示例#1
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
示例#2
0
    def __handleGitHubConnectionError(self):

        eDlg = GenericMessageDialog(
            None,
            'GitHub connection error.  Try again later',
            "",
            agwStyle=ICON_ERROR | OK)
        eDlg.ShowModal()
        eDlg.Destroy()
示例#3
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
示例#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)
示例#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
示例#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()
示例#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()
示例#8
0
    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
示例#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
示例#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")
示例#11
0
    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
示例#12
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()