Author: mir3x
Date: Sat Dec 3 00:21:56 2016
New Revision: 34683
URL: http://svn.gna.org/viewcvs/freeciv?rev=34683&view=rev
Log:
Qt client - added client options to pregame page
See patch #8041
Modified:
trunk/client/gui-qt/fc_client.cpp
trunk/client/gui-qt/fc_client.h
trunk/client/gui-qt/mapview.cpp
trunk/client/gui-qt/pages.cpp
Modified: trunk/client/gui-qt/fc_client.cpp
URL:
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/fc_client.cpp?rev=34683&r1=34682&r2=34683&view=diff
==============================================================================
--- trunk/client/gui-qt/fc_client.cpp (original)
+++ trunk/client/gui-qt/fc_client.cpp Sat Dec 3 00:21:56 2016
@@ -1034,17 +1034,26 @@
}
/****************************************************************************
+ Pregame options contructor
+****************************************************************************/
+pregame_options::pregame_options(QWidget *parent) : QWidget(parent)
+{
+}
+
+/****************************************************************************
Init's layout and default values for options in START_PAGE
****************************************************************************/
void pregame_options::init()
{
QFormLayout *layout;
+ QPushButton *qclient_options;
QHBoxLayout *hbox = nullptr;
QPushButton *but;
int level;
layout = new QFormLayout(this);
nation = new QPushButton(this);
+ qclient_options = new QPushButton(_("Client Options"));
max_players = new QSpinBox(this);
ailevel = new QComboBox(this);
cruleset = new QComboBox(this);
@@ -1053,7 +1062,8 @@
// Text and icon set by update_buttons()
connect(nation, &QPushButton::clicked,
this, &pregame_options::pick_nation);
-
+ connect(qclient_options, SIGNAL(clicked()), parentWidget(),
+ SLOT(popup_client_options()));
for (level = 0; level < AI_LEVEL_COUNT; level++) {
if (is_settable_ai_level(static_cast<ai_level>(level))) {
const char *level_name = ai_level_translated_name(
@@ -1085,6 +1095,7 @@
hbox->addWidget(ailevel);
layout->addRow(_("Players:"), hbox);
layout->addWidget(but);
+ layout->addWidget(qclient_options);
setLayout(layout);
update_buttons();
Modified: trunk/client/gui-qt/fc_client.h
URL:
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/fc_client.h?rev=34683&r1=34682&r2=34683&view=diff
==============================================================================
--- trunk/client/gui-qt/fc_client.h (original)
+++ trunk/client/gui-qt/fc_client.h Sat Dec 3 00:21:56 2016
@@ -364,7 +364,7 @@
QPushButton *nation;
QSpinBox *max_players;
public:
- pregame_options() {};
+ pregame_options(QWidget *parent);
void init();
void set_rulesets(int num_rulesets, char **rulesets);
Modified: trunk/client/gui-qt/mapview.cpp
URL:
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/mapview.cpp?rev=34683&r1=34682&r2=34683&view=diff
==============================================================================
--- trunk/client/gui-qt/mapview.cpp (original)
+++ trunk/client/gui-qt/mapview.cpp Sat Dec 3 00:21:56 2016
@@ -934,6 +934,9 @@
return;
}
update_sidebar_tooltips();
+ if (head_of_units_in_focus() != nullptr) {
+ real_menus_update();
+ }
/* TRANS: T is shortcut from Turn */
s = QString(_("%1 \nT:%2")).arg(calendar_text(),
QString::number(game.info.turn));
Modified: trunk/client/gui-qt/pages.cpp
URL:
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/pages.cpp?rev=34683&r1=34682&r2=34683&view=diff
==============================================================================
--- trunk/client/gui-qt/pages.cpp (original)
+++ trunk/client/gui-qt/pages.cpp Sat Dec 3 00:21:56 2016
@@ -615,7 +615,7 @@
up_layout = new QGridLayout;
down_layout = new QGridLayout;
start_players_tree = new QTreeWidget;
- pr_options = new pregame_options();
+ pr_options = new pregame_options(this);
chat_line = new chat_input;
chat_line->setProperty("doomchat", true);
output_window = new QTextEdit;
_______________________________________________
Freeciv-commits mailing list
[email protected]
https://mail.gna.org/listinfo/freeciv-commits