Пример #1
0
 def shutdown(self):
     import LauncherOptionsDialog
     import dialogtext
     dialogs=dialogtext.default()
     q=Queue.Queue()
     e=threading.Event()
     if (self.instance!=None):
         wx.CallAfter(self.createAndShowModalDialog,event=e,dlgclass=LauncherOptionsDialog.multiButtonDialog,parent=self.notify_window,message=dialogs.shutdownInstance.message,ButtonLabels=dialogs.shutdownInstance.ButtonLabels,title="",q=q)
         e.wait()
         (r,dlg)=q.get()
         if r==0:
             self.deleteInstance()
Пример #2
0
 def shutdown(self):
     import LauncherOptionsDialog
     import dialogtext
     dialogs = dialogtext.default()
     q = Queue.Queue()
     e = threading.Event()
     if (self.instance != None):
         wx.CallAfter(self.createAndShowModalDialog,
                      event=e,
                      dlgclass=LauncherOptionsDialog.multiButtonDialog,
                      parent=self.notify_window,
                      message=dialogs.shutdownInstance.message,
                      ButtonLabels=dialogs.shutdownInstance.ButtonLabels,
                      title="",
                      q=q)
         e.wait()
         (r, dlg) = q.get()
         if r == 0:
             self.deleteInstance()
Пример #3
0
 def queryExisting(self):
     import LauncherOptionsDialog
     import dialogtext
     from logger.Logger import logger
     dialogs=dialogtext.default()
     #  ask if the user would like to start a new VM or connect to an existing one.
     done=False
     okCallback=lambda x: setattr(self,'vmName',x.GetText())
     cancelCallback=lambda x: setattr(self,'vmName',None)
     self.vmName=None
     try:
         grouplist=[]
         for i in self.instances:
             if i.tags.has_key('Name'):
                 grouplist.append(i.tags['Name']) 
             else:
                 grouplist.append(i.private_dns_name)
         while not done:
             q=Queue.Queue()
             e=threading.Event()
             wx.CallAfter(self.createAndShowModalDialog,event=e,dlgclass=LauncherOptionsDialog.multiButtonDialog,parent=self.notify_window,message=dialogs.existingVM.message,ButtonLabels=dialogs.existingVM.ButtonLabels,title="",q=q)
             e.wait()
             (r,dlg)=q.get()
             if r==0:
                 done=True
                 self.bootNew=False
             if r==1:
                 e.clear()
                 msg="Please select a VM to connect to"
                 wx.CallAfter(self.createAndShowModalDialog,q,utilityFunctions.ListSelectionDialog,parent=self.notify_window, progressDialog=self.progressDialog, title=self.notify_window.GetParent().programName, headers=None, message=msg, noSelectionMessage="Please select a VM from the list or cancel.", items=grouplist, okCallback=okCallback, cancelCallback = cancelCallback, style=wx.DEFAULT_DIALOG_STYLE, helpEmailAddress="")
                 (r,dlg) = q.get()
                 if self.vmName!=None:
                     done=True
                 self.bootNew=False
             if r==2:
                 self.bootNew=True
                 done=True
                 e.clear()
     except Exception as e:
         logger.debug(traceback.format_exc())
         logger.debug(e)
Пример #4
0
 def queryExisting(self):
     import LauncherOptionsDialog
     import dialogtext
     from logger.Logger import logger
     dialogs = dialogtext.default()
     #  ask if the user would like to start a new VM or connect to an existing one.
     done = False
     okCallback = lambda x: setattr(self, 'vmName', x.GetText())
     cancelCallback = lambda x: setattr(self, 'vmName', None)
     self.vmName = None
     try:
         grouplist = []
         for i in self.instances:
             if i.tags.has_key('Name'):
                 grouplist.append(i.tags['Name'])
             else:
                 grouplist.append(i.private_dns_name)
         while not done:
             q = Queue.Queue()
             e = threading.Event()
             wx.CallAfter(self.createAndShowModalDialog,
                          event=e,
                          dlgclass=LauncherOptionsDialog.multiButtonDialog,
                          parent=self.notify_window,
                          message=dialogs.existingVM.message,
                          ButtonLabels=dialogs.existingVM.ButtonLabels,
                          title="",
                          q=q)
             e.wait()
             (r, dlg) = q.get()
             if r == 0:
                 done = True
                 self.bootNew = False
             if r == 1:
                 e.clear()
                 msg = "Please select a VM to connect to"
                 wx.CallAfter(
                     self.createAndShowModalDialog,
                     q,
                     utilityFunctions.ListSelectionDialog,
                     parent=self.notify_window,
                     progressDialog=self.progressDialog,
                     title=self.notify_window.GetParent().programName,
                     headers=None,
                     message=msg,
                     noSelectionMessage=
                     "Please select a VM from the list or cancel.",
                     items=grouplist,
                     okCallback=okCallback,
                     cancelCallback=cancelCallback,
                     style=wx.DEFAULT_DIALOG_STYLE,
                     helpEmailAddress="")
                 (r, dlg) = q.get()
                 if self.vmName != None:
                     done = True
                 self.bootNew = False
             if r == 2:
                 self.bootNew = True
                 done = True
                 e.clear()
     except Exception as e:
         logger.debug(traceback.format_exc())
         logger.debug(e)
Пример #5
0
import sys
import dialogtext
import wx
import Queue
from logger.Logger import logger
import siteConfig
dialogs=dialogtext.default()
if sys.platform.startswith("darwin"):
    from MacMessageDialog import LauncherMessageDialog
elif sys.platform.startswith("win"):
    from WindowsMessageDialog import LauncherMessageDialog
elif sys.platform.startswith("linux"):
    from LinuxMessageDialog import LauncherMessageDialog
class SharedSessions:
    def __init__(self,parent,idp,username,*args,**kwargs):
        self.parent=parent
        self.idp=idp
        self.username=username

    def getPassphrase(self,queue):
        import cvlsshutils.PassphraseDialog
        dlg=cvlsshutils.PassphraseDialog.passphraseDialog(self.parent,None,wx.ID_ANY,"title","text","OK","Cancel")
        (canceled,value) = dlg.getPassword()
        if canceled:
            queue.put(None)
        else:
            queue.put(value)

    def showShareFailedMessage(self,q):
        dlg = LauncherMessageDialog(self.parent, dialogs.shareFailedMessage.message, self.parent.programName, helpEmailAddress="*****@*****.**" )
        dlg.ShowModal()
import sys
import dialogtext
import wx
import Queue
from logger.Logger import logger
import siteConfig
dialogs = dialogtext.default()
if sys.platform.startswith("darwin"):
    from MacMessageDialog import LauncherMessageDialog
elif sys.platform.startswith("win"):
    from WindowsMessageDialog import LauncherMessageDialog
elif sys.platform.startswith("linux"):
    from LinuxMessageDialog import LauncherMessageDialog


class SharedSessions:
    def __init__(self, parent, idp, username, *args, **kwargs):
        self.parent = parent
        self.idp = idp
        self.username = username

    def getPassphrase(self, queue):
        import cvlsshutils.PassphraseDialog
        dlg = cvlsshutils.PassphraseDialog.passphraseDialog(
            self.parent, None, wx.ID_ANY, "title", "text", "OK", "Cancel")
        (canceled, value) = dlg.getPassword()
        if canceled:
            queue.put(None)
        else:
            queue.put(value)