[Xfce4-commits] [xfce/exo] 09/21: Build exo-helper with Gtk3
noreply at xfce.org
noreply at xfce.org
Tue Jul 12 04:08:01 CEST 2016
This is an automated email from the git hooks/post-receive script.
bluesabre pushed a commit to branch master
in repository xfce/exo.
commit 548c5e3ee6d6e99880c237c390a8f0e8acc714cd
Author: Jonas Kümmerlin <rgcjonas at gmail.com>
Date: Fri Aug 7 12:46:59 2015 +0200
Build exo-helper with Gtk3
This was rather easy. The result is good, but not perfect:
Our dialog still relies on deprecated functionality, and the
dialog buttons don't look nice.
---
configure.ac.in | 5 ++-
exo-helper/Makefile.am | 12 ++---
exo-helper/exo-helper-chooser-dialog.c | 33 ++++++--------
exo-helper/exo-helper-chooser.c | 79 ++++++++++++++++++---------------
exo-helper/exo-helper-launcher-dialog.c | 13 +++---
exo-helper/main.c | 11 ++++-
6 files changed, 82 insertions(+), 71 deletions(-)
diff --git a/configure.ac.in b/configure.ac.in
index 1487b9e..451d92f 100644
--- a/configure.ac.in
+++ b/configure.ac.in
@@ -177,7 +177,10 @@ dnl ***********************************************************
XDT_CHECK_OPTIONAL_PACKAGE([GTK3],
[gtk+-3.0], [3.6.0], [gtk3],
[GTK+ 3 support])
-AM_CONDITIONAL([ENABLE_GTK3_LIBRARY], [test "x$GTK3_FOUND" = "xyes"])
+XDT_CHECK_OPTIONAL_PACKAGE([LIBXFCE4UI2],
+ [libxfce4ui-2], [4.12.0], [libxfce4ui2],
+ [GTK+ 3 support: libxfce4ui-2])
+AM_CONDITIONAL([ENABLE_GTK3_LIBRARY], [test "x$GTK3_FOUND" = "xyes" && test "x$LIBXFCE4UI2_FOUND" = "xyes" ])
dnl *********************
dnl *** Check for X11 ***
diff --git a/exo-helper/Makefile.am b/exo-helper/Makefile.am
index 0c932aa..0c4f9de 100644
--- a/exo-helper/Makefile.am
+++ b/exo-helper/Makefile.am
@@ -36,18 +36,18 @@ exo_helper_1_SOURCES = \
main.c
exo_helper_1_CFLAGS = \
- $(GTK_CFLAGS) \
+ $(GTK3_CFLAGS) \
$(LIBXFCE4UTIL_CFLAGS) \
- $(LIBXFCE4UI_CFLAGS)
+ $(LIBXFCE4UI2_CFLAGS)
exo_helper_1_DEPENDENCIES = \
- $(top_builddir)/exo/libexo-$(LIBEXO_VERSION_API).la
+ $(top_builddir)/exo/libexo-2.la
exo_helper_1_LDADD = \
- $(GTK_LIBS) \
+ $(GTK3_LIBS) \
$(LIBXFCE4UTIL_LIBS) \
- $(LIBXFCE4UI_LIBS) \
- $(top_builddir)/exo/libexo-$(LIBEXO_VERSION_API).la
+ $(LIBXFCE4UI2_LIBS) \
+ $(top_builddir)/exo/libexo-2.la
bin_SCRIPTS = \
exo-preferred-applications
diff --git a/exo-helper/exo-helper-chooser-dialog.c b/exo-helper/exo-helper-chooser-dialog.c
index 8b10e65..2164307 100644
--- a/exo-helper/exo-helper-chooser-dialog.c
+++ b/exo-helper/exo-helper-chooser-dialog.c
@@ -89,34 +89,29 @@ exo_helper_chooser_dialog_init (ExoHelperChooserDialog *chooser_dialog)
GtkWidget *button;
GtkWidget *frame;
GtkWidget *label;
- GtkWidget *topcontainer;
GtkWidget *vbox;
GtkWidget *box;
/* verify category settings */
g_assert (EXO_HELPER_N_CATEGORIES == 4);
- gtk_dialog_add_button (GTK_DIALOG (chooser_dialog), GTK_STOCK_CLOSE, GTK_RESPONSE_CLOSE);
+ gtk_dialog_add_button (GTK_DIALOG (chooser_dialog), _("_Close"), GTK_RESPONSE_CLOSE);
gtk_window_set_icon_name (GTK_WINDOW (chooser_dialog), "preferences-desktop-default-applications");
gtk_window_set_title (GTK_WINDOW (chooser_dialog), _("Preferred Applications"));
xfce_titled_dialog_set_subtitle (XFCE_TITLED_DIALOG (chooser_dialog), _("Select default applications for various services"));
/* add the "Help" button */
- button = gtk_button_new_from_stock (GTK_STOCK_HELP);
+ button = gtk_button_new_with_mnemonic (_("_Help"));
g_signal_connect_swapped (G_OBJECT (button), "clicked", G_CALLBACK (exo_helper_chooser_dialog_show_help), chooser_dialog);
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (chooser_dialog))), button, FALSE, TRUE, 0);
gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (gtk_dialog_get_action_area (GTK_DIALOG (chooser_dialog))), button, TRUE);
gtk_widget_show (button);
- topcontainer = gtk_alignment_new (0.0, 0.0, 1.0, 1.0);
- gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (chooser_dialog))), topcontainer, TRUE, TRUE, 0);
- gtk_widget_show (topcontainer);
- chooser_dialog->plug_child = topcontainer;
-
notebook = gtk_notebook_new ();
+ gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (chooser_dialog))), notebook, TRUE, TRUE, 0);
gtk_container_set_border_width (GTK_CONTAINER (notebook), 6);
- gtk_container_add (GTK_CONTAINER (topcontainer), notebook);
gtk_widget_show (notebook);
+ chooser_dialog->plug_child = notebook;
/* allocate shared bold label attributes */
attr_list_bold = pango_attr_list_new ();
@@ -129,7 +124,7 @@ exo_helper_chooser_dialog_init (ExoHelperChooserDialog *chooser_dialog)
Internet
*/
label = gtk_label_new_with_mnemonic (_("_Internet"));
- vbox = g_object_new (GTK_TYPE_VBOX, "border-width", 12, "spacing", 24, NULL);
+ vbox = g_object_new (GTK_TYPE_BOX, "orientation", GTK_ORIENTATION_VERTICAL, "border-width", 12, "spacing", 24, NULL);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox, label);
gtk_widget_show (label);
gtk_widget_show (vbox);
@@ -145,13 +140,13 @@ exo_helper_chooser_dialog_init (ExoHelperChooserDialog *chooser_dialog)
gtk_frame_set_label_widget (GTK_FRAME (frame), label);
gtk_widget_show (label);
- box = g_object_new (GTK_TYPE_VBOX, "border-width", 12, "spacing", 12, NULL);
+ box = g_object_new (GTK_TYPE_BOX, "orientation", GTK_ORIENTATION_VERTICAL, "border-width", 12, "spacing", 12, NULL);
gtk_container_add (GTK_CONTAINER (frame), box);
gtk_widget_show (box);
label = gtk_label_new (_("The preferred Web Browser will be used to open\n"
"hyperlinks and display help contents."));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0f, 0.0f);
+ g_object_set (label, "xalign", 0.0f, "yalign", 0.0f, NULL);
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
gtk_widget_show (label);
@@ -177,13 +172,13 @@ exo_helper_chooser_dialog_init (ExoHelperChooserDialog *chooser_dialog)
gtk_frame_set_label_widget (GTK_FRAME (frame), label);
gtk_widget_show (label);
- box = g_object_new (GTK_TYPE_VBOX, "border-width", 12, "spacing", 12, NULL);
+ box = g_object_new (GTK_TYPE_BOX, "orientation", GTK_ORIENTATION_VERTICAL, "border-width", 12, "spacing", 12, NULL);
gtk_container_add (GTK_CONTAINER (frame), box);
gtk_widget_show (box);
label = gtk_label_new (_("The preferred Mail Reader will be used to compose\n"
"emails when you click on email addresses."));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0f, 0.0f);
+ g_object_set (label, "xalign", 0.0f, "yalign", 0.0f, NULL);
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
gtk_widget_show (label);
@@ -202,7 +197,7 @@ exo_helper_chooser_dialog_init (ExoHelperChooserDialog *chooser_dialog)
Utilities
*/
label = gtk_label_new_with_mnemonic (_("_Utilities"));
- vbox = g_object_new (GTK_TYPE_VBOX, "border-width", 12, "spacing", 24, NULL);
+ vbox = g_object_new (GTK_TYPE_BOX, "orientation", GTK_ORIENTATION_VERTICAL, "border-width", 12, "spacing", 24, NULL);
gtk_notebook_append_page (GTK_NOTEBOOK (notebook), vbox, label);
gtk_widget_show (label);
gtk_widget_show (vbox);
@@ -218,13 +213,13 @@ exo_helper_chooser_dialog_init (ExoHelperChooserDialog *chooser_dialog)
gtk_frame_set_label_widget (GTK_FRAME (frame), label);
gtk_widget_show (label);
- box = g_object_new (GTK_TYPE_VBOX, "border-width", 12, "spacing", 12, NULL);
+ box = g_object_new (GTK_TYPE_BOX, "orientation", GTK_ORIENTATION_VERTICAL, "border-width", 12, "spacing", 12, NULL);
gtk_container_add (GTK_CONTAINER (frame), box);
gtk_widget_show (box);
label = gtk_label_new (_("The preferred File Manager will be used to\n"
"browse the contents of folders."));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0f, 0.0f);
+ g_object_set (label, "xalign", 0.0f, "yalign", 0.0f, NULL);
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
gtk_widget_show (label);
@@ -250,13 +245,13 @@ exo_helper_chooser_dialog_init (ExoHelperChooserDialog *chooser_dialog)
gtk_frame_set_label_widget (GTK_FRAME (frame), label);
gtk_widget_show (label);
- box = g_object_new (GTK_TYPE_VBOX, "border-width", 12, "spacing", 12, NULL);
+ box = g_object_new (GTK_TYPE_BOX, "orientation", GTK_ORIENTATION_VERTICAL, "border-width", 12, "spacing", 12, NULL);
gtk_container_add (GTK_CONTAINER (frame), box);
gtk_widget_show (box);
label = gtk_label_new (_("The preferred Terminal Emulator will be used to\n"
"run commands that require a CLI environment."));
- gtk_misc_set_alignment (GTK_MISC (label), 0.0f, 0.0f);
+ g_object_set (label, "xalign", 0.0f, "yalign", 0.0f, NULL);
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
gtk_widget_show (label);
diff --git a/exo-helper/exo-helper-chooser.c b/exo-helper/exo-helper-chooser.c
index 9cfb5b1..19f9ffb 100644
--- a/exo-helper/exo-helper-chooser.c
+++ b/exo-helper/exo-helper-chooser.c
@@ -60,12 +60,12 @@ static void exo_helper_chooser_pressed (ExoHelperChooser *chooser,
struct _ExoHelperChooserClass
{
- GtkAlignmentClass __parent__;
+ GtkBinClass __parent__;
};
struct _ExoHelperChooser
{
- GtkAlignment __parent__;
+ GtkBin __parent__;
GtkWidget *image;
GtkWidget *label;
@@ -78,7 +78,7 @@ struct _ExoHelperChooser
-G_DEFINE_TYPE (ExoHelperChooser, exo_helper_chooser, GTK_TYPE_ALIGNMENT)
+G_DEFINE_TYPE (ExoHelperChooser, exo_helper_chooser, GTK_TYPE_BIN)
@@ -138,7 +138,7 @@ exo_helper_chooser_init (ExoHelperChooser *chooser)
chooser->database = exo_helper_database_get ();
- gtk_widget_push_composite_child ();
+ /*gtk_widget_push_composite_child ();*/
button = gtk_button_new ();
g_signal_connect_swapped (G_OBJECT (button), "pressed", G_CALLBACK (exo_helper_chooser_pressed), chooser);
@@ -151,7 +151,7 @@ exo_helper_chooser_init (ExoHelperChooser *chooser)
atk_object_set_name (object, _("Application Chooser Button"));
atk_object_set_description (object, _("Press left mouse button to change the selected application."));
- hbox = gtk_hbox_new (FALSE, 4);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
gtk_container_add (GTK_CONTAINER (button), hbox);
gtk_widget_show (hbox);
@@ -170,15 +170,15 @@ exo_helper_chooser_init (ExoHelperChooser *chooser)
atk_relation_set_add (relations, relation);
g_object_unref (G_OBJECT (relation));
- separator = g_object_new (GTK_TYPE_VSEPARATOR, "height-request", 16, NULL);
+ separator = g_object_new (GTK_TYPE_SEPARATOR, "orientation", GTK_ORIENTATION_VERTICAL, "height-request", 16, NULL);
gtk_box_pack_start (GTK_BOX (hbox), separator, FALSE, FALSE, 0);
gtk_widget_show (separator);
- arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE);
+ arrow = gtk_image_new_from_icon_name ("pan-down-symbolic", GTK_ICON_SIZE_BUTTON);
gtk_box_pack_start (GTK_BOX (hbox), arrow, FALSE, FALSE, 0);
gtk_widget_show (arrow);
- gtk_widget_pop_composite_child ();
+ /*gtk_widget_pop_composite_child ();*/
}
@@ -383,8 +383,8 @@ browse_clicked (GtkWidget *button,
chooser = gtk_file_chooser_dialog_new (_("Select application"),
GTK_WINDOW (toplevel),
GTK_FILE_CHOOSER_ACTION_OPEN,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
+ _("_Cancel"), GTK_RESPONSE_CANCEL,
+ _("_Open"), GTK_RESPONSE_ACCEPT,
NULL);
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (chooser), TRUE);
@@ -527,29 +527,26 @@ menu_activate_other (GtkWidget *item,
dialog = gtk_dialog_new_with_buttons (dgettext (GETTEXT_PACKAGE, BROWSE_TITLES[chooser->category]),
GTK_WINDOW (toplevel),
GTK_DIALOG_DESTROY_WITH_PARENT
- | GTK_DIALOG_NO_SEPARATOR
| GTK_DIALOG_MODAL,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_OK,
+ _("_Cancel"), GTK_RESPONSE_CANCEL,
+ _("_OK"), GTK_RESPONSE_OK,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), 6);
- gtk_container_set_border_width (GTK_CONTAINER (gtk_dialog_get_action_area (GTK_DIALOG (dialog))), 5);
- gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_action_area (GTK_DIALOG (dialog))), 6);
gtk_window_set_resizable (GTK_WINDOW (dialog), FALSE);
- hbox = g_object_new (GTK_TYPE_HBOX, "border-width", 5, "spacing", 12, NULL);
+ hbox = g_object_new (GTK_TYPE_BOX, "orientation", GTK_ORIENTATION_HORIZONTAL, "border-width", 5, "spacing", 12, NULL);
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), hbox, TRUE, TRUE, 0);
gtk_widget_show (hbox);
image = gtk_image_new_from_icon_name ("preferences-desktop-default-applications", GTK_ICON_SIZE_DIALOG);
- gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0);
+ g_object_set (image, "halign", GTK_ALIGN_CENTER, "valign", GTK_ALIGN_START, NULL);
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
gtk_widget_show (image);
- vbox = gtk_vbox_new (FALSE, 6);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
gtk_widget_show (vbox);
@@ -561,7 +558,7 @@ menu_activate_other (GtkWidget *item,
gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);
gtk_widget_show (label);
- hbox = gtk_hbox_new (FALSE, 3);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 3);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);
gtk_widget_show (hbox);
@@ -576,7 +573,7 @@ menu_activate_other (GtkWidget *item,
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
gtk_widget_show (button);
- image = gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_BUTTON);
+ image = gtk_image_new_from_icon_name ("document-open", GTK_ICON_SIZE_BUTTON);
gtk_container_add (GTK_CONTAINER (button), image);
gtk_widget_show (image);
@@ -620,8 +617,8 @@ menu_position (GtkMenu *menu,
gboolean *push_in,
gpointer chooser)
{
- GtkRequisition chooser_request;
- GtkRequisition menu_request;
+ GtkAllocation chooser_allocation;
+ GtkAllocation menu_allocation;
GdkRectangle geometry;
GdkScreen *screen;
GtkWidget *toplevel = gtk_widget_get_toplevel (chooser);
@@ -631,8 +628,8 @@ menu_position (GtkMenu *menu,
gtk_widget_translate_coordinates (GTK_WIDGET (chooser), toplevel, 0, 0, &x0, &y0);
- gtk_widget_size_request (GTK_WIDGET (chooser), &chooser_request);
- gtk_widget_size_request (GTK_WIDGET (menu), &menu_request);
+ gtk_widget_get_allocation (GTK_WIDGET (chooser), &chooser_allocation);
+ gtk_widget_get_allocation (GTK_WIDGET (menu), &menu_allocation);
gdk_window_get_position (gtk_widget_get_window (GTK_WIDGET (chooser)), x, y);
@@ -645,8 +642,8 @@ menu_position (GtkMenu *menu,
{
monitor = gdk_screen_get_monitor_at_point (screen, *x, *y);
gdk_screen_get_monitor_geometry (screen, monitor, &geometry);
- if (*y + menu_request.height > geometry.y + geometry.height)
- *y -= menu_request.height - chooser_request.height;
+ if (*y + menu_allocation.height > geometry.y + geometry.height)
+ *y -= menu_allocation.height - chooser_allocation.height;
}
*push_in = TRUE;
@@ -671,6 +668,8 @@ exo_helper_chooser_pressed (ExoHelperChooser *chooser,
GtkWidget *menu;
GtkAllocation menu_allocation;
GtkWidget *item;
+ GtkWidget *item_hbox;
+ GtkWidget *item_label;
GList *helpers;
GList *lp;
gint icon_size;
@@ -682,9 +681,9 @@ exo_helper_chooser_pressed (ExoHelperChooser *chooser,
/* set a watch cursor while loading the menu */
if (G_LIKELY (gtk_widget_get_window (button) != NULL))
{
- cursor = gdk_cursor_new (GDK_WATCH);
+ cursor = gdk_cursor_new_for_display (gdk_window_get_display (gtk_widget_get_window (button)), GDK_WATCH);
gdk_window_set_cursor (gtk_widget_get_window (button), cursor);
- gdk_cursor_unref (cursor);
+ g_object_unref (cursor);
gdk_flush ();
}
@@ -713,12 +712,13 @@ exo_helper_chooser_pressed (ExoHelperChooser *chooser,
/* determine the helper */
helper = EXO_HELPER (lp->data);
- /* add a menu item for the helper */
- item = gtk_image_menu_item_new_with_label (exo_helper_get_name (helper));
- g_object_set_data_full (G_OBJECT (item), I_("exo-helper"), helper, g_object_unref);
- g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (menu_activate), chooser);
- gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
- gtk_widget_show (item);
+ /* create a menu item for the helper */
+ item_label = gtk_label_new (exo_helper_get_name (helper));
+ g_object_set (item_label, "xalign", 0.0f, "yalign", 0.5f, NULL);
+ item_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+ gtk_box_pack_end (GTK_BOX (item_hbox), item_label, TRUE, TRUE, 0);
+ item = gtk_menu_item_new ();
+ gtk_container_add (GTK_CONTAINER (item), item_hbox);
/* try to load the icon for the helper */
icon_name = exo_helper_get_icon (helper);
@@ -743,10 +743,15 @@ exo_helper_chooser_pressed (ExoHelperChooser *chooser,
if (G_LIKELY (icon != NULL))
{
image = gtk_image_new_from_pixbuf (icon);
- gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
+ gtk_box_pack_start (GTK_BOX (item_hbox), image, FALSE, FALSE, 0);
g_object_unref (G_OBJECT (icon));
- gtk_widget_show (image);
}
+
+ /* finish setting up the menu item and add it */
+ g_object_set_data_full (G_OBJECT (item), I_("exo-helper"), helper, g_object_unref);
+ g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (menu_activate), chooser);
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+ gtk_widget_show_all (item);
}
if (G_LIKELY (helpers != NULL))
@@ -783,7 +788,7 @@ exo_helper_chooser_pressed (ExoHelperChooser *chooser,
gtk_grab_remove (menu);
g_main_loop_unref (loop);
- gtk_button_released (GTK_BUTTON (button));
+ g_signal_emit_by_name (button, "button-release-event");
g_object_unref (G_OBJECT (menu));
}
diff --git a/exo-helper/exo-helper-launcher-dialog.c b/exo-helper/exo-helper-launcher-dialog.c
index 4d0ac93..734abb1 100644
--- a/exo-helper/exo-helper-launcher-dialog.c
+++ b/exo-helper/exo-helper-launcher-dialog.c
@@ -23,6 +23,7 @@
#include <exo-helper/exo-helper-chooser.h>
#include <exo-helper/exo-helper-enum-types.h>
#include <exo-helper/exo-helper-launcher-dialog.h>
+#include <gtk/gtkx.h>
@@ -105,23 +106,23 @@ exo_helper_launcher_dialog_init (ExoHelperLauncherDialog *launcher_dialog)
GtkWidget *hbox;
GtkWidget *vbox;
- gtk_dialog_add_button (GTK_DIALOG (launcher_dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
- gtk_dialog_add_button (GTK_DIALOG (launcher_dialog), GTK_STOCK_OK, GTK_RESPONSE_OK);
+ gtk_dialog_add_button (GTK_DIALOG (launcher_dialog), _("_Cancel"), GTK_RESPONSE_CANCEL);
+ gtk_dialog_add_button (GTK_DIALOG (launcher_dialog), _("_OK"), GTK_RESPONSE_OK);
gtk_dialog_set_default_response (GTK_DIALOG (launcher_dialog), GTK_RESPONSE_OK);
gtk_window_set_resizable (GTK_WINDOW (launcher_dialog), FALSE);
gtk_window_set_title (GTK_WINDOW (launcher_dialog), _("Choose Preferred Application"));
- hbox = gtk_hbox_new (FALSE, 12);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_container_set_border_width (GTK_CONTAINER (hbox), 12);
gtk_box_pack_start (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (launcher_dialog))), hbox, TRUE, TRUE, 0);
gtk_widget_show (hbox);
image = gtk_image_new_from_icon_name ("preferences-desktop-default-applications", GTK_ICON_SIZE_DIALOG);
- gtk_misc_set_alignment (GTK_MISC (image), 0.5f, 0.0f);
+ g_object_set (image, "halign", GTK_ALIGN_CENTER, "valign", GTK_ALIGN_START, NULL);
gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
gtk_widget_show (image);
- vbox = gtk_vbox_new (FALSE, 12);
+ vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
gtk_widget_show (vbox);
@@ -131,7 +132,7 @@ exo_helper_launcher_dialog_init (ExoHelperLauncherDialog *launcher_dialog)
chooser = g_object_new (EXO_TYPE_HELPER_CHOOSER, NULL);
g_signal_connect (G_OBJECT (chooser), "notify::is-valid", G_CALLBACK (exo_helper_launcher_dialog_notify_is_valid), launcher_dialog);
- exo_binding_new (G_OBJECT (launcher_dialog), "category", G_OBJECT (chooser), "category");
+ g_object_bind_property (G_OBJECT (launcher_dialog), "category", G_OBJECT (chooser), "category", G_BINDING_SYNC_CREATE);
gtk_box_pack_start (GTK_BOX (vbox), chooser, FALSE, FALSE, 0);
gtk_widget_show (chooser);
diff --git a/exo-helper/main.c b/exo-helper/main.c
index f5866a0..94a4605 100644
--- a/exo-helper/main.c
+++ b/exo-helper/main.c
@@ -33,6 +33,7 @@
#include <exo-helper/exo-helper-chooser-dialog.h>
#include <exo-helper/exo-helper-launcher-dialog.h>
#include <exo-helper/exo-helper-utils.h>
+#include <gtk/gtkx.h>
@@ -62,7 +63,7 @@ main (int argc, char **argv)
gboolean opt_version = FALSE;
gboolean opt_configure = FALSE;
gchar *opt_launch_type = NULL;
- GdkNativeWindow opt_socket_id = 0;
+ Window opt_socket_id = 0;
GOptionContext *opt_ctx;
GOptionGroup *gtk_option_group;
@@ -140,7 +141,13 @@ main (int argc, char **argv)
g_signal_connect (plug, "delete-event", G_CALLBACK (gtk_main_quit), NULL);
plug_child = exo_helper_chooser_dialog_get_plug_child (EXO_HELPER_CHOOSER_DIALOG (dialog));
- gtk_widget_reparent (plug_child, plug);
+
+ g_object_ref (plug_child);
+ if (gtk_widget_get_parent (plug_child))
+ gtk_container_remove (GTK_CONTAINER (gtk_widget_get_parent (plug_child)), plug_child);
+ gtk_container_add (GTK_CONTAINER (plug), plug_child);
+ g_object_unref (plug_child);
+
gtk_widget_show (plug_child);
/* End startup notification */
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list