Subversion Repositories basico

Rev

Rev 385 | Rev 388 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 385 Rev 386
Line 358... Line 358...
358
        elif stack_name == 'editor':
358
        elif stack_name == 'editor':
359
            self.srvuif.set_widget_visibility('gtk_combobox_annotation_category', True)
359
            self.srvuif.set_widget_visibility('gtk_combobox_annotation_category', True)
360
            self.srvuif.set_widget_visibility('gtk_combobox_annotation_type', True)
360
            self.srvuif.set_widget_visibility('gtk_combobox_annotation_type', True)
361
            self.srvuif.set_widget_visibility('gtk_combobox_annotation_priority', True)
361
            self.srvuif.set_widget_visibility('gtk_combobox_annotation_priority', True)
362
            self.srvuif.set_widget_visibility('gtk_button_annotation_toolbar_attachment', True)
362
            self.srvuif.set_widget_visibility('gtk_button_annotation_toolbar_attachment', True)
-
 
363
        self.log.debug("Set visible stack: %s", stack_name)
363
364
364
365
365
    def annotation_preview(self):
366
    def annotation_preview(self):
366
        browser = self.srvgui.add_widget('annotation_browser', BasicoBrowser(self.app))
367
        browser = self.srvgui.add_widget('annotation_browser', BasicoBrowser(self.app))
367
        return browser
368
        return browser
Line 398... Line 399...
398
        a_title.modify_font(Pango.FontDescription('Monospace 10'))
399
        a_title.modify_font(Pango.FontDescription('Monospace 10'))
399
        vboxl.pack_start(a_title, False, False, 0)
400
        vboxl.pack_start(a_title, False, False, 0)
400
401
401
        # Text
402
        # Text
402
        scroller = Gtk.ScrolledWindow()
403
        scroller = Gtk.ScrolledWindow()
403
        scroller.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC)
-
 
-
 
404
        scroller.set_policy(Gtk.PolicyType.ALWAYS, Gtk.PolicyType.ALWAYS)
404
        scroller.set_shadow_type(Gtk.ShadowType.IN)
405
        scroller.set_shadow_type(Gtk.ShadowType.IN)
405
        scroller.set_hexpand(True)
406
        scroller.set_hexpand(True)
406
        scroller.set_vexpand(True)
407
        scroller.set_vexpand(True)
407
        a_text = self.srvgui.add_widget('gtk_textview_annotation_text', GtkSource.View.new_with_buffer(GtkSource.Buffer()))
408
        a_text = self.srvgui.add_widget('gtk_textview_annotation_text', GtkSource.View.new_with_buffer(GtkSource.Buffer()))
408
        a_text.set_wrap_mode(Gtk.WrapMode.WORD)
409
        a_text.set_wrap_mode(Gtk.WrapMode.WORD)
Line 586... Line 587...
586
        return annotation
587
        return annotation
587
588
588
589
589
    def stack_changed(self, stack, gparam):
590
    def stack_changed(self, stack, gparam):
590
        visible_stack_name = stack.get_visible_child_name()
591
        visible_stack_name = stack.get_visible_child_name()
591
        if visible_stack_name == 'preview':
-
 
592
            try:
-
 
593
                self.preview()
-
 
594
            except:
-
 
595
                pass
-
 
-
 
592
        self.set_visible_stack(visible_stack_name)
596
593
597
594
598
    def preview(self):
595
    def preview(self):
599
        aid = self.get_aid_from_widget()
596
        aid = self.get_aid_from_widget()
-
 
597
        if len(aid) == 0:
-
 
598
            return
-
 
599
600
        atype = self.srvant.get_metadata_value(aid, 'Type')
600
        atype = self.srvant.get_metadata_value(aid, 'Type')
601
        browser = self.srvgui.get_widget('annotation_browser')
601
        browser = self.srvgui.get_widget('annotation_browser')
602
        # ~ self.log.debug("Execute asciidoc for current annotation: %s", self.sid)
602
        # ~ self.log.debug("Execute asciidoc for current annotation: %s", self.sid)
603
        try:
603
        try:
604
            if atype == 'Bookmark':
604
            if atype == 'Bookmark':