[Gpa-commits] r795 - in trunk: . pixmaps src

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Thu Jan 24 22:27:35 CET 2008


Author: marcus
Date: 2008-01-24 22:27:33 +0100 (Thu, 24 Jan 2008)
New Revision: 795

Added:
   trunk/pixmaps/keyringeditor.xpm
Modified:
   trunk/TODO
   trunk/pixmaps/ChangeLog
   trunk/pixmaps/Makefile.am
   trunk/src/ChangeLog
   trunk/src/fileman.c
   trunk/src/icons.c
   trunk/src/icons.h
   trunk/src/keyring.c
   trunk/src/keyring.h
Log:
2008-01-24  Marcus Brinkmann  <marcus at g10code.de>

	* keyring.h: Add comment.
	* keyring.c (keyring_editor_new): Put a shadow around the scrolled
	window.
	(struct _GPAKeyringEditor): Add status_label.
	(keyring_statusbar_new): Set expand to false for all, and add 5
	pixel padding around key ID, which is moved before the user
	string.  Initialize status_label to empty string here.
	(keyring_update_status_bar): Set status_label.
	(toolbar_preferences): Bring back to life.
	(keyring_toolbar_new): Reenable preferences.
	* fileman.c (toolbar_preferences): Bring back to life.
	(fileman_toolbar_new): Reenable preferences.  Add keyring to
	toolbar.
	* icons.c: Include keyringeditor.xpm.
	(xpms): Add keyringeditor.


Modified: trunk/TODO
===================================================================
--- trunk/TODO	2008-01-23 23:06:15 UTC (rev 794)
+++ trunk/TODO	2008-01-24 21:27:33 UTC (rev 795)
@@ -37,3 +37,10 @@
 * There is no way to refresh selected keys from the keyserver.
   We might also want to have a scheduled refresh mode.  But that might
   be better implemented in gpg.
+
+* MB:
+** Add a beauty bar to filemanager (requires an icon corresponding to
+   keyring.xpm).
+** Support receiving keys from keyservers for unknown certificates, by
+   right click in "Signatures" tab of keyring manager and for all unknown
+   keys in that list at once.

Modified: trunk/pixmaps/ChangeLog
===================================================================
--- trunk/pixmaps/ChangeLog	2008-01-23 23:06:15 UTC (rev 794)
+++ trunk/pixmaps/ChangeLog	2008-01-24 21:27:33 UTC (rev 795)
@@ -1,3 +1,7 @@
+2008-01-24  Marcus Brinkmann  <marcus at g10code.de>
+
+	* Makefile.am (noinst_HEADERS): Add keyringeditor.xpm.
+
 2002-12-12  Miguel Coca  <mcoca at gnu.org>
 
 	* New directory with the old icons, in some cases resized to fit the

Modified: trunk/pixmaps/Makefile.am
===================================================================
--- trunk/pixmaps/Makefile.am	2008-01-23 23:06:15 UTC (rev 794)
+++ trunk/pixmaps/Makefile.am	2008-01-24 21:27:33 UTC (rev 795)
@@ -3,4 +3,4 @@
 	folder.xpm gpa_blue_key.xpm gpa_logo.xpm gpa_yellow_key.xpm \
 	harddisk.xpm help.xpm import.xpm keyring.xpm openfile.xpm \
 	open_folder.xpm sign.xpm verify.xpm wizard_backup.xpm \
-	wizard_genkey.xpm
+	wizard_genkey.xpm keyringeditor.xpm

