aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-tree.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-12-05 04:04:43 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-12-05 04:04:43 +0800
commitba0792d8ffa88e2a9be12aa547fa9d8fc5257e5b (patch)
tree41a20eb7650ebfdce9074f3eebf9716514ebca34 /mail/em-folder-tree.c
parentc923f10cb9477b3c3e0a2345b88e35b47032b70a (diff)
downloadgsoc2013-evolution-ba0792d8ffa88e2a9be12aa547fa9d8fc5257e5b.tar.gz
gsoc2013-evolution-ba0792d8ffa88e2a9be12aa547fa9d8fc5257e5b.tar.zst
gsoc2013-evolution-ba0792d8ffa88e2a9be12aa547fa9d8fc5257e5b.zip
Fixes bug #51605.
2003-12-04 Jeffrey Stedfast <fejj@ximian.com> Fixes bug #51605. * em-folder-selector.c (emfs_response): Handle creating a new folder (pop up a create-folder-selector dialog). * em-folder-tree.c (emft_popup_new_folder_response): Moved all the logic into em_folder_tree_create_folder(). (em_folder_tree_create_folder): New function to create a folder. svn path=/trunk/; revision=23635
Diffstat (limited to 'mail/em-folder-tree.c')
-rw-r--r--mail/em-folder-tree.c42
1 files changed, 26 insertions, 16 deletions
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c
index d2f25793e4..409fc5881d 100644
--- a/mail/em-folder-tree.c
+++ b/mail/em-folder-tree.c
@@ -1000,25 +1000,18 @@ emft_popup_move (GtkWidget *item, EMFolderTree *emft)
NULL, emft_popup_copy_folder_selected, cfd);
}
-static void
-emft_popup_new_folder_response (EMFolderSelector *emfs, int response, EMFolderTree *emft)
+
+gboolean
+em_folder_tree_create_folder (EMFolderTree *emft, const char *path, const char *uri)
{
- /* FIXME: ugh, kludge-a-licious: EMFolderSelector uses EMFolderTree so we can poke emfs->emft internals */
- struct _EMFolderTreePrivate *priv = emfs->emft->priv;
+ struct _EMFolderTreePrivate *priv = emft->priv;
struct _EMFolderTreeModelStoreInfo *si;
- const char *uri, *parent, *path, *full_name;
+ const char *parent, *full_name;
char *name, *namebuf = NULL;
GtkWidget *dialog;
CamelStore *store;
CamelException ex;
- if (response != GTK_RESPONSE_OK) {
- gtk_widget_destroy ((GtkWidget *) emfs);
- return;
- }
-
- uri = em_folder_selector_get_selected_uri (emfs);
- path = em_folder_selector_get_selected_path (emfs);
d(printf ("Creating folder: %s (%s)\n", path, uri));
camel_exception_init (&ex);
@@ -1056,19 +1049,36 @@ emft_popup_new_folder_response (EMFolderSelector *emfs, int response, EMFolderTr
g_free (namebuf);
- gtk_widget_destroy ((GtkWidget *) emfs);
-
- return;
+ return TRUE;
exception:
- dialog = gtk_message_dialog_new ((GtkWindow *) emfs, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+ dialog = gtk_message_dialog_new ((GtkWindow *) emft, GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, _("%s"), ex.desc);
g_signal_connect (dialog, "response", G_CALLBACK (gtk_widget_destroy), dialog);
camel_exception_clear (&ex);
g_free (namebuf);
gtk_widget_show (dialog);
+
+ return FALSE;
+}
+
+static void
+emft_popup_new_folder_response (EMFolderSelector *emfs, int response, EMFolderTree *emft)
+{
+ const char *uri, *path;
+
+ if (response != GTK_RESPONSE_OK) {
+ gtk_widget_destroy ((GtkWidget *) emfs);
+ return;
+ }
+
+ uri = em_folder_selector_get_selected_uri (emfs);
+ path = em_folder_selector_get_selected_path (emfs);
+
+ if (em_folder_tree_create_folder (emfs->emft, path, uri))
+ gtk_widget_destroy ((GtkWidget *) emfs);
}
static void