chiark / gitweb /
grey out edit->track properties when not connected
authorrjk@greenend.org.uk <>
Sun, 30 Sep 2007 14:15:16 +0000 (15:15 +0100)
committerrjk@greenend.org.uk <>
Sun, 30 Sep 2007 14:15:16 +0000 (15:15 +0100)
disobedience/client.c
disobedience/menu.c
lib/eclient.c

index ea0dbd9acd321f21042c9c808399ea4320fb4fb4..869bcf3db148d8592eb0d54766b610cc9e4d761e 100644 (file)
@@ -112,6 +112,7 @@ static void gtkclient_comms_error(void attribute((unused)) *u,
   D(("gtkclient_comms_error %s", msg));
   /* Control buttons might have become unusable */
   control_update();
+  menu_update(-1);
   gtk_label_set_text(GTK_LABEL(report_label), msg);
 }
 
@@ -136,6 +137,8 @@ static void gtkclient_report(void attribute((unused)) *u,
   if(!msg)
     /* We're idle - clear the report line */
     gtk_label_set_text(GTK_LABEL(report_label), "");
+  control_update();
+  menu_update(-1);
 }
 
 void popup_protocol_error(int attribute((unused)) code,
index ded1f894cf11cdd8640663f1c155756a262ed41b..45693853cb92be39efd68c5d2e69636b52435ccb 100644 (file)
@@ -61,7 +61,8 @@ void menu_update(int page) {
 
   assert(t != 0);
   gtk_widget_set_sensitive(properties_widget,
-                           t->properties_sensitive(tab));
+                           (t->properties_sensitive(tab)
+                            && disorder_eclient_connected(client)));
   gtk_widget_set_sensitive(selectall_widget,
                            t->selectall_sensitive(tab));
 }
index e98d15263d14b2b12a2fb3b2d27d6dfea4d039bb..6bbb530b0800c5bfb54c15cd23e69f634d4e9da4 100644 (file)
@@ -497,8 +497,12 @@ static void maybe_connected(disorder_eclient *c) {
     comms_error(c, "connecting to %s: %s", c->ident, strerror(err));
     /* sets state_disconnected */
   } else {
+    char *r;
+    
     /* The connection succeeded */
     c->state = state_connected;
+    byte_xasprintf(&r, "connected to %s", c->ident);
+    c->callbacks->report(c->u, r);
   }
 }
 
@@ -526,6 +530,8 @@ static void authbanner_opcallback(disorder_eclient *c,
 
 static void authuser_opcallback(disorder_eclient *c,
                                 struct operation *op) {
+  char *r;
+
   D(("authuser_opcallback"));
   if(c->rc / 100 != 2) {
     /* Wrong password or something.  We cannot proceed. */
@@ -535,6 +541,8 @@ static void authuser_opcallback(disorder_eclient *c,
   }
   /* OK, we're authenticated now. */
   c->authenticated = 1;
+  byte_xasprintf(&r, "authenticated with %s", c->ident);
+  c->callbacks->report(c->u, r);
   if(c->log_callbacks && !(c->ops && c->ops->opcallback == log_opcallback))
     /* We are a log client, switch to logging mode */
     stash_command(c, 0/*queuejump*/, log_opcallback, 0/*completed*/, c->log_v,