[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [kdeplasma-addons/frameworks] applets: Notes plasmoid: started to replace notes C++ plasmoid with QM
From: Davide Bettio <bettio () kde ! org>
Date: 2014-04-22 0:43:05
Message-ID: E1WcOnh-000766-9N () scm ! kde ! org
[Download RAW message or body]
Git commit f777d86ddb01ae2cb649963e21f2b33f66407ca0 by Davide Bettio.
Committed on 22/04/2014 at 00:38.
Pushed by bettio into branch 'frameworks'.
Notes plasmoid: started to replace notes C++ plasmoid with QML
M +1 -1 applets/CMakeLists.txt
M +2 -24 applets/notes/CMakeLists.txt
A +13 -0 applets/notes/package/contents/config/main.xml
A +77 -0 applets/notes/package/contents/ui/notes.qml [License: GPL (v2+)]
A +135 -0 applets/notes/package/metadata.desktop
http://commits.kde.org/kdeplasma-addons/f777d86ddb01ae2cb649963e21f2b33f66407ca0
diff --git a/applets/CMakeLists.txt b/applets/CMakeLists.txt
index ad04540..72f4dc8 100644
--- a/applets/CMakeLists.txt
+++ b/applets/CMakeLists.txt
@@ -33,7 +33,7 @@ add_subdirectory(calculator)
# add_subdirectory(luna)
# add_subdirectory(magnifique)
# add_subdirectory(microblog)
-# add_subdirectory(notes)
+add_subdirectory(notes)
# add_subdirectory(nowplaying)
# if(LIBATTICA_FOUND)
# add_subdirectory(knowledgebase)
diff --git a/applets/notes/CMakeLists.txt b/applets/notes/CMakeLists.txt
index c1c6191..79acf70 100644
--- a/applets/notes/CMakeLists.txt
+++ b/applets/notes/CMakeLists.txt
@@ -1,29 +1,7 @@
project(plasma-notes)
-add_definitions (${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
-include_directories(
- ${CMAKE_SOURCE_DIR}
- ${CMAKE_BINARY_DIR}
- ${KDE4_INCLUDES}
- )
-
-set(notes_SRCS notes.cpp textedit.cpp)
-kde4_add_ui_files(notes_SRCS config.ui)
-
-kde4_add_plugin(plasma_applet_notes ${notes_SRCS})
-target_link_libraries(plasma_applet_notes
- ${KDE4_PLASMA_LIBS} ${KDE4_KIO_LIBS}
- )
-install(
- TARGETS plasma_applet_notes
- DESTINATION ${PLUGIN_INSTALL_DIR}
- )
-
-install(
- FILES plasma-notes-default.desktop
- DESTINATION ${SERVICES_INSTALL_DIR}
- )
-
install(
FILES notes.svgz
DESTINATION ${DATA_INSTALL_DIR}/desktoptheme/default/widgets/)
+
+plasma_install_package(package org.kde.plasma.notes)
diff --git a/applets/notes/package/contents/config/main.xml \
b/applets/notes/package/contents/config/main.xml new file mode 100644
index 0000000..aedaf71
--- /dev/null
+++ b/applets/notes/package/contents/config/main.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<kcfg xmlns="http://www.kde.org/standards/kcfg/1.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
+ http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
+ <kcfgfile name=""/>
+
+ <group name="General">
+ <entry name="noteText" type="String">
+ <default></default>
+ </entry>
+ </group>
+</kcfg>
diff --git a/applets/notes/package/contents/ui/notes.qml \
b/applets/notes/package/contents/ui/notes.qml new file mode 100644
index 0000000..62efbba
--- /dev/null
+++ b/applets/notes/package/contents/ui/notes.qml
@@ -0,0 +1,77 @@
+/***************************************************************************
+ * Copyright 2014 by Davide Bettio <davide.bettio@kdemail.net> *
+ * *
+ * 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 . *
+ ***************************************************************************/
+
+import QtQuick 2.2
+
+import org.kde.plasma.core 2.0 as PlasmaCore
+import org.kde.plasma.plasmoid 2.0
+import org.kde.plasma.components 2.0 as PlasmaComponents
+import org.kde.kquickcontrolsaddons 2.0 as QtExtra
+
+Item
+{
+ id: root;
+
+ property string noteText: plasmoid.configuration.noteText;
+
+ Plasmoid.backgroundHints: "NoBackground";
+
+ PlasmaCore.Svg {
+ id: notesSvg;
+ imagePath: "widgets/notes";
+ }
+
+ PlasmaCore.SvgItem {
+ anchors.fill: parent;
+ svg: notesSvg;
+ elementId: "yellow-notes";
+ }
+
+ Timer {
+ id: saveTimer;
+ onTriggered: saveNote();
+ interval: 5000;
+ }
+
+ TextEdit {
+ id: textEdit;
+
+ anchors {
+ fill: parent;
+ leftMargin: parent.width / 15;
+ rightMargin: parent.width / 15;
+ topMargin: parent.height / 15;
+ bottomMargin: parent.height / 15;
+ }
+
+ clip: true;
+ text: noteText;
+ textFormat: TextEdit.RichText;
+
+ onTextChanged: saveTimer.start();
+ }
+
+ function saveNote()
+ {
+ if (plasmoid.configuration.noteText != textEdit.text){
+ plasmoid.configuration.noteText = textEdit.text;
+ }
+ }
+}
+
diff --git a/applets/notes/package/metadata.desktop \
b/applets/notes/package/metadata.desktop new file mode 100644
index 0000000..be61399
--- /dev/null
+++ b/applets/notes/package/metadata.desktop
@@ -0,0 +1,135 @@
+[Desktop Entry]
+Name=Notes
+Name[ar]=ملاحظات
+Name[ast]=Notes
+Name[be]=Заметкі
+Name[bs]=Bilješke
+Name[ca]=Notes
+Name[ca@valencia]=Notes
+Name[cs]=Poznámky
+Name[csb]=Nadczidczi
+Name[da]=Noter
+Name[de]=Notizen
+Name[el]=Σημειώσεις
+Name[en_GB]=Notes
+Name[eo]=Notoj
+Name[es]=Notas
+Name[et]=Märkmed
+Name[eu]=Oharrak
+Name[fi]=Muistilappu
+Name[fr]=Notes
+Name[ga]=Nótaí
+Name[gl]=Notas
+Name[he]=פתקיות
+Name[hr]=Bilješke
+Name[hu]=Feljegyzések
+Name[is]=Minnismiðar
+Name[it]=Note
+Name[ja]=メモ
+Name[kk]=Жазбалар
+Name[km]=ចំណាំ
+Name[ko]=메모
+Name[ku]=Nîşe
+Name[lt]=Užrašai
+Name[lv]=Piezīmes
+Name[mr]=नोंदी
+Name[ms]=Nota
+Name[nb]=Notater
+Name[nds]=Notizen
+Name[nl]=Notities
+Name[nn]=Notat
+Name[oc]=Nòtas
+Name[pa]=ਨੋਟਿਸ
+Name[pl]=Notatki
+Name[pt]=Notas
+Name[pt_BR]=Notas
+Name[ro]=Note
+Name[ru]=Заметки
+Name[sk]=Poznámky
+Name[sl]=Opombe
+Name[sq]=Shënime
+Name[sr]=белешке
+Name[sr@ijekavian]=биљешке
+Name[sr@ijekavianlatin]=bilješke
+Name[sr@latin]=beleške
+Name[sv]=Anteckningar
+Name[th]=บันทึกช่วยจำ
+Name[tr]=Notlar
+Name[ug]=ئىزاھ
+Name[uk]=Нотатки
+Name[wa]=Notes
+Name[x-test]=xxNotesxx
+Name[zh_CN]=便笺
+Name[zh_TW]=便條
+Comment=Desktop sticky notes
+Comment[ar]=ملاحظات لاصقة على سطح المكتب
+Comment[ast]=Notas pegaes nel escritoriu
+Comment[bs]=Ljepljive bilješke za površ
+Comment[ca]=Notes adhesives d'escriptori
+Comment[ca@valencia]=Notes adhesives d'escriptori
+Comment[cs]=Lepící poznámkové papírky na plochu
+Comment[da]=Notessedler på skrivebordet.
+Comment[de]=Klebezettel für die Arbeitsfläche
+Comment[el]=Κολλημένες σημειώσεις επιφάνειας \
εργασίας +Comment[en_GB]=Desktop sticky notes
+Comment[es]=Notas adhesivas de escritorio
+Comment[et]=Töölaua märkmepaberid
+Comment[eu]=Mahaigaineko ohar itsaskorrak
+Comment[fi]=Työpöydän muistilaput
+Comment[fr]=Un note collée sur le bureau
+Comment[ga]=Nótaí greamaitheacha
+Comment[gl]=Notas no escritorio
+Comment[he]=פתקיות על שולחן העבודה
+Comment[hu]=Ragadós asztali feljegyzések
+Comment[is]=Minnismiðar á skjáborði
+Comment[it]=Note adesive del desktop
+Comment[ja]=デスクトップの付箋紙メモ
+Comment[kk]=Үстелге жапсырмалы жазбалар
+Comment[km]=ចំណាំបិទលើផ្ទៃតុ
+Comment[ko]=데스크톱 메모
+Comment[ku]=Nîşeyên mezeloqî yên Sermasê
+Comment[lt]=Darbastalio lipnūs lapeliai
+Comment[lv]=Darbvirsmas piezīmju lapiņas
+Comment[mr]=डेस्कटॉप चिकट नोंदी
+Comment[nb]=Notatlapper for skrivebordet
+Comment[nds]=Opback-Notizen för den Schriefdisch
+Comment[nl]=Sticky's op het bureaublad
+Comment[nn]=Notatlappar på skrivebordet
+Comment[pa]=ਡੈਸਕਟਾਪ ਸਟਿੱਕੀ ਨੋਟਿਸ
+Comment[pl]=Przyklejone notatki na Pulpicie
+Comment[pt]=Notas autocolantes do ecrã
+Comment[pt_BR]=Notas adesivas na área de trabalho
+Comment[ro]=Notițe de birou lipicioase
+Comment[ru]=Стикеры для заметок на рабочий стол
+Comment[sk]=Lepiace poznámky na plochu
+Comment[sl]=Lepljive notice za namizje
+Comment[sr]=Лепљиве белешке за површ
+Comment[sr@ijekavian]=Љепљиве биљешке за површ
+Comment[sr@ijekavianlatin]=Ljepljive bilješke za površ
+Comment[sr@latin]=Lepljive beleške za površ
+Comment[sv]=Klisterlappar med meddelanden för skrivbordet
+Comment[th]=ปักหมุดบันทึกช่วยจำไว้บนพื้นที่ทำงาน
+Comment[tr]=Masaüstüne yapışan notlar
+Comment[uk]=Стільничні липкі нотатки
+Comment[wa]=Aclapantès notes sol scribanne
+Comment[x-test]=xxDesktop sticky notesxx
+Comment[zh_CN]=桌面 n 次贴
+Comment[zh_TW]=桌面便利貼
+Icon=knotes
+Type=Service
+
+X-Plasma-API=declarativeappletscript
+X-Plasma-MainScript=ui/notes.qml
+X-Plasma-DropMimeTypes=text/plain,text/richtext
+X-KDE-ServiceTypes=Plasma/Applet
+X-KDE-PluginInfo-Author=Davide Bettio, Lukas Kropatschek
+X-KDE-PluginInfo-Email=bettio@kde.org, lukas.krop@gmail.com
+X-KDE-PluginInfo-Name=org.kde.plasma.notes
+X-KDE-PluginInfo-Version=2.0
+X-KDE-PluginInfo-Website=http://plasma.kde.org/
+X-KDE-PluginInfo-Category=Utilities
+X-KDE-PluginInfo-Depends=
+X-KDE-PluginInfo-License=GPL
+X-KDE-PluginInfo-EnabledByDefault=true
+X-Plasma-Requires-FileDialog=Unused
+X-Plasma-Requires-LaunchApp=Unused
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic