// src/add_request_dialog.hh - Copyright 2005, 2006, University // of Padova, dept. of Pure and Applied // Mathematics // // This file is part of SGPEMv2. // // This is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // SGPEMv2 is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with SGPEMv2; if not, write to the Free Software // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #ifndef ADD_REQUEST_DIALOG_HH #define ADD_REQUEST_DIALOG_HH 1 namespace sgpem { class Request; class Thread; } #include "config.h" #include #include #include #include #include namespace sgpem { class AddRequestDialog : public Gtk::Dialog { public: AddRequestDialog(BaseObjectType* cobject, const Glib::RefPtr& glade); /** \brief Attemts to build a request by using the data supplied up to now. \note Must be called only after it has been shown at least one time with an OK, otherwise expect undefined behaviour! */ Request& construct_request(Thread& t); protected: virtual void on_show(); private: void _on_add(); void _on_remove(); void _on_list_selection_changed(); void _on_row_added(const Gtk::TreePath& path, const Gtk::TreeIter& it); void _on_row_removed(const Gtk::TreePath& path); void _on_combo_selection_changed(); Glib::RefPtr _glade; Gtk::TreeView* _list; Glib::RefPtr _list_model; Gtk::TreeModelColumnRecord _list_columns; Gtk::TreeModelColumn _list_key_column; Gtk::TreeModelColumn _list_resource_column; Gtk::TreeModelColumn _list_length_column; Gtk::Button* _add_button; Gtk::Button* _remove_button; Gtk::Button* _ok_button; Gtk::ComboBox* _resource_combo; Glib::RefPtr _combo_model; Gtk::TreeModelColumnRecord _combo_columns; Gtk::TreeModelColumn _combo_key_column; Gtk::TreeModelColumn _combo_resource_column; }; } //~ namespace sgpem #endif //~ ADD_REQUEST_DIALOG_HH