本文整理汇总了Python中Core.Universals.cancelThreadAction方法的典型用法代码示例。如果您正苦于以下问题:Python Universals.cancelThreadAction方法的具体用法?Python Universals.cancelThreadAction怎么用?Python Universals.cancelThreadAction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Core.Universals
的用法示例。
在下文中一共展示了Universals.cancelThreadAction方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: closeEvent
# 需要导入模块: from Core import Universals [as 别名]
# 或者: from Core.Universals import cancelThreadAction [as 别名]
def closeEvent(self, _event):
if uni.isContinueThreadAction():
uni.cancelThreadAction()
_event.ignore()
示例2: closeEvent
# 需要导入模块: from Core import Universals [as 别名]
# 或者: from Core.Universals import cancelThreadAction [as 别名]
def closeEvent(self, _event):
try:
if uni.isRaisedAnError is False:
if uni.isContinueThreadAction():
uni.cancelThreadAction()
_event.ignore()
uni.isStartedCloseProcess = True
uni.printForDevelopers("Started closeEvent")
MApplication.setQuitOnLastWindowClosed(True)
try:
self.PlayerBar.MusicPlayer.stop()
except:
pass
Details.closeAllDialogs()
uni.printForDevelopers("Closed Dialogs")
if uni.isRaisedAnError is False:
if self.Table.checkUnSavedValues() is False:
uni.isStartedCloseProcess = False
uni.printForDevelopers("Close ignored")
_event.ignore()
uni.printForDevelopers("Before self.doBeforeCloseProcesses")
if self.doBeforeCloseProcesses() is False:
_event.ignore()
return None
uni.printForDevelopers("After self.doBeforeCloseProcesses")
if isActivePyKDE4:
uni.printForDevelopers("Before Save KDE Configs")
kconf = MGlobal.config()
kconfGroup = MConfigGroup(kconf, "DirectoryOperator")
self.FileManager.dirOperator.writeConfig(kconfGroup)
self.FileManager.actCollection.writeSettings(kconfGroup)
uni.printForDevelopers("After Save KDE Configs")
uni.printForDevelopers("Before Save Configs")
uni.setMySetting(self.Table.hiddenTableColumnsSettingKey,
self.Table.hiddenTableColumns)
Bars.setAllBarsStyleToMySettings()
Records.setRecordType(1)
fu.writeToBinaryFile(
fu.joinPath(fu.pathOfSettingsDirectory, "LastState"), self.saveState())
Records.restoreRecordType()
geometry = [self.geometry().x(), self.geometry().y(), self.geometry().width(),
self.geometry().height()]
uni.setMySetting("MainWindowGeometries", geometry)
uni.setMySetting("lastDirectory", self.FileManager.currentDirectory)
uni.setMySetting("isMainWindowMaximized", self.isMaximized())
uni.setMySetting("isShowAdvancedSelections", self.SpecialTools.isShowAdvancedSelections)
uni.setMySetting("tableType", uni.tableType)
uni.setMySetting("activeTabNoOfSpecialTools", self.SpecialTools.tabwTabs.currentIndex())
uni.saveSettings()
Settings.saveUniversalSettings()
if uni.isActiveAmarok and uni.getBoolValue("amarokIsUseHost") is False:
import Amarok
uni.printForDevelopers("Before Amarok.stopEmbeddedDB")
Amarok.stopEmbeddedDB()
uni.printForDevelopers("After Amarok.stopEmbeddedDB")
uni.printForDevelopers("After Save Configs")
uni.printForDevelopers("Before self.doAfterCloseProcesses")
self.doAfterCloseProcesses()
uni.printForDevelopers("After self.doAfterCloseProcesses")
except:
if ReportBug.isClose is False:
ReportBug.ReportBug()
_event.ignore()