diff options
author | Marco Barisione <marco.barisione@collabora.co.uk> | 2013-05-10 21:25:22 +0800 |
---|---|---|
committer | Marco Barisione <marco.barisione@collabora.co.uk> | 2013-08-20 18:03:06 +0800 |
commit | 44c61cce71ad3683aa6a284ce117e286423f555c (patch) | |
tree | de958fcb39208a6295741195a0e2ed856d6cd87c | |
parent | 431c21692c396b39764eca31c3c4f05f4507ce59 (diff) | |
download | gsoc2013-empathy-44c61cce71ad3683aa6a284ce117e286423f555c.tar.gz gsoc2013-empathy-44c61cce71ad3683aa6a284ce117e286423f555c.tar.zst gsoc2013-empathy-44c61cce71ad3683aa6a284ce117e286423f555c.zip |
tpaw-utils: move empathy_get_toplevel_window to tp-aw and rename it
This commit also changes the licence of the moved code from GPL to LGPL.
See GOSSIP-RELICENSING.txt for details.
https://bugzilla.gnome.org/show_bug.cgi?id=699492
-rw-r--r-- | libempathy-gtk/empathy-individual-view.c | 3 | ||||
-rw-r--r-- | libempathy-gtk/empathy-ui-utils.c | 15 | ||||
-rw-r--r-- | libempathy-gtk/empathy-ui-utils.h | 1 | ||||
-rw-r--r-- | tp-account-widgets/tpaw-avatar-chooser.c | 4 | ||||
-rw-r--r-- | tp-account-widgets/tpaw-irc-network-chooser.c | 3 | ||||
-rw-r--r-- | tp-account-widgets/tpaw-utils.c | 19 | ||||
-rw-r--r-- | tp-account-widgets/tpaw-utils.h | 7 |
7 files changed, 30 insertions, 22 deletions
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c index 8fe7af727..4344840e4 100644 --- a/libempathy-gtk/empathy-individual-view.c +++ b/libempathy-gtk/empathy-individual-view.c @@ -28,6 +28,7 @@ #include "empathy-individual-view.h" #include <glib/gi18n-lib.h> +#include <tp-account-widgets/tpaw-utils.h> #include "empathy-cell-renderer-activatable.h" #include "empathy-cell-renderer-expander.h" @@ -2359,7 +2360,7 @@ individual_view_group_remove_activate_cb (GtkMenuItem *menuitem, text = g_strdup_printf (_("Do you really want to remove the group '%s'?"), group); - parent = empathy_get_toplevel_window (GTK_WIDGET (view)); + parent = tpaw_get_toplevel_window (GTK_WIDGET (view)); if (individual_view_remove_dialog_show (parent, _("Removing group"), text) == REMOVE_DIALOG_RESPONSE_DELETE) { diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c index cd7462081..c230324bb 100644 --- a/libempathy-gtk/empathy-ui-utils.c +++ b/libempathy-gtk/empathy-ui-utils.c @@ -851,21 +851,6 @@ empathy_window_present (GtkWindow *window) empathy_window_present_with_time (window, gtk_get_current_event_time ()); } -GtkWindow * -empathy_get_toplevel_window (GtkWidget *widget) -{ - GtkWidget *toplevel; - - g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); - - toplevel = gtk_widget_get_toplevel (widget); - if (GTK_IS_WINDOW (toplevel) && - gtk_widget_is_toplevel (toplevel)) - return GTK_WINDOW (toplevel); - - return NULL; -} - /** empathy_make_absolute_url_len: * @url: an url * @len: a length diff --git a/libempathy-gtk/empathy-ui-utils.h b/libempathy-gtk/empathy-ui-utils.h index 13559d80b..f9627f7fe 100644 --- a/libempathy-gtk/empathy-ui-utils.h +++ b/libempathy-gtk/empathy-ui-utils.h @@ -98,7 +98,6 @@ gchar * empathy_filename_from_icon_name (const gchar *icon_name, void empathy_window_present (GtkWindow *window); void empathy_window_present_with_time (GtkWindow *window, guint32 timestamp); -GtkWindow * empathy_get_toplevel_window (GtkWidget *widget); void empathy_move_to_window_desktop (GtkWindow *window, guint32 timestamp); diff --git a/tp-account-widgets/tpaw-avatar-chooser.c b/tp-account-widgets/tpaw-avatar-chooser.c index 6813cb673..6a5b83b42 100644 --- a/tp-account-widgets/tpaw-avatar-chooser.c +++ b/tp-account-widgets/tpaw-avatar-chooser.c @@ -950,7 +950,7 @@ choose_avatar_from_webcam (GtkWidget *widget, window = cheese_avatar_chooser_new (); gtk_window_set_transient_for (GTK_WINDOW (window), - GTK_WINDOW (empathy_get_toplevel_window (GTK_WIDGET (self)))); + GTK_WINDOW (tpaw_get_toplevel_window (GTK_WIDGET (self)))); gtk_window_set_modal (GTK_WINDOW (window), TRUE); g_signal_connect (G_OBJECT (window), "response", G_CALLBACK (webcam_response_cb), self); @@ -1023,7 +1023,7 @@ avatar_chooser_clicked_cb (GtkWidget *button, self->priv->chooser_dialog = GTK_FILE_CHOOSER ( gtk_file_chooser_dialog_new (_("Select Your Avatar Image"), - empathy_get_toplevel_window (GTK_WIDGET (self)), + tpaw_get_toplevel_window (GTK_WIDGET (self)), GTK_FILE_CHOOSER_ACTION_OPEN, NULL, NULL)); diff --git a/tp-account-widgets/tpaw-irc-network-chooser.c b/tp-account-widgets/tpaw-irc-network-chooser.c index 7a01a56f0..6e6aeb73b 100644 --- a/tp-account-widgets/tpaw-irc-network-chooser.c +++ b/tp-account-widgets/tpaw-irc-network-chooser.c @@ -24,6 +24,7 @@ #include "tpaw-irc-network-chooser-dialog.h" #include "tpaw-irc-network-manager.h" +#include "tpaw-utils.h" #include "empathy-ui-utils.h" #include "empathy-utils.h" @@ -322,7 +323,7 @@ clicked_cb (GtkButton *button, if (priv->dialog != NULL) goto out; - window = empathy_get_toplevel_window (GTK_WIDGET (button)); + window = tpaw_get_toplevel_window (GTK_WIDGET (button)); priv->dialog = tpaw_irc_network_chooser_dialog_new (priv->settings, priv->network, window); diff --git a/tp-account-widgets/tpaw-utils.c b/tp-account-widgets/tpaw-utils.c index b373dac9c..7c0a03082 100644 --- a/tp-account-widgets/tpaw-utils.c +++ b/tp-account-widgets/tpaw-utils.c @@ -1,9 +1,11 @@ /* - * Copyright (C) 2009-2013 Collabora Ltd. + * Copyright (C) 2007-2013 Collabora Ltd. + * Copyright (C) 2006 Xavier Claessens <xavier.claessens@gmail.com> * * Authors: Marco Barisione <marco.barisione@collabora.co.uk> * Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> * Sjoerd Simons <sjoerd.simons@collabora.co.uk> + * Xavier Claessens <xavier.claessens@collabora.co.uk> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -166,3 +168,18 @@ tpaw_make_color_whiter (GdkRGBA *color) color->green = (color->green + white.green) / 2; color->blue = (color->blue + white.blue) / 2; } + +GtkWindow * +tpaw_get_toplevel_window (GtkWidget *widget) +{ + GtkWidget *toplevel; + + g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); + + toplevel = gtk_widget_get_toplevel (widget); + if (GTK_IS_WINDOW (toplevel) && + gtk_widget_is_toplevel (toplevel)) + return GTK_WINDOW (toplevel); + + return NULL; +} diff --git a/tp-account-widgets/tpaw-utils.h b/tp-account-widgets/tpaw-utils.h index c648ae804..106c3b4e4 100644 --- a/tp-account-widgets/tpaw-utils.h +++ b/tp-account-widgets/tpaw-utils.h @@ -1,9 +1,11 @@ /* - * Copyright (C) 2009-2013 Collabora Ltd. + * Copyright (C) 2007-2013 Collabora Ltd. + * Copyright (C) 2006 Xavier Claessens <xavier.claessens@gmail.com> * * Authors: Marco Barisione <marco.barisione@collabora.co.uk> * Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> * Sjoerd Simons <sjoerd.simons@collabora.co.uk> + * Xavier Claessens <xavier.claessens@collabora.co.uk> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -38,6 +40,9 @@ const gchar *tpaw_service_name_to_display_name (const gchar *proto_name); void tpaw_make_color_whiter (GdkRGBA *color); +/* Windows */ +GtkWindow * tpaw_get_toplevel_window (GtkWidget *widget); + /* Copied from wocky/wocky-utils.h */ #define tpaw_implement_finish_void(source, tag) \ |