Ejemplo n.º 1
0
    def __init__(self, mainwin, label=''):
        gtk.VBox.__init__(self, False)

        self.mainwin = mainwin
        self.statuslist = StatusList(mainwin)
        self.waiting = CairoWaiting(mainwin)
        self.walign = gtk.Alignment(xalign=1, yalign=0.5)
        self.walign.add(self.waiting)
        self.errorbox = ErrorBox()
        self.label = gtk.Label(label)
        self.caption = label

        self.connect('expose-event', self.error_show)
Ejemplo n.º 2
0
 def __init__(self, mainwin, label=''):
     gtk.VBox.__init__(self, False)
     
     self.mainwin = mainwin
     self.statuslist = StatusList(mainwin)
     self.waiting = CairoWaiting(mainwin)
     self.walign = gtk.Alignment(xalign=1, yalign=0.5)
     self.walign.add(self.waiting)
     self.errorbox = ErrorBox()
     self.label = gtk.Label(label)
     self.caption = label
     
     self.connect('expose-event', self.error_show)
Ejemplo n.º 3
0
class GenericColumn(gtk.VBox):
    def __init__(self, mainwin, label=''):
        gtk.VBox.__init__(self, False)
        
        self.mainwin = mainwin
        self.statuslist = StatusList(mainwin)
        self.waiting = CairoWaiting(mainwin)
        self.walign = gtk.Alignment(xalign=1, yalign=0.5)
        self.walign.add(self.waiting)
        self.errorbox = ErrorBox()
        self.label = gtk.Label(label)
        self.caption = label
        
        self.connect('expose-event', self.error_show)
        
    def error_show(self, widget, event):
        self.errorbox.show()
        
    def update_tweets(self, response):
        count = 0
        if response.type == 'error':
            self.stop_update(True, response.errmsg)
        else:
            statuses = response.items
            if len(statuses) == 0:
                self.statuslist.clear()
                self.stop_update(True, _('No tweets available'))
            else:
                count = self.statuslist.update(statuses)
                self.stop_update()
        self.on_update()
        return count
            
    def update_user_pic(self, user, pic):
        self.statuslist.update_user_pic(user, pic)
        
    def update_wrap(self, width):
        self.statuslist.update_wrap(width)
    
    def start_update(self):
        self.waiting.start()
        self.errorbox.hide()
        
    def stop_update(self, error=False, msg=''):
        self.waiting.stop(error)
        self.errorbox.show_error(msg, error)
    
    def clear(self):
        self.statuslist.clear()
    
    def on_update(self, data=None):
        pass
Ejemplo n.º 4
0
class GenericColumn(gtk.VBox):
    def __init__(self, mainwin, label=''):
        gtk.VBox.__init__(self, False)

        self.mainwin = mainwin
        self.statuslist = StatusList(mainwin)
        self.waiting = CairoWaiting(mainwin)
        self.walign = gtk.Alignment(xalign=1, yalign=0.5)
        self.walign.add(self.waiting)
        self.errorbox = ErrorBox()
        self.label = gtk.Label(label)
        self.caption = label

        self.connect('expose-event', self.error_show)

    def error_show(self, widget, event):
        self.errorbox.show()

    def update_tweets(self, response):
        count = 0
        if response.type == 'error':
            self.stop_update(True, response.errmsg)
        else:
            statuses = response.items
            if len(statuses) == 0:
                self.statuslist.clear()
                self.stop_update(True, _('No tweets available'))
            else:
                count = self.statuslist.update(statuses)
                self.stop_update()
        self.on_update()
        return count

    def update_user_pic(self, user, pic):
        self.statuslist.update_user_pic(user, pic)

    def update_wrap(self, width):
        self.statuslist.update_wrap(width)

    def start_update(self):
        self.waiting.start()
        self.errorbox.hide()

    def stop_update(self, error=False, msg=''):
        self.waiting.stop(error)
        self.errorbox.show_error(msg, error)

    def clear(self):
        self.statuslist.clear()

    def on_update(self, data=None):
        pass