@@ -156,6 +156,7 @@ Kirigami.ApplicationWindow {
|
||||
icon.name: "settings-configure"
|
||||
onTriggered: pushReplaceLayer("qrc:/imports/NeoChat/Page/SettingsPage.qml")
|
||||
enabled: pageStack.layers.currentItem.title !== i18n("Settings")
|
||||
shortcut: Controller.preferencesShortcuts[0]
|
||||
},
|
||||
Kirigami.Action {
|
||||
text: i18n("About Neochat")
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include "neochatuser.h"
|
||||
#include "settings.h"
|
||||
#include "utils.h"
|
||||
#include <KStandardShortcut>
|
||||
|
||||
#ifndef Q_OS_ANDROID
|
||||
#include "trayicon.h"
|
||||
@@ -550,3 +551,8 @@ void Controller::setActiveConnection(Connection *connection)
|
||||
m_connection = connection;
|
||||
Q_EMIT activeConnectionChanged();
|
||||
}
|
||||
|
||||
QList<QKeySequence> Controller::preferencesShortcuts() const
|
||||
{
|
||||
return KStandardShortcut::preferences();
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <QObject>
|
||||
|
||||
#include <KAboutData>
|
||||
class QKeySequences;
|
||||
|
||||
#include "connection.h"
|
||||
#include "csapi/list_public_rooms.h"
|
||||
@@ -30,6 +31,9 @@ class Controller : public QObject
|
||||
Q_PROPERTY(bool busy READ busy WRITE setBusy NOTIFY busyChanged)
|
||||
Q_PROPERTY(KAboutData aboutData READ aboutData WRITE setAboutData NOTIFY aboutDataChanged)
|
||||
|
||||
/// Get the list of shortcuts activating the preferences page
|
||||
Q_PROPERTY(QList<QKeySequence> preferencesShortcuts READ preferencesShortcuts CONSTANT)
|
||||
|
||||
public:
|
||||
static Controller &instance();
|
||||
|
||||
@@ -48,6 +52,8 @@ public:
|
||||
|
||||
[[nodiscard]] int accountCount() const;
|
||||
|
||||
[[nodiscard]] QList<QKeySequence> preferencesShortcuts() const;
|
||||
|
||||
[[nodiscard]] static bool quitOnLastWindowClosed();
|
||||
void setQuitOnLastWindowClosed(bool value);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user