Introduce midori_browser_set_current_page_smartly() as public API
This commit is contained in:
parent
e70bc2cb75
commit
62930be082
4 changed files with 15 additions and 28 deletions
|
@ -425,9 +425,9 @@ _midori_browser_set_statusbar_text (MidoriBrowser* browser,
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_midori_browser_set_current_page_smartly (MidoriBrowser* browser,
|
||||
gint n)
|
||||
void
|
||||
midori_browser_set_current_page_smartly (MidoriBrowser* browser,
|
||||
gint n)
|
||||
{
|
||||
if (!katze_object_get_boolean (browser->settings,
|
||||
"open-tabs-in-the-background"))
|
||||
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue