Пример #1
0
TE_Main::TE_Main(QWidget* parent, const char* name) :
	TAAWidget(parent)
{
	setCaption( "Targeted Email" );

    // Create our widgets.
    theTabBar = new QTabBar(this);

    // Create the tabs for the tab bar.
    theTabBar->addTab("Message");
    theTabBar->addTab("Login Types");
    theTabBar->addTab("Cities");

    qws = new Q3WidgetStack(this, "widgetStack");
    
    // Create the actual tabs now, using the widget stack as the parent.
    tmessage = new TE_Message(qws);
    qws->addWidget(tmessage, 0);
    
    tlogins = new TE_LoginTypes(qws);
    qws->addWidget(tlogins, 1);
    
    tcities = new TE_Cities(qws);
    qws->addWidget(tcities, 2);

    // Buttons now.
    QPushButton *sendButton = new QPushButton(this, "sendButton");
    sendButton->setText("&Send");
    connect(sendButton, SIGNAL(clicked()), this, SLOT(sendMessage()));

    QPushButton *cancelButton = new QPushButton(this, "cancelButton");
    cancelButton->setText("&Cancel");
    connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked()));

    // Create our layout.
    Q3BoxLayout *ml = new Q3BoxLayout(this, Q3BoxLayout::TopToBottom, 3);
    ml->addWidget(theTabBar, 0);
    ml->addWidget(qws, 1);

    Q3BoxLayout *bl = new Q3BoxLayout(Q3BoxLayout::LeftToRight, 3);
    bl->addStretch(1);
    bl->addWidget(sendButton, 0);
    bl->addWidget(cancelButton, 0);

    ml->addLayout(bl, 0);
    
    connect(theTabBar, SIGNAL(selected(int)), qws, SLOT(raiseWidget(int)));

    // Create our Ctrl-1 through Ctrl-3 hotkeys
    Q3Accel  *ac = new Q3Accel(this);
    ac->insertItem(Qt::CTRL+Qt::Key_1, 0);
    ac->insertItem(Qt::CTRL+Qt::Key_2, 1);
    ac->insertItem(Qt::CTRL+Qt::Key_3, 2);
    connect(ac, SIGNAL(activated(int)), this, SLOT(raiseTab(int)));
}
Пример #2
0
//BEGIN class PinMapEditor
PinMapEditor::PinMapEditor( PinMapping * pinMapping, MicroInfo * picInfo, QWidget * parent, const char * name )
	: //KDialog( parent, name, true, i18n("Pin Map Editor"), Ok|Apply|Cancel, KDialog::Ok, true )
	  KDialog( parent ) //, name, true, i18n("Pin Map Editor"), Ok|Apply|Cancel, KDialog::Ok, true )
{
    setName(name);
    setModal(true);
    setCaption(i18n("Pin Map Editor"));
    setButtons(KDialog::Ok | KDialog::Apply | KDialog::Cancel);
    setDefaultButton(KDialog::Ok);
    showButtonSeparator(true);

	m_pPinMapping = pinMapping;
	
	m_pPinMapDocument = new PinMapDocument();
	
	Q3Accel * accel = new Q3Accel( this );
	accel->connectItem( accel->insertItem( Qt::Key_Delete ),
						m_pPinMapDocument,
						SLOT(deleteSelection()) );
	
	accel->connectItem( accel->insertItem( KStandardShortcut::selectAll().primary() ),
						m_pPinMapDocument,
						SLOT(selectAll()) );
	
	accel->connectItem( accel->insertItem( KStandardShortcut::undo().primary() ),
						m_pPinMapDocument,
						SLOT(undo()) );
	
	accel->connectItem( accel->insertItem( KStandardShortcut::redo().primary() ),
						m_pPinMapDocument,
						SLOT(redo()) );
	
	
	QFrame * f = new QFrame(this);
	f->setMinimumWidth( 480 );
	f->setMinimumHeight( 480 );
	
	f->setFrameShape( QFrame::Box );
	f->setFrameShadow( QFrame::Plain );
	QVBoxLayout * fLayout = new QVBoxLayout( f, 1, 0, "fLayout" );

	ViewContainer * vc = new ViewContainer( 0, f );
	fLayout->addWidget( vc );
	
	m_pPinMapView = static_cast<PinMapView*>(m_pPinMapDocument->createView( vc, 0 ));
	
	//qApp->processEvents(); // 2015.07.07 - do not process events, if it is not urgently needed; might generate crashes?
	
	m_pPinMapDocument->init( *m_pPinMapping, picInfo );
	
    showButtonSeparator( false );
	// enableButtonSeparator( false );

	setMainWidget(f);
}
Пример #3
0
ScannerPage::ScannerPage (QWidget *w, DBIndex *i) : QWidget (w)
{
  chartIndex = i;
  idir.setFilter(QDir::Files);

  Q3VBoxLayout *vbox = new Q3VBoxLayout(this);
  vbox->setMargin(0);
  vbox->setSpacing(5);

  search = new QLineEdit(this);
  search->setText("*");
  connect(search, SIGNAL(textChanged(const QString &)), this, SLOT(searchChanged(const QString &)));
  QToolTip::add(search, tr("List Filter, e.g. s* or sb*"));
  vbox->addWidget(search);

  list = new Q3ListBox(this);
  connect(list, SIGNAL(contextMenuRequested(Q3ListBoxItem *, const QPoint &)), this,
          SLOT(rightClick(Q3ListBoxItem *)));
  connect(list, SIGNAL(highlighted(const QString &)), this, SLOT(scannerSelected(const QString &)));
  connect(list, SIGNAL(doubleClicked(Q3ListBoxItem *)), this, SLOT(doubleClick(Q3ListBoxItem *)));
  vbox->addWidget(list);

  menu = new QMenu(this);
  menu->insertItem(QPixmap(newchart), tr("&New Scanner		Ctrl+N"), this, SLOT(newScanner()));
  menu->insertItem(QPixmap(openitem), tr("&Open Scanner		Ctrl+O"), this, SLOT(openScanner()));
  menu->insertItem(QPixmap(deleteitem), tr("&Delete Scanner	Ctrl+D"), this, SLOT(deleteScanner()));
  menu->insertItem(QPixmap(renameitem), tr("&Rename Scanner		Ctrl+R"), this, SLOT(renameScanner()));
  menu->insertItem(QPixmap(macro), tr("R&un Scanner		Ctrl+U"), this, SLOT(runScanner()));
  menu->insertSeparator(-1);
  menu->insertItem(QPixmap(help), tr("&Help		Ctrl+H"), this, SLOT(slotHelp()));

  Q3Accel *a = new Q3Accel(this);
  connect(a, SIGNAL(activated(int)), this, SLOT(slotAccel(int)));
  a->insertItem(Qt::CTRL+Qt::Key_N, NewScanner);
  a->insertItem(Qt::CTRL+Qt::Key_O, OpenScanner);
  a->insertItem(Qt::CTRL+Qt::Key_D, DeleteScanner);
  a->insertItem(Qt::CTRL+Qt::Key_R, RenameScanner);
  a->insertItem(Qt::CTRL+Qt::Key_U, RunScanner);
  a->insertItem(Qt::CTRL+Qt::Key_H, Help);

  refreshList();
  scannerSelected(QString());
}
Пример #4
0
MainMenubar::MainMenubar (QMainWindow *mw) : QMenuBar (mw, "mainMenubar")
{
  actions.setAutoDelete(FALSE);

  RcFile rcfile;

  QPixmap icon(finished);
  QAction *action  = new QAction(this, "actionExit");
  action->setMenuText(tr("E&xit"));
  action->setIconSet(icon);
  action->setAccel(Qt::CTRL+Qt::Key_Q);
  action->setStatusTip(tr("Quit Qtstalker (Ctrl+Q)"));
  action->setToolTip(tr("Quit Qtstalker (Ctrl+Q)"));
  connect(action, SIGNAL(activated()), this, SIGNAL(signalExit()));
  actions.replace(Exit, action);

  icon = configure;
  action = new QAction(this, "actionOptions");
  action->setMenuText(tr("Edit &Preferences"));
  action->setIconSet(icon);
  action->setStatusTip(tr("Modify user preferences (Ctrl+0)"));
  action->setToolTip(tr("Modify user preferences (Ctrl+0)"));
  connect(action, SIGNAL(activated()), mw, SLOT(slotOptions()));
  actions.replace(Options, action);

  icon = nav;
  bool b;
  rcfile.loadData(RcFile::ShowSidePanel, b);
  action = new QAction(this, "actionPanel");
  action->setMenuText(tr("Side &Panel"));
  action->setIconSet(icon);
  action->setStatusTip(tr("Toggle side-panel view (Ctrl+1)"));
  action->setToolTip(tr("Toggle side-panel view (Ctrl+1)"));
  action->setToggleAction(TRUE);
  action->setOn(b);
  connect(action, SIGNAL(toggled(bool)), mw, SLOT(slotHideNav(bool)));
  actions.replace(SidePanel, action);

  icon = gridicon;
  rcfile.loadData(RcFile::Grid, b);
  action = new QAction(this, "actionGrid");
  action->setMenuText(tr("Chart &Grid"));
  action->setIconSet(icon);
  action->setStatusTip(tr("Toggle chart grid (Ctrl+2)"));
  action->setToolTip(tr("Toggle chart grid (Ctrl+2)"));
  action->setToggleAction(TRUE);
  action->setOn(b);
  connect(action, SIGNAL(toggled(bool)), this, SIGNAL(signalGrid(bool)));
  actions.replace(Grid, action);

  icon = scaletoscreen;
  rcfile.loadData(RcFile::ScaleToScreen, b);
  action = new QAction(this, "actionScale");
  action->setMenuText(tr("&Scale To Screen"));
  action->setIconSet(icon);
  action->setStatusTip(tr("Scale chart to current screen data (Ctrl+3)"));
  action->setToolTip(tr("Scale chart to current screen data (Ctrl+3)"));
  action->setToggleAction(TRUE);
  action->setOn(b);
  connect(action, SIGNAL(toggled(bool)), this, SIGNAL(signalScale(bool)));
  actions.replace(ScaleToScreen, action);

  icon = crosshair;
  rcfile.loadData(RcFile::Crosshairs, b);
  action = new QAction(this, "actionCrosshairs");
  action->setMenuText(tr("Toggle &Crosshairs"));
  action->setIconSet(icon);
  action->setStatusTip(tr("Toggle crosshairs (Ctrl+4)"));
  action->setToolTip(tr("Toggle crosshairs (Ctrl+4)"));
  action->setToggleAction(TRUE);
  action->setOn(b);
  connect(action, SIGNAL(toggled(bool)), this, SIGNAL(signalCrosshairs(bool)));
  actions.replace(Crosshairs, action);

  icon = co;
  rcfile.loadData(RcFile::DrawMode, b);
  action = new QAction(this, "actionDraw");
  action->setMenuText(tr("Toggle &Draw Mode"));
  action->setIconSet(icon);
  action->setStatusTip(tr("Toggle drawing mode (Ctrl+5)"));
  action->setToolTip(tr("Toggle drawing mode (Ctrl+5)"));
  action->setToggleAction(TRUE);
  action->setOn(b);
  connect(action, SIGNAL(toggled(bool)), this, SIGNAL(signalDraw(bool)));
  actions.replace(DrawMode, action);

  icon = papertrade;
  rcfile.loadData(RcFile::PaperTradeMode, b);
  action = new QAction(this, "actionPaperTrade");
  action->setMenuText(tr("Toggle &Trade Mode"));
  action->setIconSet(icon);
  action->setStatusTip(tr("Toggle paper-trade mode"));
  action->setToolTip(tr("Toggle paper-trade mode"));
  action->setToggleAction(TRUE);
  action->setOn(b);
  connect(action, SIGNAL(toggled(bool)), this, SIGNAL(signalPaperTrade(bool)));
  actions.replace(PaperTrade, action);

  icon = indicator;
  action = new QAction(this, "actionNewIndicator");
  action->setMenuText(tr("New &Indicator"));
  action->setIconSet(icon);
  action->setStatusTip(tr("Add new indicator (Ctrl+7)"));
  action->setToolTip(tr("Add new indicator (Ctrl+7)"));
  connect(action, SIGNAL(activated()), this, SIGNAL(signalNewIndicator()));
  actions.replace(NewIndicator, action);

  icon = datawindow;
  action = new QAction(this, "actionDataWindow");
  action->setMenuText(tr("&Data Window"));
  action->setIconSet(icon);
  action->setAccel(Qt::ALT+Qt::Key_1);
  action->setStatusTip(tr("Show data window (Alt+1)"));
  action->setToolTip(tr("Show data window (Alt+1)"));
  connect(action, SIGNAL(activated()), mw, SLOT(slotDataWindow()));
  actions.replace(DataWindow, action);

  icon = quotes;
  action = new QAction(this, "actionQuote");
  action->setMenuText(tr("Load Quotes"));
  action->setIconSet(icon);
  action->setStatusTip(tr("Load Quotes (Ctrl+Y)"));
  action->setToolTip(tr("Load Quotes (Ctrl+Y)"));
  connect(action, SIGNAL(activated()), mw, SLOT(slotQuotes()));
  actions.replace(Quotes, action);

  icon = qtstalker;
  action = new QAction(this, "actionAbout");
  action->setMenuText(tr("&About"));
  action->setIconSet(icon);
  action->setStatusTip(tr("About Qtstalker."));
  action->setToolTip(tr("About Qtstalker."));
  connect(action, SIGNAL(activated()), mw, SLOT(slotAbout()));
  actions.replace(About, action);

  icon = help;
  action = new QAction(this, "actionHelp");
  action->setMenuText(tr("&Help"));
  action->setIconSet(icon);
  action->setAccel(Qt::Key_F1);
  action->setStatusTip(tr("Display Help (F1)"));
  action->setToolTip(tr("Display Help (F1)"));
  connect(action, SIGNAL(activated()), mw, SLOT(slotHelp()));
  actions.replace(Help, action);

  action = new QAction(this, "actionAdvancePaperTrade");
  action->setAccel(Qt::CTRL+Qt::Key_Right);
  connect(action, SIGNAL(activated()), this, SIGNAL(signalAdvancePaperTrade()));
  actions.replace(AdvancePaperTrade, action);

  action = new QAction(this, "actionIndicatorSummary");
  action->setMenuText(tr("Indicator Summary"));
  action->setStatusTip(tr("Indicator Summary"));
  action->setToolTip(tr("Indicator Summary"));
  connect(action, SIGNAL(activated()), mw, SLOT(slotIndicatorSummary()));
  actions.replace(IndicatorSummary, action);

  Q3Accel *a = new Q3Accel(mw);
  connect(a, SIGNAL(activated(int)), this, SLOT(slotAccel(int)));
  a->insertItem(Qt::CTRL+Qt::Key_0, Options);
  a->insertItem(Qt::CTRL+Qt::Key_1, SidePanel);
  a->insertItem(Qt::CTRL+Qt::Key_2, Grid);
  a->insertItem(Qt::CTRL+Qt::Key_3, ScaleToScreen);
  a->insertItem(Qt::CTRL+Qt::Key_4, Crosshairs);
  a->insertItem(Qt::CTRL+Qt::Key_5, DrawMode);
  a->insertItem(Qt::CTRL+Qt::Key_7, NewIndicator);
  a->insertItem(Qt::CTRL+Qt::Key_Y, Quotes);
  a->insertItem(Qt::CTRL+Qt::Key_Right, AdvancePaperTrade);
  a->insertItem(Qt::CTRL+Qt::Key_Escape, 8);

  createMenus();

  rcfile.loadData(RcFile::ShowMenuBar, b);
  if (!b)
    hide();
}
Пример #5
0
int main( int argc, char ** argv )
{
	// Register custom message handler if desired
	bool handler_registered = FALSE;
	MyMessageOutput * mymsghandler = NULL;
	for(int i = 1; i < argc; i++)
	{
		QString arg(argv[i]);
		QString opt("-msg_handler");
		if(arg.startsWith(opt))
		{
			// Extract handler type
			QString handler = arg.section("=",1,1);
			if(handler.isEmpty())
			{
				qWarning("Option '-msg_handler' is not complete. Use default handler.");
				handler_registered = TRUE;
				break;
			}
			if(handler == "console")
			{
				handler_registered = TRUE;
				break;
			}
			if(!handler.endsWith(".txt"))
			{
				qWarning("File '%s' does not end with '.txt'. Use default handler.",handler.ascii());
				handler_registered = TRUE;
				break;
			}
			QFileInfo hfinfo(handler);
			if(hfinfo.exists())
			{
				if(!hfinfo.isWritable())
				{
					qWarning("Cannot write to '%s'. Use default handler",handler.ascii());
					handler_registered = TRUE;
					break;
				}
			}
			else
			{
				QString path = hfinfo.dirPath();
				QFileInfo hfdinfo(path);
				if(!hfdinfo.isWritable())
				{
					qWarning("Cannot create file in dir '%s'. Use default handler",path.ascii());
					handler_registered = TRUE;
					break;
				}

			}
			mymsghandler = new MyMessageOutput(handler);
			handler_registered = TRUE;
			break;
		}
	}
	if(!handler_registered)
	{
		mymsghandler = new MyMessageOutput(QString("debuglog.txt"));
		handler_registered = TRUE;
	}

#ifdef Q_WS_X11
	if(XInitThreads() == 0)
		qFatal("XInitThreads didn't succeed");
#endif

	// Create a QApplication object and add default close
    QApplication a( argc, argv );
    a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );

	// Start the configuration selection dialog if more than one config file is available
	ConfigSelector cs;
	if(cs.getNumConfigs() > 1)
	{
		cs.resize(300,150);
		cs.show();
		a.exec();
	}

	// Load configuration
	Configuration * config = new Configuration();
	QString configfile(cs.getConfig());
	if(!config->load(configfile))
	{
		qFatal("Unable to load %s", configfile.ascii());
	}

	ConfigNode * cn = config->getConfig();
	if(!cn)
	{
		qFatal("Unable to get ConfigNode");
	}

	ApplicationNode * an = cn->getApplicationNode();
	if(!an)
	{
		qFatal("Unable to get ApplicationNode");
	}

	PluginsNode * pn = cn->getPluginsNode();
	if(!pn)
	{
		qFatal("Unable to get PluginsNode");
	}

	OBJECTVALUENODE_DECLARE_AND_GET(QPoint,position,an);
	OBJECTVALUENODE_DECLARE_AND_GET(QSize,size,an);
	SIMPLEVALUENODE_DECLARE_AND_GET(bool,maximized,an);
	SIMPLEVALUENODE_DECLARE_AND_GET(Q_INT8,tbindex,an);

    // Create the toplevel window
	Q3HBox * w = new Q3HBox();
	w->setSizePolicy(QSizePolicy::Preferred,QSizePolicy::Preferred);

	// Add a widget that contains the toolbox and measurements
	Q3VBox * pVBox = new Q3VBox( w );
	pVBox->setSizePolicy( QSizePolicy::Fixed, QSizePolicy::Preferred );
	pVBox->setSpacing( 5 );
	pVBox->setMargin( 2 );

	// Create the toolbox
	QToolBox * tb = new QToolBox( pVBox );

	// Create all plugins
    Plugin * VisualizePlugin = new Plugin("visualize");
    Plugin * AnalysePlugin = new Plugin("analyse_os");
    Plugin * WaveInPlugin = new Plugin("wavein");
    Plugin * FileWriterPlugin = new Plugin("filewriter");
    // Load plugin objects
	PI_Unknown *ukvi = VisualizePlugin->getObject();
	PI_Unknown *ukan = AnalysePlugin->getObject();
	PI_Unknown *ukwi = WaveInPlugin->getObject();
	PI_Unknown *ukfw = FileWriterPlugin->getObject();

	// Configure the system
	if( ukvi && ukan && ukwi && ukfw )
	{
		PI_GuiContainer* gcwiobj = NULL;
		PI_GuiContainer* gcviobj = NULL;
		PI_GuiContainer* gcfwobj = NULL;
		PI_Configuration* xcanobj = NULL;
		PI_Configuration* xcviobj = NULL;
		PI_Configuration* xcwiobj = NULL;
		PI_Configuration* xcfwobj = NULL;
		PI_DataBufferProvider* dbpwiobj = NULL;
		PI_DataBufferProvider* dbpanobj = NULL;
		PI_DataBufferConsumer* dbcanobj = NULL;
		PI_DataBufferConsumer* dbcviobj = NULL;
		PI_DataBufferConsumer* dbcfwobj = NULL;
		PI_TimeProvider* tpwiobj = NULL;
		PI_TimeConsumer* tcviobj = NULL;
		PI_TimeConsumer* tcfwobj = NULL;

		ukwi->queryInterface( PIID_GUI_CONTAINER, (void**)&gcwiobj );
		ukvi->queryInterface( PIID_GUI_CONTAINER , (void**)&gcviobj );
		ukfw->queryInterface( PIID_GUI_CONTAINER, (void**)&gcfwobj );
		ukan->queryInterface( PIID_CONFIGURATION, (void**)&xcanobj );
		ukvi->queryInterface( PIID_CONFIGURATION, (void**)&xcviobj );
		ukwi->queryInterface( PIID_CONFIGURATION, (void**)&xcwiobj );
		ukfw->queryInterface( PIID_CONFIGURATION, (void**)&xcfwobj );
		ukwi->queryInterface( PIID_DATA_BUFFER_PROVIDER, (void**)&dbpwiobj );
		ukan->queryInterface( PIID_DATA_BUFFER_PROVIDER, (void**)&dbpanobj );
		ukan->queryInterface( PIID_DATA_BUFFER_CONSUMER, (void**)&dbcanobj );
		ukvi->queryInterface( PIID_DATA_BUFFER_CONSUMER, (void**)&dbcviobj );
		ukfw->queryInterface( PIID_DATA_BUFFER_CONSUMER, (void**)&dbcfwobj );
		ukwi->queryInterface( PIID_TIME_PROVIDER, (void**)&tpwiobj );
		ukvi->queryInterface( PIID_TIME_CONSUMER, (void**)&tcviobj );
		ukfw->queryInterface( PIID_TIME_CONSUMER, (void**)&tcfwobj );

		if( gcwiobj && gcviobj && gcfwobj &&
			xcwiobj && xcanobj && xcviobj && xcfwobj &&
			dbpwiobj && dbpanobj && dbcanobj && dbcviobj && dbcfwobj &&
			tpwiobj && tcviobj && tcfwobj)
		{
			// Wave in object
			gcwiobj->setParentWindow( tb, "WaveDeviceConfiguration" );
			// Visualize object
    		gcviobj->setParentWindow( tb, "Diagram1" );
    		gcviobj->setParentWindow( tb, "Diagram2" );
    		gcviobj->setParentWindow( tb, "Diagram3" );
			gcviobj->setParentWindow( tb, "Diagram4" );
			gcviobj->setParentWindow( tb, "Diagram5" );
			gcviobj->setParentWindow( tb, "Configuration" );
			gcviobj->setParentWindow( tb, "BaseFrequency" );
			gcviobj->setParentWindow( pVBox, "TopDisplay" );
			gcviobj->setParentWindow( w, "Graph" );
			// File writer object
			gcfwobj->setParentWindow( tb, "SpectralDataSaveGui" );

			// Wave in object
			PLUGINNODE_DECLARE_AND_GET(wavein,pn);
			xcwiobj->configure(NODE_VARIABLE_NAME(wavein));
			// Analyse object
			PLUGINNODE_DECLARE_AND_GET(analyse,pn);
			xcanobj->configure(NODE_VARIABLE_NAME(analyse));
			// Visualize object
			PLUGINNODE_DECLARE_AND_GET(visualize,pn);
			xcviobj->configure(NODE_VARIABLE_NAME(visualize));
			// File writer object
			PLUGINNODE_DECLARE_AND_GET(filewriter,pn);
			xcfwobj->configure(NODE_VARIABLE_NAME(filewriter));

			// Connect the 'pause' source to different sinks
			gcviobj->connectSlot( "pause", gcwiobj->getObject("WaveDeviceConfiguration"), "setPause" );
			gcviobj->connectSlot( "pause", gcfwobj->getObject("SpectralDataSaveGui"), "setPause" );

			// Add visualize object configurations to the toolbox
			tb->addItem( gcviobj->getWidget("Diagram1"), "Diagramm 1" );
			tb->addItem( gcviobj->getWidget("Diagram2"), "Diagramm 2" );
			tb->addItem( gcviobj->getWidget("Diagram3"), "Diagramm 3" );
			tb->addItem( gcviobj->getWidget("Diagram4"), "Diagramm 4" );
			tb->addItem( gcviobj->getWidget("Diagram5"), "Diagramm 5" );
			tb->addItem( gcviobj->getWidget("Configuration"), "Konfiguration" );
			tb->addItem( gcviobj->getWidget("BaseFrequency"), "Bezugston, Stimmung" );
			// Add file writer object configuration to the toolbox
			tb->addItem( gcfwobj->getWidget("SpectralDataSaveGui"), "Datenspeicherung" );
			// Add wave in object configuration to the toolbox
			tb->addItem( gcwiobj->getWidget("WaveDeviceConfiguration"), "Soundkarte" );

			dbpwiobj->addRef();
			dbcanobj->connectToProvider( dbpwiobj );
			dbpanobj->addRef();
			dbcviobj->connectToProvider( dbpanobj );

			dbpwiobj->addRef();
			dbcfwobj->connectToProvider( dbpwiobj ); //filewrite
			dbpanobj->addRef();
			dbcfwobj->connectToProvider( dbpanobj ); //filewrite

			tpwiobj->addRef();
			tcviobj->connectToProvider( tpwiobj );
			tpwiobj->addRef();
			tcfwobj->connectToProvider( tpwiobj ); //filewrite

			xcwiobj->startRunning();
			xcanobj->startRunning();
			xcviobj->startRunning();
			xcfwobj->startRunning(); //filewrite

		}

		if( gcwiobj ) gcwiobj->release();
		if( gcviobj ) gcviobj->release();
		if( gcfwobj ) gcfwobj->release();
		if( xcanobj ) xcanobj->release();
		if( xcviobj ) xcviobj->release();
		if( xcwiobj ) xcwiobj->release();
		if( xcfwobj ) xcfwobj->release();
		if( dbpwiobj ) dbpwiobj->release();
		if( dbpanobj ) dbpanobj->release();
		if( dbcanobj ) dbcanobj->release();
		if( dbcviobj ) dbcviobj->release();
		if( dbcfwobj ) dbcfwobj->release();
		if( tpwiobj ) tpwiobj->release();
		if( tcviobj ) tcviobj->release();
		if( tcfwobj ) tcfwobj->release();
	}

	// Set active item in the ToolBox
	tb->setCurrentIndex(VALUENODE_GET_VALUE(tbindex));

	w->resize(VALUENODE_GET_VALUE(size));
	w->move(VALUENODE_GET_VALUE(position));
	if(VALUENODE_GET_VALUE(maximized))
		w->showMaximized();
	w->setCaption("Prisma-Realtime v1.3b");
    w->show();

    Q3Accel *esc = new Q3Accel( w );
    esc->connectItem( esc->insertItem( Qt::Key_Escape ), &a, SLOT( quit() ) );

    a.exec();

	w->hide();

	if(!w->isMaximized())
	{
		VALUENODE_SET_VALUE(size,w->size());
		VALUENODE_SET_VALUE(position,w->pos());
	}
	VALUENODE_SET_VALUE(maximized,w->isMaximized());

	VALUENODE_SET_VALUE(tbindex,tb->currentIndex());

	if( ukvi && ukan && ukwi && ukfw )
	{
		PI_Configuration * xmlconfig = NULL;

		ukvi->queryInterface(PIID_CONFIGURATION, (void**)&xmlconfig);
		if(xmlconfig != NULL)
		{
			xmlconfig->stopRunning();
			xmlconfig->release();
			xmlconfig = NULL;
		}
		ukan->queryInterface(PIID_CONFIGURATION, (void**)&xmlconfig);
		if(xmlconfig != NULL)
		{
			xmlconfig->stopRunning();
			xmlconfig->release();
			xmlconfig = NULL;
		}
		ukwi->queryInterface(PIID_CONFIGURATION, (void**)&xmlconfig);
		if(xmlconfig != NULL)
		{
			xmlconfig->stopRunning();
			xmlconfig->release();
			xmlconfig = NULL;
		}
		ukfw->queryInterface(PIID_CONFIGURATION, (void**)&xmlconfig);
		if(xmlconfig != NULL)
		{
			xmlconfig->stopRunning();
			xmlconfig->release();
			xmlconfig = NULL;
		}
	}

	if(ukvi) ukvi->release();
	if(ukan) ukan->release();
	if(ukwi) ukwi->release();
	if(ukfw) ukfw->release();

	delete w;

	config->save(configfile);
	// Delete before unloading plugins!!!
	delete config;

	// Release plugins
	delete VisualizePlugin;
	delete FileWriterPlugin;
	delete AnalysePlugin;
	delete WaveInPlugin;


	if(mymsghandler)
		delete mymsghandler;

    return 0;

}