vinagre r513 - in trunk: . data src



Author: jwendell
Date: Fri Nov 14 23:51:56 2008
New Revision: 513
URL: http://svn.gnome.org/viewvc/vinagre?rev=513&view=rev

Log:
2008-11-14  Jonh Wendell <jwendell gnome org>

	* lots of files: Added an initial preferences dialog.



Modified:
   trunk/ChangeLog
   trunk/data/vinagre-ui.xml
   trunk/data/vinagre.glade
   trunk/data/vinagre.schemas.in
   trunk/src/vinagre-commands.c
   trunk/src/vinagre-commands.h
   trunk/src/vinagre-prefs.c
   trunk/src/vinagre-prefs.h
   trunk/src/vinagre-ui.h

Modified: trunk/data/vinagre-ui.xml
==============================================================================
--- trunk/data/vinagre-ui.xml	(original)
+++ trunk/data/vinagre-ui.xml	Fri Nov 14 23:51:56 2008
@@ -36,6 +36,10 @@
       <menuitem name="MachineQuitMenu" action="MachineQuit"/>
     </menu>
 
+    <menu name="EditMenu" action="Edit">
+      <menuitem name="EditPreferencesMenu" action="EditPreferences"/>
+    </menu>
+
     <menu name="ViewMenu" action="View">
       <menuitem name="ViewToolbarMenu" action="ViewToolbar"/>
       <menuitem name="ViewStatusbarMenu" action="ViewStatusbar"/>

Modified: trunk/data/vinagre.glade
==============================================================================
--- trunk/data/vinagre.glade	(original)
+++ trunk/data/vinagre.glade	Fri Nov 14 23:51:56 2008
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<!--Generated with glade3 3.4.5 on Thu Nov 13 19:51:19 2008 -->
+<!--Generated with glade3 3.4.5 on Fri Nov 14 17:51:08 2008 -->
 <glade-interface>
   <widget class="GtkDialog" id="connect_dialog">
     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
@@ -38,19 +38,32 @@
             <property name="column_spacing">6</property>
             <property name="row_spacing">6</property>
             <child>
-              <widget class="GtkButton" id="find_button">
+              <widget class="GtkComboBoxEntry" id="host_entry">
+                <property name="width_request">250</property>
+                <property name="visible">True</property>
+                <property name="tooltip" translatable="yes" comments="Tooltip for host entry in connect dialog">host or host:display or host::port</property>
+                <child internal-child="entry">
+                  <widget class="GtkEntry" id="comboboxentry-entry1">
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="activates_default">True</property>
+                  </widget>
+                </child>
+              </widget>
+              <packing>
+                <property name="left_attach">2</property>
+                <property name="right_attach">3</property>
+                <property name="y_options"></property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label2">
                 <property name="visible">True</property>
-                <property name="receives_default">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="label">gtk-find</property>
-                <property name="use_stock">True</property>
-                <property name="focus_on_click">False</property>
-                <property name="response_id">0</property>
+                <property name="label">  </property>
               </widget>
               <packing>
-                <property name="left_attach">3</property>
-                <property name="right_attach">4</property>
-                <property name="x_options"></property>
+                <property name="x_options">GTK_FILL</property>
                 <property name="y_options"></property>
               </packing>
             </child>
@@ -70,32 +83,19 @@
               </packing>
             </child>
             <child>
-              <widget class="GtkLabel" id="label2">
+              <widget class="GtkButton" id="find_button">
                 <property name="visible">True</property>
+                <property name="receives_default">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="label">  </property>
-              </widget>
-              <packing>
-                <property name="x_options">GTK_FILL</property>
-                <property name="y_options"></property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkComboBoxEntry" id="host_entry">
-                <property name="width_request">250</property>
-                <property name="visible">True</property>
-                <property name="tooltip" translatable="yes" comments="Tooltip for host entry in connect dialog">host or host:display or host::port</property>
-                <child internal-child="entry">
-                  <widget class="GtkEntry" id="comboboxentry-entry1">
-                    <property name="visible">True</property>
-                    <property name="can_focus">True</property>
-                    <property name="activates_default">True</property>
-                  </widget>
-                </child>
+                <property name="label">gtk-find</property>
+                <property name="use_stock">True</property>
+                <property name="focus_on_click">False</property>
+                <property name="response_id">0</property>
               </widget>
               <packing>
-                <property name="left_attach">2</property>
-                <property name="right_attach">3</property>
+                <property name="left_attach">3</property>
+                <property name="right_attach">4</property>
+                <property name="x_options"></property>
                 <property name="y_options"></property>
               </packing>
             </child>
@@ -134,21 +134,10 @@
               <placeholder/>
             </child>
             <child>
-              <widget class="GtkLabel" id="label6">
-                <property name="visible">True</property>
-                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="label">  </property>
-              </widget>
-              <packing>
-                <property name="x_options"></property>
-                <property name="y_options"></property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkCheckButton" id="fullscreen_check">
+              <widget class="GtkCheckButton" id="scaling_check">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="label" translatable="yes">_Full screen</property>
+                <property name="label" translatable="yes">_Scaling</property>
                 <property name="use_underline">True</property>
                 <property name="response_id">0</property>
                 <property name="draw_indicator">True</property>
@@ -156,6 +145,8 @@
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
               </packing>
             </child>
             <child>
@@ -175,10 +166,10 @@
               </packing>
             </child>
             <child>
-              <widget class="GtkCheckButton" id="scaling_check">
+              <widget class="GtkCheckButton" id="fullscreen_check">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="label" translatable="yes">_Scaling</property>
+                <property name="label" translatable="yes">_Full screen</property>
                 <property name="use_underline">True</property>
                 <property name="response_id">0</property>
                 <property name="draw_indicator">True</property>
@@ -186,8 +177,17 @@
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label6">
+                <property name="visible">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="label">  </property>
+              </widget>
+              <packing>
+                <property name="x_options"></property>
+                <property name="y_options"></property>
               </packing>
             </child>
           </widget>
@@ -289,57 +289,49 @@
                   <placeholder/>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="label12">
-                    <property name="visible">True</property>
-                    <property name="label">   </property>
-                  </widget>
-                </child>
-                <child>
-                  <widget class="GtkEntry" id="username_entry">
+                  <widget class="GtkLabel" id="label19">
                     <property name="visible">True</property>
-                    <property name="can_focus">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="max_length">254</property>
-                    <property name="activates_default">True</property>
+                    <property name="xalign">0</property>
+                    <property name="label" translatable="yes">Host:</property>
+                    <property name="use_underline">True</property>
+                    <property name="mnemonic_widget">password_entry</property>
                   </widget>
                   <packing>
-                    <property name="left_attach">2</property>
-                    <property name="right_attach">3</property>
-                    <property name="top_attach">1</property>
-                    <property name="bottom_attach">2</property>
+                    <property name="left_attach">1</property>
+                    <property name="right_attach">2</property>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="username_label">
+                  <widget class="GtkLabel" id="password_label">
                     <property name="visible">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="xalign">0</property>
-                    <property name="label" translatable="yes">_Username:</property>
+                    <property name="label" translatable="yes">_Password:</property>
                     <property name="use_underline">True</property>
-                    <property name="mnemonic_widget">username_entry</property>
+                    <property name="mnemonic_widget">password_entry</property>
                   </widget>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
-                    <property name="top_attach">1</property>
-                    <property name="bottom_attach">2</property>
+                    <property name="top_attach">2</property>
+                    <property name="bottom_attach">3</property>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkCheckButton" id="save_credential_check">
+                  <widget class="GtkEntry" id="password_entry">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="label" translatable="yes">_Remember this credential</property>
-                    <property name="use_underline">True</property>
-                    <property name="response_id">0</property>
-                    <property name="draw_indicator">True</property>
+                    <property name="max_length">8</property>
+                    <property name="visibility">False</property>
+                    <property name="activates_default">True</property>
                   </widget>
                   <packing>
                     <property name="left_attach">2</property>
                     <property name="right_attach">3</property>
-                    <property name="top_attach">3</property>
-                    <property name="bottom_attach">4</property>
+                    <property name="top_attach">2</property>
+                    <property name="bottom_attach">3</property>
                   </packing>
                 </child>
                 <child>
