changeset 16526:403332494b92

Move the toggle-clipboard operation to the default wm.
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Fri, 27 Apr 2007 13:15:09 +0000
parents 62d083364deb
children ecfb07301611
files finch/libgnt/gntwm.c finch/libgnt/wms/s.c
diffstat 2 files changed, 28 insertions(+), 28 deletions(-) [+]
line wrap: on
line diff
--- a/finch/libgnt/gntwm.c	Fri Apr 27 12:11:11 2007 +0000
+++ b/finch/libgnt/gntwm.c	Fri Apr 27 13:15:09 2007 +0000
@@ -905,6 +905,32 @@
 	return FALSE;
 }
 
+static gboolean
+toggle_clipboard(GntBindable *bindable, GList *n)
+{
+	static GntWidget *clip;
+	gchar *text;
+	int maxx, maxy;
+	if (clip) {
+		gnt_widget_destroy(clip);
+		clip = NULL;
+		return TRUE;
+	}
+	getmaxyx(stdscr, maxy, maxx);
+	text = gnt_get_clipboard_string();
+	clip = gnt_hwindow_new(FALSE);
+	GNT_WIDGET_SET_FLAGS(clip, GNT_WIDGET_TRANSIENT);
+	GNT_WIDGET_SET_FLAGS(clip, GNT_WIDGET_NO_BORDER);
+	gnt_box_set_pad(GNT_BOX(clip), 0);
+	gnt_box_add_widget(GNT_BOX(clip), gnt_label_new(" "));
+	gnt_box_add_widget(GNT_BOX(clip), gnt_label_new(text));
+	gnt_box_add_widget(GNT_BOX(clip), gnt_label_new(" "));
+	gnt_widget_set_position(clip, 0, 0);
+	gnt_widget_draw(clip);
+	g_free(text);
+	return TRUE;
+}
+
 static void
 gnt_wm_class_init(GntWMClass *klass)
 {
@@ -1039,6 +1065,8 @@
 				"\033" GNT_KEY_CTRL_K, NULL);
 	gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "help-for-widget", help_for_widget,
 				"\033" "/", NULL);
+	gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "toggle-clipboard",
+				toggle_clipboard, "\033" "C", NULL);
 
 	gnt_style_read_actions(G_OBJECT_CLASS_TYPE(klass), GNT_BINDABLE_CLASS(klass));
 
--- a/finch/libgnt/wms/s.c	Fri Apr 27 12:11:11 2007 +0000
+++ b/finch/libgnt/wms/s.c	Fri Apr 27 13:15:09 2007 +0000
@@ -168,32 +168,6 @@
 	return TRUE;
 }
 
-static gboolean
-toggle_clipboard(GntBindable *bindable, GList *n)
-{
-	static GntWidget *clip;
-	gchar *text;
-	int maxx, maxy;
-	if (clip) {
-		gnt_widget_destroy(clip);
-		clip = NULL;
-		return TRUE;
-	}
-	getmaxyx(stdscr, maxy, maxx);
-	text = gnt_get_clipboard_string();
-	clip = gnt_hwindow_new(FALSE);
-	GNT_WIDGET_SET_FLAGS(clip, GNT_WIDGET_TRANSIENT);
-	GNT_WIDGET_SET_FLAGS(clip, GNT_WIDGET_NO_BORDER);
-	gnt_box_set_pad(GNT_BOX(clip), 0);
-	gnt_box_add_widget(GNT_BOX(clip), gnt_label_new(" "));
-	gnt_box_add_widget(GNT_BOX(clip), gnt_label_new(text));
-	gnt_box_add_widget(GNT_BOX(clip), gnt_label_new(" "));
-	gnt_widget_set_position(clip, 0, 0);
-	gnt_widget_draw(clip);
-	g_free(text);
-	return TRUE;
-}
-
 static void
 s_class_init(SClass *klass)
 {
@@ -208,8 +182,6 @@
 
 	gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "toggle-buddylist",
 				toggle_buddylist, "\033" "b", NULL);
-	gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "toggle-clipboard",
-				toggle_clipboard, "\033" "C", NULL);
 	gnt_style_read_actions(G_OBJECT_CLASS_TYPE(klass), GNT_BINDABLE_CLASS(klass));
 	GNTDEBUG;
 }