コード例 #1
0
ファイル: mainwindow.py プロジェクト: linverno94/bluesky
    def show_file_dialog(self):
        # Due to Qt5 bug in Windows, use temporarily Tkinter
        if platform.system().lower()=="windows":
            fname = fileopen()
        else:
            response = QFileDialog.getOpenFileName(self, 'Open file', bs.settings.scenario_path, 'Scenario files (*.scn)')
            if type(response) is tuple:
                fname = response[0]
            else:
                fname = response

        # Send IC command to stack with filename if selected, else do nothing
        if len(fname) > 0:
            self.console.stack('IC ' + str(fname))
コード例 #2
0
    def show_file_dialog(self):
        # Due to Qt5 bug in Windows, use temporarily Tkinter
        if platform.system().lower()=='windows':
            fname = fileopen()
        else:
            if platform.system().lower() == 'darwin':
                response = QFileDialog.getOpenFileName(self, 'Open file', bs.settings.scenario_path, 'Scenario files (*.scn)')
            else:
                response = QFileDialog.getOpenFileName(self, 'Open file', bs.settings.scenario_path, 'Scenario files (*.scn)', options=QFileDialog.DontUseNativeDialog)
            fname = response[0] if isinstance(response, tuple) else response

        # Send IC command to stack with filename if selected, else do nothing
        if fname:
            bs.stack.stack('IC ' + str(fname))
コード例 #3
0
ファイル: mainwindow.py プロジェクト: thobson88/bluesky
    def show_file_dialog(self):
        # Due to Qt5 bug in Windows, use temporarily Tkinter
        if platform.system().lower()=="windows":
            fname = fileopen()
        else:
            response = QFileDialog.getOpenFileName(self, 'Open file', bs.settings.scenario_path, 'Scenario files (*.scn)')
            if type(response) is tuple:
                fname = response[0]
            else:
                fname = response

        # Send IC command to stack with filename if selected, else do nothing
        if len(fname) > 0:
            self.console.stack('IC ' + str(fname))