[Xfce4-commits] [panel-plugins/xfce4-clipman-plugin] 01/03: settings: Revamp UI and add max-menu-items setting

noreply at xfce.org noreply at xfce.org
Tue Mar 24 22:08:06 CET 2020


This is an automated email from the git hooks/post-receive script.

o   c   h   o   s   i       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository panel-plugins/xfce4-clipman-plugin.

commit f58a77bae6d31d8231da64a9018352733554544d
Author: Simon Steinbeiss <simon.steinbeiss at elfenbeinturm.at>
Date:   Tue Mar 24 21:52:58 2020 +0100

    settings: Revamp UI and add max-menu-items setting
---
 panel-plugin/common.h                 |   3 +-
 panel-plugin/plugin.c                 |   2 +
 panel-plugin/settings-dialog.ui       | 281 +++++++++++++++++++++-------------
 panel-plugin/xfce4-clipman-settings.c | 105 +++++++------
 4 files changed, 230 insertions(+), 161 deletions(-)

diff --git a/panel-plugin/common.h b/panel-plugin/common.h
index 17c7427..b411e76 100644
--- a/panel-plugin/common.h
+++ b/panel-plugin/common.h
@@ -22,7 +22,8 @@
  * Default values
  */
 
-#define DEFAULT_MAX_TEXTS_IN_HISTORY                    10
+#define DEFAULT_MAX_MENU_ITEMS                          15
+#define DEFAULT_MAX_TEXTS_IN_HISTORY                    100
 #define DEFAULT_MAX_IMAGES_IN_HISTORY                   1
 #define DEFAULT_SAVE_ON_QUIT                            TRUE
 #define DEFAULT_POPUP_AT_POINTER                        FALSE
diff --git a/panel-plugin/plugin.c b/panel-plugin/plugin.c
index b6d7878..efc308c 100644
--- a/panel-plugin/plugin.c
+++ b/panel-plugin/plugin.c
@@ -132,6 +132,8 @@ plugin_register (void)
   xfconf_g_property_bind (plugin->channel, "/settings/show-qr-code",
                           G_TYPE_BOOLEAN, plugin->menu, "show-qr-code");
 #endif