Added: trunk/pixmaps/keyringeditor.xpm
===================================================================
--- trunk/pixmaps/keyringeditor.xpm	2008-01-23 23:06:15 UTC (rev 794)
+++ trunk/pixmaps/keyringeditor.xpm	2008-01-24 21:27:33 UTC (rev 795)
@@ -0,0 +1,204 @@
+/* XPM */
+static char * keyringeditor_xpm[] = {
+"24 24 177 2",
+"  	c None",
+". 	c #060403",
+"+ 	c #1C130C",
+"@ 	c #120D08",
+"# 	c #110D0A",
+"$ 	c #232222",
+"% 	c #100F0F",
+"& 	c #141413",
+"* 	c #181818",
+"= 	c #2B2B2B",
+"- 	c #030100",
+"; 	c #000000",
+"> 	c #040200",
+", 	c #030201",
+"' 	c #0F0C09",
+") 	c #07090A",
+"! 	c #000101",
+"~ 	c #050606",
+"{ 	c #171C1E",
+"] 	c #202729",
+"^ 	c #070706",
+"/ 	c #5B4D41",
+"( 	c #242E30",
+"_ 	c #1B2224",
+": 	c #3C4B4F",
+"< 	c #151B1D",
+"[ 	c #3D4D50",
+"} 	c #96BDC6",
+"| 	c #729097",
+"1 	c #98BFC9",
+"2 	c #303C3F",
+"3 	c #0B0C0D",
+"4 	c #1D1915",
+"5 	c #2D393C",
+"6 	c #273234",
+"7 	c #485B5F",
+"8 	c #37474A",
+"9 	c #AAD6E1",
+"0 	c #475A5E",
+"a 	c #040606",
+"b 	c #191F21",
+"c 	c #263032",
+"d 	c #89ACB5",
+"e 	c #232B2D",
+"f 	c #5A5149",
+"g 	c #283335",
+"h 	c #141A1C",
+"i 	c #627C82",
+"j 	c #14191A",
+"k 	c #77979E",
+"l 	c #ABD7E2",
+"m 	c #38474B",
+"n 	c #020202",
+"o 	c #0A0C0D",
+"p 	c #96BDC7",
+"q 	c #90B5BE",
+"r 	c #392718",
+"s 	c #252524",
+"t 	c #313D41",
+"u 	c #14191B",
+"v 	c #14191C",
+"w 	c #74929A",
+"x 	c #4A5D62",
+"y 	c #678289",
+"z 	c #9FC9D4",
+"A 	c #13120F",
+"B 	c #3E3C3C",
+"C 	c #283234",
+"D 	c #121718",
+"E 	c #94BAC4",
+"F 	c #020404",
+"G 	c #76959D",
+"H 	c #637E84",
+"I 	c #0A0907",
+"J 	c #6B6968",
+"K 	c #0C0C0C",
+"L 	c #171D1E",
+"M 	c #586E74",
+"N 	c #212A2C",
+"O 	c #3A4A4D",
+"P 	c #5B7379",
+"Q 	c #617A80",
+"R 	c #21292B",
+"S 	c #433F3B",
+"T 	c #192022",
+"U 	c #0F1213",
+"V 	c #222B2D",
+"W 	c #181F1F",
+"X 	c #313E41",
+"Y 	c #8CB0B9",
+"Z 	c #80A1A9",
+"` 	c #20282A",
+" .	c #2F2E2E",
+"..	c #415256",
+"+.	c #A5D0DA",
+"@.	c #111617",
+"#.	c #181E20",
+"$.	c #161C1E",
+"%.	c #080A0B",
+"&.	c #A1CBD5",
+"*.	c #6D8990",
+"=.	c #3E4F54",
+"-.	c #0F1313",
+";.	c #9FC8D2",
+">.	c #96BCC6",
+",.	c #6D8A91",
+"'.	c #3A484C",
+").	c #A0CAD4",
+"!.	c #4A5D61",
+"~.	c #13181A",
+"{.	c #7E9FA7",
+"].	c #3A4A4E",
+"^.	c #332316",
+"/.	c #4F6368",
+"(.	c #A9D5E0",
+"_.	c #1C2426",
+":.	c #080A0A",
+"<.	c #AAD6E0",
+"[.	c #374649",
+"}.	c #271B10",
+"|.	c #81A2AA",
+"1.	c #131312",
+"2.	c #5B7278",
+"3.	c #9AC1CA",
+"4.	c #0C0C0B",
+"5.	c #030304",
+"6.	c #93BAC3",
+"7.	c #0D1113",
+"8.	c #A7D2DD",
+"9.	c #1F282A",
+"0.	c #0E1112",
+"a.	c #6A868D",
+"b.	c #688289",
+"c.	c #20160E",
+"d.	c #090C0D",
+"e.	c #101415",
+"f.	c #261A10",
+"g.	c #171D1F",
+"h.	c #5D767C",
+"i.	c #0F0F0F",
+"j.	c #0B0E0E",
+"k.	c #9AC2CC",
+"l.	c #38464B",
+"m.	c #161616",
+"n.	c #2A3537",
+"o.	c #3F5054",
+"p.	c #31271E",
+"q.	c #020000",
+"r.	c #0D0F10",
+"s.	c #232C2F",
+"t.	c #85A7B0",
+"u.	c #1E2629",
+"v.	c #364447",
+"w.	c #81A3AB",
+"x.	c #0E0E0E",
+"y.	c #111516",
+"z.	c #383838",
+"A.	c #281E16",
+"B.	c #39474B",
+"C.	c #51676C",
+"D.	c #0B0E0F",
+"E.	c #010202",
+"F.	c #0D1011",
+"G.	c #161B1D",
+"H.	c #0A0A0A",
+"I.	c #040404",
+"J.	c #8FB4BD",
+"K.	c #374549",
+"L.	c #070808",
+"M.	c #0A0C0C",
+"N.	c #070A0A",
+"O.	c #3B4A4E",
+"P.	c #0D0D0D",
+"Q.	c #5F787E",
+"R.	c #6A858C",
+"S.	c #020303",
+"T.	c #0A0D0E",
+"                  . + @ # $                     ",
+"                % &       * =                   ",
+"                -           ; ;                 ",
+"              ; >             ;                 ",
+"                ,           ; ;                 ",
+"                ' ; ) ! ~ { ] ^ /               ",
+"              ( _ : < [ } | 1 2 3               ",
+"            4 5 6 7 8 9 0 a b c d e             ",
+"          f g h i j k l m n o p l q r           ",
+"          s t u d v w 9 9 x y 9 9 z A           ",
+"          B C D E F G 9 9 9 9 9 9 H I           ",
+"          J K L M N O P 9 9 9 9 Q R             ",
+"            S T U V W X Y 9 9 Z `               ",
+"             ...+. at .#.$.%.5 &.*.=.              ",
+"            -.;.>.o 5 ,.5   '.).!.              ",
+"          ~.{.9 ].^./.(._.  :.<.[.}.            ",
+"          ( 9 |.; 1.2.3.4.  5.(.6.K             ",
+"        7.| 8.9.  0.a.b.c.  d.;.9 e.            ",
+"      f.g.9 h.i.  j.k.l.    m.n.9 o.p.          ",
+"      q.k.1 r.    s.t.u.      v.9 w.x.          ",
+"    a R a.y.z.  A.B.C.D.      E.d (.F.          ",
+"      G. at .H.    I.J.K.L.      M.} 9 _.          ",
+"                N.O.D         P.Q.R.S.          ",
+"                  T.            a ; ;           "};

