void TestPage::slotAccel (int id) { switch (id) { case NewTest: newTest(); break; case DeleteTest: deleteTest(); break; case RenameTest: renameTest(); break; case OpenTest: openTest(); break; case CopyTest: copyTest(); break; case Help: slotHelp(); break; default: break; } }
/// Code: int main(int argc, char* argv[]) { #ifdef CH_MPI MPI_Init(&argc, &argv); #endif bool passed = true; int icode = 0; parseTestOptions( argc ,argv ) ; if ( verbose ) pout() << indent2 << "Beginning " << pgmname << " ..." << endl ; icode = copyTest(); if (icode != 0) { pout() << indent << pgmname << " failed with error code " << icode << endl; passed = false; } if (passed) { pout() << indent << pgmname << " passed all tests" << endl; } #ifdef CH_MPI MPI_Finalize(); #endif return icode; }
int main(int argc, const char *argv[]) { copyTest(); readTest(); writeTest(); return 0; }
TestPage::TestPage (QWidget *w, MainMenubar *mb, DBIndex *i) : QWidget (w) { chartIndex = i; menubar = mb; idir.setFilter(QDir::Dirs); QVBoxLayout *vbox = new QVBoxLayout(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 QListBox(this); connect(list, SIGNAL(contextMenuRequested(QListBoxItem *, const QPoint &)), this, SLOT(rightClick(QListBoxItem *))); connect(list, SIGNAL(highlighted(const QString &)), this, SLOT(testSelected(const QString &))); connect(list, SIGNAL(doubleClicked(QListBoxItem *)), this, SLOT(doubleClick(QListBoxItem *))); vbox->addWidget(list); menu = new QPopupMenu(this); menu->insertItem(QPixmap(newchart), tr("&New Rule Ctrl+N"), this, SLOT(newTest())); menu->insertItem(QPixmap(open), tr("&Open Rule Ctrl+O"), this, SLOT(openTest())); menu->insertItem(QPixmap(deleteitem), tr("&Delete Rule Ctrl+D"), this, SLOT(deleteTest())); menu->insertItem(QPixmap(renam), tr("&Rename Rule Ctrl+R"), this, SLOT(renameTest())); menu->insertItem(QPixmap(copypic), tr("&Copy Rule Ctrl+Y"), this, SLOT(copyTest())); menu->insertSeparator(-1); menu->insertItem(QPixmap(help), tr("&Help Ctrl+H"), this, SLOT(slotHelp())); QAccel *a = new QAccel(this); connect(a, SIGNAL(activated(int)), this, SLOT(slotAccel(int))); a->insertItem(CTRL+Key_N, NewTest); a->insertItem(CTRL+Key_O, OpenTest); a->insertItem(CTRL+Key_D, DeleteTest); a->insertItem(CTRL+Key_R, RenameTest); a->insertItem(CTRL+Key_Y, CopyTest); a->insertItem(CTRL+Key_H, Help); updateList(); testNoSelection(); }