示例#1
0
 def clear(self, widget = None):
     dialog = widgetPresenter.QuestionDialog(_('Are you sure you want '
                                               'to clear the project?'))
     response = dialog.run()
     if response == gtk.RESPONSE_YES:
         self.source_images_controler.clear()
     dialog.destroy()
示例#2
0
 def deleteCurrentPage(self, widget):
     delete_dialog = widgetPresenter.QuestionDialog(_('Are you sure you want to delete the current image?'))
     response = delete_dialog.run()
     if response == gtk.RESPONSE_YES:
         self.source_images_controler.deleteCurrentPage()
         self.source_images_icon_view.deleteCurrentSelection()
     delete_dialog.destroy()
示例#3
0
 def clear(self, widget=None):
     dialog = widgetPresenter.QuestionDialog(
         self.main_window,
         _('Are you sure you want '
           'to clear the project?'))
     response = dialog.run()
     if response == Gtk.ResponseType.YES:
         self.source_images_controler.clear()
     dialog.destroy()
示例#4
0
 def deleteCurrentPage(self, widget):
     delete_dialog = widgetPresenter.QuestionDialog(
         self.main_window,
         _('Are you sure you want to delete the current image?'))
     response = delete_dialog.run()
     if response == Gtk.ResponseType.YES:
         self.source_images_controler.deleteCurrentPage()
         self.pages_icon_view.deleteCurrentSelection()
     delete_dialog.destroy()
示例#5
0
 def quit(self, widget = None, data = None):
     if not self.project_name and not self.source_images_list_store.isEmpty():
         quit_dialog = widgetPresenter.QuestionDialog('<b>' + _("The project hasn't been saved.") + '</b>', gtk.BUTTONS_NONE)
         quit_dialog.format_secondary_text(_('Do you want to save it before closing?'))
         quit_dialog.add_buttons(_('Close anyway'), gtk.RESPONSE_NO, gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_SAVE_AS, gtk.RESPONSE_YES)
         response = quit_dialog.run()
         quit_dialog.destroy()
         if response == gtk.RESPONSE_YES:
             self.saveProjectAs()
             self.__main_quit()
         elif response == gtk.RESPONSE_NO:
             quit_dialog.destroy()
             self.__main_quit()
         else:
             return True
     else:
         self.__main_quit()
     return False
示例#6
0
 def quit(self, widget=None, data=None):
     if not self.project_name and not self.pages_icon_view.isEmpty():
         quit_dialog = widgetPresenter.QuestionDialog(
             self.main_window,
             '<b>' + _("The project hasn't been saved.") + '</b>',
             Gtk.ButtonsType.NONE)
         quit_dialog.format_secondary_text(
             _('Do you want to save it before closing?'))
         quit_dialog.add_buttons(_('Close anyway'), Gtk.ResponseType.NO,
                                 Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL,
                                 Gtk.STOCK_SAVE_AS, Gtk.ResponseType.YES)
         response = quit_dialog.run()
         quit_dialog.destroy()
         if response == Gtk.ResponseType.YES:
             self.saveProjectAs()
             self.__main_quit()
         elif response == Gtk.ResponseType.NO:
             quit_dialog.destroy()
             self.__main_quit()
         else:
             return True
     else:
         self.__main_quit()
     return False