~evfool/midori/lp792536

« back to all changes in this revision

Viewing changes to midori/midori-websettings.c

  • Committer: Christian Dywan
  • Date: 2009-03-19 17:28:50 UTC
  • Revision ID: git-v1:7af8baee8bdd5cbfcfb24ff5e2c304c25094d385
Initial support for WebKitDownload

At this point all downloads run automatically and appear in the
statusbar. The destination folder can be chosen in the preferences.
Download can be cancelled. The context menu works as well.

Show diffs side-by-side

added added

removed removed

Lines of Context:
291
291
                                  GValue*     value,
292
292
                                  GParamSpec* pspec);
293
293
 
 
294
static const gchar*
 
295
midori_get_download_dir (void)
 
296
{
 
297
    const gchar* dir = g_get_user_special_dir (G_USER_DIRECTORY_DOWNLOAD);
 
298
    if (dir)
 
299
    {
 
300
        g_mkdir_with_parents (dir, 0700);
 
301
        return dir;
 
302
    }
 
303
    return g_get_home_dir ();
 
304
}
 
305
 
294
306
static void
295
307
midori_web_settings_class_init (MidoriWebSettingsClass* class)
296
308
{
525
537
                                     "download-folder",
526
538
                                     _("Download Folder"),
527
539
                                     _("The folder downloaded files are saved to"),
528
 
                                     g_get_home_dir (),
529
 
                                     G_PARAM_READABLE));
 
540
                                     midori_get_download_dir (),
 
541
    #if WEBKIT_CHECK_VERSION (1, 1, 3)
 
542
                                     G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
543
    #else
 
544
                                     G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
 
545
    #endif
530
546
 
531
547
    g_object_class_install_property (gobject_class,
532
548
                                     PROP_DOWNLOAD_MANAGER,
584
600
                                     TRUE,
585
601
                                     flags));
586
602
 
587
 
    g_type_class_ref (WEBKIT_TYPE_WEB_VIEW);
588
603
    g_object_class_install_property (gobject_class,
589
604
                                     PROP_OPEN_NEW_PAGES_IN,
590
605
                                     g_param_spec_enum (
845
860
static void
846
861
midori_web_settings_init (MidoriWebSettings* web_settings)
847
862
{
 
863
    web_settings->download_folder = g_strdup (midori_get_download_dir ());
848
864
    web_settings->http_proxy = NULL;
849
865
    web_settings->open_popups_in_tabs = TRUE;
850
866
    web_settings->remember_last_form_inputs = TRUE;