@@ -355,51 +347,59 @@
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkEntry" id="password_entry">
+                  <widget class="GtkCheckButton" id="save_credential_check">
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="max_length">8</property>
-                    <property name="visibility">False</property>
-                    <property name="activates_default">True</property>
+                    <property name="label" translatable="yes">_Remember this credential</property>
+                    <property name="use_underline">True</property>
+                    <property name="response_id">0</property>
+                    <property name="draw_indicator">True</property>
                   </widget>
                   <packing>
                     <property name="left_attach">2</property>
                     <property name="right_attach">3</property>
-                    <property name="top_attach">2</property>
-                    <property name="bottom_attach">3</property>
+                    <property name="top_attach">3</property>
+                    <property name="bottom_attach">4</property>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="password_label">
+                  <widget class="GtkLabel" id="username_label">
                     <property name="visible">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
                     <property name="xalign">0</property>
-                    <property name="label" translatable="yes">_Password:</property>
+                    <property name="label" translatable="yes">_Username:</property>
                     <property name="use_underline">True</property>
-                    <property name="mnemonic_widget">password_entry</property>
+                    <property name="mnemonic_widget">username_entry</property>
                   </widget>
                   <packing>
                     <property name="left_attach">1</property>
                     <property name="right_attach">2</property>
-                    <property name="top_attach">2</property>
-                    <property name="bottom_attach">3</property>
+                    <property name="top_attach">1</property>
+                    <property name="bottom_attach">2</property>
                   </packing>
                 </child>
                 <child>
-                  <widget class="GtkLabel" id="label19">
+                  <widget class="GtkEntry" id="username_entry">
                     <property name="visible">True</property>
+                    <property name="can_focus">True</property>
                     <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                    <property name="xalign">0</property>
-                    <property name="label" translatable="yes">Host:</property>
-                    <property name="use_underline">True</property>
-                    <property name="mnemonic_widget">password_entry</property>
+                    <property name="max_length">254</property>
+                    <property name="activates_default">True</property>
                   </widget>
                   <packing>
-                    <property name="left_attach">1</property>
-                    <property name="right_attach">2</property>
+                    <property name="left_attach">2</property>
+                    <property name="right_attach">3</property>
+                    <property name="top_attach">1</property>
+                    <property name="bottom_attach">2</property>
                   </packing>
                 </child>
+                <child>
+                  <widget class="GtkLabel" id="label12">
+                    <property name="visible">True</property>
+                    <property name="label">   </property>
+                  </widget>
+                </child>
               </widget>
               <packing>
                 <property name="position">1</property>
@@ -614,24 +614,32 @@
               <placeholder/>
             </child>
             <child>
-              <widget class="GtkLabel" id="label16">
+              <widget class="GtkEntry" id="edit_bookmark_host_entry">
                 <property name="visible">True</property>
+                <property name="can_focus">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="label">  </property>
+                <property name="tooltip" translatable="yes">host or host:display or host::port</property>
+                <property name="activates_default">True</property>
               </widget>
+              <packing>
+                <property name="left_attach">2</property>
+                <property name="right_attach">3</property>
+                <property name="top_attach">1</property>
+                <property name="bottom_attach">2</property>
+              </packing>
             </child>
             <child>
-              <widget class="GtkLabel" id="label14">
+              <widget class="GtkEntry" id="edit_bookmark_name_entry">
+                <property name="width_request">250</property>
                 <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="is_focus">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="xalign">0</property>
-                <property name="label" translatable="yes">_Bookmark name:</property>
-                <property name="use_underline">True</property>
-                <property name="mnemonic_widget">edit_bookmark_name_entry</property>
+                <property name="activates_default">True</property>
               </widget>
               <packing>
-                <property name="left_attach">1</property>
-                <property name="right_attach">2</property>
+                <property name="left_attach">2</property>
+                <property name="right_attach">3</property>
               </packing>
             </child>
             <child>
@@ -651,33 +659,25 @@
               </packing>
             </child>
             <child>
-              <widget class="GtkEntry" id="edit_bookmark_name_entry">
-                <property name="width_request">250</property>
+              <widget class="GtkLabel" id="label14">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
-                <property name="is_focus">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="activates_default">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">_Bookmark name:</property>
+                <property name="use_underline">True</property>
+                <property name="mnemonic_widget">edit_bookmark_name_entry</property>
               </widget>
               <packing>
