diff options
author | kintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c> | 2009-12-12 22:04:32 (GMT) |
---|---|---|
committer | kintel <kintel@b57f626f-c46c-0410-a088-ec61d464b74c> | 2009-12-12 22:04:32 (GMT) |
commit | 4564d9d4a2370bec2da0aca36e192c7d5da472d7 (patch) | |
tree | e3d7dfe8360a1009a4b6b8b3630419e4cceaefc9 | |
parent | 6e32acbe6591f967453ef09efed9d08642bff9db (diff) |
Added simple about box
git-svn-id: http://svn.clifford.at/openscad/trunk@165 b57f626f-c46c-0410-a088-ec61d464b74c
-rw-r--r-- | MainWindow.h | 1 | ||||
-rw-r--r-- | MainWindow.ui | 12 | ||||
-rw-r--r-- | mainwin.cc | 29 |
3 files changed, 35 insertions, 7 deletions
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 @@ <addaction name="viewActionPerspective"/> <addaction name="viewActionOrthogonal"/> </widget> + <widget class="QMenu" name="menuHelp"> + <property name="title"> + <string>Help</string> + </property> + <addaction name="helpActionAbout"/> + </widget> <addaction name="menu_File"/> <addaction name="menu_Edit"/> <addaction name="menu_Design"/> <addaction name="menu_View"/> + <addaction name="menuHelp"/> </widget> <widget class="QStatusBar" name="statusbar"/> <action name="fileActionNew"> @@ -540,6 +547,11 @@ <string>Orthogonal</string> </property> </action> + <action name="helpActionAbout"> + <property name="text"> + <string>About</string> + </property> + </action> </widget> <customwidgets> <customwidget> @@ -40,6 +40,7 @@ #include <QMimeData> #include <QUrl> #include <QTimer> +#include <QMessageBox> //for chdir #include <unistd.h> @@ -63,6 +64,15 @@ #endif +static char helptext[] = + "OpenSCAD (www.openscad.org)\n" + "Copyright (C) 2009 Clifford Wolf <clifford@clifford.at>\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> 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 <clifford@clifford.at>"); - 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); +} + |