Modified: trunk/src/ChangeLog
===================================================================
--- trunk/src/ChangeLog	2008-01-23 23:06:15 UTC (rev 794)
+++ trunk/src/ChangeLog	2008-01-24 21:27:33 UTC (rev 795)
@@ -1,5 +1,21 @@
 2008-01-24  Marcus Brinkmann  <marcus at g10code.de>
 
+	* keyring.h: Add comment.
+	* keyring.c (keyring_editor_new): Put a shadow around the scrolled
+	window.
+	(struct _GPAKeyringEditor): Add status_label.
+	(keyring_statusbar_new): Set expand to false for all, and add 5
+	pixel padding around key ID, which is moved before the user
+	string.  Initialize status_label to empty string here.
+	(keyring_update_status_bar): Set status_label.
+	(toolbar_preferences): Bring back to life.
+	(keyring_toolbar_new): Reenable preferences.
+	* fileman.c (toolbar_preferences): Bring back to life.
+	(fileman_toolbar_new): Reenable preferences.  Add keyring to
+	toolbar.
+	* icons.c: Include keyringeditor.xpm.
+	(xpms): Add keyringeditor.
+
 	* gpa.h (gpa_get_keyring_editor, gpa_get_settings_dialog): Removed.
 	* gpa.c: Do not include gpapastrings.h, gpawindowkeeper.h,
 	gtktools.h, helpmenu.h, keytable.h, icons.h, errno.h, assert.h or

Modified: trunk/src/fileman.c
===================================================================
--- trunk/src/fileman.c	2008-01-23 23:06:15 UTC (rev 794)
+++ trunk/src/fileman.c	2008-01-24 21:27:33 UTC (rev 795)
@@ -574,14 +574,14 @@
   decrypt_files (param);
 }
 
-#if 0
+
 static void
 toolbar_preferences (GtkWidget *widget, gpointer param)
 {
   gpa_open_settings_dialog ();
 }
-#endif
 
+
 /* Construct the new toolbar object and return it.  Takes the file
    manage object.  */
 static GtkWidget *
@@ -645,10 +645,6 @@
       add_selection_sensitive_widget (fileman, item, has_selection);
     }
 
-#if 0
-  /* Disabled for now. The long label causes the toolbar to grow too much.
-   * See http://bugzilla.gnome.org/show_bug.cgi?id=75068
-   */
   gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
   
   gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar), 
@@ -657,8 +653,16 @@
                             _("preferences"),
                             GTK_SIGNAL_FUNC (toolbar_preferences),
                             fileman, -1);
-#endif
 
+  gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
+
+  icon = gpa_create_icon_widget (GTK_WIDGET (fileman), "keyringeditor");
+  item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Keyring"),
+                                  _("Open the Keyring Editor"),
+                                  _("keyring editor"), icon,
+				  GTK_SIGNAL_FUNC (gpa_open_keyring_editor),
+                                  NULL);
+
 #if 0  /* FIXME: Help is not available yet. :-( */
   /* Help */
   if ((icon = gpa_create_icon_widget (GTK_WIDGET (fileman), "help")))

