2007-10-06 [colin] 3.0.2cvs21
authorColin Leroy <colin@colino.net>
Sat, 6 Oct 2007 18:32:04 +0000 (18:32 +0000)
committerColin Leroy <colin@colino.net>
Sat, 6 Oct 2007 18:32:04 +0000 (18:32 +0000)
* src/prefs_toolbar.c
* src/toolbar.c
Set toolbar text automatically to the default
when changing Event executed on click

ChangeLog
PATCHSETS
configure.ac
src/prefs_toolbar.c
src/toolbar.c

index c0b4560028a8046d6d83b8928c03dd57c3715cec..b2db89ed20b03ed7949004a3d60b7741fafe2972 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2007-10-06 [colin]     3.0.2cvs21
+
+       * src/prefs_toolbar.c
+       * src/toolbar.c
+               Set toolbar text automatically to the default
+               when changing Event executed on click
+
 2007-10-06 [colin]     3.0.2cvs20
 
        * src/prefs_toolbar.c
index d26f64cdbbea91a1711efc8b117b7807a20abaa2..49ba31c57386c8fbfba20ac12c2945b50f0d98d3 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.61.2.71 -r 1.61.2.72 src/account.c;  cvs diff -u -r 1.59.2.59 -r 1.59.2.60 src/prefs_filtering.c;  ) > 3.0.2cvs18.patchset
 ( cvs diff -u -r 1.30.2.35 -r 1.30.2.36 src/prefs_toolbar.c;  cvs diff -u -r 1.43.2.84 -r 1.43.2.85 src/toolbar.c;  ) > 3.0.2cvs19.patchset
 ( cvs diff -u -r 1.30.2.36 -r 1.30.2.37 src/prefs_toolbar.c;  ) > 3.0.2cvs20.patchset
+( cvs diff -u -r 1.30.2.37 -r 1.30.2.38 src/prefs_toolbar.c;  cvs diff -u -r 1.43.2.85 -r 1.43.2.86 src/toolbar.c;  ) > 3.0.2cvs21.patchset
index 4e09e2228bb6660413b6d47952f4477ee3e18f2d..5d7c52322a2a7f1f02171a2f020a919247e96b1a 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=0
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=20
+EXTRA_VERSION=21
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index b1dc6cacc297fa9c366a8792678019876d1ee3df..810270d404a6fe1e3d2812e82dac697ae9f62453 100644 (file)
@@ -645,11 +645,27 @@ static void action_selection_changed(GtkComboBox *action_combo,
 {
        gchar *text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(
                           prefs_toolbar->item_action_combo));
-       
-       if(text != NULL)
+
+       if(text != NULL) { /* action */
                gtk_entry_set_text(GTK_ENTRY(prefs_toolbar->item_text_entry), text);
-       
-       g_free(text);
+               g_free(text);
+       } 
+}
+
+static void func_selection_changed(GtkComboBox *action_combo,
+                               ToolbarPage *prefs_toolbar)
+{
+       gchar *text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(
+                          prefs_toolbar->item_func_combo));
+
+       if(text != NULL) { /* action */
+               int action = -1;
+               action = toolbar_ret_val_from_descr(text);
+               if (action >= 0)
+                       gtk_entry_set_text(GTK_ENTRY(prefs_toolbar->item_text_entry), 
+                                       toolbar_get_short_text(action));
+               g_free(text);
+       } 
 }
 
 static void prefs_toolbar_create(ToolbarPage *prefs_toolbar)
@@ -859,6 +875,8 @@ static void prefs_toolbar_create(ToolbarPage *prefs_toolbar)
                         G_CALLBACK(item_type_changed), prefs_toolbar);
        g_signal_connect(G_OBJECT(item_action_combo), "changed",
                         G_CALLBACK(action_selection_changed), prefs_toolbar);
+       g_signal_connect(G_OBJECT(item_func_combo), "changed",
+                        G_CALLBACK(func_selection_changed), prefs_toolbar);
        g_signal_connect(G_OBJECT(up_btn), "clicked",
                         G_CALLBACK(prefs_toolbar_up), prefs_toolbar);
        g_signal_connect(G_OBJECT(down_btn), "clicked",
index b52996104736335d24411a213b476bcbae66a50d..6d71a8d483f927a2dcf4edd9ac960c75cd1c2b40 100644 (file)
@@ -403,39 +403,78 @@ static void toolbar_parse_item(XMLFile *file, ToolbarType source)
        }
 }
 
+const gchar *toolbar_get_short_text(int action) {
+       switch(action) {
+       case A_GO_FOLDERS:      return _("Folders");
+       case A_OPEN_MAIL:       return _("Open");
+       case A_RECEIVE_ALL:     return _("Get Mail");
+       case A_RECEIVE_CUR:     return _("Get");
+       case A_SEND_QUEUED:     return _("Send");
+       case A_COMPOSE_EMAIL:   return Q_("Toolbar|Compose");
+       case A_COMPOSE_NEWS:    return Q_("Toolbar|Compose");
+       case A_REPLY_MESSAGE:   return _("Reply");
+       case A_REPLY_ALL:       return _("All");
+       case A_REPLY_SENDER:    return _("Sender");
+       case A_REPLY_ML:        return _("List");
+       case A_FORWARD:         return _("Forward");
+       case A_TRASH:           return _("Trash");
+       case A_DELETE_REAL:     return _("Delete");
+       case A_LEARN_SPAM:      return _("Spam");
+       case A_GOTO_PREV:       return _("Prev");
+       case A_GOTO_NEXT:       return _("Next");
+       case A_IGNORE_THREAD:   return _("Ignore thread");
+       case A_WATCH_THREAD:    return _("Watch thread");
+       case A_PRINT:           return _("Print");
+       case A_CLOSE:           return _("Close");
+       case A_SEND:            return _("Send");
+       case A_SENDL:           return _("Send later");
+       case A_DRAFT:           return _("Draft");
+       case A_INSERT:          return _("Insert");
+       case A_ATTACH:          return _("Attach");
+       case A_SIG:             return _("Insert sig.");
+       case A_EXTEDITOR:       return _("Edit");
+       case A_LINEWRAP_CURRENT:return _("Wrap para.");
+       case A_LINEWRAP_ALL:    return _("Wrap all");
+       case A_ADDRBOOK:        return _("Address");
+       case A_CANCEL_INC:      return _("Stop");
+       #ifdef USE_ASPELL
+       case A_CHECK_SPELLING:  return _("Check spelling");
+       #endif
+       default:                return "";
+       }
+}
+
 static void toolbar_set_default_main(void) 
 {
        struct {
                gint action;
                gint icon;
-               gchar *text;
        } default_toolbar[] = {
 #ifdef MAEMO
-               { A_GO_FOLDERS,    STOCK_PIXMAP_GO_FOLDERS,           _("Folders") },
-               { A_OPEN_MAIL,     STOCK_PIXMAP_OPEN_MAIL,            _("Open")    },           
-               { A_SEPARATOR,     0,                                 ("")         }, 
+               { A_GO_FOLDERS,    STOCK_PIXMAP_GO_FOLDERS },
+               { A_OPEN_MAIL,     STOCK_PIXMAP_OPEN_MAIL  },           
+               { A_SEPARATOR,     0                       }, 
 #endif
-               { A_RECEIVE_ALL,   STOCK_PIXMAP_MAIL_RECEIVE_ALL,     _("Get Mail")},
-               { A_SEPARATOR,     0,                                 ("")         }, 
-               { A_SEND_QUEUED,   STOCK_PIXMAP_MAIL_SEND_QUEUE,      _("Send")    },
-               { A_COMPOSE_EMAIL, STOCK_PIXMAP_MAIL_COMPOSE,
-                       (gchar*)Q_("Toolbar|Compose") },
-               { A_SEPARATOR,     0,                                 ("")         },
-               { A_REPLY_MESSAGE, STOCK_PIXMAP_MAIL_REPLY,           _("Reply")   }, 
+               { A_RECEIVE_ALL,   STOCK_PIXMAP_MAIL_RECEIVE_ALL },
+               { A_SEPARATOR,     0}, 
+               { A_SEND_QUEUED,   STOCK_PIXMAP_MAIL_SEND_QUEUE},
+               { A_COMPOSE_EMAIL, STOCK_PIXMAP_MAIL_COMPOSE },
+               { A_SEPARATOR,     0},
+               { A_REPLY_MESSAGE, STOCK_PIXMAP_MAIL_REPLY}, 
 #ifndef MAEMO
-               { A_REPLY_ALL,     STOCK_PIXMAP_MAIL_REPLY_TO_ALL,    _("All")     },
-               { A_REPLY_SENDER,  STOCK_PIXMAP_MAIL_REPLY_TO_AUTHOR, _("Sender")  },
+               { A_REPLY_ALL,     STOCK_PIXMAP_MAIL_REPLY_TO_ALL},
+               { A_REPLY_SENDER,  STOCK_PIXMAP_MAIL_REPLY_TO_AUTHOR},
 #endif
-               { A_FORWARD,       STOCK_PIXMAP_MAIL_FORWARD,         _("Forward") },
-               { A_SEPARATOR,     0,                                 ("")         },
-               { A_TRASH,         STOCK_PIXMAP_TRASH,                _("Trash")   },
+               { A_FORWARD,       STOCK_PIXMAP_MAIL_FORWARD},
+               { A_SEPARATOR,     0},
+               { A_TRASH,         STOCK_PIXMAP_TRASH},
 #ifndef MAEMO
 #if (defined(USE_SPAMASSASSIN_PLUGIN) || defined(USE_BOGOFILTER_PLUGIN))
-               { A_LEARN_SPAM,    STOCK_PIXMAP_SPAM_BTN,             _("Spam")    },
+               { A_LEARN_SPAM,    STOCK_PIXMAP_SPAM_BTN},
 #endif
 #endif
-               { A_SEPARATOR,     0,                                 ("")         },
-               { A_GOTO_NEXT,     STOCK_PIXMAP_DOWN_ARROW,           _("Next")    }
+               { A_SEPARATOR,     0},
+               { A_GOTO_NEXT,     STOCK_PIXMAP_DOWN_ARROW }
        };
        
        gint i;
@@ -450,7 +489,7 @@ static void toolbar_set_default_main(void)
                        
                        toolbar_item->file  = g_strdup(file);
                        toolbar_item->index = default_toolbar[i].action;
-                       toolbar_item->text  = g_strdup(default_toolbar[i].text);
+                       toolbar_item->text  = g_strdup(toolbar_get_short_text(default_toolbar[i].action));
                } else {
 
                        toolbar_item->file  = g_strdup(TOOLBAR_TAG_SEPARATOR);
@@ -470,22 +509,21 @@ static void toolbar_set_default_compose(void)
        struct {
                gint action;
                gint icon;
-               gchar *text;
        } default_toolbar[] = {
 #ifdef MAEMO
-               { A_CLOSE,              STOCK_PIXMAP_CLOSE,             _("Close")              },
-               { A_SEPARATOR,          0,                               ("")                   }, 
+               { A_CLOSE,              STOCK_PIXMAP_CLOSE},
+               { A_SEPARATOR,          0}, 
 #endif
-               { A_SEND,               STOCK_PIXMAP_MAIL_SEND,         _("Send")               },
-               { A_SENDL,              STOCK_PIXMAP_MAIL_SEND_QUEUE,   _("Send later")         },
-               { A_DRAFT,              STOCK_PIXMAP_MAIL,              _("Draft")              },
-               { A_SEPARATOR,          0,                               ("")                   }, 
+               { A_SEND,               STOCK_PIXMAP_MAIL_SEND},
+               { A_SENDL,              STOCK_PIXMAP_MAIL_SEND_QUEUE},
+               { A_DRAFT,              STOCK_PIXMAP_MAIL},
+               { A_SEPARATOR,          0}, 
 #ifndef MAEMO
-               { A_INSERT,             STOCK_PIXMAP_INSERT_FILE,       _("Insert")             },
+               { A_INSERT,             STOCK_PIXMAP_INSERT_FILE},
 #endif
-               { A_ATTACH,             STOCK_PIXMAP_MAIL_ATTACH,       _("Attach")             },
-               { A_SEPARATOR,          0,                               ("")                   },
-               { A_ADDRBOOK,           STOCK_PIXMAP_ADDRESS_BOOK,      _("Address")            }
+               { A_ATTACH,             STOCK_PIXMAP_MAIL_ATTACH},
+               { A_SEPARATOR,          0},
+               { A_ADDRBOOK,           STOCK_PIXMAP_ADDRESS_BOOK       }
        };
        
        gint i;
@@ -500,7 +538,7 @@ static void toolbar_set_default_compose(void)
                        
                        toolbar_item->file  = g_strdup(file);
                        toolbar_item->index = default_toolbar[i].action;
-                       toolbar_item->text  = g_strdup(default_toolbar[i].text);
+                       toolbar_item->text  = g_strdup(toolbar_get_short_text(default_toolbar[i].action));
                } else {
 
                        toolbar_item->file  = g_strdup(TOOLBAR_TAG_SEPARATOR);
@@ -520,24 +558,23 @@ static void toolbar_set_default_msgview(void)
        struct {
                gint action;
                gint icon;
-               gchar *text;
        } default_toolbar[] = {
 #ifdef MAEMO
-               { A_CLOSE,              STOCK_PIXMAP_CLOSE,             _("Close") },
-               { A_SEPARATOR,          0,                               ("")      }, 
+               { A_CLOSE,              STOCK_PIXMAP_CLOSE},
+               { A_SEPARATOR,          0}, 
 #endif
-               { A_REPLY_MESSAGE, STOCK_PIXMAP_MAIL_REPLY,           _("Reply")   }, 
-               { A_REPLY_ALL,     STOCK_PIXMAP_MAIL_REPLY_TO_ALL,    _("All")     },
-               { A_REPLY_SENDER,  STOCK_PIXMAP_MAIL_REPLY_TO_AUTHOR, _("Sender")  },
-               { A_FORWARD,       STOCK_PIXMAP_MAIL_FORWARD,         _("Forward") },
-               { A_SEPARATOR,     0,                                 ("")         },
-               { A_TRASH,         STOCK_PIXMAP_TRASH,                _("Trash")   },
+               { A_REPLY_MESSAGE, STOCK_PIXMAP_MAIL_REPLY}, 
+               { A_REPLY_ALL,     STOCK_PIXMAP_MAIL_REPLY_TO_ALL},
+               { A_REPLY_SENDER,  STOCK_PIXMAP_MAIL_REPLY_TO_AUTHOR},
+               { A_FORWARD,       STOCK_PIXMAP_MAIL_FORWARD},
+               { A_SEPARATOR,     0},
+               { A_TRASH,         STOCK_PIXMAP_TRASH},
 #ifndef MAEMO
 #if (defined(USE_SPAMASSASSIN_PLUGIN) || defined(USE_BOGOFILTER_PLUGIN))
-               { A_LEARN_SPAM,    STOCK_PIXMAP_SPAM_BTN,             _("Spam")    },
+               { A_LEARN_SPAM,    STOCK_PIXMAP_SPAM_BTN},
 #endif
 #endif
-               { A_GOTO_NEXT,     STOCK_PIXMAP_DOWN_ARROW,           _("Next")    }
+               { A_GOTO_NEXT,     STOCK_PIXMAP_DOWN_ARROW }
        };
        
        gint i;
@@ -552,7 +589,7 @@ static void toolbar_set_default_msgview(void)
                        
                        toolbar_item->file  = g_strdup(file);
                        toolbar_item->index = default_toolbar[i].action;
-                       toolbar_item->text  = g_strdup(default_toolbar[i].text);
+                       toolbar_item->text  = g_strdup(toolbar_get_short_text(default_toolbar[i].action));
                } else {
 
                        toolbar_item->file  = g_strdup(TOOLBAR_TAG_SEPARATOR);