aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-folder-utils.c
blob: 05fcb4b06491c57dc6c9468d49387fab2bc144b5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620<!-- <!DOCTYPE Chapter PUBLIC "-//GNOME//DTD DocBook PNG Variant V1.1//EN"> -->

<chapter id="config-prefs">

      <title>Advanced Configuration</title>
      <para>
        Perhaps your mail server has changed names.  Perhaps you've
        grown tired of a certain layout for your appointments.
        Whatever the reason, you want to change your
        <application>Evolution</application> settings.  This chapter
        will tell you how to do just that.
      </para>

       <sect1 id="config-prefs-mail">
         <title>Mail Settings</title>
        <para>
        To change your mail settings, select <menuchoice>
        <guimenu>Settings</guimenu> <guimenuitem>Mail
        configuration</guimenuitem></menuchoice> in the Inbox.  This
        will open the <interface>mail preferences window</interface>,
        illustrated in <xref linkend="config-prefs-mail-fig">.  Mail
        preferences are separated into several categories:
        <variablelist>
    <varlistentry>
          <term><guilabel>Identities</guilabel></term>
          <listitem>
        <para>
               This allows you to create and alter one or more
               identities for your email.
        </para>
      </listitem>
    </varlistentry>
    <varlistentry>
      <term><guilabel>Sources</guilabel></term>
      <listitem>
        <para>
               This tab lets you tell
               <application>Evolution</application> where to get the
               mail sent to you, and how to get it.
            </para>
          </listitem>
    </varlistentry>
    <varlistentry>

      <term><guilabel>Mail Transport</guilabel></term>
      <listitem>
        <para>
               This tab lets you tell
               <application>Evolution</application> how to send mail.
            </para>
          </listitem>
    </varlistentry>

    <varlistentry>
      <term><guilabel>News Servers</guilabel></term>
      <listitem>
        <para>
              If you would like to use
              <application>Evolution</application> to read newsgroups,
              you can specify your news server preferences here.
           </para>
      </listitem>
    </varlistentry>



    <varlistentry>
      <term><guilabel>Other</guilabel></term>
      <listitem>
        <para>
              Miscellaneous mail and news settings, such as HTML
              handling preferences, and how long
              <application>Evolution</application> should wait before
              marking message read.
           </para>
      </listitem>
    </varlistentry>
      </variablelist>

    </para>

      <!-- ==============Figure===================== -->
      <figure id="config-prefs-mail-fig">
    <title>Mail Preferences Dialog</title>
    <screenshot>
      <screeninfo>Setting mail preferences</screeninfo>
      <graphic fileref="fig/config-mail" format="png" srccredit="Aaron Weber">
        </graphic>
    </screenshot>
      </figure>
      <!-- ==============End of Figure================-->


      <sect2 id="config-prefs-mail-identity">
      <title>Identity Settings</title> 
      <para>
         If you have only one email account, or send email from only
         one address, you will only need to configure one identity. If
         you want, however, you can have multiple identities.  This
         can be useful if you want to keep personal and professional
         email separate, or if you wear several hats at work.
         
       </para>
       <para>
         To add a new identity, simply click
         <guibutton>Add</guibutton>. To alter an existing identity,
         click on it in the <guilabel>Identity</guilabel> tab of the
         <interface>Preferences</interface> window, and then click
         <guibutton>Edit</guibutton>.
      </para>

      <para>
         <application>Evolution</application> will then present you
         with a dialog box containing four fields:
          <itemizedlist>
           <listitem>
        <para>
              <guilabel>Full Name:</guilabel> by default, this is the
              same name as the full name described in your user
              account on your computer.  You can select another if you
              wish.
            </para>
      </listitem>
           <listitem>
        <para>
              <guilabel>Email address:</guilabel> Enter your email
              address in this space.
            </para>
      </listitem>
           <listitem>
        <para>
              <guilabel>Organization:</guilabel> If you send email as
              a representative of a company or other organization,
              enter its name here.
            </para>
      </listitem>
           <listitem>
        <para>
              <guilabel>Signature file:</guilabel> You may choose a
              small text file to be appended to every message that you
              send.  Typically, signature files include address or
              other contact information, or a favorite quotation.
              It's good form to keep it to four lines at the maximum.
            </para>
      </listitem>
    </itemizedlist>
      </para>
    </sect2>

    <sect2 id="config-prefs-mail-network">
      <title>Network Settings</title> 
      <para>
        In order to send mail with
        <application>Evolution</application>, you need to connect to
        your network.  To do that, you'll need to know your user name
        and password, what sort of mail sending and receiving
        protocols your network uses, and the names of the servers
        you'll be using.  If you're switching from another groupware
        or email program, you can almost certainly use the same
        settings as you did with that program. Network-related
        settings are in the <guilabel>Mail Sources</guilabel> and
        <guilabel>Mail Transport</guilabel> tabs.
      </para>
 
      <sect3 id="config-prefs-network-sources">
    <title>Mail Sources</title>
    <para>
          The <interface>Mail Sources</interface> tab allows you to
          edit, add, or delete methods of retrieving mail from
          servers.  Clicking on <guibutton>Add</guibutton> or
          <guibutton>Edit</guibutton> will bring up a dialog box to
          offer you the following options:
           <variablelist>
        <varlistentry>
          <term><guilabel>Mail source type:</guilabel></term>
          <listitem>
        <para>
                  Select from IMAP or POP servers, or Unix-style
                  <systemitem><filename>mbox</filename></systemitem>
                  or <systemitem><filename>mh</filename></systemitem>
                  files.
                </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term> <guilabel>Server:</guilabel></term>
          <listitem>
        <para>
                  Enter the name of the mail source server in this
                  field. If you use an  may or may not be the same as your
                  <glossterm>SMTP</glossterm> server.
                </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term><guilabel>Username:</guilabel></term>
          <listitem>
        <para>
                  Enter the user name for the account you have on the
                  server-- this should the part of your email address
                  before the @.  If you use
                  <systemitem><filename>mbox</filename></systemitem>
                  or <systemitem><filename>mh</filename></systemitem>
                  files as your mail source, you do not need to enter
                  a username.
                </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term><guilabel>Authentication:</guilabel></term>
          <listitem>
        <para>
                  Tell <application>Evolution</application> how to
                  verify your identity with the server.  Your options
                  vary depending upon the type of server you are
                  using, and the ways it is configured.  Given the
                  name of a server,
                  <application>Evolution</application> can detect what
                  sorts of authentication it offers.
               </para>
          </listitem>
        </varlistentry>
        <varlistentry>
          <term><guilabel>Test Settings</guilabel></term>
          <listitem>
        <para>
                  Click this button to have
                  <application>Evolution</application> check to see if
                  mail sources are configured correctly.
                </para>
          </listitem>
        </varlistentry>
      </variablelist>
          </para>
          <para>
            If you have several mail sources, clicking <guibutton>Get
            Mail</guibutton> will refresh any IMAP,
            <systemitem><filename>mh</filename></systemitem>, or
            <systemitem><filename>mbox</filename></systemitem>
            listings and check and download mail from all POP servers.
            In other words, <guibutton>Get Mail</guibutton> gets your
            mail, no matter how many sources you have, or what types
            they are.
          </para>
      </sect3>

      <sect3 id="config-prefs-mail-network-transports">
    <title>Mail Transports</title>
    <para>
           The <interface>Mail Transports</interface> tab lets you set
           how you will send mail.  Evolution currently supports two
           mail transport options: <guilabel>SMTP</guilabel>, which
           uses a remote mail server, and
           <guilabel>sendmail</guilabel>, which uses the
           <application>sendmail</application> program on your local
           system.  <application>Sendmail</application> is more
           difficult to configure, but offers more flexibility than
           <systemitem>SMTP</systemitem>.
        </para>
    <para>
            To use <guilabel>SMTP</guilabel>, you'll need to enter the
            name of your SMTP server.  It may have the same name as
            your mail source server.
         </para>
         <para>
            <application>Evolution</application> can attempt to
            determine if you have entered a valid server name.  To
            have it do so, click the <guilabel>Test
            Settings</guilabel> button.
         </para>
    </sect3>
      </sect2>
      <sect2 id="config-prefs-network-news">          
          <title>News Servers</title>
          <para>
            Newsgroups are so much like mailing lists that there's no
            reason not to keep them right next to your mail.  When you
            first select the <guilabel>News Servers</guilabel> tab,
            you will see a blank box with the three familiar buttons
            on the right: <guibutton>Add</guibutton>,
            <guibutton>Edit</guibutton>, and
            <guibutton>Delete</guibutton>.
          </para>
          <para>
            Click <guibutton>Add</guibutton> to add a news server; you
            will be prompted for its name.  Enter the name, click
            <guibutton>OK</guibutton>, and you're done.  You can have
            as many mail servers as you like, of course.  News servers
            will appear next to your IMAP servers in the
            <interface>folder bar</interface>.
          </para>
     </sect2>

     <sect2 id="config-prefs-mail-other">
    <title>Other Mail Preferences</title>
    <para>
          Not everything fits neatly into categories.  This tab
          contains some miscellaneous configurations that don't have
          too much to do with each other.
          <variablelist>

             <varlistentry>
                <term> 
                   <guilabel>Send messages in HTML format</guilabel>
                </term>
                <listitem><para>
                    If you check this box, you will send
                    messages as HTML by default.  If you leave it unchecked, your
                    messages will be sent without HTML formatting unless you select 
                    <menuchoice> <guimenu>Format</guimenu> <guimenuitem>HTML</guimenuitem>
                    </menuchoice> in the message composer.
                    See <xref linkend="usage-mail-getnsend-send-html">
                    for more information about HTML mail.
                </para></listitem>
              </varlistentry>
             <varlistentry>
                <term> 
                   <guilabel>Mark Messages as Seen After</guilabel>
                </term>
                <listitem><para> 
                    When you click on a message,
                    <application>Evolution</application> will wait a
                    moment before marking it as seen. You can set the
                    delay, in milliseconds, here.
                 </para></listitem>
              </varlistentry>
              <varlistentry>
                <term>
                   <guilabel>Folder Format</guilabel>
                </term>
                <listitem> <para> By default,
                   <application>Evolution</application> saves its mail
                   in the
                   <systemitem><filename>mbox</filename></systemitem>
                   format. You can switch to the
                   <systemitem><filename>mh</filename></systemitem>
                   format if you like.  Note that this is an advanced
                   feature and may cause you to lose some messages, so
                   you should probably make a backup of your
                   <systemitem><filename>evolution</filename></systemitem>
                   directory first. In addition, it will take quite
                   some time if you have a large mailbox.
               </para></listitem>
             goto exception;
            else if (m->delete && !deleted)
                deleting = g_list_prepend (deleting, info);

            /* subscribe to the new folder if appropriate */
            if (camel_store_supports_subscriptions (m->tostore)
                && !camel_store_folder_is_subscribed (m->tostore, toname->str))
                camel_store_subscribe_folder_sync (
                    m->tostore, toname->str, NULL, NULL);

            info = info->next;
        }
    }

    /* Delete the folders in reverse order from how we copied them,
     * if we are deleting any. */
    l = deleting;
    while (l) {
        CamelFolderInfo *info = l->data;

        d(<graphic fileref="fig/config-cal" format="png" srccredit="Aaron Weber">
        </graphic>
    </screenshot>
      </figure>
      <!-- ==============End of Figure================-->
        </para>

    <sect2 id="config-prefs-cal-time">
      <title>Time Display Settings</title>
      <para>
        The <guilabel>Time display</guilabel> tab lets you set the
        following:
        <variablelist>
      <varlistentry>
        <term>Time format</term>
            m->fromstore, info->full_name, NULL, NULL);
        l = l->next;
    }

 exception:

    camel_store_free_folder_info (m->fromstore, fi);
    g_list_free (deleting);

    g_string_free (toname, TRUE);
    g_string_free (fromname, TRUE);
}

static void
emft_copy_folders__free (struct _EMCopyFolders *m)
{
    g_object_unref (m->fromstore);
    g_object_unref (m->tostore);

    g_free (m->frombase);
    g_free (m->tobase);
}

static MailMsgInfo copy_folders_info = {
    sizeof (struct _EMCopyFolders),
    (MailMsgDescFunc) emft_copy_folders__desc,
    (MailMsgExecFunc) emft_copy_folders__exec,
    (MailMsgDoneFunc) NULL,
    (MailMsgFreeFunc) emft_copy_folders__free
};

gint
em_folder_utils_copy_folders (CamelStore *fromstore,
                              const gchar *frombase,
                              CamelStore *tostore,
                              const gchar *tobase,
                              gint delete)
{
    struct _EMCopyFolders *m;
    gint seq;

    m = mail_msg_new (&copy_folders_info);
    g_object_ref (fromstore);
    m->fromstore = fromstore;
    g_object_ref (tostore);
    m->tostore = tostore;
    m->frombase = g_strdup (frombase);
    m->tobase = g_strdup (tobase);
    m->delete = delete;
    seq = m->base.seq;

    mail_msg_unordered_push (m);

    return seq;
}

struct _copy_folder_data {
    CamelStore *source_store;
    gchar </listitem>

      <listitem>
        <para> <guilabel>To-Do item that is not yet
             due:</guilabel> Text color for To-Do list items that are
             not yet due.  (Or maybe background color? find out!)
               </para>
      </listitem>


      <listitem>
        <para> <guilabel>To-Do item that is due today:</guilabel>
             Text color for today's tasks.
               </para>
      </listitem>

      <listitem>
        <para> <guilabel>To-Do item that is overdue:</guilabel>
             Text color for overdue tasks.
               </para>
      </listitem>

          </itemizedlist>
        </para>
    </sect2>

    <sect2 id="config-prefs-cal-todo">
      <title>To Do List Settings</title>
     <para>
       You can choose what information the To Do list displays and the
       way it is displayed.  The two areas of the <interface>To Do
       List</interface> tab offer several options each:
       <variablelist>
     <varlistentry>
       <term>Show on To Do List</term>
        <listitem>
          <para>
                This box contains three items.  If you select the
                check boxes next to them, that information will appear
                in the To Do list for each task it contains:
                <itemizedlist>
                  <listitem>
            <para><guilabel>Due Date</guilabel></para>
                   </listitem>
                  <listitem>
            <para><guilabel>Time Until Due</guilabel></para>
                   </listitem>
                  <listitem>
            <para><guilabel>Priority</guilabel></para>
                   </listitem>
               </itemizedlist>
               </para>
        </listitem>
      </varlistentry>
      <varlistentry>
        <term>Style Options</term>
        <listitem>
               <para>
                 Select among the following checkboxes to determine
                 how your To Do list will look:
                <itemizedlist>
                  <listitem>
            <para><guilabel>Highlight overdue items</guilabel></para>
                   </listitem>
                  <listitem>
            <para><guilabel>Highlight items due today</guilabel></para>
                   </listitem>
                  <listitem>
            <para><guilabel>Highlight not yet due items</guilabel></para>
                   </listitem>
               </itemizedlist>                 
               </para>
        </listitem>
      </varlistentry>
    </variablelist>
      </para>
    </sect2>

    <sect2 id="config-prefs-cal-alarms">
      <title>Alarms Settings</title>
      <para>  
        The <interface>alarms tab</interface> enables you to select from three boxes:
        <itemizedlist>
      <listitem>
        <para><guilabel>Beep on display alarms</guilabel>: select
        this box to have <application>Evolution</application> beep
        at you for any alarms you have set.  If you leave this box
        unchecked, <application>Evolution</application> will only
        alert you to events by opening a dialog box. These beeps
        are distinct from full-fledged audio alarms.
           </para>
      </listitem>
      <listitem>
        <para><guilabel>Audio alarms timeout after: </guilabel>
        Select this button to have your audio alarms stop
        automatically after a certain number of seconds.  </para>
      </listitem>
      <listitem>
        <para><guilabel>Enable snoozing for:</guilabel> If you
        would like to have the option to tell
        <application>Evolution</application> to repeat an alarm in
        a few minutes, select this button and decide how long
        you'd like it to wait.
           </para>
      </listitem>
    </itemizedlist>   
      </para>
    </sect2>

   </sect1>

   <sect1 id="config-prefs-contact">
      <title>Managing the Contact Manager</title>
    <para>
          To set the behavior of your Contact Manager, click on the
          <guibutton>Contact Manager</guibutton> tab in the
          <interface>Preferences</interface> window.
        </para>
    <para>
          You can set the following options: <!--insert variable list
          here-->
        </para>
      </sect1>
    


