def Search_Temp(self): Scontent = self.lineEdit_2.displayText() self.Sresult = Scontent if len(Scontent) < 3: self.myOtherWindow = diag.changedDiag("Length Error", "The searched word be longer than 3 (three) characters.") self.myOtherWindow.setStyleSheet(sharedFun.getColor()) self.myOtherWindow.setWindowModality(Qt.ApplicationModal) self.myOtherWindow.show() else: self.myOtherWindow = sres.SreS(self.Sresult, self.lng, self.lines) self.myOtherWindow.setStyleSheet(sharedFun.getColor()) self.myOtherWindow.show()
def closeWarning(self): quit_msg = "New color scheme applied. \nPlease start the application again." self.myOtherWindow = diag.changedDiag("Rebooting...", quit_msg) self.myOtherWindow.setStyleSheet(sharedFun.getColor()) self.myOtherWindow.setWindowModality(Qt.ApplicationModal) self.myOtherWindow.show() threading.Timer(3.0,QtGui.qApp.quit).start()
def searchButton(self, tree, tuplesList): wordList = [] for i in tuplesList: wordList.append(i[1]) self.myOtherWindow = searchTab.searchDialog(tree, wordList) self.myOtherWindow.setWindowModality(Qt.ApplicationModal) self.myOtherWindow.setStyleSheet(sharedFun.getColor()) self.myOtherWindow.show()
def completeSearch(self, wordList): completer = QCompleter() self.lineEdit.setCompleter(completer) completer.setCaseSensitivity(QtCore.Qt.CaseInsensitive) model = QStringListModel() completer.setModel(model) completer.popup().setStyleSheet(sharedFun.getColor()) fixedList = [] for i in wordList: fixedList.append(i.replace(".txt","")) model.setStringList(fixedList)
def okButton(self, closeFunc): if self.selectedValue == 1: replaced = "light" replacer = "dark" elif self.selectedValue == 0: replaced = "dark" replacer = "light" if self.configData[6].__contains__(replacer): print self.configData[6] self.myOtherWindow = diag.changedDiag("Reboot not necessary", "No changes made, theme already active.") self.myOtherWindow.setStyleSheet(sharedFun.getColor()) self.myOtherWindow.setWindowModality(Qt.ApplicationModal) self.myOtherWindow.show() else: config = open("Config.txt", "w") self.configData[6] = self.configData[6].replace(replaced,replacer) config.writelines(self.configData) config.close() closeFunc()
def contextMenuEvent(self, event): popup_menu = self.textEdit.createStandardContextMenu() cursor = self.textEdit.textCursor() cursor.select(QTextCursor.WordUnderCursor) self.textEdit.setTextCursor(cursor) if self.textEdit.textCursor().hasSelection(): text = unicode(self.textEdit.textCursor().selectedText()) if not self.dict.check(text): spell_menu = QMenu('Spelling Suggestions') spell_menu.setStyleSheet(sharedFun.getColor()) for word in self.dict.suggest(text): action = sharedFun.SpellAction(word, spell_menu) action.correct.connect(self.correctWord) spell_menu.addAction(action) if len(spell_menu.actions()) != 0: popup_menu.insertSeparator(popup_menu.actions()[0]) popup_menu.insertMenu(popup_menu.actions()[0], spell_menu) popup_menu.exec_(event.globalPos())
def zoomTemplate(self): self.myOtherWindow = viewer.Ui_zoomTem(self.htmlData) self.myOtherWindow.setStyleSheet(sharedFun.getColor()) self.myOtherWindow.setWindowModality(Qt.ApplicationModal) self.myOtherWindow.show()
return QtGui.QApplication.translate(context, text, disambig, _encoding) except AttributeError: def _translate(context, text, disambig): return QtGui.QApplication.translate(context, text, disambig) class Main(QtGui.QMainWindow, MainWin.Ui_MainWindow): def __init__(self): QtGui.QMainWindow.__init__(self) self.ui = MainWin.Ui_MainWindow() self.ui.setupUi(self) if __name__ == "__main__": app = QtGui.QApplication(sys.argv) splash_pix = QPixmap("Icons\loading.png") splash = QSplashScreen(splash_pix, Qt.WindowStaysOnTopHint) splash.setMask(splash_pix.mask()) splash.show() time.sleep(1.5) app.setStyle("plastique") app.setWindowIcon(QtGui.QIcon("Icons\winged_foot.png")) window = Main() window.setStyleSheet(sharedFun.getColor()) window.show() splash.finish(window) sys.exit(app.exec_())
def helpFunc(self): self.myOtherWindow = diag.changedDiag("Help","Full Guide Coming soon!\n" "Meanwhile for issues contact me at:\n\[email protected]") self.myOtherWindow.setStyleSheet(sharedFun.getColor()) self.myOtherWindow.show()
def changeTheme(self): self.myOtherWindow = colorDiag.colorDialog(self.closeWarning) self.myOtherWindow.setStyleSheet(sharedFun.getColor()) self.myOtherWindow.setWindowModality(Qt.ApplicationModal) self.myOtherWindow.show()
def nameDiagConf(self): self.myOtherWindow = diag.changedDiag("Name Changed","Your name has been changed successfully.") self.myOtherWindow.setStyleSheet(sharedFun.getColor()) self.myOtherWindow.show()
def callAbout(self): self.myOtherWindow = about.Ui_Ermes() self.myOtherWindow.setStyleSheet(sharedFun.getColor()) self.myOtherWindow.setWindowModality(Qt.ApplicationModal) self.myOtherWindow.show()
def MainButton2(self): self.myOtherWindow = Rep.Archive(self.textEdit, self.fillRecent, self.lng) self.myOtherWindow.setStyleSheet(sharedFun.getColor()) self.myOtherWindow.show()