Exemple #1
0
void ExportDlg::slotExclude()
{
  ASSERT_ENGAUGE(listIncluded != 0);
  QString curve = listIncluded->currentText();
  ASSERT_ENGAUGE(pointSets != 0);
  pointSets->exportExclude(curve);

  resetLists();

  ASSERT_ENGAUGE(listExcluded != 0);
  listExcluded->setCurrentItem(listExcluded->findItem(curve));

  toggleActions();
  updatePreview();
}
void SelectionDialog:: initConnections()
{
	// Connect the signals and slots
	connect( resetPushButton, SIGNAL( clicked() ), this,
			SLOT( resetLists() ) );

	connect( clearSelectionPushButton, SIGNAL( clicked() ),
			this, SLOT( deleteConstraints() ) );

	connect( constraintListView,
			SIGNAL( itemRenamed( Q3ListViewItem *, int ) ),
			this, SLOT( setRelatives( Q3ListViewItem *, int ) ) );

	// The "Get Data" pushbutton is connected to "accept()"
	// and "Cancel" is connected to "reject()" in the base
	// class, so there's no need to connect those buttons here.
}
Exemple #3
0
void DifferentiateCurvesDialog::apply() {
  bool lineColorOrder  = !_selectedListBox->findItems(tr("Line Color"), Qt::MatchExactly).empty();
  bool pointStyleOrder = !_selectedListBox->findItems(tr("Point Style"), Qt::MatchExactly).empty();
  bool lineStyleOrder  = !_selectedListBox->findItems(tr("Line Style"), Qt::MatchExactly).empty();
  bool lineWidthOrder  = !_selectedListBox->findItems(tr("Line Width"), Qt::MatchExactly).empty();

  int maxLineWidth = _maxLineWidth->value();
  int pointDensity = _pointDensity->currentIndex();

  int sequenceNum = 0;
  CurveList curveList = _store->getObjects<Curve>();
  for (CurveList::iterator curve_iter = curveList.begin(); curve_iter != curveList.end(); ++curve_iter)
  {
    CurvePtr curve = kst_cast<Curve>(*curve_iter);
    curve->writeLock();
    if (lineColorOrder) {
      curve->setColor(ColorSequence::entry(sequenceNum));
    }
    if (pointStyleOrder) {
      curve->setPointType(sequenceNum % KSTPOINT_MAXTYPE);
      curve->setHasPoints(true);
      curve->setPointDensity(pointDensity);
    }
    if (lineStyleOrder) {
      curve->setLineStyle(sequenceNum % LINESTYLE_MAXTYPE);
    }
    if (lineWidthOrder) {
      curve->setLineWidth((sequenceNum + 1) % maxLineWidth);
    }

    curve->registerChange();
    curve->unlock();
    ++sequenceNum;
  }
  resetLists();

  UpdateManager::self()->doUpdates(true);
  kstApp->mainWindow()->document()->setChanged(true);
}
Exemple #4
0
packagesPage::packagesPage(QWidget *parent) :
    pageBase(parent)
{
    Ui_packagesPage::setupUi(this);

    pageName = tr("Packages Page");
    pageHelpMessage = tr("");

    packagesListDirPath = "/install/packages/";

    solvingCheckedDeps = false;


    connect(resetPushButton, SIGNAL(clicked()), this, SLOT(resetLists()));
    connect(packagesListWidget, SIGNAL(currentRowChanged(int)), this, SLOT(updatePackageDescription(int)));
    connect(packagesListWidget, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(updatePackageDeps(QListWidgetItem*)), Qt::DirectConnection);
    connect(reposListWidget, SIGNAL(currentRowChanged(int)), this, SLOT(updatePackageList(int)));
    connect(reposListWidget, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(updatePackageList(QListWidgetItem*)));

    connect(selectNonePushButton, SIGNAL(clicked()), this, SLOT(unsetAllSelection()));
    connect(selectAllPushButton, SIGNAL(clicked()), this, SLOT(setAllSelection()));

}
Exemple #5
0
DifferentiateCurvesDialog::DifferentiateCurvesDialog(QWidget *parent)
  : QDialog(parent) {
   setupUi(this);

  if (MainWindow *mw = qobject_cast<MainWindow*>(parent)) {
    _store = mw->document()->objectStore();
  } else {
    // FIXME: we need the object store
    qFatal("ERROR: can't construct a DifferentiateCurvesDialog without the object store");
  }

  resetLists();

  connect(_buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(reject()));
  connect(_buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(OKClicked()));
  connect(_buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(apply()));

  connect(_add, SIGNAL(clicked()), this, SLOT(addButtonClicked()));
  connect(_remove, SIGNAL(clicked()), this, SLOT(removeButtonClicked()));
  connect(_up, SIGNAL(clicked()), this, SLOT(upButtonClicked()));
  connect(_down, SIGNAL(clicked()), this, SLOT(downButtonClicked()));
  connect(_availableListBox, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));
  connect(_selectedListBox, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));