-                <property name="left_attach">2</property>
-                <property name="right_attach">3</property>
+                <property name="left_attach">1</property>
+                <property name="right_attach">2</property>
               </packing>
             </child>
             <child>
-              <widget class="GtkEntry" id="edit_bookmark_host_entry">
+              <widget class="GtkLabel" id="label16">
                 <property name="visible">True</property>
-                <property name="can_focus">True</property>
                 <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="tooltip" translatable="yes">host or host:display or host::port</property>
-                <property name="activates_default">True</property>
+                <property name="label">  </property>
               </widget>
-              <packing>
-                <property name="left_attach">2</property>
-                <property name="right_attach">3</property>
-                <property name="top_attach">1</property>
-                <property name="bottom_attach">2</property>
-              </packing>
             </child>
           </widget>
           <packing>
@@ -713,21 +713,10 @@
               <placeholder/>
             </child>
             <child>
-              <widget class="GtkLabel" id="label11">
-                <property name="visible">True</property>
-                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
-                <property name="label">  </property>
-              </widget>
-              <packing>
-                <property name="x_options"></property>
-                <property name="y_options"></property>
-              </packing>
-            </child>
-            <child>
-              <widget class="GtkCheckButton" id="edit_fullscreen_check">
+              <widget class="GtkCheckButton" id="edit_scaling_check">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="label" translatable="yes">_Full screen</property>
+                <property name="label" translatable="yes">_Scaling</property>
                 <property name="use_underline">True</property>
                 <property name="response_id">0</property>
                 <property name="draw_indicator">True</property>
@@ -735,6 +724,8 @@
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
+                <property name="top_attach">2</property>
+                <property name="bottom_attach">3</property>
               </packing>
             </child>
             <child>
@@ -754,10 +745,10 @@
               </packing>
             </child>
             <child>
-              <widget class="GtkCheckButton" id="edit_scaling_check">
+              <widget class="GtkCheckButton" id="edit_fullscreen_check">
                 <property name="visible">True</property>
                 <property name="can_focus">True</property>
-                <property name="label" translatable="yes">_Scaling</property>
+                <property name="label" translatable="yes">_Full screen</property>
                 <property name="use_underline">True</property>
                 <property name="response_id">0</property>
                 <property name="draw_indicator">True</property>
@@ -765,8 +756,17 @@
               <packing>
                 <property name="left_attach">1</property>
                 <property name="right_attach">2</property>
-                <property name="top_attach">2</property>
-                <property name="bottom_attach">3</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label11">
+                <property name="visible">True</property>
+                <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>
+                <property name="label">  </property>
+              </widget>
+              <packing>
+                <property name="x_options"></property>
+                <property name="y_options"></property>
               </packing>
             </child>
           </widget>
@@ -815,4 +815,126 @@
       </widget>
     </child>
   </widget>
