Rename UnifiedWindow -> MainWindow

This commit is contained in:
fiaxh 2020-02-21 03:06:27 +01:00
parent d550fc905c
commit f282ef68a4
5 changed files with 21 additions and 21 deletions

View file

@ -101,8 +101,8 @@ SOURCES
src/ui/global_search.vala
src/ui/notifications.vala
src/ui/settings_dialog.vala
src/ui/unified_window.vala
src/ui/unified_window_controller.vala
src/ui/main_window.vala
src/ui/main_window_controller.vala
src/ui/add_conversation/add_conference_dialog.vala
src/ui/add_conversation/add_contact_dialog.vala

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
<template class="DinoUiUnifiedWindowPlaceholder">
<template class="DinoUiMainWindowPlaceholder">
<property name="valign">center</property>
<property name="visible">True</property>
<child>

View file

@ -6,8 +6,8 @@ using Xmpp;
public class Dino.Ui.Application : Gtk.Application, Dino.Application {
private Notifications notifications;
private UnifiedWindow window;
public UnifiedWindowController controller;
private MainWindow window;
public MainWindowController controller;
public Database db { get; set; }
public Dino.Entities.Settings settings { get; set; }
@ -35,9 +35,9 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application {
activate.connect(() => {
if (window == null) {
controller = new UnifiedWindowController(this, stream_interactor, db);
controller = new MainWindowController(this, stream_interactor, db);
config = new Config(db);
window = new UnifiedWindow(this, stream_interactor, db, config);
window = new MainWindow(this, stream_interactor, db, config);
controller.set_window(window);
if ((get_flags() & ApplicationFlags.IS_SERVICE) == ApplicationFlags.IS_SERVICE) window.delete_event.connect(window.hide_on_delete);

View file

@ -6,7 +6,7 @@ using Dino.Entities;
namespace Dino.Ui {
public class UnifiedWindow : Gtk.Window {
public class MainWindow : Gtk.Window {
public signal void conversation_selected(Conversation conversation);
@ -36,7 +36,7 @@ public class UnifiedWindow : Gtk.Window {
private Database db;
private Config config;
public UnifiedWindow(Application application, StreamInteractor stream_interactor, Database db, Config config) {
public MainWindow(Application application, StreamInteractor stream_interactor, Database db, Config config) {
Object(application : application);
this.stream_interactor = stream_interactor;
this.db = db;
@ -195,7 +195,7 @@ public class UnifiedWindow : Gtk.Window {
}
}
public class WelcomePlceholder : UnifiedWindowPlaceholder {
public class WelcomePlceholder : MainWindowPlaceholder {
public WelcomePlceholder() {
title_label.label = _("Welcome to Dino!");
label.label = _("Sign in or create an account to get started.");
@ -205,7 +205,7 @@ public class WelcomePlceholder : UnifiedWindowPlaceholder {
}
}
public class NoAccountsPlaceholder : UnifiedWindowPlaceholder {
public class NoAccountsPlaceholder : MainWindowPlaceholder {
public NoAccountsPlaceholder() {
title_label.label = _("No active accounts");
primary_button.label = _("Manage accounts");
@ -215,7 +215,7 @@ public class NoAccountsPlaceholder : UnifiedWindowPlaceholder {
}
}
public class NoConversationsPlaceholder : UnifiedWindowPlaceholder {
public class NoConversationsPlaceholder : MainWindowPlaceholder {
public NoConversationsPlaceholder() {
title_label.label = _("No active conversations");
primary_button.label = _("Start Conversation");
@ -227,7 +227,7 @@ public class NoConversationsPlaceholder : UnifiedWindowPlaceholder {
}
[GtkTemplate (ui = "/im/dino/Dino/unified_window_placeholder.ui")]
public class UnifiedWindowPlaceholder : Box {
public class MainWindowPlaceholder : Box {
[GtkChild] public Label title_label;
[GtkChild] public Label label;
[GtkChild] public Button primary_button;

View file

@ -6,17 +6,17 @@ using Dino.Entities;
namespace Dino.Ui {
public class UnifiedWindowController : Object {
public class MainWindowController : Object {
private StreamInteractor stream_interactor;
private Conversation? conversation;
private Application app;
private Database db;
private UnifiedWindow window;
private MainWindow window;
private ConversationViewController conversation_view_controller;
public UnifiedWindowController(Application application, StreamInteractor stream_interactor, Database db) {
public MainWindowController(Application application, StreamInteractor stream_interactor, Database db) {
this.app = application;
this.stream_interactor = stream_interactor;
this.db = db;
@ -25,7 +25,7 @@ public class UnifiedWindowController : Object {
stream_interactor.account_removed.connect(check_unset_conversation);
}
public void set_window(UnifiedWindow window) {
public void set_window(MainWindow window) {
this.window = window;
this.conversation_view_controller = new ConversationViewController(window.conversation_view, window.conversation_titlebar, stream_interactor);
@ -129,14 +129,14 @@ public class UnifiedWindowController : Object {
ArrayList<Account> accounts = stream_interactor.get_accounts();
if (!know_exists && accounts.size == 0) {
if (db.get_accounts().size == 0) {
window.set_stack_state(UnifiedWindow.StackState.CLEAN_START);
window.set_stack_state(MainWindow.StackState.CLEAN_START);
} else {
window.set_stack_state(UnifiedWindow.StackState.NO_ACTIVE_ACCOUNTS);
window.set_stack_state(MainWindow.StackState.NO_ACTIVE_ACCOUNTS);
}
} else if (stream_interactor.get_module(ConversationManager.IDENTITY).get_active_conversations().size == 0) {
window.set_stack_state(UnifiedWindow.StackState.NO_ACTIVE_CONVERSATIONS);
window.set_stack_state(MainWindow.StackState.NO_ACTIVE_CONVERSATIONS);
} else {
window.set_stack_state(UnifiedWindow.StackState.CONVERSATION);
window.set_stack_state(MainWindow.StackState.CONVERSATION);
}
}