本文整理汇总了Python中Core.Dialogs.showError方法的典型用法代码示例。如果您正苦于以下问题:Python Dialogs.showError方法的具体用法?Python Dialogs.showError怎么用?Python Dialogs.showError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Core.Dialogs
的用法示例。
在下文中一共展示了Dialogs.showError方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: uninstallPlugin
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import showError [as 别名]
def uninstallPlugin(self, _pluginName, _isQuiet=False):
isUninstalled = False
pluginModule = __import__("MyPlugins." + _pluginName, globals(), locals(),
["pluginName", "pluginFiles", "pluginDirectory", "uninstallThisPlugin",
"setupDirectory", "pluginVersion"], 0)
if pluginModule.uninstallThisPlugin is None:
if pluginModule.pluginDirectory == "":
for pluginFile in pluginModule.pluginFiles:
if fu.isFile(fu.joinPath(pluginModule.setupDirectory, pluginFile)):
fu.removeFileOrDir(fu.joinPath(pluginModule.setupDirectory, pluginFile))
isUninstalled = True
else:
if fu.isDir(fu.joinPath(pluginModule.setupDirectory, pluginModule.pluginDirectory)):
fu.removeFileOrDir(fu.joinPath(pluginModule.setupDirectory, pluginModule.pluginDirectory))
isUninstalled = True
else:
isUninstalled = pluginModule.uninstallThisPlugin()
if isUninstalled:
Settings.setUniversalSetting(str(pluginModule.pluginName), str(""))
if _isQuiet is False:
Dialogs.show(translate("MyPlugins", "Plug-in Uninstallation Is Complete"),
str(translate("MyPlugins", "\"%s\" is uninstalled on your system.")) % (
pluginModule.pluginName))
elif isUninstalled == "AlreadyUninstalled":
if _isQuiet is False:
Dialogs.show(translate("MyPlugins", "Plug-in Already Uninstalled"),
str(translate("MyPlugins", "\"%s\" already uninstalled on your system.")) % (
pluginModule.pluginName))
else:
if _isQuiet is False:
Dialogs.showError(translate("MyPlugins", "Plug-in Uninstallation Failed"),
str(translate("MyPlugins", "\"%s\" failed to uninstall on your system.")) % (
pluginModule.pluginName))
示例2: hash
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import showError [as 别名]
def hash(self):
sourceFile = str(self.lePathOfPackage.text())
sourceFile = fu.checkSource(sourceFile, "file")
if sourceFile is not None:
hashType = str(self.cbHash.currentText())
if hashType is not None:
hashDigestContent = fu.getHashDigest(sourceFile, hashType)
if hashDigestContent is not False:
self.teHashDigest.setText(str(hashDigestContent))
if self.cbHashOutput.currentIndex() == 1:
if fu.createHashDigestFile(sourceFile, str(self.leHashDigestFile.text()), hashType, False,
hashDigestContent):
Dialogs.show(translate("Hasher", "Hash Digest File Created"),
str(translate("Hasher", "Hash digest writed into %s")) % str(
self.leHashDigestFile.text()))
else:
Dialogs.showError(translate("Hasher", "Hash Digest File Is Not Created"),
translate("Hasher", "Hash digest file not cteated."))
elif self.cbHashOutput.currentIndex() == 2:
MApplication.clipboard().setText(str(hashDigestContent))
Dialogs.show(translate("Hasher", "Hash Digest Copied To Clipboard"),
str(translate("Hasher",
"Hash digest copied to clipboard.Hash digest is : <br>%s")) % hashDigestContent)
else:
Dialogs.showError(translate("Hasher", "Hash Digest Is Not Created"),
translate("Hasher", "Hash digest not cteated."))
示例3: addImage
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import showError [as 别名]
def addImage(self):
try:
if self.isActiveAddImage is False:
self.isActiveAddImage = True
self.pbtnAddImage.setText(translate("MusicDetails", "OK"))
self.pbtnSelectImage.show()
self.leImagePath.show()
self.lblImagePath.show()
self.lblImageType.show()
self.cbImageType.show()
self.pbtnCancelAddImage.show()
self.pbtnDeleteImage.hide()
self.pbtnSaveAsImage.hide()
else:
if fu.isFile(self.leImagePath.text()):
imageType = Taggers.getTagger().getImageTypesNo()[self.cbImageType.currentIndex()]
description = str(imageType)
Musics.writeMusicFile(self.musicValues, None, True, imageType, str(self.leImagePath.text()),
description)
self.changeFile(self.musicFile)
self.cancelAddImage()
else:
Dialogs.showError(translate("MusicDetails", "Image Does Not Exist"),
str(translate("MusicDetails", "\"%s\" does not exist.")
) % Organizer.getLink(str(self.leImagePath.text())))
except:
ReportBug.ReportBug()
示例4: readMusicFile
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import showError [as 别名]
def readMusicFile(_filePath, _isAlertWhenNotAvailable=True):
_directoryPath = fu.getDirName(_filePath)
isCanNoncompatible = False
if fu.isReadableFileOrDir(_filePath):
tagger = Taggers.getTagger()
try:
tagger.loadFile(_filePath)
except:
Dialogs.showError(translate("FileUtils/Musics", "Incorrect Tag"),
str(translate("FileUtils/Musics",
"\"%s\" : this file has the incorrect tag so can't read tags.")
) % Organizer.getLink(_filePath))
if tagger.isAvailableFile() is False:
isCanNoncompatible = True
content = {}
content["path"] = _filePath
content["baseNameOfDirectory"] = fu.getBaseName(_directoryPath)
content["baseName"] = fu.getBaseName(_filePath)
content["artist"] = tagger.getArtist()
content["title"] = tagger.getTitle()
content["album"] = tagger.getAlbum()
content["albumArtist"] = tagger.getAlbumArtist()
content["trackNum"] = tagger.getTrackNum()
content["year"] = tagger.getYear()
content["genre"] = tagger.getGenre()
content["firstComment"] = tagger.getFirstComment()
content["firstLyrics"] = tagger.getFirstLyrics()
content["images"] = tagger.getImages()
if isCanNoncompatible and _isAlertWhenNotAvailable:
Dialogs.show(translate("FileUtils/Musics", "Possible ID3 Mismatch"),
translate("FileUtils/Musics",
"Some of the files presented in the table may not support ID3 technology.<br>Please check the files and make sure they support ID3 information before proceeding."))
return content
示例5: __init__
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import showError [as 别名]
def __init__(self, _filePath, _isOpenDetailsOnNewWindow):
global currentDialogs
_filePath = fu.checkSource(_filePath, "file")
if _filePath is not None:
if _isOpenDetailsOnNewWindow is False:
isHasOpenedDialog = False
for dialog in currentDialogs:
if dialog.isVisible():
isHasOpenedDialog = True
dialog.changeFile(_filePath)
dialog.activateWindow()
dialog.raise_()
break
if isHasOpenedDialog is False:
_isOpenDetailsOnNewWindow = True
if _isOpenDetailsOnNewWindow:
currentDialogs.append(self)
MDialog.__init__(self, MApplication.activeWindow())
if isActivePyKDE4:
self.setButtons(MDialog.NoDefault)
self.charSet = MComboBox()
self.charSet.addItems(uni.getCharSets())
self.charSet.setCurrentIndex(self.charSet.findText(uni.MySettings["fileSystemEncoding"]))
self.infoLabels = {}
self.infoValues = {}
self.fileValues = {}
pbtnClose = MPushButton(translate("TextDetails", "Close"))
pbtnSave = MPushButton(translate("TextDetails", "Save Changes"))
pbtnSave.setIcon(MIcon("Images:save.png"))
MObject.connect(pbtnClose, SIGNAL("clicked()"), self.close)
MObject.connect(pbtnSave, SIGNAL("clicked()"), self.save)
self.labels = [translate("TextDetails", "File Path : "),
translate("TextDetails", "Content : ")]
self.pnlMain = MWidget()
self.vblMain = MVBoxLayout(self.pnlMain)
self.pnlClearable = None
self.changeFile(_filePath, True)
HBOXs, VBOXs = [], []
VBOXs.append(MVBoxLayout())
HBOXs.append(MHBoxLayout())
HBOXs[-1].addWidget(self.charSet, 1)
HBOXs[-1].addWidget(pbtnSave, 4)
VBOXs[0].addLayout(HBOXs[-1])
VBOXs[0].addWidget(pbtnClose)
self.vblMain.addLayout(VBOXs[0], 1)
if isActivePyKDE4:
self.setMainWidget(self.pnlMain)
else:
self.setLayout(self.vblMain)
self.show()
self.setMinimumWidth(700)
self.setMinimumHeight(500)
else:
Dialogs.showError(translate("TextDetails", "File Does Not Exist"),
str(translate("TextDetails",
"\"%s\" does not exist.<br>Table will be refreshed automatically!<br>Please retry.")
) % Organizer.getLink(str(_filePath)))
if hasattr(getMainWindow(),
"FileManager") and getMainWindow().FileManager is not None: getMainWindow().FileManager.makeRefresh()
示例6: whatDoesSpecialCommandDo
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import showError [as 别名]
def whatDoesSpecialCommandDo(_actionCommand, _isShowAlert=False, _isReturnDetails=False):
splitterIndex = _actionCommand.index("~||~")
leftKeys = _actionCommand[:splitterIndex]
rightKeys = _actionCommand[splitterIndex + 1:]
if len(leftKeys) > 0 and len(rightKeys) > 0:
details = ""
leftNames = ""
rightNames = ""
for objectNameAndPoint in leftKeys:
objectNameAndPointList = objectNameAndPoint.split("~|~")
objectName = objectNameAndPointList[0]
point = ""
if len(objectNameAndPointList) > 1:
point = objectNameAndPointList[1]
if objectName.find("Concatenate") == -1:
leftNames += getMainTable().getColumnNameFromKey(objectName)
else:
leftNames += translate("Organizer", "Concatenate")
if point != "":
if objectName.find("Concatenate") == -1:
leftNames += " " + (str(translate("Organizer", "(can be separated by \"%s\")")) % (point))
else:
leftNames += " " + (str(translate("Organizer", "(can be concatenated by \"%s\")")) % (point))
if leftKeys[-1] != objectNameAndPoint:
leftNames += " ,"
for objectNameAndPoint in rightKeys:
objectNameAndPointList = objectNameAndPoint.split("~|~")
objectName = objectNameAndPointList[0]
point = ""
if len(objectNameAndPointList) > 1:
point = objectNameAndPointList[1]
if objectName.find("Concatenate") == -1:
rightNames += getMainTable().getColumnNameFromKey(objectName)
else:
rightNames += translate("Organizer", "Concatenate")
if point != "":
if objectName.find("Concatenate") == -1:
rightNames += " " + (str(translate("Organizer", "(can be separated by \"%s\")")) % (point))
else:
rightNames += " " + (str(translate("Organizer", "(can be concatenated by \"%s\")")) % (point))
if rightKeys[-1] != objectNameAndPoint:
rightNames += " ,"
details = str(translate("Organizer",
"\"%s\" will be concatenated and/or separated then it will be set as \"%s\" respectively.")) % (
leftNames, rightNames)
if _isShowAlert:
Dialogs.show(translate("Organizer", "What Does This Command Do?"), str(details))
if _isReturnDetails is False:
return True
else:
return details
else:
Dialogs.showError(translate("Organizer", "Missing Command"),
translate("Organizer", "You have to add at least a \"Column\"!.."))
return False
示例7: cellDoubleClickedTable
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import showError [as 别名]
def cellDoubleClickedTable(self, _row, _column):
try:
if uni.getBoolValue("isRunOnDoubleClick"):
self.showTableDetails(_row, _column)
except:
Dialogs.showError(translate("SubFolderTable", "Cannot Open File"),
str(translate("SubFolderTable",
"\"%s\" : cannot be opened. Please make sure that you selected a text file.")
) % Organizer.getLink(self.values[_row]["path"]))
示例8: sourceCharSetChanged
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import showError [as 别名]
def sourceCharSetChanged(self):
try:
if self.isChangeSourceCharSetChanged:
self.fillValues()
except:
self.pbtnSave.setEnabled(False)
Dialogs.showError(translate("TextCorrector", "Incorrect File Encoding"),
str(translate("TextCorrector",
"File can not decode by \"%s\" codec.<br>Please select another file encoding type.")
) % str(self.sourceCharSet.currentText()))
示例9: sourceCharSetChanged
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import showError [as 别名]
def sourceCharSetChanged(self):
try:
self.fileValues = fu.readTextFile(self.fileValues["path"], str(self.sourceCharSet.currentText()))
self.infoValues["content"].setPlainText(
str(Organizer.emend(self.fileValues["content"], "text", False, True)))
except:
Dialogs.showError(translate("TextDetails", "Incorrect File Encoding"),
str(translate("TextDetails",
"File can not decode by \"%s\" codec.<br>Please select another file encoding type.")
) % str(self.sourceCharSet.currentText()))
示例10: findExecutablePath
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import showError [as 别名]
def findExecutablePath(_executableName, _isAlertIfNotFound=True):
executableBaseName = findExecutableBaseName(_executableName)
if executableBaseName is not None:
return fu.joinPath(fu.HamsiManagerDirectory, executableBaseName)
if _isAlertIfNotFound:
from Core import Dialogs
Dialogs.showError(translate("Execute", "Cannot Find Executable File"),
str(translate("Execute",
"\"%s\" : cannot find an executable file matched this name in directory of Hamsi Manager.<br>Please make sure that it exists and retry.")) % _executableName)
return None
示例11: checkScriptManager
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import showError [as 别名]
def checkScriptManager(_isAlertIfNotAvailable=True):
try:
from PyQt4.Qsci import QsciScintilla
return True
except:
if _isAlertIfNotAvailable:
Dialogs.showError(translate("MenuBar", "Qsci Is Not Installed"),
translate("MenuBar",
"Qsci is not installed on your systems.<br>Please install Qsci on your system and try again."))
return False
示例12: play
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import showError [as 别名]
def play(self, _filePath):
if self.m_media is not None:
self.stop()
try:
from PySide.phonon import Phonon
except:
Dialogs.showError(translate("Player", "Phonon Is Not Installed On Your System."),
translate("Player",
"We could not find the Phonon(PySide) module installed on your system.<br>Please choose another player from the options or <br>check your Phonon installation."))
return False
if not self.m_media:
self.m_media = Phonon.MediaObject()
self.audioOutput = Phonon.AudioOutput(Phonon.MusicCategory)
Phonon.createPath(self.m_media, self.audioOutput)
self.m_media.setCurrentSource(Phonon.MediaSource(str(_filePath)))
self.m_media.play()
self.paused = False
return True
示例13: downloadAndInstall
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import showError [as 别名]
def downloadAndInstall(self):
try:
if uni.isBuilt() is False:
if fu.isWritableFileOrDir(fu.HamsiManagerDirectory, True) is False:
from Core import Organizer
Dialogs.showError(translate("UpdateControl", "Access Denied"),
str(translate("UpdateControl",
"\"%s\" : you do not have the necessary permissions to change this directory.<br />Please check your access controls and retry. <br />Note: You can run Hamsi Manager as root and try again.")) % Organizer.getLink(
fu.HamsiManagerDirectory))
self.setFixedHeight(130)
self.isDownloading = True
self.prgbState.setVisible(True)
self.lblInfo.setVisible(False)
self.setWindowTitle(translate("UpdateControl", "Downloading Latest Release..."))
self.request = MNetworkRequest(MUrl(self.updateInformations[1]))
self.willDownload(self.request)
except:
ReportBug.ReportBug()
示例14: installPlugin
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import showError [as 别名]
def installPlugin(self, _pluginName, _isQuiet=False):
isInstalled = False
pluginModule = __import__("MyPlugins." + _pluginName, globals(), locals(),
["pluginName", "pluginFiles", "pluginDirectory", "installThisPlugin",
"setupDirectory", "pluginVersion"], 0)
if pluginModule.installThisPlugin is None:
if pluginModule.pluginDirectory == "":
try: fu.makeDirs(pluginModule.setupDirectory)
except: pass
for pluginFile in pluginModule.pluginFiles:
fu.copyOrChange(fu.joinPath(fu.HamsiManagerDirectory, "MyPlugins", _pluginName, pluginFile),
fu.joinPath(pluginModule.setupDirectory, pluginFile), "file", "only", True)
MyConfigure.reConfigureFile(fu.joinPath(pluginModule.setupDirectory, pluginFile))
isInstalled = True
else:
oldFilePath = fu.joinPath(fu.HamsiManagerDirectory, "MyPlugins", _pluginName,
pluginModule.pluginDirectory)
newFilePath = fu.copyOrChange(oldFilePath,
fu.joinPath(pluginModule.setupDirectory, pluginModule.pluginDirectory),
"directory", "only", True)
if newFilePath != oldFilePath:
isInstalled = True
else:
isInstalled = pluginModule.installThisPlugin()
if isInstalled:
Settings.setUniversalSetting(str(pluginModule.pluginName), str(pluginModule.pluginVersion))
if _isQuiet is False:
Dialogs.show(translate("MyPlugins", "Plug-in Installation Is Complete"),
str(translate("MyPlugins", "\"%s\" is installed on your system.")) % (
pluginModule.pluginName))
elif isInstalled == "AlreadyInstalled":
if _isQuiet is False:
Dialogs.show(translate("MyPlugins", "Plug-in Already Installed"),
str(translate("MyPlugins", "\"%s\" already installed on your system.")) % (
pluginModule.pluginName))
else:
if _isQuiet is False:
Dialogs.showError(translate("MyPlugins", "Plug-in Installation Failed"),
str(translate("MyPlugins", "\"%s\" failed to install on your system.")) % (
pluginModule.pluginName))
示例15: uninstall
# 需要导入模块: from Core import Dialogs [as 别名]
# 或者: from Core.Dialogs import showError [as 别名]
def uninstall(self):
try:
MApplication.processEvents()
self.UninstallationDirectory = str(self.leUninstallationDirectory.text())
if len(self.UninstallationDirectory) > 0:
if self.UninstallationDirectory[-1] == fu.sep:
self.UninstallationDirectory = self.UninstallationDirectory[:-1]
if self.UninstallationDirectory == fu.HamsiManagerDirectory:
self.pageNo -= 1
Dialogs.showError(translate("Uninstall", "The path you selected is not valid."),
translate("Uninstall",
"The selected path is Hamsi Manager source directory.<br>Please choose a valid uninstallation path."))
elif fu.isDir(self.UninstallationDirectory):
fu.removeFileOrDir(self.UninstallationDirectory)
else:
self.pageNo -= 1
Dialogs.showError(translate("Uninstall", "The path you selected is not valid."),
translate("Uninstall",
"The selected path points to a file not a folder.<br>Please choose a valid Uninstallation path."))
else:
self.pageNo -= 1
Dialogs.showError(translate("Uninstall", "The path you selected is not valid."),
translate("Uninstall",
"The selected path points to a file not a folder.<br>Please choose a valid Uninstallation path."))
self.pageChanged(True)
except:
from Core import ReportBug
ReportBug.ReportBug()