chiark / gitweb /
disobedience: tinker with About... box
[disorder] / disobedience / menu.c
index 435aeb4175d252a158da46696000db17b8a2f84d..b398606b289c28807ba624d21061c87903847d85 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * This file is part of DisOrder.
- * Copyright (C) 2006-2009 Richard Kettlewell
+ * Copyright (C) 2006-2009, 2011, 2013 Richard Kettlewell
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -154,7 +154,7 @@ static void about_popup_got_version(void attribute((unused)) *v,
 
   if(!value)
     value = "[error]";
-  byte_xasprintf(&server_version_string, "Server version %s", value);
+  byte_xasprintf(&server_version_string, "DisOrder server version %s", value);
   byte_xasprintf(&short_version_string, "Disobedience %s",
                  disorder_short_version_string);
   w = gtk_dialog_new_with_buttons("About Disobedience",
@@ -182,7 +182,7 @@ static void about_popup_got_version(void attribute((unused)) *v,
                      FALSE/*fill*/,
                      1/*padding*/);
   gtk_box_pack_start(GTK_BOX(vbox),
-                     gtk_label_new("\xC2\xA9 2003-2011 Richard Kettlewell et al"),
+                     gtk_label_new("\xC2\xA9 2003-2013 Richard Kettlewell et al"),
                      FALSE/*expand*/,
                      FALSE/*fill*/,
                      1/*padding*/);
@@ -215,11 +215,23 @@ void users_set_sensitive(int sensitive) {
   gtk_widget_set_sensitive(w, sensitive);
 }
 
+static void menu_check_userman(void attribute((unused)) *v,
+                               const char *err,
+                               const char attribute((unused)) *value) {
+  if(err && !strncmp(err, "510", 3))
+    users_set_sensitive(FALSE);
+  else
+    users_set_sensitive(TRUE);
+}
+
 /** @brief Called when our rights change */
 static void menu_rights_changed(const char attribute((unused)) *event,
                                 void attribute((unused)) *eventdata,
                                 void attribute((unused)) *callbackdata) {
-  users_set_sensitive(!!(last_rights & RIGHT_ADMIN));
+  if(last_rights & RIGHT_ADMIN)
+    disorder_eclient_userinfo(client, menu_check_userman, "", "email", 0);
+  else
+    users_set_sensitive(FALSE);
 }
 
 /** @brief Create the menu bar widget */
@@ -394,7 +406,7 @@ GtkWidget *menubar(GtkWidget *w) {
       GTK_STOCK_HELP,                   /* extra_data */
     },
     {
-      (char *)"/Help/About DisOrder",   /* path */
+      (char *)"/Help/About Disobedience", /* path */
       0,                                /* accelerator */
       about_popup,                      /* callback */
       0,                                /* callback_action */