Skip to content

Commit

Permalink
Rename and reorder a few methods
Browse files Browse the repository at this point in the history
  • Loading branch information
flavioamieiro committed Mar 14, 2010
1 parent bf44e3e commit 49be869
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion dojotools.py
Expand Up @@ -111,7 +111,7 @@ def run_command(self, test_cmd):
output += process.stderr.read()
status = process.wait()

self.ui._show_command_results(status, output)
self.ui.show_command_results(status, output)

def check(self):
"""
Expand Down
24 changes: 12 additions & 12 deletions ui.py
Expand Up @@ -53,7 +53,7 @@ def _create_menu(self):

self.status_icon.connect('popup-menu', self.show_menu, self.menu)

def show_menu(self, widget, button, time, data):
def _show_menu(self, widget, button, time, data):
data.show_all()
data.popup(None, None, None, button, time)

Expand All @@ -62,7 +62,15 @@ def _set_icon(self):
PASS_ICON if self.current_status == 0 else FAIL_ICON
)

def _warn_time_is_up(self):
def pause_timer(self, widget=None):
self.status_icon.set_from_stock(gtk.STOCK_MEDIA_PAUSE)
self.timer.pause()

def start_timer(self, widget=None):
self._set_icon()
self.timer.start()

def warn_time_is_up(self):
"""Shows a dialog warning the pilot that his time is up"""
dialog = gtk.Dialog('Dojotools', buttons=(gtk.STOCK_OK, 0))
dialog.set_default_size(180, 120)
Expand All @@ -72,7 +80,7 @@ def _warn_time_is_up(self):
dialog.run()
dialog.destroy()

def _show_command_results(self, status, output):
def show_command_results(self, status, output):
"""
Shows the output to the users.
Expand Down Expand Up @@ -113,15 +121,7 @@ def update_timer(self):
self.status_icon.set_tooltip(time_str)
else:
self.pause_timer()
self._warn_time_is_up()
self.warn_time_is_up()
self.start_timer()

return True

def pause_timer(self, widget=None):
self.status_icon.set_from_stock(gtk.STOCK_MEDIA_PAUSE)
self.timer.pause()

def start_timer(self, widget=None):
self._set_icon()
self.timer.start()

0 comments on commit 49be869

Please sign in to comment.