Commit 799f2447 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[ADD] - added basic edit dialogs for the whie and black list

parent c860dddd
......@@ -44,6 +44,7 @@
#include <QtGui/QVBoxLayout>
#include <QtGui/QWidget>
#include <QtCore/QSettings>
#include <QtGui/QInputDialog>
#include "core/common/WColor.h"
#include "core/common/WIOTools.h"
......@@ -1083,13 +1084,41 @@ void WMainWindow::handleLogLevelUpdate( unsigned int logLevel )
void WMainWindow::configureBlackList()
{
// WQt4Gui::getSettings().setValue( "qt4gui/modules/whiteList", QString() );
// TODO(ebaum): implement me
bool ok;
QString currentList = WQt4Gui::getSettings().value( "qt4gui/modules/blackList", "" ).toString();
QString nexList = QInputDialog::getText( this, "Edit Blacklist",
"<b>Blacklist</b> - exclude modules from all the module lists in OpenWalnut. <br> This can be useful to exclude modules explicitly, "
"which are not needed."
"<ul>"
"<li> Comma-separated"
"<li> Regular expressions allowed"
"</ul>"
, QLineEdit::Normal, currentList, &ok );
if ( ok )
{
WQt4Gui::getSettings().setValue( "qt4gui/modules/blackList", nexList );
emit blackListChanged();
}
}
void WMainWindow::configureWhiteList()
{
// WQt4Gui::getSettings().setValue( "qt4gui/modules/blackList", QString() );
// TODO(ebaum): implement me
bool ok;
QString currentList = WQt4Gui::getSettings().value( "qt4gui/modules/whiteList", "" ).toString();
QString nexList = QInputDialog::getText( this, "Edit Whitelist",
"<b>Whitelist</b> - exclude modules from all the module lists in OpenWalnut, which are not listed here. <br>"
"This can be useful to exclude modules implicitly by only listing modules which are needed."
"<ul>"
"<li> Comma-separated"
"<li> Regular expressions allowed"
"</ul>"
, QLineEdit::Normal, currentList, &ok );
if ( ok )
{
WQt4Gui::getSettings().setValue( "qt4gui/modules/whiteList", nexList );
emit whiteListChanged();
}
}
......@@ -139,6 +139,18 @@ public:
* \return settings object.
*/
static QSettings& getSettings();
signals:
/**
* Signal, which is emitted if the module whitelist has changed.
*/
void whiteListChanged();
/**
* Signal, which is emitted if the module blacklist has changed.
*/
void blackListChanged();
protected:
/**
......
......@@ -170,6 +170,10 @@ WQtControlPanel::~WQtControlPanel()
void WQtControlPanel::connectSlots()
{
// if the user changes some white/blacklist setting: update.
connect( m_mainWindow, SIGNAL( whiteListChanged() ), this, SLOT( selectTreeItem() ) );
connect( m_mainWindow, SIGNAL( blackListChanged() ), this, SLOT( selectTreeItem() ) );
connect( m_moduleTreeWidget, SIGNAL( itemSelectionChanged() ), this, SLOT( selectTreeItem() ) );
connect( m_moduleTreeWidget, SIGNAL( itemClicked( QTreeWidgetItem*, int ) ), this, SLOT( changeTreeItem( QTreeWidgetItem*, int ) ) );
connect( m_moduleTreeWidget, SIGNAL( itemClicked( QTreeWidgetItem*, int ) ), m_roiTreeWidget, SLOT( clearSelection() ) );
......
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