Пример #1
0
    def __init__(self):
        REDTab.__init__(self)

        self.setupUi(self)

        self.is_tab_on_focus = False

        self.setup_tview_nic()
        self.setup_tview_process()

        self.refresh_timer = QtCore.QTimer(self)
        self.refresh_counter = 0
        self.nic_time = 0

        self.label_error.hide()

        # For MAC progress bar text fix
        self.label_pbar_cpu.hide()
        self.label_pbar_memory.hide()
        self.label_pbar_storage.hide()

        # connecting signals to slots
        self.refresh_timer.timeout.connect(self.cb_refresh)
        self.button_refresh.clicked.connect(self.refresh_clicked)
        self.cbox_based_on.currentIndexChanged.connect(self.change_process_sort_order)
        self.tview_nic.header().sectionClicked.connect(self.cb_tview_nic_sort_indicator_changed)
        self.tview_process.header().sectionClicked.connect(self.cb_tview_process_sort_indicator_changed)
Пример #2
0
    def __init__(self):
        REDTab.__init__(self)

        self.setupUi(self)

        self.console = TerminalWidget()
        self.console_layout.insertWidget(1, self.console)

        self.refresh_button.clicked.connect(self.refresh_ports)
        self.connect_button.clicked.connect(self.connect_clicked)
        self.copy_button.clicked.connect(
            self.console.copy_selection_to_clipboard)

        # make all elements on this tab non-focusable so the focus has
        # to stay on the console widget
        self.combo_serial_port.setFocusPolicy(Qt.NoFocus)
        self.connect_button.setFocusPolicy(Qt.NoFocus)
        self.refresh_button.setFocusPolicy(Qt.NoFocus)
        self.copy_button.setFocusPolicy(Qt.NoFocus)
        self.setFocusPolicy(Qt.NoFocus)

        self.combo_serial_port.currentIndexChanged.connect(
            self.selected_serial_port_changed)

        self.refresh_ports()
Пример #3
0
    def __init__(self):
        REDTab.__init__(self)

        self.setupUi(self)

        self.is_tab_on_focus = False

        self.setup_tview_nic()
        self.setup_tview_process()

        self.refresh_timer = QtCore.QTimer(self)
        self.refresh_counter = 0
        self.nic_time = 0

        self.label_error.hide()

        # For MAC progress bar text fix
        self.label_pbar_cpu.hide()
        self.label_pbar_memory.hide()
        self.label_pbar_storage.hide()

        # connecting signals to slots
        self.refresh_timer.timeout.connect(self.cb_refresh)
        self.button_refresh.clicked.connect(self.refresh_clicked)
        self.cbox_based_on.currentIndexChanged.connect(self.change_process_sort_order)
        self.tview_nic.header().sectionClicked.connect(self.cb_tview_nic_sort_indicator_changed)
        self.tview_process.header().sectionClicked.connect(self.cb_tview_process_sort_indicator_changed)
Пример #4
0
    def __init__(self):
        REDTab.__init__(self)

        self.setupUi(self)

        self.executable_versions = {
            'fpc': None,
            'gcc': None,
            'java': None,
            'mono': None,
            'nodejs': None,
            'octave': None,
            'perl': None,
            'php': None,
            'python': None,
            'ruby': None,
            'shell': None
        }
        self.first_tab_on_focus = True
        self.tab_is_alive = True
        self.refresh_in_progress = False
        self.new_program_wizard = None

        self.splitter.setSizes([175, 400])
        self.tree_programs.setColumnWidth(0, 150)
        self.tree_programs.setColumnWidth(1, 50)

        self.tree_programs.itemSelectionChanged.connect(self.update_ui_state)
        self.button_refresh.clicked.connect(self.refresh_program_tree)
        self.button_new.clicked.connect(self.show_new_program_wizard)
        self.button_delete.clicked.connect(self.purge_selected_program)

        self.update_ui_state()
Пример #5
0
    def __init__(self):
        REDTab.__init__(self)

        self.setupUi(self)

        self.executable_versions = {
            'fpc':    None,
            'gcc':    None,
            'java':   None,
            'mono':   None,
            'nodejs': None,
            'octave': None,
            'perl':   None,
            'php':    None,
            'python': None,
            'ruby':   None,
            'shell':  None
        }
        self.first_tab_on_focus  = True
        self.tab_is_alive        = True
        self.refresh_in_progress = False
        self.new_program_wizard  = None

        self.splitter.setSizes([175, 400])
        self.tree_programs.setColumnWidth(0, 150)
        self.tree_programs.setColumnWidth(1, 50)

        self.tree_programs.itemSelectionChanged.connect(self.update_ui_state)
        self.button_refresh.clicked.connect(self.refresh_program_tree)
        self.button_new.clicked.connect(self.show_new_program_wizard)
        self.button_delete.clicked.connect(self.purge_selected_program)

        self.update_ui_state()
Пример #6
0
    def __init__(self):
        REDTab.__init__(self)

        self.setupUi(self)

        self.red_file = [None, None]
        self.config_read_counter = 0

        self.tab_widget.hide()
Пример #7
0
    def __init__(self):
        REDTab.__init__(self)

        self.setupUi(self)

        self.red_file = [None, None]
        self.config_read_counter = 0

        self.tab_widget.hide()
Пример #8
0
    def __init__(self):
        REDTab.__init__(self)

        self.setupUi(self)

        self.tabs = []

        for i in range(self.tab_widget.count()):
            self.tabs.append(self.tab_widget.widget(i))

        self.tab_widget.currentChanged.connect(self.tab_widget_current_changed)
Пример #9
0
    def __init__(self):
        REDTab.__init__(self)

        self.setupUi(self)

        self.tabs = []

        for i in range(self.tab_widget.count()):
            self.tabs.append(self.tab_widget.widget(i))

        self.tab_widget.currentChanged.connect(self.tab_widget_current_changed)
Пример #10
0
    def __init__(self):
        REDTab.__init__(self)

        self.tabs          = []
        self.service_state = ServiceState()

        self.setupUi(self)

        self.tab_widget.hide()

        for i in range(self.tab_widget.count()):
            self.tabs.append(self.tab_widget.widget(i))

        self.tab_widget.currentChanged.connect(self.tab_widget_current_changed)
Пример #11
0
    def __init__(self):
        REDTab.__init__(self)

        self.tabs = []
        self.service_state = ServiceState()

        self.setupUi(self)

        self.tab_widget.hide()

        for i in range(self.tab_widget.count()):
            self.tabs.append(self.tab_widget.widget(i))

        self.tab_widget.currentChanged.connect(self.tab_widget_current_changed)
Пример #12
0
    def __init__(self):
        REDTab.__init__(self)

        self.setupUi(self)

        self.is_tab_on_focus = False

        self.red_file = [None, None]
        self.config_read_counter = 0
        self.tabbed_extension_widgets = []

        self.tab_widget.hide()
        self.label_status.setText('Discovering Extensions...')
        self.label_status.show()
Пример #13
0
    def __init__(self):
        REDTab.__init__(self)

        self.setupUi(self)

        self.console = TerminalWidget()
        self.console_layout.insertWidget(1, self.console)

        self.refresh_button.clicked.connect(self.refresh_ports)
        self.connect_button.clicked.connect(self.connect_clicked)
        self.copy_button.clicked.connect(self.console.copy_selection_to_clipboard)

        # make all elements on this tab non-focusable so the focus has
        # to stay on the console widget
        self.combo_serial_port.setFocusPolicy(QtCore.Qt.NoFocus)
        self.connect_button.setFocusPolicy(QtCore.Qt.NoFocus)
        self.refresh_button.setFocusPolicy(QtCore.Qt.NoFocus)
        self.copy_button.setFocusPolicy(QtCore.Qt.NoFocus)
        self.setFocusPolicy(QtCore.Qt.NoFocus)

        self.refresh_ports()
Пример #14
0
    def __init__(self):
        REDTab.__init__(self)

        self.setupUi(self)

        self.package_list = [[] for i in range(NUM_TABS)]

        self.language_packages = None
        self.language_packages_file = None

        languages = 'C/C++', 'C#/Mono', 'Delphi/Lazarus', 'Java', 'JavaScript', 'Octave', 'Perl', 'PHP', 'Python', 'Ruby', 'Shell', 'VB.NET'

        self.package_list[0].append({
            'name':
            'Brick Daemon',
            'version':
            'Collecting Data...',
            'description':
            'Daemon that manages Bricks/Bricklets'
        })
        self.package_list[0].append({
            'name':
            'RED Brick API Daemon',
            'version':
            'Collecting Data...',
            'description':
            'Daemon that implements RED Brick API'
        })
        self.package_list[0].append({
            'name': 'RED Brick Image',
            'version': 'Collecting Data...',
            'description': 'SD card image of RED Brick'
        })
        for language in languages:
            self.package_list[0].append({
                'name':
                'Bindings ' + language,
                'version':
                'Collecting Data...',
                'description':
                'Tinkerforge bindings for ' + language
            })

        for i in range(1, NUM_TABS):
            self.package_list[i].append({
                'name': 'Collecting Data...',
                'version': 'Collecting Data...',
                'description': 'Collecting Data...'
            })

        self.tables = [
            self.tree_main, self.tree_c, self.tree_csharp, self.tree_delphi,
            self.tree_java, self.tree_javascript, self.tree_matlab,
            self.tree_perl, self.tree_php, self.tree_python, self.tree_ruby,
            self.tree_shell
        ]
        self.update_funcs = [
            self.update_main, lambda: self.update_language(
                (1, "c")), lambda: self.update_language(
                    (2, "mono")), lambda: self.update_language((3, "delphi")),
            lambda: self.update_language(
                (4, "java")), lambda: self.update_language(
                    (5, "node")), lambda: self.update_language((6, "matlab")),
            lambda: self.update_language(
                (7, "perl")), lambda: self.update_language(
                    (8, "php")), lambda: self.update_language(
                        (9, "python")), lambda: self.update_language(
                            (10, "ruby")), lambda: self.update_language(
                                (11, "shell"))
        ]

        self.tab_data = []

        self.models = []
        for i in range(NUM_TABS):
            self.models.append(QStandardItemModel(0, 3, self))
            self.models[i].setHorizontalHeaderItem(0, QStandardItem("Package"))
            self.models[i].setHorizontalHeaderItem(1, QStandardItem("Version"))
            self.models[i].setHorizontalHeaderItem(
                2, QStandardItem("Description"))
            self.models[i].setItem(0, 0, QStandardItem("Collecting data..."))

            self.tables[i].setModel(self.models[i])
            self.tables[i].setColumnWidth(0, DEFAULT_NAME_HEADER_WIDTH)
            self.tables[i].setColumnWidth(1, DEFAULT_VERSION_HEADER_WIDTH)
            self.tables[i].setColumnWidth(2, DEFAULT_DESCRIPTION_HEADER_WIDTH)

            self.tab_data.append({
                'table': self.tables[i],
                'model': self.models[i],
                'list': self.package_list[i],
                'update_func': self.update_funcs[i],
                'updated': False
            })

        self.tabs.currentChanged.connect(self.version_tab_changed)
Пример #15
0
    def __init__(self):
        REDTab.__init__(self)

        self.setupUi(self)

        self.package_list = [[] for i in range(NUM_TABS)]

        self.language_packages = None
        self.language_packages_file = None

        languages = "C#/Mono", "C/C++", "Delphi/Lazarus", "Java", "JavaScript", "Octave", "Perl", "PHP", "Python", "Ruby", "Shell", "VB.NET"

        self.package_list[0].append({'name': 'Brick Daemon', 'version': 'Collecting Data...', 'description': 'Daemon that manages Bricks/Bricklets'})
        self.package_list[0].append({'name': 'RED Brick API Daemon', 'version': 'Collecting Data...', 'description': 'Daemon that implements RED Brick API'})
        self.package_list[0].append({'name': 'RED Brick Image', 'version': 'Collecting Data...', 'description': 'SD card image of RED Brick'})
        for language in languages:
            self.package_list[0].append({'name': 'Bindings ' + language, 'version': 'Collecting Data...', 'description': 'Tinkerforge bindings for ' + language})

        for i in range(1, NUM_TABS):
            self.package_list[i].append({'name': 'Collecting Data...', 'version': 'Collecting Data...', 'description': 'Collecting Data...'})

        self.tables = [
            self.tree_main,
            self.tree_c,
            self.tree_csharp,
            self.tree_delphi,
            self.tree_java,
            self.tree_javascript,
            self.tree_matlab,
            self.tree_perl,
            self.tree_php,
            self.tree_python,
            self.tree_ruby,
            self.tree_shell
        ]
        self.update_funcs = [
            self.update_main,
            lambda: self.update_language((1, "c")),
            lambda: self.update_language((2, "mono")),
            lambda: self.update_language((3, "delphi")),
            lambda: self.update_language((4, "java")),
            lambda: self.update_language((5, "node")),
            lambda: self.update_language((6, "matlab")),
            lambda: self.update_language((7, "perl")),
            lambda: self.update_language((8, "php")),
            lambda: self.update_language((9, "python")),
            lambda: self.update_language((10, "ruby")),
            lambda: self.update_language((11, "shell"))
        ]

        self.tab_data = []

        self.models = []
        for i in range(NUM_TABS):
            self.models.append(QStandardItemModel(0, 3, self))
            self.models[i].setHorizontalHeaderItem(0, QStandardItem("Package"))
            self.models[i].setHorizontalHeaderItem(1, QStandardItem("Version"))
            self.models[i].setHorizontalHeaderItem(2, QStandardItem("Description"))
            self.models[i].setItem(0, 0, QStandardItem("Collecting data..."))

            self.tables[i].setModel(self.models[i])
            self.tables[i].setColumnWidth(0, DEFAULT_NAME_HEADER_WIDTH)
            self.tables[i].setColumnWidth(1, DEFAULT_VERSION_HEADER_WIDTH)
            self.tables[i].setColumnWidth(2, DEFAULT_DESCRIPTION_HEADER_WIDTH)

            self.tab_data.append({'table':       self.tables[i],
                                  'model':       self.models[i],
                                  'list':        self.package_list[i],
                                  'update_func': self.update_funcs[i],
                                  'updated':     False})

        self.tabs.currentChanged.connect(self.version_tab_changed)