def on_report_button_clicked(self, *args):
     fcd = FileChooserDialog("Choose report file and location",
                             None,
                             FILE_CHOOSER_ACTION_SAVE,
                             (STOCK_CANCEL, RESPONSE_CANCEL,
                                 STOCK_SAVE, RESPONSE_OK))
     fcd.set_modal(True)
     result = fcd.run()
     file_path = fcd.get_filename()
     fcd.destroy()
     if result == RESPONSE_OK and file_path != None:
         self.generate_balance_report(file_path)
 def file_selection_module_contents(self, msg="choose file"):
     fcd = FileChooserDialog(
         msg,
         None,
         FILE_CHOOSER_ACTION_OPEN,
         (STOCK_CANCEL, RESPONSE_CANCEL, STOCK_OPEN, RESPONSE_OK) )
     fcd.set_modal(True)
     result = fcd.run()
     file_path = fcd.get_filename()
     fcd.destroy()
     if result == RESPONSE_OK and file_path != None:
         return get_module_for_file_path(file_path)
     return None
예제 #3
0
 def save_dialog(self, msg):
     fcd = FileChooserDialog(
         msg,
         None,
         FILE_CHOOSER_ACTION_SAVE,
         (STOCK_CANCEL, RESPONSE_CANCEL, STOCK_SAVE, RESPONSE_OK) )
     fcd.set_modal(True)
     result = fcd.run()
     file_path = fcd.get_filename()
     fcd.destroy()
     if result == RESPONSE_OK and file_path != None:
         return file_path
     else:
         return None
예제 #4
0
def file_selection_path(msg="choose file",
                        selection_code=FILE_CHOOSER_ACTION_OPEN):
    fcd = FileChooserDialog(
        msg,
        None,
        selection_code,
        (STOCK_CANCEL, RESPONSE_CANCEL, STOCK_OPEN, RESPONSE_OK) )
    fcd.set_modal(True)
    result = fcd.run()
    file_path = fcd.get_filename()
    fcd.destroy()
    if result == RESPONSE_OK:
        return file_path
    return None
예제 #5
0
 def on_selectdb_button_clicked(self, *args):
     """Browse for the location of a new BoKeep transaction database."""
     
     fcd = FileChooserDialog(
         "Where should the database be?",
         self.bokeep_config_dialog,
         FILE_CHOOSER_ACTION_SAVE,
         (STOCK_CANCEL, RESPONSE_CANCEL, STOCK_SAVE, RESPONSE_OK) )
     fcd.set_modal(True)
     result = fcd.run()
     db_path = fcd.get_filename()
     fcd.destroy()
     if result == RESPONSE_OK and db_path != None:
         self.db_path_label.set_text(db_path)
         db_access_method = self.__get_db_access_method()
         self.__update_db_path(db_path, db_access_method)
         self.set_sensitivities()