[Gpa-commits] r843 - trunk/src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Mar 11 15:28:07 CET 2008


Author: marcus
Date: 2008-03-11 15:28:06 +0100 (Tue, 11 Mar 2008)
New Revision: 843

Modified:
   trunk/src/ChangeLog
   trunk/src/settingsdlg.c
   trunk/src/settingsdlg.h
Log:
2008-03-11  Marcus Brinkmann  <marcus at g10code.de>

	* settingsdlg.c: Include settingsdlg.h.  Beautify code.
	[! HAVE_CONFIG_H]: Don't include config.h.
	(default_key_frame): Do not use a border with frames, but make the
	label bold.  Give the scrolled window a shadow.
	(default_keyserver_frame): Do not use a border with frames, but
	make the label bold.
	(user_interface_mode_frame): Likewise.


Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2008-03-11 13:14:40 UTC (rev 842)
+++ trunk/src/ChangeLog	2008-03-11 14:28:06 UTC (rev 843)
@@ -1,3 +1,13 @@
+2008-03-11  Marcus Brinkmann  <marcus at g10code.de>
+
+	* settingsdlg.c: Include settingsdlg.h.  Beautify code.
+	[! HAVE_CONFIG_H]: Don't include config.h.
+	(default_key_frame): Do not use a border with frames, but make the
+	label bold.  Give the scrolled window a shadow.
+	(default_keyserver_frame): Do not use a border with frames, but
+	make the label bold.
+	(user_interface_mode_frame): Likewise.
+
 2008-03-07  Werner Koch  <wk at g10code.com>
 
 	* keytable.h (_GpaKeyTable): Add new fields FPR, DID_FIRST_HALF

Modified: trunk/src/settingsdlg.c
===================================================================
--- trunk/src/settingsdlg.c	2008-03-11 13:14:40 UTC (rev 842)
+++ trunk/src/settingsdlg.c	2008-03-11 14:28:06 UTC (rev 843)
@@ -1,32 +1,37 @@
 /* settingsdlg.c - The GNU Privacy Assistant
- * Copyright (C) 2002, Miguel Coca
- * Copyright (C) 2008 g10 Code GmbH.
- *
- * This file is part of GPA
- *
- * GPA is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GPA is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- */
+   Copyright (C) 2002, Miguel Coca
+   Copyright (C) 2008 g10 Code GmbH.
 
-#include <config.h>
+   This file is part of GPA.
 
+   GPA is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 2 of the License, or
+   (at your option) any later version.
+  
+   GPA is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+  
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, write to the Free Software
+   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+   02110-1301 USA.  */
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
 #include "gpa.h"
 #include "settingsdlg.h"
 #include "gpakeyselector.h"
 #include "keyserver.h"
 
-/* Default key section */
+#include "settingsdlg.h"
+
+
+/* Default key section.  */
 static void
 key_selected_cb (GtkTreeSelection *treeselection, gpointer user_data)
 {
@@ -35,19 +40,26 @@
   
   selected = gpa_key_selector_get_selected_keys (sel);
   gpa_options_set_default_key (gpa_options_get_instance (),
-			       (gpgme_key_t)selected->data);
+			       (gpgme_key_t) selected->data);
   g_list_free (selected);
 }
 
+
 static GtkWidget *
 default_key_frame (void)
 {
-  GtkWidget *frame, *label, *list, *scroller;
+  GtkWidget *frame;
+  GtkWidget *label;
+  GtkWidget *list;
+  GtkWidget *scroller;
 
-  /* Build UI */
-  label = gtk_label_new_with_mnemonic (_("Default _key:"));
+  /* Build UI.  */
   frame = gtk_frame_new (NULL);
+  gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
+  label = gtk_label_new_with_mnemonic (_("<b>Default _key</b>"));
+  gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
   gtk_frame_set_label_widget (GTK_FRAME (frame), label);
+
   list = gpa_key_selector_new (TRUE);
   gtk_tree_selection_set_mode (gtk_tree_view_get_selection 
 			       (GTK_TREE_VIEW (list)), GTK_SELECTION_SINGLE);
@@ -55,17 +67,23 @@
   gtk_scrolled_window_set_policy  (GTK_SCROLLED_WINDOW (scroller),
 				   GTK_POLICY_AUTOMATIC,
 				   GTK_POLICY_AUTOMATIC);
+  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroller),
+				       GTK_SHADOW_IN);
+
   gtk_widget_set_size_request (scroller, 320, 120);
   gtk_container_set_border_width (GTK_CONTAINER (scroller), 5);
   gtk_container_add (GTK_CONTAINER (scroller), list);
   gtk_container_add (GTK_CONTAINER (frame), scroller);
-  /* Connect signals */
-  g_signal_connect (G_OBJECT(gtk_tree_view_get_selection(GTK_TREE_VIEW(list))),
+
+  /* Connect signals.  */
+  g_signal_connect (G_OBJECT (gtk_tree_view_get_selection
+			      (GTK_TREE_VIEW (list))),
 		    "changed", G_CALLBACK (key_selected_cb), list);
   return frame;
 }
 
-/* Default keyserver section */
+
+/* Default keyserver section.  */
 static void
 keyserver_selected_cb (GtkWidget *entry, gpointer user_data)
 {
@@ -73,22 +91,27 @@
                                      gtk_entry_get_text (GTK_ENTRY (entry)));
 }
 
+
 static void
 selected_from_list_cb (GtkList *list, GtkWidget *widget, GtkWidget *entry)
 {
-  /* Consider the text entry activated */
+  /* Consider the text entry activated.  */
   keyserver_selected_cb (entry, NULL);
 }
 
+
 static GtkWidget *
 default_keyserver_frame (void)
 {
   GtkWidget *frame, *label, *combo;
   
   /* Build UI */
-  label = gtk_label_new_with_mnemonic (_("Default key_server: "));
   frame = gtk_frame_new (NULL);
+  gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
+  label = gtk_label_new_with_mnemonic (_("<b>Default key_server</b>"));
+  gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
   gtk_frame_set_label_widget (GTK_FRAME (frame), label);
+
   combo = gtk_combo_new ();
   gtk_combo_set_value_in_list (GTK_COMBO (combo), FALSE, FALSE);
   gtk_container_set_border_width (GTK_CONTAINER (combo), 5);
@@ -109,30 +132,33 @@
   return frame;
 }
 
-/* User interface section */
-
+
+/* User interface section.  */
 static void
 advanced_mode_toggled (GtkToggleButton *yes_button, gpointer user_data)
 {
   if (gtk_toggle_button_get_active (yes_button))
-    {
-      gpa_options_set_simplified_ui (gpa_options_get_instance (), FALSE);
-    }
+    gpa_options_set_simplified_ui (gpa_options_get_instance (), FALSE);
   else
-    {
-      gpa_options_set_simplified_ui (gpa_options_get_instance (), TRUE);
-    }
+    gpa_options_set_simplified_ui (gpa_options_get_instance (), TRUE);
 }
 
 static GtkWidget *
 user_interface_mode_frame (void)
 {
-  GtkWidget *frame, *label, *hbox, *yes_button, *no_button;
+  GtkWidget *frame;
+  GtkWidget *label;
+  GtkWidget *hbox;
+  GtkWidget *yes_button;
+  GtkWidget *no_button;
   
-  /* Build UI */
-  label = gtk_label_new_with_mnemonic (_("Use _advanced mode:"));
+  /* Build UI.  */
   frame = gtk_frame_new (NULL);
+  gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_NONE);
+  label = gtk_label_new_with_mnemonic (_("<b>Use _advanced mode</b>"));
+  gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
   gtk_frame_set_label_widget (GTK_FRAME (frame), label);
