diff options
author | Antenore Gatta <antenore@simbiosi.org> | 2018-09-10 00:43:41 +0300 |
---|---|---|
committer | Antenore Gatta <antenore@simbiosi.org> | 2018-09-10 00:43:41 +0300 |
commit | 285c253a780e97411dd5fd5245424f5b1ad0d6ae (patch) | |
tree | b5ee24bdd2ef17efbb748fd2831d3f8d7eb46bd1 | |
parent | a89b7fb6b340c38dcb011332b07b773cd54641f3 (diff) |
Adding global preference for search bar visibility - closes #1670
-rw-r--r-- | data/ui/remmina_preferences.glade | 34 | ||||
-rw-r--r-- | src/remmina_main.c | 6 | ||||
-rw-r--r-- | src/remmina_pref.c | 7 | ||||
-rw-r--r-- | src/remmina_pref.h | 1 | ||||
-rw-r--r-- | src/remmina_pref_dialog.c | 3 | ||||
-rw-r--r-- | src/remmina_pref_dialog.h | 1 |
6 files changed, 42 insertions, 10 deletions
diff --git a/data/ui/remmina_preferences.glade b/data/ui/remmina_preferences.glade index 3750ebe99..b371eea00 100644 --- a/data/ui/remmina_preferences.glade +++ b/data/ui/remmina_preferences.glade @@ -396,7 +396,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">4</property> + <property name="top_attach">5</property> </packing> </child> <child> @@ -413,7 +413,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">4</property> + <property name="top_attach">5</property> <property name="width">2</property> </packing> </child> @@ -426,7 +426,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">5</property> + <property name="top_attach">6</property> </packing> </child> <child> @@ -443,7 +443,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">5</property> + <property name="top_attach">6</property> <property name="width">2</property> </packing> </child> @@ -457,7 +457,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">6</property> + <property name="top_attach">7</property> </packing> </child> <child> @@ -474,7 +474,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">6</property> + <property name="top_attach">7</property> <property name="width">2</property> </packing> </child> @@ -487,7 +487,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">0</property> - <property name="top_attach">7</property> + <property name="top_attach">8</property> </packing> </child> <child> @@ -504,7 +504,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">7</property> + <property name="top_attach">8</property> <property name="width">2</property> </packing> </child> @@ -538,7 +538,7 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">1</property> - <property name="top_attach">3</property> + <property name="top_attach">4</property> <property name="width">2</property> </packing> </child> @@ -552,7 +552,23 @@ Author: Antenore Gatta </object> <packing> <property name="left_attach">0</property> + <property name="top_attach">4</property> + </packing> + </child> + <child> + <object class="GtkCheckButton" id="checkbutton_appearance_hide_searchbar"> + <property name="label" translatable="yes">Hide Search Bar in main window</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="halign">start</property> + <property name="hexpand">True</property> + <property name="draw_indicator">True</property> + </object> + <packing> + <property name="left_attach">0</property> <property name="top_attach">3</property> + <property name="width">3</property> </packing> </child> </object> diff --git a/src/remmina_main.c b/src/remmina_main.c index 0c7850487..6022abb28 100644 --- a/src/remmina_main.c +++ b/src/remmina_main.c @@ -1056,7 +1056,7 @@ void remmina_main_quick_search_on_icon_press(GtkEntry *entry, GtkEntryIconPositi void remmina_main_quick_search_on_changed(GtkEditable *editable, gpointer user_data) { TRACE_CALL(__func__); -/* If a search text was input then temporary set the file mode to list */ + /* If a search text was input then temporary set the file mode to list */ if (gtk_entry_get_text_length(remminamain->entry_quick_connect_server)) { if (GTK_IS_TREE_STORE(remminamain->priv->file_model)) { /* File view mode changed, put it to override and reload list */ @@ -1130,6 +1130,10 @@ static void remmina_main_init(void) gtk_window_maximize(remminamain->window); } + /* Honor global peferences Search Bar visibility */ + if (remmina_pref.hide_searchbar) + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON(GET_OBJECT("search_toggle")), FALSE); + /* Add a GtkMenuItem to the Tools menu for each plugin of type REMMINA_PLUGIN_TYPE_TOOL */ remmina_plugin_manager_for_each_plugin(REMMINA_PLUGIN_TYPE_TOOL, remmina_main_add_tool_plugin, remminamain); diff --git a/src/remmina_pref.c b/src/remmina_pref.c index 4a1e16106..070a50765 100644 --- a/src/remmina_pref.c +++ b/src/remmina_pref.c @@ -312,6 +312,12 @@ void remmina_pref_init(void) else remmina_pref.hide_connection_toolbar = FALSE; + if (g_key_file_has_key(gkeyfile, "remmina_pref", "hide_searchbar", NULL)) + remmina_pref.hide_searchbar = g_key_file_get_boolean(gkeyfile, "remmina_pref", + "hide_searchbar", NULL); + else + remmina_pref.hide_searchbar = FALSE; + if (g_key_file_has_key(gkeyfile, "remmina_pref", "default_action", NULL)) remmina_pref.default_action = g_key_file_get_integer(gkeyfile, "remmina_pref", "default_action", NULL); else @@ -666,6 +672,7 @@ gboolean remmina_pref_save(void) g_key_file_set_boolean(gkeyfile, "remmina_pref", "fullscreen_on_auto", remmina_pref.fullscreen_on_auto); g_key_file_set_boolean(gkeyfile, "remmina_pref", "always_show_tab", remmina_pref.always_show_tab); g_key_file_set_boolean(gkeyfile, "remmina_pref", "hide_connection_toolbar", remmina_pref.hide_connection_toolbar); + g_key_file_set_boolean(gkeyfile, "remmina_pref", "hide_searchbar", remmina_pref.hide_searchbar); g_key_file_set_integer(gkeyfile, "remmina_pref", "default_action", remmina_pref.default_action); g_key_file_set_integer(gkeyfile, "remmina_pref", "scale_quality", remmina_pref.scale_quality); g_key_file_set_integer(gkeyfile, "remmina_pref", "ssh_loglevel", remmina_pref.ssh_loglevel); diff --git a/src/remmina_pref.h b/src/remmina_pref.h index 21256e0ac..3ad5707d9 100644 --- a/src/remmina_pref.h +++ b/src/remmina_pref.h @@ -122,6 +122,7 @@ typedef struct _RemminaPref { gboolean fullscreen_on_auto; gboolean always_show_tab; gboolean hide_connection_toolbar; + gboolean hide_searchbar; gint default_mode; gint tab_mode; gint fullscreen_toolbar_visibility; diff --git a/src/remmina_pref_dialog.c b/src/remmina_pref_dialog.c index 5fe3f1457..78f0da06c 100644 --- a/src/remmina_pref_dialog.c +++ b/src/remmina_pref_dialog.c @@ -164,6 +164,7 @@ void remmina_pref_on_dialog_destroy(GtkWidget *widget, gpointer user_data) remmina_pref.fullscreen_on_auto = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_fullscreen_on_auto)); remmina_pref.always_show_tab = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_show_tabs)); remmina_pref.hide_connection_toolbar = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_hide_toolbar)); + remmina_pref.hide_searchbar = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_hide_searchbar)); b = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_permit_send_stats)); if (remmina_pref.periodic_usage_stats_permitted) { @@ -380,6 +381,7 @@ static void remmina_pref_dialog_init(void) gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_fullscreen_on_auto), remmina_pref.fullscreen_on_auto); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_show_tabs), remmina_pref.always_show_tab); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_hide_toolbar), remmina_pref.hide_connection_toolbar); + gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_appearance_hide_searchbar), remmina_pref.hide_searchbar); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remmina_pref_dialog->checkbutton_permit_send_stats), remmina_pref.periodic_usage_stats_permitted); @@ -542,6 +544,7 @@ GtkDialog* remmina_pref_dialog_new(gint default_tab, GtkWindow *parent) remmina_pref_dialog->checkbutton_appearance_fullscreen_on_auto = GTK_CHECK_BUTTON(GET_OBJECT("checkbutton_appearance_fullscreen_on_auto")); remmina_pref_dialog->checkbutton_appearance_show_tabs = GTK_CHECK_BUTTON(GET_OBJECT("checkbutton_appearance_show_tabs")); remmina_pref_dialog->checkbutton_appearance_hide_toolbar = GTK_CHECK_BUTTON(GET_OBJECT("checkbutton_appearance_hide_toolbar")); + remmina_pref_dialog->checkbutton_appearance_hide_searchbar = GTK_CHECK_BUTTON(GET_OBJECT("checkbutton_appearance_hide_searchbar")); remmina_pref_dialog->checkbutton_permit_send_stats = GTK_CHECK_BUTTON(GET_OBJECT("checkbutton_permit_send_stats")); remmina_pref_dialog->comboboxtext_options_double_click = GTK_COMBO_BOX(GET_OBJECT("comboboxtext_options_double_click")); remmina_pref_dialog->comboboxtext_appearance_view_mode = GTK_COMBO_BOX(GET_OBJECT("comboboxtext_appearance_view_mode")); diff --git a/src/remmina_pref_dialog.h b/src/remmina_pref_dialog.h index 911638719..cc5f52905 100644 --- a/src/remmina_pref_dialog.h +++ b/src/remmina_pref_dialog.h @@ -53,6 +53,7 @@ typedef struct _RemminaPrefDialog { GtkCheckButton *checkbutton_appearance_fullscreen_on_auto; GtkCheckButton *checkbutton_appearance_show_tabs; GtkCheckButton *checkbutton_appearance_hide_toolbar; + GtkCheckButton *checkbutton_appearance_hide_searchbar; GtkCheckButton *checkbutton_permit_send_stats; GtkComboBox *comboboxtext_options_double_click; GtkComboBox *comboboxtext_appearance_view_mode; |