Author: jtn
Date: Tue Dec 29 01:54:58 2015
New Revision: 31257

URL: http://svn.gna.org/viewcvs/freeciv?rev=31257&view=rev
Log:
In Qt client, add tooltip and right-click help to the research report
for government types.

See gna patch #6738.

Modified:
    branches/S2_5/client/gui-qt/repodlgs.cpp
    branches/S2_5/client/gui-qt/repodlgs.h

Modified: branches/S2_5/client/gui-qt/repodlgs.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-qt/repodlgs.cpp?rev=31257&r1=31256&r2=31257&view=diff
==============================================================================
--- branches/S2_5/client/gui-qt/repodlgs.cpp    (original)
+++ branches/S2_5/client/gui-qt/repodlgs.cpp    Tue Dec 29 01:54:58 2015
@@ -202,7 +202,7 @@
                 rttp->rect = QRect(icon_startx, starty + text_h + 4
                                    + (height - text_h - 4 - sheight) / 2,
                                    swidth, sheight);
-                rttp->tech_id = node->tech;
+                rttp->tgov = gov;
                 tt_help.append(rttp);
                 icon_startx += swidth + 2;
               }
@@ -278,6 +278,9 @@
         } else if (rttp->tunit != nullptr) {
           popup_help_dialog_typed(utype_name_translation(rttp->tunit),
                                   HELP_UNIT);
+        } else if (rttp->tgov != nullptr) {
+          popup_help_dialog_typed(government_name_translation(rttp->tgov),
+                                  HELP_GOVERNMENT);
         } else {
           return;
         }
@@ -319,6 +322,13 @@
         tt_text += helptext_unit(buffer, sizeof(buffer), client.conn.playing,
                                 buf2, rttp->tunit);
         tt_text = cut_helptext(tt_text);
+      } else if (rttp->tgov != nullptr) {
+        helptext_government(buffer, sizeof(buffer), client.conn.playing,
+                            buf2, rttp->tgov);
+        tt_text = QString(buffer);
+        tt_text = cut_helptext(tt_text);
+        def_str = "<p style='white-space:pre'><b>"
+                  + QString(government_name_translation(rttp->tgov)) + 
"</b>\n";
       } else {
         return;
       }
@@ -1687,4 +1697,5 @@
     units_rep = reinterpret_cast<units_report*>(w);
     units_rep->deleteLater();
   }
-}
+
+}

Modified: branches/S2_5/client/gui-qt/repodlgs.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/client/gui-qt/repodlgs.h?rev=31257&r1=31256&r2=31257&view=diff
==============================================================================
--- branches/S2_5/client/gui-qt/repodlgs.h      (original)
+++ branches/S2_5/client/gui-qt/repodlgs.h      Tue Dec 29 01:54:58 2015
@@ -61,6 +61,7 @@
   Tech_type_id tech_id;
   struct unit_type *tunit;
   struct impr_type *timpr;
+  struct government *tgov;
 };
 /****************************************************************************
   Custom widget representing research diagram in science_report


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

Reply via email to