Author: mir3x
Date: Fri Oct  7 09:07:09 2016
New Revision: 34032

URL: http://svn.gna.org/viewcvs/freeciv?rev=34032&view=rev
Log:
Qt client - added goods help (Qt-client)
Submitted by Marko Lindqvist <cazfi>

See patch #7740

Modified:
    trunk/client/gui-qt/helpdlg.cpp
    trunk/client/gui-qt/helpdlg.h

Modified: trunk/client/gui-qt/helpdlg.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/helpdlg.cpp?rev=34032&r1=34031&r2=34032&view=diff
==============================================================================
--- trunk/client/gui-qt/helpdlg.cpp     (original)
+++ trunk/client/gui-qt/helpdlg.cpp     Fri Oct  7 09:07:09 2016
@@ -675,6 +675,9 @@
       break;
     case HELP_EXTRA:
       set_topic_extra(topic, title);
+      break;
+    case HELP_GOODS:
+      set_topic_goods(topic, title);
       break;
     case HELP_GOVERNMENT:
       set_topic_government(topic, title);
@@ -698,7 +701,6 @@
     case HELP_UNIT:
       set_topic_unit(topic, title);
       break;
-    case HELP_GOODS:
     case HELP_LAST: // Just to avoid warning
       break;
   }
@@ -1276,6 +1278,23 @@
   struct nation_type *pnation = nation_by_translated_plural(title);
   if (pnation) {
     helptext_nation(buffer, sizeof(buffer), pnation, topic->text);
+    text_browser->setText(buffer);
+  } else {
+    set_topic_other(topic, title);
+  }
+}
+
+/**************************************************************************
+  Creates goods help page.
+**************************************************************************/
+void help_widget::set_topic_goods(const help_item* topic,
+                                  const char* title)
+{
+  char buffer[MAX_HELP_TEXT_SIZE];
+  struct goods_type *pgood = goods_by_translated_name(title);
+  if (pgood) {
+    helptext_goods(buffer, sizeof(buffer), client.conn.playing,
+                   topic->text, pgood);
     text_browser->setText(buffer);
   } else {
     set_topic_other(topic, title);

Modified: trunk/client/gui-qt/helpdlg.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/helpdlg.h?rev=34032&r1=34031&r2=34032&view=diff
==============================================================================
--- trunk/client/gui-qt/helpdlg.h       (original)
+++ trunk/client/gui-qt/helpdlg.h       Fri Oct  7 09:07:09 2016
@@ -112,6 +112,7 @@
   void set_topic_specialist(const help_item *item, const char *title);
   void set_topic_government(const help_item *item, const char *title);
   void set_topic_nation(const help_item *item, const char *title);
+  void set_topic_goods(const help_item *item, const char *title);
 
 public:
   help_widget(QWidget *parent = 0);


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

Reply via email to