2005-12-09 [paul] 1.9.100cvs81
authorPaul Mangan <paul@claws-mail.org>
Fri, 9 Dec 2005 14:31:58 +0000 (14:31 +0000)
committerPaul Mangan <paul@claws-mail.org>
Fri, 9 Dec 2005 14:31:58 +0000 (14:31 +0000)
* po/POTFILES.in
* src/mainwindow.c
* src/gtk/Makefile.am
* src/gtk/icon_legend.c
* src/gtk/icon_legend.h
add icon legend
* src/manual.c
cleanup

ChangeLog
PATCHSETS
configure.ac
po/POTFILES.in
src/gtk/Makefile.am
src/gtk/icon_legend.c [new file with mode: 0644]
src/gtk/icon_legend.h [new file with mode: 0644]
src/mainwindow.c
src/manual.c

index af9f1f5682fc1e57b7f82b625b467961cb99f0fc..b07e16e630bb5bd7046bad2c3e826de0c2ecf4d5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2005-12-09 [paul]      1.9.100cvs81
+
+       * po/POTFILES.in
+       * src/mainwindow.c
+       * src/gtk/Makefile.am
+       * src/gtk/icon_legend.c
+       * src/gtk/icon_legend.h
+               add icon legend
+       * src/manual.c
+               cleanup
+
 2005-12-09 [paul]      1.9.100cvs80
 
        * src/plugins/pgpcore/passphrase.c
 2005-12-09 [paul]      1.9.100cvs80
 
        * src/plugins/pgpcore/passphrase.c
index 124777ac427cab46def5401f438356bb5ea9099e..a58e9d68dd9e7031f9f5cc5aeb6902060376a91f 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.13.2.9 -r 1.13.2.10 src/common/plugin.c;  ) > 1.9.100cvs78.patchset
 ( cvs diff -u -r 1.1.2.13 -r 1.1.2.14 src/plugins/pgpcore/sgpgme.c;  ) > 1.9.100cvs79.patchset
 ( cvs diff -u -r 1.1.2.7 -r 1.1.2.8 src/plugins/pgpcore/passphrase.c;  ) > 1.9.100cvs80.patchset
 ( cvs diff -u -r 1.13.2.9 -r 1.13.2.10 src/common/plugin.c;  ) > 1.9.100cvs78.patchset
 ( cvs diff -u -r 1.1.2.13 -r 1.1.2.14 src/plugins/pgpcore/sgpgme.c;  ) > 1.9.100cvs79.patchset
 ( cvs diff -u -r 1.1.2.7 -r 1.1.2.8 src/plugins/pgpcore/passphrase.c;  ) > 1.9.100cvs80.patchset
+( cvs diff -u -r 1.53.2.15 -r 1.53.2.16 po/POTFILES.in;  cvs diff -u -r 1.274.2.80 -r 1.274.2.81 src/mainwindow.c;  cvs diff -u -r 1.11.2.4 -r 1.11.2.5 src/manual.c;  cvs diff -u -r 1.20.2.6 -r 1.20.2.7 src/gtk/Makefile.am;  diff -u /dev/null src/gtk/icon_legend.c;  diff -u /dev/null src/gtk/icon_legend.h;  ) > 1.9.100cvs81.patchset
index 4fc80e21e9403290d81e5539620776d46a20a63f..48c22f0faf9d4e40bb2fccba347555f5651b0dbf 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=100
 INTERFACE_AGE=0
 BINARY_AGE=0
 MICRO_VERSION=100
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=80
+EXTRA_VERSION=81
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index eeddcd88bab77fcdf3fcd64817a2546c40502365..7520fad57e7ed054ba4225c348b41921e65c86d7 100644 (file)
@@ -40,6 +40,7 @@ src/gtk/foldersort.c
 src/gtk/gtksourceprintjob.c
 src/gtk/gtkaspell.c
 src/gtk/gtkutils.c
 src/gtk/gtksourceprintjob.c
 src/gtk/gtkaspell.c
 src/gtk/gtkutils.c
+src/gtk/icon_legend.c
 src/gtk/inputdialog.c
 src/gtk/logwindow.c
 src/gtk/pluginwindow.c
 src/gtk/inputdialog.c
 src/gtk/logwindow.c
 src/gtk/pluginwindow.c
index 504897fb0d8b7635da4e169e1ed3f1bfb43646f9..319e0ab171ccaf8220f25ef4470cfe00d677bad9 100644 (file)
@@ -20,8 +20,9 @@ libsylpheedgtk_la_SOURCES = \
        gtksourceprintjob.c \
        gtkutils.c \
        gtkvscrollbutton.c \
        gtksourceprintjob.c \
        gtkutils.c \
        gtkvscrollbutton.c \
-       logwindow.c \
+       icon_legend.c \
        inputdialog.c \
        inputdialog.c \
