Rename UnifiedWindow -> MainWindow
This commit is contained in:
parent
d550fc905c
commit
f282ef68a4
|
@ -101,8 +101,8 @@ SOURCES
|
||||||
src/ui/global_search.vala
|
src/ui/global_search.vala
|
||||||
src/ui/notifications.vala
|
src/ui/notifications.vala
|
||||||
src/ui/settings_dialog.vala
|
src/ui/settings_dialog.vala
|
||||||
src/ui/unified_window.vala
|
src/ui/main_window.vala
|
||||||
src/ui/unified_window_controller.vala
|
src/ui/main_window_controller.vala
|
||||||
|
|
||||||
src/ui/add_conversation/add_conference_dialog.vala
|
src/ui/add_conversation/add_conference_dialog.vala
|
||||||
src/ui/add_conversation/add_contact_dialog.vala
|
src/ui/add_conversation/add_contact_dialog.vala
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<interface>
|
<interface>
|
||||||
<template class="DinoUiUnifiedWindowPlaceholder">
|
<template class="DinoUiMainWindowPlaceholder">
|
||||||
<property name="valign">center</property>
|
<property name="valign">center</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<child>
|
<child>
|
||||||
|
|
|
@ -6,8 +6,8 @@ using Xmpp;
|
||||||
|
|
||||||
public class Dino.Ui.Application : Gtk.Application, Dino.Application {
|
public class Dino.Ui.Application : Gtk.Application, Dino.Application {
|
||||||
private Notifications notifications;
|
private Notifications notifications;
|
||||||
private UnifiedWindow window;
|
private MainWindow window;
|
||||||
public UnifiedWindowController controller;
|
public MainWindowController controller;
|
||||||
|
|
||||||
public Database db { get; set; }
|
public Database db { get; set; }
|
||||||
public Dino.Entities.Settings settings { get; set; }
|
public Dino.Entities.Settings settings { get; set; }
|
||||||
|
@ -35,9 +35,9 @@ public class Dino.Ui.Application : Gtk.Application, Dino.Application {
|
||||||
|
|
||||||
activate.connect(() => {
|
activate.connect(() => {
|
||||||
if (window == null) {
|
if (window == null) {
|
||||||
controller = new UnifiedWindowController(this, stream_interactor, db);
|
controller = new MainWindowController(this, stream_interactor, db);
|
||||||
config = new Config(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);
|
controller.set_window(window);
|
||||||
if ((get_flags() & ApplicationFlags.IS_SERVICE) == ApplicationFlags.IS_SERVICE) window.delete_event.connect(window.hide_on_delete);
|
if ((get_flags() & ApplicationFlags.IS_SERVICE) == ApplicationFlags.IS_SERVICE) window.delete_event.connect(window.hide_on_delete);
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@ using Dino.Entities;
|
||||||
|
|
||||||
namespace Dino.Ui {
|
namespace Dino.Ui {
|
||||||
|
|
||||||
public class UnifiedWindow : Gtk.Window {
|
public class MainWindow : Gtk.Window {
|
||||||
|
|
||||||
public signal void conversation_selected(Conversation conversation);
|
public signal void conversation_selected(Conversation conversation);
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ public class UnifiedWindow : Gtk.Window {
|
||||||
private Database db;
|
private Database db;
|
||||||
private Config config;
|
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);
|
Object(application : application);
|
||||||
this.stream_interactor = stream_interactor;
|
this.stream_interactor = stream_interactor;
|
||||||
this.db = db;
|
this.db = db;
|
||||||
|
@ -195,7 +195,7 @@ public class UnifiedWindow : Gtk.Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WelcomePlceholder : UnifiedWindowPlaceholder {
|
public class WelcomePlceholder : MainWindowPlaceholder {
|
||||||
public WelcomePlceholder() {
|
public WelcomePlceholder() {
|
||||||
title_label.label = _("Welcome to Dino!");
|
title_label.label = _("Welcome to Dino!");
|
||||||
label.label = _("Sign in or create an account to get started.");
|
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() {
|
public NoAccountsPlaceholder() {
|
||||||
title_label.label = _("No active accounts");
|
title_label.label = _("No active accounts");
|
||||||
primary_button.label = _("Manage accounts");
|
primary_button.label = _("Manage accounts");
|
||||||
|
@ -215,7 +215,7 @@ public class NoAccountsPlaceholder : UnifiedWindowPlaceholder {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class NoConversationsPlaceholder : UnifiedWindowPlaceholder {
|
public class NoConversationsPlaceholder : MainWindowPlaceholder {
|
||||||
public NoConversationsPlaceholder() {
|
public NoConversationsPlaceholder() {
|
||||||
title_label.label = _("No active conversations");
|
title_label.label = _("No active conversations");
|
||||||
primary_button.label = _("Start Conversation");
|
primary_button.label = _("Start Conversation");
|
||||||
|
@ -227,7 +227,7 @@ public class NoConversationsPlaceholder : UnifiedWindowPlaceholder {
|
||||||
}
|
}
|
||||||
|
|
||||||
[GtkTemplate (ui = "/im/dino/Dino/unified_window_placeholder.ui")]
|
[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 title_label;
|
||||||
[GtkChild] public Label label;
|
[GtkChild] public Label label;
|
||||||
[GtkChild] public Button primary_button;
|
[GtkChild] public Button primary_button;
|
|
@ -6,17 +6,17 @@ using Dino.Entities;
|
||||||
|
|
||||||
namespace Dino.Ui {
|
namespace Dino.Ui {
|
||||||
|
|
||||||
public class UnifiedWindowController : Object {
|
public class MainWindowController : Object {
|
||||||
|
|
||||||
private StreamInteractor stream_interactor;
|
private StreamInteractor stream_interactor;
|
||||||
private Conversation? conversation;
|
private Conversation? conversation;
|
||||||
private Application app;
|
private Application app;
|
||||||
private Database db;
|
private Database db;
|
||||||
private UnifiedWindow window;
|
private MainWindow window;
|
||||||
|
|
||||||
private ConversationViewController conversation_view_controller;
|
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.app = application;
|
||||||
this.stream_interactor = stream_interactor;
|
this.stream_interactor = stream_interactor;
|
||||||
this.db = db;
|
this.db = db;
|
||||||
|
@ -25,7 +25,7 @@ public class UnifiedWindowController : Object {
|
||||||
stream_interactor.account_removed.connect(check_unset_conversation);
|
stream_interactor.account_removed.connect(check_unset_conversation);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void set_window(UnifiedWindow window) {
|
public void set_window(MainWindow window) {
|
||||||
this.window = window;
|
this.window = window;
|
||||||
|
|
||||||
this.conversation_view_controller = new ConversationViewController(window.conversation_view, window.conversation_titlebar, stream_interactor);
|
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();
|
ArrayList<Account> accounts = stream_interactor.get_accounts();
|
||||||
if (!know_exists && accounts.size == 0) {
|
if (!know_exists && accounts.size == 0) {
|
||||||
if (db.get_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 {
|
} 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) {
|
} 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 {
|
} else {
|
||||||
window.set_stack_state(UnifiedWindow.StackState.CONVERSATION);
|
window.set_stack_state(MainWindow.StackState.CONVERSATION);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue