aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-selector.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/em-folder-selector.c')
-rw-r--r--mail/em-folder-selector.c92
1 files changed, 46 insertions, 46 deletions
diff --git a/mail/em-folder-selector.c b/mail/em-folder-selector.c
index 3294c4fa5a..eb1cfa19bd 100644
--- a/mail/em-folder-selector.c
+++ b/mail/em-folder-selector.c
@@ -67,7 +67,7 @@ GType
em_folder_selector_get_type (void)
{
static GType type = 0;
-
+
if (!type) {
static const GTypeInfo info = {
sizeof (EMFolderSelectorClass),
@@ -80,10 +80,10 @@ em_folder_selector_get_type (void)
0, /* n_preallocs */
(GInstanceInitFunc) em_folder_selector_init,
};
-
+
type = g_type_register_static (GTK_TYPE_DIALOG, "EMFolderSelector", &info, 0);
}
-
+
return type;
}
@@ -92,9 +92,9 @@ em_folder_selector_class_init (EMFolderSelectorClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
GtkObjectClass *gtk_object_class = GTK_OBJECT_CLASS (klass);
-
+
parent_class = g_type_class_ref (GTK_TYPE_DIALOG);
-
+
object_class->finalize = em_folder_selector_finalize;
gtk_object_class->destroy = em_folder_selector_destroy;
}
@@ -111,13 +111,13 @@ em_folder_selector_destroy (GtkObject *obj)
{
EMFolderSelector *emfs = (EMFolderSelector *) obj;
EMFolderTreeModel *model;
-
+
if (emfs->created_id != 0) {
model = em_folder_tree_get_model (emfs->emft);
g_signal_handler_disconnect (model, emfs->created_id);
emfs->created_id = 0;
}
-
+
GTK_OBJECT_CLASS (parent_class)->destroy (obj);
}
@@ -125,11 +125,11 @@ static void
em_folder_selector_finalize (GObject *obj)
{
EMFolderSelector *emfs = (EMFolderSelector *) obj;
-
+
g_free (emfs->selected_path);
g_free (emfs->selected_uri);
g_free (emfs->created_uri);
-
+
G_OBJECT_CLASS (parent_class)->finalize (obj);
}
@@ -138,10 +138,10 @@ emfs_response (GtkWidget *dialog, int response, EMFolderSelector *emfs)
{
if (response != EM_FOLDER_SELECTOR_RESPONSE_NEW)
return;
-
+
g_object_set_data ((GObject *)emfs->emft, "select", GUINT_TO_POINTER (1));
em_folder_utils_create_folder(NULL, emfs->emft);
-
+
g_signal_stop_emission_by_name (emfs, "response");
}
@@ -151,10 +151,10 @@ emfs_create_name_changed (GtkEntry *entry, EMFolderSelector *emfs)
char *path;
const char *text = NULL;
gboolean active;
-
+
if (emfs->name_entry->text_length > 0)
text = gtk_entry_get_text (emfs->name_entry);
-
+
path = em_folder_tree_get_selected_uri(emfs->emft);
active = text && path && !strchr (text, '/');
g_free(path);
@@ -181,42 +181,42 @@ void
em_folder_selector_construct (EMFolderSelector *emfs, EMFolderTree *emft, guint32 flags, const char *title, const char *text, const char *oklabel)
{
GtkWidget *label;
-
+
gtk_window_set_modal (GTK_WINDOW (emfs), FALSE);
gtk_window_set_default_size (GTK_WINDOW (emfs), 350, 300);
gtk_window_set_title (GTK_WINDOW (emfs), title);
gtk_container_set_border_width (GTK_CONTAINER (emfs), 6);
-
+
gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (emfs)->vbox), 6);
gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (emfs)->vbox), 6);
-
+
emfs->flags = flags;
if (flags & EM_FOLDER_SELECTOR_CAN_CREATE) {
gtk_dialog_add_button (GTK_DIALOG (emfs), GTK_STOCK_NEW, EM_FOLDER_SELECTOR_RESPONSE_NEW);
g_signal_connect (emfs, "response", G_CALLBACK (emfs_response), emfs);
}
-
+
gtk_dialog_add_buttons (GTK_DIALOG (emfs), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
oklabel?oklabel:GTK_STOCK_OK, GTK_RESPONSE_OK, NULL);
-
+
gtk_dialog_set_response_sensitive (GTK_DIALOG (emfs), GTK_RESPONSE_OK, FALSE);
gtk_dialog_set_default_response (GTK_DIALOG (emfs), GTK_RESPONSE_OK);
-
+
emfs->emft = emft;
gtk_widget_show ((GtkWidget *) emft);
-
+
g_signal_connect (emfs->emft, "folder-selected", G_CALLBACK (folder_selected_cb), emfs);
g_signal_connect (emfs->emft, "folder-activated", G_CALLBACK (folder_activated_cb), emfs);
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (emfs)->vbox), (GtkWidget *)emft, TRUE, TRUE, 6);
-
+
if (text != NULL) {
label = gtk_label_new (text);
- gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
+ gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
gtk_widget_show (label);
-
+
gtk_box_pack_end (GTK_BOX (GTK_DIALOG (emfs)->vbox), label, FALSE, TRUE, 6);
}
-
+
gtk_widget_grab_focus ((GtkWidget *) emfs->emft);
}
@@ -224,10 +224,10 @@ GtkWidget *
em_folder_selector_new (EMFolderTree *emft, guint32 flags, const char *title, const char *text, const char *oklabel)
{
EMFolderSelector *emfs;
-
+
emfs = g_object_new (em_folder_selector_get_type (), NULL);
em_folder_selector_construct (emfs, emft, flags, title, text, oklabel);
-
+
return (GtkWidget *) emfs;
}
@@ -238,10 +238,10 @@ emfs_create_name_activate (GtkEntry *entry, EMFolderSelector *emfs)
if (emfs->name_entry->text_length > 0) {
char *path;
const char *text;
-
+
text = gtk_entry_get_text (emfs->name_entry);
path = em_folder_tree_get_selected_uri(emfs->emft);
-
+
if (text && path && !strchr (text, '/'))
g_signal_emit_by_name (emfs, "response", GTK_RESPONSE_OK);
g_free(path);
@@ -253,15 +253,15 @@ em_folder_selector_create_new (EMFolderTree *emft, guint32 flags, const char *ti
{
EMFolderSelector *emfs;
GtkWidget *hbox, *w;
-
+
/* remove the CREATE flag if it is there since that's the
* whole purpose of this dialog */
flags &= ~EM_FOLDER_SELECTOR_CAN_CREATE;
-
+
emfs = g_object_new (em_folder_selector_get_type (), NULL);
em_folder_selector_construct (emfs, emft, flags, title, text, _("Create"));
em_folder_tree_set_excluded(emft, EMFT_EXCLUDE_NOINFERIORS);
-
+
hbox = gtk_hbox_new (FALSE, 0);
w = gtk_label_new_with_mnemonic (_("Folder _name:"));
gtk_box_pack_start ((GtkBox *) hbox, w, FALSE, FALSE, 6);
@@ -271,11 +271,11 @@ em_folder_selector_create_new (EMFolderTree *emft, guint32 flags, const char *ti
g_signal_connect (emfs->name_entry, "activate", G_CALLBACK (emfs_create_name_activate), emfs);
gtk_box_pack_start ((GtkBox *) hbox, (GtkWidget *) emfs->name_entry, TRUE, FALSE, 6);
gtk_widget_show_all (hbox);
-
+
gtk_box_pack_start ((GtkBox *) ((GtkDialog *) emfs)->vbox, hbox, FALSE, TRUE, 0);
-
+
gtk_widget_grab_focus ((GtkWidget *) emfs->name_entry);
-
+
return (GtkWidget *) emfs;
}
@@ -297,28 +297,28 @@ em_folder_selector_get_selected_uri (EMFolderSelector *emfs)
{
char *uri;
const char *name;
-
+
if (!(uri = em_folder_tree_get_selected_uri (emfs->emft))) {
d(printf ("no selected folder?\n"));
return NULL;
}
-
+
if (uri && emfs->name_entry) {
CamelProvider *provider;
CamelURL *url;
char *newpath;
-
+
provider = camel_provider_get(uri, NULL);
-
+
name = gtk_entry_get_text (emfs->name_entry);
-
+
url = camel_url_new (uri, NULL);
if (provider && (provider->url_flags & CAMEL_URL_FRAGMENT_IS_PATH)) {
if (url->fragment)
newpath = g_strdup_printf ("%s/%s", url->fragment, name);
else
newpath = g_strdup (name);
-
+
camel_url_set_fragment (url, newpath);
} else {
char *path;
@@ -331,17 +331,17 @@ em_folder_selector_get_selected_uri (EMFolderSelector *emfs)
} else
newpath = path;
}
-
+
g_free (emfs->selected_path);
emfs->selected_path = newpath;
-
+
g_free (emfs->selected_uri);
emfs->selected_uri = camel_url_to_string (url, 0);
-
+
camel_url_free (url);
uri = emfs->selected_uri;
}
-
+
return uri;
}
@@ -361,7 +361,7 @@ const char *
em_folder_selector_get_selected_path (EMFolderSelector *emfs)
{
char *uri, *path;
-
+
if (emfs->selected_path) {
/* already did the work in a previous call */
return emfs->selected_path;
@@ -377,7 +377,7 @@ em_folder_selector_get_selected_path (EMFolderSelector *emfs)
if (emfs->name_entry) {
const char *name;
char *newpath;
-
+
name = gtk_entry_get_text (emfs->name_entry);
newpath = g_strdup_printf ("%s/%s", path?path:"", name);
Toshok2003-04-083-0/+42 * [ fixes bug #40841 ] change the Save As VCard keybinding to C-A-s, toChris Toshok2003-04-082-1/+7 * [ fixes #40212 ] change accelerator for Save As... to Control-Shift-sChris Toshok2003-03-273-4/+12 * remove conduit settings as a separate entryJP Rosevear2003-03-212-1/+4 * Make "MessageReplyList" and "MessagePostReply" have no pixbuf. Same withEttore Perazzoli2003-03-013-6/+9 * Fix an attributes typo.Hans Petter Jansson2003-02-242-1/+5 * Fix an attributes typo and add stock icon identifiers to silence warningHans Petter Jansson2003-02-242-17/+28 * (uidir): Removed (this is now defined inEttore Perazzoli2003-01-232-17/+21 * Typo fixedAndrew V. Samoilov2002-12-271-1/+1 * Change hlook value for "Toolbar" to be "both_horiz". Likewise. Likewise.Ettore Perazzoli2002-11-218-7/+18 * Change hlook value for Toolbar to beEttore Perazzoli2002-11-212-1/+6 * (uidir): Install in $(datadir)/gnome-2.0/ui.Ettore Perazzoli2002-11-042-1/+5 * Set the pixtype for command "Settings" toEttore Perazzoli2002-10-282-1/+8 * Made tooltips more clear.Jeffrey Stedfast2002-10-162-3/+7 * Remove "..." from "Remove Other User's Folder" since it doesn't pop up aDan Winship2002-10-052-1/+6 * It's a grand old string-review! Nitpicky and minor changes; details in the ap...Aaron Weber2002-10-013-2/+9 * Add FileRemoveOtherUsersFolderDan Winship2002-10-012-1/+10 * Change the accelerator of ToolsSubscriptions to be "u".Ettore Perazzoli2002-09-303-2/+11 * Make the Zoom accels the same as galeon so people will shut the fuck upJeffrey Stedfast2002-09-262-3/+9 * Add back "period" and "comma" asEttore Perazzoli2002-09-052-2/+9 * Use bracketright and bracketleft forEttore Perazzoli2002-09-042-2/+7 * New placeholder at FolderPopup/StorageFolderPropertiesPlaceholder.Ettore Perazzoli2002-08-072-0/+7 * Change the order so that "New Contact" is first and "New Contact List" isEttore Perazzoli2002-08-012-13/+5 * Move File/New/NewItems placeholder on the top and add some separators.Ettore Perazzoli2002-07-273-32/+46 * Add a View/Post-To ui dingus.Jeffrey Stedfast2002-07-263-0/+22 * Use *Control*equal and *Control*minusEttore Perazzoli2002-07-242-2/+8 * Bind MessageMove to Control-Shift-V. [#24394]Ettore Perazzoli2002-07-243-7/+25 * changed accel for HTML from T to M to avoid conflict with other menuLarry Ewing2002-07-242-1/+6 * removed Insert file from composers menu + forgotten signature editorRadek Doulik2002-07-233-10/+7 * Add a tooltip to the Save item as per bug 27901.Peter Williams2002-07-192-0/+6 * Change shortcut for "PilotSettings" to be `l'Ettore Perazzoli2002-07-192-1/+7 * Add a Control-Return accel for "FileSaveClose".Ettore Perazzoli2002-07-164-3/+16 * Add an accelerator for "FileClose".Ettore Perazzoli2002-07-122-1/+5 * Add accelerator for "Print Preview", "Delete".Ettore Perazzoli2002-07-113-3/+13 * s/Edit as New Message/Resend - this was confusing people. Also moved it toJeffrey Stedfast2002-07-102-2/+4 * s/Edit as New Message/Resend - this was confusing people.Jeffrey Stedfast2002-07-102-1/+6 * s/now// for "Send this message now" tooltipJeffrey Stedfast2002-07-061-1/+1 * Removed the Send Later verb.Jeffrey Stedfast2002-07-062-4/+4 * Added a bunch of tooltips.Ettore Perazzoli2002-07-022-3/+13 * add a 'stop' menu item (fixes ximian #17242)jacob berkman2002-06-073-0/+8 * Put the search menu in a SearchPlaceholder.Ettore Perazzoli2002-05-232-3/+6 * Add a toolbar item for ActionScheduleMeeting.Ettore Perazzoli2002-05-213-1/+20 * Replaced q binding with ` for hiding/showing the message view pane.Christopher James Lahey2002-05-143-11/+34 * Add FileOpenOtherUsersFolder.Ettore Perazzoli2002-05-112-0/+9 * Fix bad xml.Dan Winship2002-04-092-1/+5 * Added missing </submenu> tag. Remove bogus "Dump" menu item.Ettore Perazzoli2002-04-042-161/+162 * eek, we don't want 2 seps in a rowJeffrey Stedfast2002-03-281-2/+0 * Removed the "Mail Settings" stuff.Jeffrey Stedfast2002-03-283-8/+10 * Move the ComponentActionsPlaceholder into the Actions menu, instead of theEttore Perazzoli2002-03-219-45/+65 * [Start implementing the new Search Bar design.]Ettore Perazzoli2002-03-162-0/+6 * Remove "Settings" item.Ettore Perazzoli2002-03-152-12/+4 * oops.JP Rosevear2002-03-151-1/+2 * remove duplicate new items in the file and action menusJP Rosevear2002-03-152-15/+4 * remove duplicate new items in the file and action menusJP Rosevear2002-03-152-29/+5 * Remove the "Tasks Settings..." menu item.Ettore Perazzoli2002-03-144-21/+10 * Add an entry to invoke the new unified config dialog.Ettore Perazzoli2002-03-132-6/+17 * doh. In my previous commit, a whole bunch of changes that were supposed toAnna Marie Dirks2002-03-122-60/+8 * moved format menu, avoided two separatorsRadek Doulik2002-03-092-13/+14 * added FormatHTMLRadek Doulik2002-03-092-0/+12 * Fixed tiny typo ("Addressbook", not "Address book"), and cleaned upAnna Marie Dirks2002-03-082-12/+76 * added save & close on toolbar, added C-s shortcutRadek Doulik2002-03-082-1/+7 * added Print & PrintPreview stuff.Damon Chaplin2002-03-052-0/+19 * Add NewComboButton and a separator.Ettore Perazzoli2002-02-226-26/+18 * Added Copy to Folder and Move to Folder in the Actions menu here.Christopher James Lahey2002-02-142-1/+15 * Added pixbufs to MarkAsImportant, MarkAsRead and MarkAsUnread. Also addedJeffrey Stedfast2002-02-132-11/+34 * add new meeting item to Actions and File->NewJP Rosevear2002-02-082-1/+10 * Changed "Forward As" to "Forward" to improve grammar ("Forward As" impliesAnna Marie Dirks2002-02-062-6/+10 * Add MessageRedirect.Jeffrey Stedfast2002-01-302-0/+10 * From addressbook/ChangeLog:Christopher James Lahey2002-01-182-0/+11 * Remove "Dump" menu item.Ettore Perazzoli2002-01-172-1/+4 * for all separators, add a unique (per xml file) name to each separator, soMichael Meeks2002-01-1616-81/+100 * add a mark as complete itemJP Rosevear2002-01-042-2/+10 * make spacing consistent with calendar xml file, add expunge command andJP Rosevear2002-01-043-62/+82 * Add an "Add Sender to Address Book" menu item.Jeffrey Stedfast2001-12-072-0/+12 * Merging changes:Christopher James Lahey2001-12-012-10/+12 * Renamed the cut/copy/paste/delete command/item/verb names to beFederico Mena Quintero2001-10-312-10/+14 * change Save into Save and close, don't break the string freeze in theLarry Ewing2001-10-313-18/+38 * Added an EncodingPlaceholder, shuffled around the items for the Edit menuEttore Perazzoli2001-10-302-2/+10 * Remove separator from the end of the "View" menu.Ettore Perazzoli2001-10-302-2/+5 * Fix the verb names for the pixmaps in the Edit menu; they were out ofFederico Mena Quintero2001-10-301-16/+11 * Comment out the "Action" submenu, which isn't hooked up to anything in theJon Trowbridge2001-10-282-0/+8 * add separator before text size menuLarry Ewing2001-10-262-4/+10 * ChangeLog fix.Chris Lahey2001-10-241-1/+1 * Added Delete and BackSpace keybindings here.Christopher James Lahey2001-10-242-0/+10 * Added an accelerator (H_TML) to the Format->Html menu item.Anna Marie Dirks2001-10-23