Skip to content

Commit

Permalink
Changing the display mode of the "Ukraine info" message to the comman…
Browse files Browse the repository at this point in the history
…d line option (opt-in).
  • Loading branch information
Bertrand256 committed Mar 29, 2023
1 parent 4971b98 commit bfe6498
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
1 change: 1 addition & 0 deletions electrum_dash/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -1207,6 +1207,7 @@ def get_parser():
parser_gui.add_argument("-m", action="store_true", dest="hide_gui", default=False, help="hide GUI on startup")
parser_gui.add_argument("-L", "--lang", dest="language", default=None, help="default language used in GUI")
parser_gui.add_argument("--daemon", action="store_true", dest="daemon", default=False, help="keep daemon running after GUI is closed")
parser_gui.add_argument("--ukraine-info", action="store_true", dest="ukraine_info", default=False, help="show 'Ukraine banner' on startup")
add_wallet_option(parser_gui)
add_network_options(parser_gui)
add_global_options(parser_gui)
Expand Down
10 changes: 7 additions & 3 deletions electrum_dash/gui/qt/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import sys
import traceback
import threading
import re
from typing import Optional, TYPE_CHECKING, List


Expand Down Expand Up @@ -74,8 +75,10 @@ def __init__(self, windows):
def eventFilter(self, obj, event):
if event.type() == QtCore.QEvent.FileOpen:
if len(self.windows) >= 1:
self.windows[0].pay_to_URI(event.url().toString())
return True
url = event.url().toString()
if not re.match('^file://.*pydevd.py$', url):
self.windows[0].pay_to_URI(url)
return True
return False


Expand Down Expand Up @@ -277,7 +280,8 @@ def _create_window_for_wallet(self, wallet):
w = ElectrumWindow(self, wallet)
self.windows.append(w)
self.build_tray_menu()
w.ukraine_info()
if self.config.ukraine_info:
w.ukraine_info()
w.warn_if_testnet()
w.warn_if_watching_only()
return w
Expand Down
8 changes: 6 additions & 2 deletions electrum_dash/gui/qt/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,10 @@ def init_geometry(self):
self.setGeometry(100, 100, 840, 400)

def watching_only_changed(self):
name = "Dash Electrum | Glory to Ukraine | Slava Ukraini! | "
if not self.config.ukraine_info:
name = "Dash Electrum"
else:
name = "Dash Electrum | Glory to Ukraine | Slava Ukraini! | "
if constants.net.TESTNET:
name += " " + constants.net.NET_NAME.capitalize()
title = '%s %s - %s' % (name, ELECTRUM_VERSION,
Expand Down Expand Up @@ -954,7 +957,8 @@ def add_toggle_action(view_menu, tab):
run_hook('init_menubar_tools', self, tools_menu)

help_menu = menubar.addMenu(_("&Help"))
help_menu.addAction('Help Ukraine', self.ukraine_info)
if self.config.ukraine_info:
help_menu.addAction('Help Ukraine', self.ukraine_info)
help_menu.addAction(_("&About"), self.show_about)
help_menu.addAction(_("&Check for updates"), self.show_update_check)
help_menu.addAction(_("&Official website"), lambda: webopen("https://electrum.dash.org"))
Expand Down
2 changes: 2 additions & 0 deletions electrum_dash/simple_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ def __init__(self, options=None, read_user_config_function=None,
self.decimal_point = DECIMAL_POINT_DEFAULT
self.num_zeros = int(self.get('num_zeros', 8))

self.ukraine_info = self.get('ukraine_info', False) # change the 'Ukraine info' banner to opt-in

def electrum_path(self):
# Read electrum_path from command line
# Otherwise use the user's default data directory.
Expand Down
4 changes: 2 additions & 2 deletions electrum_dash/version.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import re


ELECTRUM_VERSION = '4.1.6.7' # version of the client package
APK_VERSION = '4.1.6.7' # read by buildozer.spec
ELECTRUM_VERSION = '4.1.7.0' # version of the client package
APK_VERSION = '4.1.7.0' # read by buildozer.spec

PROTOCOL_VERSION = '1.4.2' # protocol version requested

Expand Down

0 comments on commit bfe6498

Please sign in to comment.