void DatasetsListWidget::sl_renameDataset() { GCOUNTER(cvar, tvar, "WD::Dataset::Rename Dataset"); QAction *a = dynamic_cast<QAction*>(sender()); CHECK(NULL != a, ); int idx = a->property("idx").toInt(); CHECK(idx < tabs->count(), ); bool error = false; QString text = tabs->tabText(idx); do { bool ok = false; text = QInputDialog::getText(this, tr("Rename Dataset"), tr("New dataset name:"), QLineEdit::Normal, text, &ok); if (!ok) { return; } U2OpStatusImpl os; ctrl->renameDataset(idx, text, os); if (os.hasError()) { QMessageBox::critical(this, tr("Error"), os.getError()); } error = os.hasError(); } while (error); tabs->setTabText(idx, text); }
void WizardPageController::applyLayout() { wc->clearControllers(); qDeleteAll(controllers); controllers.clear(); QLayout *old = wPage->layout(); removeLayout(old); U2OpStatusImpl os; page->validate(wc->getCurrentActors(), os); if (os.hasError()) { coreLog.error(os.getError()); setError(wPage); return; } PageContentCreator pcc(wc); page->getContent()->accept(&pcc); if (wc->isBroken()) { setError(wPage); return; } pcc.setPageTitle(page->getTitle()); wPage->setLayout(pcc.getResult()); controllers << pcc.getControllers(); wPage->setFinalPage(page->isFinal()); }
IMPLEMENT_TEST(TextObjectUnitTests, clone_NullDbi) { TextObject object("object", TextObjectTestData::getObjRef()); U2OpStatusImpl os; GObject *clonedGObj = object.clone(U2DbiRef(), os); Q_UNUSED(clonedGObj); CHECK_TRUE(os.hasError(), "no error"); }
Task * BaseThroughWorker::processNextInputMessage() { const Message message = getMessageAndSetupScriptValues(input); U2OpStatusImpl os; Task *task = createTask(message, os); if (os.hasError()) { reportError(os.getError()); } return task; }
IMPLEMENT_TEST(TextObjectUnitTests, clone_NullObj) { U2EntityRef objRef = TextObjectTestData::getObjRef(); objRef.entityId = "some id"; TextObject object("object", objRef); U2OpStatusImpl os; GObject *clonedGObj = object.clone(TextObjectTestData::getDbiRef(), os); Q_UNUSED(clonedGObj); CHECK_TRUE(os.hasError(), "no error"); }
IMPLEMENT_TEST(TextObjectUnitTests, createInstance_WrongDbi) { U2OpStatusImpl os; QScopedPointer<TextObject> object(TextObject::createInstance("some text", "object", U2DbiRef(), os)); CHECK_TRUE(os.hasError(), "no error"); }