1 // -*- Mode: C++ ; indent-tabs-mode: t -*-
2 /* This file is part of Patchage.
3 * Copyright (C) 2008 Nedko Arnaudov <nedko@arnaudov.name>
5 * Patchage is free software; you can redistribute it and/or modify it under the
6 * terms of the GNU General Public License as published by the Free Software
7 * Foundation; either version 2 of the License, or (at your option) any later
10 * Patchage is distributed in the hope that it will be useful, but WITHOUT ANY
11 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for details.
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 #include <libglademm/xml.h>
23 #include "project.hpp"
24 #include "project_properties.hpp"
26 #include "globals.hpp"
28 struct project_properties_dialog_impl
30 Widget
<Gtk::Dialog
> _dialog
;
31 Widget
<Gtk::Entry
> _name
;
32 Widget
<Gtk::Entry
> _description
;
33 Widget
<Gtk::TextView
> _notes
;
35 project_properties_dialog_impl();
38 project_properties_dialog::project_properties_dialog()
40 _impl_ptr
= new project_properties_dialog_impl
;
44 project_properties_dialog::~project_properties_dialog()
50 project_properties_dialog::run(
51 shared_ptr
<project
> project_ptr
)
56 Glib::RefPtr
<Gtk::TextBuffer
> buffer
;
59 project_ptr
->get_name(name
);
60 _impl_ptr
->_name
->set_text(name
);
62 project_ptr
->get_description(description
);
63 _impl_ptr
->_description
->set_text(description
);
65 project_ptr
->get_notes(notes
);
66 buffer
= _impl_ptr
->_notes
->get_buffer();
67 buffer
->set_text(notes
);
69 result
= _impl_ptr
->_dialog
->run();
72 project_ptr
->do_change_description(_impl_ptr
->_description
->get_text());
73 project_ptr
->do_change_notes(buffer
->get_text());
74 project_ptr
->do_rename(_impl_ptr
->_name
->get_text());
77 _impl_ptr
->_dialog
->hide();
80 project_properties_dialog_impl::project_properties_dialog_impl()
82 _dialog
.init(g_xml
, "project_properties_dialog");
83 _name
.init(g_xml
, "project_name");
84 _description
.init(g_xml
, "project_description");
85 _notes
.init(g_xml
, "project_notes");