| ... |
... |
@@ -4773,49 +4773,6 @@ class ProgressDialog: |
|
4773
|
4773
|
def on_progress_dialog_delete_event(self, widget, event):
|
|
4774
|
4774
|
return True # WM's X button or Escape key should not destroy the window
|
|
4775
|
4775
|
|
|
4776
|
|
-
|
|
4777
|
|
-class ClientCertChooserDialog(FileChooserDialog):
|
|
4778
|
|
- def __init__(self, path_to_clientcert_file='', on_response_ok=None,
|
|
4779
|
|
- on_response_cancel=None):
|
|
4780
|
|
- '''
|
|
4781
|
|
- optionally accepts path_to_clientcert_file so it has that as selected
|
|
4782
|
|
- '''
|
|
4783
|
|
- def on_ok(widget, callback):
|
|
4784
|
|
- '''
|
|
4785
|
|
- check if file exists and call callback
|
|
4786
|
|
- '''
|
|
4787
|
|
- path_to_clientcert_file = self.get_filename()
|
|
4788
|
|
- if os.path.exists(path_to_clientcert_file):
|
|
4789
|
|
- callback(widget, path_to_clientcert_file)
|
|
4790
|
|
-
|
|
4791
|
|
- FileChooserDialog.__init__(self,
|
|
4792
|
|
- title_text=_('Choose Client Cert #PCKS12'),
|
|
4793
|
|
- transient_for=app.interface.instances['accounts'],
|
|
4794
|
|
- action=Gtk.FileChooserAction.OPEN,
|
|
4795
|
|
- buttons=(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
|
|
4796
|
|
- Gtk.STOCK_OPEN, Gtk.ResponseType.OK),
|
|
4797
|
|
- current_folder='',
|
|
4798
|
|
- default_response=Gtk.ResponseType.OK,
|
|
4799
|
|
- on_response_ok=(on_ok, on_response_ok),
|
|
4800
|
|
- on_response_cancel=on_response_cancel)
|
|
4801
|
|
-
|
|
4802
|
|
- filter_ = Gtk.FileFilter()
|
|
4803
|
|
- filter_.set_name(_('All files'))
|
|
4804
|
|
- filter_.add_pattern('*')
|
|
4805
|
|
- self.add_filter(filter_)
|
|
4806
|
|
-
|
|
4807
|
|
- filter_ = Gtk.FileFilter()
|
|
4808
|
|
- filter_.set_name(_('PKCS12 Files'))
|
|
4809
|
|
- filter_.add_pattern('*.p12')
|
|
4810
|
|
- self.add_filter(filter_)
|
|
4811
|
|
- self.set_filter(filter_)
|
|
4812
|
|
-
|
|
4813
|
|
- if path_to_clientcert_file:
|
|
4814
|
|
- # set_filename accept only absolute path
|
|
4815
|
|
- path_to_clientcert_file = os.path.abspath(path_to_clientcert_file)
|
|
4816
|
|
- self.set_filename(path_to_clientcert_file)
|
|
4817
|
|
-
|
|
4818
|
|
-
|
|
4819
|
4776
|
class SoundChooserDialog(FileChooserDialog):
|
|
4820
|
4777
|
def __init__(self, path_to_snd_file='', on_response_ok=None,
|
|
4821
|
4778
|
on_response_cancel=None, transient_for=None):
|