+  xfconf_g_property_bind (plugin->channel, "/tweaks/max-menu-items",
+                          G_TYPE_UINT, plugin->menu, "max-menu-items");
   xfconf_g_property_bind (plugin->channel, "/tweaks/reverse-menu-order",
                           G_TYPE_BOOLEAN, plugin->menu, "reverse-order");
   xfconf_g_property_bind (plugin->channel, "/tweaks/paste-on-activate",
diff --git a/panel-plugin/settings-dialog.ui b/panel-plugin/settings-dialog.ui
index 3ff3bc6..5c8134f 100644
--- a/panel-plugin/settings-dialog.ui
+++ b/panel-plugin/settings-dialog.ui
@@ -52,6 +52,7 @@
                 <property name="expand">False</property>
                 <property name="fill">False</property>
                 <property name="position">0</property>
+                <property name="secondary">True</property>
               </packing>
             </child>
             <child>
@@ -73,7 +74,6 @@
           <packing>
             <property name="expand">False</property>
             <property name="fill">False</property>
-            <property name="pack_type">end</property>
             <property name="position">0</property>
           </packing>
         </child>
@@ -109,7 +109,7 @@
                             <property name="spacing">6</property>
                             <child>
                               <object class="GtkCheckButton" id="add-selections">
-                                <property name="label" translatable="yes">Sync _selections</property>
+                                <property name="label" translatable="yes">Sync mouse _selections</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
@@ -126,7 +126,7 @@
                             </child>
                             <child>
                               <object class="GtkCheckButton" id="show-qr-code">
-                                <property name="label" translatable="yes">Show _QR-Code</property>
+                                <property name="label" translatable="yes">_QR-Code support</property>
                                 <property name="visible">True</property>
                                 <property name="can_focus">True</property>
                                 <property name="receives_default">False</property>
@@ -141,15 +141,54 @@
                                 <property name="position">1</property>
                               </packing>
                             </child>
+                            <child>
+                              <object class="GtkBox" id="hbox1">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</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="can_focus">False</property>
+                                    <property name="label" translatable="yes">_Paste instantly:</property>
+                                    <property name="use_underline">True</property>
+                                    <property name="mnemonic_widget">combobox-paste-on-activate</property>
+                                    <property name="xalign">0</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <object class="GtkComboBoxText" id="combobox-paste-on-activate">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                  </object>
+                                  <packing>
+                                    <property name="expand">True</property>
+                                    <property name="fill">True</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">2</property>
+                              </packing>
+                            </child>
                           </object>
                         </child>
                       </object>
                     </child>
                     <child type="label">
-                      <object class="GtkLabel" id="label-behavior">
+                      <object class="GtkLabel" id="label-general">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="label" translatable="yes"><b>Behavior</b></property>
+                        <property name="label" translatable="yes"><b>General</b></property>
                         <property name="use_markup">True</property>
                       </object>
                     </child>
@@ -179,84 +218,47 @@
                             <property name="orientation">vertical</property>
                             <property name="spacing">6</property>
                             <child>
-                              <object class="GtkCheckButton" id="save-on-quit">
-                                <property name="label" translatable="yes">Save on _quit</property>
+                              <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">If checked, this option will restore the history on every new Xfce session</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">True</property>
+                                <property name="fill">False</property>
                                 <property name="position">0</property>
                               </packing>
                             </child>
                             <child>
-                              <object class="GtkCheckButton" id="store-an-image">
-                                <property name="label" translatable="yes">Store last copied _image</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, this option allows to store one image inside the history</property>
-                                <property name="use_underline">True</property>
-                                <property name="draw_indicator">True</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkCheckButton" id="history-ignore-selections">
-                                <property name="label" translatable="yes">Ignore s_elections</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">If checked, the selections won't affect the history except the manual copies</property>
-                                <property name="use_underline">True</property>
-                                <property name="draw_indicator">True</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">2</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkBox" id="hbox-history-size">
+                              <object class="GtkBox">
                                 <property name="visible">True</property>
                                 <property name="can_focus">False</property>
-                                <property name="spacing">4</property>
                                 <child>
-                                  <object class="GtkLabel" id="label-history-size">
+                                  <object class="GtkLabel">
                                     <property name="visible">True</property>
                                     <property name="can_focus">False</property>
-                                    <property name="label" translatable="yes">Size of the _history:</property>
-                                    <property name="use_underline">True</property>
-                                    <property name="mnemonic_widget">max-texts-in-history</property>
+                                    <property name="label" translatable="yes">Maximum items:</property>
                                     <property name="xalign">0</property>
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
-                                    <property name="fill">False</property>
+                                    <property name="fill">True</property>
                                     <property name="position">0</property>
                                   </packing>
                                 </child>
                                 <child>
-                                  <object class="GtkSpinButton" id="max-texts-in-history">
+                                  <object class="GtkSpinButton" id="max-menu-items">
                                     <property name="visible">True</property>
                                     <property name="can_focus">True</property>
-                                    <property name="invisible_char">•</property>
-                                    <property name="adjustment">adjustment1</property>
                                   </object>
                                   <packing>
                                     <property name="expand">False</property>
-                                    <property name="fill">False</property>
+                                    <property name="fill">True</property>
+                                    <property name="pack_type">end</property>
                                     <property name="position">1</property>
                                   </packing>
                                 </child>
@@ -264,7 +266,7 @@
                               <packing>
                                 <property name="expand">False</property>
                                 <property name="fill">True</property>
-                                <property name="position">3</property>
+                                <property name="position">1</property>
                               </packing>
                             </child>
                           </object>
@@ -272,10 +274,10 @@
                       </object>
                     </child>
                     <child type="label">
-                      <object class="GtkLabel" id="label-history">
+                      <object class="GtkLabel" id="label-menu">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="label" translatable="yes"><b>History</b></property>
+                        <property name="label" translatable="yes"><b>Menu</b></property>
                         <property name="use_markup">True</property>
                       </object>
                     </child>
@@ -289,10 +291,11 @@
               </object>
             </child>
             <child type="tab">
-              <object class="GtkLabel" id="label-general">
+              <object class="GtkLabel" id="label-behavior">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="label" translatable="yes">General</property>
+                <property name="label" translatable="yes">_Behavior</property>
+                <property name="use_underline">True</property>
               </object>
               <packing>
                 <property name="tab_fill">False</property>
@@ -344,6 +347,60 @@ Otherwise the menu will only appear when calling "xfce4-popup-clipman-actions" (
                   </packing>
                 </child>
                 <child>
+                  <object class="GtkRevealer" id="action-revealer">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="reveal_child">True</property>
+                    <child>
+                      <object class="GtkBox">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="margin_left">6</property>
+                        <property name="orientation">vertical</property>
+                        <child>
+                          <object class="GtkRadioButton" id="skip-action-1">
+                            <property name="label" translatable="yes">_Show actions 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 shown</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">0</property>
+                          </packing>
+                        </child>
+                        <child>
+                          <object class="GtkRadioButton" id="skip-action-2">
+                            <property name="label" translatable="yes">S_kip actions 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="active">True</property>
+                            <property name="draw_indicator">True</property>
+                            <property name="group">skip-action-1</property>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                            <property name="position">1</property>
+                          </packing>
+                        </child>
+                      </object>
+                    </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">1</property>
+                  </packing>
+                </child>
+                <child>
                   <object class="GtkBox" id="hbox2">
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
@@ -487,7 +544,8 @@ Otherwise the menu will only appear when calling "xfce4-popup-clipman-actions" (
               <object class="GtkLabel" id="label-actions">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="label" translatable="yes">Actions</property>
+                <property name="label" translatable="yes">_Actions</property>
+                <property name="use_underline">True</property>
               </object>
               <packing>
                 <property name="position">1</property>
@@ -502,57 +560,34 @@ Otherwise the menu will only appear when calling "xfce4-popup-clipman-actions" (
                 <property name="orientation">vertical</property>
                 <property name="spacing">6</property>
                 <child>
-                  <object class="GtkBox" id="hbox1">
+                  <object class="GtkCheckButton" id="save-on-quit">
+                    <property name="label" translatable="yes">Remember history</property>
                     <property name="visible">True</property>
-                    <property name="can_focus">False</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="can_focus">False</property>
-                        <property name="label" translatable="yes">_Paste instantly:</property>
-                        <property name="use_underline">True</property>
-                        <property name="mnemonic_widget">combobox-paste-on-activate</property>
-                        <property name="xalign">0</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">0</property>
-                      </packing>
-                    </child>
-                    <child>
-                      <object class="GtkComboBoxText" id="combobox-paste-on-activate">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                      </object>
-                      <packing>
-                        <property name="expand">False</property>
-                        <property name="fill">False</property>
-                        <property name="position">1</property>
-                      </packing>
-                    </child>
+                    <property name="can_focus">True</property>
+                    <property name="receives_default">False</property>
+                    <property name="tooltip_text" translatable="yes">If checked, this option will restore the history on every new Xfce session</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="fill">True</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>
+                  <object class="GtkCheckButton" id="store-an-image">
+                    <property name="label" translatable="yes">Remember last copied _image</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="tooltip_text" translatable="yes">If checked, this option allows to store one image inside the history</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="fill">True</property>
                     <property name="position">1</property>
                   </packing>
                 </child>
@@ -589,35 +624,62 @@ Otherwise the menu will only appear when calling "xfce4-popup-clipman-actions" (
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkRadioButton" id="skip-action-1">
-                    <property name="label" translatable="yes">_Show actions by holding Control</property>
+                  <object class="GtkCheckButton" id="history-ignore-selections">
+                    <property name="label" translatable="yes">Ignore mouse s_elections</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 shown</property>
+                    <property name="has_tooltip">True</property>
+                    <property name="tooltip_text" translatable="yes">If checked, the selections won't affect the history except the manual copies</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="fill">True</property>
                     <property name="position">4</property>
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkRadioButton" id="skip-action-2">
-                    <property name="label" translatable="yes">S_kip actions by holding Control</property>
+                  <object class="GtkBox" id="hbox-history-size">
                     <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>
-                    <property name="group">skip-action-1</property>
+                    <property name="can_focus">False</property>
+                    <property name="spacing">4</property>
+                    <child>
+                      <object class="GtkLabel" id="label-history-size">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes">Size of the _history:</property>
+                        <property name="use_underline">True</property>
+                        <property name="mnemonic_widget">max-texts-in-history</property>
+                        <property name="xalign">0</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="position">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkSpinButton" id="max-texts-in-history">
+                        <property name="visible">True</property>
+                        <property name="can_focus">True</property>
+                        <property name="invisible_char">•</property>
+                        <property name="text" translatable="yes">5</property>
+                        <property name="adjustment">adjustment1</property>
+                        <property name="value">5</property>
+                      </object>
+                      <packing>
+                        <property name="expand">False</property>
+                        <property name="fill">False</property>
+                        <property name="pack_type">end</property>
+                        <property name="position">1</property>
+                      </packing>
+                    </child>
                   </object>
                   <packing>
                     <property name="expand">False</property>
-                    <property name="fill">False</property>
+                    <property name="fill">True</property>
                     <property name="position">5</property>
                   </packing>
                 </child>
@@ -627,10 +689,11 @@ Otherwise the menu will only appear when calling "xfce4-popup-clipman-actions" (
               </packing>
             </child>
             <child type="tab">
-              <object class="GtkLabel" id="label-tweaks">
+              <object class="GtkLabel" id="label-histor">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="label" translatable="yes">Tweaks</property>
+                <property name="label" translatable="yes">H_istory</property>
+                <property name="use_underline">True</property>
               </object>
               <packing>
                 <property name="position">2</property>
diff --git a/panel-plugin/xfce4-clipman-settings.c b/panel-plugin/xfce4-clipman-settings.c
index e0b17b4..975562a 100644
--- a/panel-plugin/xfce4-clipman-settings.c
+++ b/panel-plugin/xfce4-clipman-settings.c
@@ -76,7 +76,7 @@ prop_dialog_run (void)
   /* Dialogs */
   action_dialog = GTK_WIDGET (gtk_builder_get_object (builder, "action-dialog"));
 
-  /* General settings */
+  /* Behavior tab: General */
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "add-selections")),
                                 DEFAULT_ADD_PRIMARY_CLIPBOARD);
 #ifdef HAVE_QRENCODE
@@ -85,29 +85,35 @@ prop_dialog_run (void)
 #else
   gtk_widget_hide(GTK_WIDGET (gtk_builder_get_object (builder, "show-qr-code")));
 #endif
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "history-ignore-selections")),
-                                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, "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")),
-                             (gdouble)DEFAULT_MAX_TEXTS_IN_HISTORY);
 
