Commit af3b4cba authored by Marco Martin's avatar Marco Martin
Browse files

use the new kpackage-based runtime for the QML app

remove old dead code, the okular active app is now completely
qml and KPackage based
parent 2708e9ce
find_package(ActiveApp "0.1")
set_package_properties("ActiveApp" PROPERTIES
DESCRIPTION "Support for developing applications for Plasma Active"
URL "https://projects.kde.org/projects/extragear/base/plasma-mobile"
TYPE OPTIONAL)
if (ACTIVEAPP_FOUND)
add_subdirectory( app )
endif (ACTIVEAPP_FOUND)
add_subdirectory( app )
add_subdirectory( components )
include_directories( ${QT_INCLUDES} )
add_subdirectory(src)
#add_subdirectory(src)
# QML-only thing
install(DIRECTORY package/ DESTINATION ${KDE_INSTALL_DATADIR}/plasma/packages/org.kde.active.documentviewer)
#install(DIRECTORY package/ DESTINATION ${KDE_INSTALL_DATADIR}/plasma/packages/org.kde.active.documentviewer)
install(DIRECTORY package/ DESTINATION ${KDE_INSTALL_DATADIR}/kpackage/genericqml/org.kde.active.documentviewer)
install(FILES package/metadata.desktop DESTINATION ${XDG_APPS_INSTALL_DIR} RENAME org.kde.active.documentviewer.desktop)
install(FILES active-documentviewer.desktop DESTINATION ${KDE_INSTALL_APPDIR})
#install(FILES active-documentviewer.desktop DESTINATION ${KDE_INSTALL_APPDIR})
[Desktop Entry]
Name=Reader
Name[ar]=التصيير
Name[bg]=Четец
Name[bs]=Čitač
Name[ca]=Lector
Name[ca@valencia]=Lector
Name[cs]=Čtečka
Name[da]=Læser
Name[de]=Lesegerät
Name[el]=Πρόγραμμα ανάγνωσης
Name[en_GB]=Reader
Name[es]=Lector
Name[et]=Lugeja
Name[fi]=Lukija
Name[fr]=Lecteur
Name[ga]=Léitheoir
Name[gl]=Lector
Name[hu]=Olvasó
Name[ia]=Lector
Name[is]=Lesari
Name[it]=Lettore
Name[kk]=Оқу құралы
Name[ko]=리더
Name[lt]=Skaitytuvas
Name[mr]=वाचक
Name[nb]=Leser
Name[nds]=Leser
Name[nl]=Lezer
Name[pa]=ਰੀਡਰ
Name[pl]=Czytnik
Name[pt]=Leitor
Name[pt_BR]=Leitor
Name[ro]=Cititor
Name[ru]=Просмотрщик
Name[sk]=Čítačka
Name[sl]=Bralnik
Name[sr]=Читач
Name[sr@ijekavian]=Читач
Name[sr@ijekavianlatin]=Čitač
Name[sr@latin]=Čitač
Name[sv]=Läsprogram
Name[tr]=Okuyucu
Name[ug]=ئوقۇغۇ
Name[uk]=Переглядач
Name[x-test]=xxReaderxx
Name[zh_CN]=阅读器
Name[zh_TW]=閱讀器
GenericName=Document viewer
GenericName[ar]=عارض المستندات
GenericName[bg]=Преглед на документи
GenericName[bs]=Prikazivač dokumenata
GenericName[ca]=Visualitzador de documents
GenericName[ca@valencia]=Visualitzador de documents
GenericName[cs]=Prohlížeč dokumentů
GenericName[da]=Dokumentfremviser
GenericName[de]=Dokumentenbetrachter
GenericName[el]=Προβολέας εγγράφων
GenericName[en_GB]=Document Viewer
GenericName[es]=Visor de documentos
GenericName[et]=Dokumendinäitaja
GenericName[fi]=Asiakirjakatselin
GenericName[fr]=Afficheur de document
GenericName[ga]=Amharcán cáipéisí
GenericName[gl]=Visor de documentos
GenericName[hu]=Dokumentummegjelenítő
GenericName[ia]=Visor de documento
GenericName[is]=Skjalaskoðari
GenericName[it]=Visore di documenti
GenericName[ja]=文書ビューア
GenericName[kk]=Құжатты қарау құралы
GenericName[ko]=문서 뷰어
GenericName[lt]=Dokumentų žiūryklė
GenericName[mr]=दस्तऐवज प्रदर्शक
GenericName[nb]=Dokumentviser
GenericName[nds]=Dokmentkieker
GenericName[nl]=Documentenviewer
GenericName[pa]=ਡੌਕੂਮੈਂਟ ਦਰਸ਼ਕ
GenericName[pl]=Przeglądarka dokumentów
GenericName[pt]=Visualizador de documentos
GenericName[pt_BR]=Visualizador de documentos
GenericName[ro]=Vizualizor de documente
GenericName[ru]=Просмотр документов
GenericName[sk]=Prehliadač dokumentov
GenericName[sl]=Pregledovalnik dokumentov
GenericName[sr]=Приказивач докумената
GenericName[sr@ijekavian]=Приказивач докумената
GenericName[sr@ijekavianlatin]=Prikazivač dokumenata
GenericName[sr@latin]=Prikazivač dokumenata
GenericName[sv]=Dokumentvisare
GenericName[tr]=Belge görüntüleyici
GenericName[uk]=Переглядач документів
GenericName[x-test]=xxDocument viewerxx
GenericName[zh_CN]=文档查看器
GenericName[zh_TW]=文件檢視器
Comment=Viewer for various types of documents
Comment[ar]=عارض للعديد من أنواع المستندات
Comment[bg]=Преглед на различни видове документи
Comment[bs]=Pregledač raznih vrsta dokumenata
Comment[ca]=Visualitzador de diversos tipus de documents
Comment[ca@valencia]=Visualitzador de diversos tipus de documents
Comment[cs]=Prohlížeč různých typů dokumentů
Comment[da]=Fremviser af diverse dokumenttyper
Comment[de]=Betrachter für verschiedene Arten von Dokumenten
Comment[el]=Πρόγραμμα προβολής για διάφορους τύπους εγγράφων
Comment[en_GB]=Viewer for various types of documents
Comment[es]=Visor de diversos tipos de documentos
Comment[et]=Eri tüüpi dokumentide näitaja
Comment[fi]=Monenlaisten asiakirjojen katseluohjelma
Comment[fr]=Afficheur pour différents types de documents
Comment[ga]=Amharcán le haghaidh cáipéisí éagsúla
Comment[gl]=Visor de varios tipos de documentos.
Comment[hu]=Megjelenítő különféle típusú dokumentumokhoz
Comment[ia]=Visor pro varie typos de documento
Comment[is]=Skoðari fyrir ýmsar gerðir skjala
Comment[it]=Visore per vari tipi di documenti
Comment[kk]=Түрлі құжаттар қарау құралы
Comment[ko]=여러 형식의 문서 뷰어
Comment[lt]=Žiūryklė įvairiems dokumentų tipams
Comment[mr]=विविध प्रकारच्या दस्तऐवजांचा प्रदर्शक
Comment[nb]=Framviser for forskjellige dokumenttyper
Comment[nds]=Kieker för en Reeg Dokmenttypen
Comment[nl]=Viewer voor verschillende typen documenten
Comment[pa]=ਕਈ ਕਿਸਮ ਦੇ ਡੌਕੂਮੈਂਟ ਵੇਖਾਉਣ ਲਈ ਦਰਸ਼ਕ
Comment[pl]=Przeglądarka dla różnych typów dokumentów
Comment[pt]=Visualizador de vários tipos de documentos
Comment[pt_BR]=Visualizador para vários tipos de documentos
Comment[ro]=Vizualizor pentru diferite tipuri de documente
Comment[ru]=Программа для просмотра различных типов документов
Comment[sk]=Prehliadač pre rôzne typy dokumentov
Comment[sl]=Pregledovalnik raznih vrst dokumentov
Comment[sr]=Приказивач различитих врста докумената
Comment[sr@ijekavian]=Приказивач различитих врста докумената
Comment[sr@ijekavianlatin]=Prikazivač različitih vrsta dokumenata
Comment[sr@latin]=Prikazivač različitih vrsta dokumenata
Comment[sv]=Visningsprogram för diverse typer av dokument
Comment[tr]=Çeşitli belge türü için görüntüleyici
Comment[ug]=ھەر خىل تىپتىكى پۈتۈكلەرنى كۆرىدىغان پروگرامما
Comment[uk]=Програма для перегляду документів різних типів
Comment[x-test]=xxViewer for various types of documentsxx
Comment[zh_CN]=可以查看多种文档的工具
Comment[zh_TW]=多種型態文件的檢視器
Exec=active-documentviewer %u
Terminal=false
Icon=okular
Type=Application
Categories=Qt;KDE;Graphics;Office;Viewer;
InitialPreference=6
NoDisplay=true
MimeType=application/vnd.kde.okular-archive;
......@@ -19,14 +19,14 @@
import QtQuick 2.1
import org.kde.okular 2.0 as Okular
import QtQuick.Controls 1.3
import org.kde.plasma.extras 2.0 as PlasmaExtras
import org.kde.plasma.components 2.0 as PlasmaComponents
Image {
ApplicationWindow {
id: fileBrowserRoot
objectName: "fileBrowserRoot"
source: "image://appbackgrounds/contextarea"
fillMode: Image.Tile
visible: true
width: 360
height: 360
......@@ -40,7 +40,7 @@ Image {
Okular.DocumentItem {
id: documentItem
onWindowTitleForDocumentChanged: {
application.caption = windowTitleForDocument
fileBrowserRoot.title = windowTitleForDocument
}
}
......@@ -55,8 +55,8 @@ Image {
interval: 100
running: true
onTriggered: {
if (application.startupArguments.length > 0) {
documentItem.path = application.startupArguments[0]
if (commandlineArguments.length > 0) {
documentItem.path = commandlineArguments[0]
}
mainStack.push(Qt.createComponent("Browser.qml"))
......
......@@ -47,7 +47,8 @@ Name[x-test]=xxDocument viewerxx
Name[zh_CN]=文档查看器
Name[zh_TW]=文件檢視器
Encoding=UTF-8
Type=Service
Type=Application
Exec=kpackagelauncherqml -a org.kde.active.documentviewer %u
Icon=okular
X-KDE-ParentApp=
X-KDE-PluginInfo-Author=Marco Martin
......
set(active-documentviewer_SRCS
main.cpp
)
add_executable(active-documentviewer ${active-documentviewer_SRCS})
find_package(ActiveApp REQUIRED)
include_directories( ${QT_INCLUDES} ${ACTIVEAPP_INCLUDE_DIR})
target_link_libraries(active-documentviewer
Qt5::Declarative
Qt5::OpenGL
${KDE4_PLASMA_LIBS}
${ACTIVEAPP_LIBRARIES}
)
install(TARGETS active-documentviewer ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} )
/***************************************************************************
* *
* Copyright 2011 Sebastian Kügler <sebas@kde.org> *
* Copyright 2012 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 . *
***************************************************************************/
// KDE
#include <KApplication>
#include <KAboutData>
#include <KCmdLineArgs>
#include <KDebug>
#include <KConfigGroup>
#include "kdeclarativemainwindow.h"
#include "kdeclarativeview.h"
static const char description[] = I18N_NOOP("Document viewer for Plasma Active using Okular");
static const char version[] = "0.1";
int main(int argc, char **argv)
{
KAboutData about("active-documentviewer", 0, ki18n("Reader"), version, ki18n(description),
KAboutData::License_GPL, ki18n("Copyright 2012 Marco Martin"), KLocalizedString(), 0, "mart@kde.org");
about.addAuthor( ki18n("Marco Martin"), KLocalizedString(), "mart@kde.org" );
about.setProgramIconName("okular");
KCmdLineArgs::init(argc, argv, &about);
KCmdLineOptions options;
options.add("+[url]", ki18n( "URL of the file to open" ));
KCmdLineArgs::addCmdLineOptions(options);
KApplication app;
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
//KF5 port: remove this line and define TRANSLATION_DOMAIN in CMakeLists.txt instead
//KLocale::global()->insertCatalog("org.kde.okular");
//kDebug() << "ARGS:" << args << args->count();
KDeclarativeMainWindow *mainWindow = new KDeclarativeMainWindow();
mainWindow->declarativeView()->setPackageName("org.kde.active.documentviewer");
mainWindow->show();
args->clear();
return app.exec();
}
......@@ -141,8 +141,8 @@ Comment[x-test]=xxViewer for various types of documentsxx
Comment[zh_CN]=可以查看多种文档的工具
Comment[zh_TW]=多種型態文件的檢視器
TryExec=active-documentviewer
Exec=active-documentviewer %u
TryExec=kpackagelauncherqml -a org.kde.active.documentviewer
Exec=kpackagelauncherqml -a org.kde.active.documentviewer %u
Terminal=false
Icon=okular
Type=Application
......
......@@ -142,8 +142,8 @@ Comment[x-test]=xxViewer for various types of documentsxx
Comment[zh_CN]=可以查看多种文档的工具
Comment[zh_TW]=多種型態文件的檢視器
TryExec=active-documentviewer
Exec=active-documentviewer %u
TryExec=kpackagelauncherqml -a org.kde.active.documentviewer
Exec=kpackagelauncherqml -a org.kde.active.documentviewer %u
Terminal=false
Icon=okular
Type=Application
......
......@@ -142,8 +142,8 @@ Comment[x-test]=xxViewer for various types of documentsxx
Comment[zh_CN]=可以查看多种文档的工具
Comment[zh_TW]=多種型態文件的檢視器
TryExec=active-documentviewer
Exec=active-documentviewer %u
TryExec=kpackagelauncherqml -a org.kde.active.documentviewer
Exec=kpackagelauncherqml -a org.kde.active.documentviewer %u
Terminal=false
Icon=okular
Type=Application
......
......@@ -142,8 +142,8 @@ Comment[x-test]=xxViewer for various types of documentsxx
Comment[zh_CN]=可以查看多种文档的工具
Comment[zh_TW]=多種型態文件的檢視器
TryExec=active-documentviewer
Exec=active-documentviewer %u
TryExec=kpackagelauncherqml -a org.kde.active.documentviewer
Exec=kpackagelauncherqml -a org.kde.active.documentviewer %u
Terminal=false
Icon=okular
Type=Application
......
......@@ -142,8 +142,8 @@ Comment[x-test]=xxViewer for various types of documentsxx
Comment[zh_CN]=可以查看多种文档的工具
Comment[zh_TW]=多種型態文件的檢視器
TryExec=active-documentviewer
Exec=active-documentviewer %u
TryExec=kpackagelauncherqml -a org.kde.active.documentviewer
Exec=kpackagelauncherqml -a org.kde.active.documentviewer %u
Terminal=false
Icon=okular
Type=Application
......
......@@ -142,8 +142,8 @@ Comment[x-test]=xxViewer for various types of documentsxx
Comment[zh_CN]=可以查看多种文档的工具
Comment[zh_TW]=多種型態文件的檢視器
TryExec=active-documentviewer
Exec=active-documentviewer %u
TryExec=kpackagelauncherqml -a org.kde.active.documentviewer
Exec=kpackagelauncherqml -a org.kde.active.documentviewer %u
Terminal=false
Icon=okular
Type=Application
......
......@@ -142,8 +142,8 @@ Comment[x-test]=xxViewer for various types of documentsxx
Comment[zh_CN]=可以查看多种文档的工具
Comment[zh_TW]=多種型態文件的檢視器
TryExec=active-documentviewer
Exec=active-documentviewer %u
TryExec=kpackagelauncherqml -a org.kde.active.documentviewer
Exec=kpackagelauncherqml -a org.kde.active.documentviewer %u
Terminal=false
Icon=okular
Type=Application
......
......@@ -142,8 +142,8 @@ Comment[x-test]=xxViewer for various types of documentsxx
Comment[zh_CN]=可以查看多种文档的工具
Comment[zh_TW]=多種型態文件的檢視器
TryExec=active-documentviewer
Exec=active-documentviewer %u
TryExec=kpackagelauncherqml -a org.kde.active.documentviewer
Exec=kpackagelauncherqml -a org.kde.active.documentviewer %u
Terminal=false
Icon=okular
Type=Application
......
......@@ -142,8 +142,8 @@ Comment[x-test]=xxViewer for various types of documentsxx
Comment[zh_CN]=可以查看多种文档的工具
Comment[zh_TW]=多種型態文件的檢視器
TryExec=active-documentviewer
Exec=active-documentviewer %u
TryExec=kpackagelauncherqml -a org.kde.active.documentviewer
Exec=kpackagelauncherqml -a org.kde.active.documentviewer %u
Terminal=false
Icon=okular
Type=Application
......
......@@ -142,8 +142,8 @@ Comment[x-test]=xxViewer for various types of documentsxx
Comment[zh_CN]=可以查看多种文档的工具
Comment[zh_TW]=多種型態文件的檢視器
TryExec=active-documentviewer
Exec=active-documentviewer %u
TryExec=kpackagelauncherqml -a org.kde.active.documentviewer
Exec=kpackagelauncherqml -a org.kde.active.documentviewer %u
Terminal=false
Icon=okular
Type=Application
......
......@@ -142,8 +142,8 @@ Comment[x-test]=xxViewer for various types of documentsxx
Comment[zh_CN]=可以查看多种文档的工具
Comment[zh_TW]=多種型態文件的檢視器
TryExec=active-documentviewer
Exec=active-documentviewer %u
TryExec=kpackagelauncherqml -a org.kde.active.documentviewer
Exec=kpackagelauncherqml -a org.kde.active.documentviewer %u
Terminal=false
Icon=okular
Type=Application
......
......@@ -142,8 +142,8 @@ Comment[x-test]=xxViewer for various types of documentsxx
Comment[zh_CN]=可以查看多种文档的工具
Comment[zh_TW]=多種型態文件的檢視器
TryExec=active-documentviewer
Exec=active-documentviewer %u
TryExec=kpackagelauncherqml -a org.kde.active.documentviewer
Exec=kpackagelauncherqml -a org.kde.active.documentviewer %u
Terminal=false
Icon=okular
Type=Application
......
......@@ -142,8 +142,8 @@ Comment[x-test]=xxViewer for various types of documentsxx
Comment[zh_CN]=可以查看多种文档的工具
Comment[zh_TW]=多種型態文件的檢視器
TryExec=active-documentviewer
Exec=active-documentviewer %u
TryExec=kpackagelauncherqml -a org.kde.active.documentviewer
Exec=kpackagelauncherqml -a org.kde.active.documentviewer %u
Terminal=false
Icon=okular
Type=Application
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment