Clean up mcmod panel massively. Keep it simple - name (optionally linked), optional authors and description. Needs cut-off handling, frame looking at on Windows
This commit is contained in:
parent
6bc9df84d9
commit
14b47057fd
@ -92,11 +92,8 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="MCModInfoFrame" name="jarMIFrame">
|
<widget class="MCModInfoFrame" name="jarMIFrame">
|
||||||
<property name="frameShape">
|
|
||||||
<enum>QFrame::StyledPanel</enum>
|
|
||||||
</property>
|
|
||||||
<property name="frameShadow">
|
<property name="frameShadow">
|
||||||
<enum>QFrame::Raised</enum>
|
<enum>QFrame::Plain</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -23,34 +23,27 @@ void MCModInfoFrame::updateWithMod(Mod &m)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString missing = tr("Missing from mcmod.info");
|
QString text = "";
|
||||||
|
if(m.homeurl().isEmpty()) text = m.name();
|
||||||
|
else text = "<a href=\"" + m.homeurl() + "\">" + m.name() + "</a>";
|
||||||
|
if(!m.authors().isEmpty()) text += " by " + m.authors();
|
||||||
|
|
||||||
QString name = m.name();
|
setModText(text);
|
||||||
if(name.isEmpty()) name = missing;
|
|
||||||
QString description = m.description();
|
|
||||||
if(description.isEmpty()) description = missing;
|
|
||||||
QString authors = m.authors();
|
|
||||||
if(authors.isEmpty()) authors = missing;
|
|
||||||
QString credits = m.credits();
|
|
||||||
if(credits.isEmpty()) credits = missing;
|
|
||||||
QString website = m.homeurl();
|
|
||||||
if(website.isEmpty()) website = missing;
|
|
||||||
else website = "<a href=\"" + website + "\">" + website + "</a>";
|
|
||||||
|
|
||||||
setName(name);
|
if(m.description().isEmpty())
|
||||||
setDescription(description);
|
{
|
||||||
setAuthors(authors);
|
setModDescription(tr("No description provided in mcmod.info"));
|
||||||
setCredits(credits);
|
}
|
||||||
setWebsite(website);
|
else
|
||||||
|
{
|
||||||
|
setModDescription(m.description());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCModInfoFrame::clear()
|
void MCModInfoFrame::clear()
|
||||||
{
|
{
|
||||||
setName(tr("Select a mod to view information..."));
|
setModText(tr("Select a mod to view title and authors..."));
|
||||||
setDescription(tr("Mod description"));
|
setModDescription(tr("Select a mod to view description..."));
|
||||||
setAuthors(tr("Mod authors"));
|
|
||||||
setCredits(tr("Mod credits"));
|
|
||||||
setWebsite(tr("Mod website"));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MCModInfoFrame::MCModInfoFrame(QWidget *parent) :
|
MCModInfoFrame::MCModInfoFrame(QWidget *parent) :
|
||||||
@ -65,31 +58,12 @@ MCModInfoFrame::~MCModInfoFrame()
|
|||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCModInfoFrame::setName(QString name)
|
void MCModInfoFrame::setModText(QString text)
|
||||||
{
|
{
|
||||||
ui->label_Name->setText(name);
|
ui->label_ModText->setText(text);
|
||||||
//ui->label_Name->setToolTip(name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MCModInfoFrame::setDescription(QString description)
|
void MCModInfoFrame::setModDescription(QString text)
|
||||||
{
|
{
|
||||||
ui->label_Description->setText(description);
|
ui->label_ModDescription->setText(text);
|
||||||
//ui->label_Description->setToolTip(description);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MCModInfoFrame::setAuthors(QString authors)
|
|
||||||
{
|
|
||||||
ui->label_Authors->setText(authors);
|
|
||||||
//ui->label_Authors->setToolTip(authors);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MCModInfoFrame::setCredits(QString credits)
|
|
||||||
{
|
|
||||||
ui->label_Credits->setText(credits);
|
|
||||||
//ui->label_Credits->setToolTip(credits);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MCModInfoFrame::setWebsite(QString website)
|
|
||||||
{
|
|
||||||
ui->label_Website->setText(website);
|
|
||||||
}
|
}
|
||||||
|
@ -31,11 +31,8 @@ public:
|
|||||||
explicit MCModInfoFrame(QWidget *parent = 0);
|
explicit MCModInfoFrame(QWidget *parent = 0);
|
||||||
~MCModInfoFrame();
|
~MCModInfoFrame();
|
||||||
|
|
||||||
void setName(QString name);
|
void setModText(QString text);
|
||||||
void setDescription(QString description);
|
void setModDescription(QString text);
|
||||||
void setAuthors(QString authors);
|
|
||||||
void setCredits(QString credits);
|
|
||||||
void setWebsite(QString website);
|
|
||||||
|
|
||||||
void updateWithMod(Mod &m);
|
void updateWithMod(Mod &m);
|
||||||
void clear();
|
void clear();
|
||||||
|
@ -2,202 +2,76 @@
|
|||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>MCModInfoFrame</class>
|
<class>MCModInfoFrame</class>
|
||||||
<widget class="QFrame" name="MCModInfoFrame">
|
<widget class="QFrame" name="MCModInfoFrame">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>527</width>
|
||||||
|
<height>68</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>120</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Frame</string>
|
<string>Frame</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<widget class="QLabel" name="label_ModText">
|
||||||
<item>
|
<property name="sizePolicy">
|
||||||
<widget class="QLabel" name="label_Name">
|
<sizepolicy hsizetype="Expanding" vsizetype="Minimum">
|
||||||
<property name="sizePolicy">
|
<horstretch>0</horstretch>
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
<verstretch>0</verstretch>
|
||||||
<horstretch>0</horstretch>
|
</sizepolicy>
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>250</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>92</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="font">
|
|
||||||
<font>
|
|
||||||
<weight>75</weight>
|
|
||||||
<bold>true</bold>
|
|
||||||
</font>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Select a mod to view information...</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QLabel" name="label_Description">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>250</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>92</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Mod description</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QFormLayout" name="formLayout">
|
|
||||||
<property name="sizeConstraint">
|
|
||||||
<enum>QLayout::SetDefaultConstraint</enum>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="fieldGrowthPolicy">
|
<property name="text">
|
||||||
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
|
<string>Select a mod to view title and authors...</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="labelAlignment">
|
<property name="textFormat">
|
||||||
|
<enum>Qt::RichText</enum>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0">
|
<property name="wordWrap">
|
||||||
<widget class="QLabel" name="label_2">
|
<bool>true</bool>
|
||||||
<property name="text">
|
</property>
|
||||||
<string>Authors:</string>
|
<property name="openExternalLinks">
|
||||||
</property>
|
<bool>true</bool>
|
||||||
<property name="alignment">
|
</property>
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
</widget>
|
||||||
</property>
|
</item>
|
||||||
</widget>
|
<item>
|
||||||
</item>
|
<widget class="QLabel" name="label_ModDescription">
|
||||||
<item row="0" column="1">
|
<property name="sizePolicy">
|
||||||
<widget class="QLabel" name="label_Authors">
|
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||||
<property name="minimumSize">
|
<horstretch>0</horstretch>
|
||||||
<size>
|
<verstretch>0</verstretch>
|
||||||
<width>200</width>
|
</sizepolicy>
|
||||||
<height>0</height>
|
</property>
|
||||||
</size>
|
<property name="text">
|
||||||
</property>
|
<string>Select a mod to view description...</string>
|
||||||
<property name="maximumSize">
|
</property>
|
||||||
<size>
|
<property name="textFormat">
|
||||||
<width>16777215</width>
|
<enum>Qt::PlainText</enum>
|
||||||
<height>92</height>
|
</property>
|
||||||
</size>
|
<property name="alignment">
|
||||||
</property>
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||||
<property name="text">
|
</property>
|
||||||
<string>Mod authors</string>
|
<property name="wordWrap">
|
||||||
</property>
|
<bool>true</bool>
|
||||||
<property name="alignment">
|
</property>
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
</widget>
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="label_4">
|
|
||||||
<property name="text">
|
|
||||||
<string>Website:</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QLabel" name="label_Website">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>200</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>92</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Mod website</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<property name="openExternalLinks">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="1">
|
|
||||||
<widget class="QLabel" name="label_Credits">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>200</width>
|
|
||||||
<height>0</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>16777215</width>
|
|
||||||
<height>92</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Mod credits</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
|
||||||
</property>
|
|
||||||
<property name="wordWrap">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="label_3">
|
|
||||||
<property name="text">
|
|
||||||
<string>Credits:</string>
|
|
||||||
</property>
|
|
||||||
<property name="alignment">
|
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -222,11 +222,11 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="MCModInfoFrame" name="frame">
|
<widget class="MCModInfoFrame" name="frame">
|
||||||
<property name="frameShape">
|
<property name="sizePolicy">
|
||||||
<enum>QFrame::StyledPanel</enum>
|
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||||
</property>
|
<horstretch>0</horstretch>
|
||||||
<property name="frameShadow">
|
<verstretch>0</verstretch>
|
||||||
<enum>QFrame::Raised</enum>
|
</sizepolicy>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
Loading…
Reference in New Issue
Block a user