[Commits] [SCM] claws branch, master, updated. 3.10.1-155-g9d30727
mones at claws-mail.org
mones at claws-mail.org
Tue Sep 9 11:15:54 CEST 2014
The branch, master has been updated
via 9d30727d92db5a901a29998b172a1c9b03138517 (commit)
from ecb5946bbb9c2262678752c0958c4d18bf13e8b7 (commit)
Summary of changes:
src/plugins/fancy/fancy_prefs.c | 10 ++++++++++
1 file changed, 10 insertions(+)
- Log -----------------------------------------------------------------
commit 9d30727d92db5a901a29998b172a1c9b03138517
Author: Ricardo Mones <ricardo at mones.org>
Date: Tue Sep 9 01:07:33 2014 +0200
Fancy: disallow editing for empty stylesheets
diff --git a/src/plugins/fancy/fancy_prefs.c b/src/plugins/fancy/fancy_prefs.c
index bc3369f..3ab1f55 100644
--- a/src/plugins/fancy/fancy_prefs.c
+++ b/src/plugins/fancy/fancy_prefs.c
@@ -99,6 +99,7 @@ static FancyPrefsPage fancy_prefs_page;
static void fancy_prefs_stylesheet_browse_cb (GtkWidget *widget, gpointer data);
static void fancy_prefs_stylesheet_edit_cb (GtkWidget *widget, gpointer data);
+static void fancy_prefs_stylesheet_changed_cb (GtkWidget *widget, gpointer data);
static void create_fancy_prefs_page (PrefsPage *page, GtkWindow *window, gpointer data);
static void destroy_fancy_prefs_page (PrefsPage *page);
@@ -315,7 +316,10 @@ static void create_fancy_prefs_page(PrefsPage *page, GtkWindow *window,
gtk_box_pack_start(GTK_BOX(hbox_css), stylesheet_edit_button, FALSE, FALSE, 0);
g_signal_connect(G_OBJECT(stylesheet_edit_button), "clicked",
G_CALLBACK(fancy_prefs_stylesheet_edit_cb), stylesheet);
+ g_signal_connect(G_OBJECT(stylesheet), "changed",
+ G_CALLBACK(fancy_prefs_stylesheet_changed_cb), stylesheet_edit_button);
pref_set_entry_from_pref(GTK_ENTRY(stylesheet), fancy_prefs.stylesheet);
+ g_signal_emit_by_name(G_OBJECT(stylesheet), "changed", stylesheet_edit_button);
#ifdef HAVE_LIBSOUP_GNOME
@@ -363,6 +367,12 @@ static void fancy_prefs_stylesheet_edit_cb(GtkWidget *widget, gpointer data)
open_txt_editor(stylesheet, prefs_common_get_ext_editor_cmd());
}
+static void fancy_prefs_stylesheet_changed_cb(GtkWidget *widget, gpointer data)
+{
+ const gchar *stylesheet = gtk_entry_get_text(GTK_ENTRY(widget));
+ gtk_widget_set_sensitive(GTK_WIDGET(data), (*stylesheet)? TRUE: FALSE);
+}
+
static void prefs_set_proxy_entry_sens(GtkWidget *button, GtkEntry *entry_str) {
gtk_widget_set_sensitive(GTK_WIDGET(entry_str),
gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(button)));
-----------------------------------------------------------------------
hooks/post-receive
--
Claws Mail
More information about the Commits
mailing list