mirror of
				https://github.com/arsenetar/dupeguru.git
				synced 2025-09-11 17:58:17 +00:00 
			
		
		
		
	[#63 state:fixed] Added a "Open Debug Log" menu item in dg qt's menu.
--HG-- extra : convert_revision : svn%3Ac306627e-7827-47d3-bdf0-9a457c9553a1/trunk%40165
This commit is contained in:
		
							parent
							
								
									ff86624c3e
								
							
						
					
					
						commit
						61af22403e
					
				| @ -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 | ||||
|  | ||||
| @ -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") | ||||
| @ -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() | ||||
|      | ||||
|  | ||||
| @ -113,6 +113,7 @@ | ||||
|     <addaction name="actionShowHelp"/> | ||||
|     <addaction name="actionRegister"/> | ||||
|     <addaction name="actionCheckForUpdate"/> | ||||
|     <addaction name="actionOpenDebugLog"/> | ||||
|     <addaction name="actionAbout"/> | ||||
|    </widget> | ||||
|    <widget class="QMenu" name="menuFile"> | ||||
| @ -422,6 +423,11 @@ | ||||
|     <string>Export To XHTML</string> | ||||
|    </property> | ||||
|   </action> | ||||
|   <action name="actionOpenDebugLog"> | ||||
|    <property name="text"> | ||||
|     <string>Open Debug Log</string> | ||||
|    </property> | ||||
|   </action> | ||||
|  </widget> | ||||
|  <customwidgets> | ||||
|   <customwidget> | ||||
| @ -898,6 +904,22 @@ | ||||
|     </hint> | ||||
|    </hints> | ||||
|   </connection> | ||||
|   <connection> | ||||
|    <sender>actionOpenDebugLog</sender> | ||||
|    <signal>triggered()</signal> | ||||
|    <receiver>MainWindow</receiver> | ||||
|    <slot>openDebugLogTriggered()</slot> | ||||
|    <hints> | ||||
|     <hint type="sourcelabel"> | ||||
|      <x>-1</x> | ||||
|      <y>-1</y> | ||||
|     </hint> | ||||
|     <hint type="destinationlabel"> | ||||
|      <x>314</x> | ||||
|      <y>256</y> | ||||
|     </hint> | ||||
|    </hints> | ||||
|   </connection> | ||||
|  </connections> | ||||
|  <slots> | ||||
|   <slot>directoriesTriggered()</slot> | ||||
| @ -930,5 +952,6 @@ | ||||
|   <slot>registerTrigerred()</slot> | ||||
|   <slot>checkForUpdateTriggered()</slot> | ||||
|   <slot>exportTriggered()</slot> | ||||
|   <slot>openDebugLogTriggered()</slot> | ||||
|  </slots> | ||||
| </ui> | ||||
|  | ||||
| @ -14,4 +14,4 @@ import sys | ||||
| if sys.platform == 'win32': | ||||
|     from platform_win import * | ||||
| else: | ||||
|     logging.warning("Unsupported Platform!!") | ||||
|     pass # unsupported platform | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user