chiark / gitweb /
use GtkStyles everywhere instead of explicit colors. faster.
[disorder] / disobedience / login.c
index 8a00a597265bdb50260a06fac6bc344d61e42164..3dff339b4431c8fe7a223616fbb9bf6f03d8856f 100644 (file)
@@ -125,10 +125,12 @@ static void login_save(GtkButton attribute((unused)) *button,
        GTK_DIALOG_MODAL|GTK_DIALOG_DESTROY_WITH_PARENT,
        GTK_MESSAGE_QUESTION,
        GTK_BUTTONS_NONE,
-       "File %s already exists", path);
+       "File %s already exists.", path);
+    gtk_window_set_title(GTK_WINDOW(yorn),
+                         "Configuration file already exists");
     gtk_dialog_add_buttons(GTK_DIALOG(yorn),
-                           "Overwrite", GTK_RESPONSE_ACCEPT,
-                           "Cancel", GTK_RESPONSE_REJECT,
+                           "Overwrite it", GTK_RESPONSE_ACCEPT,
+                           "Don't save after all", GTK_RESPONSE_REJECT,
                            (char *)0);
     if(gtk_dialog_run(GTK_DIALOG(yorn)) != GTK_RESPONSE_ACCEPT)
       goto done;
@@ -172,9 +174,6 @@ static void login_save(GtkButton attribute((unused)) *button,
 done:
   if(yorn)
     gtk_widget_destroy(yorn);
-  /* OS X WM likes to hide it */
-  if(login_window)
-    gtk_window_present(GTK_WINDOW(login_window));
 }
 
 static void login_cancel(GtkButton attribute((unused)) *button,
@@ -187,17 +186,17 @@ static const struct button buttons[] = {
   {
     "Login",
     login_ok,
-    "Login with these settings",
+    "(Re-)connect using these settings",
   },
   {
     GTK_STOCK_SAVE,
     login_save,
-    "Save these settings",
+    "Save these settings and close window",
   },
   {
-    GTK_STOCK_CANCEL,
+    GTK_STOCK_CLOSE,
     login_cancel,
-    "Discard all changes and close window"
+    "Discard changes and close window"
   },
 };
 
@@ -216,13 +215,16 @@ void login_box(void) {
   default_connect();
   /* Create a new login window */
   login_window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+  gtk_widget_set_style(login_window, tool_style);
   g_signal_connect(login_window, "destroy",
                   G_CALLBACK(gtk_widget_destroyed), &login_window);
   gtk_window_set_title(GTK_WINDOW(login_window), "Login Details");
   /* Construct the form */
   table = gtk_table_new(NLWIS + 1/*rows*/, 2/*columns*/, FALSE/*homogenous*/);
+  gtk_widget_set_style(table, tool_style);
   for(n = 0; n < NLWIS; ++n) {
     label = gtk_label_new(lwis[n].description);
+    gtk_widget_set_style(label, tool_style);
     gtk_misc_set_alignment(GTK_MISC(label), 1/*right*/, 0/*bottom*/);
     gtk_table_attach(GTK_TABLE(table), label,
                     0, 1,              /* left/right_attach */
@@ -230,6 +232,7 @@ void login_box(void) {
                     GTK_FILL, 0,       /* x/yoptions */
                     1, 1);             /* x/ypadding */
     entry = gtk_entry_new();
+    gtk_widget_set_style(entry, tool_style);
     gtk_entry_set_visibility(GTK_ENTRY(entry),
                              lwis[n].flags & LWI_HIDDEN ? FALSE : TRUE);
     gtk_entry_set_text(GTK_ENTRY(entry), lwis[n].get());
@@ -247,6 +250,8 @@ void login_box(void) {
   gtk_box_pack_start(GTK_BOX(vbox), buttonbox,
                      FALSE/*expand*/, FALSE/*fill*/, 1/*padding*/);
   gtk_container_add(GTK_CONTAINER(login_window), vbox);
+  gtk_window_set_transient_for(GTK_WINDOW(login_window),
+                               GTK_WINDOW(toplevel));
   gtk_widget_show_all(login_window);
 }