Specialize alertpanel icons
authorColin Leroy <colin@colino.net>
Tue, 27 Jul 2004 08:52:20 +0000 (08:52 +0000)
committerColin Leroy <colin@colino.net>
Tue, 27 Jul 2004 08:52:20 +0000 (08:52 +0000)
Fix mimeview width of the icons

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/alertpanel.c
src/alertpanel.h
src/message_search.c
src/mimeview.c
src/sgpgme.c
src/summary_search.c

index 4eb9276e77bc9678f67c84c97fe47997710ece06..243228190bb8c0506ea4d681dc1bdff606286194 100644 (file)
@@ -1,3 +1,16 @@
+2004-07-27 [colin]     0.9.12cvs35.2
+
+       * src/mimeview.c
+               Fix width a bit (by Paul)
+       * src/alertpanel.c
+       * src/alertpanel.h
+               Specialize icons, make alertpanel_message()
+               private
+       * src/message_search.c
+       * src/sgpgme.c
+       * src/summary_search.c
+               Suit alertpanel changes
+
 2004-07-27 [colin]     0.9.12cvs35.1
 
        * src/alertpanel.c
 2004-07-27 [colin]     0.9.12cvs35.1
 
        * src/alertpanel.c
index 5911a0071a35902789933577f98e34a82fe5b8a3..1e4e918ab198c9c04781abb1837ebe1100d09023 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
@@ -81,3 +81,4 @@
 ( cvs diff -u -r 1.5.2.8 -r 1.5.2.9 src/gtk/menu.c; cvs diff -u -r 1.274.2.12 -r 1.274.2.13 src/mainwindow.c; ) > 0.9.12cvs33.25.patchset
 ( cvs diff -u -r 1.56.2.20 -r 1.56.2.21 src/pop.c; ) > 0.9.12cvs33.26.patchset
 ( cvs diff -u -r 1.17.2.3 -r 1.17.2.4 src/alertpanel.c; cvs diff -u -r 1.12.2.2 -r 1.12.2.3 src/passphrase.c; ) > 0.9.12cvs35.1.patchset
 ( cvs diff -u -r 1.5.2.8 -r 1.5.2.9 src/gtk/menu.c; cvs diff -u -r 1.274.2.12 -r 1.274.2.13 src/mainwindow.c; ) > 0.9.12cvs33.25.patchset
 ( cvs diff -u -r 1.56.2.20 -r 1.56.2.21 src/pop.c; ) > 0.9.12cvs33.26.patchset
 ( cvs diff -u -r 1.17.2.3 -r 1.17.2.4 src/alertpanel.c; cvs diff -u -r 1.12.2.2 -r 1.12.2.3 src/passphrase.c; ) > 0.9.12cvs35.1.patchset
+( cvs diff -u -r 1.17.2.4 -r 1.17.2.5 src/alertpanel.c; cvs diff -u -r 1.5 -r 1.6 src/alertpanel.h; cvs diff -u -r 1.3.12.2 -r 1.3.12.3 src/message_search.c; cvs diff -u -r 1.83.2.13 -r 1.83.2.14 src/mimeview.c; cvs diff -u -r 1.12.2.3 -r 1.12.2.4 src/sgpgme.c; cvs diff -u -r 1.15.2.4 -r 1.15.2.5 src/summary_search.c; ) > 0.9.12cvs35.2.patchset
index 08aeb14b00815e74adffeedbf9483d2f782a69fa..49367fc2a59770922556a3baeb0f4acf48e94a37 100644 (file)
@@ -13,7 +13,7 @@ INTERFACE_AGE=0
 BINARY_AGE=0
 EXTRA_VERSION=35
 EXTRA_RELEASE=
 BINARY_AGE=0
 EXTRA_VERSION=35
 EXTRA_RELEASE=
-EXTRA_GTK2_VERSION=.1
+EXTRA_GTK2_VERSION=.2
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}${EXTRA_RELEASE}${EXTRA_GTK2_VERSION}
 
 if test \( $EXTRA_VERSION -eq 0 \) -o \( "x$EXTRA_RELEASE" != "x" \); then
     VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}${EXTRA_RELEASE}${EXTRA_GTK2_VERSION}
