Skip to content

Commit

Permalink
1.1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
noembryo committed Aug 12, 2019
1 parent 98dcbad commit 28a4248
Show file tree
Hide file tree
Showing 7 changed files with 286 additions and 127 deletions.
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,19 @@ The original KoHighlights (using the wxPython) can be found
* View the highlights and various info for a book by selecting it in the list.
* Save the highlights to the "Archive" and view them, even if your reader is not
connected.
* Merge highlights from the same book that is read in two different devices and/or sync
its reading position. To do it you have to:
* Load both metadata (e.g. your reader's and your tablet's)
* Merge highlights/Sync position from the same book that is read in two different devices
and/or sync its reading position. To do it you have to:
* Load both metadata (e.g. by scanning your reader's _and_ your tablet's books).
* Select the relevant rows of the (same) book.
* If the book has the same cre_dom_version (version of the CREngine), then the
"Merge/Sync" button gets activated and you get the options to sync the highlights
or the position or both.
* Merge highlights/Sync position of a book with its archived version
(book's right click menu)
* Show/hide the page, date or even the highlight text while viewing or saving the
highlights of the books.
* Double click or press the Open Book button to view the book in your system's reader.
* Save all the selected books' highlights:
* Save all the selected books' highlights in:
* A text/html file for every selected book or
* A single text/html file with all highlights combined
* Delete some or all the highlights of any book.
Expand Down
20 changes: 13 additions & 7 deletions boot_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,22 @@
os.chdir(APP_DIR) # Set the current working directory to the app's directory

if sys.platform == "win32": # Windows
import win32api
import win32event
from winerror import ERROR_ALREADY_EXISTS

class SingleInstance:
""" Limits application to single instance
"""
def __init__(self, name):
import win32event
import win32api
self.mutex = win32event.CreateMutex(None, False, name)
self.lasterror = win32api.GetLastError()

def already_running(self):
from winerror import ERROR_ALREADY_EXISTS
return self.lasterror == ERROR_ALREADY_EXISTS

def __del__(self):
import win32api
import win32api # needed otherwise raises Exception AttributeError
win32api.CloseHandle(self.mutex) if self.mutex else None

my_app = SingleInstance(APP_NAME)
Expand Down Expand Up @@ -67,7 +68,12 @@ def except_hook(class_type, value, trace_back):
sys.excepthook = except_hook


PYTHON2 = True if not sys.version_info >= (3, 0) else False
PYTHON2 = True if sys.version_info < (3, 0) else False
QT4 = True
try:
import PySide
except ImportError:
QT4 = False
FIRST_RUN = False
# noinspection PyBroadException
try:
Expand All @@ -80,10 +86,10 @@ def except_hook(class_type, value, trace_back):


BOOKS_VIEW, HIGHLIGHTS_VIEW = range(2) # app views
TITLE, AUTHOR, TYPE, PERCENT, MODIFIED, PATH = range(6) # file_table columns
TITLE, AUTHOR, TYPE, PERCENT, RATING, MODIFIED, PATH = range(7) # file_table columns
PAGE, HIGHLIGHT_TEXT, DATE, PAGE_ID, COMMENT = range(5) # high_list item data
(HIGHLIGHT_H, COMMENT_H,
DATE_H, TITLE_H, PAGE_H, AUTHOR_H, PATH_H) = range(7) # high_table columns
DATE_H, TITLE_H, AUTHOR_H, PAGE_H, PATH_H) = range(7) # high_table columns
MANY_TEXT, ONE_TEXT, MANY_HTML, ONE_HTML, MERGED_HIGH = range(5) # save_actions
DB_MD5, DB_DATE, DB_PATH, DB_DATA = range(4) # db data (columns)

Expand Down
3 changes: 1 addition & 2 deletions gui_about.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Form implementation generated from reading ui file 'D:\Apps\DEV\PROJECTS\KoHighlights\gui_about.ui'
#
# Created: Sun Mar 31 18:17:28 2019
# Created: Mon Aug 12 13:08:09 2019
# by: pyside-uic 0.2.15 running on PySide 1.2.4
#
# WARNING! All changes made in this file will be lost!
Expand Down Expand Up @@ -95,7 +95,6 @@ def retranslateUi(self, About):
About.setWindowTitle(QtGui.QApplication.translate("About", "About KoHighlights", None, QtGui.QApplication.UnicodeUTF8))
self.about_tabs.setTabText(self.about_tabs.indexOf(self.info_tab), QtGui.QApplication.translate("About", "Information", None, QtGui.QApplication.UnicodeUTF8))
self.about_tabs.setTabText(self.about_tabs.indexOf(self.log_tab), QtGui.QApplication.translate("About", "Log", None, QtGui.QApplication.UnicodeUTF8))
self.about_qt_btn.setToolTip(QtGui.QApplication.translate("About", "Check online for an updated version", None, QtGui.QApplication.UnicodeUTF8))
self.about_qt_btn.setText(QtGui.QApplication.translate("About", "About Qt", None, QtGui.QApplication.UnicodeUTF8))
self.updates_btn.setToolTip(QtGui.QApplication.translate("About", "Check online for an updated version", None, QtGui.QApplication.UnicodeUTF8))
self.updates_btn.setText(QtGui.QApplication.translate("About", "Check for Updates", None, QtGui.QApplication.UnicodeUTF8))
Expand Down
19 changes: 12 additions & 7 deletions gui_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Form implementation generated from reading ui file 'D:\Apps\DEV\PROJECTS\KoHighlights\gui_main.ui'
#
# Created: Sun Apr 7 02:32:13 2019
# Created: Mon Aug 12 13:08:09 2019
# by: pyside-uic 0.2.15 running on PySide 1.2.4
#
# WARNING! All changes made in this file will be lost!
Expand Down Expand Up @@ -42,10 +42,11 @@ def setupUi(self, Base):
self.file_table.setDefaultDropAction(QtCore.Qt.CopyAction)
self.file_table.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
self.file_table.setHorizontalScrollMode(QtGui.QAbstractItemView.ScrollPerPixel)
self.file_table.setWordWrap(False)
self.file_table.setCornerButtonEnabled(False)
self.file_table.setColumnCount(6)
self.file_table.setColumnCount(7)
self.file_table.setObjectName("file_table")
self.file_table.setColumnCount(6)
self.file_table.setColumnCount(7)
self.file_table.setRowCount(0)
item = QtGui.QTableWidgetItem()
self.file_table.setHorizontalHeaderItem(0, item)
Expand All @@ -59,6 +60,8 @@ def setupUi(self, Base):
self.file_table.setHorizontalHeaderItem(4, item)
item = QtGui.QTableWidgetItem()
self.file_table.setHorizontalHeaderItem(5, item)
item = QtGui.QTableWidgetItem()
self.file_table.setHorizontalHeaderItem(6, item)
self.file_table.horizontalHeader().setHighlightSections(False)
self.file_table.horizontalHeader().setMinimumSectionSize(22)
self.file_table.horizontalHeader().setSortIndicatorShown(True)
Expand Down Expand Up @@ -178,6 +181,7 @@ def setupUi(self, Base):
self.high_table.setDefaultDropAction(QtCore.Qt.CopyAction)
self.high_table.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
self.high_table.setHorizontalScrollMode(QtGui.QAbstractItemView.ScrollPerPixel)
self.high_table.setWordWrap(False)
self.high_table.setCornerButtonEnabled(False)
self.high_table.setColumnCount(7)
self.high_table.setObjectName("high_table")
Expand Down Expand Up @@ -244,8 +248,9 @@ def retranslateUi(self, Base):
self.file_table.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("Base", "Author", None, QtGui.QApplication.UnicodeUTF8))
self.file_table.horizontalHeaderItem(2).setText(QtGui.QApplication.translate("Base", "Type", None, QtGui.QApplication.UnicodeUTF8))
self.file_table.horizontalHeaderItem(3).setText(QtGui.QApplication.translate("Base", "Percent", None, QtGui.QApplication.UnicodeUTF8))
self.file_table.horizontalHeaderItem(4).setText(QtGui.QApplication.translate("Base", "Modified", None, QtGui.QApplication.UnicodeUTF8))
self.file_table.horizontalHeaderItem(5).setText(QtGui.QApplication.translate("Base", "Path", None, QtGui.QApplication.UnicodeUTF8))
self.file_table.horizontalHeaderItem(4).setText(QtGui.QApplication.translate("Base", "Rating", None, QtGui.QApplication.UnicodeUTF8))
self.file_table.horizontalHeaderItem(5).setText(QtGui.QApplication.translate("Base", "Modified", None, QtGui.QApplication.UnicodeUTF8))
self.file_table.horizontalHeaderItem(6).setText(QtGui.QApplication.translate("Base", "Path", None, QtGui.QApplication.UnicodeUTF8))
self.fold_btn.setText(QtGui.QApplication.translate("Base", "Hide Book Info", None, QtGui.QApplication.UnicodeUTF8))
self.title_lbl.setText(QtGui.QApplication.translate("Base", "Title", None, QtGui.QApplication.UnicodeUTF8))
self.series_lbl.setText(QtGui.QApplication.translate("Base", "Series", None, QtGui.QApplication.UnicodeUTF8))
Expand All @@ -259,8 +264,8 @@ def retranslateUi(self, Base):
self.high_table.horizontalHeaderItem(1).setText(QtGui.QApplication.translate("Base", "Comment", None, QtGui.QApplication.UnicodeUTF8))
self.high_table.horizontalHeaderItem(2).setText(QtGui.QApplication.translate("Base", "Date", None, QtGui.QApplication.UnicodeUTF8))
self.high_table.horizontalHeaderItem(3).setText(QtGui.QApplication.translate("Base", "Title", None, QtGui.QApplication.UnicodeUTF8))
self.high_table.horizontalHeaderItem(4).setText(QtGui.QApplication.translate("Base", "Page", None, QtGui.QApplication.UnicodeUTF8))
self.high_table.horizontalHeaderItem(5).setText(QtGui.QApplication.translate("Base", "Author", None, QtGui.QApplication.UnicodeUTF8))
self.high_table.horizontalHeaderItem(4).setText(QtGui.QApplication.translate("Base", "Author", None, QtGui.QApplication.UnicodeUTF8))
self.high_table.horizontalHeaderItem(5).setText(QtGui.QApplication.translate("Base", "Page", None, QtGui.QApplication.UnicodeUTF8))
self.high_table.horizontalHeaderItem(6).setText(QtGui.QApplication.translate("Base", "Book path", None, QtGui.QApplication.UnicodeUTF8))
self.act_english.setText(QtGui.QApplication.translate("Base", "English", None, QtGui.QApplication.UnicodeUTF8))
self.act_greek.setText(QtGui.QApplication.translate("Base", "Greek", None, QtGui.QApplication.UnicodeUTF8))
Expand Down
Loading

0 comments on commit 28a4248

Please sign in to comment.