+       logwindow.c \
        manage_window.c \
        menu.c \
        pluginwindow.c \
        manage_window.c \
        menu.c \
        pluginwindow.c \
@@ -46,6 +47,7 @@ sylpheedgtkinclude_HEADERS = \
        gtksourceprintjob.h \
        gtkutils.h \
        gtkvscrollbutton.h \
        gtksourceprintjob.h \
        gtkutils.h \
        gtkvscrollbutton.h \
+       icon_legend.h \
        inputdialog.h \
        logwindow.h \
        manage_window.h \
        inputdialog.h \
        logwindow.h \
        manage_window.h \
diff --git a/src/gtk/icon_legend.c b/src/gtk/icon_legend.c
new file mode 100644 (file)
index 0000000..472cde1
--- /dev/null
@@ -0,0 +1,163 @@
+/*
+ * This file Copyright (C) 2005 Paul Mangan <claws@thewildbeast.co.uk>
+ * and the Sylpheed-Claws team
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 "defs.h"
+
+#include <glib.h>
+#include <glib/gi18n.h>
+#include <gtk/gtk.h>
+#include <gdk/gdkkeysyms.h>
+#include <gtk/gtkwidget.h>
+#include <gtk/gtkwindow.h>
+#include <gtk/gtksignal.h>
+#include <gtk/gtkvbox.h>
+#include <gtk/gtkhbox.h>
+#include <gtk/gtklabel.h>
+
+#include "gtkutils.h"
+#include "stock_pixmap.h"
+#include "prefs_gtk.h"
+
+#define ICONS 12
+
+StockPixmap legend_icons[ICONS] = {
+       STOCK_PIXMAP_NEW,
+       STOCK_PIXMAP_UNREAD,
+       STOCK_PIXMAP_REPLIED, 
+       STOCK_PIXMAP_FORWARDED, 
+       STOCK_PIXMAP_CLIP,
+       STOCK_PIXMAP_GPG_SIGNED,
+       STOCK_PIXMAP_KEY,
+       STOCK_PIXMAP_CLIP_GPG_SIGNED,
+       STOCK_PIXMAP_CLIP_KEY,
+       STOCK_PIXMAP_MARK,
+       STOCK_PIXMAP_LOCKED,
+       STOCK_PIXMAP_IGNORETHREAD,
+};
+
+static gchar *legend_icon_desc[] = {
+       N_("New"),
+       N_("Unread"),
+       N_("Has been replied to"),
+       N_("Has been forwarded"),
+       N_("Has attachment(s)"),
+       N_("Digitally signed"),
+       N_("Encrypted"),
+       N_("Signed and has attachment(s)"),
+       N_("Encrypted and has attachment(s)"),
+       N_("Marked"),
+       N_("Locked"),
+       N_("In an ignored thread"),
+};
+
+static struct LegendDialog {
+       GtkWidget *window;
+} legend;
+
+static void legend_create(void);
+static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event);
+static void legend_close(void);
+
+void legend_show(void)
+{
+       if (!legend.window)
+               legend_create();
+       else
+               gtk_window_present(GTK_WINDOW(legend.window));
+}
+
+static void legend_create(void)
+{
+       GtkWidget *window;
+       GtkWidget *vbox;
+       GtkWidget *confirm_area;
+       GtkWidget *close_button;
+       GtkWidget *hbox;
+       GtkWidget *label;
+       GtkWidget *icon_label;
+       GtkWidget *desc_label;
+       gint i;
+
+       window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+       gtk_window_set_title(GTK_WINDOW(window), _("Icon Legend"));
+       gtk_container_set_border_width(GTK_CONTAINER(window), 8);
+       gtk_window_set_resizable(GTK_WINDOW(window), FALSE);
+       gtk_widget_set_size_request(window, -1, -1);
+       g_signal_connect(G_OBJECT(window), "delete_event",
+                        G_CALLBACK(legend_close), NULL);
+       g_signal_connect(G_OBJECT(window), "key_press_event",
+                        G_CALLBACK(key_pressed), NULL);
+       gtk_widget_realize(window);
+
+       vbox = gtk_vbox_new(FALSE, 8);
+       gtk_container_add(GTK_CONTAINER(window), vbox);
+       gtk_container_set_border_width(GTK_CONTAINER(vbox), 2);
+
+       hbox = gtk_hbox_new(FALSE, 8);
+       gtk_widget_show(hbox);
+       gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+
+       label = gtk_label_new(_("<span weight=\"bold\">The following icons are used to show the status of a message:</span>"));
+       gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
+       gtk_label_set_line_wrap(GTK_LABEL(label), TRUE);
+       gtk_widget_show(label);
+       gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
+
+       for (i = 0; i < ICONS; ++i) {
+               icon_label = stock_pixmap_widget(window, legend_icons[i]);
+               desc_label = gtk_label_new(gettext(legend_icon_desc[i]));
+               gtk_label_set_line_wrap(GTK_LABEL(desc_label), TRUE);
+
+               hbox = gtk_hbox_new(FALSE, 4);
+               gtk_widget_show(hbox);
+               gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+               gtk_box_pack_start(GTK_BOX(hbox), icon_label, FALSE, FALSE, 0);
+               gtk_box_pack_start(GTK_BOX(hbox), desc_label, FALSE, FALSE, 0);
+       }       
+
+       gtkut_stock_button_set_create(&confirm_area, &close_button, GTK_STOCK_CLOSE,
+                                     NULL, NULL, NULL, NULL);
+       gtk_box_pack_end(GTK_BOX(vbox), confirm_area, FALSE, FALSE, 4);
+       gtk_widget_grab_default(close_button);
+       g_signal_connect_closure
+               (G_OBJECT(close_button), "clicked",
+                g_cclosure_new_swap(G_CALLBACK(legend_close),
+                                    window, NULL), FALSE);
+
+       gtk_widget_show_all(window);
+
+       legend.window = window;
+}
+
+static gboolean key_pressed(GtkWidget *widget, GdkEventKey *event)
+{
+       if (event && event->keyval == GDK_Escape)
+               gtk_widget_destroy(legend.window);
+       return FALSE;
+}
+
+static void legend_close(void)
+{
+       gtk_widget_destroy(legend.window);
+       legend.window = NULL;
+}
diff --git a/src/gtk/icon_legend.h b/src/gtk/icon_legend.h
new file mode 100644 (file)
index 0000000..cf1d3a6
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+ * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
+ * This file Copyright (C) 2005 Paul Mangan <claws@thewildbeast.co.uk>
+ * and the Sylpheed-Claws team
+ *
+ * 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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 __ICON_LEGEND_H__
+#define __ICON_LEGEND_H__
+
+void legend_show       (void);
+
+#endif /* __ICON_LEGEND_H__ */
index acdfd9e1e5b4046221bf80a66eb7b386078a54f1..0709294a7eaa506b117a409a67a112049ce2bfc7 100644 (file)
@@ -91,6 +91,7 @@
 #include "filtering.h"
 #include "folderutils.h"
 #include "foldersort.h"
 #include "filtering.h"
 #include "folderutils.h"
 #include "foldersort.h"
