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


Python Settings.toFile方法代码示例

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


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

示例1: GUIMainWin

# 需要导入模块: from Settings import Settings [as 别名]
# 或者: from Settings.Settings import toFile [as 别名]
class GUIMainWin(QtGui.QMainWindow):
    def __init__(self, parent=None, flags=None):
        QtGui.QMainWindow.__init__(self, parent)

        self.ui = uic.loadUi("guimainwin.ui", self)
        self.setWindowTitle("Kapelhof")

        # center window on screen:
        rect = QtGui.QApplication.desktop().geometry()
        self.move(rect.center() - self.rect().center())
        self.faxServ = FaxService()
        self.mailServ = MailService()
        self.settings = Settings()

        # connect signals and slots:
        self.ui.newClientButton.clicked.connect(self.newClient)
        self.ui.newFaxButton.clicked.connect(self.newFax)
        self.ui.newMailButton.clicked.connect(self.newMail)
        self.ui.settingsButton.clicked.connect(self.openSettings)
        self.ui.clientViewButton.clicked.connect(self.openClientView)
        self.ui.manageStockButton.clicked.connect(self.openStockManager)
        self.ui.excelButton.clicked.connect(self.generateExcelFiles)
        self.ui.updateWebButton.clicked.connect(self.updateWebsite)
        self.ui.updateToppowerButton.clicked.connect(self.updateToppower)
        # self.ui.importContactsCsvButton.clicked.connect(self.importContactsFromCsv)

        # Uncomment to import the tuinaannemers:
        # self.importContactsFromCsv()

    # slots:
    def closeEvent(self, event):
        self.settings.toFile()
        event.accept()

    def newClient(self):
        newClientWin = GUINewClient(self.settings.groups)
        newClientWin.newClientSignal.connect(self.settings.addClient)
        newClientWin.accepted.connect(self.settings.toFile)
        newClientWin.exec_()

    def newFax(self):
        newFaxWin = GUINewFax(
            self.faxServ, self.settings.ourName, self.settings.ourNumber, self.settings.clients, self.settings.groups
        )
        newFaxWin.exec_()

    def newMail(self):
        newMailWin = GUINewMail(self.mailServ, self.settings.clients, self.settings.groups)
        newMailWin.exec_()

    def openSettings(self):
        settingsWin = GUISettings()
        settingsWin.exec_()

    def openClientView(self):
        clView = ClientsView(self.settings, self)
        clView.newClientSignal.connect(self.settings.addClient)
        self.settings.clientsUpdated.connect(clView.updateList)
        clView.exec_()

    def openStockManager(self):
        print "Opening stock manager application"
        stockManager = StockManagerGUI()
        stockManager.show()

    def generateExcelFiles(self):
        print "Generating excel files"
        ### The old way of generating excel files was to get the excel files from the external program. Now we use the internal stock db to generate the excel docs
        ###extractor.excel_creator.createExcel()
        ### QtGui.QMessageBox.information(None, "Excel bestanden gemaakt.", "De excel bestanden zijn klaar.")
        extractor.excel_creator.createExcelWithSplitSizesFromStockDb()
        print "Finished generating excel files"

    def updateWebsite(self):
        pass
        # extractor.site_synchronizer.synchronize()
        # QtGui.QMessageBox.information(None, "Update geslaagd.", "De website is up-to-date.")

    def updateToppower(self):
        synchronizeDialog = SynchronizeDialog(self)
        synchronizeDialog.exec_()

    def importContactsFromCsv(self):
        contactImporter = ContactImporter()
        contactImporter.newClientSignal.connect(self.settings.addClient)
        contactImporter.parseAndAddToContacts()
        self.settings.toFile()
        QtGui.QMessageBox.information(None, "Importeren gelukt.", "De contactpersonen zijn nu geimporteerd.")
开发者ID:brecht1234,项目名称:kapelhof_tools,代码行数:90,代码来源:GUIMainWin.py


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