changeset 18091:7e0bd339533c

merge of '121873f517c4c5e2d65c3a1cdd152694834d7db0' and 'b6554a097db9af922d42e44a8f82e43d8774a781'
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Tue, 12 Jun 2007 21:25:56 +0000
parents 9018b785ef73 (current diff) 19e6c7249c20 (diff)
children 662564beb575
files configure.ac finch/libgnt/gntstyle.c
diffstat 8 files changed, 33 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/configure.ac	Mon Jun 11 17:36:40 2007 +0000
+++ b/configure.ac	Tue Jun 12 21:25:56 2007 +0000
@@ -52,10 +52,10 @@
           [purple_major_version.purple_minor_version.purple_micro_version])
 m4_define([purple_display_version], purple_version[]m4_ifdef([purple_version_suffix],[purple_version_suffix]))
 
-m4_define([gnt_lt_current], [0])
-m4_define([gnt_major_version], [1])
+m4_define([gnt_lt_current], [1])
+m4_define([gnt_major_version], [2])
 m4_define([gnt_minor_version], [0])
-m4_define([gnt_micro_version], [1])
+m4_define([gnt_micro_version], [0])
 m4_define([gnt_version_suffix], [devel])
 m4_define([gnt_version],
           [gnt_major_version.gnt_minor_version.gnt_micro_version])
--- a/finch/libgnt/Makefile.am	Mon Jun 11 17:36:40 2007 +0000
+++ b/finch/libgnt/Makefile.am	Tue Jun 12 21:25:56 2007 +0000
@@ -1,6 +1,6 @@
 EXTRA_DIST=genmarshal
 
-SUBDIRS = . 
+SUBDIRS = . wms
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = gnt.pc
 
--- a/finch/libgnt/configure.ac	Mon Jun 11 17:36:40 2007 +0000
+++ b/finch/libgnt/configure.ac	Tue Jun 12 21:25:56 2007 +0000
@@ -24,11 +24,11 @@
 # Make sure to update ../../configure.ac with libgnt version changes.
 #
 
-m4_define([gnt_lt_current], [0])
-m4_define([gnt_major_version], [1])
+m4_define([gnt_lt_current], [1])
+m4_define([gnt_major_version], [2])
 m4_define([gnt_minor_version], [0])
 m4_define([gnt_micro_version], [0])
-m4_define([gnt_version_suffix], [beta7])
+m4_define([gnt_version_suffix], [devel])
 m4_define([gnt_version],
           [gnt_major_version.gnt_minor_version.gnt_micro_version])
 m4_define([gnt_display_version], gnt_version[]m4_ifdef([gnt_version_suffix],[gnt_version_suffix]))
--- a/finch/libgnt/gntstyle.c	Mon Jun 11 17:36:40 2007 +0000
+++ b/finch/libgnt/gntstyle.c	Tue Jun 12 21:25:56 2007 +0000
@@ -138,8 +138,7 @@
 		if (!name)
 			return;
 
-		ws = g_object_new(GNT_TYPE_WS, NULL);
-		gnt_ws_set_name(ws, name);
+		ws = gnt_ws_new(name);
 		gnt_wm_add_workspace(wm, ws);
 		g_free(name);
 
--- a/finch/libgnt/gntwm.c	Mon Jun 11 17:36:40 2007 +0000
+++ b/finch/libgnt/gntwm.c	Tue Jun 12 21:25:56 2007 +0000
@@ -335,8 +335,7 @@
 	wm->title_places = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free);
 	gnt_style_read_workspaces(wm);
 	if (wm->workspaces == NULL) {
-		wm->cws = g_object_new(GNT_TYPE_WS, NULL);
-		gnt_ws_set_name(wm->cws, "default");
+		wm->cws = gnt_ws_new("default");
 		gnt_wm_add_workspace(wm, wm->cws);
 	} else {
 		wm->cws = wm->workspaces->data;
@@ -1030,12 +1029,11 @@
 	GntWM *wm = GNT_WM(bindable);
 
 	endwin();
-	refresh();
-	curs_set(0);   /* endwin resets the cursor to normal */
 
 	g_hash_table_foreach(wm->nodes, (GHFunc)refresh_node, NULL);
 	update_screen(wm);
 	gnt_ws_draw_taskbar(wm->cws, TRUE);
+	curs_set(0);   /* endwin resets the cursor to normal */
 
 	return FALSE;
 }
