Beispiel #1
0
void MainTabs::askForRenaming(int index)
{
    if (index != indexOf(logger)) {
        TextInputDialog * dia = guiHelper->getNameDialog(this, tabBarRef->tabText(index));
        if (dia != nullptr) {
            int res = dia->exec();
            QString newName = dia->getInputText();
            if (res == QDialog::Accepted && !newName.isEmpty()) {
                static_cast<TabAbstract *>(widget(index))->setName(newName);
            }
            delete dia;
        }
    }
}
Beispiel #2
0
void TransformsGui::onSaveToMemory()
{
    if (transformWidgetList.size() == 1) {
        QMessageBox::critical(this,tr("Error"),tr("No transformation selected, nothing to register!"),QMessageBox::Ok);
    } else {

        TextInputDialog * dia = guiHelper->getNameDialog(this, name);
        if (dia != NULL) {
            int ret = dia->exec();
            if (ret == QDialog::Accepted) {
                QString newName = dia->getInputText();
                if (newName.isEmpty())
                    newName = name;
                setName(newName);

                transformFactory->registerChainConf(getCurrentTransformChain(),true);

            }
            delete dia;
        }
    }
}