summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjvoisin2011-08-21 04:08:04 +0200
committerjvoisin2011-08-21 04:08:04 +0200
commit54f6655ecf1436284550ec4aeedfe6b23974478a (patch)
tree551bbc7b4668765d056a665570438b5b5b33af8d
parent03832504121769f54775a4b713d2a6518e143a7e (diff)
Refont the handle of backup copy
-rwxr-xr-xmat-gui31
1 files changed, 16 insertions, 15 deletions
diff --git a/mat-gui b/mat-gui
index 0339763..252e4a6 100755
--- a/mat-gui
+++ b/mat-gui
@@ -69,15 +69,15 @@ class GUI:
69 # parser.class - name - type - cleaned 69 # parser.class - name - type - cleaned
70 self.liststore = gtk.ListStore(object, str, str, str, str) 70 self.liststore = gtk.ListStore(object, str, str, str, str)
71 71
72 treeview = gtk.TreeView(model=self.liststore) 72 self.treeview = gtk.TreeView(model=self.liststore)
73 treeview.set_search_column(1) # the filename column is searchable 73 self.treeview.set_search_column(1) # filename column is searchable
74 treeview.set_rules_hint(True) # alternate colors for rows 74 self.treeview.set_rules_hint(True) # alternate colors for rows
75 treeview.set_rubber_banding(True) # mouse selection 75 self.treeview.set_rubber_banding(True) # mouse selection
76 self.add_columns(treeview) 76 self.add_columns()
77 self.selection = treeview.get_selection() 77 self.selection = self.treeview.get_selection()
78 self.selection.set_mode(gtk.SELECTION_MULTIPLE) 78 self.selection.set_mode(gtk.SELECTION_MULTIPLE)
79 79
80 content.add(treeview) 80 content.add(self.treeview)
81 81
82 self.statusbar = gtk.Statusbar() 82 self.statusbar = gtk.Statusbar()
83 self.statusbar.push(1, _('Ready')) 83 self.statusbar.push(1, _('Ready'))
@@ -125,12 +125,12 @@ data loss'))
125 vbox.pack_start(toolbar, False, False, 0) 125 vbox.pack_start(toolbar, False, False, 0)
126 return vbox 126 return vbox
127 127
128 def add_columns(self, treeview): 128 def add_columns(self):
129 ''' 129 '''
130 Create the columns, and add them to the treeview 130 Create the columns, and add them to the treeview
131 ''' 131 '''
132 colname = [_('Filename'), _('Mimetype'), _('State'), 132 colname = [_('Filename'), _('Mimetype'), _('State'),
133 _('State of the backup copy')] 133 _('State of the cleaned file')]
134 134
135 for i, j in enumerate(colname): 135 for i, j in enumerate(colname):
136 filename_column = gtk.CellRendererText() 136 filename_column = gtk.CellRendererText()
@@ -139,8 +139,8 @@ data loss'))
139 column.set_resizable(True) # column is resizeable 139 column.set_resizable(True) # column is resizeable
140 if i is 0: # place cell-specific tooltip on this column 140 if i is 0: # place cell-specific tooltip on this column
141 tips = TreeViewTooltips(column) 141 tips = TreeViewTooltips(column)
142 tips.add_view(treeview) 142 tips.add_view(self.treeview)
143 treeview.append_column(column) 143 self.treeview.append_column(column)
144 144
145 def create_menu_item(self, name, func, menu, pix, shortcut): 145 def create_menu_item(self, name, func, menu, pix, shortcut):
146 ''' 146 '''
@@ -299,13 +299,13 @@ data loss'))
299 vbox = gtk.VBox(spacing=5) 299 vbox = gtk.VBox(spacing=5)
300 dialog.get_content_area().pack_start(vbox, True, True, 0) 300 dialog.get_content_area().pack_start(vbox, True, True, 0)
301 store = gtk.ListStore(str, str) 301 store = gtk.ListStore(str, str)
302 302
303 # append filename - mimetype to the store 303 # append filename - mimetype to the store
304 [store.append([item, 'bleh']) for item in filelist] 304 [store.append([item, 'bleh']) for item in filelist]
305 305
306 treeview = gtk.TreeView(store) 306 treeview = gtk.TreeView(store)
307 vbox.pack_start(treeview, True, True, 0) 307 vbox.pack_start(treeview, True, True, 0)
308 308
309 #create column 309 #create column
310 rendererText = gtk.CellRendererText() 310 rendererText = gtk.CellRendererText()
311 column = gtk.TreeViewColumn(_('Filename'), rendererText, text=0) 311 column = gtk.TreeViewColumn(_('Filename'), rendererText, text=0)
@@ -424,6 +424,7 @@ non-anonymised) file to output archive'))
424 self.force = not self.force 424 self.force = not self.force
425 elif name == 'backup': 425 elif name == 'backup':
426 self.backup = not self.backup 426 self.backup = not self.backup
427 self.treeview.get_column(3).set_visible(self.backup)
427 elif name == 'add2archive': 428 elif name == 'add2archive':
428 self.add2archive = not self.add2archive 429 self.add2archive = not self.add2archive
429 430
@@ -483,7 +484,7 @@ non-anonymised) file to output archive'))
483 self.liststore[line][0].file.remove_all_ugly() 484 self.liststore[line][0].file.remove_all_ugly()
484 if self.backup: # the backup copy state 485 if self.backup: # the backup copy state
485 self.liststore[line][4] = _('clean') 486 self.liststore[line][4] = _('clean')
486 else: 487 else:
487 self.liststore[line][3] = _('clean') 488 self.liststore[line][3] = _('clean')
488 yield True 489 yield True
489 self.statusbar.push(0, _('Ready')) 490 self.statusbar.push(0, _('Ready'))