+  <widget class="GtkDialog" id="preferences_dialog">
+    <property name="width_request">300</property>
+    <property name="height_request">200</property>
+    <property name="border_width">5</property>
+    <property name="title" translatable="yes">Preferences</property>
+    <property name="resizable">False</property>
+    <property name="modal">True</property>
+    <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
+    <property name="destroy_with_parent">True</property>
+    <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+    <property name="has_separator">False</property>
+    <child internal-child="vbox">
+      <widget class="GtkVBox" id="dialog-vbox5">
+        <property name="visible">True</property>
+        <child>
+          <widget class="GtkVBox" id="vbox3">
+            <property name="visible">True</property>
+            <property name="spacing">6</property>
+            <child>
+              <widget class="GtkLabel" id="label17">
+                <property name="visible">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">&lt;b&gt;Interface&lt;/b&gt;</property>
+                <property name="use_markup">True</property>
+              </widget>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">False</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkHBox" id="hbox1">
+                <property name="visible">True</property>
+                <property name="spacing">12</property>
+                <child>
+                  <widget class="GtkLabel" id="label18">
+                    <property name="visible">True</property>
+                    <property name="label">  </property>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                  </packing>
+                </child>
+                <child>
+                  <widget class="GtkVBox" id="vbox4">
+                    <property name="visible">True</property>
+                    <property name="spacing">6</property>
+                    <child>
+                      <widget class="GtkCheckButton" id="always_show_tabs_check">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="tooltip" translatable="yes">Whether we should show tabs even when there is only one active connection</property>
+                        <property name="label" translatable="yes">_Always show tabs</property>
+                        <property name="use_underline">True</property>
+                        <property name="xalign">0</property>
+                        <property name="response_id">0</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <widget class="GtkCheckButton" id="show_accels_check">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="tooltip" translatable="yes">Whether we should show the menu accelerators (shortcut keys)</property>
+                        <property name="label" translatable="yes">_Show menu shortcuts</property>
+                        <property name="use_underline">True</property>
+                        <property name="xalign">0</property>
+                        <property name="response_id">0</property>
+                        <property name="draw_indicator">True</property>
+                      </widget>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="padding">6</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child internal-child="action_area">
+          <widget class="GtkHButtonBox" id="dialog-action_area5">
+            <property name="visible">True</property>
+            <property name="layout_style">GTK_BUTTONBOX_END</property>
+            <child>
+              <widget class="GtkButton" id="button9">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="receives_default">True</property>
+                <property name="label" translatable="yes">gtk-close</property>
+                <property name="use_stock">True</property>
+                <property name="response_id">0</property>
+              </widget>
+            </child>
+          </widget>
+          <packing>
+            <property name="expand">False</property>
+            <property name="pack_type">GTK_PACK_END</property>
+          </packing>
+        </child>
+      </widget>
+    </child>
+  </widget>
 </glade-interface>

Modified: trunk/data/vinagre.schemas.in
==============================================================================
--- trunk/data/vinagre.schemas.in	(original)
+++ trunk/data/vinagre.schemas.in	Fri Nov 14 23:51:56 2008
@@ -66,7 +66,7 @@
 			<applyto>/apps/vinagre/show_accels</applyto>
 			<owner>vinagre</owner>
 			<type>bool</type>
-			<default>true</default>
+			<default>false</default>
 			<locale name="C">
 				<short>Whether we should show the menu accelerators (shortcut keys)</short>
 				<long>Set to "false" to disable menu shortcuts. Set to "true" to enable them. Note that if they are enabled, those keys will be intercepted by the menu and will not be sent to the remote host.</long>

Modified: trunk/src/vinagre-commands.c
==============================================================================
--- trunk/src/vinagre-commands.c	(original)
+++ trunk/src/vinagre-commands.c	Fri Nov 14 23:51:56 2008
@@ -191,6 +191,14 @@
   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,

Modified: trunk/src/vinagre-commands.h
==============================================================================
--- trunk/src/vinagre-commands.h	(original)
+++ trunk/src/vinagre-commands.h	Fri Nov 14 23:51:56 2008
@@ -46,6 +46,9 @@
 void		vinagre_cmd_machine_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,

Modified: trunk/src/vinagre-prefs.c
==============================================================================
--- trunk/src/vinagre-prefs.c	(original)
+++ trunk/src/vinagre-prefs.c	Fri Nov 14 23:51:56 2008
@@ -20,7 +20,9 @@
 
 #include <gconf/gconf-client.h>
 #include <glib/gi18n.h>
+#include <glade/glade.h>
 #include "vinagre-prefs.h"
+#include "vinagre-utils.h"
 
 #define VINAGRE_BASE_KEY		"/apps/vinagre"
 #define VM_ALWAYS_SHOW_TABS		VINAGRE_BASE_KEY "/always_show_tabs"
@@ -368,7 +370,7 @@
 				   g_param_spec_boolean ("show-accels",
 							 "Show menu accelerators",
 							 "Whether we should show the menu accelerators (keyboard shortcuts)",
-							 TRUE,
+							 FALSE,
 							 G_PARAM_READWRITE));
   g_object_class_install_property (object_class,
 				   PROP_HISTORY_SIZE,
@@ -379,4 +381,86 @@
 						     G_PARAM_READWRITE));
 
 }
