chiark / gitweb /
Comments
authorRichard Kettlewell <rjk@greenend.org.uk>
Sat, 19 Apr 2008 12:28:31 +0000 (13:28 +0100)
committerRichard Kettlewell <rjk@greenend.org.uk>
Sat, 19 Apr 2008 12:28:31 +0000 (13:28 +0100)
disobedience/menu.c
disobedience/users.c

index ab32f36d073fda2e5c24c74fc087d149bbac26cb..0540a56d25d9f978b657ce34a8f8100a2efdd9b2 100644 (file)
@@ -130,6 +130,7 @@ void menu_update(int page) {
                            t->selectall_sensitive(tab));
   gtk_widget_set_sensitive(selectnone_widget,
                            t->selectnone_sensitive(tab));
+  /* TODO Users should only be sensitive if have RIGHT_ADMIN */
 }
    
 /** @brief Fetch version in order to display the about... popup */
index bca35aaab2a9d3917163544e662d7e2fdb609fda..5b50b2599185c8b6128c5ba5a5c46b8600213021 100644 (file)
@@ -37,10 +37,12 @@ static GtkWidget *users_details_rights[32];
 
 static const char *users_who, *users_email, *users_rights, *users_password;
 
+/** @brief qsort() callback for username comparison */
 static int usercmp(const void *a, const void *b) {
   return strcmp(*(char **)a, *(char **)b);
 }
 
+/** @brief Called with the list of users */
 static void users_got_list(void attribute((unused)) *v, int nvec, char **vec) {
   int n;
   GtkTreeIter iter;
@@ -57,6 +59,7 @@ static void users_got_list(void attribute((unused)) *v, int nvec, char **vec) {
   gtk_widget_show_all(users_window);
 }
 
+/** @brief Pick the selected user from the list */
 static char *users_getuser(void) {
   GtkTreeIter iter;
   char *who, *c;
@@ -79,6 +82,7 @@ static char *users_getuser(void) {
 /** @brief Text should be editable */
 #define DETAIL_EDITABLE 2
 
+/** @brief Add a row to the user detail table */
 static GtkWidget *users_detail_generic(GtkWidget *table,
                                        int *rowp,
                                        const char *title,
@@ -275,17 +279,20 @@ static void users_makedetails(const char *title,
   gtk_widget_show_all(users_details_window);
 }
 
+/** @brief Called when the 'add' button is pressed */
 static void users_add(GtkButton attribute((unused)) *button,
                      gpointer attribute((unused)) userdata) {
   /* TODO */
 }
 
+/** @brief Called when user deletion goes wrong */
 static void users_deleted_error(struct callbackdata attribute((unused)) *cbd,
                                int attribute((unused)) code,
                                const char *msg) {
   popup_msg(GTK_MESSAGE_ERROR, msg);
 }
 
+/** @brief Called when a user has been deleted */
 static void users_deleted(void *v) {
   const struct callbackdata *const cbd = v;
   GtkTreeIter iter;
@@ -307,6 +314,7 @@ static void users_deleted(void *v) {
   g_free(who);
 }
 
+/** @brief Called when the 'Delete' button is pressed */
 static void users_delete(GtkButton attribute((unused)) *button,
                         gpointer attribute((unused)) userdata) {
   GtkWidget *yesno;
@@ -349,6 +357,7 @@ static void users_got_password(void attribute((unused)) *v, const char *value) {
                     users_password);
 }
 
+/** @brief Called when the 'Edit' button is pressed */
 static void users_edit(GtkButton attribute((unused)) *button,
                       gpointer attribute((unused)) userdata) {
   if(!(users_who = users_getuser()))
@@ -360,6 +369,7 @@ static void users_edit(GtkButton attribute((unused)) *button,
   disorder_eclient_userinfo(client, users_got_password, users_who, "password", 0);
 }
 
+/** @brief Table of buttons for the user window */
 static const struct button users_buttons[] = {
   {
     "Add user",
@@ -379,6 +389,7 @@ static const struct button users_buttons[] = {
 };
 #define NUSERS_BUTTONS (sizeof users_buttons / sizeof *users_buttons)
 
+/** @brief Pop up the user management window */
 void manage_users(void) {
   GtkWidget *tree, *buttons, *hbox;
   GtkCellRenderer *cr;