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 d79ad2e..6c55daf 100644 (file)
@@ -25,3 +25,4 @@ claws-mail.pc
 patches
 commitHelper.tmp
 *.patchset
+.project
index cded61d..c5faccf 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 5c2ef9b..fa7f0ac 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 4aa2e24..c78b994 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 94650b3..3c00c2b 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 992635e..08cd459 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 228936c..68651c2 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 b3f8886..a5ed63b 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 1abb5fd..9879927 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 a67d5b2..ce3b0f8 100644 (file)
@@ -489,6 +489,7 @@ struct _PrefsCommon
        gboolean use_networkmanager;
        gboolean use_shred;
        gboolean two_line_vert;
+       gboolean inherit_folder_props;
 
 };