<commit_before>/* Copyright 2011-2015 Yorba Foundation
 *
 * This software is licensed under the GNU Lesser General Public License
 * (version 2.1 or later).  See the COPYING file in this distribution.
 */

// Wrapper class for GSettings.
public class Configuration {
    public const string WINDOW_WIDTH_KEY = "window-width";
    public const string WINDOW_HEIGHT_KEY = "window-height";
    public const string WINDOW_MAXIMIZE_KEY = "window-maximize";
    public const string FOLDER_LIST_PANE_POSITION_KEY = "folder-list-pane-position";
    public const string MESSAGES_PANE_POSITION_KEY = "messages-pane-position";
    public const string COMPOSER_PANE_POSITION_KEY = "composer-pane-position";
    public const string AUTOSELECT_KEY = "autoselect";
    public const string DISPLAY_PREVIEW_KEY = "display-preview";
    public const string SPELL_CHECK_KEY = "spell-check";
    public const string PLAY_SOUNDS_KEY = "play-sounds";
    public const string SHOW_NOTIFICATIONS_KEY = "show-notifications";
    public const string STARTUP_NOTIFICATIONS_KEY = "startup-notifications";
    public const string ASK_OPEN_ATTACHMENT_KEY = "ask-open-attachment";
    public const string COMPOSE_AS_HTML_KEY = "compose-as-html";
    
    public Settings settings { get; private set; }
    
    public Settings gnome_interface;
    private Settings? indicator_datetime;
    
    public int window_width {
        get { return settings.get_int(WINDOW_WIDTH_KEY); }
    }
    
    public int window_height {
        get { return settings.get_int(WINDOW_HEIGHT_KEY); }
    }
    
    public bool window_maximize {
        get { return settings.get_boolean(WINDOW_MAXIMIZE_KEY); }
    }
    
    public int folder_list_pane_position {
        get { return settings.get_int(FOLDER_LIST_PANE_POSITION_KEY); }
    }
    
    public int messages_pane_position {
        get { return settings.get_int(MESSAGES_PANE_POSITION_KEY); }
    }
    
    public int composer_pane_position {
        get { return settings.get_int(COMPOSER_PANE_POSITION_KEY); }
    }
    
    public bool autoselect {
        get { return settings.get_boolean(AUTOSELECT_KEY); }
    }
    
    public bool display_preview {
        get { return settings.get_boolean(DISPLAY_PREVIEW_KEY); }
    }
    
    public bool spell_check {
        get { return settings.get_boolean(SPELL_CHECK_KEY); }
    }

    public bool play_sounds {
        get { return settings.get_boolean(PLAY_SOUNDS_KEY); }
    }

    public bool show_notifications {
        get { return settings.get_boolean(SHOW_NOTIFICATIONS_KEY); }
    }

    public bool startup_notifications {
        get { return settings.get_boolean(STARTUP_NOTIFICATIONS_KEY); }
        set { set_boolean(STARTUP_NOTIFICATIONS_KEY, value); }
    }
    
    private const string CLOCK_FORMAT_KEY = "clock-format";
    private const string TIME_FORMAT_KEY = "time-format";
    public Date.ClockFormat clock_format {
        get {
            if (indicator_datetime != null) {
                string format = indicator_datetime.get_string(TIME_FORMAT_KEY);
                if (format == "12-hour")
                    return Date.ClockFormat.TWELVE_HOURS;
                else if (format == "24-hour")
                    return Date.ClockFormat.TWENTY_FOUR_HOURS;
                else {
                    // locale-default or custom
                    return Date.ClockFormat.LOCALE_DEFAULT;
                }
            }
            if (gnome_interface.get_string(CLOCK_FORMAT_KEY) == "12h")
                return Date.ClockFormat.TWELVE_HOURS;
            else
                return Date.ClockFormat.TWENTY_FOUR_HOURS;
        }
    }
    
