Added SimpleConfig class to deal with simple config options added for fallback to other gui when missing deps
This commit is contained in:
11
electrum
11
electrum
@@ -40,8 +40,9 @@ try:
|
||||
from lib import Wallet, WalletSynchronizer, format_satoshis, mnemonic, prompt_password
|
||||
except ImportError:
|
||||
from electrum import Wallet, WalletSynchronizer, format_satoshis, mnemonic, prompt_password
|
||||
|
||||
|
||||
from decimal import Decimal
|
||||
from lib import SimpleConfig
|
||||
|
||||
known_commands = {
|
||||
'help':'Prints this help',
|
||||
@@ -101,9 +102,12 @@ protected_commands = ['payto', 'password', 'mktx', 'seed', 'import','signmessage
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
# Load simple config class
|
||||
simple_config = SimpleConfig()
|
||||
|
||||
usage = "usage: %prog [options] command\nCommands: "+ (', '.join(known_commands))
|
||||
parser = optparse.OptionParser(prog=usage)
|
||||
parser.add_option("-g", "--gui", dest="gui", default="lite", help="gui")
|
||||
parser.add_option("-g", "--gui", dest="gui", default=simple_config.config["gui"], help="gui")
|
||||
parser.add_option("-w", "--wallet", dest="wallet_path", help="wallet path (default: electrum.dat)")
|
||||
parser.add_option("-o", "--offline", action="store_true", dest="offline", default=False, help="remain offline")
|
||||
parser.add_option("-a", "--all", action="store_true", dest="show_all", default=False, help="show all addresses")
|
||||
@@ -115,6 +119,7 @@ if __name__ == '__main__':
|
||||
parser.add_option("-r", "--remote", dest="remote_url", default=None, help="URL of a remote wallet")
|
||||
options, args = parser.parse_args()
|
||||
|
||||
|
||||
wallet = Wallet()
|
||||
wallet.set_path(options.wallet_path)
|
||||
wallet.read()
|
||||
@@ -161,6 +166,8 @@ if __name__ == '__main__':
|
||||
error_message = QErrorMessage()
|
||||
error_message.setFixedSize(350,200)
|
||||
error_message.showMessage("<p>Sorry, the Electrum 'Lite GUI' requires Qt >= 4.7 to run. The pro GUI will be started instead.</p><p>Check your distributions packages for upgrades.</p>")
|
||||
simple_config.config["gui"] = "qt"
|
||||
simple_config.save_config
|
||||
app.exec_()
|
||||
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user