本文整理汇总了Python中qt.QMessageBox.information方法的典型用法代码示例。如果您正苦于以下问题:Python QMessageBox.information方法的具体用法?Python QMessageBox.information怎么用?Python QMessageBox.information使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qt.QMessageBox
的用法示例。
在下文中一共展示了QMessageBox.information方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setSource
# 需要导入模块: from qt import QMessageBox [as 别名]
# 或者: from qt.QMessageBox import information [as 别名]
def setSource(self, url):
#action, key, filename = split_url(url)
action, name = split_url(url)
filehandler = self.app.game_fileshandler
if action == 'cleanup':
filehandler.cleanup_game(name)
elif action == 'prepare':
filehandler.prepare_game(name)
elif action == 'edit':
dlg = EditGameDataDialog(self, name)
dlg.show()
elif action == 'set_title_screenshot':
self.select_title_screenshot(name)
elif action == 'open_weblink':
# get gamedata from doc object
# to keep from excessive xml parsing
gamedata = self.doc.gamedata
cmd = self.app.myconfig.get('externalactions', 'launch_weblink')
# for these url's, the name is the site
weblink_url = gamedata['weblinks'][name]
if '%s' in cmd:
os.system(cmd % weblink_url)
else:
os.system("%s '%s'" % (cmd, weblink_url))
# now we reset the name variable to reset the page properly
name = gamedata['name']
else:
QMessageBox.information(self, '%s is unimplemented.' % action)
# refresh the page
self.set_game_info(name)
# need to emit signal here for mainwin to pick up
# this method is ugly
if action in ['cleanup', 'prepare', 'edit']:
mainwin = self.parent().parent()
mainwin.refreshListView()
示例2: slotAcceptData
# 需要导入模块: from qt import QMessageBox [as 别名]
# 或者: from qt.QMessageBox import information [as 别名]
def slotAcceptData(self):
tabForm=self.tabs[0][0]
rec = self.tabs[0][1]
for field, fieldDef in tabForm.fieldList:
if fieldDef.readonly:
continue
elif fieldDef.relation <> None: #combobox
if field == "usernr":
rec.updateUser()
else:
rec.setFieldValue(rec.getDescriptorColumnName(field),
tabForm.getFieldText(field))
fieldDef.default = tabForm.getFieldValue(field)
rec.setFieldValue(field, tabForm.getFieldValue(field))
else:
rec.setFieldValue(field, tabForm.getFieldValue(field))
#print "Type ", type(getattr(rec, field))
if self.mode == constants.INSERT:
try:
rec.insert()
self.mode = constants.UPDATE
except dbexceptions.dbError, dberr:
QMessageBox.information(self, "Kura Error while inserting"
, dberr.errorMessage)
return False
self.emit(PYSIGNAL("sigAcceptNewData"), (rec,))
self.mode = constants.UPDATE
示例3: removeChildDataTypesSlot
# 需要导入模块: from qt import QMessageBox [as 别名]
# 或者: from qt.QMessageBox import information [as 别名]
def removeChildDataTypesSlot(self):
""" Removes the selected data type from the list of parent data types. """
if self._relationTypeView.mySelectedChildDataTypeList == []:
QMessageBox.information(self._parentFrame, self._parentFrame.tr("DataFinder: No Selection"),
"Please select a Data Type to remove!",
self._parentFrame.tr("OK"), "", "",
0, -1)
else:
self._relationTypeModel.removeChildDataTypes(self._relationTypeView.mySelectedChildDataTypeList)
self._relationTypeView.setButtonsState(True)
示例4: addChildDataTypesSlot
# 需要导入模块: from qt import QMessageBox [as 别名]
# 或者: from qt.QMessageBox import information [as 别名]
def addChildDataTypesSlot(self):
""" Adds the selected data types from the list of available data types to the list of child data types. """
if self._relationTypeView.mySelectedAvailableDataTypeList == []:
QMessageBox.information(self._parentFrame, self._parentFrame.tr("DataFinder: No Selection"),
"Please select a Data Type to add!",
self._parentFrame.tr("OK"), "", "",
0, -1)
else:
self._relationTypeModel.addChildDataTypes(self._relationTypeView.mySelectedAvailableDataTypeList)
self._relationTypeView.setButtonsState(True)
示例5: http2Done
# 需要导入模块: from qt import QMessageBox [as 别名]
# 或者: from qt.QMessageBox import information [as 别名]
def http2Done(self, error):
qs = QString(self.http2.readAll())
match = self.imgre.search(unicode(qs))
if error:
QMessageBox.warning(self, "Warning", "Cannot upload! Error:" + self.http2.error())
else:
if match:
self.editUrl.setText(self.image)
self.editThumb.setText(match.group(1))
QMessageBox.information(self, "Info", "Image successfully uploaded!")
else:
QMessageBox.warning(self, "Warning", "Cannot upload the thumbnail image file!")
self.http2.closeConnection()
示例6: removeAttributeSlot
# 需要导入模块: from qt import QMessageBox [as 别名]
# 或者: from qt.QMessageBox import information [as 别名]
def removeAttributeSlot(self):
""" Removes selected rows/attributes. """
if self._dataTypeView.propertyTable.currentSelection() == -1:
QMessageBox.information(self._parentFrame, self._parentFrame.tr("DataFinder: No Selection"),
"Please select a row to remove!",
self._parentFrame.tr("OK"), "", "",
0, -1)
else:
for index in self._dataTypeView.mySelectedRowList:
self._dataTypeView.propertyTable.removeRow(index)
self._dataTypeModel.myPropertyList = self._dataTypeView.myPropertyList
self._dataTypeView.setButtonsState(True)
示例7: select_title_screenshot
# 需要导入模块: from qt import QMessageBox [as 别名]
# 或者: from qt.QMessageBox import information [as 别名]
def select_title_screenshot(self, name):
if self.select_title_screenshot_dlg is None:
file_filter = "*.png|PNG Images\n*|All Files"
path = self.app.dosbox.get_capture_path(name)
dlg = QFileDialog(path, file_filter, self, 'select_title_screenshot_dlg', True)
dlg.connect(dlg, SIGNAL('okClicked()'), self.title_screenshot_selected)
dlg.connect(dlg, SIGNAL('cancelClicked()'), self.destroy_select_title_screenshot_dlg)
dlg.connect(dlg, SIGNAL('closeClicked()'), self.destroy_select_title_screenshot_dlg)
dlg.game_name = name
dlg.show()
self.select_title_screenshot_dlg = dlg
else:
# we shouldn't need this with a modal dialog
QMessageBox.information(self, opendlg_errormsg)
示例8: _set_name
# 需要导入模块: from qt import QMessageBox [as 别名]
# 或者: from qt.QMessageBox import information [as 别名]
def _set_name(self, newname):
name = self.name
if newname == name:
return
if not re.match('^[a-zA-Z]\w*$', newname):
QMessageBox.information(None, "grafit",
"<b>Illegal column name</b><p>Column names must start with a letter and consist "
"of letters, numbers and underscore (_)<p>")
return
if newname in self.worksheet.column_names and name != newname:
QMessageBox.information(None, "grafit",
"<b>A column with this name already exists</b><p>Please choose another name<p>")
return
self.rename___(self.worksheet.name, self.name, newname).do().register()
示例9: scenarioSelection_currentRowChanged
# 需要导入模块: from qt import QMessageBox [as 别名]
# 或者: from qt.QMessageBox import information [as 别名]
def scenarioSelection_currentRowChanged(self, current, previous):
if not current.isValid():
return
currentItem = current.internalPointer()
previousItem = previous.internalPointer()
if not isinstance(currentItem, FileItem):
return
if currentItem == previousItem:
return
if currentItem.object.type() != ContainerType.Scenario:
return
if currentItem.object == self.currentScenario:
return
if self.currentIsChanged():
ret = QMessageBox.information(self,
self.tr("Text Changed"),
self.tr("Do you want to save it?"),
QMessageBox.Save | QMessageBox.Cancel | QMessageBox.Discard)
if ret == QMessageBox.Cancel:
self.scenarioRestore.emit(previous)
return
elif ret == QMessageBox.Save:
self.currentScenario.setText(qt.toUnicode(self.ui.textEditScenario.toPlainText()))
self.setCurrentScenario(currentItem.object)
self.ui.textEditScenario.setScenario(self.currentScenario)
filepath = self.currentScenario.filePath()
self.setWindowTitle(self.tr("%1 - Hestia [*]").arg(filepath))
示例10: __guardar_como
# 需要导入模块: from qt import QMessageBox [as 别名]
# 或者: from qt.QMessageBox import information [as 别名]
def __guardar_como(self):
"""Abre un diálogo pidiendo el nombre de archivo y guarda en dicho archivo"""
filtro = ""
for fmt in SL.extensiones_fichero:
filtro = filtro+ "%s files (*.%s);;" % (fmt, fmt.lower())
filename = QFileDialog.getSaveFileName(QString.null, filtro, self)
filename = str(filename)
if filename:
from Driza.excepciones import FicheroExisteException, FicheroTipoDesconocidoException
import re
extension = re.compile('.*\..*')
if not extension.match(filename):
filename += ".driza"
try:
self.__gestorproyectos.guardar(filename)
except FicheroExisteException, fichero:
returncode = QMessageBox.information(self, 'Atencion:', 'El fichero' + fichero.fichero + ' ya existe' , 'Sobreescribir', 'Otro nombre', 'Cancelar', 0, 1)
if returncode == 0:
self.__gestorproyectos.guardar(filename, True)
self.__idu.establecer_original()
self.__myUpdate()
elif returncode == 1:
self.__guardarcomo()
except FicheroTipoDesconocidoException:
QMessageBox.warning(self, u'Atención', u'La extensión del fichero es incorrecta.\nPruebe con otra extensión')
self.__gestorproyectos.fichero = None
示例11: __dproyecto_modificado
# 需要导入模块: from qt import QMessageBox [as 别名]
# 或者: from qt.QMessageBox import information [as 别名]
def __dproyecto_modificado(self):
"""Pregunta en caso de que haya sido modificado el proyecto si desea ser guardado"""
if not self.__idu.original():
returncode = QMessageBox.information(self, 'Atencion:', 'El proyecto actual ha sido modificado, desea guardarlo?', 'Guardarlo', 'No guardarlo', 'Volver', 0, 1)
if returncode == 0:
self.__guardar()
elif returncode == 2:
return False
return True
示例12: slotLaunchDosbox
# 需要导入模块: from qt import QMessageBox [as 别名]
# 或者: from qt.QMessageBox import information [as 别名]
def slotLaunchDosbox(self, game=None):
if game is None:
game = self.listView.currentItem().game
if self.app.game_fileshandler.get_game_status(game):
self.app.dosbox.run_game(game)
else:
title = self.game_titles[game]
box = QMessageBox.information(self, 'UnavailableGame')
box.setText('%s is unavailable' % title)
示例13: httpDone
# 需要导入模块: from qt import QMessageBox [as 别名]
# 或者: from qt.QMessageBox import information [as 别名]
def httpDone(self, error):
qs = QString(self.http.readAll())
match = self.imgre.search(unicode(qs))
if error:
QMessageBox.warning(self, "Warning", "Cannot upload! Error:" + self.http.error())
else:
if match:
self.image = match.group(1)
if self.thumbfile: # do second upload
if self.chkShack.isChecked():
self.BeginImageUpload(self.thumbfile, self.ImageShackPostData, self.http2)
elif self.chkArk.isChecked():
self.BeginImageUpload(self.thumbfile, self.ImageArkPostData, self.http2)
else: # no need to upload second
QMessageBox.information(self, "Info", "Image successfully uploaded!")
self.editUrl.setText(self.image)
else:
if self.thumbfile:
os.unlink(thumbfile)
QMessageBox.warning(self, "Warning", "Cannot upload the image file!")
self.http.closeConnection()
示例14: loop
# 需要导入模块: from qt import QMessageBox [as 别名]
# 或者: from qt.QMessageBox import information [as 别名]
def loop(self):
"""
Procedimiento Bucle principal.
Lanza la ventana splash despues de la principal para que obtenga el foco
Despues espera nuevos eventos por parte del usuario
"""
self.vprincipal.show()
if self.__options.vsplash == None:
if (self.__gestorconfig.configuracion["vsplash"] and not self.__gestorproyectos.fichero):
self.__dsplash.show()
elif self.__options.vsplash:
self.__dsplash.show()
if self.__nuevo:
#Es la primera vez que se ejecuta el programa
QMessageBox.information(self.vprincipal, 'Bienvenido', 'Parece que es la primera vez que ejecutas Driza')
if self.__ioperaciones.listamodulosdefectuosos:
ristra = u""
for modulo in self.__ioperaciones.listamodulosdefectuosos:
ristra += unicode(modulo) + "\n"
mensaje = u"Las siguientes operaciones no han podido ser cargadas:\n" + ristra
QMessageBox.information(self.vprincipal, "Error en la carga de operaciones", mensaje)
logging.info('Lanzando Bucle Principal')
self.exec_loop()
return
示例15: launch_browser
# 需要导入模块: from qt import QMessageBox [as 别名]
# 或者: from qt.QMessageBox import information [as 别名]
def launch_browser(browser, url, caption=None, message=None):
if not caption: caption = "Info"
if not message: message = "Launch web browser?"
if not browser or not access(browser, X_OK):
QMessageBox.warning(None, "Warning", "You must properly configure your web browser path in Preferences (within the Edit menu).")
return 0
cancel = QMessageBox.information(None, caption, message, "&Ok", "&Cancel")
if cancel: return 0
if sys.platform == 'win32':
return spawnv(P_NOWAIT, browser, (" ", url))
else:
return spawnv(P_NOWAIT, browser, (browser, url))