Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma applet for NetworkManager
Commits
5aea7c4e
Commit
5aea7c4e
authored
Nov 27, 2020
by
Devin Lin
🎨
Committed by
Bhushan Shah
Nov 27, 2020
Browse files
Switch mobile wifi to use overlay sheet for password input
parent
c6b9d6c7
Changes
3
Hide whitespace changes
Inline
Side-by-side
mobile/wifi/package/contents/ui/ConnectDialog.qml
0 → 100644
View file @
5aea7c4e
/*
* Copyright 2020 Devin Lin <espidev@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Library General Public License for more details
*
* You should have received a copy of the GNU Library General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import
QtQuick
2.6
import
QtQuick
.
Layouts
1.2
import
QtQuick
.
Controls
2.2
as
Controls
import
org
.
kde
.
kirigami
2.12
as
Kirigami
Kirigami.OverlaySheet
{
id
:
sheetRoot
property
int
securityType
property
string
headingText
property
string
devicePath
property
string
specificPath
signal
donePressed
(
string
password
)
function
openAndClear
()
{
warning
.
visible
=
false
;
this
.
open
();
passwordField
.
text
=
""
;
passwordField
.
focus
=
true
;
}
header
:
Kirigami.Heading
{
level
:
2
text
:
headingText
wrapMode
:
Text
.
WordWrap
}
footer
:
RowLayout
{
Item
{
Layout.fillWidth
:
true
}
Controls.Button
{
text
:
i18nc
(
"
@action:button
"
,
"
Cancel
"
)
icon.name
:
"
dialog-close
"
onClicked
:
sheetRoot
.
close
();
}
Controls.Button
{
text
:
i18nc
(
"
@action:button
"
,
"
Done
"
)
icon.name
:
"
dialog-ok
"
onClicked
:
{
if
(
passwordField
.
acceptableInput
)
{
sheetRoot
.
close
();
handler
.
addAndActivateConnection
(
devicePath
,
specificPath
,
passwordField
.
text
);
}
else
{
warning
.
visible
=
true
;
}
}
}
}
ColumnLayout
{
Layout.fillWidth
:
true
spacing
:
Kirigami
.
Units
.
largeSpacing
PasswordField
{
id
:
passwordField
Layout.fillWidth
:
true
securityType
:
sheetRoot
.
securityType
}
Controls.Label
{
id
:
warning
text
:
i18n
(
"
Invalid input.
"
)
visible
:
false
}
}
}
mobile/wifi/package/contents/ui/ConnectionItemDelegate.qml
View file @
5aea7c4e
...
...
@@ -70,27 +70,10 @@ Kirigami.SwipeListItem {
id
:
connectionNameLabel
Layout.fillWidth
:
true
visible
:
!
connectionPasswordField
.
visible
elide
:
Text
.
ElideRight
text
:
ItemUniqueName
textFormat
:
Text
.
PlainText
}
PasswordField
{
id
:
connectionPasswordField
Layout.fillWidth
:
true
implicitWidth
:
Kirigami
.
Units
.
gridUnit
*
16
securityType
:
SecurityType
visible
:
false
onVisibleChanged
:
{
if
(
visible
)
forceActiveFocus
()
connectionPasswordField
.
text
=
""
}
onAccepted
:
{
if
(
acceptableInput
)
handler
.
addAndActivateConnection
(
DevicePath
,
SpecificPath
,
connectionPasswordField
.
text
);
}
}
}
actions
:
[
...
...
@@ -123,17 +106,10 @@ Kirigami.SwipeListItem {
}
function
changeState
()
{
if
(
Uuid
||
!
predictableWirelessPassword
||
connectionPasswordField
.
visible
)
{
if
(
Uuid
||
!
predictableWirelessPassword
)
{
if
(
ConnectionState
==
PlasmaNM
.
Enums
.
Deactivated
)
{
if
(
!
predictableWirelessPassword
&&
!
Uuid
)
{
handler
.
addAndActivateConnection
(
DevicePath
,
SpecificPath
);
}
else
if
(
connectionPasswordField
.
visible
)
{
if
(
connectionPasswordField
.
text
!=
""
)
{
handler
.
addAndActivateConnection
(
DevicePath
,
SpecificPath
,
connectionPasswordFieldField
.
text
);
connectionPasswordField
.
visible
=
false
;
}
else
{
connectionPasswordField
.
visible
=
false
;
}
}
else
{
handler
.
activateConnection
(
ConnectionPath
,
DevicePath
,
SpecificPath
);
}
...
...
@@ -141,7 +117,11 @@ Kirigami.SwipeListItem {
//show popup
}
}
else
if
(
predictableWirelessPassword
)
{
connectionPasswordField
.
visible
=
true
;
connectionDialog
.
headingText
=
i18n
(
"
Connect to
"
)
+
"
"
+
ItemUniqueName
;
connectionDialog
.
devicePath
=
DevicePath
;
connectionDialog
.
specificPath
=
SpecificPath
;
connectionDialog
.
securityType
=
SecurityType
;
connectionDialog
.
openAndClear
();
}
}
}
mobile/wifi/package/contents/ui/main.qml
View file @
5aea7c4e
...
...
@@ -74,6 +74,10 @@ ScrollViewKCM {
}
}
ConnectDialog
{
id
:
connectionDialog
}
view
:
ListView
{
id
:
view
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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