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 org.kde.kirigami as Kirigami
import org.kde.kirigamiaddons.formcard as FormCard
import org.kde.neochat
import org.kde.neochat.devtools
FormCard.FormCardPage {
Kirigami.ScrollablePage {
id: root
required property NeoChatConnection connection
title: i18nc("@title:window", "General")
FormCard.FormHeader {
Kirigami.Form {
Kirigami.FormGroup {
title: i18nc("@title:group", "General Settings")
visible: Qt.platform.os !== "android"
}
FormCard.FormCard {
FormCard.FormCheckDelegate {
id: closeDelegate
Kirigami.FormEntry {
contentItem: QQC2.CheckBox {
text: i18n("Show in System Tray")
checked: NeoChatConfig.systemTray
visible: Controller.supportSystemTray
@@ -35,32 +34,30 @@ FormCard.FormCardPage {
NeoChatConfig.save();
}
}
FormCard.FormDelegateSeparator {
above: closeDelegate
below: minimizeDelegate
}
FormCard.FormCheckDelegate {
id: minimizeDelegate
Kirigami.FormSeparator {}
Kirigami.FormEntry {
id: trayOnStartup
visible: Controller.supportSystemTray && !Kirigami.Settings.isMobile && NeoChatConfig.systemTray
contentItem: QQC2.CheckBox {
text: i18n("Minimize to system tray on startup")
checked: NeoChatConfig.minimizeToSystemTrayOnStartup
visible: Controller.supportSystemTray && !Kirigami.Settings.isMobile && NeoChatConfig.systemTray
enabled: NeoChatConfig.systemTray && !NeoChatConfig.isMinimizeToSystemTrayOnStartupImmutable
onToggled: {
NeoChatConfig.minimizeToSystemTrayOnStartup = checked;
NeoChatConfig.save();
}
}
FormCard.FormDelegateSeparator {
above: minimizeDelegate
below: automaticallyDelegate
visible: minimizeDelegate.visible
}
FormCard.FormCheckDelegate {
id: automaticallyDelegate
Kirigami.FormSeparator {
visible: trayOnStartup.visible
}
Kirigami.FormEntry {
contentItem: QQC2.CheckBox {
text: i18n("Automatically hide/unhide the room information when resizing the window")
checked: NeoChatConfig.autoRoomInfoDrawer
enabled: !NeoChatConfig.isAutoRoomInfoDrawerImmutable
@@ -70,13 +67,12 @@ FormCard.FormCardPage {
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")
checked: NeoChatConfig.allRoomsInHome
enabled: !NeoChatConfig.isAllRoomsInHomeImmutable
@@ -85,67 +81,67 @@ FormCard.FormCardPage {
NeoChatConfig.save();
}
}
}
}
}
FormCard.FormHeader {
Kirigami.FormGroup {
title: i18nc("@title:group", "Room List Sort Order")
}
FormCard.FormCard {
FormCard.FormTextDelegate {
Kirigami.FormEntry {
contentItem: QQC2.Label {
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 {}
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 {
Kirigami.FormGroup {
title: i18nc("@title", "Timeline")
}
FormCard.FormCard {
FormCard.FormComboBoxDelegate {
Kirigami.FormEntry {
title: i18n("Mark messages as read when:")
contentItem: QQC2.ComboBox {
id: markAsReadCombo
text: i18n("Mark messages as read when:")
textRole: "name"
valueRole: "value"
model: [
@@ -173,13 +169,11 @@ FormCard.FormCardPage {
Component.onCompleted: currentIndex = NeoChatConfig.markReadCondition
onCurrentValueChanged: NeoChatConfig.markReadCondition = currentValue
}
FormCard.FormDelegateSeparator {
above: markAsReadCombo
below: showDeletedMessages
}
Kirigami.FormSeparator {}
FormCard.FormCheckDelegate {
Kirigami.FormEntry {
contentItem: QQC2.CheckBox {
id: showDeletedMessages
text: i18n("Show deleted messages")
checked: NeoChatConfig.showDeletedMessages
@@ -189,13 +183,12 @@ FormCard.FormCardPage {
NeoChatConfig.save();
}
}
FormCard.FormDelegateSeparator {
above: showDeletedMessages
below: showStateEvents
}
FormCard.FormCheckDelegate {
Kirigami.FormSeparator {}
Kirigami.FormEntry {
contentItem: QQC2.CheckBox {
id: showStateEvents
text: i18n("Show state events")
checked: NeoChatConfig.showStateEvent
@@ -205,14 +198,14 @@ FormCard.FormCardPage {
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
visible: NeoChatConfig.showStateEvent
text: i18n("Show leave and join events")
@@ -223,16 +216,16 @@ FormCard.FormCardPage {
NeoChatConfig.save();
}
}
FormCard.FormDelegateSeparator {
visible: NeoChatConfig.showStateEvent
above: showLeaveJoinEventDelegate
below: showNameDelegate
}
FormCard.FormCheckDelegate {
id: showNameDelegate
Kirigami.FormSeparator {
visible: NeoChatConfig.showStateEvent
}
Kirigami.FormEntry {
visible: NeoChatConfig.showStateEvent
contentItem: QQC2.CheckBox {
id: showNameDelegate
text: i18n("Show name change events")
checked: NeoChatConfig.showRename
enabled: !NeoChatConfig.isShowRenameImmutable
@@ -241,16 +234,16 @@ FormCard.FormCardPage {
NeoChatConfig.save();
}
}
FormCard.FormDelegateSeparator {
visible: NeoChatConfig.showStateEvent
above: showNameDelegate
below: showAvatarChangeDelegate
}
FormCard.FormCheckDelegate {
id: showAvatarChangeDelegate
Kirigami.FormSeparator {
visible: NeoChatConfig.showStateEvent
}
Kirigami.FormEntry {
visible: NeoChatConfig.showStateEvent
contentItem: QQC2.CheckBox {
id: showAvatarChangeDelegate
text: i18n("Show avatar update events")
checked: NeoChatConfig.showAvatarUpdate
enabled: !NeoChatConfig.isShowAvatarUpdateImmutable
@@ -260,37 +253,13 @@ FormCard.FormCardPage {
}
}
}
FormCard.FormHeader {
}
Kirigami.FormGroup {
title: i18nc("Chat Editor", "Editor")
}
FormCard.FormCard {
FormCard.FormRadioDelegate {
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 {
Kirigami.FormEntry {
contentItem: QQC2.CheckBox {
id: quickEditCheckbox
text: i18n("Use s/text/replacement syntax to edit your last message")
checked: NeoChatConfig.allowQuickEdit
@@ -300,11 +269,12 @@ FormCard.FormCardPage {
NeoChatConfig.save();
}
}
FormCard.FormDelegateSeparator {
above: quickEditCheckbox
below: typingNotificationsDelegate
}
FormCard.FormCheckDelegate {
Kirigami.FormSeparator {}
Kirigami.FormEntry {
contentItem: QQC2.CheckBox {
id: typingNotificationsDelegate
text: i18n("Send typing notifications")
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
text: i18n("Enable developer tools")
checked: NeoChatConfig.developerTools
@@ -329,13 +300,13 @@ FormCard.FormCardPage {
NeoChatConfig.save();
}
}
FormCard.FormDelegateSeparator {
above: enableDeveloperToolsDelegate
below: openDeveloperToolsDelegate
}
FormCard.FormButtonDelegate {
id: openDeveloperToolsDelegate
Kirigami.FormSeparator {}
Kirigami.FormEntry {
visible: NeoChatConfig.developerTools
contentItem: QQC2.Button {
id: openDeveloperToolsDelegate
icon.name: "tools"
text: i18n("Open Developer Tools")
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 {
FormCard.FormButtonDelegate {
Kirigami.FormGroup {
title: i18nc("@title:group", "Default Settings")
Kirigami.FormEntry {
contentItem: QQC2.Button {
icon.name: "kt-restore-defaults-symbolic"
text: i18nc("@action:button", "Reset all configuration values to their default…")
onClicked: resetDialog.open()
}
}
}
}
Kirigami.PromptDialog {
id: resetDialog
title: i18nc("@title:dialog", "Reset Configuration")