Compare commits

...

1 Commits

Author SHA1 Message Date
Tobias Fella
092e092e18 WIP 2026-02-06 05:02:58 -05:00

View File

@@ -7,25 +7,24 @@ import QtQuick.Controls as QQC2
import QtQuick.Layouts import QtQuick.Layouts
import org.kde.kirigami as Kirigami import org.kde.kirigami as Kirigami
import org.kde.kirigamiaddons.formcard as FormCard
import org.kde.neochat import org.kde.neochat
import org.kde.neochat.devtools import org.kde.neochat.devtools
FormCard.FormCardPage { Kirigami.ScrollablePage {
id: root id: root
required property NeoChatConnection connection required property NeoChatConnection connection
title: i18nc("@title:window", "General") title: i18nc("@title:window", "General")
FormCard.FormHeader { Kirigami.Form {
Kirigami.FormGroup {
title: i18nc("@title:group", "General Settings") title: i18nc("@title:group", "General Settings")
visible: Qt.platform.os !== "android" visible: Qt.platform.os !== "android"
}
FormCard.FormCard { Kirigami.FormEntry {
FormCard.FormCheckDelegate { contentItem: QQC2.CheckBox {
id: closeDelegate
text: i18n("Show in System Tray") text: i18n("Show in System Tray")
checked: NeoChatConfig.systemTray checked: NeoChatConfig.systemTray
visible: Controller.supportSystemTray visible: Controller.supportSystemTray
@@ -35,32 +34,30 @@ FormCard.FormCardPage {
NeoChatConfig.save(); NeoChatConfig.save();
} }
} }
FormCard.FormDelegateSeparator {
above: closeDelegate
below: minimizeDelegate
} }
FormCard.FormCheckDelegate { Kirigami.FormSeparator {}
id: minimizeDelegate
Kirigami.FormEntry {
id: trayOnStartup
visible: Controller.supportSystemTray && !Kirigami.Settings.isMobile && NeoChatConfig.systemTray
contentItem: QQC2.CheckBox {
text: i18n("Minimize to system tray on startup") text: i18n("Minimize to system tray on startup")
checked: NeoChatConfig.minimizeToSystemTrayOnStartup checked: NeoChatConfig.minimizeToSystemTrayOnStartup
visible: Controller.supportSystemTray && !Kirigami.Settings.isMobile && NeoChatConfig.systemTray
enabled: NeoChatConfig.systemTray && !NeoChatConfig.isMinimizeToSystemTrayOnStartupImmutable enabled: NeoChatConfig.systemTray && !NeoChatConfig.isMinimizeToSystemTrayOnStartupImmutable
onToggled: { onToggled: {
NeoChatConfig.minimizeToSystemTrayOnStartup = checked; NeoChatConfig.minimizeToSystemTrayOnStartup = checked;
NeoChatConfig.save(); NeoChatConfig.save();
} }
} }
FormCard.FormDelegateSeparator {
above: minimizeDelegate
below: automaticallyDelegate
visible: minimizeDelegate.visible
} }
FormCard.FormCheckDelegate { Kirigami.FormSeparator {
id: automaticallyDelegate visible: trayOnStartup.visible
}
Kirigami.FormEntry {
contentItem: QQC2.CheckBox {
text: i18n("Automatically hide/unhide the room information when resizing the window") text: i18n("Automatically hide/unhide the room information when resizing the window")
checked: NeoChatConfig.autoRoomInfoDrawer checked: NeoChatConfig.autoRoomInfoDrawer
enabled: !NeoChatConfig.isAutoRoomInfoDrawerImmutable enabled: !NeoChatConfig.isAutoRoomInfoDrawerImmutable
@@ -70,13 +67,12 @@ FormCard.FormCardPage {
NeoChatConfig.save(); NeoChatConfig.save();
} }
} }
FormCard.FormDelegateSeparator {
above: automaticallyDelegate
below: categorizeDelegate
} }
FormCard.FormCheckDelegate {
id: categorizeDelegate Kirigami.FormSeparator {}
Kirigami.FormEntry {
contentItem: QQC2.CheckBox {
text: i18n("Show all rooms in \"Home\" tab") text: i18n("Show all rooms in \"Home\" tab")
checked: NeoChatConfig.allRoomsInHome checked: NeoChatConfig.allRoomsInHome
enabled: !NeoChatConfig.isAllRoomsInHomeImmutable enabled: !NeoChatConfig.isAllRoomsInHomeImmutable
@@ -85,67 +81,67 @@ FormCard.FormCardPage {
NeoChatConfig.save(); NeoChatConfig.save();
} }
} }
}
}
} Kirigami.FormGroup {
FormCard.FormHeader {
title: i18nc("@title:group", "Room List Sort Order") title: i18nc("@title:group", "Room List Sort Order")
}
FormCard.FormCard { Kirigami.FormEntry {
FormCard.FormTextDelegate { contentItem: QQC2.Label {
text: i18nc("@info:label", "Hidden events are not considered as recent activity when sorting rooms.") text: i18nc("@info:label", "Hidden events are not considered as recent activity when sorting rooms.")
} }
}
// FormCard.FormDelegateSeparator {}
// FormCard.FormRadioDelegate {
// text: i18nc("As in 'sort something based on last activity'", "Importance")
// description: i18nc("@info", "Rooms with unread notifications will be shown first.")
// checked: NeoChatConfig.sortOrder === 1
// enabled: !NeoChatConfig.isSortOrderImmutable
// onToggled: {
// NeoChatConfig.sortOrder = 1
// NeoChatConfig.customSortOrder = []
// NeoChatConfig.save()
// }
// }
// FormCard.FormRadioDelegate {
// text: i18nc("As in 'sort something alphabetically'", "Alphabetical")
// checked: NeoChatConfig.sortOrder === 0
// enabled: !NeoChatConfig.isSortOrderImmutable
// onToggled: {
// NeoChatConfig.sortOrder = 0
// NeoChatConfig.customSortOrder = []
// NeoChatConfig.save()
// }
// }
// FormCard.FormRadioDelegate {
// text: i18nc("As in 'sort something based on the last event'", "Newest Events")
// description: i18nc("@info", "Rooms with the newest events will be shown first.")
// checked: NeoChatConfig.sortOrder === 2
// enabled: !NeoChatConfig.isSortOrderImmutable
// onToggled: {
// NeoChatConfig.sortOrder = 2
// NeoChatConfig.customSortOrder = []
// NeoChatConfig.save()
// }
// }
// FormCard.FormRadioDelegate {
// id: openCustomRoomSortButton
// text: i18nc("@option:radio", "Custom")
// checked: NeoChatConfig.sortOrder === 3
// enabled: !NeoChatConfig.isSortOrderImmutable
// onClicked: {
// Qt.createComponent('org.kde.neochat.settings', 'RoomSortParameterDialog').createObject(root).open();
// }
// }
}
FormCard.FormDelegateSeparator {} Kirigami.FormGroup {
FormCard.FormRadioDelegate {
text: i18nc("As in 'sort something based on last activity'", "Importance")
description: i18nc("@info", "Rooms with unread notifications will be shown first.")
checked: NeoChatConfig.sortOrder === 1
enabled: !NeoChatConfig.isSortOrderImmutable
onToggled: {
NeoChatConfig.sortOrder = 1
NeoChatConfig.customSortOrder = []
NeoChatConfig.save()
}
}
FormCard.FormRadioDelegate {
text: i18nc("As in 'sort something alphabetically'", "Alphabetical")
checked: NeoChatConfig.sortOrder === 0
enabled: !NeoChatConfig.isSortOrderImmutable
onToggled: {
NeoChatConfig.sortOrder = 0
NeoChatConfig.customSortOrder = []
NeoChatConfig.save()
}
}
FormCard.FormRadioDelegate {
text: i18nc("As in 'sort something based on the last event'", "Newest Events")
description: i18nc("@info", "Rooms with the newest events will be shown first.")
checked: NeoChatConfig.sortOrder === 2
enabled: !NeoChatConfig.isSortOrderImmutable
onToggled: {
NeoChatConfig.sortOrder = 2
NeoChatConfig.customSortOrder = []
NeoChatConfig.save()
}
}
FormCard.FormRadioDelegate {
id: openCustomRoomSortButton
text: i18nc("@option:radio", "Custom")
checked: NeoChatConfig.sortOrder === 3
enabled: !NeoChatConfig.isSortOrderImmutable
onClicked: {
Qt.createComponent('org.kde.neochat.settings', 'RoomSortParameterDialog').createObject(root).open();
}
}
}
FormCard.FormHeader {
title: i18nc("@title", "Timeline") title: i18nc("@title", "Timeline")
} Kirigami.FormEntry {
FormCard.FormCard { title: i18n("Mark messages as read when:")
FormCard.FormComboBoxDelegate { contentItem: QQC2.ComboBox {
id: markAsReadCombo id: markAsReadCombo
text: i18n("Mark messages as read when:")
textRole: "name" textRole: "name"
valueRole: "value" valueRole: "value"
model: [ model: [
@@ -173,13 +169,11 @@ FormCard.FormCardPage {
Component.onCompleted: currentIndex = NeoChatConfig.markReadCondition Component.onCompleted: currentIndex = NeoChatConfig.markReadCondition
onCurrentValueChanged: NeoChatConfig.markReadCondition = currentValue onCurrentValueChanged: NeoChatConfig.markReadCondition = currentValue
} }
FormCard.FormDelegateSeparator {
above: markAsReadCombo
below: showDeletedMessages
} }
Kirigami.FormSeparator {}
FormCard.FormCheckDelegate { Kirigami.FormEntry {
contentItem: QQC2.CheckBox {
id: showDeletedMessages id: showDeletedMessages
text: i18n("Show deleted messages") text: i18n("Show deleted messages")
checked: NeoChatConfig.showDeletedMessages checked: NeoChatConfig.showDeletedMessages
@@ -189,13 +183,12 @@ FormCard.FormCardPage {
NeoChatConfig.save(); NeoChatConfig.save();
} }
} }
FormCard.FormDelegateSeparator {
above: showDeletedMessages
below: showStateEvents
} }
FormCard.FormCheckDelegate { Kirigami.FormSeparator {}
Kirigami.FormEntry {
contentItem: QQC2.CheckBox {
id: showStateEvents id: showStateEvents
text: i18n("Show state events") text: i18n("Show state events")
checked: NeoChatConfig.showStateEvent checked: NeoChatConfig.showStateEvent
@@ -205,14 +198,14 @@ FormCard.FormCardPage {
NeoChatConfig.save(); NeoChatConfig.save();
} }
} }
FormCard.FormDelegateSeparator {
visible: NeoChatConfig.showStateEvent
above: showStateEvents
below: showLeaveJoinEventDelegate
} }
FormCard.FormCheckDelegate { Kirigami.FormSeparator {
visible: NeoChatConfig.showStateEvent
}
Kirigami.FormEntry {
contentItem: QQC2.CheckBox {
id: showLeaveJoinEventDelegate id: showLeaveJoinEventDelegate
visible: NeoChatConfig.showStateEvent visible: NeoChatConfig.showStateEvent
text: i18n("Show leave and join events") text: i18n("Show leave and join events")
@@ -223,16 +216,16 @@ FormCard.FormCardPage {
NeoChatConfig.save(); NeoChatConfig.save();
} }
} }
FormCard.FormDelegateSeparator {
visible: NeoChatConfig.showStateEvent
above: showLeaveJoinEventDelegate
below: showNameDelegate
} }
FormCard.FormCheckDelegate { Kirigami.FormSeparator {
id: showNameDelegate
visible: NeoChatConfig.showStateEvent visible: NeoChatConfig.showStateEvent
}
Kirigami.FormEntry {
visible: NeoChatConfig.showStateEvent
contentItem: QQC2.CheckBox {
id: showNameDelegate
text: i18n("Show name change events") text: i18n("Show name change events")
checked: NeoChatConfig.showRename checked: NeoChatConfig.showRename
enabled: !NeoChatConfig.isShowRenameImmutable enabled: !NeoChatConfig.isShowRenameImmutable
@@ -241,16 +234,16 @@ FormCard.FormCardPage {
NeoChatConfig.save(); NeoChatConfig.save();
} }
} }
FormCard.FormDelegateSeparator {
visible: NeoChatConfig.showStateEvent
above: showNameDelegate
below: showAvatarChangeDelegate
} }
FormCard.FormCheckDelegate { Kirigami.FormSeparator {
id: showAvatarChangeDelegate
visible: NeoChatConfig.showStateEvent visible: NeoChatConfig.showStateEvent
}
Kirigami.FormEntry {
visible: NeoChatConfig.showStateEvent
contentItem: QQC2.CheckBox {
id: showAvatarChangeDelegate
text: i18n("Show avatar update events") text: i18n("Show avatar update events")
checked: NeoChatConfig.showAvatarUpdate checked: NeoChatConfig.showAvatarUpdate
enabled: !NeoChatConfig.isShowAvatarUpdateImmutable enabled: !NeoChatConfig.isShowAvatarUpdateImmutable
@@ -260,37 +253,13 @@ FormCard.FormCardPage {
} }
} }
} }
FormCard.FormHeader { }
Kirigami.FormGroup {
title: i18nc("Chat Editor", "Editor") title: i18nc("Chat Editor", "Editor")
}
FormCard.FormCard { Kirigami.FormEntry {
FormCard.FormRadioDelegate { contentItem: QQC2.CheckBox {
text: i18nc("@option:radio", "Send messages with Enter")
checked: NeoChatConfig.sendMessageWith === 0
visible: !Kirigami.Settings.isMobile
enabled: !NeoChatConfig.isSendMessageWithImmutable
onToggled: {
NeoChatConfig.sendMessageWith = 0
NeoChatConfig.save()
}
}
FormCard.FormRadioDelegate {
id: sendWithEnterRadio
text: i18nc("@option:radio", "Send messages with Ctrl+Enter")
checked: NeoChatConfig.sendMessageWith === 1
visible: !Kirigami.Settings.isMobile
enabled: !NeoChatConfig.isSendMessageWithImmutable
onToggled: {
NeoChatConfig.sendMessageWith = 1
NeoChatConfig.save()
}
}
FormCard.FormDelegateSeparator {
visible: !Kirigami.Settings.isMobile
above: sendWithEnterRadio
below: quickEditCheckbox
}
FormCard.FormCheckDelegate {
id: quickEditCheckbox id: quickEditCheckbox
text: i18n("Use s/text/replacement syntax to edit your last message") text: i18n("Use s/text/replacement syntax to edit your last message")
checked: NeoChatConfig.allowQuickEdit checked: NeoChatConfig.allowQuickEdit
@@ -300,11 +269,12 @@ FormCard.FormCardPage {
NeoChatConfig.save(); NeoChatConfig.save();
} }
} }
FormCard.FormDelegateSeparator {
above: quickEditCheckbox
below: typingNotificationsDelegate
} }
FormCard.FormCheckDelegate {
Kirigami.FormSeparator {}
Kirigami.FormEntry {
contentItem: QQC2.CheckBox {
id: typingNotificationsDelegate id: typingNotificationsDelegate
text: i18n("Send typing notifications") text: i18n("Send typing notifications")
checked: NeoChatConfig.typingNotifications checked: NeoChatConfig.typingNotifications
@@ -315,11 +285,12 @@ FormCard.FormCardPage {
} }
} }
} }
FormCard.FormHeader {
title: i18n("Developer Settings")
} }
FormCard.FormCard {
FormCard.FormCheckDelegate { Kirigami.FormGroup {
title: i18n("Developer Settings")
Kirigami.FormEntry {
contentItem: QQC2.CheckBox {
id: enableDeveloperToolsDelegate id: enableDeveloperToolsDelegate
text: i18n("Enable developer tools") text: i18n("Enable developer tools")
checked: NeoChatConfig.developerTools checked: NeoChatConfig.developerTools
@@ -329,13 +300,13 @@ FormCard.FormCardPage {
NeoChatConfig.save(); NeoChatConfig.save();
} }
} }
FormCard.FormDelegateSeparator {
above: enableDeveloperToolsDelegate
below: openDeveloperToolsDelegate
} }
FormCard.FormButtonDelegate { Kirigami.FormSeparator {}
id: openDeveloperToolsDelegate
Kirigami.FormEntry {
visible: NeoChatConfig.developerTools visible: NeoChatConfig.developerTools
contentItem: QQC2.Button {
id: openDeveloperToolsDelegate
icon.name: "tools" icon.name: "tools"
text: i18n("Open Developer Tools") text: i18n("Open Developer Tools")
onClicked: root.QQC2.ApplicationWindow.window.pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.devtools', 'DevtoolsPage'), { onClicked: root.QQC2.ApplicationWindow.window.pageStack.pushDialogLayer(Qt.createComponent('org.kde.neochat.devtools', 'DevtoolsPage'), {
@@ -345,16 +316,20 @@ FormCard.FormCardPage {
}); });
} }
} }
FormCard.FormHeader {
title: i18nc("@title:group", "Default Settings")
} }
FormCard.FormCard { Kirigami.FormGroup {
FormCard.FormButtonDelegate { title: i18nc("@title:group", "Default Settings")
Kirigami.FormEntry {
contentItem: QQC2.Button {
icon.name: "kt-restore-defaults-symbolic" icon.name: "kt-restore-defaults-symbolic"
text: i18nc("@action:button", "Reset all configuration values to their default…") text: i18nc("@action:button", "Reset all configuration values to their default…")
onClicked: resetDialog.open() onClicked: resetDialog.open()
} }
} }
}
}
Kirigami.PromptDialog { Kirigami.PromptDialog {
id: resetDialog id: resetDialog
title: i18nc("@title:dialog", "Reset Configuration") title: i18nc("@title:dialog", "Reset Configuration")