#NEWLINE# def settings_dialog( self ) : #NEWLINE# #INDENT# def check_for_api_key( api_key ) : #NEWLINE# #INDENT# if ( api_key and ( len ( api_key ) > 12 ) ) : #NEWLINE# #INDENT# self . config . set_key ( 'plugin_label_api_key' , str ( self . auth_token_edit . text ( ) ) ) #NEWLINE# self . upload . setEnabled ( True ) #NEWLINE# self . download . setEnabled ( True ) #NEWLINE# self . accept . setEnabled ( True ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . upload . setEnabled ( False ) #NEWLINE# self . download . setEnabled ( False ) #NEWLINE# self . accept . setEnabled ( False ) #NEWLINE# #UNINDENT# #UNINDENT# d = QDialog ( ) #NEWLINE# layout = QGridLayout ( d ) #NEWLINE# layout . addWidget ( QLabel ( 'API Key: ' ) , 0 , 0 ) #NEWLINE# self . auth_token_edit = QLineEdit ( self . auth_token ( ) ) #NEWLINE# self . auth_token_edit . textChanged . connect ( check_for_api_key ) #NEWLINE# layout . addWidget ( QLabel ( 'Label sync options: ' ) , 2 , 0 ) #NEWLINE# layout . addWidget ( self . auth_token_edit , 0 , 1 , 1 , 2 ) #NEWLINE# decrypt_key_text = QLineEdit ( self . encode_password ) #NEWLINE# decrypt_key_text . setReadOnly ( True ) #NEWLINE# layout . addWidget ( decrypt_key_text , 1 , 1 ) #NEWLINE# layout . addWidget ( QLabel ( 'Decryption key: ' ) , 1 , 0 ) #NEWLINE# layout . addWidget ( HelpButton ( 'This key can be used on the LabElectrum website to decrypt your data in case you want to review it online.' ) , 1 , 2 ) #NEWLINE# self . upload = QPushButton ( 'Force upload' ) #NEWLINE# self . upload . clicked . connect ( self . full_push ) #NEWLINE# layout . addWidget ( self . upload , 2 , 1 ) #NEWLINE# self . download = QPushButton ( 'Force download' ) #NEWLINE# self . download . clicked . connect ( ( lambda : self . full_pull ( True ) ) ) #NEWLINE# layout . addWidget ( self . download , 2 , 2 ) #NEWLINE# c = QPushButton ( _ ( 'Cancel' ) ) #NEWLINE# c . clicked . connect ( d . reject ) #NEWLINE# self . accept = QPushButton ( _ ( 'Done' ) ) #NEWLINE# self . accept . clicked . connect ( d . accept ) #NEWLINE# layout . addWidget ( c , 3 , 1 ) #NEWLINE# layout . addWidget ( self . accept , 3 , 2 ) #NEWLINE# check_for_api_key ( self . auth_token ( ) ) #NEWLINE# if d . exec_ ( ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return False