[Freeciv-commits] r34103 - in /branches/S2_6: client/gui-qt/ data/themes/gui-qt/Classic/ data/themes/gui-qt/Necrophos/ data/themes/gui-qt/Nigh...
Author: mir3x Date: Wed Oct 12 08:26:30 2016 New Revision: 34103 URL: http://svn.gna.org/viewcvs/freeciv?rev=34103&view=rev Log: Qt client - replaced QInputDialog with custom dialog See patch #7812 Modified: branches/S2_6/client/gui-qt/citydlg.cpp branches/S2_6/client/gui-qt/hudwidget.cpp branches/S2_6/client/gui-qt/hudwidget.h branches/S2_6/client/gui-qt/mapctrl.cpp branches/S2_6/data/themes/gui-qt/Classic/resource.qss branches/S2_6/data/themes/gui-qt/Necrophos/resource.qss branches/S2_6/data/themes/gui-qt/NightStalker/resource.qss Modified: branches/S2_6/client/gui-qt/citydlg.cpp URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/citydlg.cpp?rev=34103&r1=34102&r2=34103&view=diff == --- branches/S2_6/client/gui-qt/citydlg.cpp (original) +++ branches/S2_6/client/gui-qt/citydlg.cpp Wed Oct 12 08:26:30 2016 @@ -19,7 +19,6 @@ #include #include #include -#include #include #include #include @@ -1872,15 +1871,12 @@ / void city_dialog::city_rename() { - bool ok; - QString text = QInputDialog::getText(this, - _("Rename City"), - _("What should we rename the city to?"), - QLineEdit::Normal, - city_name_get(pcity), &ok); - - if (ok && !text.isEmpty()) { -::city_rename(pcity, text.toLocal8Bit().data()); + hud_input_box ask(gui()->central_wdg); + + ask.set_text_title_definput(_("What should we rename the city to?"), + _("Rename City"), city_name_get(pcity)); + if (ask.exec() == QDialog::Accepted) { +::city_rename(pcity, ask.input_edit.text().toLocal8Bit().data()); } } @@ -1890,26 +1886,28 @@ void city_dialog::save_cma() { struct cm_parameter param; - bool ok; - QString text = QInputDialog::getText(this, - _("Name new preset"), - _("What should we name the preset?"), - QLineEdit::Normal, - _("new preset"), &ok); - - if (ok && !text.isEmpty()) { -param.allow_disorder = false; -param.allow_specialists = true; -param.require_happy = cma_celeb_checkbox->isChecked(); -param.happy_factor = slider_tab[2 * O_LAST + 1]->value(); - -for (int i = O_FOOD; i < O_LAST; i++) { - param.minimal_surplus[i] = slider_tab[2 * i]->value(); - param.factor[i] = slider_tab[2 * i + 1]->value(); -} - -cmafec_preset_add(text.toLocal8Bit().data(), ¶m); -update_cma_tab(); + QString text; + hud_input_box ask(gui()->central_wdg); + + ask.set_text_title_definput(_("What should we name the preset?"), + _("Name new preset"), + _("new preset")); + if (ask.exec() == QDialog::Accepted) { +text = ask.input_edit.text().toLocal8Bit().data(); +if (!text.isEmpty()) { + param.allow_disorder = false; + param.allow_specialists = true; + param.require_happy = cma_celeb_checkbox->isChecked(); + param.happy_factor = slider_tab[2 * O_LAST + 1]->value(); + + for (int i = O_FOOD; i < O_LAST; i++) { +param.minimal_surplus[i] = slider_tab[2 * i]->value(); +param.factor[i] = slider_tab[2 * i + 1]->value(); + } + + cmafec_preset_add(text.toLocal8Bit().data(), ¶m); + update_cma_tab(); +} } } @@ -3142,17 +3140,19 @@ { struct worklist queue; struct global_worklist *gw; - bool ok; - QString text = QInputDialog::getText(this, - _("Save current worklist"), - _("What should we name new worklist?"), - QLineEdit::Normal, - _("New worklist"), &ok); - - if (ok && !text.isEmpty()) { -gw = global_worklist_new(text.toLocal8Bit().data()); -city_get_queue(pcity, &queue); -global_worklist_set(gw, &queue); + QString text; + hud_input_box ask(gui()->central_wdg); + + ask.set_text_title_definput(_("What should we name new worklist?"), + _("Save current worklist"), + _("New worklist")); + if (ask.exec() == QDialog::Accepted) { +text = ask.input_edit.text().toLocal8Bit().data(); +if (!text.isEmpty()) { + gw = global_worklist_new(text.toLocal8Bit().data()); + city_get_queue(pcity, &queue); + global_worklist_set(gw, &queue); +} } } Modified: branches/S2_6/client/gui-qt/hudwidget.cpp URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/hudwidget.cpp?rev=34103&r1=34102&r2=34103&view=diff == -
[Freeciv-commits] r34102 - in /branches/S2_6/client: client_main.c options.c options.h tilespec.c tilespec.h
Author: cazfi Date: Wed Oct 12 02:29:31 2016 New Revision: 34102 URL: http://svn.gna.org/viewcvs/freeciv?rev=34102&view=rev Log: Fill initial default for tileset option for all topologies. See patch #6875 Modified: branches/S2_6/client/client_main.c branches/S2_6/client/options.c branches/S2_6/client/options.h branches/S2_6/client/tilespec.c branches/S2_6/client/tilespec.h Modified: branches/S2_6/client/client_main.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/client_main.c?rev=34102&r1=34101&r2=34102&view=diff == --- branches/S2_6/client/client_main.c (original) +++ branches/S2_6/client/client_main.c Wed Oct 12 02:29:31 2016 @@ -662,10 +662,12 @@ helpdata_init(); boot_help_texts(); + fill_topo_ts_default(); + if (forced_tileset_name[0] != '\0') { -tilespec_try_read(forced_tileset_name, TRUE); +tilespec_try_read(forced_tileset_name, TRUE, -1, TRUE); } else { -tilespec_try_read(gui_options.default_tileset_name, FALSE); +tilespec_try_read(gui_options.default_tileset_name, FALSE, -1, TRUE); } audio_real_init(sound_set_name, music_set_name, sound_plugin_name); Modified: branches/S2_6/client/options.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/options.c?rev=34102&r1=34101&r2=34102&view=diff == --- branches/S2_6/client/options.c (original) +++ branches/S2_6/client/options.c Wed Oct 12 02:29:31 2016 @@ -6278,3 +6278,49 @@ opt->str_vtable->set(opt, tileset_basename(t)); option_gui_update(opt); } + +/ + Does topology-specific tileset option lack value? +/ +static bool is_ts_option_unset(const char *optname) +{ + struct option *opt; + const char *val; + + opt = optset_option_by_name(client_optset, optname); + + if (opt == NULL) { +return TRUE; + } + + val = opt->str_vtable->get(opt); + + if (val == NULL || val[0] == '\0') { +return TRUE; + } + + return FALSE; +} + +/ + Fill default tilesets for topology-specific settings. +/ +void fill_topo_ts_default(void) +{ + if (is_ts_option_unset("default_tileset_overhead_name")) { +log_debug("Setting tileset for overhead topology."); +tilespec_try_read(NULL, FALSE, 0, FALSE); + } + if (is_ts_option_unset("default_tileset_iso_name")) { +log_debug("Setting tileset for iso topology."); +tilespec_try_read(NULL, FALSE, TF_ISO, FALSE); + } + if (is_ts_option_unset("default_tileset_hex_name")) { +log_debug("Setting tileset for hex topology."); +tilespec_try_read(NULL, FALSE, TF_HEX, FALSE); + } + if (is_ts_option_unset("default_tileset_isohex_name")) { +log_debug("Setting tileset for isohex topology."); +tilespec_try_read(NULL, FALSE, TF_ISO | TF_HEX, FALSE); + } +} Modified: branches/S2_6/client/options.h URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/options.h?rev=34102&r1=34101&r2=34102&view=diff == --- branches/S2_6/client/options.h (original) +++ branches/S2_6/client/options.h Wed Oct 12 02:29:31 2016 @@ -565,6 +565,7 @@ const char *tileset_name_for_topology(int topology_id); void option_set_default_ts(struct tileset *t); +void fill_topo_ts_default(void); #ifdef __cplusplus } Modified: branches/S2_6/client/tilespec.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/tilespec.c?rev=34102&r1=34101&r2=34102&view=diff == --- branches/S2_6/client/tilespec.c (original) +++ branches/S2_6/client/tilespec.c Wed Oct 12 02:29:31 2016 @@ -967,7 +967,7 @@ return is_valid_tileset_dir(t, dir); } else { return (dir == DIR8_NORTH || dir == DIR8_EAST - || dir == DIR8_SOUTH || dir == DIR8_WEST); +|| dir == DIR8_SOUTH || dir == DIR8_WEST); } } @@ -979,14 +979,15 @@ { int idx; - if (actual_topology & TF_ISO) { + if ((actual_topology & TF_HEX) + && (actual_topology & TF_ISO)) { +idx = TS_TOPO_ISOHEX; + } else if (actual_topology & TF_ISO) { idx = TS_TOPO_ISO; + } else if (actual_topology & TF_HEX) { +idx = TS_TOPO_HEX; } else { -idx = 0; - } - - if (actual_topology & TF_HEX) { -idx |= TS_TOPO_HEX; +idx = TS_TOPO_OVERHEAD; } return idx; @@ -1187,18 +1188,22 @@ Call this function with the (guessed) name of the tileset, when starting the client. ***/ -void tilespec_try_read(const char *tileset_name, bool verbose
[Freeciv-commits] r34101 - in /trunk/client: client_main.c options.c options.h tilespec.c tilespec.h
Author: cazfi Date: Wed Oct 12 02:29:23 2016 New Revision: 34101 URL: http://svn.gna.org/viewcvs/freeciv?rev=34101&view=rev Log: Fill initial default for tileset option for all topologies. See patch #6875 Modified: trunk/client/client_main.c trunk/client/options.c trunk/client/options.h trunk/client/tilespec.c trunk/client/tilespec.h Modified: trunk/client/client_main.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/client_main.c?rev=34101&r1=34100&r2=34101&view=diff == --- trunk/client/client_main.c (original) +++ trunk/client/client_main.c Wed Oct 12 02:29:23 2016 @@ -662,10 +662,12 @@ helpdata_init(); boot_help_texts(); + fill_topo_ts_default(); + if (forced_tileset_name[0] != '\0') { -tilespec_try_read(forced_tileset_name, TRUE); +tilespec_try_read(forced_tileset_name, TRUE, -1, TRUE); } else { -tilespec_try_read(gui_options.default_tileset_name, FALSE); +tilespec_try_read(gui_options.default_tileset_name, FALSE, -1, TRUE); } audio_real_init(sound_set_name, music_set_name, sound_plugin_name); Modified: trunk/client/options.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/options.c?rev=34101&r1=34100&r2=34101&view=diff == --- trunk/client/options.c (original) +++ trunk/client/options.c Wed Oct 12 02:29:23 2016 @@ -6296,3 +6296,49 @@ opt->str_vtable->set(opt, tileset_basename(t)); option_gui_update(opt); } + +/ + Does topology-specific tileset option lack value? +/ +static bool is_ts_option_unset(const char *optname) +{ + struct option *opt; + const char *val; + + opt = optset_option_by_name(client_optset, optname); + + if (opt == NULL) { +return TRUE; + } + + val = opt->str_vtable->get(opt); + + if (val == NULL || val[0] == '\0') { +return TRUE; + } + + return FALSE; +} + +/ + Fill default tilesets for topology-specific settings. +/ +void fill_topo_ts_default(void) +{ + if (is_ts_option_unset("default_tileset_overhead_name")) { +log_debug("Setting tileset for overhead topology."); +tilespec_try_read(NULL, FALSE, 0, FALSE); + } + if (is_ts_option_unset("default_tileset_iso_name")) { +log_debug("Setting tileset for iso topology."); +tilespec_try_read(NULL, FALSE, TF_ISO, FALSE); + } + if (is_ts_option_unset("default_tileset_hex_name")) { +log_debug("Setting tileset for hex topology."); +tilespec_try_read(NULL, FALSE, TF_HEX, FALSE); + } + if (is_ts_option_unset("default_tileset_isohex_name")) { +log_debug("Setting tileset for isohex topology."); +tilespec_try_read(NULL, FALSE, TF_ISO | TF_HEX, FALSE); + } +} Modified: trunk/client/options.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/options.h?rev=34101&r1=34100&r2=34101&view=diff == --- trunk/client/options.h (original) +++ trunk/client/options.h Wed Oct 12 02:29:23 2016 @@ -566,6 +566,7 @@ const char *tileset_name_for_topology(int topology_id); void option_set_default_ts(struct tileset *t); +void fill_topo_ts_default(void); #ifdef __cplusplus } Modified: trunk/client/tilespec.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/client/tilespec.c?rev=34101&r1=34100&r2=34101&view=diff == --- trunk/client/tilespec.c (original) +++ trunk/client/tilespec.c Wed Oct 12 02:29:23 2016 @@ -980,7 +980,7 @@ return is_valid_tileset_dir(t, dir); } else { return (dir == DIR8_NORTH || dir == DIR8_EAST - || dir == DIR8_SOUTH || dir == DIR8_WEST); +|| dir == DIR8_SOUTH || dir == DIR8_WEST); } } @@ -992,14 +992,15 @@ { int idx; - if (actual_topology & TF_ISO) { + if ((actual_topology & TF_HEX) + && (actual_topology & TF_ISO)) { +idx = TS_TOPO_ISOHEX; + } else if (actual_topology & TF_ISO) { idx = TS_TOPO_ISO; + } else if (actual_topology & TF_HEX) { +idx = TS_TOPO_HEX; } else { -idx = 0; - } - - if (actual_topology & TF_HEX) { -idx |= TS_TOPO_HEX; +idx = TS_TOPO_OVERHEAD; } return idx; @@ -1200,18 +1201,22 @@ Call this function with the (guessed) name of the tileset, when starting the client. ***/ -void tilespec_try_read(const char *tileset_name, bool verbose) -{ - if (!(tileset = tileset_read_toplevel(tileset_name, verbose, -1))) { +void tilespec_try_read(const char *tileset_name, bool verbose, int topo_id, +
[Freeciv-commits] r34100 - in /branches/S2_6: client/gui-gtk-3.22/menu.c data/gtk3.22_menus.xml
Author: cazfi Date: Tue Oct 11 21:30:46 2016 New Revision: 34100 URL: http://svn.gna.org/viewcvs/freeciv?rev=34100&view=rev Log: Use gtk_builder instead of gtk_ui_manager in gtk3.22-client See patch #7771 Modified: branches/S2_6/client/gui-gtk-3.22/menu.c branches/S2_6/data/gtk3.22_menus.xml [This mail would be too long, it was shortened to contain the URLs only.] Modified: branches/S2_6/client/gui-gtk-3.22/menu.c URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-gtk-3.22/menu.c?rev=34100&r1=34099&r2=34100&view=diff Modified: branches/S2_6/data/gtk3.22_menus.xml URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/data/gtk3.22_menus.xml?rev=34100&r1=34099&r2=34100&view=diff ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r34099 - in /trunk: Makefile.am m4/gtk3x-client.m4
Author: cazfi Date: Tue Oct 11 21:25:36 2016 New Revision: 34099 URL: http://svn.gna.org/viewcvs/freeciv?rev=34099&view=rev Log: Added gtk3x-client.m4 See patch #7799 Added: trunk/m4/gtk3x-client.m4 Modified: trunk/Makefile.am Modified: trunk/Makefile.am URL: http://svn.gna.org/viewcvs/freeciv/trunk/Makefile.am?rev=34099&r1=34098&r2=34099&view=diff == --- trunk/Makefile.am (original) +++ trunk/Makefile.am Tue Oct 11 21:25:36 2016 @@ -51,6 +51,7 @@ m4/gtk2-client.m4 \ m4/gtk3-client.m4 \ m4/gtk3.22-client.m4\ + m4/gtk3x-client.m4 \ m4/iconv.m4 \ m4/intlmacosx.m4\ m4/lib-ld.m4\ Added: trunk/m4/gtk3x-client.m4 URL: http://svn.gna.org/viewcvs/freeciv/trunk/m4/gtk3x-client.m4?rev=34099&view=auto == --- trunk/m4/gtk3x-client.m4(added) +++ trunk/m4/gtk3x-client.m4Tue Oct 11 21:25:36 2016 @@ -0,0 +1,31 @@ +# Try to configure the GTK+-3.x client (gui-gtk-3.9x) + +# FC_GTK3X_CLIENT +# Test for GTK+-3.90 libraries needed for gui-gtk-3.9x + +AC_DEFUN([FC_GTK3X_CLIENT], +[ + # Add check "x$client" = "xauto" when this becomes supported client + if test "x$gui_gtk3x" = "xyes" || + test "x$client" = "xall" ; then +PKG_CHECK_MODULES([GTK3X], [gtk+-4.0 >= 3.89.0], + [ +GTK3X_CFLAGS="$GTK3X_CFLAGS -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_90" +GTK3X_CFLAGS="$GTK3X_CFLAGS -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_50" +gui_gtk3x=yes +if test "x$client" = "xauto" ; then + client=yes +fi +gui_gtk3x_cflags="$GTK3X_CFLAGS" +gui_gtk3x_libs="$GTK3X_LIBS" +if test "x$MINGW" = "xyes"; then + dnl Required to compile gtk3 on Windows platform + gui_gtk3x_cflags="$gui_gtk3x_cflags -mms-bitfields" + gui_gtk3x_ldflags="$gui_gtk3x_ldflags -mwindows" +fi + ], + [ +FC_NO_CLIENT([gtk3x], [GTK+-3.9x libraries not found]) + ]) + fi +]) ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r34095 - in /trunk: common/actions.c common/actions.h server/rssanity.c
Author: sveinung Date: Tue Oct 11 16:16:15 2016 New Revision: 34095 URL: http://svn.gna.org/viewcvs/freeciv?rev=34095&view=rev Log: Move obligatory hard requirements to actions.c. An action may force all its enablers to include one or more of its hard requirements. The information about what requirements are obligatory for what actions has lived in rssanity.c's sanity_check_ruleset_data() until now. Move it to the new function action_enabler_obligatory_reqs_missing(). Make it possible to check each individual action enabler. See patch #7801 Modified: trunk/common/actions.c trunk/common/actions.h trunk/server/rssanity.c [This mail would be too long, it was shortened to contain the URLs only.] Modified: trunk/common/actions.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.c?rev=34095&r1=34094&r2=34095&view=diff Modified: trunk/common/actions.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/common/actions.h?rev=34095&r1=34094&r2=34095&view=diff Modified: trunk/server/rssanity.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/server/rssanity.c?rev=34095&r1=34094&r2=34095&view=diff ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r34094 - in /trunk/utility: string_vector.c string_vector.h
Author: sveinung Date: Tue Oct 11 16:15:46 2016 New Revision: 34094 URL: http://svn.gna.org/viewcvs/freeciv?rev=34094&view=rev Log: Introduce are_strvecs_equal(). See patch #7800 Modified: trunk/utility/string_vector.c trunk/utility/string_vector.h Modified: trunk/utility/string_vector.c URL: http://svn.gna.org/viewcvs/freeciv/trunk/utility/string_vector.c?rev=34094&r1=34093&r2=34094&view=diff == --- trunk/utility/string_vector.c (original) +++ trunk/utility/string_vector.c Tue Oct 11 16:15:46 2016 @@ -346,6 +346,27 @@ } /** + Returns TRUE if stv1 and stv2 are equal. +**/ +bool are_strvecs_equal(const struct strvec *stv1, + const struct strvec *stv2) +{ + int i; + + if (strvec_size(stv1) != strvec_size(stv2)) { +return FALSE; + } + + for (i = 0; i < strvec_size(stv1); i++) { +if (0 != strcmp(stv1->vec[i], stv2->vec[i])) { + return FALSE; +} + } + + return TRUE; +} + +/** Returns the datas of the vector. **/ const char *const *strvec_data(const struct strvec *psv) Modified: trunk/utility/string_vector.h URL: http://svn.gna.org/viewcvs/freeciv/trunk/utility/string_vector.h?rev=34094&r1=34093&r2=34094&view=diff == --- trunk/utility/string_vector.h (original) +++ trunk/utility/string_vector.h Tue Oct 11 16:15:46 2016 @@ -45,6 +45,8 @@ bool strvec_remove(struct strvec *psv, size_t svindex); size_t strvec_size(const struct strvec *psv); +bool are_strvecs_equal(const struct strvec *stv1, + const struct strvec *stv2); const char *const *strvec_data(const struct strvec *psv); bool strvec_index_valid(const struct strvec *psv, size_t svindex); const char *strvec_get(const struct strvec *psv, size_t svindex); ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits
[Freeciv-commits] r34093 - /branches/S2_6/doc/README.msys2
Author: cazfi Date: Tue Oct 11 13:25:47 2016 New Revision: 34093 URL: http://svn.gna.org/viewcvs/freeciv?rev=34093&view=rev Log: Removed mention of gtk3x-client from README.msys2 See patch #7809 Modified: branches/S2_6/doc/README.msys2 Modified: branches/S2_6/doc/README.msys2 URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/doc/README.msys2?rev=34093&r1=34092&r2=34093&view=diff == --- branches/S2_6/doc/README.msys2 (original) +++ branches/S2_6/doc/README.msys2 Tue Oct 11 13:25:47 2016 @@ -12,7 +12,7 @@ - Msys1, not msys2, is still the official freeciv Windows Installer build method - Buildable clients are gtk3, gtk2, sdl2, and Qt - - Official pre-made msys2 environment supports only gtk3-, gtk3x-, and + - Official pre-made msys2 environment supports only gtk3- and sdl2-client builds ___ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits