Beispiel #1
0
 def __init__(self, workspace, recently_opened_notebooks):
     self.sidebar = ServiceLocator.get_main_window().sidebar
     self.hbchooser = ServiceLocator.get_main_window(
     ).headerbar.hb_right.notebook_chooser
     self.kernelspecs = ServiceLocator.get_kernelspecs()
     self.workspace = workspace
     self.recently_opened_notebooks = recently_opened_notebooks
     self.recently_opened_notebooks.register_observer(self)
Beispiel #2
0
    def __init__(self, workspace, recently_opened_notebooks):
        self.sidebar = ServiceLocator.get_main_window().sidebar
        self.hbchooser = ServiceLocator.get_main_window(
        ).headerbar.hb_right.notebook_chooser
        self.workspace = workspace
        self.recently_opened_notebooks = recently_opened_notebooks

        for widget in [self.sidebar, self.hbchooser]:
            widget.recent_notebooks_list_view.set_sort_func(self.sort_func)
            widget.recent_notebooks_list_view.connect(
                'row-activated', self.on_recent_notebooks_list_click)

        self.recently_opened_notebooks.populate_from_disk()
    def __init__(self, workspace, sb_view, hb_view):
        self.sb_view = sb_view
        self.hb_view = hb_view
        self.sidebar = ServiceLocator.get_main_window().sidebar
        self.hbchooser = ServiceLocator.get_main_window().headerbar.hb_right.notebook_chooser
        self.main_window = ServiceLocator.get_main_window()
        self.workspace = workspace
        self.open_notebook_should_scroll = False
        self.open_notebook_hb_should_scroll = False

        self.sidebar.connect('size-allocate', self.on_open_notebook_view_size_allocate)
        self.hbchooser.connect('size-allocate', self.on_open_notebook_hb_view_size_allocate)
        self.sb_view.connect('row-selected', self.on_open_notebooks_list_selected)
        self.hb_view.connect('row-selected', self.on_open_notebooks_list_selected)
    def __init__(self, workspace, open_notebooks_list, sb_view, hb_view):
        self.workspace = workspace
        self.open_notebooks_list = open_notebooks_list
        self.main_window = ServiceLocator.get_main_window()

        self.sidebar = ServiceLocator.get_main_window().sidebar
        self.sb_view = sb_view
        self.sb_view.set_can_focus(False)
        self.sb_view.set_sort_func(self.sort_func)
        self.sidebar.open_notebooks_list_view_wrapper.add(self.sb_view)

        self.hbchooser = ServiceLocator.get_main_window().headerbar.hb_right.notebook_chooser
        self.hb_view = hb_view
        self.hb_view.set_can_focus(False)
        self.hb_view.set_sort_func(self.sort_func)
        self.hbchooser.open_notebooks_list_view_wrapper.add(self.hb_view)

        self.hbchooser.open_notebooks_list_view_wrapper.hide()
        self.workspace.register_observer(self)
        self.open_notebooks_list.register_observer(self)
Beispiel #5
0
    def __init__(self, workspace):
        Observable.__init__(self)
        self.workspace = workspace
        self.main_window = ServiceLocator.get_main_window()

        self.window_mode = None
        self.activate_welcome_page_mode()

        self.main_window.paned.set_position(self.workspace.sidebar_position)
        if self.workspace.show_sidebar:
            self.on_show_sidebar()
        else:
            self.on_hide_sidebar()

        self.workspace.register_observer(self)
Beispiel #6
0
    def __init__(self, workspace):
        self.workspace = workspace
        self.headerbar = ServiceLocator.get_main_window().headerbar
        self.kernelspecs = ServiceLocator.get_kernelspecs()

        self.window_mode = None
        self.activate_welcome_page_mode()
        self.setup_kernel_changer()

        if self.workspace.show_sidebar:
            self.on_show_sidebar()
        else:
            self.on_hide_sidebar()

        self.workspace.register_observer(self)
    def __init__(self, workspace):
        self.workspace = workspace
        self.main_window = ServiceLocator.get_main_window()
        self.settings = ServiceLocator.get_settings()

        self.main_window.toggle_sidebar_action.connect('activate', self.toggle_sidebar)
        self.main_window.preferences_action.connect('activate', self.show_preferences_dialog)
        self.main_window.show_about_dialog_action.connect('activate', self.show_about_dialog)
        self.main_window.show_shortcuts_window_action.connect('activate', self.show_shortcuts_window)
        self.main_window.sidebar.connect('size-allocate', self.on_sidebar_size_allocate)

        self.main_window.restart_kernel_action.connect('activate', self.on_restart_kernel_action)
        self.main_window.change_kernel_action.connect('activate', self.on_change_kernel_action)
        self.main_window.save_all_action.connect('activate', self.on_save_all_action)
        self.main_window.save_as_action.connect('activate', self.on_save_as_action)
        self.main_window.delete_action.connect('activate', self.on_delete_action)
        self.main_window.close_action.connect('activate', self.on_close_action)
        self.main_window.close_all_action.connect('activate', self.on_close_all_action)
        self.main_window.open_action.connect('activate', self.on_open_action)
        self.main_window.create_action.connect('activate', self.on_create_action)

        self.settings.register_observer(self)
Beispiel #8
0
    def __init__(self, workspace):
        self.main_window = ServiceLocator.get_main_window()
        self.workspace = workspace

        self.setup_shortcuts()