def initlistView(self):
     rows = self.manager.get_clients(self.ticketid, assigned=False)
     ubox = self.listBox.availableListBox()
     abox = self.listBox.selectedListBox()
     for row in rows:
         if row.assigned:
             c = QListBoxText(abox, row.client)
         else:
             c = QListBoxText(ubox, row.client)
         c.clientid = row.clientid
Beispiel #2
0
 def initlistView(self):
     ptrows = self.profile.get_trait_rows()
     pt = [r.trait for r in ptrows]
     all_trows = self.traits.select(fields=['trait'], order=['trait'])
     trows = [r for r in all_trows if r.trait not in pt]
     abox = self.listBox.availableListBox()
     sbox = self.listBox.selectedListBox()
     for row in ptrows:
         QListBoxText(sbox, row.trait)
     for row in trows:
         QListBoxText(abox, row.trait)
Beispiel #3
0
 def initView(self):
     traits = self.trait.get_trait_list()
     traits.sort()
     parents = self.trait.parents()
     traits = [t for t in traits if t != self.trait.current_trait]
     abox = self.listBox.availableListBox()
     sbox = self.listBox.selectedListBox()
     avail_traits = [t for t in traits if t not in parents]
     for trait in avail_traits:
         r = QListBoxText(abox, trait)
     for trait in parents:
         r = QListBoxText(sbox, trait)
Beispiel #4
0
    def initView(self):
        self.suite = self.profile.current.suite
        # self.traits is just a cursor
        self.traits = self.conn.cursor(statement=True)
        self.traits.set_table('%s_traits' % self.suite)

        ptrows = self.profile.get_trait_rows()
        pt = [row.trait for row in ptrows]
        all_trows = self.traits.select(fields=['trait'], order=['trait'])
        trows = [row for row in all_trows if row.trait not in pt]
        abox = self.listBox.availableListBox()
        sbox = self.listBox.selectedListBox()
        for row in ptrows:
            r = QListBoxText(sbox, row.trait)
        for row in trows:
            r = QListBoxText(abox, row.trait)
Beispiel #5
0
 def getAccItem(self,acc):
     image = acc.BlogService.getPixmap()
     if image:        
         i = QListBoxPixmap (  image, acc.Name )
     else:
         i = QListBoxText ( acc.Name )
     return i
Beispiel #6
0
 def initView(self):
     app = self.app
     self.db = app.db
     self.suite = self.profile.current.suite
     self.traits = StatementCursor(app.conn)
     self.traits.set_table('%s_traits'  % self.suite)
     
     ptrows = self.profile.get_trait_rows()
     pt = [r.trait for r in ptrows]
     all_trows = self.traits.select(fields=['trait'], order=['trait'])
     trows = [r for r in all_trows if r.trait not in pt]
     abox = self.listBox.availableListBox()
     sbox = self.listBox.selectedListBox()
     for row in ptrows:
         r = QListBoxText(sbox, row.trait)
         r.trait = row.trait
     for row in trows:
         r = QListBoxText(abox, row.trait)
         r.trait = row.trait
Beispiel #7
0
    def bg(self, *args):
        p = self.parent
        self.item_to_update = None
        self.result = False
        blogId = p.settings.get("main", "selectedblog")
        title = unicode(p.editPostTitle.text())
        content = unicode(p.sourceEditor.text())
        # are we editing?
        if p.current_post and p.current_post.has_key('id'):  #yes!
            #yes, edit it
            try:
                self.atomBlog.editPost(blogId, p.current_post['id'], title,
                                       content)
                self.result = True
                idx = p.PublishedPosts[p.settings.get(
                    "main", "selectedblog")].index(p.current_post)
                p.PublishedPosts[p.settings.get(
                    "main", "selectedblog")][idx]['date'] = date.today()
                p.PublishedPosts[p.settings.get(
                    "main", "selectedblog")][idx]["title"] = title
                p.PublishedPosts[p.settings.get(
                    "main", "selectedblog")][idx]["content"] = content
                self.item_to_update = p.PublishedPosts[p.settings.get(
                    "main", "selectedblog")][idx]
            except:
                self.result = False

        else:  #no, we are creating
            try:
                idx = self.atomBlog.newPost(int(blogId), title, content)
                if idx:
                    self.result = True
                    item = {
                        "id": idx,
                        "date": date.today(),
                        "title": title,
                        "content": content,
                    }
                    i = QListBoxText(title)
                    p.listPublishedPosts.insertItem(i, 0)
                    #i = QListBoxText(p.listPublishedPosts, title)
                    p.PublishedPosts[p.settings.get("main",
                                                    "selectedblog")] += [item]
                    p.PublishedItems[i] = item
            except Exception, inst:
                self.result = False
Beispiel #8
0
    def initView(self):
        app = self.app
        self.db = app.db
        self.suite = self.profile.current.suite
        self.traits = StatementCursor(app.conn)
        self.traits.set_table('%s_traits' % self.suite)

        ptrows = self.profile.get_trait_rows()
        pt = [r.trait for r in ptrows]
        all_trows = self.traits.select(fields=['trait'], order=['trait'])
        trows = [r for r in all_trows if r.trait not in pt]
        abox = self.listBox.availableListBox()
        sbox = self.listBox.selectedListBox()
        for row in ptrows:
            r = QListBoxText(sbox, row.trait)
            r.trait = row.trait
        for row in trows:
            r = QListBoxText(abox, row.trait)
            r.trait = row.trait
Beispiel #9
0
 def _add_family_to_listbox(self, box, family):
     item = QListBoxText(box, family)
     item.family = family
Beispiel #10
0
 def _add_family_to_listbox(self, box, family):
     r = QListBoxText(box, family)
     r.family = family
Beispiel #11
0
 def _add_family_to_listbox(self, box, family):
     r = QListBoxText(box, family)
     r.family = family
Beispiel #12
0
 def initView(self):
     abox = self.listBox.availableListBox()
     apt_ids = [r.apt_id for r in self.suitecursor.get_apt_sources()]
     for apt_id in apt_ids:
         QListBoxText(abox, apt_id)
Beispiel #13
0
 def _add_family_to_listbox(self, box, family):
     item = QListBoxText(box, family)
     item.family = family