@@ -1128,6 +1126,16 @@
 	return TRUE;
 }
 
+static gboolean
+workspace_new(GntBindable *bindable, GList *null)
+{
+	GntWM *wm = GNT_WM(bindable);
+	GntWS *ws = gnt_ws_new(NULL);
+	gnt_wm_add_workspace(wm, ws);
+	gnt_wm_switch_workspace(wm, g_list_index(wm->workspaces, ws));
+	return TRUE;
+}
+
 static void
 gnt_wm_class_init(GntWMClass *klass)
 {
@@ -1262,6 +1270,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), "workspace-new", workspace_new,
+				GNT_KEY_F9, NULL);
 	gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "workspace-next", workspace_next,
 				"\033" ">", NULL);
 	gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "workspace-prev", workspace_prev,
@@ -1316,6 +1326,7 @@
 
 	return type;
 }
+
 void
 gnt_wm_add_workspace(GntWM *wm, GntWS *ws)
 {
--- a/finch/libgnt/gntws.c	Mon Jun 11 17:36:40 2007 +0000
+++ b/finch/libgnt/gntws.c	Tue Jun 12 21:25:56 2007 +0000
@@ -154,6 +154,13 @@
 	return type;
 }
 
+GntWS *gnt_ws_new(const char *name)
+{
+	GntWS *ws = GNT_WS(g_object_new(GNT_TYPE_WS, NULL));
+	ws->name = g_strdup(name ? name : "(noname)");
+	return ws;
+}
+
 const char * gnt_ws_get_name(GntWS *ws)
 {
 	return ws->name;
--- a/finch/libgnt/gntws.h	Mon Jun 11 17:36:40 2007 +0000
+++ b/finch/libgnt/gntws.h	Tue Jun 12 21:25:56 2007 +0000
@@ -45,6 +45,7 @@
 
 GType gnt_ws_get_gtype(void);
 
+GntWS *gnt_ws_new(const char *name);
 void gnt_ws_set_name(GntWS *, const gchar *);
 void gnt_ws_add_widget(GntWS *, GntWidget *);
 void gnt_ws_remove_widget(GntWS *, GntWidget *);
--- a/finch/libgnt/wms/irssi.c	Mon Jun 11 17:36:40 2007 +0000
+++ b/finch/libgnt/wms/irssi.c	Tue Jun 12 21:25:56 2007 +0000
@@ -192,7 +192,7 @@
 	const char *name = gnt_widget_get_name(win);
 	if (!name || !GNT_IS_BOX(win) || strcmp(name, "conversation-window"))
 		return;
-	g_object_set_data(G_OBJECT(win), "irssi-index", GINT_TO_POINTER(g_list_index(wm->list, win)));
+	g_object_set_data(G_OBJECT(win), "irssi-index", GINT_TO_POINTER(g_list_index(wm->cws->list, win)));
 	g_timeout_add(0, (GSourceFunc)update_conv_window_title, node);
 }
 
@@ -221,7 +221,7 @@
 	int x, y, w, h;
 	GntWidget *win;
 
-	if (wm->ordered == NULL || is_budddylist(win = GNT_WIDGET(wm->ordered->data)))
+	if (wm->cws->ordered == NULL || is_budddylist(win = GNT_WIDGET(wm->cws->ordered->data)))
 		return FALSE;
 
 	find_window_position(irssi, win, &hor, &vert);