mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-04-21 21:52:03 +02:00
wizardview: manage through MainView
Change-Id: I083d293784e07f4fcc099e60ada84e433a1b2fa0 GitLab: #1216
This commit is contained in:
parent
e71c1d1729
commit
8fd7c70d1f
5 changed files with 20 additions and 51 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue