From 2b29f9f57bb3a30da8fc1cd6f40dcbe75f27b6af Mon Sep 17 00:00:00 2001 From: "beville@gmail.com" Date: Fri, 23 Nov 2012 22:05:56 +0000 Subject: [PATCH] Tweaked the OptionalMessageDialog usage git-svn-id: http://comictagger.googlecode.com/svn/trunk@80 6c5673fe-1810-88d6-992b-cd32ca31540c --- comicarchive.py | 3 ++- optionalmsgdialog.py | 7 +++++++ settings.py | 8 +++++--- taggerwindow.py | 23 ++++++++++++----------- todo.txt | 5 ++--- 5 files changed, 28 insertions(+), 18 deletions(-) diff --git a/comicarchive.py b/comicarchive.py index 10e3cd0..86bc415 100644 --- a/comicarchive.py +++ b/comicarchive.py @@ -24,6 +24,7 @@ import struct import sys import tempfile import subprocess +import _subprocess import platform import time @@ -174,7 +175,7 @@ class RarArchiver: # windows only, keeps the cmd.exe from popping up if platform.system() == "Windows": self.startupinfo = subprocess.STARTUPINFO() - self.startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW + self.startupinfo.dwFlags |= _subprocess.STARTF_USESHOWWINDOW else: self.startupinfo = None diff --git a/optionalmsgdialog.py b/optionalmsgdialog.py index 442ceb1..c456e98 100644 --- a/optionalmsgdialog.py +++ b/optionalmsgdialog.py @@ -46,8 +46,15 @@ class OptionalMessageDialog(QDialog): self.was_accepted = False l = QVBoxLayout( self ) + self.theLabel = QLabel( msg ) + self.theLabel.setWordWrap(True) + self.theLabel.setWordWrap(True) + self.theLabel.setTextFormat( Qt.RichText ) + self.theLabel.setTextInteractionFlags( Qt.LinksAccessibleByMouse | Qt.LinksAccessibleByKeyboard ) + l.addWidget( self.theLabel ) + l.insertSpacing ( -1, 10 ) if check_text is None: if style == StyleQuestion: diff --git a/settings.py b/settings.py index ee1e3a6..03ccbf9 100644 --- a/settings.py +++ b/settings.py @@ -38,7 +38,7 @@ class ComicTaggerSettings: # automatic settings last_selected_data_style = 0 - last_opened_folder = None + last_opened_folder = "" last_main_window_width = 0 last_main_window_height = 0 last_main_window_x = 0 @@ -116,8 +116,10 @@ class ComicTaggerSettings: self.rar_exe_path = self.config.get( 'settings', 'rar_exe_path' ) self.unrar_exe_path = self.config.get( 'settings', 'unrar_exe_path' ) - self.last_selected_data_style = self.config.getint( 'auto', 'last_selected_data_style' ) - self.last_opened_folder = self.config.get( 'auto', 'last_opened_folder' ) + if self.config.has_option('auto', 'last_selected_data_style'): + self.last_selected_data_style = self.config.getint( 'auto', 'last_selected_data_style' ) + if self.config.has_option('auto', 'last_opened_folder'): + self.last_opened_folder = self.config.get( 'auto', 'last_opened_folder' ) if self.config.has_option('auto', 'last_main_window_width'): self.last_main_window_width = self.config.getint( 'auto', 'last_main_window_width' ) if self.config.has_option('auto', 'last_main_window_height'): diff --git a/taggerwindow.py b/taggerwindow.py index 2c66fb4..3de9536 100644 --- a/taggerwindow.py +++ b/taggerwindow.py @@ -136,11 +136,11 @@ class TaggerWindow( QtGui.QMainWindow): if self.settings.show_disclaimer: checked = OptionalMessageDialog.msg( self, "Disclaimer", - "Thanks for trying Comic Tagger!\n\n" + - "Be aware that is beta-level software, and the developers\n" + - "of this program can take no responsibility for any loss of data due\n" + - "to its use.\n\n" + - "That said, have fun!\n", + "Thanks for trying Comic Tagger!

" + + "Be aware that this is beta-level software, and the developers " + + "of this program can take no responsibility for any loss of data due " + + "to its use.

" + + "That said, have fun!", ) self.settings.show_disclaimer = not checked @@ -771,12 +771,13 @@ class TaggerWindow( QtGui.QMainWindow): if self.comic_archive.isRar() and self.data_style == MetaDataStyle.CBI: if self.settings.ask_about_cbi_in_rar: answered_yes, checked = OptionalMessageDialog.question( self, "RAR and ComicBookLover", - "You are about to write a CBL tag block to a RAR archive!\n\n" + - "While technically possible, no known reader can read those tags from RAR\n" + - "yet. If you would like this feature from ComicBookLover, please go their\n" + - "forums and add a feature request!\n\n" + - "http://forums.comicbooklover.com/categories/ipad-features\n\n" + - "Do you want to continue with the save?\n", + "You are about to write a CBL tag block to a RAR archive!

" + + "While technically possible, no known reader can read those tags from RAR " + + "yet. If you would like this feature from ComicBookLover, please go their " + + "forums and add a feature request!

" + + "" + + "http://forums.comicbooklover.com/categories/ipad-features/

" + + "Do you want to continue with the save?", ) self.settings.ask_about_cbi_in_rar = not checked if not answered_yes: diff --git a/todo.txt b/todo.txt index 92712a8..b6933da 100644 --- a/todo.txt +++ b/todo.txt @@ -5,10 +5,9 @@ General Setting Tab: Add Settings Reset - may require restart Add setting to dis-allow writing CBI to RAR - +Use QT Config Dialog?? + Optional dialog - maybe move to a UI file - add wordwrap, maybe some spacing in there, maybe center? Make URL clickable Fix about graphics