-  xfconf_g_property_bind (xfconf_channel, "/settings/add-primary-clipboard", G_TYPE_BOOLEAN,
-                          gtk_builder_get_object (builder, "add-selections"), "active");
+  /* paste-on-activate combobox */
+  combobox = GTK_WIDGET (gtk_builder_get_object (builder, "combobox-paste-on-activate"));
+  gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), _("None"));
+  /* TRANSLATORS: Keyboard shortcut */
+  gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), _("Ctrl+V"));
+  /* TRANSLATORS: Keyboard shortcut */
+  gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), _("Shift+Insert"));
+  gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), 0);
+
 #ifdef HAVE_QRENCODE
   xfconf_g_property_bind (xfconf_channel, "/settings/show-qr-code", G_TYPE_BOOLEAN,
                           gtk_builder_get_object (builder, "show-qr-code"), "active");
 #endif
-  xfconf_g_property_bind (xfconf_channel, "/settings/history-ignore-primary-clipboard", G_TYPE_BOOLEAN,
-                          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, "/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,
-                          gtk_builder_get_object (builder, "max-texts-in-history"), "value");
+  xfconf_g_property_bind (xfconf_channel, "/settings/add-primary-clipboard", G_TYPE_BOOLEAN,
+                          gtk_builder_get_object (builder, "add-selections"), "active");
+  xfconf_g_property_bind (xfconf_channel, "/tweaks/paste-on-activate",
+                          G_TYPE_UINT, G_OBJECT (combobox), "active");
+
+  /* Behavior tab: Menu */
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "popup-at-pointer")),
+                                DEFAULT_POPUP_AT_POINTER);
+  gtk_spin_button_set_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, "max-menu-items")),
+                             (gdouble)DEFAULT_MAX_MENU_ITEMS);
+
+  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/max-menu-items", G_TYPE_UINT,
+                          gtk_builder_get_object (builder, "max-menu-items"), "value");
 
   /* Actions tab and dialog */
   gtk_switch_set_state (GTK_SWITCH (gtk_builder_get_object (builder, "enable-actions")),
@@ -115,6 +121,18 @@ prop_dialog_run (void)
   xfconf_g_property_bind (xfconf_channel, "/settings/enable-actions", G_TYPE_BOOLEAN,
                           gtk_builder_get_object (builder, "enable-actions"), "active");
 
+  gtk_revealer_set_reveal_child (GTK_REVEALER (gtk_builder_get_object (builder, "action-revealer")),
+                                 DEFAULT_ENABLE_ACTIONS);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "skip-action-1")),
+                                DEFAULT_SKIP_ACTION_ON_KEY_DOWN);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "skip-action-2")),
+                                !DEFAULT_SKIP_ACTION_ON_KEY_DOWN);
+
+  xfconf_g_property_bind (xfconf_channel, "/settings/enable-actions", G_TYPE_BOOLEAN,
+                          gtk_builder_get_object (builder, "action-revealer"), "reveal-child");
+  xfconf_g_property_bind (xfconf_channel, "/tweaks/skip-action-on-key-down", G_TYPE_BOOLEAN,
+                          gtk_builder_get_object (builder, "skip-action-2"), "active");
+
   g_signal_connect (gtk_builder_get_object (builder, "button-add-action"), "clicked", G_CALLBACK (cb_add_action), NULL);
   g_signal_connect (gtk_builder_get_object (builder, "button-edit-action"), "clicked", G_CALLBACK (cb_edit_action), NULL);
   g_signal_connect (gtk_builder_get_object (builder, "button-delete-action"), "clicked", G_CALLBACK (cb_delete_action), NULL);
@@ -150,47 +168,32 @@ 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);
+  /* History tab */
+  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, "store-an-image")),
+                                (gboolean)DEFAULT_MAX_IMAGES_IN_HISTORY);
   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-1")),
-                            DEFAULT_ENABLE_ACTIONS);
-  gtk_widget_set_sensitive (GTK_WIDGET (gtk_builder_get_object (builder, "skip-action-2")),
-                            DEFAULT_ENABLE_ACTIONS);
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "skip-action-1")),
-                                DEFAULT_SKIP_ACTION_ON_KEY_DOWN);
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "skip-action-2")),
-                                !DEFAULT_SKIP_ACTION_ON_KEY_DOWN);
+  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "history-ignore-selections")),
+                                DEFAULT_HISTORY_IGNORE_PRIMARY_CLIPBOARD);
+  gtk_spin_button_set_value (GTK_SPIN_BUTTON (gtk_builder_get_object (builder, "max-texts-in-history")),
+                             (gdouble)DEFAULT_MAX_TEXTS_IN_HISTORY);
 
-  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, "/settings/save-on-quit", G_TYPE_BOOLEAN,
+                          gtk_builder_get_object (builder, "save-on-quit"), "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, "/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-1"), "sensitive");
-  xfconf_g_property_bind (xfconf_channel, "/settings/enable-actions", G_TYPE_BOOLEAN,
-                          gtk_builder_get_object (builder, "skip-action-2"), "sensitive");
-  xfconf_g_property_bind (xfconf_channel, "/tweaks/skip-action-on-key-down", G_TYPE_BOOLEAN,
-                          gtk_builder_get_object (builder, "skip-action-2"), "active");
-
-  /* Tweaks tab: paste-on-activate combobox */
-  combobox = GTK_WIDGET (gtk_builder_get_object (builder, "combobox-paste-on-activate"));
-  gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), _("None"));
-  /* TRANSLATORS: Keyboard shortcut */
-  gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), _("Ctrl+V"));
-  /* TRANSLATORS: Keyboard shortcut */
-  gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combobox), _("Shift+Insert"));
-  gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), 0);
-
-  xfconf_g_property_bind (xfconf_channel, "/tweaks/paste-on-activate",
-                          G_TYPE_UINT, G_OBJECT (combobox), "active");
-
+  xfconf_g_property_bind (xfconf_channel, "/settings/history-ignore-primary-clipboard", G_TYPE_BOOLEAN,
+                          gtk_builder_get_object (builder, "history-ignore-selections"), "active");
+  xfconf_g_property_bind (xfconf_channel, "/settings/max-texts-in-history", G_TYPE_UINT,
+                          gtk_builder_get_object (builder, "max-texts-in-history"), "value");
   /* Run the dialog */
   while ((gtk_dialog_run (GTK_DIALOG (settings_dialog))) == 2);
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list