[Kazehakase-cvs] CVS update: kazehakase/src/actions

Back to archive index

Ryo SHIMIZU furyo****@users*****
Tue Mar 7 01:39:26 JST 2006


Index: kazehakase/src/actions/kz-actions-tab.c
diff -u kazehakase/src/actions/kz-actions-tab.c:1.36 kazehakase/src/actions/kz-actions-tab.c:1.37
--- kazehakase/src/actions/kz-actions-tab.c:1.36	Sat Jan 14 19:01:52 2006
+++ kazehakase/src/actions/kz-actions-tab.c	Tue Mar  7 01:39:26 2006
@@ -92,6 +92,13 @@
 	kz_window_close_tab(kztab->kz, GTK_WIDGET(kztab->kzembed));
 }
 
+enum {
+	KZ_TAB_CLOSE_ALL_TABS = -1,
+	KZ_TAB_CLOSE_INACTIVE,
+	KZ_TAB_CLOSE_BACKWARD,
+	KZ_TAB_CLOSE_FORWARD
+};
+
 static void
 close_all_tab (GtkAction *action, KzWindow *kz, gint mode)
 {
@@ -100,6 +107,12 @@
 	gint num, pos;
 	gint i;
 
+	if(mode == KZ_TAB_CLOSE_ALL_TABS)
+	{
+		kz_window_close_all_tab(kz);
+		return;
+	}
+
 	g_return_if_fail(KZ_IS_WINDOW(kz));
 
 	kztab = g_object_get_qdata(G_OBJECT(kz), kztab_quark);
@@ -116,8 +129,8 @@
 		GtkWidget *widget = KZ_WINDOW_NTH_PAGE(kztab->kz, i);
 
 		if (i == pos) continue;
-		if (i > pos && mode == 1) continue;
-		if (i < pos && mode == 2) continue;
+		if (i > pos && mode == KZ_TAB_CLOSE_BACKWARD) continue;
+		if (i < pos && mode == KZ_TAB_CLOSE_FORWARD) continue;
 
 		kz_window_close_tab(kztab->kz, widget);
 	}
@@ -126,21 +139,26 @@
 static void
 act_tab_close_left (GtkAction *action, KzWindow *kz)
 {
-	close_all_tab(action, kz, 1);
+	close_all_tab(action, kz, KZ_TAB_CLOSE_BACKWARD);
 }
 
 static void
 act_tab_close_right (GtkAction *action, KzWindow *kz)
 {
-	close_all_tab(action, kz, 2);
+	close_all_tab(action, kz, KZ_TAB_CLOSE_FORWARD);
 }
 
 static void
 act_tab_close_all_inactive_active (GtkAction *action, KzWindow *kz)
 {
-	close_all_tab(action, kz, 0);
+	close_all_tab(action, kz, KZ_TAB_CLOSE_INACTIVE);
 }
 
+static void
+act_tab_close_all_tabs (GtkAction *action, KzWindow *kz)
+{
+	close_all_tab(action, kz, KZ_TAB_CLOSE_ALL_TABS);
+}
 
 static gboolean
 get_all_under_current_tab (GNode *node, gpointer data)
@@ -377,6 +395,9 @@
 	{"TabCloseAllInactiveTabs", GTK_STOCK_CLOSE, N_("Close all _inactive tabs"),
 	 NULL, NULL, G_CALLBACK(act_tab_close_all_inactive_active)},
 
+	{"TabCloseAllTabs", GTK_STOCK_CLOSE, N_("Clos_e all tabs"),
+	 NULL, NULL, G_CALLBACK(act_tab_close_all_tabs)},
+
 	{"TabCloseAllChild", GTK_STOCK_CLOSE, N_("Close all c_hild tab"),
 	 NULL, NULL, G_CALLBACK(act_tab_close_all_child)},
 
Index: kazehakase/src/actions/kz-actions.c
diff -u kazehakase/src/actions/kz-actions.c:1.219 kazehakase/src/actions/kz-actions.c:1.220
--- kazehakase/src/actions/kz-actions.c:1.219	Sat Jan 14 19:36:52 2006
+++ kazehakase/src/actions/kz-actions.c	Tue Mar  7 01:39:26 2006
@@ -994,6 +994,11 @@
 	}
 }
 
+static void
+act_tab_close_all (GtkAction *action, KzWindow *kz)
+{
+	kz_window_close_all_tab(kz);
+}
 
 static void
 act_bookmark_in_new_tab (GtkAction *action, KzWindow *kz)
@@ -2025,6 +2030,7 @@
   {"CloseAllBackwardTab", KZ_STOCK_CLOSE_BACKWARD, N_("Close all _backward tabs"), NULL, NULL, G_CALLBACK(act_tab_close_backward_all)},
   {"CloseAllForwardTab", KZ_STOCK_CLOSE_FORWARD, N_("Close all _forward tabs"),  NULL, NULL, G_CALLBACK(act_tab_close_forward_all)},
   {"CloseAllInactiveTabs", NULL, N_("Close all _inactive tabs"), NULL, NULL, G_CALLBACK(act_tab_close_all_inactive_active)},
+  {"CloseAllTabs", NULL, N_("Clos_e all tabs"), NULL, NULL, G_CALLBACK(act_tab_close_all)},
 
   {"OpenBookmarkInNewTab",      NULL, N_("Open the bookmark in new _tab"),   NULL,  NULL, G_CALLBACK(act_bookmark_in_new_tab)},
   {"OpenAllBookmarks",          NULL, N_("Open a_ll bookmarks"),             NULL,  NULL, G_CALLBACK(act_open_all_bookmarks)},


More information about the Kazehakase-cvs mailing list
Back to archive index