Differential D17211 Diff 46394 desktoppackage/contents/configuration/ConfigurationContainmentActions.qml
Changeset View
Changeset View
Standalone View
Standalone View
desktoppackage/contents/configuration/ConfigurationContainmentActions.qml
Show All 11 Lines | |||||
12 | * GNU General Public License for more details. | 12 | * GNU General Public License for more details. | ||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU General Public License | 14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | 15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. | 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. | ||
17 | */ | 17 | */ | ||
18 | 18 | | |||
19 | import QtQuick 2.0 | 19 | import QtQuick 2.0 | ||
20 | import QtQuick.Controls 1.0 as QtControls | 20 | import QtQuick.Controls 2.3 as QtControls | ||
21 | import QtQuick.Layouts 1.0 | 21 | import QtQuick.Layouts 1.0 | ||
22 | 22 | | |||
23 | Item { | 23 | Item { | ||
24 | id: root | 24 | id: root | ||
25 | 25 | | |||
26 | signal configurationChanged | 26 | signal configurationChanged | ||
27 | implicitWidth: mainColumn.implicitWidth | 27 | implicitWidth: mainColumn.implicitWidth | ||
28 | implicitHeight: mainColumn.implicitHeight | 28 | implicitHeight: mainColumn.implicitHeight | ||
▲ Show 20 Lines • Show All 80 Lines • ▼ Show 20 Line(s) | 108 | Component.onCompleted: { | |||
109 | for (var i = 0; i < configDialog.containmentActionConfigModel.count; ++i) { | 109 | for (var i = 0; i < configDialog.containmentActionConfigModel.count; ++i) { | ||
110 | if (configDialog.containmentActionConfigModel.get(i).pluginName == pluginName) { | 110 | if (configDialog.containmentActionConfigModel.get(i).pluginName == pluginName) { | ||
111 | pluginsCombo.currentIndex = i; | 111 | pluginsCombo.currentIndex = i; | ||
112 | break; | 112 | break; | ||
113 | } | 113 | } | ||
114 | } | 114 | } | ||
115 | pluginsCombo.initialized = true; | 115 | pluginsCombo.initialized = true; | ||
116 | } | 116 | } | ||
117 | onCurrentIndexChanged: { | 117 | onActivated: { | ||
118 | if (initialized && configDialog.containmentActionConfigModel.get(currentIndex).pluginName != pluginName) { | 118 | if (initialized && configDialog.containmentActionConfigModel.get(currentIndex).pluginName != pluginName) { | ||
119 | configDialog.currentContainmentActionsModel.update(index, action, configDialog.containmentActionConfigModel.get(currentIndex).pluginName); | 119 | configDialog.currentContainmentActionsModel.update(index, action, configDialog.containmentActionConfigModel.get(currentIndex).pluginName); | ||
120 | } | 120 | } | ||
121 | } | 121 | } | ||
122 | } | 122 | } | ||
123 | } | 123 | } | ||
124 | 124 | | |||
125 | Repeater { | 125 | Repeater { | ||
126 | model: configDialog.currentContainmentActionsModel | 126 | model: configDialog.currentContainmentActionsModel | ||
127 | 127 | | |||
128 | RowLayout { | 128 | RowLayout { | ||
129 | Layout.column: 2 | 129 | Layout.column: 2 | ||
130 | Layout.row: index | 130 | Layout.row: index | ||
131 | 131 | | |||
132 | QtControls.Button { | 132 | QtControls.Button { | ||
133 | iconName: "configure" | 133 | icon.name: "configure" | ||
134 | width: height | 134 | width: height | ||
135 | enabled: model.hasConfigurationInterface | 135 | enabled: model.hasConfigurationInterface | ||
136 | onClicked: { | 136 | onClicked: { | ||
137 | configDialog.currentContainmentActionsModel.showConfiguration(index, this); | 137 | configDialog.currentContainmentActionsModel.showConfiguration(index, this); | ||
138 | } | 138 | } | ||
139 | } | 139 | } | ||
140 | QtControls.Button { | 140 | QtControls.Button { | ||
141 | iconName: "dialog-information" | 141 | icon.name: "dialog-information" | ||
142 | width: height | 142 | width: height | ||
143 | onClicked: { | 143 | onClicked: { | ||
144 | configDialog.currentContainmentActionsModel.showAbout(index, this); | 144 | configDialog.currentContainmentActionsModel.showAbout(index, this); | ||
145 | } | 145 | } | ||
146 | } | 146 | } | ||
147 | QtControls.Button { | 147 | QtControls.Button { | ||
148 | iconName: "list-remove" | 148 | icon.name: "list-remove" | ||
149 | width: height | 149 | width: height | ||
150 | onClicked: { | 150 | onClicked: { | ||
151 | configDialog.currentContainmentActionsModel.remove(index); | 151 | configDialog.currentContainmentActionsModel.remove(index); | ||
152 | } | 152 | } | ||
153 | } | 153 | } | ||
154 | } | 154 | } | ||
155 | } | 155 | } | ||
156 | 156 | | |||
157 | MouseEventInputButton { | 157 | MouseEventInputButton { | ||
158 | anchors.left: parent.left | | |||
159 | defaultText: i18nd("plasma_shell_org.kde.plasma.desktop", "Add Action"); | 158 | defaultText: i18nd("plasma_shell_org.kde.plasma.desktop", "Add Action"); | ||
160 | onEventStringChanged: { | 159 | onEventStringChanged: { | ||
161 | configDialog.currentContainmentActionsModel.append(eventString, "org.kde.contextmenu"); | 160 | configDialog.currentContainmentActionsModel.append(eventString, "org.kde.contextmenu"); | ||
162 | } | 161 | } | ||
163 | } | 162 | } | ||
164 | } | 163 | } | ||
165 | 164 | | |||
166 | } | 165 | } |