Skip to content

Commit

Permalink
Updated Appdata for Appcenter Issues fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
babluboy committed Apr 28, 2017
1 parent 71b587d commit 451efad
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 30 deletions.
18 changes: 10 additions & 8 deletions data/com.github.babluboy.bookworm.appdata.xml
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Copyright 2017 Siddharth Das <[email protected]> -->
<!-- Copyright 2017 Siddhartha Das <[email protected]> -->
<component type="desktop">
<id>com.github.babluboy.bookworm.desktop</id>
<metadata_license>CC0-1.0</metadata_license>
<project_group>bookworm</project_group>
<project_license>GPL-3.0+</project_license>
<name>Bookworm</name>
<summary>A simple ebook reader for Elementary OS</summary>
<summary>A simple, focused eBook reader</summary>
<description>
<p>
A simple eBook Reader application made for elementary OS.The goal of Bookworm is to provide a uniform user experience for multiple electronic document formats like epub,pdf, mobi, etc.
Bookworm is currently under active development and only the EPUB format is supported.
</p>
<p>Read the books you love without having to worry about the different format complexities like epub, pdf, mobi, cbr, etc.</p>
<p>Bookworm is currently under active development and this initial release supports only the EPUB format. PDF support will be added to the next version and support for other formats to follow.</p>
</description>
<screenshots>
<screenshot type="default">
<caption>Bookworm Library View</caption>
<image>https://raw.githubusercontent.com/babluboy/bookworm/master/screenshots/BookwormLibraryView.jpeg</image>
</screenshot>
<screenshot type="default">
<caption>Bookworm Reading View</caption>
<image>https://github.com/babluboy/bookworm/blob/master/screenshots/Bookworm-PreferencesPopUp.jpeg</image>
<image>https://raw.githubusercontent.com/babluboy/bookworm/master/screenshots/BookwormReadingView.jpeg</image>
</screenshot>
</screenshots>
<provides>
Expand All @@ -25,7 +27,7 @@
<releases>
​ <release version="0.5" date="2017-04-25">
​ <description>
​ <p>Initial WIP Release</p>
​ <p>Initial release with support for EPUB format</p>
​ </description>
​ </release>
​ </releases>
Expand Down
2 changes: 1 addition & 1 deletion po/bookworm.pot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-04-27 19:00+0100\n"
"POT-Creation-Date: 2017-04-28 18:41+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
Expand Down
3 changes: 3 additions & 0 deletions src/bookworm.vala
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ public class BookwormApp.Bookworm:Granite.Application {
public static BookwormApp.Book renderPage (owned BookwormApp.Book aBook, owned string direction){
int currentContentLocation = aBook.getBookPageNumber();
string searchText = "";

//handle loading page with search string
if(direction.index_of("SEARCH:") != -1){
searchText = direction.replace("SEARCH:", "");
Expand Down Expand Up @@ -563,6 +564,8 @@ public class BookwormApp.Bookworm:Granite.Application {
BookwormApp.AppWindow.aWebView.grab_focus();
//set the bookmak icon on the header
handleBookMark("DISPLAY");
//set the navigation controls
aBook = BookwormApp.Bookworm.controlNavigation(aBook);
return aBook;
}

Expand Down
34 changes: 18 additions & 16 deletions src/ePubReader.vala
Original file line number Diff line number Diff line change
Expand Up @@ -428,25 +428,27 @@ public class BookwormApp.ePubReader {
}

public static string provideContent (owned BookwormApp.Book aBook, int contentLocation){
debug("Attempting to fetch content from book at location:"+aBook.getBaseLocationOfContents());
StringBuilder contents = new StringBuilder();
string baseLocationOfContents = aBook.getBaseLocationOfContents();
//handle the case when the content list has html escape chars for the URI
string bookLocationToRead = BookwormApp.Utils.decodeHTMLChars(aBook.getBookContentList().get(contentLocation));
//fetch content from extracted book
debug("Attempting to fetch content from location:"+bookLocationToRead);
contents.assign(BookwormApp.Utils.fileOperations("READ_FILE", bookLocationToRead, "", ""));
//find list of relative urls with src, href, etc and convert them to absolute ones
foreach(string tagname in BookwormApp.Constants.TAG_NAME_WITH_PATHS){
string[] srcList = BookwormApp.Utils.multiExtractBetweenTwoStrings(contents.str, tagname, "\"");
StringBuilder srcItemFullPath = new StringBuilder();
foreach(string srcItem in srcList){
srcItemFullPath.assign(BookwormApp.Utils.getFullPathFromFilename(aBook.getBookExtractionLocation(), srcItem));
contents.assign(contents.str.replace(tagname+srcItem+"\"",tagname+srcItemFullPath.str+"\""));
if(contentLocation > -1){
string baseLocationOfContents = aBook.getBaseLocationOfContents();
//handle the case when the content list has html escape chars for the URI
string bookLocationToRead = BookwormApp.Utils.decodeHTMLChars(aBook.getBookContentList().get(contentLocation));
//fetch content from extracted book
contents.assign(BookwormApp.Utils.fileOperations("READ_FILE", bookLocationToRead, "", ""));
//find list of relative urls with src, href, etc and convert them to absolute ones
foreach(string tagname in BookwormApp.Constants.TAG_NAME_WITH_PATHS){
string[] srcList = BookwormApp.Utils.multiExtractBetweenTwoStrings(contents.str, tagname, "\"");
StringBuilder srcItemFullPath = new StringBuilder();
foreach(string srcItem in srcList){
srcItemFullPath.assign(BookwormApp.Utils.getFullPathFromFilename(aBook.getBookExtractionLocation(), srcItem));
contents.assign(contents.str.replace(tagname+srcItem+"\"",tagname+srcItemFullPath.str+"\""));
}
}
//update the content for required manipulation
contents.assign(adjustPageContent(contents.str));
}
//update the content for required manipulation
contents.assign(adjustPageContent(contents.str));

debug("Completed fetching content from book at location:"+aBook.getBaseLocationOfContents() + "for page:" + contentLocation.to_string());
return contents.str;
}

Expand Down
1 change: 0 additions & 1 deletion src/library.vala
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ public class BookwormApp.Library{
//left button click for reading or selection of book
if(BookwormApp.Bookworm.BOOKWORM_CURRENT_STATE == BookwormApp.Constants.BOOKWORM_UI_STATES[0]){
aBook = BookwormApp.Bookworm.libraryViewMap.get(aEventBox.get_name());
debug("Initiated process for reading eBook:"+aBook.getBookLocation());
BookwormApp.Bookworm.readSelectedBook(aBook);
}
if(BookwormApp.Bookworm.BOOKWORM_CURRENT_STATE == BookwormApp.Constants.BOOKWORM_UI_STATES[2] ||
Expand Down
4 changes: 0 additions & 4 deletions src/window.vala
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ public class BookwormApp.AppWindow {
currentBookForForward = BookwormApp.Bookworm.libraryViewMap.get(BookwormApp.Bookworm.locationOfEBookCurrentlyRead);
debug("Initiating read forward for eBook:"+currentBookForForward.getBookLocation());
currentBookForForward = BookwormApp.Bookworm.renderPage(currentBookForForward, "FORWARD");
currentBookForForward = BookwormApp.Bookworm.controlNavigation(currentBookForForward);
//update book details to libraryView Map
BookwormApp.Bookworm.libraryViewMap.set(currentBookForForward.getBookLocation(), currentBookForForward);
BookwormApp.Bookworm.locationOfEBookCurrentlyRead = currentBookForForward.getBookLocation();
Expand All @@ -161,7 +160,6 @@ public class BookwormApp.AppWindow {
currentBookForReverse = BookwormApp.Bookworm.libraryViewMap.get(BookwormApp.Bookworm.locationOfEBookCurrentlyRead);
debug("Initiating read previous for eBook:"+currentBookForReverse.getBookLocation());
currentBookForReverse = BookwormApp.Bookworm.renderPage(currentBookForReverse, "BACKWARD");
currentBookForReverse = BookwormApp.Bookworm.controlNavigation(currentBookForReverse);
//update book details to libraryView Map
BookwormApp.Bookworm.libraryViewMap.set(currentBookForReverse.getBookLocation(), currentBookForReverse);
BookwormApp.Bookworm.locationOfEBookCurrentlyRead = currentBookForReverse.getBookLocation();
Expand Down Expand Up @@ -209,15 +207,13 @@ public class BookwormApp.AppWindow {
//get object for this ebook
BookwormApp.Book aBookLeftKeyPress = BookwormApp.Bookworm.libraryViewMap.get(BookwormApp.Bookworm.locationOfEBookCurrentlyRead);
aBookLeftKeyPress = BookwormApp.Bookworm.renderPage(aBookLeftKeyPress, "BACKWARD");
aBookLeftKeyPress = BookwormApp.Bookworm.controlNavigation(aBookLeftKeyPress);
//update book details to libraryView Map
BookwormApp.Bookworm.libraryViewMap.set(aBookLeftKeyPress.getBookLocation(), aBookLeftKeyPress);
}
if (ev.keyval == Gdk.Key.Right) {// Right key pressed, move page forward
//get object for this ebook
BookwormApp.Book aBookRightKeyPress = BookwormApp.Bookworm.libraryViewMap.get(BookwormApp.Bookworm.locationOfEBookCurrentlyRead);
aBookRightKeyPress = BookwormApp.Bookworm.renderPage(aBookRightKeyPress, "FORWARD");
aBookRightKeyPress = BookwormApp.Bookworm.controlNavigation(aBookRightKeyPress);
//update book details to libraryView Map
BookwormApp.Bookworm.libraryViewMap.set(aBookRightKeyPress.getBookLocation(), aBookRightKeyPress);
}
Expand Down

0 comments on commit 451efad

Please sign in to comment.