def __init__(self, parent): super(DeviceFilesWidget, self).__init__(i18n('Device files'), parent) self.setWindowTitle(i18n("Device files")) widget = QtWidgets.QWidget(self) vlayout = QtWidgets.QVBoxLayout() self.toolbar = QtWidgets.QToolBar(self) self.toolbar.addAction(i18n("Refresh"), self.loadRemoteFiles) self.toolbar.addAction(icon("download"), i18n("Download to Device"), self.downloadFile) self.filesView = QtWidgets.QTreeWidget(self) self.filesView.header().close() self.deviceItem = QtWidgets.QTreeWidgetItem(0) self.deviceItem.setText(0,i18n("Device")) self.filesView.addTopLevelItem(self.deviceItem) vlayout.addWidget(self.toolbar) vlayout.addWidget(self.filesView) widget.setLayout(vlayout) self.setWidget(widget)
def setupUi(self, Dialog): Dialog.setObjectName("Dialog") Dialog.resize(933, 539) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(":/icons/Preferences-system.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) Dialog.setWindowIcon(icon) self.verticalLayout = QtWidgets.QVBoxLayout(Dialog) self.verticalLayout.setObjectName("verticalLayout") self.horizontalLayout = QtWidgets.QHBoxLayout() self.horizontalLayout.setContentsMargins(-1, -1, 0, -1) self.horizontalLayout.setObjectName("horizontalLayout") self.categories = QtWidgets.QTreeWidget(Dialog) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Expanding) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.categories.sizePolicy().hasHeightForWidth()) self.categories.setSizePolicy(sizePolicy) self.categories.setMinimumSize(QtCore.QSize(250, 0)) self.categories.setObjectName("categories") item_0 = QtWidgets.QTreeWidgetItem(self.categories) icon = QtGui.QIcon.fromTheme("preferences-system") item_0.setIcon(0, icon) item_0 = QtWidgets.QTreeWidgetItem(self.categories) icon = QtGui.QIcon.fromTheme("accessories-text-editor") item_0.setIcon(0, icon) item_1 = QtWidgets.QTreeWidgetItem(item_0) icon = QtGui.QIcon.fromTheme("applications-graphics") item_1.setIcon(0, icon) item_1 = QtWidgets.QTreeWidgetItem(item_0) icon = QtGui.QIcon.fromTheme("network-wired") item_1.setIcon(0, icon) item_0 = QtWidgets.QTreeWidgetItem(self.categories) icon1 = QtGui.QIcon() icon1.addPixmap(QtGui.QPixmap(":/icons/interpreter-sys.png"), QtGui.QIcon.Normal, QtGui.QIcon.Off) item_0.setIcon(0, icon1) self.categories.header().setVisible(False) self.horizontalLayout.addWidget(self.categories) self.line = QtWidgets.QFrame(Dialog) self.line.setFrameShape(QtWidgets.QFrame.VLine) self.line.setFrameShadow(QtWidgets.QFrame.Sunken) self.line.setObjectName("line") self.horizontalLayout.addWidget(self.line) self.pages = QtWidgets.QStackedWidget(Dialog) sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred) sizePolicy.setHorizontalStretch(0) sizePolicy.setVerticalStretch(0) sizePolicy.setHeightForWidth(self.pages.sizePolicy().hasHeightForWidth()) self.pages.setSizePolicy(sizePolicy) self.pages.setObjectName("pages") self.pageNotFound = QtWidgets.QWidget() self.pageNotFound.setObjectName("pageNotFound") self.gridLayout = QtWidgets.QGridLayout(self.pageNotFound) self.gridLayout.setObjectName("gridLayout") self.label = QtWidgets.QLabel(self.pageNotFound) self.label.setAlignment(QtCore.Qt.AlignCenter) self.label.setObjectName("label") self.gridLayout.addWidget(self.label, 0, 0, 1, 1) self.pages.addWidget(self.pageNotFound) self.horizontalLayout.addWidget(self.pages) self.verticalLayout.addLayout(self.horizontalLayout) self.buttons = QtWidgets.QDialogButtonBox(Dialog) self.buttons.setOrientation(QtCore.Qt.Horizontal) self.buttons.setStandardButtons(QtWidgets.QDialogButtonBox.Cancel|QtWidgets.QDialogButtonBox.Ok|QtWidgets.QDialogButtonBox.Reset|QtWidgets.QDialogButtonBox.RestoreDefaults) self.buttons.setObjectName("buttons") self.verticalLayout.addWidget(self.buttons) self.retranslateUi(Dialog) self.buttons.accepted.connect(Dialog.accept) self.buttons.rejected.connect(Dialog.reject) QtCore.QMetaObject.connectSlotsByName(Dialog)