    public bool ask_open_attachment {
        get { return settings.get_boolean(ASK_OPEN_ATTACHMENT_KEY); }<commit_msg>Only use Canonical's time format setting when running Unity<commit_after>/* Copyright 2011-2015 Yorba Foundation
 *
 * This software is licensed under the GNU Lesser General Public License
 * (version 2.1 or later).  See the COPYING file in this distribution.
 */

// Wrapper class for GSettings.
public class Configuration {
    public const string WINDOW_WIDTH_KEY = "window-width";
    public const string WINDOW_HEIGHT_KEY = "window-height";
    public const string WINDOW_MAXIMIZE_KEY = "window-maximize";
    public const string FOLDER_LIST_PANE_POSITION_KEY = "folder-list-pane-position";
    public const string MESSAGES_PANE_POSITION_KEY = "messages-pane-position";
    public const string COMPOSER_PANE_POSITION_KEY = "composer-pane-position";
    public const string AUTOSELECT_KEY = "autoselect";
    public const string DISPLAY_PREVIEW_KEY = "display-preview";
    public const string SPELL_CHECK_KEY = "spell-check";
    public const string PLAY_SOUNDS_KEY = "play-sounds";
    public const string SHOW_NOTIFICATIONS_KEY = "show-notifications";
    public const string STARTUP_NOTIFICATIONS_KEY = "startup-notifications";
    public const string ASK_OPEN_ATTACHMENT_KEY = "ask-open-attachment";
    public const string COMPOSE_AS_HTML_KEY = "compose-as-html";
    
    public Settings settings { get; private set; }
    
    public Settings gnome_interface;
    private Settings? indicator_datetime;
    
    public int window_width {
        get { return settings.get_int(WINDOW_WIDTH_KEY); }
    }
    
    public int window_height {
        get { return settings.get_int(WINDOW_HEIGHT_KEY); }
    }
    
    public bool window_maximize {
        get { return settings.get_boolean(WINDOW_MAXIMIZE_KEY); }
    }
    
    public int folder_list_pane_position {
        get { return settings.get_int(FOLDER_LIST_PANE_POSITION_KEY); }
    }
    
    public int messages_pane_position {
        get { return settings.get_int(MESSAGES_PANE_POSITION_KEY); }
    }
    
    public int composer_pane_position {
        get { return settings.get_int(COMPOSER_PANE_POSITION_KEY); }
    }
    
    public bool autoselect {
        get { return settings.get_boolean(AUTOSELECT_KEY); }
    }
    
    public bool display_preview {
        get { return settings.get_boolean(DISPLAY_PREVIEW_KEY); }
    }
    
    public bool spell_check {
        get { return settings.get_boolean(SPELL_CHECK_KEY); }
    }

    public bool play_sounds {
        get { return settings.get_boolean(PLAY_SOUNDS_KEY); }
    }

    public bool show_notifications {
        get { return settings.get_boolean(SHOW_NOTIFICATIONS_KEY); }
    }

    public bool startup_notifications {
        get { return settings.get_boolean(STARTUP_NOTIFICATIONS_KEY); }
        set { set_boolean(STARTUP_NOTIFICATIONS_KEY, value); }
    }
    
    private const string CLOCK_FORMAT_KEY = "clock-format";
    private const string TIME_FORMAT_KEY = "time-format";
    public Date.ClockFormat clock_format {
        get {
            if (GearyApplication.instance.is_running_unity && indicator_datetime != null) {
                string format = indicator_datetime.get_string(TIME_FORMAT_KEY);
                if (format == "12-hour")
                    return Date.ClockFormat.TWELVE_HOURS;
                else if (format == "24-hour")
                    return Date.ClockFormat.TWENTY_FOUR_HOURS;
                else {
                    // locale-default or custom
                    return Date.ClockFormat.LOCALE_DEFAULT;
                }
            }
            if (gnome_interface.get_string(CLOCK_FORMAT_KEY) == "12h")
                return Date.ClockFormat.TWELVE_HOURS;
            else
                return Date.ClockFormat.TWENTY_FOUR_HOURS;
        }
    }
    
    public bool ask_open_attachment {
        get { return settings.get_boolean(ASK_OPEN_ATTACHMENT_KEY); }
{'fraction_non_alphanumeric': 0.0741859243697479, 'fraction_numerical': 0.004201680672268907, 'mean_word_length': 2.7137981472452464, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7474170', 'n_tokens_mistral': 2336, 'n_tokens_neox': 2237, 'n_words': 493}