Account switcher fixes, part 1
- Make account index notifyable - Give login window a title - Fix height of account list
This commit is contained in:
@@ -121,6 +121,8 @@ Controller::Controller(QObject *parent)
|
||||
}
|
||||
#endif
|
||||
|
||||
connect(&AccountRegistry::instance(), &AccountRegistry::accountCountChanged, this, &Controller::activeConnectionIndexChanged);
|
||||
|
||||
#ifdef QUOTIENT_07
|
||||
static int oldAccountCount = 0;
|
||||
connect(&AccountRegistry::instance(), &AccountRegistry::accountCountChanged, this, [=]() {
|
||||
@@ -688,6 +690,7 @@ void Controller::setActiveConnection(Connection *connection)
|
||||
}
|
||||
NeoChatConfig::self()->save();
|
||||
Q_EMIT activeConnectionChanged();
|
||||
Q_EMIT activeConnectionIndexChanged();
|
||||
}
|
||||
|
||||
void Controller::saveWindowGeometry()
|
||||
|
||||
@@ -41,7 +41,7 @@ class Controller : public QObject
|
||||
Q_PROPERTY(bool hasWindowSystem READ hasWindowSystem CONSTANT)
|
||||
Q_PROPERTY(bool isOnline READ isOnline NOTIFY isOnlineChanged)
|
||||
Q_PROPERTY(bool encryptionSupported READ encryptionSupported CONSTANT)
|
||||
Q_PROPERTY(int activeConnectionIndex READ activeConnectionIndex CONSTANT)
|
||||
Q_PROPERTY(int activeConnectionIndex READ activeConnectionIndex NOTIFY activeConnectionIndexChanged)
|
||||
|
||||
public:
|
||||
static Controller &instance();
|
||||
@@ -154,6 +154,7 @@ Q_SIGNALS:
|
||||
void keyVerificationStart();
|
||||
void keyVerificationAccept(const QString &commitment);
|
||||
void keyVerificationKey(const QString &sas);
|
||||
void activeConnectionIndexChanged();
|
||||
|
||||
public Q_SLOTS:
|
||||
void logout(Quotient::Connection *conn, bool serverSideLogout);
|
||||
|
||||
@@ -58,7 +58,7 @@ QQC2.ToolBar {
|
||||
text: i18n("Add Account")
|
||||
subtitle: i18n("Log in to an existing account")
|
||||
onClicked: {
|
||||
pageStack.pushDialogLayer("qrc:/WelcomePage.qml")
|
||||
pageStack.pushDialogLayer("qrc:/WelcomePage.qml", {}, {title: i18nc("@title:window", "Login")})
|
||||
userInfo.accountsListVisible = false
|
||||
accounts.currentIndex = Controller.activeConnectionIndex
|
||||
}
|
||||
@@ -100,7 +100,7 @@ QQC2.ToolBar {
|
||||
}
|
||||
|
||||
width: parent.width
|
||||
height: contentHeight
|
||||
Layout.preferredHeight: contentHeight
|
||||
delegate: Kirigami.BasicListItem {
|
||||
leftPadding: topPadding
|
||||
leading: Kirigami.Avatar {
|
||||
|
||||
Reference in New Issue
Block a user