Changeset View
Changeset View
Standalone View
Standalone View
src/app/qml/Bookshelf.qml
Show First 20 Lines • Show All 86 Lines • ▼ Show 20 Line(s) | |||||
87 | // text: i18nc("Select the next book in the list", "Select Next Book"); | 87 | // text: i18nc("Select the next book in the list", "Select Next Book"); | ||
88 | // shortcut: StandardKey.MoveToNextChar; | 88 | // shortcut: StandardKey.MoveToNextChar; | ||
89 | // iconName: "go-next"; | 89 | // iconName: "go-next"; | ||
90 | // onTriggered: shelfList.nextEntry(); | 90 | // onTriggered: shelfList.nextEntry(); | ||
91 | // enabled: root.isCurrentPage && applicationWindow().deviceType === applicationWindow().deviceTypeDesktop; | 91 | // enabled: root.isCurrentPage && applicationWindow().deviceType === applicationWindow().deviceTypeDesktop; | ||
92 | // }, | 92 | // }, | ||
93 | Kirigami.Action { | 93 | Kirigami.Action { | ||
94 | text: i18nc("Open the book which is currently selected in the list", "Open Selected Book"); | 94 | text: i18nc("Open the book which is currently selected in the list", "Open Selected Book"); | ||
95 | shortcut: "Return"; | 95 | shortcut: bookDetails.sheetOpen? "" : "Return"; | ||
96 | iconName: "document-open"; | 96 | iconName: "document-open"; | ||
97 | onTriggered: openBook(shelfList.currentIndex); | 97 | onTriggered: openBook(shelfList.currentIndex); | ||
98 | enabled: root.isCurrentPage && applicationWindow().deviceType === applicationWindow().deviceTypeDesktop; | 98 | enabled: root.isCurrentPage && applicationWindow().deviceType === applicationWindow().deviceTypeDesktop; | ||
99 | } | 99 | } | ||
100 | ] | 100 | ] | ||
101 | actions { | 101 | actions { | ||
102 | contextualActions: PLASMA_PLATFORM.substring(0, 5) === "phone" ? mobileActions : desktopActions; | 102 | contextualActions: PLASMA_PLATFORM.substring(0, 5) === "phone" ? mobileActions : desktopActions; | ||
103 | main: bookDetails.sheetOpen ? bookDetailsAction : mainShelfAction; | 103 | main: bookDetails.sheetOpen ? bookDetailsAction : mainShelfAction; | ||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Line(s) | 181 | Kirigami.OverlaySheet { | |||
188 | property QtObject fakeBook: Peruse.PropertyContainer { | 188 | property QtObject fakeBook: Peruse.PropertyContainer { | ||
189 | property string author: ""; | 189 | property string author: ""; | ||
190 | property string title: ""; | 190 | property string title: ""; | ||
191 | property string filename: ""; | 191 | property string filename: ""; | ||
192 | property string publisher: ""; | 192 | property string publisher: ""; | ||
193 | property string thumbnail: ""; | 193 | property string thumbnail: ""; | ||
194 | property string currentPage: "0"; | 194 | property string currentPage: "0"; | ||
195 | property string totalPages: "0"; | 195 | property string totalPages: "0"; | ||
196 | property string comment: ""; | ||||
196 | } | 197 | } | ||
197 | ListComponents.BookTile { | 198 | ListComponents.BookTile { | ||
198 | id: detailsTile; | 199 | id: detailsTile; | ||
199 | height: neededHeight; | 200 | height: neededHeight; | ||
200 | width: shelfList.width - Kirigami.Units.largeSpacing * 2; | 201 | width: shelfList.width - Kirigami.Units.largeSpacing * 2; | ||
201 | author: bookDetails.currentBook.readProperty("author"); | 202 | author: bookDetails.currentBook.readProperty("author"); | ||
202 | publisher: bookDetails.currentBook.readProperty("publisher"); | 203 | publisher: bookDetails.currentBook.readProperty("publisher"); | ||
203 | title: bookDetails.currentBook.readProperty("title"); | 204 | title: bookDetails.currentBook.readProperty("title"); | ||
204 | filename: bookDetails.currentBook.readProperty("filename"); | 205 | filename: bookDetails.currentBook.readProperty("filename"); | ||
205 | thumbnail: bookDetails.currentBook.readProperty("thumbnail"); | 206 | thumbnail: bookDetails.currentBook.readProperty("thumbnail"); | ||
206 | categoryEntriesCount: 0; | 207 | categoryEntriesCount: 0; | ||
207 | currentPage: bookDetails.currentBook.readProperty("currentPage"); | 208 | currentPage: bookDetails.currentBook.readProperty("currentPage"); | ||
208 | totalPages: bookDetails.currentBook.readProperty("totalPages"); | 209 | totalPages: bookDetails.currentBook.readProperty("totalPages"); | ||
210 | description: bookDetails.currentBook.readProperty("description"); | ||||
209 | onBookSelected: { | 211 | onBookSelected: { | ||
210 | bookDetails.close(); | 212 | bookDetails.close(); | ||
211 | applicationWindow().showBook(filename, currentPage); | 213 | applicationWindow().showBook(filename, currentPage); | ||
212 | } | 214 | } | ||
213 | onBookDeleteRequested: { | 215 | onBookDeleteRequested: { | ||
214 | contentList.removeBook(detailsTile.filename, true); | 216 | contentList.removeBook(detailsTile.filename, true); | ||
215 | close(); | 217 | close(); | ||
216 | } | 218 | } | ||
217 | } | 219 | } | ||
218 | } | 220 | } | ||
219 | } | 221 | } |