Commit b5f223f3 authored by Nate Graham's avatar Nate Graham
Browse files

[KCM] Port main page to QQC2

Summary:
BUG: 414211
FIXED-IN: 5.18.0

Test Plan: Open Network Connections KCM and use it; no visual or behavioral regressions

Reviewers: jgrulich

Reviewed By: jgrulich

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D25408
parent fc443cce
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
import QtQuick 2.1 import QtQuick 2.1
import QtQuick.Dialogs 1.1 import QtQuick.Dialogs 1.1
import QtQuick.Controls 1.2 as QtControls import QtQuick.Controls 2.5 as QQC2
import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
...@@ -56,7 +56,7 @@ Item { ...@@ -56,7 +56,7 @@ Item {
sourceModel: connectionModel sourceModel: connectionModel
} }
QtControls.TextField { QQC2.TextField {
id: searchField id: searchField
anchors { anchors {
...@@ -72,9 +72,11 @@ Item { ...@@ -72,9 +72,11 @@ Item {
} }
} }
QtControls.ScrollView { QQC2.ScrollView {
id: scrollView id: scrollView
Component.onCompleted: background.visible = true // show frame
anchors { anchors {
bottom: buttonRow.top bottom: buttonRow.top
bottomMargin: Math.round(units.gridUnit / 3) bottomMargin: Math.round(units.gridUnit / 3)
...@@ -92,6 +94,8 @@ Item { ...@@ -92,6 +94,8 @@ Item {
anchors.fill: parent anchors.fill: parent
clip: true clip: true
focus: true
activeFocusOnTab: true
model: editorProxyModel model: editorProxyModel
currentIndex: -1 currentIndex: -1
boundsBehavior: Flickable.StopAtBounds boundsBehavior: Flickable.StopAtBounds
...@@ -136,23 +140,29 @@ Item { ...@@ -136,23 +140,29 @@ Item {
} }
spacing: Math.round(units.gridUnit / 2) spacing: Math.round(units.gridUnit / 2)
QtControls.ToolButton { QQC2.ToolButton {
id: addConnectionButton id: addConnectionButton
iconName: "list-add" icon.name: "list-add"
tooltip: i18n("Add new connection")
QQC2.ToolTip {
text: i18n("Add new connection")
}
onClicked: { onClicked: {
addNewConnectionDialog.open() addNewConnectionDialog.open()
} }
} }
QtControls.ToolButton { QQC2.ToolButton {
id: removeConnectionButton id: removeConnectionButton
enabled: connectionView.currentConnectionPath && connectionView.currentConnectionPath.length enabled: connectionView.currentConnectionPath && connectionView.currentConnectionPath.length
iconName: "list-remove" icon.name: "list-remove"
tooltip: i18n("Remove selected connection")
QQC2.ToolTip {
text: i18n("Remove selected connection")
}
onClicked: { onClicked: {
deleteConfirmationDialog.connectionName = connectionView.currentConnectionName deleteConfirmationDialog.connectionName = connectionView.currentConnectionName
...@@ -161,12 +171,15 @@ Item { ...@@ -161,12 +171,15 @@ Item {
} }
} }
QtControls.ToolButton { QQC2.ToolButton {
id: exportConnectionButton id: exportConnectionButton
enabled: connectionView.currentConnectionExportable enabled: connectionView.currentConnectionExportable
iconName: "document-export" icon.name: "document-export"
tooltip: i18n("Export selected connection")
QQC2.ToolTip {
text: i18n("Export selected connection")
}
onClicked: { onClicked: {
root.requestExportConnection(connectionView.currentConnectionPath) root.requestExportConnection(connectionView.currentConnectionPath)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment