Got settings reset working

git-svn-id: http://comictagger.googlecode.com/svn/trunk@86 6c5673fe-1810-88d6-992b-cd32ca31540c
This commit is contained in:
beville@gmail.com 2012-11-24 18:17:35 +00:00
parent c7dabd6a7e
commit 9ecb67e3a6
4 changed files with 52 additions and 41 deletions

View File

@ -28,31 +28,6 @@ import utils
class ComicTaggerSettings:
settings_file = ""
folder = ""
# General Settings
rar_exe_path = ""
unrar_exe_path = ""
allow_cbi_in_rar = True
# automatic settings
last_selected_data_style = 0
last_opened_folder = ""
last_main_window_width = 0
last_main_window_height = 0
last_main_window_x = 0
last_main_window_y = 0
# identifier settings
id_length_delta_thresh = 5
id_publisher_blacklist = "Panini Comics, Abril, Scholastic Book Services"
# Show/ask dialog flags
ask_about_cbi_in_rar = True
show_disclaimer = True
@staticmethod
def getSettingsFolder():
if platform.system() == "Windows":
@ -69,9 +44,35 @@ class ComicTaggerSettings:
else:
return os.path.dirname(__file__)
def setDefaultValues( self ):
# General Settings
self.rar_exe_path = ""
self.unrar_exe_path = ""
self.allow_cbi_in_rar = True
# automatic settings
self.last_selected_data_style = 0
self.last_opened_folder = ""
self.last_main_window_width = 0
self.last_main_window_height = 0
self.last_main_window_x = 0
self.last_main_window_y = 0
# identifier settings
self.id_length_delta_thresh = 5
self.id_publisher_blacklist = "Panini Comics, Abril, Scholastic Book Services"
# Show/ask dialog flags
self.ask_about_cbi_in_rar = True
self.show_disclaimer = True
def __init__(self):
self.settings_file = ""
self.folder = ""
self.setDefaultValues()
self.config = ConfigParser.RawConfigParser()
self.folder = ComicTaggerSettings.getSettingsFolder()

View File

@ -70,17 +70,21 @@ class SettingsWindow(QtGui.QDialog):
elif platform.system() == "Darwin":
self.lblRarHelp.setText( macRarHelp )
# Copy values from settings to form
self.leRarExePath.setText( self.settings.rar_exe_path )
self.leUnrarExePath.setText( self.settings.unrar_exe_path )
self.leNameLengthDeltaThresh.setText( str(self.settings.id_length_delta_thresh) )
self.tePublisherBlacklist.setPlainText( self.settings.id_publisher_blacklist )
self.settingsToForm()
self.btnBrowseRar.clicked.connect(self.selectRar)
self.btnBrowseUnrar.clicked.connect(self.selectUnrar)
self.btnClearCache.clicked.connect(self.clearCache)
self.btnResetSettings.clicked.connect(self.resetSettings)
def settingsToForm( self ):
# Copy values from settings to form
self.leRarExePath.setText( self.settings.rar_exe_path )
self.leUnrarExePath.setText( self.settings.unrar_exe_path )
self.leNameLengthDeltaThresh.setText( str(self.settings.id_length_delta_thresh) )
self.tePublisherBlacklist.setPlainText( self.settings.id_publisher_blacklist )
def accept( self ):
# Copy values from form to settings and save
@ -113,7 +117,8 @@ class SettingsWindow(QtGui.QDialog):
def resetSettings( self ):
self.settings.reset()
print "ATB reset setting!!"
self.settingsToForm()
QtGui.QMessageBox.information(self,"Settings", "Settings have been returned to default values.")
def selectFile( self, control, name ):

View File

@ -976,7 +976,7 @@ class TaggerWindow( QtGui.QMainWindow):
self.setDirtyFlag()
def showSettings( self ):
settingswin = SettingsWindow( self, self.settings )
settingswin.setModal(True)
settingswin.exec_()

View File

@ -1,14 +1,14 @@
-----------------------------------------------------
Features
-----------------------------------------------------
General Setting Tab:
Add Settings Reset - may require restart
Add setting to dis-allow writing CBI to RAR
CLI
explicit metadata settings option format
-- figure out how to add credits,tags
-- delete tags, credits
Use QT Config Dialog??
Optional dialog
Make URL clickable
Credit overlay:
Just add non-dupes
Create a credit list class to manage
Fix about graphics
@ -16,13 +16,16 @@ Style sheets for windows/mac/linux
-----------------------------------------------------
Bugs
-----------------------------------------------------
Comma in Credits in CIX
Windows zip and rar: set proper path for writing to archive
set working dir for sys calls
SERIOUS BUG: rebuilding zips!
http://stackoverflow.com/questions/11578443/trigger-io-errno-18-cross-device-link
Frozen apps better finding of resource files
Frozen apps: better finding of resource files
OSX
weird unrar complaints
@ -76,7 +79,9 @@ Archive function to detect tag blocks out of sync
app tour?
Settings
Add setting to dis-allow writing CBI to RAR
Overwrite or overlay
----------------------------------------------