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
6
Merge Requests
6
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
861f3d30
Commit
861f3d30
authored
Mar 17, 2018
by
Martin Kacej
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
connecting and other funcnionality
parent
022854a2
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
17 deletions
+83
-17
mobile/package/contents/ui/RowItemDelegate.qml
mobile/package/contents/ui/RowItemDelegate.qml
+82
-12
mobile/package/contents/ui/Wifi.qml
mobile/package/contents/ui/Wifi.qml
+1
-5
No files found.
mobile/package/contents/ui/RowItemDelegate.qml
View file @
861f3d30
...
...
@@ -23,27 +23,43 @@ import QtQuick.Layouts 1.2
import
org
.
kde
.
plasma
.
core
2.0
as
PlasmaCore
import
org
.
kde
.
plasma
.
components
2.0
as
PlasmaComponents
import
org
.
kde
.
plasma
.
networkmanagement
0.2
as
PlasmaNM
import
org
.
kde
.
kirigami
2
.0
as
Kirigami
import
org
.
kde
.
kirigami
1
.0
as
Kirigami
Kirigami.SwipeListItem
{
id
:
listitem
width
:
parent
.
width
height
:
units
.
gridUnit
*
3
enabled
:
true
backgroundColor
:
theme
.
backgroundColor
property
var
map
:
[]
property
bool
predictableWirelessPassword
:
!
Uuid
&&
Type
==
PlasmaNM
.
Enums
.
Wireless
&&
(
SecurityType
==
PlasmaNM
.
Enums
.
StaticWep
||
SecurityType
==
PlasmaNM
.
Enums
.
WpaPsk
||
SecurityType
==
PlasmaNM
.
Enums
.
Wpa2Psk
)
onClicked
:
{
changeState
()
}
Item
{
height
:
connectionSvgIcon
.
height
width
:
parent
.
width
anchors.centerIn
:
parent
PlasmaCore.SvgItem
{
id
:
connectionSvgIcon
anchors
{
left
:
parent
.
left
rightMargin
:
10
}
height
:
units
.
iconSizes
.
big
;
width
:
height
elementId
:
ConnectionIcon
//height: units.iconSizes.big; width: height
svg
:
PlasmaCore.Svg
{
multipleImages
:
true
imagePath
:
"
icons/network
"
...
...
@@ -79,9 +95,49 @@ Kirigami.SwipeListItem {
text
:
ItemUniqueName
textFormat
:
Text
.
PlainText
}
Item
{
id
:
connectionPasswordField
anchors.left
:
connectionNameLabel
.
left
height
:
units
.
gridUnit
*
1.5
visible
:
false
onVisibleChanged
:
{
connectionPasswordFieldField
.
text
=
""
}
PasswordField
{
id
:
connectionPasswordFieldField
height
:
parent
.
height
}
PlasmaComponents.Button
{
id
:
connectionPasswordFieldButton
anchors.left
:
connectionPasswordFieldField
.
right
width
:
units
.
gridUnit
*
5
height
:
parent
.
height
text
:
"
ok
"
// TODO icon, size
onClicked
:
{
handler
.
addAndActivateConnection
(
DevicePath
,
SpecificPath
,
connectionPasswordFieldField
.
text
);
}
}
}
}
actions
:
[
Kirigami.Action
{
iconName
:
"
go-previous
"
// TODO better icon
visible
:
ConnectionState
!=
PlasmaNM
.
Enums
.
Activated
onTriggered
:
changeState
()
},
Kirigami.Action
{
iconName
:
"
go-next
"
// TODO better icon
visible
:
ConnectionState
==
PlasmaNM
.
Enums
.
Activated
onTriggered
:
handler
.
deactivateConnection
(
ConnectionPath
,
DevicePath
)
},
Kirigami.Action
{
iconName
:
"
configure
"
onTriggered
:
getDetails
()
...
...
@@ -89,13 +145,11 @@ Kirigami.SwipeListItem {
Kirigami.Action
{
iconName
:
"
remove
"
visible
:
(
Uuid
!=
""
)?
true
:
false
onTriggered
:
{
forgetNetwork
()
}
onTriggered
:
forgetNetwork
()
}
]
function
getDetails
(){
function
getDetails
()
{
if
(
ConnectionDetails
)
networkDetailsViewContent
.
details
=
ConnectionDetails
if
(
ConnectionDetails
[
1
]
!==
""
)
{
...
...
@@ -108,17 +162,33 @@ Kirigami.SwipeListItem {
handler
.
getActiveConnectionInfo
(
ConnectionPath
)
}
networkDetailsViewContent
.
map
=
map
console
.
info
(
map
[
"
method
"
])
networkDetailsViewContent
.
fillDetails
()
detailsDialog
.
open
()
}
function
connect
()
{
console
.
info
(
ConnectionDetails
[
1
]
+
'
trying to connect
'
)
function
changeState
()
{
if
(
Uuid
||
!
predictableWirelessPassword
||
connectionPasswordField
.
visible
)
{
if
(
ConnectionState
==
PlasmaNM
.
Enums
.
Deactivated
)
{
if
(
!
predictableWirelessPassword
&&
!
Uuid
)
{
handler
.
addAndActivateConnection
(
DevicePath
,
SpecificPath
);
}
else
if
(
connectionPasswordField
.
visible
)
{
if
(
connectionPasswordFieldField
.
text
!=
""
)
{
handler
.
addAndActivateConnection
(
DevicePath
,
SpecificPath
,
connectionPasswordFieldField
.
text
);
connectionPasswordField
.
visible
=
false
;
}
else
{
connectionPasswordField
.
visible
=
false
;
}
}
else
{
handler
.
activateConnection
(
ConnectionPath
,
DevicePath
,
SpecificPath
);
}
}
}
else
if
(
predictableWirelessPassword
)
{
connectionPasswordField
.
visible
=
true
;
}
}
function
forgetNetwork
()
{
console
.
info
(
ConnectionPath
+
'
trying to forget
'
)
deleteConfirmation
.
open
()
// ItemUniqueName
// TODO confirmation dialog
handler
.
removeConnection
(
ConnectionPath
)
}
}
mobile/package/contents/ui/Wifi.qml
View file @
861f3d30
...
...
@@ -119,11 +119,7 @@ Item {
currentIndex
:
-
1
boundsBehavior
:
Flickable
.
StopAtBounds
model
:
mobileProxyModel
delegate
:
RowItemDelegate
{
onClicked
:
{
connect
()
}
}
delegate
:
RowItemDelegate
{}
}
}
...
...
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