ScenarioSelectionWidget.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2008 by Antonello Lobianco                              *
00003  *   antonello@regmas.org                                                  *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU Library General Public License as       *
00007  *   published by the Free Software Foundation; either version 3 of the    *
00008  *   License, or (at your option) any later version.                       *
00009  *                                                                         *
00010  *   This program is distributed in the hope that it will be useful,       *
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00013  *   GNU General Public License for more details.                          *
00014  *                                                                         *
00015  *   You should have received a copy of the GNU Library General Public     *
00016  *   License along with this program; if not, write to the                 *
00017  *   Free Software Foundation, Inc.,                                       *
00018  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
00019  ***************************************************************************/
00020 
00021 #include <QtGui>
00022 
00023 #include "ScenarioSelectionWidget.h"
00024 
00025 ScenarioSelectionWidget::ScenarioSelectionWidget(QWidget *parent): QDialog(parent) {
00026 
00027     label = new QLabel(tr("Select the scenario you want to run..."));
00028     scenarioSelector = new QComboBox();
00029     QVBoxLayout *mainLayout = new QVBoxLayout;
00030     mainLayout->addWidget(label);
00031     mainLayout->addWidget(scenarioSelector);
00032     setLayout(mainLayout);
00033     setWindowTitle(tr("Scenario selection"));
00034     setFixedHeight(sizeHint().height());
00035 
00036     //connect(scenarioSelector, SIGNAL( activated(const QString&)), this, SLOT( processSelectedScenario(const QString &)   ));
00037     //connect(scenarioSelector, SIGNAL( activated(const QString&)), this, SLOT( close()));
00038 
00039 }
00040 
00041 ScenarioSelectionWidget::~ScenarioSelectionWidget(){
00042 }
00043 
00044 
00045 void
00046 ScenarioSelectionWidget::receiveScenarioOptions(const QVector<QString> &scenarios_h){
00047     scenarioSelector->clear();
00048     for (uint i=0; i< scenarios_h.size();i++){
00049         scenarioSelector->addItem(scenarios_h.at(i));
00050     }
00051     //scenarioSelector->setFocus(); // may be not visible, no effect!
00052     //scenarioSelector->grabMouse();
00053     //scenarioSelector->grabKeyboard();
00054 }
00055 
00056 /*
00057 void
00058 ScenarioSelectionWidget::processSelectedScenario(const QString &scenario_h){
00059     emit selectedScenarioName(scenario_h);  
00060 }
00061 
00062 */
00063 
00064