@@ -17,9 +17,10 @@ Kirigami.ScrollablePage {
|
||||
|
||||
Kirigami.FormLayout {
|
||||
QQC2.CheckBox {
|
||||
Kirigami.FormData.label: i18nc("General settings:")
|
||||
Kirigami.FormData.label: i18n("General settings:")
|
||||
text: i18n("Close to system tray")
|
||||
checked: Config.systemTray
|
||||
visible: Controller.supportSystemTray
|
||||
onToggled: {
|
||||
Config.systemTray = checked
|
||||
Config.save()
|
||||
|
||||
@@ -404,6 +404,15 @@ KAboutData Controller::aboutData() const
|
||||
return m_aboutData;
|
||||
}
|
||||
|
||||
bool Controller::supportSystemTray() const
|
||||
{
|
||||
#ifdef Q_OS_ANDROID
|
||||
return false;
|
||||
#else
|
||||
return true;
|
||||
#endif
|
||||
}
|
||||
|
||||
void Controller::changePassword(Connection *connection, const QString ¤tPassword, const QString &newPassword)
|
||||
{
|
||||
NeochatChangePasswordJob *job = connection->callApi<NeochatChangePasswordJob>(newPassword, false);
|
||||
|
||||
@@ -33,6 +33,7 @@ class Controller : public QObject
|
||||
Q_PROPERTY(Connection *activeConnection READ activeConnection WRITE setActiveConnection NOTIFY activeConnectionChanged)
|
||||
Q_PROPERTY(bool busy READ busy WRITE setBusy NOTIFY busyChanged)
|
||||
Q_PROPERTY(KAboutData aboutData READ aboutData WRITE setAboutData NOTIFY aboutDataChanged)
|
||||
Q_PROPERTY(bool supportSystemTray READ supportSystemTray CONSTANT)
|
||||
|
||||
public:
|
||||
static Controller &instance();
|
||||
@@ -60,6 +61,8 @@ public:
|
||||
void setAboutData(const KAboutData &aboutData);
|
||||
[[nodiscard]] KAboutData aboutData() const;
|
||||
|
||||
[[nodiscard]] bool supportSystemTray() const;
|
||||
|
||||
bool saveAccessTokenToFile(const AccountSettings &account, const QByteArray &accessToken);
|
||||
bool saveAccessTokenToKeyChain(const AccountSettings &account, const QByteArray &accessToken);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user