本文整理汇总了Python中PyQt4.QtGui.QMessageBox.information方法的典型用法代码示例。如果您正苦于以下问题:Python QMessageBox.information方法的具体用法?Python QMessageBox.information怎么用?Python QMessageBox.information使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt4.QtGui.QMessageBox
的用法示例。
在下文中一共展示了QMessageBox.information方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: checkDirty
# 需要导入模块: from PyQt4.QtGui import QMessageBox [as 别名]
# 或者: from PyQt4.QtGui.QMessageBox import information [as 别名]
def checkDirty(self):
'''
Asserts whether the dialog contains dirty controls.
'''
isDirty = False
msgResponse = None
if self._dirtyTracker.isDirty():
isDirty = True
msg = QApplication.translate(
"MappedDialog",
"Would you like to save changes before closing?"
)
msgResponse = QMessageBox.information(
self, QApplication.translate(
"MappedDialog","Save Changes"
),
msg,
QMessageBox.Yes|QMessageBox.No|QMessageBox.Cancel
)
return isDirty,msgResponse
示例2: extract_message
# 需要导入模块: from PyQt4.QtGui import QMessageBox [as 别名]
# 或者: from PyQt4.QtGui.QMessageBox import information [as 别名]
def extract_message(self):
perform_ocr("original_img.jpg")
print (self.boundary_xy)
msg = QMessageBox()
msg.setIcon(QMessageBox.Information)
msg.setText("Text file saved")
msg.setWindowTitle("Information")
#msg.setStandardButtons(QMessageBox.Ok)
a=QtGui.QPushButton('Ok')
a.setStyleSheet("background-color: orange;border-radius: 15px; border-color: orange;padding-left: 20px;padding-right: 20px;padding-top: 10px;padding-bottom: 10px; border-top: 10px transparent;border-bottom: 10px transparent;border-right: 10px transparent;border-left: 20px transparent;");
msg.addButton(a,QtGui.QMessageBox.YesRole)
msg.setStyleSheet("background-color: rgb(189,189,189);")
#msg.buttonClicked.connect(msgbtn)
retval = msg.exec_()
self.extract_complete_signal.emit()
#os.startfile("output.txt")
#w = QWidget()
#QMessageBox.information(w, "Message", "Text file saved ")
示例3: show_upload_finished_message
# 需要导入模块: from PyQt4.QtGui import QMessageBox [as 别名]
# 或者: from PyQt4.QtGui.QMessageBox import information [as 别名]
def show_upload_finished_message(self):
self.is_upload_active = False
self.ui_single_file_upload.connections_onetime.setEnabled(True)
self.ui_single_file_upload.start_upload_bt.setStyleSheet(("QPushButton:hover{\n"
" background-color: #83bf20;\n"
" border-color: #83bf20;\n"
"}\n"
"QPushButton:active {\n"
" background-color: #93cc36;\n"
" border-color: #93cc36;\n"
"}\n"
"QPushButton{\n"
" background-color: #88c425;\n"
" border: 1px solid #88c425;\n"
" color: #fff;\n"
" border-radius: 7px;\n"
"}"))
self.ui_single_file_upload.start_upload_bt.setEnabled(True)
self.ui_single_file_upload.file_path.setText("")
QMessageBox.information(self, 'Success!', 'File uploaded successfully!')
示例4: deleteConnectionDialog
# 需要导入模块: from PyQt4.QtGui import QMessageBox [as 别名]
# 或者: from PyQt4.QtGui.QMessageBox import information [as 别名]
def deleteConnectionDialog(self):
# Delete connection.
currentText = self.ui.connectionList.currentText()
key = '/CartoDBPlugin/%s' % currentText
msg = QApplication.translate('CartoDBPlugin', 'Remove connection {}?').format(currentText)
result = QMessageBox.information(self, QApplication.translate('CartoDBPlugin', 'Confirm delete'), msg, QMessageBox.Ok | QMessageBox.Cancel)
if result == QMessageBox.Ok:
# Remove connection from list
self.settings.remove(key)
indexToDelete = self.ui.connectionList.currentIndex()
self.ui.connectionList.removeItem(indexToDelete)
self.setConnectionListPosition()
if self.ui.connectionList.count() > 0:
self.deleteconnetion.emit(currentText)
示例5: do_verify
# 需要导入模块: from PyQt4.QtGui import QMessageBox [as 别名]
# 或者: from PyQt4.QtGui.QMessageBox import information [as 别名]
def do_verify(self, tx):
# 1. get the password and sign the verification request
password = None
if self.wallet.use_encryption:
msg = _('GreenAddress requires your signature to verify that transaction is instant.\n'
'Please enter your password to sign a verification request.')
password = self.win.password_dialog(msg)
if not password:
return
try:
self.verify_button.setText(_('Verifying...'))
QApplication.processEvents() # update the button label
addr = self.get_my_addr(tx)
message = "Please verify if %s is GreenAddress instant confirmed" % tx.hash()
sig = self.wallet.sign_message(addr, message, password)
# 2. send the request
connection = httplib.HTTPSConnection('greenaddress.it')
connection.request("GET", ("/verify/?signature=%s&txhash=%s" % (urllib.quote(sig), tx.hash())),
None, {'User-Agent': 'Electrum'})
response = connection.getresponse()
response = json.loads(response.read())
# 3. display the result
if response.get('verified'):
QMessageBox.information(None, _('Verification successful!'),
_('%s is covered by GreenAddress instant confirmation') % (tx.hash()), _('OK'))
else:
QMessageBox.critical(None, _('Verification failed!'),
_('%s is not covered by GreenAddress instant confirmation') % (tx.hash()), _('OK'))
except BaseException as e:
import traceback
traceback.print_exc(file=sys.stdout)
QMessageBox.information(None, _('Error'), str(e), _('OK'))
finally:
self.verify_button.setText(self.button_label)
示例6: information
# 需要导入模块: from PyQt4.QtGui import QMessageBox [as 别名]
# 或者: from PyQt4.QtGui.QMessageBox import information [as 别名]
def information(title, text):
"""
Show a information QMessageBox
:param title: title's box
:param text: text's box
:return: None
"""
QMessageBox.information(None, title, text)
示例7: compare_config_version
# 需要导入模块: from PyQt4.QtGui import QMessageBox [as 别名]
# 或者: from PyQt4.QtGui.QMessageBox import information [as 别名]
def compare_config_version(self, path=None):
"""
Method to check the version of the two files being copied and return the latest one
:param newfile: QFile
:return: QFile
"""
if not path:
path = self.userPath
else:
path = path
base_file = self.baseSQLPath()
user_file = path + '/%s' % DEFAULT_CONFIG
if os.path.isfile(user_file):
if QMessageBox.warning(None, QApplication.translate("FilePaths",
"Previous user configuration found"),
QApplication.translate("FilePaths",
"Wizard detected previous configuration exists in the current directory."
"\nDo you want to overwrite the existing config?"),
QMessageBox.Yes | QMessageBox.No) == QMessageBox.Yes:
if filecmp.cmp(base_file, user_file, shallow=False):
pass
else:
try:
os.remove(user_file)
shutil.copy(base_file, self.userPath)
except:
pass
else:
QMessageBox.information(None,
QApplication.translate("FilePaths",
"Configuration Exist"),
QApplication.translate("FilePaths",
"Previous configuration retained"))
else:
shutil.copy(base_file, user_file)
self.createBackup()
示例8: model
# 需要导入模块: from PyQt4.QtGui import QMessageBox [as 别名]
# 或者: from PyQt4.QtGui.QMessageBox import information [as 别名]
def model(self):
if not self._model:
QMessageBox.information(None, QApplication.translate("AttributeBrowser","Loading foreign keys"),
QApplication.translate("AttributeBrowser","Foreign Key cannot be loaded"))
return
else:
self._dbModel = self.mapping.tableMapping(self._model)
return self._dbModel