Skip to content

Commit

Permalink
Merge pull request #104 from macarooni-man/dev
Browse files Browse the repository at this point in the history
More v2.2.4 fixes
  • Loading branch information
macarooni-man authored Nov 14, 2024
2 parents a4bfcf1 + cf70bfa commit 1a6876a
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
1 change: 1 addition & 0 deletions source/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -5945,6 +5945,7 @@ def _init_defaults():
defaults.locale = None
defaults.sponsor_reminder = None
defaults.discord_presence = True
defaults.prompt_feedback = True
defaults.telepath_settings = {
'enable-api': False,
'api-host': "0.0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion source/locales.json

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions source/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -8577,6 +8577,13 @@ def on_touch_down(self, touch):

# Show popup; popup_type can be "info", "warning", "query"
def show_popup(self, popup_type, title, content, callback=None, *args):

# Ignore if a pop-up is already on-screen
if self.popup_widget:
return


# If not, process pop-up
popup_types = (
"info", "warning", "query", "warning_query", "controls", "addon",
"script", "file", "error_log"
Expand Down Expand Up @@ -17493,6 +17500,29 @@ def start_timer(*_):
threading.Timer(0, start_timer).start()


# Show pop-up to ask user for initial user feedback
try:
if constants.app_config.prompt_feedback and constants.app_online:
constants.app_config.prompt_feedback = False

def open_feedback(*a):
url = "https://www.auto-mcs.com/feedback"
webbrowser.open_new_tab(url)

Clock.schedule_once(
functools.partial(
screen_manager.current_screen.show_popup,
"query",
"Share Your Feedback",
"Thanks for using $auto-mcs$!\n\nWhile your server is launching, please take a moment to leave us your feedback",
(None, threading.Timer(0, open_feedback).start)
),
1
)
except:
pass


# Stop server
def stop_server(self, *args):
if self.run_data:
Expand Down
2 changes: 1 addition & 1 deletion source/svrmgr.py
Original file line number Diff line number Diff line change
Expand Up @@ -2044,7 +2044,7 @@ def open_remote_server(self, name):
if constants.debug:
print(vars(self.remote_server))

return None
return bool(self.remote_server)

except AttributeError:
pass
Expand Down
3 changes: 2 additions & 1 deletion source/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,13 @@ def get_versions(*a):

# Check for network changes in the background
connect_counter += 1
if (connect_counter == 10 and not constants.app_online) or (connect_counter == 60 and constants.app_online):
if (connect_counter == 10 and not constants.app_online) or (connect_counter == 3600 and constants.app_online):
try:
constants.check_app_updates()
except Exception as e:
if constants.debug:
print(e)

connect_counter = 0

time.sleep(1)
Expand Down

0 comments on commit 1a6876a

Please sign in to comment.