[gtranslator] Make it build with gtk+ 3.



commit 3f47b72d4b7eb6fa1078598c01e3348f9f5dfca4
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Tue Nov 2 11:36:32 2010 +0100

    Make it build with gtk+ 3.

 src/dialogs/gtr-close-confirmation-dialog.c        |    1 -
 src/dialogs/gtr-header-dialog.c                    |    1 -
 src/dialogs/gtr-jump-dialog.c                      |    1 -
 src/dialogs/gtr-preferences-dialog.c               |   10 +--
 src/dialogs/gtr-profile-dialog.c                   |    1 -
 src/dialogs/gtr-search-dialog.c                    |    5 +-
 src/gtr-status-combo-box.c                         |    6 +-
 src/gtr-utils.c                                    |   62 --------------------
 src/gtr-utils.h                                    |    6 --
 src/gtr-window.c                                   |   35 +++++------
 src/main.c                                         |    3 -
 src/translation-memory/gtr-translation-memory-ui.c |    4 +-
 12 files changed, 27 insertions(+), 108 deletions(-)
---
diff --git a/src/dialogs/gtr-close-confirmation-dialog.c b/src/dialogs/gtr-close-confirmation-dialog.c
index 0db434c..41c4acf 100644
--- a/src/dialogs/gtr-close-confirmation-dialog.c
+++ b/src/dialogs/gtr-close-confirmation-dialog.c
@@ -144,7 +144,6 @@ gtr_close_confirmation_dialog_init (GtrCloseConfirmationDialog * dlg)
   gtk_container_set_border_width (GTK_CONTAINER (dlg), 5);
   gtk_box_set_spacing (GTK_BOX (gtk_dialog_get_content_area (GTK_DIALOG (dlg))), 14);
   gtk_window_set_resizable (GTK_WINDOW (dlg), FALSE);
-  gtk_dialog_set_has_separator (GTK_DIALOG (dlg), FALSE);
   gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dlg), TRUE);
 
   gtk_window_set_title (GTK_WINDOW (dlg), "");
diff --git a/src/dialogs/gtr-header-dialog.c b/src/dialogs/gtr-header-dialog.c
index 8cc4c7d..7800b37 100644
--- a/src/dialogs/gtr-header-dialog.c
+++ b/src/dialogs/gtr-header-dialog.c
@@ -251,7 +251,6 @@ gtr_header_dialog_init (GtrHeaderDialog * dlg)
 
   gtk_window_set_title (GTK_WINDOW (dlg), _("Edit Header"));
   gtk_window_set_resizable (GTK_WINDOW (dlg), FALSE);
-  gtk_dialog_set_has_separator (GTK_DIALOG (dlg), FALSE);
   gtk_window_set_destroy_with_parent (GTK_WINDOW (dlg), TRUE);
 
   action_area = gtk_dialog_get_action_area (GTK_DIALOG (dlg));
diff --git a/src/dialogs/gtr-jump-dialog.c b/src/dialogs/gtr-jump-dialog.c
index f9bf92b..a5127d8 100644
--- a/src/dialogs/gtr-jump-dialog.c
+++ b/src/dialogs/gtr-jump-dialog.c
@@ -92,7 +92,6 @@ gtr_jump_dialog_init (GtrJumpDialog * dlg)
   gtk_window_set_title (GTK_WINDOW (dlg), _("Go to Message"));
   gtk_window_set_default_size (GTK_WINDOW (dlg), 300, 100);
   gtk_window_set_resizable (GTK_WINDOW (dlg), TRUE);
-  gtk_dialog_set_has_separator (GTK_DIALOG (dlg), FALSE);
   gtk_window_set_destroy_with_parent (GTK_WINDOW (dlg), TRUE);
 
   action_area = gtk_dialog_get_action_area (GTK_DIALOG (dlg));
diff --git a/src/dialogs/gtr-preferences-dialog.c b/src/dialogs/gtr-preferences-dialog.c
index 41a452e..504d800 100644
--- a/src/dialogs/gtr-preferences-dialog.c
+++ b/src/dialogs/gtr-preferences-dialog.c
@@ -615,11 +615,11 @@ setup_profile_pages (GtrPreferencesDialog *dlg)
 
 /***************Interface pages****************/
 static void
-scheme_color_changed_cb (GtkComboBox * combobox, GtrPreferencesDialog * dlg)
+scheme_color_changed_cb (GtkComboBoxText * combobox, GtrPreferencesDialog * dlg)
 {
   gchar *active_text;
 
-  active_text = gtk_combo_box_get_active_text (combobox);
+  active_text = gtk_combo_box_text_get_active_text (combobox);
 
   g_settings_set_string (dlg->priv->ui_settings,
                          GTR_SETTINGS_COLOR_SCHEME,
@@ -676,9 +676,8 @@ setup_interface_pages (GtrPreferencesDialog * dlg)
                                          GTR_SETTINGS_COLOR_SCHEME);
   while (scheme_ids[i] != NULL)
     {
-      gtk_combo_box_append_text (GTK_COMBO_BOX
-                                 (dlg->priv->scheme_color_combobox),
-                                 scheme_ids[i]);
+      gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (dlg->priv->scheme_color_combobox),
+                                      scheme_ids[i]);
       if (g_strcmp0 (scheme_ids[i], scheme_active) == 0)
         gtk_combo_box_set_active (GTK_COMBO_BOX
                                   (dlg->priv->scheme_color_combobox), i);
@@ -987,7 +986,6 @@ gtr_preferences_dialog_init (GtrPreferencesDialog * dlg)
 
   gtk_window_set_title (GTK_WINDOW (dlg), _("Gtranslator Preferences"));
   gtk_window_set_resizable (GTK_WINDOW (dlg), FALSE);
-  gtk_dialog_set_has_separator (GTK_DIALOG (dlg), FALSE);
   gtk_window_set_destroy_with_parent (GTK_WINDOW (dlg), TRUE);
 
   action_area = gtk_dialog_get_action_area (GTK_DIALOG (dlg));
diff --git a/src/dialogs/gtr-profile-dialog.c b/src/dialogs/gtr-profile-dialog.c
index e739521..0f0099b 100644
--- a/src/dialogs/gtr-profile-dialog.c
+++ b/src/dialogs/gtr-profile-dialog.c
@@ -85,7 +85,6 @@ gtr_profile_dialog_init (GtrProfileDialog *dlg)
 
   gtk_window_set_title (GTK_WINDOW (dlg), _("Gtranslator Profile"));
   gtk_window_set_resizable (GTK_WINDOW (dlg), FALSE);
-  gtk_dialog_set_has_separator (GTK_DIALOG (dlg), FALSE);
   gtk_window_set_destroy_with_parent (GTK_WINDOW (dlg), TRUE);
   gtk_window_set_modal (GTK_WINDOW (dlg), TRUE);
 
diff --git a/src/dialogs/gtr-search-dialog.c b/src/dialogs/gtr-search-dialog.c
index 828e74d..7b2af19 100644
--- a/src/dialogs/gtr-search-dialog.c
+++ b/src/dialogs/gtr-search-dialog.c
@@ -166,9 +166,9 @@ gtr_search_dialog_class_init (GtrSearchDialogClass * klass)
   /* Note: we cannot use the keyval/modifier associated with the 
    * GTK_STOCK_FIND_AND_REPLACE stock item since GNOME HIG suggests Ctrl+h
    * for Replace while gtk+ uses Ctrl+r */
-  gtk_binding_entry_add_signal (binding_set, GDK_h, GDK_CONTROL_MASK,
+  gtk_binding_entry_add_signal (binding_set, GDK_KEY_h, GDK_CONTROL_MASK,
                                 "show_replace", 0);
-  gtk_binding_entry_add_signal (binding_set, GDK_H, GDK_CONTROL_MASK,
+  gtk_binding_entry_add_signal (binding_set, GDK_KEY_H, GDK_CONTROL_MASK,
                                 "show_replace", 0);
 }
 
@@ -371,7 +371,6 @@ gtr_search_dialog_init (GtrSearchDialog * dlg)
   dlg->priv = GTR_SEARCH_DIALOG_GET_PRIVATE (dlg);
 
   gtk_window_set_resizable (GTK_WINDOW (dlg), FALSE);
-  gtk_dialog_set_has_separator (GTK_DIALOG (dlg), FALSE);
   gtk_window_set_destroy_with_parent (GTK_WINDOW (dlg), TRUE);
 
   gtk_dialog_add_buttons (GTK_DIALOG (dlg),
diff --git a/src/gtr-status-combo-box.c b/src/gtr-status-combo-box.c
index 8195e7f..4dc474a 100644
--- a/src/gtr-status-combo-box.c
+++ b/src/gtr-status-combo-box.c
@@ -252,9 +252,9 @@ key_press_event (GtkWidget           *widget,
 		 GdkEventKey         *event,
 		 GtrStatusComboBox *combo)
 {
-	if (event->keyval == GDK_Return || event->keyval == GDK_ISO_Enter ||
-	    event->keyval == GDK_KP_Enter || event->keyval == GDK_space ||
-	    event->keyval == GDK_KP_Space)
+	if (event->keyval == GDK_KEY_Return || event->keyval == GDK_KEY_ISO_Enter ||
+	    event->keyval == GDK_KEY_KP_Enter || event->keyval == GDK_KEY_space ||
+	    event->keyval == GDK_KEY_KP_Space)
 	{
 		show_menu (combo, 0, event->time);
 		return TRUE;
diff --git a/src/gtr-utils.c b/src/gtr-utils.c
index cec1491..f85e0b8 100644
--- a/src/gtr-utils.c
+++ b/src/gtr-utils.c
@@ -680,68 +680,6 @@ finally_2:
 }
 
 /**
- * gtr_utils_activate_url:
- * @dialog: a #GtkAboutDialog
- * @url: the url to show
- * @data: useless data variable
- * 
- * Shows the corresponding @url in the default browser.
- */
-void
-gtr_utils_activate_url (GtkAboutDialog * dialog,
-                        const gchar * url, gpointer data)
-{
-  //FIXME: gtk_url_show deprecates this func.
-  gchar *open[3];
-
-  if (g_find_program_in_path ("xdg-open"))
-    {
-      open[0] = "xdg-open";
-    }
-  else
-    return;
-
-  open[1] = (gchar *) url;
-  open[2] = NULL;
-
-  gdk_spawn_on_screen (gdk_screen_get_default (),
-                       NULL,
-                       open,
-                       NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL);
-}
-
-/**
- * gtr_utils_activate_email:
- * @dialog: a #GtkAboutDialog
- * @email: the email to show
- * @data: useless data variable
- * 
- * Shows the corresponding @email in the default mailer.
- */
-void
-gtr_utils_activate_email (GtkAboutDialog * dialog,
-                          const gchar * email, gpointer data)
-{
-  //FIXME: gtk_url_show deprecates this func.
-  gchar *open[3];
-
-  if (g_find_program_in_path ("xdg-email"))
-    {
-      open[0] = "xdg-email";
-    }
-  else
-    return;
-
-  open[1] = (gchar *) email;
-  open[2] = NULL;
-
-  gdk_spawn_on_screen (gdk_screen_get_default (),
-                       NULL,
-                       open,
-                       NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL);
-}
-
-/**
  * gtr_utils_help_display:
  * @parent: a #GtkWindow
  * @doc_id: the name of the type of doc
diff --git a/src/gtr-utils.h b/src/gtr-utils.h
index 67a7214..a840a92 100644
--- a/src/gtr-utils.h
+++ b/src/gtr-utils.h
@@ -65,12 +65,6 @@ gtr_utils_get_ui_objects (const gchar * filename,
      gboolean g_utf8_caselessnmatch (const gchar * s1,
                                      const gchar * s2, gssize n1, gssize n2);
 
-     void gtr_utils_activate_url (GtkAboutDialog * dialog,
-                                  const gchar * url, gpointer data);
-
-     void gtr_utils_activate_email (GtkAboutDialog * dialog,
-                                    const gchar * email, gpointer data);
-
      void gtr_utils_help_display (GtkWindow * parent,
                                   const gchar * doc_id,
                                   const gchar * file_name);
diff --git a/src/gtr-window.c b/src/gtr-window.c
index 2e399ff..5117781 100644
--- a/src/gtr-window.c
+++ b/src/gtr-window.c
@@ -1347,7 +1347,6 @@ gtr_window_cmd_edit_toolbar (GtkAction * action, GtrWindow * window)
   gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
   gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)), 5);
   gtk_box_set_spacing (GTK_BOX (content_area), 2);
-  gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE);
   gtk_window_set_default_size (GTK_WINDOW (dialog), 500, 400);
 
   editor = egg_toolbar_editor_new (window->priv->ui_manager,
@@ -1916,6 +1915,12 @@ gtr_window_dispose (GObject * object)
       priv->prof_manager = NULL;
     }
 
+  if (priv->layout_manager)
+    {
+      g_object_unref (priv->layout_manager);
+      priv->layout_manager = NULL;
+    }
+
   /* Now that there have broken some reference loops,
    * force collection again.
    */
@@ -1931,31 +1936,25 @@ gtr_window_finalize (GObject * object)
 }
 
 static void
-gtr_window_destroy (GtkObject * object)
+gtr_window_destroy (GtkWidget * widget)
 {
-  GtrWindow *window;
+  GtrWindowPrivate *priv;
 
-  window = GTR_WINDOW (object);
+  priv = GTR_WINDOW (widget)->priv;
 
   DEBUG_PRINT ("Destroy window");
 
-  if (!window->priv->destroy_has_run)
+  if (!priv->destroy_has_run)
     {
-      if (window->priv->widgets)
+      if (priv->widgets)
         {
-          g_hash_table_destroy (window->priv->widgets);
-          window->priv->widgets = NULL;
+          g_hash_table_destroy (priv->widgets);
+          priv->widgets = NULL;
         }
-
-      if (window->priv->layout_manager)
-        {
-          g_object_unref (window->priv->layout_manager);
-          window->priv->layout_manager = NULL;
-        }
-      window->priv->destroy_has_run = TRUE;
+      priv->destroy_has_run = TRUE;
     }
 
-  GTK_OBJECT_CLASS (gtr_window_parent_class)->destroy (object);
+  GTK_WIDGET_CLASS (gtr_window_parent_class)->destroy (widget);
 }
 
 
@@ -2009,7 +2008,6 @@ static void
 gtr_window_class_init (GtrWindowClass * klass)
 {
   GObjectClass *object_class = G_OBJECT_CLASS (klass);
-  GtkObjectClass *gobject_class = GTK_OBJECT_CLASS (klass);
   GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (klass);
 
   g_type_class_add_private (klass, sizeof (GtrWindowPrivate));
@@ -2017,10 +2015,9 @@ gtr_window_class_init (GtrWindowClass * klass)
   object_class->finalize = gtr_window_finalize;
   object_class->dispose = gtr_window_dispose;
 
-  gobject_class->destroy = gtr_window_destroy;
-
   widget_class->configure_event = gtr_window_configure_event;
   widget_class->key_press_event = gtr_window_key_press_event;
+  widget_class->destroy = gtr_window_destroy;
 }
 
 /***************************** Public funcs ***********************************/
diff --git a/src/main.c b/src/main.c
index 920f2c2..f977306 100644
--- a/src/main.c
+++ b/src/main.c
@@ -285,9 +285,6 @@ main (gint argc, gchar * argv[])
   /* Init plugin engine */
   engine = gtr_plugins_engine_get_default ();
 
-  gtk_about_dialog_set_url_hook (gtr_utils_activate_url, NULL, NULL);
-  gtk_about_dialog_set_email_hook (gtr_utils_activate_email, NULL, NULL);
-
   /* Create the main app-window. */
   window = gtr_application_create_window (app);
 
diff --git a/src/translation-memory/gtr-translation-memory-ui.c b/src/translation-memory/gtr-translation-memory-ui.c
index 2e1b49c..0835fde 100644
--- a/src/translation-memory/gtr-translation-memory-ui.c
+++ b/src/translation-memory/gtr-translation-memory-ui.c
@@ -197,7 +197,7 @@ showed_message_cb (GtrTab * tab, GtrMsg * msg, GtrTranslationMemoryUi * tm_ui)
 
       gtk_list_store_append (model, &iter);
       gtk_list_store_set (model, &iter,
-                          SHORTCUT_COLUMN, GDK_0 + k,
+                          SHORTCUT_COLUMN, GDK_KEY_0 + k,
                           STRING_COLUMN, match->match,
                           LEVEL_COLUMN, match->level,
                           -1);
@@ -234,7 +234,7 @@ showed_message_cb (GtrTab * tab, GtrMsg * msg, GtrTranslationMemoryUi * tm_ui)
                          item_name);
 
       gtk_menu_item_set_accel_path (GTK_MENU_ITEM (tm_item), accel_path);
-      gtk_accel_map_add_entry (accel_path, GDK_0 + (j - 1), GDK_CONTROL_MASK);
+      gtk_accel_map_add_entry (accel_path, GDK_KEY_0 + (j - 1), GDK_CONTROL_MASK);
 
       g_free (accel_path);
       g_free (item_name);



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