Author: mir3x Date: Sun Nov 6 22:10:41 2016 New Revision: 34413 URL: http://svn.gna.org/viewcvs/freeciv?rev=34413&view=rev Log: Qt client - added endgame report to menu
See patch #7934 Modified: trunk/client/gui-qt/menu.cpp trunk/client/gui-qt/menu.h trunk/client/gui-qt/repodlgs.cpp trunk/client/gui-qt/repodlgs.h Modified: trunk/client/gui-qt/menu.cpp URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/menu.cpp?rev=34413&r1=34412&r2=34413&view=diff ============================================================================== --- trunk/client/gui-qt/menu.cpp (original) +++ trunk/client/gui-qt/menu.cpp Sun Nov 6 22:10:41 2016 @@ -535,7 +535,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(); @@ -1460,6 +1460,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")); @@ -1734,6 +1738,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 { @@ -2871,6 +2883,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: trunk/client/gui-qt/menu.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/menu.h?rev=34413&r1=34412&r2=34413&view=diff ============================================================================== --- trunk/client/gui-qt/menu.h (original) +++ trunk/client/gui-qt/menu.h Sun Nov 6 22:10:41 2016 @@ -75,6 +75,7 @@ GO_AND_BUILD_CITY, NOT_4_OBS, MULTIPLIERS, + ENDGAME, SAVE }; @@ -412,6 +413,7 @@ void slot_spaceship(); void slot_demographics(); void slot_achievements(); + void slot_endgame(); void slot_top_five(); void slot_traveler(); Modified: trunk/client/gui-qt/repodlgs.cpp URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/repodlgs.cpp?rev=34413&r1=34412&r2=34413&view=diff ============================================================================== --- trunk/client/gui-qt/repodlgs.cpp (original) +++ trunk/client/gui-qt/repodlgs.cpp Sun Nov 6 22:10:41 2016 @@ -1646,6 +1646,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: trunk/client/gui-qt/repodlgs.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/repodlgs.h?rev=34413&r1=34412&r2=34413&view=diff ============================================================================== --- trunk/client/gui-qt/repodlgs.h (original) +++ trunk/client/gui-qt/repodlgs.h Sun Nov 6 22:10:41 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