1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-04-21 21:52:03 +02:00

refactor: use ApplicationWindow as the main entry point

Change-Id: I5e298e51fdc4099f0380d8a2ce2176cd66070eed
This commit is contained in:
Ming Rui Zhang 2020-11-04 15:24:46 -05:00
parent 4cbfe7a966
commit 768ea9d601
22 changed files with 218 additions and 240 deletions

View file

@ -1,3 +1,25 @@
/*
* Copyright (C) 2020 by Savoir-faire Linux
* Author: Aline Gondim Santos <aline.gondimsantos@savoirfairelinux.com>
* Author: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>
* Author: Albert Babí <albert.babi@savoirfairelinux.com>
* Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>
* Author: Yang Wang <yang.wang@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
import QtQuick 2.14
import QtQuick.Window 2.14
import QtQuick.Controls 2.14
@ -16,15 +38,63 @@ import "commoncomponents"
ApplicationWindow {
id: root
property ApplicationWindow appWindow: root
enum LoadedSource {
WizardView = 0,
MainView,
None
}
AccountMigrationDialog{
id: accountMigrationDialog
Universal.theme: Universal.Light
visible: false
title: JamiStrings.appTitle
onAccountMigrationFinished:{
startClientByMainview()
width: {
if (checkLoadedSource() === MainApplicationWindow.LoadedSource.WizardView)
return JamiTheme.wizardViewMinWidth
return JamiTheme.mainViewPreferredWidth
}
height: {
if (checkLoadedSource() === MainApplicationWindow.LoadedSource.WizardView)
return JamiTheme.wizardViewMinHeight
return JamiTheme.mainViewPreferredHeight
}
minimumWidth: {
if (checkLoadedSource() === MainApplicationWindow.LoadedSource.WizardView)
return JamiTheme.wizardViewMinWidth
return JamiTheme.mainViewMinWidth
}
minimumHeight: {
if (checkLoadedSource() === MainApplicationWindow.LoadedSource.WizardView)
return JamiTheme.wizardViewMinHeight
return JamiTheme.mainViewMinHeight
}
visible: mainApplicationLoader.status === Loader.Ready
function checkLoadedSource() {
var sourceString = mainApplicationLoader.source.toString()
if (sourceString === JamiQmlUtils.wizardViewLoadPath)
return MainApplicationWindow.LoadedSource.WizardView
else if (sourceString === JamiQmlUtils.mainViewLoadPath)
return MainApplicationWindow.LoadedSource.MainView
return MainApplicationWindow.LoadedSource.None
}
function startAccountMigration(){
return accountMigrationDialog.startAccountMigrationOfTopStack()
}
function startClient(){
setX(Screen.width / 2 - width / 2)
setY(Screen.height / 2 - height / 2)
if (UtilsAdapter.getAccountListSize() !== 0) {
mainApplicationLoader.setSource(JamiQmlUtils.mainViewLoadPath,
{"containerWindow": root})
} else {
mainApplicationLoader.setSource(JamiQmlUtils.wizardViewLoadPath)
}
}
@ -34,93 +104,38 @@ ApplicationWindow {
if (force || !SettingsAdapter.getAppValue(Settings.MinimizeOnClose) ||
!UtilsAdapter.getAccountListSize()) {
Qt.quit()
} else {
// hide to the systray
if (mainViewLoader.item)
mainViewLoader.item.hide()
else
Qt.quit()
}
} else
hide()
}
function startAccountMigration(){
return accountMigrationDialog.startAccountMigrationOfTopStack()
AccountMigrationDialog{
id: accountMigrationDialog
visible: false
onAccountMigrationFinished: startClient()
}
function startClientByMainview(){
setX(Screen.width / 2 - width / 2)
setY(Screen.height / 2 - height / 2)
if (!UtilsAdapter.getAccountListSize()) {
wizardView.show()
} else {
mainViewLoader.setSource("qrc:/src/mainview/MainView.qml")
}
}
Universal.theme: Universal.Light
visible: false
Loader {
id: mainViewLoader
id: mainApplicationLoader
property int newAddedAccountIndex: -1
anchors.fill: parent
asynchronous: true
visible: status == Loader.Ready
source: ""
Connections {
target: mainViewLoader.item
target: mainApplicationLoader.item
function onCloseApp() {
root.close()
function onLoaderSourceChangeRequested(sourceToLoad) {
if (sourceToLoad === MainApplicationWindow.LoadedSource.WizardView)
mainApplicationLoader.setSource(JamiQmlUtils.wizardViewLoadPath)
else
mainApplicationLoader.setSource(JamiQmlUtils.mainViewLoadPath,
{"containerWindow": root})
}
function onNoAccountIsAvailable() {
mainViewLoader.setSource("")
wizardViewForApplicationStart.changePageQML(0)
wizardView.show()
}
}
}
Window {
id: wizardView
title: "Jami"
minimumWidth: 500
minimumHeight: 600
WizardView {
id: wizardViewForApplicationStart
anchors.fill: parent
onNeedToShowMainViewWindow: {
mainViewLoader.newAddedAccountIndex = accountIndex
if (mainViewLoader.source.toString() !== "qrc:/src/mainview/MainView.qml")
mainViewLoader.setSource("qrc:/src/mainview/MainView.qml")
wizardView.close()
}
onWizardViewIsClosed: parent.close()
}
// @disable-check M16
onClosing: {
if (mainViewLoader.source.toString() !== "qrc:/src/mainview/MainView.qml") {
root.close()
}
}
// @enable-check M16
}
Component.onCompleted: {
if(!startAccountMigration()){
startClientByMainview()
}
}
@ -138,31 +153,25 @@ ApplicationWindow {
Connections {
target: LRCInstance
function restore(window) {
window.show()
window.raise();
window.requestActivate()
}
function onRestoreAppRequested() {
if (mainViewLoader.item)
restore(mainViewLoader.item)
requestActivate()
showNormal()
}
function onNotificationClicked(forceToTop) {
var window = mainViewLoader.item ? mainViewLoader.item : wizardView
// This is a hack to bring the window to the front which is normally done
// with QWindow::requestActivate but is thwarted for qml windows by the
// notification being clicked. Native solutions are preferable.
if (forceToTop && (!window.visible
|| window.visibility & Qt.WindowMinimized
|| window.visibility === Qt.WindowNoState)) {
var tmpFlags = window.flags
window.hide()
window.flags = Qt.WindowStaysOnTopHint
window.flags = tmpFlags
}
restore(window)
function onNotificationClicked() {
requestActivate()
raise()
if (visibility === Window.Hidden ||
visibility === Window.Minimized)
showNormal()
}
}
onClosing: root.close()
Component.onCompleted: {
if(!startAccountMigration()){
startClient()
}
}
}

View file

@ -307,11 +307,7 @@ CallAdapter::showNotification(const QString& accountId, const QString& convUid)
}
auto onClicked = [this, convInfo]() {
#ifdef Q_OS_WINDOWS
emit LRCInstance::instance().notificationClicked();
#else
emit LRCInstance::instance().notificationClicked(true);
#endif
if (!convInfo.uid.isEmpty()) {
emit callSetupMainViewRequired(convInfo.accountId, convInfo.uid);
}

View file

@ -22,6 +22,9 @@ pragma Singleton
import QtQuick 2.14
Item {
readonly property string mainViewLoadPath: "qrc:/src/mainview/MainView.qml"
readonly property string wizardViewLoadPath: "qrc:/src/wizardview/WizardView.qml"
property bool callIsFullscreen: false
TextMetrics {

View file

@ -171,6 +171,16 @@ Item {
property int preferredDialogHeight: 300
property int minimumPreviewWidth: 120
// main application spec
property int mainViewMinWidth: 460
property int mainViewMinHeight: 400
property int wizardViewMinWidth: 500
property int wizardViewMinHeight: 600
property int mainViewPreferredWidth: 650
property int mainViewPreferredHeight: 600
function setTheme(dark) {
darkTheme = dark
}

View file

@ -146,11 +146,7 @@ ConversationsAdapter::onNewUnreadInteraction(const QString& accountId,
auto& contact = accInfo.contactModel->getContact(interaction.authorUri);
auto from = accInfo.contactModel->bestNameForContact(interaction.authorUri);
auto onClicked = [this, accountId, convUid, uri = interaction.authorUri] {
#ifdef Q_OS_WINDOWS
emit LRCInstance::instance().notificationClicked();
#else
emit LRCInstance::instance().notificationClicked(true);
#endif
auto convInfo = LRCInstance::getConversationFromConvUid(convUid, accountId);
if (!convInfo.uid.isEmpty()) {
selectConversation(accountId, convInfo.uid);

View file

@ -446,7 +446,7 @@ signals:
void accountListChanged();
void currentAccountChanged();
void restoreAppRequested();
void notificationClicked(bool forceToTop = false);
void notificationClicked();
void updateSmartList();
void quitEngineRequested();

View file

@ -172,7 +172,6 @@ MainApplication::init()
vsConsoleDebug();
}
connectForceWindowToTop();
initSettings();
initSystray();
initQmlEngine();
@ -364,25 +363,3 @@ MainApplication::cleanup()
#endif
QApplication::exit(0);
}
void
MainApplication::connectForceWindowToTop()
{
#ifdef Q_OS_WINDOWS
QObject::connect(&LRCInstance::instance(), &LRCInstance::notificationClicked, [] {
for (QWindow* appWindow : qApp->allWindows()) {
if (appWindow->objectName().compare("mainViewWindow"))
continue;
// clang-format off
::SetWindowPos((HWND) appWindow->winId(),
HWND_TOPMOST, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
::SetWindowPos((HWND) appWindow->winId(),
HWND_NOTOPMOST, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW);
// clang-format on
return;
}
});
#endif
}

View file

@ -48,7 +48,6 @@ private:
void initSettings();
void initSystray();
void cleanup();
void connectForceWindowToTop();
private:
QScopedPointer<QFile> debugFile_;

View file

@ -28,29 +28,24 @@ import net.jami.Constants 1.0
// Import qml component files.
import "components"
import "../"
import "../wizardview"
import "../settingsview"
import "../settingsview/components"
Window {
id: mainViewWindow
objectName: "mainViewWindow"
Rectangle {
id: mainView
property int minWidth: settingsViewPreferredWidth
property int minHeight: 400
objectName: "mainView"
property var containerWindow: ""
property int mainViewWindowPreferredWidth: 650
property int mainViewWindowPreferredHeight: 600
property int sidePanelViewStackPreferredWidth: 250
property int mainViewStackPreferredWidth: 250
property int settingsViewPreferredWidth: 445
property int settingsViewPreferredWidth: 460
property int onWidthChangedTriggerDistance: 5
property int savedSidePanelViewMinWidth: 0
property int savedSidePanelViewMaxWidth: 0
property int savedWelcomeViewMinWidth: 0
property int savedWelcomeViewMaxWidth: 0
property bool sidePanelOnly: !mainViewStack.visible
property bool sidePanelOnly: (!mainViewStack.visible) && sidePanelViewStack.visible
// To calculate tab bar bottom border hidden rect left margin.
property int tabBarLeftMargin: 8
@ -60,13 +55,12 @@ Window {
// For updating msgWebView
property string currentConvUID: ""
signal closeApp
signal noAccountIsAvailable
signal loaderSourceChangeRequested(int sourceToLoad)
property string currentAccountId: AccountAdapter.currentAccountId
onCurrentAccountIdChanged: {
var index = UtilsAdapter.getCurrAccList().indexOf(currentAccountId)
mainViewWindowSidePanel.refreshAccountComboBox(index)
mainViewSidePanel.refreshAccountComboBox(index)
if (inSettingsView) {
settingsView.accountListChanged()
settingsView.setSelected(settingsView.selectedMenu, true)
@ -86,7 +80,7 @@ Window {
function showWelcomeView() {
currentConvUID = ""
callStackView.needToCloseInCallConversationAndPotentialWindow()
mainViewWindowSidePanel.deselectConversationSmartList()
mainViewSidePanel.deselectConversationSmartList()
if (isPageInStack("callStackViewObject", sidePanelViewStack) ||
isPageInStack("communicationPageMessageWebView", sidePanelViewStack) ||
isPageInStack("communicationPageMessageWebView", mainViewStack) ||
@ -167,8 +161,8 @@ Window {
var windowCurrentMinimizedSize = settingsViewPreferredWidth
+ sidePanelViewStackPreferredWidth + onWidthChangedTriggerDistance
if (mainViewWindow.width < windowCurrentMinimizedSize)
mainViewWindow.width = windowCurrentMinimizedSize
if (containerWindow.width < windowCurrentMinimizedSize)
containerWindow.width = windowCurrentMinimizedSize
}
} else {
sidePanelViewStack.pop(StackView.Immediate)
@ -235,12 +229,6 @@ Window {
}
}
title: JamiStrings.appTitle
visible: true
width: mainViewWindowPreferredWidth
height: mainViewWindowPreferredHeight
minimumWidth: minWidth
minimumHeight: minHeight
color: JamiTheme.backgroundColor
Connections {
@ -255,13 +243,14 @@ Window {
Connections {
target: JamiQmlUtils
// TODO: call in fullscreen inside containerWindow
function onCallIsFullscreenChanged() {
if (JamiQmlUtils.callIsFullscreen) {
UtilsAdapter.setSystemTrayIconVisible(false)
mainViewWindow.hide()
containerWindow.hide()
} else {
UtilsAdapter.setSystemTrayIconVisible(true)
mainViewWindow.show()
containerWindow.show()
}
}
}
@ -279,8 +268,8 @@ Window {
Layout.fillWidth: true
Layout.fillHeight: true
width: mainViewWindow.width
height: mainViewWindow.height
width: mainView.width
height: mainView.height
handle: Rectangle {
implicitWidth: JamiTheme.splitViewHandlePreferredWidth
@ -312,7 +301,7 @@ Window {
width: mainViewSidePanelRect.width
height: 64
visible: (mainViewWindowSidePanel.visible || settingsMenu.visible)
visible: (mainViewSidePanel.visible || settingsMenu.visible)
currentIndex: 0
@ -321,8 +310,8 @@ Window {
function onUpdateConversationForAddedContact() {
MessagesAdapter.updateConversationForAddedContact()
mainViewWindowSidePanel.clearContactSearchBar()
mainViewWindowSidePanel.forceReselectConversationSmartListCurrentIndex()
mainViewSidePanel.clearContactSearchBar()
mainViewSidePanel.forceReselectConversationSmartListCurrentIndex()
}
function onAccountStatusChanged(accountId) {
@ -342,7 +331,7 @@ Window {
StackView {
id: sidePanelViewStack
initialItem: mainViewWindowSidePanel
initialItem: mainViewSidePanel
anchors.top: accountComboBox.visible ? accountComboBox.bottom :
mainViewSidePanelRect.top
@ -375,7 +364,7 @@ Window {
Layout.fillWidth: true
Layout.fillHeight: true
onNeedToShowMainViewWindow: {
onLoaderSourceChangeRequested: {
mainViewStackLayout.currentIndex = 0
backToMainView()
}
@ -409,7 +398,7 @@ Window {
}
SidePanel {
id: mainViewWindowSidePanel
id: mainViewSidePanel
Connections {
target: ConversationsAdapter
@ -429,6 +418,7 @@ Window {
WelcomePage {
id: welcomePage
visible: false
}
@ -437,14 +427,13 @@ Window {
visible: false
onSettingsViewWindowNeedToShowMainViewWindow: {
onSettingsViewNeedToShowMainView: {
AccountAdapter.accountChanged(0)
toggleSettingsView()
}
onSettingsViewWindowNeedToShowNewWizardWindow: {
mainViewWindow.noAccountIsAvailable()
}
onSettingsViewNeedToShowNewWizardWindow: loaderSourceChangeRequested(
MainApplicationWindow.LoadedSource.WizardView)
onSettingsBackArrowClicked: sidePanelViewStack.pop(StackView.Immediate)
}
@ -464,7 +453,7 @@ Window {
target: MessagesAdapter
function onNeedToUpdateSmartList() {
mainViewWindowSidePanel.forceUpdateConversationSmartListView()
mainViewSidePanel.forceUpdateConversationSmartListView()
}
function onNavigateToWelcomePageRequested() {
@ -498,7 +487,7 @@ Window {
var widthToCompare = sidePanelViewStackPreferredWidth +
(inSettingsView ? settingsViewPreferredWidth : mainViewStackPreferredWidth)
if (mainViewWindow.width < widthToCompare - onWidthChangedTriggerDistance
if (mainView.width < widthToCompare - onWidthChangedTriggerDistance
&& mainViewStack.visible) {
mainViewStack.visible = false
@ -515,8 +504,8 @@ Window {
else if (inWelcomeViewStack)
recursionStackViewItemMove(mainViewStack, sidePanelViewStack)
mainViewWindow.update()
} else if (mainViewWindow.width >= widthToCompare + onWidthChangedTriggerDistance
mainView.update()
} else if (mainView.width >= widthToCompare + onWidthChangedTriggerDistance
&& !mainViewStack.visible) {
mainViewStack.visible = true
@ -535,7 +524,7 @@ Window {
pushCallStackView()
}
mainViewWindow.update()
mainView.update()
}
}
@ -543,7 +532,7 @@ Window {
id: aboutPopUpDialog
height: Math.min(preferredHeight,
mainViewWindow.height - JamiTheme.preferredMarginSize * 2)
mainView.height - JamiTheme.preferredMarginSize * 2)
}
WelcomePageQrDialog {
@ -559,12 +548,6 @@ Window {
id: userProfile
}
onClosing: {
close.accepted = false
mainViewWindow.hide()
mainViewWindow.closeApp()
}
Shortcut {
sequence: "Ctrl+M"
context: Qt.ApplicationShortcut
@ -621,10 +604,10 @@ Window {
sequence: "F11"
context: Qt.ApplicationShortcut
onActivated: {
if (mainViewWindow.visibility !== 5) // 5 = FullScreen
mainViewWindow.visibility = "FullScreen"
if (containerWindow.visibility !== Window.FullScreen)
containerWindow.visibility = Window.FullScreen
else
mainViewWindow.visibility = "Windowed"
containerWindow.visibility = Window.Windowed
}
}

View file

@ -250,13 +250,13 @@ ComboBox {
PushButton {
id: settingsButton
source: !mainViewWindow.inSettingsView ?
source: !mainView.inSettingsView ?
"qrc:/images/icons/round-settings-24px.svg" :
"qrc:/images/icons/round-close-24px.svg"
normalColor: JamiTheme.backgroundColor
imageColor: JamiTheme.textColor
toolTipText: !mainViewWindow.inSettingsView ?
toolTipText: !mainView.inSettingsView ?
JamiStrings.openSettings :
JamiStrings.closeSettings

View file

@ -173,7 +173,7 @@ Popup {
onClicked: {
root.close()
mainViewWindow.startWizard()
mainView.startWizard()
}
}

View file

@ -262,7 +262,7 @@ Rectangle {
if (JamiQmlUtils.callIsFullscreen) {
callStackView.toggleFullScreen()
} else {
mainViewWindow.showWelcomeView()
mainView.showWelcomeView()
}
}
}

View file

@ -52,6 +52,8 @@ Rectangle {
function needToCloseInCallConversationAndPotentialWindow() {
// Close potential window, context menu releated windows.
if (!callStackMainView.currentItem)
return
if (callStackMainView.currentItem.stackNumber === CallStackView.AudioPageStack) {
audioCallPage.closeInCallConversation()
CallFullScreenWindowContainerCreation.closeVideoCallFullScreenWindowContainer()

View file

@ -42,7 +42,7 @@ ListView {
function repositionIndex(uid = "") {
if (uid === "")
uid = mainViewWindow.currentConvUID
uid = mainView.currentConvUID
root.currentIndex = -1
updateListView()
for (var i = 0; i < count; i++) {

View file

@ -73,7 +73,7 @@ ItemDelegate {
function onShowConversation(accountId, convUid) {
if (convUid === UID) {
mainViewWindow.setMainView(DisplayID == DisplayName ? "" : DisplayID,
mainView.setMainView(DisplayID == DisplayName ? "" : DisplayID,
DisplayName, UID, CallStackViewShouldShow, IsAudioOnly, CallState)
}
}

View file

@ -128,7 +128,7 @@ Rectangle {
onBackClicked: {
MessagesAdapter.updateDraft()
mainViewWindow.showWelcomeView()
mainView.showWelcomeView()
}
onNeedToHideConversationInCall: {

View file

@ -68,9 +68,9 @@ Rectangle {
toolTipText: qsTr("Toggle to display side panel")
visible: mainViewWindow.sidePanelOnly
visible: mainView.sidePanelOnly
onClicked: mainViewWindow.showWelcomeView()
onClicked: mainView.showWelcomeView()
}
AvatarImage {

View file

@ -26,30 +26,31 @@ import net.jami.Constants 1.0
import "../../commoncomponents"
Rectangle {
id: welcomeRect
id: root
anchors.fill: parent
color: JamiTheme.secondaryBackgroundColor
Rectangle {
id: welcomeRectComponentsGroup
ColumnLayout {
id: welcomePageColumnLayout
anchors.centerIn: parent
width: Math.max(mainViewStackPreferredWidth, welcomeRect.width - 100)
height: mainViewWindow.minimumHeight
color: JamiTheme.secondaryBackgroundColor
width: Math.max(mainViewStackPreferredWidth, root.width - 100)
height: parent.height
ColumnLayout {
id: welcomeRectComponentsGroupColumnLayout
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: welcomePageColumnLayout.width
Layout.preferredHeight: implicitHeight
Layout.topMargin: JamiTheme.preferredMarginSize
ResponsiveImage {
id: jamiLogoImage
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: welcomeRectComponentsGroup.width
Layout.preferredWidth: welcomePageColumnLayout.width
Layout.preferredHeight: 100
Layout.topMargin: JamiTheme.preferredMarginSize
Layout.bottomMargin: 10
smooth: true
@ -62,7 +63,7 @@ Rectangle {
id: jamiIntroText
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: welcomeRectComponentsGroup.width
Layout.preferredWidth: welcomePageColumnLayout.width
Layout.preferredHeight: 80
Layout.bottomMargin: 5
@ -80,7 +81,7 @@ Rectangle {
id: jamiShareWithFriendText
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: welcomeRectComponentsGroup.width
Layout.preferredWidth: welcomePageColumnLayout.width
Layout.preferredHeight: 50
wrapMode: Text.WordWrap
@ -99,9 +100,9 @@ Rectangle {
id: jamiRegisteredNameRect
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: welcomeRectComponentsGroup.width
Layout.preferredWidth: welcomePageColumnLayout.width
Layout.preferredHeight: 65
Layout.bottomMargin: JamiTheme.preferredMarginSize
color: JamiTheme.secondaryBackgroundColor
visible: AccountAdapter.currentAccountType === Profile.Type.RING
@ -113,9 +114,11 @@ Rectangle {
Text {
id: jamiRegisteredNameText
Layout.alignment: Qt.AlignCenter
Layout.preferredWidth: welcomeRectComponentsGroup.width
Layout.preferredWidth: welcomePageColumnLayout.width
Layout.preferredHeight: 30
font.pointSize: JamiTheme.textFontSize + 1
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
@ -125,7 +128,7 @@ Rectangle {
id: textMetricsjamiRegisteredNameText
font: jamiRegisteredNameText.font
text: UtilsAdapter.getBestId(AccountAdapter.currentAccountId)
elideWidth: welcomeRectComponentsGroup.width
elideWidth: welcomePageColumnLayout.width
elide: Qt.ElideMiddle
}
}
@ -148,27 +151,26 @@ Rectangle {
}
}
}
}
}
MaterialButton {
id: btnClose
MaterialButton {
id: btnAboutPopUp
anchors.bottom: parent.bottom
anchors.bottomMargin: JamiTheme.preferredMarginSize
anchors.horizontalCenter: parent.horizontalCenter
Layout.alignment: Qt.AlignBottom | Qt.AlignHCenter
Layout.bottomMargin: JamiTheme.preferredMarginSize
Layout.preferredWidth: 150
Layout.preferredHeight: 30
width: 150
height: 30
color: JamiTheme.buttonTintedBlack
hoveredColor: JamiTheme.buttonTintedBlackHovered
pressedColor: JamiTheme.buttonTintedBlackPressed
outlined: true
color: JamiTheme.buttonTintedBlack
hoveredColor: JamiTheme.buttonTintedBlackHovered
pressedColor: JamiTheme.buttonTintedBlackPressed
outlined: true
text: JamiStrings.aboutJami
text: JamiStrings.aboutJami
onClicked: aboutPopUpDialog.open()
onClicked: aboutPopUpDialog.open()
}
}
CustomBorder {

View file

@ -87,9 +87,9 @@ Rectangle {
AccountAdapter.stopPreviewing()
settingsViewRect.stopBooth()
if (showMainView)
settingsViewWindowNeedToShowMainViewWindow()
settingsViewNeedToShowMainView()
else
settingsViewWindowNeedToShowNewWizardWindow()
settingsViewNeedToShowNewWizardWindow()
}
function accountListChanged() {
@ -106,8 +106,8 @@ Rectangle {
property int profileType: SettingsAdapter.getCurrentAccount_Profile_Info_Type()
property int selectedMenu: SettingsView.Account
// signal to redirect the page to main view
signal settingsViewWindowNeedToShowMainViewWindow()
signal settingsViewWindowNeedToShowNewWizardWindow
signal settingsViewNeedToShowMainView()
signal settingsViewNeedToShowNewWizardWindow
signal settingsBackArrowClicked

View file

@ -157,7 +157,7 @@ BaseDialog {
Rectangle {
id: cellRectWithThreeKeys
implicitWidth: minWidth / 2
implicitWidth: JamiTheme.mainViewMinWidth / 2
implicitHeight: 50
anchors.left: parent.left
anchors.leftMargin: 20
@ -257,8 +257,8 @@ BaseDialog {
anchors.bottomMargin: 20
anchors.topMargin: 50
width: minWidth
height: minHeight - 100
width: JamiTheme.mainViewMinWidth
height: JamiTheme.mainViewMinHeight - 100
anchors.fill: parent
StackLayout {

View file

@ -47,7 +47,7 @@ RowLayout {
toolTipText: JamiStrings.back
hoverEnabled: true
visible: mainViewWindow.sidePanelOnly
visible: mainView.sidePanelOnly
onClicked: {
backArrowClicked()

View file

@ -25,6 +25,7 @@ import net.jami.Models 1.0
import net.jami.Adapters 1.0
import net.jami.Constants 1.0
import "../"
import "../commoncomponents"
import "components"
@ -67,7 +68,7 @@ Rectangle {
property var inputParaObject: ({})
// signal to redirect the page to main view
signal needToShowMainViewWindow(int accountIndex)
signal loaderSourceChangeRequested(int sourceToLoad)
signal wizardViewIsClosed
visible: true
@ -98,7 +99,7 @@ Rectangle {
changePageQML(WizardView.WizardViewPageIndex.BACKUPKEYSPAGE)
} else {
changePageQML(WizardView.WizardViewPageIndex.WELCOMEPAGE)
needToShowMainViewWindow(addedAccountIndex)
loaderSourceChangeRequested(MainApplicationWindow.LoadedSource.MainView)
}
}
@ -162,7 +163,7 @@ Rectangle {
title, info)
if (success) {
console.log("Account Export Succeed")
needToShowMainViewWindow(addedAccountIndex)
loaderSourceChangeRequested(MainApplicationWindow.LoadedSource.MainView)
}
}
}
@ -321,12 +322,12 @@ Rectangle {
}
changePageQML(WizardView.WizardViewPageIndex.WELCOMEPAGE)
needToShowMainViewWindow(addedAccountIndex)
loaderSourceChangeRequested(MainApplicationWindow.LoadedSource.MainView)
}
onLeavePage: {
changePageQML(WizardView.WizardViewPageIndex.WELCOMEPAGE)
needToShowMainViewWindow(addedAccountIndex)
loaderSourceChangeRequested(MainApplicationWindow.LoadedSource.MainView)
}
}
@ -383,7 +384,7 @@ Rectangle {
changePageQML(WizardView.WizardViewPageIndex.BACKUPKEYSPAGE)
else {
changePageQML(WizardView.WizardViewPageIndex.WELCOMEPAGE)
needToShowMainViewWindow(addedAccountIndex)
loaderSourceChangeRequested(MainApplicationWindow.LoadedSource.MainView)
}
profilePage.initializeOnShowUp()