[dasher] Make Direct Mode available from toolbar and menu
- From: Patrick Welche <pwelche src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dasher] Make Direct Mode available from toolbar and menu
- Date: Thu, 20 Sep 2012 16:50:09 +0000 (UTC)
commit b2141c8ea15f5e6e057b5a5873bc1fda3573b058
Author: Patrick Welche <prlw1 cam ac uk>
Date: Thu Sep 20 17:48:35 2012 +0100
Make Direct Mode available from toolbar and menu
Not just from the command line. (i.e. enable the work done
in 5e640558)
Data/GUI/dasher.traditional.ui | 12 +++++++++++-
Src/Gtk2/dasher_main.cpp | 13 +++++++++++++
2 files changed, 24 insertions(+), 1 deletions(-)
---
diff --git a/Data/GUI/dasher.traditional.ui b/Data/GUI/dasher.traditional.ui
index f013a47..527263b 100644
--- a/Data/GUI/dasher.traditional.ui
+++ b/Data/GUI/dasher.traditional.ui
@@ -129,8 +129,16 @@
</object>
</child>
<child>
+ <object class="GtkToggleAction" id="action_toggle_direct_mode">
+ <property name="stock_id">gtk-connect</property>
+ <property name="tooltip" translatable="yes">Direct Mode</property>
+ <property name="label" translatable="yes">_Direct Mode</property>
+ <signal name="toggled" handler="dasher_main_cb_toggle_direct_mode"/>
+ </object>
+ </child>
+ <child>
<object class="GtkToggleAction" id="action_toggle_game_mode">
- <property name="label" translatable="yes">_Game Mode</property>
+ <property name="label" translatable="yes">_Game Mode</property>
<signal name="activate" handler="dasher_main_cb_toggle_game_mode"/>
</object>
</child>
@@ -144,6 +152,7 @@
<menuitem action="action_save"/>
<menuitem action="action_saveas"/>
<menuitem action="action_append"/>
+ <menuitem action="action_toggle_direct_mode"/>
<menuitem action="action_toggle_game_mode"/>
<separator/>
<menuitem action="action_import"/>
@@ -171,6 +180,7 @@
<toolitem action="action_cut"/>
<toolitem action="action_copy"/>
<toolitem action="action_paste"/>
+ <toolitem action="action_toggle_direct_mode"/>
<separator/>
<toolitem action="action_preferences"/>
<toolitem action="action_help"/>
diff --git a/Src/Gtk2/dasher_main.cpp b/Src/Gtk2/dasher_main.cpp
index 7f7715e..4b2c530 100644
--- a/Src/Gtk2/dasher_main.cpp
+++ b/Src/Gtk2/dasher_main.cpp
@@ -91,6 +91,7 @@ static void dasher_main_command_preferences(DasherMain *pSelf);
static void dasher_main_command_preferences_alphabet(DasherMain *pSelf);
static void dasher_main_command_help(DasherMain *pSelf);
static void dasher_main_command_about(DasherMain *pSelf);
+static void dasher_main_command_toggle_direct_mode(DasherMain*);
static void dasher_main_command_toggle_game_mode(DasherMain*);
/* c.f. WRAP_CPP_CB below */
@@ -99,6 +100,7 @@ extern "C" void dasher_main_cb_quit(GtkAction*, DasherMain*);
extern "C" void dasher_main_cb_preferences(GtkAction*, DasherMain*);
extern "C" void dasher_main_cb_help(GtkAction*, DasherMain*);
extern "C" void dasher_main_cb_about(GtkAction*, DasherMain*);
+extern "C" void dasher_main_cb_toggle_direct_mode(GtkAction*, DasherMain*);
extern "C" void dasher_main_cb_toggle_game_mode(GtkAction*, DasherMain*);
static gboolean dasher_main_speed_changed(DasherMain *pSelf);
@@ -361,6 +363,7 @@ WRAP_CPP_CB(quit)
WRAP_CPP_CB(preferences)
WRAP_CPP_CB(help)
WRAP_CPP_CB(about)
+WRAP_CPP_CB(toggle_direct_mode)
WRAP_CPP_CB(toggle_game_mode)
extern "C" void
@@ -586,6 +589,16 @@ void show_game_file_dialog(GtkWidget *pButton, GtkWidget *pWidget, gpointer pDat
gtk_widget_destroy(GTK_WIDGET(objRefs->first));
}
+void dasher_main_command_toggle_direct_mode(DasherMain *pSelf) {
+ DasherMainPrivate *pPrivate = DASHER_MAIN_GET_PRIVATE(pSelf);
+
+ if (dasher_app_settings_get_long(pPrivate->pAppSettings, APP_LP_STYLE) == APP_STYLE_DIRECT) {
+ dasher_app_settings_set_long(pPrivate->pAppSettings, APP_LP_STYLE, APP_STYLE_TRAD);
+ } else {
+ dasher_app_settings_set_long(pPrivate->pAppSettings, APP_LP_STYLE, APP_STYLE_DIRECT);
+ }
+}
+
/**
* Toggle game mode on and off. Toggling on causes a dialog box to be displayed
* welcoming the user to game mode and prompting them to specify a file to play with.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]