Beispiel #1
0
    def __init__(self):
        self.widget = QtWidgets.QWidget()
        self.widget.setWindowTitle("Sk options")
        main_layout = QtWidgets.QVBoxLayout(self.widget)
        self.widget.setLayout(main_layout)

        # ---- Size ----
        self.Size_Label = QtWidgets.QLabel("Size:")
        self.Size_ComboBox = QtWidgets.QComboBox()
        self.Size_text = ["6", "8", "10", "12"]
        self.Size_ComboBox.addItems(self.Size_text)
        self.Size_ComboBox.setCurrentIndex(0)
        size_layout = QtWidgets.QHBoxLayout()
        size_layout.addWidget(self.Size_Label)
        size_layout.addWidget(self.Size_ComboBox)

        # ---- Pillow ----
        self.Pillow_Label = QtWidgets.QLabel("Pillow:")
        self.Pillow_ComboBox = QtWidgets.QComboBox()
        self.V_Pillow = ["No", "Yes"]
        self.Pillow_ComboBox.addItems(self.V_Pillow)
        self.Pillow_ComboBox.setCurrentIndex(self.V_Pillow.index('No'))
        if self.Size_ComboBox.currentText() == "8":
            self.Pillow_ComboBox.setEnabled(True)
        else:
            self.Pillow_ComboBox.setEnabled(False)

        pillow_layout = QtWidgets.QHBoxLayout()
        pillow_layout.addWidget(self.Pillow_Label)
        pillow_layout.addWidget(self.Pillow_ComboBox)

        # ---- Placement ----
        self.Label_position = QtWidgets.QLabel("Placement ")
        self.Label_position.setAlignment(QtCore.Qt.AlignTop)
        self.Label_pos_x = QtWidgets.QLabel("x:")
        self.Label_pos_y = QtWidgets.QLabel("y:")
        self.Label_pos_z = QtWidgets.QLabel("z:")
        self.pos_x = QtWidgets.QDoubleSpinBox()
        self.pos_y = QtWidgets.QDoubleSpinBox()
        self.pos_z = QtWidgets.QDoubleSpinBox()
        self.pos_x.setValue(0.000)
        self.pos_y.setValue(0.000)
        self.pos_z.setValue(0.000)
        self.pos_x.setDecimals(3)
        self.pos_y.setDecimals(3)
        self.pos_z.setDecimals(3)
        self.pos_x.setRange(minnum, maxnum)
        self.pos_y.setRange(minnum, maxnum)
        self.pos_z.setRange(minnum, maxnum)

        placement_layout = QtWidgets.QHBoxLayout()

        placement_layout_1 = QtWidgets.QVBoxLayout()
        placement_layout_1.addWidget(self.Label_position)
        placement_layout_2 = QtWidgets.QVBoxLayout()
        placement_layout_2.addWidget(self.Label_pos_x)
        placement_layout_2.addWidget(self.Label_pos_y)
        placement_layout_2.addWidget(self.Label_pos_z)
        placement_layout_3 = QtWidgets.QVBoxLayout()
        placement_layout_3.addWidget(self.pos_x)
        placement_layout_3.addWidget(self.pos_y)
        placement_layout_3.addWidget(self.pos_z)

        placement_layout.addLayout(placement_layout_1)
        placement_layout.addLayout(placement_layout_2)
        placement_layout.addLayout(placement_layout_3)

        # d :
        self.Label_pos_d = QtWidgets.QLabel("in d:")
        self.pos_d = QtWidgets.QComboBox()
        self.pos_d.addItems(['0', '1'])
        self.pos_d.setCurrentIndex(0)

        placement_layout_2.addWidget(self.Label_pos_d)
        placement_layout_3.addWidget(self.pos_d)

        # w :
        self.Label_pos_w = QtWidgets.QLabel("in w:")
        self.pos_w = QtWidgets.QComboBox()
        self.pos_w.addItems(['-1', '0', '1'])
        self.pos_w.setCurrentIndex(1)

        placement_layout_2.addWidget(self.Label_pos_w)
        placement_layout_3.addWidget(self.pos_w)

        # h :
        self.Label_pos_h = QtWidgets.QLabel("in h:")
        self.pos_h = QtWidgets.QComboBox()
        self.pos_h.addItems(['0', '1'])
        self.pos_h.setCurrentIndex(0)

        placement_layout_2.addWidget(self.Label_pos_h)
        placement_layout_3.addWidget(self.pos_h)

        # ---- Axes ----
        self.Label_axis = QtWidgets.QLabel("Axis ")
        self.Label_axis.setAlignment(QtCore.Qt.AlignTop)
        self.Label_axis_d = QtWidgets.QLabel("d:")
        self.Label_axis_w = QtWidgets.QLabel("w:")
        self.Label_axis_h = QtWidgets.QLabel("h:")
        self.axis_d_x = QtWidgets.QDoubleSpinBox()
        self.axis_d_y = QtWidgets.QDoubleSpinBox()
        self.axis_d_z = QtWidgets.QDoubleSpinBox()
        self.axis_d_x.setMinimum(-1)
        self.axis_d_x.setMaximum(1)
        self.axis_d_y.setMinimum(-1)
        self.axis_d_y.setMaximum(1)
        self.axis_d_z.setMinimum(-1)
        self.axis_d_z.setMaximum(1)
        self.axis_d_x.setValue(0)
        self.axis_d_y.setValue(0)
        self.axis_d_z.setValue(1)
        self.axis_w_x = QtWidgets.QDoubleSpinBox()
        self.axis_w_y = QtWidgets.QDoubleSpinBox()
        self.axis_w_z = QtWidgets.QDoubleSpinBox()
        self.axis_w_x.setMinimum(-1)
        self.axis_w_x.setMaximum(1)
        self.axis_w_y.setMinimum(-1)
        self.axis_w_y.setMaximum(1)
        self.axis_w_z.setMinimum(-1)
        self.axis_w_z.setMaximum(1)
        self.axis_w_x.setValue(0)
        self.axis_w_y.setValue(1)
        self.axis_w_z.setValue(0)
        self.axis_h_x = QtWidgets.QDoubleSpinBox()
        self.axis_h_y = QtWidgets.QDoubleSpinBox()
        self.axis_h_z = QtWidgets.QDoubleSpinBox()
        self.axis_h_x.setMinimum(-1)
        self.axis_h_x.setMaximum(1)
        self.axis_h_y.setMinimum(-1)
        self.axis_h_y.setMaximum(1)
        self.axis_h_z.setMinimum(-1)
        self.axis_h_z.setMaximum(1)
        self.axis_h_x.setValue(1)
        self.axis_h_y.setValue(0)
        self.axis_h_z.setValue(0)

        axes_layout = QtWidgets.QHBoxLayout()

        axes_layout_1 = QtWidgets.QVBoxLayout()
        axes_layout_1.addWidget(self.Label_axis)

        axes_layout_2 = QtWidgets.QVBoxLayout()
        axes_layout_2.addWidget(self.Label_axis_d)
        axes_layout_2.addWidget(self.Label_axis_w)
        axes_layout_2.addWidget(self.Label_axis_h)

        axes_layout_3 = QtWidgets.QVBoxLayout()
        axes_layout_3.addWidget(self.axis_d_x)
        axes_layout_3.addWidget(self.axis_w_x)
        axes_layout_3.addWidget(self.axis_h_x)

        axes_layout_4 = QtWidgets.QVBoxLayout()
        axes_layout_4.addWidget(self.axis_d_y)
        axes_layout_4.addWidget(self.axis_w_y)
        axes_layout_4.addWidget(self.axis_h_y)

        axes_layout_5 = QtWidgets.QVBoxLayout()
        axes_layout_5.addWidget(self.axis_d_z)
        axes_layout_5.addWidget(self.axis_w_z)
        axes_layout_5.addWidget(self.axis_h_z)

        axes_layout.addLayout(axes_layout_1)
        axes_layout.addLayout(axes_layout_2)
        axes_layout.addLayout(axes_layout_3)
        axes_layout.addLayout(axes_layout_4)
        axes_layout.addLayout(axes_layout_5)

        # ---- Image ----
        image = QtWidgets.QLabel(
            'Image of points and axis <a href="https://raw.githubusercontent.com/davidmubernal/Mechatronic_Documentation/master/img_gui/SK_dir.png">here</a>.'
        )
        image.setOpenExternalLinks(True)
        # svgimage = QtSvg.QSvgWidget(":/img_gui/SK_dir.svg") # TODO No carga la imagen
        # svgimage.renderer()

        image_layout = QtWidgets.QHBoxLayout()
        image_layout.addWidget(image)
        # image_layout.addWidget(svgimage)

        main_layout.addLayout(size_layout)
        main_layout.addLayout(pillow_layout)
        main_layout.addLayout(placement_layout)
        main_layout.addLayout(axes_layout)
        main_layout.addLayout(image_layout)
Beispiel #2
0
    def __init__(self, common):
        super(SettingsDialog, self).__init__()

        self.common = common

        self.common.log("SettingsDialog", "__init__")

        self.setModal(True)
        self.setWindowTitle(strings._("gui_settings_window_title"))
        self.setWindowIcon(
            QtGui.QIcon(GuiCommon.get_resource_path("images/logo.png")))

        self.system = platform.system()

        # If ONIONSHARE_HIDE_TOR_SETTINGS=1, hide Tor settings in the dialog
        self.hide_tor_settings = os.environ.get(
            "ONIONSHARE_HIDE_TOR_SETTINGS") == "1"

        # Automatic updates options

        # Autoupdate
        self.autoupdate_checkbox = QtWidgets.QCheckBox()
        self.autoupdate_checkbox.setCheckState(QtCore.Qt.Unchecked)
        self.autoupdate_checkbox.setText(
            strings._("gui_settings_autoupdate_option"))

        # Last update time
        self.autoupdate_timestamp = QtWidgets.QLabel()

        # Check for updates button
        self.check_for_updates_button = QtWidgets.QPushButton(
            strings._("gui_settings_autoupdate_check_button"))
        self.check_for_updates_button.clicked.connect(self.check_for_updates)
        # We can't check for updates if not connected to Tor
        if not self.common.gui.onion.connected_to_tor:
            self.check_for_updates_button.setEnabled(False)

        # Autoupdate options layout
        autoupdate_group_layout = QtWidgets.QVBoxLayout()
        autoupdate_group_layout.addWidget(self.autoupdate_checkbox)
        autoupdate_group_layout.addWidget(self.autoupdate_timestamp)
        autoupdate_group_layout.addWidget(self.check_for_updates_button)
        autoupdate_group = QtWidgets.QGroupBox(
            strings._("gui_settings_autoupdate_label"))
        autoupdate_group.setLayout(autoupdate_group_layout)

        # Autoupdate is only available for Windows and Mac (Linux updates using package manager)
        if self.system != "Windows" and self.system != "Darwin":
            autoupdate_group.hide()

        # Language settings
        language_label = QtWidgets.QLabel(
            strings._("gui_settings_language_label"))
        self.language_combobox = QtWidgets.QComboBox()
        # Populate the dropdown with all of OnionShare's available languages
        language_names_to_locales = {
            v: k
            for k, v in self.common.settings.available_locales.items()
        }
        language_names = list(language_names_to_locales)
        language_names.sort()
        for language_name in language_names:
            locale = language_names_to_locales[language_name]
            self.language_combobox.addItem(language_name, locale)
        language_layout = QtWidgets.QHBoxLayout()
        language_layout.addWidget(language_label)
        language_layout.addWidget(self.language_combobox)
        language_layout.addStretch()

        # Connection type: either automatic, control port, or socket file

        # Bundled Tor
        self.connection_type_bundled_radio = QtWidgets.QRadioButton(
            strings._("gui_settings_connection_type_bundled_option"))
        self.connection_type_bundled_radio.toggled.connect(
            self.connection_type_bundled_toggled)

        # Bundled Tor doesn't work on dev mode in Windows or Mac
        if (self.system == "Windows" or self.system == "Darwin") and getattr(
                sys, "onionshare_dev_mode", False):
            self.connection_type_bundled_radio.setEnabled(False)

        # Bridge options for bundled tor

        # No bridges option radio
        self.tor_bridges_no_bridges_radio = QtWidgets.QRadioButton(
            strings._("gui_settings_tor_bridges_no_bridges_radio_option"))
        self.tor_bridges_no_bridges_radio.toggled.connect(
            self.tor_bridges_no_bridges_radio_toggled)

        # obfs4 option radio
        # if the obfs4proxy binary is missing, we can't use obfs4 transports
        (
            self.tor_path,
            self.tor_geo_ip_file_path,
            self.tor_geo_ipv6_file_path,
            self.obfs4proxy_file_path,
        ) = self.common.gui.get_tor_paths()
        if not self.obfs4proxy_file_path or not os.path.isfile(
                self.obfs4proxy_file_path):
            self.tor_bridges_use_obfs4_radio = QtWidgets.QRadioButton(
                strings.
                _("gui_settings_tor_bridges_obfs4_radio_option_no_obfs4proxy"))
            self.tor_bridges_use_obfs4_radio.setEnabled(False)
        else:
            self.tor_bridges_use_obfs4_radio = QtWidgets.QRadioButton(
                strings._("gui_settings_tor_bridges_obfs4_radio_option"))
        self.tor_bridges_use_obfs4_radio.toggled.connect(
            self.tor_bridges_use_obfs4_radio_toggled)

        # meek_lite-azure option radio
        # if the obfs4proxy binary is missing, we can't use meek_lite-azure transports
        (
            self.tor_path,
            self.tor_geo_ip_file_path,
            self.tor_geo_ipv6_file_path,
            self.obfs4proxy_file_path,
        ) = self.common.gui.get_tor_paths()
        if not self.obfs4proxy_file_path or not os.path.isfile(
                self.obfs4proxy_file_path):
            self.tor_bridges_use_meek_lite_azure_radio = QtWidgets.QRadioButton(
                strings.
                _("gui_settings_tor_bridges_meek_lite_azure_radio_option_no_obfs4proxy"
                  ))
            self.tor_bridges_use_meek_lite_azure_radio.setEnabled(False)
        else:
            self.tor_bridges_use_meek_lite_azure_radio = QtWidgets.QRadioButton(
                strings._(
                    "gui_settings_tor_bridges_meek_lite_azure_radio_option"))
        self.tor_bridges_use_meek_lite_azure_radio.toggled.connect(
            self.tor_bridges_use_meek_lite_azure_radio_toggled)

        # Custom bridges radio and textbox
        self.tor_bridges_use_custom_radio = QtWidgets.QRadioButton(
            strings._("gui_settings_tor_bridges_custom_radio_option"))
        self.tor_bridges_use_custom_radio.toggled.connect(
            self.tor_bridges_use_custom_radio_toggled)

        self.tor_bridges_use_custom_label = QtWidgets.QLabel(
            strings._("gui_settings_tor_bridges_custom_label"))
        self.tor_bridges_use_custom_label.setTextInteractionFlags(
            QtCore.Qt.TextBrowserInteraction)
        self.tor_bridges_use_custom_label.setOpenExternalLinks(True)
        self.tor_bridges_use_custom_textbox = QtWidgets.QPlainTextEdit()
        self.tor_bridges_use_custom_textbox.setMaximumHeight(200)
        self.tor_bridges_use_custom_textbox.setPlaceholderText(
            "[address:port] [identifier]")

        tor_bridges_use_custom_textbox_options_layout = QtWidgets.QVBoxLayout()
        tor_bridges_use_custom_textbox_options_layout.addWidget(
            self.tor_bridges_use_custom_label)
        tor_bridges_use_custom_textbox_options_layout.addWidget(
            self.tor_bridges_use_custom_textbox)

        self.tor_bridges_use_custom_textbox_options = QtWidgets.QWidget()
        self.tor_bridges_use_custom_textbox_options.setLayout(
            tor_bridges_use_custom_textbox_options_layout)
        self.tor_bridges_use_custom_textbox_options.hide()

        # Bridges layout/widget
        bridges_layout = QtWidgets.QVBoxLayout()
        bridges_layout.addWidget(self.tor_bridges_no_bridges_radio)
        bridges_layout.addWidget(self.tor_bridges_use_obfs4_radio)
        bridges_layout.addWidget(self.tor_bridges_use_meek_lite_azure_radio)
        bridges_layout.addWidget(self.tor_bridges_use_custom_radio)
        bridges_layout.addWidget(self.tor_bridges_use_custom_textbox_options)

        self.bridges = QtWidgets.QWidget()
        self.bridges.setLayout(bridges_layout)

        # Automatic
        self.connection_type_automatic_radio = QtWidgets.QRadioButton(
            strings._("gui_settings_connection_type_automatic_option"))
        self.connection_type_automatic_radio.toggled.connect(
            self.connection_type_automatic_toggled)

        # Control port
        self.connection_type_control_port_radio = QtWidgets.QRadioButton(
            strings._("gui_settings_connection_type_control_port_option"))
        self.connection_type_control_port_radio.toggled.connect(
            self.connection_type_control_port_toggled)

        connection_type_control_port_extras_label = QtWidgets.QLabel(
            strings._("gui_settings_control_port_label"))
        self.connection_type_control_port_extras_address = QtWidgets.QLineEdit(
        )
        self.connection_type_control_port_extras_port = QtWidgets.QLineEdit()
        connection_type_control_port_extras_layout = QtWidgets.QHBoxLayout()
        connection_type_control_port_extras_layout.addWidget(
            connection_type_control_port_extras_label)
        connection_type_control_port_extras_layout.addWidget(
            self.connection_type_control_port_extras_address)
        connection_type_control_port_extras_layout.addWidget(
            self.connection_type_control_port_extras_port)

        self.connection_type_control_port_extras = QtWidgets.QWidget()
        self.connection_type_control_port_extras.setLayout(
            connection_type_control_port_extras_layout)
        self.connection_type_control_port_extras.hide()

        # Socket file
        self.connection_type_socket_file_radio = QtWidgets.QRadioButton(
            strings._("gui_settings_connection_type_socket_file_option"))
        self.connection_type_socket_file_radio.toggled.connect(
            self.connection_type_socket_file_toggled)

        connection_type_socket_file_extras_label = QtWidgets.QLabel(
            strings._("gui_settings_socket_file_label"))
        self.connection_type_socket_file_extras_path = QtWidgets.QLineEdit()
        connection_type_socket_file_extras_layout = QtWidgets.QHBoxLayout()
        connection_type_socket_file_extras_layout.addWidget(
            connection_type_socket_file_extras_label)
        connection_type_socket_file_extras_layout.addWidget(
            self.connection_type_socket_file_extras_path)

        self.connection_type_socket_file_extras = QtWidgets.QWidget()
        self.connection_type_socket_file_extras.setLayout(
            connection_type_socket_file_extras_layout)
        self.connection_type_socket_file_extras.hide()

        # Tor SOCKS address and port
        gui_settings_socks_label = QtWidgets.QLabel(
            strings._("gui_settings_socks_label"))
        self.connection_type_socks_address = QtWidgets.QLineEdit()
        self.connection_type_socks_port = QtWidgets.QLineEdit()
        connection_type_socks_layout = QtWidgets.QHBoxLayout()
        connection_type_socks_layout.addWidget(gui_settings_socks_label)
        connection_type_socks_layout.addWidget(
            self.connection_type_socks_address)
        connection_type_socks_layout.addWidget(self.connection_type_socks_port)

        self.connection_type_socks = QtWidgets.QWidget()
        self.connection_type_socks.setLayout(connection_type_socks_layout)
        self.connection_type_socks.hide()

        # Authentication options

        # No authentication
        self.authenticate_no_auth_radio = QtWidgets.QRadioButton(
            strings._("gui_settings_authenticate_no_auth_option"))
        self.authenticate_no_auth_radio.toggled.connect(
            self.authenticate_no_auth_toggled)

        # Password
        self.authenticate_password_radio = QtWidgets.QRadioButton(
            strings._("gui_settings_authenticate_password_option"))
        self.authenticate_password_radio.toggled.connect(
            self.authenticate_password_toggled)

        authenticate_password_extras_label = QtWidgets.QLabel(
            strings._("gui_settings_password_label"))
        self.authenticate_password_extras_password = QtWidgets.QLineEdit("")
        authenticate_password_extras_layout = QtWidgets.QHBoxLayout()
        authenticate_password_extras_layout.addWidget(
            authenticate_password_extras_label)
        authenticate_password_extras_layout.addWidget(
            self.authenticate_password_extras_password)

        self.authenticate_password_extras = QtWidgets.QWidget()
        self.authenticate_password_extras.setLayout(
            authenticate_password_extras_layout)
        self.authenticate_password_extras.hide()

        # Authentication options layout
        authenticate_group_layout = QtWidgets.QVBoxLayout()
        authenticate_group_layout.addWidget(self.authenticate_no_auth_radio)
        authenticate_group_layout.addWidget(self.authenticate_password_radio)
        authenticate_group_layout.addWidget(self.authenticate_password_extras)
        self.authenticate_group = QtWidgets.QGroupBox(
            strings._("gui_settings_authenticate_label"))
        self.authenticate_group.setLayout(authenticate_group_layout)

        # Put the radios into their own group so they are exclusive
        connection_type_radio_group_layout = QtWidgets.QVBoxLayout()
        connection_type_radio_group_layout.addWidget(
            self.connection_type_bundled_radio)
        connection_type_radio_group_layout.addWidget(
            self.connection_type_automatic_radio)
        connection_type_radio_group_layout.addWidget(
            self.connection_type_control_port_radio)
        connection_type_radio_group_layout.addWidget(
            self.connection_type_socket_file_radio)
        connection_type_radio_group = QtWidgets.QGroupBox(
            strings._("gui_settings_connection_type_label"))
        connection_type_radio_group.setLayout(
            connection_type_radio_group_layout)

        # The Bridges options are not exclusive (enabling Bridges offers obfs4 or custom bridges)
        connection_type_bridges_radio_group_layout = QtWidgets.QVBoxLayout()
        connection_type_bridges_radio_group_layout.addWidget(self.bridges)
        self.connection_type_bridges_radio_group = QtWidgets.QGroupBox(
            strings._("gui_settings_tor_bridges"))
        self.connection_type_bridges_radio_group.setLayout(
            connection_type_bridges_radio_group_layout)
        self.connection_type_bridges_radio_group.hide()

        # Test tor settings button
        self.connection_type_test_button = QtWidgets.QPushButton(
            strings._("gui_settings_connection_type_test_button"))
        self.connection_type_test_button.clicked.connect(self.test_tor_clicked)
        connection_type_test_button_layout = QtWidgets.QHBoxLayout()
        connection_type_test_button_layout.addWidget(
            self.connection_type_test_button)
        connection_type_test_button_layout.addStretch()

        # Connection type layout
        connection_type_layout = QtWidgets.QVBoxLayout()
        connection_type_layout.addWidget(
            self.connection_type_control_port_extras)
        connection_type_layout.addWidget(
            self.connection_type_socket_file_extras)
        connection_type_layout.addWidget(self.connection_type_socks)
        connection_type_layout.addWidget(self.authenticate_group)
        connection_type_layout.addWidget(
            self.connection_type_bridges_radio_group)
        connection_type_layout.addLayout(connection_type_test_button_layout)

        # Buttons
        self.save_button = QtWidgets.QPushButton(
            strings._("gui_settings_button_save"))
        self.save_button.clicked.connect(self.save_clicked)
        self.cancel_button = QtWidgets.QPushButton(
            strings._("gui_settings_button_cancel"))
        self.cancel_button.clicked.connect(self.cancel_clicked)
        version_label = QtWidgets.QLabel(f"OnionShare {self.common.version}")
        version_label.setStyleSheet(self.common.gui.css["settings_version"])
        self.help_button = QtWidgets.QPushButton(
            strings._("gui_settings_button_help"))
        self.help_button.clicked.connect(self.help_clicked)
        buttons_layout = QtWidgets.QHBoxLayout()
        buttons_layout.addWidget(version_label)
        buttons_layout.addWidget(self.help_button)
        buttons_layout.addStretch()
        buttons_layout.addWidget(self.save_button)
        buttons_layout.addWidget(self.cancel_button)

        # Tor network connection status
        self.tor_status = QtWidgets.QLabel()
        self.tor_status.setStyleSheet(
            self.common.gui.css["settings_tor_status"])
        self.tor_status.hide()

        # Layout
        tor_layout = QtWidgets.QVBoxLayout()
        tor_layout.addWidget(connection_type_radio_group)
        tor_layout.addLayout(connection_type_layout)
        tor_layout.addWidget(self.tor_status)
        tor_layout.addStretch()

        layout = QtWidgets.QVBoxLayout()
        if not self.hide_tor_settings:
            layout.addLayout(tor_layout)
            layout.addSpacing(20)
        layout.addWidget(autoupdate_group)
        if autoupdate_group.isVisible():
            layout.addSpacing(20)
        layout.addLayout(language_layout)
        layout.addSpacing(20)
        layout.addStretch()
        layout.addLayout(buttons_layout)

        self.setLayout(layout)
        self.cancel_button.setFocus()

        self.reload_settings()
Beispiel #3
0
    def construct_layout(self) -> None:
        """Layout of Sankey Navigator"""
        super().construct_layout()
        self.label_help.setVisible(False)

        # Layout Reference Flows and Impact Categories
        grid_lay = QtWidgets.QGridLayout()
        grid_lay.addWidget(QtWidgets.QLabel('Reference flow: '), 0, 0)
        grid_lay.addWidget(QtWidgets.QLabel('Impact indicator: '), 1, 0)

        self.update_calculation_setup()

        grid_lay.addWidget(self.func_unit_cb, 0, 1)
        grid_lay.addWidget(self.method_cb, 1, 1)
        # self.reload_pb = QtWidgets.QPushButton('Reload')
        # self.reload_pb.clicked.connect(self.new_sankey)
        # grid_lay.addWidget(self.reload_pb, 2, 0)
        # self.close_pb = QtWidgets.QPushButton('Close')
        # self.close_pb.clicked.connect(self.switch_to_main)

        # grid_lay.addWidget(self.close_pb, 0, 5)
        # self.color_attr_cb = QtWidgets.QComboBox()
        # self.color_attr_cb.addItems(['flow', 'location', 'name'])
        # grid_lay.addWidget(QtWidgets.QLabel('color by: '), 0, 2)
        # grid_lay.addWidget(self.color_attr_cb, 0, 3)

        # cut-off
        grid_lay.addWidget(QtWidgets.QLabel('cutoff: '), 1, 2)
        self.cutoff_sb.setRange(0.0, 1.0)
        self.cutoff_sb.setSingleStep(0.001)
        self.cutoff_sb.setDecimals(4)
        self.cutoff_sb.setValue(0.05)
        self.cutoff_sb.setKeyboardTracking(False)
        grid_lay.addWidget(self.cutoff_sb, 1, 3)

        # max-iterations of graph traversal
        grid_lay.addWidget(QtWidgets.QLabel('Calculation depth: '), 1, 4)
        self.max_calc_sb.setRange(1, 2000)
        self.max_calc_sb.setSingleStep(50)
        self.max_calc_sb.setDecimals(0)
        self.max_calc_sb.setValue(250)
        self.max_calc_sb.setKeyboardTracking(False)
        grid_lay.addWidget(self.max_calc_sb, 1, 5)

        grid_lay.setColumnStretch(6, 1)
        hlay = QtWidgets.QHBoxLayout()
        hlay.addLayout(grid_lay)

        # checkbox cumulative impact
        # self.checkbox_cumulative_impact = QtWidgets.QCheckBox("Cumulative impact")
        # self.checkbox_cumulative_impact.setChecked(True)

        # Controls Layout
        hl_controls = QtWidgets.QHBoxLayout()
        hl_controls.addWidget(self.button_back)
        hl_controls.addWidget(self.button_forward)
        hl_controls.addWidget(self.button_calculate)
        hl_controls.addWidget(self.button_refresh)
        hl_controls.addWidget(self.button_random_activity)
        hl_controls.addWidget(self.button_toggle_help)
        hl_controls.addStretch(1)

        # Checkboxes Layout
        # self.hl_checkboxes = QtWidgets.QHBoxLayout()
        # self.hl_checkboxes.addWidget(self.checkbox_cumulative_impact)
        # self.hl_checkboxes.addStretch(1)

        # Layout
        self.layout.addLayout(hl_controls)
        self.layout.addLayout(hlay)
        # self.vlay.addLayout(self.hl_checkboxes)
        self.layout.addWidget(self.label_help)
        self.layout.addWidget(self.view)
        self.setLayout(self.layout)
    def __init__(self, main_win, lib):
        AbstractWidget.__init__(self, main_win=main_win, lib=lib)

        lbl_width = 60

        # create the overall layout
        self.main_layout = QtWidgets.QVBoxLayout()
        self.frame.setLayout(self.main_layout)

        # - active setup
        hbox = QtWidgets.QHBoxLayout()
        self.main_layout.addLayout(hbox)
        hbox.addStretch()
        self.active_label = QtWidgets.QLabel()
        hbox.addWidget(self.active_label)
        hbox.addStretch()

        # - list of setups
        hbox = QtWidgets.QHBoxLayout()
        self.main_layout.addLayout(hbox)

        # -- label
        vbox = QtWidgets.QVBoxLayout()
        hbox.addLayout(vbox)
        vbox.addStretch()
        label = QtWidgets.QLabel("Profiles:")
        label.setFixedWidth(lbl_width)
        vbox.addWidget(label)
        vbox.addStretch()

        # -- list
        self.ssp_list = QtWidgets.QTableWidget()
        self.ssp_list.setSortingEnabled(True)
        self.ssp_list.setFocus()
        self.ssp_list.setSelectionBehavior(
            QtWidgets.QAbstractItemView.SelectRows)
        self.ssp_list.setSelectionMode(
            QtWidgets.QAbstractItemView.ExtendedSelection)
        self.ssp_list.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        # noinspection PyUnresolvedReferences
        self.ssp_list.customContextMenuRequested.connect(
            self.make_context_menu)
        # noinspection PyUnresolvedReferences
        self.ssp_list.itemDoubleClicked.connect(self.load_profile)
        hbox.addWidget(self.ssp_list)

        # - RIGHT COLUMN
        right_vbox = QtWidgets.QVBoxLayout()
        hbox.addLayout(right_vbox)

        # -- project box
        self.project_box = QtWidgets.QGroupBox("Project")
        right_vbox.addWidget(self.project_box)
        # --- manage button box
        project_vbox = QtWidgets.QVBoxLayout()
        self.project_box.setLayout(project_vbox)
        # noinspection PyUnresolvedReferences
        self.manage_btn_box = QtWidgets.QDialogButtonBox(QtCore.Qt.Vertical)
        project_vbox.addWidget(self.manage_btn_box)

        # ---- new project
        self.btn_new_project = QtWidgets.QPushButton("New project")
        # noinspection PyUnresolvedReferences
        self.btn_new_project.clicked.connect(self.new_project)
        self.btn_new_project.setToolTip("Create a new project")
        self.manage_btn_box.addButton(self.btn_new_project,
                                      QtWidgets.QDialogButtonBox.ActionRole)
        self.new_project_act = QtWidgets.QAction('New Project DB', self)
        self.new_project_act.setShortcut('Ctrl+N')
        # noinspection PyUnresolvedReferences
        self.new_project_act.triggered.connect(self.new_project)
        self.main_win.database_menu.addAction(self.new_project_act)

        # ---- rename project
        self.btn_rename_project = QtWidgets.QPushButton("Rename project")
        # noinspection PyUnresolvedReferences
        self.btn_rename_project.clicked.connect(self.rename_project)
        self.btn_rename_project.setToolTip("Rename the current project")
        self.manage_btn_box.addButton(self.btn_rename_project,
                                      QtWidgets.QDialogButtonBox.ActionRole)
        self.rename_project_act = QtWidgets.QAction(
            'Rename Current Project DB', self)
        # self.rename_project_act.setShortcut('Ctrl+R')
        # noinspection PyUnresolvedReferences
        self.rename_project_act.triggered.connect(self.rename_project)
        self.main_win.database_menu.addAction(self.rename_project_act)

        # ---- load project
        self.btn_load_project = QtWidgets.QPushButton("Switch project")
        # noinspection PyUnresolvedReferences
        self.btn_load_project.clicked.connect(self.switch_project)
        self.btn_load_project.setToolTip("Switch to another existing project")
        self.manage_btn_box.addButton(self.btn_load_project,
                                      QtWidgets.QDialogButtonBox.ActionRole)
        self.load_project_act = QtWidgets.QAction('Switch Project DB', self)
        # self.load_project_act.setShortcut('Ctrl+L')
        # noinspection PyUnresolvedReferences
        self.load_project_act.triggered.connect(self.switch_project)
        self.main_win.database_menu.addAction(self.load_project_act)

        # ---- import data
        self.btn_import_data = QtWidgets.QPushButton("Import data")
        # noinspection PyUnresolvedReferences
        self.btn_import_data.clicked.connect(self.import_data)
        self.btn_import_data.setToolTip("Import data from another project")
        self.manage_btn_box.addButton(self.btn_import_data,
                                      QtWidgets.QDialogButtonBox.ActionRole)
        self.import_data_act = QtWidgets.QAction('Import Data from Project DB',
                                                 self)
        # self.import_data_act.setShortcut('Ctrl+I')
        # noinspection PyUnresolvedReferences
        self.import_data_act.triggered.connect(self.import_data)
        self.main_win.database_menu.addAction(self.import_data_act)

        # ---- project folder
        self.btn_project_folder = QtWidgets.QPushButton("Open folder")
        # noinspection PyUnresolvedReferences
        self.btn_project_folder.clicked.connect(self.project_folder)
        self.btn_project_folder.setToolTip("Open projects folder")
        self.manage_btn_box.addButton(self.btn_project_folder,
                                      QtWidgets.QDialogButtonBox.ActionRole)
        self.project_folder_act = QtWidgets.QAction('Open Projects DB Folder',
                                                    self)
        # self.project_folder_act.setShortcut('Ctrl+P')
        # noinspection PyUnresolvedReferences
        self.project_folder_act.triggered.connect(self.project_folder)
        self.main_win.database_menu.addAction(self.project_folder_act)

        # ---- refresh DB
        self.btn_refresh_db = QtWidgets.QPushButton("Refresh DB")
        # noinspection PyUnresolvedReferences
        self.btn_refresh_db.clicked.connect(self.update_table)
        self.btn_refresh_db.setToolTip("Refresh DB entries")
        self.manage_btn_box.addButton(self.btn_refresh_db,
                                      QtWidgets.QDialogButtonBox.ActionRole)
        self.refresh_db_act = QtWidgets.QAction('Open Projects DB Folder',
                                                self)
        # noinspection PyUnresolvedReferences
        self.refresh_db_act.triggered.connect(self.update_table)
        self.main_win.database_menu.addAction(self.refresh_db_act)

        right_vbox.addStretch()
        right_vbox.addStretch()

        # -- profiles box
        self.profiles_box = QtWidgets.QGroupBox("Profiles")
        right_vbox.addWidget(self.profiles_box)

        # --- manage button box
        profiles_vbox = QtWidgets.QVBoxLayout()
        self.profiles_box.setLayout(profiles_vbox)
        # noinspection PyUnresolvedReferences
        self.product_btn_box = QtWidgets.QDialogButtonBox(QtCore.Qt.Vertical)
        profiles_vbox.addWidget(self.product_btn_box)

        # ---- import profiles
        btn = QtWidgets.QPushButton("Import profiles")
        # noinspection PyUnresolvedReferences
        btn.clicked.connect(self.import_profiles)
        btn.setToolTip("Import multiple profiles")
        self.product_btn_box.addButton(btn,
                                       QtWidgets.QDialogButtonBox.ActionRole)
        self.import_profiles_act = QtWidgets.QAction(
            'Import Multiple Profiles', self)
        self.import_profiles_act.setShortcut('Ctrl+I')
        # noinspection PyUnresolvedReferences
        self.import_profiles_act.triggered.connect(self.import_profiles)
        self.main_win.database_menu.addSeparator()
        self.main_win.database_menu.addAction(self.import_profiles_act)

        # ---- export profiles
        btn = QtWidgets.QPushButton("Export profiles")
        # noinspection PyUnresolvedReferences
        btn.clicked.connect(self.export_profile_switch)
        btn.setToolTip("Export profile data")
        self.product_btn_box.addButton(btn,
                                       QtWidgets.QDialogButtonBox.ActionRole)
        self.export_profiles_act = QtWidgets.QAction(
            'Export Multiple Profiles', self)
        self.export_profiles_act.setShortcut('Ctrl+X')
        # noinspection PyUnresolvedReferences
        self.export_profiles_act.triggered.connect(self.export_profile_switch)
        self.main_win.database_menu.addAction(self.export_profiles_act)

        # ---- plot profiles
        btn = QtWidgets.QPushButton("Make plots")
        # noinspection PyUnresolvedReferences
        btn.clicked.connect(self.plot_profiles)
        btn.setToolTip("Create plots with all the profiles")
        self.product_btn_box.addButton(btn,
                                       QtWidgets.QDialogButtonBox.ActionRole)
        self.plot_profiles_act = QtWidgets.QAction('Make Plots from Data',
                                                   self)
        # self.plot_profiles_act.setShortcut('Ctrl+P')
        # noinspection PyUnresolvedReferences
        self.plot_profiles_act.triggered.connect(self.plot_profiles)
        self.main_win.database_menu.addAction(self.plot_profiles_act)

        # ---- export metadata
        btn = QtWidgets.QPushButton("Export info")
        # noinspection PyUnresolvedReferences
        btn.clicked.connect(self.export_profile_metadata)
        btn.setToolTip("Export profile locations and metadata")
        self.product_btn_box.addButton(btn,
                                       QtWidgets.QDialogButtonBox.ActionRole)
        self.export_profile_metadata_act = QtWidgets.QAction(
            'Export Data Info', self)
        # self.export_profile_metadata_act.setShortcut('Ctrl+D')
        # noinspection PyUnresolvedReferences
        self.export_profile_metadata_act.triggered.connect(
            self.export_profile_metadata)
        self.main_win.database_menu.addAction(self.export_profile_metadata_act)

        # ---- output folder
        btn = QtWidgets.QPushButton("Output folder")
        # noinspection PyUnresolvedReferences
        btn.clicked.connect(self.output_folder)
        btn.setToolTip("Open the output folder")
        self.product_btn_box.addButton(btn,
                                       QtWidgets.QDialogButtonBox.ActionRole)
        self.output_folder_act = QtWidgets.QAction('Open Output Folder', self)
        # self.output_folder_act.setShortcut('Ctrl+O')
        # noinspection PyUnresolvedReferences
        self.output_folder_act.triggered.connect(self.output_folder)
        self.main_win.database_menu.addAction(self.output_folder_act)

        # self.main_layout.addStretch()

        self.update_table()
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(579, 505)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setSizeConstraint(
            QtWidgets.QLayout.SetDefaultConstraint)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.label = QtWidgets.QLabel(self.centralwidget)
        self.label.setMaximumSize(QtCore.QSize(120, 16777215))
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label.setFont(font)
        self.label.setObjectName("label")
        self.horizontalLayout.addWidget(self.label)
        self.combobox_comport = QtWidgets.QComboBox(self.centralwidget)
        self.combobox_comport.setMaximumSize(QtCore.QSize(100, 16777215))
        self.combobox_comport.setObjectName("combobox_comport")
        self.horizontalLayout.addWidget(self.combobox_comport)
        self.btn_search_ports = QtWidgets.QPushButton(self.centralwidget)
        self.btn_search_ports.setMaximumSize(QtCore.QSize(50, 16777215))
        self.btn_search_ports.setObjectName("btn_search_ports")
        self.horizontalLayout.addWidget(self.btn_search_ports)
        self.btn_connect = QtWidgets.QPushButton(self.centralwidget)
        self.btn_connect.setMaximumSize(QtCore.QSize(100, 16777215))
        self.btn_connect.setObjectName("btn_connect")
        self.horizontalLayout.addWidget(self.btn_connect)
        self.horizontalLayout_14 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_14.setObjectName("horizontalLayout_14")
        self.label_connected = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setPointSize(12)
        self.label_connected.setFont(font)
        self.label_connected.setObjectName("label_connected")
        self.horizontalLayout_14.addWidget(self.label_connected)
        self.horizontalLayout.addLayout(self.horizontalLayout_14)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.line = QtWidgets.QFrame(self.centralwidget)
        self.line.setFrameShape(QtWidgets.QFrame.HLine)
        self.line.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line.setObjectName("line")
        self.verticalLayout.addWidget(self.line)
        self.f1_layout = QtWidgets.QHBoxLayout()
        self.f1_layout.setObjectName("f1_layout")
        self.f1_label = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.f1_label.setFont(font)
        self.f1_label.setObjectName("f1_label")
        self.f1_layout.addWidget(self.f1_label)
        self.f1_shortcut_field = QtWidgets.QLineEdit(self.centralwidget)
        self.f1_shortcut_field.setReadOnly(True)
        self.f1_shortcut_field.setObjectName("f1_shortcut_field")
        self.f1_layout.addWidget(self.f1_shortcut_field)
        self.btn_f1_set = QtWidgets.QPushButton(self.centralwidget)
        self.btn_f1_set.setObjectName("btn_f1_set")
        self.f1_layout.addWidget(self.btn_f1_set)
        self.btn_f1_delete = QtWidgets.QPushButton(self.centralwidget)
        self.btn_f1_delete.setObjectName("btn_f1_delete")
        self.f1_layout.addWidget(self.btn_f1_delete)
        self.btn_debug_f1 = QtWidgets.QPushButton(self.centralwidget)
        self.btn_debug_f1.setObjectName("btn_debug_f1")
        self.f1_layout.addWidget(self.btn_debug_f1)
        self.verticalLayout.addLayout(self.f1_layout)
        self.f2_layout = QtWidgets.QHBoxLayout()
        self.f2_layout.setObjectName("f2_layout")
        self.f2_label = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.f2_label.setFont(font)
        self.f2_label.setObjectName("f2_label")
        self.f2_layout.addWidget(self.f2_label)
        self.f2_shortcut_field = QtWidgets.QLineEdit(self.centralwidget)
        self.f2_shortcut_field.setReadOnly(True)
        self.f2_shortcut_field.setObjectName("f2_shortcut_field")
        self.f2_layout.addWidget(self.f2_shortcut_field)
        self.btn_f2_set = QtWidgets.QPushButton(self.centralwidget)
        self.btn_f2_set.setObjectName("btn_f2_set")
        self.f2_layout.addWidget(self.btn_f2_set)
        self.btn_f2_delete = QtWidgets.QPushButton(self.centralwidget)
        self.btn_f2_delete.setObjectName("btn_f2_delete")
        self.f2_layout.addWidget(self.btn_f2_delete)
        self.btn_debug_f2 = QtWidgets.QPushButton(self.centralwidget)
        self.btn_debug_f2.setObjectName("btn_debug_f2")
        self.f2_layout.addWidget(self.btn_debug_f2)
        self.verticalLayout.addLayout(self.f2_layout)
        self.f3_layout = QtWidgets.QHBoxLayout()
        self.f3_layout.setObjectName("f3_layout")
        self.f3_label = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.f3_label.setFont(font)
        self.f3_label.setObjectName("f3_label")
        self.f3_layout.addWidget(self.f3_label)
        self.f3_shortcut_field = QtWidgets.QLineEdit(self.centralwidget)
        self.f3_shortcut_field.setReadOnly(True)
        self.f3_shortcut_field.setObjectName("f3_shortcut_field")
        self.f3_layout.addWidget(self.f3_shortcut_field)
        self.btn_f3_set = QtWidgets.QPushButton(self.centralwidget)
        self.btn_f3_set.setObjectName("btn_f3_set")
        self.f3_layout.addWidget(self.btn_f3_set)
        self.btn_f3_delete = QtWidgets.QPushButton(self.centralwidget)
        self.btn_f3_delete.setObjectName("btn_f3_delete")
        self.f3_layout.addWidget(self.btn_f3_delete)
        self.btn_debug_f3 = QtWidgets.QPushButton(self.centralwidget)
        self.btn_debug_f3.setObjectName("btn_debug_f3")
        self.f3_layout.addWidget(self.btn_debug_f3)
        self.verticalLayout.addLayout(self.f3_layout)
        self.f4_layout = QtWidgets.QHBoxLayout()
        self.f4_layout.setObjectName("f4_layout")
        self.f4_label = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.f4_label.setFont(font)
        self.f4_label.setObjectName("f4_label")
        self.f4_layout.addWidget(self.f4_label)
        self.f4_shortcut_field = QtWidgets.QLineEdit(self.centralwidget)
        self.f4_shortcut_field.setReadOnly(True)
        self.f4_shortcut_field.setObjectName("f4_shortcut_field")
        self.f4_layout.addWidget(self.f4_shortcut_field)
        self.btn_f4_set = QtWidgets.QPushButton(self.centralwidget)
        self.btn_f4_set.setObjectName("btn_f4_set")
        self.f4_layout.addWidget(self.btn_f4_set)
        self.btn_f4_delete = QtWidgets.QPushButton(self.centralwidget)
        self.btn_f4_delete.setObjectName("btn_f4_delete")
        self.f4_layout.addWidget(self.btn_f4_delete)
        self.btn_debug_f4 = QtWidgets.QPushButton(self.centralwidget)
        self.btn_debug_f4.setObjectName("btn_debug_f4")
        self.f4_layout.addWidget(self.btn_debug_f4)
        self.verticalLayout.addLayout(self.f4_layout)
        self.f5_layout = QtWidgets.QHBoxLayout()
        self.f5_layout.setObjectName("f5_layout")
        self.f5_label = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.f5_label.setFont(font)
        self.f5_label.setObjectName("f5_label")
        self.f5_layout.addWidget(self.f5_label)
        self.f5_shortcut_field = QtWidgets.QLineEdit(self.centralwidget)
        self.f5_shortcut_field.setReadOnly(True)
        self.f5_shortcut_field.setObjectName("f5_shortcut_field")
        self.f5_layout.addWidget(self.f5_shortcut_field)
        self.btn_f5_set = QtWidgets.QPushButton(self.centralwidget)
        self.btn_f5_set.setObjectName("btn_f5_set")
        self.f5_layout.addWidget(self.btn_f5_set)
        self.btn_f5_delete = QtWidgets.QPushButton(self.centralwidget)
        self.btn_f5_delete.setObjectName("btn_f5_delete")
        self.f5_layout.addWidget(self.btn_f5_delete)
        self.btn_debug_f5 = QtWidgets.QPushButton(self.centralwidget)
        self.btn_debug_f5.setObjectName("btn_debug_f5")
        self.f5_layout.addWidget(self.btn_debug_f5)
        self.verticalLayout.addLayout(self.f5_layout)
        self.f6_layout = QtWidgets.QHBoxLayout()
        self.f6_layout.setObjectName("f6_layout")
        self.f6_label = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.f6_label.setFont(font)
        self.f6_label.setObjectName("f6_label")
        self.f6_layout.addWidget(self.f6_label)
        self.f6_shortcut_field = QtWidgets.QLineEdit(self.centralwidget)
        self.f6_shortcut_field.setReadOnly(True)
        self.f6_shortcut_field.setObjectName("f6_shortcut_field")
        self.f6_layout.addWidget(self.f6_shortcut_field)
        self.btn_f6_set = QtWidgets.QPushButton(self.centralwidget)
        self.btn_f6_set.setObjectName("btn_f6_set")
        self.f6_layout.addWidget(self.btn_f6_set)
        self.btn_f6_delete = QtWidgets.QPushButton(self.centralwidget)
        self.btn_f6_delete.setObjectName("btn_f6_delete")
        self.f6_layout.addWidget(self.btn_f6_delete)
        self.btn_debug_f6 = QtWidgets.QPushButton(self.centralwidget)
        self.btn_debug_f6.setObjectName("btn_debug_f6")
        self.f6_layout.addWidget(self.btn_debug_f6)
        self.verticalLayout.addLayout(self.f6_layout)
        self.f7_layout = QtWidgets.QHBoxLayout()
        self.f7_layout.setObjectName("f7_layout")
        self.f7_label = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.f7_label.setFont(font)
        self.f7_label.setObjectName("f7_label")
        self.f7_layout.addWidget(self.f7_label)
        self.f7_shortcut_field = QtWidgets.QLineEdit(self.centralwidget)
        self.f7_shortcut_field.setReadOnly(True)
        self.f7_shortcut_field.setObjectName("f7_shortcut_field")
        self.f7_layout.addWidget(self.f7_shortcut_field)
        self.btn_f7_set = QtWidgets.QPushButton(self.centralwidget)
        self.btn_f7_set.setObjectName("btn_f7_set")
        self.f7_layout.addWidget(self.btn_f7_set)
        self.btn_f7_delete = QtWidgets.QPushButton(self.centralwidget)
        self.btn_f7_delete.setObjectName("btn_f7_delete")
        self.f7_layout.addWidget(self.btn_f7_delete)
        self.btn_debug_f7 = QtWidgets.QPushButton(self.centralwidget)
        self.btn_debug_f7.setObjectName("btn_debug_f7")
        self.f7_layout.addWidget(self.btn_debug_f7)
        self.verticalLayout.addLayout(self.f7_layout)
        self.f8_layout = QtWidgets.QHBoxLayout()
        self.f8_layout.setObjectName("f8_layout")
        self.f8_label = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.f8_label.setFont(font)
        self.f8_label.setObjectName("f8_label")
        self.f8_layout.addWidget(self.f8_label)
        self.f8_shortcut_field = QtWidgets.QLineEdit(self.centralwidget)
        self.f8_shortcut_field.setReadOnly(True)
        self.f8_shortcut_field.setObjectName("f8_shortcut_field")
        self.f8_layout.addWidget(self.f8_shortcut_field)
        self.btn_f8_set = QtWidgets.QPushButton(self.centralwidget)
        self.btn_f8_set.setObjectName("btn_f8_set")
        self.f8_layout.addWidget(self.btn_f8_set)
        self.btn_f8_delete = QtWidgets.QPushButton(self.centralwidget)
        self.btn_f8_delete.setObjectName("btn_f8_delete")
        self.f8_layout.addWidget(self.btn_f8_delete)
        self.btn_debug_f8 = QtWidgets.QPushButton(self.centralwidget)
        self.btn_debug_f8.setObjectName("btn_debug_f8")
        self.f8_layout.addWidget(self.btn_debug_f8)
        self.verticalLayout.addLayout(self.f8_layout)
        self.f9_layout = QtWidgets.QHBoxLayout()
        self.f9_layout.setObjectName("f9_layout")
        self.f9_label = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.f9_label.setFont(font)
        self.f9_label.setObjectName("f9_label")
        self.f9_layout.addWidget(self.f9_label)
        self.f9_shortcut_field = QtWidgets.QLineEdit(self.centralwidget)
        self.f9_shortcut_field.setReadOnly(True)
        self.f9_shortcut_field.setObjectName("f9_shortcut_field")
        self.f9_layout.addWidget(self.f9_shortcut_field)
        self.btn_f9_set = QtWidgets.QPushButton(self.centralwidget)
        self.btn_f9_set.setObjectName("btn_f9_set")
        self.f9_layout.addWidget(self.btn_f9_set)
        self.btn_f9_delete = QtWidgets.QPushButton(self.centralwidget)
        self.btn_f9_delete.setObjectName("btn_f9_delete")
        self.f9_layout.addWidget(self.btn_f9_delete)
        self.btn_debug_f9 = QtWidgets.QPushButton(self.centralwidget)
        self.btn_debug_f9.setObjectName("btn_debug_f9")
        self.f9_layout.addWidget(self.btn_debug_f9)
        self.verticalLayout.addLayout(self.f9_layout)
        self.f10_layout = QtWidgets.QHBoxLayout()
        self.f10_layout.setObjectName("f10_layout")
        self.f10_label = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.f10_label.setFont(font)
        self.f10_label.setObjectName("f10_label")
        self.f10_layout.addWidget(self.f10_label)
        self.f10_shortcut_field = QtWidgets.QLineEdit(self.centralwidget)
        self.f10_shortcut_field.setReadOnly(True)
        self.f10_shortcut_field.setObjectName("f10_shortcut_field")
        self.f10_layout.addWidget(self.f10_shortcut_field)
        self.btn_f10_set = QtWidgets.QPushButton(self.centralwidget)
        self.btn_f10_set.setObjectName("btn_f10_set")
        self.f10_layout.addWidget(self.btn_f10_set)
        self.btn_f10_delete = QtWidgets.QPushButton(self.centralwidget)
        self.btn_f10_delete.setObjectName("btn_f10_delete")
        self.f10_layout.addWidget(self.btn_f10_delete)
        self.btn_debug_f10 = QtWidgets.QPushButton(self.centralwidget)
        self.btn_debug_f10.setObjectName("btn_debug_f10")
        self.f10_layout.addWidget(self.btn_debug_f10)
        self.verticalLayout.addLayout(self.f10_layout)
        self.f11_layout = QtWidgets.QHBoxLayout()
        self.f11_layout.setObjectName("f11_layout")
        self.f11_label = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.f11_label.setFont(font)
        self.f11_label.setObjectName("f11_label")
        self.f11_layout.addWidget(self.f11_label)
        self.f11_shortcut_field = QtWidgets.QLineEdit(self.centralwidget)
        self.f11_shortcut_field.setReadOnly(True)
        self.f11_shortcut_field.setObjectName("f11_shortcut_field")
        self.f11_layout.addWidget(self.f11_shortcut_field)
        self.btn_f11_set = QtWidgets.QPushButton(self.centralwidget)
        self.btn_f11_set.setObjectName("btn_f11_set")
        self.f11_layout.addWidget(self.btn_f11_set)
        self.btn_f11_delete = QtWidgets.QPushButton(self.centralwidget)
        self.btn_f11_delete.setObjectName("btn_f11_delete")
        self.f11_layout.addWidget(self.btn_f11_delete)
        self.btn_debug_f11 = QtWidgets.QPushButton(self.centralwidget)
        self.btn_debug_f11.setObjectName("btn_debug_f11")
        self.f11_layout.addWidget(self.btn_debug_f11)
        self.verticalLayout.addLayout(self.f11_layout)
        self.f12_layout = QtWidgets.QHBoxLayout()
        self.f12_layout.setObjectName("f12_layout")
        self.f12_label = QtWidgets.QLabel(self.centralwidget)
        font = QtGui.QFont()
        font.setPointSize(10)
        self.f12_label.setFont(font)
        self.f12_label.setObjectName("f12_label")
        self.f12_layout.addWidget(self.f12_label)
        self.f12_shortcut_field = QtWidgets.QLineEdit(self.centralwidget)
        self.f12_shortcut_field.setReadOnly(True)
        self.f12_shortcut_field.setObjectName("f12_shortcut_field")
        self.f12_layout.addWidget(self.f12_shortcut_field)
        self.btn_f12_set = QtWidgets.QPushButton(self.centralwidget)
        self.btn_f12_set.setObjectName("btn_f12_set")
        self.f12_layout.addWidget(self.btn_f12_set)
        self.btn_f12_delete = QtWidgets.QPushButton(self.centralwidget)
        self.btn_f12_delete.setObjectName("btn_f12_delete")
        self.f12_layout.addWidget(self.btn_f12_delete)
        self.btn_debug_f12 = QtWidgets.QPushButton(self.centralwidget)
        self.btn_debug_f12.setObjectName("btn_debug_f12")
        self.f12_layout.addWidget(self.btn_debug_f12)
        self.verticalLayout.addLayout(self.f12_layout)
        self.line_2 = QtWidgets.QFrame(self.centralwidget)
        self.line_2.setFrameShape(QtWidgets.QFrame.HLine)
        self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
        self.line_2.setObjectName("line_2")
        self.verticalLayout.addWidget(self.line_2)
        self.btn_setcolor = QtWidgets.QPushButton(self.centralwidget)
        self.btn_setcolor.setObjectName("btn_setcolor")
        self.verticalLayout.addWidget(self.btn_setcolor)
        MainWindow.setCentralWidget(self.centralwidget)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)
        self.menuBar = QtWidgets.QMenuBar(MainWindow)
        self.menuBar.setGeometry(QtCore.QRect(0, 0, 579, 22))
        self.menuBar.setObjectName("menuBar")
        self.menuMenu = QtWidgets.QMenu(self.menuBar)
        self.menuMenu.setObjectName("menuMenu")
        self.menu_bar = QtWidgets.QMenu(self.menuMenu)
        self.menu_bar.setObjectName("menu_bar")
        MainWindow.setMenuBar(self.menuBar)
        self.actionEnable_debug = QtWidgets.QAction(MainWindow)
        self.actionEnable_debug.setObjectName("actionEnable_debug")
        self.actiondefault = QtWidgets.QAction(MainWindow)
        self.actiondefault.setObjectName("actiondefault")
        self.menu_bar.addAction(self.actiondefault)
        self.menuMenu.addAction(self.menu_bar.menuAction())
        self.menuMenu.addAction(self.actionEnable_debug)
        self.menuBar.addAction(self.menuMenu.menuAction())

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
Beispiel #6
0
    def makeWidget(self, qscreen: QtGui.QScreen, geom: tuple = ()):
        # (re)create the widget, do the same for children
        # how children are placed on the parent widget, depends on the subclass
        self.window = self.ContainerWindow(self.signals, self.title,
                                           self.parent)

        # send to correct x-screen
        self.window.show()
        self.window.windowHandle().setScreen(qscreen)
        self.n_xscreen = self.gpu_handler.getXScreenNum(
            qscreen
        )  # the correct x-screen number must be passed upstream, to the VideoContainer

        # continue window / widget construction in the correct x screen
        self.main_widget = self.ContainerWidget(self.window)  # a QTabWidget
        self.main_layout = QtWidgets.QVBoxLayout(self.main_widget)
        self.window.setCentralWidget(self.main_widget)

        if len(geom) >= 4:
            self.window.setGeometry(geom[0], geom[1], geom[2], geom[3])

        # create tabs
        self.play_video_tab = QtWidgets.QWidget(None)
        self.play_video_lay = QtWidgets.QVBoxLayout(self.play_video_tab)

        self.calendar_tab = QtWidgets.QWidget(None)
        self.calendar_lay = QtWidgets.QVBoxLayout(self.calendar_tab)

        self.main_widget.addTab(self.play_video_tab, "Recordings")
        self.main_widget.addTab(self.calendar_tab, "Calendar")

        # **** Recordings tab *****
        # create the grid into "the Recordings" tab (self.play_video_tab)
        self.grid_widget = self.GridWidget(self.play_video_tab)
        self.play_video_lay.addWidget(self.grid_widget)

        self.grid_layout = QtWidgets.QGridLayout(self.grid_widget)
        self.grid_layout.setHorizontalSpacing(2)
        self.grid_layout.setVerticalSpacing(2)
        # ( int left, int top, int right, int bottom )
        self.grid_layout.setContentsMargins(0, 0, 0, 0)

        # put timeline widget under the grid
        self.timelinewidget = TimeLineWidget(datetime.date.today(),
                                             parent=self.play_video_tab)
        # self.timelinewidget.setLogLevel(logging.DEBUG)
        self.play_video_lay.addWidget(self.timelinewidget)

        # put buttons under the timeline
        self.buttons = QtWidgets.QWidget(self.play_video_tab)
        self.buttons_lay = QtWidgets.QHBoxLayout(self.buttons)

        self.play_video_lay.addWidget(self.buttons)

        self.play_button = QtWidgets.QPushButton("play", self.buttons)
        self.stop_button = QtWidgets.QPushButton("stop", self.buttons)
        self.zoom_to_fs_button = QtWidgets.QPushButton("limits", self.buttons)

        self.buttons_lay.addWidget(self.play_button)
        self.buttons_lay.addWidget(self.stop_button)
        self.buttons_lay.addWidget(self.zoom_to_fs_button)

        # **** Calendar tab *****
        # put the calendar into the "Calendar" tab (self.calendar_tab)
        # calendar
        self.calendarwidget = CalendarWidget(datetime.date.today(),
                                             parent=self.calendar_tab)
        self.calendar_lay.addWidget(self.calendarwidget)
        """
        self.playback_controller = PlaybackController(
            calendar_widget     = self.calendarwidget,
            timeline_widget     = self.timelinewidget,
            valkkafs_manager    = self.valkkafsmanager,
            play_button         = self.play_button,
            stop_button         = self.stop_button
            )
        """
        self.widget_set = WidgetSet(calendar_widget=self.calendarwidget,
                                    timeline_widget=self.timelinewidget,
                                    play_button=self.play_button,
                                    stop_button=self.stop_button,
                                    zoom_to_fs_button=self.zoom_to_fs_button)
        self.playback_controller.register(self.widget_set)

        class ScreenMenu(QuickMenu):
            title = "Change Screen"
            elements = [
                QuickMenuElement(title="Screen 1"),
                QuickMenuElement(title="Screen 2")
            ]

        """ TODO: activate after gpu-hopping has been debugged
        self.screenmenu = ScreenMenu(self.window)
        self.screenmenu.screen_1.triggered.connect(self.test_slot)
        self.screenmenu.screen_2.triggered.connect(self.test_slot)
        """

        if (len(self.gpu_handler.true_screens) > 1):
            # so, there's more than a single x screen: create a button for
            # changing x-screens
            self.button = QtWidgets.QPushButton("Change Screen",
                                                self.main_widget)
            self.main_layout.addWidget(self.button)
            self.button.setSizePolicy(QtWidgets.QSizePolicy.Minimum,
                                      QtWidgets.QSizePolicy.Minimum)
            self.button.clicked.connect(self.change_xscreen_slot)

        self.placeChildren()
Beispiel #7
0
    def setup_ui(self):
        self.mesh_to_follow.textChanged.connect(self.ctrl.on_mesh_to_follow_changed)

        self.top_selection_view.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
        self.top_selection.setStringList(self.model.top_selection)
        self.top_selection_view.setModel(self.top_selection)

        self.set_top_btn.clicked.connect(self.ctrl.set_top_selection)
        self.add_top_btn.clicked.connect(self.ctrl.add_top_selection)
        self.remove_top_btn.clicked.connect(self.ctrl.remove_from_top_selection)

        self.bot_selection_view.setSelectionMode(QtWidgets.QAbstractItemView.ExtendedSelection)
        self.bot_selection.setStringList(self.model.bot_selection)
        self.bot_selection_view.setModel(self.bot_selection)

        self.set_bot_btn.clicked.connect(self.ctrl.set_bot_selection)
        self.add_bot_btn.clicked.connect(self.ctrl.add_bot_selection)
        self.remove_bot_btn.clicked.connect(self.ctrl.remove_from_bot_selection)

        self.top_creation_switch.stateChanged.connect(self.ctrl.on_top_creation_switch_changed)
        self.bot_creation_switch.stateChanged.connect(self.ctrl.on_bot_creation_switch_changed)

        self.how_many_top_ctrls_cbbox.insertItems(0, ["5", "7"])
        self.how_many_top_ctrls_cbbox.currentTextChanged.connect(self.ctrl.on_how_many_top_ctrls_cbbox_changed)
        self.how_many_bot_ctrls_cbbox.insertItems(0, ["5", "7"])
        self.how_many_bot_ctrls_cbbox.currentTextChanged.connect(self.ctrl.on_how_many_bot_ctrls_cbbox_changed)

        self.loft_axis_cbbox.insertItems(0, ["X", "Y", "Z"])
        self.loft_axis_cbbox.currentTextChanged.connect(self.ctrl.on_loft_axis_cbbox_changed)

        self.set_mesh_btn.clicked.connect(self.ctrl.set_mesh_to_follow)

        self.prebuild_btn.clicked.connect(self.ctrl.prebuild)

        main_layout = QtWidgets.QVBoxLayout()

        mesh_to_follow_layout = QtWidgets.QVBoxLayout()
        mesh_to_follow_grp = grpbox("Mesh to attach the ctrls to:", mesh_to_follow_layout)
        mesh_to_follow_layout.addWidget(self.mesh_to_follow)
        mesh_to_follow_layout.addWidget(self.set_mesh_btn)

        top_selection_layout = QtWidgets.QVBoxLayout()
        self.top_selection_grp = grpbox("Select top Components :", top_selection_layout)
        top_selection_layout.addWidget(self.set_top_btn)
        top_selection_layout.addWidget(self.top_selection_view)
        top_btn_layout = QtWidgets.QHBoxLayout()
        top_btn_layout.addWidget(self.add_top_btn)
        top_btn_layout.addWidget(self.remove_top_btn)
        top_selection_layout.addLayout(top_btn_layout)

        bot_selection_layout = QtWidgets.QVBoxLayout()
        self.bot_selection_grp = grpbox("Select bot Components :", bot_selection_layout)
        bot_selection_layout.addWidget(self.set_bot_btn)
        bot_selection_layout.addWidget(self.bot_selection_view)
        bot_btn_layout = QtWidgets.QHBoxLayout()
        bot_btn_layout.addWidget(self.add_bot_btn)
        bot_btn_layout.addWidget(self.remove_bot_btn)
        bot_selection_layout.addLayout(bot_btn_layout)

        top_switch_layout = QtWidgets.QHBoxLayout()
        top_switch_text = QtWidgets.QLabel("Create Top Ribbon:")
        top_switch_layout.addWidget(top_switch_text)
        top_switch_layout.addWidget(self.top_creation_switch)

        bot_switch_layout = QtWidgets.QHBoxLayout()
        bot_switch_text = QtWidgets.QLabel("Create Bot Ribbon:")
        bot_switch_layout.addWidget(bot_switch_text)
        bot_switch_layout.addWidget(self.bot_creation_switch)

        how_many_top_layout = QtWidgets.QVBoxLayout()
        self.how_many_top_grp = grpbox("How many ctrls :", how_many_top_layout)
        how_many_top_layout.addWidget(self.how_many_top_ctrls_cbbox)

        how_many_bot_layout = QtWidgets.QVBoxLayout()
        self.how_many_bot_grp = grpbox("How many ctrls :", how_many_bot_layout)
        how_many_bot_layout.addWidget(self.how_many_bot_ctrls_cbbox)

        loft_axis_layout = QtWidgets.QHBoxLayout()
        loft_axis_grp = grpbox("Ribbons surface's main Axis:", loft_axis_layout)
        loft_axis_layout.addWidget(self.loft_axis_cbbox)

        # options_layout = QtWidgets.QVBoxLayout()
        # options_grp = grpbox("Options", options_layout)
        #
        # ctrls_layout = QtWidgets.QVBoxLayout()
        # ctrls_text = QtWidgets.QLabel("Option :")
        # ctrls_layout.addWidget(ctrls_text)
        #
        # options_layout.addLayout(ctrls_layout)

        main_layout.addWidget(mesh_to_follow_grp)
        main_layout.addWidget(loft_axis_grp)
        main_layout.addLayout(top_switch_layout)
        main_layout.addWidget(self.how_many_top_grp)
        main_layout.addWidget(self.top_selection_grp)
        main_layout.addLayout(bot_switch_layout)
        main_layout.addWidget(self.how_many_bot_grp)
        main_layout.addWidget(self.bot_selection_grp)
        # main_layout.addWidget(options_grp)
        self.setLayout(main_layout)
Beispiel #8
0
    def setupUi(self, Frame, param_name, is_value_display_tb=False):
        self.Frame = Frame
        Frame.setObjectName(f"f_param_{param_name}")
        Frame.setFrameShadow(QtWidgets.QFrame.Raised)
        self.verticalLayout = QtWidgets.QVBoxLayout(Frame)
        self.verticalLayout.setContentsMargins(2, 2, 2, 2)
        self.verticalLayout.setObjectName(f"vl_param_{param_name}")

        self.line = QtWidgets.QFrame(Frame)
        self.line.setFrameShape(QtWidgets.QFrame.HLine)
        self.line.setFrameShadow(QtWidgets.QFrame.Plain)
        self.line.setObjectName(f"line_{param_name}")
        self.verticalLayout.addWidget(self.line)

        self.hl_param_generic_t = QtWidgets.QHBoxLayout()
        self.hl_param_generic_t.setSpacing(10)
        self.hl_param_generic_t.setObjectName(f"hl_param_{param_name}_t")
        self.t_param_generic = QtWidgets.QLabel(Frame)
        self.t_param_generic.setAlignment(QtCore.Qt.AlignLeading
                                          | QtCore.Qt.AlignLeft
                                          | QtCore.Qt.AlignTop)
        self.t_param_generic.setObjectName(f"t_param_{param_name}")
        self.hl_param_generic_t.addWidget(self.t_param_generic)
        self.t_param_generic_desc = QtWidgets.QLabel(Frame)
        sizePolicy = QtWidgets.QSizePolicy(
            QtWidgets.QSizePolicy.MinimumExpanding,
            QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.t_param_generic_desc.sizePolicy().hasHeightForWidth())
        self.t_param_generic_desc.setSizePolicy(sizePolicy)
        font = QtGui.QFont()
        font.setItalic(True)
        self.t_param_generic_desc.setFont(font)
        self.t_param_generic_desc.setAlignment(QtCore.Qt.AlignLeading
                                               | QtCore.Qt.AlignLeft
                                               | QtCore.Qt.AlignTop)
        self.t_param_generic_desc.setObjectName(f"t_param_{param_name}_desc")
        self.t_param_generic_desc.setWordWrap(True)
        self.hl_param_generic_t.addWidget(self.t_param_generic_desc)
        self.verticalLayout.addLayout(self.hl_param_generic_t)
        self.hl_param_generic_b = QtWidgets.QHBoxLayout()
        self.hl_param_generic_b.setObjectName(f"hl_param_{param_name}_b")

        if is_value_display_tb:
            self.tb_param_generic_value = QtWidgets.QLineEdit(Frame)
            sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                               QtWidgets.QSizePolicy.Fixed)
            sizePolicy.setHorizontalStretch(0)
            sizePolicy.setVerticalStretch(0)
            sizePolicy.setHeightForWidth(
                self.tb_param_generic_value.sizePolicy().hasHeightForWidth())
            self.tb_param_generic_value.setSizePolicy(sizePolicy)
            self.tb_param_generic_value.setMinimumSize(QtCore.QSize(20, 0))
            self.tb_param_generic_value.setMaximumSize(
                QtCore.QSize(35, 16777215))
            self.tb_param_generic_value.setText("")
            self.tb_param_generic_value.setObjectName(f"tb_param_{param_name}")
            self.hl_param_generic_b.addWidget(self.tb_param_generic_value)

        else:  # Using Label:
            self.t_param_generic_value = QtWidgets.QLabel(Frame)
            sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                               QtWidgets.QSizePolicy.Maximum)
            sizePolicy.setHorizontalStretch(0)
            sizePolicy.setVerticalStretch(0)
            sizePolicy.setHeightForWidth(
                self.t_param_generic_value.sizePolicy().hasHeightForWidth())
            self.t_param_generic_value.setSizePolicy(sizePolicy)
            self.t_param_generic_value.setMinimumSize(QtCore.QSize(40, 0))
            self.t_param_generic_value.setObjectName(
                f"t_param_{param_name}_value")
            self.hl_param_generic_b.addWidget(self.t_param_generic_value)

        self.slider_param_generic = QtWidgets.QSlider(Frame)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Maximum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.slider_param_generic.sizePolicy().hasHeightForWidth())
        self.slider_param_generic.setSizePolicy(sizePolicy)
        self.slider_param_generic.setMaximum(100)
        self.slider_param_generic.setProperty("value", 0)
        self.slider_param_generic.setOrientation(QtCore.Qt.Horizontal)
        self.slider_param_generic.setTickPosition(
            QtWidgets.QSlider.TicksBothSides)
        self.slider_param_generic.setTickInterval(10)
        self.slider_param_generic.setObjectName(f"slider_param_{param_name}")
        self.hl_param_generic_b.addWidget(self.slider_param_generic)
        self.verticalLayout.addLayout(self.hl_param_generic_b)

        #self.retranslateUi(Frame)
        QtCore.QMetaObject.connectSlotsByName(Frame)
Beispiel #9
0
    def setupUi(self, TripwireDialog):
        TripwireDialog.setObjectName("TripwireDialog")
        TripwireDialog.resize(400, 300)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(TripwireDialog.sizePolicy().hasHeightForWidth())
        TripwireDialog.setSizePolicy(sizePolicy)
        TripwireDialog.setMinimumSize(QtCore.QSize(400, 300))
        TripwireDialog.setMaximumSize(QtCore.QSize(400, 300))
        font = QtGui.QFont()
        font.setFamily("Segoe UI")
        font.setPointSize(9)
        TripwireDialog.setFont(font)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/images/app_icon.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off)
        TripwireDialog.setWindowIcon(icon)
        TripwireDialog.setSizeGripEnabled(False)
        self.gridLayout = QtWidgets.QGridLayout(TripwireDialog)
        self.gridLayout.setObjectName("gridLayout")
        self.label_2 = QtWidgets.QLabel(TripwireDialog)
        self.label_2.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label_2.setObjectName("label_2")
        self.gridLayout.addWidget(self.label_2, 2, 0, 1, 1)
        self.label = QtWidgets.QLabel(TripwireDialog)
        self.label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label.setObjectName("label")
        self.gridLayout.addWidget(self.label, 1, 0, 1, 1)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.checkBox_evescout = QtWidgets.QCheckBox(TripwireDialog)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Maximum, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.checkBox_evescout.sizePolicy().hasHeightForWidth())
        self.checkBox_evescout.setSizePolicy(sizePolicy)
        self.checkBox_evescout.setToolTip("")
        self.checkBox_evescout.setObjectName("checkBox_evescout")
        self.horizontalLayout.addWidget(self.checkBox_evescout)
        self.label_6 = QtWidgets.QLabel(TripwireDialog)
        self.label_6.setOpenExternalLinks(True)
        self.label_6.setObjectName("label_6")
        self.horizontalLayout.addWidget(self.label_6)
        self.gridLayout.addLayout(self.horizontalLayout, 6, 1, 1, 1)
        self.label_3 = QtWidgets.QLabel(TripwireDialog)
        self.label_3.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label_3.setObjectName("label_3")
        self.gridLayout.addWidget(self.label_3, 3, 0, 1, 1)
        self.buttonBox = QtWidgets.QDialogButtonBox(TripwireDialog)
        self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
        self.buttonBox.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok)
        self.buttonBox.setObjectName("buttonBox")
        self.gridLayout.addWidget(self.buttonBox, 11, 0, 1, 2)
        self.label_evescout_logo = QtWidgets.QLabel(TripwireDialog)
        self.label_evescout_logo.setCursor(QtCore.Qt.PointingHandCursor)
        self.label_evescout_logo.setText("")
        self.label_evescout_logo.setPixmap(QtGui.QPixmap(":/images/evescout.png"))
        self.label_evescout_logo.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label_evescout_logo.setObjectName("label_evescout_logo")
        self.gridLayout.addWidget(self.label_evescout_logo, 5, 0, 4, 1)
        self.lineEdit_url = QtWidgets.QLineEdit(TripwireDialog)
        self.lineEdit_url.setObjectName("lineEdit_url")
        self.gridLayout.addWidget(self.lineEdit_url, 1, 1, 1, 1)
        self.lineEdit_user = QtWidgets.QLineEdit(TripwireDialog)
        self.lineEdit_user.setObjectName("lineEdit_user")
        self.gridLayout.addWidget(self.lineEdit_user, 2, 1, 1, 1)
        self.lineEdit_pass = QtWidgets.QLineEdit(TripwireDialog)
        self.lineEdit_pass.setInputMethodHints(QtCore.Qt.ImhHiddenText|QtCore.Qt.ImhNoAutoUppercase|QtCore.Qt.ImhNoPredictiveText|QtCore.Qt.ImhSensitiveData)
        self.lineEdit_pass.setEchoMode(QtWidgets.QLineEdit.Password)
        self.lineEdit_pass.setObjectName("lineEdit_pass")
        self.gridLayout.addWidget(self.lineEdit_pass, 3, 1, 1, 1)
        self.label_5 = QtWidgets.QLabel(TripwireDialog)
        self.label_5.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
        self.label_5.setOpenExternalLinks(True)
        self.label_5.setObjectName("label_5")
        self.gridLayout.addWidget(self.label_5, 7, 1, 1, 1)
        self.label_4 = QtWidgets.QLabel(TripwireDialog)
        self.label_4.setText("")
        self.label_4.setPixmap(QtGui.QPixmap(":/images/tripwire_banner.png"))
        self.label_4.setObjectName("label_4")
        self.gridLayout.addWidget(self.label_4, 0, 0, 1, 2)
        self.label_7 = QtWidgets.QLabel(TripwireDialog)
        self.label_7.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
        self.label_7.setObjectName("label_7")
        self.gridLayout.addWidget(self.label_7, 4, 0, 1, 1)
        self.lineEdit_proxy = QtWidgets.QLineEdit(TripwireDialog)
        self.lineEdit_proxy.setInputMask("")
        self.lineEdit_proxy.setObjectName("lineEdit_proxy")
        self.gridLayout.addWidget(self.lineEdit_proxy, 4, 1, 1, 1)

        self.retranslateUi(TripwireDialog)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("accepted()"), TripwireDialog.accept)
        QtCore.QObject.connect(self.buttonBox, QtCore.SIGNAL("rejected()"), TripwireDialog.reject)
        QtCore.QMetaObject.connectSlotsByName(TripwireDialog)
Beispiel #10
0
    def setupUi(self, TradeWidget):
        TradeWidget.setObjectName("TradeWidget")
        TradeWidget.resize(464, 200)
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(TradeWidget)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.formLayout = QtWidgets.QFormLayout()
        self.formLayout.setObjectName("formLayout")
        self.label = QtWidgets.QLabel(TradeWidget)
        self.label.setObjectName("label")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole,
                                  self.label)
        self.buyer = QtWidgets.QLabel(TradeWidget)
        self.buyer.setObjectName("buyer")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole,
                                  self.buyer)
        self.label_2 = QtWidgets.QLabel(TradeWidget)
        self.label_2.setObjectName("label_2")
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole,
                                  self.label_2)
        self.item = QtWidgets.QLabel(TradeWidget)
        self.item.setObjectName("item")
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole,
                                  self.item)
        self.label_3 = QtWidgets.QLabel(TradeWidget)
        self.label_3.setObjectName("label_3")
        self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole,
                                  self.label_3)
        self.price = QtWidgets.QLabel(TradeWidget)
        self.price.setObjectName("price")
        self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole,
                                  self.price)
        self.label_4 = QtWidgets.QLabel(TradeWidget)
        self.label_4.setObjectName("label_4")
        self.formLayout.setWidget(3, QtWidgets.QFormLayout.LabelRole,
                                  self.label_4)
        self.stash = QtWidgets.QLabel(TradeWidget)
        self.stash.setObjectName("stash")
        self.formLayout.setWidget(3, QtWidgets.QFormLayout.FieldRole,
                                  self.stash)
        self.label_5 = QtWidgets.QLabel(TradeWidget)
        self.label_5.setObjectName("label_5")
        self.formLayout.setWidget(4, QtWidgets.QFormLayout.LabelRole,
                                  self.label_5)
        self.other = QtWidgets.QLabel(TradeWidget)
        self.other.setObjectName("other")
        self.formLayout.setWidget(4, QtWidgets.QFormLayout.FieldRole,
                                  self.other)
        self.horizontalLayout_2.addLayout(self.formLayout)
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.time = QtWidgets.QLabel(TradeWidget)
        self.time.setObjectName("time")
        self.verticalLayout.addWidget(self.time)
        spacerItem = QtWidgets.QSpacerItem(20, 40,
                                           QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout.addItem(spacerItem)
        self.horizontalLayout_2.addLayout(self.verticalLayout)
        self.horizontalLayout_2.setStretch(0, 1)
        self.verticalLayout_2.addLayout(self.horizontalLayout_2)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.copy = QtWidgets.QPushButton(TradeWidget)
        self.copy.setObjectName("copy")
        self.horizontalLayout.addWidget(self.copy)
        self.whisper = QtWidgets.QPushButton(TradeWidget)
        self.whisper.setObjectName("whisper")
        self.horizontalLayout.addWidget(self.whisper)
        self.invite = QtWidgets.QPushButton(TradeWidget)
        self.invite.setObjectName("invite")
        self.horizontalLayout.addWidget(self.invite)
        self.trade = QtWidgets.QPushButton(TradeWidget)
        self.trade.setObjectName("trade")
        self.horizontalLayout.addWidget(self.trade)
        self.kick = QtWidgets.QPushButton(TradeWidget)
        self.kick.setObjectName("kick")
        self.horizontalLayout.addWidget(self.kick)
        spacerItem1 = QtWidgets.QSpacerItem(40, 20,
                                            QtWidgets.QSizePolicy.Expanding,
                                            QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem1)
        self.verticalLayout_2.addLayout(self.horizontalLayout)
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.thanks = QtWidgets.QPushButton(TradeWidget)
        self.thanks.setObjectName("thanks")
        self.horizontalLayout_3.addWidget(self.thanks)
        spacerItem2 = QtWidgets.QSpacerItem(40, 20,
                                            QtWidgets.QSizePolicy.Expanding,
                                            QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_3.addItem(spacerItem2)
        self.verticalLayout_2.addLayout(self.horizontalLayout_3)

        self.retranslateUi(TradeWidget)
        QtCore.QMetaObject.connectSlotsByName(TradeWidget)
Beispiel #11
0
    def __init__(self):
        qw.QDialog.__init__(self)
        self.setWindowFlags(qc.Qt.WindowStaysOnTopHint)
        self.setWindowTitle('Name It')
        self.setFixedHeight(285)
        self.setFixedWidth(320)

        self.setLayout(qw.QVBoxLayout())
        self.layout().setContentsMargins(5, 5, 5, 5)
        self.layout().setSpacing(5)
        self.layout().setAlignment(qc.Qt.AlignTop)

        # RENAME WIDGET
        # each section of the tool is its own widget/layout
        # advantageous to just using layouts because layouts are visual only
        # widgets can be changed, hidden, etc
        #
        rename_widget = qw.QWidget()
        rename_widget.setLayout(qw.QVBoxLayout())
        rename_widget.layout().setContentsMargins(0, 0, 0, 0)
        rename_widget.layout().setSpacing(2)
        rename_widget.setSizePolicy(qw.QSizePolicy.Minimum,
                                    qw.QSizePolicy.Fixed)
        self.layout().addWidget(rename_widget)

        # add the horizontal line splitter with a custom widget we made below
        rename_splitter = Splitter(text='RENAME')
        rename_widget.layout().addWidget(rename_splitter)

        # rename text layout
        rename_text_layout = qw.QHBoxLayout()
        rename_text_layout.setContentsMargins(4, 0, 4, 0)
        rename_text_layout.setSpacing(2)
        # add to rename widget
        rename_widget.layout().addLayout(rename_text_layout)

        # rename text widgets
        rename_text_lb = qw.QLabel('New Name:')
        self.rename_le = qw.QLineEdit()
        rename_text_layout.addWidget(rename_text_lb)
        rename_text_layout.addWidget(self.rename_le)

        # use regular expressions to prevent typing symbols into the rename le, which aren't allowed in Maya names
        reg_ex_ren = qc.QRegExp("^(?!^_)[a-zA-Z_]+")
        # second argument is the parent, which we assign just to keep it alive, otherwise it may be deleted right after
        text_validator_rename = qg.QRegExpValidator(reg_ex_ren, self.rename_le)
        self.rename_le.setValidator(text_validator_rename)

        # add the custom divider line
        rename_widget.layout().addLayout(SplitterLayout())

        # rename multiples layout
        rename_mult_layout = qw.QHBoxLayout()
        rename_mult_layout.setContentsMargins(4, 0, 4, 0)
        rename_mult_layout.setSpacing(2)
        # add to rename widget
        rename_widget.layout().addLayout(rename_mult_layout)

        # rename multiples widgets
        rename_mult_method_lb = qw.QLabel('Multiples Naming Method:')
        self.rename_mult_method_combo = qw.QComboBox()
        self.rename_mult_method_combo.addItem('Numbers (0-9)')
        self.rename_mult_method_combo.addItem('Letters (a-z)')
        self.rename_mult_method_combo.setFixedWidth(
            120)  # otherwise will expand to fill space
        rename_mult_layout.addWidget(rename_mult_method_lb)
        rename_mult_layout.addWidget(self.rename_mult_method_combo)

        # rename multiples options layout
        # The options will change depending on what is selected in the combo box above
        multi_options_layout = qw.QHBoxLayout()
        multi_options_layout.setContentsMargins(4, 0, 4, 0)
        multi_options_layout.setSpacing(2)
        # add to rename widget
        rename_widget.layout().addLayout(multi_options_layout)

        # rename multiples options widgets
        # numbers option from rename_multi_method_combo
        self.frame_pad_lb = qw.QLabel('No. Padding:')
        self.frame_pad_spin = qw.QSpinBox()
        self.frame_pad_spin.setFixedWidth(40)
        self.frame_pad_spin.setMinimum(0)
        self.frame_pad_spin.setMaximum(10)

        # letters option from rename_multi_method_combo
        self.lower_radio = qw.QRadioButton('Lowercase')
        self.upper_radio = qw.QRadioButton('Uppercase')
        # since the numbers option is the default, turn these off for now
        self.lower_radio.setVisible(False)
        self.upper_radio.setVisible(False)
        self.lower_radio.setFixedHeight(19)
        self.upper_radio.setFixedHeight(19)
        self.lower_radio.setChecked(True)  # default selected option

        # add to multi options layout
        # left side options
        multi_options_layout.addWidget(self.frame_pad_lb)
        multi_options_layout.addWidget(self.lower_radio)
        # use an expanding spacer to push each one to the left/right
        multi_options_layout.addSpacerItem(
            qw.QSpacerItem(5, 5, qw.QSizePolicy.Expanding))
        # right side options
        multi_options_layout.addWidget(self.frame_pad_spin)
        multi_options_layout.addWidget(self.upper_radio)

        # add the custom divider line
        rename_widget.layout().addLayout(SplitterLayout())

        # prefix/suffix options layout
        fix_layout = qw.QHBoxLayout()
        fix_layout.setContentsMargins(4, 0, 4, 0)
        fix_layout.setSpacing(2)
        # add to rename widget
        rename_widget.layout().addLayout(fix_layout)

        # prefix and suffix checks/options widgets
        self.prefix_check = qw.QCheckBox('Prefix:')
        self.prefix_le = qw.QLineEdit()
        self.prefix_le.setEnabled(
            False)  # don't allow typing into line edit if not checked
        self.prefix_le.setFixedWidth(85)
        self.prefix_le.setValidator(
            text_validator_rename
        )  # use the same validator, don't need a new parent

        self.suffix_check = qw.QCheckBox('Suffix:')
        self.suffix_le = qw.QLineEdit()
        self.suffix_le.setEnabled(
            False)  # don't allow typing into line edit if not checked
        self.suffix_le.setFixedWidth(85)
        self.suffix_le.setValidator(text_validator_rename)

        # add to fix layout
        fix_layout.addWidget(self.prefix_check)
        fix_layout.addWidget(self.prefix_le)
        fix_layout.addSpacerItem(qw.QSpacerItem(5, 5,
                                                qw.QSizePolicy.Expanding))
        fix_layout.addWidget(self.suffix_check)
        fix_layout.addWidget(self.suffix_le)

        # add the custom divider line
        rename_widget.layout().addLayout(SplitterLayout())

        # rename button layout
        rename_button_layout = qw.QHBoxLayout()
        rename_button_layout.setContentsMargins(4, 0, 4, 0)
        rename_button_layout.setSpacing(0)
        # add to rename widget
        rename_widget.layout().addLayout(rename_button_layout)

        # rename button widgets
        self.rename_lb = qw.QLabel('e.g.')
        rename_btn = qw.QPushButton('Rename')
        rename_btn.setFixedHeight(20)
        rename_btn.setFixedWidth(55)

        # add to rename button layout
        rename_button_layout.addWidget(self.rename_lb)
        rename_button_layout.addWidget(rename_btn)

        # REPLACE WIDGET
        #
        replace_widget = qw.QWidget()
        replace_widget.setLayout(qw.QVBoxLayout())
        replace_widget.layout().setContentsMargins(0, 0, 0, 0)
        replace_widget.layout().setSpacing(2)
        replace_widget.setSizePolicy(qw.QSizePolicy.Minimum,
                                     qw.QSizePolicy.Fixed)
        self.layout().addWidget(replace_widget)

        # replace splitter from custom widget class below
        replace_splitter = Splitter(text='FIND/REPLACE')
        replace_widget.layout().addWidget(replace_splitter)

        # replace layout
        replace_layout = qw.QHBoxLayout()
        replace_layout.setContentsMargins(4, 0, 4, 0)
        replace_layout.setSpacing(2)
        # add to replace widget
        replace_widget.layout().addLayout(replace_layout)

        # replace widgets
        replace_lb = qw.QLabel('Find:')
        replace_lb.setFixedWidth(55)
        self.replace_le = qw.QLineEdit()

        # find/replace validator; simpler than rename one because we may search for strings within strings
        reg_ex_rep = qc.QRegExp("[a-zA-Z_]+")
        text_validator_replace = qg.QRegExpValidator(reg_ex_rep,
                                                     self.replace_le)
        self.replace_le.setValidator(text_validator_replace)

        # add to replace layout
        replace_layout.addWidget(replace_lb)
        replace_layout.addWidget(self.replace_le)

        # replace with layout
        with_layout = qw.QHBoxLayout()
        with_layout.setContentsMargins(4, 0, 4, 0)
        with_layout.setSpacing(2)
        # add to replace widget
        replace_widget.layout().addLayout(with_layout)

        # with widgets
        with_lb = qw.QLabel('Replace:')
        with_lb.setFixedWidth(55)
        self.with_le = qw.QLineEdit()
        self.with_le.setValidator(text_validator_replace)

        # add to replace with layout
        with_layout.addWidget(with_lb)
        with_layout.addWidget(self.with_le)

        # add the custom divider line
        replace_widget.layout().addLayout(SplitterLayout())

        # selection layout
        selection_layout = qw.QHBoxLayout()
        selection_layout.setContentsMargins(4, 0, 4, 0)
        selection_layout.setSpacing(2)
        # add to replace widget
        replace_widget.layout().addLayout(selection_layout)

        # selection widgets
        selection_mode_lb = qw.QLabel('Selection Mode:')
        self.all_radio = qw.QRadioButton('All')
        self.all_radio.setFixedHeight(19)
        self.all_radio.setChecked(True)
        selected_radio = qw.QRadioButton('Selected')
        selected_radio.setFixedHeight(19)

        # add to selection layout
        selection_layout.addWidget(selection_mode_lb)
        spacer_item = qw.QSpacerItem(5, 5, qw.QSizePolicy.Expanding)
        selection_layout.addSpacerItem(spacer_item)
        selection_layout.addWidget(self.all_radio)
        selection_layout.addWidget(selected_radio)

        # add the custom divider line
        replace_widget.layout().addLayout(SplitterLayout())

        # replace button layout
        replace_btn_layout = qw.QHBoxLayout()
        replace_btn_layout.setContentsMargins(4, 0, 4, 0)
        replace_btn_layout.setSpacing(2)
        replace_btn_layout.setAlignment(qc.Qt.AlignRight)
        # add to replace widget
        replace_widget.layout().addLayout(replace_btn_layout)

        # replace button
        replace_btn = qw.QPushButton('Replace')
        replace_btn.setFixedHeight(20)
        replace_btn.setFixedWidth(55)

        # add to replace button layout
        replace_btn_layout.addWidget(replace_btn)

        # ------------------------------------------------------------------------#
        # good practice to put all modifiers and connections in one place

        # connect modifiers
        #
        self.prefix_check.stateChanged.connect(self.prefix_le.setEnabled)
        self.suffix_check.stateChanged.connect(self.suffix_le.setEnabled)
        self.prefix_check.stateChanged.connect(self._update_example_rename)
        self.suffix_check.stateChanged.connect(self._update_example_rename)

        self.rename_mult_method_combo.currentIndexChanged.connect(
            self._toggle_multi_naming_method)
        self.rename_mult_method_combo.currentIndexChanged.connect(
            self._update_example_rename)
        self.lower_radio.clicked.connect(self._update_example_rename)
        self.upper_radio.clicked.connect(self._update_example_rename)
        self.frame_pad_spin.valueChanged.connect(self._update_example_rename)

        self.rename_le.textChanged.connect(self._update_example_rename)
        self.prefix_le.textChanged.connect(self._update_example_rename)
        self.suffix_le.textChanged.connect(self._update_example_rename)

        rename_btn.clicked.connect(self.rename)
        replace_btn.clicked.connect(self.replace)

        self._update_example_rename()
Beispiel #12
0
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(801, 600)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.verticalLayoutWidget = QtWidgets.QWidget(self.centralwidget)
        self.verticalLayoutWidget.setGeometry(QtCore.QRect(9, 9, 781, 561))
        self.verticalLayoutWidget.setObjectName("verticalLayoutWidget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.verticalLayoutWidget)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setSpacing(3)
        self.horizontalLayout.setSizeConstraint(
            QtWidgets.QLayout.SetMinimumSize)
        self.horizontalLayout.setObjectName("horizontalLayout")

        self.deleteButton = QtWidgets.QPushButton(self.verticalLayoutWidget)
        self.deleteButton.setObjectName("deleteButton")
        self.horizontalLayout.addWidget(self.deleteButton)
        self.deleteButton.clicked.connect(self.delete_clicked)

        self.toRightButton = QtWidgets.QPushButton(self.verticalLayoutWidget)
        self.toRightButton.setObjectName("toRightButton")
        self.horizontalLayout.addWidget(self.toRightButton)
        self.toRightButton.clicked.connect(self.toRight_clicked)

        self.clearButton = QtWidgets.QPushButton(self.verticalLayoutWidget)
        self.clearButton.setObjectName("clearButton")
        self.horizontalLayout.addWidget(self.clearButton)
        self.clearButton.clicked.connect(self.clear_clicked)

        self.lineEdit = QtWidgets.QLineEdit(self.verticalLayoutWidget)
        self.lineEdit.setObjectName("lineEdit")
        self.horizontalLayout.addWidget(self.lineEdit)

        self.editButton = QtWidgets.QPushButton(self.verticalLayoutWidget)
        self.editButton.setObjectName("pushButton")
        self.editButton.clicked.connect(self.edit_clicked)

        self.horizontalLayout.addWidget(self.editButton)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_3.setSpacing(9)
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")

        self.leftList = QtWidgets.QListWidget(self.verticalLayoutWidget)
        self.leftList.setObjectName("leftList")
        self.horizontalLayout_3.addWidget(self.leftList)

        self.rightList = QtWidgets.QListWidget(self.verticalLayoutWidget)
        self.rightList.setObjectName("rightList")
        self.horizontalLayout_3.addWidget(self.rightList)

        self.verticalLayout.addLayout(self.horizontalLayout_3)
        MainWindow.setCentralWidget(self.centralwidget)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)

        self.leftList.setEditTriggers(
            QtWidgets.QAbstractItemView.NoEditTriggers)
        self.rightList.setEditTriggers(
            QtWidgets.QAbstractItemView.NoEditTriggers)

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
Beispiel #13
0
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(844, 625)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.centralwidget)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.device_list = QtWidgets.QComboBox(self.centralwidget)
        self.device_list.setMinimumSize(QtCore.QSize(400, 0))
        self.device_list.setObjectName("device_list")
        self.horizontalLayout_3.addWidget(self.device_list)
        spacerItem = QtWidgets.QSpacerItem(40, 20,
                                           QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_3.addItem(spacerItem)
        self.label_4 = QtWidgets.QLabel(self.centralwidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.label_4.sizePolicy().hasHeightForWidth())
        self.label_4.setSizePolicy(sizePolicy)
        self.label_4.setObjectName("label_4")
        self.horizontalLayout_3.addWidget(self.label_4)
        self.label_9 = QtWidgets.QLabel(self.centralwidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.label_9.sizePolicy().hasHeightForWidth())
        self.label_9.setSizePolicy(sizePolicy)
        self.label_9.setObjectName("label_9")
        self.horizontalLayout_3.addWidget(self.label_9)
        self.brightness = QtWidgets.QSlider(self.centralwidget)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.brightness.sizePolicy().hasHeightForWidth())
        self.brightness.setSizePolicy(sizePolicy)
        self.brightness.setMinimumSize(QtCore.QSize(200, 0))
        self.brightness.setOrientation(QtCore.Qt.Horizontal)
        self.brightness.setObjectName("brightness")
        self.horizontalLayout_3.addWidget(self.brightness)
        self.verticalLayout.addLayout(self.horizontalLayout_3)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setContentsMargins(-1, 20, -1, -1)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.pages = QtWidgets.QTabWidget(self.centralwidget)
        self.pages.setAutoFillBackground(False)
        self.pages.setStyleSheet("b")
        self.pages.setObjectName("pages")
        self.page_1 = QtWidgets.QWidget()
        self.page_1.setObjectName("page_1")
        self.gridLayout_2 = QtWidgets.QGridLayout(self.page_1)
        self.gridLayout_2.setObjectName("gridLayout_2")
        self.pages.addTab(self.page_1, "")
        self.page_2 = QtWidgets.QWidget()
        self.page_2.setObjectName("page_2")
        self.gridLayout_3 = QtWidgets.QGridLayout(self.page_2)
        self.gridLayout_3.setObjectName("gridLayout_3")
        self.pages.addTab(self.page_2, "")
        self.page_3 = QtWidgets.QWidget()
        self.page_3.setObjectName("page_3")
        self.gridLayout_11 = QtWidgets.QGridLayout(self.page_3)
        self.gridLayout_11.setObjectName("gridLayout_11")
        self.pages.addTab(self.page_3, "")
        self.page_4 = QtWidgets.QWidget()
        self.page_4.setObjectName("page_4")
        self.gridLayout_10 = QtWidgets.QGridLayout(self.page_4)
        self.gridLayout_10.setObjectName("gridLayout_10")
        self.pages.addTab(self.page_4, "")
        self.page_5 = QtWidgets.QWidget()
        self.page_5.setObjectName("page_5")
        self.gridLayout_9 = QtWidgets.QGridLayout(self.page_5)
        self.gridLayout_9.setObjectName("gridLayout_9")
        self.pages.addTab(self.page_5, "")
        self.page_6 = QtWidgets.QWidget()
        self.page_6.setObjectName("page_6")
        self.gridLayout_8 = QtWidgets.QGridLayout(self.page_6)
        self.gridLayout_8.setObjectName("gridLayout_8")
        self.pages.addTab(self.page_6, "")
        self.page_7 = QtWidgets.QWidget()
        self.page_7.setObjectName("page_7")
        self.gridLayout_7 = QtWidgets.QGridLayout(self.page_7)
        self.gridLayout_7.setObjectName("gridLayout_7")
        self.pages.addTab(self.page_7, "")
        self.page_8 = QtWidgets.QWidget()
        self.page_8.setObjectName("page_8")
        self.gridLayout_6 = QtWidgets.QGridLayout(self.page_8)
        self.gridLayout_6.setObjectName("gridLayout_6")
        self.pages.addTab(self.page_8, "")
        self.page_9 = QtWidgets.QWidget()
        self.page_9.setObjectName("page_9")
        self.gridLayout_5 = QtWidgets.QGridLayout(self.page_9)
        self.gridLayout_5.setObjectName("gridLayout_5")
        self.pages.addTab(self.page_9, "")
        self.tab_10 = QtWidgets.QWidget()
        self.tab_10.setObjectName("tab_10")
        self.gridLayout_4 = QtWidgets.QGridLayout(self.tab_10)
        self.gridLayout_4.setObjectName("gridLayout_4")
        self.pages.addTab(self.tab_10, "")
        self.horizontalLayout.addWidget(self.pages)
        self.groupBox = QtWidgets.QGroupBox(self.centralwidget)
        self.groupBox.setMinimumSize(QtCore.QSize(250, 0))
        self.groupBox.setMaximumSize(QtCore.QSize(250, 16777215))
        self.groupBox.setObjectName("groupBox")
        self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.groupBox)
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.formLayout = QtWidgets.QFormLayout()
        self.formLayout.setObjectName("formLayout")
        self.label = QtWidgets.QLabel(self.groupBox)
        self.label.setObjectName("label")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole,
                                  self.label)
        self.imageButton = QtWidgets.QPushButton(self.groupBox)
        self.imageButton.setObjectName("imageButton")
        self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole,
                                  self.imageButton)
        self.label_2 = QtWidgets.QLabel(self.groupBox)
        self.label_2.setObjectName("label_2")
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole,
                                  self.label_2)
        self.text = QtWidgets.QLineEdit(self.groupBox)
        self.text.setObjectName("text")
        self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole,
                                  self.text)
        self.label_3 = QtWidgets.QLabel(self.groupBox)
        self.label_3.setObjectName("label_3")
        self.formLayout.setWidget(2, QtWidgets.QFormLayout.LabelRole,
                                  self.label_3)
        self.command = QtWidgets.QLineEdit(self.groupBox)
        self.command.setObjectName("command")
        self.formLayout.setWidget(2, QtWidgets.QFormLayout.FieldRole,
                                  self.command)
        self.label_5 = QtWidgets.QLabel(self.groupBox)
        self.label_5.setObjectName("label_5")
        self.formLayout.setWidget(3, QtWidgets.QFormLayout.LabelRole,
                                  self.label_5)
        self.keys = QtWidgets.QLineEdit(self.groupBox)
        self.keys.setObjectName("keys")
        self.formLayout.setWidget(3, QtWidgets.QFormLayout.FieldRole,
                                  self.keys)
        self.label_6 = QtWidgets.QLabel(self.groupBox)
        self.label_6.setObjectName("label_6")
        self.formLayout.setWidget(7, QtWidgets.QFormLayout.LabelRole,
                                  self.label_6)
        self.write = QtWidgets.QPlainTextEdit(self.groupBox)
        self.write.setObjectName("write")
        self.formLayout.setWidget(7, QtWidgets.QFormLayout.FieldRole,
                                  self.write)
        self.label_8 = QtWidgets.QLabel(self.groupBox)
        self.label_8.setObjectName("label_8")
        self.formLayout.setWidget(4, QtWidgets.QFormLayout.LabelRole,
                                  self.label_8)
        self.switch_page = QtWidgets.QSpinBox(self.groupBox)
        self.switch_page.setMinimum(0)
        self.switch_page.setMaximum(10)
        self.switch_page.setProperty("value", 0)
        self.switch_page.setObjectName("switch_page")
        self.formLayout.setWidget(4, QtWidgets.QFormLayout.FieldRole,
                                  self.switch_page)
        self.label_7 = QtWidgets.QLabel(self.groupBox)
        self.label_7.setObjectName("label_7")
        self.formLayout.setWidget(5, QtWidgets.QFormLayout.LabelRole,
                                  self.label_7)
        self.change_brightness = QtWidgets.QSpinBox(self.groupBox)
        self.change_brightness.setMinimum(-99)
        self.change_brightness.setObjectName("change_brightness")
        self.formLayout.setWidget(5, QtWidgets.QFormLayout.FieldRole,
                                  self.change_brightness)
        self.label_91 = QtWidgets.QLabel(self.groupBox)
        self.label_91.setObjectName("label_91")
        self.formLayout.setWidget(6, QtWidgets.QFormLayout.LabelRole,
                                  self.label_91)
        self.information = QtWidgets.QComboBox(self.groupBox)
        self.information.setObjectName("information")
        self.information.addItem("")
        self.information.addItem("")
        self.information.addItem("")
        self.information.addItem("")
        self.formLayout.setWidget(6, QtWidgets.QFormLayout.FieldRole,
                                  self.information)
        self.verticalLayout_3.addLayout(self.formLayout)
        self.horizontalLayout.addWidget(self.groupBox)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.verticalLayout_2.addLayout(self.verticalLayout)
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 844, 22))
        self.menubar.setObjectName("menubar")
        self.menuFile = QtWidgets.QMenu(self.menubar)
        self.menuFile.setObjectName("menuFile")
        MainWindow.setMenuBar(self.menubar)
        self.statusbar = QtWidgets.QStatusBar(MainWindow)
        self.statusbar.setObjectName("statusbar")
        MainWindow.setStatusBar(self.statusbar)
        self.actionImport = QtWidgets.QAction(MainWindow)
        self.actionImport.setObjectName("actionImport")
        self.actionExport = QtWidgets.QAction(MainWindow)
        self.actionExport.setObjectName("actionExport")
        self.actionExit = QtWidgets.QAction(MainWindow)
        self.actionExit.setObjectName("actionExit")
        self.menuFile.addAction(self.actionImport)
        self.menuFile.addAction(self.actionExport)
        self.menuFile.addSeparator()
        self.menuFile.addAction(self.actionExit)
        self.menubar.addAction(self.menuFile.menuAction())

        self.retranslateUi(MainWindow)
        self.pages.setCurrentIndex(0)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
