diff --git a/src/creator/qml/Book.qml b/src/creator/qml/Book.qml index d55e68b..b349415 100644 --- a/src/creator/qml/Book.qml +++ b/src/creator/qml/Book.qml @@ -1,173 +1,173 @@ /* * Copyright (C) 2015 Dan Leinir Turthra Jensen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 6 of version 3 of the license. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . * */ import QtQuick 2.2 import QtQuick.Controls 2.2 as QtControls import org.kde.kirigami 2.1 as Kirigami import org.kde.peruse 0.1 as Peruse Kirigami.ScrollablePage { id: root; property string categoryName: "book"; - title: i18nc("title of the main book editor page", "Editing %1").arg(bookModel.title == "" ? root.filename : bookModel.title); + title: i18nc("title of the main book editor page", "Editing %1", bookModel.title == "" ? root.filename : bookModel.title); property string filename; actions { left: addPageSheet.opened ? null : saveBookAction; main: addPageSheet.opened ? closeAddPageSheetAction : defaultMainAction; right: addPageSheet.opened ? null : addPageAction; } Kirigami.Action { id: saveBookAction; text: i18nc("Saves the book to a file on disk", "Save Book"); iconName: "document-save"; onTriggered: bookModel.saveBook(); enabled: bookModel.hasUnsavedChanges; } Kirigami.Action { id: addPageAction; text: i18nc("adds a new page at the end of the book", "Add Page"); iconName: "list-add"; onTriggered: addPage(bookModel.pageCount); } Kirigami.Action { id: defaultMainAction; text: i18nc("causes a dialog to show in which the user can edit the meta information for the entire book", "Edit Metainfo"); iconName: "document-edit"; onTriggered: pageStack.push(editMetaInfo); } Kirigami.Action { id: closeAddPageSheetAction; text: i18nc("closes the the add page sheet", "Do Not Add A Page"); iconName: "dialog-cancel"; onTriggered: addPageSheet.close(); } function addPage(afterWhatIndex) { addPageSheet.addPageAfter = afterWhatIndex; addPageSheet.open(); } ListView { id: bookList; model: Peruse.ArchiveBookModel { id: bookModel; qmlEngine: globalQmlEngine; readWrite: true; filename: root.filename; } Component { id: editMetaInfo; BookMetainfoPage { model: bookModel; } } delegate: Kirigami.SwipeListItem { id: listItem; height: Kirigami.Units.iconSizes.huge + Kirigami.Units.smallSpacing * 2; supportsMouseEvents: true; onClicked: ; actions: [ Kirigami.Action { text: i18nc("swap the position of this page with the previous one", "Move Up"); iconName: "go-up" onTriggered: { bookModel.swapPages(model.index, model.index - 1); } enabled: model.index > 0; visible: enabled; }, Kirigami.Action { text: i18nc("swap the position of this page with the next one", "Move Down"); iconName: "go-down" onTriggered: { bookModel.swapPages(model.index, model.index + 1); } enabled: model.index < bookModel.pageCount - 1; visible: enabled; }, Kirigami.Action { text: i18nc("remove the page from the book", "Delete Page"); iconName: "list-remove" onTriggered: {} }, Kirigami.Action { text: i18nc("add a page to the book after this one", "Add Page After This"); iconName: "list-add" onTriggered: root.addPage(model.index); } ] Item { anchors.fill: parent; Item { id: bookCover; anchors { top: parent.top; left: parent.left; bottom: parent.bottom; } width: height; Image { id: coverImage; anchors { fill: parent; margins: Kirigami.Units.smallSpacing; } asynchronous: true; fillMode: Image.PreserveAspectFit; source: model.url; } } QtControls.Label { anchors { verticalCenter: parent.verticalCenter; left: bookCover.right; leftMargin: Kirigami.Units.largeSpacing; } text: model.title; } } } Rectangle { id: processingBackground; anchors.fill: parent; opacity: bookModel.processing ? 0.5 : 0; Behavior on opacity { PropertyAnimation { duration: mainWindow.animationDuration; } } MouseArea { anchors.fill: parent; enabled: parent.opacity > 0; onClicked: { } } } QtControls.BusyIndicator { anchors { horizontalCenter: processingBackground.horizontalCenter; top: parent.top topMargin: x; } running: processingBackground.opacity > 0; visible: running; } } AddPageSheet { id: addPageSheet; model: bookModel; } } diff --git a/src/creator/qml/BookPage.qml b/src/creator/qml/BookPage.qml index 9955582..444a40e 100644 --- a/src/creator/qml/BookPage.qml +++ b/src/creator/qml/BookPage.qml @@ -1,31 +1,31 @@ /* * Copyright (C) 2015 Dan Leinir Turthra Jensen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 6 of version 3 of the license. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . * */ import QtQuick 2.2 import org.kde.kirigami 2.1 as Kirigami Kirigami.Page { id: root; property string categoryName: "bookPage"; - title: i18nc("title of the page editing sub-page for the book editor", "Page %1").arg(root.title); + title: i18nc("title of the page editing sub-page for the book editor", "Page %1", root.title); property string title; } diff --git a/src/creator/qml/WelcomePage.qml b/src/creator/qml/WelcomePage.qml index 92f053d..43f9e7f 100644 --- a/src/creator/qml/WelcomePage.qml +++ b/src/creator/qml/WelcomePage.qml @@ -1,175 +1,175 @@ /* * Copyright (C) 2015 Dan Leinir Turthra Jensen * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 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 6 of version 3 of the license. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library. If not, see . * */ import QtQuick 2.2 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.2 as QtControls import org.kde.kirigami 2.1 as Kirigami Kirigami.Page { id: root; property string categoryName: "welcomePage"; title: i18nc("title of the welcome page", "Welcome"); Item { width: root.width - (root.leftPadding + root.rightPadding); height: root.height - root.topPadding; Item { id: titleContainer; anchors { top: parent.top; left: parent.left; right: parent.right; } height: appNameLabel.height + appDescriptionLabel.height + Kirigami.Units.largeSpacing; Kirigami.Heading { id: appNameLabel; anchors { left: parent.left; right: parent.right; bottom: parent.verticalCenter; } text: "Peruse Creator"; horizontalAlignment: Text.AlignHCenter; } QtControls.Label { id: appDescriptionLabel; anchors { top: parent.verticalCenter; left: parent.left; right: parent.right; } text: i18nc("application subtitle", "Comic Book Creation Tool"); horizontalAlignment: Text.AlignHCenter; } Rectangle { anchors.centerIn: parent; height: 1; color: Kirigami.Theme.textColor; width: appDescriptionLabel.paintedWidth; } } Item { id: actionsContainer; anchors { top: titleContainer.bottom; left: parent.left; right: parent.right; bottom: parent.bottom; } Item { anchors { top: parent.top; left: parent.left; right: parent.right; bottom: parent.verticalCenter; margins: Kirigami.Units.largeSpacing; } QtControls.Label { anchors.fill: parent; wrapMode: Text.WrapAtWordBoundaryOrAnywhere; horizontalAlignment: Text.AlignHCenter; verticalAlignment: Text.AlignVCenter; text: i18nc("Longer introduction text used on the welcome page", "Welcome to Peruse Creator, a tool designed to assist you in creating comic book archives which can be read with any cbz capable comic book reader app. You can either create entirely new comic book archives from scratch, create one from a set of pictures, or editing existing archives. Once you have created them, you can even publish them directly to the online comic book archive at the KDE Store from within the application, or just share the files with your friends."); } } Item { anchors { top: parent.verticalCenter; left: parent.left; right: parent.right; bottom: parent.bottom; } Item { id: continueLast; anchors { top: parent.top; left: parent.left; right: parent.horizontalCenter; bottom: parent.verticalCenter; } QtControls.Button { anchors.centerIn: parent; // iconName: "go-next"; - text: i18nc("Button to continue working on the most recently opened comic book archive", "Continue %1").arg(continueLast.mostRecentBook.split('/').pop()); + text: i18nc("Button to continue working on the most recently opened comic book archive", "Continue %1", continueLast.mostRecentBook.split('/').pop()); onClicked: mainWindow.openBook(continueLast.mostRecentBook); } property string mostRecentBook: ""; Component.onCompleted: { if(peruseConfig.recentlyOpened.length > 0) { for(var i = 0; i < peruseConfig.recentlyOpened.length; ++i) { if(peruseConfig.recentlyOpened[i].toLowerCase().slice(-4) === ".cbz") { continueLast.mostRecentBook = peruseConfig.recentlyOpened[i]; break; } } } } visible: mostRecentBook.length > 0; } Item { anchors { top: parent.top; left: continueLast.visible ? parent.horizontalCenter : parent.left; right: parent.right; bottom: parent.verticalCenter; } QtControls.Button { anchors.centerIn: parent; // iconName: "document-open"; text: i18nc("Button to open existing comic book archive", "Open Existing..."); onClicked: mainWindow.openOther(); } } Item { anchors { top: parent.verticalCenter; left: parent.left; right: parent.horizontalCenter; bottom: parent.bottom; } QtControls.Button { anchors.centerIn: parent; // iconName: "document-new"; text: i18nc("Button to create a new, empty comic book archive", "Create Blank"); onClicked: mainWindow.createNew(); } } Item { anchors { top: parent.verticalCenter; left: parent.horizontalCenter; right: parent.right; bottom: parent.bottom; } QtControls.Button { anchors.centerIn: parent; // iconName: "folder-open"; text: i18nc("Button to create a new comic book archive by copying in a bunch of pictures", "Create From Images..."); } } } } } }