Merge lp:~mboevink/midori/midori into lp:midori

Proposed by Matthew Boevink
Status: Merged
Approved by: Cris Dywan
Approved revision: 6422
Merged at revision: 6492
Proposed branch: lp:~mboevink/midori/midori
Merge into: lp:midori
Diff against target: 58 lines (+25/-2)
1 file modified
midori/midori-view.c (+25/-2)
To merge this branch: bzr merge lp:~mboevink/midori/midori
Reviewer Review Type Date Requested Status
Cris Dywan Approve
André Stösel Pending
Review via email: mp+190368@code.launchpad.net

This proposal supersedes a proposal from 2013-09-29.

Commit message

Add close tabs to right feature

Description of the change

Adds close rightmost tab, a useful feature supplied by most browsers

To post a comment you must log in.
Revision history for this message
Cody Garver (codygarver) wrote : Posted in a previous version of this proposal

I prefer "Close Tabs to the Right". That's also what Firefox and Chrome use.

Revision history for this message
Matthew Boevink (mboevink) wrote : Posted in a previous version of this proposal

It's a bit long for a drop down menu don't you agree?

Revision history for this message
Cris Dywan (kalikiana) wrote :

Indeed Chromium appears to have this… could you give an example on how you use it?. It seems a little "arbitrary" without a use case and it smells like the kind of feature that will raise eyebrows when being re-evaluated out of context after a while.

review: Needs Information
Revision history for this message
Matthew Boevink (mboevink) wrote :

> Indeed Chromium appears to have this… could you give an example on how you use
> it?. It seems a little "arbitrary" without a use case and it smells like the
> kind of feature that will raise eyebrows when being re-evaluated out of
> context after a while.

I'm not going to lie: porn. So often you're looking for something particular from a web search and open up a large amount of tabs trying to find what you want, so you go through, one by one closing each tab until you find what you want. Now you have your search on the left and the content you don't need to look at on the right. "Close tabs to right". It's also handy when a website defaults to opening new tabs.

Revision history for this message
Cris Dywan (kalikiana) wrote :

I'm convinced.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'midori/midori-view.c'
2--- midori/midori-view.c 2013-09-17 15:41:00 +0000
3+++ midori/midori-view.c 2013-10-10 13:29:13 +0000
4@@ -3891,7 +3891,7 @@
5
6 if (handled)
7 return;
8-
9+
10 if (!strcmp (uri, "about:new"))
11 uri = midori_settings_get_tabhome (MIDORI_SETTINGS (view->settings));
12 if (!strcmp (uri, "about:home"))
13@@ -4406,6 +4406,27 @@
14 }
15
16 static void
17+midori_view_tab_label_menu_close_tabs_right_cb (GtkAction* action,
18+ gpointer user_data)
19+{
20+ GtkWidget* view = user_data;
21+ MidoriBrowser* browser = midori_browser_get_for_widget (view);
22+ GList* tabs = midori_browser_get_tabs (browser);
23+ gboolean found_tab = FALSE;
24+ for (; tabs; tabs = g_list_next (tabs))
25+ {
26+ if (tabs->data == view)
27+ {
28+ found_tab = TRUE;
29+ continue;
30+ }
31+ if (found_tab)
32+ midori_browser_close_tab (browser, tabs->data);
33+ }
34+ g_list_free (tabs);
35+}
36+
37+static void
38 midori_view_tab_label_menu_close_other_tabs_cb (GtkAction* action,
39 gpointer user_data)
40 {
41@@ -4454,7 +4475,7 @@
42
43 MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (view));
44 g_return_val_if_fail (browser != NULL, NULL);
45-
46+
47 GtkActionGroup* actions = midori_browser_get_action_group (browser);
48 MidoriContextAction* menu = midori_context_action_new ("TabContextMenu", NULL, NULL, NULL);
49 midori_context_action_add_action_group (menu, actions);
50@@ -4471,6 +4492,8 @@
51 view->minimized ? _("Show Tab _Label") : _("Show Tab _Icon Only"), NULL, NULL,
52 midori_view_tab_label_menu_minimize_tab_cb, view);
53 midori_context_action_add (menu, NULL);
54+ midori_context_action_add_simple (menu, "TabCloseRight", _("Close Tabs to the R_ight"), NULL, NULL,
55+ midori_view_tab_label_menu_close_tabs_right_cb, view);
56 GtkAction* action = gtk_action_new ("TabCloseOther", g_dngettext (NULL, "Close Ot_her Tab", "Close Ot_her Tabs", pages - 1), NULL, NULL);
57 g_signal_connect (action, "activate", G_CALLBACK (midori_view_tab_label_menu_close_other_tabs_cb), view);
58 gtk_action_set_sensitive (action, pages > 1);

Subscribers

People subscribed via source and target branches

to all changes: