Exemple #1
0
def check_devices_dialog(main_window):

    dialog = GenericMessageDialog(main_window, 'Do you want test the devices?',
                                  'Test', wx.YES | wx.NO | wx.ICON_QUESTION)

    answer = dialog.ShowModal()
    dialog.Destroy()

    return answer == wx.ID_YES
Exemple #2
0
def check_devices_response_dialog(main_window):

    dialog = GenericMessageDialog(main_window, 'Did all devices work?', 'Test',
                                  wx.YES | wx.NO | wx.ICON_QUESTION)

    answer = dialog.ShowModal()
    dialog.Destroy()

    return answer == wx.ID_YES
    def __handleGitHubConnectionError(self):

        eDlg = GenericMessageDialog(
            None,
            'GitHub connection error.  Try again later',
            "",
            agwStyle=ICON_ERROR | OK)
        eDlg.ShowModal()
        eDlg.Destroy()
Exemple #4
0
def start_shoot_at_dialog(main_window):

    dialog = GenericMessageDialog(main_window,
                                  'Do you want shoot extra photos?', 'Extra',
                                  wx.YES | wx.NO | wx.ICON_QUESTION)

    answer = dialog.ShowModal()
    dialog.Destroy()

    if answer == wx.ID_YES:
        shoot_at_window(main_window)
Exemple #5
0
    def initModules(self):
        dialog = GenericMessageDialog(
            self, 'Choose the modules that you want use in the next windows',
            'Modules initialization', wx.OK | wx.ICON_INFORMATION)

        dialog.ShowModal()
        dialog.Destroy()

        self.initTable()
        self.initCameras()
        print self.arduinoBoards.port_camera
Exemple #6
0
 def show(self):
     '''show the dialog as a child process'''
     mp_util.child_close_fds()
     from wx.lib.agw.genericmessagedialog import GenericMessageDialog
     app = wx.PySimpleApp()
     # note! font size change is not working. I don't know why yet
     font = wx.Font(self.font_size, wx.MODERN, wx.NORMAL, wx.NORMAL)
     dlg = GenericMessageDialog(None, self.message, self.title,
                                wx.ICON_INFORMATION | wx.OK)
     dlg.SetFont(font)
     dlg.ShowModal()
     app.MainLoop()
Exemple #7
0
 def call(self):
     '''show the dialog as a child process'''
     mp_util.child_close_fds()
     from MAVProxy.modules.lib import wx_processguard
     from MAVProxy.modules.lib.wx_loader import wx
     from wx.lib.agw.genericmessagedialog import GenericMessageDialog
     app = wx.App(False)
     # note! font size change is not working. I don't know why yet
     font = wx.Font(self.font_size, wx.MODERN, wx.NORMAL, wx.NORMAL)
     dlg = GenericMessageDialog(None, self.message, self.title, wx.ICON_INFORMATION|wx.OK)
     dlg.SetFont(font)
     dlg.ShowModal()
     app.MainLoop()
    def __handleAuthenticationError(self, event: CommandEvent):

        eDlg = GenericMessageDialog(self,
                                    'The supplied todoist token is invalid',
                                    "",
                                    agwStyle=ICON_ERROR | OK)
        eDlg.ShowModal()
        eDlg.Destroy()
        with DlgConfigure(self) as aDlg:
            cDlg: DlgConfigure = cast(DlgConfigure, aDlg)
            if cDlg.ShowModal() == OK:
                # The following 2 already defined in init
                self._apiToken = Preferences().todoistApiToken
                self._todoistAdapter = TodoistAdapter(self._apiToken)

                self._onCreateTaskClicked(event)  # Dang I hate recursion
Exemple #9
0
    def initCameras(self):

        dialog = GenericMessageDialog(
            self,
            'Plug in ONLY the camera module and press OK, or CANCEL to skip',
            'Table camera module', wx.OK | wx.CANCEL | wx.ICON_QUESTION)

        answer = dialog.ShowModal()
        dialog.Destroy()

        if answer == wx.ID_OK:
            self.arduinoBoards.connect_camera()
            # self.cameraPan.nameLabel.SetLabel("Name : " + str(self.arduinoBoards.port_camera))
        else:
            # self.cameraPan.nameLabel.SetLabel("Name : No module camera attached")
            pass
Exemple #10
0
    def initTable(self):

        dialog = GenericMessageDialog(
            self,
            'Plug in ONLY the table rotation module and press OK, or CANCEL to skip',
            'Table rotation module', wx.OK | wx.CANCEL | wx.ICON_QUESTION)

        answer = dialog.ShowModal()
        dialog.Destroy()

        if answer == wx.ID_OK:
            self.arduinoBoards.connect_table()
            self.tablePan.nameLabel.SetLabel(
                "Name : " + str(self.arduinoBoards.port_table))
        else:
            self.tablePan.nameLabel.SetLabel(
                "Name : No module rotation table attached")
    def __handleAuthenticationError(self):

        eDlg = GenericMessageDialog(None,
                                    'GitHub authentication error',
                                    "",
                                    agwStyle=ICON_ERROR | OK)
        eDlg.ShowModal()
        eDlg.Destroy()

        with DlgConfigure(self) as dlg:
            dlg: DlgConfigure = cast(DlgConfigure, dlg)
            if dlg.ShowModal() == OK:
                githubToken: str = self._preferences.githubApiToken
                userName: str = self._preferences.githubUserName
                self._githubAdapter = GithubAdapter(
                    userName=userName, authenticationToken=githubToken)

                self.__populateRepositories()  # I hate recursion
 def OnDelete(self, event):
   job_ids = self.list_ctrl.GetSelectedJobIDs()
   if len(job_ids) == 0 :
     return
   users = self.list_ctrl.GetOwners(job_ids)
   if (len(users) > 1) or (not user in users):
     raise Sorry("At least one job selected for deletion is owned by a "
       "different user; this interface only allows you to delete your own "+
       "jobs.")
   if self.ConfirmDelete(job_ids):
     try :
       success = sge_utils.qdel(job_ids=job_ids)
     except RuntimeError as e :
       raise Sorry("Error executing 'qdel' command: %s" % str(e))
     else :
       GenericMessageDialog("Job(s) deleted successfuly.", style=wx.OK)
Exemple #13
0
 def kshow(self):
     dlg = GenericMessageDialog(
         self.parent, self.m_msg, self.h_msg,
         self.k_ico | self.k_but | GMD_USE_GRADIENTBUTTONS)
     dlg.ShowModal()
     dlg.Destroy()