Пример #1
0
 def __init__(self, cfg):
     print cfg
     for group in cfg.groupList():
         #self.setCurrentGroup(group)
         for k,v in cfg.entryMap(group).items():
             print k, '-->', v
     print 'preinit'
     KConfigSkeleton.__init__(self, 'konsultantrc')
     print 'postinit'
Пример #2
0
 def __init__(self, name='konsultant'):
     KConfigSkeleton.__init__(self, name)
     self.readConfig()
     print 'hello there'
     config = self.config()
     print config, [str(x) for x in config.groupList()]
     cfg = BaseSkel()
     data = cfg.getdata()
     print 'sections added'
     #self.setDefaults()
     print 'DefaultSkeleton written'
Пример #3
0
        def __init__(self, *args):
            KConfigSkeleton.__init__(self, *args)
            
            self.filterErrorList = []
            self.filterWarningList = []
            
            self.setCurrentGroup("Font")
            self.fontDefault = self.addItemBool("fontDefault", True)
            self.fontFixed = self.addItemBool("fontFixed", False)
            self.fontCustom = self.addItemBool("fontCustom", False)
            self.fontVal = QFont()
            self.font = self.addItemFont("font", self.fontVal, QFont())
            
            self.setCurrentGroup("Filters")
            self.filterErrorsVal = QString()
            self.filterErrors = self.addItemString("filterErrors",
                self.filterErrorsVal, LoviConfig.LoviConfig_.ERRORS)
            self.filterWarningsVal = QString()
            self.filterWarnings = self.addItemString("filterWarnings",
                self.filterWarningsVal, LoviConfig.LoviConfig_.WARNINGS)

            self.readConfig()
            self.processConfig()
Пример #4
0
import sys
from kdecore import KAboutData, KApplication, KCmdLineArgs, KConfigSkeleton
from kdeui import KConfigDialog, KMainWindow

KCmdLineArgs.init(sys.argv, KAboutData("test", "test", "1.0"))
app = KApplication()
mainWin = KMainWindow(None, "test")
app.setMainWidget(mainWin)
cfg = KConfigSkeleton("test")
dlg = KConfigDialog(mainWin, "settings", cfg)
mainWin.show()
app.exec_loop()