[Xfce4-commits] [xfce/exo] 13/21: exo-desktop-item-edit: Port to Gtk3
noreply at xfce.org
noreply at xfce.org
Tue Jul 12 04:08:05 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 19598dc406f208651806a0b45aa2965f660ebe80
Author: Jonas Kümmerlin <rgcjonas at gmail.com>
Date: Sat Aug 8 11:41:22 2015 +0200
exo-desktop-item-edit: Port to Gtk3
---
exo-desktop-item-edit/Makefile.am | 12 ++--
exo-desktop-item-edit/exo-die-command-entry.c | 14 +++--
exo-desktop-item-edit/exo-die-command-model.c | 6 +-
exo-desktop-item-edit/exo-die-desktop-model.c | 6 +-
exo-desktop-item-edit/exo-die-editor.c | 80 ++++++++++++++-------------
exo-desktop-item-edit/main.c | 18 +++---
6 files changed, 66 insertions(+), 70 deletions(-)
diff --git a/exo-desktop-item-edit/Makefile.am b/exo-desktop-item-edit/Makefile.am
index 5c53ef5..7892491 100644
--- a/exo-desktop-item-edit/Makefile.am
+++ b/exo-desktop-item-edit/Makefile.am
@@ -26,24 +26,24 @@ exo_desktop_item_edit_SOURCES = \
main.c
exo_desktop_item_edit_CFLAGS = \
- $(GTK_CFLAGS) \
+ $(GTK3_CFLAGS) \
$(GTHREAD_CFLAGS) \
$(LIBXFCE4UTIL_CFLAGS) \
$(GIO_CFLAGS) \
- $(LIBXFCE4UI_CFLAGS)
+ $(LIBXFCE4UI2_CFLAGS)
exo_desktop_item_edit_LDFLAGS = \
-no-undefined
exo_desktop_item_edit_DEPENDENCIES = \
- $(top_builddir)/exo/libexo-$(LIBEXO_VERSION_API).la
+ $(top_builddir)/exo/libexo-2.la
exo_desktop_item_edit_LDADD = \
- $(GTK_LIBS) \
+ $(GTK3_LIBS) \
$(GTHREAD_LIBS) \
$(LIBXFCE4UTIL_LIBS) \
$(GIO_LIBS) \
- $(LIBXFCE4UI_LIBS) \
- $(top_builddir)/exo/libexo-$(LIBEXO_VERSION_API).la
+ $(LIBXFCE4UI2_LIBS) \
+ $(top_builddir)/exo/libexo-2.la
# vi:set ts=8 sw=8 noet ai nocindent syntax=automake:
diff --git a/exo-desktop-item-edit/exo-die-command-entry.c b/exo-desktop-item-edit/exo-die-command-entry.c
index 3e2af71..db2dfa1 100644
--- a/exo-desktop-item-edit/exo-die-command-entry.c
+++ b/exo-desktop-item-edit/exo-die-command-entry.c
@@ -77,7 +77,7 @@ struct _ExoDieCommandEntry
-G_DEFINE_TYPE (ExoDieCommandEntry, exo_die_command_entry, GTK_TYPE_HBOX)
+G_DEFINE_TYPE (ExoDieCommandEntry, exo_die_command_entry, GTK_TYPE_BOX)
@@ -135,13 +135,15 @@ exo_die_command_entry_init (ExoDieCommandEntry *command_entry)
GtkWidget *image;
/* setup the box */
+ gtk_orientable_set_orientation (GTK_ORIENTABLE (command_entry), GTK_ORIENTATION_HORIZONTAL);
gtk_box_set_spacing (GTK_BOX (command_entry), 6);
/* allocate the command model */
command_entry->model = exo_die_command_model_new ();
g_signal_connect (G_OBJECT (command_entry->model), "loaded", G_CALLBACK (exo_die_command_entry_model_loaded), command_entry);
- gtk_widget_push_composite_child ();
+ /* TODO: switch to widget templates
+ gtk_widget_push_composite_child ();*/
command_entry->entry = gtk_entry_new ();
gtk_entry_set_activates_default (GTK_ENTRY (command_entry->entry), TRUE);
@@ -154,11 +156,11 @@ exo_die_command_entry_init (ExoDieCommandEntry *command_entry)
gtk_box_pack_start (GTK_BOX (command_entry), button, FALSE, FALSE, 0);
gtk_widget_show (button);
- image = gtk_image_new_from_stock (GTK_STOCK_OPEN, GTK_ICON_SIZE_MENU);
+ image = gtk_image_new_from_icon_name ("document-open", GTK_ICON_SIZE_MENU);
gtk_container_add (GTK_CONTAINER (button), image);
gtk_widget_show (image);
- gtk_widget_pop_composite_child ();
+ /*gtk_widget_pop_composite_child ();*/
}
@@ -255,8 +257,8 @@ exo_die_command_entry_button_clicked (GtkWidget *button,
chooser = gtk_file_chooser_dialog_new (_("Select an Application"),
GTK_WINDOW (toplevel),
GTK_FILE_CHOOSER_ACTION_OPEN,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+ _("_Cancel"), GTK_RESPONSE_CANCEL,
+ _("_Open"), GTK_RESPONSE_ACCEPT,
NULL);
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (chooser), TRUE);
diff --git a/exo-desktop-item-edit/exo-die-command-model.c b/exo-desktop-item-edit/exo-die-command-model.c
index 7998f0e..dcecaf7 100644
--- a/exo-desktop-item-edit/exo-die-command-model.c
+++ b/exo-desktop-item-edit/exo-die-command-model.c
@@ -384,8 +384,6 @@ exo_die_command_model_collect_idle (gpointer user_data)
g_return_val_if_fail (EXO_DIE_IS_COMMAND_MODEL (command_model), FALSE);
g_return_val_if_fail (command_model->items == NULL, FALSE);
- GDK_THREADS_ENTER ();
-
/* move the collected items "online" */
command_model->items = command_model->collect_items;
command_model->collect_items = NULL;
@@ -416,8 +414,6 @@ exo_die_command_model_collect_idle (gpointer user_data)
/* tell the consumer that we are loaded */
g_signal_emit (G_OBJECT (command_model), command_model_signals[LOADED], 0);
- GDK_THREADS_LEAVE ();
-
return FALSE;
}
@@ -508,7 +504,7 @@ exo_die_command_model_collect_thread (gpointer user_data)
command_model->collect_items = items;
/* and schedule an idle source */
- command_model->collect_idle_id = g_idle_add_full (G_PRIORITY_LOW, exo_die_command_model_collect_idle,
+ command_model->collect_idle_id = gdk_threads_add_idle_full (G_PRIORITY_LOW, exo_die_command_model_collect_idle,
command_model, exo_die_command_model_collect_idle_destroy);
}
else
diff --git a/exo-desktop-item-edit/exo-die-desktop-model.c b/exo-desktop-item-edit/exo-die-desktop-model.c
index a74c85a..4d85447 100644
--- a/exo-desktop-item-edit/exo-die-desktop-model.c
+++ b/exo-desktop-item-edit/exo-die-desktop-model.c
@@ -427,8 +427,6 @@ exo_die_desktop_model_collect_idle (gpointer user_data)
g_return_val_if_fail (EXO_DIE_IS_DESKTOP_MODEL (desktop_model), FALSE);
g_return_val_if_fail (desktop_model->items == NULL, FALSE);
- GDK_THREADS_ENTER ();
-
/* move the collected items "online" */
desktop_model->items = desktop_model->collect_items;
desktop_model->collect_items = NULL;
@@ -456,8 +454,6 @@ exo_die_desktop_model_collect_idle (gpointer user_data)
}
gtk_tree_path_free (path);
- GDK_THREADS_LEAVE ();
-
return FALSE;
}
@@ -546,7 +542,7 @@ exo_die_desktop_model_collect_thread (gpointer user_data)
desktop_model->collect_items = g_slist_sort (items, exo_die_desktop_item_compare);
/* and schedule an idle source */
- desktop_model->collect_idle_id = g_idle_add_full (G_PRIORITY_LOW, exo_die_desktop_model_collect_idle,
+ desktop_model->collect_idle_id = gdk_threads_add_idle_full (G_PRIORITY_LOW, exo_die_desktop_model_collect_idle,
desktop_model, exo_die_desktop_model_collect_idle_destroy);
}
else
diff --git a/exo-desktop-item-edit/exo-die-editor.c b/exo-desktop-item-edit/exo-die-editor.c
index 07f5dd2..8c43dd6 100644
--- a/exo-desktop-item-edit/exo-die-editor.c
+++ b/exo-desktop-item-edit/exo-die-editor.c
@@ -72,12 +72,12 @@ static void exo_die_editor_cell_data_func (GtkCellLayout *cell_layout,
struct _ExoDieEditorClass
{
- GtkTableClass __parent__;
+ GtkGridClass __parent__;
};
struct _ExoDieEditor
{
- GtkTable __parent__;
+ GtkGrid __parent__;
GtkWidget *name_entry;
GtkWidget *icon_button;
ExoDieEditorMode mode;
@@ -93,7 +93,7 @@ struct _ExoDieEditor
-G_DEFINE_TYPE (ExoDieEditor, exo_die_editor, GTK_TYPE_TABLE)
+G_DEFINE_TYPE (ExoDieEditor, exo_die_editor, GTK_TYPE_GRID)
@@ -270,7 +270,6 @@ static void
exo_die_editor_init (ExoDieEditor *editor)
{
GtkWidget *button;
- GtkWidget *align;
GtkWidget *entry;
GtkWidget *label;
GtkWidget *image;
@@ -287,23 +286,23 @@ exo_die_editor_init (ExoDieEditor *editor)
editor->path = g_strdup ("");
/* configure the table */
- gtk_table_resize (GTK_TABLE (editor), 8, 2);
- gtk_table_set_col_spacings (GTK_TABLE (editor), 12);
- gtk_table_set_row_spacings (GTK_TABLE (editor), 0);
+ gtk_grid_set_column_spacing (GTK_GRID (editor), 12);
+ gtk_grid_set_row_spacing (GTK_GRID (editor), 6);
row = 0;
/* TRANSLATORS: Label in "Create Launcher"/"Create Link" dialog, make sure to avoid mnemonic conflicts */
label = gtk_label_new_with_mnemonic (_("_Name:"));
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (label), 1.0f, 0.5f);
- gtk_table_attach (GTK_TABLE (editor), label, 0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 3);
+ g_object_set (label, "xalign", 1.0f, "yalign", 0.5f, NULL);
+ gtk_grid_attach (GTK_GRID (editor), label, 0, row, 1, 1);
gtk_widget_show (label);
editor->name_entry = gtk_entry_new ();
gtk_entry_set_activates_default (GTK_ENTRY (editor->name_entry), TRUE);
exo_mutual_binding_new (G_OBJECT (editor), "name", G_OBJECT (editor->name_entry), "text");
- gtk_table_attach (GTK_TABLE (editor), editor->name_entry, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3);
+ gtk_grid_attach (GTK_GRID (editor), editor->name_entry, 1, row, 1, 1);
+ g_object_set (editor->name_entry, "hexpand", TRUE, NULL);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), editor->name_entry);
gtk_widget_show (editor->name_entry);
@@ -312,14 +311,15 @@ exo_die_editor_init (ExoDieEditor *editor)
/* TRANSLATORS: Label in "Create Launcher"/"Create Link" dialog, make sure to avoid mnemonic conflicts */
label = gtk_label_new_with_mnemonic (_("C_omment:"));
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (label), 1.0f, 0.5f);
- gtk_table_attach (GTK_TABLE (editor), label, 0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 3);
+ g_object_set (label, "xalign", 1.0f, "yalign", 0.5f, NULL);
+ gtk_grid_attach (GTK_GRID (editor), label, 0, row, 1, 1);
gtk_widget_show (label);
entry = gtk_entry_new ();
gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
exo_mutual_binding_new (G_OBJECT (editor), "comment", G_OBJECT (entry), "text");
- gtk_table_attach (GTK_TABLE (editor), entry, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3);
+ gtk_grid_attach (GTK_GRID (editor), entry, 1, row, 1, 1);
+ g_object_set (entry, "hexpand", TRUE, NULL);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
gtk_widget_show (entry);
@@ -328,14 +328,15 @@ exo_die_editor_init (ExoDieEditor *editor)
/* TRANSLATORS: Label in "Create Launcher" dialog, make sure to avoid mnemonic conflicts */
label = gtk_label_new_with_mnemonic (_("Comm_and:"));
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (label), 1.0f, 0.5f);
+ g_object_set (label, "xalign", 1.0f, "yalign", 0.5f, NULL);
exo_binding_new_full (G_OBJECT (editor), "mode", G_OBJECT (label), "visible", exo_die_true_if_application, NULL, NULL);
- gtk_table_attach (GTK_TABLE (editor), label, 0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 3);
+ gtk_grid_attach (GTK_GRID (editor), label, 0, row, 1, 1);
entry = exo_die_command_entry_new ();
exo_mutual_binding_new (G_OBJECT (editor), "command", G_OBJECT (entry), "text");
exo_binding_new_full (G_OBJECT (editor), "mode", G_OBJECT (entry), "visible", exo_die_true_if_application, NULL, NULL);
- gtk_table_attach (GTK_TABLE (editor), entry, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3);
+ gtk_grid_attach (GTK_GRID (editor), entry, 1, row, 1, 1);
+ g_object_set (entry, "hexpand", TRUE, NULL);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
row += 1;
@@ -343,15 +344,16 @@ exo_die_editor_init (ExoDieEditor *editor)
/* TRANSLATORS: Label in "Create Link" dialog, make sure to avoid mnemonic conflicts */
label = gtk_label_new_with_mnemonic (_("_URL:"));
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (label), 1.0f, 0.5f);
+ g_object_set (label, "xalign", 1.0f, "yalign", 0.5f, NULL);
exo_binding_new_full (G_OBJECT (editor), "mode", G_OBJECT (label), "visible", exo_die_true_if_link, NULL, NULL);
- gtk_table_attach (GTK_TABLE (editor), label, 0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 3);
+ gtk_grid_attach (GTK_GRID (editor), label, 0, row, 1, 1);
entry = gtk_entry_new ();
gtk_entry_set_activates_default (GTK_ENTRY (entry), TRUE);
exo_mutual_binding_new (G_OBJECT (editor), "url", G_OBJECT (entry), "text");
exo_binding_new_full (G_OBJECT (editor), "mode", G_OBJECT (entry), "visible", exo_die_true_if_link, NULL, NULL);
- gtk_table_attach (GTK_TABLE (editor), entry, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3);
+ gtk_grid_attach (GTK_GRID (editor), entry, 1, row, 1, 1);
+ g_object_set (entry, "hexpand", TRUE, NULL);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
row += 1;
@@ -359,12 +361,13 @@ exo_die_editor_init (ExoDieEditor *editor)
/* TRANSLATORS: Label in "Create Launcher" dialog, make sure to avoid mnemonic conflicts */
label = gtk_label_new_with_mnemonic (_("Working _Directory:"));
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (label), 1.0f, 0.5f);
+ g_object_set (label, "xalign", 1.0f, "yalign", 0.5f, NULL);
exo_binding_new_full (G_OBJECT (editor), "mode", G_OBJECT (label), "visible", exo_die_true_if_application, NULL, NULL);
- gtk_table_attach (GTK_TABLE (editor), label, 0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 3);
+ gtk_grid_attach (GTK_GRID (editor), label, 0, row, 1, 1);
- box = gtk_hbox_new (FALSE, 6);
- gtk_table_attach (GTK_TABLE (editor), box, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3);
+ box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
+ gtk_grid_attach (GTK_GRID (editor), box, 1, row, 1, 1);
+ g_object_set (box, "hexpand", TRUE, NULL);
exo_binding_new_full (G_OBJECT (editor), "mode", G_OBJECT (box), "visible", exo_die_true_if_application, NULL, NULL);
entry = gtk_entry_new ();
@@ -379,7 +382,7 @@ exo_die_editor_init (ExoDieEditor *editor)
gtk_box_pack_start (GTK_BOX (box), button, FALSE, FALSE, 0);
gtk_widget_show (button);
- image = gtk_image_new_from_stock (GTK_STOCK_DIRECTORY, GTK_ICON_SIZE_MENU);
+ image = gtk_image_new_from_icon_name ("folder", GTK_ICON_SIZE_MENU);
gtk_container_add (GTK_CONTAINER (button), image);
gtk_widget_show (image);
@@ -388,19 +391,16 @@ exo_die_editor_init (ExoDieEditor *editor)
/* TRANSLATORS: Label in "Create Launcher"/"Create Link" dialog, make sure to avoid mnemonic conflicts */
label = gtk_label_new_with_mnemonic (_("_Icon:"));
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (label), 1.0f, 0.5f);
- gtk_table_attach (GTK_TABLE (editor), label, 0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 3);
+ g_object_set (label, "xalign", 1.0f, "yalign", 0.5f, NULL);
+ gtk_grid_attach (GTK_GRID (editor), label, 0, row, 1, 1);
gtk_widget_show (label);
- align = gtk_alignment_new (0.0f, 0.5f, 0.0f, 0.0f);
- gtk_table_attach (GTK_TABLE (editor), align, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3);
- gtk_widget_show (align);
-
editor->icon_button = gtk_button_new ();
g_signal_connect (G_OBJECT (editor->icon_button), "clicked", G_CALLBACK (exo_die_editor_icon_clicked), editor);
- gtk_container_add (GTK_CONTAINER (align), editor->icon_button);
gtk_label_set_mnemonic_widget (GTK_LABEL (label), editor->icon_button);
gtk_widget_show (editor->icon_button);
+ gtk_grid_attach (GTK_GRID (editor), editor->icon_button, 1, row, 1, 1);
+ g_object_set (editor->icon_button, "expand", FALSE, "halign", GTK_ALIGN_START, "valign", GTK_ALIGN_CENTER, NULL);
/* TRANSLATORS: Label for the icon button in "Create Launcher"/"Create Link" dialog if no icon selected */
label = gtk_label_new (_("No icon"));
@@ -411,9 +411,9 @@ exo_die_editor_init (ExoDieEditor *editor)
label = gtk_label_new (_("Options:"));
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
- gtk_misc_set_alignment (GTK_MISC (label), 1.0f, 0.5f);
+ g_object_set (label, "xalign", 1.0f, "yalign", 0.5f, NULL);
exo_binding_new_full (G_OBJECT (editor), "mode", G_OBJECT (label), "visible", exo_die_true_if_application, NULL, NULL);
- gtk_table_attach (GTK_TABLE (editor), label, 0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 3);
+ gtk_grid_attach (GTK_GRID (editor), label, 0, row, 1, 1);
/* TRANSLATORS: Check button label in "Create Launcher" dialog, make sure to avoid mnemonic conflicts
* and sync your translations with the translations in Thunar and xfce4-panel.
@@ -424,7 +424,8 @@ exo_die_editor_init (ExoDieEditor *editor)
"startup notification."));
exo_mutual_binding_new (G_OBJECT (editor), "snotify", G_OBJECT (button), "active");
exo_binding_new_full (G_OBJECT (editor), "mode", G_OBJECT (button), "visible", exo_die_true_if_application, NULL, NULL);
- gtk_table_attach (GTK_TABLE (editor), button, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3);
+ gtk_grid_attach (GTK_GRID (editor), button, 1, row, 1, 1);
+ g_object_set (button, "hexpand", TRUE, NULL);
row += 1;
@@ -435,7 +436,8 @@ exo_die_editor_init (ExoDieEditor *editor)
gtk_widget_set_tooltip_text (button, _("Select this option to run the command in a terminal window."));
exo_mutual_binding_new (G_OBJECT (editor), "terminal", G_OBJECT (button), "active");
exo_binding_new_full (G_OBJECT (editor), "mode", G_OBJECT (button), "visible", exo_die_true_if_application, NULL, NULL);
- gtk_table_attach (GTK_TABLE (editor), button, 1, 2, row, row + 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 3);
+ gtk_grid_attach (GTK_GRID (editor), button, 1, row, 1, 1);
+ g_object_set (button, "hexpand", TRUE, NULL);
}
@@ -589,8 +591,8 @@ exo_die_editor_icon_clicked (GtkWidget *button,
/* allocate the icon chooser dialog */
chooser = exo_icon_chooser_dialog_new (_("Select an icon"),
GTK_WINDOW (toplevel),
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
+ _("_Cancel"), GTK_RESPONSE_CANCEL,
+ _("_OK"), GTK_RESPONSE_ACCEPT,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (chooser), GTK_RESPONSE_ACCEPT);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (chooser),
@@ -637,8 +639,8 @@ exo_die_editor_path_clicked (GtkWidget *button,
chooser = gtk_file_chooser_dialog_new (_("Select a working directory"),
GTK_WINDOW (toplevel),
GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_OK, GTK_RESPONSE_ACCEPT,
+ _("_Cancel"), GTK_RESPONSE_CANCEL,
+ _("_OK"), GTK_RESPONSE_ACCEPT,
NULL);
gtk_dialog_set_default_response (GTK_DIALOG (chooser), GTK_RESPONSE_ACCEPT);
gtk_dialog_set_alternative_button_order (GTK_DIALOG (chooser),
diff --git a/exo-desktop-item-edit/main.c b/exo-desktop-item-edit/main.c
index c9671e0..5e3eb06 100644
--- a/exo-desktop-item-edit/main.c
+++ b/exo-desktop-item-edit/main.c
@@ -322,13 +322,13 @@ main (int argc, char **argv)
/* allocate the dialog */
dialog = xfce_titled_dialog_new_with_buttons (opt_create_new ? _(CREATE_TITLES[mode]) : _(EDIT_TITLES[mode]),
- NULL, GTK_DIALOG_NO_SEPARATOR,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ NULL, 0,
+ _("_Cancel"), GTK_RESPONSE_CANCEL,
NULL);
gtk_window_set_default_size (GTK_WINDOW (dialog), 350, 375);
gtk_window_set_icon_name (GTK_WINDOW (dialog), ICON_NAMES[mode]);
- button = gtk_button_new_from_stock (GTK_STOCK_HELP);
+ button = gtk_button_new_with_mnemonic (_("_Help"));
bbox = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
gtk_box_pack_start (GTK_BOX (bbox), button, FALSE, FALSE, 0);
gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (bbox), button, TRUE);
@@ -337,7 +337,7 @@ main (int argc, char **argv)
gtk_widget_show (button);
/* add the "Create"/"Save" button (as default) */
- button = gtk_button_new_from_stock (opt_create_new ? _("C_reate") : GTK_STOCK_SAVE);
+ button = gtk_button_new_with_mnemonic (opt_create_new ? _("C_reate") : _("_Save"));
gtk_dialog_add_action_widget (GTK_DIALOG (dialog), button, GTK_RESPONSE_ACCEPT);
gtk_widget_set_can_default (button, TRUE);
gtk_widget_grab_default (button);
@@ -424,7 +424,7 @@ main (int argc, char **argv)
if (G_UNLIKELY (opt_xid != 0))
{
/* try to determine the window for the id */
- xwindow = gdk_window_foreign_new ((GdkNativeWindow) opt_xid);
+ xwindow = gdk_x11_window_foreign_new_for_display (gdk_display_get_default(), opt_xid);
if (G_LIKELY (xwindow != NULL))
{
GtkAllocation allocation;
@@ -435,11 +435,11 @@ main (int argc, char **argv)
/* ...and set the "transient for" relation */
gdk_window_set_transient_for (gtk_widget_get_window (dialog), xwindow);
gtk_window_set_screen (GTK_WINDOW (dialog),
- gdk_drawable_get_screen (GDK_DRAWABLE (xwindow)));
+ gdk_window_get_screen (GDK_WINDOW (xwindow)));
/* center on parent */
gdk_window_get_root_origin (xwindow, &ox, &oy);
- gdk_window_get_geometry (xwindow, NULL, NULL, &ow, &oh, NULL);
+ gdk_window_get_geometry (xwindow, NULL, NULL, &ow, &oh);
gtk_widget_get_allocation (dialog, &allocation);
ox += (ow - allocation.width) / 2;
@@ -516,8 +516,8 @@ main (int argc, char **argv)
chooser = gtk_file_chooser_dialog_new (_("Choose filename"),
GTK_WINDOW (dialog),
GTK_FILE_CHOOSER_ACTION_SAVE,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
+ _("_Cancel"), GTK_RESPONSE_CANCEL,
+ _("_Save"), GTK_RESPONSE_ACCEPT,
NULL);
gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (chooser), TRUE);
gtk_file_chooser_set_do_overwrite_confirmation (GTK_FILE_CHOOSER (chooser), TRUE);
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list