Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Backports:SLE-15-SP6
morris
gsettings-port.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File gsettings-port.patch of Package morris
Description: Port to GSettings. Author: Yavor Doganov <yavor@gnu.org> Bug-Debian: https://bugs.debian.org/886056 Forwarded: no Last-Update: 2019-10-23 --- --- morris.orig/configure.ac +++ morris/configure.ac @@ -21,15 +21,7 @@ gtk+-2.0 >= 2.4 ]) -AC_ARG_WITH([gconf], - AS_HELP_STRING([--without-gconf], [Build without gconf library (default: test)])) - -if test "x$with_gconf" != "xno"; then - PKG_CHECK_MODULES(GCONF, [gconf-2.0]) - AC_DEFINE(HAVE_GCONF, 1, "compile with gconf support") -fi -AM_GCONF_SOURCE_2 -AM_CONDITIONAL(HAVE_GCONF, test "x$with_gconf" != "xno") +GLIB_GSETTINGS # gdk-pixbuf-2.0 --- /dev/null +++ morris/net.nine-mens-morris.gschema.xml @@ -0,0 +1,137 @@ +<schemalist gettext-domain="morris"> + <schema id="net.nine-mens-morris" path="/net/nine-mens-morris/"> + <key name="show-log-of-moves" type="b"> + <default>false</default> + <summary>Show a game log</summary> + <description>Show a separate window with the history of the moves played in a game.</description> + </key> + <key name="pause-on-ai-player" type="b"> + <default>false</default> + <summary>Pause on AI players</summary> + <description>If enabled, the program will pause before an AI-player makes a move.</description> + </key> + <child name="display" schema="net.nine-mens-morris.display"/> + <child name="ai" schema="net.nine-mens-morris.ai"/> + </schema> + <schema id="net.nine-mens-morris.display" path="/net/nine-mens-morris/display/"> + <key name="show-game-over-message-box" type="b"> + <default>true</default> + <summary>Show game-over message-box</summary> + <description>Show a message box with the winner at the end of the game.</description> + </key> + <key name="show-board-coordinates" type="b"> + <default>true</default> + <summary>Show board coordinates</summary> + <description>Show the alpha-numeric board coordinates.</description> + </key> + <key name="colored-crossings-while-dragging" type="b"> + <default>true</default> + <summary>Color the board crossing while dragging</summary> + <description>If this is enabled, the crossings of the board are colored while the user drags a piece to show the valid moves.</description> + </key> + <key name="animate-computer-moves" type="b"> + <default>true</default> + <summary>Animate the computer moves</summary> + <description>Whether the computer moves should be shown as small animations.</description> + </key> + <key name="animate-setting-of-pieces" type="b"> + <default>true</default> + <summary>Animate setting new pieces</summary> + <description>If enabled, setting new pieces by the computer will be animated.</description> + </key> + <key name="animate-takes" type="b"> + <default>true</default> + <summary>Animate takes</summary> + <description>If enabled, taking of opponent stones by the computer will be animated.</description> + </key> + <key name="animation-speed" type="d"> + <default>1000</default> + <summary>Animation speed</summary> + <description>Speed of pieces in the animation. Actually, the value is the number of milliseconds it takes to move a piece across the whole board.</description> + </key> + <key name="take-piece-delay" type="d"> + <default>2500</default> + <summary>Delay between animations of takes</summary> + <description>Delay between the animation of takes and between the move-animation and the first take (in milliseconds).</description> + </key> + </schema> + <schema id="net.nine-mens-morris.ai" path="/net/nine-mens-morris/ai/"> + <key name="share-transposition-tables" type="b"> + <default>true</default> + <summary>Share transposition tables between Computer A and B</summary> + <description>Whether both AI players (Computer A and B) should use the same transposition table. If enables, one AI player will benefit from the calculations of the other. Note that if this is enabled, the evaluation weights of both players have to be set to identical values.</description> + </key> + <child name="computer-a" schema="net.nine-mens-morris.ai.computer-a"/> + <child name="computer-b" schema="net.nine-mens-morris.ai.computer-b"/> + </schema> + <schema id="net.nine-mens-morris.ai.computer-a" path="/net/nine-mens-morris/ai/computer-a/"> + <key name="max-time" type="i"> + <default>1000</default> + <summary>Maximum thinking time</summary> + <description>Maximum time (in milliseconds) Computer A is allowed to think.</description> + </key> + <key name="max-depth" type="i"> + <default>25</default> + <summary>Maximum search-depth</summary> + <description>Maximum search-depth in the game tree for Computer A.</description> + </key> + <child name="weights" schema="net.nine-mens-morris.ai.computer-a.weights"/> + </schema> + <schema id="net.nine-mens-morris.ai.computer-a.weights" path="/net/nine-mens-morris/ai/computer-a/weights/"> + <key name="material" type="d"> + <default>1.0</default> + <summary>Evaluation weight for material</summary> + <description>Evaluation weight for material (number of pieces left, relative to the pieces left of the opponent).</description> + </key> + <key name="freedom" type="d"> + <default>0.2</default> + <summary>Evaluation weight for freedom</summary> + <description>Evaluation weight for freedom (number of possible moves, relative to the possible moves of the opponent).</description> + </key> + <key name="mills" type="d"> + <default>0.8</default> + <summary>Evaluation weight for mills</summary> + <description>Evaluation weight for complete mills (number of completed mills, relative to the number of the opponent's mills).</description> + </key> + <key name="experience" type="d"> + <default>1.0</default> + <summary>Evaluation weight for experience</summary> + <description>Evaluation weight for the experience gained during previous games. Positions that lead to winning a game get a bonus, while positions that lead to a lost game are down-rated.</description> + </key> + </schema> + <schema id="net.nine-mens-morris.ai.computer-b" path="/net/nine-mens-morris/ai/computer-b/"> + <key name="max-time" type="i"> + <default>1000</default> + <summary>Maximum thinking time</summary> + <description>Maximum time (in milliseconds) Computer A is allowed to think.</description> + </key> + <key name="max-depth" type="i"> + <default>25</default> + <summary>Maximum search-depth</summary> + <description>Maximum search-depth in the game tree for Computer A.</description> + </key> + <child name="weights" schema="net.nine-mens-morris.ai.computer-b.weights"/> + </schema> + <schema id="net.nine-mens-morris.ai.computer-b.weights" path="/net/nine-mens-morris/ai/computer-b/weights/"> + <key name="material" type="d"> + <default>1.0</default> + <summary>Evaluation weight for material</summary> + <description>Evaluation weight for material (number of pieces left, relative to the pieces left of the opponent).</description> + </key> + <key name="freedom" type="d"> + <default>0.2</default> + <summary>Evaluation weight for freedom</summary> + <description>Evaluation weight for freedom (number of possible moves, relative to the possible moves of the opponent).</description> + </key> + <key name="mills" type="d"> + <default>0.8</default> + <summary>Evaluation weight for mills</summary> + <description>Evaluation weight for complete mills (number of completed mills, relative to the number of the opponent's mills).</description> + </key> + <key name="experience" type="d"> + <default>1.0</default> + <summary>Evaluation weight for experience</summary> + <description>Evaluation weight for the experience gained during previous games. Positions that lead to winning a game get a bonus, while positions that lead to a lost game are down-rated.</description> + </key> + </schema> +</schemalist> --- morris.orig/Makefile.am +++ morris/Makefile.am @@ -15,20 +15,10 @@ sys_DATA = $(sys_in_files:.desktop.in=.desktop) schema_in_files = morris.schemas.in -if HAVE_GCONF - schemadir = $(GCONF_SCHEMA_FILE_DIR) - schema_DATA = $(schema_in_files:.schemas.in=.schemas) -endif +gsettings_SCHEMAS = net.nine-mens-morris.gschema.xml -EXTRA_DIST += $(schema_in_files) $(sys_in_files) -DISTCLEANFILES = $(sys_DATA) $(schema_DATA) - -install-data-local: -if HAVE_GCONF -if GCONF_SCHEMAS_INSTALL - GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(top_builddir)/morris/$(schema_DATA) -endif -endif +EXTRA_DIST += $(gsettings_SCHEMAS) $(sys_in_files) +DISTCLEANFILES = $(sys_DATA) @INTLTOOL_DESKTOP_RULE@ -@INTLTOOL_SCHEMAS_RULE@ +@GSETTINGS_RULES@ --- morris.orig/morris.schemas.in +++ /dev/null @@ -1,286 +0,0 @@ -<gconfschemafile> - - <schemalist> - <schema> - <key>/schemas/apps/morris/show_log_of_moves</key> - <applyto>/apps/morris/show_log_of_moves</applyto> - <owner>morris</owner> - <type>bool</type> - <default>false</default> - <locale name="C"> - <short>Show a game log</short> - <long>Show a separate window with the history of the moves played in a game.</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/morris/pause_on_ai_player</key> - <applyto>/apps/morris/pause_on_ai_player</applyto> - <owner>morris</owner> - <type>bool</type> - <default>false</default> - <locale name="C"> - <short>Pause on AI players</short> - <long>If enabled, the program will pause before an AI-player makes a move.</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/morris/display/show_game_over_message_box</key> - <applyto>/apps/morris/display/show_game_over_message_box</applyto> - <owner>morris</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>Show game-over message-box</short> - <long>Show a message box with the winner at the end of the game.</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/morris/display/show_board_coordinates</key> - <applyto>/apps/morris/display/show_board_coordinates</applyto> - <owner>morris</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>Show board coordinates</short> - <long>Show the alpha-numeric board coordinates.</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/morris/display/colored_crossings_while_dragging</key> - <applyto>/apps/morris/display/colored_crossings_while_dragging</applyto> - <owner>morris</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>Color the board crossing while dragging</short> - <long>If this is enabled, the crossings of the board are colored while the user drags a piece to show the valid moves.</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/morris/display/animate_computer_moves</key> - <applyto>/apps/morris/display/animate_computer_moves</applyto> - <owner>morris</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>Animate the computer moves</short> - <long>Whether the computer moves should be shown as small animations.</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/morris/display/animate_setting_of_pieces</key> - <applyto>/apps/morris/display/animate_setting_of_pieces</applyto> - <owner>morris</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>Animate setting new pieces</short> - <long>If enabled, setting new pieces by the computer will be animated.</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/morris/display/animate_takes</key> - <applyto>/apps/morris/display/animate_takes</applyto> - <owner>morris</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>Animate takes</short> - <long>If enabled, taking of opponent stones by the computer will be animated.</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/morris/display/animation_speed</key> - <applyto>/apps/morris/display/animation_speed</applyto> - <owner>morris</owner> - <type>float</type> - <default>1000</default> - <locale name="C"> - <short>Animation speed</short> - <long>Speed of pieces in the animation. Actually, the value is the number of milliseconds it takes to move a piece across the whole board.</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/morris/display/take_piece_delay</key> - <applyto>/apps/morris/display/take_piece_delay</applyto> - <owner>morris</owner> - <type>float</type> - <default>2500</default> - <locale name="C"> - <short>Delay between animations of takes</short> - <long>Delay between the animation of takes and between the move-animation and the first take (in milliseconds).</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/morris/ai/share_transposition_tables</key> - <applyto>/apps/morris/ai/share_transposition_tables</applyto> - <owner>morris</owner> - <type>bool</type> - <default>true</default> - <locale name="C"> - <short>Share transposition tables between Computer A and B</short> - <long> - Whether both AI players (Computer A and B) should use the same transposition table. If enables, one AI player will benefit from the calculations of the other. - Note that if this is enabled, the evaluation weights of both players have to be set to identical values. - </long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/morris/ai/computerA/max_time</key> - <applyto>/apps/morris/ai/computerA/max_time</applyto> - <owner>morris</owner> - <type>int</type> - <default>1000</default> - <locale name="C"> - <short>Maximum thinking time</short> - <long>Maximum time (in milliseconds) Computer A is allowed to think.</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/morris/ai/computerA/max_depth</key> - <applyto>/apps/morris/ai/computerA/max_depth</applyto> - <owner>morris</owner> - <type>int</type> - <default>25</default> - <locale name="C"> - <short>Maximum search-depth</short> - <long>Maximum search-depth in the game tree for Computer A.</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/morris/ai/computerA/weights/material</key> - <applyto>/apps/morris/ai/computerA/weights/material</applyto> - <owner>morris</owner> - <type>float</type> - <default>1.0</default> - <locale name="C"> - <short>Evaluation weight for material</short> - <long>Evaluation weight for material (number of pieces left, relative to the pieces left of the opponent).</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/morris/ai/computerA/weights/freedom</key> - <applyto>/apps/morris/ai/computerA/weights/freedom</applyto> - <owner>morris</owner> - <type>float</type> - <default>0.2</default> - <locale name="C"> - <short>Evaluation weight for freedom</short> - <long>Evaluation weight for freedom (number of possible moves, relative to the possible moves of the opponent).</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/morris/ai/computerA/weights/mills</key> - <applyto>/apps/morris/ai/computerA/weights/mills</applyto> - <owner>morris</owner> - <type>float</type> - <default>0.8</default> - <locale name="C"> - <short>Evaluation weight for mills</short> - <long>Evaluation weight for complete mills (number of completed mills, relative to the number of the opponent's mills).</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/morris/ai/computerA/weights/experience</key> - <applyto>/apps/morris/ai/computerA/weights/experience</applyto> - <owner>morris</owner> - <type>float</type> - <default>1.0</default> - <locale name="C"> - <short>Evaluation weight for experience</short> - <long>Evaluation weight for the experience gained during previous games. Positions that lead to winning a game get a bonus, while positions that lead to a lost game are down-rated.</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/morris/ai/computerB/max_time</key> - <applyto>/apps/morris/ai/computerB/max_time</applyto> - <owner>morris</owner> - <type>int</type> - <default>1000</default> - <locale name="C"> - <short>Maximum thinking time</short> - <long>Maximum time (in milliseconds) Computer A is allowed to think.</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/morris/ai/computerB/max_depth</key> - <applyto>/apps/morris/ai/computerB/max_depth</applyto> - <owner>morris</owner> - <type>int</type> - <default>25</default> - <locale name="C"> - <short>Maximum search-depth</short> - <long>Maximum search-depth in the game tree for Computer A.</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/morris/ai/computerB/weights/material</key> - <applyto>/apps/morris/ai/computerB/weights/material</applyto> - <owner>morris</owner> - <type>float</type> - <default>1.0</default> - <locale name="C"> - <short>Evaluation weight for material</short> - <long>Evaluation weight for material (number of pieces left, relative to the pieces left of the opponent).</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/morris/ai/computerB/weights/freedom</key> - <applyto>/apps/morris/ai/computerB/weights/freedom</applyto> - <owner>morris</owner> - <type>float</type> - <default>0.2</default> - <locale name="C"> - <short>Evaluation weight for freedom</short> - <long>Evaluation weight for freedom (number of possible moves, relative to the possible moves of the opponent).</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/morris/ai/computerB/weights/mills</key> - <applyto>/apps/morris/ai/computerB/weights/mills</applyto> - <owner>morris</owner> - <type>float</type> - <default>0.8</default> - <locale name="C"> - <short>Evaluation weight for mills</short> - <long>Evaluation weight for complete mills (number of completed mills, relative to the number of the opponent's mills).</long> - </locale> - </schema> - - <schema> - <key>/schemas/apps/morris/ai/computerB/weights/experience</key> - <applyto>/apps/morris/ai/computerB/weights/experience</applyto> - <owner>morris</owner> - <type>float</type> - <default>1.0</default> - <locale name="C"> - <short>Evaluation weight for experience</short> - <long>Evaluation weight for the experience gained during previous games. Positions that lead to winning a game get a bonus, while positions that lead to a lost game are down-rated.</long> - </locale> - </schema> - - </schemalist> - -</gconfschemafile> - --- morris.orig/src/Makefile.am +++ morris/src/Makefile.am @@ -31,12 +31,6 @@ AM_CPPFLAGS = -DLOCALEDIR=\"$(localedir)\" \ $(GTK_CFLAGS) $(GCONF_CFLAGS) $(BOOST_CPPFLAGS) -if HAVE_GCONF - morris_LDADD += $(GCONF_LIBS) - AM_CPPFLAGS += $(GCONF_CFLAGS) - morris_SOURCES += gconf_configmgr.hh gconf_configmgr.cc -endif - # -I$(top_srcdir) \ # -DGNOMELOCALEDIR=\""$(datadir)/locale"\" \ # -DGNOME_ICONDIR=\""$(datadir)/pixmaps"\" --- morris.orig/src/gtk_appgui.cc +++ morris/src/gtk_appgui.cc @@ -25,10 +25,6 @@ #include "gtk_prefDisplay.hh" #include "appgtk_configmgr.hh" -#if HAVE_GCONF -# include "gconf_configmgr.hh" -#endif - #include <assert.h> #include <iostream> #include <boost/bind.hpp> @@ -97,16 +93,8 @@ gtk_box_pack_end(GTK_BOX(appgui->getMainWindowVBox()), boardgui->getBoardWidget(), true,true,0); - - // install configuration manager using GConf - -#if HAVE_GCONF - ConfigManager_GConf* config = new ConfigManager_GConf(0,NULL); - config->setAppConfigDelegate(configmanager_ptr(new ConfigManager_AppGtk)); -#else - ConfigManager_Chained* config = new ConfigManager_Application; + ConfigManager_Chained* config = new ConfigManager_Application(); config->setDelegate(configmanager_ptr(new ConfigManager_AppGtk)); -#endif MainApp::app().registerConfigManager(configmanager_ptr(config)); } @@ -183,7 +171,8 @@ if (!quitApp) { - MainApp::app().getConfigManager()->store(ConfigManager::itemPref_showLogOfMoves, enable); + configmanager_ptr config = MainApp::app().getConfigManager(); + config->store(config->main(), ConfigManager::itemPref_showLogOfMoves, enable); } } --- morris.orig/po/POTFILES.in +++ morris/po/POTFILES.in @@ -10,4 +10,4 @@ src/mainapp.cc src/util.hh morris.desktop.in -morris.schemas.in +net.nine-mens-morris.gschema.xml --- morris.orig/src/configmgr.cc +++ morris/src/configmgr.cc @@ -20,29 +20,39 @@ #include <string.h> -const char* ConfigManager::itemComputer_maxTime[2] = { "ai/computerA/max_time","ai/computerB/max_time" }; -const char* ConfigManager::itemComputer_maxDepth[2] = { "ai/computerA/max_depth", "ai/computerB/max_depth" }; -const char* ConfigManager::itemComputer_weightMaterial[2] = { "ai/computerA/weights/material","ai/computerB/weights/material" }; -const char* ConfigManager::itemComputer_weightFreedom[2] = { "ai/computerA/weights/freedom","ai/computerB/weights/freedom" }; -const char* ConfigManager::itemComputer_weightMills[2] = { "ai/computerA/weights/mills","ai/computerB/weights/mills" }; -const char* ConfigManager::itemComputer_weightExperience[2] = { "ai/computerA/weights/experience","ai/computerB/weights/experience" }; - -const char* ConfigManager::itemComputers_shareTTables = "ai/share_transposition_tables"; - - -const char* ConfigManager::itemDisplay_showGameOverMessageBox = "display/show_game_over_message_box"; -const char* ConfigManager::itemDisplayGtk_showCoordinates = "display/show_board_coordinates"; -const char* ConfigManager::itemDisplayGtk_coloredCrossingsWhileDragging = "display/colored_crossings_while_dragging"; -const char* ConfigManager::itemDisplayGtk_animateComputerMoves = "display/animate_computer_moves"; -const char* ConfigManager::itemDisplayGtk_animateSettingOfPieces = "display/animate_setting_of_pieces"; -const char* ConfigManager::itemDisplayGtk_animateTakes = "display/animate_takes"; -const char* ConfigManager::itemDisplayGtk_animationSpeed = "display/animation_speed"; -const char* ConfigManager::itemDisplayGtk_takePieceDelay = "display/take_piece_delay"; +const char* ConfigManager::itemComputer_maxTime[2] = { "max-time","max-time" }; +const char* ConfigManager::itemComputer_maxDepth[2] = { "max-depth", "max-depth" }; +const char* ConfigManager::itemComputer_weightMaterial[2] = { "material","material" }; +const char* ConfigManager::itemComputer_weightFreedom[2] = { "freedom","freedom" }; +const char* ConfigManager::itemComputer_weightMills[2] = { "mills","mills" }; +const char* ConfigManager::itemComputer_weightExperience[2] = { "experience","experience" }; + +const char* ConfigManager::itemComputers_shareTTables = "share-transposition-tables"; + + +const char* ConfigManager::itemDisplay_showGameOverMessageBox = "show-game-over-message-box"; +const char* ConfigManager::itemDisplayGtk_showCoordinates = "show-board-coordinates"; +const char* ConfigManager::itemDisplayGtk_coloredCrossingsWhileDragging = "colored-crossings-while-dragging"; +const char* ConfigManager::itemDisplayGtk_animateComputerMoves = "animate-computer-moves"; +const char* ConfigManager::itemDisplayGtk_animateSettingOfPieces = "animate-setting-of-pieces"; +const char* ConfigManager::itemDisplayGtk_animateTakes = "animate-takes"; +const char* ConfigManager::itemDisplayGtk_animationSpeed = "animation-speed"; +const char* ConfigManager::itemDisplayGtk_takePieceDelay = "take-piece-delay"; -const char* ConfigManager::itemPref_pauseOnAIPlayer = "pause_on_ai_player"; -const char* ConfigManager::itemPref_showLogOfMoves = "show_log_of_moves"; +const char* ConfigManager::itemPref_pauseOnAIPlayer = "pause-on-ai-player"; +const char* ConfigManager::itemPref_showLogOfMoves = "show-log-of-moves"; +ConfigManager::ConfigManager() +{ + settings = g_settings_new("net.nine-mens-morris"); + disp_settings = g_settings_get_child(settings, "display"); + ai_settings = g_settings_get_child(settings, "ai"); + compA_settings = g_settings_get_child(ai_settings, "computer-a"); + compB_settings = g_settings_get_child(ai_settings, "computer-b"); + weightsA_settings = g_settings_get_child(compA_settings, "weights"); + weightsB_settings = g_settings_get_child(compB_settings, "weights"); +} bool ConfigManager::cmp(const char* a, const char* b) { --- morris.orig/src/app_configmgr.cc +++ morris/src/app_configmgr.cc @@ -21,16 +21,87 @@ #include "gtk_menutoolbar.hh" // TODO: gtk is a special implementation ! #include "algo_alphabeta.hh" +ConfigManager_Application::ConfigManager_Application() +{ +} + +ConfigManager_Application::~ConfigManager_Application() +{ + g_object_unref(settings); + g_object_unref(disp_settings); + g_object_unref(ai_settings); + g_object_unref(compA_settings); + g_object_unref(compB_settings); + g_object_unref(weightsA_settings); + g_object_unref(weightsB_settings); +} void ConfigManager_Application::readInitialValues() { + /* TODO: this should somehow be in the base class */ + + store(settings, itemPref_pauseOnAIPlayer, + read_bool(settings, itemPref_pauseOnAIPlayer)); + store(settings, itemPref_showLogOfMoves, + read_bool(settings, itemPref_showLogOfMoves)); + store(disp_settings, itemDisplay_showGameOverMessageBox, + read_bool(disp_settings, itemDisplay_showGameOverMessageBox)); + store(disp_settings, itemDisplayGtk_showCoordinates, + read_bool(disp_settings, itemDisplayGtk_showCoordinates)); + store(disp_settings, itemDisplayGtk_coloredCrossingsWhileDragging, + read_bool(disp_settings, itemDisplayGtk_coloredCrossingsWhileDragging)); + store(disp_settings, itemDisplayGtk_animateComputerMoves, + read_bool(disp_settings, itemDisplayGtk_animateComputerMoves)); + store(disp_settings, itemDisplayGtk_animateSettingOfPieces, + read_bool(disp_settings, itemDisplayGtk_animateSettingOfPieces)); + store(disp_settings, itemDisplayGtk_animateTakes, + read_bool(disp_settings, itemDisplayGtk_animateTakes)); + + store(disp_settings, itemDisplayGtk_animationSpeed, + read_float(disp_settings, itemDisplayGtk_animationSpeed)); + store(disp_settings, itemDisplayGtk_takePieceDelay, + read_float(disp_settings, itemDisplayGtk_takePieceDelay)); + + for (int i=0;i<2;i++) + { + GSettings* obj; + + if (i == 0) + obj = compA_settings; + else + obj = compB_settings; + + store(obj, itemComputer_maxTime[i], + read_int(obj, itemComputer_maxTime[i])); + store(obj, itemComputer_maxDepth[i], + read_int(obj, itemComputer_maxDepth[i])); + + if (i == 0) + obj = weightsA_settings; + else + obj = weightsB_settings; + + store(obj, itemComputer_weightMaterial[i], + read_float(obj, itemComputer_weightMaterial[i])); + store(obj, itemComputer_weightFreedom[i], + read_float(obj, itemComputer_weightFreedom[i])); + store(obj, itemComputer_weightMills[i], + read_float(obj, itemComputer_weightMills[i])); + store(obj, itemComputer_weightExperience[i], + read_float(obj, itemComputer_weightExperience[i])); + } + + store(ai_settings, itemComputers_shareTTables, + read_bool(ai_settings, itemComputers_shareTTables)); } -void ConfigManager_Application::store(const char* key, int value) +void ConfigManager_Application::store(GSettings* settings, const char* key, int value) { - if (read_int(key)==value) + if (read_int(settings,key)==value) return; + g_settings_set_int(settings,key,value); + { PlayerIF_AlgoAB* p; for (int i=0;i<2;i++) @@ -52,15 +123,17 @@ if (m_delegate != NULL) { - m_delegate->store(key, value); + m_delegate->store(settings, key, value); } } -void ConfigManager_Application::store(const char* key, bool value) +void ConfigManager_Application::store(GSettings* settings, const char* key, bool value) { - if (read_bool(key)==value) + if (read_bool(settings,key)==value) return; + g_settings_set_boolean(settings,key,value); + if (cmp(key,itemPref_pauseOnAIPlayer)) { MainApp::app().options.alwaysPauseOnAIPlayer = value; @@ -72,15 +145,17 @@ } else if (m_delegate != NULL) { - m_delegate->store(key,value); + m_delegate->store(settings,key,value); } } -void ConfigManager_Application::store(const char* key, float value) +void ConfigManager_Application::store(GSettings* settings, const char* key, float value) { - if (read_float(key)==value) + if (read_float(settings,key)==value) return; + g_settings_set_double(settings,key,value); + for (int i=0;i<2;i++) { PlayerIF_AlgoAB* p = dynamic_cast<PlayerIF_AlgoAB*>(MainApp::app().getAIPlayer(i).get()); @@ -112,98 +187,40 @@ if (m_delegate != NULL) { - m_delegate->store(key,value); + m_delegate->store(settings,key,value); } } -void ConfigManager_Application::store(const char* key, const char* value) +void ConfigManager_Application::store(GSettings* settings, const char* key, const char* value) { - if (strcmp(read_string(key).c_str(),value)==0) + if (strcmp(read_string(settings,key).c_str(),value)==0) return; if (m_delegate != NULL) { - m_delegate->store(key,value); + m_delegate->store(settings,key,value); } } -int ConfigManager_Application::read_int(const char* key) +int ConfigManager_Application::read_int(GSettings* settings, const char* key) { - { - const PlayerIF_AlgoAB* p; - for (int i=0;i<2;i++) - { - p = dynamic_cast<const PlayerIF_AlgoAB*>(MainApp::app().getAIPlayer(i).get()); - - if (cmp(key,itemComputer_maxTime[i])) - { - return p->askMaxTime_msec(); - } - else if (cmp(key,itemComputer_maxDepth[i])) - { - return p->askMaxDepth(); - } - } - } - - - if (m_delegate != NULL) - { - return m_delegate->read_int(key); - } + return g_settings_get_int(settings,key); } -bool ConfigManager_Application::read_bool(const char* key) +bool ConfigManager_Application::read_bool(GSettings* settings, const char* key) { - if (cmp(key,itemPref_pauseOnAIPlayer)) - { - return MainApp::app().options.alwaysPauseOnAIPlayer; - } - else if (cmp(key,itemComputers_shareTTables)) - { - return MainApp::app().getShareTTables(); - } - - if (m_delegate != NULL) - { - return m_delegate->read_bool(key); - } + return g_settings_get_boolean(settings,key); } -float ConfigManager_Application::read_float(const char* key) +float ConfigManager_Application::read_float(GSettings* settings, const char* key) { - for (int i=0;i<2;i++) - { - const PlayerIF_AlgoAB* p = dynamic_cast<const PlayerIF_AlgoAB*>(MainApp::app().getAIPlayer(i).get()); - - if (cmp(key,itemComputer_weightMaterial[i])) - { - return p->askEvalWeight(PlayerIF_AlgoAB::Weight_Material); - } - else if (cmp(key,itemComputer_weightFreedom[i])) - { - return p->askEvalWeight(PlayerIF_AlgoAB::Weight_Freedom); - } - else if (cmp(key,itemComputer_weightMills[i])) - { - return p->askEvalWeight(PlayerIF_AlgoAB::Weight_Mills); - } - else if (cmp(key,itemComputer_weightExperience[i])) - { - return p->askEvalWeight(PlayerIF_AlgoAB::Weight_Experience); - } - } - - if (m_delegate != NULL) - { - return m_delegate->read_float(key); - } + return g_settings_get_double(settings,key); } -std::string ConfigManager_Application::read_string(const char* key) +std::string ConfigManager_Application::read_string(GSettings* settings, const char* key) { if (m_delegate != NULL) { - return m_delegate->read_string(key); + return m_delegate->read_string(settings,key); } } --- morris.orig/src/app_configmgr.hh +++ morris/src/app_configmgr.hh @@ -37,17 +37,20 @@ class ConfigManager_Application : public ConfigManager_Chained { public: + ConfigManager_Application(); + ~ConfigManager_Application(); + virtual void readInitialValues(); - virtual void store(const char* key, int value); - virtual void store(const char* key, bool value); - virtual void store(const char* key, float value); - virtual void store(const char* key, const char* value); + virtual void store(GSettings* settings, const char* key, int value); + virtual void store(GSettings* settings, const char* key, bool value); + virtual void store(GSettings* settings, const char* key, float value); + virtual void store(GSettings* settings, const char* key, const char* value); - virtual int read_int (const char* key); - virtual bool read_bool (const char* key); - virtual float read_float (const char* key); - virtual std::string read_string(const char* key); + virtual int read_int (GSettings* settings, const char* key); + virtual bool read_bool (GSettings* settings, const char* key); + virtual float read_float (GSettings* settings, const char* key); + virtual std::string read_string(GSettings* settings, const char* key); }; #endif --- morris.orig/src/appgtk_configmgr.cc +++ morris/src/appgtk_configmgr.cc @@ -23,15 +23,15 @@ #include "gtkcairo_boardgui.hh" -void ConfigManager_AppGtk::store(const char* key, int value) +void ConfigManager_AppGtk::store(GSettings* settings, const char* key, int value) { if (m_delegate != NULL) { - m_delegate->store(key, value); + m_delegate->store(settings, key, value); } } -void ConfigManager_AppGtk::store(const char* key, bool value) +void ConfigManager_AppGtk::store(GSettings* settings, const char* key, bool value) { if (cmp(key,itemPref_showLogOfMoves)) { @@ -65,11 +65,11 @@ } else if (m_delegate != NULL) { - m_delegate->store(key,value); + m_delegate->store(settings,key,value); } } -void ConfigManager_AppGtk::store(const char* key, float value) +void ConfigManager_AppGtk::store(GSettings* settings, const char* key, float value) { if (cmp(key,itemDisplayGtk_animationSpeed)) { @@ -81,27 +81,27 @@ } else if (m_delegate != NULL) { - m_delegate->store(key,value); + m_delegate->store(settings,key,value); } } -void ConfigManager_AppGtk::store(const char* key, const char* value) +void ConfigManager_AppGtk::store(GSettings* settings, const char* key, const char* value) { if (m_delegate != NULL) { - m_delegate->store(key,value); + m_delegate->store(settings,key,value); } } -int ConfigManager_AppGtk::read_int(const char* key) +int ConfigManager_AppGtk::read_int(GSettings* settings, const char* key) { if (m_delegate != NULL) { - return m_delegate->read_int(key); + return m_delegate->read_int(settings,key); } } -bool ConfigManager_AppGtk::read_bool(const char* key) +bool ConfigManager_AppGtk::read_bool(GSettings* settings, const char* key) { if (cmp(key,itemPref_showLogOfMoves)) { @@ -135,11 +135,11 @@ if (m_delegate != NULL) { - return m_delegate->read_bool(key); + return m_delegate->read_bool(settings,key); } } -float ConfigManager_AppGtk::read_float(const char* key) +float ConfigManager_AppGtk::read_float(GSettings* settings, const char* key) { if (cmp(key,itemDisplayGtk_animationSpeed)) { @@ -152,14 +152,14 @@ if (m_delegate != NULL) { - return m_delegate->read_float(key); + return m_delegate->read_float(settings,key); } } -std::string ConfigManager_AppGtk::read_string(const char* key) +std::string ConfigManager_AppGtk::read_string(GSettings* settings, const char* key) { if (m_delegate != NULL) { - return m_delegate->read_string(key); + return m_delegate->read_string(settings,key); } } --- morris.orig/src/appgtk_configmgr.hh +++ morris/src/appgtk_configmgr.hh @@ -25,15 +25,15 @@ class ConfigManager_AppGtk : public ConfigManager_Chained { public: - virtual void store(const char* key, int value); - virtual void store(const char* key, bool value); - virtual void store(const char* key, float value); - virtual void store(const char* key, const char* value); + virtual void store(GSettings* settings, const char* key, int value); + virtual void store(GSettings* settings, const char* key, bool value); + virtual void store(GSettings* settings, const char* key, float value); + virtual void store(GSettings* settings, const char* key, const char* value); - virtual int read_int (const char* key); - virtual bool read_bool (const char* key); - virtual float read_float (const char* key); - virtual std::string read_string(const char* key); + virtual int read_int (GSettings* settings, const char* key); + virtual bool read_bool (GSettings* settings, const char* key); + virtual float read_float (GSettings* settings, const char* key); + virtual std::string read_string(GSettings* settings, const char* key); }; #endif --- morris.orig/src/configmgr.hh +++ morris/src/configmgr.hh @@ -21,6 +21,7 @@ #include <string> #include <boost/shared_ptr.hpp> +#include <gio/gio.h> /* The config manager organizes all the configurable options. @@ -45,20 +46,28 @@ class ConfigManager { public: + ConfigManager(); virtual ~ConfigManager() { } virtual void readInitialValues() { } - virtual void store(const char* key, int value) = 0; - virtual void store(const char* key, bool value) = 0; - virtual void store(const char* key, float value) = 0; - virtual void store(const char* key, const char* value) = 0; - - virtual int read_int (const char* key) = 0; - virtual bool read_bool (const char* key) = 0; - virtual float read_float (const char* key) = 0; - virtual std::string read_string(const char* key) = 0; - + virtual void store(GSettings* settings, const char* key, int value) = 0; + virtual void store(GSettings* settings, const char* key, bool value) = 0; + virtual void store(GSettings* settings, const char* key, float value) = 0; + virtual void store(GSettings* settings, const char* key, const char* value) = 0; + + virtual int read_int (GSettings* settings, const char* key) = 0; + virtual bool read_bool (GSettings* settings, const char* key) = 0; + virtual float read_float (GSettings* settings, const char* key) = 0; + virtual std::string read_string(GSettings* settings, const char* key) = 0; + + GSettings* main() { return settings; } + GSettings* disp() { return disp_settings; } + GSettings* ai() { return ai_settings; } + GSettings* compA() { return compA_settings; } + GSettings* compB() { return compB_settings; } + GSettings* weightsA() { return weightsA_settings; } + GSettings* weightsB() { return weightsB_settings; } // constant strings for the configurable items @@ -84,6 +93,14 @@ static const char* itemPref_showLogOfMoves; protected: + GSettings* settings; + GSettings* disp_settings; + GSettings* ai_settings; + GSettings* compA_settings; + GSettings* compB_settings; + GSettings* weightsA_settings; + GSettings* weightsB_settings; + // Compare two config-keys. This function is optimized for the comparisons of the keys. static bool cmp(const char*, const char*); }; --- morris.orig/src/gtk_menutoolbar.cc +++ morris/src/gtk_menutoolbar.cc @@ -79,14 +79,17 @@ static void cb_pauseOnAI(GtkToggleAction* a) { - MainApp::app().getConfigManager()->store(ConfigManager::itemPref_pauseOnAIPlayer, - bool(gtk_toggle_action_get_active(a))); + bool active = bool(gtk_toggle_action_get_active(a)); + configmanager_ptr config = MainApp::app().getConfigManager(); + config->store(config->main(), ConfigManager::itemPref_pauseOnAIPlayer, active); } static void cb_showMoveLog(GtkToggleAction* a) { - MainApp::app().getConfigManager()->store(ConfigManager::itemPref_showLogOfMoves, - bool(gtk_toggle_action_get_active(a))); + bool active = bool(gtk_toggle_action_get_active(a)); + configmanager_ptr config = MainApp::app().getConfigManager(); + config->store(config->main(), ConfigManager::itemPref_showLogOfMoves, active); + MainApp::app().getApplicationGUI()->showMoveLog(active, false); } @@ -278,6 +281,15 @@ // set defaults + configmanager_ptr config = MainApp::app().getConfigManager(); + + if (config->read_bool(config->main(), + ConfigManager::itemPref_pauseOnAIPlayer)) + gtk_action_activate(gtk_action_group_get_action(actiongroup, "pauseOnAI")); + if (config->read_bool(config->main(), + ConfigManager::itemPref_showLogOfMoves)) + gtk_action_activate(gtk_action_group_get_action(actiongroup, "moveLog")); + gtk_action_set_sensitive( gtk_action_group_get_action(actiongroup, "ContinueGame"), false); gtk_action_set_sensitive( gtk_action_group_get_action(actiongroup, "ForceMove"), false); gtk_action_set_sensitive( gtk_action_group_get_action(actiongroup, "UndoMove"), false); --- morris.orig/src/gtk_prefAI.cc +++ morris/src/gtk_prefAI.cc @@ -70,6 +70,7 @@ configmanager_ptr config = MainApp::app().getConfigManager(); GtkWidget* pref_dialog; + GSettings* obj; struct aiWidgets ai[2]; @@ -159,19 +160,29 @@ // set default values + if (c == 0) + obj = config->compA(); + else + obj = config->compB(); + gtk_spin_button_set_value(GTK_SPIN_BUTTON(ai[c].spin_depth), - config->read_int(ConfigManager::itemComputer_maxDepth[c])); + config->read_int(obj,ConfigManager::itemComputer_maxDepth[c])); gtk_spin_button_set_value(GTK_SPIN_BUTTON(ai[c].spin_time), - config->read_int(ConfigManager::itemComputer_maxTime[c])/1000.0); + config->read_int(obj,ConfigManager::itemComputer_maxTime[c])/1000.0); + + if (c == 0) + obj = config->weightsA(); + else + obj = config->weightsB(); gtk_range_set_value(GTK_RANGE(ai[c].scale_material), - config->read_float(ConfigManager::itemComputer_weightMaterial[c])); + config->read_float(obj,ConfigManager::itemComputer_weightMaterial[c])); gtk_range_set_value(GTK_RANGE(ai[c].scale_freedom), - config->read_float(ConfigManager::itemComputer_weightFreedom[c])); + config->read_float(obj,ConfigManager::itemComputer_weightFreedom[c])); gtk_range_set_value(GTK_RANGE(ai[c].scale_mills), - config->read_float(ConfigManager::itemComputer_weightMills[c])); + config->read_float(obj,ConfigManager::itemComputer_weightMills[c])); gtk_range_set_value(GTK_RANGE(ai[c].scale_experience), - config->read_float(ConfigManager::itemComputer_weightExperience[c])); + config->read_float(obj,ConfigManager::itemComputer_weightExperience[c])); } GtkWidget* big_hbox = gtk_hbox_new(FALSE,0); @@ -183,7 +194,8 @@ GtkWidget* check_shareTT= gtk_check_button_new_with_label(_("share transposition table")); - bool share_TT = config->read_bool(ConfigManager::itemComputers_shareTTables); + bool share_TT = config->read_bool(config->ai(), + ConfigManager::itemComputers_shareTTables); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_shareTT), share_TT); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(pref_dialog)->vbox), check_shareTT, FALSE, TRUE, PADDING); gtk_signal_connect(GTK_OBJECT(check_shareTT), "toggled", GTK_SIGNAL_FUNC(cb_aiPref_shareTT), &ai[1]); @@ -198,15 +210,21 @@ case GTK_RESPONSE_ACCEPT: { share_TT=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check_shareTT)); - config->store(ConfigManager::itemComputers_shareTTables, share_TT); + config->store(config->ai(), + ConfigManager::itemComputers_shareTTables, share_TT); for (int c=0;c<2;c++) { MainApp::app().getTTable(c)->clear(); // TODO: in fact, we only have to clear the table, if we changed a crucial parameter - config->store(ConfigManager::itemComputer_maxTime[c], + if (c == 0) + obj = config->compA(); + else + obj = config->compB(); + + config->store(obj,ConfigManager::itemComputer_maxTime[c], int( gtk_spin_button_get_value(GTK_SPIN_BUTTON(ai[c].spin_time)) * 1000.0 )); - config->store(ConfigManager::itemComputer_maxDepth[c], + config->store(obj,ConfigManager::itemComputer_maxDepth[c], int(gtk_spin_button_get_value(GTK_SPIN_BUTTON(ai[c].spin_depth)))); @@ -216,13 +234,18 @@ int c2 = c; if (share_TT) { c2=0; } - config->store(ConfigManager::itemComputer_weightMaterial[c], + if (c == 0) + obj = config->weightsA(); + else + obj = config->weightsB(); + + config->store(obj,ConfigManager::itemComputer_weightMaterial[c], float(gtk_range_get_value(GTK_RANGE(ai[c2].scale_material)))); - config->store(ConfigManager::itemComputer_weightFreedom[c], + config->store(obj,ConfigManager::itemComputer_weightFreedom[c], float(gtk_range_get_value(GTK_RANGE(ai[c2].scale_freedom)))); - config->store(ConfigManager::itemComputer_weightMills[c], + config->store(obj,ConfigManager::itemComputer_weightMills[c], float(gtk_range_get_value(GTK_RANGE(ai[c2].scale_mills)))); - config->store(ConfigManager::itemComputer_weightExperience[c], + config->store(obj,ConfigManager::itemComputer_weightExperience[c], float(gtk_range_get_value(GTK_RANGE(ai[c2].scale_experience)))); } } --- morris.orig/src/gtk_prefDisplay.cc +++ morris/src/gtk_prefDisplay.cc @@ -53,17 +53,17 @@ GtkWidget* check_showCoords = gtk_check_button_new_with_label(_("show coordinates")); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_gameOverReq), - config->read_bool(ConfigManager::itemDisplay_showGameOverMessageBox)); + config->read_bool(config->disp(), ConfigManager::itemDisplay_showGameOverMessageBox)); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_animComp), - config->read_bool(ConfigManager::itemDisplayGtk_animateComputerMoves)); + config->read_bool(config->disp(), ConfigManager::itemDisplayGtk_animateComputerMoves)); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_animSet), - config->read_bool(ConfigManager::itemDisplayGtk_animateSettingOfPieces)); + config->read_bool(config->disp(), ConfigManager::itemDisplayGtk_animateSettingOfPieces)); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_animTake), - config->read_bool(ConfigManager::itemDisplayGtk_animateTakes)); + config->read_bool(config->disp(), ConfigManager::itemDisplayGtk_animateTakes)); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_showCoords), - config->read_bool(ConfigManager::itemDisplayGtk_showCoordinates)); + config->read_bool(config->disp(), ConfigManager::itemDisplayGtk_showCoordinates)); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(check_colCross), - config->read_bool(ConfigManager::itemDisplayGtk_coloredCrossingsWhileDragging)); + config->read_bool(config->disp(), ConfigManager::itemDisplayGtk_coloredCrossingsWhileDragging)); gtk_box_pack_start(GTK_BOX(vbox), check_gameOverReq, FALSE, TRUE, PADDING/2); gtk_box_pack_start(GTK_BOX(vbox), check_showCoords, FALSE, TRUE, PADDING/2); @@ -76,7 +76,7 @@ GtkWidget* label = gtk_label_new(_("animation speed")); - float animSpeed = config->read_float(ConfigManager::itemDisplayGtk_animationSpeed); + float animSpeed = config->read_float(config->disp(), ConfigManager::itemDisplayGtk_animationSpeed); animSpeed = 100-animSpeed/20; GtkObject* adj_animSpeed = gtk_adjustment_new(animSpeed, 0.0, // lower @@ -95,7 +95,7 @@ hbox = gtk_hbox_new(FALSE,0); label = gtk_label_new(_("take piece delay")); - float takeDelay = config->read_float(ConfigManager::itemDisplayGtk_takePieceDelay); + float takeDelay = config->read_float(config->disp(), ConfigManager::itemDisplayGtk_takePieceDelay); takeDelay = takeDelay/10; GtkObject* adj_takeDelay = gtk_adjustment_new(takeDelay, // initial value 0.0, // lower @@ -124,22 +124,30 @@ { case GTK_RESPONSE_ACCEPT: { - config->store(ConfigManager::itemDisplay_showGameOverMessageBox, + config->store(config->disp(), + ConfigManager::itemDisplay_showGameOverMessageBox, bool(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check_gameOverReq)))); - config->store(ConfigManager::itemDisplayGtk_coloredCrossingsWhileDragging, + config->store(config->disp(), + ConfigManager::itemDisplayGtk_coloredCrossingsWhileDragging, bool(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check_colCross)))); - config->store(ConfigManager::itemDisplayGtk_animateComputerMoves, + config->store(config->disp(), + ConfigManager::itemDisplayGtk_animateComputerMoves, bool(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check_animComp)))); - config->store(ConfigManager::itemDisplayGtk_animateSettingOfPieces, + config->store(config->disp(), + ConfigManager::itemDisplayGtk_animateSettingOfPieces, bool(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check_animSet)))); - config->store(ConfigManager::itemDisplayGtk_animateTakes, + config->store(config->disp(), + ConfigManager::itemDisplayGtk_animateTakes, bool(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check_animTake)))); - config->store(ConfigManager::itemDisplayGtk_showCoordinates, + config->store(config->disp(), + ConfigManager::itemDisplayGtk_showCoordinates, bool(gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check_showCoords)))); - config->store(ConfigManager::itemDisplayGtk_animationSpeed, + config->store(config->disp(), + ConfigManager::itemDisplayGtk_animationSpeed, float( 20*(100-gtk_range_get_value(GTK_RANGE(scale_animSpeed))) )); - config->store(ConfigManager::itemDisplayGtk_takePieceDelay, + config->store(config->disp(), + ConfigManager::itemDisplayGtk_takePieceDelay, float( 10* gtk_range_get_value(GTK_RANGE(scale_takeDelay)) )); newValues = true;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor