Changeset 29715c255541ab3aa8d8f67699d73b3d998e4f3d

Show
Ignore:
Timestamp:
01/06/07 23:39:05 (6 years ago)
Author:
Philipp Kern <phil@…>
Parents:
51c5ddfd7bdcfb903514afe7b9a3d69c1092c508
Children:
8343ef5b25d88a8435bcc3c904c1653f928f3950
git-committer:
Philipp Kern <phil@0x539.de> / 2007-01-06T22:39:05Z+0000
Message:

[project @ Enable highlighting when subscribed]

Original author: Armin Burgmeier <armin@…>
Date: 2005-06-14 16:26:27+00:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/document.cpp

    ree9a068 r29715c2  
    6262                        buf->set_language(language); 
    6363        } 
    64  
    65         // Do not highlight anything until the user subscribed 
    66         buf->set_highlight(false); 
    6764#endif 
    6865 
     
    343340        // Get document we subscribed to 
    344341        obby::local_document& doc = *m_doc.get_document(); 
     342#ifdef WITH_GTKSOURCEVIEW 
     343        Glib::RefPtr<Gtk::SourceBuffer> buf = get_buffer(); 
     344#else 
    345345        Glib::RefPtr<Gtk::TextBuffer> buf = get_buffer(); 
     346#endif 
    346347 
    347348        // Install singal handlers 
     
    362363        set_editable(true); 
    363364        set_wrap_mode(Gtk::WRAP_NONE); 
     365 
     366        // Enable highlighting 
     367        buf->set_highlight(true); 
    364368 
    365369        // TODO: Do this in an idle handler? *kA* 
     
    588592void Gobby::Document::set_intro_text() 
    589593{ 
    590         get_buffer()->set_text(_( 
     594#ifdef WITH_GTKSOURCEVIEW 
     595        Glib::RefPtr<Gtk::SourceBuffer> buf = get_buffer(); 
     596#else 
     597        Glib::RefPtr<Gtk::TextBuffer> buf = get_buffer(); 
     598#endif 
     599 
     600        buf->set_text(_( 
    591601                "You are not subscribed to the document \"") + 
    592602                        m_doc.get_title() + _("\".\n\nTo view changes that " 
     
    597607 
    598608        Glib::RefPtr<Gtk::TextChildAnchor> anchor = 
    599                 get_buffer()->create_child_anchor(get_buffer()->end() ); 
     609                buf->create_child_anchor(buf->end() ); 
    600610 
    601611        // Activate the subscribe button, if it isn't 
    602612        m_btn_subscribe.set_sensitive(true); 
    603613 
     614        // Add the button to the anchor 
    604615        add_child_at_anchor(m_btn_subscribe, anchor); 
    605616 
     
    608619        set_editable(false); 
    609620        set_wrap_mode(Gtk::WRAP_WORD_CHAR); 
     621 
     622        // Do not highlight anything until the user subscribed 
     623        buf->set_highlight(false); 
    610624} 
    611625