+### Properties dialog ##########################################################
+
+class PropertiesDialog(gtk.Dialog):
+ def __init__(self, path, size, bytesize):
+ gtk.Dialog.__init__(self)
+ self.set_title( _('File properties') )
+ self.set_transient_for(app)
+ self.set_wmclass('PropertiesDialog', 'FindIT')
+ self.add_buttons(gtk.STOCK_OK, gtk.RESPONSE_OK)
+
+ name = basename(path)
+
+ access = time.strftime('%x %X', time.localtime(getatime(path)))
+ modified = time.strftime('%x %X', time.localtime(getmtime(path)))
+
+ table = gtk.Table(2, 2, True)
+ table.set_border_width(10)
+ table.set_col_spacings(10)
+ table.set_row_spacings(10)
+
+ nameLbl = gtk.Label( _('Name') )
+ nameValueLbl = gtk.Label(name)
+
+ sizeLbl = gtk.Label( _('Size') )
+ sizeValueLbl = gtk.Label(size + ' (' + `bytesize` + ' b)')
+
+ accessLbl = gtk.Label( _('Opened') )
+ accessValueLbl = gtk.Label(access)
+
+ modifiedLbl = gtk.Label( _('Modified') )
+ modifiedValueLbl = gtk.Label(modified)
+
+ table.attach(nameLbl, 0, 1, 0, 1)
+ table.attach(nameValueLbl, 1, 2, 0, 1)
+ table.attach(sizeLbl, 0, 1, 1, 2)
+ table.attach(sizeValueLbl, 1, 2, 1, 2)
+ table.attach(accessLbl, 0, 1, 2, 3)
+ table.attach(accessValueLbl, 1, 2, 2, 3)
+ table.attach(modifiedLbl, 0, 1, 3, 4)
+ table.attach(modifiedValueLbl, 1, 2, 3, 4)
+
+ self.vbox.add(table)
+ self.show_all()
+ self.run()
+ self.destroy()
+