当前位置: 首页>>代码示例>>Python>>正文


Python QDialog.accept方法代码示例

本文整理汇总了Python中PySide.QtGui.QDialog.accept方法的典型用法代码示例。如果您正苦于以下问题:Python QDialog.accept方法的具体用法?Python QDialog.accept怎么用?Python QDialog.accept使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PySide.QtGui.QDialog的用法示例。


在下文中一共展示了QDialog.accept方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: accept

# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import accept [as 别名]
    def accept(self, *args, **kwargs):
        #Validate the input, returning if invalid.

        #The configuration name cannot be empty or only whitespace.
        configuration_name = self.txtName.text().strip()
        if not configuration_name:
            QMessageBox.critical(self, "Missing Name", "You must give this server configuration a name.")
            self.txtName.selectAll()
            self.txtName.setFocus()
            return

        #We check to see if the user entered a valid server configuration.
        if self.ServerTypeTabs.currentWidget() is self.LocalServerTab:
            if not self.validateLocalServerPath():
                QMessageBox.critical(self, "Invalid Path", "The path you entered does not point to a valid Sage installation.")
                self.txtPath.selectAll()
                self.txtPath.setFocus()
                return
        elif self.ServerTypeTabs.currentWidget() is self.NotebookServerTab:
            if not self.validateNotebookServer():
                QMessageBox.critical(self, "Invalid Notebook Server", "The Sage Notebook Server settings you provided are not valid.")
                return


        #Input is valid, so accept.
        QDialog.accept(self)
开发者ID:rljacobson,项目名称:Guru-NB,代码行数:28,代码来源:EditSageServerDlg.py

示例2: accept

# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import accept [as 别名]
 def accept(self):
     settings = QSettings()
     settings.setValue("DB/File", self.file.text())
     settings.setValue("SMTP/Server", self.smtp_server.text())
     settings.setValue("HTTP Proxy/IP", self.http_proxy_ip.text())
     settings.setValue("HTTP Proxy/Enabled", bool(self.http_proxy.isChecked()) and bool(self.http_proxy_ip.text()))
     QDialog.accept(self)
开发者ID:LS80,项目名称:FFL,代码行数:9,代码来源:settings.py

示例3: accept

# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import accept [as 别名]
    def accept(self):
        players = self.playerSelections()
        self.team.team_name = self.teamNameEdit.text()
        self.team.email = unicode(self.emailEdit.text()).lower()

        if self.validTeam(players):
            playersOut = [player for player in self.team_players if player not in players]
            subs_made = len(playersOut)
            if subs_made > 0:
                if self.team.subs_used + subs_made > config.MAX_SUBS:
                    QMessageBox.critical(self, "Substitution Error",
                                         "This manager has insufficient substitutions remaining")
                    self.setCurrentPlayers()
                else:
                    playersIn = [player for player in players if player not in self.team_players]
                    form = confirmSubsDialog(playersOut, playersIn, self)
                    if form.exec_():
                        self.team.subs_used += subs_made
                        self.team.total_cost = self.total_cost
                        self.team.formation = self.formation
                        self.team.squad.substitute(playersIn, playersOut, form.datetime)
                        self.confirmSubs(playersIn, playersOut, form.datetime)
                        QDialog.accept(self)
                    else:
                        self.setCurrentPlayers()
            else:
                QDialog.accept(self)

        self.team.save()
开发者ID:LS80,项目名称:FFL,代码行数:31,代码来源:editTeam.py

示例4: accept

# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import accept [as 别名]
    def accept(self):
        self.network_changed = self.networkWidget.is_changed()
        self.rep_changed = self.repWidget.is_changed()
        self.specgram_changed = self.specWidget.is_changed()

        self.settings.update(self.networkWidget.get_current_state())
        self.settings.update(self.repWidget.get_current_state())
        self.settings.update(self.specWidget.get_current_state())

        QDialog.accept(self)
开发者ID:mmcauliffe,项目名称:exemplar-network-explorer,代码行数:12,代码来源:config.py

示例5: accept

# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import accept [as 别名]
	def accept(self):
		if len(self.id_lineedit.text().strip()) == 0:
			QMessageBox.warning(self, "Error: Relief Device ID Blank", "The relief device must be given an ID.", QMessageBox.Ok)
			self.id_lineedit.setFocus()
			return
		selected_area = self.area_combobox.itemData(self.area_combobox.currentIndex())
		for device in selected_area.children:
			if device.name == self.id_lineedit.text():
				QMessageBox.warning(self, "Error: Relief Device ID Already Exists", 
				"Cannot add relief device because that relief device ID already exists. Please create a new relief device ID.", QMessageBox.Ok)
				self.id_lineedit.setFocus()
				self.id_lineedit.setSelection(0, self.id_lineedit.maxLength())
				return
		QDialog.accept(self)
开发者ID:nb1987,项目名称:rvac,代码行数:16,代码来源:dlg_classes.py

示例6: __guardar

# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import accept [as 别名]
 def __guardar(self):
     guardar = True
     p = Persistence()
     if self.__categoria is None:
         categoria = Categoria()
         categoria.setDescripcion(self.txtCategoria.text())
         self.__categoria = categoria
     else:
         self.__categoria.setDescripcion(self.txtCategoria.text())
         guardar = False        
     try:
         if guardar:
             p.guardarCategoria(categoria)
         else:
             p.actualizarCategoria(self.__categoria)
     except sqlite3.IntegrityError:
         if guardar:
             self.__categoria = None
         QMessageBox.information(self, 'Error', 'El elemento ya existe')
     else:
         return QDialog.accept(self)
开发者ID:ehmsoft,项目名称:Desktop,代码行数:23,代码来源:NuevaCategoria.py

示例7: accept

# 需要导入模块: from PySide.QtGui import QDialog [as 别名]
# 或者: from PySide.QtGui.QDialog import accept [as 别名]
 def accept(self):
     QDialog.accept(self)
开发者ID:jlehtoma,项目名称:MaeBird,代码行数:4,代码来源:dialogs.py


注:本文中的PySide.QtGui.QDialog.accept方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。