Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Plasma applet for NetworkManager
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
5
Merge Requests
5
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Plasma
Plasma applet for NetworkManager
Commits
fab05557
Commit
fab05557
authored
Mar 27, 2018
by
Martin Kacej
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dialogs transfered to Pages
parent
db26d701
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
84 additions
and
107 deletions
+84
-107
mobile/package/contents/ui/ConnectionEditorDialog.qml
mobile/package/contents/ui/ConnectionEditorDialog.qml
+32
-5
mobile/package/contents/ui/NetworkDetailsView.qml
mobile/package/contents/ui/NetworkDetailsView.qml
+8
-13
mobile/package/contents/ui/RowItemDelegate.qml
mobile/package/contents/ui/RowItemDelegate.qml
+18
-13
mobile/package/contents/ui/Wifi.qml
mobile/package/contents/ui/Wifi.qml
+26
-76
No files found.
mobile/package/contents/ui/ConnectionEditorDialog.qml
View file @
fab05557
...
...
@@ -22,39 +22,66 @@ import QtQuick.Controls 2.2 as Controls
import
QtQuick
.
Layouts
1.2
import
org
.
kde
.
plasma
.
components
2.0
as
PlasmaComponents
import
org
.
kde
.
plasma
.
extras
2.0
as
PlasmaExtras
import
org
.
kde
.
kirigami
2.2
as
Kirigami
PlasmaExtras.ScrollArea
{
Kirigami.ScrollablePage
{
property
var
details
property
var
str
:
0
property
var
connection
:
({})
property
var
wirelessSettings
:
({})
property
var
enabledSaving
:
(
editorIpSection
.
enabledSave
&&
editorSecuritySection
.
enabledSave
&&
ssidField
.
text
)
title
:
i18n
(
"
Connection Editor
"
)
ColumnLayout
{
id
:
columnlayout
anchors.horizontalCenter
:
parent
.
horizontalCenter
PlasmaComponent
s.Label
{
Control
s.Label
{
text
:
i18n
(
"
SSID
"
)
font.weight
:
Font
.
Bold
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
PlasmaComponent
s.TextField
{
Control
s.TextField
{
id
:
ssidField
Layout.fillWidth
:
true
anchors.horizontalCenter
:
parent
.
horizontalCenter
placeholderText
:
i18n
(
"
None
"
)
}
IPDetailsSection
{
id
:
editorIpSection
width
:
parent
.
width
anchors.horizontalCenter
:
parent
.
horizontalCenter
}
SecuritySection
{
id
:
editorSecuritySection
//anchors.top: editorIpSection.bottom
anchors.topMargin
:
units
.
gridUnit
anchors.horizontalCenter
:
parent
.
horizontalCenter
width
:
parent
.
width
}
}
actions
{
left
:
Kirigami.Action
{
text
:
"
save
"
enabled
:
enabledSaving
onTriggered
:
{
save
()
applicationWindow
().
pageStack
.
pop
()
}
}
right
:
Kirigami.Action
{
iconName
:
"
cancel
"
onTriggered
:
{
applicationWindow
().
pageStack
.
pop
()
}
}
}
function
save
()
{
var
m
=
({});
connection
[
"
id
"
]
=
ssidField
.
text
...
...
mobile/package/contents/ui/NetworkDetailsView.qml
View file @
fab05557
...
...
@@ -29,7 +29,7 @@ PlasmaExtras.ScrollArea {
property
alias
signal_speed
:
linkSpeedLabel
.
text
property
alias
ip_address
:
ipAddressLabel
.
text
property
alias
security
:
securityLabel
.
text
property
var
map
:
[]
property
var
activeMap
:
({})
Column
{
Column
{
...
...
@@ -89,13 +89,17 @@ PlasmaExtras.ScrollArea {
}
}
SecuritySection
{
id
:
detailsSecuritySection
}
RowLayout
{
PlasmaComponent
s.Label
{
Control
s.Label
{
anchors.left
:
parent
.
left
text
:
i18n
(
"
Advanced options
"
)
}
PlasmaComponent
s.Switch
{
Control
s.Switch
{
id
:
advancedOptionsSwitch
checked
:
false
}
...
...
@@ -105,11 +109,6 @@ PlasmaExtras.ScrollArea {
id
:
detailsIP
visible
:
advancedOptionsSwitch
.
checked
}
SecuritySection
{
id
:
s
visible
:
advancedOptionsSwitch
.
checked
}
}
function
fillDetails
()
{
...
...
@@ -117,11 +116,7 @@ PlasmaExtras.ScrollArea {
for
(
var
i
=
0
;
i
<
(
details
.
length
/
2
);
i
++
){
d
[
details
[(
i
*
2
)]]
=
details
[(
i
*
2
)
+
1
]
}
for
(
var
i
in
map
)
{
if
(
map
.
hasOwnProperty
(
i
))
{
console
.
info
(
i
+
'
=
'
+
map
[
i
]);
}
}
if
(
d
[
'
Access point (SSID)
'
])
detailsDialog
.
titleText
=
d
[
'
Access point (SSID)
'
]
signal_strength
=
d
[
'
Signal strength
'
]
...
...
mobile/package/contents/ui/RowItemDelegate.qml
View file @
fab05557
...
...
@@ -155,20 +155,25 @@ Kirigami.SwipeListItem {
]
function
getDetails
()
{
if
(
ConnectionDetails
)
networkDetailsViewContent
.
details
=
ConnectionDetails
if
(
ConnectionDetails
[
1
]
!==
""
)
{
detailsDialog
.
titleText
=
ItemUniqueName
}
else
{
detailsDialog
.
titleText
=
i18n
(
"
Network details
"
)
}
map
=
handler
.
getConnectionSettings
(
ConnectionPath
,
"
ipv4
"
)
if
(
ConnectionState
==
PlasmaNM
.
Enums
.
Activated
){
handler
.
getActiveConnectionInfo
(
ConnectionPath
)
applicationWindow
().
pageStack
.
push
(
networkDetailsViewComponent
)
if
(
networkDetailsViewComponent
.
status
==
Component
.
Ready
){
console
.
info
(
"
Network view ready
"
)
if
(
ConnectionDetails
)
networkDetailsViewComponentView
.
details
=
ConnectionDetails
if
(
ConnectionDetails
[
1
]
!==
""
)
{
detailsDialog
.
titleText
=
ItemUniqueName
}
else
{
detailsDialog
.
titleText
=
i18n
(
"
Network details
"
)
}
map
=
handler
.
getConnectionSettings
(
ConnectionPath
,
"
ipv4
"
)
if
(
ConnectionState
==
PlasmaNM
.
Enums
.
Activated
){
networkDetailsViewComponentView
.
activeMap
=
handler
.
getActiveConnectionInfo
(
SpecificPath
)
}
//networkDetailsViewContent.map = map
networkDetailsViewComponentView
.
fillDetails
()
//applicationWindow().pageStack.push(networkDetailsViewComponent)
}
networkDetailsViewContent
.
map
=
map
networkDetailsViewContent
.
fillDetails
()
detailsDialog
.
open
()
}
function
changeState
()
{
...
...
mobile/package/contents/ui/Wifi.qml
View file @
fab05557
...
...
@@ -25,11 +25,14 @@ import org.kde.plasma.extras 2.0 as PlasmaExtras
import
org
.
kde
.
plasma
.
networkmanagement
0.2
as
PlasmaNM
import
org
.
kde
.
kirigami
2.2
as
Kirigami
Kirigami.
Page
{
Kirigami.
ApplicationItem
{
id
:
main
objectName
:
"
wifiMain
"
width
:
units
.
gridUnit
*
30
height
:
width
*
1.5
//width: units.gridUnit * 30
//height: width * 1.5
pageStack.defaultColumnWidth
:
Kirigami
.
Units
.
gridUnit
*
25
pageStack.initialPage
:
formLayout
PlasmaNM.Handler
{
id
:
handler
...
...
@@ -43,6 +46,10 @@ Kirigami.Page {
}
}
contextDrawer
:
Kirigami.ContextDrawer
{
id
:
contextDrawer
}
PlasmaNM.NetworkModel
{
id
:
connectionModel
}
...
...
@@ -56,15 +63,12 @@ Kirigami.Page {
id
:
formLayout
anchors
{
fill
:
parent
margins
:
units
.
gridUnit
leftMargin
:
units
.
gridUnit
/
2
}
RowLayout
{
id
:
layoutrow
width
:
parent
.
width
PlasmaComponent
s.Label
{
Control
s.Label
{
anchors.left
:
parent
.
left
text
:
i18n
(
"
Wifi
"
)
Layout.fillWidth
:
true
...
...
@@ -80,6 +84,7 @@ Kirigami.Page {
}
}
Rectangle
{
id
:
separator
anchors.top
:
layoutrow
.
bottom
...
...
@@ -120,87 +125,32 @@ Kirigami.Page {
model
:
mobileProxyModel
delegate
:
RowItemDelegate
{}
}
}
PlasmaComponent
s.Button
{
Control
s.Button
{
id
:
customConnectionButton
anchors.top
:
wifiarea
.
bottom
anchors.topMargin
:
units
.
gridUnit
text
:
i18n
(
"
Add custom connection
"
)
onClicked
:
connectionEditorDialog
.
open
()
onClicked
:
{
applicationWindow
().
pageStack
.
push
(
connectionEditorDialogcomponent
)
//Qt.resolvedUrl("./ConnectionEditorDialog.qml"))
}
}
}
contextualActions
:
[
Kirigami.Action
{
text
:
"
Add custom connection
"
onTriggered
:
connectionEditorDialog
.
open
()
},
Kirigami.Action
{
text
:
"
Create Hotspot
"
onTriggered
:
showPassiveNotification
(
"
Open tethering
"
)
}
]
PlasmaComponents.Dialog
{
id
:
connectionEditorDialog
title
:
i18n
(
"
Connection Editor
"
)
buttons
:
RowLayout
{
width
:
parent
.
width
PlasmaComponents.Button
{
text
:
'
Save
'
enabled
:
connectionEditorDialogContent
.
enabledSaving
onClicked
:{
connectionEditorDialogContent
.
save
()
connectionEditorDialog
.
close
()
}
}
PlasmaComponents.Button
{
anchors.right
:
parent
.
right
text
:
'
Cancel
'
onClicked
:
connectionEditorDialog
.
close
()
}
}
content
:
ConnectionEditorDialog
{
id
:
connectionEditorDialogContent
width
:
units
.
gridUnit
*
22
height
:
units
.
gridUnit
*
25
Component.onDestruction
:
{
console
.
info
(
"
Destroyed editor content
"
)
}
}
Component.onDestruction
:
{
console
.
info
(
"
Destroyed editor
"
)
connectionEditorDialogContent
.
destroy
()
Component
{
id
:
connectionEditorDialogcomponent
ConnectionEditorDialog
{
}
}
PlasmaComponents.CommonDialog
{
id
:
detailsDialog
titleText
:
i18n
(
"
Network Details
"
)
buttonTexts
:
[
i18n
(
"
Close
"
)]
onButtonClicked
:
{
networkDetailsViewContent
.
clearDetails
()
close
()
}
content
:
NetworkDetailsView
{
id
:
networkDetailsViewContent
width
:
units
.
gridUnit
*
22
height
:
units
.
gridUnit
*
25
Component.onDestruction
:
{
console
.
info
(
"
Destroyed details content
"
)
}
}
Component.onDestruction
:
{
console
.
info
(
"
Destroyed details
"
)
networkDetailsViewContent
.
destroy
()
Component
{
id
:
networkDetailsViewComponent
NetworkDetailsView
{
id
:
networkDetailsViewComponentView
}
}
Component.onDestruction
:
{
console
.
error
(
"
Destroyed main
"
)
connectionEditorDialog
.
destroy
()
detailsDialog
.
destroy
()
//connectionEditorDialog.connectionEditorDialogContent.destroy()
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment