def updateChannelVersionLabel(self): # versionCode = self.label_3.text() item = self.listWidget.currentItem() if item != None: versionCode = self.listWidget.itemWidget(item).label_2.text() taskManager.shareInstance().updateChannelVersionLabel(versionCode) self.close()
def SwitchAccountTask(self): self.toolButton.setText(u'登录中...') # url = 'http://auth-beta.funcell123.com/product/pack' #测试环境 # self.lineEdit.setText('100') # self.lineEdit_2.setText('fds415651d65ht23fd2') # url = 'https://auth.funcell123.com/product/pack' #正式环境 url = self.getHostAddress() parameters = 'product_code=' + unicode( self.lineEdit.text()) + '&' + 'product_key=' + unicode( self.lineEdit_2.text()) response = httpManager.shareInstance().http_post(url, parameters) data = json.loads(response) for key in data: if 'error_code' == key: if 'P1111' == data[key]: print '--------SwitchAccount success--------' # QtGui.QMessageBox.information(None,u"提示", u"切换帐号成功!") taskManager.shareInstance().updateChanelList(data['data']) # taskManager.shareInstance().refreshPackUi() if len(self.lineEdit.text()) > 0 and len( self.lineEdit_2.text()) > 0: self.saveUserInfo() self.accept() else: self.toolButton.setText(u'登录') QtGui.QMessageBox.critical(None, u'错误', u'切换帐号失败,请重新登录!')
def LoginTask(self): self.toolButton.setText(u'登录中...') # url = 'http://auth-beta.funcell123.com/product/pack' #测试环境 # self.lineEdit.setText('100') # self.lineEdit_2.setText('fds415651d65ht23fd2') # url = 'https://auth.funcell123.com/product/pack' #正式环境 url = self.getHostAddress() parameters = 'product_code=' + unicode( self.lineEdit.text()) + '&' + 'product_key=' + unicode( self.lineEdit_2.text()) response = httpManager.shareInstance().http_post(url, parameters) data = json.loads(response) print 'response:', response for key in data: # print key if 'data' == key: # print 'data渠道数据个数:',str(len(data[key])) taskManager.shareInstance().updateChanelList(data[key]) elif 'message' == key: pass elif 'error_code' == key: if 'P1111' == data[key]: print '--------登录成功--------' if len(self.lineEdit.text()) > 0 and len( self.lineEdit_2.text()) > 0: self.saveUserInfo() self.accept() else: self.toolButton.setText(u'登录') QtGui.QMessageBox.critical(None, u'错误', u'用户名或密码错误!') elif 'level' == key: pass
def updateConfig(self, keystoreUi_Class, keystoreDetails): import sys reload(sys) sys.setdefaultencoding('utf-8') flag = False flag_modify = True old_str = keystoreDetails new_str = keystoreUi_Class.lineEdit.text( ) + "|" + keystoreUi_Class.lineEdit_2.text( ) + "|" + keystoreUi_Class.lineEdit_3.text( ) + "|" + keystoreUi_Class.lineEdit_4.text() if keystoreUi_Class.checkBox.isChecked(): new_str += "|Default" flag = True logDir = 'Log/' #-------------------start---------此步骤是为了查询当前需要修改的字符串是否需要删除'|Default' ------------- productcode = ConfigParse.shareInstance().getProductCode() logFile = codecs.open(logDir + productcode + '/SignFile.log', 'a+', 'utf-8') for line in logFile.readlines(): line = line.rstrip("\r\n") if keystoreDetails == line: idx = line.find('|Default') if idx > 0: print '当前修改项中包含|Default字段,当前修改项不能删除|Default字段' flag_modify = False logFile.close() #-------------------end----------------------- if flag and flag_modify: #先判断是否需要替换"|Default" self.modifyFileContent(logDir + productcode + '/SignFile.log', "|Default", "") new_str = str(new_str) old_str = str(old_str) print 'old_str:', old_str print 'new_str:', new_str # self.modifyFileContent(logDir +productcode + '/SignFile.log', str(old_str), str(new_str)) self.modifyFileContent(logDir + productcode + '/SignFile.log', old_str, new_str) if flag: taskManager.shareInstance().updateKeystore(new_str, False) keystoreUi_Class.close() self.initKeystoreList()
def SaveConfig(self, keystoreUi_Class): import sys reload(sys) sys.setdefaultencoding('utf-8') flag = False info = keystoreUi_Class.lineEdit.text( ) + "|" + keystoreUi_Class.lineEdit_2.text( ) + "|" + keystoreUi_Class.lineEdit_3.text( ) + "|" + keystoreUi_Class.lineEdit_4.text() if keystoreUi_Class.checkBox.isChecked(): info += "|Default" flag = True print 'info', info info = str(info) info = info.decode('utf-8').encode('gb2312') # txtunicode=info.decode('utf-8') # txtunicode=txtunicode.encode('gb2312') # self.log(txtunicode, flag) self.log(info, flag) taskManager.shareInstance().addKeyStore(info) if flag: taskManager.shareInstance().updateKeystore(info, True) keystoreUi_Class.close()
def setupUi(self, Form): Form.setObjectName(_fromUtf8("Form")) Form.resize(498, 406) Form.setStyleSheet( _fromUtf8("QToolButton[objectName=\"closetoolButton\"] {\n" "border:0px;\n" "}\n" "QToolButton[objectName=\"closetoolButton\"]:hover {\n" "image:url(:/images/close_hover.png);\n" "}\n" "QToolButton[objectName=\"closetoolButton\"]:pressed {\n" "image:url(:/images/close_pressed.png);\n" "}\n" "QWidget[objectName=\"Form\"]{\n" "background-image: url(:/images/funcell_bg.png);\n" "}\n" "QListWidget[objectName=\"listWidget\"]{\n" "background-color: rgb(255, 255, 255);\n" "}")) self.closetoolButton = QtGui.QToolButton(Form) self.closetoolButton.setGeometry(QtCore.QRect(469, 0, 27, 22)) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/images/close_normal.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.closetoolButton.setIcon(icon) self.closetoolButton.setIconSize(QtCore.QSize(27, 22)) self.closetoolButton.setObjectName(_fromUtf8("closetoolButton")) self.listWidget = QtGui.QListWidget(Form) self.listWidget.setGeometry(QtCore.QRect(0, 70, 498, 335)) self.listWidget.setObjectName(_fromUtf8("listWidget")) self.label = QtGui.QLabel(Form) self.label.setGeometry(QtCore.QRect(40, 20, 131, 31)) self.label.setLineWidth(1) self.label.setObjectName(_fromUtf8("label")) self.toolButton = QtGui.QToolButton(Form) self.toolButton.setGeometry(QtCore.QRect(170, 28, 50, 18)) self.toolButton.setObjectName(_fromUtf8("toolButton")) self.toolButton.setStyleSheet("color: rgb(0, 0, 0);") self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form) self.closetoolButton.clicked.connect(self.close) self.toolButton.clicked.connect(self.OpenKeystore) self.connect(taskManager.shareInstance(), SIGNAL("addKeyStoreFile"), self.addKeyStoreFile) self.initKeystoreList()
def initPluginList(self): self.__ChannelPluginListData = taskManager.shareInstance().getChannelPluginListData() for key_data in self.__ChannelPluginListData: print 'key_data:',key_data for key in key_data: typePlugin = key_data['typePlugin'] channel = key_data['channel'] version = key_data['version'] # status = key_data['status'] # if 'enable' == status: item1 = QtGui.QListWidgetItem() item1.setSizeHint(QSize(0, 42)) item = pluginListItem() item.label.setText(typePlugin) item.label_2.setText(channel) item.pushButton.setText(version) self.listWidget.addItem(item1) self.listWidget.setItemWidget(item1,item)
def setupUi(self, Form): Form.setObjectName(_fromUtf8("Form")) Form.resize(666, 460) Form.setStyleSheet( _fromUtf8("QToolButton[objectName=\"closetoolButton\"] {\n" "border:0px;\n" "}\n" "QToolButton[objectName=\"closetoolButton\"]:hover {\n" "image:url(:/images/close_hover.png);\n" "}\n" "QToolButton[objectName=\"closetoolButton\"]:pressed {\n" "image:url(:/images/close_pressed.png);\n" "}\n" "QWidget[objectName=\"Form\"]{\n" "background-image: url(:/images/funcell_bg.png);\n" "}\n" "QLabel[objectName=\"label\"]{\n" "color: rgb(255, 255, 255);\n" "}\n" "")) self.textBrowser = QtGui.QTextBrowser(Form) self.textBrowser.setGeometry(QtCore.QRect(0, 60, 665, 401)) self.textBrowser.setObjectName(_fromUtf8("textBrowser")) self.label = QtGui.QLabel(Form) self.label.setGeometry(QtCore.QRect(40, 20, 71, 16)) self.label.setObjectName(_fromUtf8("label")) self.closetoolButton = QtGui.QToolButton(Form) self.closetoolButton.setGeometry(QtCore.QRect(635, 0, 27, 22)) icon = QtGui.QIcon() icon.addPixmap(QtGui.QPixmap(_fromUtf8(":/images/close_normal.png")), QtGui.QIcon.Normal, QtGui.QIcon.Off) self.closetoolButton.setIcon(icon) self.closetoolButton.setIconSize(QtCore.QSize(27, 22)) self.closetoolButton.setObjectName(_fromUtf8("closetoolButton")) self.retranslateUi(Form) QtCore.QMetaObject.connectSlotsByName(Form) self.closetoolButton.clicked.connect(self.close) self.connect(taskManager.shareInstance(), SIGNAL("updateTextLog"), self.updateTextLog) self.initLog()