Skip to content

Commit

Permalink
- only allow one message at a time
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaac authored and Isaac committed Dec 23, 2013
1 parent ec15b0f commit da20164
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions ThemeScheduler.py
Expand Up @@ -79,8 +79,14 @@ def translate_time(t):


def blocking_message(msg):
if ThemeScheduler.dialog_open:
print("Dialog already open!")
print(msg)
return
ThemeScheduler.dialog_open = True
sublime.ok_cancel_dialog(msg)
ThemeScheduler.update = True
ThemeScheduler.dialog_open = False


class ThemeSchedulerGetNextChangeCommand(sublime_plugin.ApplicationCommand):
Expand Down Expand Up @@ -114,6 +120,14 @@ class ThemeScheduler(object):
update = False
current_time = None
set_safe = False
dialog_open = False

@classmethod
def reset_msg_state(cls):
"""
Reset teh current state of dialogs
"""
cls.dialog_open = False

@classmethod
def init(cls, set_safe=False):
Expand Down Expand Up @@ -387,6 +401,7 @@ def tweak_loaded():

def load_plugin(retries):
global SETTINGS
ThemeScheduler.reset_msg_state()

if tweak_loaded() or retries == 0:
log("ThemeScheduler: Loading...")
Expand Down

0 comments on commit da20164

Please sign in to comment.