def s_server(self): mip = self.slchange() self.P = rwser(mip[1].split(',')[1], mip[0], self.app) self.P.setTerminationEnabled(True) if not self.P.isRunning(): try: self.pport = mip[0] self.mbutton.setEnabled(False) self.mbutton2.setEnabled(True) self.sl.setEnabled(False) self.sl2.setEnabled(False) self.ic1 = QIcon(r_path(solve_path('static/images/play.png'))) self.ic1 = self.ic1.pixmap(70, 70, QIcon.Active, QIcon.On) self.l.setPixmap(self.ic1) pp = self.slchange() addr = self.getTrans('10') addr += "<a href='http://" addr += pp[1].split(',')[1] + ":" + pp[0] addr += "'> http://" + pp[1].split(',')[1] + ":" + pp[0] addr += "</a>" self.t.setText(addr) self.t.setFont(self.Arial) self.P.start() self.Runningo = True except: self.eout() else: self.eout()
def set_button(self, glo): hlayout = QHBoxLayout() self.mbutton = QPushButton('Start', self) self.mbutton.clicked.connect(self.s_server) self.mbutton.setFont(self.Arials) self.mbutton.setIcon(QPixmap(r_path(solve_path('static/images/play.png')))) self.mbutton2 = QPushButton('Stop', self) self.mbutton2.clicked.connect(self.st_server) self.mbutton2.setIcon(QPixmap(r_path(solve_path('static/images/pause.png')))) self.mbutton.setToolTip(self.getTrans('4')) self.mbutton2.setToolTip(self.getTrans('6')) self.mbutton2.setEnabled(False) self.mbutton2.setFont(self.Arials) hlayout.addWidget(self.mbutton) hlayout.addWidget(self.mbutton2) glo.addLayout(hlayout)
def Flabel(self, glo): fontt = self.Arial self.ic1 = QIcon(r_path(solve_path('static/images/pause.png'))) self.l = QLabel('Icond', self) self.ic1 = self.ic1.pixmap(70, 70, QIcon.Active, QIcon.On) self.l.setPixmap(self.ic1) self.l.setAlignment(Qt.AlignCenter | Qt.AlignHCenter) self.l.setFont(fontt) self.t = QLabel('Texted', self) self.t.setText(self.getTrans('11')) self.t.setOpenExternalLinks(True) self.t.setAlignment(Qt.AlignCenter | Qt.AlignHCenter) self.t.setFont(fontt) self.t.setToolTip(self.getTrans('9')) self.l.setToolTip(self.getTrans('9')) glo.addStretch() glo.addWidget(self.l) glo.addWidget(self.t) glo.addStretch()
def __init__(self, app=None): super(NewWindow, self).__init__() self.app = app glo = QVBoxLayout(self) icp = r_path(solve_path('static/images/favicon.png')) # need to used objective message boxs instead of functions to set font self.Arial = QFont("", 12, QFont.Bold) self.Arials = QFont("", 10, QFont.Bold) # Language support variable self.Language = 'en' self.Runningo = False icon = QIcon(icp) self.SelfIinit(icon) self.center() self.langsList(glo) self.set_Abutton(icp, glo) self.Lists(glo) self.Flabel(glo) self.set_button(glo) self.setLayout(glo) mip = self.slchange() self.P = rwser(mip[1].split(',')[1], mip[0], self.app) self.activateWindow() self.show()