diff options
-rw-r--r-- | gui/LegacyModEditDialog.ui | 5 | ||||
-rw-r--r-- | gui/MCModInfoFrame.cpp | 64 | ||||
-rw-r--r-- | gui/MCModInfoFrame.h | 7 | ||||
-rw-r--r-- | gui/MCModInfoFrame.ui | 246 | ||||
-rw-r--r-- | gui/OneSixModEditDialog.ui | 10 |
5 files changed, 87 insertions, 245 deletions
diff --git a/gui/LegacyModEditDialog.ui b/gui/LegacyModEditDialog.ui index 3ab946d9..bb0d9ef2 100644 --- a/gui/LegacyModEditDialog.ui +++ b/gui/LegacyModEditDialog.ui @@ -92,11 +92,8 @@ </item> <item> <widget class="MCModInfoFrame" name="jarMIFrame"> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> <property name="frameShadow"> - <enum>QFrame::Raised</enum> + <enum>QFrame::Plain</enum> </property> </widget> </item> diff --git a/gui/MCModInfoFrame.cpp b/gui/MCModInfoFrame.cpp index 15ead7ab..a0458cbc 100644 --- a/gui/MCModInfoFrame.cpp +++ b/gui/MCModInfoFrame.cpp @@ -23,34 +23,27 @@ void MCModInfoFrame::updateWithMod(Mod &m) 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(); - 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>"; + setModText(text); - setName(name); - setDescription(description); - setAuthors(authors); - setCredits(credits); - setWebsite(website); + if(m.description().isEmpty()) + { + setModDescription(tr("No description provided in mcmod.info")); + } + else + { + setModDescription(m.description()); + } } void MCModInfoFrame::clear() { - setName(tr("Select a mod to view information...")); - setDescription(tr("Mod description")); - setAuthors(tr("Mod authors")); - setCredits(tr("Mod credits")); - setWebsite(tr("Mod website")); + setModText(tr("Select a mod to view title and authors...")); + setModDescription(tr("Select a mod to view description...")); } MCModInfoFrame::MCModInfoFrame(QWidget *parent) : @@ -65,31 +58,12 @@ MCModInfoFrame::~MCModInfoFrame() delete ui; } -void MCModInfoFrame::setName(QString name) -{ - ui->label_Name->setText(name); - //ui->label_Name->setToolTip(name); -} - -void MCModInfoFrame::setDescription(QString description) -{ - ui->label_Description->setText(description); - //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) +void MCModInfoFrame::setModText(QString text) { - ui->label_Credits->setText(credits); - //ui->label_Credits->setToolTip(credits); + ui->label_ModText->setText(text); } -void MCModInfoFrame::setWebsite(QString website) +void MCModInfoFrame::setModDescription(QString text) { - ui->label_Website->setText(website); + ui->label_ModDescription->setText(text); } diff --git a/gui/MCModInfoFrame.h b/gui/MCModInfoFrame.h index 01812df7..cdf399cb 100644 --- a/gui/MCModInfoFrame.h +++ b/gui/MCModInfoFrame.h @@ -31,11 +31,8 @@ public: explicit MCModInfoFrame(QWidget *parent = 0); ~MCModInfoFrame(); - void setName(QString name); - void setDescription(QString description); - void setAuthors(QString authors); - void setCredits(QString credits); - void setWebsite(QString website); + void setModText(QString text); + void setModDescription(QString text); void updateWithMod(Mod &m); void clear(); diff --git a/gui/MCModInfoFrame.ui b/gui/MCModInfoFrame.ui index 41902c1a..b24251ae 100644 --- a/gui/MCModInfoFrame.ui +++ b/gui/MCModInfoFrame.ui @@ -2,202 +2,76 @@ <ui version="4.0"> <class>MCModInfoFrame</class> <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"> <string>Frame</string> </property> - <layout class="QHBoxLayout" name="horizontalLayout"> + <layout class="QVBoxLayout" name="verticalLayout_2"> <item> - <layout class="QVBoxLayout" name="verticalLayout"> - <item> - <widget class="QLabel" name="label_Name"> - <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="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> + <widget class="QLabel" name="label_ModText"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Expanding" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Select a mod to view title and authors...</string> + </property> + <property name="textFormat"> + <enum>Qt::RichText</enum> + </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> - <layout class="QFormLayout" name="formLayout"> - <property name="sizeConstraint"> - <enum>QLayout::SetDefaultConstraint</enum> + <widget class="QLabel" name="label_ModDescription"> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="text"> + <string>Select a mod to view description...</string> </property> - <property name="fieldGrowthPolicy"> - <enum>QFormLayout::AllNonFixedFieldsGrow</enum> + <property name="textFormat"> + <enum>Qt::PlainText</enum> </property> - <property name="labelAlignment"> + <property name="alignment"> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> </property> - <item row="0" column="0"> - <widget class="QLabel" name="label_2"> - <property name="text"> - <string>Authors:</string> - </property> - <property name="alignment"> - <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> - </property> - </widget> - </item> - <item row="0" column="1"> - <widget class="QLabel" name="label_Authors"> - <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 authors</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="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> + <property name="wordWrap"> + <bool>true</bool> + </property> + </widget> </item> </layout> </widget> diff --git a/gui/OneSixModEditDialog.ui b/gui/OneSixModEditDialog.ui index 675a6faa..6d70200a 100644 --- a/gui/OneSixModEditDialog.ui +++ b/gui/OneSixModEditDialog.ui @@ -222,11 +222,11 @@ </item> <item> <widget class="MCModInfoFrame" name="frame"> - <property name="frameShape"> - <enum>QFrame::StyledPanel</enum> - </property> - <property name="frameShadow"> - <enum>QFrame::Raised</enum> + <property name="sizePolicy"> + <sizepolicy hsizetype="Preferred" vsizetype="Minimum"> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> </property> </widget> </item> |