Introduce midori_browser_set_current_page_smartly() as public API

This commit is contained in:
Alexander Butenko 2010-07-03 03:28:03 -04:00 committed by Christian Dywan
parent e70bc2cb75
commit 62930be082
4 changed files with 15 additions and 28 deletions

View file

@ -425,8 +425,8 @@ _midori_browser_set_statusbar_text (MidoriBrowser* browser,
}
}
static void
_midori_browser_set_current_page_smartly (MidoriBrowser* browser,
void
midori_browser_set_current_page_smartly (MidoriBrowser* browser,
gint n)
{
if (!katze_object_get_boolean (browser->settings,
@ -2697,7 +2697,7 @@ _action_trash_activate_item_alt (GtkAction* action,
n = midori_browser_add_uri (browser, katze_item_get_uri (item));
_midori_browser_set_current_page_smartly (browser, n);
midori_browser_set_current_page_smartly (browser, n);
katze_array_remove_item (browser->trash, item);
_midori_browser_update_actions (browser);
@ -3419,7 +3419,7 @@ midori_browser_bookmark_homepage_button_press_cb (GtkToolItem* button,
g_object_get (browser->settings, "homepage", &homepage, NULL);
n = midori_browser_add_uri (browser, homepage);
g_free (homepage);
_midori_browser_set_current_page_smartly (browser, n);
midori_browser_set_current_page_smartly (browser, n);
return TRUE;
}
@ -3781,7 +3781,7 @@ midori_browser_bookmark_open_in_tab_activate_cb (GtkWidget* menuitem,
if ((uri = katze_item_get_uri (child)) && *uri)
{
n = midori_browser_add_item (browser, child);
_midori_browser_set_current_page_smartly (browser, n);
midori_browser_set_current_page_smartly (browser, n);
}
i++;
}
@ -3791,7 +3791,7 @@ midori_browser_bookmark_open_in_tab_activate_cb (GtkWidget* menuitem,
if ((uri = katze_item_get_uri (item)) && *uri)
{
n = midori_browser_add_item (browser, item);
_midori_browser_set_current_page_smartly (browser, n);
midori_browser_set_current_page_smartly (browser, n);
}
}
}
@ -6234,7 +6234,7 @@ midori_bookmarkbar_item_button_press_event_cb (GtkWidget* toolitem,
if (katze_item_get_uri (item))
{
n = midori_browser_add_uri (browser, katze_item_get_uri (item));
_midori_browser_set_current_page_smartly (browser, n);
midori_browser_set_current_page_smartly (browser, n);
return TRUE;
}

View file

@ -116,6 +116,9 @@ midori_browser_set_current_uri (MidoriBrowser* browser,
const gchar*
midori_browser_get_current_uri (MidoriBrowser* browser);
void
midori_browser_set_current_page_smartly (MidoriBrowser* browser,
gint n);
void
midori_browser_set_current_page (MidoriBrowser* browser,
gint n);

View file

@ -666,14 +666,10 @@ midori_bookmarks_open_in_tab_activate_cb (GtkWidget* menuitem,
if ((uri = katze_item_get_uri (child)) && *uri)
{
MidoriBrowser* browser;
MidoriWebSettings* settings;
browser = midori_browser_get_for_widget (GTK_WIDGET (bookmarks));
n = midori_browser_add_item (browser, child);
settings = katze_object_get_object (browser, "settings");
if (!katze_object_get_boolean (settings, "open-tabs-in-the-background"))
midori_browser_set_current_page (browser, n);
g_object_unref (settings);
midori_browser_set_current_page_smartly (browser, n);
}
i++;
}
@ -681,14 +677,10 @@ midori_bookmarks_open_in_tab_activate_cb (GtkWidget* menuitem,
else if ((uri = katze_item_get_uri (item)) && *uri)
{
MidoriBrowser* browser;
MidoriWebSettings* settings;
browser = midori_browser_get_for_widget (GTK_WIDGET (bookmarks));
n = midori_browser_add_item (browser, item);
settings = katze_object_get_object (browser, "settings");
if (!katze_object_get_boolean (settings, "open-tabs-in-the-background"))
midori_browser_set_current_page (browser, n);
g_object_unref (settings);
midori_browser_set_current_page_smartly (browser, n);
}
}

View file

@ -655,14 +655,10 @@ midori_history_open_in_tab_activate_cb (GtkWidget* menuitem,
if ((uri = katze_item_get_uri (child)) && *uri)
{
MidoriBrowser* browser;
MidoriWebSettings* settings;
browser = midori_browser_get_for_widget (GTK_WIDGET (history));
n = midori_browser_add_item (browser, child);
settings = katze_object_get_object (browser, "settings");
if (!katze_object_get_boolean (settings, "open-tabs-in-the-background"))
midori_browser_set_current_page (browser, n);
g_object_unref (settings);
midori_browser_set_current_page_smartly (browser, n);
}
}
}
@ -671,14 +667,10 @@ midori_history_open_in_tab_activate_cb (GtkWidget* menuitem,
if ((uri = katze_item_get_uri (item)) && *uri)
{
MidoriBrowser* browser;
MidoriWebSettings* settings;
browser = midori_browser_get_for_widget (GTK_WIDGET (history));
n = midori_browser_add_item (browser, item);
settings = katze_object_get_object (browser, "settings");
if (!katze_object_get_boolean (settings, "open-tabs-in-the-background"))
midori_browser_set_current_page (browser, n);
g_object_unref (settings);
midori_browser_set_current_page_smartly (browser, n);
}
}
}