aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-11-26 03:04:24 +0800
committerXan Lopez <xan@igalia.com>2012-11-26 03:04:24 +0800
commita60eb7cad58e17985e8a7908d5e90bab5fff6186 (patch)
tree95ecd03aacb6e8b17df5e7c936592e14ec46a30b /src
parent445102fa0e84e3521d59d314a6bac204ba1af641 (diff)
downloadgsoc2013-epiphany-a60eb7cad58e17985e8a7908d5e90bab5fff6186.tar
gsoc2013-epiphany-a60eb7cad58e17985e8a7908d5e90bab5fff6186.tar.gz
gsoc2013-epiphany-a60eb7cad58e17985e8a7908d5e90bab5fff6186.tar.bz2
gsoc2013-epiphany-a60eb7cad58e17985e8a7908d5e90bab5fff6186.tar.lz
gsoc2013-epiphany-a60eb7cad58e17985e8a7908d5e90bab5fff6186.tar.xz
gsoc2013-epiphany-a60eb7cad58e17985e8a7908d5e90bab5fff6186.tar.zst
gsoc2013-epiphany-a60eb7cad58e17985e8a7908d5e90bab5fff6186.zip
Use gtk_application_get_active_window instead of rolling our own
Diffstat (limited to 'src')
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c2
-rw-r--r--src/ephy-history-window.c2
-rw-r--r--src/ephy-session.c2
-rw-r--r--src/ephy-session.h2
-rw-r--r--src/ephy-shell.c21
-rw-r--r--src/ephy-shell.h2
6 files changed, 5 insertions, 26 deletions
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index 8dc057b1e..d74e06020 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -291,7 +291,7 @@ get_target_window (EphyBookmarksEditor *editor)
}
else
{
- return GTK_WIDGET (ephy_shell_get_active_window (ephy_shell));
+ return GTK_WIDGET (gtk_application_get_active_window (GTK_APPLICATION (ephy_shell)));
}
}
diff --git a/src/ephy-history-window.c b/src/ephy-history-window.c
index a344060ab..c657275a1 100644
--- a/src/ephy-history-window.c
+++ b/src/ephy-history-window.c
@@ -304,7 +304,7 @@ get_target_window (EphyHistoryWindow *editor)
}
else
{
- return GTK_WIDGET (ephy_shell_get_active_window (ephy_shell));
+ return GTK_WIDGET (gtk_application_get_active_window (GTK_APPLICATION (ephy_shell)));
}
}
diff --git a/src/ephy-session.c b/src/ephy-session.c
index 70fc234dc..f29c21f1e 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -291,7 +291,7 @@ session_command_open_uris (EphySession *session,
g_object_ref (shell);
- window = ephy_shell_get_active_window (shell);
+ window = gtk_application_get_active_window (GTK_APPLICATION (shell));
new_windows_in_tabs = g_settings_get_boolean (EPHY_SETTINGS_MAIN,
EPHY_PREFS_NEW_WINDOWS_IN_TABS);
diff --git a/src/ephy-session.h b/src/ephy-session.h
index fc754126f..30363bfe9 100644
--- a/src/ephy-session.h
+++ b/src/ephy-session.h
@@ -70,8 +70,6 @@ struct _EphySessionClass
GType ephy_session_get_type (void);
-EphyWindow *ephy_session_get_active_window (EphySession *session);
-
gboolean ephy_session_save (EphySession *session,
const char *filename);
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index e38b6aec0..ca1fbec20 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -207,7 +207,7 @@ show_about (GSimpleAction *action,
{
EphyWindow *window;
- window = ephy_shell_get_active_window (ephy_shell);
+ window = gtk_application_get_active_window (GTK_APPLICATION (ephy_shell));
window_cmd_help_about (NULL, GTK_WIDGET (window));
}
@@ -600,7 +600,7 @@ download_started_cb (WebKitWebContext *web_context,
return;
}
- window = ephy_shell_get_active_window (shell);
+ window = gtk_application_get_active_window (GTK_APPLICATION (shell));
ed = ephy_download_new_for_download (download);
ephy_download_set_window (ed, GTK_WIDGET (window));
@@ -1041,23 +1041,6 @@ ephy_shell_get_n_windows (EphyShell *shell)
return g_list_length (shell->priv->windows);
}
-EphyWindow *
-ephy_shell_get_active_window (EphyShell *shell)
-{
- GList *l;
-
- g_return_val_if_fail (EPHY_IS_SHELL (shell), NULL);
-
- for (l = shell->priv->windows; l != NULL; l = l->next) {
- EphyEmbedContainer *window = EPHY_EMBED_CONTAINER (l->data);
-
- if (!ephy_embed_container_get_is_popup (window))
- return EPHY_WINDOW (window);
- }
-
- return NULL;
-}
-
gboolean
ephy_shell_close_all_windows (EphyShell *shell)
{
diff --git a/src/ephy-shell.h b/src/ephy-shell.h
index e9402e104..4e42d001b 100644
--- a/src/ephy-shell.h
+++ b/src/ephy-shell.h
@@ -179,8 +179,6 @@ GList *ephy_shell_get_windows (EphyShell *shell);
guint ephy_shell_get_n_windows (EphyShell *shell);
-EphyWindow *ephy_shell_get_active_window (EphyShell *shell);
-
gboolean ephy_shell_close_all_windows (EphyShell *shell);
G_END_DECLS