lib/CUSDialog.cpp

Go to the documentation of this file.
00001 /*
00002  *  Qtstalker stock charter
00003  *
00004  *  Copyright (C) 2001-2007 Stefan S. Stratigakos
00005  *
00006  *  This program is free software; you can redistribute it and/or modify
00007  *  it under the terms of the GNU General Public License as published by
00008  *  the Free Software Foundation; either version 2 of the License, or
00009  *  (at your option) any later version.
00010  *
00011  *  This program is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with this program; if not, write to the Free Software
00018  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
00019  *  USA.
00020  */
00021 
00022 #include "CUSDialog.h"
00023 #include "HelpWindow.h"
00024 #include <qinputdialog.h>
00025 #include <qmessagebox.h>
00026 #include <qlayout.h>
00027 #include <qlabel.h>
00028 #include <qframe.h>
00029 #include <qdir.h>
00030 
00031 CUSDialog::CUSDialog (QString d) : QTabDialog (0, "CUSDialog", TRUE)
00032 {
00033   setCaption(tr("CUS Indicator"));
00034   
00035   helpFile = d;
00036 
00037   QWidget *w = new QWidget(this);
00038   
00039   QVBoxLayout *vbox = new QVBoxLayout(w);
00040   vbox->setMargin(5);
00041   vbox->setSpacing(0);
00042   
00043   list = new FormulaEdit(w, FormulaEdit::Indicator);
00044   vbox->addWidget(list);
00045   
00046   addTab(w, tr("Settings"));
00047 
00048   setOkButton();
00049   setCancelButton();
00050   setHelpButton();
00051   QObject::connect(this, SIGNAL(helpButtonPressed()), this, SLOT(help()));
00052 
00053   resize(400, 300);
00054 }
00055 
00056 CUSDialog::~CUSDialog ()
00057 {
00058 }
00059 
00060 void CUSDialog::setLine (QString d)
00061 {
00062   list->setLine(d);
00063 }
00064 
00065 void CUSDialog::getList (QStringList &l)
00066 {
00067   l.clear();
00068   QString s;
00069   list->getText(s);
00070   l = QStringList::split("\n", s, FALSE);
00071 }
00072 
00073 void CUSDialog::help ()
00074 {
00075   HelpWindow *hw = new HelpWindow(this, helpFile);
00076   hw->show();
00077 }
00078