diff --git a/base/qt/app.py b/base/qt/app.py
index 69d23f56..0631bb06 100644
--- a/base/qt/app.py
+++ b/base/qt/app.py
@@ -7,6 +7,8 @@
# which should be included with this package. The terms are also available at
# http://www.hardcoded.net/licenses/hs_license
+from __future__ import unicode_literals
+
import logging
import os.path as op
@@ -54,6 +56,8 @@ class DupeGuru(DupeGuruBase, QObject):
def __init__(self, data_module, appid):
appdata = unicode(QDesktopServices.storageLocation(QDesktopServices.DataLocation))
+ # For basicConfig() to work, we have to be sure that no logging has taken place before this call.
+ logging.basicConfig(filename=op.join(appdata, 'debug.log'), level=logging.WARNING)
DupeGuruBase.__init__(self, data_module, appdata, appid)
QObject.__init__(self)
self._setup()
@@ -169,6 +173,11 @@ class DupeGuru(DupeGuruBase, QObject):
self.results.mark_none()
self.emit(SIGNAL('dupeMarkingChanged()'))
+ def openDebugLog(self):
+ debugLogPath = op.join(self.appdata, 'debug.log')
+ url = QUrl.fromLocalFile(debugLogPath)
+ QDesktopServices.openUrl(url)
+
def open_selected(self):
if self.selected_dupe is None:
return
diff --git a/base/qt/gen.py b/base/qt/gen.py
deleted file mode 100644
index cb1c2de7..00000000
--- a/base/qt/gen.py
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/usr/bin/env python
-# Created By: Virgil Dupras
-# Created On: 2009-05-22
-# $Id$
-# Copyright 2009 Hardcoded Software (http://www.hardcoded.net)
-#
-# This software is licensed under the "HS" License as described in the "LICENSE" file,
-# which should be included with this package. The terms are also available at
-# http://www.hardcoded.net/licenses/hs_license
-
-import os
-import sys
-
-def print_and_do(cmd):
- print cmd
- os.system(cmd)
-
-print_and_do("pyuic4 main_window.ui > main_window_ui.py")
-print_and_do("pyuic4 directories_dialog.ui > directories_dialog_ui.py")
-print_and_do("pyuic4 about_box.ui > about_box_ui.py")
-print_and_do("pyuic4 reg_submit_dialog.ui > reg_submit_dialog_ui.py")
-print_and_do("pyuic4 reg_demo_dialog.ui > reg_demo_dialog_ui.py")
-print_and_do("pyuic4 error_report_dialog.ui > error_report_dialog_ui.py")
-print_and_do("pyrcc4 dg.qrc > dg_rc.py")
\ No newline at end of file
diff --git a/base/qt/main_window.py b/base/qt/main_window.py
index a6442b9c..c19416e7 100644
--- a/base/qt/main_window.py
+++ b/base/qt/main_window.py
@@ -230,6 +230,9 @@ class MainWindow(QMainWindow, Ui_MainWindow):
def moveTriggered(self):
self.app.copy_or_move_marked(False)
+ def openDebugLogTriggered(self):
+ self.app.openDebugLog()
+
def openTriggered(self):
self.app.open_selected()
diff --git a/base/qt/main_window.ui b/base/qt/main_window.ui
index 8d949c2f..cb34d01f 100644
--- a/base/qt/main_window.ui
+++ b/base/qt/main_window.ui
@@ -113,6 +113,7 @@
+
@@ -898,6 +904,22 @@
+
+ actionOpenDebugLog
+ triggered()
+ MainWindow
+ openDebugLogTriggered()
+
+
+ -1
+ -1
+
+
+ 314
+ 256
+
+
+
directoriesTriggered()
@@ -930,5 +952,6 @@
registerTrigerred()
checkForUpdateTriggered()
exportTriggered()
+ openDebugLogTriggered()
diff --git a/base/qt/platform.py b/base/qt/platform.py
index c0668794..98e612b7 100644
--- a/base/qt/platform.py
+++ b/base/qt/platform.py
@@ -14,4 +14,4 @@ import sys
if sys.platform == 'win32':
from platform_win import *
else:
- logging.warning("Unsupported Platform!!")
\ No newline at end of file
+ pass # unsupported platform