[Xfce4-commits] <xfce4-clipman-plugin:master> [settings-dialog] Polishment and actions-reset-button
Mike Massonnet
noreply at xfce.org
Fri Dec 11 23:38:02 CET 2009
Updating branch refs/heads/master
to cb74677a90ab64fb6cd0c11828a1c1ab9fd063b2 (commit)
from e7e60ca7881c69bd2199db118df0baa953ae8ef7 (commit)
commit cb74677a90ab64fb6cd0c11828a1c1ab9fd063b2
Author: Mike Massonnet <mmassonnet at xfce.org>
Date: Fri Dec 11 23:30:21 2009 +0100
[settings-dialog] Polishment and actions-reset-button
Set the settings dialog an inch bigger. Repolish the action dialog. New
button beneath the actions treeview to reset the actions to the system
default values.
panel-plugin/Makefile.am | 4 +-
panel-plugin/settings-dialog.glade | 229 +++++++++++++++++++--------------
panel-plugin/xfce4-clipman-settings.c | 49 ++++++--
3 files changed, 172 insertions(+), 110 deletions(-)
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index d7bde8f..94fb248 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -19,7 +19,7 @@ bin_PROGRAMS = xfce4-clipman xfce4-popup-clipman xfce4-clipman-settings
if MAINTAINER_MODE
BUILT_SOURCES = settings-dialog_glade.h
settings-dialog_glade.h: settings-dialog.glade
- exo-csource --static --strip-comments --strip-content --name=settings_dialog_glade $< >$@
+ $(AM_V_GEN) exo-csource --static --strip-comments --strip-content --name=settings_dialog_glade $< >$@
endif
#
@@ -177,7 +177,7 @@ desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
@INTLTOOL_DESKTOP_RULE@
%.desktop.in: %.desktop.in.in
- sed -e "s^@EXTERNAL_PLUGIN_PATH@^$(plugindir)^" \
+ $(AM_V_GEN) sed -e "s^@EXTERNAL_PLUGIN_PATH@^$(plugindir)^" \
$< > $@
#
diff --git a/panel-plugin/settings-dialog.glade b/panel-plugin/settings-dialog.glade
index 5cffdc7..2fbbefb 100644
--- a/panel-plugin/settings-dialog.glade
+++ b/panel-plugin/settings-dialog.glade
@@ -1,14 +1,14 @@
<?xml version="1.0"?>
<glade-interface>
- <!-- interface-requires gtk+ 2.14 -->
+ <!-- interface-requires gtk+ 2.16 -->
<requires lib="xfce4"/>
<!-- interface-requires xfce4 2335.53032 -->
<!-- interface-naming-policy toplevel-contextual -->
<widget class="XfceTitledDialog" id="settings-dialog">
<property name="title">Clipman</property>
<property name="window_position">center</property>
- <property name="default_width">300</property>
- <property name="default_height">380</property>
+ <property name="default_width">340</property>
+ <property name="default_height">420</property>
<property name="destroy_with_parent">True</property>
<property name="icon_name">xfce4-clipman-plugin</property>
<property name="type_hint">dialog</property>
@@ -144,7 +144,7 @@
<child>
<widget class="GtkHBox" id="hbox1">
<property name="visible">True</property>
- <property name="spacing">6</property>
+ <property name="spacing">4</property>
<child>
<widget class="GtkLabel" id="label5">
<property name="visible">True</property>
@@ -164,7 +164,7 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="invisible_char">•</property>
- <property name="adjustment">6 5 1000 1 10 0</property>
+ <property name="adjustment">5 5 1000 5 10 0</property>
</widget>
<packing>
<property name="expand">False</property>
@@ -324,6 +324,27 @@
<property name="position">2</property>
</packing>
</child>
+ <child>
+ <widget class="GtkButton" id="button-reset-actions">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <signal name="clicked" handler="cb_reset_actions"/>
+ <child>
+ <widget class="GtkImage" id="image4">
+ <property name="visible">True</property>
+ <property name="stock">gtk-clear</property>
+ <property name="icon-size">1</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="pack_type">end</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
</widget>
<packing>
<property name="expand">False</property>
@@ -464,97 +485,97 @@
<property name="bottom_padding">6</property>
<property name="left_padding">12</property>
<child>
- <widget class="GtkTable" id="table1">
+ <widget class="GtkVBox" id="vbox2">
<property name="visible">True</property>
- <property name="n_rows">4</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">2</property>
- <property name="row_spacing">6</property>
- <child>
- <widget class="GtkLabel" id="label4">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Name:</property>
- </widget>
- <packing>
- <property name="x_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label5">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Pattern:</property>
- </widget>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- </packing>
- </child>
+ <property name="orientation">vertical</property>
+ <property name="spacing">6</property>
<child>
- <widget class="GtkEntry" id="action-name">
+ <widget class="GtkHBox" id="hbox5">
<property name="visible">True</property>
- <property name="can_focus">True</property>
+ <property name="spacing">4</property>
+ <child>
+ <widget class="GtkLabel" id="label4">
+ <property name="visible">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Name:</property>
+ </widget>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkEntry" id="action-name">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ </widget>
+ <packing>
+ <property name="position">1</property>
+ </packing>
+ </child>
</widget>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkHBox" id="hbox2">
+ <widget class="GtkHBox" id="hbox6">
<property name="visible">True</property>
<property name="spacing">4</property>
<child>
- <widget class="GtkEntry" id="regex">
+ <widget class="GtkLabel" id="label5">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">•</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Pattern:</property>
</widget>
<packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkButton" id="button1">
- <property name="can_focus">True</property>
- <property name="receives_default">True</property>
+ <widget class="GtkHBox" id="hbox2">
+ <property name="visible">True</property>
+ <property name="spacing">4</property>
<child>
- <widget class="GtkImage" id="image5">
+ <widget class="GtkEntry" id="regex">
<property name="visible">True</property>
- <property name="stock">gtk-edit</property>
- <property name="icon-size">1</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ </widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkButton" id="button1">
+ <property name="can_focus">True</property>
+ <property name="receives_default">True</property>
+ <child>
+ <widget class="GtkImage" id="image5">
+ <property name="visible">True</property>
+ <property name="stock">gtk-edit</property>
+ <property name="icon-size">1</property>
+ </widget>
+ </child>
</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="fill">False</property>
<property name="position">1</property>
</packing>
</child>
</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>
- </packing>
- </child>
- <child>
- <widget class="GtkCheckButton" id="manual">
- <property name="label" translatable="yes">Activate only on manual copy</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip" translatable="yes">By default the action is triggerred by a selection, check this option to trigger the action only when you make a manual copy</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
@@ -585,14 +606,22 @@
</child>
</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="position">2</property>
</packing>
</child>
<child>
- <placeholder/>
+ <widget class="GtkCheckButton" id="manual">
+ <property name="label" translatable="yes">Activate only on manual copy</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" translatable="yes">By default the action is triggerred by a selection, check this option to trigger the action only when you make a manual copy</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="position">3</property>
+ </packing>
</child>
</widget>
</child>
@@ -636,12 +665,9 @@
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
- <widget class="GtkTable" id="table2">
+ <widget class="GtkHBox" id="hbox7">
<property name="visible">True</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">2</property>
- <property name="row_spacing">6</property>
+ <property name="spacing">4</property>
<child>
<widget class="GtkLabel" id="label6">
<property name="visible">True</property>
@@ -649,50 +675,55 @@
<property name="label" translatable="yes">Name:</property>
</widget>
<packing>
- <property name="x_options">GTK_FILL</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
- <widget class="GtkLabel" id="label7">
+ <widget class="GtkEntry" id="command-name">
<property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Command:</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
</widget>
<packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
+ <property name="position">1</property>
</packing>
</child>
+ </widget>
+ <packing>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <widget class="GtkHBox" id="hbox8">
+ <property name="visible">True</property>
+ <property name="spacing">4</property>
<child>
- <widget class="GtkEntry" id="command-name">
+ <widget class="GtkLabel" id="label7">
<property name="visible">True</property>
- <property name="can_focus">True</property>
+ <property name="xalign">0</property>
+ <property name="label" translatable="yes">Command:</property>
</widget>
<packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="y_options"></property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
</packing>
</child>
<child>
<widget class="GtkEntry" id="command">
<property name="visible">True</property>
<property name="can_focus">True</property>
+ <property name="invisible_char">•</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="y_options"></property>
+ <property name="position">1</property>
</packing>
</child>
</widget>
<packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
+ <property name="position">1</property>
</packing>
</child>
<child>
@@ -712,7 +743,7 @@
</child>
</widget>
<packing>
- <property name="position">1</property>
+ <property name="position">2</property>
</packing>
</child>
</widget>
@@ -784,7 +815,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">3</property>
+ <property name="position">2</property>
</packing>
</child>
</widget>
diff --git a/panel-plugin/xfce4-clipman-settings.c b/panel-plugin/xfce4-clipman-settings.c
index 12f43be..fa30005 100644
--- a/panel-plugin/xfce4-clipman-settings.c
+++ b/panel-plugin/xfce4-clipman-settings.c
@@ -37,11 +37,6 @@
#include "settings-dialog_glade.h"
#include "actions.h"
-static XfconfChannel *xfconf_channel = NULL;
-static GladeXML *gxml = NULL;
-static ClipmanActions *actions = NULL;
-static GtkWidget *dialog = NULL;
-
static void prop_dialog_run ();
static void cb_show_help (GtkButton *button);
static void setup_actions_treeview (GtkTreeView *treeview);
@@ -54,6 +49,7 @@ static void cb_actions_row_activated (GtkTreeView *treeview,
GtkTreePath *path,
GtkTreeViewColumn *column);
static void cb_delete_action (GtkButton *button);
+static void cb_reset_actions (GtkButton *button);
static void setup_commands_treeview (GtkTreeView *treeview);
static void entry_dialog_cleanup ();
#if !GLIB_CHECK_VERSION(2,16,0)
@@ -67,6 +63,11 @@ static void cb_refresh_command (GtkButton *button);
static void cb_delete_command (GtkButton *button);
static void cb_set_action_dialog_button_ok (GtkWidget *widget);
+static XfconfChannel *xfconf_channel = NULL;
+static GladeXML *gxml = NULL;
+static ClipmanActions *actions = NULL;
+static GtkWidget *settings_dialog = NULL;
+
static void
@@ -78,7 +79,7 @@ prop_dialog_run ()
gxml = glade_xml_new_from_buffer (settings_dialog_glade, settings_dialog_glade_length, NULL, NULL);
/* Dialogs */
- dialog = glade_xml_get_widget (gxml, "settings-dialog");
+ settings_dialog = glade_xml_get_widget (gxml, "settings-dialog");
action_dialog = glade_xml_get_widget (gxml, "action-dialog");
/* General settings */
@@ -112,6 +113,7 @@ prop_dialog_run ()
glade_xml_signal_connect_data (gxml, "cb_add_action", G_CALLBACK (cb_add_action), NULL);
glade_xml_signal_connect_data (gxml, "cb_edit_action", G_CALLBACK (cb_edit_action), NULL);
glade_xml_signal_connect_data (gxml, "cb_delete_action", G_CALLBACK (cb_delete_action), NULL);
+ glade_xml_signal_connect_data (gxml, "cb_reset_actions", G_CALLBACK (cb_reset_actions), NULL);
glade_xml_signal_connect_data (gxml, "cb_actions_row_activated", G_CALLBACK (cb_actions_row_activated), NULL);
glade_xml_signal_connect_data (gxml, "cb_add_command", G_CALLBACK (cb_add_command), NULL);
glade_xml_signal_connect_data (gxml, "cb_refresh_command", G_CALLBACK (cb_refresh_command), NULL);
@@ -132,10 +134,10 @@ prop_dialog_run ()
G_CALLBACK (cb_set_action_dialog_button_ok), NULL);
/* Run the dialog */
- while ((gtk_dialog_run (GTK_DIALOG (dialog))) == 2);
+ while ((gtk_dialog_run (GTK_DIALOG (settings_dialog))) == 2);
gtk_widget_destroy (action_dialog);
- gtk_widget_destroy (dialog);
+ gtk_widget_destroy (settings_dialog);
g_object_unref (gxml);
/* Save the actions */
@@ -424,6 +426,34 @@ cb_delete_action (GtkButton *button)
gtk_list_store_remove (GTK_LIST_STORE (model), &iter);
}
+static void
+cb_reset_actions (GtkButton *button)
+{
+ GtkWidget *dialog;
+ gchar *filename;
+ gint res;
+
+ dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (settings_dialog),
+ GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_QUESTION,
+ GTK_BUTTONS_YES_NO,
+ _("<b>Reset actions</b>"), NULL);
+ gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+ _("Are you sure you want to reset the actions to the system default values?"));
+ res = gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+ if (res != GTK_RESPONSE_YES)
+ return;
+
+ filename = g_strdup_printf ("%s/xfce4/panel/xfce4-clipman-actions.xml", g_get_user_config_dir ());
+ g_unlink (filename);
+ g_free (filename);
+
+ g_object_unref (actions);
+ actions = clipman_actions_get ();
+ refresh_actions_treeview (GTK_TREE_VIEW (glade_xml_get_widget (gxml, "actions")));
+}
+
/* Actions Entry */
@@ -641,7 +671,7 @@ cb_unique_app (UniqueApp *app,
return UNIQUE_RESPONSE_PASSTHROUGH;
}
- gtk_window_present (GTK_WINDOW (dialog));
+ gtk_window_present (GTK_WINDOW (settings_dialog));
return UNIQUE_RESPONSE_OK;
}
#endif
@@ -675,3 +705,4 @@ main (gint argc,
xfconf_shutdown ();
return 0;
}
+
More information about the Xfce4-commits
mailing list