Author: mir3x
Date: Sun Nov  6 22:10:30 2016
New Revision: 34412

URL: http://svn.gna.org/viewcvs/freeciv?rev=34412&view=rev
Log:
Qt client - added endgame report to menu

See patch #7934

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

Modified: branches/S2_6/client/gui-qt/menu.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/menu.cpp?rev=34412&r1=34411&r2=34412&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/menu.cpp        (original)
+++ branches/S2_6/client/gui-qt/menu.cpp        Sun Nov  6 22:10:30 2016
@@ -532,7 +532,7 @@
 **************************************************************************/
 void real_menus_update(void)
 {
-  if (C_S_RUNNING == client_state()) {
+  if (C_S_RUNNING <= client_state()) {
     gui()->menuBar()->setVisible(true);
     gui()->menu_bar->menus_sensitive();
     gui()->menu_bar->update_airlift_menu();
@@ -1277,6 +1277,10 @@
   act = menu->addAction(_("Achievements"));
   connect(act, SIGNAL(triggered()), this, SLOT(slot_achievements()));
 
+  act = menu->addAction(_("Endgame report"));
+  menu_list.insertMulti(ENDGAME, act);
+  connect(act, SIGNAL(triggered()), this, SLOT(slot_endgame()));
+
   /* Help Menu */
   menu = this->addMenu(_("Help"));
 
@@ -1551,6 +1555,14 @@
         break;
       case MULTIPLIERS:
         if (client_is_observer() == false && multiplier_count() > 0) {
+          i.value()->setEnabled(true);
+          i.value()->setVisible(true);
+        } else {
+          i.value()->setVisible(false);
+        }
+        break;
+      case ENDGAME:
+        if (gui()->is_repo_dlg_open("END")) {
           i.value()->setEnabled(true);
           i.value()->setVisible(true);
         } else {
@@ -2675,6 +2687,15 @@
 }
 
 /****************************************************************
+  Action "SHOW ENDGAME REPORT"
+*****************************************************************/
+void mr_menu::slot_endgame()
+{
+  popup_endgame_report();
+}
+
+
+/****************************************************************
   Action "SHOW TOP FIVE CITIES"
 *****************************************************************/
 void mr_menu::slot_top_five()

Modified: branches/S2_6/client/gui-qt/menu.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/menu.h?rev=34412&r1=34411&r2=34412&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/menu.h  (original)
+++ branches/S2_6/client/gui-qt/menu.h  Sun Nov  6 22:10:30 2016
@@ -74,6 +74,7 @@
   GO_AND_BUILD_CITY,
   NOT_4_OBS,
   MULTIPLIERS,
+  ENDGAME,
   SAVE
 };
 
@@ -384,6 +385,7 @@
   void slot_spaceship();
   void slot_demographics();
   void slot_achievements();
+  void slot_endgame();
   void slot_top_five();
   void slot_traveler();
 

Modified: branches/S2_6/client/gui-qt/repodlgs.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/repodlgs.cpp?rev=34412&r1=34411&r2=34412&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/repodlgs.cpp    (original)
+++ branches/S2_6/client/gui-qt/repodlgs.cpp    Sun Nov  6 22:10:30 2016
@@ -1649,6 +1649,18 @@
 }
 
 /****************************************************************************
+  Popups endgame report to front if exists
+****************************************************************************/
+void popup_endgame_report()
+{
+  int i;
+  if (gui()->is_repo_dlg_open("END")) {
+    i = gui()->gimme_index_of("END");
+    gui()->game_tab_widget->setCurrentIndex(i);
+  }
+}
+
+/****************************************************************************
   Received endgame report information about single player.
 ****************************************************************************/
 void endgame_report_dialog_player(const struct packet_endgame_player *packet)

Modified: branches/S2_6/client/gui-qt/repodlgs.h
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/repodlgs.h?rev=34412&r1=34411&r2=34412&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/repodlgs.h      (original)
+++ branches/S2_6/client/gui-qt/repodlgs.h      Sun Nov  6 22:10:30 2016
@@ -220,5 +220,6 @@
 void popdown_units_report();
 void popdown_science_report();
 void popdown_endgame_report();
+void popup_endgame_report();
 
 #endif /* FC__REPODLGS_H */


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

Reply via email to