[Xfce4-commits] <xfce4-clipman-plugin:master> Add "Tweaks" tab in the Settings dialog

Mike Massonnet noreply at xfce.org
Fri Oct 28 14:28:01 CEST 2011


Updating branch refs/heads/master
         to 7e17c504b56e484b5ffbf75f838968bb10acd9e8 (commit)
       from 0ee4877220d98b4e1239ed9e7ebfca8ffa8b2078 (commit)

commit 7e17c504b56e484b5ffbf75f838968bb10acd9e8
Author: Mike Massonnet <mmassonnet at xfce.org>
Date:   Thu Oct 27 23:25:06 2011 +0200

    Add "Tweaks" tab in the Settings dialog
    
    Modified the settings-dialog.ui file to include a new tab with
    existing hidden settings.
    
    Binded all the checkboxes to their Xfconf properties.

 panel-plugin/common.h                 |    4 +-
 panel-plugin/settings-dialog.ui       |  138 +++++++++++++++++++++++++++++----
 panel-plugin/xfce4-clipman-settings.c |   27 ++++++-
 3 files changed, 147 insertions(+), 22 deletions(-)

diff --git a/panel-plugin/common.h b/panel-plugin/common.h
index bab4795..a37f1c8 100644
--- a/panel-plugin/common.h
+++ b/panel-plugin/common.h
@@ -22,15 +22,13 @@
  * Default values
  */
 
-/* History */
 #define DEFAULT_MAX_TEXTS_IN_HISTORY                    10
 #define DEFAULT_MAX_IMAGES_IN_HISTORY                   1
 #define DEFAULT_SAVE_ON_QUIT                            TRUE
+#define DEFAULT_POPUP_AT_POINTER                        FALSE
 #define DEFAULT_REVERSE_ORDER                           FALSE
 #define DEFAULT_REORDER_ITEMS                           TRUE
 #define DEFAULT_SKIP_ACTION_ON_KEY_DOWN                 FALSE
-
-/* Collector */
 #define DEFAULT_ADD_PRIMARY_CLIPBOARD                   FALSE
 #define DEFAULT_HISTORY_IGNORE_PRIMARY_CLIPBOARD        TRUE
 #define DEFAULT_ENABLE_ACTIONS                          FALSE
diff --git a/panel-plugin/settings-dialog.ui b/panel-plugin/settings-dialog.ui
index 4880b2e..71151b3 100644
--- a/panel-plugin/settings-dialog.ui
+++ b/panel-plugin/settings-dialog.ui
@@ -17,7 +17,7 @@
     <property name="title">Clipman</property>
     <property name="window_position">center</property>
     <property name="default_width">340</property>
-    <property name="default_height">420</property>
+    <property name="default_height">390</property>
     <property name="destroy_with_parent">True</property>
     <property name="icon_name">xfce4-clipman-plugin</property>
     <property name="type_hint">dialog</property>
@@ -148,19 +148,6 @@
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkCheckButton" id="reverse-order">
-                                <property name="label" translatable="yes">Reverse order</property>
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="receives_default">False</property>
-                                <property name="tooltip_text" translatable="yes">If checked, reverse order of the history shown in the menu</property>
-                                <property name="draw_indicator">True</property>
-                              </object>
-                              <packing>
-                                <property name="position">3</property>
-                              </packing>
-                            </child>
-                            <child>
                               <object class="GtkHBox" id="hbox-history-size">
                                 <property name="visible">True</property>
                                 <property name="spacing">4</property>
@@ -193,7 +180,7 @@
                                 </child>
                               </object>
                               <packing>
-                                <property name="position">4</property>
+                                <property name="position">3</property>
                               </packing>
                             </child>
                           </object>
@@ -382,6 +369,127 @@
                 <property name="tab_fill">False</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkVBox" id="vbox-tweaks">
