[vinagre] Remove preferences dialog, bug 614774
- From: David King <davidk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vinagre] Remove preferences dialog, bug 614774
- Date: Sun, 14 Aug 2011 10:40:13 +0000 (UTC)
commit 63423ccbc9ba9faf773f8bc6b0614a1ded59b922
Author: David King <amigadave amigadave com>
Date: Sun Aug 14 11:30:55 2011 +0200
Remove preferences dialog, bug 614774
The preferences dialog only had two options, neither of which were
particularly relevant in a dialog as opposed to a menu. The option to
always show tabs was removed from the UI, but can still be found in
GSettings. The option to enable keyboard shortcuts was moved to the View
menu.
data/vinagre-ui.xml | 5 +-
data/vinagre.ui | 132 --------------------------------------------
vinagre/vinagre-commands.c | 10 ---
vinagre/vinagre-commands.h | 6 --
vinagre/vinagre-prefs.c | 56 -------------------
vinagre/vinagre-prefs.h | 3 -
vinagre/vinagre-ui.h | 7 +-
vinagre/vinagre-window.c | 4 +
8 files changed, 8 insertions(+), 215 deletions(-)
---
diff --git a/data/vinagre-ui.xml b/data/vinagre-ui.xml
index 956bc47..d17dc42 100644
--- a/data/vinagre-ui.xml
+++ b/data/vinagre-ui.xml
@@ -36,11 +36,8 @@
<menuitem name="RemoteQuitMenu" action="RemoteQuit"/>
</menu>
- <menu name="EditMenu" action="Edit">
- <menuitem name="EditPreferencesMenu" action="EditPreferences"/>
- </menu>
-
<menu name="ViewMenu" action="View">
+ <menuitem name="ViewKeyboardShortcutsMenu" action="ViewKeyboardShortcuts"/>
<menuitem name="ViewToolbarMenu" action="ViewToolbar"/>
<menuitem name="ViewStatusbarMenu" action="ViewStatusbar"/>
<separator/>
diff --git a/data/vinagre.ui b/data/vinagre.ui
index 2cf82d3..e70f61a 100644
--- a/data/vinagre.ui
+++ b/data/vinagre.ui
@@ -1386,136 +1386,4 @@ Jonh Wendell <jwendell gnome org></property>
<action-widget response="0">button4</action-widget>
</action-widgets>
</object>
- <object class="GtkDialog" id="preferences_dialog">
- <property name="can_focus">False</property>
- <property name="border_width">12</property>
- <property name="title" translatable="yes">Preferences</property>
- <property name="resizable">False</property>
- <property name="modal">True</property>
- <property name="window_position">center-on-parent</property>
- <property name="destroy_with_parent">True</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <object class="GtkBox" id="dialog-vbox5">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkBox" id="vbox3">
- <property name="orientation">vertical</property>
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="spacing">6</property>
- <child>
- <object class="GtkLabel" id="label17">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Interface</property>
- <attributes>
- <attribute name="weight" value="bold"/>
- </attributes>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="always_show_tabs_check">
- <property name="label" translatable="yes">_Always show tabs</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip_text" translatable="yes">Always show tabs in the remote desktop display area</property>
- <property name="margin_left">12</property>
- <property name="use_action_appearance">False</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="show_accels_check">
- <property name="label" translatable="yes">Allow _keyboard shortcuts</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="has_tooltip">True</property>
- <property name="tooltip_text" translatable="yes" comments="A tooltip in the preferences dialog">Enables menu accelerators and keyboard shortcuts. This prevents those shortcuts being sent to the remote desktop</property>
- <property name="margin_left">12</property>
- <property name="use_action_appearance">False</property>
- <property name="use_underline">True</property>
- <property name="xalign">0</property>
- <property name="draw_indicator">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="padding">6</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <object class="GtkButtonBox" id="dialog-action_area5">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <child>
- <object class="GtkButton" id="preferences_help_button">
- <property name="label">gtk-help</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="button9">
- <property name="label">gtk-close</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
- <property name="use_action_appearance">False</property>
- <property name="use_stock">True</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </object>
- </child>
- <action-widgets>
- <action-widget response="1">preferences_help_button</action-widget>
- <action-widget response="0">button9</action-widget>
- </action-widgets>
- </object>
</interface>
diff --git a/vinagre/vinagre-commands.c b/vinagre/vinagre-commands.c
index 13c2254..98edba4 100644
--- a/vinagre/vinagre-commands.c
+++ b/vinagre/vinagre-commands.c
@@ -216,14 +216,6 @@ vinagre_cmd_remote_quit (GtkAction *action,
gtk_widget_destroy (GTK_WIDGET (window));
}
-/* Edit Menu */
-void
-vinagre_cmd_edit_preferences (GtkAction *action,
- VinagreWindow *window)
-{
- vinagre_prefs_dialog_show (window);
-}
-
/* View Menu */
void
vinagre_cmd_view_show_toolbar (GtkAction *action,
@@ -328,5 +320,3 @@ vinagre_cmd_help_about (GtkAction *action,
{
vinagre_utils_show_help_about (GTK_WINDOW (window));
}
-
-/* vim: set ts=8: */
diff --git a/vinagre/vinagre-commands.h b/vinagre/vinagre-commands.h
index 0807ea7..bcc2fbe 100644
--- a/vinagre/vinagre-commands.h
+++ b/vinagre/vinagre-commands.h
@@ -47,9 +47,6 @@ void vinagre_cmd_remote_vnc_listener (GtkAction *action,
void vinagre_cmd_remote_quit (GtkAction *action,
VinagreWindow *window);
-void vinagre_cmd_edit_preferences (GtkAction *action,
- VinagreWindow *window);
-
void vinagre_cmd_view_show_toolbar (GtkAction *action,
VinagreWindow *window);
void vinagre_cmd_view_show_statusbar (GtkAction *action,
@@ -67,9 +64,6 @@ void vinagre_cmd_help_contents (GtkAction *action,
void vinagre_cmd_help_about (GtkAction *action,
VinagreWindow *window);
-
-
G_END_DECLS
#endif /* __VINAGRE_COMMANDS_H__ */
-/* vim: set ts=8: */
diff --git a/vinagre/vinagre-prefs.c b/vinagre/vinagre-prefs.c
index 193705a..53d38d6 100644
--- a/vinagre/vinagre-prefs.c
+++ b/vinagre/vinagre-prefs.c
@@ -23,8 +23,6 @@
#include "vinagre-prefs.h"
#define VINAGRE_SCHEMA_NAME "org.gnome.Vinagre"
-#define VM_ALWAYS_SHOW_TABS "always-show-tabs"
-#define VM_SHOW_ACCELS "show-accels"
#define VM_HISTORY_SIZE "history-size"
#define VM_ALWAYS_ENABLE_LISTENING "always-enable-listening"
#define VM_SHARED_FLAG "shared-flag"
@@ -179,57 +177,3 @@ vinagre_prefs_class_init (VinagrePrefsClass *klass)
FALSE,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
-
-/* Preferences dialog */
-
-typedef struct {
- GtkBuilder *xml;
- GtkWidget *dialog;
- GtkWidget *show_tabs;
- GtkWidget *show_accels;
- GtkWindow *parent;
-} VinagrePrefsDialog;
-
-static void
-vinagre_prefs_dialog_response (GtkDialog *d, gint response_id, VinagrePrefsDialog *dialog)
-{
- if (response_id > 0)
- {
- vinagre_utils_show_help (dialog->parent, "preferences");
- return;
- }
-
- gtk_widget_destroy (dialog->dialog);
- g_object_unref (dialog->xml);
- g_slice_free (VinagrePrefsDialog, dialog);
- dialog = NULL;
-}
-
-void
-vinagre_prefs_dialog_show (VinagreWindow *window)
-{
- VinagrePrefsDialog *dialog;
- VinagrePrefs *pref;
-
- dialog = g_slice_new (VinagrePrefsDialog);
-
- dialog->xml = vinagre_utils_get_builder ();
- dialog->dialog = GTK_WIDGET (gtk_builder_get_object (dialog->xml, "preferences_dialog"));
- dialog->parent = GTK_WINDOW (window);
- gtk_window_set_transient_for (GTK_WINDOW (dialog->dialog), dialog->parent);
-
- dialog->show_tabs = GTK_WIDGET (gtk_builder_get_object (dialog->xml, "always_show_tabs_check"));
- dialog->show_accels = GTK_WIDGET (gtk_builder_get_object (dialog->xml, "show_accels_check"));
-
- pref = vinagre_prefs_get_default ();
- g_settings_bind (pref->priv->gsettings, VM_ALWAYS_SHOW_TABS, dialog->show_tabs, "active", G_SETTINGS_BIND_DEFAULT);
- g_settings_bind (pref->priv->gsettings, VM_SHOW_ACCELS, dialog->show_accels, "active", G_SETTINGS_BIND_DEFAULT);
-
- g_signal_connect (dialog->dialog,
- "response",
- G_CALLBACK (vinagre_prefs_dialog_response),
- dialog);
-
- gtk_widget_show_all (dialog->dialog);
-}
-/* vim: set ts=8: */
diff --git a/vinagre/vinagre-prefs.h b/vinagre/vinagre-prefs.h
index 5340e56..59e3b93 100644
--- a/vinagre/vinagre-prefs.h
+++ b/vinagre/vinagre-prefs.h
@@ -53,9 +53,6 @@ GType vinagre_prefs_get_type (void) G_GNUC_CONST;
VinagrePrefs * vinagre_prefs_get_default (void);
GSettings * vinagre_prefs_get_default_gsettings (void);
-void vinagre_prefs_dialog_show (VinagreWindow *window);
-
G_END_DECLS
#endif /* _VINAGRE_PREFS_H_ */
-/* vim: set ts=8: */
diff --git a/vinagre/vinagre-ui.h b/vinagre/vinagre-ui.h
index f7fd9fb..ad40b27 100644
--- a/vinagre/vinagre-ui.h
+++ b/vinagre/vinagre-ui.h
@@ -47,10 +47,6 @@ static const GtkActionEntry vinagre_always_sensitive_entries[] =
{ "RemoteQuit", GTK_STOCK_QUIT, NULL, "<control>Q",
N_("Quit the program"), G_CALLBACK (vinagre_cmd_remote_quit) },
- /* Edit menu */
- { "EditPreferences", GTK_STOCK_PREFERENCES, NULL, NULL,
- N_("Edit the application preferences"), G_CALLBACK (vinagre_cmd_edit_preferences) },
-
/* Help menu */
{"HelpContents", GTK_STOCK_HELP, N_("_Contents"), "F1",
N_("Open the Vinagre manual"), G_CALLBACK (vinagre_cmd_help_contents)},
@@ -60,6 +56,9 @@ static const GtkActionEntry vinagre_always_sensitive_entries[] =
static const GtkToggleActionEntry vinagre_always_sensitive_toggle_entries[] =
{
+ { "ViewKeyboardShortcuts", NULL, N_("_Keyboard shortcuts"), NULL,
+ N_("Enable keyboard shurtcuts"), NULL, FALSE },
+
{ "ViewToolbar", NULL, N_("_Toolbar"), NULL,
N_("Show or hide the toolbar"),
G_CALLBACK (vinagre_cmd_view_show_toolbar), FALSE },
diff --git a/vinagre/vinagre-window.c b/vinagre/vinagre-window.c
index e469dbf..6d2b540 100644
--- a/vinagre/vinagre-window.c
+++ b/vinagre/vinagre-window.c
@@ -351,6 +351,10 @@ create_menu_bar_and_toolbar (VinagreWindow *window,
action = gtk_action_group_get_action (action_group, "RemoteConnect");
gtk_action_set_is_important (action, TRUE);
+ action = gtk_action_group_get_action (action_group, "ViewKeyboardShortcuts");
+ g_settings_bind (vinagre_prefs_get_default_gsettings (), "show-accels",
+ action, "active", G_SETTINGS_BIND_DEFAULT);
+
/* Remote connected actions */
action_group = gtk_action_group_new ("VinagreWindowRemoteConnectedActions");
gtk_action_group_set_translation_domain (action_group, NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]