Beispiel #14
0
def Row(*controls) -> QtWidgets.QLayout:
    layout = QtWidgets.QHBoxLayout()
    _formset_layout(layout, controls)
    return layout
Beispiel #15
0
    def __init__(self, parent):
        """
        Create a summary tab for a SMH analysis session.

        :param parent:
            The parent widget.
        """

        super(SummaryTab, self).__init__(parent)
        self.parent = parent

        # Right pane: A MPL figure with two axes, vertically aligned.
        # Left pane:
        # - Name, RA/DEC
        # - Link to search on Vizier/Simbad
        # - Comments/notes (user info?)

        # Set a size policy.
        sp = QtGui.QSizePolicy(QtGui.QSizePolicy.MinimumExpanding,
                               QtGui.QSizePolicy.MinimumExpanding)
        sp.setHeightForWidth(self.sizePolicy().hasHeightForWidth())
        self.setSizePolicy(sp)

        # Create a top-level horizontal layout to contain a MPL figure and
        # a vertical layout of settings..
        tab_layout = QtGui.QHBoxLayout(self)
        tab_layout.setContentsMargins(20, 20, 20, 0)

        # Create the left hand pane.
        summary_widget = QtGui.QWidget()
        summary_layout = QtGui.QVBoxLayout(summary_widget)

        # Star name label.
        self.star_label = QtGui.QLabel(self)
        bold_monospaced = QtGui2.QFont("Courier", 14)
        bold_monospaced.setBold(True)
        self.star_label.setFont(bold_monospaced)
        summary_layout.addWidget(self.star_label)

        # Coordinates label.
        self.coordinates_label = QtGui.QLabel(self)
        self.coordinates_label.setFont(bold_monospaced)
        summary_layout.addWidget(self.coordinates_label)

        # Notes.
        self.summary_notes = QtGui.QPlainTextEdit(self)
        summary_layout.addWidget(self.summary_notes)

        # External sources of information.
        hbox = QtGui.QHBoxLayout()

        # - Simbad
        self.btn_query_simbad = QtGui.QPushButton(self)
        self.btn_query_simbad.setText("Query Simbad..")
        self.btn_query_simbad.clicked.connect(self.query_simbad)

        hbox.addWidget(self.btn_query_simbad)
        hbox.addItem(
            QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding,
                              QtGui.QSizePolicy.Minimum))
        summary_layout.addLayout(hbox)
        tab_layout.addWidget(summary_widget)

        # Create a matplotlib widget in the right hand pane.

        self.figure = mpl.MPLWidget(None, tight_layout=True)
        sp = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding,
                               QtGui.QSizePolicy.Expanding)
        sp.setHorizontalStretch(0)
        sp.setVerticalStretch(0)
        sp.setHeightForWidth(self.figure.sizePolicy().hasHeightForWidth())
        self.figure.setSizePolicy(sp)
        self.figure.setFixedWidth(400)
        tab_layout.addWidget(self.figure)

        self.ax_top_comparison = self.figure.figure.add_subplot(211)
        self.ax_bottom_comparison = self.figure.figure.add_subplot(212)

        # Initialize the widgets.
        self._populate_widgets()

        # Connect the widgets.
        self.summary_notes.textChanged.connect(self.update_summary_notes)

        return None
Beispiel #16
0
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.resize(782, 857)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
        MainWindow.setSizePolicy(sizePolicy)
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
        self.gridLayout.setObjectName("gridLayout")
        self.splitter = QtWidgets.QSplitter(self.centralwidget)
        self.splitter.setMinimumSize(QtCore.QSize(0, 0))
        self.splitter.setOrientation(QtCore.Qt.Horizontal)
        self.splitter.setObjectName("splitter")
        self.layoutWidget = QtWidgets.QWidget(self.splitter)
        self.layoutWidget.setObjectName("layoutWidget")
        self.vLayoutLeft = QtWidgets.QVBoxLayout(self.layoutWidget)
        self.vLayoutLeft.setContentsMargins(0, 0, 0, 0)
        self.vLayoutLeft.setObjectName("vLayoutLeft")
        self.hLayoutNodeOp = QtWidgets.QHBoxLayout()
        self.hLayoutNodeOp.setObjectName("hLayoutNodeOp")
        self.btnAddNode = QtWidgets.QPushButton(self.layoutWidget)
        self.btnAddNode.setObjectName("btnAddNode")
        self.hLayoutNodeOp.addWidget(self.btnAddNode)
        self.btnRemoveNode = QtWidgets.QPushButton(self.layoutWidget)
        self.btnRemoveNode.setObjectName("btnRemoveNode")
        self.hLayoutNodeOp.addWidget(self.btnRemoveNode)
        self.btnClearNodeList = QtWidgets.QPushButton(self.layoutWidget)
        self.btnClearNodeList.setObjectName("btnClearNodeList")
        self.hLayoutNodeOp.addWidget(self.btnClearNodeList)
        self.vLayoutLeft.addLayout(self.hLayoutNodeOp)
        self.nodeList = QtWidgets.QListWidget(self.layoutWidget)
        self.nodeList.setObjectName("nodeList")
        self.vLayoutLeft.addWidget(self.nodeList)
        self.btnDoCheck = QtWidgets.QPushButton(self.layoutWidget)
        self.btnDoCheck.setObjectName("btnDoCheck")
        self.vLayoutLeft.addWidget(self.btnDoCheck)
        self.layoutWidget1 = QtWidgets.QWidget(self.splitter)
        self.layoutWidget1.setObjectName("layoutWidget1")
        self.vLayoutRight = QtWidgets.QVBoxLayout(self.layoutWidget1)
        self.vLayoutRight.setContentsMargins(0, 0, 0, 0)
        self.vLayoutRight.setObjectName("vLayoutRight")
        self.labelTitle = QtWidgets.QLabel(self.layoutWidget1)
        font = QtGui.QFont()
        font.setFamily("Microsoft YaHei")
        font.setPointSize(16)
        font.setWeight(50)
        font.setBold(False)
        self.labelTitle.setFont(font)
        self.labelTitle.setObjectName("labelTitle")
        self.vLayoutRight.addWidget(self.labelTitle)
        self.labelDesc = QtWidgets.QLabel(self.layoutWidget1)
        font = QtGui.QFont()
        font.setFamily("Microsoft YaHei")
        font.setPointSize(10)
        self.labelDesc.setFont(font)
        self.labelDesc.setTextFormat(QtCore.Qt.RichText)
        self.labelDesc.setWordWrap(True)
        self.labelDesc.setObjectName("labelDesc")
        self.vLayoutRight.addWidget(self.labelDesc)
        self.objectList = QtWidgets.QListWidget(self.layoutWidget1)
        self.objectList.setObjectName("objectList")
        self.vLayoutRight.addWidget(self.objectList)
        self.hLayoutFixOp = QtWidgets.QHBoxLayout()
        self.hLayoutFixOp.setObjectName("hLayoutFixOp")
        self.btnFixSelect = QtWidgets.QPushButton(self.layoutWidget1)
        self.btnFixSelect.setObjectName("btnFixSelect")
        self.hLayoutFixOp.addWidget(self.btnFixSelect)
        self.btnFixAll = QtWidgets.QPushButton(self.layoutWidget1)
        self.btnFixAll.setObjectName("btnFixAll")
        self.hLayoutFixOp.addWidget(self.btnFixAll)
        self.vLayoutRight.addLayout(self.hLayoutFixOp)
        self.gridLayout.addWidget(self.splitter, 0, 0, 1, 1)
        self.progressBar = QtWidgets.QProgressBar(self.centralwidget)
        self.progressBar.setMinimumSize(QtCore.QSize(0, 0))
        self.progressBar.setMaximumSize(QtCore.QSize(16777215, 2))
        self.progressBar.setBaseSize(QtCore.QSize(0, 0))
        self.progressBar.setProperty("value", 0)
        self.progressBar.setTextVisible(False)
        self.progressBar.setObjectName("progressBar")
        self.gridLayout.addWidget(self.progressBar, 1, 0, 1, 1)
        MainWindow.setCentralWidget(self.centralwidget)
        self.menubar = QtWidgets.QMenuBar(MainWindow)
        self.menubar.setGeometry(QtCore.QRect(0, 0, 782, 26))
        self.menubar.setObjectName("menubar")
        self.menuCreatePrj = QtWidgets.QMenu(self.menubar)
        self.menuCreatePrj.setObjectName("menuCreatePrj")
        self.menuHelp = QtWidgets.QMenu(self.menubar)
        self.menuHelp.setObjectName("menuHelp")
        MainWindow.setMenuBar(self.menubar)
        self.actionNew = QtWidgets.QAction(MainWindow)
        self.actionNew.setObjectName("actionNew")
        self.actionLoad = QtWidgets.QAction(MainWindow)
        self.actionLoad.setObjectName("actionLoad")
        self.actionSave = QtWidgets.QAction(MainWindow)
        self.actionSave.setObjectName("actionSave")
        self.actionDelete = QtWidgets.QAction(MainWindow)
        self.actionDelete.setObjectName("actionDelete")
        self.actionExit = QtWidgets.QAction(MainWindow)
        self.actionExit.setObjectName("actionExit")
        self.actionSaveAs = QtWidgets.QAction(MainWindow)
        self.actionSaveAs.setObjectName("actionSaveAs")
        self.actionUsage = QtWidgets.QAction(MainWindow)
        self.actionUsage.setObjectName("actionUsage")
        self.actionAbout = QtWidgets.QAction(MainWindow)
        self.actionAbout.setObjectName("actionAbout")
        self.menuCreatePrj.addAction(self.actionNew)
        self.menuCreatePrj.addAction(self.actionLoad)
        self.menuCreatePrj.addSeparator()
        self.menuCreatePrj.addAction(self.actionSave)
        self.menuCreatePrj.addAction(self.actionSaveAs)
        self.menuCreatePrj.addSeparator()
        self.menuCreatePrj.addAction(self.actionDelete)
        self.menuCreatePrj.addAction(self.actionExit)
        self.menuHelp.addAction(self.actionUsage)
        self.menuHelp.addAction(self.actionAbout)
        self.menubar.addAction(self.menuCreatePrj.menuAction())
        self.menubar.addAction(self.menuHelp.menuAction())

        self.retranslateUi(MainWindow)
        QtCore.QMetaObject.connectSlotsByName(MainWindow)
Beispiel #17
0
    def __init__(self, main_win, db):
        AbstractWidget.__init__(self, main_win=main_win, db=db)

        lbl_width = 60

        # outline ui
        self.main_layout = QtWidgets.QVBoxLayout()
        self.frame.setLayout(self.main_layout)

        # - active setup
        hbox = QtWidgets.QHBoxLayout()
        self.main_layout.addLayout(hbox)
        hbox.addStretch()
        self.active_label = QtWidgets.QLabel()
        hbox.addWidget(self.active_label)
        hbox.addStretch()

        # - list of setups
        hbox = QtWidgets.QHBoxLayout()
        self.main_layout.addLayout(hbox)

        # -- label
        vbox = QtWidgets.QVBoxLayout()
        hbox.addLayout(vbox)
        vbox.addStretch()
        label = QtWidgets.QLabel("Setups:")
        label.setFixedWidth(lbl_width)
        vbox.addWidget(label)
        vbox.addStretch()

        # -- list
        self.setup_list = QtWidgets.QTableWidget()
        self.setup_list.setSelectionBehavior(
            QtWidgets.QAbstractItemView.SelectRows)
        self.setup_list.setSelectionMode(
            QtWidgets.QAbstractItemView.SingleSelection)
        self.setup_list.setSortingEnabled(True)
        hbox.addWidget(self.setup_list)

        # -- button box
        vbox = QtWidgets.QVBoxLayout()
        hbox.addLayout(vbox)
        self.btn_box = QtWidgets.QDialogButtonBox(QtCore.Qt.Vertical)
        vbox.addWidget(self.btn_box)
        vbox.addStretch()
        # --- new setup
        self.btn_new_setup = QtWidgets.QPushButton("New")
        # noinspection PyUnresolvedReferences
        self.btn_new_setup.clicked.connect(self.new_setup)
        self.btn_new_setup.setToolTip("Create a new setup profile")
        self.btn_box.addButton(self.btn_new_setup,
                               QtWidgets.QDialogButtonBox.ActionRole)
        # --- import setup
        self.btn_import_setup = QtWidgets.QPushButton("Import")
        # noinspection PyUnresolvedReferences
        self.btn_import_setup.clicked.connect(self.import_setup)
        self.btn_import_setup.setToolTip("Import existing setup profiles")
        self.btn_box.addButton(self.btn_import_setup,
                               QtWidgets.QDialogButtonBox.ActionRole)
        # --- clone setup
        self.btn_clone_setup = QtWidgets.QPushButton("Clone")
        # noinspection PyUnresolvedReferences
        self.btn_clone_setup.clicked.connect(self.clone_setup)
        self.btn_clone_setup.setToolTip("Clone the selected setup profile")
        self.btn_box.addButton(self.btn_clone_setup,
                               QtWidgets.QDialogButtonBox.ActionRole)
        # --- rename setup
        self.btn_rename_setup = QtWidgets.QPushButton("Rename")
        # noinspection PyUnresolvedReferences
        self.btn_rename_setup.clicked.connect(self.rename_setup)
        self.btn_rename_setup.setToolTip("Rename the selected setup profile")
        self.btn_box.addButton(self.btn_rename_setup,
                               QtWidgets.QDialogButtonBox.ActionRole)
        # --- delete setup
        self.btn_delete_setup = QtWidgets.QPushButton("Delete")
        # noinspection PyUnresolvedReferences
        self.btn_delete_setup.clicked.connect(self.delete_setup)
        self.btn_delete_setup.setToolTip("Delete the selected setup profile")
        self.btn_box.addButton(self.btn_delete_setup,
                               QtWidgets.QDialogButtonBox.ActionRole)
        # --- activate setup
        self.btn_activate_setup = QtWidgets.QPushButton("Activate")
        # noinspection PyUnresolvedReferences
        self.btn_activate_setup.clicked.connect(self.activate_setup)
        self.btn_activate_setup.setToolTip(
            "Activate the selected setup profile")
        self.btn_box.addButton(self.btn_activate_setup,
                               QtWidgets.QDialogButtonBox.ActionRole)
        # --- refresh
        self.btn_refresh_list = QtWidgets.QPushButton("Refresh")
        # noinspection PyUnresolvedReferences
        self.btn_refresh_list.clicked.connect(self.on_setup_changed)
        self.btn_refresh_list.setToolTip(
            "Refresh the profiles from the setup database")
        self.btn_box.addButton(self.btn_refresh_list,
                               QtWidgets.QDialogButtonBox.ActionRole)
        # --- open folder
        self.btn_open_folder = QtWidgets.QPushButton("Folder")
        # noinspection PyUnresolvedReferences
        self.btn_open_folder.clicked.connect(self.on_open_folder)
        self.btn_open_folder.setToolTip(
            "Open the folder with the setup database")
        self.btn_box.addButton(self.btn_open_folder,
                               QtWidgets.QDialogButtonBox.ActionRole)

        self.main_layout.addSpacing(18)
Beispiel #18
0
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(352, 455)
        self.verticalLayout_3 = QtWidgets.QVBoxLayout(Form)
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.LacesGrpBx = QtWidgets.QGroupBox(Form)
        self.LacesGrpBx.setObjectName("LacesGrpBx")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.LacesGrpBx)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout()
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.LoadShapeBtn = QtWidgets.QPushButton(self.LacesGrpBx)
        self.LoadShapeBtn.setObjectName("LoadShapeBtn")
        self.verticalLayout_2.addWidget(self.LoadShapeBtn)
        self.CurrentShapeLbl = QtWidgets.QLabel(self.LacesGrpBx)
        self.CurrentShapeLbl.setAlignment(QtCore.Qt.AlignCenter)
        self.CurrentShapeLbl.setObjectName("CurrentShapeLbl")
        self.verticalLayout_2.addWidget(self.CurrentShapeLbl)
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.JointsOnCurve = QtWidgets.QLabel(self.LacesGrpBx)
        self.JointsOnCurve.setObjectName("JointsOnCurve")
        self.horizontalLayout.addWidget(self.JointsOnCurve)
        self.NumberOfJoints = QtWidgets.QSpinBox(self.LacesGrpBx)
        self.NumberOfJoints.setMinimumSize(QtCore.QSize(50, 0))
        self.NumberOfJoints.setMaximumSize(QtCore.QSize(50, 16777215))
        self.NumberOfJoints.setMinimum(2)
        self.NumberOfJoints.setProperty("value", 2)
        self.NumberOfJoints.setObjectName("NumberOfJoints")
        self.horizontalLayout.addWidget(self.NumberOfJoints)
        self.verticalLayout_2.addLayout(self.horizontalLayout)
        self.Mode = QtWidgets.QCheckBox(self.LacesGrpBx)
        self.Mode.setLayoutDirection(QtCore.Qt.LeftToRight)
        self.Mode.setCheckable(True)
        self.Mode.setChecked(False)
        self.Mode.setObjectName("Mode")
        self.verticalLayout_2.addWidget(self.Mode)
        self.CreateControlsBtn = QtWidgets.QPushButton(self.LacesGrpBx)
        self.CreateControlsBtn.setObjectName("CreateControlsBtn")
        self.verticalLayout_2.addWidget(self.CreateControlsBtn)
        self.horizontalLayout_2.addLayout(self.verticalLayout_2)
        self.verticalLayout_6 = QtWidgets.QVBoxLayout()
        self.verticalLayout_6.setObjectName("verticalLayout_6")
        self.RebuildGrp = QtWidgets.QGroupBox(self.LacesGrpBx)
        self.RebuildGrp.setObjectName("RebuildGrp")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.RebuildGrp)
        self.verticalLayout.setObjectName("verticalLayout")
        self.RebuildCurveChk = QtWidgets.QCheckBox(self.RebuildGrp)
        self.RebuildCurveChk.setObjectName("RebuildCurveChk")
        self.verticalLayout.addWidget(self.RebuildCurveChk)
        self.horizontalLayout_6 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_6.setObjectName("horizontalLayout_6")
        self.NumberofSpansLabel = QtWidgets.QLabel(self.RebuildGrp)
        self.NumberofSpansLabel.setObjectName("NumberofSpansLabel")
        self.horizontalLayout_6.addWidget(self.NumberofSpansLabel)
        self.NumberOfSpansSpnBx = QtWidgets.QSpinBox(self.RebuildGrp)
        self.NumberOfSpansSpnBx.setMinimumSize(QtCore.QSize(50, 0))
        self.NumberOfSpansSpnBx.setMaximumSize(QtCore.QSize(50, 16777215))
        self.NumberOfSpansSpnBx.setMinimum(4)
        self.NumberOfSpansSpnBx.setObjectName("NumberOfSpansSpnBx")
        self.horizontalLayout_6.addWidget(self.NumberOfSpansSpnBx)
        self.verticalLayout.addLayout(self.horizontalLayout_6)
        self.CurrentShapeControlsLbl = QtWidgets.QLabel(self.RebuildGrp)
        self.CurrentShapeControlsLbl.setText("")
        self.CurrentShapeControlsLbl.setObjectName("CurrentShapeControlsLbl")
        self.verticalLayout.addWidget(self.CurrentShapeControlsLbl)
        self.verticalLayout_6.addWidget(self.RebuildGrp)
        self.groupBox_2 = QtWidgets.QGroupBox(self.LacesGrpBx)
        self.groupBox_2.setObjectName("groupBox_2")
        self.verticalLayout_7 = QtWidgets.QVBoxLayout(self.groupBox_2)
        self.verticalLayout_7.setObjectName("verticalLayout_7")
        self.horizontalLayout_9 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_9.setObjectName("horizontalLayout_9")
        self.label_2 = QtWidgets.QLabel(self.groupBox_2)
        self.label_2.setObjectName("label_2")
        self.horizontalLayout_9.addWidget(self.label_2)
        self.X_offsetAxis_radio = QtWidgets.QRadioButton(self.groupBox_2)
        self.X_offsetAxis_radio.setChecked(False)
        self.X_offsetAxis_radio.setObjectName("X_offsetAxis_radio")
        self.horizontalLayout_9.addWidget(self.X_offsetAxis_radio)
        self.Y_offsetAxis_radio = QtWidgets.QRadioButton(self.groupBox_2)
        self.Y_offsetAxis_radio.setChecked(True)
        self.Y_offsetAxis_radio.setObjectName("Y_offsetAxis_radio")
        self.horizontalLayout_9.addWidget(self.Y_offsetAxis_radio)
        self.Z_offsetAxis_radio = QtWidgets.QRadioButton(self.groupBox_2)
        self.Z_offsetAxis_radio.setObjectName("Z_offsetAxis_radio")
        self.horizontalLayout_9.addWidget(self.Z_offsetAxis_radio)
        self.verticalLayout_7.addLayout(self.horizontalLayout_9)
        self.horizontalLayout_8 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_8.setObjectName("horizontalLayout_8")
        self.label = QtWidgets.QLabel(self.groupBox_2)
        self.label.setObjectName("label")
        self.horizontalLayout_8.addWidget(self.label)
        self.doubleSpinBox = QtWidgets.QDoubleSpinBox(self.groupBox_2)
        self.doubleSpinBox.setObjectName("doubleSpinBox")
        self.horizontalLayout_8.addWidget(self.doubleSpinBox)
        self.verticalLayout_7.addLayout(self.horizontalLayout_8)
        self.verticalLayout_6.addWidget(self.groupBox_2)
        self.horizontalLayout_2.addLayout(self.verticalLayout_6)
        self.verticalLayout_3.addWidget(self.LacesGrpBx)
        self.progresivePathGrpBx = QtWidgets.QGroupBox(Form)
        self.progresivePathGrpBx.setObjectName("progresivePathGrpBx")
        self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.progresivePathGrpBx)
        self.verticalLayout_4.setObjectName("verticalLayout_4")
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        self.PathCurveBtn = QtWidgets.QPushButton(self.progresivePathGrpBx)
        self.PathCurveBtn.setObjectName("PathCurveBtn")
        self.horizontalLayout_4.addWidget(self.PathCurveBtn)
        self.PathCurveLbl = QtWidgets.QLabel(self.progresivePathGrpBx)
        self.PathCurveLbl.setText("")
        self.PathCurveLbl.setObjectName("PathCurveLbl")
        self.horizontalLayout_4.addWidget(self.PathCurveLbl)
        self.verticalLayout_4.addLayout(self.horizontalLayout_4)
        self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_5.setObjectName("horizontalLayout_5")
        self.ControlCurveBtn = QtWidgets.QPushButton(self.progresivePathGrpBx)
        self.ControlCurveBtn.setObjectName("ControlCurveBtn")
        self.horizontalLayout_5.addWidget(self.ControlCurveBtn)
        self.ControlCurveLbl = QtWidgets.QLabel(self.progresivePathGrpBx)
        self.ControlCurveLbl.setText("")
        self.ControlCurveLbl.setObjectName("ControlCurveLbl")
        self.horizontalLayout_5.addWidget(self.ControlCurveLbl)
        self.verticalLayout_4.addLayout(self.horizontalLayout_5)
        self.pushButton = QtWidgets.QPushButton(self.progresivePathGrpBx)
        self.pushButton.setObjectName("pushButton")
        self.verticalLayout_4.addWidget(self.pushButton)
        self.verticalLayout_3.addWidget(self.progresivePathGrpBx)
        self.groupBox = QtWidgets.QGroupBox(Form)
        self.groupBox.setObjectName("groupBox")
        self.verticalLayout_5 = QtWidgets.QVBoxLayout(self.groupBox)
        self.verticalLayout_5.setObjectName("verticalLayout_5")
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.SinCntrlCurveBtn = QtWidgets.QPushButton(self.groupBox)
        self.SinCntrlCurveBtn.setObjectName("SinCntrlCurveBtn")
        self.horizontalLayout_3.addWidget(self.SinCntrlCurveBtn)
        self.SinCurveLbl = QtWidgets.QLabel(self.groupBox)
        self.SinCurveLbl.setMinimumSize(QtCore.QSize(100, 0))
        self.SinCurveLbl.setText("")
        self.SinCurveLbl.setObjectName("SinCurveLbl")
        self.horizontalLayout_3.addWidget(self.SinCurveLbl)
        self.verticalLayout_5.addLayout(self.horizontalLayout_3)
        self.horizontalLayout_7 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_7.setObjectName("horizontalLayout_7")
        self.CreateSinBtn = QtWidgets.QPushButton(self.groupBox)
        self.CreateSinBtn.setObjectName("CreateSinBtn")
        self.horizontalLayout_7.addWidget(self.CreateSinBtn)
        self.XchkBx = QtWidgets.QCheckBox(self.groupBox)
        self.XchkBx.setObjectName("XchkBx")
        self.horizontalLayout_7.addWidget(self.XchkBx)
        self.YchkBx = QtWidgets.QCheckBox(self.groupBox)
        self.YchkBx.setChecked(True)
        self.YchkBx.setObjectName("YchkBx")
        self.horizontalLayout_7.addWidget(self.YchkBx)
        self.ZchkBx = QtWidgets.QCheckBox(self.groupBox)
        self.ZchkBx.setObjectName("ZchkBx")
        self.horizontalLayout_7.addWidget(self.ZchkBx)
        self.verticalLayout_5.addLayout(self.horizontalLayout_7)
        self.verticalLayout_3.addWidget(self.groupBox)

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)
Beispiel #19
0
    def __init__(self, parent=None):
        super(AddressBook, self).__init__(parent)

        self.contacts = SortedDict()
        self.oldName = ''
        self.oldAddress = ''
        self.currentMode = self.NavigationMode

        nameLabel = QtWidgets.QLabel("Name:")
        self.nameLine = QtWidgets.QLineEdit()
        self.nameLine.setReadOnly(True)

        addressLabel = QtWidgets.QLabel("Address:")
        self.addressText = QtWidgets.QTextEdit()
        self.addressText.setReadOnly(True)

        self.addButton = QtWidgets.QPushButton("&Add")
        self.addButton.show()
        self.editButton = QtWidgets.QPushButton("&Edit")
        self.editButton.setEnabled(False)
        self.removeButton = QtWidgets.QPushButton("&Remove")
        self.removeButton.setEnabled(False)
        self.findButton = QtWidgets.QPushButton("&Find")
        self.findButton.setEnabled(False)
        self.submitButton = QtWidgets.QPushButton("&Submit")
        self.submitButton.hide()
        self.cancelButton = QtWidgets.QPushButton("&Cancel")
        self.cancelButton.hide()

        self.nextButton = QtWidgets.QPushButton("&Next")
        self.nextButton.setEnabled(False)
        self.previousButton = QtWidgets.QPushButton("&Previous")
        self.previousButton.setEnabled(False)

        self.loadButton = QtWidgets.QPushButton("&Load...")
        self.loadButton.setToolTip("Load contacts from a file")
        self.saveButton = QtWidgets.QPushButton("Sa&ve...")
        self.saveButton.setToolTip("Save contacts to a file")
        self.saveButton.setEnabled(False)

        self.exportButton = QtWidgets.QPushButton("Ex&port")
        self.exportButton.setToolTip("Export as vCard")
        self.exportButton.setEnabled(False)

        self.dialog = FindDialog()

        self.addButton.clicked.connect(self.addContact)
        self.submitButton.clicked.connect(self.submitContact)
        self.editButton.clicked.connect(self.editContact)
        self.removeButton.clicked.connect(self.removeContact)
        self.findButton.clicked.connect(self.findContact)
        self.cancelButton.clicked.connect(self.cancel)
        self.nextButton.clicked.connect(self.next)
        self.previousButton.clicked.connect(self.previous)
        self.loadButton.clicked.connect(self.loadFromFile)
        self.saveButton.clicked.connect(self.saveToFile)
        self.exportButton.clicked.connect(self.exportAsVCard)

        buttonLayout1 = QtWidgets.QVBoxLayout()
        buttonLayout1.addWidget(self.addButton)
        buttonLayout1.addWidget(self.editButton)
        buttonLayout1.addWidget(self.removeButton)
        buttonLayout1.addWidget(self.findButton)
        buttonLayout1.addWidget(self.submitButton)
        buttonLayout1.addWidget(self.cancelButton)
        buttonLayout1.addWidget(self.loadButton)
        buttonLayout1.addWidget(self.saveButton)
        buttonLayout1.addWidget(self.exportButton)
        buttonLayout1.addStretch()

        buttonLayout2 = QtWidgets.QHBoxLayout()
        buttonLayout2.addWidget(self.previousButton)
        buttonLayout2.addWidget(self.nextButton)

        mainLayout = QtWidgets.QGridLayout()
        mainLayout.addWidget(nameLabel, 0, 0)
        mainLayout.addWidget(self.nameLine, 0, 1)
        mainLayout.addWidget(addressLabel, 1, 0, QtCore.Qt.AlignTop)
        mainLayout.addWidget(self.addressText, 1, 1)
        mainLayout.addLayout(buttonLayout1, 1, 2)
        mainLayout.addLayout(buttonLayout2, 2, 1)

        self.setLayout(mainLayout)
        self.setWindowTitle("Simple Address Book")
Beispiel #20
0
    def setupUi(self, MainWindow):
        MainWindow.setObjectName("MainWindow")
        MainWindow.setEnabled(True)
        MainWindow.resize(462, 587)
        icon = QtGui.QIcon()
        icon.addPixmap(
            QtGui.QPixmap("files/img/trello_and_movidesk_icone.png"),
            QtGui.QIcon.Normal, QtGui.QIcon.Off)
        MainWindow.setWindowIcon(icon)
        MainWindow.setStyleSheet("background-color: rgb(98, 114, 164);")
        font = QtGui.QFont()
        font.setFamily("Ubuntu")
        self.centralwidget = QtWidgets.QWidget(MainWindow)
        self.centralwidget.setObjectName("centralwidget")
        self.verticalLayout = QtWidgets.QVBoxLayout(self.centralwidget)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setSpacing(0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.frame = QtWidgets.QFrame(self.centralwidget)
        self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
        self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
        self.frame.setObjectName("frame")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.frame)
        self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout_2.setSpacing(0)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.top_bar = QtWidgets.QFrame(self.frame)
        self.top_bar.setMinimumSize(QtCore.QSize(0, 35))
        self.top_bar.setMaximumSize(QtCore.QSize(16777215, 45))
        self.top_bar.setStyleSheet("")
        self.top_bar.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.top_bar.setFrameShadow(QtWidgets.QFrame.Raised)
        self.top_bar.setObjectName("top_bar")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.top_bar)
        self.horizontalLayout_2.setContentsMargins(0, 5, 0, 5)
        self.horizontalLayout_2.setSpacing(0)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")

        self.pop_up = QtWidgets.QFrame(self.top_bar)
        self.pop_up.setMaximumSize(QtCore.QSize(450, 16777215))
        self.pop_up.setStyleSheet(
            "background-color: rgb(39, 181, 252); border-radius: 7px;")
        self.pop_up.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.pop_up.setFrameShadow(QtWidgets.QFrame.Raised)
        self.pop_up.setObjectName("pop_up")

        self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.pop_up)
        self.horizontalLayout_3.setContentsMargins(10, 3, 10, 3)
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")

        self.label_closemessage = QtWidgets.QLabel(self.top_bar)
        self.label_closemessage.setAlignment(QtCore.Qt.AlignCenter)
        self.label_closemessage.setStyleSheet("color: rgb(0,0,0);")
        self.label_closemessage.setObjectName("label_closemessage")
        self.horizontalLayout_3.addWidget(self.label_closemessage)
        self.pushButton_close_error = QtWidgets.QPushButton(self.pop_up)
        self.pushButton_close_error.setMaximumSize(QtCore.QSize(20, 20))
        self.pushButton_close_error.setStyleSheet(
            "QPushButton{    \n"
            "    border-radius: 10px;\n"
            "    background-position: center;\n"
            "    background-image: url(files/img/closeicon2.png);\n"
            "}\n"
            "QPushButton:hover{\n"
            "    background-color: rgb(255, 255, 255);\n"
            "    color: rgb(200,200,200);\n"
            "}\n"
            "QPushButton:pressed{\n"
            "    background-color: rgb(35,35,35);    \n"
            "    color: rgb(200,200,200);\n"
            "}")
        self.pushButton_close_error.setText("")
        self.pushButton_close_error.setObjectName("pushButton_close_error")
        self.horizontalLayout_3.addWidget(self.pushButton_close_error)
        self.horizontalLayout_2.addWidget(self.pop_up)
        self.verticalLayout_2.addWidget(self.top_bar)
        self.main = QtWidgets.QFrame(self.frame)
        self.main.setStyleSheet("")
        self.main.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.main.setFrameShadow(QtWidgets.QFrame.Raised)
        self.main.setObjectName("main")
        self.horizontalLayout = QtWidgets.QHBoxLayout(self.main)
        self.horizontalLayout.setObjectName("horizontalLayout")

        self.content = QtWidgets.QFrame(self.main)
        self.content.setEnabled(True)
        self.content.setMinimumSize(QtCore.QSize(370, 500))
        self.content.setMaximumSize(QtCore.QSize(370, 500))
        self.content.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.content.setFrameShadow(QtWidgets.QFrame.Raised)
        self.content.setStyleSheet(
            "background-color: rgb(56, 58, 59); border-radius: 5px;")
        self.content.setObjectName("content")
        self.content.setFrameShape(QFrame.StyledPanel)
        self.content.setFrameShadow(QFrame.Raised)

        self.logo = QtWidgets.QFrame(self.content)
        self.logo.setGeometry(QtCore.QRect(30, 10, 311, 141))
        self.logo.setStyleSheet(
            "background-image: url(files/img/trello_and_movidesk.png);\n"
            "background-repeat: no-repeat;\n"
            "background-position: center;\n"
            "")
        self.logo.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.logo.setFrameShadow(QtWidgets.QFrame.Plain)
        self.logo.setObjectName("logo")
        self.line_ticket = QtWidgets.QLineEdit(self.content)
        self.line_ticket.setGeometry(QtCore.QRect(40, 170, 115, 31))
        self.line_ticket.setFont(font)
        self.line_ticket.setStyleSheet(
            "QLineEdit{\n"
            "    border: 2px solid rgb(120,120,120);\n"
            "    border-radius: 5px;\n"
            "    padding: 1px 3px;\n"
            "    background-color: rgb(79,79,79);\n"
            "    color: rgb(185, 185, 185);\n"
            "}\n"
            "QLineEdit:hover{\n"
            "    border: 2px solid rgb(70,70,70);\n"
            "}\n"
            "QLineEdit:focus{\n"
            "    border: 2px solid rgb(0,102,204);\n"
            "    color: rgb(200,200,200);\n"
            "}")
        self.line_ticket.setInputMask("")
        self.line_ticket.setMaxLength(5)
        self.onlyInt = QIntValidator()
        self.line_ticket.setValidator(self.onlyInt)
        # self.line_ticket.setFocus(0)
        self.line_ticket.setObjectName("line_ticket")
        self.comboBox_lists = QtWidgets.QComboBox(self.content)
        self.comboBox_lists.setGeometry(QtCore.QRect(200, 170, 141, 31))
        self.comboBox_lists.setFont(font)
        self.comboBox_lists.setStyleSheet(
            "QComboBox{\n"
            "    border: 2px solid rgb(120,120,120);\n"
            "    border-radius: 5px;\n"
            "    padding: 1px 3px;\n"
            "    background-color: rgb(79,79,79);\n"
            "    color: rgb(185, 185, 185);\n"
            "}\n"
            "QComboBox:hover{\n"
            "    border: 2px solid rgb(70,70,70);\n"
            "}\n"
            "QComboBox:focus{\n"
            "    border: 2px solid rgb(0,102,204);\n"
            "    color: rgb(200,200,200);\n"
            "}\n"
            "")
        self.comboBox_lists.setEditable(False)
        self.comboBox_lists.setObjectName("comboBox_lists")
        self.list_miembros = QtWidgets.QListWidget(self.content)
        self.list_miembros.setSelectionMode(QAbstractItemView.MultiSelection)
        self.list_miembros.setGeometry(QtCore.QRect(15, 221, 180, 201))
        self.list_miembros.setStyleSheet(
            "QListWidget{\n"
            "    border: 2px solid rgb(120,120,120);\n"
            "    border-radius: 5px;\n"
            "    padding: 1px 3px;\n"
            "    background-color: rgb(79,79,79);\n"
            "    color: rgb(185, 185, 185);\n"
            "}\n"
            "QListWidget:hover{\n"
            "    border: 2px solid rgb(70,70,70);\n"
            "}\n"
            "QListWidget:focus{\n"
            "    border: 2px solid rgb(0,102,204);\n"
            "    color: rgb(200,200,200);\n"
            "}")
        self.list_miembros.setObjectName("list_miembros")
        self.list_etiquetas = QtWidgets.QListWidget(self.content)
        self.list_etiquetas.setSelectionMode(QAbstractItemView.MultiSelection)
        self.list_etiquetas.setGeometry(QtCore.QRect(200, 221, 161, 201))
        self.list_etiquetas.setStyleSheet(
            "QListWidget{\n"
            "    border: 2px solid rgb(120,120,120);\n"
            "    border-radius: 5px;\n"
            "    padding: 1px 3px;\n"
            "    background-color: rgb(79,79,79);\n"
            "    color: rgb(185, 185, 185);\n"
            "}\n"
            "QListWidget:hover{\n"
            "    border: 2px solid rgb(70,70,70);\n"
            "}\n"
            "QListWidget:focus{\n"
            "    border: 2px solid rgb(0,102,204);\n"
            "    color: rgb(200,200,200);\n"
            "}")
        self.list_etiquetas.setObjectName("list_etiquetas")
        self.pushButton_create = QtWidgets.QPushButton(self.content)
        self.pushButton_create.setGeometry(QtCore.QRect(110, 440, 161, 35))
        font.setPointSize(10)
        self.pushButton_create.setFont(font)
        self.pushButton_create.setStyleSheet(
            "QPushButton{\n"
            "    border: 2px solid rgb(120,120,120);\n"
            "    border-radius: 5px;\n"
            "    padding: 1px 3px;\n"
            "    background-color: rgb(79,79,79);\n"
            "    color: rgb(185, 185, 185);\n"
            "}\n"
            "QPushButton:hover{\n"
            "    border: 2px solid rgb(70,70,70);\n"
            "}\n"
            "QPushButton:pressed{\n"
            "    background-color: rgb(0, 102,204);\n"
            "    border: 2px solid rgb(0,102,204);\n"
            "    color: rgb(200,200,200);\n"
            "}")
        self.pushButton_create.setObjectName("pushButton_create")

        self.label_loading = QtWidgets.QLabel(self.content)
        self.label_loading.setGeometry(QtCore.QRect(130, 445, 126, 22))
        self.label_loading.setFont(font)
        self.label_loading.setStyleSheet("color: rgb(185, 185, 185);")
        self.label_loading.setObjectName("label_loading")
        self.label_loading.setAlignment(QtCore.Qt.AlignCenter)

        self.label_miembros = QtWidgets.QLabel(self.content)
        self.label_miembros.setGeometry(QtCore.QRect(20, 206, 60, 13))
        self.label_miembros.setFont(font)
        self.label_miembros.setStyleSheet("color: rgb(185, 185, 185);")
        self.label_miembros.setObjectName("label_miembros")
        self.label_etiquetas = QtWidgets.QLabel(self.content)
        self.label_etiquetas.setGeometry(QtCore.QRect(205, 206, 60, 13))
        self.label_etiquetas.setFont(font)
        self.label_etiquetas.setStyleSheet("color: rgb(185, 185, 185);")
        self.label_etiquetas.setObjectName("label_etiquetas")
        self.horizontalLayout.addWidget(self.content)
        self.verticalLayout_2.addWidget(self.main)
        self.bottom_bar = QtWidgets.QFrame(self.frame)
        self.bottom_bar.setMinimumSize(QtCore.QSize(0, 30))
        self.bottom_bar.setMaximumSize(QtCore.QSize(16777215, 30))
        self.bottom_bar.setStyleSheet("background-color: rgb(98, 114, 164);")
        self.bottom_bar.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.bottom_bar.setFrameShadow(QtWidgets.QFrame.Raised)
        self.bottom_bar.setObjectName("bottom_bar")
        self.verticalLayout_2.addWidget(self.bottom_bar)
        self.verticalLayout.addWidget(self.frame)
        MainWindow.setCentralWidget(self.centralwidget)

        #
        #  FUNCTIONS
        #

        # BT Close Popup
        self.pushButton_close_error.clicked.connect(lambda: self.pop_up.hide())

        # Hide Elements in the Boot of Program
        self.pop_up.hide()
        self.label_loading.hide()

        # Button Create Ticket
        self.pushButton_create.clicked.connect(self.checkFields)

        self.retranslateUi(MainWindow)

        self.loaddata(MainWindow)

        QtCore.QMetaObject.connectSlotsByName(MainWindow)
Beispiel #21
0
    def __init__(self, main_win, plot_params: Optional[PlotParams] = None):
        super().__init__(parent=main_win)
        if plot_params is None:
            self._pp = PlotParams()  # plot parameters
        else:
            self._pp = plot_params

        self.jm2 = Model()
        self.jm2.use_test_sed_params(TestSediments.COARSE_SAND)
        self.jm2.use_default_mdl_params()

        self.setWindowTitle("Arch Tab")
        self.settings = QtCore.QSettings()

        self.main_win = main_win
        self.progress = QtProgress(parent=self)

        self.setContentsMargins(0, 0, 0, 0)

        canvas_frame = QtWidgets.QFrame(self)
        self.layout = QtWidgets.QVBoxLayout()
        canvas_frame.setLayout(self.layout)

        with rc_context(app_info.plot_rc_context):

            self.f = Figure()
            self.f.patch.set_alpha(0.0)
            self.c = FigureCanvas(self.f)
            self.c.setParent(self)
            # noinspection PyUnresolvedReferences
            self.c.setFocusPolicy(
                QtCore.Qt.ClickFocus)  # key for press events!!!
            self.c.setFocus()
            self.layout.addWidget(self.c)

            # axes
            gs = gridspec.GridSpec(3, 3)
            self.up_ax = self.f.add_subplot(gs[0:2, :])
            self.down_ax = self.f.add_subplot(gs[2, :])

        # navigation
        self.nav = NavToolbar(canvas=self.c, parent=self)
        self.layout.addWidget(self.nav)

        self.setCentralWidget(canvas_frame)

        settings_dock = QtWidgets.QDockWidget("Settings")
        settings_dock.setFeatures(QtWidgets.QDockWidget.DockWidgetFloatable
                                  | QtWidgets.QDockWidget.DockWidgetMovable)
        settings_dock.setMinimumWidth(200)
        settings_dock.setMaximumWidth(400)
        settings_frame = QtWidgets.QWidget()
        settings_dock.setWidget(settings_frame)
        self.process_layout = QtWidgets.QVBoxLayout()
        settings_frame.setLayout(self.process_layout)

        # sediment

        seds_label_layout = QtWidgets.QHBoxLayout()
        self.process_layout.addLayout(seds_label_layout)
        seds_label_layout.addStretch()
        seds_label = QtWidgets.QLabel("Sediment Type")
        seds_label_layout.addWidget(seds_label)
        seds_label_layout.addStretch()

        seds_layout = QtWidgets.QHBoxLayout()
        self.process_layout.addLayout(seds_layout)
        seds_layout.addStretch()
        self.seds = dict()
        for sed in TestSediments:
            self.seds[test_params[sed].name] = sed
        self.seds_list = QtWidgets.QComboBox()
        self.seds_list.addItems(list(self.seds.keys()))
        self.seds_list.setCurrentText(
            test_params[TestSediments.COARSE_SAND].name)
        # noinspection PyUnresolvedReferences
        self.seds_list.currentTextChanged.connect(self.on_draw)
        seds_layout.addWidget(self.seds_list)
        seds_layout.addStretch()

        # frequency

        freq_label_layout = QtWidgets.QHBoxLayout()
        self.process_layout.addLayout(freq_label_layout)
        freq_label_layout.addStretch()
        self.freq_label = QtWidgets.QLabel("Frequency [%.1f kHz]" %
                                           (self.jm2.mdl_params.f / 1000))
        freq_label_layout.addWidget(self.freq_label)
        freq_label_layout.addStretch()

        freq_layout = QtWidgets.QHBoxLayout()
        self.process_layout.addLayout(freq_layout)
        freq_layout.addStretch()
        self.freq_slider = QtWidgets.QSlider(QtCore.Qt.Horizontal)
        self.freq_slider.setMinimumWidth(160)
        self.freq_slider.setMinimum(1)
        self.freq_slider.setMaximum(500)
        self.freq_slider.setTickInterval(1)
        self.freq_slider.setValue(self.jm2.mdl_params.f / 1000)
        # noinspection PyUnresolvedReferences
        self.freq_slider.valueChanged.connect(self.on_draw)
        freq_layout.addWidget(self.freq_slider)
        freq_layout.addStretch()

        self.process_layout.addSpacing(12)

        redraw_layout = QtWidgets.QHBoxLayout()
        self.process_layout.addLayout(redraw_layout)
        redraw_layout.addStretch()
        redraw_btn = QtWidgets.QPushButton("Redraw")
        # noinspection PyUnresolvedReferences
        redraw_btn.clicked.connect(self.on_draw)
        redraw_layout.addWidget(redraw_btn)
        redraw_layout.addStretch()

        self.process_layout.addStretch()
        self.addDockWidget(QtCore.Qt.RightDockWidgetArea, settings_dock)

        self.on_draw()
    def setupUi(self, Dialog):
        Dialog.setObjectName("Dialog")
        Dialog.resize(400, 401)
        self.verticalLayout = QtWidgets.QVBoxLayout(Dialog)
        self.verticalLayout.setObjectName("verticalLayout")
        self.label = QtWidgets.QLabel(Dialog)
        self.label.setObjectName("label")
        self.verticalLayout.addWidget(self.label)
        self.widget = QtWidgets.QWidget(Dialog)
        self.widget.setObjectName("widget")
        self.horizontalLayout = QtWidgets.QHBoxLayout(self.widget)
        self.horizontalLayout.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.edtURL = QtWidgets.QLineEdit(self.widget)
        self.edtURL.setText("")
        self.edtURL.setPlaceholderText("")
        self.edtURL.setObjectName("edtURL")
        self.horizontalLayout.addWidget(self.edtURL)
        self.btnAdd = QtWidgets.QPushButton(self.widget)
        self.btnAdd.setEnabled(False)
        self.btnAdd.setObjectName("btnAdd")
        self.horizontalLayout.addWidget(self.btnAdd)
        self.verticalLayout.addWidget(self.widget)
        self.lblCameraInfo = QtWidgets.QLabel(Dialog)
        self.lblCameraInfo.setObjectName("lblCameraInfo")
        self.verticalLayout.addWidget(self.lblCameraInfo)
        self.groupBox = QtWidgets.QGroupBox(Dialog)
        self.groupBox.setObjectName("groupBox")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.groupBox)
        self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.widget_2 = QtWidgets.QWidget(self.groupBox)
        self.widget_2.setObjectName("widget_2")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.widget_2)
        self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.scrollArea = QtWidgets.QScrollArea(self.widget_2)
        self.scrollArea.setFrameShape(QtWidgets.QFrame.NoFrame)
        self.scrollArea.setFrameShadow(QtWidgets.QFrame.Plain)
        self.scrollArea.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
        self.scrollArea.setHorizontalScrollBarPolicy(
            QtCore.Qt.ScrollBarAlwaysOff)
        self.scrollArea.setWidgetResizable(True)
        self.scrollArea.setObjectName("scrollArea")
        self.scrollAreaWidgetContents = QtWidgets.QWidget()
        self.scrollAreaWidgetContents.setGeometry(QtCore.QRect(0, 0, 362, 242))
        self.scrollAreaWidgetContents.setObjectName("scrollAreaWidgetContents")
        self.verticalLayout_3 = QtWidgets.QVBoxLayout(
            self.scrollAreaWidgetContents)
        self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.lstVideos = QtWidgets.QWidget(self.scrollAreaWidgetContents)
        self.lstVideos.setObjectName("lstVideos")
        self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.lstVideos)
        self.verticalLayout_4.setObjectName("verticalLayout_4")
        self.verticalLayout_3.addWidget(self.lstVideos)
        spacerItem = QtWidgets.QSpacerItem(20, 40,
                                           QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout_3.addItem(spacerItem)
        self.scrollArea.setWidget(self.scrollAreaWidgetContents)
        self.horizontalLayout_2.addWidget(self.scrollArea)
        self.verticalLayout_2.addWidget(self.widget_2)
        self.verticalLayout.addWidget(self.groupBox)

        self.retranslateUi(Dialog)
        QtCore.QMetaObject.connectSlotsByName(Dialog)
Beispiel #23
0
    def __init__(self, parent=None):
        QtWidgets.QWidget.__init__(self, parent)

        quit = QtWidgets.QPushButton("&Quit")
        quit.setFont(QtGui.QFont("Times", 18, QtGui.QFont.Bold))

        self.connect(quit, QtCore.SIGNAL("clicked()"), qApp,
                     QtCore.SLOT("quit()"))

        angle = LCDRange("ANGLE")
        angle.setRange(5, 70)

        force = LCDRange("FORCE")
        force.setRange(10, 50)

        cannonBox = QtWidgets.QFrame()
        cannonBox.setFrameStyle(QtWidgets.QFrame.WinPanel
                                | QtWidgets.QFrame.Sunken)

        self.cannonField = CannonField()

        self.connect(angle, QtCore.SIGNAL("valueChanged(int)"),
                     self.cannonField.setAngle)
        self.connect(self.cannonField, QtCore.SIGNAL("angleChanged(int)"),
                     angle.setValue)

        self.connect(force, QtCore.SIGNAL("valueChanged(int)"),
                     self.cannonField.setForce)
        self.connect(self.cannonField, QtCore.SIGNAL("forceChanged(int)"),
                     force.setValue)

        self.connect(self.cannonField, QtCore.SIGNAL("hit()"), self.hit)
        self.connect(self.cannonField, QtCore.SIGNAL("missed()"), self.missed)

        shoot = QtWidgets.QPushButton("&Shoot")
        shoot.setFont(QtGui.QFont("Times", 18, QtGui.QFont.Bold))

        self.connect(shoot, QtCore.SIGNAL("clicked()"), self.fire)
        self.connect(self.cannonField, QtCore.SIGNAL("canShoot(bool)"), shoot,
                     QtCore.SLOT("setEnabled(bool)"))

        restart = QtWidgets.QPushButton("&New Game")
        restart.setFont(QtGui.QFont("Times", 18, QtGui.QFont.Bold))

        self.connect(restart, QtCore.SIGNAL("clicked()"), self.newGame)

        self.hits = QtWidgets.QLCDNumber(2)
        self.shotsLeft = QtWidgets.QLCDNumber(2)
        hitsLabel = QtWidgets.QLabel("HITS")
        shotsLeftLabel = QtWidgets.QLabel("SHOTS LEFT")

        QtWidgets.QShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Enter), self,
                            self.fire)
        QtWidgets.QShortcut(QtGui.QKeySequence(QtCore.Qt.Key_Return), self,
                            self.fire)
        QtWidgets.QShortcut(
            QtGui.QKeySequence(QtCore.Qt.CTRL + QtCore.Qt.Key_Q), self,
            QtCore.SLOT("close()"))

        topLayout = QtWidgets.QHBoxLayout()
        topLayout.addWidget(shoot)
        topLayout.addWidget(self.hits)
        topLayout.addWidget(hitsLabel)
        topLayout.addWidget(self.shotsLeft)
        topLayout.addWidget(shotsLeftLabel)
        topLayout.addStretch(1)
        topLayout.addWidget(restart)

        leftLayout = QtWidgets.QVBoxLayout()
        leftLayout.addWidget(angle)
        leftLayout.addWidget(force)

        cannonLayout = QtWidgets.QVBoxLayout()
        cannonLayout.addWidget(self.cannonField)
        cannonBox.setLayout(cannonLayout)

        gridLayout = QtWidgets.QGridLayout()
        gridLayout.addWidget(quit, 0, 0)
        gridLayout.addLayout(topLayout, 0, 1)
        gridLayout.addLayout(leftLayout, 1, 0)
        gridLayout.addWidget(cannonBox, 1, 1, 2, 1)
        gridLayout.setColumnStretch(1, 10)
        self.setLayout(gridLayout)

        angle.setValue(60)
        force.setValue(25)
        angle.setFocus()

        self.newGame()
Beispiel #24
0
    def __init__(self, parent=None):
        super(AddressBook, self).__init__(parent)

        self.contacts = SortedDict()
        self.oldName = ''
        self.oldAddress = ''
        self.currentMode = self.NavigationMode

        nameLabel = QtWidgets.QLabel("Name:")
        self.nameLine = QtWidgets.QLineEdit()
        self.nameLine.setReadOnly(True)

        addressLabel = QtWidgets.QLabel("Address:")
        self.addressText = QtWidgets.QTextEdit()
        self.addressText.setReadOnly(True)

        self.addButton = QtWidgets.QPushButton("&Add")
        self.addButton.show()
        self.editButton = QtWidgets.QPushButton("&Edit")
        self.editButton.setEnabled(False)
        self.removeButton = QtWidgets.QPushButton("&Remove")
        self.removeButton.setEnabled(False)
        self.submitButton = QtWidgets.QPushButton("&Submit")
        self.submitButton.hide()
        self.cancelButton = QtWidgets.QPushButton("&Cancel")
        self.cancelButton.hide()

        self.nextButton = QtWidgets.QPushButton("&Next")
        self.nextButton.setEnabled(False)
        self.previousButton = QtWidgets.QPushButton("&Previous")
        self.previousButton.setEnabled(False)

        self.addButton.clicked.connect(self.addContact)
        self.submitButton.clicked.connect(self.submitContact)
        self.editButton.clicked.connect(self.editContact)
        self.removeButton.clicked.connect(self.removeContact)
        self.cancelButton.clicked.connect(self.cancel)
        self.nextButton.clicked.connect(self.next)
        self.previousButton.clicked.connect(self.previous)

        buttonLayout1 = QtWidgets.QVBoxLayout()
        buttonLayout1.addWidget(self.addButton)
        buttonLayout1.addWidget(self.editButton)
        buttonLayout1.addWidget(self.removeButton)
        buttonLayout1.addWidget(self.submitButton)
        buttonLayout1.addWidget(self.cancelButton)
        buttonLayout1.addStretch()

        buttonLayout2 = QtWidgets.QHBoxLayout()
        buttonLayout2.addWidget(self.previousButton)
        buttonLayout2.addWidget(self.nextButton)

        mainLayout = QtWidgets.QGridLayout()
        mainLayout.addWidget(nameLabel, 0, 0)
        mainLayout.addWidget(self.nameLine, 0, 1)
        mainLayout.addWidget(addressLabel, 1, 0, QtCore.Qt.AlignTop)
        mainLayout.addWidget(self.addressText, 1, 1)
        mainLayout.addLayout(buttonLayout1, 1, 2)
        mainLayout.addLayout(buttonLayout2, 3, 1)

        self.setLayout(mainLayout)
        self.setWindowTitle("Simple Address Book")
Beispiel #25
0
    def setupUi(self, Setting):
        Setting.setObjectName("Setting")
        Setting.resize(601, 537)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/icon/icon/CTPBEE.png"),
                       QtGui.QIcon.Normal, QtGui.QIcon.Off)
        Setting.setWindowIcon(icon)
        self.verticalLayout = QtWidgets.QVBoxLayout(Setting)
        self.verticalLayout.setObjectName("verticalLayout")
        self.tabWidget = QtWidgets.QTabWidget(Setting)
        self.tabWidget.setObjectName("tabWidget")
        self.tab = QtWidgets.QWidget()
        self.tab.setObjectName("tab")
        self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.tab)
        self.verticalLayout_4.setObjectName("verticalLayout_4")
        self.py_manage_layout = QtWidgets.QVBoxLayout()
        self.py_manage_layout.setObjectName("py_manage_layout")
        self.verticalLayout_4.addLayout(self.py_manage_layout)
        self.tabWidget.addTab(self.tab, "")
        self.tab_2 = QtWidgets.QWidget()
        self.tab_2.setObjectName("tab_2")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.tab_2)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.pypi_source = QtWidgets.QLineEdit(self.tab_2)
        self.pypi_source.setObjectName("pypi_source")
        self.verticalLayout_2.addWidget(self.pypi_source)
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        spacerItem = QtWidgets.QSpacerItem(40, 20,
                                           QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem)
        self.change_pypi_btn = QtWidgets.QPushButton(self.tab_2)
        self.change_pypi_btn.setObjectName("change_pypi_btn")
        self.horizontalLayout_2.addWidget(self.change_pypi_btn)
        self.pypi_checkBox = QtWidgets.QCheckBox(self.tab_2)
        self.pypi_checkBox.setLayoutDirection(QtCore.Qt.RightToLeft)
        self.pypi_checkBox.setChecked(True)
        self.pypi_checkBox.setObjectName("pypi_checkBox")
        self.horizontalLayout_2.addWidget(self.pypi_checkBox)
        self.verticalLayout_2.addLayout(self.horizontalLayout_2)
        spacerItem1 = QtWidgets.QSpacerItem(20, 40,
                                            QtWidgets.QSizePolicy.Minimum,
                                            QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout_2.addItem(spacerItem1)
        self.tabWidget.addTab(self.tab_2, "")
        self.tab_3 = QtWidgets.QWidget()
        self.tab_3.setObjectName("tab_3")
        self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.tab_3)
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.install_path = QtWidgets.QLineEdit(self.tab_3)
        self.install_path.setReadOnly(True)
        self.install_path.setObjectName("install_path")
        self.horizontalLayout.addWidget(self.install_path)
        self.install_btn = QtWidgets.QPushButton(self.tab_3)
        self.install_btn.setObjectName("install_btn")
        self.horizontalLayout.addWidget(self.install_btn)
        self.verticalLayout_3.addLayout(self.horizontalLayout)
        spacerItem2 = QtWidgets.QSpacerItem(20, 40,
                                            QtWidgets.QSizePolicy.Minimum,
                                            QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout_3.addItem(spacerItem2)
        self.tabWidget.addTab(self.tab_3, "")
        self.verticalLayout.addWidget(self.tabWidget)

        self.retranslateUi(Setting)
        self.tabWidget.setCurrentIndex(0)
        QtCore.QMetaObject.connectSlotsByName(Setting)
Beispiel #26
0
    def __init__(self, job, format, parent=None):
        QtWidgets.QWidget.__init__(self)

        self.__job = job

        # Temporary workaround when pwd library is not available (i.e. Windows).
        # TODO(bcipriano) Pull this info directly from Cuebot.
        #  (https://github.com/imageworks/OpenCue/issues/218)
        if 'pwd' in globals():
            user_name = pwd.getpwnam(job.username()).pw_gecos
        else:
            user_name = job.username()

        __default_from = "%s-pst@%s" % (job.show(), cuegui.Constants.EMAIL_DOMAIN)
        __default_to = "%s@%s" % (job.username(), cuegui.Constants.EMAIL_DOMAIN)
        __default_cc = "%s-pst@%s" % (job.show(), cuegui.Constants.EMAIL_DOMAIN)
        __default_bcc = ""
        __default_subject = "%s%s" % (cuegui.Constants.EMAIL_SUBJECT_PREFIX, job.data.name)
        __default_body = "%s%s%s" % (cuegui.Constants.EMAIL_BODY_PREFIX, job.data.name,
                                     cuegui.Constants.EMAIL_BODY_SUFFIX)
        __default_body += "Hi %s,\n\n" % user_name

        self.__btnSend = QtWidgets.QPushButton("Send", self)
        self.__btnCancel = QtWidgets.QPushButton("Cancel", self)

        # Body Widgets
        self.__email_body = QtWidgets.QTextEdit(self)
        self.appendToBody(__default_body)
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Minimum)

        self.__email_from = QtWidgets.QLineEdit(__default_from, self)
        self.__email_to = QtWidgets.QLineEdit(__default_to, self)
        self.__email_cc = QtWidgets.QLineEdit(__default_cc, self)
        self.__email_bcc = QtWidgets.QLineEdit(__default_bcc, self)
        self.__email_subject = QtWidgets.QLineEdit(__default_subject, self)

        # Main Virtical Layout
        vlayout = QtWidgets.QVBoxLayout(self)

        # Top Grid Layout
        glayout = QtWidgets.QGridLayout()
        glayout.setContentsMargins(0, 0, 0, 0)

        glayout.addWidget(QtWidgets.QLabel("From:", self), 0, 0)
        glayout.addWidget(self.__email_from, 0, 1)

        glayout.addWidget(QtWidgets.QLabel("To:", self), 1, 0)
        glayout.addWidget(self.__email_to, 1, 1)

        glayout.addWidget(QtWidgets.QLabel("CC:", self), 2, 0)
        glayout.addWidget(self.__email_cc, 2, 1)

        glayout.addWidget(QtWidgets.QLabel("BCC:", self), 3, 0)
        glayout.addWidget(self.__email_bcc, 3, 1)

        glayout.addWidget(QtWidgets.QLabel("Subject:", self), 4, 0)
        glayout.addWidget(self.__email_subject, 4, 1)

        vlayout.addLayout(glayout)
        vlayout.addWidget(self.__email_body)

        # Bottom Horizontal Layout
        hlayout = QtWidgets.QHBoxLayout()
        hlayout.addItem(spacerItem)
        hlayout.addWidget(self.__btnSend)
        hlayout.addWidget(self.__btnCancel)
        vlayout.addLayout(hlayout)

        self.__btnSend.clicked.connect(self.sendEmail)
        self.__btnCancel.clicked.connect(self.cancel.emit)
    def setupUi(self, ImageViewer):
        ImageViewer.setObjectName("ImageViewer")
        ImageViewer.resize(733, 701)
        ImageViewer.setMinimumSize(QtCore.QSize(733, 701))
        self.centralwidget = QtWidgets.QWidget(ImageViewer)
        self.centralwidget.setMinimumSize(QtCore.QSize(672, 500))
        self.centralwidget.setObjectName("centralwidget")
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.centralwidget)
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.widget_7 = QtWidgets.QWidget(self.centralwidget)
        self.widget_7.setMinimumSize(QtCore.QSize(684, 679))
        self.widget_7.setObjectName("widget_7")
        self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.widget_7)
        self.verticalLayout_3.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.widget_4 = QtWidgets.QWidget(self.widget_7)
        self.widget_4.setObjectName("widget_4")
        self.horizontalLayout_5 = QtWidgets.QHBoxLayout(self.widget_4)
        self.horizontalLayout_5.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout_5.setObjectName("horizontalLayout_5")
        self.widget_5 = QtWidgets.QWidget(self.widget_4)
        self.widget_5.setMinimumSize(QtCore.QSize(650, 0))
        self.widget_5.setObjectName("widget_5")
        self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.widget_5)
        self.verticalLayout_2.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout_2.setObjectName("verticalLayout_2")
        self.wgt_sceneImage = QtWidgets.QWidget(self.widget_5)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.wgt_sceneImage.sizePolicy().hasHeightForWidth())
        self.wgt_sceneImage.setSizePolicy(sizePolicy)
        self.wgt_sceneImage.setMinimumSize(QtCore.QSize(650, 600))
        self.wgt_sceneImage.setAutoFillBackground(False)
        self.wgt_sceneImage.setStyleSheet(
            "QWidget#wgt_sceneImage { background-color: rgb(135, 135, 135) }")
        self.wgt_sceneImage.setObjectName("wgt_sceneImage")
        self.lyt_sceneImage = QtWidgets.QVBoxLayout(self.wgt_sceneImage)
        self.lyt_sceneImage.setContentsMargins(0, 0, 0, 0)
        self.lyt_sceneImage.setSpacing(7)
        self.lyt_sceneImage.setObjectName("lyt_sceneImage")
        self.verticalLayout_2.addWidget(self.wgt_sceneImage)
        self.sldr_images = QtWidgets.QSlider(self.widget_5)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.sldr_images.sizePolicy().hasHeightForWidth())
        self.sldr_images.setSizePolicy(sizePolicy)
        self.sldr_images.setMaximum(0)
        self.sldr_images.setOrientation(QtCore.Qt.Horizontal)
        self.sldr_images.setInvertedAppearance(False)
        self.sldr_images.setInvertedControls(False)
        self.sldr_images.setTickPosition(QtWidgets.QSlider.TicksAbove)
        self.sldr_images.setObjectName("sldr_images")
        self.verticalLayout_2.addWidget(self.sldr_images)
        self.widget = QtWidgets.QWidget(self.widget_5)
        self.widget.setMinimumSize(QtCore.QSize(684, 0))
        self.widget.setObjectName("widget")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.widget)
        self.horizontalLayout_2.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        spacerItem = QtWidgets.QSpacerItem(40, 20,
                                           QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem)
        self.spnb_images = QtWidgets.QSpinBox(self.widget)
        self.spnb_images.setObjectName("spnb_images")
        self.horizontalLayout_2.addWidget(self.spnb_images)
        spacerItem1 = QtWidgets.QSpacerItem(40, 20,
                                            QtWidgets.QSizePolicy.Expanding,
                                            QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem1)
        self.verticalLayout_2.addWidget(self.widget)
        self.horizontalLayout_5.addWidget(self.widget_5)
        self.horizontalLayout_5.setStretch(0, 9)
        self.verticalLayout_3.addWidget(self.widget_4)
        self.horizontalLayout_3.addWidget(self.widget_7)
        self.widget_3 = QtWidgets.QWidget(self.centralwidget)
        self.widget_3.setMinimumSize(QtCore.QSize(0, 0))
        self.widget_3.setObjectName("widget_3")
        self.verticalLayout_12 = QtWidgets.QVBoxLayout(self.widget_3)
        self.verticalLayout_12.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout_12.setObjectName("verticalLayout_12")
        spacerItem2 = QtWidgets.QSpacerItem(20, 40,
                                            QtWidgets.QSizePolicy.Minimum,
                                            QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout_12.addItem(spacerItem2)
        self.widget_6 = QtWidgets.QWidget(self.widget_3)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.widget_6.sizePolicy().hasHeightForWidth())
        self.widget_6.setSizePolicy(sizePolicy)
        self.widget_6.setInputMethodHints(QtCore.Qt.ImhNoEditMenu)
        self.widget_6.setObjectName("widget_6")
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.widget_6)
        self.horizontalLayout_4.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        self.sldr_filteredImageOpacity = QtWidgets.QSlider(self.widget_6)
        self.sldr_filteredImageOpacity.setEnabled(False)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum,
                                           QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.sldr_filteredImageOpacity.sizePolicy().hasHeightForWidth())
        self.sldr_filteredImageOpacity.setSizePolicy(sizePolicy)
        self.sldr_filteredImageOpacity.setMinimumSize(QtCore.QSize(0, 250))
        self.sldr_filteredImageOpacity.setCursor(
            QtGui.QCursor(QtCore.Qt.PointingHandCursor))
        self.sldr_filteredImageOpacity.setLayoutDirection(
            QtCore.Qt.LeftToRight)
        self.sldr_filteredImageOpacity.setMaximum(100)
        self.sldr_filteredImageOpacity.setProperty("value", 100)
        self.sldr_filteredImageOpacity.setSliderPosition(100)
        self.sldr_filteredImageOpacity.setTracking(True)
        self.sldr_filteredImageOpacity.setOrientation(QtCore.Qt.Vertical)
        self.sldr_filteredImageOpacity.setInvertedAppearance(False)
        self.sldr_filteredImageOpacity.setInvertedControls(False)
        self.sldr_filteredImageOpacity.setObjectName(
            "sldr_filteredImageOpacity")
        self.horizontalLayout_4.addWidget(self.sldr_filteredImageOpacity)
        self.verticalLayout_12.addWidget(self.widget_6)
        spacerItem3 = QtWidgets.QSpacerItem(20, 40,
                                            QtWidgets.QSizePolicy.Minimum,
                                            QtWidgets.QSizePolicy.Expanding)
        self.verticalLayout_12.addItem(spacerItem3)
        self.verticalLayout_12.setStretch(0, 10)
        self.verticalLayout_12.setStretch(1, 6)
        self.verticalLayout_12.setStretch(2, 10)
        self.horizontalLayout_3.addWidget(self.widget_3)
        ImageViewer.setCentralWidget(self.centralwidget)

        self.retranslateUi(ImageViewer)
        QtCore.QMetaObject.connectSlotsByName(ImageViewer)
