[gnome-dictionary] app: Drop all deprecated API
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-dictionary] app: Drop all deprecated API
- Date: Mon, 23 Feb 2015 15:33:42 +0000 (UTC)
commit c60d8c8b8eda7bd4be587f90bc0d20b91e76e5d0
Author: Emmanuele Bassi <ebassi gnome org>
Date: Mon Feb 23 15:01:46 2015 +0000
app: Drop all deprecated API
https://bugzilla.gnome.org/show_bug.cgi?id=745022
src/gdict-app.c | 14 ++++++--------
src/gdict-sidebar.c | 17 +++++++++++------
src/gdict-window.c | 5 ++++-
3 files changed, 21 insertions(+), 15 deletions(-)
---
diff --git a/src/gdict-app.c b/src/gdict-app.c
index 96dc603..25159be 100644
--- a/src/gdict-app.c
+++ b/src/gdict-app.c
@@ -320,6 +320,8 @@ gdict_startup (GApplication *application,
{
GtkBuilder *builder = gtk_builder_new ();
GError * error = NULL;
+ static const char *lookup_accels[2] = { "<Primary>l", NULL };
+ static const char *escape_accels[2] = { "Escape", NULL };
g_action_map_add_action_entries (G_ACTION_MAP (application),
app_entries, G_N_ELEMENTS (app_entries),
@@ -336,15 +338,11 @@ gdict_startup (GApplication *application,
}
gtk_application_set_menubar (GTK_APPLICATION (application),
- G_MENU_MODEL (gtk_builder_get_object (builder,
- "menubar")));
+ G_MENU_MODEL (gtk_builder_get_object (builder, "menubar")));
gtk_application_set_app_menu (GTK_APPLICATION (application),
- G_MENU_MODEL (gtk_builder_get_object (builder,
- "app-menu")));
- gtk_application_add_accelerator (GTK_APPLICATION (application),
- "<Primary>l", "win.lookup", NULL);
- gtk_application_add_accelerator (GTK_APPLICATION (application),
- "Escape", "win.escape", NULL);
+ G_MENU_MODEL (gtk_builder_get_object (builder, "app-menu")));
+ gtk_application_set_accels_for_action (GTK_APPLICATION (application), "win.lookup", lookup_accels);
+ gtk_application_set_accels_for_action (GTK_APPLICATION (application), "win.escape", escape_accels);
g_object_unref (builder);
}
diff --git a/src/gdict-sidebar.c b/src/gdict-sidebar.c
index efa3888..83c0b80 100644
--- a/src/gdict-sidebar.c
+++ b/src/gdict-sidebar.c
@@ -72,7 +72,7 @@ enum
static guint sidebar_signals[LAST_SIGNAL] = { 0 };
static GQuark sidebar_page_id_quark = 0;
-G_DEFINE_TYPE (GdictSidebar, gdict_sidebar, GTK_TYPE_VBOX);
+G_DEFINE_TYPE (GdictSidebar, gdict_sidebar, GTK_TYPE_BOX);
SidebarPage *
sidebar_page_new (const gchar *id,
@@ -316,6 +316,9 @@ gdict_sidebar_init (GdictSidebar *sidebar)
sidebar->priv = priv = GDICT_SIDEBAR_GET_PRIVATE (sidebar);
+ gtk_orientable_set_orientation (GTK_ORIENTABLE (sidebar),
+ GTK_ORIENTATION_VERTICAL);
+
/* we store all the pages inside the list, but we keep
* a pointer inside the hash table for faster look up
* times; what's inside the table will be destroyed with
@@ -343,14 +346,16 @@ gdict_sidebar_init (GdictSidebar *sidebar)
sidebar);
priv->select_button = select_button;
- select_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+ select_hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
- priv->label = gtk_label_new (NULL);
- gtk_misc_set_alignment (GTK_MISC (priv->label), 0.0, 0.5);
+ priv->label = g_object_new (GTK_TYPE_LABEL,
+ "xalign", 0.0,
+ "yalign", 0.5,
+ NULL);
gtk_box_pack_start (GTK_BOX (select_hbox), priv->label, FALSE, FALSE, 0);
gtk_widget_show (priv->label);
- arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE);
+ arrow = gtk_image_new_from_icon_name ("go-down-symbolic", GTK_ICON_SIZE_BUTTON);
gtk_box_pack_end (GTK_BOX (select_hbox), arrow, FALSE, FALSE, 0);
gtk_widget_show (arrow);
@@ -434,7 +439,7 @@ gdict_sidebar_add_page (GdictSidebar *sidebar,
NULL);
/* add the menu item for the page */
- menu_item = gtk_image_menu_item_new_with_label (page_name);
+ menu_item = gtk_menu_item_new_with_label (page_name);
g_object_set_qdata_full (G_OBJECT (menu_item),
sidebar_page_id_quark,
g_strdup (page_id),
diff --git a/src/gdict-window.c b/src/gdict-window.c
index 91e2d06..e27db0e 100644
--- a/src/gdict-window.c
+++ b/src/gdict-window.c
@@ -248,7 +248,10 @@ gdict_window_lookup_start_cb (GdictContext *context,
return;
if (!window->busy_cursor)
- window->busy_cursor = gdk_cursor_new (GDK_WATCH);
+ {
+ GdkDisplay *display = gtk_widget_get_display (GTK_WIDGET (window));
+ window->busy_cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
+ }
message = g_strdup_printf (_("Searching for '%s'..."), window->word);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]