[libepc] Really use GTK+ 3.



commit a08655df4081f76053f22c0c587a25a3f0443792
Author: Murray Cumming <murrayc murrayc com>
Date:   Wed Aug 31 14:19:47 2011 +0200

    Really use GTK+ 3.
    
    	* configure.ac: Check for gtk+-3.0 for libepc-ui.
    	* examples/consumer-ui.c:
    	* examples/publisher-ui.c: Port to GTK+ 3, though I just removed the
    	GtkAboutBox url hook.
    	Bug #657679 (Frederic Peters)

 ChangeLog               |   10 ++++++++++
 configure.ac            |    2 +-
 examples/consumer-ui.c  |    8 ++++----
 examples/publisher-ui.c |   20 --------------------
 4 files changed, 15 insertions(+), 25 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index e909454..f1c6460 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2011-08-31  Murray Cumming  <murrayc murrayc com>
+
+	Really use GTK+ 3.
+
+	* configure.ac: Check for gtk+-3.0 for libepc-ui.
+	* examples/consumer-ui.c:
+	* examples/publisher-ui.c: Port to GTK+ 3, though I just removed the 
+	GtkAboutBox url hook.
+	Bug #657679 (Frederic Peters)
+
 2011-06-15  Murray Cumming  <murrayc murrayc com>
 
 	Avoid use of deprecated G_CONST_RETURN.
diff --git a/configure.ac b/configure.ac
index e2a8690..239200d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -80,7 +80,7 @@ PKG_CHECK_MODULES(LIBEPC,    [avahi-client >= 0.6
                               uuid         >= 1.36
                               $LIBSOUP
                               $GIO])
-PKG_CHECK_MODULES(LIBEPC_UI, [gtk+-2.0     >= 2.10])
+PKG_CHECK_MODULES(LIBEPC_UI, [gtk+-3.0     >= 3.0])
 
 AC_SUBST(AVAHI_UI_CFLAGS)
 AC_SUBST(AVAHI_UI_LIBS)
diff --git a/examples/consumer-ui.c b/examples/consumer-ui.c
index 2569de9..bc2f8a6 100644
--- a/examples/consumer-ui.c
+++ b/examples/consumer-ui.c
@@ -35,7 +35,7 @@ list_keys (EpcConsumer *consumer,
       keys = g_list_sort (keys, (GCompareFunc) strcmp);
 
       for (iter = keys; iter; iter = iter->next)
-        gtk_combo_box_append_text (GTK_COMBO_BOX (keys_combo), iter->data);
+        gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (keys_combo), NULL, iter->data);
 
       gtk_combo_box_set_active (GTK_COMBO_BOX (keys_combo), 0);
       gtk_widget_set_sensitive (keys_combo, TRUE);
@@ -71,7 +71,7 @@ keys_combo_changed_cb (GtkComboBox *combo_box,
 
   /* retreive a the currently selected resource */
 
-  key = gtk_combo_box_get_active_text (combo_box);
+  key = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (combo_box));
 
   if (key)
     value = epc_consumer_lookup (consumer, key, &length, &error);
@@ -120,7 +120,7 @@ create_lookup_dialog (EpcConsumer *consumer,
 
   /* Setup the combo box listing keys. */
 
-  keys_combo = gtk_combo_box_new_text ();
+  keys_combo = gtk_combo_box_text_new ();
   gtk_widget_set_sensitive (keys_combo, FALSE);
 
   g_signal_connect (keys_combo, "changed",
@@ -165,7 +165,7 @@ create_lookup_dialog (EpcConsumer *consumer,
   /* Create the dialog widget. */
 
   dialog = gtk_dialog_new_with_buttons ("Published Value", NULL,
-                                        GTK_DIALOG_NO_SEPARATOR,
+                                        (GtkDialogFlags)0,
                                         GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE,
                                         NULL);
 
diff --git a/examples/publisher-ui.c b/examples/publisher-ui.c
index 314938d..01839ba 100644
--- a/examples/publisher-ui.c
+++ b/examples/publisher-ui.c
@@ -366,25 +366,6 @@ schedule_auto_save (void)
     auto_save_id = g_timeout_add (5 * 1000, auto_save_cb, NULL);
 }
 
-static void
-url_hook (GtkAboutDialog *dialog,
-          const gchar    *link,
-          gpointer        data G_GNUC_UNUSED)
-{
-  gchar *args[] = { "xdg-open", (gchar*) link, NULL };
-  GError *error = NULL;
-
-  gdk_spawn_on_screen (gtk_widget_get_screen (GTK_WIDGET (dialog)),
-                       NULL, args, NULL, G_SPAWN_SEARCH_PATH,
-                       NULL, NULL, NULL, &error);
-
-  if (error)
-    {
-      show_error (GTK_WIDGET (dialog), "Cannot follow link.", error);
-      g_error_free (error);
-    }
-}
-
 void
 about_button_clicked_cb (GtkWidget *widget)
 {
@@ -799,7 +780,6 @@ main (int   argc,
   g_set_application_name ("Easy Publisher Example");
 
   gtk_init (&argc, &argv);
-  gtk_about_dialog_set_url_hook (url_hook, NULL, NULL);
 
   builder = gtk_builder_new ();
   load_ui (argv[0]);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]