Rename Config class and source file to match code style
Rename `Configuration` => `Application.Configuration` and `geary-config.vala to `application-config.vala`. Update call sites and test cases.
This commit is contained in:
parent
8f2563bc09
commit
e426517b30
30 changed files with 96 additions and 82 deletions
|
|
@ -18,6 +18,7 @@ src/client/application/application-attachment-manager.vala
|
|||
src/client/application/application-avatar-store.vala
|
||||
src/client/application/application-certificate-manager.vala
|
||||
src/client/application/application-command.vala
|
||||
src/client/application/application-configuration.vala
|
||||
src/client/application/application-contact-store.vala
|
||||
src/client/application/application-contact.vala
|
||||
src/client/application/application-controller.vala
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ public class Accounts.SignatureWebView : ClientWebView {
|
|||
}
|
||||
|
||||
|
||||
public SignatureWebView(Configuration config) {
|
||||
public SignatureWebView(Application.Configuration config) {
|
||||
base(config);
|
||||
this.user_content_manager.add_script(SignatureWebView.app_script);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,26 +7,27 @@
|
|||
/**
|
||||
* Provides convenience properties to current Geary GSettings values.
|
||||
*/
|
||||
public class Configuration {
|
||||
public class Application.Configuration {
|
||||
|
||||
public const string WINDOW_WIDTH_KEY = "window-width";
|
||||
|
||||
public const string ASK_OPEN_ATTACHMENT_KEY = "ask-open-attachment";
|
||||
public const string AUTOSELECT_KEY = "autoselect";
|
||||
public const string COMPOSER_WINDOW_SIZE_KEY = "composer-window-size";
|
||||
public const string COMPOSE_AS_HTML_KEY = "compose-as-html";
|
||||
public const string CONVERSATION_VIEWER_ZOOM_KEY = "conversation-viewer-zoom";
|
||||
public const string DISPLAY_PREVIEW_KEY = "display-preview";
|
||||
public const string FOLDER_LIST_PANE_HORIZONTAL_KEY = "folder-list-pane-horizontal";
|
||||
public const string FOLDER_LIST_PANE_POSITION_HORIZONTAL_KEY = "folder-list-pane-position-horizontal";
|
||||
public const string FOLDER_LIST_PANE_POSITION_KEY = "folder-list-pane-position";
|
||||
public const string FOLDER_LIST_PANE_POSITION_VERTICAL_KEY = "folder-list-pane-position-vertical";
|
||||
public const string MESSAGES_PANE_POSITION_KEY = "messages-pane-position";
|
||||
public const string SEARCH_STRATEGY_KEY = "search-strategy";
|
||||
public const string SPELL_CHECK_LANGUAGES = "spell-check-languages";
|
||||
public const string SPELL_CHECK_VISIBLE_LANGUAGES = "spell-check-visible-languages";
|
||||
public const string STARTUP_NOTIFICATIONS_KEY = "startup-notifications";
|
||||
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 FOLDER_LIST_PANE_POSITION_HORIZONTAL_KEY = "folder-list-pane-position-horizontal";
|
||||
public const string FOLDER_LIST_PANE_POSITION_VERTICAL_KEY = "folder-list-pane-position-vertical";
|
||||
public const string FOLDER_LIST_PANE_HORIZONTAL_KEY = "folder-list-pane-horizontal";
|
||||
public const string MESSAGES_PANE_POSITION_KEY = "messages-pane-position";
|
||||
public const string AUTOSELECT_KEY = "autoselect";
|
||||
public const string DISPLAY_PREVIEW_KEY = "display-preview";
|
||||
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 const string SPELL_CHECK_VISIBLE_LANGUAGES = "spell-check-visible-languages";
|
||||
public const string SPELL_CHECK_LANGUAGES = "spell-check-languages";
|
||||
public const string SEARCH_STRATEGY_KEY = "search-strategy";
|
||||
public const string CONVERSATION_VIEWER_ZOOM_KEY = "conversation-viewer-zoom";
|
||||
public const string COMPOSER_WINDOW_SIZE_KEY = "composer-window-size";
|
||||
public const string WINDOW_WIDTH_KEY = "window-width";
|
||||
|
||||
|
||||
public enum DesktopEnvironment {
|
||||
|
|
@ -197,7 +197,7 @@ public class GearyApplication : Gtk.Application {
|
|||
* This will be null until {@link startup} has been called, and
|
||||
* hence will only ever become non-null for the primary instance.
|
||||
*/
|
||||
public Configuration? config {
|
||||
public Application.Configuration? config {
|
||||
get; private set; default = null;
|
||||
}
|
||||
|
||||
|
|
@ -393,7 +393,7 @@ public class GearyApplication : Gtk.Application {
|
|||
Environment.set_application_name(NAME);
|
||||
Util.International.init(GETTEXT_PACKAGE, this.binary);
|
||||
|
||||
Configuration.init(this.is_installed, GSETTINGS_DIR);
|
||||
Application.Configuration.init(this.is_installed, GSETTINGS_DIR);
|
||||
Geary.Logging.init();
|
||||
Geary.Logging.log_to(stderr);
|
||||
GLib.Log.set_writer_func(Geary.Logging.default_log_writer);
|
||||
|
|
@ -408,7 +408,7 @@ public class GearyApplication : Gtk.Application {
|
|||
// Calls Gtk.init(), amongst other things
|
||||
base.startup();
|
||||
|
||||
this.config = new Configuration(SCHEMA_ID);
|
||||
this.config = new Application.Configuration(SCHEMA_ID);
|
||||
this.autostart = new Application.StartupManager(
|
||||
this.config, this.get_desktop_directory()
|
||||
);
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ public abstract class ClientWebView : WebKit.WebView, Geary.BaseInterface {
|
|||
/**
|
||||
* Initialises WebKit.WebContext for use by the client.
|
||||
*/
|
||||
public static void init_web_context(Configuration config,
|
||||
public static void init_web_context(Application.Configuration config,
|
||||
File web_extension_dir,
|
||||
File cache_dir) {
|
||||
WebsiteDataManager data_manager = new WebsiteDataManager(cache_dir.get_path());
|
||||
|
|
@ -107,7 +107,9 @@ public abstract class ClientWebView : WebKit.WebView, Geary.BaseInterface {
|
|||
});
|
||||
|
||||
update_spellcheck(context, config);
|
||||
config.settings.changed[Configuration.SPELL_CHECK_LANGUAGES].connect(() => {
|
||||
config.settings.changed[
|
||||
Application.Configuration.SPELL_CHECK_LANGUAGES
|
||||
].connect(() => {
|
||||
update_spellcheck(context, config);
|
||||
});
|
||||
|
||||
|
|
@ -181,7 +183,7 @@ public abstract class ClientWebView : WebKit.WebView, Geary.BaseInterface {
|
|||
}
|
||||
|
||||
private static inline void update_spellcheck(WebKit.WebContext context,
|
||||
Configuration config) {
|
||||
Application.Configuration config) {
|
||||
context.set_spell_checking_enabled(config.spell_check_languages.length > 0);
|
||||
context.set_spell_checking_languages(config.spell_check_languages);
|
||||
}
|
||||
|
|
@ -296,7 +298,7 @@ public abstract class ClientWebView : WebKit.WebView, Geary.BaseInterface {
|
|||
public signal void remote_image_load_blocked();
|
||||
|
||||
|
||||
protected ClientWebView(Configuration config,
|
||||
protected ClientWebView(Application.Configuration config,
|
||||
WebKit.UserContentManager? custom_manager = null) {
|
||||
WebKit.Settings setts = new WebKit.Settings();
|
||||
setts.allow_modal_dialogs = false;
|
||||
|
|
@ -357,7 +359,7 @@ public abstract class ClientWebView : WebKit.WebView, Geary.BaseInterface {
|
|||
);
|
||||
|
||||
// Manage zoom level, ensure it's sane
|
||||
config.bind(Configuration.CONVERSATION_VIEWER_ZOOM_KEY, this, "zoom_level");
|
||||
config.bind(Application.Configuration.CONVERSATION_VIEWER_ZOOM_KEY, this, "zoom_level");
|
||||
if (this.zoom_level < ZOOM_MIN) {
|
||||
this.zoom_level = ZOOM_MIN;
|
||||
} else if (this.zoom_level > ZOOM_MAX) {
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public class Components.InspectorLogView : Gtk.Grid {
|
|||
public signal void record_selection_changed();
|
||||
|
||||
|
||||
public InspectorLogView(Configuration config,
|
||||
public InspectorLogView(Application.Configuration config,
|
||||
Geary.AccountInformation? filter_by = null) {
|
||||
GLib.Settings system = config.gnome_interface;
|
||||
system.bind(
|
||||
|
|
|
|||
|
|
@ -58,13 +58,17 @@ public class MainToolbar : Gtk.Box {
|
|||
private Gtk.Image delete_image = new Gtk.Image.from_icon_name("edit-delete-symbolic", Gtk.IconSize.MENU);
|
||||
|
||||
|
||||
public MainToolbar(Configuration config) {
|
||||
public MainToolbar(Application.Configuration config) {
|
||||
// Sync headerbar width with left pane
|
||||
config.bind(Configuration.MESSAGES_PANE_POSITION_KEY, this, "left-pane-width",
|
||||
SettingsBindFlags.GET);
|
||||
config.bind(
|
||||
Application.Configuration.MESSAGES_PANE_POSITION_KEY,
|
||||
this,
|
||||
"left-pane-width",
|
||||
SettingsBindFlags.GET
|
||||
);
|
||||
this.bind_property("left-pane-width", this.folder_header, "width-request", BindingFlags.SYNC_CREATE);
|
||||
|
||||
if (config.desktop_environment != Configuration.DesktopEnvironment.UNITY) {
|
||||
if (config.desktop_environment != UNITY) {
|
||||
this.bind_property("account", this.folder_header, "title", BindingFlags.SYNC_CREATE);
|
||||
this.bind_property("folder", this.folder_header, "subtitle", BindingFlags.SYNC_CREATE);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -690,21 +690,22 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
|
|||
this.folder_list.remove_account(to_remove);
|
||||
}
|
||||
|
||||
private void load_config(Configuration config) {
|
||||
private void load_config(Application.Configuration config) {
|
||||
// This code both loads AND saves the pane positions with live updating. This is more
|
||||
// resilient against crashes because the value in dconf changes *immediately*, and
|
||||
// stays saved in the event of a crash.
|
||||
config.bind(Configuration.MESSAGES_PANE_POSITION_KEY, this.conversations_paned, "position");
|
||||
config.bind(Configuration.WINDOW_WIDTH_KEY, this, "window-width");
|
||||
config.bind(Configuration.WINDOW_HEIGHT_KEY, this, "window-height");
|
||||
config.bind(Configuration.WINDOW_MAXIMIZE_KEY, this, "window-maximized");
|
||||
config.bind(Application.Configuration.MESSAGES_PANE_POSITION_KEY, this.conversations_paned, "position");
|
||||
config.bind(Application.Configuration.WINDOW_WIDTH_KEY, this, "window-width");
|
||||
config.bind(Application.Configuration.WINDOW_HEIGHT_KEY, this, "window-height");
|
||||
config.bind(Application.Configuration.WINDOW_MAXIMIZE_KEY, this, "window-maximized");
|
||||
// Update to layout
|
||||
if (config.folder_list_pane_position_horizontal == -1) {
|
||||
config.folder_list_pane_position_horizontal = config.folder_list_pane_position_old;
|
||||
config.messages_pane_position += config.folder_list_pane_position_old;
|
||||
}
|
||||
config.settings.changed[Configuration.FOLDER_LIST_PANE_HORIZONTAL_KEY]
|
||||
.connect(on_change_orientation);
|
||||
config.settings.changed[
|
||||
Application.Configuration.FOLDER_LIST_PANE_HORIZONTAL_KEY
|
||||
].connect(on_change_orientation);
|
||||
}
|
||||
|
||||
private void restore_saved_window_state() {
|
||||
|
|
@ -801,7 +802,7 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
|
|||
}
|
||||
}
|
||||
|
||||
private void setup_layout(Configuration config) {
|
||||
private void setup_layout(Application.Configuration config) {
|
||||
this.notify["has-toplevel-focus"].connect(on_has_toplevel_focus);
|
||||
|
||||
// Search bar
|
||||
|
|
@ -841,7 +842,7 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
|
|||
BindingFlags.SYNC_CREATE | BindingFlags.BIDIRECTIONAL);
|
||||
this.main_toolbar.bind_property("find-open", this.conversation_viewer.conversation_find_bar,
|
||||
"search-mode-enabled", BindingFlags.SYNC_CREATE | BindingFlags.BIDIRECTIONAL);
|
||||
if (config.desktop_environment == Configuration.DesktopEnvironment.UNITY) {
|
||||
if (config.desktop_environment == UNITY) {
|
||||
BindingTransformFunc title_func = (binding, source, ref target) => {
|
||||
string folder = selected_folder != null ? selected_folder.get_display_name() + " " : "";
|
||||
string account = main_toolbar.account != null ? "(%s)".printf(main_toolbar.account) : "";
|
||||
|
|
@ -1340,8 +1341,9 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
|
|||
}
|
||||
|
||||
this.application.config.bind(
|
||||
horizontal ? Configuration.FOLDER_LIST_PANE_POSITION_HORIZONTAL_KEY
|
||||
: Configuration.FOLDER_LIST_PANE_POSITION_VERTICAL_KEY,
|
||||
horizontal
|
||||
? Application.Configuration.FOLDER_LIST_PANE_POSITION_HORIZONTAL_KEY
|
||||
: Application.Configuration.FOLDER_LIST_PANE_POSITION_VERTICAL_KEY,
|
||||
this.folder_paned, "position");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
[GtkTemplate (ui = "/org/gnome/Geary/composer-headerbar.ui")]
|
||||
public class ComposerHeaderbar : Gtk.HeaderBar {
|
||||
|
||||
public Configuration config { get; set; }
|
||||
public Application.Configuration config { get; set; }
|
||||
|
||||
public ComposerWidget.ComposerState state { get; set; }
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ public class ComposerHeaderbar : Gtk.HeaderBar {
|
|||
/** Fired when the user wants to expand a compact composer. */
|
||||
public signal void expand_composer();
|
||||
|
||||
public ComposerHeaderbar(Configuration config, bool is_compact) {
|
||||
public ComposerHeaderbar(Application.Configuration config, bool is_compact) {
|
||||
this.config = config;
|
||||
|
||||
this.recipients_button.set_visible(is_compact);
|
||||
|
|
@ -64,7 +64,7 @@ public class ComposerHeaderbar : Gtk.HeaderBar {
|
|||
}
|
||||
|
||||
private void set_detach_button_side() {
|
||||
if (config.desktop_environment == Configuration.DesktopEnvironment.UNITY) {
|
||||
if (config.desktop_environment == UNITY) {
|
||||
detach_start.visible = false;
|
||||
detach_end.visible = true;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ public class ComposerWebView : ClientWebView {
|
|||
internal signal bool button_release_event_done(Gdk.Event event);
|
||||
|
||||
|
||||
public ComposerWebView(Configuration config) {
|
||||
public ComposerWebView(Application.Configuration config) {
|
||||
base(config);
|
||||
|
||||
add_events(Gdk.EventMask.KEY_PRESS_MASK | Gdk.EventMask.KEY_RELEASE_MASK);
|
||||
|
|
|
|||
|
|
@ -2168,7 +2168,7 @@ public class ComposerWidget : Gtk.EventBox, Geary.BaseInterface {
|
|||
|
||||
private void on_select_dictionary(SimpleAction action, Variant? param) {
|
||||
if (this.spell_check_popover == null) {
|
||||
Configuration config = this.application.config;
|
||||
Application.Configuration config = this.application.config;
|
||||
this.spell_check_popover = new SpellCheckPopover(
|
||||
this.select_dictionary_button, config
|
||||
);
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ public class ComposerWindow : Gtk.ApplicationWindow, ComposerContainer {
|
|||
|
||||
add(this.composer);
|
||||
|
||||
if (application.config.desktop_environment == Configuration.DesktopEnvironment.UNITY) {
|
||||
if (application.config.desktop_environment == UNITY) {
|
||||
composer.embed_header();
|
||||
} else {
|
||||
composer.header.show_close_button = true;
|
||||
|
|
@ -129,7 +129,7 @@ public class ComposerWindow : Gtk.ApplicationWindow, ComposerContainer {
|
|||
}
|
||||
|
||||
switch (this.application.config.desktop_environment) {
|
||||
case Configuration.DesktopEnvironment.UNITY:
|
||||
case UNITY:
|
||||
this.title = subject;
|
||||
break;
|
||||
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ public class SpellCheckPopover {
|
|||
private Gtk.SearchEntry search_box;
|
||||
private Gtk.ScrolledWindow view;
|
||||
private Gtk.Box content;
|
||||
private Configuration config;
|
||||
private Application.Configuration config;
|
||||
|
||||
private enum SpellCheckStatus {
|
||||
INACTIVE,
|
||||
|
|
@ -175,7 +175,7 @@ public class SpellCheckPopover {
|
|||
|
||||
}
|
||||
|
||||
public SpellCheckPopover(Gtk.Widget button, Configuration config) {
|
||||
public SpellCheckPopover(Gtk.Widget button, Application.Configuration config) {
|
||||
this.popover = new Gtk.Popover(button);
|
||||
this.config = config;
|
||||
this.selected_rows = new GLib.GenericSet<string>(GLib.str_hash, GLib.str_equal);
|
||||
|
|
|
|||
|
|
@ -110,8 +110,9 @@ public class ConversationListStore : Gtk.ListStore {
|
|||
this.email_store = new Geary.App.EmailStore(
|
||||
conversations.base_folder.account
|
||||
);
|
||||
GearyApplication.instance.config.settings.changed[Configuration.DISPLAY_PREVIEW_KEY].connect(
|
||||
on_display_preview_changed);
|
||||
GearyApplication.instance.config.settings.changed[
|
||||
Application.Configuration.DISPLAY_PREVIEW_KEY
|
||||
].connect(on_display_preview_changed);
|
||||
|
||||
conversations.scan_completed.connect(on_scan_completed);
|
||||
conversations.conversations_added.connect(on_conversations_added);
|
||||
|
|
|
|||
|
|
@ -56,8 +56,9 @@ public class ConversationListView : Gtk.TreeView, Geary.BaseInterface {
|
|||
Gtk.drag_source_set(this, Gdk.ModifierType.BUTTON1_MASK, FolderList.Tree.TARGET_ENTRY_LIST,
|
||||
Gdk.DragAction.COPY | Gdk.DragAction.MOVE);
|
||||
|
||||
GearyApplication.instance.config.settings.changed[Configuration.DISPLAY_PREVIEW_KEY].connect(
|
||||
on_display_preview_changed);
|
||||
GearyApplication.instance.config.settings.changed[
|
||||
Application.Configuration.DISPLAY_PREVIEW_KEY
|
||||
].connect(on_display_preview_changed);
|
||||
|
||||
// Watch for mouse events.
|
||||
motion_notify_event.connect(on_motion_notify_event);
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ public class ConversationEmail : Gtk.Box, Geary.BaseInterface {
|
|||
// Cancellable to use when loading message content
|
||||
private GLib.Cancellable load_cancellable;
|
||||
|
||||
private Configuration config;
|
||||
private Application.Configuration config;
|
||||
|
||||
private Geary.TimeoutManager body_loading_timeout;
|
||||
|
||||
|
|
@ -280,7 +280,7 @@ public class ConversationEmail : Gtk.Box, Geary.BaseInterface {
|
|||
Geary.Email email,
|
||||
Geary.App.EmailStore email_store,
|
||||
Application.ContactStore contacts,
|
||||
Configuration config,
|
||||
Application.Configuration config,
|
||||
bool is_sent,
|
||||
bool is_draft,
|
||||
GLib.Cancellable load_cancellable) {
|
||||
|
|
|
|||
|
|
@ -515,7 +515,7 @@ public class ConversationListBox : Gtk.ListBox, Geary.BaseInterface {
|
|||
private Application.ContactStore contacts;
|
||||
|
||||
// App config
|
||||
private Configuration config;
|
||||
private Application.Configuration config;
|
||||
|
||||
// Cancellable for this conversation's data loading.
|
||||
private Cancellable cancellable = new Cancellable();
|
||||
|
|
@ -610,7 +610,7 @@ public class ConversationListBox : Gtk.ListBox, Geary.BaseInterface {
|
|||
bool suppress_mark_timer,
|
||||
Geary.App.EmailStore email_store,
|
||||
Application.ContactStore contacts,
|
||||
Configuration config,
|
||||
Application.Configuration config,
|
||||
Gtk.Adjustment adjustment) {
|
||||
base_ref();
|
||||
this.conversation = conversation;
|
||||
|
|
|
|||
|
|
@ -228,7 +228,7 @@ public class ConversationMessage : Gtk.Grid, Geary.BaseInterface {
|
|||
// The message headers represented by this view
|
||||
private Geary.EmailHeaderSet headers;
|
||||
|
||||
private Configuration config;
|
||||
private Application.Configuration config;
|
||||
|
||||
// Store from which to lookup contacts
|
||||
private Application.ContactStore contacts;
|
||||
|
|
@ -357,7 +357,7 @@ public class ConversationMessage : Gtk.Grid, Geary.BaseInterface {
|
|||
public ConversationMessage.from_email(Geary.Email email,
|
||||
bool load_remote_resources,
|
||||
Application.ContactStore contacts,
|
||||
Configuration config) {
|
||||
Application.Configuration config) {
|
||||
this(
|
||||
email,
|
||||
email.preview != null ? email.preview.buffer.get_valid_utf8() : null,
|
||||
|
|
@ -377,7 +377,7 @@ public class ConversationMessage : Gtk.Grid, Geary.BaseInterface {
|
|||
public ConversationMessage.from_message(Geary.RFC822.Message message,
|
||||
bool load_remote_resources,
|
||||
Application.ContactStore contacts,
|
||||
Configuration config) {
|
||||
Application.Configuration config) {
|
||||
this(
|
||||
message,
|
||||
message.get_preview(),
|
||||
|
|
@ -391,7 +391,7 @@ public class ConversationMessage : Gtk.Grid, Geary.BaseInterface {
|
|||
string? preview,
|
||||
bool load_remote_resources,
|
||||
Application.ContactStore contacts,
|
||||
Configuration config) {
|
||||
Application.Configuration config) {
|
||||
base_ref();
|
||||
this.headers = headers;
|
||||
this.load_remote_resources = load_remote_resources;
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ public class ConversationViewer : Gtk.Stack, Geary.BaseInterface {
|
|||
get; private set; default = null;
|
||||
}
|
||||
|
||||
private Configuration config;
|
||||
private Application.Configuration config;
|
||||
|
||||
private Gee.Set<Geary.App.Conversation>? selection_while_composing = null;
|
||||
private GLib.Cancellable? find_cancellable = null;
|
||||
|
|
@ -71,7 +71,7 @@ public class ConversationViewer : Gtk.Stack, Geary.BaseInterface {
|
|||
/**
|
||||
* Constructs a new conversation view instance.
|
||||
*/
|
||||
public ConversationViewer(Configuration config) {
|
||||
public ConversationViewer(Application.Configuration config) {
|
||||
base_ref();
|
||||
this.config = config;
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,7 @@ public class ConversationWebView : ClientWebView {
|
|||
);
|
||||
|
||||
|
||||
public ConversationWebView(Configuration config) {
|
||||
public ConversationWebView(Application.Configuration config) {
|
||||
base(config);
|
||||
this.user_content_manager.add_script(ConversationWebView.app_script);
|
||||
this.user_content_manager.add_style_sheet(ConversationWebView.app_stylesheet);
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ public class AttachmentDialog : Object {
|
|||
private const int PREVIEW_SIZE = 180;
|
||||
private const int PREVIEW_PADDING = 3;
|
||||
|
||||
private Configuration config;
|
||||
private Application.Configuration config;
|
||||
|
||||
private Gtk.FileChooserNative? chooser = null;
|
||||
|
||||
|
|
@ -20,7 +20,7 @@ public class AttachmentDialog : Object {
|
|||
|
||||
public delegate bool Attacher(File attachment_file, bool alert_errors = true);
|
||||
|
||||
public AttachmentDialog(Gtk.Window? parent, Configuration config) {
|
||||
public AttachmentDialog(Gtk.Window? parent, Application.Configuration config) {
|
||||
this.config = config;
|
||||
this.chooser = new Gtk.FileChooserNative(_("Choose a file"), parent, Gtk.FileChooserAction.OPEN, _("_Attach"), Stock._CANCEL);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,11 +29,11 @@ public class PreferencesDialog : Gtk.Dialog {
|
|||
set_titlebar(this.header);
|
||||
this.app = app;
|
||||
|
||||
Configuration config = app.config;
|
||||
config.bind(Configuration.AUTOSELECT_KEY, autoselect, "active");
|
||||
config.bind(Configuration.DISPLAY_PREVIEW_KEY, display_preview, "active");
|
||||
config.bind(Configuration.FOLDER_LIST_PANE_HORIZONTAL_KEY, three_pane_view, "active");
|
||||
config.bind(Configuration.STARTUP_NOTIFICATIONS_KEY, startup_notifications, "active");
|
||||
Application.Configuration config = app.config;
|
||||
config.bind(Application.Configuration.AUTOSELECT_KEY, autoselect, "active");
|
||||
config.bind(Application.Configuration.DISPLAY_PREVIEW_KEY, display_preview, "active");
|
||||
config.bind(Application.Configuration.FOLDER_LIST_PANE_HORIZONTAL_KEY, three_pane_view, "active");
|
||||
config.bind(Application.Configuration.STARTUP_NOTIFICATIONS_KEY, startup_notifications, "active");
|
||||
}
|
||||
|
||||
public new void run() {
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ geary_client_vala_sources = files(
|
|||
'application/application-avatar-store.vala',
|
||||
'application/application-certificate-manager.vala',
|
||||
'application/application-command.vala',
|
||||
'application/application-configuration.vala',
|
||||
'application/application-contact-store.vala',
|
||||
'application/application-contact.vala',
|
||||
'application/application-controller.vala',
|
||||
|
|
@ -11,7 +12,6 @@ geary_client_vala_sources = files(
|
|||
'application/application-plugin-manager.vala',
|
||||
'application/application-startup-manager.vala',
|
||||
'application/geary-application.vala',
|
||||
'application/geary-config.vala',
|
||||
'application/goa-mediator.vala',
|
||||
'application/secret-mediator.vala',
|
||||
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ public class Plugin.DesktopNotifications : Notification {
|
|||
|
||||
/* We do not show notification action under Unity */
|
||||
|
||||
if (this.application.config.desktop_environment == Configuration.DesktopEnvironment.UNITY) {
|
||||
if (this.application.config.desktop_environment == UNITY) {
|
||||
this.application.send_notification(id, notification);
|
||||
return notification;
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* (version 2.1 or later). See the COPYING file in this distribution.
|
||||
*/
|
||||
|
||||
class ConfigurationTest : TestCase {
|
||||
public class Application.ConfigurationTest : TestCase {
|
||||
|
||||
private Configuration test_config = null;
|
||||
|
||||
|
|
@ -9,11 +9,11 @@
|
|||
public abstract class ClientWebViewTestCase<V> : TestCase {
|
||||
|
||||
protected V? test_view = null;
|
||||
protected Configuration? config = null;
|
||||
protected Application.Configuration? config = null;
|
||||
|
||||
protected ClientWebViewTestCase(string name) {
|
||||
base(name);
|
||||
this.config = new Configuration(GearyApplication.SCHEMA_ID);
|
||||
this.config = new Application.Configuration(GearyApplication.SCHEMA_ID);
|
||||
this.config.enable_debug = true;
|
||||
ClientWebView.init_web_context(
|
||||
this.config,
|
||||
|
|
|
|||
|
|
@ -14,7 +14,9 @@ public class ClientWebViewTest : TestCase {
|
|||
}
|
||||
|
||||
public void init_web_context() throws Error {
|
||||
Configuration config = new Configuration(GearyApplication.SCHEMA_ID);
|
||||
Application.Configuration config = new Application.Configuration(
|
||||
GearyApplication.SCHEMA_ID
|
||||
);
|
||||
config.enable_debug = true;
|
||||
ClientWebView.init_web_context(
|
||||
config,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ class ClientPageStateTest : ClientWebViewTestCase<ClientWebView> {
|
|||
|
||||
private class TestClientWebView : ClientWebView {
|
||||
|
||||
public TestClientWebView(Configuration config) {
|
||||
public TestClientWebView(Application.Configuration config) {
|
||||
base(config);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -80,8 +80,8 @@ geary_test_client_sources = [
|
|||
'engine/api/geary-credentials-mediator-mock.vala',
|
||||
|
||||
'client/accounts/accounts-manager-test.vala',
|
||||
'client/application/application-configuration-test.vala',
|
||||
'client/application/geary-application-test.vala',
|
||||
'client/application/geary-configuration-test.vala',
|
||||
'client/components/client-web-view-test.vala',
|
||||
'client/components/client-web-view-test-case.vala',
|
||||
'client/composer/composer-web-view-test.vala',
|
||||
|
|
|
|||
|
|
@ -49,9 +49,9 @@ int main(string[] args) {
|
|||
// Keep this before other ClientWebView based tests since it tests
|
||||
// WebContext init
|
||||
client.add_suite(new Accounts.ManagerTest().get_suite());
|
||||
client.add_suite(new Application.ConfigurationTest().get_suite());
|
||||
client.add_suite(new ClientWebViewTest().get_suite());
|
||||
client.add_suite(new ComposerWebViewTest().get_suite());
|
||||
client.add_suite(new ConfigurationTest().get_suite());
|
||||
client.add_suite(new GearyApplicationTest().get_suite());
|
||||
client.add_suite(new Util.Avatar.Test().get_suite());
|
||||
client.add_suite(new Util.Cache.Test().get_suite());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue