1
0
mirror of https://github.com/gryf/pygtktalog.git synced 2025-12-17 03:20:17 +01:00

Added on_quit method.

This commit is contained in:
2009-05-19 19:50:05 +00:00
parent b493b66ea8
commit f0f8d27d19

View File

@@ -5,8 +5,11 @@
Author: Roman 'gryf' Dobosz, gryf73@gmail.com
Created: 2009-05-02
"""
import gtk
from gtkmvc import Controller
from pygtktalog.dialogs import yesno, okcancel, info, warn, error
class MainController(Controller):
"""
@@ -26,3 +29,24 @@ class MainController(Controller):
progress bar/status bar adapters goes here
"""
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