mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-27 19:50:27 +00:00
add translation catalogs
This commit is contained in:
parent
5bcf1e8f35
commit
4fe74b2294
5
active/app/Messages.sh
Normal file
5
active/app/Messages.sh
Normal file
|
@ -0,0 +1,5 @@
|
|||
#! /usr/bin/env bash
|
||||
$EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp
|
||||
$XGETTEXT `find . -name \*.qml` -L Java -o $podir/org.kde.active.documentviewer.pot
|
||||
$XGETTEXT `find src/ -name "*.cpp" -o -name "*.h"` -o $podir/org.kde.active.documentviewer.pot
|
||||
rm -f rc.cpp
|
|
@ -2,7 +2,7 @@
|
|||
Name=Document viewer
|
||||
Encoding=UTF-8
|
||||
Type=Service
|
||||
Icon=system-file-manager
|
||||
Icon=okular
|
||||
X-KDE-ParentApp=
|
||||
X-KDE-PluginInfo-Author=Marco Martin
|
||||
X-KDE-PluginInfo-Email=mart@kde.org
|
||||
|
|
|
@ -54,6 +54,7 @@ KDE_EXPORT int kdemain(int argc, char **argv)
|
|||
|
||||
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
|
||||
|
||||
KGlobal::locale()->insertCatalog("org.kde.okular");
|
||||
//kDebug() << "ARGS:" << args << args->count();
|
||||
|
||||
KDeclarativeMainWindow *mainWindow = new KDeclarativeMainWindow();
|
||||
|
|
3
active/components/Messages.sh
Normal file
3
active/components/Messages.sh
Normal file
|
@ -0,0 +1,3 @@
|
|||
#! /usr/bin/env bash
|
||||
$XGETTEXT `find src/ -name "*.cpp" -o -name "*.h"` -o $podir/org.kde.okular.pot
|
||||
rm -f rc.cpp
|
|
@ -26,10 +26,13 @@
|
|||
#include <QtDeclarative/qdeclarative.h>
|
||||
#include <QtDeclarative/QDeclarativeEngine>
|
||||
|
||||
#include <KGlobalSettings>
|
||||
#include <KLocale>
|
||||
|
||||
void OkularPlugin::registerTypes(const char *uri)
|
||||
{
|
||||
Q_ASSERT(uri == QLatin1String("org.kde.okular"));
|
||||
KGlobal::locale()->insertCatalog("org.kde.okular");
|
||||
qmlRegisterType<DocumentItem>(uri, 0, 1, "DocumentItem");
|
||||
qmlRegisterType<PageItem>(uri, 0, 1, "PageItem");
|
||||
qmlRegisterType<ThumbnailItem>(uri, 0, 1, "ThumbnailItem");
|
||||
|
|
|
@ -1,75 +0,0 @@
|
|||
/*
|
||||
* 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 Library General Public License as
|
||||
* published by the Free Software Foundation; either version 2, 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 Library General Public License for more details
|
||||
*
|
||||
* You should have received a copy of the GNU Library 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 1.1
|
||||
import org.kde.okular 0.1
|
||||
|
||||
Item {
|
||||
width: 400
|
||||
height: 200
|
||||
DocumentItem {
|
||||
id: documentItem
|
||||
//put the full path of a pdf file here to test
|
||||
path: "/path/to/pdf file"
|
||||
}
|
||||
Flickable {
|
||||
anchors {
|
||||
left: thumbnailsView.right
|
||||
top: parent.top
|
||||
bottom: parent.bottom
|
||||
right: parent.right
|
||||
}
|
||||
contentWidth: page.width
|
||||
contentHeight: page.height
|
||||
PageItem {
|
||||
id: page
|
||||
document: documentItem
|
||||
width: implicitWidth
|
||||
height: implicitHeight
|
||||
}
|
||||
}
|
||||
ListView {
|
||||
id: thumbnailsView
|
||||
width: 100
|
||||
height: parent.height
|
||||
model: documentItem.pageCount
|
||||
delegate: Rectangle {
|
||||
color: "red"
|
||||
width: parent.width
|
||||
height: width
|
||||
ThumbnailItem {
|
||||
id: thumbnail
|
||||
document: documentItem
|
||||
pageNumber: modelData
|
||||
width: parent.width
|
||||
height: parent.width / (implicitWidth/implicitHeight)
|
||||
}
|
||||
Text {
|
||||
text: modelData+1
|
||||
}
|
||||
Text {
|
||||
text: thumbnail.implicitWidth+"x"+thumbnail.implicitHeight
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: page.pageNumber = modelData
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue