def edit(self,event): self.edit_dialog = CreateDialog() self.edit_dialog.addtask_btn.clicked.connect(self.update_task) self.edit_dialog.taskcount_spinbox.hide() self.edit_dialog.profile_box.clear() self.edit_dialog.proxies_box.clear() profile_combobox = self.parent().parent().parent().parent().parent().parent().parent().createdialog.profile_box for profile in [profile_combobox.itemText(i) for i in range(profile_combobox.count())]: self.edit_dialog.profile_box.addItem(profile) proxies_combobox = self.parent().parent().parent().parent().parent().parent().parent().createdialog.proxies_box for proxy in [proxies_combobox.itemText(i) for i in range(proxies_combobox.count())]: self.edit_dialog.proxies_box.addItem(proxy) self.edit_dialog.load_data(self) self.edit_dialog.show()
def setupUi(self, MainWindow): MainWindow.setFixedSize(1109, 600) # background color for main UI MainWindow.setStyleSheet("background-color: {};".format( globalStyles["backgroundDark"])) MainWindow.setWindowTitle("Phoenix Bot") self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setStyleSheet( "QMessageBox QLabel { color: #FFFFFF; }QMessageBox QPushButton { background-color: %s;color: #FFFFFF;}" % (globalStyles["primary"])) self.sidebar = QtWidgets.QWidget(self.centralwidget) self.sidebar.setGeometry(QtCore.QRect(0, 0, 61, 601)) # SIDE BAR COLOR self.sidebar.setStyleSheet( 'background-color: {};border-right: 1px solid #2e2d2d;'.format( globalStyles['backgroundLight'])) self.home_tab = QtWidgets.QWidget(self.sidebar) self.home_tab.setGeometry(QtCore.QRect(0, 85, 60, 45)) self.home_tab.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) #initial selected color background self.home_tab.setStyleSheet( "background-color: {};border: none;".format( globalStyles['primaryAscent'])) self.home_active_tab = QtWidgets.QWidget(self.home_tab) self.home_active_tab.setGeometry(QtCore.QRect(0, 0, 4, 45)) #initial selected color side bar self.home_active_tab.setStyleSheet( "background-color: {};border: none;".format( globalStyles["primary"])) self.home_active_tab.setCursor( QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.home_icon = QtWidgets.QLabel(self.home_tab) self.home_icon.setGeometry(QtCore.QRect(21, 13, 20, 20)) self.home_icon.setStyleSheet("border: none;") self.home_icon.setText("") self.home_icon.setPixmap(QtGui.QPixmap("images/home_alt.png")) self.home_icon.setScaledContents(True) self.home_icon.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.profiles_tab = QtWidgets.QWidget(self.sidebar) self.profiles_tab.setGeometry(QtCore.QRect(0, 130, 60, 45)) self.profiles_tab.setCursor(QtGui.QCursor( QtCore.Qt.PointingHandCursor)) self.profiles_tab.setStyleSheet( "background-color: transparent;border: none;") self.profiles_active_tab = QtWidgets.QWidget(self.profiles_tab) self.profiles_active_tab.setGeometry(QtCore.QRect(0, 0, 4, 45)) self.profiles_active_tab.setStyleSheet( "background-color: transparent;border: none;") self.profiles_active_tab.setCursor( QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.profiles_icon = QtWidgets.QLabel(self.profiles_tab) self.profiles_icon.setGeometry(QtCore.QRect(21, 13, 20, 20)) self.profiles_icon.setStyleSheet("border: none;") self.profiles_icon.setText("") self.profiles_icon.setPixmap(QtGui.QPixmap("images/profiles.png")) self.profiles_icon.setScaledContents(True) self.profiles_icon.setCursor( QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.proxies_tab = QtWidgets.QWidget(self.sidebar) self.proxies_tab.setGeometry(QtCore.QRect(0, 175, 60, 45)) self.proxies_tab.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.proxies_tab.setStyleSheet( "background-color: transparent;border: none;") self.proxies_active_tab = QtWidgets.QWidget(self.proxies_tab) self.proxies_active_tab.setGeometry(QtCore.QRect(0, 0, 4, 45)) self.proxies_active_tab.setStyleSheet( "background-color: transparent;border: none;") self.proxies_icon = QtWidgets.QLabel(self.proxies_tab) self.proxies_icon.setGeometry(QtCore.QRect(21, 13, 20, 20)) self.proxies_icon.setStyleSheet("border: none;") self.proxies_icon.setPixmap(QtGui.QPixmap("images/proxies.png")) self.proxies_icon.setScaledContents(True) self.settings_tab = QtWidgets.QWidget(self.sidebar) self.settings_tab.setGeometry(QtCore.QRect(0, 220, 60, 45)) self.settings_tab.setCursor(QtGui.QCursor( QtCore.Qt.PointingHandCursor)) self.settings_tab.setStyleSheet( "background-color: transparent;border: none;") self.settings_active_tab = QtWidgets.QWidget(self.settings_tab) self.settings_active_tab.setGeometry(QtCore.QRect(0, 0, 4, 45)) self.settings_active_tab.setStyleSheet( "background-color: transparent;border: none;") self.settings_icon = QtWidgets.QLabel(self.settings_tab) self.settings_icon.setGeometry(QtCore.QRect(21, 13, 20, 20)) self.settings_icon.setStyleSheet("border: none;") self.settings_icon.setPixmap(QtGui.QPixmap("images/settings.png")) self.settings_icon.setScaledContents(True) self.logo = QtWidgets.QLabel(self.sidebar) self.logo.setGeometry(QtCore.QRect(10, 23, 41, 41)) self.logo.setStyleSheet("border: none;color:red;") self.logo.setText("") self.logo.setPixmap(QtGui.QPixmap("images/birdbot.png")) self.logo.setScaledContents(True) self.homepage = HomePage(self.centralwidget) self.createdialog = CreateDialog(self) self.createdialog.addtask_btn.clicked.connect(self.create_task) self.createdialog.setWindowIcon(QtGui.QIcon("images/birdbot.png")) self.createdialog.hide() self.profilespage = ProfilesPage(self.centralwidget) self.profilespage.hide() self.proxiespage = ProxiesPage(self.centralwidget) self.proxiespage.hide() self.settingspage = SettingsPage(self.centralwidget) self.settingspage.hide() MainWindow.setCentralWidget(self.centralwidget) QtCore.QMetaObject.connectSlotsByName(MainWindow) self.set_functions()
def setupUi(self, MainWindow): MainWindow.setFixedSize(1109, 600) MainWindow.setStyleSheet("background-color: #1E1E1E;") MainWindow.setWindowTitle("Bird Bot") self.centralwidget = QtWidgets.QWidget(MainWindow) self.centralwidget.setStyleSheet( "QMessageBox QLabel { color: #FFFFFF; }QMessageBox QPushButton { background-color: #5D43FB;color: #FFFFFF;}" ) self.sidebar = QtWidgets.QWidget(self.centralwidget) self.sidebar.setGeometry(QtCore.QRect(0, 0, 61, 601)) self.sidebar.setStyleSheet( "background-color: #232323;border-right: 1px solid #2e2d2d;") self.home_tab = QtWidgets.QWidget(self.sidebar) self.home_tab.setGeometry(QtCore.QRect(0, 85, 60, 45)) self.home_tab.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.home_tab.setStyleSheet("background-color: #272342;border: none;") self.home_active_tab = QtWidgets.QWidget(self.home_tab) self.home_active_tab.setGeometry(QtCore.QRect(0, 0, 4, 45)) self.home_active_tab.setStyleSheet( "background-color: #5D43FB;border: none;") self.home_active_tab.setCursor( QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.home_icon = QtWidgets.QLabel(self.home_tab) self.home_icon.setGeometry(QtCore.QRect(21, 13, 20, 20)) self.home_icon.setStyleSheet("border: none;") self.home_icon.setText("") self.home_icon.setPixmap(QtGui.QPixmap(":/images/home_alt.png")) self.home_icon.setScaledContents(True) self.home_icon.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.profiles_tab = QtWidgets.QWidget(self.sidebar) self.profiles_tab.setGeometry(QtCore.QRect(0, 130, 60, 45)) self.profiles_tab.setCursor(QtGui.QCursor( QtCore.Qt.PointingHandCursor)) self.profiles_tab.setStyleSheet( "background-color: transparent;border: none;") self.profiles_active_tab = QtWidgets.QWidget(self.profiles_tab) self.profiles_active_tab.setGeometry(QtCore.QRect(0, 0, 4, 45)) self.profiles_active_tab.setStyleSheet( "background-color: transparent;border: none;") self.profiles_active_tab.setCursor( QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.profiles_icon = QtWidgets.QLabel(self.profiles_tab) self.profiles_icon.setGeometry(QtCore.QRect(21, 13, 20, 20)) self.profiles_icon.setStyleSheet("border: none;") self.profiles_icon.setText("") self.profiles_icon.setPixmap(QtGui.QPixmap(":/images/profiles.png")) self.profiles_icon.setScaledContents(True) self.profiles_icon.setCursor( QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.proxies_tab = QtWidgets.QWidget(self.sidebar) self.proxies_tab.setGeometry(QtCore.QRect(0, 175, 60, 45)) self.proxies_tab.setCursor(QtGui.QCursor(QtCore.Qt.PointingHandCursor)) self.proxies_tab.setStyleSheet( "background-color: transparent;border: none;") self.proxies_active_tab = QtWidgets.QWidget(self.proxies_tab) self.proxies_active_tab.setGeometry(QtCore.QRect(0, 0, 4, 45)) self.proxies_active_tab.setStyleSheet( "background-color: transparent;border: none;") self.proxies_icon = QtWidgets.QLabel(self.proxies_tab) self.proxies_icon.setGeometry(QtCore.QRect(21, 13, 20, 20)) self.proxies_icon.setStyleSheet("border: none;") self.proxies_icon.setPixmap(QtGui.QPixmap(":/images/proxies.png")) self.proxies_icon.setScaledContents(True) self.settings_tab = QtWidgets.QWidget(self.sidebar) self.settings_tab.setGeometry(QtCore.QRect(0, 220, 60, 45)) self.settings_tab.setCursor(QtGui.QCursor( QtCore.Qt.PointingHandCursor)) self.settings_tab.setStyleSheet( "background-color: transparent;border: none;") self.settings_active_tab = QtWidgets.QWidget(self.settings_tab) self.settings_active_tab.setGeometry(QtCore.QRect(0, 0, 4, 45)) self.settings_active_tab.setStyleSheet( "background-color: transparent;border: none;") self.settings_icon = QtWidgets.QLabel(self.settings_tab) self.settings_icon.setGeometry(QtCore.QRect(21, 13, 20, 20)) self.settings_icon.setStyleSheet("border: none;") self.settings_icon.setPixmap(QtGui.QPixmap(":/images/settings.png")) self.settings_icon.setScaledContents(True) self.logo = QtWidgets.QLabel(self.sidebar) self.logo.setGeometry(QtCore.QRect(10, 23, 41, 41)) self.logo.setStyleSheet("border: none;") self.logo.setText("") self.logo.setPixmap(QtGui.QPixmap(":/images/birdbot.png")) self.logo.setScaledContents(True) self.homepage = HomePage(self.centralwidget) self.createdialog = CreateDialog(self) self.createdialog.addtask_btn.clicked.connect(self.create_task) self.createdialog.setWindowIcon(QtGui.QIcon("images/birdbot.png")) self.createdialog.hide() self.profilespage = ProfilesPage(self.centralwidget) self.profilespage.hide() self.proxiespage = ProxiesPage(self.centralwidget) self.proxiespage.hide() self.settingspage = SettingsPage(self.centralwidget) self.settingspage.hide() MainWindow.setCentralWidget(self.centralwidget) QtCore.QMetaObject.connectSlotsByName(MainWindow) self.set_functions()