static void saveSingleSpeedLimit(tr_variant* d, tr_torrent* tor, tr_direction dir) { tr_variantDictReserve(d, 3); tr_variantDictAddInt(d, TR_KEY_speed_Bps, tr_torrentGetSpeedLimit_Bps(tor, dir)); tr_variantDictAddBool(d, TR_KEY_use_global_speed_limit, tr_torrentUsesSessionLimits(tor)); tr_variantDictAddBool(d, TR_KEY_use_speed_limit, tr_torrentUsesSpeedLimit(tor, dir)); }
/** * This is where we initialize the preferences file with the default values. * If you add a new preferences key, you /must/ add a default value here. */ static void tr_prefs_init_defaults (tr_variant * d) { const char * dir; dir = g_get_user_special_dir (G_USER_DIRECTORY_DOWNLOAD); if (dir == NULL) dir = g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP); if (dir == NULL) dir = tr_getDefaultDownloadDir (); tr_variantDictReserve (d, 29); tr_variantDictAddStr (d, TR_KEY_watch_dir, dir); tr_variantDictAddBool (d, TR_KEY_watch_dir_enabled, FALSE); tr_variantDictAddBool (d, TR_KEY_user_has_given_informed_consent, FALSE); tr_variantDictAddBool (d, TR_KEY_inhibit_desktop_hibernation, FALSE); tr_variantDictAddBool (d, TR_KEY_blocklist_updates_enabled, TRUE); tr_variantDictAddStr (d, TR_KEY_open_dialog_dir, g_get_home_dir ()); tr_variantDictAddBool (d, TR_KEY_show_toolbar, TRUE); tr_variantDictAddBool (d, TR_KEY_show_filterbar, TRUE); tr_variantDictAddBool (d, TR_KEY_show_statusbar, TRUE); tr_variantDictAddBool (d, TR_KEY_trash_can_enabled, TRUE); tr_variantDictAddBool (d, TR_KEY_show_notification_area_icon, FALSE); tr_variantDictAddBool (d, TR_KEY_show_tracker_scrapes, FALSE); tr_variantDictAddBool (d, TR_KEY_show_extra_peer_details, FALSE); tr_variantDictAddBool (d, TR_KEY_show_backup_trackers, FALSE); tr_variantDictAddStr (d, TR_KEY_statusbar_stats, "total-ratio"); tr_variantDictAddBool (d, TR_KEY_torrent_added_notification_enabled, true); tr_variantDictAddBool (d, TR_KEY_torrent_complete_notification_enabled, true); tr_variantDictAddStr (d, TR_KEY_torrent_complete_sound_command, "canberra-gtk-play -i complete-download -d 'transmission torrent downloaded'"); tr_variantDictAddBool (d, TR_KEY_torrent_complete_sound_enabled, true); tr_variantDictAddBool (d, TR_KEY_show_options_window, TRUE); tr_variantDictAddBool (d, TR_KEY_main_window_is_maximized, FALSE); tr_variantDictAddInt (d, TR_KEY_main_window_height, 500); tr_variantDictAddInt (d, TR_KEY_main_window_width, 300); tr_variantDictAddInt (d, TR_KEY_main_window_x, 50); tr_variantDictAddInt (d, TR_KEY_main_window_y, 50); tr_variantDictAddStr (d, TR_KEY_download_dir, dir); tr_variantDictAddStr (d, TR_KEY_sort_mode, "sort-by-name"); tr_variantDictAddBool (d, TR_KEY_sort_reversed, FALSE); tr_variantDictAddBool (d, TR_KEY_compact_view, FALSE); }