summaryrefslogtreecommitdiff
path: root/mat-gui
diff options
context:
space:
mode:
authorjvoisin2014-01-06 21:47:02 +0000
committerjvoisin2014-01-06 21:47:02 +0000
commit9c44ef035133d928afa4cbc41e40883b7460d210 (patch)
tree77559b8459bd74d12f118506f0323d4899ea1ce3 /mat-gui
parentcb2975459500a7c9819dac4628cb50403d1883f0 (diff)
The user can now chose if he wants to includes unsupported files to archive
Diffstat (limited to 'mat-gui')
-rwxr-xr-xmat-gui15
1 files changed, 7 insertions, 8 deletions
diff --git a/mat-gui b/mat-gui
index b618e8f..a1cb446 100755
--- a/mat-gui
+++ b/mat-gui
@@ -206,8 +206,7 @@ class GUI(object):
206 206
207 def cb_preferences_popup(self, button): 207 def cb_preferences_popup(self, button):
208 ''' Preferences popup ''' 208 ''' Preferences popup '''
209 dialog = Gtk.Dialog(_('Preferences'), self.window, 0, 209 dialog = Gtk.Dialog(_('Preferences'), self.window, 0, (Gtk.STOCK_OK, 0))
210 (Gtk.STOCK_OK, 0))
211 dialog.connect('delete-event', self.cb_hide_widget) 210 dialog.connect('delete-event', self.cb_hide_widget)
212 dialog.set_resizable(False) 211 dialog.set_resizable(False)
213 hbox = Gtk.HBox() 212 hbox = Gtk.HBox()
@@ -226,8 +225,7 @@ class GUI(object):
226 pdf_quality.set_tooltip_text(_('Reduce the produced PDF size and quality')) 225 pdf_quality.set_tooltip_text(_('Reduce the produced PDF size and quality'))
227 table.attach(pdf_quality, 0, 1, 0, 1) 226 table.attach(pdf_quality, 0, 1, 0, 1)
228 227
229 add2archive = Gtk.CheckButton(_('Add unsupported file to archives'), 228 add2archive = Gtk.CheckButton(_('Add unsupported file to archives'), False)
230 False)
231 add2archive.set_active(self.add2archive) 229 add2archive.set_active(self.add2archive)
232 add2archive.connect('toggled', self.__invert, 'add2archive') 230 add2archive.connect('toggled', self.__invert, 'add2archive')
233 add2archive.set_tooltip_text(_('Add non-supported (and so \ 231 add2archive.set_tooltip_text(_('Add non-supported (and so \
@@ -270,8 +268,7 @@ non-anonymised) file to output archive'))
270 ''' Add a file to the list if its format is supported ''' 268 ''' Add a file to the list if its format is supported '''
271 cf = CFile(filename, add2archive=self.add2archive, 269 cf = CFile(filename, add2archive=self.add2archive,
272 low_pdf_quality=self.pdf_quality) 270 low_pdf_quality=self.pdf_quality)
273 # if the file is supported by the mat, 271 # if the file is supported by the mat, and is writable (for usability's sake).
274 # and is writable (for usability's sake).
275 if cf.file and cf.file.is_writable: 272 if cf.file and cf.file.is_writable:
276 self.liststore.append([cf, cf.file.basename, _('Unknown')]) 273 self.liststore.append([cf, cf.file.basename, _('Unknown')])
277 return False 274 return False
@@ -392,6 +389,7 @@ non-anonymised) file to output archive'))
392 dialog.show_all() 389 dialog.show_all()
393 dialog.run() 390 dialog.run()
394 dialog.destroy() 391 dialog.destroy()
392 return [i[1] for i in store if i[0]]
395 393
396 def __mat_check(self, iterator): 394 def __mat_check(self, iterator):
397 ''' Check elements in iterator are clean ''' 395 ''' Check elements in iterator are clean '''
@@ -417,8 +415,9 @@ non-anonymised) file to output archive'))
417 if isinstance(self.liststore[line][0].file, archive.GenericArchiveStripper): 415 if isinstance(self.liststore[line][0].file, archive.GenericArchiveStripper):
418 unsupported_list = self.liststore[line][0].file.list_unsupported() 416 unsupported_list = self.liststore[line][0].file.list_unsupported()
419 if unsupported_list: 417 if unsupported_list:
420 self.__popup_archive(unsupported_list) 418 list_to_add = self.__popup_archive(unsupported_list)
421 yield True 419 if self.liststore[line][0].file.remove_all(list_to_add):
420 self.liststore[line][2] = _('Clean')
422 elif self.liststore[line][0].file.remove_all(): 421 elif self.liststore[line][0].file.remove_all():
423 self.liststore[line][2] = _('Clean') 422 self.liststore[line][2] = _('Clean')
424 yield True 423 yield True