Changeset 9541de7ae0dda530e7389c81d49f038995f662f2

Show
Ignore:
Timestamp:
01/06/07 23:46:22 (6 years ago)
Author:
Philipp Kern <phil@…>
Parents:
fe536413af36297bc864a494c9f55f7cf7545560
Children:
5a6f44aa59c175c482fe4c59c764377531364996
git-committer:
Philipp Kern <phil@0x539.de> / 2007-01-06T22:46:22Z+0000
Message:

[project @ Allow to open documents as unowned text, thanks to Ben Levitt [fixes #52]]

Original author: Philipp Kern <phil@…>
Date: 2005-08-05 21:14:50+00:00

Files:
2 modified

Legend:

Unmodified
Added
Removed
  • inc/window.hpp

    r3d3692a r9541de7  
    106106        void apply_preferences(); 
    107107        void update_title_bar(const Document& doc); 
    108         void open_local_file(const Glib::ustring& file); 
     108        void open_local_file(const Glib::ustring& file, 
     109                             bool open_as_edited = 0); 
    109110        void save_local_file(Document& doc, const Glib::ustring& file); 
    110111        void close_document(DocWindow& doc); 
  • src/window.cpp

    rf121394 r9541de7  
    418418                dlg.set_current_folder(m_last_path); 
    419419 
     420        // Create open_as_edited toggle 
     421        Gtk::CheckButton open_as_edited_check_button( 
     422                _("Hilight documents to appear written by you") ); 
     423        dlg.get_vbox()->pack_start(open_as_edited_check_button, 
     424                Gtk::PACK_SHRINK); 
     425        open_as_edited_check_button.show(); 
     426 
    420427        // Create buttons to close it 
    421428        dlg.add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL); 
     
    435442                    iter != list.end(); 
    436443                    ++ iter) 
    437                         open_local_file(*iter); 
     444                        open_local_file(*iter, 
     445                                open_as_edited_check_button.get_active() ); 
    438446        } 
    439447} 
     
    823831} 
    824832 
    825 void Gobby::Window::open_local_file(const Glib::ustring& file) 
     833void Gobby::Window::open_local_file(const Glib::ustring& file, 
     834                                    bool open_as_edited) 
    826835{ 
    827836        try 
     
    834843                m_buffer->create_document( 
    835844                        Glib::path_get_basename(file), 
    836                         convert_to_utf8(Glib::file_get_contents(file)) 
     845                        convert_to_utf8(Glib::file_get_contents(file)), 
     846                        open_as_edited 
    837847                ); 
    838848        }