Example #1
0
    def __init__(self):
        super().__init__()
        self.data = None

        grid = QGridLayout()
        gui.widgetBox(self.controlArea, orientation=grid)
        grid.addWidget(
            gui.checkBox(
                None, self, "add_type_annotations",
                "Add type annotations to header",
                tooltip=
                "Some formats (Tab-delimited, Comma-separated) can include \n"
                "additional information about variables types in header rows.",
                callback=self._update_messages),
            0, 0, 1, 2)
        grid.setRowMinimumHeight(1, 8)
        grid.addWidget(
            gui.checkBox(
                None, self, "auto_save", "Autosave when receiving new data",
                callback=self._update_messages),
            2, 0, 1, 2)
        grid.setRowMinimumHeight(3, 8)
        self.bt_save = gui.button(None, self, "Save", callback=self.save_file)
        grid.addWidget(self.bt_save, 4, 0)
        grid.addWidget(
            gui.button(None, self, "Save as ...", callback=self.save_file_as),
            4, 1)

        self.adjustSize()
        self._update_messages()
Example #2
0
    def __init__(self):
        super().__init__()
        self.data = None

        grid = QGridLayout()
        gui.widgetBox(self.controlArea, orientation=grid)
        grid.addWidget(
            gui.checkBox(
                None,
                self,
                "add_type_annotations",
                "Add type annotations to header",
                tooltip=
                "Some formats (Tab-delimited, Comma-separated) can include \n"
                "additional information about variables types in header rows.",
                callback=self._update_messages), 0, 0, 1, 2)
        grid.setRowMinimumHeight(1, 8)
        grid.addWidget(
            gui.checkBox(None,
                         self,
                         "auto_save",
                         "Autosave when receiving new data",
                         callback=self._update_messages), 2, 0, 1, 2)
        grid.setRowMinimumHeight(3, 8)
        self.bt_save = gui.button(None, self, "Save", callback=self.save_file)
        grid.addWidget(self.bt_save, 4, 0)
        grid.addWidget(
            gui.button(None, self, "Save as ...", callback=self.save_file_as),
            4, 1)

        self.adjustSize()
        self._update_messages()
Example #3
0
    def __init__(self):
        OWWidget.__init__(self)
        ConcurrentWidgetMixin.__init__(self)

        self.available_scales = sorted(MODELS.values(),
                                       key=lambda x: x["order"])

        # create grid
        grid = QGridLayout()
        gui.widgetBox(self.controlArea, orientation=grid)

        # image attribute selection
        hbox_attr = gui.hBox(None)
        self.cb_image_attr = gui.comboBox(widget=hbox_attr,
                                          master=self,
                                          value='image_attr_current_index',
                                          label='Image attribute',
                                          orientation=Qt.Horizontal,
                                          callback=self.setting_changed)
        grid.addWidget(hbox_attr, 1, 0, 1, 2)

        # Scale images option
        hbox_scale = gui.hBox(None)
        gui.checkBox(widget=hbox_scale,
                     master=self,
                     value="use_scale",
                     label="Scale images to ",
                     callback=self.setting_changed)
        self.scale_combo = gui.comboBox(widget=hbox_scale,
                                        master=self,
                                        value="scale_index",
                                        items=[
                                            "{} ({}×{})".format(
                                                v["name"],
                                                *v["target_image_size"])
                                            for v in self.available_scales
                                        ],
                                        callback=self.setting_changed)
        grid.addWidget(hbox_scale, 3, 0, 1, 2)

        # file format
        hbox_format = gui.hBox(None)
        gui.comboBox(widget=hbox_format,
                     master=self,
                     value="file_format_index",
                     label="File format",
                     items=[x.upper() for x in SUPPORTED_FILE_FORMATS],
                     orientation=Qt.Horizontal,
                     callback=self.setting_changed)
        grid.addWidget(hbox_format, 4, 0, 1, 2)

        # auto save
        grid.addWidget(
            gui.checkBox(
                widget=None,
                master=self,
                value="auto_save",
                label="Autosave when receiving new data or settings change",
                callback=self._update_messages), 5, 0, 1, 2)

        # buttons
        self.bt_save = gui.button(None, self, "Save", callback=self.save_file)
        grid.addWidget(self.bt_save, 7, 0)
        grid.addWidget(
            gui.button(None, self, "Save as ...", callback=self.save_file_as),
            7, 1)

        grid.setRowMinimumHeight(5, 8)
        grid.setRowMinimumHeight(6, 20)

        self.scale_combo.setEnabled(self.use_scale)
        self.adjustSize()
        self._update_messages()