Commit 516ba0eb authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[REMOVE] - removed config dialog for several reasons. It used an deprecated...

[REMOVE] - removed config dialog for several reasons. It used an deprecated API and nobody fixed it. It was quite unmaintainable regarding new options. We simply need something simple. Most of our config options are simply not useful for average users. By the way, advanced users might probably be able to use a text editor too as long as we do not have a dialog.
parent 465cca54
......@@ -12,7 +12,6 @@ SET( QT_LIBS ${QT_QTCORE_LIBRARY}
# add here all classes that inherit from QObject
SET(GUI_QT4_MOC_HDRS
WMainWindow.h
WQtConfigWidget.h
WQtNavGLWidget.h
WQtGLWidget.h
WQtCombinerToolbar.h
......
This diff is collapsed.
//---------------------------------------------------------------------------
//
// Project: OpenWalnut ( http://www.openwalnut.org )
//
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
// For more information see http://www.openwalnut.org/copying
//
// This file is part of OpenWalnut.
//
// OpenWalnut is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenWalnut 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 Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
//
//---------------------------------------------------------------------------
#ifndef WCFGOPERATIONS_H
#define WCFGOPERATIONS_H
#include <string>
#include <vector>
#include "../../common/WProperties.h"
/**
* static class that provides string and file operation functions
* to operate on a config file
*/
class WCfgOperations
{
public:
/**
* read the whole plain text from a text file
*
* \param fileName filename
*
* \result line vector of the text file
*/
static std::vector< std::string > readCfg( const std::string fileName );
/**
* write the plain line text to a file
*
* \param fileName filename
* \param lines line vector
*/
static void writeCfg( const std::string fileName, const std::vector< std::string > lines );
/**
* determine if a line is a comment
*
* \param line line
*
* \result is a comment
*/
static bool isComment( const std::string line );
/**
* determine if a line is an assignment
*
* \param line line
*
* \result is an assignment
*/
static bool isAssignment( const std::string line );
/**
* remove a comment from a line
*
* \param line line
*
* \result line without the comment
*/
static std::string removeComment( const std::string line );
/**
* parses a line with an assignment and returns the components
*
* \param line line
* \param left pointer to left part of the assignment
* \param right pointer to right part of the assignment
*/
static void getAssignementComponents( const std::string line, std::string *left, std::string *right );
/**
* determine if the line is a comment and in the comment is an assignment
*
* \param line line
*
* \result is a commented assignment
*/
static bool isCommentedAssignment( const std::string line );
/**
* determine if a line is a section
*
* \param line line
*
* \result is line a section
*/
static bool isSection( const std::string line );
/**
* get the section name of a line
*
* \param line line
*
* \result section name
*/
static std::string getSectionName( const std::string line );
/**
* return the line as uncommented
*
* \param line line
*
* \result line with first comment signs removed
*/
static std::string uncommentLine( const std::string line );
/**
* determine if a string is a bool var ("yes", "no")
*
* \param line line
*
* \result is bool var
*/
static bool isBool( const std::string line );
/**
* get the bool value of the line
*
* \param line line
*
* \result bool value
*/
static bool getAsBool( const std::string line );
/**
* determine if a line an int
*
* \param line line
*
* \result is int
*/
static bool isInt( const std::string line );
/**
* get a line as an int
*
* \param line line
*
* \result as int
*/
static int getAsInt( const std::string line );
/**
* determine if a line is a double
*
* \param line line
*
* \result is double
*/
static bool isDouble( const std::string line );
/**
* get a line as a double
*
* \param line line
*
* \result as double
*/
static double getAsDouble( const std::string line );
/**
* determine if a line is a string ( beginning and ending with a quote )
*
* \param line line
* \param useColon consider a colon at the beginning and end of the string
*
* \result is string
*/
static bool isString( const std::string line, bool useColon = false );
/**
* get the line as a string
*
* \param line line
* \param useColon consider a colon at the beginning and end of the string
*
* \result as string
*/
static std::string getAsString( const std::string line, bool useColon = false );
/**
* convert a property value to a string
* \note so far only functional with the types bool, int, double and string
* others will return an empty string
* doubles are capped to 2 digits after the dot and all zeros after the dot except the
* one behind the dot are removed, also if there's a '0' before the dot it's removed
* to have a consistent writing in the config file
*
* \param prop property variable
* \param useColon consider a colon at the beginning and end of the string
*
* \result property variable as string
*/
static std::string getPropValAsString( boost::shared_ptr< WProperties > prop, bool useColon = false );
private:
};
#endif // WCFGOPERATIONS_H
......@@ -42,6 +42,7 @@
#include <QtGui/QVBoxLayout>
#include <QtGui/QWidget>
#include <QtCore/QSettings>
#include <QtGui/QMessageBox>
#include "../../common/WColor.h"
#include "../../common/WPreferences.h"
......@@ -70,7 +71,6 @@
#include "events/WOpenCustomDockWidgetEvent.h"
#include "guiElements/WQtPropertyBoolAction.h"
#include "WQtCombinerToolbar.h"
#include "WQtConfigWidget.h"
#include "WQtCustomDockWidget.h"
#include "WQtNavGLWidget.h"
......@@ -1019,14 +1019,12 @@ void WMainWindow::newRoi()
void WMainWindow::openConfigDialog()
{
if( m_configWidget.get() )
{
m_configWidget->wait( true );
}
m_configWidget = boost::shared_ptr< WQtConfigWidget >( new WQtConfigWidget );
m_configWidget->initAndShow();
// TODO(all): we need a nice dialog box here.
QString msg = "OpenWalnut allows you to configure several features. Most of these options are only useful to advanced users. "
"You can have a user-scope configuration in your HOME as \".walnut.cfg\". "
"If this file exists, OpenWalnut loads this file. You can also specify a \"walnut.cfg\" in your OpenWalnut directory under "
"\"share/OpenWalnut/\". The file is very well documented.";
QMessageBox::information( this, "OpenWalnut - Configuration", msg );
}
void WMainWindow::restoreSavedState()
......
......@@ -46,7 +46,6 @@ class QMenuBar;
class WModule;
class WProjectFileIO;
class WQtCombinerToolbar;
class WQtConfigWidget;
class WQtControlPanel;
class WQtCustomDockWidget;
class WQtNavGLWidget;
......@@ -305,11 +304,6 @@ private:
boost::shared_ptr< WQtNavGLWidget > m_navSagittal; //!< the sgittal view widget GL widget of the GUI
QDockWidget* m_dummyWidget; //!< The dummywidget serves as spacer in the dockwidget area;
/**
* shared pointer for the configuration widget
*/
boost::shared_ptr< WQtConfigWidget > m_configWidget;
/**
* All registered WQtCustomDockWidgets.
*/
......
This diff is collapsed.
This diff is collapsed.
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