@@ -1517,7 +1517,13 @@ def click_actionManageKeys(self):
1517
1517
1518
1518
# menu button 'delete all treshed messages'
1519
1519
def click_actionDeleteAllTrashedMessages (self ):
1520
- if QtWidgets .QMessageBox .question (self , _translate ("MainWindow" , "Delete trash?" ), _translate ("MainWindow" , "Are you sure you want to delete all trashed messages?" ), QtWidgets .QMessageBox .Yes , QtWidgets .QMessageBox .No ) == QtWidgets .QMessageBox .No :
1520
+ if QtWidgets .QMessageBox .question (
1521
+ self , _translate ("MainWindow" , "Delete trash?" ),
1522
+ _translate (
1523
+ "MainWindow" ,
1524
+ "Are you sure you want to delete all trashed messages?"
1525
+ ), QtWidgets .QMessageBox .Yes , QtWidgets .QMessageBox .No
1526
+ ) == QtWidgets .QMessageBox .No :
1521
1527
return
1522
1528
sqlStoredProcedure ('deleteandvacuume' )
1523
1529
self .rerenderTabTreeMessages ()
@@ -2008,15 +2014,15 @@ def click_pushButtonSend(self):
2008
2014
toAddress = acct .toAddress
2009
2015
else :
2010
2016
if QtWidgets .QMessageBox .question (
2011
- self , "Sending an email?" ,
2012
- _translate (
2013
- "MainWindow" ,
2014
- "You are trying to send an email"
2015
- " instead of a bitmessage. This"
2016
- " requires registering with a"
2017
- " gateway. Attempt to register?"
2018
- ), QtWidgets .QMessageBox .Yes
2019
- | QtWidgets .QMessageBox .No
2017
+ self , "Sending an email?" ,
2018
+ _translate (
2019
+ "MainWindow" ,
2020
+ "You are trying to send an email"
2021
+ " instead of a bitmessage. This"
2022
+ " requires registering with a"
2023
+ " gateway. Attempt to register?"
2024
+ ), QtWidgets .QMessageBox .Yes |
2025
+ QtWidgets .QMessageBox .No
2020
2026
) != QtWidgets .QMessageBox .Yes :
2021
2027
continue
2022
2028
email = acct .getLabel ()
@@ -2434,9 +2440,9 @@ def displayNewInboxMessage(
2434
2440
sound .SOUND_UNKNOWN
2435
2441
)
2436
2442
if self .getCurrentAccount () is not None and (
2437
- (self .getCurrentFolder (treeWidget ) != "inbox"
2438
- and self .getCurrentFolder (treeWidget ) is not None )
2439
- or self .getCurrentAccount (treeWidget ) != acct .address ):
2443
+ (self .getCurrentFolder (treeWidget ) != "inbox" and
2444
+ self .getCurrentFolder (treeWidget ) is not None ) or
2445
+ self .getCurrentAccount (treeWidget ) != acct .address ):
2440
2446
# Ubuntu should notify of new message irespective of
2441
2447
# whether it's in current message list or not
2442
2448
self .indicatorUpdate (True , to_label = acct .toLabel )
@@ -3436,10 +3442,9 @@ def on_action_InboxSaveMessageAs(self):
3436
3442
3437
3443
defaultFilename = "" .join (
3438
3444
x for x in subjectAtCurrentInboxRow if x .isalnum ()) + '.txt'
3439
- filename , filetype = QtWidgets .QFileDialog .getSaveFileName (
3445
+ filename = QtWidgets .QFileDialog .getSaveFileName (
3440
3446
self , _translate ("MainWindow" , "Save As..." ), defaultFilename ,
3441
- "Text files (*.txt);;All files (*.*)"
3442
- )
3447
+ "Text files (*.txt);;All files (*.*)" )[0 ]
3443
3448
if not filename :
3444
3449
return
3445
3450
try :
@@ -3922,8 +3927,8 @@ def on_action_ClipboardMessagelist(self):
3922
3927
account = accountClass (myAddress )
3923
3928
if isinstance (account , GatewayAccount ) \
3924
3929
and otherAddress == account .relayAddress and (
3925
- (currentColumn in (0 , 2 ) and currentFolder == "sent" )
3926
- or (currentColumn in (1 , 2 ) and currentFolder != "sent" )):
3930
+ (currentColumn in (0 , 2 ) and currentFolder == "sent" ) or
3931
+ (currentColumn in (1 , 2 ) and currentFolder != "sent" )):
3927
3932
text = tableWidget .item (currentRow , currentColumn ).label
3928
3933
else :
3929
3934
text = tableWidget .item (currentRow , currentColumn ).data (QtCore .Qt .UserRole )
@@ -3983,10 +3988,9 @@ def setAvatar(self, addressAtCurrentRow):
3983
3988
current_files += [upper ]
3984
3989
filters [0 :0 ] = ['Image files (' + ' ' .join (all_images_filter ) + ')' ]
3985
3990
filters [1 :1 ] = ['All files (*.*)' ]
3986
- sourcefile , filetype = QtWidgets .QFileDialog .getOpenFileName (
3991
+ sourcefile = QtWidgets .QFileDialog .getOpenFileName (
3987
3992
self , _translate ("MainWindow" , "Set avatar..." ),
3988
- filter = ';;' .join (filters )
3989
- )
3993
+ filter = ';;' .join (filters ))[0 ]
3990
3994
# determine the correct filename (note that avatars don't use the suffix)
3991
3995
destination = state .appdata + 'avatars/' + hash + '.' + sourcefile .split ('.' )[- 1 ]
3992
3996
exists = QtCore .QFile .exists (destination )
@@ -4051,10 +4055,10 @@ def setAddressSound(self, addr):
4051
4055
"MainWindow" , "Sound files (%s)" %
4052
4056
' ' .join (['*%s%s' % (os .extsep , ext ) for ext in sound .extensions ])
4053
4057
))]
4054
- sourcefile , filetype = QtWidgets .QFileDialog .getOpenFileName (
4058
+ sourcefile = QtWidgets .QFileDialog .getOpenFileName (
4055
4059
self , _translate ("MainWindow" , "Set notification sound..." ),
4056
4060
filter = ';;' .join (filters )
4057
- )
4061
+ )[ 0 ]
4058
4062
4059
4063
if not sourcefile :
4060
4064
return
0 commit comments