+#include "icon_legend.h"
 
 #define AC_LABEL_WIDTH 240
 
 
 #define AC_LABEL_WIDTH 240
 
@@ -415,6 +416,9 @@ static void manual_open_cb   (MainWindow    *mainwin,
                                  guint          action,
                                  GtkWidget     *widget);
 
                                  guint          action,
                                  GtkWidget     *widget);
 
+static void legend_open_cb      (GtkMenuItem   *menuitem,
+                                 gpointer       data);
+
 static void scan_tree_func      (Folder        *folder,
                                  FolderItem    *item,
                                  gpointer       data);
 static void scan_tree_func      (Folder        *folder,
                                  FolderItem    *item,
                                  gpointer       data);
@@ -795,6 +799,7 @@ static GtkItemFactoryEntry mainwin_entries[] =
 #endif
        {N_("/_Help/_Online User-contributed FAQ"),     
                                                NULL, manual_open_cb, MANUAL_FAQ_CLAWS, NULL},
 #endif
        {N_("/_Help/_Online User-contributed FAQ"),     
                                                NULL, manual_open_cb, MANUAL_FAQ_CLAWS, NULL},
+       {N_("/_Help/Icon _Legend"),             NULL, legend_open_cb, 0, NULL},
        {N_("/_Help/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_Help/_About"),                   NULL, about_show, 0, NULL}
 };
        {N_("/_Help/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_Help/_About"),                   NULL, about_show, 0, NULL}
 };
@@ -3167,6 +3172,11 @@ static void manual_open_cb(MainWindow *mainwin, guint action,
        manual_open((ManualType)action);
 }
 
        manual_open((ManualType)action);
 }
 
+static void legend_open_cb(GtkMenuItem *menuitem, gpointer data)
+{
+       legend_show();
+}
+
 static void scan_tree_func(Folder *folder, FolderItem *item, gpointer data)
 {
        MainWindow *mainwin = (MainWindow *)data;
 static void scan_tree_func(Folder *folder, FolderItem *item, gpointer data)
 {
        MainWindow *mainwin = (MainWindow *)data;
index 62e3529ecb68b811e18e7f874489e0cd3b80e0e2..08d036c3b530fcdd00e6416b70d0c57660a24bfb 100644 (file)
@@ -94,7 +94,6 @@ void manual_open(ManualType type)
 {
        gchar *uri = NULL;
        gchar *dir;
 {
        gchar *uri = NULL;
        gchar *dir;
-       gchar *lang_str;
 
        switch (type) {
                case MANUAL_MANUAL_LOCAL:
 
        switch (type) {
                case MANUAL_MANUAL_LOCAL: