Logo Search packages:      
Sourcecode: zim version File versions  Download package

def zim::gui::GtkInterface::do_open_notebook (   self,
  notebook 
)

Signal handler for open-notebook.

Reimplemented from zim::NotebookInterface.

Definition at line 595 of file __init__.py.

00595                                           :
            '''Signal handler for open-notebook.'''

            def move_away(o, path):
                  if self.page >= path:
                        self.open_page_back() \
                        or self.open_page_parent \
                        or self.open_page_home

            def follow(o, path, newpath, update_links):
                  if self.page == path:
                        self.open_page(newpath)
                  elif self.page > path:
                        newpath = newpath + self.page.relname(path)
                        newpath = Path(newpath.name) # IndexPath -> Path
                        self.open_page(newpath)

            def autosave(o, p):
                  page = self.mainwindow.pageview.get_page()
                  if page.modified:
                        self.save_page(page)

            NotebookInterface.do_open_notebook(self, notebook)
            self.history = History(notebook, self.uistate)
            self.on_notebook_properties_changed(notebook)
            notebook.connect('properties-changed', self.on_notebook_properties_changed)
            notebook.connect('delete-page', autosave) # before action
            notebook.connect('move-page', autosave) # before action
            notebook.connect_after('delete-page', move_away)
            notebook.connect_after('move-page', follow)

            # Start a lightweight background check of the index
            self.notebook.index.update(background=True, checkcontents=False)

            self.set_readonly(notebook.readonly)

      def check_notebook_needs_upgrade(self):


Generated by  Doxygen 1.6.0   Back to index