Port plasmoid to Plasma Next

This commit is contained in:
Aleix Pol 2014-06-18 02:35:48 +02:00
parent a1a560c469
commit 3e74a97304
8 changed files with 50 additions and 40 deletions

View file

@ -17,8 +17,7 @@ qt5_wrap_cpp(kdeconnectdeclarativeplugin_SRC ${kdeconnectdeclarativeplugin_MOC})
add_library(kdeconnectdeclarativeplugin SHARED ${kdeconnectdeclarativeplugin_SRC})
target_link_libraries(kdeconnectdeclarativeplugin
Qt5::Qml
Qt5::Gui
kdeconnectinterfaces
)
install(TARGETS kdeconnectdeclarativeplugin DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/kdeconnect)
install(FILES qmldir DESTINATION ${IMPORTS_INSTALL_DIR}/org/kde/kdeconnect)
install(TARGETS kdeconnectdeclarativeplugin DESTINATION ${QML_INSTALL_DIR}/org/kde/kdeconnect)
install(FILES qmldir DESTINATION ${QML_INSTALL_DIR}/org/kde/kdeconnect)

View file

@ -18,9 +18,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 1.1
import org.kde.plasma.core 0.1 as PlasmaCore
import org.kde.plasma.components 0.1 as PlasmaComponents
import QtQuick 2.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.kdeconnect 1.0
QtObject {

View file

@ -18,12 +18,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 1.1
import org.kde.plasma.core 0.1 as PlasmaCore
import QtQuick 2.1
import org.kde.plasma.core 2.0 as PlasmaCore
Item {
id: view
anchors.fill: parent
//TODO: Use this to detect if we should be iconized or full size
function isConstrained() {
@ -35,18 +34,4 @@ Item {
source: "kdeconnect"
anchors.fill: parent
}
MouseArea {
id: mouseArea
anchors.fill: parent
onClicked: plasmoid.togglePopup()
PlasmaCore.ToolTip {
id: tooltip
target: mouseArea
image: QIcon("kdeconnect")
subText: i18n("KDE Connect device notifications")
}
}
}

View file

@ -18,9 +18,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 1.1
import org.kde.plasma.core 0.1 as PlasmaCore
import org.kde.plasma.components 0.1 as PlasmaComponents
import QtQuick 2.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.kdeconnect 1.0
PlasmaComponents.ListItem

View file

@ -18,21 +18,17 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 1.1
import org.kde.plasma.core 0.1 as PlasmaCore
import org.kde.plasma.components 0.1 as PlasmaComponents
import org.kde.plasma.extras 0.1 as PlasmaExtras
import org.kde.plasma.graphicswidgets 0.1 as PlasmaWidgets
import QtQuick 2.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.kdeconnect 1.0 as KdeConnect
Item {
id: kdeconnect
property int minimumWidth: 290
property int minimumHeight: 340
//TODO: Show the full widget when it is not docked
property Component compactRepresentation: CompactRepresentation { }
implicitWidth: 290
implicitHeight: 340
PlasmaComponents.Label {
visible: devicesView.count==0

View file

@ -18,9 +18,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 1.1
import org.kde.plasma.core 0.1 as PlasmaCore
import org.kde.plasma.components 0.1 as PlasmaComponents
import QtQuick 2.1
import org.kde.plasma.core 2.0 as PlasmaCore
import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.kdeconnect 1.0
QtObject {

View file

@ -0,0 +1,30 @@
/**
* Copyright 2014 Aleix Pol Gonzalez <aleixpol@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) version 3 or any later version
* accepted by the membership of KDE e.V. (or its successor approved
* by the membership of KDE e.V.), which shall act as a proxy
* defined in Section 14 of version 3 of the license.
*
* 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, see <http://www.gnu.org/licenses/>.
*/
import QtQuick 2.1
import org.kde.plasma.plasmoid 2.0
Item
{
Plasmoid.compactRepresentation: CompactRepresentation { }
Plasmoid.fullRepresentation: FullRepresentation {}
Plasmoid.preferredRepresentation: fullRepresentation
}

View file

@ -50,7 +50,7 @@ Type=Service
X-KDE-ServiceTypes=Plasma/Applet,Plasma/PopupApplet
X-Plasma-API=declarativeappletscript
X-Plasma-MainScript=ui/kdeconnect.qml
X-Plasma-MainScript=ui/main.qml
X-Plasma-NotificationArea=true
X-Plasma-ConfigPlugins=kcm_kdeconnect