示例#1
0
 def _setupfields(self):
     numfields = len(self.fields)
     for fnum in range(numfields):
         fname = self.fields[fnum]
         entry = KLineEdit('', self)
         self.entries[fname] = entry
         self.grid.addWidget(entry, fnum + 1, 1)
         label = QLabel(entry, fname, self, fname)
         self.grid.addWidget(label, fnum + 1, 0)
     self.insButton = KPushButton('insert/new', self)
     self.updButton = KPushButton('update', self)
     self.grid.addWidget(self.insButton, numfields, 0)
     self.grid.addWidget(self.updButton, numfields, 1)
示例#2
0
    def __init__(self, parent, name='SuiteTraitComboBox'):
        QFrame.__init__(self, parent, name)
        self.app = get_application_pointer()
        self.conn = self.app.conn
        self.suiteCursor = Suites(self.conn)
        self.suites = self.suiteCursor.list()
        self.traits = Traits(self.conn, self.suites[0])
        self.scombo = KComboBox(self, 'SuiteComboBox')
        self.scombo.insertStrList(self.suites)
        self.tcombo = KComboBox(self, 'TypeComboBox')
        self.tcombo.insertStrList(['template', 'script'])
        self.trcombo = KComboBox(self, 'TraitComboBox')
        self.update_btn = KPushButton('update', self)
        self.listView = TraitListView(self)
        self.vbox = QVBoxLayout(self)
        for attribute in [
                'listView', 'scombo', 'tcombo', 'trcombo', 'update_btn'
        ]:
            widget = getattr(self, attribute)
            self.vbox.addWidget(widget)
        # we need to redo the signals and the methods that are called
        self.connect(self.scombo, SIGNAL('activated(int)'), self.update_traits)

        self.connect(self.update_btn, SIGNAL('clicked()'),
                     self.refreshlistView)
示例#3
0
 def __init__(self, app, parent):
     KMainWindow.__init__(self, parent)
     dbwidget(self, app)
     self.manager = InstallerManager(self.conn)
     self.mainView = KPushButton('hello there', self)
     self.setCentralWidget(self.mainView)
     self.setCaption('Installer Management')
     self.show()
示例#4
0
 def __init__(self, app, parent, profile):
     KMainWindow.__init__(self, parent, 'TraitAssigner')
     self.page = QFrame(self)
     self.vbox = QVBoxLayout(self.page, 5, 7)
     self.listBox = KActionSelector(self.page)
     self.listBox.setShowUpDownButtons(True)
     self.setCentralWidget(self.page)
     self.vbox.addWidget(self.listBox)
     hbox = QHBoxLayout(self.page, 5, 7)
     self.vbox.addLayout(hbox)
     self.ok_button = KPushButton('ok', self.page)
     self.cancel_button = KPushButton('cancel', self.page)
     hbox.addWidget(self.ok_button)
     hbox.addWidget(self.cancel_button)
     self.app = app
     self.db = app.db
     self.profile = Profile(app.conn)
     self.profile.set_profile(profile)
     self.suite = self.profile.current.suite
     self.traits = StatementCursor(app.conn)
     self.traits.set_table('%s_traits'  % self.suite)
     self.initlistView()
     self.show()
示例#5
0
 def __init__(self, app, parent, name='SuiteTraitCombo'):
     QWidget.__init__(self, parent, name)
     dbwidget(self, app)
     self.suiteCursor = Suites(self.conn)
     self.suites = self.suiteCursor.list()
     self.traits = Traits(self.conn, self.suites[0])
     self.scombo = SuiteCombo(self, self.suites)
     self.tcombo = MyCombo(self, 'TypeCombo')
     self.tcombo.fill(['template', 'script'])
     self.ubutton = KPushButton('update', self)
     self.listView = TraitList(self.app, self)
     self.vbox = QVBoxLayout(self)
     for member in ['listView', 'scombo', 'tcombo', 'ubutton']:
         widget = getattr(self, member)
         self.vbox.addWidget(widget)
     self.connect(self.scombo, SIGNAL('highlighted(int)'),
                  self.update_traits)
     self.connect(self.ubutton, SIGNAL('clicked()'), self.refreshlistView)