void ScannerPage::runScanner ()
{
  QString s;
  config.getData(Config::ScannerPath, s);
  QString s2("*");
  SymbolDialog *dialog = new SymbolDialog(this,
                                          s,
  					  s,
					  s2,
					  Q3FileDialog::ExistingFiles);
  dialog->setCaption(tr("Select scanners to run"));

  int rc = dialog->exec();

  if (rc == QDialog::Accepted)
  {
    QStringList l = dialog->selectedFiles();
    int loop;
    QDir dir;
    for (loop = 0; loop < (int) l.count(); loop++)
    {
      QFileInfo fi(l[loop]);
      Scanner *sdialog = new Scanner(fi.fileName(), chartIndex);
      connect(sdialog, SIGNAL(exitScanner()), this, SLOT(refreshList()));
      connect(sdialog, SIGNAL(message(QString)), this, SIGNAL(message(QString)));
      sdialog->show();
      sdialog->scan();
      delete sdialog;
    }
  }

  delete dialog;
}
Beispiel #2
0
void CSV::editRule ()
{
  QString s("*");
  SymbolDialog *dialog = new SymbolDialog(this,
  				          ruleDir,
                                          ruleDir,
					  s,
					  Q3FileDialog::ExistingFiles);
  dialog->setCaption(tr("Select Rule To Edit"));

  int rc = dialog->exec();

  if (rc == QDialog::Rejected)
  {
    delete dialog;
    return;
  }

  QStringList l = dialog->selectedFiles();
  delete dialog;
  if (! l.count())
    return;

  CSVRuleDialog *rdialog = new CSVRuleDialog(this, l[0]);

  rc = rdialog->exec();

  delete rdialog;
}
void FormulaEdit::includeRule ()
{
  QString s("*");
  QString s2, s3;
  config.getData(Config::IndicatorPath, s2);
  config.getData(Config::IndicatorGroup, s3);
  s2.append("/" + s3);
  SymbolDialog *dialog = new SymbolDialog(this,
                                          s2,
  					  s2,
					  s,
					  QFileDialog::ExistingFiles);
  dialog->setCaption(tr("Select rule to include"));

  int rc = dialog->exec();

  if (rc != QDialog::Accepted)
  {
    delete dialog;
    return;
  }

  QStringList selection = dialog->selectedFiles();
  delete dialog;

  if (! selection.count())
    return;

  QFileInfo fi(selection[0]);
  s = "INCLUDECUS(" + fi.fileName() + ")\n";
  formula->insert(s);
}
void Plot3DDialog::showUpperGreek()
{
	SymbolDialog *greekLetters = new SymbolDialog(SymbolDialog::upperGreek, this, Qt::Tool);
	greekLetters->setAttribute(Qt::WA_DeleteOnClose);
	connect(greekLetters, SIGNAL(addLetter(const QString&)), this, SLOT(addSymbol(const QString&)));
	greekLetters->show();
	greekLetters->setActiveWindow();
}
Beispiel #5
0
void TextFormatButtons::showUpperGreek()
{
  SymbolDialog *greekLetters = new SymbolDialog(SymbolDialog::upperGreek, this, Qt::Tool|Qt::WindowStaysOnTopHint);
  greekLetters->setAttribute(Qt::WA_DeleteOnClose);
  QFont f = connectedTextEdit->font();
  f.setPointSize(12);
  greekLetters->setFont(f);
  connect(greekLetters, SIGNAL(addLetter(const QString&)), this, SLOT(addSymbol(const QString&)));
  greekLetters->show();
  greekLetters->setFocus();
}
void TextFormatButtons::showMathSymbols()
{
	SymbolDialog *mathSymbols = new SymbolDialog(SymbolDialog::mathSymbols, this, Qt::Tool);
	mathSymbols->setAttribute(Qt::WA_DeleteOnClose);
	QFont f = connectedTextEdit->font();
	if(f.pointSize()<14)
		f.setPointSize(14);
	mathSymbols->setFont(f);
	connect(mathSymbols, SIGNAL(addLetter(const QString&)), this, SLOT(addSymbol(const QString&)));
	mathSymbols->show();
	mathSymbols->setFocus();
}
Beispiel #7
0
void TextFormatButtons::showMathSymbols()
{
  SymbolDialog::CharSet charSet = SymbolDialog::mathSymbols;
  if (d_buttons == Equation || d_buttons == TexLegend)
    charSet = SymbolDialog::latexMathSymbols;

  SymbolDialog *mathSymbols = new SymbolDialog(charSet, this, Qt::Tool|Qt::WindowStaysOnTopHint);
  mathSymbols->setAttribute(Qt::WA_DeleteOnClose);
  QFont f = connectedTextEdit->font();
  f.setPointSize(12);
  mathSymbols->setFont(f);
  connect(mathSymbols, SIGNAL(addLetter(const QString&)), this, SLOT(addSymbol(const QString&)));
  mathSymbols->show();
  mathSymbols->setFocus();
}
void FormulaEdit::openRule ()
{
  QString s("*");
  QString s2;
  config.getData(Config::IndicatorPath, s2);
  SymbolDialog *dialog = new SymbolDialog(this,
                                          s2,
  					  s2,
					  s,
					  QFileDialog::ExistingFiles);
  dialog->setCaption(tr("Select rule to open."));

  int rc = dialog->exec();

  if (rc != QDialog::Accepted)
  {
    delete dialog;
    return;
  }

  QStringList selection = dialog->selectedFile();
  delete dialog;

  if (! selection.count())
    return;

  QFile f(selection[0]);
  if (! f.open(IO_ReadOnly))
  {
    qDebug("FormulaEdit::openRule:can't read file %s", selection[0].latin1());
    return;
  }
  QTextStream stream(&f);
  
  QString script;
  while(stream.atEnd() == 0)
  {
    s = stream.readLine();
    s = s.stripWhiteSpace();
    if (s.contains("script="))
      script = s;
  }
  f.close();

  setLine(script);
}
Beispiel #9
0
void CSV::deleteRule ()
{
  QString s("*");
  SymbolDialog *dialog = new SymbolDialog(this,
  				          ruleDir,
                                          ruleDir,
					  s,
					  Q3FileDialog::ExistingFiles);
  dialog->setCaption(tr("Select Rules To Delete"));

  int rc = dialog->exec();

  if (rc == QDialog::Accepted)
  {
    rc = QMessageBox::warning(this,
  			      tr("Qtstalker: Warning"),
			      tr("Are you sure to delete selected rules?"),
			      QMessageBox::Yes,
			      QMessageBox::No,
			      QMessageBox::NoButton);

    if (rc == QMessageBox::No)
    {
      delete dialog;
      return;
    }

    QStringList l = dialog->selectedFiles();
    delete dialog;
    if (! l.count())
      return;

    int loop;
    QDir dir;
    for (loop = 0; loop < (int) l.count(); loop++)
      dir.remove(l[loop]);

    updateRules();
  }
  else
    delete dialog;
}
void ScannerPage::deleteScanner()
{
  QString s;
  config.getData(Config::ScannerPath, s);
  QString s2("*");
  SymbolDialog *dialog = new SymbolDialog(this,
                                          s,
  					  s,
					  s2,
					  Q3FileDialog::ExistingFiles);
  dialog->setCaption(tr("Select Scanners To Delete"));

  int rc = dialog->exec();

  if (rc == QDialog::Accepted)
  {
    rc = QMessageBox::warning(this,
  			      tr("Qtstalker: Warning"),
			      tr("Are you sure to delete selected scanners?"),
			      QMessageBox::Yes,
			      QMessageBox::No,
			      QMessageBox::NoButton);

    if (rc == QMessageBox::No)
    {
      delete dialog;
      return;
    }

    QStringList l = dialog->selectedFiles();
    int loop;
    QDir dir;
    for (loop = 0; loop < (int) l.count(); loop++)
      dir.remove(l[loop]);

    refreshList();
    scannerSelected(QString());
  }

  delete dialog;
}
Beispiel #11
0
void TestPage::deleteTest()
{
  QString s("*");
  QString s2;
  config.getData(Config::TestPath, s2);
  SymbolDialog *dialog = new SymbolDialog(this,
                                          s2,
  					  s2,
					  s,
					  QFileDialog::DirectoryOnly);
  dialog->setCaption(tr("Select Backtest rule To Delete"));

  int rc = dialog->exec();

  if (rc == QDialog::Accepted)
  {
    rc = QMessageBox::warning(this,
  			      tr("Qtstalker: Warning"),
			      tr("Are you sure you want to delete backtest rule?"),
			      QMessageBox::Yes,
			      QMessageBox::No,
			      QMessageBox::NoButton);

    if (rc == QMessageBox::No)
    {
      delete dialog;
      return;
    }

    s = "rm -r " + dialog->selectedFile();
    
    if (system(s.latin1()) == -1)
      qDebug("TestPage::deleteTest:command failed");
    
    updateList();

    testNoSelection();
  }

  delete dialog;
}
Beispiel #12
0
void Scanner::getSymbols ()
{
  QString s;
  if (! basePath->currentText().compare(tr("Chart")))
    config.getData(Config::DataPath, s);
  else
    config.getData(Config::GroupPath, s);
  QString s2("*");
  SymbolDialog *dialog = new SymbolDialog(this,
                                          s,
  					  s,
					  s2,
					  QFileDialog::ExistingFiles);
  dialog->setCaption(tr("Select symbols to scan"));
  
  int rc = dialog->exec();

  if (rc == QDialog::Accepted)
    fileList = dialog->selectedFiles();
    
  fileButton->setText(QString::number(fileList.count()) + " Symbols");
    
  delete dialog;
}