Move MainWindow to Application package
Move MainWindow out of the root namespace and add it to Application, so it can privately share internal state with the Controller. Rename the source and UI files to match.
This commit is contained in:
parent
56876365ba
commit
239fdce562
20 changed files with 120 additions and 75 deletions
|
|
@ -413,6 +413,7 @@ ui/accounts_editor_edit_pane.ui
|
|||
ui/accounts_editor_list_pane.ui
|
||||
ui/accounts_editor_remove_pane.ui
|
||||
ui/accounts_editor_servers_pane.ui
|
||||
ui/application-main-window.ui
|
||||
ui/certificate_warning_dialog.glade
|
||||
ui/composer-headerbar.ui
|
||||
ui/composer-link-popover.ui
|
||||
|
|
@ -437,7 +438,6 @@ ui/folder-popover.ui
|
|||
ui/gtk/help-overlay.ui
|
||||
ui/main-toolbar.ui
|
||||
ui/main-toolbar-menus.ui
|
||||
ui/main-window.ui
|
||||
ui/main-window-info-bar.ui
|
||||
ui/password-dialog.glade
|
||||
ui/preferences-dialog.ui
|
||||
|
|
|
|||
|
|
@ -6,8 +6,9 @@
|
|||
* (version 2.1 or later). See the COPYING file in this distribution.
|
||||
*/
|
||||
|
||||
[GtkTemplate (ui = "/org/gnome/Geary/main-window.ui")]
|
||||
public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
|
||||
[GtkTemplate (ui = "/org/gnome/Geary/application-main-window.ui")]
|
||||
public class Application.MainWindow :
|
||||
Gtk.ApplicationWindow, Geary.BaseInterface {
|
||||
|
||||
|
||||
// Named actions.
|
||||
|
|
@ -74,7 +75,7 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
|
|||
private const int MIN_CONVERSATION_COUNT = 50;
|
||||
|
||||
|
||||
public static void add_accelerators(Application.Client owner) {
|
||||
public static void add_accelerators(Client owner) {
|
||||
// Marking actions
|
||||
//
|
||||
// Unread is the primary action, so it doesn't get the <Shift>
|
||||
|
|
@ -159,8 +160,8 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
|
|||
|
||||
|
||||
/** Returns the window's associated client application instance. */
|
||||
public new Application.Client application {
|
||||
get { return (Application.Client) base.get_application(); }
|
||||
public new Client application {
|
||||
get { return (Client) base.get_application(); }
|
||||
set { base.set_application(value); }
|
||||
}
|
||||
|
||||
|
|
@ -176,14 +177,12 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
|
|||
}
|
||||
|
||||
/** The attachment manager for this window. */
|
||||
public Application.AttachmentManager attachments { get; private set; }
|
||||
public AttachmentManager attachments { get; private set; }
|
||||
|
||||
/** Determines if conversations in the selected folder can be trashed. */
|
||||
public bool selected_folder_supports_trash {
|
||||
get {
|
||||
return Application.Controller.does_folder_support_trash(
|
||||
this.selected_folder
|
||||
);
|
||||
return Controller.does_folder_support_trash(this.selected_folder);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -274,7 +273,7 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
|
|||
public signal void retry_service_problem(Geary.ClientService.Status problem);
|
||||
|
||||
|
||||
public MainWindow(Application.Client application) {
|
||||
public MainWindow(Client application) {
|
||||
Object(
|
||||
application: application,
|
||||
show_menubar: false
|
||||
|
|
@ -298,7 +297,7 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
|
|||
update_command_actions();
|
||||
update_conversation_actions(NONE);
|
||||
|
||||
this.attachments = new Application.AttachmentManager(this);
|
||||
this.attachments = new AttachmentManager(this);
|
||||
|
||||
this.application.engine.account_available.connect(on_account_available);
|
||||
this.application.engine.account_unavailable.connect(on_account_unavailable);
|
||||
|
|
@ -715,21 +714,21 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
|
|||
this.folder_list.remove_account(to_remove);
|
||||
}
|
||||
|
||||
private void load_config(Application.Configuration config) {
|
||||
private void load_config(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(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");
|
||||
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");
|
||||
// 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[
|
||||
Application.Configuration.FOLDER_LIST_PANE_HORIZONTAL_KEY
|
||||
Configuration.FOLDER_LIST_PANE_HORIZONTAL_KEY
|
||||
].connect(on_change_orientation);
|
||||
}
|
||||
|
||||
|
|
@ -827,7 +826,7 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
|
|||
}
|
||||
}
|
||||
|
||||
private void setup_layout(Application.Configuration config) {
|
||||
private void setup_layout(Configuration config) {
|
||||
this.notify["has-toplevel-focus"].connect(on_has_toplevel_focus);
|
||||
|
||||
// Search bar
|
||||
|
|
@ -874,7 +873,7 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
|
|||
string folder = selected_folder != null ? selected_folder.get_display_name() + " " : "";
|
||||
string account = main_toolbar.account != null ? "(%s)".printf(main_toolbar.account) : "";
|
||||
|
||||
target = "%s%s - %s".printf(folder, account, Application.Client.NAME);
|
||||
target = "%s%s - %s".printf(folder, account, Client.NAME);
|
||||
|
||||
return true;
|
||||
};
|
||||
|
|
@ -976,7 +975,7 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
|
|||
|
||||
/** Un-does the last executed application command, if any. */
|
||||
private async void undo() {
|
||||
Application.Controller.AccountContext? selected = this.context;
|
||||
Controller.AccountContext? selected = this.context;
|
||||
if (selected != null) {
|
||||
selected.commands.undo.begin(
|
||||
selected.cancellable,
|
||||
|
|
@ -993,7 +992,7 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
|
|||
|
||||
/** Re-does the last undone application command, if any. */
|
||||
private async void redo() {
|
||||
Application.Controller.AccountContext? selected = this.context;
|
||||
Controller.AccountContext? selected = this.context;
|
||||
if (selected != null) {
|
||||
selected.commands.redo.begin(
|
||||
selected.cancellable,
|
||||
|
|
@ -1009,7 +1008,7 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
|
|||
}
|
||||
|
||||
private void update_command_actions() {
|
||||
Application.Controller.AccountContext? selected = this.context;
|
||||
Controller.AccountContext? selected = this.context;
|
||||
get_edit_action(Action.Edit.UNDO).set_enabled(
|
||||
selected != null && selected.commands.can_undo
|
||||
);
|
||||
|
|
@ -1132,7 +1131,7 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
|
|||
this.main_toolbar.copy_folder_menu.clear();
|
||||
this.main_toolbar.move_folder_menu.clear();
|
||||
|
||||
Application.Controller.AccountContext? context = this.context;
|
||||
Controller.AccountContext? context = this.context;
|
||||
if (context != null) {
|
||||
context.commands.executed.disconnect(on_command_execute);
|
||||
context.commands.undone.disconnect(on_command_undo);
|
||||
|
|
@ -1195,7 +1194,7 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
|
|||
// last email was removed but the conversation monitor
|
||||
// hasn't signalled its removal yet. In this case,
|
||||
// just don't load it since it will soon disappear.
|
||||
Application.Controller.AccountContext? context = this.context;
|
||||
Controller.AccountContext? context = this.context;
|
||||
if (context != null && convo.get_count() > 0) {
|
||||
try {
|
||||
yield this.conversation_viewer.load_conversation(
|
||||
|
|
@ -1386,8 +1385,8 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
|
|||
|
||||
this.application.config.bind(
|
||||
horizontal
|
||||
? Application.Configuration.FOLDER_LIST_PANE_POSITION_HORIZONTAL_KEY
|
||||
: Application.Configuration.FOLDER_LIST_PANE_POSITION_VERTICAL_KEY,
|
||||
? Configuration.FOLDER_LIST_PANE_POSITION_HORIZONTAL_KEY
|
||||
: Configuration.FOLDER_LIST_PANE_POSITION_VERTICAL_KEY,
|
||||
this.folder_paned, "position");
|
||||
}
|
||||
|
||||
|
|
@ -1485,7 +1484,7 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
|
|||
|
||||
Gee.MultiMap<Geary.EmailIdentifier, Type>? selected_operations = null;
|
||||
if (this.selected_folder != null) {
|
||||
Application.Controller.AccountContext? context =
|
||||
Controller.AccountContext? context =
|
||||
this.application.controller.get_context_for_account(
|
||||
this.selected_folder.account.information
|
||||
);
|
||||
|
|
@ -1647,8 +1646,8 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
|
|||
update_ui();
|
||||
}
|
||||
|
||||
private void on_command_execute(Application.Command command) {
|
||||
if (!(command is Application.TrivialCommand)) {
|
||||
private void on_command_execute(Command command) {
|
||||
if (!(command is TrivialCommand)) {
|
||||
// Only show an execute notification for non-trivial
|
||||
// commands
|
||||
on_command_redo(command);
|
||||
|
|
@ -1659,9 +1658,9 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
|
|||
}
|
||||
}
|
||||
|
||||
private void on_command_undo(Application.Command command) {
|
||||
private void on_command_undo(Command command) {
|
||||
update_command_actions();
|
||||
Application.EmailCommand? email = command as Application.EmailCommand;
|
||||
EmailCommand? email = command as EmailCommand;
|
||||
if (email != null) {
|
||||
if (email.conversations.size > 1) {
|
||||
this.show_conversations.begin(
|
||||
|
|
@ -1681,7 +1680,7 @@ public class MainWindow : Gtk.ApplicationWindow, Geary.BaseInterface {
|
|||
}
|
||||
}
|
||||
|
||||
private void on_command_redo(Application.Command command) {
|
||||
private void on_command_redo(Command command) {
|
||||
update_command_actions();
|
||||
if (command.executed_label != null) {
|
||||
Components.InAppNotification ian =
|
||||
|
|
@ -369,7 +369,7 @@ public class Components.AttachmentPane : Gtk.Grid {
|
|||
}
|
||||
|
||||
private void open_attachments(Gee.Collection<Geary.Attachment> attachments) {
|
||||
MainWindow? main = this.get_toplevel() as MainWindow;
|
||||
var main = this.get_toplevel() as Application.MainWindow;
|
||||
if (main != null) {
|
||||
Application.Client app = main.application;
|
||||
bool confirmed = true;
|
||||
|
|
|
|||
|
|
@ -161,7 +161,9 @@ public class MainToolbar : Gtk.Box {
|
|||
);
|
||||
|
||||
if (this.show_trash_button) {
|
||||
this.trash_delete_button.action_name = "win."+MainWindow.ACTION_TRASH_CONVERSATION;
|
||||
this.trash_delete_button.action_name = Action.Window.prefix(
|
||||
Application.MainWindow.ACTION_TRASH_CONVERSATION
|
||||
);
|
||||
this.trash_delete_button.image = trash_image;
|
||||
this.trash_delete_button.tooltip_text = ngettext(
|
||||
"Move conversation to Trash",
|
||||
|
|
@ -169,7 +171,9 @@ public class MainToolbar : Gtk.Box {
|
|||
this.selected_conversations
|
||||
);
|
||||
} else {
|
||||
this.trash_delete_button.action_name = "win."+MainWindow.ACTION_DELETE_CONVERSATION;
|
||||
this.trash_delete_button.action_name = Action.Window.prefix(
|
||||
Application.MainWindow.ACTION_DELETE_CONVERSATION
|
||||
);
|
||||
this.trash_delete_button.image = delete_image;
|
||||
this.trash_delete_button.tooltip_text = ngettext(
|
||||
"Delete conversation",
|
||||
|
|
|
|||
|
|
@ -128,9 +128,9 @@ public class MainWindowInfoBar : Gtk.InfoBar {
|
|||
private void show_details() {
|
||||
Dialogs.ProblemDetailsDialog dialog =
|
||||
new Dialogs.ProblemDetailsDialog(
|
||||
get_toplevel() as MainWindow,
|
||||
get_toplevel() as Application.MainWindow,
|
||||
this.report
|
||||
);
|
||||
);
|
||||
dialog.run();
|
||||
dialog.destroy();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ public class SearchBar : Gtk.SearchBar {
|
|||
}
|
||||
|
||||
private void on_information_changed() {
|
||||
MainWindow? main = get_toplevel() as MainWindow;
|
||||
var main = get_toplevel() as Application.MainWindow;
|
||||
if (main != null) {
|
||||
set_search_placeholder_text(
|
||||
current_account == null ||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class ConversationListCellRenderer : Gtk.CellRenderer {
|
|||
// Recalculates size when the style changed.
|
||||
// Note: this must be called by the parent TreeView.
|
||||
public static void style_changed(Gtk.Widget widget) {
|
||||
MainWindow? window = widget.get_toplevel() as MainWindow;
|
||||
var window = widget.get_toplevel() as Application.MainWindow;
|
||||
if (window != null && example_data == null) {
|
||||
example_data = new FormattedConversationData.create_example(
|
||||
window.application.config
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ public class ConversationListView : Gtk.TreeView, Geary.BaseInterface {
|
|||
// composer.
|
||||
if (this.config.autoselect &&
|
||||
get_selection().count_selected_rows() == 0) {
|
||||
MainWindow? parent = get_toplevel() as MainWindow;
|
||||
var parent = get_toplevel() as Application.MainWindow;
|
||||
if (parent != null && !parent.has_composer) {
|
||||
set_cursor(new Gtk.TreePath.from_indices(0, -1), null, false);
|
||||
}
|
||||
|
|
@ -296,7 +296,7 @@ public class ConversationListView : Gtk.TreeView, Geary.BaseInterface {
|
|||
// doesn't attempt to load it then close it straight away.
|
||||
if (event.type == Gdk.EventType.BUTTON_PRESS &&
|
||||
!get_selection().path_is_selected(path)) {
|
||||
MainWindow? parent = get_toplevel() as MainWindow;
|
||||
var parent = get_toplevel() as Application.MainWindow;
|
||||
if (parent != null && !parent.close_composer(false)) {
|
||||
return true;
|
||||
}
|
||||
|
|
@ -306,7 +306,7 @@ public class ConversationListView : Gtk.TreeView, Geary.BaseInterface {
|
|||
Geary.App.Conversation conversation = get_model().get_conversation_at_path(path);
|
||||
|
||||
GLib.Menu context_menu_model = new GLib.Menu();
|
||||
MainWindow? main = get_toplevel() as MainWindow;
|
||||
var main = get_toplevel() as Application.MainWindow;
|
||||
if (main != null) {
|
||||
if (main.is_shift_down) {
|
||||
context_menu_model.append(
|
||||
|
|
@ -316,7 +316,9 @@ public class ConversationListView : Gtk.TreeView, Geary.BaseInterface {
|
|||
"Move conversations to _Trash",
|
||||
this.selected.size
|
||||
),
|
||||
"win." + MainWindow.ACTION_ARCHIVE_CONVERSATION
|
||||
Action.Window.prefix(
|
||||
Application.MainWindow.ACTION_ARCHIVE_CONVERSATION
|
||||
)
|
||||
);
|
||||
} else {
|
||||
context_menu_model.append(
|
||||
|
|
@ -326,26 +328,64 @@ public class ConversationListView : Gtk.TreeView, Geary.BaseInterface {
|
|||
"_Delete conversations",
|
||||
this.selected.size
|
||||
),
|
||||
"win." + MainWindow.ACTION_DELETE_CONVERSATION
|
||||
Action.Window.prefix(
|
||||
Application.MainWindow.ACTION_DELETE_CONVERSATION
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (conversation.is_unread())
|
||||
context_menu_model.append(_("Mark as _Read"), "win."+MainWindow.ACTION_MARK_AS_READ);
|
||||
context_menu_model.append(
|
||||
_("Mark as _Read"),
|
||||
Action.Window.prefix(
|
||||
Application.MainWindow.ACTION_MARK_AS_READ
|
||||
)
|
||||
);
|
||||
|
||||
if (conversation.has_any_read_message())
|
||||
context_menu_model.append(_("Mark as _Unread"), "win."+MainWindow.ACTION_MARK_AS_UNREAD);
|
||||
context_menu_model.append(
|
||||
_("Mark as _Unread"),
|
||||
Action.Window.prefix(
|
||||
Application.MainWindow.ACTION_MARK_AS_UNREAD
|
||||
)
|
||||
);
|
||||
|
||||
if (conversation.is_flagged())
|
||||
context_menu_model.append(_("U_nstar"), "win."+MainWindow.ACTION_MARK_AS_UNSTARRED);
|
||||
else
|
||||
context_menu_model.append(_("_Star"), "win."+MainWindow.ACTION_MARK_AS_STARRED);
|
||||
if (conversation.is_flagged()) {
|
||||
context_menu_model.append(
|
||||
_("U_nstar"),
|
||||
Action.Window.prefix(
|
||||
Application.MainWindow.ACTION_MARK_AS_UNSTARRED
|
||||
)
|
||||
);
|
||||
} else {
|
||||
context_menu_model.append(
|
||||
_("_Star"),
|
||||
Action.Window.prefix(
|
||||
Application.MainWindow.ACTION_MARK_AS_STARRED
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Menu actions_section = new Menu();
|
||||
actions_section.append(_("_Reply"), "win."+MainWindow.ACTION_REPLY_CONVERSATION);
|
||||
actions_section.append(_("R_eply All"), "win."+MainWindow.ACTION_REPLY_ALL_CONVERSATION);
|
||||
actions_section.append(_("_Forward"), "win."+MainWindow.ACTION_FORWARD_CONVERSATION);
|
||||
actions_section.append(
|
||||
_("_Reply"),
|
||||
Action.Window.prefix(
|
||||
Application.MainWindow.ACTION_REPLY_CONVERSATION
|
||||
)
|
||||
);
|
||||
actions_section.append(
|
||||
_("R_eply All"),
|
||||
Action.Window.prefix(
|
||||
Application.MainWindow.ACTION_REPLY_ALL_CONVERSATION
|
||||
)
|
||||
);
|
||||
actions_section.append(
|
||||
_("_Forward"),
|
||||
Action.Window.prefix(
|
||||
Application.MainWindow.ACTION_FORWARD_CONVERSATION
|
||||
)
|
||||
);
|
||||
context_menu_model.append_section(null, actions_section);
|
||||
|
||||
// Use a popover rather than a regular context menu since
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ public class Conversation.ContactPopover : Gtk.Popover {
|
|||
* Starts loading the avatar for the message's sender.
|
||||
*/
|
||||
public async void load_avatar() {
|
||||
MainWindow? main = this.get_toplevel() as MainWindow;
|
||||
var main = this.get_toplevel() as Application.MainWindow;
|
||||
if (main != null) {
|
||||
Application.AvatarStore loader = main.application.controller.avatars;
|
||||
int window_scale = get_scale_factor();
|
||||
|
|
@ -238,7 +238,7 @@ public class Conversation.ContactPopover : Gtk.Popover {
|
|||
}
|
||||
|
||||
private void on_new_conversation() {
|
||||
MainWindow? main = this.get_toplevel() as MainWindow;
|
||||
var main = this.get_toplevel() as Application.MainWindow;
|
||||
if (main != null) {
|
||||
main.open_composer_for_mailbox(this.mailbox);
|
||||
}
|
||||
|
|
@ -253,7 +253,7 @@ public class Conversation.ContactPopover : Gtk.Popover {
|
|||
}
|
||||
|
||||
private void on_show_conversations() {
|
||||
MainWindow? main = this.get_toplevel() as MainWindow;
|
||||
var main = this.get_toplevel() as Application.MainWindow;
|
||||
if (main != null) {
|
||||
main.show_search_bar("from:%s".printf(this.mailbox.address));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -505,7 +505,7 @@ public class ConversationEmail : Gtk.Box, Geary.BaseInterface {
|
|||
|
||||
/** Displays the raw RFC 822 source for this email. */
|
||||
public async void view_source() {
|
||||
MainWindow? main = get_toplevel() as MainWindow;
|
||||
var main = get_toplevel() as Application.MainWindow;
|
||||
if (main != null) {
|
||||
Geary.Email email = this.email;
|
||||
try {
|
||||
|
|
@ -777,7 +777,7 @@ public class ConversationEmail : Gtk.Box, Geary.BaseInterface {
|
|||
this.conversation.base_folder is Geary.FolderSupport.Remove
|
||||
);
|
||||
bool is_shift_down = false;
|
||||
MainWindow? main = get_toplevel() as MainWindow;
|
||||
var main = get_toplevel() as Application.MainWindow;
|
||||
if (main != null) {
|
||||
is_shift_down = main.is_shift_down;
|
||||
|
||||
|
|
@ -835,7 +835,7 @@ public class ConversationEmail : Gtk.Box, Geary.BaseInterface {
|
|||
private void update_displayed_attachments() {
|
||||
bool has_attachments = !this.displayed_attachments.is_empty;
|
||||
this.attachments_button.set_visible(has_attachments);
|
||||
MainWindow? main = get_toplevel() as MainWindow;
|
||||
var main = get_toplevel() as Application.MainWindow;
|
||||
|
||||
if (has_attachments && main != null) {
|
||||
this.attachments_pane = new Components.AttachmentPane(
|
||||
|
|
@ -855,7 +855,7 @@ public class ConversationEmail : Gtk.Box, Geary.BaseInterface {
|
|||
this.message_body_state = FAILED;
|
||||
this.primary_message.show_load_error_pane();
|
||||
|
||||
MainWindow? main = get_toplevel() as MainWindow;
|
||||
var main = get_toplevel() as Application.MainWindow;
|
||||
if (main != null) {
|
||||
Geary.AccountInformation account = this.email_store.account.information;
|
||||
main.application.controller.report_problem(
|
||||
|
|
@ -906,7 +906,7 @@ public class ConversationEmail : Gtk.Box, Geary.BaseInterface {
|
|||
private void on_save_image(string uri,
|
||||
string? alt_text,
|
||||
Geary.Memory.Buffer? content) {
|
||||
MainWindow? main = get_toplevel() as MainWindow;
|
||||
var main = get_toplevel() as Application.MainWindow;
|
||||
if (main != null) {
|
||||
if (uri.has_prefix(ClientWebView.CID_URL_PREFIX)) {
|
||||
string cid = uri.substring(ClientWebView.CID_URL_PREFIX.length);
|
||||
|
|
|
|||
|
|
@ -639,7 +639,7 @@ public class ConversationMessage : Gtk.Grid, Geary.BaseInterface {
|
|||
*/
|
||||
public async void load_contacts(GLib.Cancellable cancellable)
|
||||
throws GLib.Error {
|
||||
MainWindow? main = this.get_toplevel() as MainWindow;
|
||||
var main = this.get_toplevel() as Application.MainWindow;
|
||||
if (main != null && !cancellable.is_cancelled()) {
|
||||
// Load the primary contact and avatar
|
||||
if (this.primary_originator != null) {
|
||||
|
|
@ -1285,7 +1285,7 @@ public class ConversationMessage : Gtk.Grid, Geary.BaseInterface {
|
|||
}
|
||||
});
|
||||
} else {
|
||||
MainWindow? main = this.get_toplevel() as MainWindow;
|
||||
var main = this.get_toplevel() as Application.MainWindow;
|
||||
if (main != null) {
|
||||
main.application.show_uri.begin(link);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -146,7 +146,7 @@ public class ConversationViewer : Gtk.Stack, Geary.BaseInterface {
|
|||
* Puts the view into composer mode, showing a full-height composer.
|
||||
*/
|
||||
public void do_compose(Composer.Widget composer) {
|
||||
MainWindow? main_window = get_toplevel() as MainWindow;
|
||||
var main_window = get_toplevel() as Application.MainWindow;
|
||||
if (main_window != null) {
|
||||
Composer.Box box = new Composer.Box(
|
||||
composer, main_window.main_toolbar
|
||||
|
|
@ -486,7 +486,7 @@ public class ConversationViewer : Gtk.Stack, Geary.BaseInterface {
|
|||
set_visible_child(this.conversation_page);
|
||||
|
||||
// Restore the old selection
|
||||
MainWindow? main_window = get_toplevel() as MainWindow;
|
||||
var main_window = get_toplevel() as Application.MainWindow;
|
||||
if (main_window != null &&
|
||||
this.selection_while_composing != null) {
|
||||
ConversationListView conversation_list =
|
||||
|
|
|
|||
|
|
@ -51,7 +51,8 @@ public class Dialogs.ProblemDetailsDialog : Hdy.Dialog {
|
|||
private Geary.ServiceInformation? service;
|
||||
|
||||
|
||||
public ProblemDetailsDialog(MainWindow parent, Geary.ProblemReport report) {
|
||||
public ProblemDetailsDialog(Application.MainWindow parent,
|
||||
Geary.ProblemReport report) {
|
||||
Object(
|
||||
transient_for: parent,
|
||||
use_header_bar: 1
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ public class FolderList.FolderEntry : FolderList.AbstractFolderEntry, Sidebar.In
|
|||
is_emphasized_changed(has_new);
|
||||
}
|
||||
|
||||
public bool internal_drop_received(MainWindow main_window,
|
||||
public bool internal_drop_received(Application.MainWindow main_window,
|
||||
Gdk.DragContext context,
|
||||
Gtk.SelectionData data) {
|
||||
// Copy or move?
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public class FolderList.Tree : Sidebar.Tree, Geary.BaseInterface {
|
|||
|
||||
public override bool accept_cursor_changed() {
|
||||
bool can_switch = true;
|
||||
MainWindow? parent = get_toplevel() as MainWindow;
|
||||
var parent = get_toplevel() as Application.MainWindow;
|
||||
if (parent != null) {
|
||||
can_switch = parent.close_composer(false);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ geary_client_vala_sources = files(
|
|||
'application/application-contact-store.vala',
|
||||
'application/application-contact.vala',
|
||||
'application/application-controller.vala',
|
||||
'application/application-main-window.vala',
|
||||
'application/application-notification-context.vala',
|
||||
'application/application-plugin-manager.vala',
|
||||
'application/application-startup-manager.vala',
|
||||
|
|
@ -41,7 +42,6 @@ geary_client_vala_sources = files(
|
|||
'components/folder-popover.vala',
|
||||
'components/icon-factory.vala',
|
||||
'components/main-toolbar.vala',
|
||||
'components/main-window.vala',
|
||||
'components/main-window-info-bar.vala',
|
||||
'components/monitored-progress-bar.vala',
|
||||
'components/monitored-spinner.vala',
|
||||
|
|
|
|||
|
|
@ -56,7 +56,9 @@ public interface Sidebar.DestroyableEntry : Sidebar.Entry {
|
|||
|
||||
public interface Sidebar.InternalDropTargetEntry : Sidebar.Entry {
|
||||
// Returns true if drop was successful
|
||||
public abstract bool internal_drop_received(MainWindow main, Gdk.DragContext context, Gtk.SelectionData data);
|
||||
public abstract bool internal_drop_received(Application.MainWindow main,
|
||||
Gdk.DragContext context,
|
||||
Gtk.SelectionData data);
|
||||
}
|
||||
|
||||
public interface Sidebar.InternalDragSourceEntry : Sidebar.Entry {
|
||||
|
|
|
|||
|
|
@ -1071,7 +1071,7 @@ public class Sidebar.Tree : Gtk.TreeView {
|
|||
|
||||
bool success = false;
|
||||
|
||||
MainWindow? main = get_toplevel() as MainWindow;
|
||||
var main = get_toplevel() as Application.MainWindow;
|
||||
if (main != null) {
|
||||
success = targetable.internal_drop_received(
|
||||
main, context, selection_data
|
||||
|
|
|
|||
|
|
@ -2,8 +2,7 @@
|
|||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.20"/>
|
||||
<template class="MainWindow" parent="GtkApplicationWindow">
|
||||
<property name="name">GearyMainWindow</property>
|
||||
<template class="ApplicationMainWindow" parent="GtkApplicationWindow">
|
||||
<property name="can_focus">False</property>
|
||||
<property name="events">GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK | GDK_FOCUS_CHANGE_MASK | GDK_STRUCTURE_MASK</property>
|
||||
<property name="show_menubar">False</property>
|
||||
|
|
@ -7,6 +7,7 @@
|
|||
<file compressed="true" preprocess="xml-stripblanks">accounts_editor_list_pane.ui</file>
|
||||
<file compressed="true" preprocess="xml-stripblanks">accounts_editor_remove_pane.ui</file>
|
||||
<file compressed="true" preprocess="xml-stripblanks">accounts_editor_servers_pane.ui</file>
|
||||
<file compressed="true" preprocess="xml-stripblanks">application-main-window.ui</file>
|
||||
<file compressed="true" preprocess="xml-stripblanks">certificate_warning_dialog.glade</file>
|
||||
<file compressed="true">client-web-view.js</file>
|
||||
<file compressed="true">client-web-view-allow-remote-images.js</file>
|
||||
|
|
@ -38,7 +39,6 @@
|
|||
<file compressed="true" preprocess="xml-stripblanks">gtk/help-overlay.ui</file>
|
||||
<file compressed="true" preprocess="xml-stripblanks">main-toolbar.ui</file>
|
||||
<file compressed="true" preprocess="xml-stripblanks">main-toolbar-menus.ui</file>
|
||||
<file compressed="true" preprocess="xml-stripblanks">main-window.ui</file>
|
||||
<file compressed="true" preprocess="xml-stripblanks">main-window-info-bar.ui</file>
|
||||
<file compressed="true" preprocess="xml-stripblanks">password-dialog.glade</file>
|
||||
<file compressed="true" preprocess="xml-stripblanks">preferences-dialog.ui</file>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue