[evolution-kolab] EPlugin: new util function for GtkButton sensitivity
- From: Christian Hilberg <chilberg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-kolab] EPlugin: new util function for GtkButton sensitivity
- Date: Tue, 9 Oct 2012 18:13:09 +0000 (UTC)
commit 2b3743f7df011bd0999d47c9e4a141082c0a96ef
Author: Christian Hilberg <hilberg kernelconcepts de>
Date: Tue Oct 9 20:02:23 2012 +0200
EPlugin: new util function for GtkButton sensitivity
* sets (in)sensitive a named (stock) button
of a GtkDialog
src/eplugin/e-kolab-plugin-util.c | 25 ++++++++++++++++++++++---
src/eplugin/e-kolab-plugin-util.h | 6 ++++++
2 files changed, 28 insertions(+), 3 deletions(-)
---
diff --git a/src/eplugin/e-kolab-plugin-util.c b/src/eplugin/e-kolab-plugin-util.c
index 2d5bec0..6a632c8 100644
--- a/src/eplugin/e-kolab-plugin-util.c
+++ b/src/eplugin/e-kolab-plugin-util.c
@@ -203,7 +203,7 @@ e_kolab_plugin_util_ui_dialog_ref_button (GtkDialog *dialog,
GList *btn_lst = NULL;
GList *btn_lst_ptr = NULL;
GtkWidget *btn = NULL;
-
+
g_return_val_if_fail (GTK_IS_DIALOG (dialog), NULL);
g_return_val_if_fail (button_label != NULL, NULL);
@@ -216,7 +216,7 @@ e_kolab_plugin_util_ui_dialog_ref_button (GtkDialog *dialog,
while (btn_lst_ptr != NULL) {
GtkButton *btn_cand = NULL;
const gchar *label = NULL;
-
+
if (! GTK_IS_BUTTON (btn_lst_ptr->data)) {
g_warning ("%s()[%u] GtkButtonBox contains non-GtkButton child, skipping",
__func__, __LINE__);
@@ -239,10 +239,29 @@ e_kolab_plugin_util_ui_dialog_ref_button (GtkDialog *dialog,
if (btn_lst != NULL)
g_list_free (btn_lst);
-
+
return btn;
}
+void
+e_kolab_plugin_util_ui_dialog_set_button_sensitive (GtkDialog *dialog,
+ const gchar *button_label,
+ gboolean stock_check,
+ gboolean sensitive)
+{
+ GtkWidget *btn = NULL;
+
+ g_return_if_fail (GTK_IS_DIALOG (dialog));
+ g_return_if_fail (button_label != NULL);
+
+ btn = e_kolab_plugin_util_ui_dialog_ref_button (dialog,
+ button_label,
+ stock_check);
+ g_return_if_fail (GTK_IS_BUTTON (btn));
+ gtk_widget_set_sensitive (btn, sensitive);
+ g_object_unref (btn);
+}
+
gboolean
e_kolab_plugin_util_ui_get_selected_source (EShellView *shell_view,
ESource **selected_source)
diff --git a/src/eplugin/e-kolab-plugin-util.h b/src/eplugin/e-kolab-plugin-util.h
index 6cd7f32..6b59335 100644
--- a/src/eplugin/e-kolab-plugin-util.h
+++ b/src/eplugin/e-kolab-plugin-util.h
@@ -54,6 +54,12 @@ e_kolab_plugin_util_ui_dialog_ref_button (GtkDialog *dialog,
const gchar *button_label,
gboolean stock_check);
+void
+e_kolab_plugin_util_ui_dialog_set_button_sensitive (GtkDialog *dialog,
+ const gchar *button_label,
+ gboolean stock_check,
+ gboolean sensitive);
+
gboolean
e_kolab_plugin_util_ui_get_selected_source (EShellView *shell_view,
ESource **selected_source);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]