  <sect1 id="config-prefs-general">
    <title>General Preferences</title> 
    <para>
          Additional configuration options will be covered here, as
          they become available.
        </para>
  </sect1>
</chapter>
    





const gchar *uid; gint fromvfolder, tovfolder; guint flags; /* handles moving to/from vfolders */ uid = camel_service_get_uid (CAMEL_SERVICE (cfd->source_store)); fromvfolder = (g_strcmp0 (uid, "vfolder") == 0); gtk_tree_model_get ( model, iter, COL_UINT_FLAGS, &flags, COL_POINTER_CAMEL_STORE, &store, -1); uid = camel_service_get_uid (CAMEL_SERVICE (store)); tovfolder = (g_strcmp0 (uid, "vfolder") == 0); /* moving from vfolder to normal- not allowed */ if (fromvfolder && !tovfolder && cfd->delete) return FALSE; /* copy/move from normal folder to vfolder - not allowed */ if (!fromvfolder && tovfolder) return FALSE; /* copying to vfolder - not allowed */ if (tovfolder && !cfd->delete) return FALSE; return (flags & EMFT_EXCLUDE_NOINFERIORS) == 0; } void em_folder_utils_copy_folder (GtkWindow *parent, EMailBackend *backend, const gchar *folder_uri, gint delete) { GtkWidget *dialog; EMFolderSelector *selector; EMFolderTree *folder_tree; EMailSession *session; const gchar *label; const gchar *title; struct _copy_folder_data *cfd; GError *error = NULL; g_return_if_fail (E_IS_MAIL_BACKEND (backend)); g_return_if_fail (folder_uri != NULL); session = e_mail_backend_get_session (backend); cfd = g_malloc (sizeof (*cfd)); cfd->delete = delete; e_mail_folder_uri_parse ( CAMEL_SESSION (session), folder_uri, &cfd->source_store, &cfd->source_folder_name, &error); if (error != NULL) { g_warning ("%s", error->message); g_error_free (error); g_free (cfd); return; } label = delete ? _("_Move") : _("C_opy"); title = delete ? _("Move Folder To") : _("Copy Folder To"); dialog = em_folder_selector_new ( parent, backend, EM_FOLDER_SELECTOR_CAN_CREATE, title, NULL, label); selector = EM_FOLDER_SELECTOR (dialog); folder_tree = em_folder_selector_get_folder_tree (selector); em_folder_tree_set_excluded_func ( folder_tree, emfu_copy_folder_exclude, cfd); if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) { const gchar *uri; uri = em_folder_selector_get_selected_uri (selector); emfu_copy_folder_selected (backend, uri, cfd); } gtk_widget_destroy (dialog); } static void new_folder_created_cb (CamelStore *store, GAsyncResult *result, AsyncContext *context) { GError *error = NULL; e_mail_store_create_folder_finish (store, result, &error); /* FIXME Use an EActivity here. */ if (error != NULL) { g_warning ("%s", error->message); g_error_free (error); } else if (context->folder_tree != NULL) { gpointer data; gboolean expand_only; /* XXX What in the hell kind of lazy hack is this? */ data = g_object_get_data ( G_OBJECT (context->folder_tree), "select"); expand_only = GPOINTER_TO_INT (data) ? TRUE : FALSE; em_folder_tree_set_selected ( context->folder_tree, context->folder_uri, expand_only); } async_context_free (context); } void em_folder_utils_create_folder (GtkWindow *parent, EMailBackend *backend, EMFolderTree *emft, const gchar *initial_uri) { EMailSession *session; EMFolderSelector *selector; EMFolderTree *folder_tree; CamelStore *store = NULL; const gchar *folder_uri; gchar *folder_name = NULL; GtkWidget *dialog; GError *error = NULL; g_return_if_fail (GTK_IS_WINDOW (parent)); g_return_if_fail (E_IS_MAIL_BACKEND (backend)); session = e_mail_backend_get_session (backend); dialog = em_folder_selector_create_new ( parent, backend, 0, _("Create Folder"), _("Specify where to create the folder:")); selector = EM_FOLDER_SELECTOR (dialog); folder_tree = em_folder_selector_get_folder_tree (selector); if (initial_uri != NULL) em_folder_tree_set_selected (folder_tree, initial_uri, FALSE); if (gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_OK) goto exit; folder_uri = em_folder_selector_get_selected_uri (selector); e_mail_folder_uri_parse ( CAMEL_SESSION (session), folder_uri, &store, &folder_name, &error); /* XXX This is unlikely to fail since the URI comes straight from * EMFolderSelector, but leave a breadcrumb if it does fail. */ if (error != NULL) { g_warn_if_fail (store == NULL); g_warn_if_fail (folder_name == NULL); g_warning ("%s", error->message); g_error_free (error); goto exit; } /* HACK: we need to create vfolders using the vfolder editor */ if (CAMEL_IS_VEE_STORE (store)) { EFilterRule *rule; rule = em_vfolder_rule_new (backend); e_filter_rule_set_name (rule, folder_name); vfolder_gui_add_rule (EM_VFOLDER_RULE (rule)); } else { AsyncContext *context; context = g_slice_new0 (AsyncContext); context->folder_uri = g_strdup (folder_uri); if (EM_IS_FOLDER_TREE (emft)) context->folder_tree = g_object_ref (emft); /* FIXME Not passing a GCancellable. */ e_mail_store_create_folder ( store, folder_name, G_PRIORITY_DEFAULT, NULL, (GAsyncReadyCallback) new_folder_created_cb, context); } g_free (folder_name); exit: gtk_widget_destroy (dialog); } const gchar * em_folder_utils_get_icon_name (guint32 flags) { const gchar *icon_name; switch (flags & CAMEL_FOLDER_TYPE_MASK) { case CAMEL_FOLDER_TYPE_INBOX: icon_name = "mail-inbox"; break; case CAMEL_FOLDER_TYPE_OUTBOX: icon_name = "mail-outbox"; break; case CAMEL_FOLDER_TYPE_TRASH: icon_name = "user-trash"; break; case CAMEL_FOLDER_TYPE_JUNK: icon_name = "mail-mark-junk"; break; case CAMEL_FOLDER_TYPE_SENT: icon_name = "mail-sent"; break; default: if (flags & CAMEL_FOLDER_SHARED_TO_ME) icon_name = "stock_shared-to-me"; else if (flags & CAMEL_FOLDER_SHARED_BY_ME) icon_name = "stock_shared-by-me"; else if (flags & CAMEL_FOLDER_VIRTUAL) icon_name = "folder-saved-search"; else icon_name = "folder"; } return icon_name; }