aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2012-10-07 23:59:34 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2012-10-08 07:29:58 +0200
commit24b4e9956b381fe0f9447a6c35ae72ca3e0caabc (patch)
tree4604398ebd033489cd36acfef58cdea5c56f7e8c /src
parent66aca31467d1ecd86b3033b28596f50c5bff8aaa (diff)
downloadlogdiag-24b4e9956b381fe0f9447a6c35ae72ca3e0caabc.tar.gz
logdiag-24b4e9956b381fe0f9447a6c35ae72ca3e0caabc.tar.xz
logdiag-24b4e9956b381fe0f9447a6c35ae72ca3e0caabc.zip
Add a usage hint to the main window.
Diffstat (limited to 'src')
-rw-r--r--src/ld-window-main.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/ld-window-main.c b/src/ld-window-main.c
index 634c121..0be7700 100644
--- a/src/ld-window-main.c
+++ b/src/ld-window-main.c
@@ -42,6 +42,9 @@ struct _LdWindowMainPrivate
GtkWidget *statusbar;
guint statusbar_symbol_context_id;
guint statusbar_menu_context_id;
+ guint statusbar_hint_context_id;
+
+ guint statusbar_hint_drag;
};
@@ -276,6 +279,8 @@ ld_window_main_init (LdWindowMain *self)
(GTK_STATUSBAR (priv->statusbar), "menu");
priv->statusbar_symbol_context_id = gtk_statusbar_get_context_id
(GTK_STATUSBAR (priv->statusbar), "symbol");
+ priv->statusbar_hint_context_id = gtk_statusbar_get_context_id
+ (GTK_STATUSBAR (priv->statusbar), "hint");
priv->lv_viewport = gtk_viewport_new (NULL, NULL);
gtk_viewport_set_shadow_type
@@ -338,6 +343,10 @@ ld_window_main_init (LdWindowMain *self)
diagram_set_filename (self, NULL);
+ priv->statusbar_hint_drag = gtk_statusbar_push
+ (GTK_STATUSBAR (priv->statusbar), priv->statusbar_hint_context_id,
+ _("Drag symbols from the library pane to add them to the diagram."));
+
action_set_sensitive (self, "Undo", FALSE);
action_set_sensitive (self, "Redo", FALSE);
action_set_sensitive (self, "Delete", FALSE);
@@ -498,6 +507,14 @@ static void
on_diagram_changed (LdDiagram *diagram, LdWindowMain *self)
{
update_title (self);
+
+ if (self->priv->statusbar_hint_drag)
+ {
+ gtk_statusbar_remove (GTK_STATUSBAR (self->priv->statusbar),
+ self->priv->statusbar_hint_context_id,
+ self->priv->statusbar_hint_drag);
+ self->priv->statusbar_hint_drag = 0;
+ }
}
static void