// This program 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.

// This program 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 this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 

// Copyright 2003 Liam Girdwood  


#include "config.h"
#include "todo_dialog.hh"
#include <gdk/gdkkeysyms.h>
#include <gtkmm/accelgroup.h>
#include <gtkmm/button.h>
#include <gtkmm/buttonbox.h>
#include <gtkmm/label.h>
#include <gtkmm/box.h>
#include <libgnomeuimm/href.h>

namespace GUI
{

/*! \fn TodoDialog::TodoDialog()
* 
* Constructor. Create Todo Dialog
*/
TodoDialog::TodoDialog()
{  
	// create todo widgets
	Gtk::Button *todo_okbutton = Gtk::manage(new Gtk::Button(Gtk::StockID("gtk-ok")));
	Gtk::Label *todo_help_label = Gtk::manage(new Gtk::Label("Sorry, This feature has not been implemented\n"
	"in Nova yet. You can find out more by visiting\n"
	"the Nova homepage."));
	Gnome::UI::HRef *nova_href = Gtk::manage(new Gnome::UI::HRef("http://gnova.org", "Nova I.O.E Homepage"));
	Gtk::Label *email_label = Gtk::manage(new Gtk::Label("If you would like to help in the implementation\n"
	"of this feature, then please contact me at:"));
	Gnome::UI::HRef *email_href = Gtk::manage(new Gnome::UI::HRef("mailto:liam@gnova.org","liam@gnova.org"));
	Gtk::VBox *todo_vbox = Gtk::manage(new Gtk::VBox(false, 0));
	
	// build dialog
	todo_okbutton->set_flags(Gtk::CAN_FOCUS);
	todo_okbutton->set_relief(Gtk::RELIEF_NORMAL);
	
	get_action_area()->property_layout_style().set_value(Gtk::BUTTONBOX_END);
	get_action_area()->pack_start(*todo_okbutton);
	
	todo_help_label->set_alignment(0.5,0.5);
	todo_help_label->set_padding(0,0);
	todo_help_label->set_justify(Gtk::JUSTIFY_LEFT);
	todo_help_label->set_line_wrap(false);
	todo_help_label->set_use_markup(false);
	
	nova_href->set_flags(Gtk::CAN_FOCUS);
	
	email_label->set_alignment(0.5,0.5);
	email_label->set_padding(0,0);
	email_label->set_justify(Gtk::JUSTIFY_LEFT);
	email_label->set_line_wrap(false);
	email_label->set_use_markup(false);
	
	email_href->set_flags(Gtk::CAN_FOCUS);
	
	todo_vbox->pack_start(*todo_help_label);
	todo_vbox->pack_start(*nova_href, Gtk::PACK_SHRINK, 0);
	todo_vbox->pack_start(*email_label);
	todo_vbox->pack_start(*email_href, Gtk::PACK_SHRINK, 0);
	
	// dialog properties
	get_vbox()->set_homogeneous(false);
	get_vbox()->set_spacing(0);
	get_vbox()->pack_start(*todo_vbox);
	set_border_width(10);
	set_title("Sorry, this hasn't been implemented.");
	set_modal(true);
	property_window_position().set_value(Gtk::WIN_POS_NONE);
	set_resizable(true);
	show_all();
	
	// connect signal handler
	todo_okbutton->signal_clicked().connect(SigC::slot(*this, &TodoDialog::on_todo_okbutton_clicked));
}

/*! \fn TodoDialog::~TodoDialog()
*
* Destructor
*/
TodoDialog::~TodoDialog()
{ 
}

/*! \fn void TodoDialog::on_todo_okbutton_clicked()
*
* OK button has been clicked, so destroy dialog
*/
void TodoDialog::on_todo_okbutton_clicked()
{  
	hide();
	response(Gtk::RESPONSE_OK); //stops run().
}

/*! \fn void TodoDialog::display (void)
*
* Display dialog
*/
void TodoDialog::display (void)
{
	TodoDialog * dialog = new TodoDialog ();
	dialog->set_modal(true);
	dialog->run();
	delete dialog;
}

}


syntax highlighted by Code2HTML, v. 0.9.1