gnome-mud r817 - in trunk: . data/icons src
- From: lharris svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-mud r817 - in trunk: . data/icons src
- Date: Fri, 20 Mar 2009 10:03:28 +0000 (UTC)
Author: lharris
Date: Fri Mar 20 10:03:28 2009
New Revision: 817
URL: http://svn.gnome.org/viewvc/gnome-mud?rev=817&view=rev
Log:
Added activity notification for inactive tabs in MudWindow
Added:
trunk/data/icons/hicolor_apps_16x16_gnome-mud-negative.png (contents, props changed)
trunk/data/icons/hicolor_apps_16x16_gnome-mud-positive.png (contents, props changed)
Modified:
trunk/ChangeLog
trunk/data/icons/Makefile.am
trunk/src/gnome-mud-icons.h
trunk/src/mud-connection-view.c
trunk/src/mud-window.c
trunk/src/mud-window.h
Modified: trunk/data/icons/Makefile.am
==============================================================================
--- trunk/data/icons/Makefile.am (original)
+++ trunk/data/icons/Makefile.am Fri Mar 20 10:03:28 2009
@@ -10,6 +10,8 @@
hicolor_apps_24x24_gnome-mud.png \
hicolor_apps_32x32_gnome-mud.png \
hicolor_apps_scalable_gnome-mud.svg \
+ hicolor_apps_16x16_gnome-mud-negative.png \
+ hicolor_apps_16x16_gnome-mud-positive.png \
$(NULL)
noinst_Data = \
Added: trunk/data/icons/hicolor_apps_16x16_gnome-mud-negative.png
==============================================================================
Binary file. No diff available.
Added: trunk/data/icons/hicolor_apps_16x16_gnome-mud-positive.png
==============================================================================
Binary file. No diff available.
Modified: trunk/src/gnome-mud-icons.h
==============================================================================
--- trunk/src/gnome-mud-icons.h (original)
+++ trunk/src/gnome-mud-icons.h Fri Mar 20 10:03:28 2009
@@ -22,7 +22,10 @@
G_BEGIN_DECLS
#define GMUD_STOCK_ICON "gnome-mud"
+#define GMUD_STOCK_POSITIVE "gnome-mud-positive"
+#define GMUD_STOCK_NEGATIVE "gnome-mud-negative"
G_END_DECLS
#endif // GNOME_MUD_ICONS_H
+
Modified: trunk/src/mud-connection-view.c
==============================================================================
--- trunk/src/mud-connection-view.c (original)
+++ trunk/src/mud-connection-view.c Fri Mar 20 10:03:28 2009
@@ -1189,21 +1189,30 @@
if(!gag)
{
if(g_str_equal(view->priv->current_output, "main"))
+ {
vte_terminal_feed(view->terminal,
buf,
length);
+
+ mud_window_toggle_tab_icon(view->window, view);
+ }
else
{
MudSubwindow *sub =
mud_connection_view_get_subwindow(view,
view->priv->current_output);
- if(!sub)
+ if(sub)
+ mud_subwindow_feed(sub, buf, length);
+ else
+ {
vte_terminal_feed(view->terminal,
buf,
length);
- else
- mud_subwindow_feed(sub, buf, length);
+
+ mud_window_toggle_tab_icon(view->window, view);
+ }
+
}
mud_log_write_hook(view->log, buf, length);
Modified: trunk/src/mud-window.c
==============================================================================
--- trunk/src/mud-window.c (original)
+++ trunk/src/mud-window.c Fri Mar 20 10:03:28 2009
@@ -641,6 +641,10 @@
gchar *name;
gboolean connected;
gboolean logging;
+ GtkWidget *box;
+ GtkWidget *viewport;
+ GList *list = NULL;
+ GtkImage *image;
if(IS_MUD_CONNECTION_VIEW(self->priv->current_view))
mud_connection_view_hide_subwindows(self->priv->current_view);
@@ -687,6 +691,27 @@
gtk_widget_set_sensitive(self->priv->menu_disconnect, connected);
gtk_widget_set_sensitive(self->priv->toolbar_disconnect, connected);
+
+ mud_window_toggle_input_mode(self, self->priv->current_view);
+
+ if(GTK_WIDGET_VISIBLE(self->priv->textview))
+ gtk_widget_grab_focus(self->priv->textview);
+ else
+ gtk_widget_grab_focus(self->priv->password_entry);
+
+
+ g_object_get(self->priv->current_view,
+ "ui-vbox", &viewport,
+ NULL);
+
+ box = gtk_notebook_get_tab_label(GTK_NOTEBOOK(self->priv->notebook),
+ viewport);
+ list = gtk_container_get_children(GTK_CONTAINER(box));
+ image = GTK_IMAGE(list->data);
+
+ g_list_free(list);
+
+ gtk_image_set_from_icon_name(image, GMUD_STOCK_NEGATIVE, GTK_ICON_SIZE_MENU);
}
else
{
@@ -699,13 +724,6 @@
gtk_widget_set_sensitive(self->priv->toolbar_disconnect, FALSE);
gtk_widget_set_sensitive(self->priv->toolbar_reconnect, FALSE);
}
-
- mud_window_toggle_input_mode(self, self->priv->current_view);
-
- if(GTK_WIDGET_VISIBLE(self->priv->textview))
- gtk_widget_grab_focus(self->priv->textview);
- else
- gtk_widget_grab_focus(self->priv->password_entry);
}
static void
@@ -1047,6 +1065,37 @@
}
void
+mud_window_toggle_tab_icon(MudWindow *self,
+ MudConnectionView *view)
+{
+ g_return_if_fail(IS_MUD_WINDOW(self));
+
+ if(!IS_MUD_CONNECTION_VIEW(view))
+ return;
+
+ if(!g_direct_equal(self->priv->current_view, view))
+ {
+ GtkWidget *box;
+ GtkWidget *viewport;
+ GList *list = NULL;
+ GtkImage *image;
+
+ g_object_get(view,
+ "ui-vbox", &viewport,
+ NULL);
+
+ box = gtk_notebook_get_tab_label(GTK_NOTEBOOK(self->priv->notebook),
+ viewport);
+ list = gtk_container_get_children(GTK_CONTAINER(box));
+ image = GTK_IMAGE(list->data);
+
+ g_list_free(list);
+
+ gtk_image_set_from_icon_name(image, GMUD_STOCK_POSITIVE, GTK_ICON_SIZE_MENU);
+ }
+}
+
+void
mud_window_close_current_window(MudWindow *self)
{
g_return_if_fail(IS_MUD_WINDOW(self));
@@ -1131,6 +1180,9 @@
gint nr;
VteTerminal *terminal;
GtkVBox *viewport;
+ GtkHBox *hbox;
+ GtkWidget *tab_label;
+ GtkImage *image;
MudConnectionView *view = MUD_CONNECTION_VIEW(cview);
g_return_if_fail(IS_MUD_WINDOW(self));
@@ -1147,9 +1199,25 @@
"terminal", &terminal,
NULL);
+ tab_label = gtk_label_new(tabLbl);
+ hbox = GTK_HBOX(gtk_hbox_new(FALSE, 0));
+ image = GTK_IMAGE(gtk_image_new_from_icon_name(GMUD_STOCK_NEGATIVE,
+ GTK_ICON_SIZE_MENU));
+
+ gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(image), FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(hbox), tab_label, TRUE, TRUE, 0);
+
+ gtk_widget_show_all(GTK_WIDGET(hbox));
+
nr = gtk_notebook_append_page(GTK_NOTEBOOK(self->priv->notebook),
GTK_WIDGET(viewport),
- gtk_label_new(tabLbl));
+ GTK_WIDGET(hbox));
+
+ gtk_notebook_set_tab_label_packing(GTK_NOTEBOOK(self->priv->notebook),
+ GTK_WIDGET(viewport),
+ TRUE,
+ TRUE,
+ GTK_PACK_START);
gtk_notebook_set_current_page(GTK_NOTEBOOK(self->priv->notebook), nr);
@@ -1182,5 +1250,15 @@
gtk_widget_set_sensitive(self->priv->startlog, FALSE);
gtk_widget_set_sensitive(self->priv->menu_disconnect, FALSE);
gtk_widget_set_sensitive(self->priv->toolbar_disconnect, FALSE);
+
+ if(GTK_WIDGET_VISIBLE(self->priv->password_entry))
+ {
+ gtk_widget_hide(self->priv->password_entry);
+
+ gtk_widget_show(self->priv->textviewscroll);
+ gtk_widget_show(self->priv->textview);
+
+ gtk_widget_grab_focus(self->priv->textview);
+ }
}
Modified: trunk/src/mud-window.h
==============================================================================
--- trunk/src/mud-window.h (original)
+++ trunk/src/mud-window.h Fri Mar 20 10:03:28 2009
@@ -65,6 +65,7 @@
void mud_window_close_current_window(MudWindow *window);
void mud_window_disconnected(MudWindow *window);
void mud_window_toggle_input_mode(MudWindow *window, MudConnectionView *view);
+void mud_window_toggle_tab_icon(MudWindow *window, MudConnectionView *view);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]