[nautilus-actions] Check for Gtk+ >= 2.18 before using gtk_widget_get_sensitive()
- From: Pierre Wieser <pwieser src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus-actions] Check for Gtk+ >= 2.18 before using gtk_widget_get_sensitive()
- Date: Mon, 2 Aug 2010 20:34:24 +0000 (UTC)
commit 28117e0f439eb51fc8b2ffa384014361624ab630
Author: Pierre Wieser <pwieser trychlos org>
Date: Mon Aug 2 22:08:16 2010 +0200
Check for Gtk+ >= 2.18 before using gtk_widget_get_sensitive()
ChangeLog | 5 +++++
src/nact/nact-add-capability-dialog.c | 9 ++++++++-
src/nact/nact-add-scheme-dialog.c | 9 ++++++++-
src/nact/nact-main-tab.c | 2 +-
4 files changed, 22 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 341f581..fa817aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2010-08-02 Pierre Wieser <pwieser trychlos org>
+ * src/nact/nact-add-capability-dialog.c (try_for_send_ok):
+ * src/nact/nact-add-scheme-dialog.c (try_for_send_ok):
+ * src/nact/nact-main-tab.c (nact_main_tab_is_page_enabled):
+ Check that Gtk+ is more recent that 2.18 for gtk_widget_get_sensitive().
+
Split the NACT manual by chapter.
* doc/nact/C/nact-usage.xml:
diff --git a/src/nact/nact-add-capability-dialog.c b/src/nact/nact-add-capability-dialog.c
index b8437fa..b8740e7 100644
--- a/src/nact/nact-add-capability-dialog.c
+++ b/src/nact/nact-add-capability-dialog.c
@@ -543,10 +543,17 @@ static void
try_for_send_ok( NactAddCapabilityDialog *dialog )
{
GtkWidget *button;
+ gboolean is_sensitive;
button = base_window_get_widget( BASE_WINDOW( dialog ), "OKButton" );
- if( gtk_widget_get_sensitive( button )){
+#if(( GTK_MAJOR_VERSION > 2 ) || ( GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 18 ))
+ is_sensitive = gtk_widget_is_sensitive( button );
+#else
+ is_sensitive = GTK_WIDGET_IS_SENSITIVE( button );
+#endif
+
+ if( is_sensitive ){
send_ok( dialog );
}
}
diff --git a/src/nact/nact-add-scheme-dialog.c b/src/nact/nact-add-scheme-dialog.c
index bf8ebc7..a4a8c2d 100644
--- a/src/nact/nact-add-scheme-dialog.c
+++ b/src/nact/nact-add-scheme-dialog.c
@@ -402,10 +402,17 @@ static void
try_for_send_ok( NactAddSchemeDialog *dialog )
{
GtkWidget *button;
+ gboolean is_sensitive;
button = base_window_get_widget( BASE_WINDOW( dialog ), "OKButton" );
- if( gtk_widget_get_sensitive( button )){
+#if(( GTK_MAJOR_VERSION > 2 ) || ( GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 18 ))
+ is_sensitive = gtk_widget_is_sensitive( button );
+#else
+ is_sensitive = GTK_WIDGET_IS_SENSITIVE( button );
+#endif
+
+ if( is_sensitive ){
send_ok( dialog );
}
}
diff --git a/src/nact/nact-main-tab.c b/src/nact/nact-main-tab.c
index 81a58c5..4ae2424 100644
--- a/src/nact/nact-main-tab.c
+++ b/src/nact/nact-main-tab.c
@@ -75,7 +75,7 @@ nact_main_tab_is_page_enabled( NactMainWindow *window, gint num_page )
notebook = GTK_NOTEBOOK( base_window_get_widget( BASE_WINDOW( window ), "MainNotebook" ));
page = gtk_notebook_get_nth_page( notebook, num_page );
-#if(( GTK_MAJOR_VERSION > 2 ) || ( GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION > 18 ))
+#if(( GTK_MAJOR_VERSION > 2 ) || ( GTK_MAJOR_VERSION == 2 && GTK_MINOR_VERSION >= 18 ))
is_sensitive = gtk_widget_is_sensitive( page );
#else
is_sensitive = GTK_WIDGET_IS_SENSITIVE( page );
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]