Commit af722891 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[ADD] - we now have a welcome message for each new release

parent cc718913
<h1>Welcome to OpenWalnut %OW_LIB_VERSION%!</h1>
<a href="http://www.openwalnut.org/projects/openwalnut/wiki/ReleaseNotes">Release Notes</a>
<br>
<br>
Hello User! New to OpenWalnut? Have a look at <a href="http://www.openwalnut.org">http://www.openwalnut.org</a>!
We provide
<ul>
<li> user-/video documentation
<li> programming tutorials
<li> and the newest information
</ul>
Do you have problems using OpenWalnut? Do not hesitate to ask:
<ul>
<li><a href="mailto:openwalnut@lists.informatik.uni-leipzig.de">Mailing List</a>
<li>IRC Chat on irc.freenode.net in #ow
</ul>
Found a Bug? Do you have ideas for improvement? Please <a href="http://www.openwalnut.org/projects/openwalnut/wiki/Contribute">report</a> these issues! We can improve OpenWalnut only with your help and ideas.
<br><br>
<i>Thank you for using OpenWalnut!</i>
......@@ -28,6 +28,7 @@
#include <vector>
#include <boost/thread.hpp>
#include <boost/regex.hpp>
#include <QtGui/QApplication>
#include <QtGui/QCloseEvent>
......@@ -49,6 +50,8 @@
#include <QtWebKit/QWebView>
#endif
#include "WVersion.h" // NOTE: this file is auto-generated by CMAKE
#include "../icons/WIcons.xpm"
#include "controlPanel/WPropertyBoolWidget.h"
#include "controlPanel/WQtControlPanel.h"
......@@ -225,6 +228,9 @@ void WMainWindow::setupGUI()
m_glDock->addDockWidget( Qt::RightDockWidgetArea, mainGLDock );
connect( m_mainGLWidget.get(), SIGNAL( renderedFirstFrame() ), this, SLOT( handleGLVendor() ) );
// NOTE: we abuse the gl widgets first frame event to handle startup news.
connect( m_mainGLWidget.get(), SIGNAL( renderedFirstFrame() ), this, SLOT( handleStartMessages() ) );
m_permanentToolBar = new WQtToolBar( "Standard Toolbar", this );
addToolBar( Qt::TopToolBarArea, m_permanentToolBar );
......@@ -1020,10 +1026,32 @@ void WMainWindow::handleGLVendor()
"aware that Mesa can freeze OpenWalnut. Ensure you have the latest version of Mesa installed to avoid problems.";
QLabel* l = new QLabel( msg );
l->setWordWrap( true );
l->setGeometry( 0, 0, 400, 200 );
l->setMinimumWidth( 400 );
l->setMinimumWidth( 640 );
WQtMessageDialog* msgDia = new WQtMessageDialog( "MesaWarning", "Mesa Warning", l, getSettings(), this );
msgDia->show();
}
}
void WMainWindow::handleStartMessages()
{
// Load welcome file
std::string filename( WPathHelper::getDocPath().file_string() + "/openwalnut-qt4/OpenWalnutWelcome.html" );
std::string content = readFileIntoString( filename );
// gen ID for it using version (allows showing release/welcome message for each new release)
QString msgID = "OpenWalnutWelcome" + QString( W_LIB_VERSION );
// replace OW_VERSION
boost::regex reg1( "%OW_LIB_VERSION%" );
boost::regex reg2( "%OW_VERSION%" );
content = boost::regex_replace( content, reg1, std::string( W_LIB_VERSION ) );
content = boost::regex_replace( content, reg2, std::string( W_VERSION ) );
QLabel* l = new QLabel( QString::fromStdString( content ) );
l->setWordWrap( true );
l->setMinimumWidth( 640 );
WQtMessageDialog* msgDia = new WQtMessageDialog( msgID, "Welcome to OpenWalnut", l, getSettings(), this );
msgDia->show();
}
......@@ -166,7 +166,7 @@ protected:
*
* \param e the close event.
*/
void closeEvent( QCloseEvent* e );
virtual void closeEvent( QCloseEvent* e );
/**
* Handle custom events.
......@@ -356,6 +356,11 @@ private slots:
* Handles some special GL vendors and shows the user a dialog.
*/
void handleGLVendor();
/**
* Shows startup info messages
*/
void handleStartMessages();
};
#endif // WMAINWINDOW_H
......@@ -29,4 +29,4 @@
INCLUDE( BuildUtils.cmake )
GET_VERSION_STRING( OW_VERSION OW_API_VERSION )
FILE( WRITE ${HEADER_FILENAME} "// generated by CMake. Do not modify.\n#define W_VERSION \"${OW_VERSION}\"\n" )
FILE( WRITE ${HEADER_FILENAME} "// generated by CMake. Do not modify.\n#define W_VERSION \"${OW_VERSION}\"\n#define W_LIB_VERSION \"${OW_API_VERSION}\"\n" )
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment