MCPcopy Create free account
hub / github.com/Faster3ck/Converseen / overwriteDialog

Method overwriteDialog

src/mainwindowimpl.cpp:1278–1324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1276}
1277
1278void MainWindowImpl::overwriteDialog(QString baseName)
1279{
1280 bool ok;
1281 QString newBaseName;
1282
1283 while (newBaseName.isEmpty()) {
1284 newBaseName = QInputDialog::getText(0, tr("Suggest a new name!"),
1285 tr("New name:"), QLineEdit::Normal,
1286 baseName, &ok);
1287
1288 if (!ok) {
1289 QMessageBox::StandardButton msg;
1290 msg = QMessageBox::question(this, tr("Please, specify a name!"),
1291 tr("You should specify a name.\nClick Retry to specify a new name.\nClick Ignore to cancel this operation.\nClick Abort to cancel all operations."),
1292 QMessageBox::Retry | QMessageBox::Ignore | QMessageBox::Abort);
1293
1294
1295
1296 if (msg == QMessageBox::Ignore) {
1297 convertThread->stopProcess();
1298 break;
1299 }
1300
1301 if (msg == QMessageBox::Abort) {
1302 stopProcess();
1303 break;
1304 }
1305 }
1306 else {
1307 if (newBaseName.isEmpty())
1308 QMessageBox::warning(0, tr("Warning!"),
1309 tr("The filename should not be empty!"));
1310
1311 if (newBaseName == baseName) {
1312 QMessageBox::StandardButton msg;
1313 msg = QMessageBox::question(this, tr("Warning!"),
1314 tr("The name chosen is identical to the initial one. Do you want to overwrite the original file?"),
1315 QMessageBox::Yes | QMessageBox::No); // TODO: mettere si per tutte!
1316
1317 if (msg == QMessageBox::No)
1318 newBaseName.clear();
1319 }
1320 }
1321 }
1322 //convertThread->mutex.unlock();
1323 convertThread->setNewBasename(newBaseName, ok);
1324}
1325
1326void MainWindowImpl::stopProcess()
1327{

Callers

nothing calls this directly

Calls 3

clearMethod · 0.80
setNewBasenameMethod · 0.80
stopProcessMethod · 0.45

Tested by

no test coverage detected