Skip to content
Snippets Groups Projects
Commit 936d5ea9 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

[#1641] Store dialpad display in gconf

parent ac481c0e
No related branches found
No related tags found
No related merge requests found
...@@ -51,6 +51,19 @@ ...@@ -51,6 +51,19 @@
</locale> </locale>
</schema> </schema>
<schema>
<key>/schemas/apps/sflphone-client-gnome/state/dialpad</key>
<applyto>/apps/sflphone-client-gnome/state/dialpad</applyto>
<owner>sflphone-client-gnome</owner>
<type>bool</type>
<default>true</default>
<locale name="C">
<short>Display dialpad</short>
<long>Display dialpad.</long>
</locale>
</schema>
</schemalist> </schemalist>
</gconfschemafile> </gconfschemafile>
...@@ -249,7 +249,7 @@ create_main_window () ...@@ -249,7 +249,7 @@ create_main_window ()
gtk_widget_show_all (mic_control); gtk_widget_show_all (mic_control);
} }
if(SHOW_DIALPAD){ if (eel_gconf_get_boolean (CONF_SHOW_DIALPAD)){
dialpad = create_dialpad(); dialpad = create_dialpad();
gtk_box_pack_end (GTK_BOX (subvbox), dialpad, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/); gtk_box_pack_end (GTK_BOX (subvbox), dialpad, FALSE /*expand*/, TRUE /*fill*/, 0 /*padding*/);
gtk_widget_show_all (dialpad); gtk_widget_show_all (dialpad);
......
...@@ -123,8 +123,6 @@ log4c_category_t* log4c_sfl_gtk_category; ...@@ -123,8 +123,6 @@ log4c_category_t* log4c_sfl_gtk_category;
#define MINIMIZED TRUE #define MINIMIZED TRUE
/** Behaviour of the main window on incoming calls */ /** Behaviour of the main window on incoming calls */
#define __POPUP_WINDOW ( dbus_popup_mode() ) #define __POPUP_WINDOW ( dbus_popup_mode() )
/** Show/Hide the dialpad */
#define SHOW_DIALPAD ( dbus_get_dialpad() )
/** Show/Hide the alsa configuration panel */ /** Show/Hide the alsa configuration panel */
#define SHOW_ALSA_CONF ( dbus_get_audio_manager() == ALSA ) #define SHOW_ALSA_CONF ( dbus_get_audio_manager() == ALSA )
/** Show/Hide the volume controls */ /** Show/Hide the volume controls */
...@@ -169,5 +167,7 @@ log4c_category_t* log4c_sfl_gtk_category; ...@@ -169,5 +167,7 @@ log4c_category_t* log4c_sfl_gtk_category;
#define CONF_MAIN_WINDOW_HEIGHT CONF_PREFIX "/state/window_height" #define CONF_MAIN_WINDOW_HEIGHT CONF_PREFIX "/state/window_height"
#define CONF_MAIN_WINDOW_POSITION_X CONF_PREFIX "/state/window_position_x" #define CONF_MAIN_WINDOW_POSITION_X CONF_PREFIX "/state/window_position_x"
#define CONF_MAIN_WINDOW_POSITION_Y CONF_PREFIX "/state/window_position_y" #define CONF_MAIN_WINDOW_POSITION_Y CONF_PREFIX "/state/window_position_y"
/** Show/Hide the dialpad */
#define CONF_SHOW_DIALPAD CONF_PREFIX "/state/dialpad"
#endif #endif
...@@ -297,11 +297,12 @@ static void volume_bar_cb (GtkToggleAction *togglemenuitem, gpointer user_data) ...@@ -297,11 +297,12 @@ static void volume_bar_cb (GtkToggleAction *togglemenuitem, gpointer user_data)
static void dialpad_bar_cb (GtkToggleAction *togglemenuitem, gpointer user_data) static void dialpad_bar_cb (GtkToggleAction *togglemenuitem, gpointer user_data)
{ {
gboolean toggled = gtk_toggle_action_get_active (togglemenuitem); gboolean toggled = gtk_toggle_action_get_active (togglemenuitem);
if (toggled == SHOW_DIALPAD) gboolean conf_dialpad = eel_gconf_get_boolean (CONF_SHOW_DIALPAD);
if (toggled == conf_dialpad)
return; return;
main_window_dialpad (toggled); main_window_dialpad (toggled);
if (toggled || SHOW_DIALPAD) if (toggled || conf_dialpad)
dbus_set_dialpad(toggled); eel_gconf_set_boolean (CONF_SHOW_DIALPAD, toggled); //dbus_set_dialpad (toggled);
} }
static void help_contents_cb (GtkAction *action) static void help_contents_cb (GtkAction *action)
...@@ -1318,7 +1319,7 @@ void create_menus (GtkUIManager *ui_manager, GtkWidget **widget) ...@@ -1318,7 +1319,7 @@ void create_menus (GtkUIManager *ui_manager, GtkWidget **widget)
volumeToggle = gtk_ui_manager_get_action (ui_manager, "/MenuBar/ViewMenu/VolumeControls"); volumeToggle = gtk_ui_manager_get_action (ui_manager, "/MenuBar/ViewMenu/VolumeControls");
// Set the toggle buttons // Set the toggle buttons
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (gtk_ui_manager_get_action (ui_manager, "/MenuBar/ViewMenu/Dialpad")), (gboolean) SHOW_DIALPAD); gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (gtk_ui_manager_get_action (ui_manager, "/MenuBar/ViewMenu/Dialpad")), eel_gconf_get_boolean (CONF_SHOW_DIALPAD));
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (volumeToggle), (gboolean) SHOW_VOLUME); gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (volumeToggle), (gboolean) SHOW_VOLUME);
gtk_action_set_sensitive (GTK_ACTION (volumeToggle), SHOW_ALSA_CONF); gtk_action_set_sensitive (GTK_ACTION (volumeToggle), SHOW_ALSA_CONF);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment