diff --git a/src/app/qml/Book.qml b/src/app/qml/Book.qml --- a/src/app/qml/Book.qml +++ b/src/app/qml/Book.qml @@ -28,7 +28,11 @@ import org.kde.peruse 0.1 as Peruse import "listcomponents" as ListComponents - +/** + * @brief Page that handles reading the book. + * + * + */ Kirigami.Page { id: root; objectName: "bookViewer"; @@ -283,6 +287,11 @@ enabled: root.isCurrentPage; } + /** + * This holds an instance of ViewerBase, which can either be the + * Okular viewer(the fallback one), or one of the type specific + * ones(ImageBrowser based). + */ Item { width: root.width - (root.leftPadding + root.rightPadding); height: root.height - (root.topPadding + root.bottomPadding); @@ -359,7 +368,9 @@ } } } - + /** + * Overlay with book information and a series selection. + */ Kirigami.OverlaySheet { id: bookInfo; function setNewCurrentIndex(newIndex) { @@ -454,6 +465,7 @@ width: parent.width; height: Kirigami.Units.gridUnit * 12; orientation: ListView.Horizontal; + var acbf = seriesListView.model.acbfData; NumberAnimation { id: seriesListAnimation; target: seriesListView; property: "contentX"; duration: applicationWindow().animationDuration; easing.type: Easing.InOutQuad; } delegate: ListComponents.BookTileTall { height: model.filename != "" ? neededHeight : 1; diff --git a/src/app/qml/Bookshelf.qml b/src/app/qml/Bookshelf.qml --- a/src/app/qml/Bookshelf.qml +++ b/src/app/qml/Bookshelf.qml @@ -28,7 +28,18 @@ import org.kde.peruse 0.1 as Peruse import "listcomponents" as ListComponents - +/** + * @brief This lays out the books and categories. + * + * It uses BookTileTall for the books and CategoryTileTall + * for showing the categories. Categories can be selected to open + * a new bookshelf from the right, showing the entries in that + * subcategory. This is particularly in use with the folder category. + * + * There is also access to the SearchBox, and it is possible to access + * a BookTile by press+holding the thumbnail. + * This holds information about the book. + */ Kirigami.ScrollablePage { id: root; title: headerText; diff --git a/src/app/qml/PeruseMain.qml b/src/app/qml/PeruseMain.qml --- a/src/app/qml/PeruseMain.qml +++ b/src/app/qml/PeruseMain.qml @@ -28,6 +28,24 @@ import org.kde.peruse 0.1 as Peruse import org.kde.contentlist 0.1 +/** + * @brief main application window. + * + * This splits the window in two sections: + * - A section where you can select comics. + * - A "global drawer" which can be used to switch between categories + * and access settings and the open book dialog. + * + * The global drawer controls which is the main component on the left. + * It initializes on WelcomePage. The category filters are each handled + * by a BookShelf. The store page by Store and the settings by Settings. + * + * This also controls the bookViewer, which is a Book object where the + * main reading of comics is done. + * + * There is also the PeruseContextDrawer, which is only accesible on the book + * page and requires flicking in from the right. + */ Kirigami.ApplicationWindow { id: mainWindow; title: "Comic Book Reader"; diff --git a/src/app/qml/SearchBox.qml b/src/app/qml/SearchBox.qml --- a/src/app/qml/SearchBox.qml +++ b/src/app/qml/SearchBox.qml @@ -26,7 +26,13 @@ import org.kde.peruse 0.1 as Peruse import "listcomponents" as ListComponents - +/** + * @brief A box that holds search results + * + * This shows up when selecting the search from + * BookShelf or the WelcomePage. It draws BookTileTall + * and CategoryTileTall for the entries it finds. + */ Rectangle { id: root; property int maxHeight: parent.height; diff --git a/src/app/qml/Settings.qml b/src/app/qml/Settings.qml --- a/src/app/qml/Settings.qml +++ b/src/app/qml/Settings.qml @@ -29,7 +29,11 @@ import org.kde.peruse 0.1 as Peruse import "listcomponents" as ListComponents - +/** + * @brief This holds toggles and dials to configure Peruse. + * + * Its main purpose is to add and remove entries from the list of booklocations. + */ Kirigami.Page { id: root; property string categoryName: "settingsPage"; diff --git a/src/app/qml/Store.qml b/src/app/qml/Store.qml --- a/src/app/qml/Store.qml +++ b/src/app/qml/Store.qml @@ -29,7 +29,9 @@ import org.kde.peruse 0.1 as Peruse import "listcomponents" as ListComponents - +/** + * @brief This holds the NewStuffStuff to get new comics from the KDE store. + */ Kirigami.Page { id: root; property string categoryName: "storePage"; diff --git a/src/app/qml/WelcomePage.qml b/src/app/qml/WelcomePage.qml --- a/src/app/qml/WelcomePage.qml +++ b/src/app/qml/WelcomePage.qml @@ -27,7 +27,19 @@ import org.kde.peruse 0.1 as Peruse import "listcomponents" as ListComponents - +/** + * @brief The page that Peruse opens up on. + * + * The WelcomePage shares some resemblance to the + * BookShelf pages in that it allows the user to select a comic, + * but where BookShelf pages are really for discovery and searching + * through categories and subcategories, the WelcomePage is primarily + * for selecting the recently opened and new books, which the user is most likely + * to look at when they want to read. + * + * It uses BookTileTall to show the selectable books, SearchBox to search books + * and Section to indicate a subsection. + */ Kirigami.Page { id: root; property string categoryName: "welcomePage"; diff --git a/src/app/qml/listcomponents/BookTile.qml b/src/app/qml/listcomponents/BookTile.qml --- a/src/app/qml/listcomponents/BookTile.qml +++ b/src/app/qml/listcomponents/BookTile.qml @@ -24,6 +24,16 @@ import org.kde.kirigami 2.1 as Kirigami +/** + * @brief small window with book information. + * + * This shows a bit of information about the book and gives a + * selector with the other books in the series. + * + * It pops up after finishing a book in Book, and when pressing long + * on a BookTileTall item in BookShelf. + * + */ Item { id: root; property bool selected: false; diff --git a/src/app/qml/listcomponents/BookTileTall.qml b/src/app/qml/listcomponents/BookTileTall.qml --- a/src/app/qml/listcomponents/BookTileTall.qml +++ b/src/app/qml/listcomponents/BookTileTall.qml @@ -24,6 +24,9 @@ import org.kde.kirigami 2.1 as Kirigami +/** + * @brief A button to select a book to read with a nice big thumbnail. + */ Item { id: root; property bool selected: false; diff --git a/src/app/qml/listcomponents/CategoryTileTall.qml b/src/app/qml/listcomponents/CategoryTileTall.qml --- a/src/app/qml/listcomponents/CategoryTileTall.qml +++ b/src/app/qml/listcomponents/CategoryTileTall.qml @@ -24,6 +24,12 @@ import org.kde.kirigami 2.1 as Kirigami +/** + * @brief A button to select a category to show the categories and books inside. + * + * It distinguishes itself from a book by drawing two rectangles behind the thumbnail, + * to indicate 'multiple books'. + */ Item { id: root; property bool selected: false; diff --git a/src/app/qml/listcomponents/Section.qml b/src/app/qml/listcomponents/Section.qml --- a/src/app/qml/listcomponents/Section.qml +++ b/src/app/qml/listcomponents/Section.qml @@ -22,7 +22,9 @@ import QtQuick 2.1 import org.kde.kirigami 2.1 as Kirigami - +/** + * @brief Draws a big header to indicate subsections within a page. + */ Row { width: parent.width; height: headerText.paintedHeight; diff --git a/src/app/qml/viewers/ImageBrowser.qml b/src/app/qml/viewers/ImageBrowser.qml --- a/src/app/qml/viewers/ImageBrowser.qml +++ b/src/app/qml/viewers/ImageBrowser.qml @@ -23,6 +23,11 @@ // import QtQuick.Layouts 1.1 // import QtQuick.Controls 1.0 as QtControls +/** + * @brief The image viewer used by the CBR and Folder Viewer Base classes. + * + * It handles drawing the image and the different zoom modes. + */ ListView { id: root signal goNextPage(); @@ -43,7 +48,14 @@ currentIndex = indexHere; } } - + /** + * An interactive area with an image. + * + * Clicking once on the image will hide all other controls from view. + * Clicking twice will instead zoom in. + * + * Pinch will zoom in as well. + */ delegate: Flickable { id: flick width: imageWidth diff --git a/src/app/qml/viewers/ViewerBase.qml b/src/app/qml/viewers/ViewerBase.qml --- a/src/app/qml/viewers/ViewerBase.qml +++ b/src/app/qml/viewers/ViewerBase.qml @@ -22,7 +22,15 @@ import QtQuick 2.1 import QtQuick.Layouts 1.1 import QtQuick.Controls 1.0 - +/** + * @brief a base for holding the image browser. + * + * It keeps track of the comic data and deals with all sorts + * of side functions like keeping track of the current page, + * right to left mode and the controls. + * + * This is slightly different between filetypes. + */ Item { id: root; signal goNextPage(); diff --git a/src/app/qml/viewers/cbr.qml b/src/app/qml/viewers/cbr.qml --- a/src/app/qml/viewers/cbr.qml +++ b/src/app/qml/viewers/cbr.qml @@ -24,7 +24,15 @@ import QtQuick.Controls 1.0 import org.kde.peruse 0.1 as Peruse - +/** + * @brief a ViewerBase for CBR style books. + * + * It is called from Book when the opened book is one of the following files: + * - application/x-cbz + * - application/x-cbr + * - application/vnd.comicbook+zip + * - application/vnd.comicbook+rar + */ ViewerBase { id: root; property string title: imageBrowser.model.title; diff --git a/src/app/qml/viewers/folderofimages.qml b/src/app/qml/viewers/folderofimages.qml --- a/src/app/qml/viewers/folderofimages.qml +++ b/src/app/qml/viewers/folderofimages.qml @@ -24,7 +24,14 @@ import QtQuick.Controls 1.0 import org.kde.peruse 0.1 as Peruse - +/** + * @brief a ViewerBase for books that are folders with images. + * + * It is called from Book when the opened book is one of the following files: + * - inode/directory + * - image/jpeg + * - image/png + */ ViewerBase { id: root; property string title: imageBrowser.model.title; diff --git a/src/app/qml/viewers/okular.qml b/src/app/qml/viewers/okular.qml --- a/src/app/qml/viewers/okular.qml +++ b/src/app/qml/viewers/okular.qml @@ -25,7 +25,14 @@ import org.kde.kirigami 2.1 as Kirigami import org.kde.okular 2.0 as Okular - +/** + * @brief a ViewerBase intended as a fallback for unsupported books. + * + * It is called from Book when the opened book has no other specialised viewers. + * + * It does not use the ImageBrowser because it needs to access + * Okular Page items for the images. + */ ViewerBase { id: root; property string title: documentItem.windowTitleForDocument; diff --git a/src/creator/qml/AddPageSheet.qml b/src/creator/qml/AddPageSheet.qml --- a/src/creator/qml/AddPageSheet.qml +++ b/src/creator/qml/AddPageSheet.qml @@ -24,7 +24,11 @@ import QtQuick.Controls 2.2 as QtControls import org.kde.kirigami 2.1 as Kirigami - +/** + * @brief overlay with options for adding a page. + * + * It is accessed from Book + */ Kirigami.OverlaySheet { id: root; property int addPageAfter: 0; diff --git a/src/creator/qml/Book.qml b/src/creator/qml/Book.qml --- a/src/creator/qml/Book.qml +++ b/src/creator/qml/Book.qml @@ -24,7 +24,15 @@ import org.kde.kirigami 2.1 as Kirigami import org.kde.peruse 0.1 as Peruse - +/** + * @brief the page that deals with editing the book. + * + * This is primarily a list of pages that can be moved around. These are inside + * Kirigami ListSwipeItems. + * + * This also has a button to add pages, which calls up AddPageSheet. + * And a button to edit the book metadata, which calls up BookMetainfoPage. + */ Kirigami.ScrollablePage { id: root; property string categoryName: "book"; diff --git a/src/creator/qml/BookMetainfoPage.qml b/src/creator/qml/BookMetainfoPage.qml --- a/src/creator/qml/BookMetainfoPage.qml +++ b/src/creator/qml/BookMetainfoPage.qml @@ -25,7 +25,13 @@ import org.kde.kirigami 2.1 as Kirigami import "metainfoeditors" - +/** + * @brief Page with form to edit the comic metadata. + * + * Most metadata entries are quite simple. + * + * Others, like Author, need a dedicated entry editor (AuthorEntryEditor). + */ Kirigami.Page { id: root; title: i18nc("title text for the book meta information editor sheet", "Edit Meta Information"); diff --git a/src/creator/qml/CreateNewBook.qml b/src/creator/qml/CreateNewBook.qml --- a/src/creator/qml/CreateNewBook.qml +++ b/src/creator/qml/CreateNewBook.qml @@ -25,7 +25,12 @@ import org.kde.kirigami 2.1 as Kirigami import org.kde.peruse 0.1 as Peruse - +/** + * @brief page with a form for creating a new comic. + * + * It asks for the default title, folder and cover image, + * and when done it open the new book in Book. + */ Kirigami.Page { id: root; property string categoryName: "createNewBook"; diff --git a/src/creator/qml/Main.qml b/src/creator/qml/Main.qml --- a/src/creator/qml/Main.qml +++ b/src/creator/qml/Main.qml @@ -25,7 +25,18 @@ import org.kde.kirigami 2.1 as Kirigami import org.kde.peruse 0.1 as Peruse - +/** + * @brief Main window of the application. + * + * This splits the window in two sections: + * - A section where you can modify a comic. + * - A "global drawer" which can be used to select actions. + * + * WelcomePage is the opening page and holds options to create a new comic. + * CreateNewBook gives options for creating a new book from scratch. + * Book is the actual book being modified. + * Settings is the page with toggles and knobs for Peruse Creator config. + */ Kirigami.ApplicationWindow { id: mainWindow; property int animationDuration: 200; diff --git a/src/creator/qml/Settings.qml b/src/creator/qml/Settings.qml --- a/src/creator/qml/Settings.qml +++ b/src/creator/qml/Settings.qml @@ -22,7 +22,9 @@ import QtQuick 2.2 import org.kde.kirigami 2.1 as Kirigami - +/** + * @brief Page with knobs and dials for configuring Peruse Creator. + */ Kirigami.Page { id: root; property string categoryName: "settingsPage"; diff --git a/src/creator/qml/WelcomePage.qml b/src/creator/qml/WelcomePage.qml --- a/src/creator/qml/WelcomePage.qml +++ b/src/creator/qml/WelcomePage.qml @@ -24,7 +24,15 @@ import QtQuick.Controls 2.2 as QtControls import org.kde.kirigami 2.1 as Kirigami - +/** + * @brief The page on which Peruse Creator opens. + * + * This page gives an introduction to peruse and has options for: + * - Opening the last opened archive by either Peruse or Peruse Creator. + * - Opening an existing comic. + * - Creating a blank comic. + * - Creating a comic archive from a selection of images. + */ Kirigami.Page { id: root; property string categoryName: "welcomePage"; diff --git a/src/creator/qml/metainfoeditors/AuthorEntryEditor.qml b/src/creator/qml/metainfoeditors/AuthorEntryEditor.qml --- a/src/creator/qml/metainfoeditors/AuthorEntryEditor.qml +++ b/src/creator/qml/metainfoeditors/AuthorEntryEditor.qml @@ -23,7 +23,19 @@ import org.kde.kirigami 2.1 as Kirigami import QtQuick.Controls 2.2 as QtControls - +/** + * @brief a special overlay sheet for editing the author information. + * + * Authors can have the full names, nicknames and some contact information + * like email adress and homepage. They can also be assigned a role + * from a list of predefined author activities. + * + * Author is used in acbf for both the actual authors as well as the people + * who handled generating the acbf document, which is why this is + * a dedicated form. + * + * TODO: Support input for multiple homepage and email adresses. + */ Kirigami.OverlaySheet { id: root; property int index: -1;