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 Phone Components
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
26
Issues
26
List
Boards
Labels
Service Desk
Milestones
Merge Requests
4
Merge Requests
4
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Plasma
Plasma Phone Components
Commits
d5b65037
Commit
d5b65037
authored
Jun 24, 2015
by
Eike Hein
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Port to PlasmaWindowModel.
parent
758d3694
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
19 deletions
+28
-19
containments/taskpanel/package/contents/ui/Task.qml
containments/taskpanel/package/contents/ui/Task.qml
+2
-2
containments/taskpanel/package/contents/ui/TaskSwitcher.qml
containments/taskpanel/package/contents/ui/TaskSwitcher.qml
+9
-15
containments/taskpanel/taskpanel.cpp
containments/taskpanel/taskpanel.cpp
+9
-0
containments/taskpanel/taskpanel.h
containments/taskpanel/taskpanel.h
+8
-2
No files found.
containments/taskpanel/package/contents/ui/Task.qml
View file @
d5b65037
...
...
@@ -46,7 +46,7 @@ Item {
ScriptAction
{
script
:
{
if
(
background
.
x
!=
0
)
{
window
.
executeJob
(
"
close
"
,
model
.
Id
);
plasmoid
.
nativeInterface
.
windowModel
.
requestClose
(
model
.
index
);
}
}
}
...
...
@@ -83,7 +83,7 @@ Item {
onPressed
:
delegate
.
z
=
10
;
onClicked
:
{
window
.
hide
();
window
.
executeJob
(
"
activate
"
,
model
.
Id
);
plasmoid
.
nativeInterface
.
windowModel
.
requestActivate
(
model
.
index
);
}
onReleased
:
{
delegate
.
z
=
0
;
...
...
containments/taskpanel/package/contents/ui/TaskSwitcher.qml
View file @
d5b65037
...
...
@@ -20,7 +20,7 @@
import
QtQuick
2.0
import
QtQuick
.
Layouts
1.1
import
QtQuick
.
Window
2.2
import
org
.
kde
.
plasma
.
core
2.
0
as
PlasmaCore
import
org
.
kde
.
plasma
.
core
2.
1
as
PlasmaCore
import
org
.
kde
.
plasma
.
components
2.0
as
PlasmaComponents
import
org
.
kde
.
plasma
.
mobilecomponents
0.2
...
...
@@ -56,19 +56,6 @@ FullScreenPanel {
scrollAnim
.
running
=
true
;
}
PlasmaCore.DataSource
{
id
:
tasksSource
engine
:
"
tasks
"
connectedSources
:
"
tasks
"
}
function
executeJob
(
operationName
,
id
)
{
var
service
=
tasksSource
.
serviceForSource
(
"
tasks
"
);
var
operation
=
service
.
operationDescription
(
operationName
);
operation
.
Id
=
id
;
service
.
startOperationCall
(
operation
);
}
SequentialAnimation
{
id
:
scrollAnim
property
alias
to
:
internalAnim
.
to
...
...
@@ -140,7 +127,14 @@ FullScreenPanel {
}
}
model
:
tasksSource
.
models
.
tasks
PlasmaCore.SortFilterModel
{
id
:
filteredWindowModel
filterRole
:
"
DisplayRole
"
filterRegExp
:
"
.+
"
sourceModel
:
plasmoid
.
nativeInterface
.
windowModel
}
model
:
filteredWindowModel
header
:
Item
{
width
:
window
.
width
height
:
window
.
height
...
...
containments/taskpanel/taskpanel.cpp
View file @
d5b65037
...
...
@@ -26,6 +26,7 @@
#include <KWayland/Client/connection_thread.h>
#include <KWayland/Client/plasmawindowmanagement.h>
#include <KWayland/Client/plasmawindowmodel.h>
#include <KWayland/Client/registry.h>
static
const
QString
s_kwinService
=
QStringLiteral
(
"org.kde.KWin"
);
...
...
@@ -66,6 +67,9 @@ void TaskPanel::initWayland()
connect
(
registry
,
&
Registry
::
plasmaWindowManagementAnnounced
,
this
,
[
this
,
registry
]
(
quint32
name
,
quint32
version
)
{
m_windowManagement
=
registry
->
createPlasmaWindowManagement
(
name
,
version
,
this
);
qRegisterMetaType
<
QVector
<
int
>
>
(
"QVector<int>"
);
m_windowModel
=
m_windowManagement
->
createWindowModel
();
emit
windowModelChanged
();
connect
(
m_windowManagement
,
&
PlasmaWindowManagement
::
showingDesktopChanged
,
this
,
[
this
]
(
bool
showing
)
{
if
(
showing
==
m_showingDesktop
)
{
...
...
@@ -82,6 +86,11 @@ void TaskPanel::initWayland()
registry
->
setup
();
}
QAbstractItemModel
*
TaskPanel
::
windowModel
()
const
{
return
m_windowModel
;
}
void
TaskPanel
::
updateActiveWindow
()
{
if
(
!
m_windowManagement
)
{
...
...
containments/taskpanel/taskpanel.h
View file @
d5b65037
...
...
@@ -21,21 +21,24 @@
#ifndef TASKPANEL_H
#define TASKPANEL_H
#include <Plasma/Containment>
class
QAbstractItemModel
;
namespace
KWayland
{
namespace
Client
{
class
PlasmaWindowManagement
;
class
PlasmaWindow
;
class
PlasmaWindowModel
;
}
}
class
TaskPanel
:
public
Plasma
::
Containment
{
Q_OBJECT
Q_PROPERTY
(
QAbstractItemModel
*
windowModel
READ
windowModel
NOTIFY
windowModelChanged
)
Q_PROPERTY
(
bool
showDesktop
READ
isShowingDesktop
WRITE
requestShowingDesktop
NOTIFY
showingDesktopChanged
)
Q_PROPERTY
(
bool
hasCloseableActiveWindow
READ
hasCloseableActiveWindow
NOTIFY
hasCloseableActiveWindowChanged
)
...
...
@@ -43,6 +46,8 @@ public:
TaskPanel
(
QObject
*
parent
,
const
QVariantList
&
args
);
~
TaskPanel
();
QAbstractItemModel
*
windowModel
()
const
;
Q_INVOKABLE
void
closeActiveWindow
();
bool
isShowingDesktop
()
const
{
...
...
@@ -53,6 +58,7 @@ public:
bool
hasCloseableActiveWindow
()
const
;
Q_SIGNALS:
void
windowModelChanged
();
void
showingDesktopChanged
(
bool
);
void
hasCloseableActiveWindowChanged
();
...
...
@@ -61,8 +67,8 @@ private:
void
updateActiveWindow
();
bool
m_showingDesktop
;
KWayland
::
Client
::
PlasmaWindowManagement
*
m_windowManagement
;
KWayland
::
Client
::
PlasmaWindowModel
*
m_windowModel
=
nullptr
;
KWayland
::
Client
::
PlasmaWindow
*
m_activeWindow
=
nullptr
;
};
#endif
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