Beispiel #28
0
    def setupUi(self, wg_Export):
        wg_Export.setObjectName("wg_Export")
        wg_Export.resize(340, 700)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(wg_Export.sizePolicy().hasHeightForWidth())
        wg_Export.setSizePolicy(sizePolicy)
        wg_Export.setMinimumSize(QtCore.QSize(340, 0))
        wg_Export.setMaximumSize(QtCore.QSize(340, 16777215))
        self.verticalLayout = QtWidgets.QVBoxLayout(wg_Export)
        self.verticalLayout.setContentsMargins(0, 0, 0, 0)
        self.verticalLayout.setObjectName("verticalLayout")
        self.widget_4 = QtWidgets.QWidget(wg_Export)
        self.widget_4.setObjectName("widget_4")
        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.widget_4)
        self.horizontalLayout_2.setContentsMargins(-1, 0, 18, 0)
        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
        self.l_name = QtWidgets.QLabel(self.widget_4)
        self.l_name.setObjectName("l_name")
        self.horizontalLayout_2.addWidget(self.l_name)
        self.e_name = QtWidgets.QLineEdit(self.widget_4)
        self.e_name.setMinimumSize(QtCore.QSize(0, 0))
        self.e_name.setMaximumSize(QtCore.QSize(9999, 16777215))
        self.e_name.setObjectName("e_name")
        self.horizontalLayout_2.addWidget(self.e_name)
        self.l_class = QtWidgets.QLabel(self.widget_4)
        font = QtGui.QFont()
        font.setWeight(75)
        font.setBold(True)
        self.l_class.setFont(font)
        self.l_class.setObjectName("l_class")
        self.horizontalLayout_2.addWidget(self.l_class)
        self.verticalLayout.addWidget(self.widget_4)
        self.groupBox_2 = QtWidgets.QGroupBox(wg_Export)
        self.groupBox_2.setObjectName("groupBox_2")
        self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.groupBox_2)
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.f_taskName = QtWidgets.QWidget(self.groupBox_2)
        self.f_taskName.setObjectName("f_taskName")
        self.horizontalLayout_11 = QtWidgets.QHBoxLayout(self.f_taskName)
        self.horizontalLayout_11.setContentsMargins(-1, 0, -1, 0)
        self.horizontalLayout_11.setObjectName("horizontalLayout_11")
        self.l_taskName = QtWidgets.QLabel(self.f_taskName)
        self.l_taskName.setObjectName("l_taskName")
        self.horizontalLayout_11.addWidget(self.l_taskName)
        self.l_taskName2 = QtWidgets.QLabel(self.f_taskName)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.l_taskName2.sizePolicy().hasHeightForWidth())
        self.l_taskName2.setSizePolicy(sizePolicy)
        self.l_taskName2.setText("")
        self.l_taskName2.setAlignment(QtCore.Qt.AlignCenter)
        self.l_taskName2.setObjectName("l_taskName2")
        self.horizontalLayout_11.addWidget(self.l_taskName2)
        self.b_changeTask = QtWidgets.QPushButton(self.f_taskName)
        self.b_changeTask.setEnabled(True)
        self.b_changeTask.setFocusPolicy(QtCore.Qt.NoFocus)
        self.b_changeTask.setObjectName("b_changeTask")
        self.horizontalLayout_11.addWidget(self.b_changeTask)
        self.verticalLayout_3.addWidget(self.f_taskName)
        self.f_frameRange = QtWidgets.QWidget(self.groupBox_2)
        self.f_frameRange.setObjectName("f_frameRange")
        self.horizontalLayout = QtWidgets.QHBoxLayout(self.f_frameRange)
        self.horizontalLayout.setSpacing(0)
        self.horizontalLayout.setContentsMargins(9, 0, 9, 0)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.label_3 = QtWidgets.QLabel(self.f_frameRange)
        self.label_3.setObjectName("label_3")
        self.horizontalLayout.addWidget(self.label_3)
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem)
        self.chb_globalRange = QtWidgets.QCheckBox(self.f_frameRange)
        self.chb_globalRange.setChecked(True)
        self.chb_globalRange.setObjectName("chb_globalRange")
        self.horizontalLayout.addWidget(self.chb_globalRange)
        self.l_rangeStart = QtWidgets.QLabel(self.f_frameRange)
        self.l_rangeStart.setEnabled(False)
        self.l_rangeStart.setObjectName("l_rangeStart")
        self.horizontalLayout.addWidget(self.l_rangeStart)
        self.sp_rangeStart = QtWidgets.QSpinBox(self.f_frameRange)
        self.sp_rangeStart.setEnabled(False)
        self.sp_rangeStart.setMaximumSize(QtCore.QSize(55, 16777215))
        self.sp_rangeStart.setMaximum(99999)
        self.sp_rangeStart.setObjectName("sp_rangeStart")
        self.horizontalLayout.addWidget(self.sp_rangeStart)
        spacerItem1 = QtWidgets.QSpacerItem(5, 20, QtWidgets.QSizePolicy.Fixed, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem1)
        self.l_rangeEnd = QtWidgets.QLabel(self.f_frameRange)
        self.l_rangeEnd.setEnabled(False)
        self.l_rangeEnd.setObjectName("l_rangeEnd")
        self.horizontalLayout.addWidget(self.l_rangeEnd)
        self.sp_rangeEnd = QtWidgets.QSpinBox(self.f_frameRange)
        self.sp_rangeEnd.setEnabled(False)
        self.sp_rangeEnd.setMaximumSize(QtCore.QSize(55, 16777215))
        self.sp_rangeEnd.setMaximum(99999)
        self.sp_rangeEnd.setProperty("value", 100)
        self.sp_rangeEnd.setObjectName("sp_rangeEnd")
        self.horizontalLayout.addWidget(self.sp_rangeEnd)
        self.verticalLayout_3.addWidget(self.f_frameRange)
        self.widget_6 = QtWidgets.QWidget(self.groupBox_2)
        self.widget_6.setObjectName("widget_6")
        self.horizontalLayout_5 = QtWidgets.QHBoxLayout(self.widget_6)
        self.horizontalLayout_5.setSpacing(0)
        self.horizontalLayout_5.setContentsMargins(9, 0, 9, 0)
        self.horizontalLayout_5.setObjectName("horizontalLayout_5")
        self.label_5 = QtWidgets.QLabel(self.widget_6)
        self.label_5.setObjectName("label_5")
        self.horizontalLayout_5.addWidget(self.label_5)
        spacerItem2 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_5.addItem(spacerItem2)
        self.cb_outType = QtWidgets.QComboBox(self.widget_6)
        self.cb_outType.setMinimumSize(QtCore.QSize(124, 0))
        self.cb_outType.setObjectName("cb_outType")
        self.horizontalLayout_5.addWidget(self.cb_outType)
        self.verticalLayout_3.addWidget(self.widget_6)
        self.f_cam = QtWidgets.QWidget(self.groupBox_2)
        self.f_cam.setObjectName("f_cam")
        self.horizontalLayout_6 = QtWidgets.QHBoxLayout(self.f_cam)
        self.horizontalLayout_6.setSpacing(0)
        self.horizontalLayout_6.setContentsMargins(-1, 0, -1, 0)
        self.horizontalLayout_6.setObjectName("horizontalLayout_6")
        self.l_cam = QtWidgets.QLabel(self.f_cam)
        self.l_cam.setMinimumSize(QtCore.QSize(40, 0))
        self.l_cam.setMaximumSize(QtCore.QSize(95, 16777215))
        self.l_cam.setObjectName("l_cam")
        self.horizontalLayout_6.addWidget(self.l_cam)
        self.cb_cam = QtWidgets.QComboBox(self.f_cam)
        self.cb_cam.setObjectName("cb_cam")
        self.horizontalLayout_6.addWidget(self.cb_cam)
        self.verticalLayout_3.addWidget(self.f_cam)
        self.w_sCamShot = QtWidgets.QWidget(self.groupBox_2)
        self.w_sCamShot.setObjectName("w_sCamShot")
        self.horizontalLayout_8 = QtWidgets.QHBoxLayout(self.w_sCamShot)
        self.horizontalLayout_8.setSpacing(0)
        self.horizontalLayout_8.setContentsMargins(9, 0, 9, 0)
        self.horizontalLayout_8.setObjectName("horizontalLayout_8")
        self.l_sCamShot = QtWidgets.QLabel(self.w_sCamShot)
        self.l_sCamShot.setMinimumSize(QtCore.QSize(40, 0))
        self.l_sCamShot.setMaximumSize(QtCore.QSize(95, 16777215))
        self.l_sCamShot.setObjectName("l_sCamShot")
        self.horizontalLayout_8.addWidget(self.l_sCamShot)
        self.cb_sCamShot = QtWidgets.QComboBox(self.w_sCamShot)
        self.cb_sCamShot.setObjectName("cb_sCamShot")
        self.horizontalLayout_8.addWidget(self.cb_sCamShot)
        self.verticalLayout_3.addWidget(self.w_sCamShot)
        self.f_convertExport = QtWidgets.QWidget(self.groupBox_2)
        self.f_convertExport.setObjectName("f_convertExport")
        self.horizontalLayout_15 = QtWidgets.QHBoxLayout(self.f_convertExport)
        self.horizontalLayout_15.setContentsMargins(9, 0, 9, 0)
        self.horizontalLayout_15.setObjectName("horizontalLayout_15")
        self.l_convertExport = QtWidgets.QLabel(self.f_convertExport)
        self.l_convertExport.setObjectName("l_convertExport")
        self.horizontalLayout_15.addWidget(self.l_convertExport)
        spacerItem3 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_15.addItem(spacerItem3)
        self.chb_convertExport = QtWidgets.QCheckBox(self.f_convertExport)
        self.chb_convertExport.setText("")
        self.chb_convertExport.setChecked(False)
        self.chb_convertExport.setObjectName("chb_convertExport")
        self.horizontalLayout_15.addWidget(self.chb_convertExport)
        self.verticalLayout_3.addWidget(self.f_convertExport)
        self.f_localOutput = QtWidgets.QWidget(self.groupBox_2)
        self.f_localOutput.setObjectName("f_localOutput")
        self.horizontalLayout_13 = QtWidgets.QHBoxLayout(self.f_localOutput)
        self.horizontalLayout_13.setContentsMargins(-1, 0, -1, 0)
        self.horizontalLayout_13.setObjectName("horizontalLayout_13")
        self.l_localOutput = QtWidgets.QLabel(self.f_localOutput)
        self.l_localOutput.setObjectName("l_localOutput")
        self.horizontalLayout_13.addWidget(self.l_localOutput)
        spacerItem4 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_13.addItem(spacerItem4)
        self.chb_localOutput = QtWidgets.QCheckBox(self.f_localOutput)
        self.chb_localOutput.setText("")
        self.chb_localOutput.setObjectName("chb_localOutput")
        self.horizontalLayout_13.addWidget(self.chb_localOutput)
        self.verticalLayout_3.addWidget(self.f_localOutput)
        self.f_status = QtWidgets.QWidget(self.groupBox_2)
        self.f_status.setObjectName("f_status")
        self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.f_status)
        self.horizontalLayout_4.setContentsMargins(-1, 0, -1, 0)
        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
        self.label = QtWidgets.QLabel(self.f_status)
        self.label.setMinimumSize(QtCore.QSize(40, 0))
        self.label.setMaximumSize(QtCore.QSize(40, 16777215))
        self.label.setObjectName("label")
        self.horizontalLayout_4.addWidget(self.label)
        self.l_status = QtWidgets.QLabel(self.f_status)
        self.l_status.setAlignment(QtCore.Qt.AlignCenter)
        self.l_status.setObjectName("l_status")
        self.horizontalLayout_4.addWidget(self.l_status)
        self.b_goTo = QtWidgets.QPushButton(self.f_status)
        self.b_goTo.setFocusPolicy(QtCore.Qt.NoFocus)
        self.b_goTo.setObjectName("b_goTo")
        self.horizontalLayout_4.addWidget(self.b_goTo)
        self.verticalLayout_3.addWidget(self.f_status)
        self.f_connect = QtWidgets.QWidget(self.groupBox_2)
        self.f_connect.setObjectName("f_connect")
        self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.f_connect)
        self.horizontalLayout_3.setContentsMargins(-1, 0, -1, 0)
        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
        self.b_connect = QtWidgets.QPushButton(self.f_connect)
        self.b_connect.setFocusPolicy(QtCore.Qt.NoFocus)
        self.b_connect.setObjectName("b_connect")
        self.horizontalLayout_3.addWidget(self.b_connect)
        self.verticalLayout_3.addWidget(self.f_connect)
        self.verticalLayout.addWidget(self.groupBox_2)
        self.gb_submit = QtWidgets.QGroupBox(wg_Export)
        self.gb_submit.setCheckable(True)
        self.gb_submit.setChecked(True)
        self.gb_submit.setObjectName("gb_submit")
        self.verticalLayout_7 = QtWidgets.QVBoxLayout(self.gb_submit)
        self.verticalLayout_7.setContentsMargins(-1, 15, -1, -1)
        self.verticalLayout_7.setObjectName("verticalLayout_7")
        self.f_manager = QtWidgets.QWidget(self.gb_submit)
        self.f_manager.setObjectName("f_manager")
        self.horizontalLayout_17 = QtWidgets.QHBoxLayout(self.f_manager)
        self.horizontalLayout_17.setContentsMargins(-1, 0, -1, 0)
        self.horizontalLayout_17.setObjectName("horizontalLayout_17")
        self.l_manager = QtWidgets.QLabel(self.f_manager)
        self.l_manager.setObjectName("l_manager")
        self.horizontalLayout_17.addWidget(self.l_manager)
        spacerItem5 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_17.addItem(spacerItem5)
        self.cb_manager = QtWidgets.QComboBox(self.f_manager)
        self.cb_manager.setMinimumSize(QtCore.QSize(150, 0))
        self.cb_manager.setObjectName("cb_manager")
        self.horizontalLayout_17.addWidget(self.cb_manager)
        self.verticalLayout_7.addWidget(self.f_manager)
        self.f_rjPrio = QtWidgets.QWidget(self.gb_submit)
        self.f_rjPrio.setObjectName("f_rjPrio")
        self.horizontalLayout_21 = QtWidgets.QHBoxLayout(self.f_rjPrio)
        self.horizontalLayout_21.setContentsMargins(-1, 0, -1, 0)
        self.horizontalLayout_21.setObjectName("horizontalLayout_21")
        self.l_rjPrio = QtWidgets.QLabel(self.f_rjPrio)
        self.l_rjPrio.setObjectName("l_rjPrio")
        self.horizontalLayout_21.addWidget(self.l_rjPrio)
        spacerItem6 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_21.addItem(spacerItem6)
        self.sp_rjPrio = QtWidgets.QSpinBox(self.f_rjPrio)
        self.sp_rjPrio.setMaximum(100)
        self.sp_rjPrio.setProperty("value", 50)
        self.sp_rjPrio.setObjectName("sp_rjPrio")
        self.horizontalLayout_21.addWidget(self.sp_rjPrio)
        self.verticalLayout_7.addWidget(self.f_rjPrio)
        self.f_rjWidgetsPerTask = QtWidgets.QWidget(self.gb_submit)
        self.f_rjWidgetsPerTask.setObjectName("f_rjWidgetsPerTask")
        self.horizontalLayout_22 = QtWidgets.QHBoxLayout(self.f_rjWidgetsPerTask)
        self.horizontalLayout_22.setContentsMargins(-1, 0, -1, 0)
        self.horizontalLayout_22.setObjectName("horizontalLayout_22")
        self.label_15 = QtWidgets.QLabel(self.f_rjWidgetsPerTask)
        self.label_15.setObjectName("label_15")
        self.horizontalLayout_22.addWidget(self.label_15)
        spacerItem7 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_22.addItem(spacerItem7)
        self.sp_rjFramesPerTask = QtWidgets.QSpinBox(self.f_rjWidgetsPerTask)
        self.sp_rjFramesPerTask.setMaximum(9999)
        self.sp_rjFramesPerTask.setProperty("value", 999)
        self.sp_rjFramesPerTask.setObjectName("sp_rjFramesPerTask")
        self.horizontalLayout_22.addWidget(self.sp_rjFramesPerTask)
        self.verticalLayout_7.addWidget(self.f_rjWidgetsPerTask)
        self.f_rjTimeout = QtWidgets.QWidget(self.gb_submit)
        self.f_rjTimeout.setObjectName("f_rjTimeout")
        self.horizontalLayout_28 = QtWidgets.QHBoxLayout(self.f_rjTimeout)
        self.horizontalLayout_28.setContentsMargins(-1, 0, -1, 0)
        self.horizontalLayout_28.setObjectName("horizontalLayout_28")
        self.l_rjTimeout = QtWidgets.QLabel(self.f_rjTimeout)
        self.l_rjTimeout.setObjectName("l_rjTimeout")
        self.horizontalLayout_28.addWidget(self.l_rjTimeout)
        spacerItem8 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_28.addItem(spacerItem8)
        self.sp_rjTimeout = QtWidgets.QSpinBox(self.f_rjTimeout)
        self.sp_rjTimeout.setMinimum(1)
        self.sp_rjTimeout.setMaximum(9999)
        self.sp_rjTimeout.setProperty("value", 360)
        self.sp_rjTimeout.setObjectName("sp_rjTimeout")
        self.horizontalLayout_28.addWidget(self.sp_rjTimeout)
        self.verticalLayout_7.addWidget(self.f_rjTimeout)
        self.f_rjSuspended = QtWidgets.QWidget(self.gb_submit)
        self.f_rjSuspended.setObjectName("f_rjSuspended")
        self.horizontalLayout_26 = QtWidgets.QHBoxLayout(self.f_rjSuspended)
        self.horizontalLayout_26.setContentsMargins(-1, 0, -1, 0)
        self.horizontalLayout_26.setObjectName("horizontalLayout_26")
        self.label_18 = QtWidgets.QLabel(self.f_rjSuspended)
        self.label_18.setObjectName("label_18")
        self.horizontalLayout_26.addWidget(self.label_18)
        spacerItem9 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_26.addItem(spacerItem9)
        self.chb_rjSuspended = QtWidgets.QCheckBox(self.f_rjSuspended)
        self.chb_rjSuspended.setText("")
        self.chb_rjSuspended.setChecked(False)
        self.chb_rjSuspended.setObjectName("chb_rjSuspended")
        self.horizontalLayout_26.addWidget(self.chb_rjSuspended)
        self.verticalLayout_7.addWidget(self.f_rjSuspended)
        self.f_osDependencies = QtWidgets.QWidget(self.gb_submit)
        self.f_osDependencies.setObjectName("f_osDependencies")
        self.horizontalLayout_27 = QtWidgets.QHBoxLayout(self.f_osDependencies)
        self.horizontalLayout_27.setContentsMargins(-1, 0, -1, 0)
        self.horizontalLayout_27.setObjectName("horizontalLayout_27")
        self.label_19 = QtWidgets.QLabel(self.f_osDependencies)
        self.label_19.setObjectName("label_19")
        self.horizontalLayout_27.addWidget(self.label_19)
        spacerItem10 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_27.addItem(spacerItem10)
        self.chb_osDependencies = QtWidgets.QCheckBox(self.f_osDependencies)
        self.chb_osDependencies.setText("")
        self.chb_osDependencies.setChecked(True)
        self.chb_osDependencies.setObjectName("chb_osDependencies")
        self.horizontalLayout_27.addWidget(self.chb_osDependencies)
        self.verticalLayout_7.addWidget(self.f_osDependencies)
        self.f_osUpload = QtWidgets.QWidget(self.gb_submit)
        self.f_osUpload.setObjectName("f_osUpload")
        self.horizontalLayout_23 = QtWidgets.QHBoxLayout(self.f_osUpload)
        self.horizontalLayout_23.setContentsMargins(-1, 0, -1, 0)
        self.horizontalLayout_23.setObjectName("horizontalLayout_23")
        self.label_16 = QtWidgets.QLabel(self.f_osUpload)
        self.label_16.setObjectName("label_16")
        self.horizontalLayout_23.addWidget(self.label_16)
        spacerItem11 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_23.addItem(spacerItem11)
        self.chb_osUpload = QtWidgets.QCheckBox(self.f_osUpload)
        self.chb_osUpload.setText("")
        self.chb_osUpload.setChecked(True)
        self.chb_osUpload.setObjectName("chb_osUpload")
        self.horizontalLayout_23.addWidget(self.chb_osUpload)
        self.verticalLayout_7.addWidget(self.f_osUpload)
        self.f_osPAssets = QtWidgets.QWidget(self.gb_submit)
        self.f_osPAssets.setObjectName("f_osPAssets")
        self.horizontalLayout_24 = QtWidgets.QHBoxLayout(self.f_osPAssets)
        self.horizontalLayout_24.setContentsMargins(-1, 0, -1, 0)
        self.horizontalLayout_24.setObjectName("horizontalLayout_24")
        self.label_17 = QtWidgets.QLabel(self.f_osPAssets)
        self.label_17.setObjectName("label_17")
        self.horizontalLayout_24.addWidget(self.label_17)
        spacerItem12 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_24.addItem(spacerItem12)
        self.chb_osPAssets = QtWidgets.QCheckBox(self.f_osPAssets)
        self.chb_osPAssets.setText("")
        self.chb_osPAssets.setChecked(True)
        self.chb_osPAssets.setObjectName("chb_osPAssets")
        self.horizontalLayout_24.addWidget(self.chb_osPAssets)
        self.verticalLayout_7.addWidget(self.f_osPAssets)
        self.gb_osSlaves = QtWidgets.QGroupBox(self.gb_submit)
        self.gb_osSlaves.setObjectName("gb_osSlaves")
        self.horizontalLayout_25 = QtWidgets.QHBoxLayout(self.gb_osSlaves)
        self.horizontalLayout_25.setContentsMargins(9, 3, 9, 3)
        self.horizontalLayout_25.setObjectName("horizontalLayout_25")
        self.e_osSlaves = QtWidgets.QLineEdit(self.gb_osSlaves)
        self.e_osSlaves.setObjectName("e_osSlaves")
        self.horizontalLayout_25.addWidget(self.e_osSlaves)
        self.b_osSlaves = QtWidgets.QPushButton(self.gb_osSlaves)
        self.b_osSlaves.setMaximumSize(QtCore.QSize(25, 16777215))
        self.b_osSlaves.setFocusPolicy(QtCore.Qt.NoFocus)
        self.b_osSlaves.setObjectName("b_osSlaves")
        self.horizontalLayout_25.addWidget(self.b_osSlaves)
        self.verticalLayout_7.addWidget(self.gb_osSlaves)
        self.f_dlGroup = QtWidgets.QWidget(self.gb_submit)
        self.f_dlGroup.setObjectName("f_dlGroup")
        self.horizontalLayout_7 = QtWidgets.QHBoxLayout(self.f_dlGroup)
        self.horizontalLayout_7.setContentsMargins(-1, 0, -1, 0)
        self.horizontalLayout_7.setObjectName("horizontalLayout_7")
        self.label_9 = QtWidgets.QLabel(self.f_dlGroup)
        self.label_9.setObjectName("label_9")
        self.horizontalLayout_7.addWidget(self.label_9)
        spacerItem13 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.horizontalLayout_7.addItem(spacerItem13)
        self.cb_dlGroup = QtWidgets.QComboBox(self.f_dlGroup)
        self.cb_dlGroup.setMinimumSize(QtCore.QSize(150, 0))
        self.cb_dlGroup.setObjectName("cb_dlGroup")
        self.horizontalLayout_7.addWidget(self.cb_dlGroup)
        self.verticalLayout_7.addWidget(self.f_dlGroup)
        self.verticalLayout.addWidget(self.gb_submit)
        self.groupBox = QtWidgets.QGroupBox(wg_Export)
        self.groupBox.setCheckable(False)
        self.groupBox.setChecked(False)
        self.groupBox.setObjectName("groupBox")
        self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.groupBox)
        self.verticalLayout_4.setContentsMargins(18, -1, 18, -1)
        self.verticalLayout_4.setObjectName("verticalLayout_4")
        self.l_pathLast = QtWidgets.QLabel(self.groupBox)
        self.l_pathLast.setObjectName("l_pathLast")
        self.verticalLayout_4.addWidget(self.l_pathLast)
        self.widget_2 = QtWidgets.QWidget(self.groupBox)
        self.widget_2.setObjectName("widget_2")
        self.horizontalLayout_14 = QtWidgets.QHBoxLayout(self.widget_2)
        self.horizontalLayout_14.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout_14.setContentsMargins(0, 0, 0, 0)
        self.horizontalLayout_14.setObjectName("horizontalLayout_14")
        self.b_openLast = QtWidgets.QPushButton(self.widget_2)
        self.b_openLast.setEnabled(False)
        self.b_openLast.setFocusPolicy(QtCore.Qt.NoFocus)
        self.b_openLast.setObjectName("b_openLast")
        self.horizontalLayout_14.addWidget(self.b_openLast)
        self.b_copyLast = QtWidgets.QPushButton(self.widget_2)
        self.b_copyLast.setEnabled(False)
        self.b_copyLast.setFocusPolicy(QtCore.Qt.NoFocus)
        self.b_copyLast.setObjectName("b_copyLast")
        self.horizontalLayout_14.addWidget(self.b_copyLast)
        self.verticalLayout_4.addWidget(self.widget_2)
        self.verticalLayout.addWidget(self.groupBox)

        self.retranslateUi(wg_Export)
        QtCore.QMetaObject.connectSlotsByName(wg_Export)
Beispiel #29
0
 def _create_scale_button_ui(self):
     self.scale_btn = QtWidgets.QPushButton("Scale")
     layout = QtWidgets.QHBoxLayout()
     layout.addWidget(self.scale_btn)
     return layout
Beispiel #30
0
    def setupUi(self, NinePatchFrame):
        NinePatchFrame.setObjectName("NinePatchFrame")
        NinePatchFrame.resize(252, 290)
        icon = QtGui.QIcon()
        icon.addPixmap(QtGui.QPixmap(":/root/favicon"), QtGui.QIcon.Normal,
                       QtGui.QIcon.Off)
        NinePatchFrame.setWindowIcon(icon)
        self.verticalLayout = QtWidgets.QVBoxLayout(NinePatchFrame)
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.labelEdge = QtWidgets.QLabel(NinePatchFrame)
        font = QtGui.QFont()
        font.setFamily("等线 Light")
        font.setPointSize(16)
        self.labelEdge.setFont(font)
        self.labelEdge.setObjectName("labelEdge")
        self.horizontalLayout.addWidget(self.labelEdge)
        self.spinBoxEdge = QtWidgets.QSpinBox(NinePatchFrame)
        font = QtGui.QFont()
        font.setFamily("微软雅黑 Light")
        font.setPointSize(16)
        self.spinBoxEdge.setFont(font)
        self.spinBoxEdge.setObjectName("spinBoxEdge")
        self.horizontalLayout.addWidget(self.spinBoxEdge)
        self.pushButtonCommit = QtWidgets.QPushButton(NinePatchFrame)
        font = QtGui.QFont()
        font.setFamily("微软雅黑 Light")
        font.setPointSize(16)
        self.pushButtonCommit.setFont(font)
        self.pushButtonCommit.setObjectName("pushButtonCommit")
        self.horizontalLayout.addWidget(self.pushButtonCommit)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.tableWidgetResult = QtWidgets.QTableWidget(NinePatchFrame)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding,
                                           QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(
            self.tableWidgetResult.sizePolicy().hasHeightForWidth())
        self.tableWidgetResult.setSizePolicy(sizePolicy)
        font = QtGui.QFont()
        font.setFamily("微软雅黑 Light")
        font.setPointSize(16)
        self.tableWidgetResult.setFont(font)
        self.tableWidgetResult.setEditTriggers(
            QtWidgets.QAbstractItemView.EditKeyPressed)
        self.tableWidgetResult.setIconSize(QtCore.QSize(25, 25))
        self.tableWidgetResult.setTextElideMode(QtCore.Qt.ElideNone)
        self.tableWidgetResult.setObjectName("tableWidgetResult")
        self.tableWidgetResult.setColumnCount(0)
        self.tableWidgetResult.setRowCount(0)
        self.tableWidgetResult.horizontalHeader().setVisible(False)
        self.tableWidgetResult.horizontalHeader().setDefaultSectionSize(10)
        self.tableWidgetResult.horizontalHeader().setHighlightSections(False)
        self.tableWidgetResult.horizontalHeader().setMinimumSectionSize(10)
        self.tableWidgetResult.horizontalHeader().setStretchLastSection(False)
        self.tableWidgetResult.verticalHeader().setVisible(False)
        self.tableWidgetResult.verticalHeader().setDefaultSectionSize(10)
        self.tableWidgetResult.verticalHeader().setHighlightSections(False)
        self.tableWidgetResult.verticalHeader().setMinimumSectionSize(10)
        self.tableWidgetResult.verticalHeader().setStretchLastSection(False)
        self.verticalLayout.addWidget(self.tableWidgetResult)
        self.labelEdge.setBuddy(self.spinBoxEdge)

        self.retranslateUi(NinePatchFrame)
        QtCore.QMetaObject.connectSlotsByName(NinePatchFrame)
        NinePatchFrame.setTabOrder(self.spinBoxEdge, self.pushButtonCommit)
        NinePatchFrame.setTabOrder(self.pushButtonCommit,
                                   self.tableWidgetResult)