diff options
author | Sadrul Habib Chowdhury <sadrul@pidgin.im> | 2007-06-12 21:25:56 +0000 |
---|---|---|
committer | Sadrul Habib Chowdhury <sadrul@pidgin.im> | 2007-06-12 21:25:56 +0000 |
commit | e48eb9788eeea9733fef385c655bee8af1fca2bc (patch) | |
tree | 3543d28631c33925c698ffae11ecdea7fa41b73c | |
parent | 383957a236920ba890648797419ee67a757168ec (diff) | |
parent | 907a768b9c776f06bd8ac5157058c6a1bc497a39 (diff) | |
download | pidgin-e48eb9788eeea9733fef385c655bee8af1fca2bc.tar.gz |
merge of 'a0178de25d1892b2f929c84c59e8ba429de439d7'
and '3a40ec9ee97de35146c800b78e2453deceaff604'
-rw-r--r-- | configure.ac | 6 | ||||
-rw-r--r-- | finch/libgnt/Makefile.am | 2 | ||||
-rw-r--r-- | finch/libgnt/configure.ac | 6 | ||||
-rw-r--r-- | finch/libgnt/gntstyle.c | 3 | ||||
-rw-r--r-- | finch/libgnt/gntwm.c | 19 | ||||
-rw-r--r-- | finch/libgnt/gntws.c | 7 | ||||
-rw-r--r-- | finch/libgnt/gntws.h | 1 | ||||
-rw-r--r-- | finch/libgnt/wms/irssi.c | 4 |
8 files changed, 33 insertions, 15 deletions
diff --git a/configure.ac b/configure.ac index 7d9bc96ad3..965aac2956 100644 --- a/configure.ac +++ b/configure.ac @@ -52,10 +52,10 @@ m4_define([purple_version], [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]) diff --git a/finch/libgnt/Makefile.am b/finch/libgnt/Makefile.am index 29367fc2a7..3079a4148d 100644 --- a/finch/libgnt/Makefile.am +++ b/finch/libgnt/Makefile.am @@ -1,6 +1,6 @@ EXTRA_DIST=genmarshal -SUBDIRS = . +SUBDIRS = . wms pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = gnt.pc diff --git a/finch/libgnt/configure.ac b/finch/libgnt/configure.ac index eeae6acbdb..7fa570f703 100644 --- a/finch/libgnt/configure.ac +++ b/finch/libgnt/configure.ac @@ -24,11 +24,11 @@ AC_PREREQ([2.50]) # 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])) diff --git a/finch/libgnt/gntstyle.c b/finch/libgnt/gntstyle.c index c8e5b0a70b..c8555bb553 100644 --- a/finch/libgnt/gntstyle.c +++ b/finch/libgnt/gntstyle.c @@ -138,8 +138,7 @@ void gnt_style_read_workspaces(GntWM *wm) 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); diff --git a/finch/libgnt/gntwm.c b/finch/libgnt/gntwm.c index 81ab6c6367..b846882835 100644 --- a/finch/libgnt/gntwm.c +++ b/finch/libgnt/gntwm.c @@ -335,8 +335,7 @@ gnt_wm_init(GTypeInstance *instance, gpointer class) 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 @@ refresh_screen(GntBindable *bindable, GList *null) 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 @@ workspace_list(GntBindable *b, GList *params) 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 @@ gnt_wm_class_init(GntWMClass *klass) "\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 @@ gnt_wm_get_gtype(void) return type; } + void gnt_wm_add_workspace(GntWM *wm, GntWS *ws) { diff --git a/finch/libgnt/gntws.c b/finch/libgnt/gntws.c index 930c50ac53..297a21d141 100644 --- a/finch/libgnt/gntws.c +++ b/finch/libgnt/gntws.c @@ -154,6 +154,13 @@ gnt_ws_get_gtype(void) 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; diff --git a/finch/libgnt/gntws.h b/finch/libgnt/gntws.h index bf2d7ea7b0..a68b6f841b 100644 --- a/finch/libgnt/gntws.h +++ b/finch/libgnt/gntws.h @@ -45,6 +45,7 @@ G_BEGIN_DECLS 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 *); diff --git a/finch/libgnt/wms/irssi.c b/finch/libgnt/wms/irssi.c index a9ad0b7815..4c6c03ce8c 100644 --- a/finch/libgnt/wms/irssi.c +++ b/finch/libgnt/wms/irssi.c @@ -192,7 +192,7 @@ irssi_update_window(GntWM *wm, GntNode *node) 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 @@ move_direction(GntBindable *bindable, GList *list) 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); |