+                <property name="visible">True</property>
+                <property name="border_width">6</property>
+                <property name="orientation">vertical</property>
+                <property name="spacing">6</property>
+                <child>
+                  <object class="GtkHBox" id="hbox1">
+                    <property name="visible">True</property>
+                    <property name="tooltip_text" translatable="yes">Automatically paste a selected item from the history</property>
+                    <property name="spacing">4</property>
+                    <child>
+                      <object class="GtkLabel" id="label-paste-on-activate">
+                        <property name="visible">True</property>
+                        <property name="xalign">0</property>
+                        <property name="label" translatable="yes">_Paste on activate:</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">combobox-paste-on-activate</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkComboBox" id="combobox-paste-on-activate">
+                        <property name="visible">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">False</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="popup-at-pointer">
+                    <property name="label" translatable="yes">P_osition menu at mouse pointer</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="tooltip_text" translatable="yes">Popup the menu at the mouse pointer position, only for the xfce4-popup-clipman command</property>
+                    <property name="use_underline">True</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="GtkCheckButton" id="reorder-items">
+                    <property name="label" translatable="yes">_Reorder history items</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="tooltip_text" translatable="yes">Push last copied text to the top of the history, useful to reorder old items</property>
+                    <property name="use_underline">True</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="reverse-order">
+                    <property name="label" translatable="yes">Re_verse history order</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="tooltip_text" translatable="yes">Reverse order of the history shown in the menu</property>
+                    <property name="use_underline">True</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>
+                <child>
+                  <object class="GtkCheckButton" id="skip-action">
+                    <property name="label" translatable="yes">_Skip action by holding Control</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="tooltip_text" translatable="yes">When the selection is done (mouse or keyboard) and the Control key is still pressed down, the popup menu for matched actions will be skipped</property>
+                    <property name="use_underline">True</property>
+                    <property name="draw_indicator">True</property>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">False</property>
+                    <property name="position">4</property>
+                  </packing>
+                </child>
+              </object>
+              <packing>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child type="tab">
+              <object class="GtkLabel" id="label-tweaks">
+                <property name="visible">True</property>
+                <property name="label" translatable="yes">Tweaks</property>
+              </object>
+              <packing>
+                <property name="position">2</property>
+                <property name="tab_fill">False</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="position">1</property>
diff --git a/panel-plugin/xfce4-clipman-settings.c b/panel-plugin/xfce4-clipman-settings.c
index f1672f4..cc35c91 100644
--- a/panel-plugin/xfce4-clipman-settings.c
+++ b/panel-plugin/xfce4-clipman-settings.c
@@ -90,8 +90,6 @@ prop_dialog_run (void)
                                 DEFAULT_HISTORY_IGNORE_PRIMARY_CLIPBOARD);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "save-on-quit")),
                                 DEFAULT_SAVE_ON_QUIT);
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "reverse-order")),
-                                DEFAULT_REVERSE_ORDER);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "store-an-image")),
                                 (gboolean)DEFAULT_MAX_IMAGES_IN_HISTORY);
   gtk_spin_button_set_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, "max-texts-in-history")),
@@ -103,8 +101,6 @@ prop_dialog_run (void)
                           gtk_builder_get_object (builder, "history-ignore-selections"), "active");
   xfconf_g_property_bind (xfconf_channel, "/settings/save-on-quit", G_TYPE_BOOLEAN,
                           gtk_builder_get_object (builder, "save-on-quit"), "active");
-  xfconf_g_property_bind (xfconf_channel, "/tweaks/reverse-menu-order", G_TYPE_BOOLEAN,
-                          gtk_builder_get_object (builder, "reverse-order"), "active");
   xfconf_g_property_bind (xfconf_channel, "/settings/max-images-in-history", G_TYPE_UINT,
                           gtk_builder_get_object (builder, "store-an-image"), "active");
   xfconf_g_property_bind (xfconf_channel, "/settings/max-texts-in-history", G_TYPE_UINT,
@@ -151,6 +147,29 @@ prop_dialog_run (void)
   g_signal_connect_swapped (gtk_builder_get_object (builder, "action-dialog-button-cancel"), "clicked",
                              G_CALLBACK (gtk_dialog_response), action_dialog);
 
+  /* Tweaks tab */
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "popup-at-pointer")),
+                                DEFAULT_POPUP_AT_POINTER);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "reorder-items")),
+                                DEFAULT_REORDER_ITEMS);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "reverse-order")),
+                                DEFAULT_REVERSE_ORDER);
+  gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "skip-action")),
+                            DEFAULT_ENABLE_ACTIONS);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "skip-action")),
+                                DEFAULT_SKIP_ACTION_ON_KEY_DOWN);
+
+  xfconf_g_property_bind (xfconf_channel, "/tweaks/popup-at-pointer", G_TYPE_BOOLEAN,
+                          gtk_builder_get_object (builder, "popup-at-pointer"), "active");
+  xfconf_g_property_bind (xfconf_channel, "/tweaks/reorder-items", G_TYPE_BOOLEAN,
+                          gtk_builder_get_object (builder, "reorder-items"), "active");
+  xfconf_g_property_bind (xfconf_channel, "/tweaks/reverse-menu-order", G_TYPE_BOOLEAN,
+                          gtk_builder_get_object (builder, "reverse-order"), "active");
+  xfconf_g_property_bind (xfconf_channel, "/settings/enable-actions", G_TYPE_BOOLEAN,
+                          gtk_builder_get_object (builder, "skip-action"), "sensitive");
+  xfconf_g_property_bind (xfconf_channel, "/tweaks/skip-action-on-key-down", G_TYPE_BOOLEAN,
+                          gtk_builder_get_object (builder, "skip-action"), "active");
+
   /* Run the dialog */
   while ((gtk_dialog_run (GTK_DIALOG (settings_dialog))) == 2);
 


More information about the Xfce4-commits mailing list