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 { 0035 above: closeDelegate 0036 below: minimizeDelegate 0037 } 0038 0039 FormCard.FormCheckDelegate { 0040 id: minimizeDelegate 0041 text: i18n("Minimize to system tray on startup") 0042 checked: Config.minimizeToSystemTrayOnStartup 0043 visible: Controller.supportSystemTray && !Kirigami.Settings.isMobile 0044 enabled: Config.systemTray && !Config.isMinimizeToSystemTrayOnStartupImmutable 0045 onToggled: { 0046 Config.minimizeToSystemTrayOnStartup = checked; 0047 Config.save(); 0048 } 0049 } 0050 0051 FormCard.FormDelegateSeparator { 0052 above: minimizeDelegate 0053 below: automaticallyDelegate 0054 } 0055 0056 FormCard.FormCheckDelegate { 0057 id: automaticallyDelegate 0058 text: i18n("Automatically hide/unhide the room information when resizing the window") 0059 checked: Config.autoRoomInfoDrawer 0060 enabled: !Config.isAutoRoomInfoDrawerImmutable 0061 visible: Qt.platform.os !== "android" 0062 onToggled: { 0063 Config.autoRoomInfoDrawer = checked; 0064 Config.save(); 0065 } 0066 } 0067 } 0068 FormCard.FormHeader { 0069 title: i18n("Timeline Events") 0070 } 0071 FormCard.FormCard { 0072 FormCard.FormCheckDelegate { 0073 id: showDeletedMessages 0074 text: i18n("Show deleted messages") 0075 checked: Config.showDeletedMessages 0076 enabled: !Config.isShowDeletedMessagesImmutable 0077 onToggled: { 0078 Config.showDeletedMessages = checked; 0079 Config.save(); 0080 } 0081 } 0082 0083 FormCard.FormDelegateSeparator { 0084 above: showDeletedMessages 0085 below: showStateEvents 0086 } 0087 0088 FormCard.FormCheckDelegate { 0089 id: showStateEvents 0090 text: i18n("Show state events") 0091 checked: Config.showStateEvent 0092 enabled: !Config.isShowStateEventImmutable 0093 onToggled: { 0094 Config.showStateEvent = checked; 0095 Config.save(); 0096 } 0097 } 0098 0099 FormCard.FormDelegateSeparator { 0100 visible: Config.showStateEvent 0101 above: showStateEvents 0102 below: showLeaveJoinEventDelegate 0103 } 0104 0105 FormCard.FormCheckDelegate { 0106 id: showLeaveJoinEventDelegate 0107 visible: Config.showStateEvent 0108 text: i18n("Show leave and join events") 0109 checked: Config.showLeaveJoinEvent 0110 enabled: !Config.isShowLeaveJoinEventImmutable 0111 onToggled: { 0112 Config.showLeaveJoinEvent = checked; 0113 Config.save(); 0114 } 0115 } 0116 0117 FormCard.FormDelegateSeparator { 0118 visible: Config.showStateEvent 0119 above: showLeaveJoinEventDelegate 0120 below: showNameDelegate 0121 } 0122 0123 FormCard.FormCheckDelegate { 0124 id: showNameDelegate 0125 visible: Config.showStateEvent 0126 text: i18n("Show name change events") 0127 checked: Config.showRename 0128 enabled: !Config.isShowRenameImmutable 0129 onToggled: { 0130 Config.showRename = checked; 0131 Config.save(); 0132 } 0133 } 0134 0135 FormCard.FormDelegateSeparator { 0136 visible: Config.showStateEvent 0137 above: showNameDelegate 0138 below: showAvatarChangeDelegate 0139 } 0140 0141 FormCard.FormCheckDelegate { 0142 id: showAvatarChangeDelegate 0143 visible: Config.showStateEvent 0144 text: i18n("Show avatar update events") 0145 checked: Config.showAvatarUpdate 0146 enabled: !Config.isShowAvatarUpdateImmutable 0147 onToggled: { 0148 Config.showAvatarUpdate = checked; 0149 Config.save(); 0150 } 0151 } 0152 } 0153 FormCard.FormHeader { 0154 title: i18nc("Chat Editor", "Editor") 0155 } 0156 FormCard.FormCard { 0157 FormCard.FormCheckDelegate { 0158 id: quickEditCheckbox 0159 text: i18n("Use s/text/replacement syntax to edit your last message") 0160 checked: Config.allowQuickEdit 0161 enabled: !Config.isAllowQuickEditImmutable 0162 onToggled: { 0163 Config.allowQuickEdit = checked; 0164 Config.save(); 0165 } 0166 } 0167 FormCard.FormDelegateSeparator { 0168 above: quickEditCheckbox 0169 below: typingNotificationsDelegate 0170 } 0171 FormCard.FormCheckDelegate { 0172 id: typingNotificationsDelegate 0173 text: i18n("Send typing notifications") 0174 checked: Config.typingNotifications 0175 enabled: !Config.isTypingNotificationsImmutable 0176 onToggled: { 0177 Config.typingNotifications = checked; 0178 Config.save(); 0179 } 0180 } 0181 } 0182 FormCard.FormHeader { 0183 title: i18n("Developer Settings") 0184 } 0185 FormCard.FormCard { 0186 FormCard.FormCheckDelegate { 0187 text: i18n("Enable developer tools") 0188 checked: Config.developerTools 0189 enabled: !Config.isDeveloperToolsImmutable 0190 onToggled: { 0191 Config.developerTools = checked; 0192 Config.save(); 0193 } 0194 } 0195 } 0196 }