2008-06-13 [holger] 3.4.0cvs94
authorHolger Berndt <hb@claws-mail.org>
Fri, 13 Jun 2008 09:21:20 +0000 (09:21 +0000)
committerHolger Berndt <hb@claws-mail.org>
Fri, 13 Jun 2008 09:21:20 +0000 (09:21 +0000)
* .cvsignore
More files to ignore
* src/gtk/inputdialog.c
* src/gtk/inputdialog.h
Make input dialog more generic so that a checkbox
with custom text can be used in addition to the
"remember this" checkbox
* src/imap_gtk.c
* src/mh_gtk.c
* src/prefs_common.c
* src/prefs_common.h
Allow new folders to inherit the properties of the
parent folder during folder creation

.cvsignore
ChangeLog
PATCHSETS
configure.ac
src/gtk/inputdialog.c
src/gtk/inputdialog.h
src/imap_gtk.c
src/mh_gtk.c
src/prefs_common.c
src/prefs_common.h

index d79ad2e7796d3e3dd8d66aafc9354811798d6e53..6c55daf259b2539c8f08ab1c4044da1ffb7ca4f7 100644 (file)
@@ -25,3 +25,4 @@ claws-mail.pc
 patches
 commitHelper.tmp
 *.patchset
+.project
index cded61d295767809a9733ea2c0c9c7db3a1d2b1e..c5faccffd4ba62cf4b626c626742a9bcb797b904 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,19 @@
+2008-06-13 [holger]    3.4.0cvs94
+
+       * .cvsignore
+               More files to ignore
+       * src/gtk/inputdialog.c
+       * src/gtk/inputdialog.h
+               Make input dialog more generic so that a checkbox
+               with custom text can be used in addition to the
+               "remember this" checkbox
+       * src/imap_gtk.c
+       * src/mh_gtk.c
+       * src/prefs_common.c
+       * src/prefs_common.h
+               Allow new folders to inherit the properties of the
+               parent folder during folder creation
+
 2008-06-13 [wwp]       3.4.0cvs93
 
        * src/addressbook.c
index 5c2ef9bd06d8ae08e238a1fdf5c9e1bef43943d4..fa7f0ac63d854a8e3363789f4a47e0f519f010f4 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.382.2.451 -r 1.382.2.452 src/compose.c;  cvs diff -u -r 1.50.2.46 -r 1.50.2.47 src/compose.h;  cvs diff -u -r 1.207.2.200 -r 1.207.2.201 src/folderview.c;  ) > 3.4.0cvs91.patchset
 ( cvs diff -u -r 1.1.2.10 -r 1.1.2.11 src/addrduplicates.c;  cvs diff -u -r 1.9.2.22 -r 1.9.2.23 src/addressadd.c;  cvs diff -u -r 1.60.2.117 -r 1.60.2.118 src/addressbook.c;  cvs diff -u -r 1.1.2.10 -r 1.1.2.11 src/addressbook_foldersel.c;  cvs diff -u -r 1.11.2.18 -r 1.11.2.19 src/editgroup.c;  cvs diff -u -r 1.26.2.35 -r 1.26.2.36 src/foldersel.c;  ) > 3.4.0cvs92.patchset
 ( cvs diff -u -r 1.60.2.118 -r 1.60.2.119 src/addressbook.c;  ) > 3.4.0cvs93.patchset
+( cvs diff -u -r 1.8.2.6 -r 1.8.2.7 .cvsignore;  cvs diff -u -r 1.1.2.56 -r 1.1.2.57 src/imap_gtk.c;  cvs diff -u -r 1.2.2.30 -r 1.2.2.31 src/mh_gtk.c;  cvs diff -u -r 1.204.2.171 -r 1.204.2.172 src/prefs_common.c;  cvs diff -u -r 1.103.2.109 -r 1.103.2.110 src/prefs_common.h;  cvs diff -u -r 1.2.2.27 -r 1.2.2.28 src/gtk/inputdialog.c;  cvs diff -u -r 1.1.2.8 -r 1.1.2.9 src/gtk/inputdialog.h;  ) > 3.4.0cvs94.patchset
index 4aa2e2484d87cc96df637111371e497fa6fa00ee..c78b994792843dc06d01f1b50db93681aae4f98c 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=4
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=93
+EXTRA_VERSION=94
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 94650b369c6e753430a49932f01f2862eab3fbd4..3c00c2b3b9ff80955d0c22774cb4c307fa8b3456 100644 (file)
@@ -46,6 +46,8 @@
 #include "gtkutils.h"
 #include "utils.h"
 #include "combobox.h"
