Author: mir3x
Date: Thu Jul 28 17:35:45 2016
New Revision: 33352

URL: http://svn.gna.org/viewcvs/freeciv?rev=33352&view=rev
Log:
Qt client - Show scenario authors field in scenario selection page
Reported by Marko Lindqvist <cazfi>

See patch #7330


Modified:
    trunk/client/gui-qt/pages.cpp

Modified: trunk/client/gui-qt/pages.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/pages.cpp?rev=33352&r1=33351&r2=33352&view=diff
==============================================================================
--- trunk/client/gui-qt/pages.cpp       (original)
+++ trunk/client/gui-qt/pages.cpp       Thu Jul 28 17:35:45 2016
@@ -472,6 +472,8 @@
   scenarios_load = new QTableWidget;
   scenarios_view = new QTextEdit;
   scenarios_text = new QLabel;
+  scenarios_text->setTextFormat(Qt::RichText);
+  scenarios_text->setWordWrap(true);
   QStringList sav;
   sav << _("Choose a Scenario");
   scenarios_load->setRowCount(0);
@@ -1103,21 +1105,33 @@
     if ((sf = secfile_load_section(pfile->fullname, "scenario", TRUE))
         && secfile_lookup_bool_default(sf, TRUE, "scenario.is_scenario")) {
 
-      const char *sname, *sdescription;
+      const char *sname, *sdescription, *sauthors;
       QTableWidgetItem *item;
       QString str = QString(pfile->name);
+      QString st;
       QStringList sl;
 
       sname = secfile_lookup_str_default(sf, NULL, "scenario.name");
       sdescription = secfile_lookup_str_default(sf, NULL,
                                               "scenario.description");
+      sauthors = secfile_lookup_str_default(sf, NULL,
+                                              "scenario.authors");
       item = new QTableWidgetItem();
       scenarios_load->insertRow(row);
       item->setText(pfile->name);
-      sl << (sname && strlen(sname) ? Q_(sname) : pfile->name)
+      if (sauthors) {
+        st = QString("\n") + QString("<b>") + _("Authors: ")
+             + QString("</b>") + QString(sauthors);
+      } else {
+        st = "";
+      }
+      sl << "<b>"
+         + QString(sname && strlen(sname) ? Q_(sname) : pfile->name)
+         + "</b>"
          << pfile->fullname
-         << (NULL != sdescription && '\0' != sdescription[0]
-             ? Q_(sdescription) : "");
+         << QString(NULL != sdescription && '\0' != sdescription[0]
+                    ? Q_(sdescription) : "") + st;
+      sl.replaceInStrings("\n", "<br>");
       item->setData(Qt::UserRole, sl);
       scenarios_load->setItem(row, 0, item);
       row++;


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to