// TODO Icons required.
//  _up->setIcon(QPixmap(":kst_uparrow.png"));
  _up->setText("Up");
//  _down->setIcon(QPixmap(":kst_downarrow.png"));
  _down->setText("Down");
//  _add->setIcon(QPixmap(":kst_rightarrow.png"));
  _add->setText("Add");
//  _remove->setIcon(QPixmap(":kst_leftarrow.png"));
  _remove->setText("Remove");

  _maxLineWidth->setMaximum(LINEWIDTH_MAX);
}
DifferentiateCurvesDialog::DifferentiateCurvesDialog(QWidget *parent)
  : QDialog(parent) {
   setupUi(this);

  if (MainWindow *mw = qobject_cast<MainWindow*>(parent)) {
    _store = mw->document()->objectStore();
  } else {
    // FIXME: we need the object store
    qFatal("ERROR: can't construct a DifferentiateCurvesDialog without the object store");
  }

  resetLists();

  connect(_buttonBox->button(QDialogButtonBox::Cancel), SIGNAL(clicked()), this, SLOT(reject()));
  connect(_buttonBox->button(QDialogButtonBox::Ok), SIGNAL(clicked()), this, SLOT(OKClicked()));
  connect(_buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(apply()));

  connect(_add, SIGNAL(clicked()), this, SLOT(addButtonClicked()));
  connect(_remove, SIGNAL(clicked()), this, SLOT(removeButtonClicked()));
  connect(_up, SIGNAL(clicked()), this, SLOT(upButtonClicked()));
  connect(_down, SIGNAL(clicked()), this, SLOT(downButtonClicked()));
  connect(_availableListBox, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));
  connect(_selectedListBox, SIGNAL(itemSelectionChanged()), this, SLOT(updateButtons()));

  // Use the standard icons
  _up->setIcon(QPixmap(":kst_uparrow.png"));
  _down->setIcon(QPixmap(":kst_downarrow.png"));
  _add->setIcon(QPixmap(":kst_rightarrow.png"));
  _remove->setIcon(QPixmap(":kst_leftarrow.png"));
  _up->setToolTip(i18n("Move the selected property up the priority list"));
  _down->setToolTip(i18n("Move the selected property down the priority list"));
  _add->setToolTip(i18n("Add the selected property to the list of properties to cycle through"));
  _remove->setToolTip(i18n("Remove the selected property from the list of properties to cycle through"));

  _maxLineWidth->setMaximum(LINEWIDTH_MAX);
}
Exemple #7
0
ExportDlg::ExportDlg(QString title, PointSets* pointSets, const CoordSettings* coord,
  const GridMeshSettings* grid, ExportSettings* xport) :
  QDialog(0, "exportdlg", true),
  pointSets(pointSets),
  coord(coord),
  grid(grid),
  xport(xport)
{
  DigitDebug::ctor(QString("exportdlg ") + QString::number((ulong) this, 16));
  
  setCaption(tr("Export Settings - [%1]%2")
    .arg(title)
    .arg(freewareCaption));

  setFixedSize(380, 650);

  // curve selection
  groupCurveSelection = new Q3GroupBox(QString(tr("Curve Selection")), this);
  CHECK_PTR_ENGAUGE(groupCurveSelection);
  groupCurveSelection->setGeometry(10, 10, 360, 150);
  
  labelIncluded = new QLabel(QString(tr("Included")), groupCurveSelection);
  CHECK_PTR_ENGAUGE(labelIncluded);
  labelIncluded->setGeometry(10, 20, 110, 20);

  labelExcluded = new QLabel(QString(tr("Not included")), groupCurveSelection);
  CHECK_PTR_ENGAUGE(labelExcluded);
  labelExcluded->setGeometry(240, 20, 110, 20);
  
  listIncluded = new Q3ListBox(groupCurveSelection);
  CHECK_PTR_ENGAUGE(listIncluded);
  listIncluded->setGeometry(10, 40, 110, 100);
  QWhatsThis::add(listIncluded, QString(tr("List of curves to be included in the exported file")));
  connect(listIncluded, SIGNAL(selectionChanged(Q3ListBoxItem*)), this, SLOT(slotIncluded(Q3ListBoxItem*)));
  
  listExcluded = new Q3ListBox(groupCurveSelection);
  CHECK_PTR_ENGAUGE(listExcluded);
  listExcluded->setGeometry(240, 40, 110, 100);
  QWhatsThis::add(listExcluded, QString(tr("List of curves to be excluded from the exported file")));
  connect(listExcluded, SIGNAL(selectionChanged(Q3ListBoxItem*)), this, SLOT(slotExcluded(Q3ListBoxItem*)));
  
  buttonInclude = new QPushButton(QString(tr("<<Include")), groupCurveSelection);
  CHECK_PTR_ENGAUGE(buttonInclude);
  buttonInclude->setGeometry(130, 40, 100, 30);
  QWhatsThis::add(buttonInclude, QString(tr("Move the currently selected curve from the excluded list "
    "to the included list")));
  connect(buttonInclude, SIGNAL(clicked()), this, SLOT(slotInclude()));
  
  buttonExclude = new QPushButton(QString(tr("Exclude>>")), groupCurveSelection);
  CHECK_PTR_ENGAUGE(buttonExclude);
  buttonExclude->setGeometry(130, 80, 100, 30);
  QWhatsThis::add(buttonExclude, QString(tr("Move the currently selected curve from the included list "
    "to the excluded list")));
  connect(buttonExclude, SIGNAL(clicked()), this, SLOT(slotExclude()));
  
  // points selection
  groupPointsSelection = new Q3ButtonGroup(QString(tr("Points Selection")), this);
  CHECK_PTR_ENGAUGE(groupPointsSelection);
  groupPointsSelection->setGeometry(10, 170, 360, 110);

  buttonXAllCurves = new QRadioButton(QString(tr("Interpolate Y's at X's from all curves")),
    groupPointsSelection);
  CHECK_PTR_ENGAUGE(buttonXAllCurves);
  buttonXAllCurves->setGeometry(10, 20, 300, 20);
  QWhatsThis::add(buttonXAllCurves, QString(tr("Exported file will have values at every unique X "
    "value from every curve. Y values will be linearly interpolated if necessary")));
  connect(buttonXAllCurves, SIGNAL(toggled(bool)), this, SLOT(slotXAllCurves(bool)));

  buttonXFirstCurve = new QRadioButton(QString(tr("Interpolate Y's at X's from first curve")),
    groupPointsSelection);
  CHECK_PTR_ENGAUGE(buttonXFirstCurve);
  buttonXFirstCurve->setGeometry(10, 40, 300, 20);
  QWhatsThis::add(buttonXFirstCurve, QString(tr("Exported file will have values at every unique X "
    "value from the first curve. Y values will be linearly interpolated if necessary")));
  connect(buttonXFirstCurve, SIGNAL(toggled(bool)), this, SLOT(slotXFirstCurve(bool)));

  buttonXGridLines = new QRadioButton(QString(tr("Interpolate Y's at grid line X's")), groupPointsSelection);
  CHECK_PTR_ENGAUGE(buttonXGridLines);
  buttonXGridLines->setGeometry(10, 60, 300, 20);
  QWhatsThis::add(buttonXGridLines, QString(tr("Exported file will have values at every unique X "
    "grid line. Y values will be linearly interpolated if necessary")));
  connect(buttonXGridLines, SIGNAL(toggled(bool)), this, SLOT(slotXGridLines(bool)));

  buttonXYAllCurves = new QRadioButton(QString(tr("Raw X's and Y's")), groupPointsSelection);
  CHECK_PTR_ENGAUGE(buttonXYAllCurves);
  buttonXYAllCurves->setGeometry(10, 80, 300, 20);
  QWhatsThis::add(buttonXYAllCurves, QString(tr("Exported file will have only original X and Y values "
    "without any interpolation")));
  connect(buttonXYAllCurves, SIGNAL(toggled(bool)), this, SLOT(slotXYAllCurves(bool)));

  // layout
  groupLayout = new Q3ButtonGroup(QString(tr("Layout")), this);
  CHECK_PTR_ENGAUGE(groupLayout);
  groupLayout->setGeometry(10, 290, 360, 70);

  buttonAllCurvesOnEachLine = new QRadioButton(QString(tr("All curves on each line")), groupLayout);
  CHECK_PTR_ENGAUGE(buttonAllCurvesOnEachLine);
  buttonAllCurvesOnEachLine->setGeometry(10, 20, 210, 20);
  QWhatsThis::add(buttonAllCurvesOnEachLine, QString(tr("Exported file will have, on each line, "
    "an X value, the Y value for the first curve, the Y value for the second curve,...")));
  connect(buttonAllCurvesOnEachLine, SIGNAL(toggled(bool)), this, SLOT(slotAllCurvesOnEachLine(bool)));

  buttonOneCurveOnEachLine = new QRadioButton(QString(tr("One curve on each line")), groupLayout);
  CHECK_PTR_ENGAUGE(buttonOneCurveOnEachLine);
  buttonOneCurveOnEachLine->setGeometry(10, 40, 210, 20);
  QWhatsThis::add(buttonOneCurveOnEachLine, QString(tr("Exported file will have all the points for "
    "the first curve, with one X-Y pair on each line, then the points for the second curve,...")));
  connect(buttonOneCurveOnEachLine, SIGNAL(toggled(bool)), this, SLOT(slotOneCurveOnEachLine(bool)));

  // delimiters
  groupDelimiters = new Q3ButtonGroup(QString(tr("Delimiters")), this);
  CHECK_PTR_ENGAUGE(groupDelimiters);
  groupDelimiters->setGeometry(10, 370, 113, 90);

  buttonCommas = new QRadioButton(QString(tr("Commas")), groupDelimiters);
  CHECK_PTR_ENGAUGE(buttonCommas);
  buttonCommas->setGeometry(10, 20, 110, 20);
  QWhatsThis::add(buttonCommas, QString(tr("Exported file will have commas between adjacent values")));
  connect(buttonCommas, SIGNAL(toggled(bool)), this, SLOT(slotCommas(bool)));

  buttonSpaces = new QRadioButton(QString(tr("Spaces")), groupDelimiters);
  CHECK_PTR_ENGAUGE(buttonSpaces);
  buttonSpaces->setGeometry(10, 40, 110, 20);
  QWhatsThis::add(buttonSpaces, QString(tr("Exported file will have spaces between adjacent values")));
  connect(buttonSpaces, SIGNAL(toggled(bool)), this, SLOT(slotSpaces(bool)));

  buttonTabs = new QRadioButton(QString(tr("Tabs")), groupDelimiters);
  CHECK_PTR_ENGAUGE(buttonTabs);
  buttonTabs->setGeometry(10, 60, 110, 20);
  QWhatsThis::add(buttonTabs, QString(tr("Exported file will have tabs between adjacent values")));
  connect(buttonTabs, SIGNAL(toggled(bool)), this, SLOT(slotTabs(bool)));

  // header
  groupHeader = new Q3ButtonGroup(QString(tr("Header")), this);
  CHECK_PTR_ENGAUGE(groupHeader);
  groupHeader->setGeometry(133, 370, 113, 90);

  buttonNone = new QRadioButton(QString(tr("None")), groupHeader);
  CHECK_PTR_ENGAUGE(buttonNone);
  buttonNone->setGeometry(10, 20, 110, 20);
  QWhatsThis::add(buttonNone, QString(tr("Exported file will have no header line")));
  connect(buttonNone, SIGNAL(toggled(bool)), this, SLOT(slotNone(bool)));

  buttonSimple = new QRadioButton(QString(tr("Simple")), groupHeader);
  CHECK_PTR_ENGAUGE(buttonSimple);
  buttonSimple->setGeometry(10, 40, 110, 20);
  QWhatsThis::add(buttonSimple, QString(tr("Exported file will have simple header line")));
  connect(buttonSimple, SIGNAL(toggled(bool)), this, SLOT(slotSimple(bool)));

  buttonGnuplot = new QRadioButton(QString(tr("Gnuplot")), groupHeader);
  CHECK_PTR_ENGAUGE(buttonGnuplot);
  buttonGnuplot->setGeometry(10, 60, 110, 20);
  QWhatsThis::add(buttonGnuplot, QString(tr("Exported file will have gnuplot header line")));
  connect(buttonGnuplot, SIGNAL(toggled(bool)), this, SLOT(slotGnuplot(bool)));

  // x label for header
  if (coord->frame == Cartesian)
    labelXThetaLabel = new QLabel(QString(tr("Header X Label")), this);
  else
    labelXThetaLabel = new QLabel(QString(tr("Header Theta Label")), this);
  CHECK_PTR_ENGAUGE(labelXThetaLabel);
  labelXThetaLabel->setGeometry(256, 390, 114, 20);

  editXThetaLabel = new QLineEdit(this);
  CHECK_PTR_ENGAUGE(editXThetaLabel);
  editXThetaLabel->setGeometry(256, 410, 110, 20);
  if (coord->frame == Cartesian)
    QWhatsThis::add(editXThetaLabel, QString(tr("Label in the header for x values")));
  else
    QWhatsThis::add(editXThetaLabel, QString(tr("Label in the header for theta values")));
  connect(editXThetaLabel, SIGNAL(textEdited(const QString&)), this, SLOT(slotXThetaLabel(const QString&)));

  // preview
  labelPreview = new QLabel(QString(tr("Preview")), this);
  CHECK_PTR_ENGAUGE(labelPreview);
  labelPreview->setGeometry(10, 470, 100, 20);

  listPreview = new Q3ListBox(this);
  CHECK_PTR_ENGAUGE(listPreview);
  listPreview->setGeometry(10, 490, 360, 110);
  QWhatsThis::add(listPreview, QString(tr("Preview window shows how current settings affect the exported file")));

  // navigation buttons
  buttonOk = new QPushButton(tr("OK"), this);
  CHECK_PTR_ENGAUGE(buttonOk);
  buttonOk->setGeometry(45, 610, 100, 30);
  connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));

  buttonCancel = new QPushButton(tr("Cancel"), this);
  CHECK_PTR_ENGAUGE(buttonCancel);
  buttonCancel->setGeometry(175, 610, 100, 30);
  connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));

  buttonWhat = new QPushButton(this);
  CHECK_PTR_ENGAUGE(buttonWhat);
  buttonWhat->setPixmap(QPixmap(whatsthis_xpm));
  buttonWhat->setGeometry(305, 610, 60, 30);
  QToolTip::add(buttonWhat, QString(tr("What's this?")));
  connect(buttonWhat, SIGNAL(clicked()), this, SLOT(slotWhat()));

  resetLists();    
  toggleActions();
  updatePreview();
}