@@ -147,7 +147,7 @@ def chooseDevice(self, devices):
147147 deviceStr = dialog .chosenDeviceStr ()
148148 return HidTransport ([deviceStr , None ])
149149
150- def showGui (trezor , settings , fileMap , logger , feedback ):
150+ def showGui (trezor , settings , fileMap , logger ):
151151 """
152152 Initialize, ask for encrypt/decrypt options,
153153 ask for files to be decrypted/encrypted,
@@ -161,27 +161,20 @@ def showGui(trezor, settings, fileMap, logger, feedback):
161161 items selected in GUI
162162 """
163163 dialog = Dialog (trezor , settings , fileMap , logger )
164- settings .guiExists = True
165164 settings .settings2Gui (dialog , trezor )
166- if settings .logger .getEffectiveLevel () <= logging .INFO :
167- dialog .appendDescription ("<br>Trezor label: " + trezor .features .label )
168- if settings .WArg and settings .logger .getEffectiveLevel () <= logging .WARN :
169- dialog .appendDescription ("<br>Warning: The option `--wipe` is set. Plaintext files will "
170- "be shredded after encryption. Abort if you are uncertain or don't understand." )
165+ processing .reportLogging ("Trezor label: %s" % trezor .features .label , logging .INFO ,
166+ "Trezor IO" , settings , logger , dialog )
171167 if not dialog .exec_ ():
172- settings .guiExists = False
173168 processing .reportLogging ("Shutting down due to user request "
174169 "(Done/Quit was called)." , logging .DEBUG ,
175- "GUI IO" , settings , logger )
170+ "GUI IO" , settings , logger , None )
176171 sys .exit (4 ) # Esc or exception
177- settings .guiExists = False
178172 settings .gui2Settings (dialog ,trezor )
179173
180174# root
181175
182176logging .basicConfig (stream = sys .stderr , level = basics .LOGGINGLEVEL )
183177logger = logging .getLogger ('tsfe' )
184- feedback = processing .Feedback ()
185178
186179app = QtGui .QApplication (sys .argv )
187180
@@ -204,20 +197,27 @@ def showGui(trezor, settings, fileMap, logger, feedback):
204197
205198trezor .clear_session ()
206199
207- if settings .TArg :
208- logger .info ("Trezor label: %s" , trezor .features .label )
209-
210200fileMap = file_map .FileMap (trezor ,logger )
211201
212202# if everything is specified in the command line then do not call the GUI
213203if ((settings .PArg is None ) or (len (settings .inputFiles ) <= 0 )) and (not settings .TArg ):
214204 # something was not specified, so we call the GUI
215- showGui (trezor , settings , fileMap , logger , feedback )
205+ showGui (trezor , settings , fileMap , logger )
216206else :
217- logger .info ("Everything was specified or --terminal was set, "
218- "hence the GUI will not be called." )
207+ processing .reportLogging ("Trezor label: %s" % trezor .features .label , logging .INFO ,
208+ "Trezor IO" , settings , logger , None )
209+ processing .reportLogging ("Everything was specified or --terminal was set, "
210+ "hence the GUI will not be called." , logging .INFO ,
211+ "Trezor IO" , settings , logger , None )
212+ if settings .WArg :
213+ processing .reportLogging ("The option `--wipe` is set. In case of "
214+ "encryption, the original plaintext files will "
215+ "be shredded after encryption. In case of decryption, "
216+ "the encrypted files will be shredded after decryption. "
217+ "Abort if you are uncertain or don't understand." , logging .WARNING ,
218+ "Dangerous arguments" , settings , logger , None )
219219 if settings .PArg is not None :
220220 trezor .prefillPassphrase (settings .PArg )
221221
222- processing .processAll (trezor , settings , fileMap , logger , feedback )
222+ processing .processAll (trezor , settings , fileMap , logger , dialog = None )
223223 sys .exit (0 )
0 commit comments