Skip to content

Commit

Permalink
0.3.5.0 update
Browse files Browse the repository at this point in the history
  • Loading branch information
noembryo committed Oct 25, 2017
1 parent f3ba40e commit 18f4126
Show file tree
Hide file tree
Showing 9 changed files with 282 additions and 123 deletions.
38 changes: 38 additions & 0 deletions boot_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# coding=utf-8
from __future__ import (absolute_import, division, print_function, unicode_literals)

import time
import sys, os
import traceback
from os.path import dirname, join, isdir

APP_NAME = "KoHighlights"
APP_DIR = dirname(os.path.abspath(sys.argv[0]))
os.chdir(APP_DIR) # Set the current working directory to the app's directory
SETTINGS_DIR = join(os.environ['APPDATA'], APP_NAME)
os.makedirs(SETTINGS_DIR) if not isdir(SETTINGS_DIR) else None


def except_hook(class_type, value, trace_back):
""" Print the error to a log file
"""
name = join(SETTINGS_DIR, "error_log_{}.txt".format(time.strftime("%Y-%m-%d")))
with open(name, "a") as log:
log.write('\nCrash@{}\n'.format(time.strftime("%Y-%m-%d %H:%M:%S")))
traceback.print_exception(class_type, value, trace_back, file=open(name, "a"))
sys.__excepthook__(class_type, value, trace_back)


sys.excepthook = except_hook

import gzip, json

try:
with gzip.GzipFile(join(SETTINGS_DIR, 'settings.json.gz'), 'rb') as settings:
app_config = json.loads(settings.read())
except IOError: # first run
app_config = {}

FIRST_RUN = not bool(app_config)
TITLE, AUTHOR, TYPE, PERCENT, MODIFIED, PATH = range(6)
PAGE, HIGHLIGHT_TEXT, DATE, PAGE_ID, COMMENT = range(5)
13 changes: 10 additions & 3 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: Tue Sep 19 17:26:05 2017
# Created: Wed Oct 25 15:36:43 2017
# 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 @@ -73,11 +73,16 @@ def setupUi(self, About):
self.horizontalLayout = QtGui.QHBoxLayout(self.btn_box)
self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
self.horizontalLayout.setObjectName("horizontalLayout")
self.about_qt_btn = QtGui.QPushButton(self.btn_box)
self.about_qt_btn.setObjectName("about_qt_btn")
self.horizontalLayout.addWidget(self.about_qt_btn)
spacerItem = QtGui.QSpacerItem(92, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
self.updates_btn = QtGui.QPushButton(self.btn_box)
self.updates_btn.setObjectName("updates_btn")
self.horizontalLayout.addWidget(self.updates_btn)
spacerItem = QtGui.QSpacerItem(175, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem1)
self.close_btn = QtGui.QPushButton(self.btn_box)
self.close_btn.setObjectName("close_btn")
self.horizontalLayout.addWidget(self.close_btn)
Expand All @@ -92,6 +97,8 @@ 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))
self.close_btn.setText(QtGui.QApplication.translate("About", "Close", None, QtGui.QApplication.UnicodeUTF8))
Expand Down
2 changes: 1 addition & 1 deletion gui_auto_info.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_auto_info.ui'
#
# Created: Tue Sep 19 17:26:06 2017
# Created: Wed Oct 25 15:36:43 2017
# by: pyside-uic 0.2.15 running on PySide 1.2.4
#
# WARNING! All changes made in this file will be lost!
Expand Down
2 changes: 1 addition & 1 deletion 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: Tue Sep 19 17:26:05 2017
# Created: Wed Oct 25 15:36:43 2017
# by: pyside-uic 0.2.15 running on PySide 1.2.4
#
# WARNING! All changes made in this file will be lost!
Expand Down
8 changes: 6 additions & 2 deletions gui_status.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_status.ui'
#
# Created: Tue Sep 19 17:26:06 2017
# Created: Wed Oct 25 15:36:43 2017
# 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 @@ -49,17 +49,21 @@ def setupUi(self, Status):
self.act_text = QtGui.QAction(Status)
self.act_text.setCheckable(True)
self.act_text.setObjectName("act_text")
self.act_comment = QtGui.QAction(Status)
self.act_comment.setCheckable(True)
self.act_comment.setObjectName("act_comment")

self.retranslateUi(Status)
QtCore.QMetaObject.connectSlotsByName(Status)

def retranslateUi(self, Status):
self.show_items_btn.setToolTip(QtGui.QApplication.translate("Status", "Show/Hide elements of Highlights.\n"
"It also affects the saved text files.", None, QtGui.QApplication.UnicodeUTF8))
self.show_items_btn.setStatusTip(QtGui.QApplication.translate("Status", "Show/Hide elements of Highlights.\\nIt also affects the saved text files.", None, QtGui.QApplication.UnicodeUTF8))
self.show_items_btn.setStatusTip(QtGui.QApplication.translate("Status", "Show/Hide elements of Highlights. It also affects the saved text files.", None, QtGui.QApplication.UnicodeUTF8))
self.show_items_btn.setText(QtGui.QApplication.translate("Status", "Show in Highlights", None, QtGui.QApplication.UnicodeUTF8))
self.act_page.setText(QtGui.QApplication.translate("Status", "Page", None, QtGui.QApplication.UnicodeUTF8))
self.act_date.setText(QtGui.QApplication.translate("Status", "Date", None, QtGui.QApplication.UnicodeUTF8))
self.act_text.setText(QtGui.QApplication.translate("Status", "Highlight", None, QtGui.QApplication.UnicodeUTF8))
self.act_comment.setText(QtGui.QApplication.translate("Status", "Comment", None, QtGui.QApplication.UnicodeUTF8))

import images_rc
2 changes: 1 addition & 1 deletion gui_toolbar.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_toolbar.ui'
#
# Created: Tue Sep 19 17:26:06 2017
# Created: Wed Oct 25 15:36:43 2017
# by: pyside-uic 0.2.15 running on PySide 1.2.4
#
# WARNING! All changes made in this file will be lost!
Expand Down
8 changes: 4 additions & 4 deletions images_rc.py

Large diffs are not rendered by default.

Loading

0 comments on commit 18f4126

Please sign in to comment.