diff --git a/src/canvas.cpp b/src/canvas.cpp --- a/src/canvas.cpp +++ b/src/canvas.cpp @@ -554,8 +554,9 @@ Main::Main(QGraphicsScene& c, Mesh &m, Q tooltips_id = helpmenu->insertItem("Show Cell&Info", this, SLOT(Refresh())); helpmenu->setItemChecked(tooltips_id, true); helpmenu->insertSeparator(); - helpmenu->insertItem("&About", this, SLOT(help()) ); //, Key_F1); + helpmenu->insertSeparator(); + helpmenu->insertItem("&GPL", this, SLOT(gpl()) ); menu->insertItem("&Help",helpmenu); statusBar(); setCentralWidget(editor); @@ -941,6 +942,35 @@ void Main::help() about->show(); } + +#include +#include +#include +void Main::gpl() +{ + static QMessageBox* gpl = new QMessageBox ( "License", "", + QMessageBox::Information, 1, 0, 0, this, 0, FALSE ); + + std::ifstream t("../doc/GPL"); + std::string str; + + t.seekg(0, std::ios::end); + str.reserve(t.tellg()); + t.seekg(0, std::ios::beg); + + str.assign((std::istreambuf_iterator(t)), + std::istreambuf_iterator()); + gpl->setText(QString("

GNU GENERAL PUBLIC LICENSE

" + "

Version 2, June 1991

" + "

Copyright (C) 1989, 1991 Free Software Foundation, Inc. " + "59 Temple Place, Suite 330, Boston, MA 02111-1307 USA: " + "Everyone is permitted to copy and distribute verbatim copies " + "of this license document, but changing it is not allowed.

")); + gpl->setDetailedText(QString(str.c_str())); + gpl->setButtonText( 1, "Dismiss" ); + gpl->show(); +} + void Main::aboutQt(){ QMessageBox::aboutQt( this, "Virtual Leaf" ); }