Begin adding restart required indicator to settings

needsRestart
Loren Burkholder 2 years ago
parent e50aee08b4
commit 4d1a4a201d
  1. 28
      resources/qml/pages/UserSettingsPage.qml
  2. 8
      src/UserSettingsPage.cpp
  3. 1
      src/UserSettingsPage.h

@ -19,6 +19,14 @@ Rectangle {
property bool collapsed: width < collapsePoint
color: Nheko.colors.window
Platform.MessageDialog {
id: needsRestartDlg
buttons: Platform.MessageDialog.Ok
text: qsTr("This setting will take effect the next time Nheko is started")
title: qsTr("Restart required")
}
ScrollView {
id: scroll
@ -48,6 +56,7 @@ Rectangle {
rows: collapsed? 2: 1
required property var model
id: r
// onModelChanged: if (model.needsRestart) restartWarning.visible = true;
Label {
Layout.alignment: Qt.AlignLeft
@ -72,6 +81,25 @@ Rectangle {
wrapMode: Text.Wrap
}
// Label {
// id: restartWarning
// Layout.alignment: Qt.AlignLeft
// visible: false//model.needsRestart
// color: Nheko.theme.red
// text: qsTr("Restart required")
// font.italic: true
// ToolTip.text: qsTr("This setting will take effect the next time Nheko is started")
//// Connections {
//// enabled: model.needsRestart
//// target: r
//// function onModelChanged() {
//// restartWarning.visible = true;
//// }
//// }
// }
DelegateChooser {
id: chooser

@ -907,6 +907,7 @@ UserSettingsModel::roleNames() const
{Values, "values"},
{Good, "good"},
{Enabled, "enabled"},
{NeedsRestart, "needsRestart"},
};
return roles;
@ -1515,6 +1516,13 @@ UserSettingsModel::data(const QModelIndex &index, int role) const
default:
return true;
}
} else if (role == NeedsRestart) {
switch (index.row()) {
case ExposeDBusApi:
return true;
default:
return false;
}
}
return {};

@ -523,6 +523,7 @@ public:
Values,
Good,
Enabled,
NeedsRestart,
};
UserSettingsModel(QObject *parent = nullptr);

Loading…
Cancel
Save