mirror of
https://github.com/gryf/pygtktalog.git
synced 2025-12-17 11:30:19 +01:00
Added on_quit method.
This commit is contained in:
@@ -5,8 +5,11 @@
|
|||||||
Author: Roman 'gryf' Dobosz, gryf73@gmail.com
|
Author: Roman 'gryf' Dobosz, gryf73@gmail.com
|
||||||
Created: 2009-05-02
|
Created: 2009-05-02
|
||||||
"""
|
"""
|
||||||
|
import gtk
|
||||||
|
|
||||||
from gtkmvc import Controller
|
from gtkmvc import Controller
|
||||||
|
|
||||||
|
from pygtktalog.dialogs import yesno, okcancel, info, warn, error
|
||||||
|
|
||||||
class MainController(Controller):
|
class MainController(Controller):
|
||||||
"""
|
"""
|
||||||
@@ -26,3 +29,24 @@ class MainController(Controller):
|
|||||||
progress bar/status bar adapters goes here
|
progress bar/status bar adapters goes here
|
||||||
"""
|
"""
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
def on_quit_activate(self, widget):
|
||||||
|
"""Quit and save window parameters to config file"""
|
||||||
|
# check if any unsaved project is on go.
|
||||||
|
#if self.model.unsaved_project and \
|
||||||
|
#self.model.config.confd['confirmquit']:
|
||||||
|
# if not yesno.Qst(_("Quit application") + " - pyGTKtalog",
|
||||||
|
# _("Do you really want to quit?"),
|
||||||
|
# _("Current database is not saved, any changes "
|
||||||
|
# "will be lost.")).run():
|
||||||
|
# return
|
||||||
|
#self.__store_settings()
|
||||||
|
#self.model.cleanup()
|
||||||
|
msg1 = _("Do you really want to quit?")
|
||||||
|
msg2 = _("Current database is not saved, any changes will be lost.")
|
||||||
|
title = _("Quit application") + " - pyGTKtalog"
|
||||||
|
|
||||||
|
if yesno(msg1, msg2, title, 0):
|
||||||
|
gtk.main_quit()
|
||||||
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user