Modified: trunk/src/icons.c
===================================================================
--- trunk/src/icons.c	2008-01-23 23:06:15 UTC (rev 794)
+++ trunk/src/icons.c	2008-01-24 21:27:33 UTC (rev 795)
@@ -1,25 +1,27 @@
 /* icons.c  - GPA icons
  * Copyright (C) 2000, 2001 OpenIT 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) 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 <gtk/gtk.h>
 #include <config.h>
 #include <stdio.h>
@@ -43,6 +45,7 @@
 #include "help.xpm"
 #include "import.xpm"
 #include "keyring.xpm"
+#include "keyringeditor.xpm"
 #include "openfile.xpm"
 #include "sign.xpm"
 #include "wizard_backup.xpm"
@@ -60,6 +63,7 @@
   {"sign",	sign_xpm  },
   {"verify",    verify_xpm },
   {"keyring",	keyring_xpm  },
+  {"keyringeditor",	keyringeditor_xpm  },
   {"gpa_blue_key",	gpa_blue_key_xpm},
   {"gpa_yellow_key",	gpa_yellow_key_xpm},
   {"blue_key",	blue_key_xpm},
@@ -79,7 +83,7 @@
 
 
 static GdkPixmap *
-pixmap_for_icon ( GtkWidget *window, const char *name, GdkBitmap **r_mask )
+pixmap_for_icon (GtkWidget *window, const char *name, GdkBitmap **r_mask)
 {
     GtkStyle  *style;
     GdkPixmap *pix;
@@ -87,16 +91,16 @@
     int i;
     
 
-    for ( i=0; xpms[i].name ; i++ )
-      if ( !strcmp ( xpms[i].name, name ) )
+    for (i = 0; xpms[i].name; i++)
+      if (! strcmp (xpms[i].name, name))
         {
           xpm = xpms[i].xpm;
           break;
         }
     
-    if ( !xpm )
+    if (! xpm)
       {
-        fprintf (stderr, "Icon `%s' not found\n", name );
+        fprintf (stderr, "Icon `%s' not found\n", name);
 	fflush (stderr);
         return NULL;
       }
@@ -109,43 +113,46 @@
     return pix;
 }
 
+
 GtkWidget *
-gpa_create_icon_widget ( GtkWidget *window, const char *name )
+gpa_create_icon_widget (GtkWidget *window, const char *name)
 {
     GdkBitmap *mask;
     GtkWidget *icon = NULL;
     GdkPixmap *pix;
 
-    pix = pixmap_for_icon ( window, name, &mask );
-    if ( pix )
-        icon = gtk_pixmap_new(pix, mask);
+    pix = pixmap_for_icon (window, name, &mask);
+    if (pix)
+      icon = gtk_pixmap_new (pix, mask);
     return icon;
 }
 
+
 GdkPixmap *
-gpa_create_icon_pixmap ( GtkWidget *window, const char *name, GdkBitmap **mask )
+gpa_create_icon_pixmap (GtkWidget *window, const char *name, GdkBitmap **mask)
 {
-  return pixmap_for_icon ( window, name, mask );
+  return pixmap_for_icon (window, name, mask);
 }
 
+
 GdkPixbuf *
 gpa_create_icon_pixbuf (const char *name)
 {
   char **xpm = NULL;
   int i; 
   
-  for ( i=0; xpms[i].name ; i++ )
-    if ( !strcmp ( xpms[i].name, name ) )
+  for (i = 0; xpms[i].name; i++)
+    if (! strcmp (xpms[i].name, name))
       {
 	xpm = xpms[i].xpm;
 	break;
       }
   
-  if ( !xpm )
+  if (! xpm)
     {
-      fprintf (stderr, "Icon `%s' not found\n", name );
-	fflush (stderr);
-        return NULL;
+      fprintf (stderr, "Icon `%s' not found\n", name);
+      fflush (stderr);
+      return NULL;
     }
 
   return gdk_pixbuf_new_from_xpm_data ((const char**) xpm);

Modified: trunk/src/icons.h
===================================================================
--- trunk/src/icons.h	2008-01-23 23:06:15 UTC (rev 794)
+++ trunk/src/icons.h	2008-01-24 21:27:33 UTC (rev 795)
@@ -1,30 +1,31 @@
 /* icons.h  -  Icons for GPA
- *	Copyright (C) 2000 G-N-U 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) 2000 G-N-U GmbH.
+   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.,
+   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.  */
+
 #ifndef ICONS_H
 #define ICONS_H
 
+GtkWidget *gpa_create_icon_widget (GtkWidget *window, const char *name);
 
-GtkWidget *gpa_create_icon_widget (GtkWidget *window, const char *name );
 GdkPixmap *gpa_create_icon_pixmap (GtkWidget *window, const char *name,
-                                   GdkBitmap **mask );
+                                   GdkBitmap **mask);
+
 GdkPixbuf *gpa_create_icon_pixbuf (const char *name);
      
 #endif /*ICONS_H*/

Modified: trunk/src/keyring.c
===================================================================
--- trunk/src/keyring.c	2008-01-23 23:06:15 UTC (rev 794)
+++ trunk/src/keyring.c	2008-01-24 21:27:33 UTC (rev 795)
@@ -1,31 +1,36 @@
 /* keyring.c - The GNU Privacy Assistant keyring.
    Copyright (C) 2000, 2001 G-N-U GmbH.
-   Copyright (C) 2005 g10 Code GmbH.
+   Copyright (C) 2005, 2008 g10 Code GmbH.
 
-   This file is part of GPA
+   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
+   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
+   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 GPA; if not, write to the Free Software Foundation,
-   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA  */
+   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.  */
 
-#include <config.h>
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
 
-#include <gpgme.h>
-#include <gtk/gtk.h>
-#include <gdk/gdkkeysyms.h>
 #include <stdlib.h>
 #include <string.h>
 #include <errno.h>
+
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+
+#include <gpgme.h>
+
 #include "gpa.h"
 #include "gtktools.h"
 #include "icons.h"
@@ -122,6 +127,7 @@
   GtkWidget *subkeys_page;
   
   /* Labels in the status bar */
+  GtkWidget *status_label;
   GtkWidget *status_key_user;
   GtkWidget *status_key_id;
 
@@ -1517,14 +1523,14 @@
   keyring_editor_import (param);
 }
 
-#if 0
+
 static void
 toolbar_preferences (GtkWidget *widget, gpointer param)
 {
   gpa_open_settings_dialog ();
 }
-#endif
 
+
 static void
 toolbar_refresh (GtkWidget *widget, gpointer param)
 {
@@ -1621,10 +1627,6 @@
    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (item), TRUE);
    gtk_signal_handler_unblock_by_data (GTK_OBJECT (item), editor);
  
-#if 0
-  /* Disabled for now. The long label causes the toolbar to grow too much.
-   * See http://bugzilla.gnome.org/show_bug.cgi?id=75086
-   */
   gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
 
   item = gtk_toolbar_insert_stock (GTK_TOOLBAR (toolbar), 
@@ -1633,7 +1635,6 @@
                                    _("preferences"),
                                    GTK_SIGNAL_FUNC (toolbar_preferences),
                                    editor, -1);
-#endif
 
   gtk_toolbar_append_space (GTK_TOOLBAR (toolbar));
 
@@ -1648,7 +1649,8 @@
   icon = gpa_create_icon_widget (window, "openfile");
   item = gtk_toolbar_append_item (GTK_TOOLBAR (toolbar), _("Files"),
                                   _("Open the File Manager"),
-                                  _("file manager"), icon, GTK_SIGNAL_FUNC (gpa_open_filemanager),
+                                  _("file manager"), icon,
+				  GTK_SIGNAL_FUNC (gpa_open_filemanager),
                                   NULL);
 
 #if 0  /* Help is not available yet. :-( */
@@ -1660,9 +1662,11 @@
 #endif
 
   return toolbar;
-} /* keyring_toolbar_new */
+}
 
 
+
+/* Status bar handling.  */
 static GtkWidget *
 keyring_statusbar_new (GPAKeyringEditor *editor)
 {
@@ -1671,31 +1675,35 @@
 
   hbox = gtk_hbox_new (FALSE, 0);
 
-  label = gtk_label_new (_("Selected Default Key:"));
-  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
+  label = gtk_label_new ("");
+  editor->status_label = label;
+  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
 
   label = gtk_label_new ("");
+  editor->status_key_id = label;
+  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 5);
+
+  label = gtk_label_new ("");
   editor->status_key_user = label;
-  gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
+  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
   
-  label = gtk_label_new ("");
-  editor->status_key_id = label;
-  gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0);
-
   return hbox;
-} /* keyring_statusbar_new */
+}
 
 
-/* Update the status bar */
+/* Update the status bar.  */
 static void