index 163e0c2489113cf73400f0c4bf58afe430394235..081073a9ed3185cc3a73e8f2d8420d2e58a2eff6 100644 (file)
@@ -53,7 +53,8 @@ static void alertpanel_create         (const gchar    *title,
                                         const gchar    *button2_label,
                                         const gchar    *button3_label,
                                         gboolean        can_disable,
                                         const gchar    *button2_label,
                                         const gchar    *button3_label,
                                         gboolean        can_disable,
-                                        GtkWidget      *custom_widget);
+                                        GtkWidget      *custom_widget,
+                                        gint            alert_type);
 
 static void alertpanel_button_toggled  (GtkToggleButton        *button,
                                         gpointer                data);
 
 static void alertpanel_button_toggled  (GtkToggleButton        *button,
                                         gpointer                data);
@@ -78,7 +79,7 @@ AlertValue alertpanel(const gchar *title,
                alertpanel_is_open = TRUE;
 
        alertpanel_create(title, message, button1_label, button2_label,
                alertpanel_is_open = TRUE;
 
        alertpanel_create(title, message, button1_label, button2_label,
-                         button3_label, FALSE, NULL);
+                         button3_label, FALSE, NULL, ALERT_QUESTION);
        alertpanel_show();
 
        debug_print("return value = %d\n", value);
        alertpanel_show();
 
        debug_print("return value = %d\n", value);
@@ -97,32 +98,35 @@ AlertValue alertpanel_with_widget(const gchar *title,
        else
                alertpanel_is_open = TRUE;
        alertpanel_create(title, message, button1_label, button2_label, 
        else
                alertpanel_is_open = TRUE;
        alertpanel_create(title, message, button1_label, button2_label, 
-                         button3_label, FALSE, widget);
+                         button3_label, FALSE, widget, ALERT_QUESTION);
        alertpanel_show();
 
        debug_print("return value = %d\n", value);
        return value;
 }
        alertpanel_show();
 
        debug_print("return value = %d\n", value);
        return value;
 }
-void alertpanel_message(const gchar *title, const gchar *message)
+
+static void alertpanel_message(const gchar *title, const gchar *message, gint type)
 {
        if (alertpanel_is_open)
                return;
        else
                alertpanel_is_open = TRUE;
 
 {
        if (alertpanel_is_open)
                return;
        else
                alertpanel_is_open = TRUE;
 
-       alertpanel_create(title, message, NULL, NULL, NULL, FALSE, NULL);
+       alertpanel_create(title, message, NULL, NULL, NULL, FALSE, NULL, type);
        alertpanel_show();
 }
 
 AlertValue alertpanel_message_with_disable(const gchar *title,
        alertpanel_show();
 }
 
 AlertValue alertpanel_message_with_disable(const gchar *title,
-                                          const gchar *message)
+                                          const gchar *message,
+                                          gint alert_type)
 {
        if (alertpanel_is_open)
                return 0;
        else
                alertpanel_is_open = TRUE;
 
 {
        if (alertpanel_is_open)
                return 0;
        else
                alertpanel_is_open = TRUE;
 
-       alertpanel_create(title, message, NULL, NULL, NULL, TRUE, NULL);
+       alertpanel_create(title, message, NULL, NULL, NULL, TRUE, NULL,
+                         alert_type);
        alertpanel_show();
 
        return value;
        alertpanel_show();
 
        return value;
@@ -138,7 +142,7 @@ void alertpanel_notice(const gchar *format, ...)
        va_end(args);
        strretchomp(buf);
 
        va_end(args);
        strretchomp(buf);
 
-       alertpanel_message(_("Notice"), buf);
+       alertpanel_message(_("Notice"), buf, ALERT_NOTICE);
 }
 
 void alertpanel_warning(const gchar *format, ...)
 }
 
 void alertpanel_warning(const gchar *format, ...)
@@ -151,7 +155,7 @@ void alertpanel_warning(const gchar *format, ...)
        va_end(args);
        strretchomp(buf);
 
        va_end(args);
        strretchomp(buf);
 
-       alertpanel_message(_("Warning"), buf);
+       alertpanel_message(_("Warning"), buf, ALERT_WARNING);
 }
 
 void alertpanel_error(const gchar *format, ...)
 }
 
 void alertpanel_error(const gchar *format, ...)
@@ -164,7 +168,7 @@ void alertpanel_error(const gchar *format, ...)
        va_end(args);
        strretchomp(buf);
 
        va_end(args);
        strretchomp(buf);
 
-       alertpanel_message(_("Error"), buf);
+       alertpanel_message(_("Error"), buf, ALERT_ERROR);
 }
 
 /*!
 }
 
 /*!
@@ -218,7 +222,8 @@ static void alertpanel_create(const gchar *title,
                              const gchar *button2_label,
                              const gchar *button3_label,
                              gboolean     can_disable,
                              const gchar *button2_label,
                              const gchar *button3_label,
                              gboolean     can_disable,
-                             GtkWidget *custom_widget)
+                             GtkWidget   *custom_widget,
+                             gint         alert_type)
 {
        static PangoFontDescription *font_desc;
        GtkWidget *label;
 {
        static PangoFontDescription *font_desc;
        GtkWidget *label;
@@ -235,6 +240,10 @@ static void alertpanel_create(const gchar *title,
        GtkWidget *icon;
        const gchar *label2;
        const gchar *label3;
        GtkWidget *icon;
        const gchar *label2;
        const gchar *label3;
+       gchar *icon_desc[] = {  GTK_STOCK_DIALOG_INFO,
+                               GTK_STOCK_DIALOG_QUESTION,
+                               GTK_STOCK_DIALOG_WARNING,
+                               GTK_STOCK_DIALOG_ERROR };
 
        debug_print("Creating alert panel dialog...\n");
 
 
        debug_print("Creating alert panel dialog...\n");
 
@@ -254,7 +263,10 @@ static void alertpanel_create(const gchar *title,
 
        /* for title label */
        w_hbox = gtk_hbox_new(FALSE, 0);
 
        /* for title label */
        w_hbox = gtk_hbox_new(FALSE, 0);
-       icon = gtk_image_new_from_stock(GTK_STOCK_DIALOG_WARNING,
+       
+       if (alert_type < 0 || alert_type > 3)
+               alert_type = 0;
+       icon = gtk_image_new_from_stock(icon_desc[alert_type],
                                        GTK_ICON_SIZE_DIALOG); 
        gtk_box_pack_start(GTK_BOX(w_hbox), icon, FALSE, FALSE, 16);
        hbox = gtk_hbox_new(FALSE, 0);
                                        GTK_ICON_SIZE_DIALOG); 
        gtk_box_pack_start(GTK_BOX(w_hbox), icon, FALSE, FALSE, 16);
        hbox = gtk_hbox_new(FALSE, 0);
index 55b9879d71541a93e1f16c87bd082851bedf2c13..fc0b05755eac52554b6b48af05295d97d83201f5 100644 (file)
@@ -33,6 +33,13 @@ typedef enum
        G_ALERTDISABLE  = 1 << 16
 } AlertValue;
 
        G_ALERTDISABLE  = 1 << 16
 } AlertValue;
 
+typedef enum
+{
+       ALERT_NOTICE,
+       ALERT_QUESTION,
+       ALERT_WARNING,
+       ALERT_ERROR
+} AlertType;
 #define G_ALERT_VALUE_MASK     0x0000ffff
 
 AlertValue alertpanel  (const gchar    *title,
 #define G_ALERT_VALUE_MASK     0x0000ffff
 
 AlertValue alertpanel  (const gchar    *title,
@@ -48,11 +55,9 @@ AlertValue alertpanel_with_widget    (const gchar *title,
                                         const gchar *button3_label,
                                         GtkWidget *widget);
 
                                         const gchar *button3_label,
                                         GtkWidget *widget);
 
-void alertpanel_message        (const gchar    *title,
-                        const gchar    *message);
-
 AlertValue alertpanel_message_with_disable     (const gchar    *title,
 AlertValue alertpanel_message_with_disable     (const gchar    *title,
-                                                const gchar    *message);
+                                                const gchar    *message,
+                                                gint            alert_type);
 
 void alertpanel_notice (const gchar    *format,
                         ...) G_GNUC_PRINTF(1, 2);
 
 void alertpanel_notice (const gchar    *format,
                         ...) G_GNUC_PRINTF(1, 2);
index b434fb10dc9355a4586fcac850934712546d141c..c25ebca6f1f1a57e1d05b8f70b6b9072f9dcd3dc 100644 (file)
@@ -183,9 +183,8 @@ static void message_search_execute(GtkButton *button, gpointer data)
                }
 
                if (all_searched) {
                }
 
                if (all_searched) {
-                       alertpanel_message
-                               (_("Search failed"),
-                                _("Search string not found."));
+                       alertpanel_notice
+                               (_("Search string not found."));
                        break;
                }
 
                        break;
                }
 
index 2705ed8a520320dc0d250c7572e6ebf596f8903e..5736966d07b482fcba70c781acee8f2c29924162 100644 (file)
@@ -1697,21 +1697,23 @@ static void icon_scroll_size_allocate_cb(GtkWidget *widget,
 static void icon_list_create(MimeView *mimeview, MimeInfo *mimeinfo)
 {
        GtkRequisition size;
 static void icon_list_create(MimeView *mimeview, MimeInfo *mimeinfo)
 {
        GtkRequisition size;
-       gint           width;
+
        g_return_if_fail(mimeinfo != NULL);
 
        while (mimeinfo != NULL) {
                if (mimeinfo->type != MIMETYPE_MULTIPART)
                        icon_list_append_icon(mimeview, mimeinfo);
                if (mimeinfo->node->children != NULL)
        g_return_if_fail(mimeinfo != NULL);
 
        while (mimeinfo != NULL) {
                if (mimeinfo->type != MIMETYPE_MULTIPART)
                        icon_list_append_icon(mimeview, mimeinfo);
                if (mimeinfo->node->children != NULL)
-                       icon_list_create(mimeview, (MimeInfo *) mimeinfo->node->children->data);
-               mimeinfo = mimeinfo->node->next != NULL ? (MimeInfo *) mimeinfo->node->next->data : NULL;
+                       icon_list_create(mimeview, 
+                               (MimeInfo *) mimeinfo->node->children->data);
+               mimeinfo = mimeinfo->node->next != NULL 
+                        ? (MimeInfo *) mimeinfo->node->next->data 
+                        : NULL;
        }
        gtk_widget_size_request(mimeview->icon_vbox, &size);
        }
        gtk_widget_size_request(mimeview->icon_vbox, &size);
-       width = size.width + 4;
-       if (width > mimeview->icon_mainbox->requisition.width) {
+       if (size.width > mimeview->icon_mainbox->requisition.width) {
                gtk_widget_set_size_request(mimeview->icon_mainbox, 
                gtk_widget_set_size_request(mimeview->icon_mainbox, 
-                                           width, -1);
+                                           size.width, -1);
        }
 
 }
        }
 
 }
index b37dac53687d24ec1f3f39a81954ee1d728f42ef..7c9551032266f8c1a2ad26e3026c6df4bb76d223 100644 (file)
@@ -286,8 +286,9 @@ void sgpgme_init()
 
                        val = alertpanel_message_with_disable
                                (_("Warning"),
 
                        val = alertpanel_message_with_disable
                                (_("Warning"),
-                                _("GnuPG is not installed properly, or needs to be upgraded.\n"
-                                  "OpenPGP support disabled."));
+                                _("GnuPG is not installed properly, or needs "
+                                  "to be upgraded.\n"
+                                  "OpenPGP support disabled."), ALERT_WARNING);
                        if (val & G_ALERTDISABLE)
                                prefs_common.gpg_warning = FALSE;
                }
                        if (val & G_ALERTDISABLE)
                                prefs_common.gpg_warning = FALSE;
                }
index 4f4741b9840c1317fc46a1e68b90ff6643664860..7909690e47b5b54daeafbee735900e59ef32ae17 100644 (file)
@@ -338,9 +338,8 @@ static void summary_search_execute(GtkButton *button, gpointer data)
                        }
 
                        if (all_searched) {
                        }
 
                        if (all_searched) {
-                               alertpanel_message
-                                       (_("Search failed"),
-                                        _("Search string not found."));
+                               alertpanel_notice
+                                       (_("Search string not found."));
                                break;
                        }
 
                                break;
                        }