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
08601943
Commit
08601943
authored
Jun 11, 2015
by
Marco Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
new bottom panel containment with close button
parent
504d1a8a
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
197 additions
and
0 deletions
+197
-0
containments/CMakeLists.txt
containments/CMakeLists.txt
+1
-0
containments/taskpanel/CMakeLists.txt
containments/taskpanel/CMakeLists.txt
+22
-0
containments/taskpanel/Messages.sh
containments/taskpanel/Messages.sh
+4
-0
containments/taskpanel/package/code/close.js
containments/taskpanel/package/code/close.js
+2
-0
containments/taskpanel/package/contents/ui/main.qml
containments/taskpanel/package/contents/ui/main.qml
+38
-0
containments/taskpanel/package/metadata.desktop
containments/taskpanel/package/metadata.desktop
+18
-0
containments/taskpanel/taskpanel.cpp
containments/taskpanel/taskpanel.cpp
+66
-0
containments/taskpanel/taskpanel.h
containments/taskpanel/taskpanel.h
+41
-0
shell/contents/layout.js
shell/contents/layout.js
+5
-0
No files found.
containments/CMakeLists.txt
View file @
08601943
...
...
@@ -2,3 +2,4 @@
plasma_install_package
(
panel org.kde.phone.panel
)
add_subdirectory
(
homescreen
)
add_subdirectory
(
taskpanel
)
containments/taskpanel/CMakeLists.txt
0 → 100644
View file @
08601943
set
(
taskpanel_SRCS
taskpanel.cpp
)
add_library
(
plasma_containment_phone_taskpanel MODULE
${
taskpanel_SRCS
}
)
kcoreaddons_desktop_to_json
(
plasma_containment_phone_taskpanel package/metadata.desktop
)
target_link_libraries
(
plasma_containment_phone_taskpanel
Qt5::Gui
Qt5::DBus
KF5::Plasma
Qt5::Qml
KF5::I18n
KF5::Service
)
install
(
TARGETS plasma_containment_phone_taskpanel DESTINATION
${
KDE_INSTALL_PLUGINDIR
}
/plasma/applets
)
plasma_install_package
(
package org.kde.phone.taskpanel
)
containments/taskpanel/Messages.sh
0 → 100755
View file @
08601943
#! /usr/bin/env bash
$EXTRACTRC
`
find
.
-name
\*
.rc
-o
-name
\*
.ui
-o
-name
\*
.kcfg
`
>>
rc.cpp
$XGETTEXT
`
find
.
-name
\*
.js
-o
-name
\*
.qml
-o
-name
\*
.cpp
`
-o
$podir
/plasma_applet_org.kde.phone.taskpanel.pot
rm
-f
rc.cpp
containments/taskpanel/package/code/close.js
0 → 100644
View file @
08601943
workspace
.
activeClient
.
closeWindow
();
containments/taskpanel/package/contents/ui/main.qml
0 → 100644
View file @
08601943
/*
* Copyright 2015 Marco Martin <mart@kde.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA.
*/
import
QtQuick
2.4
import
QtQuick
.
Layouts
1.1
import
org
.
kde
.
plasma
.
plasmoid
2.0
import
org
.
kde
.
plasma
.
core
2.0
as
PlasmaCore
import
org
.
kde
.
plasma
.
components
2.0
as
PlasmaComponents
import
org
.
kde
.
kquickcontrolsaddons
2.0
Item
{
width
:
600
height
:
40
property
Item
toolBox
PlasmaComponents.ToolButton
{
anchors.right
:
parent
.
right
iconSource
:
"
window-close
"
onClicked
:
plasmoid
.
nativeInterface
.
executeScript
(
"
close
"
);
}
}
\ No newline at end of file
containments/taskpanel/package/metadata.desktop
0 → 100644
View file @
08601943
[Desktop Entry]
Encoding=UTF-8
Keywords=
Name=Phone Task panel
Type=Service
X-KDE-ServiceTypes=Plasma/Applet,Plasma/Containment
X-Plasma-API=declarativeappletscript
X-KDE-Library=plasma_containment_phone_taskpanel
X-KDE-PluginInfo-Author=Marco Martin
X-KDE-PluginInfo-Category=
X-KDE-PluginInfo-Email=mart@kde.org
X-KDE-PluginInfo-License=GPLv2+
X-KDE-PluginInfo-Name=org.kde.phone.taskpanel
X-KDE-PluginInfo-Version=
X-KDE-PluginInfo-Website=
X-Plasma-MainScript=ui/main.qml
X-Plasma-ContainmentType=Panel
containments/taskpanel/taskpanel.cpp
0 → 100644
View file @
08601943
/***************************************************************************
* Copyright (C) 2015 Marco Martin <mart@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, 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 General Public License for more details. *
* *
* You should have received a copy of the GNU 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 . *
***************************************************************************/
#include "taskpanel.h"
#include <QtQml>
#include <QDebug>
#include <QDBusMessage>
#include <QDBusConnection>
#include <Plasma/Package>
static
const
QString
s_kwinService
=
QStringLiteral
(
"org.kde.KWin"
);
TaskPanel
::
TaskPanel
(
QObject
*
parent
,
const
QVariantList
&
args
)
:
Plasma
::
Containment
(
parent
,
args
)
{
setHasConfigurationInterface
(
true
);
}
TaskPanel
::~
TaskPanel
()
{
}
void
TaskPanel
::
executeScript
(
const
QString
&
script
)
{
//Plasma::Package p =
package
().
filePath
(
"scripts"
,
script
+
".js"
);
QDBusMessage
message
=
QDBusMessage
::
createMethodCall
(
s_kwinService
,
"/Scripting"
,
QString
(),
"loadScript"
);
QList
<
QVariant
>
arguments
;
arguments
<<
QVariant
(
"/opt/kde5qt5/share/plasma/plasmoids/org.kde.phone.taskpanel/code/close.js"
);
message
.
setArguments
(
arguments
);
QDBusMessage
reply
=
QDBusConnection
::
sessionBus
().
call
(
message
);
if
(
reply
.
type
()
==
QDBusMessage
::
ErrorMessage
)
{
qWarning
()
<<
reply
.
errorMessage
();
}
else
{
const
int
id
=
reply
.
arguments
().
first
().
toInt
();
QDBusConnection
::
sessionBus
().
connect
(
s_kwinService
,
"/"
+
QString
::
number
(
id
),
QString
(),
"print"
,
this
,
SLOT
(
print
(
QString
)));
QDBusConnection
::
sessionBus
().
connect
(
s_kwinService
,
"/"
+
QString
::
number
(
id
),
QString
(),
"printError"
,
this
,
SLOT
(
print
(
QString
)));
message
=
QDBusMessage
::
createMethodCall
(
s_kwinService
,
"/"
+
QString
::
number
(
id
),
QString
(),
"run"
);
reply
=
QDBusConnection
::
sessionBus
().
call
(
message
);
if
(
reply
.
type
()
==
QDBusMessage
::
ErrorMessage
)
{
qWarning
()
<<
reply
.
errorMessage
();
}
}
}
K_EXPORT_PLASMA_APPLET_WITH_JSON
(
taskpanel
,
TaskPanel
,
"metadata.json"
)
#include "taskpanel.moc"
containments/taskpanel/taskpanel.h
0 → 100644
View file @
08601943
/***************************************************************************
* Copyright (C) 2015 Marco Martin <mart@kde.org> *
*
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, 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 General Public License for more details. *
* *
* You should have received a copy of the GNU 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 . *
***************************************************************************/
#ifndef TASKPANEL_H
#define TASKPANEL_H
#include <Plasma/Containment>
class
TaskPanel
:
public
Plasma
::
Containment
{
Q_OBJECT
public:
TaskPanel
(
QObject
*
parent
,
const
QVariantList
&
args
);
~
TaskPanel
();
Q_INVOKABLE
void
executeScript
(
const
QString
&
script
);
private:
};
#endif
shell/contents/layout.js
View file @
08601943
...
...
@@ -20,3 +20,8 @@ var panel = new Panel("org.kde.phone.panel");
panel
.
addWidget
(
"
org.kde.plasma.networkmanagement
"
);
panel
.
addWidget
(
"
org.kde.plasma.battery
"
);
panel
.
height
=
60
;
var
bottomPanel
=
new
Panel
(
"
org.kde.phone.taskpanel
"
);
bottomPanel
.
location
=
"
bottom
"
;
bottomPanel
.
height
=
80
;
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