-keyring_update_status_bar (GPAKeyringEditor * editor)
+keyring_update_status_bar (GPAKeyringEditor *editor)
 {
   gpgme_key_t key = gpa_options_get_default_key (gpa_options_get_instance ());
 
   if (key)
     {
-      gchar *string = gpa_gpgme_key_get_userid (key->uids);
+      gchar *string;
 
+      gtk_label_set_text (GTK_LABEL (editor->status_label),
+			  _("Selected default key:"));
+      string = gpa_gpgme_key_get_userid (key->uids);
       gtk_label_set_text (GTK_LABEL (editor->status_key_user), string);
       g_free (string);
       gtk_label_set_text (GTK_LABEL (editor->status_key_id),
@@ -1703,11 +1711,14 @@
     }
   else
     {
+      gtk_label_set_text (GTK_LABEL (editor->status_label),
+			  _("No default key selected in the preferences."));
       gtk_label_set_text (GTK_LABEL (editor->status_key_user), "");
       gtk_label_set_text (GTK_LABEL (editor->status_key_id), "");
     }     
 }
 
+
 static gint
 display_popup_menu (GPAKeyringEditor *editor, GdkEvent *event, 
 		    GpaKeyList *list)
@@ -1718,9 +1729,8 @@
   g_return_val_if_fail (editor != NULL, FALSE);
   g_return_val_if_fail (event != NULL, FALSE);
   
-  /* The "widget" is the menu that was supplied when 
-   * g_signal_connect_swapped() was called.
-   */
+  /* The "widget" is the menu that was supplied when
+     g_signal_connect_swapped() was called.  */
   menu = GTK_MENU (editor->popup_menu);
   
   if (event->type == GDK_BUTTON_PRESS)
@@ -1732,7 +1742,7 @@
 	    gtk_tree_view_get_selection (GTK_TREE_VIEW (list));
 	  GtkTreePath *path;
 	  GtkTreeIter iter;
-          /* Make sure the clicked key is selected */
+          /* Make sure the clicked key is selected.  */
 	  if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (list), 
 					     event_button->x,
 					     event_button->y, 
@@ -1741,9 +1751,9 @@
 	    {
 	      gtk_tree_model_get_iter (gtk_tree_view_get_model 
 				       (GTK_TREE_VIEW(list)), &iter, path);
-	      if (!gtk_tree_selection_iter_is_selected (selection, &iter))
+	      if (! gtk_tree_selection_iter_is_selected (selection, &iter))
 		{
-		  /* Block selection updates */
+		  /* Block selection updates.  */
 		  editor->freeze_selection++;
 		  gtk_tree_selection_unselect_all (selection);
 		  editor->freeze_selection--;
@@ -1759,38 +1769,37 @@
   return FALSE;
 }
 
-/* signal handler for the "changed_default_key" signal. Update the
- * status bar and the selection sensitive widgets because some depend on
- * the default key */
+
+/* Signal handler for the "changed_default_key" signal.  */
 static void
 keyring_default_key_changed (GpaOptions *options, gpointer param)
 {
   GPAKeyringEditor * editor = param;
 
   keyring_update_status_bar (editor);  
+
+  /* Update the status bar and the selection sensitive widgets because
+   some depend on the default key.  */
   update_selection_sensitive_widgets (editor);
 }
 
-/* signal handler for the "changed_ui_mode" signal. Disable the subkeys
- * page in the details notebook.
- */
+
+/* Signal handler for the "changed_ui_mode" signal.  */
 static void
 keyring_ui_mode_changed (GpaOptions *options, gpointer param)
 {
   GPAKeyringEditor * editor = param;
 
-  if (!gpa_options_get_simplified_ui (gpa_options_get_instance ()))
-    {
-      keyring_editor_add_subkeys_page (editor);
-    }
+  /* Toggles the subkeys page in the details notebook.  */
+  if (! gpa_options_get_simplified_ui (gpa_options_get_instance ()))
+    keyring_editor_add_subkeys_page (editor);
   else
-    {
-      keyring_editor_remove_subkeys_page (editor);
-    }
+    keyring_editor_remove_subkeys_page (editor);
 }
 
 
-/* Create and return a new key ring editor window */
+/* Create and return a new keyring editor dialog.  The dialog is
+   hidden by default.  */
 GtkWidget *
 keyring_editor_new (void)
 {
@@ -1811,7 +1820,7 @@
 
   gchar *markup;
 
-  editor = g_malloc(sizeof(GPAKeyringEditor));
+  editor = g_malloc (sizeof (GPAKeyringEditor));
   editor->selection_sensitive_widgets = NULL;
   editor->details_idle_id = 0;
 
@@ -1825,8 +1834,8 @@
   gtk_window_add_accel_group (GTK_WINDOW (window), accel_group);
   gtk_signal_connect_object (GTK_OBJECT (window), "map",
                              GTK_SIGNAL_FUNC (keyring_editor_mapped),
-                             (gpointer)editor);
-  /* Realize the window so that we can create pixmaps without warnings */
+                             (gpointer) editor);
+  /* Realize the window so that we can create pixmaps without warnings.  */
   gtk_widget_realize (window);
 
   vbox = gtk_vbox_new (FALSE, 0);
@@ -1836,10 +1845,11 @@
                       keyring_editor_menubar_new (window, editor),
                       FALSE, TRUE, 0);
 
-  toolbar = keyring_toolbar_new(window, editor);
+  toolbar = keyring_toolbar_new (window, editor);
   gtk_box_pack_start (GTK_BOX (vbox), toolbar, FALSE, TRUE, 0);
 
 
+  /* Add a fancy label that tells us: This is the keyring editor.  */
   hbox = gtk_hbox_new (FALSE, 0);
   gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);
   
@@ -1864,17 +1874,15 @@
   gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled),
                                   GTK_POLICY_AUTOMATIC,
                                   GTK_POLICY_AUTOMATIC);
-
+  /* FIXME: Which shadow type?  */
+  gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled),
+				       GTK_SHADOW_IN);
   keylist = gpa_keylist_new (window);
   editor->keylist = GPA_KEYLIST (keylist);
   if (gpa_options_get_detailed_view (gpa_options_get_instance()))
-    {
-      gpa_keylist_set_detailed (editor->keylist);
-    }
+    gpa_keylist_set_detailed (editor->keylist);
   else
-    {
-      gpa_keylist_set_brief (editor->keylist);
-    }
+    gpa_keylist_set_brief (editor->keylist);
 
   gtk_container_add (GTK_CONTAINER (scrolled), keylist);
 
@@ -1895,10 +1903,10 @@
   gtk_box_pack_start (GTK_BOX (vbox), statusbar, FALSE, TRUE, 0);
   g_signal_connect (G_OBJECT (gpa_options_get_instance ()),
 		    "changed_default_key",
-                    (GCallback)keyring_default_key_changed, editor);
+                    (GCallback) keyring_default_key_changed, editor);
   g_signal_connect (G_OBJECT (gpa_options_get_instance ()),
 		    "changed_ui_mode",
-                    (GCallback)keyring_ui_mode_changed, editor);
+                    (GCallback) keyring_ui_mode_changed, editor);
 
   keyring_update_status_bar (editor);
   update_selection_sensitive_widgets (editor);
@@ -1912,5 +1920,4 @@
 		    G_CALLBACK (keyring_editor_key_listed), editor);
 
   return window;
-} /* keyring_editor_new */
-
+}

Modified: trunk/src/keyring.h
===================================================================
--- trunk/src/keyring.h	2008-01-23 23:06:15 UTC (rev 794)
+++ trunk/src/keyring.h	2008-01-24 21:27:33 UTC (rev 795)
@@ -1,26 +1,28 @@
 /* keyring.h  -  The GNU Privacy Assistant
- *      Copyright (C) 2000 G-N-U 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) 2000 G-N-U GmbH.
+   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.,
+   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.  */
+
 #ifndef KEYRINGEDITOR_H
 #define KEYRINGEDITOR_H
 
-GtkWidget * keyring_editor_new (void);
+/* Create and return a new keyring editor dialog.  The dialog is
+   hidden by default.  */
+GtkWidget *keyring_editor_new (void);
 
 #endif /* KEYRINGEDITOR_H */



More information about the Gpa-commits mailing list