Skip to content
Snippets Groups Projects
Commit 8fd7c70d authored by Aline Gondim Santos's avatar Aline Gondim Santos
Browse files

wizardview: manage through MainView

Change-Id: I083d293784e07f4fcc099e60ada84e433a1b2fa0
GitLab: #1216
parent e71c1d17
No related branches found
No related tags found
No related merge requests found
......@@ -35,9 +35,6 @@ BaseView {
property bool successState: true
// signal to redirect the page to main view
signal loaderSourceChangeRequested(int sourceToLoad)
function slotMigrationButtonClicked() {
stackedWidget.currentIndex = AccountMigrationView.AccountMigrationStep.Synching;
AccountAdapter.setArchivePasswordAsync(CurrentAccountToMigrate.accountId, passwordInputLineEdit.text);
......
......@@ -43,7 +43,6 @@ ApplicationWindow {
LayoutMirroring.childrenInherit: isRTL
enum LoadedSource {
WizardView,
MainView,
AccountMigrationView,
None
......@@ -95,19 +94,13 @@ ApplicationWindow {
function checkLoadedSource() {
var sourceString = mainApplicationLoader.source.toString();
if (sourceString === JamiQmlUtils.wizardViewLoadPath)
return MainApplicationWindow.LoadedSource.WizardView;
else if (sourceString === JamiQmlUtils.mainViewLoadPath)
if (sourceString === JamiQmlUtils.mainViewLoadPath)
return MainApplicationWindow.LoadedSource.MainView;
return MainApplicationWindow.LoadedSource.None;
}
function startClient() {
if (UtilsAdapter.getAccountListSize() !== 0) {
setMainLoaderSource(JamiQmlUtils.mainViewLoadPath);
} else {
setMainLoaderSource(JamiQmlUtils.wizardViewLoadPath);
}
setMainLoaderSource(JamiQmlUtils.mainViewLoadPath);
}
function setMainLoaderSource(source) {
......@@ -159,14 +152,6 @@ ApplicationWindow {
asynchronous: true
visible: status == Loader.Ready
Connections {
target: viewCoordinator
function onRequestAppWindowWizardView() {
setMainLoaderSource(JamiQmlUtils.wizardViewLoadPath);
}
}
Connections {
id: connectionMigrationEnded
......@@ -182,32 +167,16 @@ ApplicationWindow {
}
}
Connections {
target: mainApplicationLoader.item
function onLoaderSourceChangeRequested(sourceToLoad) {
if (sourceToLoad === MainApplicationWindow.LoadedSource.WizardView)
setMainLoaderSource(JamiQmlUtils.wizardViewLoadPath);
else if (sourceToLoad === MainApplicationWindow.LoadedSource.AccountMigrationView)
setMainLoaderSource(JamiQmlUtils.accountMigrationViewLoadPath);
else
setMainLoaderSource(JamiQmlUtils.mainViewLoadPath);
}
}
// Set `visible = false` when loading a new QML file.
onSourceChanged: windowSettingsLoaded = false
onLoaded: {
if (checkLoadedSource() === MainApplicationWindow.LoadedSource.WizardView) {
// Onboarding wizard window, these settings are fixed.
// - window screen will default to the primary
// - the window will showNormal once windowSettingsLoaded is
// set to true(then forcing visible to true)
appWindow.width = JamiTheme.wizardViewMinWidth;
appWindow.height = JamiTheme.wizardViewMinHeight;
appWindow.minimumWidth = JamiTheme.wizardViewMinWidth;
appWindow.minimumHeight = JamiTheme.wizardViewMinHeight;
if (UtilsAdapter.getAccountListSize() === 0) {
layoutManager.restoreWindowSettings();
if (!viewCoordinator.rootView)
// Set the viewCoordinator's root item.
viewCoordinator.init(item);
viewCoordinator.present("WizardView");
} else {
// Main window, load any valid app settings, and allow the
// layoutManager to handle as much as possible.
......@@ -220,8 +189,9 @@ ApplicationWindow {
viewCoordinator.present("WelcomePage");
viewCoordinator.preload("ConversationView");
});
// Set the viewCoordinator's root item.
viewCoordinator.init(item);
if (!viewCoordinator.rootView)
// Set the viewCoordinator's root item.
viewCoordinator.init(item);
if (CurrentAccountToMigrate.accountToMigrateListSize > 0)
viewCoordinator.present("AccountMigrationView");
}
......
......@@ -27,7 +27,10 @@ QtObject {
required property QtObject viewManager
signal initialized
signal requestAppWindowWizardView
function requestAppWindowWizardView() {
viewCoordinator.present("WizardView");
}
// A map of view names to file paths for QML files that define each view.
property variant resources: {
......
......@@ -43,8 +43,6 @@ Rectangle {
property int tabBarLeftMargin: 8
property int tabButtonShrinkSize: 8
signal loaderSourceChangeRequested(int sourceToLoad)
property string currentConvId: CurrentConversation.id
onCurrentConvIdChanged: {
if (currentConvId !== '') {
......
......@@ -33,9 +33,6 @@ BaseView {
inhibits: ["ConversationView"]
// signal to redirect the page to main view
signal loaderSourceChangeRequested(int sourceToLoad)
color: JamiTheme.backgroundColor
Connections {
......@@ -57,8 +54,11 @@ BaseView {
target: WizardViewStepModel
function onCloseWizardView() {
loaderSourceChangeRequested(MainApplicationWindow.LoadedSource.MainView);
root.dismiss();
viewCoordinator.preload("SidePanel");
viewCoordinator.preload("SettingsSidePanel");
viewCoordinator.present("WelcomePage");
viewCoordinator.preload("ConversationView");
}
}
......@@ -70,6 +70,7 @@ BaseView {
anchors.fill: parent
contentHeight: controlPanelStackView.height
boundsBehavior: Flickable.StopAtBounds
StackLayout {
id: controlPanelStackView
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment