Skip to content

Commit

Permalink
asking for confirmation before initializing policy
Browse files Browse the repository at this point in the history
  • Loading branch information
eugeni committed Sep 17, 2009
1 parent 98ae7de commit 887e4f6
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions gui/tomoyo-gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ def refresh_domains(self, lstore_all, lstore_active, reload=True):
dialog.destroy()
if ret == gtk.RESPONSE_YES:
# installing policy
self.install_policy()
self.install_policy(confirm=False)


lstore_all.clear()
Expand Down Expand Up @@ -457,8 +457,20 @@ def process_events(self):
while gtk.events_pending():
gtk.main_iteration(False)

def install_policy(self, widget=None):
def install_policy(self, widget=None, confirm=True):
"""Installs tomoyo policy"""
if confirm:
dialog = gtk.MessageDialog(
parent=self.window,
flags=0,
type=gtk.MESSAGE_ERROR,
message_format = _("Do you really want to initialize TOMOYO policy? This will remove all your settings and reset policy to default state!"),
buttons=gtk.BUTTONS_YES_NO)
dialog.show_all()
ret = dialog.run()
dialog.destroy()
if ret != gtk.RESPONSE_YES:
return
# progress bar
progress = gtk.Window()
progress.set_title(_("Please wait..."))
Expand Down

0 comments on commit 887e4f6

Please sign in to comment.