Example #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
Example #2
0
 def _layout(self) -> QtWidgets.QWidget:
     widget = QtWidgets.QWidget()
     self._vbox = main_widgets.VBox()
     self._vbox.addSpacerItem(
         main_widgets.Spacer(v_pol=QtWidgets.QSizePolicy.Expanding))
     widget.setLayout(self._vbox)
     return widget
Example #3
0
 def _layout(self) -> None:
     self.addWidget(
         DeviceSelector(
             self.MAIN.refresh_devices,
             self.MAIN.device_changed,
             self.MAIN.add_device,
         )
     )
     self.addSpacerItem(
         main_widgets.Spacer(
             v_pol=QtWidgets.QSizePolicy.Fixed, width=150, height=5
         )
     )
     self.addItem(DeviceInfo(self.MAIN.update_device_info))
     self.addSpacerItem(
         main_widgets.Spacer(v_pol=QtWidgets.QSizePolicy.MinimumExpanding)
     )
Example #4
0
 def _top(self) -> main_widgets.HBox:
     hbox = main_widgets.HBox()
     hbox.addItem(self.MAIN.MAIN_LEFT)
     hbox.addSpacerItem(
         main_widgets.Spacer(
             h_pol=QtWidgets.QSizePolicy.Expanding,
             v_pol=QtWidgets.QSizePolicy.Expanding,
         )
     )
     return hbox
Example #5
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
Example #6
0
 def __init__(self, update_info: QtSignalType):
     super().__init__()
     update_info.connect(self._update_info)
     self._add_labels()
     self.addItem(
         main_widgets.Spacer(
             h_pol=QtWidgets.QSizePolicy.Minimum,
             height=0,
             width=80,
         ),
         0,
         1,
     )
     self.addItem(
         main_widgets.Spacer(
             h_pol=QtWidgets.QSizePolicy.Minimum,
             height=0,
             width=40,
         ),
         0,
         3,
     )
Example #7
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
Example #8
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
Example #9
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
Example #10
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