Browse Source

Swapped to internal pubsub framework for better cross platform support

pull/90/merge
chriskiehl 9 years ago
parent
commit
653f5b858d
6 changed files with 12 additions and 12 deletions
  1. 10
      gooey/gui/controller.py
  2. 2
      gooey/gui/windows/base_window.py
  3. 4
      gooey/gui/windows/footer.py
  4. 2
      gooey/gui/windows/header.py
  5. 2
      gooey/gui/windows/layouts.py
  6. 4
      gooey/gui/windows/sidebar.py

10
gooey/gui/controller.py

@ -8,7 +8,7 @@ import wx
import sys
import subprocess
from wx.lib.pubsub import pub
from gooey.gui.pubsub import pub
from multiprocessing.dummy import Pool
from gooey.gui import events
@ -43,7 +43,7 @@ class Controller(object):
pub.subscribe(self.on_edit, events.WINDOW_EDIT)
def on_edit(self):
pub.sendMessage(events.WINDOW_CHANGE, view_name=views.CONFIG_SCREEN)
pub.send_message(events.WINDOW_CHANGE, view_name=views.CONFIG_SCREEN)
def on_close(self):
self.core_gui.Destroy()
@ -71,7 +71,7 @@ class Controller(object):
cmd_line_args = self.core_gui.GetOptions()
command = '{0} {1}'.format(self.build_spec['target'], cmd_line_args)
pub.sendMessage(events.WINDOW_CHANGE, view_name=views.RUNNING_SCREEN)
pub.send_message(events.WINDOW_CHANGE, view_name=views.RUNNING_SCREEN)
self.run_client_code(command)
def run_client_code(self, command):
@ -90,10 +90,10 @@ class Controller(object):
def process_result(self, process):
_stdout, _stderr = process.communicate()
if process.returncode == 0:
pub.sendMessage(events.WINDOW_CHANGE, view_name=views.SUCCESS_SCREEN)
pub.send_message(events.WINDOW_CHANGE, view_name=views.SUCCESS_SCREEN)
self.success_dialog()
else:
pub.sendMessage(events.WINDOW_CHANGE, view_name=views.ERROR_SCREEN)
pub.send_message(events.WINDOW_CHANGE, view_name=views.ERROR_SCREEN)
self.error_dialog(_stderr)
def skipping_config(self):

2
gooey/gui/windows/base_window.py

@ -4,7 +4,7 @@ Created on Jan 19, 2014
'''
import wx
from wx.lib.pubsub import pub
from gooey.gui.pubsub import pub
from gooey.gui.controller import Controller
from gooey.gui.lang import i18n

4
gooey/gui/windows/footer.py

@ -7,7 +7,7 @@ Created on Dec 23, 2013
import wx
import wx.animate
from wx.lib.pubsub import pub
from gooey.gui.pubsub import pub
from gooey.gui.lang import i18n
from gooey.gui import imageutil, image_repository, events
@ -148,7 +148,7 @@ class Footer(AbstractFooter):
self.Bind(wx.EVT_BUTTON, self.dispatch_click, button)
def dispatch_click(self, event):
pub.sendMessage(str(event.GetId()))
pub.send_message(str(event.GetId()))
event.Skip()

2
gooey/gui/windows/header.py

@ -5,7 +5,7 @@ Created on Dec 23, 2013
'''
import wx
from wx.lib.pubsub import pub
from gooey.gui.pubsub import pub
from gooey.gui import imageutil, image_repository, events
from gooey.gui.util import wx_util

2
gooey/gui/windows/layouts.py

@ -1,6 +1,6 @@
from collections import OrderedDict
import wx
from wx.lib.pubsub import pub
from gooey.gui.pubsub import pub
from gooey.gui import events
from gooey.gui.windows.advanced_config import ConfigPanel

4
gooey/gui/windows/sidebar.py

@ -1,5 +1,5 @@
import wx
from wx.lib.pubsub import pub
from gooey.gui.pubsub import pub
from gooey.gui import events
from gooey.gui.util import wx_util
@ -43,5 +43,5 @@ class Sidebar(wx.Panel):
self.Bind(wx.EVT_LISTBOX, self.onClick, thing)
def onClick(self, evt):
pub.sendMessage(events.PANEL_CHANGE, view_name=evt.GetString())
pub.send_message(events.PANEL_CHANGE, view_name=evt.GetString())
evt.Skip()
Loading…
Cancel
Save