Changeset 654b4976de6e507f77fdc8c3d46df0be62f72890

Show
Ignore:
Timestamp:
01/06/07 23:31:52 (6 years ago)
Author:
Philipp Kern <phil@…>
Parents:
d0023f642e7bb92e0db9d191d41d41ee7e252e34
Children:
3edaafe4051a0101b29a54b073c06b46e9e71e89
git-committer:
Philipp Kern <phil@0x539.de> / 2007-01-06T22:31:52Z+0000
Message:

[project @ Save document was missing in the source]

Original author: Philipp Kern <phil@…>
Date: 2005-04-18 19:21:37+00:00

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/window.cpp

    r36e69e2 r654b497  
    1818 
    1919#include <stdexcept> 
     20#include <fstream> 
     21#include <ostream> 
    2022#include <gtkmm/main.h> 
    2123#include <gtkmm/aboutdialog.h> 
     
    297299void Gobby::Window::on_document_save() 
    298300{ 
     301        Widget* page = m_folder.get_nth_page(m_folder.get_current_page() ); 
     302        obby::document& doc = static_cast<Document*>(page)->get_document(); 
     303 
    299304        Gtk::FileChooserDialog dlg(*this, "Save current document", 
    300305                        Gtk::FILE_CHOOSER_ACTION_SAVE); 
     
    304309        if(dlg.run() == Gtk::RESPONSE_OK) 
    305310        { 
     311                std::ofstream stream(dlg.get_filename().c_str() ); 
     312                stream << doc.get_whole_buffer() << std::endl; 
    306313        } 
    307314}