Ejemplo n.º 1
0
 def _bottom(self) -> main_widgets.HBox:
     hbox = main_widgets.HBox()
     hbox.addWitems(
         main_widgets.Spacer(h_pol=QtWidgets.QSizePolicy.Expanding),
         main_widgets.Button(text="Close", to_connect=self.hide),
     )
     return hbox
Ejemplo n.º 2
0
 def _bottom(self) -> main_widgets.HBox:
     hbox = main_widgets.HBox()
     hbox.addWitems(
         main_widgets.Spacer(h_pol=QtWidgets.QSizePolicy.Expanding),
         main_widgets.Button(
             text="Disable all",
             to_connect=self._disable_all_devices.emit,
             tooltip="Disable all enabled device drivers",
         ),
         main_widgets.Button(
             text="Refresh",
             to_connect=self._refresh_enabled_devices.emit,
             tooltip="Check for enabled devices",
         ),
     )
     return hbox
Ejemplo n.º 3
0
 def _bottom(self) -> main_widgets.HBox:
     hbox = main_widgets.HBox()
     hbox.addSpacerItem(
         main_widgets.Spacer(h_pol=QtWidgets.QSizePolicy.Expanding)
     )
     hbox.addWidget(
         main_widgets.Button(
             text="Settings",
             to_connect=self.MAIN.settings_window.show,
         )
     )
     hbox.addWidget(
         main_widgets.Button(
             text="Close",
             to_connect=self.on_quit,
         )
     )
     return hbox
Ejemplo n.º 4
0
 def _bottom(self) -> main_widgets.HBox:
     hbox = main_widgets.HBox()
     hbox.addWitems(
         main_widgets.Spacer(h_pol=QtWidgets.QSizePolicy.Expanding),
         main_widgets.Button(
             text="Refresh",
             to_connect=self._refresh_devices.emit,
         ),
     )
     return hbox
Ejemplo n.º 5
0
 def _bottom(self) -> main_widgets.HBox:
     hbox = main_widgets.HBox()
     hbox.addSpacerItem(
         main_widgets.Spacer(h_pol=QtWidgets.QSizePolicy.Expanding))
     self.checkbox = CheckBox(
         self._init_state,
         self._enabled_change,
     )
     hbox.addWidgets(
         self.checkbox,
         main_widgets.Button(text="Show info",
                             to_connect=self._show_device_info),
     )
     return hbox
Ejemplo n.º 6
0
    def _layout(self) -> main_widgets.VBox:
        vbox = main_widgets.VBox()
        text_widget = QtWidgets.QPlainTextEdit(str(self._device_info))
        text_widget.setSizePolicy(
            QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding
        )
        text_widget.setReadOnly(True)

        def copy_info() -> None:
            text_widget.selectAll()
            text_widget.copy()
            text_widget.moveCursor(QtGui.QTextCursor.Start)

        bottom = main_widgets.HBox()
        bottom.addSpacerItem(
            main_widgets.Spacer(h_pol=QtWidgets.QSizePolicy.Expanding)
        )
        bottom.addWidgets(
            main_widgets.Button(text="Copy info", to_connect=copy_info),
            main_widgets.Button(text="Close", to_connect=self.close),
        )
        vbox.addWidget(text_widget)
        vbox.addItem(bottom)
        return vbox