Changeset 10508

Show
Ignore:
Timestamp:
11/11/10 09:54:10 (3 years ago)
Author:
Snyder.Jason
Message:

moved call to show() to the constructor, changed startup sequence: now checks for naming service and offers to start locally or connect to a remote, then displays a warning if nodebooter has not been run. added a button to the toolbar to start nodebooter

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • ossiedev/trunk/tools/wavedash/src/WavedashView.py

    r10450 r10508  
    2828from WavedashController import Controller 
    2929from WavedashPreferencePage import WavedashPreferencePage 
     30from NSChoiceDialog import NSChoiceDialog 
     31from NodeBooterDialog import NodeBooterDialog 
    3032 
    3133OSSIE_WAVEAPP_DIMENSION = (600,600)                                                     
     
    3638NAMINGSERVICE_ICON_FILE = "/resources/network.png" 
    3739REFRESH_ICON_FILE = "/resources/refresh.png" 
    38  
     40NODEBOOTER_ICON_FILE = "/resources/nbstart.png" 
    3941 
    4042 
    4143class WavedashView(wx.Frame, WaveformListener,  
    42                    ComponentListener, PropertyListener ): 
     44                   ComponentListener, PropertyListener): 
    4345    """ This is top level frame that acts as primary UI """ 
    4446    def __init__(self, controller, amodel): 
     
    8486        self.trueValues = ["t", "true", "yes", "on", "1"] 
    8587         
     88             
    8689        self.Bind(wx.EVT_CLOSE, self.OnClose) 
    8790         
    8891        self.SetSize(OSSIE_WAVEAPP_DIMENSION) 
    8992        self.Center() 
     93        self.Show() 
     94         
     95        if not self.controller.namingServiceIsRunning(): 
     96            nscd = NSChoiceDialog(self)         
     97     
    9098           
    9199    def createToolBar(self): 
     
    108116        uninstall = self.toolbar.AddSimpleTool(-1, uninstallIcon, shortHelpString="Uninstall waveform") 
    109117         
     118        startNodeBooterIcon = wx.Image(root + NODEBOOTER_ICON_FILE, wx.BITMAP_TYPE_ANY).ConvertToBitmap() 
     119        startNodeBooter = self.toolbar.AddSimpleTool(-1, startNodeBooterIcon, shortHelpString="Start NodeBooter") 
     120         
    110121         
    111122        self.Bind(wx.EVT_TOOL, self.OnStart, start) 
     
    113124        self.Bind(wx.EVT_TOOL, self.OnUninstall, uninstall) 
    114125        self.Bind(wx.EVT_TOOL, self.OnSelectNS, selectNS) 
     126        self.Bind(wx.EVT_TOOL, self.OnStartNodeBooter, startNodeBooter) 
    115127     
    116128    def OnStart(self, event): 
     
    130142        status = self.controller.stopWaveform(activeWform.getName()) 
    131143     
    132     def OnUninstall(self, event): 
    133        
    134              
     144    def OnUninstall(self, event):     
    135145        selWform = self.model.getActiveWaveform() 
    136146        if selWform is None: 
     
    148158            if(button.isComponentButton == True and button.getGrandParentName() == selWform.getName()): 
    149159                self.configureButtons.remove(button) 
    150                  
    151              
     160                  
    152161        success = self.model.removeWaveform(selWform) 
    153162             
    154163    def OnSelectNS(self, event): 
    155164        self.controller.selectNS() 
    156      
    157      
     165         
     166    def OnStartNodeBooter(self, event): 
     167        nbd = NodeBooterDialog(self) 
     168         
     169        if nbd.GetReturnCode() == 0: 
     170            self.controller.CORBAutils.setNamingService('127.0.0.1') 
     171            self.controller.CORBAutils.init_CORBA() 
     172            self.controller.refresh() 
     173 
    158174    def createMenus(self): 
    159175        menuBar = wx.MenuBar() 
     
    10651081         
    10661082    def OnRefresh(self, event): 
    1067          
    10681083        self.controller.refresh() 
    10691084         
     
    12251240    
    12261241    frame = WavedashView(ctrlr, ctrlr.model) 
    1227     frame.Show() 
     1242 
    12281243    ctrlr.CORBAutils.init_CORBA() 
    12291244    ctrlr.buildModel()