Example #1
0
    def delete_page(self, page_num, kill=True, prompt=0):
        if page_num >= self.get_n_pages() or page_num < 0:
            log.debug("Can not delete page %s no such index", page_num)
            return
        # TODO NOTEBOOK it would be nice if none of the "ui" stuff
        # (PromptQuitDialog) would be in here
        procs = self.get_running_fg_processes_count_page(page_num)
        if prompt == 2 or (prompt == 1 and procs > 0):
            # TODO NOTEBOOK remove call to guake
            if not PromptQuitDialog(self.guake.window, procs, -1).close_tab():
                return

        for terminal in self.get_terminals_for_page(page_num):
            if kill:
                terminal.kill()
            terminal.destroy()
Example #2
0
 def accel_quit(self, *args):
     """Callback to prompt the user whether to quit Guake or not.
     """
     procs = self.notebook.get_running_fg_processes_count()
     tabs = self.notebook.get_n_pages()
     prompt_cfg = self.settings.general.get_boolean('prompt-on-quit')
     prompt_tab_cfg = self.settings.general.get_int('prompt-on-close-tab')
     # "Prompt on tab close" config overrides "prompt on quit" config
     if prompt_cfg or (prompt_tab_cfg == 1 and procs > 0) or (prompt_tab_cfg
                                                              == 2):
         log.debug("Remaining procs=%r", procs)
         if PromptQuitDialog(self.window, procs, tabs).quit():
             log.info("Quitting Guake")
             Gtk.main_quit()
     else:
         log.info("Quitting Guake")
         Gtk.main_quit()