Example #1
0
 def __init__(self, pathname, parent=None, watching=Purr.WATCHED):
     self._pathname = pathname
     pathname = Kittens.utils.collapseuser(pathname)
     self._in_setWatching = True
     QListWidgetItem.__init__(self, pathname, parent)
     self.setFlags(Qt.ItemIsSelectable | Qt.ItemIsUserCheckable | Qt.ItemIsEnabled | Qt.ItemIsTristate)
     self.setWatching(watching)
Example #2
0
 def __init__(self, pathname, parent=None, watching=Purr.WATCHED):
     self._pathname = pathname
     pathname = Kittens.utils.collapseuser(pathname)
     self._in_setWatching = True
     QListWidgetItem.__init__(self, pathname, parent)
     self.setFlags(Qt.ItemIsSelectable | Qt.ItemIsUserCheckable
                   | Qt.ItemIsEnabled | Qt.ItemIsTristate)
     self.setWatching(watching)
Example #3
0
 def __init__(self, parent, info):
     QListWidgetItem.__init__(
         self,
         _("Operation %(no)s : %(date)s - %(type)s") % {
             "no": info.no,
             "date": info.date,
             "type": info.type
         }, parent)
     self._info = info
Example #4
0
    def __init__(self, parent, user):
        if user.username == "root":
            icon = "root"
            name = _("Super User")
        else:
            name = user.username
            icon = "normal"

        label = "%s (%s)" % (name, user.realname)
        QListWidgetItem.__init__(self, QIcon(":/gui/pics/user_%s.png" % icon), label, parent)
        self.user = user
Example #5
0
 def __init__(self, parent, ext, size, path=None, timestamp=None):
     self.path = path
     self.ext = ext
     self.size = float(size)/(1024*1024)
     text = '%s (%.2f MB)'%(self.ext.upper(), self.size)
     QListWidgetItem.__init__(self, file_icon_provider().icon_from_ext(ext),
                              text, parent, QListWidgetItem.UserType)
     if timestamp is not None:
         ts = timestamp.astimezone(local_tz)
         t = strftime('%a, %d %b %Y [%H:%M:%S]', ts.timetuple())
         text = _('Last modified: %s\n\nDouble click to view')%t
         self.setToolTip(text)
         self.setStatusTip(text)
Example #6
0
 def __init__(self, parent, ext, size, path=None, timestamp=None):
     self.path = path
     self.ext = ext
     self.size = float(size) / (1024 * 1024)
     text = '%s (%.2f MB)' % (self.ext.upper(), self.size)
     QListWidgetItem.__init__(self,
                              file_icon_provider().icon_from_ext(ext), text,
                              parent, QListWidgetItem.UserType)
     if timestamp is not None:
         ts = timestamp.astimezone(local_tz)
         t = strftime('%a, %d %b %Y [%H:%M:%S]', ts.timetuple())
         text = _('Last modified: %s\n\nDouble click to view') % t
         self.setToolTip(text)
         self.setStatusTip(text)
Example #7
0
 def __init__(self, text, user_data=None):
     QListWidgetItem.__init__(self, text)
     self.user_data = user_data
Example #8
0
 def __init__(self, parent, widget):
     QListWidgetItem.__init__(self, parent)
     self.widget = widget
     self.setSizeHint(QSize(widget.width()-20, widget.height()))
Example #9
0
 def __init__(self, parent, device, release):
     label = "%s on %s" % (release, device.path)
     QListWidgetItem.__init__(self, QIcon(":/gui/pics/parduspart.png"), label, parent)
     self.device = device
     self.release = release
Example #10
0
 def __init__(self, parent, connection, package):
     QListWidgetItem.__init__(self, QIcon(":/gui/pics/%s.png" % package), connection, parent)
     self._connection = [connection, package]
Example #11
0
 def __init__(self, parent, info):
     QListWidgetItem.__init__(self, _("Operation %(no)s : %(date)s - %(type)s") % {"no":info.no, "date":info.date, "type":info.type}, parent)
     self._info = info
Example #12
0
 def __init__(self, parent, widget):
     QListWidgetItem.__init__(self, parent)
     self.widget = widget
     self.setSizeHint(QSize(widget.width() - 20, widget.height()))
Example #13
0
 def __init__(self, text='', x=0, color='k'):
     QListWidgetItem.__init__(self)
     self.setText(text)
     self.x = x
     self.color = color
Example #14
0
 def __init__(self, parent, pixmap, user):
     icon = QIcon(pixmap)
     QListWidgetItem.__init__(self, icon, QString(user.username), parent)
     self._user = user
Example #15
0
 def __init__(self, parent, connection, package):
     QListWidgetItem.__init__(self, QIcon(":/gui/pics/%s.png" % package),
                              connection, parent)
     self._connection = [connection, package]