+
   hbox = gtk_hbox_new (TRUE, 0);
   gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
   gtk_container_add (GTK_CONTAINER (frame), hbox);
@@ -141,56 +167,56 @@
   no_button = gtk_radio_button_new_with_mnemonic_from_widget
     (GTK_RADIO_BUTTON (yes_button), _("_No"));
   gtk_box_pack_start_defaults (GTK_BOX (hbox), no_button);
-  /* Select default value */
+
+  /* Select default value.  */
   if (gpa_options_get_simplified_ui (gpa_options_get_instance ()))
-    {
-      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (no_button), TRUE);
-    }
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (no_button), TRUE);
   else
-    {
-      gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (yes_button), TRUE);
-    }
-  /* Connect signals */
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (yes_button), TRUE);
+
+  /* Connect signals.  */
   g_signal_connect (G_OBJECT (yes_button), "toggled",
                     G_CALLBACK (advanced_mode_toggled), NULL);
   
   return frame;
 }
 
+
+/* Create a new settings dialog and return it.  The dialog is shown
+   but not run.  */
 GtkWidget *
 gpa_settings_dialog_new (void)
 {
   GtkWidget *dialog;
   GtkWidget *frame;
 
-  dialog = gtk_dialog_new_with_buttons (_("Settings"),
-                                        NULL,
-                                        0,
+  dialog = gtk_dialog_new_with_buttons (_("Settings"), NULL, 0,
                                         _("_Close"),
                                         GTK_RESPONSE_CLOSE, NULL);
   gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_CLOSE);
   gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
   gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 5);
 
-  /* The default key section */
+  /* The default key section.  */
   frame = default_key_frame ();
   gtk_box_pack_start_defaults (GTK_BOX (GTK_DIALOG (dialog)->vbox), frame);
 
-  /* The default keyserver section */
+  /* The default keyserver section.  */
   frame = default_keyserver_frame ();
   gtk_box_pack_start_defaults (GTK_BOX (GTK_DIALOG (dialog)->vbox), frame);
 
-  /* The UI mode section */
+  /* The UI mode section.  */
   frame = user_interface_mode_frame ();
   gtk_box_pack_start_defaults (GTK_BOX (GTK_DIALOG (dialog)->vbox), frame);
 
-  /* Close the dialog when asked to */
+  /* Close the dialog when asked to.  */
   g_signal_connect_swapped (GTK_OBJECT (dialog), 
                             "response", 
                             G_CALLBACK (gtk_widget_destroy),
                             GTK_OBJECT (dialog));
 
-  /* Don't run the dialog here: leave that to gtk_main */
+  /* Don't run the dialog here: leave that to gtk_main.  */
   gtk_widget_show_all (GTK_WIDGET (dialog));
+
   return dialog;
 }

Modified: trunk/src/settingsdlg.h
===================================================================
--- trunk/src/settingsdlg.h	2008-03-11 13:14:40 UTC (rev 842)
+++ trunk/src/settingsdlg.h	2008-03-11 14:28:06 UTC (rev 843)
@@ -1,26 +1,27 @@
 /* settingsdlg.c - The GNU Privacy Assistant
- *	Copyright (C) 2002, Miguel Coca
- *
- * This file is part of GPA
- *
- * GPA is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * GPA is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
- */
+   Copyright (C) 2002, Miguel Coca
+   Copyright (C) 2008 g10 Code GmbH.
 
+   This file is part of GPA.
+
+   GPA is free software; you can redistribute it and/or modify it
+   under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   GPA is distributed in the hope that it will be useful, but WITHOUT
+   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+   or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+   License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+
 #ifndef SETTINGSDLG_H
 #define SETTINGSDLG_H
 
-GtkWidget * gpa_settings_dialog_new (void);
+/* Create a new settings dialog and return it.  The dialog is shown
+   but not run.  */
+GtkWidget *gpa_settings_dialog_new (void);
 
 #endif



More information about the Gpa-commits mailing list