Ejemplo n.º 1
0
    def load_other_file(self, source):
        current_tab = self.window.get_active_tab()

        self.same_document[current_tab] = False

        self.split_views[current_tab].remove(
            self.split_views[current_tab].get_children()[1])

        new_document = Pluma.Document()  #.Pluma_document_new()
        new_document.load("file://" + source.replace(" ", "%20"),
                          self.encoding, 1, True)
        new_view = Pluma.View.new_with_buffer(
            new_document)  #.Pluma_view_new(new_document)

        new_document.connect("mark-set", self.update_line_column_data)

        new_document.save(0)

        self.alt_views[current_tab] = new_document

        sw = Gtk.ScrolledWindow()
        sw.add(new_view)

        self.split_views[current_tab].add2(sw)

        self.label_other_document.set_label(
            os.path.basename(source).replace("%20", " "))

        self.window.get_active_tab().show_all()
Ejemplo n.º 2
0
        def do_get_info_widget(self, proposal):
                if not self.info_widget:
                        view = Pluma.View.new_with_buffer(Pluma.Document())
                        manager = get_language_manager()

                        lang = manager.get_language('snippets')
                        view.get_buffer().set_language(lang)
                        
                        sw = Gtk.ScrolledWindow()
                        sw.add(view)
                        
                        self.info_view = view
                        self.info_widget = sw
                
                return self.info_widget