+
+/* Preferences dialog */
+
+typedef struct {
+  GladeXML  *xml;
+  GtkWidget *dialog;
+  GtkWidget *show_tabs;
+  GtkWidget *show_accels;
+} VinagrePrefsDialog;
+
+static void
+vinagre_prefs_dialog_setup (VinagrePrefsDialog *dialog)
+{
+  gboolean show_accels, show_tabs;
+
+  g_object_get (vinagre_prefs_get_default (),
+		"show-accels", &show_accels,
+		"always-show-tabs", &show_tabs,
+		NULL);
+
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->show_accels), show_accels);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->show_tabs), show_tabs);
+}
+
+static void
+vinagre_prefs_dialog_quit (VinagrePrefsDialog *dialog)
+{
+  gtk_widget_destroy (dialog->dialog);
+  g_object_unref (dialog->xml);
+  g_free (dialog);
+  dialog = NULL;
+}
+
+static void
+vinagre_prefs_dialog_show_tabs_cb (VinagrePrefsDialog *dialog)
+{
+  g_object_set (vinagre_prefs_get_default (),
+		"always-show-tabs", gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->show_tabs)),
+		NULL);
+}
+
+static void
+vinagre_prefs_dialog_show_accels_cb (VinagrePrefsDialog *dialog)
+{
+  g_object_set (vinagre_prefs_get_default (),
+		"show-accels", gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->show_accels)),
+		NULL);
+}
+
+void
+vinagre_prefs_dialog_show (VinagreWindow *window)
+{
+  VinagrePrefsDialog *dialog;
+
+  dialog = g_new (VinagrePrefsDialog, 1);
+
+  dialog->xml = glade_xml_new (vinagre_utils_get_glade_filename (), NULL, NULL);
+  dialog->dialog = glade_xml_get_widget (dialog->xml, "preferences_dialog");
+  gtk_window_set_transient_for (GTK_WINDOW (dialog->dialog), GTK_WINDOW (window));
+
+  dialog->show_tabs = glade_xml_get_widget (dialog->xml, "always_show_tabs_check");
+  dialog->show_accels = glade_xml_get_widget (dialog->xml, "show_accels_check");
+
+  vinagre_prefs_dialog_setup (dialog);
+
+  g_signal_connect_swapped (dialog->dialog,
+			    "response", 
+                            G_CALLBACK (vinagre_prefs_dialog_quit),
+                            dialog);
+
+  g_signal_connect_swapped (dialog->show_tabs,
+			    "toggled",
+			     G_CALLBACK (vinagre_prefs_dialog_show_tabs_cb),
+			     dialog);
+
+  g_signal_connect_swapped (dialog->show_accels,
+			    "toggled",
+			     G_CALLBACK (vinagre_prefs_dialog_show_accels_cb),
+			     dialog);
+
+  gtk_widget_show_all (dialog->dialog);
+}
 /* vim: set ts=8: */

Modified: trunk/src/vinagre-prefs.h
==============================================================================
--- trunk/src/vinagre-prefs.h	(original)
+++ trunk/src/vinagre-prefs.h	Fri Nov 14 23:51:56 2008
@@ -22,6 +22,7 @@
 #define _VINAGRE_PREFS_H_
 
 #include <glib-object.h>
+#include "vinagre-window.h"
 
 G_BEGIN_DECLS
 
@@ -51,6 +52,7 @@
 
 VinagrePrefs	*vinagre_prefs_get_default (void);
 
+void		vinagre_prefs_dialog_show (VinagreWindow *window);
 G_END_DECLS
 
 #endif /* _VINAGRE_PREFS_H_ */

Modified: trunk/src/vinagre-ui.h
==============================================================================
--- trunk/src/vinagre-ui.h	(original)
+++ trunk/src/vinagre-ui.h	Fri Nov 14 23:51:56 2008
@@ -43,6 +43,10 @@
     N_("Open a .VNC file"), G_CALLBACK (vinagre_cmd_machine_open) },
   { "MachineQuit", GTK_STOCK_QUIT, NULL, "<control>Q",
     N_("Quit the program"), G_CALLBACK (vinagre_cmd_machine_quit) },
+
+  /* Edit menu */
+  { "EditPreferences", GTK_STOCK_PREFERENCES, NULL, NULL,
+    N_("Edit the application preferences"), G_CALLBACK (vinagre_cmd_edit_preferences) },
   	
   /* Bookmarks menu */
   { "BookmarksOpen", GTK_STOCK_CONNECT, N_("_Open bookmark"), NULL,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]