Warning, /network/neochat/src/qml/GeneralSettingsPage.qml is written in an unsupported language. File is not indexed.
0001 // SPDX-FileCopyrightText: 2020 Tobias Fella <tobias.fella@kde.org> 0002 // SPDX-FileCopyrightText: 2021 Carl Schwan <carl@carlschwan.eu> 0003 // SPDX-License-Identifier: GPL-2.0-or-later 0004 0005 import QtQuick 0006 import QtQuick.Layouts 0007 0008 import org.kde.kirigami as Kirigami 0009 import org.kde.kirigamiaddons.formcard as FormCard 0010 0011 import org.kde.neochat 0012 import org.kde.neochat.config 0013 0014 FormCard.FormCardPage { 0015 title: i18nc("@title:window", "General") 0016 0017 FormCard.FormHeader { 0018 title: i18n("General settings") 0019 visible: Qt.platform.os !== "android" 0020 } 0021 FormCard.FormCard { 0022 FormCard.FormCheckDelegate { 0023 id: closeDelegate 0024 text: i18n("Show in System Tray") 0025 checked: Config.systemTray 0026 visible: Controller.supportSystemTray 0027 enabled: !Config.isSystemTrayImmutable 0028 onToggled: { 0029 Config.systemTray = checked 0030 Config.save() 0031 } 0032 } 0033 0034 FormCard.FormDelegateSeparator { above: closeDelegate; below: minimizeDelegate } 0035 0036 FormCard.FormCheckDelegate { 0037 id: minimizeDelegate 0038 text: i18n("Minimize to system tray on startup") 0039 checked: Config.minimizeToSystemTrayOnStartup 0040 visible: Controller.supportSystemTray && !Kirigami.Settings.isMobile 0041 enabled: Config.systemTray && !Config.isMinimizeToSystemTrayOnStartupImmutable 0042 onToggled: { 0043 Config.minimizeToSystemTrayOnStartup = checked 0044 Config.save() 0045 } 0046 } 0047 0048 FormCard.FormDelegateSeparator { above: minimizeDelegate; below: automaticallyDelegate } 0049 0050 FormCard.FormCheckDelegate { 0051 id: automaticallyDelegate 0052 text: i18n("Automatically hide/unhide the room information when resizing the window") 0053 checked: Config.autoRoomInfoDrawer 0054 enabled: !Config.isAutoRoomInfoDrawerImmutable 0055 visible: Qt.platform.os !== "android" 0056 onToggled: { 0057 Config.autoRoomInfoDrawer = checked 0058 Config.save() 0059 } 0060 } 0061 } 0062 FormCard.FormHeader { 0063 title: i18n("Timeline Events") 0064 } 0065 FormCard.FormCard { 0066 FormCard.FormCheckDelegate { 0067 id: showDeletedMessages 0068 text: i18n("Show deleted messages") 0069 checked: Config.showDeletedMessages 0070 enabled: !Config.isShowDeletedMessagesImmutable 0071 onToggled: { 0072 Config.showDeletedMessages = checked 0073 Config.save() 0074 } 0075 } 0076 0077 FormCard.FormDelegateSeparator { above: showDeletedMessages; below: showStateEvents } 0078 0079 FormCard.FormCheckDelegate { 0080 id: showStateEvents 0081 text: i18n("Show state events") 0082 checked: Config.showStateEvent 0083 enabled: !Config.isShowStateEventImmutable 0084 onToggled: { 0085 Config.showStateEvent = checked 0086 Config.save() 0087 } 0088 } 0089 0090 FormCard.FormDelegateSeparator { 0091 visible: Config.showStateEvent 0092 above: showStateEvents 0093 below: showLeaveJoinEventDelegate } 0094 0095 FormCard.FormCheckDelegate { 0096 id: showLeaveJoinEventDelegate 0097 visible: Config.showStateEvent 0098 text: i18n("Show leave and join events") 0099 checked: Config.showLeaveJoinEvent 0100 enabled: !Config.isShowLeaveJoinEventImmutable 0101 onToggled: { 0102 Config.showLeaveJoinEvent = checked 0103 Config.save() 0104 } 0105 } 0106 0107 FormCard.FormDelegateSeparator { 0108 visible: Config.showStateEvent 0109 above: showLeaveJoinEventDelegate 0110 below: showNameDelegate 0111 } 0112 0113 FormCard.FormCheckDelegate { 0114 id: showNameDelegate 0115 visible: Config.showStateEvent 0116 text: i18n("Show name change events") 0117 checked: Config.showRename 0118 enabled: !Config.isShowRenameImmutable 0119 onToggled: { 0120 Config.showRename = checked 0121 Config.save() 0122 } 0123 } 0124 0125 FormCard.FormDelegateSeparator { 0126 visible: Config.showStateEvent 0127 above: showNameDelegate 0128 below: showAvatarChangeDelegate 0129 } 0130 0131 FormCard.FormCheckDelegate { 0132 id: showAvatarChangeDelegate 0133 visible: Config.showStateEvent 0134 text: i18n("Show avatar update events") 0135 checked: Config.showAvatarUpdate 0136 enabled: !Config.isShowAvatarUpdateImmutable 0137 onToggled: { 0138 Config.showAvatarUpdate = checked 0139 Config.save() 0140 } 0141 } 0142 } 0143 FormCard.FormHeader { 0144 title: i18n("Rooms and private chats") 0145 } 0146 FormCard.FormCard { 0147 FormCard.FormRadioDelegate { 0148 text: i18n("Separated") 0149 checked: !Config.mergeRoomList 0150 enabled: !Config.isMergeRoomListImmutable 0151 onToggled: { 0152 Config.mergeRoomList = false 0153 Config.save() 0154 } 0155 } 0156 FormCard.FormRadioDelegate { 0157 text: i18n("Intermixed") 0158 checked: Config.mergeRoomList 0159 enabled: !Config.isMergeRoomListImmutable 0160 onToggled: { 0161 Config.mergeRoomList = true 0162 Config.save() 0163 } 0164 } 0165 } 0166 FormCard.FormHeader { 0167 title: i18nc("Chat Editor", "Editor") 0168 } 0169 FormCard.FormCard { 0170 FormCard.FormCheckDelegate { 0171 id: quickEditCheckbox 0172 text: i18n("Use s/text/replacement syntax to edit your last message") 0173 checked: Config.allowQuickEdit 0174 enabled: !Config.isAllowQuickEditImmutable 0175 onToggled: { 0176 Config.allowQuickEdit = checked 0177 Config.save() 0178 } 0179 } 0180 FormCard.FormDelegateSeparator { above: quickEditCheckbox; below: typingNotificationsDelegate } 0181 FormCard.FormCheckDelegate { 0182 id: typingNotificationsDelegate 0183 text: i18n("Send typing notifications") 0184 checked: Config.typingNotifications 0185 enabled: !Config.isTypingNotificationsImmutable 0186 onToggled: { 0187 Config.typingNotifications = checked 0188 Config.save() 0189 } 0190 } 0191 } 0192 FormCard.FormHeader { 0193 title: i18n("Developer Settings") 0194 } 0195 FormCard.FormCard { 0196 FormCard.FormCheckDelegate { 0197 text: i18n("Enable developer tools") 0198 checked: Config.developerTools 0199 enabled: !Config.isDeveloperToolsImmutable 0200 onToggled: { 0201 Config.developerTools = checked 0202 Config.save() 0203 } 0204 } 0205 } 0206 }