Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
glacier-home
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
NemoMobile
glacier-home
Commits
dadf5260
Commit
dadf5260
authored
Jun 19, 2014
by
Aleksi Suomalainen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #18 from locusf/wifi_panel
[statusbar] Wifi panel added for statusbar
parents
b12c667c
28a33bf8
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
113 additions
and
2 deletions
+113
-2
Statusbar.qml
src/qml/Statusbar.qml
+19
-0
StatusbarItem.qml
src/qml/StatusbarItem.qml
+11
-1
WifiPanel.qml
src/qml/WifiPanel.qml
+80
-0
resources-qml.qrc
src/resources-qml.qrc
+1
-0
src.pro
src/src.pro
+2
-1
No files found.
src/qml/Statusbar.qml
View file @
dadf5260
...
@@ -75,6 +75,7 @@ Item {
...
@@ -75,6 +75,7 @@ Item {
onAvailableChanged
:
updateTechnologies
()
onAvailableChanged
:
updateTechnologies
()
onTechnologiesEnabledChanged
:
updateTechnologies
()
onTechnologiesEnabledChanged
:
updateTechnologies
()
onTechnologiesChanged
:
updateTechnologies
()
onTechnologiesChanged
:
updateTechnologies
()
}
}
NetworkTechnology
{
NetworkTechnology
{
...
@@ -91,6 +92,23 @@ Item {
...
@@ -91,6 +92,23 @@ Item {
key
:
"
Cellular.DataTechnology
"
key
:
"
Cellular.DataTechnology
"
}
}
TechnologyModel
{
id
:
wifimodel
name
:
"
wifi
"
onPoweredChanged
:
{
if
(
powered
)
wifimodel
.
requestScan
()
}
}
Loader
{
id
:
panel_loader
anchors.bottom
:
root
.
top
height
:
240
width
:
parent
.
width
visible
:
false
}
Row
{
Row
{
spacing
:
16
spacing
:
16
StatusbarItem
{
StatusbarItem
{
...
@@ -140,6 +158,7 @@ Item {
...
@@ -140,6 +158,7 @@ Item {
return
"
image://theme/icon_wifi_0
"
return
"
image://theme/icon_wifi_0
"
}
}
}
}
panel
:
WifiPanel
{}
}
}
StatusbarItem
{
StatusbarItem
{
source
:
"
image://theme/icon_bt_normal
"
source
:
"
image://theme/icon_bt_normal
"
...
...
src/qml/StatusbarItem.qml
View file @
dadf5260
...
@@ -4,7 +4,8 @@ Item {
...
@@ -4,7 +4,8 @@ Item {
height
:
48
height
:
48
width
:
48
width
:
48
property
alias
source
:
icon
.
source
property
alias
source
:
icon
.
source
property
string
panel_source
property
Component
panel
Image
{
Image
{
id
:
icon
id
:
icon
anchors.centerIn
:
parent
anchors.centerIn
:
parent
...
@@ -12,6 +13,15 @@ Item {
...
@@ -12,6 +13,15 @@ Item {
MouseArea
{
MouseArea
{
anchors.fill
:
parent
anchors.fill
:
parent
onClicked
:
{
onClicked
:
{
if
(
panel_source
!==
""
&&
!
panel
)
{
panel_loader
.
source
=
panel_source
panel_loader
.
visible
=
!
panel_loader
.
visible
}
if
(
panel
&&
panel_source
===
""
)
{
panel_loader
.
sourceComponent
=
panel
panel_loader
.
visible
=
!
panel_loader
.
visible
}
if
(
icon
.
source
.
toString
().
match
(
"
normal
"
))
{
if
(
icon
.
source
.
toString
().
match
(
"
normal
"
))
{
icon
.
source
=
icon
.
source
.
toString
().
replace
(
"
normal
"
,
"
focused
"
)
icon
.
source
=
icon
.
source
.
toString
().
replace
(
"
normal
"
,
"
focused
"
)
}
else
{
}
else
{
...
...
src/qml/WifiPanel.qml
0 → 100644
View file @
dadf5260
/****************************************************************************************
**
** Copyright (C) 2014 Aleksi Suomalainen <suomalainen.aleksi@gmail.com>
** All rights reserved.
**
** You may use this file under the terms of BSD license as follows:
**
** Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in the
** documentation and/or other materials provided with the distribution.
** * Neither the name of the author nor the
** names of its contributors may be used to endorse or promote products
** derived from this software without specific prior written permission.
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR
** ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
**
****************************************************************************************/
import
QtQuick
2.1
import
QtQuick
.
Controls
.
Nemo
1.0
import
QtQuick
.
Controls
.
Styles
.
Nemo
1.0
Component
{
Rectangle
{
height
:
240
width
:
root
.
width
color
:
"
#313131
"
opacity
:
0.5
Column
{
Repeater
{
model
:
wifimodel
delegate
:
Item
{
width
:
root
.
width
height
:
40
function
getStrengthIndex
(
strength
)
{
var
strengthIndex
=
"
0
"
if
(
strength
>=
59
)
{
strengthIndex
=
"
4
"
}
else
if
(
strength
>=
55
)
{
strengthIndex
=
"
3
"
}
else
if
(
strength
>=
50
)
{
strengthIndex
=
"
2
"
}
else
if
(
strength
>=
40
)
{
strengthIndex
=
"
1
"
}
return
strengthIndex
}
Row
{
spacing
:
12
Image
{
source
:
"
image://theme/icon_wifi_focused
"
+
getStrengthIndex
(
modelData
.
strength
)
}
Label
{
anchors.leftMargin
:
20
width
:
root
.
width
font.pointSize
:
8
text
:
modelData
.
name
wrapMode
:
Text
.
Wrap
}
}
}
}
}
}
}
src/resources-qml.qrc
View file @
dadf5260
...
@@ -39,5 +39,6 @@
...
@@ -39,5 +39,6 @@
<file>qml/Statusbar.qml</file>
<file>qml/Statusbar.qml</file>
<file>qml/images/wallpaper-portrait-bubbles.png</file>
<file>qml/images/wallpaper-portrait-bubbles.png</file>
<file>qml/StatusbarItem.qml</file>
<file>qml/StatusbarItem.qml</file>
<file>qml/WifiPanel.qml</file>
</qresource>
</qresource>
</RCC>
</RCC>
src/src.pro
View file @
dadf5260
...
@@ -45,6 +45,7 @@ OTHER_FILES += qml/*.qml \
...
@@ -45,6 +45,7 @@ OTHER_FILES += qml/*.qml \
qml/scripts/desktop.js \
qml/scripts/desktop.js \
qml/FeedsPage.qml \
qml/FeedsPage.qml \
qml/Statusbar.qml \
qml/Statusbar.qml \
qml/StatusbarItem.qml
qml/StatusbarItem.qml \
qml/WifiPanel.qml
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