+#include "prefs_common.h"
+
 
 #define INPUT_DIALOG_WIDTH     420
 
@@ -73,7 +75,9 @@ static gboolean is_pass = FALSE;
 static void input_dialog_create        (gboolean is_password);
 static gchar *input_dialog_open        (const gchar    *title,
                                 const gchar    *message,
+                                const gchar  *checkbtn_label,
                                 const gchar    *default_string,
+                                gboolean default_checkbtn_state,
                                 gboolean       *remember);
 static void input_dialog_set   (const gchar    *title,
                                 const gchar    *message,
@@ -116,7 +120,7 @@ gchar *input_dialog(const gchar *title, const gchar *message,
                HILDON_GTK_INPUT_MODE_FULL | HILDON_GTK_INPUT_MODE_AUTOCAP);
 #endif
 
-       return input_dialog_open(title, message, default_string, NULL);
+       return input_dialog_open(title, message, NULL, default_string, FALSE, NULL);
 }
 
 gchar *input_dialog_with_invisible(const gchar *title, const gchar *message,
@@ -141,7 +145,7 @@ gchar *input_dialog_with_invisible(const gchar *title, const gchar *message,
                HILDON_GTK_INPUT_MODE_FULL | HILDON_GTK_INPUT_MODE_INVISIBLE);
 #endif
 
-       return input_dialog_open(title, message, default_string, NULL);
+       return input_dialog_open(title, message, NULL, default_string, FALSE, NULL);
 }
 
 gchar *input_dialog_combo(const gchar *title, const gchar *message,
@@ -177,7 +181,40 @@ gchar *input_dialog_combo_remember(const gchar *title, const gchar *message,
        combobox_unset_popdown_strings(GTK_COMBO_BOX(combo));
        combobox_set_popdown_strings(GTK_COMBO_BOX(combo), list);
 
-       return input_dialog_open(title, message, default_string, remember);
+       return input_dialog_open(title, message, NULL, default_string, FALSE, remember);
+}
+
+gchar *input_dialog_with_checkbtn(const gchar  *title,
+                                  const gchar  *message,
+                                  const gchar  *default_string,
+                                  const gchar  *checkbtn_label,
+                                  gboolean *checkbtn_state)
+{
+       if (dialog && GTK_WIDGET_VISIBLE(dialog)) return NULL;
+
+       if (!dialog)
+               input_dialog_create(FALSE);
+
+       type = INPUT_DIALOG_NORMAL;
+       gtk_widget_hide(combo);
+       gtk_widget_show(entry);
+
+       if(checkbtn_label && checkbtn_state)
+               gtk_widget_show(remember_checkbtn);
+       else
+               gtk_widget_hide(remember_checkbtn);
+
+       gtk_widget_show(icon_q);
+       gtk_widget_hide(icon_p);
+       is_pass = FALSE;
+       gtk_entry_set_visibility(GTK_ENTRY(entry), TRUE);
+#ifdef MAEMO
+       hildon_gtk_entry_set_input_mode(GTK_ENTRY(entry), 
+               HILDON_GTK_INPUT_MODE_FULL | HILDON_GTK_INPUT_MODE_AUTOCAP);
+#endif
+
+       return input_dialog_open(title, message, checkbtn_label, default_string, 
+                                prefs_common.inherit_folder_props, checkbtn_state);
 }
 
 gchar *input_dialog_query_password(const gchar *server, const gchar *user)
@@ -308,7 +345,10 @@ static void input_dialog_create(gboolean is_password)
 }
 
 static gchar *input_dialog_open(const gchar *title, const gchar *message,
-                               const gchar *default_string, gboolean *remember)
+                               const gchar *checkbtn_label,
+                               const gchar *default_string,
+                               gboolean default_checkbtn_state,
+                               gboolean *remember)
 {
        gchar *str;
 
@@ -317,10 +357,16 @@ static gchar *input_dialog_open(const gchar *title, const gchar *message,
        if (!dialog)
                input_dialog_create(FALSE);
 
+       if(checkbtn_label)
+               gtk_button_set_label(GTK_BUTTON(remember_checkbtn), checkbtn_label);
+       else
+               gtk_button_set_label(GTK_BUTTON(remember_checkbtn), _("Remember this"));
+
        input_dialog_set(title, message, default_string);
        gtk_widget_show(dialog);
 
-       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remember_checkbtn), FALSE);
+       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remember_checkbtn),
+                                    default_checkbtn_state);
        if (remember)
                gtk_widget_show(remember_checkbtn);
        else
index 992635eff4c83ab6edba743f31996aaacaeb6ca7..08cd4599a17dcca220cc16439f084b535e981a76 100644 (file)
 gchar *input_dialog                    (const gchar    *title,
                                         const gchar    *message,
                                         const gchar    *default_string);
+gchar *input_dialog_with_checkbtn(const gchar  *title,
+                                  const gchar  *message,
+                                  const gchar  *default_string,
+                                  const gchar  *checkbtn_label,
+                                  gboolean *checkbtn_state);
 gchar *input_dialog_with_invisible     (const gchar    *title,
                                         const gchar    *message,
                                         const gchar    *default_string);
index 228936c1cab27ff7e0655a8c158990f56eb276e4..68651c2eccb31082516725ed3edb517c6f8b4937 100644 (file)
@@ -154,12 +154,15 @@ static void new_folder_cb(FolderView *folderview, guint action,
        g_return_if_fail(item->folder != NULL);
        g_return_if_fail(item->folder->account != NULL);
 
-       new_folder = input_dialog
+       new_folder = input_dialog_with_checkbtn
                (_("New folder"),
                 _("Input the name of new folder:\n"
                   "(if you want to create a folder to store subfolders\n"
                   "only and no mail, append '/' to the folder name)"),
-                _("NewFolder"));
+                _("NewFolder"),
+                _("Inherit properties from parent folder"),
+                &(prefs_common.inherit_folder_props));
+
        if (!new_folder) return;
        AUTORELEASE_STR(new_folder, {g_free(new_folder); return;});
 
@@ -192,6 +195,11 @@ static void new_folder_cb(FolderView *folderview, guint action,
                alertpanel_error(_("Can't create the folder '%s'."), name);
                return;
        }
+
+       if(prefs_common.inherit_folder_props) {
+               folder_item_prefs_copy_prefs(item, new_item);
+       }
+
        folder_write_list();
 }
 
index b3f88860f32e15d0c9cced4d7378f3a75ecefda4..a5ed63b721b311a2ef716120255fb46cfd1517fa 100644 (file)
@@ -37,6 +37,7 @@
 #include "inputdialog.h"
 #include "mh.h"
 #include "foldersel.h"
+#include "prefs_common.h"
 
 static void new_folder_cb(FolderView *folderview, guint action, GtkWidget *widget);
 static void delete_folder_cb(FolderView *folderview, guint action, GtkWidget *widget);
@@ -127,9 +128,11 @@ static void new_folder_cb(FolderView *folderview, guint action,
        g_return_if_fail(item != NULL);
        g_return_if_fail(item->folder != NULL);
 
-       new_folder = input_dialog(_("New folder"),
-                                 _("Input the name of new folder:"),
-                                 _("NewFolder"));
+       new_folder = input_dialog_with_checkbtn(_("New folder"),
+                                               _("Input the name of new folder:"),
+                                               _("NewFolder"),
+                                               _("Inherit properties from parent folder"),
+                                               &(prefs_common.inherit_folder_props));
        if (!new_folder) return;
        AUTORELEASE_STR(new_folder, {g_free(new_folder); return;});
 
@@ -155,6 +158,10 @@ static void new_folder_cb(FolderView *folderview, guint action,
                return;
        }
 
+       if(prefs_common.inherit_folder_props) {
+               folder_item_prefs_copy_prefs(item, new_item);
+       }
+
        folder_write_list();
 }
 
index 1abb5fdc975f2a1ebb6fa8b4ee16d2829b7a4182..9879927bbe7dbf4587f9ec0900fea0e6a1689751 100644 (file)
@@ -1116,6 +1116,9 @@ static PrefParam param[] = {
        {"two_line_vertical", "TRUE", &prefs_common.two_line_vert,
        P_BOOL, NULL, NULL, NULL },
 
+       {"inherit_folder_properties", "FALSE", &prefs_common.inherit_folder_props, P_BOOL,
+        NULL, NULL, NULL},
+
        {NULL, NULL, NULL, P_OTHER, NULL, NULL, NULL}
 };
 
index a67d5b2a614f1b61586052b8e9877db3d94ce908..ce3b0f887433a7cf196c1c0c0b46de3fd099086e 100644 (file)
@@ -489,6 +489,7 @@ struct _PrefsCommon
        gboolean use_networkmanager;
        gboolean use_shred;
        gboolean two_line_vert;
+       gboolean inherit_folder_props;
 
 };