Permalink
Browse files

Packaging and proper Harmattan UI

  • Loading branch information...
1 parent 57a3c59 commit ca9d8722df2b04a27718b40f93b018f68aa85965 @thp thp committed May 18, 2012
Showing with 2,384 additions and 7 deletions.
  1. +5 −2 ClassicPrintProvider.h
  2. +2 −0 README
  3. +15 −0 TODO
  4. +14 −1 classicprintqml.cpp
  5. +8 −0 classicprintqml.desktop
  6. BIN classicprintqml.png
  7. +13 −2 classicprintqml.pro
  8. +94 −2 classicprintqml.qml
  9. +2,168 −0 classicprintqml.svg
  10. +5 −0 debian/changelog
  11. +1 −0 debian/compat
  12. +13 −0 debian/control
  13. +32 −0 debian/copyright
  14. +13 −0 debian/rules
  15. +1 −0 debian/source/format
View
@@ -22,14 +22,17 @@ class ClassicPrintProvider : public QDeclarativeImageProvider {
QImage requestImage(const QString &id, QSize *size,
const QSize &requestedSize)
{
- Q_UNUSED(size);
+ if (id == "") {
+ return QImage();
+ }
QImage source("/" + id);
size->setWidth(source.width());
size->setHeight(source.height());
QImage destination(requestedSize, source.format());
- classicPrint.process(source,
+ classicPrint.process(source.scaled(requestedSize,
+ Qt::KeepAspectRatio),
requestedSize.width(),
requestedSize.height(),
destination);
View
2 README
@@ -6,5 +6,7 @@ This is the port of "ClassicPrint" for the N900 to QML. It re-uses most of the
C++/Qt backend, but adds a QML interface (image provider + other object) to
utilize the ClassicPrint core from a QML application on e.g. MeeGo Harmattan.
+The port is released under the same license as ClassicPrint itself (GNU GPL).
+
Contact information: Thomas Perl <thp.io/about>
View
15 TODO
@@ -0,0 +1,15 @@
+
+ - Create a QML object ("ClassicPrint") that exposes all the
+ settings of the ClassicPrint core, and use it in the QML
+ UI (probably simplified compared to the QWiget-based UI).
+
+ - Add ability to save and share photos.
+
+ - Add ability to load files from somewhere other than DCIM.
+
+ - Lazily load file list to make startup faster.
+
+ - Add ability to save settings and share with other users.
+
+ - Provide some presets for users to get started easily.
+
View
@@ -13,8 +13,21 @@ int main(int argc, char *argv[])
ClassicPrintProvider::init();
ClassicPrintProvider::addToView(&view);
+ QStringList fileModel;
+
+ QDir dcim("/home/user/MyDocs/DCIM/");
+ QStringList photos;
+ photos << "*.jpg" << "*.png";
+
+ QStringList fileNames = dcim.entryList(photos, QDir::Files, QDir::Time);
+ QString fileName;
+ foreach (fileName, fileNames) {
+ fileModel << (dcim.absolutePath() + "/" + fileName);
+ }
+
+ view.rootContext()->setContextProperty("fileModel", fileModel);
view.setSource(QUrl("qrc:/classicprintqml.qml"));
- view.show();
+ view.showFullScreen();
return app.exec();
}
View
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Name=Classic Print
+Exec=invoker --single-instance --type=e /opt/classicprintqml/bin/classicprintqml
+Icon=/opt/classicprintqml/classicprintqml.png
+Terminal=false
+Type=Application
+Categories=Graphics;Photography;
+
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -3,12 +3,23 @@ TEMPLATE = app
QT += declarative xml
-CONFIG += debug
-
OBJECTS_DIR = build
MOC_DIR = build
RCC_DIR = build
+# Deployment on MeeGo Harmattan
+target.path = /opt/classicprintqml/bin
+INSTALLS += target
+
+icon.path = /opt/classicprintqml
+icon.files = classicprintqml.png
+INSTALLS += icon
+
+desktop.path = /usr/share/applications
+desktop.files = classicprintqml.desktop
+INSTALLS += desktop
+
+
# Main application
DEPENDPATH += .
INCLUDEPATH += .
View
@@ -1,7 +1,99 @@
import QtQuick 1.1
+import com.nokia.meego 1.1
+import com.nokia.extras 1.1
-Image {
- source: 'image://classicPrint/home/thp/Pictures/Webcam/2012-05-18-115321.jpg'
+PageStackWindow {
+ initialPage: listPage
+
+ Page {
+ id: listPage
+ tools: commonTools
+ orientationLock: PageOrientation.LockPortrait
+
+ ListView {
+ id: listView
+
+ anchors.fill: parent
+ model: fileModel
+
+ delegate: Image {
+ source: 'file://' + modelData
+ asynchronous: true
+ fillMode: Image.PreserveAspectFit
+
+ height: 200
+ width: parent.width
+
+ sourceSize {
+ width: parent.width
+ }
+
+ MouseArea {
+ anchors.fill: parent
+
+ onClicked: {
+ displayImage.filePath = modelData;
+ pageStack.push(imagePage);
+ }
+ }
+
+ BusyIndicator {
+ anchors.centerIn: parent
+ running: visible
+ visible: parent.status == Image.Loading
+ }
+ }
+ }
+
+ ScrollDecorator {
+ flickableItem: listView
+ }
+ }
+
+ Page {
+ id: imagePage
+ tools: commonTools
+ orientationLock: PageOrientation.LockPortrait
+
+ Image {
+ id: displayImage
+ asynchronous: true
+ property string filePath: ''
+
+ width: parent.height
+ height: parent.width
+ anchors.centerIn: parent
+ fillMode: Image.PreserveAspectFit
+ rotation: 90
+
+ source: 'image://classicPrint/' + filePath
+ sourceSize.width: width
+ sourceSize.height: height
+ }
+
+ BusyIndicator {
+ anchors.centerIn: parent
+ running: visible
+ visible: displayImage.status == Image.Loading
+ }
+ }
+
+ ToolBarLayout {
+ id: commonTools
+
+ ToolIcon {
+ iconId: (pageStack.depth>1)?'icon-m-toolbar-back-white':'icon-m-toolbar-back-dimmed-white'
+ onClicked: {
+ if (pageStack.depth > 1) {
+ pageStack.pop();
+ }
+ }
+ }
+ }
+
+ Component.onCompleted: {
+ theme.inverted = true;
+ }
}
Oops, something went wrong.

0 comments on commit ca9d872

Please sign in to comment.