From 4564d9d4a2370bec2da0aca36e192c7d5da472d7 Mon Sep 17 00:00:00 2001 From: kintel Date: Sat, 12 Dec 2009 22:04:32 +0000 Subject: Added simple about box git-svn-id: http://svn.clifford.at/openscad/trunk@165 b57f626f-c46c-0410-a088-ec61d464b74c diff --git a/MainWindow.h b/MainWindow.h index f89809a..1019780 100644 --- a/MainWindow.h +++ b/MainWindow.h @@ -111,6 +111,7 @@ public slots: void animateUpdate(); void dragEnterEvent(QDragEnterEvent *event); void dropEvent(QDropEvent *event); + void helpAbout(); }; #endif diff --git a/MainWindow.ui b/MainWindow.ui index 5ba3c75..962dee6 100644 --- a/MainWindow.ui +++ b/MainWindow.ui @@ -174,10 +174,17 @@ + + + Help + + + + @@ -540,6 +547,11 @@ Orthogonal + + + About + + diff --git a/mainwin.cc b/mainwin.cc index 4fdc001..9bd6889 100644 --- a/mainwin.cc +++ b/mainwin.cc @@ -40,6 +40,7 @@ #include #include #include +#include //for chdir #include @@ -63,6 +64,15 @@ #endif +static char helptext[] = + "OpenSCAD (www.openscad.org)\n" + "Copyright (C) 2009 Clifford Wolf \n" + "\n" + "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."; + QPointer MainWindow::current_win = NULL; MainWindow::MainWindow(const char *filename) @@ -191,16 +201,14 @@ MainWindow::MainWindow(const char *filename) // viewActionCGALGrid = menu->addAction("CGAL Grid Only", this, SLOT(viewModeCGALGrid()), QKeySequence(Qt::Key_F11)); // #endif + // Help menu + connect(this->helpActionAbout, SIGNAL(triggered()), this, SLOT(helpAbout())); + + console->setReadOnly(true); current_win = this; - PRINT("OpenSCAD (www.openscad.at)"); - PRINT("Copyright (C) 2009 Clifford Wolf "); - PRINT(""); - PRINT("This program is free software; you can redistribute it and/or modify"); - PRINT("it under the terms of the GNU General Public License as published by"); - PRINT("the Free Software Foundation; either version 2 of the License, or"); - PRINT("(at your option) any later version."); + PRINT(helptext); PRINT(""); editor->setTabStopWidth(30); @@ -1322,3 +1330,10 @@ void MainWindow::dropEvent(QDropEvent *event) current_win = NULL; } +void +MainWindow::helpAbout() +{ + qApp->setWindowIcon(QApplication::windowIcon()); + QMessageBox::information(this, "About OpenSCAD", helptext); +} + -- cgit v0.10.1