QtLingo 1
QtLingo is an Application to make Qt Computer Translations easier
MainWindow.cpp
Go to the documentation of this file.
1
13#include "MainWindow.h"
14// UI
15#include "ui_MainWindow.h"
16
20MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
21{
22 // App Icon
23 QApplication::setWindowIcon(QIcon(":/images/logo32.png"));
24 // Set up UI
25 ui->setupUi(this);
26 #ifdef USE_SQL_FLAG
27 // SQL Database Types Do not Translate these
28 ui->comboBoxSqlDatabaseType->addItem(":memory:");
29 ui->comboBoxSqlDatabaseType->addItem("QSQLITE");
30 ui->comboBoxSqlDatabaseType->addItem("QMYSQL");
31 ui->comboBoxSqlDatabaseType->addItem("QPSQL");
32 ui->comboBoxSqlDatabaseType->addItem("QDB2");
33 ui->comboBoxSqlDatabaseType->addItem("QIBASE");
34 ui->comboBoxSqlDatabaseType->addItem("QOCI");
35 ui->comboBoxSqlDatabaseType->addItem("QTDS");
36 #else
37 ui->comboBoxSqlDatabaseType->setHidden(true);
38 ui->comboBoxTranslationsProjectNames->setHidden(true);
39 ui->pushButtonTranslationsAdd->setHidden(true);
40 ui->pushButtonTranslationsDelete->setHidden(true);
41 ui->pushButtonTranslationsSave->setHidden(true);
42 ui->pushButtonTranslationsProjectBrowser->setHidden(true);
43 ui->tabWidget->removeTab(ui->tabWidget->indexOf(ui->tabWidget->findChild<QWidget*>("tabSQL")));
44 ui->toolBar->actions().at(0)->setVisible(false); // Set Save hidden
45 ui->toolBar->actions().at(1)->setVisible(false); // Set divider hidden
46 ui->labelTranslationsOptions->setHidden(true);
47 #endif
48 // Hide Progress
50 ui->progressBarProjectsFiles->hide();
51 // Connect actions
52 connect(ui->actionExit, &QAction::triggered, this, &MainWindow::close);
53 connect(ui->actionAbout, &QAction::triggered, this, &MainWindow::onAbout);
54 connect(ui->actionHelp, &QAction::triggered, this, &MainWindow::onHelp);
55 connect(ui->actionAuthor, &QAction::triggered, this, &MainWindow::onAuthor);
56 connect(ui->actionClipboard, &QAction::triggered, this, &MainWindow::onClipboard);
57 connect(ui->actionCompile, &QAction::triggered, this, &MainWindow::onCompile);
58 connect(ui->actionSave, &QAction::triggered, this, &MainWindow::onSave);
59 connect(ui->actionTranslate_Help, &QAction::triggered, this, &MainWindow::onTranslateHelp);
60 connect(ui->actionTranslate_ReadMe, &QAction::triggered, this, &MainWindow::onTranslateReadMe);
61 connect(ui->actionAccept_Translations, &QAction::triggered, this, &MainWindow::acceptTranslations);
62 // Set UI Language Code
63 ui->labelSettingsLanguageUI->setText(myQOnlineTranslator.languageCode(myQOnlineTranslator.language(QLocale())));
64 // Set Window Title to Application Name
65 setWindowTitle(QApplication::applicationName());
66 //
67}
68
73{
74 setMessage("~MainWindow", Debug);
75 Q_CLEANUP_RESOURCE(QtLingo);
76 delete ui;
77}
78
82void MainWindow::closeEvent(QCloseEvent *event)
83{
84 setMessage("closeEvent", Debug);
85 if (isSaveSettings) onSave();
87 QMainWindow::closeEvent(event);
88 close();
89} // end closeEvent
90
94void MainWindow::changeEvent(QEvent *event)
95{
96 setMessage("changeEvent", Debug);
97 if (event ->type() == QEvent::LanguageChange && isMainLoaded)
98 {
99 // retranslate designer form (single inheritance approach)
100 ui->retranslateUi(this);
101 // retranslate other widgets which weren't added in designer
102 retranslate();
103 }
104 // remember to call base class implementation
105 QMainWindow::changeEvent(event);
106}
107
112{
113 myLanguageModel = thisLanguageModel;
114 myLanguageModel->mySetting->setMessage("set Language Model", "setLanguageModel", MyOrgSettings::MyMessageTypes::Debug);
116}
117
122{
123 // Create table model:
124 // MySettings Settings
125 // Constants
126 myConstants = new MyConstants();
127 //
128 myDbModel = new MyDatatables(myLanguageModel, myConstants, this);
129 myTranlatorParser = new MyTranlatorParser(myLanguageModel, this);
130 // Read in Settings First
132 myUiLanguageName = myLanguageModel->languageCodeToName(myLanguageModel->getDefaultLanguageCode());
133 //
134 // Progress bar
136 // Do a one time Single Shot call to onRunFirstOnStartup to allow the GUI to load before calling what is in that call
137 QTimer::singleShot(666, this, &MainWindow::onRunFirstOnStartup);
138}
139
143void MainWindow::loadLanguage(const QString &thisLanguage)
144{
145 if (getLastLanguageName() != thisLanguage)
146 {
147 myLanguageModel->setLanguage(thisLanguage);
148 //loadLanguageComboBox(); // retranlate
149 }
150}
151
155void MainWindow::setLastLanguageName(const QString &thisLastLanguageName)
156{
157 myLastLanguageName = thisLastLanguageName;
158}
159
164{
165 return myLastLanguageName;
166}
167
172{
173 ui->statusbar->showMessage(tr("Internet is down, trying to reconnect"));
174}
175
180{
181 setMessage("retranslate", Debug);
182 // FIXME
185}
186
190void MainWindow::setMainLoaded(bool thisState)
191{
192 isMainLoaded = thisState;
193 myLanguageModel->setMainLoaded(thisState);
194}
195
200{
201 setMessage("loadLanguageComboBoxSource", Debug);
202 //
203 QMetaEnum theEnum = QMetaEnum::fromType<QOnlineTranslator::Language>();
204 bool lastIsMainLoaded = isMainLoaded;
205 setMainLoaded(false);
206 int theCurrentIndex = ui->comboBoxTranslationSourceLanguage->currentIndex();
207 if (theCurrentIndex < 0)
208 {
209 theCurrentIndex = -1; // FIXME
210 }
212 //
213 QStandardItemModel *theLangModel = new QStandardItemModel(this);
214 theLangModel->setColumnCount(2);
215 for (int k = 0; k < theEnum.keyCount(); k++)
216 {
217 QString theLanguageName = theEnum.key(k);
218 //QString theLanguageName = myQOnlineTranslator.languageNameToCode(e.key(k));
219 QStandardItem* theCol0 = new QStandardItem(theLanguageName);
220 QStandardItem* theCol1 = new QStandardItem(tr(theLanguageName.toLocal8Bit()));
221 theLangModel->setItem(k, 0, theCol0);
222 theLangModel->setItem(k, 1, theCol1);
223 } // end for
224 QTableView* tableView = new QTableView(this);
225 tableView->setModel(theLangModel);
226 tableView->verticalHeader()->setVisible(false);
227 tableView->horizontalHeader()->setVisible(false);
228 tableView->setColumnWidth (0, 196);
229 tableView->setColumnWidth (1, 196);
230 tableView->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
231 tableView->setSelectionBehavior(QAbstractItemView::SelectRows);
232 tableView->setAutoScroll(false);
233 // Set comboBox
234 ui->comboBoxTranslationSourceLanguage->setMinimumWidth(400);
235 ui->comboBoxTranslationSourceLanguage->setModel(theLangModel);
236 ui->comboBoxTranslationSourceLanguage->setView(tableView);
237 if (theCurrentIndex == -1)
238 { ui->comboBoxTranslationSourceLanguage->setCurrentIndex(ui->comboBoxTranslationSourceLanguage->findText(mySourceLanguage)); }
239 else
240 { ui->comboBoxTranslationSourceLanguage->setCurrentIndex(theCurrentIndex); }
242 setMainLoaded(lastIsMainLoaded);
243}
244
249{
250 ui->labelTranslationsSourceLanguageCode->setText(myLanguageModel->languageNameToCode(ui->comboBoxTranslationSourceLanguage->currentText()));
251}
252
257{
258 myLanguageModel->mySetting->setMessage("load Language ComboBox", "loadLanguageComboBox", MyOrgSettings::MyMessageTypes::Debug);
259 bool lastMainLoaded = getMainLoaded();
260 setMainLoaded(false);
261 int theCurrentIndex = ui->comboBoxLanguage->currentIndex();
262 ui->comboBoxLanguage->clear();
263 const QStringList theQmFiles = myLanguageModel->getQmFiles(myLanguageModel->getTranslationSource());
264 QStandardItemModel *theLangModel = new QStandardItemModel(this);
265 theLangModel->setColumnCount(2);
266 for (int i = 0; i < theQmFiles.size(); ++i)
267 {
268 QString theLanguageName = myLanguageModel->getLanguageFromFile(myLanguageModel->getTransFilePrefix(), theQmFiles.at(i));
269 QStandardItem* theCol0 = new QStandardItem(theLanguageName);
270 QStandardItem* theCol1 = new QStandardItem(myLanguageModel->translateThis(theLanguageName));
271 theLangModel->setItem(i, 0, theCol0);
272 theLangModel->setItem(i, 1, theCol1);
273 } // end for
274 QTableView* theTableView = new QTableView(this);
275 theTableView->setModel(theLangModel);
276 theTableView->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
277 theTableView->setSelectionBehavior(QAbstractItemView::SelectRows);
278 theTableView->setAutoScroll(false);
279 theTableView->verticalHeader()->setVisible(false);
280 theTableView->horizontalHeader()->setVisible(false);
281 theTableView->setColumnWidth (0, 196);
282 theTableView->setColumnWidth (1, 196);
283 // Set comboBox
284 ui->comboBoxLanguage->setMinimumWidth(400);
285 ui->comboBoxLanguage->setModel(theLangModel);
286 ui->comboBoxLanguage->setView(theTableView);
287 // Bold UI Language name
288 QStandardItemModel *m = qobject_cast<QStandardItemModel *>(ui->comboBoxLanguage->model());
289 // FIXME
290 QString theDefaultLangageName = myLanguageModel->languageCodeToName(myLanguageModel->getDefaultLanguageCode());
291 QStandardItem *item = m ? m->item(ui->comboBoxLanguage->findText(theDefaultLangageName)) : nullptr;
292 if (item)
293 {
294 auto f = item->font();
295 f.setBold(true);
296 item->setFont(f);
297 }
298 if (theCurrentIndex > 0)
299 {
300 ui->comboBoxLanguage->setCurrentIndex(theCurrentIndex);
301 }
302 else
303 {
304 ui->comboBoxLanguage->setCurrentIndex(ui->comboBoxLanguage->findText(myLanguageModel->getLanguageName()));
305 }
306 setMainLoaded(lastMainLoaded); // Set to prevent triggers
307}
308
313{
314 setMessage("loadQtProjectCombo", Debug);
315 #ifdef USE_SQL_FLAG
316 bool lastIsMainLoaded = isMainLoaded;
317 isMainLoaded = false;
318 myLanguageModel->setMainLoaded(false);
320 QSqlQueryModel *theModalQtLingo = new QSqlQueryModel(this);
321 // SELECT id, QtProjectName FROM Projects
322 const auto SELECTED_PROJECTS_SQL = QLatin1String(R"(%1)").arg(myDbModel->getQtProjectNameSelectQuery());
323 theModalQtLingo->setQuery(SELECTED_PROJECTS_SQL);
324 if (theModalQtLingo->lastError().isValid()) { qWarning() << theModalQtLingo->lastError(); }
325 theModalQtLingo->setHeaderData(0,Qt::Horizontal, tr("ID"));
326 theModalQtLingo->setHeaderData(1, Qt::Horizontal, tr("Project"));
327 QTableView *theTableView = new QTableView;
328 theTableView->setModel(theModalQtLingo);
329 theTableView->setSelectionBehavior(QAbstractItemView::SelectRows);
330 theTableView->setSelectionMode(QAbstractItemView::SingleSelection);
331 theTableView->verticalHeader()->setVisible(false);
332 theTableView->horizontalHeader()->setVisible(false);
333 theTableView->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
334 theTableView->setAutoScroll(false);
335 //theTableView->setColumnHidden(0, true);
336 theTableView->setColumnWidth (1, 296);
337 //ui->comboBoxProjectNames->setModel(nullptr);
338 ui->comboBoxTranslationsProjectNames->setModel(theModalQtLingo);
339 ui->comboBoxTranslationsProjectNames->setView(theTableView);
340 ui->comboBoxTranslationsProjectNames->setMinimumWidth(300);
341 ui->comboBoxTranslationsProjectNames->setModelColumn(1);
342 ui->comboBoxTranslationsProjectNames->setCurrentIndex(0);
343 // Set by Project name or Index
344 QString theProjectName = myDbModel->getProjectName();
345 ui->comboBoxTranslationsProjectNames->setCurrentIndex(ui->comboBoxTranslationsProjectNames->findText(theProjectName));
346 // int theProjectIndex = mySqlDb->getProjectID().toInt();
347 // ui->comboBoxProjectNames->setCurrentIndex(theProjectIndex);
348 isMainLoaded = lastIsMainLoaded;
349 myLanguageModel->setMainLoaded(lastIsMainLoaded);
350 #endif
351}
352
357{
358 return isMainLoaded;
359}
360
365{
366 setMainLoaded(false);
368 // Go to Tab
369 ui->tabWidget->setCurrentIndex(ui->tabWidget->indexOf(ui->tabWidget->findChild<QWidget*>("tabSettings")));
370 // Read Settings
372 // Read Saved Language
373 myLanguageModel->readLanguage();
374 // Get Language File
375 //QString theQmLanguageFile = myLanguageModel->getLanguageFile(myLanguageModel->getLanguageCode(), myLanguageModel->getTranslationSource(), myLanguageModel->getTransFilePrefix());
376 // Load Language
377 //myLanguageModel->loadLanguage(theQmLanguageFile);
378 loadLanguage(myLanguageModel->getLanguageName());
379 //QString theLastLanguage = myLanguageModel->getLanguageFromFile(myLanguageModel->getTransFilePrefix(), theQmLanguageFile);
381 //
382 setMessage("onRunFirstOnStartup", Debug);
383 //
384 if (!myDbModel->checkDatabase()) close();
386 //
387 if (!fillForms(myDbModel->getProjectID()))
388 {
390 }
392 //
394 //
395 setPrograms();
396 //
397 setMainLoaded(true);
398}
399
404{
405 isDebugMessage = myLanguageModel->mySetting->readSettingsBool(myLanguageModel->mySetting->MY_IS_DEBUG_MESSAGE, isDebugMessage);
406 if (isDebugMessage)
407 { ui->checkBoxSettignsMessaging->setCheckState(Qt::CheckState::Checked); }
408 else
409 { ui->checkBoxSettignsMessaging->setCheckState(Qt::CheckState::Unchecked); }
410 setMessagingStates(isDebugMessage);
411 // Go to Tab
412 int theIndex = myLanguageModel->mySetting->readSettingsInt(myLanguageModel->mySetting->MY_LAST_TAB_INDEX, myLanguageModel->mySetting->MY_DEFAULT_TAB_INDEX.toInt());
413 if (theIndex < 0)
414 {
415 theIndex = 0;
416 }
417 ui->tabWidget->setCurrentIndex(theIndex);
418}
419
424{
425 setMessage("readAllSettings", Debug);
426 //resize(myMySettings->getGeometrySize());
427 //move(myMySettings->getGeometryPos());
428 //
429 //if(myMySettings->getGeometryMax()) setWindowState(windowState() | Qt::WindowMaximized);
430 //if(myMySettings->getGeometryMin()) setWindowState(windowState() | Qt::WindowMinimized);
431 //
432 //
435}
436
441{
442 setMessage("writeAllSettings", Debug);
443 myLanguageModel->mySetting->writeSettings(myConstants->MY_IS_DEBUG_MESSAGE, isDebugMessage ? "true" : "false");
444 // Write Geometry on exit
445 myLanguageModel->mySetting->setGeometry(saveGeometry());
446 myLanguageModel->mySetting->setWindowState(saveState());
447 // Last Tab
448 myLanguageModel->mySetting->writeSettings(myLanguageModel->mySetting->MY_LAST_TAB_INDEX, QString::number(ui->tabWidget->currentIndex()));
449 //
452}
453
458{
459 setMessage("readStatesChanges", Debug);
460 restoreGeometry(myLanguageModel->mySetting->getGeometry());
461 restoreState(myLanguageModel->mySetting->getWindowState());
462 // SQL Memory option Chech
463 // default set to myProjectID="-1"
464 QString theProjectID = myLanguageModel->mySetting->readSettings(myConstants->MY_SQL_PROJECT_ID, myDbModel->getProjectID());
465 // We cannot read from the database yet, we are only getting the last states we know of
466 if (theProjectID != "-1") { myDbModel->setProjectID(theProjectID); } else { myDbModel->setProjectID("1"); }
467 myDbModel->setProjectName(myLanguageModel->mySetting->readSettings(myConstants->MY_SQL_PROJECT_NAME, myDbModel->getProjectName()));
468 // Project ID
469 ui->labelRecordIdProject->setText(myDbModel->getProjectID());
470 // Trans Engine
471 // Google
472 ui->checkBoxSettingsGoogle->setCheckState((myLanguageModel->mySetting->readSettings(myConstants->MY_TRANS_ENGINE_GOOGLE_VALUE, "true")) == "true" ? Qt::CheckState::Checked : Qt::CheckState::Unchecked);
473 // Bing
474 ui->checkBoxSettingsBing->setCheckState((myLanguageModel->mySetting->readSettings(myConstants->MY_TRANS_ENGINE_BING_VALUE, "true")) == "true" ? Qt::CheckState::Checked : Qt::CheckState::Unchecked);
475 // Yandex
476 ui->checkBoxSettingsYandex->setCheckState((myLanguageModel->mySetting->readSettings(myConstants->MY_TRANS_ENGINE_YANDEX_VALUE, "true")) == "true" ? Qt::CheckState::Checked : Qt::CheckState::Unchecked);
477 // Delay
479}
480
485{
486 setMessage("writeStateChanges", Debug);
487 // Project ID
490 // Trans Engines
491 // Google
492 myLanguageModel->mySetting->writeSettings(myConstants->MY_TRANS_ENGINE_GOOGLE_VALUE, (ui->checkBoxSettingsGoogle->isChecked()) ? "true" : "false" );
493 // Bing
494 myLanguageModel->mySetting->writeSettings(myConstants->MY_TRANS_ENGINE_BING_VALUE, (ui->checkBoxSettingsBing->isChecked()) ? "true" : "false" );
495 // Yandex
496 myLanguageModel->mySetting->writeSettings(myConstants->MY_TRANS_ENGINE_YANDEX_VALUE, (ui->checkBoxSettingsYandex->isChecked()) ? "true" : "false" );
497 // Language
498 myLanguageModel->mySetting->writeSettings(myConstants->MY_LANGUAGE_COMBO_STATE, QString::number(ui->comboBoxLanguage->currentIndex()));
499 // Delay
501 // Language ComboBox
502 myLanguageModel->setLanguageCode(myLanguageModel->languageNameToCode(ui->comboBoxLanguage->currentText()));
503 //myLanguageModel->writeLanguage();
504}
505
510{
511 setMessage("writeSqlDatabaseInfo", Debug);
512 // SQL Database Type Index
513 myLanguageModel->mySetting->writeSettings(myConstants->MY_SQL_COMBO_STATE, QString::number(ui->comboBoxSqlDatabaseType->currentIndex()));
514 // SQL Database Type Value
515 myLanguageModel->mySetting->writeSettings(myConstants->MY_SQL_DB_TYPE, ui->comboBoxSqlDatabaseType->currentText());
516 // SQL Database Name
518 // SQL Database Type Host
520 // SQL Database Type User
522 // SQL Encrypted Password, it is saved in Ini file
523 if (!ui->lineEditSqlPassword->text().isEmpty())
524 { myLanguageModel->mySetting->writeSettings(myConstants->MY_SQL_DB_PASS, myLanguageModel->mySetting->encryptThis(ui->lineEditSqlPassword->text())); }
525}
526
531{
532 setMessage("readSqlDatabaseInfo", Debug);
533 QString theDb = QString("%1%2%3.db").arg(myLanguageModel->mySetting->getAppDataLocation(), QDir::separator(), myDbModel->mySqlModel->getSqlDatabaseName());
534 // SQL Database Name
535 ui->lineEditSqlDatabaseName->setText(myLanguageModel->mySetting->readSettings(myConstants->MY_SQL_DB_NAME, theDb));
536 // Set ComboBox for SQL
537 ui->comboBoxSqlDatabaseType->setCurrentIndex(myLanguageModel->mySetting->readSettingsInt(myConstants->MY_SQL_COMBO_STATE, 1));
538 // SQL Type Value
540 // SQL Host
541 ui->lineEditSqlHostName->setText(myLanguageModel->mySetting->readSettings(myConstants->MY_SQL_DB_HOST, "")); // No Default
542 // SQL User
543 ui->lineEditSqlUserName->setText(myLanguageModel->mySetting->readSettings(myConstants->MY_SQL_DB_USER, "")); // No Default
544 // SQL Decrypt Password, it is saved in Ini file
545 QString thePassword = myLanguageModel->mySetting->decryptThis(myLanguageModel->mySetting->readSettings(myConstants->MY_SQL_DB_PASS, ""));
546 if (!thePassword.isEmpty())
547 { ui->lineEditSqlPassword->setText(thePassword); }
548 else
549 { ui->lineEditSqlPassword->setText(""); }
550}
551
556{
557 setMessage("onAuthor", Debug);
558 // Go to Tab
559 ui->tabWidget->setCurrentIndex(ui->tabWidget->indexOf(ui->tabWidget->findChild<QWidget*>("tabHelp")));
560 //
561 QString theFileName = QString(":help/About-Author_%1.md").arg(myLanguageModel->getLanguageCode());
562 if (!myLanguageModel->mySetting->isFileExists(theFileName))
563 { theFileName = QString(":help/About-Author_%1.md").arg(myConstants->MY_DEFAULT_LANGUAGE_CODE); }
564 ui->textEditHelp->setMarkdown(myLanguageModel->mySetting->readFile(theFileName));
565}
566
571{
572 setMessage("onAbout", Debug);
573 // Go to Tab
574 ui->tabWidget->setCurrentIndex(ui->tabWidget->indexOf(ui->tabWidget->findChild<QWidget*>("tabHelp")));
575 //
576 QString theFileName = QString(":help/About_%1.md").arg(myLanguageModel->getLanguageCode());
577 if (!myLanguageModel->mySetting->isFileExists(theFileName))
578 { theFileName = QString(":help/About_%1.md").arg(myConstants->MY_DEFAULT_LANGUAGE_CODE); }
579 ui->textEditHelp->setMarkdown(myLanguageModel->mySetting->readFile(theFileName));
580}
581
586{
587 setMessage("onHelp", Debug);
588 // Go to Tab
589 ui->tabWidget->setCurrentIndex(ui->tabWidget->indexOf(ui->tabWidget->findChild<QWidget*>("tabHelp")));
590 //
591 QString theFileName = QString(":help/Help_%1.md").arg(myLanguageModel->getLanguageCode());
592 if (!myLanguageModel->mySetting->isFileExists(theFileName))
593 { theFileName = QString(":help/Help_%1.md").arg(myConstants->MY_DEFAULT_LANGUAGE_CODE); }
594 QString theFileContent = myLanguageModel->mySetting->readFile(theFileName);
595 // Do not translate this file
596 QString theLanguageFileName = ":help/Language.txt";
597 if (myLanguageModel->mySetting->isFileExists(theLanguageFileName))
598 {
599 theFileContent.append(myLanguageModel->mySetting->readFile(theLanguageFileName));
600 }
601 ui->textEditHelp->setMarkdown(theFileContent);
602}
603
607void MainWindow::on_pushButtonTranslationsSourceBrowse_clicked()
608{
609 setMessage("on_pushButtonTranslationsSourceBrowse_clicked", Debug);
610 QFileDialog dialogTranslationFolder;
611 dialogTranslationFolder.setFileMode(QFileDialog::Directory);
612 dialogTranslationFolder.setOption(QFileDialog::ShowDirsOnly);
613 dialogTranslationFolder.setOption(QFileDialog::DontResolveSymlinks);
614 //
615 QString theTranslationFolder = dialogTranslationFolder.getExistingDirectory(this, tr("Translation Source Folder Location"), myConstants->MY_TRANSLATION_FOLDER);
616 //QString theTranslationFolder = dialogTranslationFolder.getExistingDirectory(this, tr("Translation Source Folder Location"), myLanguageModel->mySetting->getQtProjectPath());
617 if (!theTranslationFolder.isEmpty())
618 { ui->lineEditTranslationsSource->setText(theTranslationFolder); }
619}
620
624void MainWindow::on_pushButtonTranslationsDoxyfileBrowse_clicked()
625{
626 setMessage("on_pushButtonTranslationsDoxyfileBrowse_clicked", Debug);
627 QFileDialog dialogTranslationFolder;
628 dialogTranslationFolder.setFileMode(QFileDialog::Directory);
629 dialogTranslationFolder.setOption(QFileDialog::ShowDirsOnly);
630 dialogTranslationFolder.setOption(QFileDialog::DontResolveSymlinks);
631 //
632 QString theTranslationFolder = dialogTranslationFolder.getExistingDirectory(this, tr("Translation Doxyfile Folder Location"), myLanguageModel->mySetting->getLastApplicationPath());
633 if (!theTranslationFolder.isEmpty())
634 { ui->lineEditTranslationsDoxyfile->setText(theTranslationFolder); }
635}
636
640void MainWindow::on_pushButtonTranslationsProjectFolderBrowse_clicked()
641{
642 setMessage("on_pushButtonTranslationsProjectFolderBrowse_clicked", Debug);
643 QFileDialog dialogTranslationFolder;
644 dialogTranslationFolder.setFileMode(QFileDialog::Directory);
645 dialogTranslationFolder.setOption(QFileDialog::ShowDirsOnly);
646 dialogTranslationFolder.setOption(QFileDialog::DontResolveSymlinks);
647 //
648 QString theTranslationFolder = dialogTranslationFolder.getExistingDirectory(this, tr("Projects Folder Location"), myLanguageModel->mySetting->getLastApplicationPath());
649 if (!theTranslationFolder.isEmpty())
650 { ui->lineEditTranslationsProjectFolder->setText(theTranslationFolder); }
651}
652
656void MainWindow::on_comboBoxLanguage_currentIndexChanged(const QString &thisLanguage)
657{
658 setMessage("on_comboBoxLanguage_currentIndexChanged", Debug);
659 if (!getMainLoaded()) { return; }
660 loadLanguage(thisLanguage);
661}
662
666void MainWindow::on_checkBoxSettingsGoogle_stateChanged(int thisArg)
667{
668 Q_UNUSED(thisArg)
669 if (!isMainLoaded) { return; }
670 setMessage("on_checkBoxSettingsGoogle_stateChanged", Debug);
672}
673
677void MainWindow::on_checkBoxSettingsBing_stateChanged(int thisArg)
678{
679 Q_UNUSED(thisArg)
680 if (!isMainLoaded) { return; }
681 setMessage("on_checkBoxSettingsBing_stateChanged", Debug);
683}
684
688void MainWindow::on_checkBoxSettingsYandex_stateChanged(int thisArg)
689{
690 Q_UNUSED(thisArg)
691 if (!isMainLoaded) { return; }
692 setMessage("on_checkBoxSettingsYandex_stateChanged", Debug);
694}
695
699void MainWindow::on_pushButtonSqlDatabaseNameBrowse_clicked()
700{
701 setMessage("on_pushButtonSqlDatabaseNameBrowse_clicked", Debug);
702 QFileDialog dialogSqlDbFolder;
703 dialogSqlDbFolder.setFileMode(QFileDialog::Directory);
704 dialogSqlDbFolder.setOption(QFileDialog::ShowDirsOnly);
705 dialogSqlDbFolder.setOption(QFileDialog::DontResolveSymlinks);
706 //
707 QString theSqlFolder = dialogSqlDbFolder.getExistingDirectory(this, tr("Sqlite Folder Location"), myLanguageModel->mySetting->getAppDataLocation());
708 if (!theSqlFolder.isEmpty())
709 {
710 QString theDbLocation = ui->lineEditSqlDatabaseName->text();
711 QString theDbNewLocation = QString("%1/%2.db").arg(theSqlFolder, myDbModel->mySqlModel->getSqlDatabaseName());
712 if (theDbLocation != theDbNewLocation)
713 {
714 //
715 if (myLanguageModel->mySetting->getFileInfo(MyOrgSettings::IsFile, ui->lineEditSqlDatabaseName->text()) == "true")
716 {
717 QString thePath = myLanguageModel->mySetting->getFileInfo(MyOrgSettings::CanonicalFilePath, ui->lineEditSqlDatabaseName->text());
718 // moveDb
719 if (myDbModel->mySqlModel->moveDb(theDbNewLocation, thePath, theDbNewLocation))
720 { ui->lineEditSqlDatabaseName->setText(theDbNewLocation); }
721 else
722 { myLanguageModel->mySetting->showMessageBox(QObject::tr("Database Move Failed").toLocal8Bit(), QString("%1: %2").arg(tr("Failed to move Database"), ui->lineEditSqlDatabaseName->text()).toLocal8Bit(), myLanguageModel->mySetting->Critical); }
723 }
724 }
725 }
726}
727
731void MainWindow::on_comboBoxTranslationsProjectNames_currentIndexChanged(int thisIndex)
732{
733 Q_UNUSED(thisIndex) // not the same as theIndex
734 if (!isMainLoaded) { return; }
735 QString theIndex = ui->comboBoxTranslationsProjectNames->model()->data(ui->comboBoxTranslationsProjectNames->model()->index(ui->comboBoxTranslationsProjectNames->currentIndex(), 0)).toString();
736 setMessage("on_comboBoxTranslationsProjectNames_currentIndexChanged = " + QString::number(thisIndex) + " and thisIndex = " + theIndex, Debug);
737 fillForms(theIndex);
738}
739
744{
745 QAbstractItemModel *theModel = ui->comboBoxTranslationsProjectNames->model();
746 QModelIndex theIndex = theModel->index(thisIndex, 0); // 0 Refers to the first item or ID
747 return theModel->data(theIndex).toString().trimmed(); // Returns 'Item 0'
748}
749
753void MainWindow::on_pushButtonSqlPasswordShow_clicked()
754{
755 setMessage("on_pushButtonSqlPasswordShow_clicked", Debug);
756 myLanguageModel->mySetting->showMessageBox(QObject::tr("Password Revieled").toLocal8Bit(), ui->lineEditSqlPassword->text().toLocal8Bit(), myLanguageModel->mySetting->Information);
757}
758
762void MainWindow::on_pushButtonSqlSave_clicked()
763{
764 setMessage("on_pushButtonSqlSave_clicked", Debug);
766}
767
772{
773 setMessage("onSave", Debug);
775 myDbModel->saveQtProject();
777}
778
782void MainWindow::on_pushButtonTranslationsSave_clicked()
783{
784 setMessage("on_pushButtonTranslationsSave_clicked", Debug);
785 onSave();
786}
787
791void MainWindow::on_pushButtonTranslationsClear_clicked()
792{
793 setMainLoaded(false);
795 setMainLoaded(true);
796}
797
801void MainWindow::on_pushButtonTranslationsAdd_clicked()
802{
803 setMessage("on_pushButtonTranslationsAdd_clicked", Debug);
805 myDbModel->addQtProject();
806 ui->labelRecordIdProject->setText(myDbModel->getProjectID());
808}
809
813void MainWindow::on_pushButtonTranslationsDelete_clicked()
814{
815 setMessage("on_pushButtonTranslationsDelete_clicked", Debug);
817 myDbModel->deleteQtProject(ui->labelRecordIdProject->text());
818}
819
823void MainWindow::on_pushButtonTranslationsProjectsBrowser_clicked()
824{
825 setMessage("on_pushButtonTranslationsProjectsBrowser_clicked", Debug);
826 QFileDialog dialogTranslationFolder;
827 dialogTranslationFolder.setFileMode(QFileDialog::Directory);
828 dialogTranslationFolder.setOption(QFileDialog::ShowDirsOnly);
829 dialogTranslationFolder.setOption(QFileDialog::DontResolveSymlinks);
830 //
831 QString theTranslationFolder = dialogTranslationFolder.getExistingDirectory(this, tr("Projects Folder Location"), myLanguageModel->mySetting->getLastApplicationPath());
832 if (!theTranslationFolder.isEmpty())
833 { ui->lineEditProjectName->setText(theTranslationFolder); }
834}
835
840{
841 setMessage("setPrograms", Debug);
842 QString theLupdatePath = "/usr/bin/lupdate";
843 QString theLreleasePath = "/usr/bin/lrelease";
844
845// #if Q_OS_MSDOS || defined(Q_OS_WIN32) || defined(Q_OS_WINCE)
846// // FIXME Qt Folder have not tested this code
847// QString theQtEnv;
848// theLupdatePath = mySqlDb->mySqlModel->runProcces("where", "lupdate.exe", true, 60);
849// if (theLupdatePath.isEmpty())
850// {
851// theQtEnv = myLanguageModel->mySetting->getEnvironmentVar("Qt");
852// if (theQtEnv.isEmpty())
853// {
854// theLupdatePath = QString("%1/lupdate.exe").arg(theQtEnv);
855// }
856// else
857// {
858// theLupdatePath = "c:/Qt/lupdate.exe";
859// }
860// }
861// theLreleasePath = mySqlDb->mySqlModel->runProcces("where", "lrelease.exe", true, 60);
862// if (theLreleasePath.isEmpty())
863// {
864// theQtEnv = myLanguageModel->mySetting->getEnvironmentVar("Qt");
865// if (theQtEnv.isEmpty())
866// {
867// theLreleasePath = QString("%1/lrelease.exe").arg(theQtEnv);
868// }
869// else
870// {
871// theLreleasePath = "c:/Qt/lrelease.exe";
872// }
873// }
874// ui->lineEditSettingsLupdate->setText(theLupdatePath);
875// ui->lineEditSettingsLrelease->setText(theLreleasePath);
876// #else
877 if (!myLanguageModel->mySetting->isFileExists(theLupdatePath))
878 {
879 theLupdatePath = myDbModel->mySqlModel->runProcces("which", "lupdate", true, 60);
880 if (theLupdatePath.isEmpty())
881 { theLupdatePath = myDbModel->mySqlModel->runProcces("type -P", "lupdate", true, 60); }
882 }
883 if (!myLanguageModel->mySetting->isFileExists(theLreleasePath))
884 {
885 theLreleasePath = myDbModel->mySqlModel->runProcces("which", "lrelease", true, 60);
886 if (theLreleasePath.isEmpty())
887 { theLreleasePath = myDbModel->mySqlModel->runProcces("type -P", "lrelease", true, 60); }
888 }
889// #endif
890 ui->lineEditSettingsLupdate->setText(theLupdatePath);
891 ui->lineEditSettingsLrelease->setText(theLreleasePath);
892}
893
898{
899 setMessage("settingsButtons", Debug);
900 ui->pushButtonSqlDatabaseNameBrowse->setEnabled(ui->comboBoxSqlDatabaseType->currentText() == myConstants->MY_SQL_DEFAULT || ui->comboBoxSqlDatabaseType->currentText() == ":memory:");
901}
902
906void MainWindow::on_comboBoxSqlDatabaseType_currentIndexChanged(const QString &thisSqlType)
907{
908 if (!isMainLoaded) { return; }
909 setMessage("on_comboBoxSqlDatabaseType_currentIndexChanged=" + thisSqlType, Debug);
910 myDbModel->mySqlModel->setSqlDriver(thisSqlType);
913}
914
919{
920 setMessage("languageChecked", Debug);
921 myLanguages = "";
922 checkLanguage("Amharic", "am" , ui->checkBoxTranslationsAM->isChecked());
923 checkLanguage("Afrikaans", "af" , ui->checkBoxTranslationsAF->isChecked());
924 checkLanguage("Albanian", "sq" , ui->checkBoxTranslationsSQ->isChecked());
925 checkLanguage("Arabic", "ar" , ui->checkBoxTranslationsAR->isChecked());
926 checkLanguage("Armenian", "hy" , ui->checkBoxTranslationsHY->isChecked());
927 checkLanguage("Azerbaijani", "az" , ui->checkBoxTranslationsAZ->isChecked());
928 checkLanguage("Basque", "eu" , ui->checkBoxTranslationsEU->isChecked());
929 checkLanguage("Bashkir", "ba" , ui->checkBoxTranslationsBA->isChecked());
930 checkLanguage("Belarusian", "be" , ui->checkBoxTranslationsBE->isChecked());
931 checkLanguage("Bengali", "bn" , ui->checkBoxTranslationsBN->isChecked());
932 checkLanguage("Bosnian", "bs" , ui->checkBoxTranslationsBS->isChecked());
933 checkLanguage("Bulgarian", "bg" , ui->checkBoxTranslationsBG->isChecked());
934 checkLanguage("Catalan", "ca" , ui->checkBoxTranslationsCA->isChecked());
935 checkLanguage("Chichewa", "ny" , ui->checkBoxTranslationsNY->isChecked());
936 checkLanguage("Corsican", "co" , ui->checkBoxTranslationsCO->isChecked());
937 checkLanguage("Croatian", "hr" , ui->checkBoxTranslationsHR->isChecked());
938 checkLanguage("Czech", "cs" , ui->checkBoxTranslationsCS->isChecked());
939 checkLanguage("Danish", "da" , ui->checkBoxTranslationsDA->isChecked());
940 checkLanguage("Dutch", "nl" , ui->checkBoxTranslationsNL->isChecked());
941 checkLanguage("English", "en" , ui->checkBoxTranslationsEN->isChecked());
942 checkLanguage("Esperanto", "eo" , ui->checkBoxTranslationsEO->isChecked());
943 checkLanguage("Estonian", "et" , ui->checkBoxTranslationsET->isChecked());
944 checkLanguage("Faeroese", "fo" , ui->checkBoxTranslationsFO->isChecked());
945 checkLanguage("Farsi", "fa" , ui->checkBoxTranslationsFA->isChecked());
946 checkLanguage("Finnish", "fi" , ui->checkBoxTranslationsFI->isChecked());
947 checkLanguage("Fijian", "fj" , ui->checkBoxTranslationsFJ->isChecked());
948 checkLanguage("French", "fr" , ui->checkBoxTranslationsFR->isChecked());
949 checkLanguage("Frisian", "fy" , ui->checkBoxTranslationsFY->isChecked());
950 checkLanguage("Gaelic", "gd" , ui->checkBoxTranslationsGD->isChecked());
951 checkLanguage("Galician", "gl" , ui->checkBoxTranslationsGL->isChecked());
952 checkLanguage("German", "de" , ui->checkBoxTranslationsDE->isChecked());
953 checkLanguage("Georgian", "ka" , ui->checkBoxTranslationsKA->isChecked());
954 checkLanguage("Greek", "el" , ui->checkBoxTranslationsEL->isChecked());
955 checkLanguage("Gujarati", "gu" , ui->checkBoxTranslationsGU->isChecked());
956 checkLanguage("Haitian", "ht" , ui->checkBoxTranslationsHT->isChecked());
957 checkLanguage("Hausa", "ha" , ui->checkBoxTranslationsHA->isChecked());
958 checkLanguage("Hebrew", "he" , ui->checkBoxTranslationsHE->isChecked());
959 checkLanguage("Hindi", "hi" , ui->checkBoxTranslationsHI->isChecked());
960 checkLanguage("Hungarian", "hu" , ui->checkBoxTranslationsHU->isChecked());
961 checkLanguage("Icelandic", "is" , ui->checkBoxTranslationsIS->isChecked());
962 checkLanguage("Igbo", "ig" , ui->checkBoxTranslationsIG->isChecked());
963 checkLanguage("Indonesian", "id" , ui->checkBoxTranslationsID->isChecked());
964 checkLanguage("Irish", "ga" , ui->checkBoxTranslationsGA->isChecked());
965 checkLanguage("Italian", "it" , ui->checkBoxTranslationsIT->isChecked());
966 checkLanguage("Japanese", "ja" , ui->checkBoxTranslationsJA->isChecked());
967 checkLanguage("Javanese", "jw" , ui->checkBoxTranslationsJW->isChecked());
968 checkLanguage("Kannada", "kn" , ui->checkBoxTranslationsKN->isChecked());
969 checkLanguage("Kazakh", "kk" , ui->checkBoxTranslationsKK->isChecked());
970 checkLanguage("Khmer", "km" , ui->checkBoxTranslationsKM->isChecked());
971 checkLanguage("Kinyarwanda", "rw" , ui->checkBoxTranslationsRW->isChecked());
972 checkLanguage("Korean", "ko" , ui->checkBoxTranslationsKO->isChecked());
973 checkLanguage("Kurdish", "ku" , ui->checkBoxTranslationsKU->isChecked());
974 checkLanguage("Kyrgyz", "ky" , ui->checkBoxTranslationsKY->isChecked());
975 checkLanguage("Lao", "lo" , ui->checkBoxTranslationsLO->isChecked());
976 checkLanguage("Latin", "la" , ui->checkBoxTranslationsLA->isChecked());
977 checkLanguage("Latvian", "lv" , ui->checkBoxTranslationsLV->isChecked());
978 checkLanguage("Lithuanian", "lt" , ui->checkBoxTranslationsLT->isChecked());
979 checkLanguage("Luxembourgish", "lb" , ui->checkBoxTranslationsLB->isChecked());
980 checkLanguage("Macedonian", "mk" , ui->checkBoxTranslationsMK->isChecked());
981 checkLanguage("Malagasy", "mg" , ui->checkBoxTranslationsMG->isChecked());
982 checkLanguage("Malayalam", "ml" , ui->checkBoxTranslationsML->isChecked());
983 checkLanguage("Malaysian", "ms" , ui->checkBoxTranslationsMS->isChecked());
984 checkLanguage("Maltese", "mt" , ui->checkBoxTranslationsMT->isChecked());
985 checkLanguage("Maori", "mi" , ui->checkBoxTranslationsMI->isChecked());
986 checkLanguage("Marathi", "mr" , ui->checkBoxTranslationsMR->isChecked());
987 checkLanguage("Mongolian", "mn" , ui->checkBoxTranslationsMN->isChecked());
988 checkLanguage("Myanmar", "my" , ui->checkBoxTranslationsMY->isChecked());
989 checkLanguage("Norwegian", "no" , ui->checkBoxTranslationsNO->isChecked());
990 checkLanguage("Bokmal", "nb" , ui->checkBoxTranslationsNB->isChecked());
991 checkLanguage("Nynorsk", "nn" , ui->checkBoxTranslationsNN->isChecked());
992 checkLanguage("Nepali", "ne" , ui->checkBoxTranslationsNE->isChecked());
993 checkLanguage("Oriya", "or" , ui->checkBoxTranslationsOR->isChecked());
994 checkLanguage("Pashto", "ps" , ui->checkBoxTranslationsPS->isChecked());
995 checkLanguage("Polish", "pl" , ui->checkBoxTranslationsPL->isChecked());
996 checkLanguage("Portuguese", "pt" , ui->checkBoxTranslationsPT->isChecked());
997 checkLanguage("Punjabi", "pa" , ui->checkBoxTranslationsPA->isChecked());
998 checkLanguage("Rhaeto-Romanic", "rm" , ui->checkBoxTranslationsRM->isChecked());
999 checkLanguage("Romanian", "ro" , ui->checkBoxTranslationsRO->isChecked());
1000 checkLanguage("Russian", "ru" , ui->checkBoxTranslationsRU->isChecked());
1001 checkLanguage("Samoan", "sm" , ui->checkBoxTranslationsSM->isChecked());
1002 checkLanguage("Sesotho", "st" , ui->checkBoxTranslationsST->isChecked());
1003 checkLanguage("Serbian", "sr" , ui->checkBoxTranslationsSR->isChecked());
1004 checkLanguage("Shona", "sn" , ui->checkBoxTranslationsSN->isChecked());
1005 checkLanguage("Sindhi", "sd" , ui->checkBoxTranslationsSD->isChecked());
1006 checkLanguage("Sinhala", "si" , ui->checkBoxTranslationsSI->isChecked());
1007 checkLanguage("Slovak", "sk" , ui->checkBoxTranslationsSK->isChecked());
1008 checkLanguage("Slovenian", "sl" , ui->checkBoxTranslationsSL->isChecked());
1009 checkLanguage("Spanish", "es" , ui->checkBoxTranslationsES->isChecked());
1010 checkLanguage("Somali", "so" , ui->checkBoxTranslationsSO->isChecked());
1011 checkLanguage("Sorbian", "sb" , ui->checkBoxTranslationsSB->isChecked());
1012 checkLanguage("Sundanese", "su" , ui->checkBoxTranslationsSU->isChecked());
1013 checkLanguage("Swahili", "sw" , ui->checkBoxTranslationsSW->isChecked());
1014 checkLanguage("Swedish", "sv" , ui->checkBoxTranslationsSV->isChecked());
1015 checkLanguage("Tagalog", "tl" , ui->checkBoxTranslationsTL->isChecked());
1016 checkLanguage("Tahitian", "ty" , ui->checkBoxTranslationsTY->isChecked());
1017 checkLanguage("Tajik", "tg" , ui->checkBoxTranslationsTG->isChecked());
1018 checkLanguage("Tamil", "ta" , ui->checkBoxTranslationsTA->isChecked());
1019 checkLanguage("Tatar", "tt" , ui->checkBoxTranslationsTT->isChecked());
1020 checkLanguage("Telugu", "te" , ui->checkBoxTranslationsTE->isChecked());
1021 checkLanguage("Tongan", "to" , ui->checkBoxTranslationsTO->isChecked());
1022 checkLanguage("Turkmen", "tk" , ui->checkBoxTranslationsTK->isChecked());
1023 checkLanguage("Thai", "th" , ui->checkBoxTranslationsTH->isChecked());
1024 checkLanguage("Tsonga", "ts" , ui->checkBoxTranslationsTS->isChecked());
1025 checkLanguage("Tswana", "tn" , ui->checkBoxTranslationsTN->isChecked());
1026 checkLanguage("Turkish", "tr" , ui->checkBoxTranslationsTR->isChecked());
1027 checkLanguage("Ukrainian", "uk" , ui->checkBoxTranslationsUK->isChecked());
1028 checkLanguage("Uighur", "ug" , ui->checkBoxTranslationsUG->isChecked());
1029 checkLanguage("Uzbek", "uz" , ui->checkBoxTranslationsUZ->isChecked());
1030 checkLanguage("Urdu", "ur" , ui->checkBoxTranslationsUR->isChecked());
1031 checkLanguage("Venda", "ve" , ui->checkBoxTranslationsVE->isChecked());
1032 checkLanguage("Vietnamese", "vi" , ui->checkBoxTranslationsVI->isChecked());
1033 checkLanguage("Welsh", "cy" , ui->checkBoxTranslationsCY->isChecked());
1034 checkLanguage("Xhosa", "xh" , ui->checkBoxTranslationsXH->isChecked());
1035 checkLanguage("Yiddish", "yi" , ui->checkBoxTranslationsYI->isChecked());
1036 checkLanguage("Yoruba", "yo" , ui->checkBoxTranslationsYO->isChecked());
1037 checkLanguage("Zulu", "zu" , ui->checkBoxTranslationsZU->isChecked());
1038 checkLanguage("SimplifiedChinese", "zh-CN" , ui->checkBoxTranslationsZH_CN->isChecked());
1039 checkLanguage("TraditionalChinese", "zh-TW" , ui->checkBoxTranslationsZH_TW->isChecked());
1040 // Added
1041 checkLanguage("Klingon", "tlh" , ui->checkBoxTranslationsTLH->isChecked());
1042 checkLanguage("KlingonPlqaD", "tlh-Qaak" , ui->checkBoxTranslationsTLH_QAAK->isChecked());
1043 checkLanguage("Cantonese", "yue" , ui->checkBoxTranslationsYUE->isChecked());
1044 checkLanguage("Cebuano", "ceb" , ui->checkBoxTranslationsCEB->isChecked());
1045 checkLanguage("Filipino", "fil" , ui->checkBoxTranslationsFIL->isChecked());
1046 checkLanguage("Hawaiian", "haw" , ui->checkBoxTranslationsHAW->isChecked());
1047 checkLanguage("HillMari", "mrj" , ui->checkBoxTranslationsMRJ->isChecked());
1048 checkLanguage("Hmong", "hmn" , ui->checkBoxTranslationsHMN->isChecked());
1049 checkLanguage("LevantineArabic", "apc" , ui->checkBoxTranslationsAPC->isChecked());
1050 checkLanguage("Mari", "mhr" , ui->checkBoxTranslationsMHR->isChecked());
1051 checkLanguage("Papiamento", "pap" , ui->checkBoxTranslationsPAP->isChecked());
1052 checkLanguage("QueretaroOtomi", "otq" , ui->checkBoxTranslationsOTQ->isChecked());
1053 checkLanguage("SerbianLatin", "sr-Latin" , ui->checkBoxTranslationsSR_LATIN->isChecked());
1054 checkLanguage("Udmurt", "udm" , ui->checkBoxTranslationsUDM->isChecked());
1055 checkLanguage("YucatecMaya", "yua" , ui->checkBoxTranslationsYUA->isChecked());
1056 return myLanguages;
1057}
1058
1062void MainWindow::checkLanguage(const QString &thisName, const QString &thisLanguage, bool thisChecked)
1063{
1064 setMessage("checkLanguage", Debug);
1065 QString theLangagesIDs = myLanguages;
1066 myLanguageName = thisName;
1067 if (thisChecked)
1068 {
1069 if (theLangagesIDs.contains(thisLanguage, Qt::CaseInsensitive)) { return; }
1070 else
1071 {
1072 if (theLangagesIDs.isEmpty())
1073 {
1074 theLangagesIDs.append(QString("%1").arg(thisLanguage.toLower()));
1075 }
1076 else
1077 {
1078 theLangagesIDs.append(QString(", %1").arg(thisLanguage.toLower()));
1079 }
1080 }
1081 }
1082 else
1083 {
1084 if (theLangagesIDs.contains(thisLanguage, Qt::CaseInsensitive))
1085 {
1086 if (theLangagesIDs.indexOf(thisLanguage, Qt::CaseInsensitive) - 1 > -1)
1087 {
1088 theLangagesIDs.remove(thisLanguage, Qt::CaseInsensitive);
1089 }
1090 else
1091 {
1092 theLangagesIDs.remove(QString(", %1").arg(thisLanguage), Qt::CaseInsensitive);
1093 }
1094 }
1095 }
1096 myLanguages = theLangagesIDs;
1097}
1098
1102void MainWindow::setCheckMarksTranslation(const QString &thisDbValve)
1103{
1104 // set check boxes
1105 if (thisDbValve.contains("af", Qt::CaseInsensitive))
1106 { ui->checkBoxTranslationsAF->setCheckState(Qt::CheckState::Checked); }
1107 else
1108 { ui->checkBoxTranslationsAF->setCheckState(Qt::CheckState::Unchecked); }
1109 if (thisDbValve.contains("am", Qt::CaseInsensitive))
1110 { ui->checkBoxTranslationsAM->setCheckState(Qt::CheckState::Checked); }
1111 else
1112 { ui->checkBoxTranslationsAM->setCheckState(Qt::CheckState::Unchecked); }
1113 if (thisDbValve.contains("ar", Qt::CaseInsensitive))
1114 { ui->checkBoxTranslationsAR->setCheckState(Qt::CheckState::Checked); }
1115 else
1116 { ui->checkBoxTranslationsAR->setCheckState(Qt::CheckState::Unchecked); }
1117 if (thisDbValve.contains("az", Qt::CaseInsensitive))
1118 { ui->checkBoxTranslationsAZ->setCheckState(Qt::CheckState::Checked); }
1119 else
1120 { ui->checkBoxTranslationsAZ->setCheckState(Qt::CheckState::Unchecked); }
1121 if (thisDbValve.contains("ba", Qt::CaseInsensitive))
1122 { ui->checkBoxTranslationsBA->setCheckState(Qt::CheckState::Checked); }
1123 else
1124 { ui->checkBoxTranslationsBA->setCheckState(Qt::CheckState::Unchecked); }
1125 if (thisDbValve.contains("bn", Qt::CaseInsensitive))
1126 { ui->checkBoxTranslationsBN->setCheckState(Qt::CheckState::Checked); }
1127 else
1128 { ui->checkBoxTranslationsBN->setCheckState(Qt::CheckState::Unchecked); }
1129 if (thisDbValve.contains("bs", Qt::CaseInsensitive))
1130 { ui->checkBoxTranslationsBS->setCheckState(Qt::CheckState::Checked); }
1131 else
1132 { ui->checkBoxTranslationsBS->setCheckState(Qt::CheckState::Unchecked); }
1133 if (thisDbValve.contains("be", Qt::CaseInsensitive))
1134 { ui->checkBoxTranslationsBE->setCheckState(Qt::CheckState::Checked); }
1135 else
1136 { ui->checkBoxTranslationsBE->setCheckState(Qt::CheckState::Unchecked); }
1137 if (thisDbValve.contains("bg", Qt::CaseInsensitive))
1138 { ui->checkBoxTranslationsBG->setCheckState(Qt::CheckState::Checked); }
1139 else
1140 { ui->checkBoxTranslationsBG->setCheckState(Qt::CheckState::Unchecked); }
1141 if (thisDbValve.contains("ca", Qt::CaseInsensitive))
1142 { ui->checkBoxTranslationsCA->setCheckState(Qt::CheckState::Checked); }
1143 else
1144 { ui->checkBoxTranslationsCA->setCheckState(Qt::CheckState::Unchecked); }
1145 if (thisDbValve.contains("cs", Qt::CaseInsensitive))
1146 { ui->checkBoxTranslationsCS->setCheckState(Qt::CheckState::Checked); }
1147 else
1148 { ui->checkBoxTranslationsCS->setCheckState(Qt::CheckState::Unchecked); }
1149 if (thisDbValve.contains("co", Qt::CaseInsensitive))
1150 { ui->checkBoxTranslationsCO->setCheckState(Qt::CheckState::Checked); }
1151 else
1152 { ui->checkBoxTranslationsCO->setCheckState(Qt::CheckState::Unchecked); }
1153 if (thisDbValve.contains("cy", Qt::CaseInsensitive))
1154 { ui->checkBoxTranslationsCY->setCheckState(Qt::CheckState::Checked); }
1155 else
1156 { ui->checkBoxTranslationsCY->setCheckState(Qt::CheckState::Unchecked); }
1157 if (thisDbValve.contains("ceb", Qt::CaseInsensitive))
1158 { ui->checkBoxTranslationsCEB->setCheckState(Qt::CheckState::Checked); }
1159 else
1160 { ui->checkBoxTranslationsCEB->setCheckState(Qt::CheckState::Unchecked); }
1161 if (thisDbValve.contains("da", Qt::CaseInsensitive))
1162 { ui->checkBoxTranslationsDA->setCheckState(Qt::CheckState::Checked); }
1163 else
1164 { ui->checkBoxTranslationsDA->setCheckState(Qt::CheckState::Unchecked); }
1165 if (thisDbValve.contains("de", Qt::CaseInsensitive))
1166 { ui->checkBoxTranslationsDE->setCheckState(Qt::CheckState::Checked); }
1167 else
1168 { ui->checkBoxTranslationsDE->setCheckState(Qt::CheckState::Unchecked); }
1169 if (thisDbValve.contains("el", Qt::CaseInsensitive))
1170 { ui->checkBoxTranslationsEL->setCheckState(Qt::CheckState::Checked); }
1171 else
1172 { ui->checkBoxTranslationsEL->setCheckState(Qt::CheckState::Unchecked); }
1173 if (thisDbValve.contains("eo", Qt::CaseInsensitive))
1174 { ui->checkBoxTranslationsEO->setCheckState(Qt::CheckState::Checked); }
1175 else
1176 { ui->checkBoxTranslationsEO->setCheckState(Qt::CheckState::Unchecked); }
1177 if (thisDbValve.contains("en", Qt::CaseInsensitive))
1178 { ui->checkBoxTranslationsEN->setCheckState(Qt::CheckState::Checked); }
1179 else
1180 { ui->checkBoxTranslationsEN->setCheckState(Qt::CheckState::Unchecked); }
1181 if (thisDbValve.contains("et", Qt::CaseInsensitive))
1182 { ui->checkBoxTranslationsET->setCheckState(Qt::CheckState::Checked); }
1183 else
1184 { ui->checkBoxTranslationsET->setCheckState(Qt::CheckState::Unchecked); }
1185 if (thisDbValve.contains("es", Qt::CaseInsensitive))
1186 { ui->checkBoxTranslationsES->setCheckState(Qt::CheckState::Checked); }
1187 else
1188 { ui->checkBoxTranslationsES->setCheckState(Qt::CheckState::Unchecked); }
1189 if (thisDbValve.contains("eu", Qt::CaseInsensitive))
1190 { ui->checkBoxTranslationsEU->setCheckState(Qt::CheckState::Checked); }
1191 else
1192 { ui->checkBoxTranslationsEU->setCheckState(Qt::CheckState::Unchecked); }
1193 if (thisDbValve.contains("fo", Qt::CaseInsensitive))
1194 { ui->checkBoxTranslationsFO->setCheckState(Qt::CheckState::Checked); }
1195 else
1196 { ui->checkBoxTranslationsFO->setCheckState(Qt::CheckState::Unchecked); }
1197 if (thisDbValve.contains("fa", Qt::CaseInsensitive))
1198 { ui->checkBoxTranslationsFA->setCheckState(Qt::CheckState::Checked); }
1199 else
1200 { ui->checkBoxTranslationsFA->setCheckState(Qt::CheckState::Unchecked); }
1201 if (thisDbValve.contains("fi", Qt::CaseInsensitive))
1202 { ui->checkBoxTranslationsFI->setCheckState(Qt::CheckState::Checked); }
1203 else
1204 { ui->checkBoxTranslationsFI->setCheckState(Qt::CheckState::Unchecked); }
1205 if (thisDbValve.contains("fr", Qt::CaseInsensitive))
1206 { ui->checkBoxTranslationsFR->setCheckState(Qt::CheckState::Checked); }
1207 else
1208 { ui->checkBoxTranslationsFR->setCheckState(Qt::CheckState::Unchecked); }
1209 if (thisDbValve.contains("fil", Qt::CaseInsensitive))
1210 { ui->checkBoxTranslationsFIL->setCheckState(Qt::CheckState::Checked); }
1211 else
1212 { ui->checkBoxTranslationsFIL->setCheckState(Qt::CheckState::Unchecked); }
1213 if (thisDbValve.contains("fj", Qt::CaseInsensitive))
1214 { ui->checkBoxTranslationsFJ->setCheckState(Qt::CheckState::Checked); }
1215 else
1216 { ui->checkBoxTranslationsFJ->setCheckState(Qt::CheckState::Unchecked); }
1217 if (thisDbValve.contains("fy", Qt::CaseInsensitive))
1218 { ui->checkBoxTranslationsFY->setCheckState(Qt::CheckState::Checked); }
1219 else
1220 { ui->checkBoxTranslationsFY->setCheckState(Qt::CheckState::Unchecked); }
1221 if (thisDbValve.contains("gd", Qt::CaseInsensitive))
1222 { ui->checkBoxTranslationsGD->setCheckState(Qt::CheckState::Checked); }
1223 else
1224 { ui->checkBoxTranslationsGD->setCheckState(Qt::CheckState::Unchecked); }
1225 if (thisDbValve.contains("ga", Qt::CaseInsensitive))
1226 { ui->checkBoxTranslationsGA->setCheckState(Qt::CheckState::Checked); }
1227 else
1228 { ui->checkBoxTranslationsGA->setCheckState(Qt::CheckState::Unchecked); }
1229 if (thisDbValve.contains("gl", Qt::CaseInsensitive))
1230 { ui->checkBoxTranslationsGL->setCheckState(Qt::CheckState::Checked); }
1231 else
1232 { ui->checkBoxTranslationsGL->setCheckState(Qt::CheckState::Unchecked); }
1233 if (thisDbValve.contains("GU", Qt::CaseInsensitive))
1234 { ui->checkBoxTranslationsGU->setCheckState(Qt::CheckState::Checked); }
1235 else
1236 { ui->checkBoxTranslationsGU->setCheckState(Qt::CheckState::Unchecked); }
1237 if (thisDbValve.contains("hr", Qt::CaseInsensitive))
1238 { ui->checkBoxTranslationsHR->setCheckState(Qt::CheckState::Checked); }
1239 else
1240 { ui->checkBoxTranslationsHR->setCheckState(Qt::CheckState::Unchecked); }
1241 if (thisDbValve.contains("haw", Qt::CaseInsensitive))
1242 { ui->checkBoxTranslationsHAW->setCheckState(Qt::CheckState::Checked); }
1243 else
1244 { ui->checkBoxTranslationsHAW->setCheckState(Qt::CheckState::Unchecked); }
1245 if (thisDbValve.contains("he", Qt::CaseInsensitive))
1246 { ui->checkBoxTranslationsHE->setCheckState(Qt::CheckState::Checked); }
1247 else
1248 { ui->checkBoxTranslationsHE->setCheckState(Qt::CheckState::Unchecked); }
1249 if (thisDbValve.contains("hi", Qt::CaseInsensitive))
1250 { ui->checkBoxTranslationsHI->setCheckState(Qt::CheckState::Checked); }
1251 else
1252 { ui->checkBoxTranslationsHI->setCheckState(Qt::CheckState::Unchecked); }
1253 if (thisDbValve.contains("hu", Qt::CaseInsensitive))
1254 { ui->checkBoxTranslationsHU->setCheckState(Qt::CheckState::Checked); }
1255 else
1256 { ui->checkBoxTranslationsHU->setCheckState(Qt::CheckState::Unchecked); }
1257 if (thisDbValve.contains("HT", Qt::CaseInsensitive))
1258 { ui->checkBoxTranslationsHT->setCheckState(Qt::CheckState::Checked); }
1259 else
1260 { ui->checkBoxTranslationsHT->setCheckState(Qt::CheckState::Unchecked); }
1261 if (thisDbValve.contains("ha", Qt::CaseInsensitive))
1262 { ui->checkBoxTranslationsHA->setCheckState(Qt::CheckState::Checked); }
1263 else
1264 { ui->checkBoxTranslationsHA->setCheckState(Qt::CheckState::Unchecked); }
1265 if (thisDbValve.contains("hy", Qt::CaseInsensitive))
1266 { ui->checkBoxTranslationsHY->setCheckState(Qt::CheckState::Checked); }
1267 else
1268 { ui->checkBoxTranslationsHY->setCheckState(Qt::CheckState::Unchecked); }
1269 if (thisDbValve.contains("id", Qt::CaseInsensitive))
1270 { ui->checkBoxTranslationsID->setCheckState(Qt::CheckState::Checked); }
1271 else
1272 { ui->checkBoxTranslationsID->setCheckState(Qt::CheckState::Unchecked); }
1273 if (thisDbValve.contains("ig", Qt::CaseInsensitive))
1274 { ui->checkBoxTranslationsIG->setCheckState(Qt::CheckState::Checked); }
1275 else
1276 { ui->checkBoxTranslationsIG->setCheckState(Qt::CheckState::Unchecked); }
1277 if (thisDbValve.contains("is", Qt::CaseInsensitive))
1278 { ui->checkBoxTranslationsIS->setCheckState(Qt::CheckState::Checked); }
1279 else
1280 { ui->checkBoxTranslationsIS->setCheckState(Qt::CheckState::Unchecked); }
1281 if (thisDbValve.contains("jw", Qt::CaseInsensitive))
1282 { ui->checkBoxTranslationsJW->setCheckState(Qt::CheckState::Checked); }
1283 else
1284 { ui->checkBoxTranslationsJW->setCheckState(Qt::CheckState::Unchecked); }
1285 if (thisDbValve.contains("ka", Qt::CaseInsensitive))
1286 { ui->checkBoxTranslationsKA->setCheckState(Qt::CheckState::Checked); }
1287 else
1288 { ui->checkBoxTranslationsKA->setCheckState(Qt::CheckState::Unchecked); }
1289 if (thisDbValve.contains("kn", Qt::CaseInsensitive))
1290 { ui->checkBoxTranslationsKN->setCheckState(Qt::CheckState::Checked); }
1291 else
1292 { ui->checkBoxTranslationsKN->setCheckState(Qt::CheckState::Unchecked); }
1293 if (thisDbValve.contains("kk", Qt::CaseInsensitive))
1294 { ui->checkBoxTranslationsKK->setCheckState(Qt::CheckState::Checked); }
1295 else
1296 { ui->checkBoxTranslationsKK->setCheckState(Qt::CheckState::Unchecked); }
1297 if (thisDbValve.contains("km", Qt::CaseInsensitive))
1298 { ui->checkBoxTranslationsKM->setCheckState(Qt::CheckState::Checked); }
1299 else
1300 { ui->checkBoxTranslationsKM->setCheckState(Qt::CheckState::Unchecked); }
1301 if (thisDbValve.contains("ky", Qt::CaseInsensitive))
1302 { ui->checkBoxTranslationsKY->setCheckState(Qt::CheckState::Checked); }
1303 else
1304 { ui->checkBoxTranslationsKY->setCheckState(Qt::CheckState::Unchecked); }
1305 if (thisDbValve.contains("lo", Qt::CaseInsensitive))
1306 { ui->checkBoxTranslationsLO->setCheckState(Qt::CheckState::Checked); }
1307 else
1308 { ui->checkBoxTranslationsLO->setCheckState(Qt::CheckState::Unchecked); }
1309 if (thisDbValve.contains("la", Qt::CaseInsensitive))
1310 { ui->checkBoxTranslationsLA->setCheckState(Qt::CheckState::Checked); }
1311 else
1312 { ui->checkBoxTranslationsLA->setCheckState(Qt::CheckState::Unchecked); }
1313 if (thisDbValve.contains("lb", Qt::CaseInsensitive))
1314 { ui->checkBoxTranslationsLB->setCheckState(Qt::CheckState::Checked); }
1315 else
1316 { ui->checkBoxTranslationsLB->setCheckState(Qt::CheckState::Unchecked); }
1317 if (thisDbValve.contains("nl", Qt::CaseInsensitive))
1318 { ui->checkBoxTranslationsNL->setCheckState(Qt::CheckState::Checked); }
1319 else
1320 { ui->checkBoxTranslationsNL->setCheckState(Qt::CheckState::Unchecked); }
1321 if (thisDbValve.contains("it", Qt::CaseInsensitive))
1322 { ui->checkBoxTranslationsIT->setCheckState(Qt::CheckState::Checked); }
1323 else
1324 { ui->checkBoxTranslationsIT->setCheckState(Qt::CheckState::Unchecked); }
1325 if (thisDbValve.contains("ja", Qt::CaseInsensitive))
1326 { ui->checkBoxTranslationsJA->setCheckState(Qt::CheckState::Checked); }
1327 else
1328 { ui->checkBoxTranslationsJA->setCheckState(Qt::CheckState::Unchecked); }
1329 if (thisDbValve.contains("ko", Qt::CaseInsensitive))
1330 { ui->checkBoxTranslationsKO->setCheckState(Qt::CheckState::Checked); }
1331 else
1332 { ui->checkBoxTranslationsKO->setCheckState(Qt::CheckState::Unchecked); }
1333 if (thisDbValve.contains("ku", Qt::CaseInsensitive))
1334 { ui->checkBoxTranslationsKU->setCheckState(Qt::CheckState::Checked); }
1335 else
1336 { ui->checkBoxTranslationsKU->setCheckState(Qt::CheckState::Unchecked); }
1337 if (thisDbValve.contains("lv", Qt::CaseInsensitive))
1338 { ui->checkBoxTranslationsLV->setCheckState(Qt::CheckState::Checked); }
1339 else
1340 { ui->checkBoxTranslationsLV->setCheckState(Qt::CheckState::Unchecked); }
1341 if (thisDbValve.contains("lt", Qt::CaseInsensitive))
1342 { ui->checkBoxTranslationsLT->setCheckState(Qt::CheckState::Checked); }
1343 else
1344 { ui->checkBoxTranslationsLT->setCheckState(Qt::CheckState::Unchecked); }
1345 if (thisDbValve.contains("mk", Qt::CaseInsensitive))
1346 { ui->checkBoxTranslationsMK->setCheckState(Qt::CheckState::Checked); }
1347 else
1348 { ui->checkBoxTranslationsMK->setCheckState(Qt::CheckState::Unchecked); }
1349 if (thisDbValve.contains("ml", Qt::CaseInsensitive))
1350 { ui->checkBoxTranslationsML->setCheckState(Qt::CheckState::Checked); }
1351 else
1352 { ui->checkBoxTranslationsML->setCheckState(Qt::CheckState::Unchecked); }
1353 if (thisDbValve.contains("ms", Qt::CaseInsensitive))
1354 { ui->checkBoxTranslationsMS->setCheckState(Qt::CheckState::Checked); }
1355 else
1356 { ui->checkBoxTranslationsMS->setCheckState(Qt::CheckState::Unchecked); }
1357 if (thisDbValve.contains("mt", Qt::CaseInsensitive))
1358 { ui->checkBoxTranslationsMT->setCheckState(Qt::CheckState::Checked); }
1359 else
1360 { ui->checkBoxTranslationsMT->setCheckState(Qt::CheckState::Unchecked); }
1361 if (thisDbValve.contains("mg", Qt::CaseInsensitive))
1362 { ui->checkBoxTranslationsMG->setCheckState(Qt::CheckState::Checked); }
1363 else
1364 { ui->checkBoxTranslationsMG->setCheckState(Qt::CheckState::Unchecked); }
1365 if (thisDbValve.contains("mi", Qt::CaseInsensitive))
1366 { ui->checkBoxTranslationsMI->setCheckState(Qt::CheckState::Checked); }
1367 else
1368 { ui->checkBoxTranslationsMI->setCheckState(Qt::CheckState::Unchecked); }
1369 if (thisDbValve.contains("mr", Qt::CaseInsensitive))
1370 { ui->checkBoxTranslationsMR->setCheckState(Qt::CheckState::Checked); }
1371 else
1372 { ui->checkBoxTranslationsMR->setCheckState(Qt::CheckState::Unchecked); }
1373 if (thisDbValve.contains("mn", Qt::CaseInsensitive))
1374 { ui->checkBoxTranslationsMN->setCheckState(Qt::CheckState::Checked); }
1375 else
1376 { ui->checkBoxTranslationsMN->setCheckState(Qt::CheckState::Unchecked); }
1377 if (thisDbValve.contains("my", Qt::CaseInsensitive))
1378 { ui->checkBoxTranslationsMY->setCheckState(Qt::CheckState::Checked); }
1379 else
1380 { ui->checkBoxTranslationsMY->setCheckState(Qt::CheckState::Unchecked); }
1381 if (thisDbValve.contains("mrj", Qt::CaseInsensitive))
1382 { ui->checkBoxTranslationsMRJ->setCheckState(Qt::CheckState::Checked); }
1383 else
1384 { ui->checkBoxTranslationsMRJ->setCheckState(Qt::CheckState::Unchecked); }
1385 if (thisDbValve.contains("hmn", Qt::CaseInsensitive))
1386 { ui->checkBoxTranslationsHMN->setCheckState(Qt::CheckState::Checked); }
1387 else
1388 { ui->checkBoxTranslationsHMN->setCheckState(Qt::CheckState::Unchecked); }
1389 if (thisDbValve.contains("apc", Qt::CaseInsensitive))
1390 { ui->checkBoxTranslationsAPC->setCheckState(Qt::CheckState::Checked); }
1391 else
1392 { ui->checkBoxTranslationsAPC->setCheckState(Qt::CheckState::Unchecked); }
1393 if (thisDbValve.contains("mhr", Qt::CaseInsensitive))
1394 { ui->checkBoxTranslationsMHR->setCheckState(Qt::CheckState::Checked); }
1395 else
1396 { ui->checkBoxTranslationsMHR->setCheckState(Qt::CheckState::Unchecked); }
1397 if (thisDbValve.contains("no", Qt::CaseInsensitive))
1398 { ui->checkBoxTranslationsNO->setCheckState(Qt::CheckState::Checked); }
1399 else
1400 { ui->checkBoxTranslationsNO->setCheckState(Qt::CheckState::Unchecked); }
1401 if (thisDbValve.contains("nb", Qt::CaseInsensitive))
1402 { ui->checkBoxTranslationsNB->setCheckState(Qt::CheckState::Checked); }
1403 else
1404 { ui->checkBoxTranslationsNB->setCheckState(Qt::CheckState::Unchecked); }
1405 if (thisDbValve.contains("nn", Qt::CaseInsensitive))
1406 { ui->checkBoxTranslationsNN->setCheckState(Qt::CheckState::Checked); }
1407 else
1408 { ui->checkBoxTranslationsNN->setCheckState(Qt::CheckState::Unchecked); }
1409 if (thisDbValve.contains("ny", Qt::CaseInsensitive))
1410 { ui->checkBoxTranslationsNY->setCheckState(Qt::CheckState::Checked); }
1411 else
1412 { ui->checkBoxTranslationsNY->setCheckState(Qt::CheckState::Unchecked); }
1413 if (thisDbValve.contains("ne", Qt::CaseInsensitive))
1414 { ui->checkBoxTranslationsNE->setCheckState(Qt::CheckState::Checked); }
1415 else
1416 { ui->checkBoxTranslationsNE->setCheckState(Qt::CheckState::Unchecked); }
1417 if (thisDbValve.contains("or", Qt::CaseInsensitive))
1418 { ui->checkBoxTranslationsOR->setCheckState(Qt::CheckState::Checked); }
1419 else
1420 { ui->checkBoxTranslationsOR->setCheckState(Qt::CheckState::Unchecked); }
1421 if (thisDbValve.contains("otq", Qt::CaseInsensitive))
1422 { ui->checkBoxTranslationsOTQ->setCheckState(Qt::CheckState::Checked); }
1423 else
1424 { ui->checkBoxTranslationsOTQ->setCheckState(Qt::CheckState::Unchecked); }
1425 if (thisDbValve.contains("pap", Qt::CaseInsensitive))
1426 { ui->checkBoxTranslationsPAP->setCheckState(Qt::CheckState::Checked); }
1427 else
1428 { ui->checkBoxTranslationsPAP->setCheckState(Qt::CheckState::Unchecked); }
1429 if (thisDbValve.contains("ps", Qt::CaseInsensitive))
1430 { ui->checkBoxTranslationsPS->setCheckState(Qt::CheckState::Checked); }
1431 else
1432 { ui->checkBoxTranslationsPS->setCheckState(Qt::CheckState::Unchecked); }
1433 if (thisDbValve.contains("pl", Qt::CaseInsensitive))
1434 { ui->checkBoxTranslationsPL->setCheckState(Qt::CheckState::Checked); }
1435 else
1436 { ui->checkBoxTranslationsPL->setCheckState(Qt::CheckState::Unchecked); }
1437 if (thisDbValve.contains("pt", Qt::CaseInsensitive))
1438 { ui->checkBoxTranslationsPT->setCheckState(Qt::CheckState::Checked); }
1439 else
1440 { ui->checkBoxTranslationsPT->setCheckState(Qt::CheckState::Unchecked); }
1441 if (thisDbValve.contains("pa", Qt::CaseInsensitive))
1442 { ui->checkBoxTranslationsPA->setCheckState(Qt::CheckState::Checked); }
1443 else
1444 { ui->checkBoxTranslationsPA->setCheckState(Qt::CheckState::Unchecked); }
1445 if (thisDbValve.contains("rm", Qt::CaseInsensitive))
1446 { ui->checkBoxTranslationsRM->setCheckState(Qt::CheckState::Checked); }
1447 else
1448 { ui->checkBoxTranslationsRM->setCheckState(Qt::CheckState::Unchecked); }
1449 if (thisDbValve.contains("ro", Qt::CaseInsensitive))
1450 { ui->checkBoxTranslationsRO->setCheckState(Qt::CheckState::Checked); }
1451 else
1452 { ui->checkBoxTranslationsRO->setCheckState(Qt::CheckState::Unchecked); }
1453 if (thisDbValve.contains("ru", Qt::CaseInsensitive))
1454 { ui->checkBoxTranslationsRU->setCheckState(Qt::CheckState::Checked); }
1455 else
1456 { ui->checkBoxTranslationsRU->setCheckState(Qt::CheckState::Unchecked); }
1457 if (thisDbValve.contains("rw", Qt::CaseInsensitive))
1458 { ui->checkBoxTranslationsRW->setCheckState(Qt::CheckState::Checked); }
1459 else
1460 { ui->checkBoxTranslationsRW->setCheckState(Qt::CheckState::Unchecked); }
1461 if (thisDbValve.contains("sq", Qt::CaseInsensitive))
1462 { ui->checkBoxTranslationsSQ->setCheckState(Qt::CheckState::Checked); }
1463 else
1464 { ui->checkBoxTranslationsSQ->setCheckState(Qt::CheckState::Unchecked); }
1465 if (thisDbValve.contains("sr", Qt::CaseInsensitive))
1466 { ui->checkBoxTranslationsSR->setCheckState(Qt::CheckState::Checked); }
1467 else
1468 { ui->checkBoxTranslationsSR->setCheckState(Qt::CheckState::Unchecked); }
1469 if (thisDbValve.contains("sk", Qt::CaseInsensitive))
1470 { ui->checkBoxTranslationsSK->setCheckState(Qt::CheckState::Checked); }
1471 else
1472 { ui->checkBoxTranslationsSK->setCheckState(Qt::CheckState::Unchecked); }
1473 if (thisDbValve.contains("sl", Qt::CaseInsensitive))
1474 { ui->checkBoxTranslationsSL->setCheckState(Qt::CheckState::Checked); }
1475 else
1476 { ui->checkBoxTranslationsSL->setCheckState(Qt::CheckState::Unchecked); }
1477 if (thisDbValve.contains("sb", Qt::CaseInsensitive))
1478 { ui->checkBoxTranslationsSB->setCheckState(Qt::CheckState::Checked); }
1479 else
1480 { ui->checkBoxTranslationsSB->setCheckState(Qt::CheckState::Unchecked); }
1481 if (thisDbValve.contains("sm", Qt::CaseInsensitive))
1482 { ui->checkBoxTranslationsSM->setCheckState(Qt::CheckState::Checked); }
1483 else
1484 { ui->checkBoxTranslationsSM->setCheckState(Qt::CheckState::Unchecked); }
1485 if (thisDbValve.contains("st", Qt::CaseInsensitive))
1486 { ui->checkBoxTranslationsST->setCheckState(Qt::CheckState::Checked); }
1487 else
1488 { ui->checkBoxTranslationsST->setCheckState(Qt::CheckState::Unchecked); }
1489 if (thisDbValve.contains("sn", Qt::CaseInsensitive))
1490 { ui->checkBoxTranslationsSN->setCheckState(Qt::CheckState::Checked); }
1491 else
1492 { ui->checkBoxTranslationsSN->setCheckState(Qt::CheckState::Unchecked); }
1493 if (thisDbValve.contains("sd", Qt::CaseInsensitive))
1494 { ui->checkBoxTranslationsSD->setCheckState(Qt::CheckState::Checked); }
1495 else
1496 { ui->checkBoxTranslationsSD->setCheckState(Qt::CheckState::Unchecked); }
1497 if (thisDbValve.contains("si", Qt::CaseInsensitive))
1498 { ui->checkBoxTranslationsSI->setCheckState(Qt::CheckState::Checked); }
1499 else
1500 { ui->checkBoxTranslationsSI->setCheckState(Qt::CheckState::Unchecked); }
1501 if (thisDbValve.contains("so", Qt::CaseInsensitive))
1502 { ui->checkBoxTranslationsSO->setCheckState(Qt::CheckState::Checked); }
1503 else
1504 { ui->checkBoxTranslationsSO->setCheckState(Qt::CheckState::Unchecked); }
1505 if (thisDbValve.contains("su", Qt::CaseInsensitive))
1506 { ui->checkBoxTranslationsSU->setCheckState(Qt::CheckState::Checked); }
1507 else
1508 { ui->checkBoxTranslationsSU->setCheckState(Qt::CheckState::Unchecked); }
1509 if (thisDbValve.contains("sw", Qt::CaseInsensitive))
1510 { ui->checkBoxTranslationsSW->setCheckState(Qt::CheckState::Checked); }
1511 else
1512 { ui->checkBoxTranslationsSW->setCheckState(Qt::CheckState::Unchecked); }
1513 if (thisDbValve.contains("sr-Latin", Qt::CaseInsensitive))
1514 { ui->checkBoxTranslationsSR_LATIN->setCheckState(Qt::CheckState::Checked); }
1515 else
1516 { ui->checkBoxTranslationsSR_LATIN->setCheckState(Qt::CheckState::Unchecked); }
1517 if (thisDbValve.contains("sv", Qt::CaseInsensitive))
1518 { ui->checkBoxTranslationsSV->setCheckState(Qt::CheckState::Checked); }
1519 else
1520 { ui->checkBoxTranslationsSV->setCheckState(Qt::CheckState::Unchecked); }
1521 if (thisDbValve.contains("tlh", Qt::CaseInsensitive))
1522 { ui->checkBoxTranslationsTLH->setCheckState(Qt::CheckState::Checked); }
1523 else
1524 { ui->checkBoxTranslationsTLH->setCheckState(Qt::CheckState::Unchecked); }
1525 if (thisDbValve.contains("tlh-Qaak", Qt::CaseInsensitive))
1526 { ui->checkBoxTranslationsTLH_QAAK->setCheckState(Qt::CheckState::Checked); }
1527 else
1528 { ui->checkBoxTranslationsTLH_QAAK->setCheckState(Qt::CheckState::Unchecked); }
1529 if (thisDbValve.contains("tl", Qt::CaseInsensitive))
1530 { ui->checkBoxTranslationsTL->setCheckState(Qt::CheckState::Checked); }
1531 else
1532 { ui->checkBoxTranslationsTL->setCheckState(Qt::CheckState::Unchecked); }
1533 if (thisDbValve.contains("ty", Qt::CaseInsensitive))
1534 { ui->checkBoxTranslationsTY->setCheckState(Qt::CheckState::Checked); }
1535 else
1536 { ui->checkBoxTranslationsTY->setCheckState(Qt::CheckState::Unchecked); }
1537 if (thisDbValve.contains("tg", Qt::CaseInsensitive))
1538 { ui->checkBoxTranslationsTG->setCheckState(Qt::CheckState::Checked); }
1539 else
1540 { ui->checkBoxTranslationsTG->setCheckState(Qt::CheckState::Unchecked); }
1541 if (thisDbValve.contains("ta", Qt::CaseInsensitive))
1542 { ui->checkBoxTranslationsTA->setCheckState(Qt::CheckState::Checked); }
1543 else
1544 { ui->checkBoxTranslationsTA->setCheckState(Qt::CheckState::Unchecked); }
1545 if (thisDbValve.contains("tt", Qt::CaseInsensitive))
1546 { ui->checkBoxTranslationsTT->setCheckState(Qt::CheckState::Checked); }
1547 else
1548 { ui->checkBoxTranslationsTT->setCheckState(Qt::CheckState::Unchecked); }
1549 if (thisDbValve.contains("te", Qt::CaseInsensitive))
1550 { ui->checkBoxTranslationsTE->setCheckState(Qt::CheckState::Checked); }
1551 else
1552 { ui->checkBoxTranslationsTE->setCheckState(Qt::CheckState::Unchecked); }
1553 if (thisDbValve.contains("to", Qt::CaseInsensitive))
1554 { ui->checkBoxTranslationsTO->setCheckState(Qt::CheckState::Checked); }
1555 else
1556 { ui->checkBoxTranslationsTO->setCheckState(Qt::CheckState::Unchecked); }
1557 if (thisDbValve.contains("tk", Qt::CaseInsensitive))
1558 { ui->checkBoxTranslationsTK->setCheckState(Qt::CheckState::Checked); }
1559 else
1560 { ui->checkBoxTranslationsTK->setCheckState(Qt::CheckState::Unchecked); }
1561 if (thisDbValve.contains("th", Qt::CaseInsensitive))
1562 { ui->checkBoxTranslationsTH->setCheckState(Qt::CheckState::Checked); }
1563 else
1564 { ui->checkBoxTranslationsTH->setCheckState(Qt::CheckState::Unchecked); }
1565 if (thisDbValve.contains("ts", Qt::CaseInsensitive))
1566 { ui->checkBoxTranslationsTS->setCheckState(Qt::CheckState::Checked); }
1567 else
1568 { ui->checkBoxTranslationsTS->setCheckState(Qt::CheckState::Unchecked); }
1569 if (thisDbValve.contains("tn", Qt::CaseInsensitive))
1570 { ui->checkBoxTranslationsTN->setCheckState(Qt::CheckState::Checked); }
1571 else
1572 { ui->checkBoxTranslationsTN->setCheckState(Qt::CheckState::Unchecked); }
1573 if (thisDbValve.contains("tr", Qt::CaseInsensitive))
1574 { ui->checkBoxTranslationsTR->setCheckState(Qt::CheckState::Checked); }
1575 else
1576 { ui->checkBoxTranslationsTR->setCheckState(Qt::CheckState::Unchecked); }
1577 if (thisDbValve.contains("uk", Qt::CaseInsensitive))
1578 { ui->checkBoxTranslationsUK->setCheckState(Qt::CheckState::Checked); }
1579 else
1580 { ui->checkBoxTranslationsUK->setCheckState(Qt::CheckState::Unchecked); }
1581 if (thisDbValve.contains("ur", Qt::CaseInsensitive))
1582 { ui->checkBoxTranslationsUR->setCheckState(Qt::CheckState::Checked); }
1583 else
1584 { ui->checkBoxTranslationsUR->setCheckState(Qt::CheckState::Unchecked); }
1585 if (thisDbValve.contains("ug", Qt::CaseInsensitive))
1586 { ui->checkBoxTranslationsUG->setCheckState(Qt::CheckState::Checked); }
1587 else
1588 { ui->checkBoxTranslationsUG->setCheckState(Qt::CheckState::Unchecked); }
1589 if (thisDbValve.contains("uz", Qt::CaseInsensitive))
1590 { ui->checkBoxTranslationsUZ->setCheckState(Qt::CheckState::Checked); }
1591 else
1592 { ui->checkBoxTranslationsUZ->setCheckState(Qt::CheckState::Unchecked); }
1593 if (thisDbValve.contains("ve", Qt::CaseInsensitive))
1594 { ui->checkBoxTranslationsVE->setCheckState(Qt::CheckState::Checked); }
1595 else
1596 { ui->checkBoxTranslationsVE->setCheckState(Qt::CheckState::Unchecked); }
1597 if (thisDbValve.contains("udm", Qt::CaseInsensitive))
1598 { ui->checkBoxTranslationsUDM->setCheckState(Qt::CheckState::Checked); }
1599 else
1600 { ui->checkBoxTranslationsUDM->setCheckState(Qt::CheckState::Unchecked); }
1601 if (thisDbValve.contains("vi", Qt::CaseInsensitive))
1602 { ui->checkBoxTranslationsVI->setCheckState(Qt::CheckState::Checked); }
1603 else
1604 { ui->checkBoxTranslationsVI->setCheckState(Qt::CheckState::Unchecked); }
1605 if (thisDbValve.contains("xh", Qt::CaseInsensitive))
1606 { ui->checkBoxTranslationsXH->setCheckState(Qt::CheckState::Checked); }
1607 else
1608 { ui->checkBoxTranslationsXH->setCheckState(Qt::CheckState::Unchecked); }
1609 if (thisDbValve.contains("yi", Qt::CaseInsensitive))
1610 { ui->checkBoxTranslationsYI->setCheckState(Qt::CheckState::Checked); }
1611 else
1612 { ui->checkBoxTranslationsYI->setCheckState(Qt::CheckState::Unchecked); }
1613 if (thisDbValve.contains("yo", Qt::CaseInsensitive))
1614 { ui->checkBoxTranslationsYO->setCheckState(Qt::CheckState::Checked); }
1615 else
1616 { ui->checkBoxTranslationsYO->setCheckState(Qt::CheckState::Unchecked); }
1617 if (thisDbValve.contains("yue", Qt::CaseInsensitive))
1618 { ui->checkBoxTranslationsYUE->setCheckState(Qt::CheckState::Checked); }
1619 else
1620 { ui->checkBoxTranslationsYUE->setCheckState(Qt::CheckState::Unchecked); }
1621 if (thisDbValve.contains("yua", Qt::CaseInsensitive))
1622 { ui->checkBoxTranslationsYUA->setCheckState(Qt::CheckState::Checked); }
1623 else
1624 { ui->checkBoxTranslationsYUA->setCheckState(Qt::CheckState::Unchecked); }
1625 if (thisDbValve.contains("zu", Qt::CaseInsensitive))
1626 { ui->checkBoxTranslationsZU->setCheckState(Qt::CheckState::Checked); }
1627 else
1628 { ui->checkBoxTranslationsZU->setCheckState(Qt::CheckState::Unchecked); }
1629 if (thisDbValve.contains("zh-CN", Qt::CaseInsensitive))
1630 { ui->checkBoxTranslationsZH_CN->setCheckState(Qt::CheckState::Checked); }
1631 else
1632 { ui->checkBoxTranslationsZH_CN->setCheckState(Qt::CheckState::Unchecked); }
1633 if (thisDbValve.contains("zh-TW", Qt::CaseInsensitive))
1634 { ui->checkBoxTranslationsZH_TW->setCheckState(Qt::CheckState::Checked); }
1635 else
1636 { ui->checkBoxTranslationsZH_TW->setCheckState(Qt::CheckState::Unchecked); }
1637}
1638
1642bool MainWindow::fillForms(const QString &thisProjectID)
1643{
1644 setMessage("fillForms=" + thisProjectID, Debug);
1645 bool theReturn = true;
1646 #ifdef USE_SQL_FLAG
1647 setMainLoaded(false);
1649 ui->labelRecordIdProject->setText(thisProjectID); // Project id and Configuration ProjectID
1650 // Declare all variable in function scope
1651 QString theDbValve;
1652 QSqlQuery query;
1653 QString myConfigurationSelectQuery = myDbModel->getQtProjectFullSelectQueryID(thisProjectID);
1654 setMessage("myConfigurationSelectQuery=|" + myConfigurationSelectQuery + "|", Debug);
1655 /*
1656 * id, QtProjectName, QtProjectFolder, SourceFolder, DoxyfileFolder, HelpFolder, LanguageIDs
1657 */
1658 if (query.exec(myConfigurationSelectQuery))
1659 {
1660 if (query.first())
1661 {
1662 setMessage(" QtProjectName=|" + query.value("QtProjectName").toString() + "| SourceFolder=|" + query.value("SourceFolder").toString() + "| QtProjectFolder=|" + query.value("QtProjectFolder").toString() + "| DoxyfileFolder=|" + query.value("DoxyfileFolder").toString() + "| HelpFolder=|" + query.value("HelpFolder").toString() + "| LanguageIDs=|" + query.value("LanguageIDs").toString() + "|", Debug);
1663 // Set Record ID
1664 myRecordID = query.value("id").toInt();
1665 ui->labelRecordIdProject->setText(query.value("id").toString());
1666 ui->lineEditProjectName->setText(query.value("QtProjectName").toString());
1667 ui->comboBoxTranslationsProjectNames->setCurrentIndex(ui->comboBoxTranslationsProjectNames->findText(query.value("QtProjectName").toString()));
1668 ui->lineEditTranslationsProjectFolder->setText(query.value("QtProjectFolder").toString());
1669 ui->lineEditTranslationsSource->setText(query.value("SourceFolder").toString());
1670 ui->lineEditTranslationsDoxyfile->setText(query.value("DoxyfileFolder").toString());
1671 ui->lineEditTranslationsHelp->setText(query.value("HelpFolder").toString());
1672 //
1673 ui->radioButtonTranslationsQmake->setChecked(query.value("Make").toString() == "qmake" ? true : false);
1674 ui->radioButtonTranslationsCmake->setChecked(query.value("Make").toString() == "cmake" ? true : false);
1675 //
1676 mySourceLanguage = query.value("SourceLanguage").toString();
1677 ui->comboBoxTranslationSourceLanguage->setCurrentIndex(ui->comboBoxTranslationSourceLanguage->findText(query.value("SourceLanguage").toString()));
1679 // en,de,fr,it,ja,zh,no,ru,sv,ar
1680 theDbValve = query.value("LanguageIDs").toString();
1681 setCheckMarksTranslation(theDbValve);
1682 }
1683 else
1684 {
1685 //myLanguageModel->mySetting->showMessageBox(QObject::tr("Could not read from the Database").toLocal8Bit(), QString("%1 %2").arg(tr("Unable to find record in database"), myConfigurationSelectQuery).toLocal8Bit(), myLanguageModel->mySetting->Critical);
1686 theReturn = false;
1687 }
1688 }
1689 else
1690 {
1691 myLanguageModel->mySetting->showMessageBox(tr("Could not read from the Database").toLocal8Bit(), QString("%1 %2").arg(tr("Unable to find record in database"), myConfigurationSelectQuery).toLocal8Bit(), myLanguageModel->mySetting->Critical);
1692 theReturn = false;
1693 }
1694 isSaveSettings = false;
1695 setMainLoaded(true);
1696 #else
1697 // FIXME
1698 #endif
1699 return theReturn;
1700}
1701
1706{
1707 setMessage("clearTabSettings", Debug);
1708 // Defaults
1709 ui->labelRecordIdProject->setText("0");
1710 ui->lineEditProjectName->clear();
1711 ui->comboBoxTranslationsProjectNames->setCurrentIndex(-1);
1712}
1713
1718{
1719 setMessage("clearTabTranslations", Debug);
1720 // Defaults
1721 //#define TEST_FORM
1722 #ifdef TEST_FORM
1723 ui->lineEditTranslationsDoxyfile->setText("Doxyfile");
1724 ui->lineEditTranslationsSource->setText("Source");
1725 ui->lineEditTranslationsProjectFolder->setText("ProjectFolder");
1726 ui->checkBoxTranslationsAF->setCheckState(Qt::CheckState::Checked);
1727 ui->checkBoxTranslationsSQ->setCheckState(Qt::CheckState::Checked);
1728 ui->checkBoxTranslationsAR->setCheckState(Qt::CheckState::Checked);
1729 ui->checkBoxTranslationsEU->setCheckState(Qt::CheckState::Checked);
1730 ui->checkBoxTranslationsBE->setCheckState(Qt::CheckState::Checked);
1731 ui->checkBoxTranslationsBG->setCheckState(Qt::CheckState::Checked);
1732 ui->checkBoxTranslationsCA->setCheckState(Qt::CheckState::Checked);
1733 ui->checkBoxTranslationsHR->setCheckState(Qt::CheckState::Checked);
1734 ui->checkBoxTranslationsCS->setCheckState(Qt::CheckState::Checked);
1735 ui->checkBoxTranslationsAR->setCheckState(Qt::CheckState::Checked);
1736 ui->checkBoxTranslationsNL->setCheckState(Qt::CheckState::Checked);
1737 ui->checkBoxTranslationsEN->setCheckState(Qt::CheckState::Checked);
1738 ui->checkBoxTranslationsET->setCheckState(Qt::CheckState::Checked);
1739 ui->checkBoxTranslationsFO->setCheckState(Qt::CheckState::Checked);
1740 ui->checkBoxTranslationsFA->setCheckState(Qt::CheckState::Checked);
1741 ui->checkBoxTranslationsFI->setCheckState(Qt::CheckState::Checked);
1742 ui->checkBoxTranslationsFR->setCheckState(Qt::CheckState::Checked);
1743 ui->checkBoxTranslationsGD->setCheckState(Qt::CheckState::Checked);
1744 ui->checkBoxTranslationsDE->setCheckState(Qt::CheckState::Checked);
1745 ui->checkBoxTranslationsEL->setCheckState(Qt::CheckState::Checked);
1746 ui->checkBoxTranslationsHE->setCheckState(Qt::CheckState::Checked);
1747 ui->checkBoxTranslationsHI->setCheckState(Qt::CheckState::Checked);
1748 ui->checkBoxTranslationsHU->setCheckState(Qt::CheckState::Checked);
1749 ui->checkBoxTranslationsIS->setCheckState(Qt::CheckState::Checked);
1750 ui->checkBoxTranslationsID->setCheckState(Qt::CheckState::Checked);
1751 ui->checkBoxTranslationsGA->setCheckState(Qt::CheckState::Checked);
1752 ui->checkBoxTranslationsIT->setCheckState(Qt::CheckState::Checked);
1753 ui->checkBoxTranslationsJA->setCheckState(Qt::CheckState::Checked);
1754 ui->checkBoxTranslationsKO->setCheckState(Qt::CheckState::Checked);
1755 ui->checkBoxTranslationsKU->setCheckState(Qt::CheckState::Checked);
1756 ui->checkBoxTranslationsLV->setCheckState(Qt::CheckState::Checked);
1757 ui->checkBoxTranslationsLT->setCheckState(Qt::CheckState::Checked);
1758 ui->checkBoxTranslationsMK->setCheckState(Qt::CheckState::Checked);
1759 ui->checkBoxTranslationsML->setCheckState(Qt::CheckState::Checked);
1760 ui->checkBoxTranslationsMS->setCheckState(Qt::CheckState::Checked);
1761 ui->checkBoxTranslationsMT->setCheckState(Qt::CheckState::Checked);
1762 ui->checkBoxTranslationsNO->setCheckState(Qt::CheckState::Checked);
1763 ui->checkBoxTranslationsNB->setCheckState(Qt::CheckState::Checked);
1764 ui->checkBoxTranslationsNN->setCheckState(Qt::CheckState::Checked);
1765 ui->checkBoxTranslationsPL->setCheckState(Qt::CheckState::Checked);
1766 ui->checkBoxTranslationsPT->setCheckState(Qt::CheckState::Checked);
1767 ui->checkBoxTranslationsPA->setCheckState(Qt::CheckState::Checked);
1768 ui->checkBoxTranslationsRM->setCheckState(Qt::CheckState::Checked);
1769 ui->checkBoxTranslationsRO->setCheckState(Qt::CheckState::Checked);
1770 ui->checkBoxTranslationsRU->setCheckState(Qt::CheckState::Checked);
1771 ui->checkBoxTranslationsSR->setCheckState(Qt::CheckState::Checked);
1772 ui->checkBoxTranslationsSK->setCheckState(Qt::CheckState::Checked);
1773 ui->checkBoxTranslationsSL->setCheckState(Qt::CheckState::Checked);
1774 ui->checkBoxTranslationsSB->setCheckState(Qt::CheckState::Checked);
1775 ui->checkBoxTranslationsES->setCheckState(Qt::CheckState::Checked);
1776 ui->checkBoxTranslationsSV->setCheckState(Qt::CheckState::Checked);
1777 ui->checkBoxTranslationsTH->setCheckState(Qt::CheckState::Checked);
1778 ui->checkBoxTranslationsTS->setCheckState(Qt::CheckState::Checked);
1779 ui->checkBoxTranslationsTN->setCheckState(Qt::CheckState::Checked);
1780 ui->checkBoxTranslationsTR->setCheckState(Qt::CheckState::Checked);
1781 ui->checkBoxTranslationsUK->setCheckState(Qt::CheckState::Checked);
1782 ui->checkBoxTranslationsUR->setCheckState(Qt::CheckState::Checked);
1783 ui->checkBoxTranslationsVE->setCheckState(Qt::CheckState::Checked);
1784 ui->checkBoxTranslationsVI->setCheckState(Qt::CheckState::Checked);
1785 ui->checkBoxTranslationsCY->setCheckState(Qt::CheckState::Checked);
1786 ui->checkBoxTranslationsXH->setCheckState(Qt::CheckState::Checked);
1787 ui->checkBoxTranslationsYI->setCheckState(Qt::CheckState::Checked);
1788 ui->checkBoxTranslationsZU->setCheckState(Qt::CheckState::Checked);
1789 ui->checkBoxTranslationsAM->setCheckState(Qt::CheckState::Checked);
1790 ui->checkBoxTranslationsHY->setCheckState(Qt::CheckState::Checked);
1791 ui->checkBoxTranslationsAZ->setCheckState(Qt::CheckState::Checked);
1792 ui->checkBoxTranslationsBA->setCheckState(Qt::CheckState::Checked);
1793 ui->checkBoxTranslationsBN->setCheckState(Qt::CheckState::Checked);
1794 ui->checkBoxTranslationsBS->setCheckState(Qt::CheckState::Checked);
1795 ui->checkBoxTranslationsNY->setCheckState(Qt::CheckState::Checked);
1796 ui->checkBoxTranslationsCO->setCheckState(Qt::CheckState::Checked);
1797 ui->checkBoxTranslationsEO->setCheckState(Qt::CheckState::Checked);
1798 ui->checkBoxTranslationsFJ->setCheckState(Qt::CheckState::Checked);
1799 ui->checkBoxTranslationsFY->setCheckState(Qt::CheckState::Checked);
1800 ui->checkBoxTranslationsGL->setCheckState(Qt::CheckState::Checked);
1801 ui->checkBoxTranslationsKA->setCheckState(Qt::CheckState::Checked);
1802 ui->checkBoxTranslationsGU->setCheckState(Qt::CheckState::Checked);
1803 ui->checkBoxTranslationsHT->setCheckState(Qt::CheckState::Checked);
1804 ui->checkBoxTranslationsHA->setCheckState(Qt::CheckState::Checked);
1805 ui->checkBoxTranslationsIG->setCheckState(Qt::CheckState::Checked);
1806 ui->checkBoxTranslationsJW->setCheckState(Qt::CheckState::Checked);
1807 ui->checkBoxTranslationsKN->setCheckState(Qt::CheckState::Checked);
1808 ui->checkBoxTranslationsKK->setCheckState(Qt::CheckState::Checked);
1809 ui->checkBoxTranslationsKM->setCheckState(Qt::CheckState::Checked);
1810 ui->checkBoxTranslationsRW->setCheckState(Qt::CheckState::Checked);
1811 ui->checkBoxTranslationsKY->setCheckState(Qt::CheckState::Checked);
1812 ui->checkBoxTranslationsLO->setCheckState(Qt::CheckState::Checked);
1813 ui->checkBoxTranslationsLA->setCheckState(Qt::CheckState::Checked);
1814 ui->checkBoxTranslationsLB->setCheckState(Qt::CheckState::Checked);
1815 ui->checkBoxTranslationsMG->setCheckState(Qt::CheckState::Checked);
1816 ui->checkBoxTranslationsMI->setCheckState(Qt::CheckState::Checked);
1817 ui->checkBoxTranslationsMR->setCheckState(Qt::CheckState::Checked);
1818 ui->checkBoxTranslationsMN->setCheckState(Qt::CheckState::Checked);
1819 ui->checkBoxTranslationsMY->setCheckState(Qt::CheckState::Checked);
1820 ui->checkBoxTranslationsNE->setCheckState(Qt::CheckState::Checked);
1821 ui->checkBoxTranslationsOR->setCheckState(Qt::CheckState::Checked);
1822 ui->checkBoxTranslationsPS->setCheckState(Qt::CheckState::Checked);
1823 ui->checkBoxTranslationsSM->setCheckState(Qt::CheckState::Checked);
1824 ui->checkBoxTranslationsST->setCheckState(Qt::CheckState::Checked);
1825 ui->checkBoxTranslationsSN->setCheckState(Qt::CheckState::Checked);
1826 ui->checkBoxTranslationsSD->setCheckState(Qt::CheckState::Checked);
1827 ui->checkBoxTranslationsSI->setCheckState(Qt::CheckState::Checked);
1828 ui->checkBoxTranslationsSO->setCheckState(Qt::CheckState::Checked);
1829 ui->checkBoxTranslationsSU->setCheckState(Qt::CheckState::Checked);
1830 ui->checkBoxTranslationsSW->setCheckState(Qt::CheckState::Checked);
1831 ui->checkBoxTranslationsTL->setCheckState(Qt::CheckState::Checked);
1832 ui->checkBoxTranslationsTY->setCheckState(Qt::CheckState::Checked);
1833 ui->checkBoxTranslationsTG->setCheckState(Qt::CheckState::Checked);
1834 ui->checkBoxTranslationsTA->setCheckState(Qt::CheckState::Checked);
1835 ui->checkBoxTranslationsTT->setCheckState(Qt::CheckState::Checked);
1836 ui->checkBoxTranslationsTE->setCheckState(Qt::CheckState::Checked);
1837 ui->checkBoxTranslationsTO->setCheckState(Qt::CheckState::Checked);
1838 ui->checkBoxTranslationsTK->setCheckState(Qt::CheckState::Checked);
1839 ui->checkBoxTranslationsUG->setCheckState(Qt::CheckState::Checked);
1840 ui->checkBoxTranslationsUZ->setCheckState(Qt::CheckState::Checked);
1841 ui->checkBoxTranslationsYO->setCheckState(Qt::CheckState::Checked);
1842 ui->checkBoxTranslationsZH_CN->setCheckState(Qt::CheckState::Checked);
1843 ui->checkBoxTranslationsZH_TW->setCheckState(Qt::CheckState::Checked);
1844 ui->checkBoxTranslationsTLH->setCheckState(Qt::CheckState::Checked);
1845 ui->checkBoxTranslationsTLH_QAAK->setCheckState(Qt::CheckState::Checked);
1846 ui->checkBoxTranslationsYUE->setCheckState(Qt::CheckState::Checked);
1847 ui->checkBoxTranslationsCEB->setCheckState(Qt::CheckState::Checked);
1848 ui->checkBoxTranslationsFIL->setCheckState(Qt::CheckState::Checked);
1849 ui->checkBoxTranslationsHAW->setCheckState(Qt::CheckState::Checked);
1850 ui->checkBoxTranslationsMRJ->setCheckState(Qt::CheckState::Checked);
1851 ui->checkBoxTranslationsHMN->setCheckState(Qt::CheckState::Checked);
1852 ui->checkBoxTranslationsAPC->setCheckState(Qt::CheckState::Checked);
1853 ui->checkBoxTranslationsMHR->setCheckState(Qt::CheckState::Checked);
1854 ui->checkBoxTranslationsPAP->setCheckState(Qt::CheckState::Checked);
1855 ui->checkBoxTranslationsOTQ->setCheckState(Qt::CheckState::Checked);
1856 ui->checkBoxTranslationsSR_LATIN->setCheckState(Qt::CheckState::Checked);
1857 ui->checkBoxTranslationsUDM->setCheckState(Qt::CheckState::Checked);
1858 ui->checkBoxTranslationsYUA->setCheckState(Qt::CheckState::Checked);
1859 #else
1860 ui->lineEditTranslationsDoxyfile->clear();
1861 ui->lineEditTranslationsSource->clear();
1863 ui->lineEditTranslationsHelp->clear();
1864 ui->checkBoxTranslationsAF->setCheckState(Qt::CheckState::Unchecked);
1865 ui->checkBoxTranslationsSQ->setCheckState(Qt::CheckState::Unchecked);
1866 ui->checkBoxTranslationsAR->setCheckState(Qt::CheckState::Unchecked);
1867 ui->checkBoxTranslationsEU->setCheckState(Qt::CheckState::Unchecked);
1868 ui->checkBoxTranslationsBE->setCheckState(Qt::CheckState::Unchecked);
1869 ui->checkBoxTranslationsBG->setCheckState(Qt::CheckState::Unchecked);
1870 ui->checkBoxTranslationsCA->setCheckState(Qt::CheckState::Unchecked);
1871 ui->checkBoxTranslationsHR->setCheckState(Qt::CheckState::Unchecked);
1872 ui->checkBoxTranslationsCS->setCheckState(Qt::CheckState::Unchecked);
1873 ui->checkBoxTranslationsAR->setCheckState(Qt::CheckState::Unchecked);
1874 ui->checkBoxTranslationsNL->setCheckState(Qt::CheckState::Unchecked);
1875 ui->checkBoxTranslationsEN->setCheckState(Qt::CheckState::Unchecked);
1876 ui->checkBoxTranslationsET->setCheckState(Qt::CheckState::Unchecked);
1877 ui->checkBoxTranslationsFO->setCheckState(Qt::CheckState::Unchecked);
1878 ui->checkBoxTranslationsFA->setCheckState(Qt::CheckState::Unchecked);
1879 ui->checkBoxTranslationsFI->setCheckState(Qt::CheckState::Unchecked);
1880 ui->checkBoxTranslationsFR->setCheckState(Qt::CheckState::Unchecked);
1881 ui->checkBoxTranslationsGD->setCheckState(Qt::CheckState::Unchecked);
1882 ui->checkBoxTranslationsDE->setCheckState(Qt::CheckState::Unchecked);
1883 ui->checkBoxTranslationsEL->setCheckState(Qt::CheckState::Unchecked);
1884 ui->checkBoxTranslationsHE->setCheckState(Qt::CheckState::Unchecked);
1885 ui->checkBoxTranslationsHI->setCheckState(Qt::CheckState::Unchecked);
1886 ui->checkBoxTranslationsHU->setCheckState(Qt::CheckState::Unchecked);
1887 ui->checkBoxTranslationsIS->setCheckState(Qt::CheckState::Unchecked);
1888 ui->checkBoxTranslationsID->setCheckState(Qt::CheckState::Unchecked);
1889 ui->checkBoxTranslationsGA->setCheckState(Qt::CheckState::Unchecked);
1890 ui->checkBoxTranslationsIT->setCheckState(Qt::CheckState::Unchecked);
1891 ui->checkBoxTranslationsJA->setCheckState(Qt::CheckState::Unchecked);
1892 ui->checkBoxTranslationsKO->setCheckState(Qt::CheckState::Unchecked);
1893 ui->checkBoxTranslationsKU->setCheckState(Qt::CheckState::Unchecked);
1894 ui->checkBoxTranslationsLV->setCheckState(Qt::CheckState::Unchecked);
1895 ui->checkBoxTranslationsLT->setCheckState(Qt::CheckState::Unchecked);
1896 ui->checkBoxTranslationsMK->setCheckState(Qt::CheckState::Unchecked);
1897 ui->checkBoxTranslationsML->setCheckState(Qt::CheckState::Unchecked);
1898 ui->checkBoxTranslationsMS->setCheckState(Qt::CheckState::Unchecked);
1899 ui->checkBoxTranslationsMT->setCheckState(Qt::CheckState::Unchecked);
1900 ui->checkBoxTranslationsNO->setCheckState(Qt::CheckState::Unchecked);
1901 ui->checkBoxTranslationsNB->setCheckState(Qt::CheckState::Unchecked);
1902 ui->checkBoxTranslationsNN->setCheckState(Qt::CheckState::Unchecked);
1903 ui->checkBoxTranslationsPL->setCheckState(Qt::CheckState::Unchecked);
1904 ui->checkBoxTranslationsPT->setCheckState(Qt::CheckState::Unchecked);
1905 ui->checkBoxTranslationsPA->setCheckState(Qt::CheckState::Unchecked);
1906 ui->checkBoxTranslationsRM->setCheckState(Qt::CheckState::Unchecked);
1907 ui->checkBoxTranslationsRO->setCheckState(Qt::CheckState::Unchecked);
1908 ui->checkBoxTranslationsRU->setCheckState(Qt::CheckState::Unchecked);
1909 ui->checkBoxTranslationsSR->setCheckState(Qt::CheckState::Unchecked);
1910 ui->checkBoxTranslationsSK->setCheckState(Qt::CheckState::Unchecked);
1911 ui->checkBoxTranslationsSL->setCheckState(Qt::CheckState::Unchecked);
1912 ui->checkBoxTranslationsSB->setCheckState(Qt::CheckState::Unchecked);
1913 ui->checkBoxTranslationsES->setCheckState(Qt::CheckState::Unchecked);
1914 ui->checkBoxTranslationsSV->setCheckState(Qt::CheckState::Unchecked);
1915 ui->checkBoxTranslationsTH->setCheckState(Qt::CheckState::Unchecked);
1916 ui->checkBoxTranslationsTS->setCheckState(Qt::CheckState::Unchecked);
1917 ui->checkBoxTranslationsTN->setCheckState(Qt::CheckState::Unchecked);
1918 ui->checkBoxTranslationsTR->setCheckState(Qt::CheckState::Unchecked);
1919 ui->checkBoxTranslationsUK->setCheckState(Qt::CheckState::Unchecked);
1920 ui->checkBoxTranslationsUR->setCheckState(Qt::CheckState::Unchecked);
1921 ui->checkBoxTranslationsVE->setCheckState(Qt::CheckState::Unchecked);
1922 ui->checkBoxTranslationsVI->setCheckState(Qt::CheckState::Unchecked);
1923 ui->checkBoxTranslationsCY->setCheckState(Qt::CheckState::Unchecked);
1924 ui->checkBoxTranslationsXH->setCheckState(Qt::CheckState::Unchecked);
1925 ui->checkBoxTranslationsYI->setCheckState(Qt::CheckState::Unchecked);
1926 ui->checkBoxTranslationsZU->setCheckState(Qt::CheckState::Unchecked);
1927
1928 ui->checkBoxTranslationsAM->setCheckState(Qt::CheckState::Unchecked);
1929 ui->checkBoxTranslationsHY->setCheckState(Qt::CheckState::Unchecked);
1930 ui->checkBoxTranslationsAZ->setCheckState(Qt::CheckState::Unchecked);
1931 ui->checkBoxTranslationsBA->setCheckState(Qt::CheckState::Unchecked);
1932 ui->checkBoxTranslationsBN->setCheckState(Qt::CheckState::Unchecked);
1933 ui->checkBoxTranslationsBS->setCheckState(Qt::CheckState::Unchecked);
1934 ui->checkBoxTranslationsNY->setCheckState(Qt::CheckState::Unchecked);
1935 ui->checkBoxTranslationsCO->setCheckState(Qt::CheckState::Unchecked);
1936 ui->checkBoxTranslationsEO->setCheckState(Qt::CheckState::Unchecked);
1937 ui->checkBoxTranslationsFJ->setCheckState(Qt::CheckState::Unchecked);
1938 ui->checkBoxTranslationsFY->setCheckState(Qt::CheckState::Unchecked);
1939 ui->checkBoxTranslationsGL->setCheckState(Qt::CheckState::Unchecked);
1940 ui->checkBoxTranslationsKA->setCheckState(Qt::CheckState::Unchecked);
1941 ui->checkBoxTranslationsGU->setCheckState(Qt::CheckState::Unchecked);
1942 ui->checkBoxTranslationsHT->setCheckState(Qt::CheckState::Unchecked);
1943 ui->checkBoxTranslationsHA->setCheckState(Qt::CheckState::Unchecked);
1944 ui->checkBoxTranslationsIG->setCheckState(Qt::CheckState::Unchecked);
1945 ui->checkBoxTranslationsJW->setCheckState(Qt::CheckState::Unchecked);
1946 ui->checkBoxTranslationsKN->setCheckState(Qt::CheckState::Unchecked);
1947 ui->checkBoxTranslationsKK->setCheckState(Qt::CheckState::Unchecked);
1948 ui->checkBoxTranslationsKM->setCheckState(Qt::CheckState::Unchecked);
1949 ui->checkBoxTranslationsRW->setCheckState(Qt::CheckState::Unchecked);
1950 ui->checkBoxTranslationsKY->setCheckState(Qt::CheckState::Unchecked);
1951 ui->checkBoxTranslationsLO->setCheckState(Qt::CheckState::Unchecked);
1952 ui->checkBoxTranslationsLA->setCheckState(Qt::CheckState::Unchecked);
1953 ui->checkBoxTranslationsLB->setCheckState(Qt::CheckState::Unchecked);
1954 ui->checkBoxTranslationsMG->setCheckState(Qt::CheckState::Unchecked);
1955 ui->checkBoxTranslationsMI->setCheckState(Qt::CheckState::Unchecked);
1956 ui->checkBoxTranslationsMR->setCheckState(Qt::CheckState::Unchecked);
1957 ui->checkBoxTranslationsMN->setCheckState(Qt::CheckState::Unchecked);
1958 ui->checkBoxTranslationsMY->setCheckState(Qt::CheckState::Unchecked);
1959 ui->checkBoxTranslationsNE->setCheckState(Qt::CheckState::Unchecked);
1960 ui->checkBoxTranslationsOR->setCheckState(Qt::CheckState::Unchecked);
1961 ui->checkBoxTranslationsPS->setCheckState(Qt::CheckState::Unchecked);
1962 ui->checkBoxTranslationsSM->setCheckState(Qt::CheckState::Unchecked);
1963 ui->checkBoxTranslationsST->setCheckState(Qt::CheckState::Unchecked);
1964 ui->checkBoxTranslationsSN->setCheckState(Qt::CheckState::Unchecked);
1965 ui->checkBoxTranslationsSD->setCheckState(Qt::CheckState::Unchecked);
1966 ui->checkBoxTranslationsSI->setCheckState(Qt::CheckState::Unchecked);
1967 ui->checkBoxTranslationsSO->setCheckState(Qt::CheckState::Unchecked);
1968 ui->checkBoxTranslationsSU->setCheckState(Qt::CheckState::Unchecked);
1969 ui->checkBoxTranslationsSW->setCheckState(Qt::CheckState::Unchecked);
1970 ui->checkBoxTranslationsTL->setCheckState(Qt::CheckState::Unchecked);
1971 ui->checkBoxTranslationsTY->setCheckState(Qt::CheckState::Unchecked);
1972 ui->checkBoxTranslationsTG->setCheckState(Qt::CheckState::Unchecked);
1973 ui->checkBoxTranslationsTA->setCheckState(Qt::CheckState::Unchecked);
1974 ui->checkBoxTranslationsTT->setCheckState(Qt::CheckState::Unchecked);
1975 ui->checkBoxTranslationsTE->setCheckState(Qt::CheckState::Unchecked);
1976 ui->checkBoxTranslationsTO->setCheckState(Qt::CheckState::Unchecked);
1977 ui->checkBoxTranslationsTK->setCheckState(Qt::CheckState::Unchecked);
1978 ui->checkBoxTranslationsUG->setCheckState(Qt::CheckState::Unchecked);
1979 ui->checkBoxTranslationsUZ->setCheckState(Qt::CheckState::Unchecked);
1980 ui->checkBoxTranslationsYO->setCheckState(Qt::CheckState::Unchecked);
1981 ui->checkBoxTranslationsZH_CN->setCheckState(Qt::CheckState::Unchecked);
1982 ui->checkBoxTranslationsZH_TW->setCheckState(Qt::CheckState::Unchecked);
1983 ui->checkBoxTranslationsTLH->setCheckState(Qt::CheckState::Unchecked);
1984 ui->checkBoxTranslationsTLH_QAAK->setCheckState(Qt::CheckState::Unchecked);
1985 ui->checkBoxTranslationsYUE->setCheckState(Qt::CheckState::Unchecked);
1986 ui->checkBoxTranslationsCEB->setCheckState(Qt::CheckState::Unchecked);
1987 ui->checkBoxTranslationsFIL->setCheckState(Qt::CheckState::Unchecked);
1988 ui->checkBoxTranslationsHAW->setCheckState(Qt::CheckState::Unchecked);
1989 ui->checkBoxTranslationsMRJ->setCheckState(Qt::CheckState::Unchecked);
1990 ui->checkBoxTranslationsHMN->setCheckState(Qt::CheckState::Unchecked);
1991 ui->checkBoxTranslationsAPC->setCheckState(Qt::CheckState::Unchecked);
1992 ui->checkBoxTranslationsMHR->setCheckState(Qt::CheckState::Unchecked);
1993 ui->checkBoxTranslationsPAP->setCheckState(Qt::CheckState::Unchecked);
1994 ui->checkBoxTranslationsOTQ->setCheckState(Qt::CheckState::Unchecked);
1995 ui->checkBoxTranslationsSR_LATIN->setCheckState(Qt::CheckState::Unchecked);
1996 ui->checkBoxTranslationsUDM->setCheckState(Qt::CheckState::Unchecked);
1997 ui->checkBoxTranslationsYUA->setCheckState(Qt::CheckState::Unchecked);
1998 #endif
1999}
2000
2005{
2006 setMessage("clearTabProject", Debug);
2007 ui->textEditProjects->setText("");
2008}
2009
2014{
2015 setMessage("clearTabHelp", Debug);
2016 ui->textEditHelp->setText("");
2017}
2018
2022void MainWindow::clearForms(int tabNumber)
2023{
2024 setMessage("clearForms", Debug);
2025 switch (tabNumber)
2026 {
2027 case TabSettings: clearTabSettings(); break;
2029 case TabProject: clearTabProject(); break;
2030 case TabTabHelp: clearTabHelp(); break;
2031 case TabAll:
2032 ui->labelRecordIdProject->setText("");
2036 clearTabHelp();
2037 break;
2038 }
2039}
2040
2045{
2047 myDbModel->myProject->setMake(ui->radioButtonTranslationsQmake->isChecked() ? "qmake" : "cmake");
2048 //
2049 myDbModel->myProject->setID(ui->labelRecordIdProject->text());
2050 myDbModel->myProject->setQtProjectName(ui->lineEditProjectName->text());
2052 myDbModel->myProject->setSourceFolder(ui->lineEditTranslationsSource->text());
2054 myDbModel->myProject->setHelpFolder(ui->lineEditTranslationsHelp->text());
2055 myDbModel->myProject->setSourceLanguage(ui->comboBoxTranslationSourceLanguage->currentText());
2056 myDbModel->setProjectName(ui->lineEditProjectName->text());
2057}
2058
2063{
2064 myDbModel->myProject->setID(ui->labelRecordIdProject->text());
2065 myDbModel->myProject->setQtProjectName(ui->lineEditProjectName->text());
2067 myDbModel->myProject->setSourceFolder(ui->lineEditTranslationsSource->text());
2069 myDbModel->myProject->setHelpFolder(ui->lineEditTranslationsHelp->text());
2070 myDbModel->myProject->setSourceLanguage(ui->comboBoxTranslationSourceLanguage->currentText());
2072 myDbModel->myProject->setMake(ui->radioButtonTranslationsQmake->isChecked() ? "qmake" : "cmake");
2073 myDbModel->setProjectName(ui->lineEditProjectName->text());
2074}
2075
2080{
2083}
2084
2089{
2090 setMessage("setProjectClass", Debug);
2091 switch (tabNumber)
2092 {
2093 case TabSettings:
2095 break;
2096 case TabTranslations:
2098 break;
2099 case TabProject:
2100 break;
2101 case TabTabHelp:
2102 break;
2103 case TabSql:
2105 break;
2106 case TabAll:
2107 setTabAll();
2108 break;
2109 }
2110}
2111
2116{
2117 setMessage("onCompile", Debug);
2118 QString theProject = myLanguageModel->mySetting->combinePathFileName(ui->lineEditTranslationsProjectFolder->text(), QString("%1%2").arg(ui->lineEditProjectName->text(), ui->radioButtonTranslationsQmake->isChecked() ? ".pro" : ".cmake"));
2119 if (ui->radioButtonTranslationsQmake->isChecked())
2120 {
2121 // qmake
2122 theProject = myLanguageModel->mySetting->combinePathFileName(ui->lineEditTranslationsProjectFolder->text(), QString("%1%2").arg(ui->lineEditProjectName->text(), ".pro"));
2123 }
2124 else
2125 {
2126 // cmake
2127 theProject = myLanguageModel->mySetting->combinePathFileName(ui->lineEditTranslationsProjectFolder->text(), "CMakeLists.txt");
2128 }
2129 if (!myLanguageModel->mySetting->isFileExists(theProject))
2130 {
2131 myLanguageModel->mySetting->showMessageBox(QObject::tr("Project file not found").toLocal8Bit(), QString("%1: %2").arg(tr("Project file not found"), theProject).toLocal8Bit(), myLanguageModel->mySetting->Critical);
2132 return;
2133 }
2134 QString theLupdateResult = myDbModel->mySqlModel->runProcces(ui->lineEditSettingsLupdate->text(), theProject, true, 60);
2135 if (myDbModel->mySqlModel->getRunReturnCode() != 0)
2136 {
2137 myLanguageModel->mySetting->showMessageBox(QObject::tr("Error running lupdate").toLocal8Bit(), QString("%1: %2").arg(tr("Error running lupdate"), theLupdateResult).toLocal8Bit(), myLanguageModel->mySetting->Critical);
2138 return;
2139 }
2140 //
2141 ui->actionTranslate_Help->setDisabled(true);
2142 ui->actionTranslate_ReadMe->setDisabled(true);
2143 ui->actionAccept_Translations->setDisabled(true);
2144 //
2146 if (ui->radioButtonTranslationsQmake->isChecked())
2147 {
2148 // qmake
2149 myTranslationConf = "TRANSLATIONS += ";
2150 }
2151 else
2152 {
2153 // cmake
2154 myTranslationConf = "set(TS_FILES ";
2155 }
2156 myTranslationQrc.clear();
2157
2158 createTranslationJob("Afrikaans", "af" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsAF->isChecked());
2159 createTranslationJob("Albanian", "sq" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsSQ->isChecked());
2160 createTranslationJob("Amharic", "am" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsAM->isChecked());
2161 createTranslationJob("Arabic", "ar" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsAR->isChecked());
2162 createTranslationJob("Armenian", "hy" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsHY->isChecked());
2163 createTranslationJob("Azerbaijani", "az" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsAZ->isChecked());
2164 createTranslationJob("Bashkir", "ba" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsBA->isChecked());
2165 createTranslationJob("Basque", "eu" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsEU->isChecked());
2166 createTranslationJob("Belarusian", "be" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsBE->isChecked());
2167 createTranslationJob("Bengali", "bn" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsBN->isChecked());
2168 createTranslationJob("Bosnian", "bs" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsBS->isChecked());
2169 createTranslationJob("Bulgarian", "bg" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsBG->isChecked());
2170 createTranslationJob("Cantonese", "yue", ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsYO->isChecked());
2171 createTranslationJob("Catalan", "ca" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsCA->isChecked());
2172 createTranslationJob("Cebuano", "ceb", ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsYO->isChecked());
2173 createTranslationJob("Chichewa", "ny" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsNY->isChecked());
2174 createTranslationJob("Corsican", "co" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsCO->isChecked());
2175 createTranslationJob("Croatian", "hr" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsHR->isChecked());
2176 createTranslationJob("Czech", "cs" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsCS->isChecked());
2177 createTranslationJob("SimplifiedChinese", "zh-CN" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsZH_CN->isChecked());
2178 createTranslationJob("TraditionalChinese", "zh-TW" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsZH_TW->isChecked());
2179 createTranslationJob("Danish", "da" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsDA->isChecked());
2180 createTranslationJob("Dutch", "nl" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsNL->isChecked());
2181 createTranslationJob("English", "en" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsEN->isChecked());
2182 createTranslationJob("Estonian", "et" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsET->isChecked());
2183 createTranslationJob("Esperanto", "eo" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsEO->isChecked());
2184 createTranslationJob("Faeroese", "fo" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsFO->isChecked());
2185 createTranslationJob("Farsi", "fa" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsFA->isChecked());
2186 createTranslationJob("Fijian", "fj" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsFJ->isChecked());
2187 createTranslationJob("Filipino", "fil", ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsYO->isChecked());
2188 createTranslationJob("Finnish", "fi" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsFI->isChecked());
2189 createTranslationJob("French", "fr" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsFR->isChecked());
2190 createTranslationJob("Frisian", "fy" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsFY->isChecked());
2191 createTranslationJob("Gaelic", "gd" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsGD->isChecked());
2192 createTranslationJob("Galician", "gl" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsGL->isChecked());
2193 createTranslationJob("Georgian", "ka" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsKA->isChecked());
2194 createTranslationJob("German", "de" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsDE->isChecked());
2195 createTranslationJob("Greek", "el" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsEL->isChecked());
2196 createTranslationJob("Gujarati", "gu" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsGU->isChecked());
2197 createTranslationJob("Haitian", "ht" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsHT->isChecked());
2198 createTranslationJob("Hausa", "ha" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsHA->isChecked());
2199 createTranslationJob("Hawaiian", "haw", ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsYO->isChecked());
2200 createTranslationJob("Hebrew", "he" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsHE->isChecked());
2201 createTranslationJob("HillMari", "mrj", ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsYO->isChecked());
2202 createTranslationJob("Hindi", "hi" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsHI->isChecked());
2203 createTranslationJob("Hmong", "hmn", ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsYO->isChecked());
2204 createTranslationJob("Hungarian", "hu" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsHU->isChecked());
2205 createTranslationJob("Icelandic", "is" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsIS->isChecked());
2206 createTranslationJob("Igbo", "ig" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsIG->isChecked());
2207 createTranslationJob("Indonesian", "id" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsID->isChecked());
2208 createTranslationJob("Irish", "ga" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsGA->isChecked());
2209 createTranslationJob("Italian", "it" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsIT->isChecked());
2210 createTranslationJob("Japanese", "ja" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsJA->isChecked());
2211 createTranslationJob("Javanese", "jw" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsJW->isChecked());
2212 createTranslationJob("Kannada", "kn" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsKN->isChecked());
2213 createTranslationJob("Kazakh", "kk" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsKK->isChecked());
2214 createTranslationJob("Khmer", "km" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsKM->isChecked());
2215 createTranslationJob("Kinyarwanda", "rw" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsRW->isChecked());
2216 createTranslationJob("Klingon", "tlh", ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsYO->isChecked());
2217 createTranslationJob("KlingonPlqaD", "tlh-Qaak", ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsYO->isChecked());
2218 createTranslationJob("Korean", "ko" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsKO->isChecked());
2219 createTranslationJob("Kurdish", "ku" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsKU->isChecked());
2220 createTranslationJob("Kyrgyz", "ky" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsKY->isChecked());
2221 createTranslationJob("Latvian", "lv" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsLV->isChecked());
2222 createTranslationJob("Lao", "lo" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsLO->isChecked());
2223 createTranslationJob("Latin", "la" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsLA->isChecked());
2224 createTranslationJob("LevantineArabic", "apc", ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsYO->isChecked());
2225 createTranslationJob("Lithuanian", "lt" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsLT->isChecked());
2226 createTranslationJob("Luxembourgish", "lb" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsLB->isChecked());
2227 createTranslationJob("Macedonian", "mk" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsMK->isChecked());
2228 createTranslationJob("Mari", "mhr", ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsYO->isChecked());
2229 createTranslationJob("Maori", "mi" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsMI->isChecked());
2230 createTranslationJob("Marathi", "mr" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsMR->isChecked());
2231 createTranslationJob("Malagasy", "mg" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsMG->isChecked());
2232 createTranslationJob("Malayalam", "ml" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsML->isChecked());
2233 createTranslationJob("Malaysian", "ms" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsMS->isChecked());
2234 createTranslationJob("Maltese", "mt" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsMT->isChecked());
2235 createTranslationJob("Mongolian", "mn" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsMN->isChecked());
2236 createTranslationJob("Myanmar", "my" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsMY->isChecked());
2237 createTranslationJob("Norwegian", "no" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsNO->isChecked());
2238 createTranslationJob("Bokmal", "nb" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsNB->isChecked());
2239 createTranslationJob("Nepali", "ne" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsNE->isChecked());
2240 createTranslationJob("Nynorsk", "nn" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsNN->isChecked());
2241 createTranslationJob("Oriya", "or" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsOR->isChecked());
2242 createTranslationJob("Pashto", "ps" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsPS->isChecked());
2243 createTranslationJob("Papiamento", "pap", ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsYO->isChecked());
2244 createTranslationJob("Polish", "pl" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsPL->isChecked());
2245 createTranslationJob("Portuguese", "pt" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsPT->isChecked());
2246 createTranslationJob("Punjabi", "pa" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsPA->isChecked());
2247 createTranslationJob("QueretaroOtomi", "otq", ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsYO->isChecked());
2248 createTranslationJob("Rhaeto-Romanic", "rm" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsRM->isChecked());
2249 createTranslationJob("Romanian", "ro" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsRO->isChecked());
2250 createTranslationJob("Russian", "ru" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsRU->isChecked());
2251 createTranslationJob("Samoan", "sm" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsSM->isChecked());
2252 createTranslationJob("Serbian", "sr" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsSR->isChecked());
2253 createTranslationJob("SerbianLatin", "sr-Latin", ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsYO->isChecked());
2254 createTranslationJob("Slovak", "sk" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsSK->isChecked());
2255 createTranslationJob("Slovenian", "sl" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsSL->isChecked());
2256 createTranslationJob("Sesotho", "st" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsST->isChecked());
2257 createTranslationJob("Shona", "sn" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsSN->isChecked());
2258 createTranslationJob("Sindhi", "sd" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsSD->isChecked());
2259 createTranslationJob("Sinhala", "si" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsSI->isChecked());
2260 createTranslationJob("Somali", "so" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsSO->isChecked());
2261 createTranslationJob("Sorbian", "sb" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsSB->isChecked());
2262 createTranslationJob("Spanish", "es" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsES->isChecked());
2263 createTranslationJob("Sundanese", "su" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsSU->isChecked());
2264 createTranslationJob("Swahili", "sw" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsSW->isChecked());
2265 createTranslationJob("Swedish", "sv" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsSV->isChecked());
2266 createTranslationJob("Tagalog", "tl" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsTL->isChecked());
2267 createTranslationJob("Tahitian", "ty" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsTY->isChecked());
2268 createTranslationJob("Tajik", "tg" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsTG->isChecked());
2269 createTranslationJob("Tamil", "ta" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsTA->isChecked());
2270 createTranslationJob("Tatar", "tt" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsTT->isChecked());
2271 createTranslationJob("Telugu", "te" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsTE->isChecked());
2272 createTranslationJob("Thai", "th" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsTH->isChecked());
2273 createTranslationJob("Tongan", "to" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsTO->isChecked());
2274 createTranslationJob("Tsonga", "ts" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsTS->isChecked());
2275 createTranslationJob("Tswana", "tn" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsTN->isChecked());
2276 createTranslationJob("Turkish", "tr" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsTR->isChecked());
2277 createTranslationJob("Turkmen", "tk" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsTK->isChecked());
2278 createTranslationJob("Uighur", "ub" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsUG->isChecked());
2279 createTranslationJob("Ukrainian", "uk" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsUK->isChecked());
2280 createTranslationJob("Urdu", "ur" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsUR->isChecked());
2281 createTranslationJob("Udmurt", "udm", ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsYO->isChecked());
2282 createTranslationJob("Uzbek", "uz" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsUZ->isChecked());
2283 createTranslationJob("Venda", "ve" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsVE->isChecked());
2284 createTranslationJob("Vietnamese", "vi" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsVI->isChecked());
2285 createTranslationJob("Welsh", "cy" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsCY->isChecked());
2286 createTranslationJob("Xhosa", "xh" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsXH->isChecked());
2287 createTranslationJob("Yiddish", "yi" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsYI->isChecked());
2288 createTranslationJob("Yoruba", "yo" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsYO->isChecked());
2289 createTranslationJob("YucatecMaya", "yua", ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsYO->isChecked());
2290 createTranslationJob("Zulu", "zu" , ui->comboBoxTranslationSourceLanguage->currentText(), ui->checkBoxTranslationsZU->isChecked());
2291
2292 if (ui->radioButtonTranslationsCmake->isChecked()) { myTranslationConf.append(")"); }
2293 //
2294 ui->textEditProjects->setText(QString("%1\n\n\n%2").arg(myTranslationConf, myTranslationQrc));
2296 ui->progressBarProjectsFiles->setMaximum(myLingoJob.count());
2297 ui->progressBarProjectsFiles->show();
2298 // Go to Tab
2299 ui->tabWidget->setCurrentIndex(ui->tabWidget->indexOf(ui->tabWidget->findChild<QWidget*>("tabProject")));
2300 //
2302 // Now I can run the job with myLingoJob
2303 for( int i = 0; i < myLingoJob.count(); ++i )
2304 {
2305 ui->progressBarProjectsFiles->setValue(i);
2306 setMessage("Translating..." + myLingoJob.at(i).getLanguageName(), Debug);
2307 // check for files existance and delete it
2308 QString theTempFoler = QString("%1%2%3").arg(myLanguageModel->mySetting->getAppDataLocation(), QDir::separator(), "temp");
2309 if (!myLanguageModel->mySetting->isMakeDir(theTempFoler))
2310 {
2311 myLanguageModel->mySetting->showMessageBox(QObject::tr("Error trying to make directory").toLocal8Bit(), QString("%1: %2").arg(tr("Can not make directory"), theTempFoler).toLocal8Bit(), myLanguageModel->mySetting->Critical);
2312 }
2313
2314 if (!myLanguageModel->mySetting->removeAllFiles(theTempFoler))
2315 {
2316 myLanguageModel->mySetting->showMessageBox(QObject::tr("Error trying to remove all files").toLocal8Bit(), QString("%1: %2").arg(tr("Can not remove all files"), theTempFoler).toLocal8Bit(), myLanguageModel->mySetting->Critical);
2317 }
2318
2319 QString theDestTxtFile = QString("%1%2%3%4%5_%6.txt").arg(myLanguageModel->mySetting->getAppDataLocation(), QDir::separator(), "temp", QDir::separator(), ui->lineEditProjectName->text(), myLingoJob.at(i).getLangName());
2320 // Create Txt file
2321 myTranlatorParser->toTXT(myLingoJob.at(i).getTsFile(), theTempFoler, true, false, true);
2322 // make sure txt file exist or continue because it might be translated, those it made no file
2323 if (!myLanguageModel->mySetting->isFileExists(theDestTxtFile))
2324 {
2325 //myLanguageModel->mySetting->showMessageBox(QObject::tr("Could not find the Txt file").toLocal8Bit(), QString("%1: %2").arg(tr("Can not find Txt file"), theDestTxtFile).toLocal8Bit(), myLanguageModel->mySetting->Critical);
2326 continue;
2327 }
2328 bool isSameLanguage = false;
2329 if (myLingoJob.at(i).getLanguageName() == ui->comboBoxTranslationSourceLanguage->currentText()) { isSameLanguage = true; }
2330 //
2331 QString theTxtFileContent;
2332 //
2333 QFile theInputTxtFile(theDestTxtFile);
2334 if (theInputTxtFile.open(QIODevice::ReadOnly))
2335 {
2336 int theTranslastionsCounter = 1;
2337 ui->progressBarProjectsTranslations->setMaximum(myLanguageModel->mySetting->fileNumberLines(theDestTxtFile));
2338 QTextStream theTxtFileStream(&theInputTxtFile);
2339 while (!theTxtFileStream.atEnd())
2340 {
2341 ui->progressBarProjectsTranslations->setValue(theTranslastionsCounter++);
2342 // [[[00000281]]] "%1"
2343 QString theLine = theTxtFileStream.readLine();
2344 // Append ID
2345 theTxtFileContent.append(theLine.leftRef(theLine.indexOf("\"") -1));
2346 // Find what is in between "?"
2347 QString theMatch = theLine.section('"', 1, 1);
2348 // Check to see if it has any Letters in it
2349 if (myLanguageModel->mySetting->isWord(theMatch))
2350 {
2351 if (theMatch.contains("%")) { removeArgs(theMatch, myLingoJob.at(i).getTsFile()); }
2352 if (isSameLanguage)
2353 { myTranslation = theMatch; }
2354 else
2355 {
2356 // QString &text, Engine engine, Language translationLang, Language sourceLang, Language uiLang
2357 myTranslation = translateWithReturn(theMatch, QOnlineTranslator::Engine::Google, myLingoJob.at(i).getLang(), myLingoJob.at(i).getSourceLang(), myQOnlineTranslator.language(QLocale()));
2358 myTranslation = checkTranslationErrors(myTranslation, theMatch, QOnlineTranslator::Engine::Google, myLingoJob.at(i).getLang(), myLingoJob.at(i).getSourceLang(), myQOnlineTranslator.language(QLocale()));
2359 // if empty use another service
2360 if (myTranslation.isEmpty())
2361 {
2362 myTranslation = translateWithReturn(theMatch, QOnlineTranslator::Engine::Bing, myLingoJob.at(i).getLang(), myLingoJob.at(i).getSourceLang(), myQOnlineTranslator.language(QLocale()));
2363 myTranslation = checkTranslationErrors(myTranslation, theMatch, QOnlineTranslator::Engine::Google, myLingoJob.at(i).getLang(), myLingoJob.at(i).getSourceLang(), myQOnlineTranslator.language(QLocale()));
2364 if (myTranslation.isEmpty())
2365 {
2366 myTranslation = translateWithReturn(theMatch, QOnlineTranslator::Engine::Yandex, myLingoJob.at(i).getLang(), myLingoJob.at(i).getSourceLang(), myQOnlineTranslator.language(QLocale()));
2367 myTranslation = checkTranslationErrors(myTranslation, theMatch, QOnlineTranslator::Engine::Google, myLingoJob.at(i).getLang(), myLingoJob.at(i).getSourceLang(), myQOnlineTranslator.language(QLocale()));
2368 }
2369 }
2370 }
2371 }
2372 if (myTranslation.isEmpty()) { myTranslation = theMatch; }
2373 theTxtFileContent.append(QString(" \"%1\"\n").arg(myTranslation));
2374 ui->statusbar->showMessage(QString("%1: %2 = %3").arg(myLingoJob.at(i).getLanguageName(), theMatch, myTranslation));
2375 // Set a delay or you will be ban from Engine
2376 if (!isSameLanguage) { myLanguageModel->mySetting->delay(ui->spinBoxSettingsDelay->value()); }
2377 }
2378 theInputTxtFile.close();
2379 myLanguageModel->mySetting->writeFile(theDestTxtFile, theTxtFileContent);
2380 if (myLanguageModel->mySetting->isFileExists(theDestTxtFile))
2381 {
2382 fixTranslationFile(theDestTxtFile);
2383 // Create Txt file
2384 myTranlatorParser->toTS(theTempFoler, myLingoJob.at(i).getTsFile(), myLingoJob.at(i).getLangName());
2385 }
2386 } // end if (theInputTxtFile.open(QIODevice::ReadOnly))
2387 } // end for( int i = 0; i < myLingoJob.count(); ++i )
2388 QString theLreleaseResult = myDbModel->mySqlModel->runProcces(ui->lineEditSettingsLrelease->text(), theProject, true, 60);
2389 if (myDbModel->mySqlModel->getRunReturnCode() != 0)
2390 {
2391 myLanguageModel->mySetting->showMessageBox(QObject::tr("Error running lrelease").toLocal8Bit(), QString("%1: %2").arg(tr("Error running lrelease"), theLreleaseResult).toLocal8Bit(), myLanguageModel->mySetting->Critical);
2392 }
2394 ui->progressBarProjectsFiles->hide();
2396 ui->statusbar->showMessage("");
2397 //
2398 ui->actionTranslate_Help->setDisabled(false);
2399 ui->actionTranslate_ReadMe->setDisabled(false);
2400 ui->actionAccept_Translations->setDisabled(false);
2402} // end onCompile
2403
2407void MainWindow::setTranslationErrorType(const QString &thisTranslations)
2408{
2409 if (!myTranslationError.isEmpty())
2410 {
2411 if (thisTranslations.contains("Error transferring"))
2412 {
2413 // server replied: Too Many Requests, seems to happen with Arabic FIXME
2414 myTranslationErrorType = ErrorTransferring;
2415 }
2416 else if (thisTranslations.contains("Socket operation timed out"))
2417 {
2418 // Internet Down
2419 myTranslationErrorType = HostNotFound;
2420 }
2421 else if (thisTranslations.contains("Host www.bing.com not found"))
2422 {
2423 // Internet Down
2424 myTranslationErrorType = HostNotFound;
2425 }
2426 else if (thisTranslations.contains("Host translate.yandex.com not found"))
2427 {
2428 // Internet Down
2429 myTranslationErrorType = HostNotFound;
2430 }
2431 else if (thisTranslations.contains("Host translate.googleapis.com not found"))
2432 {
2433 // Internet Down
2434 myTranslationErrorType = HostNotFound;
2435 }
2436 else
2437 {
2438 myTranslationErrorType = NoError; // No Error Type detected, Log Critical
2439 }
2440 }
2441}
2442
2446QString MainWindow::checkTranslationErrors(const QString &thisTranslations, const QString &thisText, QOnlineTranslator::Engine thisEngine, QOnlineTranslator::Language thisTranslationLang, QOnlineTranslator::Language thisSourceLang, QOnlineTranslator::Language thisUiLang)
2447{
2448 if (isTranslationError) { setTranslationErrorType(thisTranslations); }
2449 switch (myTranslationErrorType)
2450 {
2451 case HostNotFound:
2452 myLanguageModel->mySetting->getInternetWait();
2453 myTranslation = translateWithReturn(thisText, thisEngine, thisTranslationLang, thisSourceLang, thisUiLang);
2454 break;
2455 case ErrorTransferring:
2456 // Increase delay, wait, and retry
2457 ui->spinBoxSettingsDelay->setValue(ui->spinBoxSettingsDelay->value() + myIncreameantValue);
2458 myLanguageModel->mySetting->delay(myDelayValue + myIncreameantValue);
2459 myTranslation = translateWithReturn(thisText, thisEngine, thisTranslationLang, thisSourceLang, thisUiLang);
2460 break;
2461 case NoError:
2462 myLanguageModel->mySetting->showMessageBox(tr("Translation Error not found"), QString("%1: %2").arg(tr("Translation Error not found"), thisTranslations), myLanguageModel->mySetting->Critical);
2463 myTranslation = thisTranslations;
2464 break;
2465 }
2466 return myTranslation;
2467}
2468
2473{
2474 const QStringList theTsFiles = myLanguageModel->getTsFiles(ui->lineEditTranslationsSource->text());
2475 for (int i = 0; i < theTsFiles.size(); ++i)
2476 {
2477 if (!myLanguageModel->mySetting->isFileExists(theTsFiles.at(i)))
2478 { myLanguageModel->mySetting->showMessageBox(tr("Translation TS File not found"), QString("%1: %2").arg(tr("Translation TS File not found"), theTsFiles.at(i)), myLanguageModel->mySetting->Critical); }
2479 QString theFileContent = myLanguageModel->mySetting->readFile(theTsFiles.at(i));
2480 theFileContent.replace(QString(" type=\"unfinished\""), QString("")); // replace text in string
2481 myLanguageModel->mySetting->writeFile(theTsFiles.at(i), theFileContent);
2482 }
2483 ui->statusbar->showMessage(tr("Accepted all Translations"));
2484}
2485
2490{
2491 myLingoJob.clear();
2492 myHelpTranslationsFiles.clear();
2493 myHelpFileNames.clear();
2494 myTranslationQrc.clear();
2495 QString theHelpPath = ui->lineEditTranslationsHelp->text();
2496 QDir dir(theHelpPath);
2497 QStringList theFileNames = dir.entryList(QStringList("*.md"), QDir::Files, QDir::Name);
2498 for (QString &theFileName : theFileNames)
2499 {
2500 QString theLangCode = myLanguageModel->getLangCode(theFileName);
2501 if (ui->labelTranslationsSourceLanguageCode->text() == theLangCode)
2502 { myHelpTranslationsFiles.append(dir.filePath(theFileName)); }
2503 }
2504 for (QString &fileName : myHelpTranslationsFiles)
2505 {
2506 QString theFileName = myLanguageModel->mySetting->getFileInfo(myLanguageModel->mySetting->BaseName, fileName);
2507 int theIndex = theFileName.indexOf("_");
2508 theFileName = theFileName.mid(0, theIndex);
2509 myHelpFileNames.append(theFileName);
2510 }
2511 //
2513 //
2514 createHelpTranslationJob("Afrikaans", "af" , ui->checkBoxTranslationsAF->isChecked());
2515 createHelpTranslationJob("Albanian", "sq" , ui->checkBoxTranslationsSQ->isChecked());
2516 createHelpTranslationJob("Amharic", "am" , ui->checkBoxTranslationsAM->isChecked());
2517 createHelpTranslationJob("Arabic", "ar" , ui->checkBoxTranslationsAR->isChecked());
2518 createHelpTranslationJob("Armenian", "hy" , ui->checkBoxTranslationsHY->isChecked());
2519 createHelpTranslationJob("Azerbaijani", "az" , ui->checkBoxTranslationsAZ->isChecked());
2520 createHelpTranslationJob("Bashkir", "ba" , ui->checkBoxTranslationsBA->isChecked());
2521 createHelpTranslationJob("Basque", "eu" , ui->checkBoxTranslationsEU->isChecked());
2522 createHelpTranslationJob("Belarusian", "be" , ui->checkBoxTranslationsBE->isChecked());
2523 createHelpTranslationJob("Bengali", "bn" , ui->checkBoxTranslationsBN->isChecked());
2524 createHelpTranslationJob("Bosnian", "bs" , ui->checkBoxTranslationsBS->isChecked());
2525 createHelpTranslationJob("Bulgarian", "bg" , ui->checkBoxTranslationsBG->isChecked());
2526 createHelpTranslationJob("Cantonese", "yue", ui->checkBoxTranslationsYO->isChecked());
2527 createHelpTranslationJob("Catalan", "ca" , ui->checkBoxTranslationsCA->isChecked());
2528 createHelpTranslationJob("Cebuano", "ceb", ui->checkBoxTranslationsYO->isChecked());
2529 createHelpTranslationJob("Chichewa", "ny" , ui->checkBoxTranslationsNY->isChecked());
2530 createHelpTranslationJob("Corsican", "co" , ui->checkBoxTranslationsCO->isChecked());
2531 createHelpTranslationJob("Croatian", "hr" , ui->checkBoxTranslationsHR->isChecked());
2532 createHelpTranslationJob("Czech", "cs" , ui->checkBoxTranslationsCS->isChecked());
2533 createHelpTranslationJob("SimplifiedChinese", "zh-CN" , ui->checkBoxTranslationsZH_CN->isChecked());
2534 createHelpTranslationJob("TraditionalChinese", "zh-TW" , ui->checkBoxTranslationsZH_TW->isChecked());
2535 createHelpTranslationJob("Danish", "da" , ui->checkBoxTranslationsDA->isChecked());
2536 createHelpTranslationJob("Dutch", "nl" , ui->checkBoxTranslationsNL->isChecked());
2537 createHelpTranslationJob("English", "en" , ui->checkBoxTranslationsEN->isChecked());
2538 createHelpTranslationJob("Estonian", "et" , ui->checkBoxTranslationsET->isChecked());
2539 createHelpTranslationJob("Esperanto", "eo" , ui->checkBoxTranslationsEO->isChecked());
2540 createHelpTranslationJob("Faeroese", "fo" , ui->checkBoxTranslationsFO->isChecked());
2541 createHelpTranslationJob("Farsi", "fa" , ui->checkBoxTranslationsFA->isChecked());
2542 createHelpTranslationJob("Fijian", "fj" , ui->checkBoxTranslationsFJ->isChecked());
2543 createHelpTranslationJob("Filipino", "fil", ui->checkBoxTranslationsYO->isChecked());
2544 createHelpTranslationJob("Finnish", "fi" , ui->checkBoxTranslationsFI->isChecked());
2545 createHelpTranslationJob("French", "fr" , ui->checkBoxTranslationsFR->isChecked());
2546 createHelpTranslationJob("Frisian", "fy" , ui->checkBoxTranslationsFY->isChecked());
2547 createHelpTranslationJob("Gaelic", "gd" , ui->checkBoxTranslationsGD->isChecked());
2548 createHelpTranslationJob("Galician", "gl" , ui->checkBoxTranslationsGL->isChecked());
2549 createHelpTranslationJob("Georgian", "ka" , ui->checkBoxTranslationsKA->isChecked());
2550 createHelpTranslationJob("German", "de" , ui->checkBoxTranslationsDE->isChecked());
2551 createHelpTranslationJob("Greek", "el" , ui->checkBoxTranslationsEL->isChecked());
2552 createHelpTranslationJob("Gujarati", "gu" , ui->checkBoxTranslationsGU->isChecked());
2553 createHelpTranslationJob("Haitian", "ht" , ui->checkBoxTranslationsHT->isChecked());
2554 createHelpTranslationJob("Hausa", "ha" , ui->checkBoxTranslationsHA->isChecked());
2555 createHelpTranslationJob("Hawaiian", "haw", ui->checkBoxTranslationsYO->isChecked());
2556 createHelpTranslationJob("Hebrew", "he" , ui->checkBoxTranslationsHE->isChecked());
2557 createHelpTranslationJob("HillMari", "mrj", ui->checkBoxTranslationsYO->isChecked());
2558 createHelpTranslationJob("Hindi", "hi" , ui->checkBoxTranslationsHI->isChecked());
2559 createHelpTranslationJob("Hmong", "hmn", ui->checkBoxTranslationsYO->isChecked());
2560 createHelpTranslationJob("Hungarian", "hu" , ui->checkBoxTranslationsHU->isChecked());
2561 createHelpTranslationJob("Icelandic", "is" , ui->checkBoxTranslationsIS->isChecked());
2562 createHelpTranslationJob("Igbo", "ig" , ui->checkBoxTranslationsIG->isChecked());
2563 createHelpTranslationJob("Indonesian", "id" , ui->checkBoxTranslationsID->isChecked());
2564 createHelpTranslationJob("Irish", "ga" , ui->checkBoxTranslationsGA->isChecked());
2565 createHelpTranslationJob("Italian", "it" , ui->checkBoxTranslationsIT->isChecked());
2566 createHelpTranslationJob("Japanese", "ja" , ui->checkBoxTranslationsJA->isChecked());
2567 createHelpTranslationJob("Javanese", "jw" , ui->checkBoxTranslationsJW->isChecked());
2568 createHelpTranslationJob("Kannada", "kn" , ui->checkBoxTranslationsKN->isChecked());
2569 createHelpTranslationJob("Kazakh", "kk" , ui->checkBoxTranslationsKK->isChecked());
2570 createHelpTranslationJob("Khmer", "km" , ui->checkBoxTranslationsKM->isChecked());
2571 createHelpTranslationJob("Kinyarwanda", "rw" , ui->checkBoxTranslationsRW->isChecked());
2572 createHelpTranslationJob("Klingon", "tlh", ui->checkBoxTranslationsYO->isChecked());
2573 createHelpTranslationJob("KlingonPlqaD", "tlh-Qaak", ui->checkBoxTranslationsYO->isChecked());
2574 createHelpTranslationJob("Korean", "ko" , ui->checkBoxTranslationsKO->isChecked());
2575 createHelpTranslationJob("Kurdish", "ku" , ui->checkBoxTranslationsKU->isChecked());
2576 createHelpTranslationJob("Kyrgyz", "ky" , ui->checkBoxTranslationsKY->isChecked());
2577 createHelpTranslationJob("Latvian", "lv" , ui->checkBoxTranslationsLV->isChecked());
2578 createHelpTranslationJob("Lao", "lo" , ui->checkBoxTranslationsLO->isChecked());
2579 createHelpTranslationJob("Latin", "la" , ui->checkBoxTranslationsLA->isChecked());
2580 createHelpTranslationJob("LevantineArabic", "apc", ui->checkBoxTranslationsYO->isChecked());
2581 createHelpTranslationJob("Lithuanian", "lt" , ui->checkBoxTranslationsLT->isChecked());
2582 createHelpTranslationJob("Luxembourgish", "lb" , ui->checkBoxTranslationsLB->isChecked());
2583 createHelpTranslationJob("Macedonian", "mk" , ui->checkBoxTranslationsMK->isChecked());
2584 createHelpTranslationJob("Mari", "mhr", ui->checkBoxTranslationsYO->isChecked());
2585 createHelpTranslationJob("Maori", "mi" , ui->checkBoxTranslationsMI->isChecked());
2586 createHelpTranslationJob("Marathi", "mr" , ui->checkBoxTranslationsMR->isChecked());
2587 createHelpTranslationJob("Malagasy", "mg" , ui->checkBoxTranslationsMG->isChecked());
2588 createHelpTranslationJob("Malayalam", "ml" , ui->checkBoxTranslationsML->isChecked());
2589 createHelpTranslationJob("Malaysian", "ms" , ui->checkBoxTranslationsMS->isChecked());
2590 createHelpTranslationJob("Maltese", "mt" , ui->checkBoxTranslationsMT->isChecked());
2591 createHelpTranslationJob("Mongolian", "mn" , ui->checkBoxTranslationsMN->isChecked());
2592 createHelpTranslationJob("Myanmar", "my" , ui->checkBoxTranslationsMY->isChecked());
2593 createHelpTranslationJob("Norwegian", "no" , ui->checkBoxTranslationsNO->isChecked());
2594 createHelpTranslationJob("Bokmal", "nb" , ui->checkBoxTranslationsNB->isChecked());
2595 createHelpTranslationJob("Nepali", "ne" , ui->checkBoxTranslationsNE->isChecked());
2596 createHelpTranslationJob("Nynorsk", "nn" , ui->checkBoxTranslationsNN->isChecked());
2597 createHelpTranslationJob("Oriya", "or" , ui->checkBoxTranslationsOR->isChecked());
2598 createHelpTranslationJob("Pashto", "ps" , ui->checkBoxTranslationsPS->isChecked());
2599 createHelpTranslationJob("Papiamento", "pap", ui->checkBoxTranslationsYO->isChecked());
2600 createHelpTranslationJob("Polish", "pl" , ui->checkBoxTranslationsPL->isChecked());
2601 createHelpTranslationJob("Portuguese", "pt" , ui->checkBoxTranslationsPT->isChecked());
2602 createHelpTranslationJob("Punjabi", "pa" , ui->checkBoxTranslationsPA->isChecked());
2603 createHelpTranslationJob("QueretaroOtomi", "otq", ui->checkBoxTranslationsYO->isChecked());
2604 createHelpTranslationJob("Rhaeto-Romanic", "rm" , ui->checkBoxTranslationsRM->isChecked());
2605 createHelpTranslationJob("Romanian", "ro" , ui->checkBoxTranslationsRO->isChecked());
2606 createHelpTranslationJob("Russian", "ru" , ui->checkBoxTranslationsRU->isChecked());
2607 createHelpTranslationJob("Samoan", "sm" , ui->checkBoxTranslationsSM->isChecked());
2608 createHelpTranslationJob("Serbian", "sr" , ui->checkBoxTranslationsSR->isChecked());
2609 createHelpTranslationJob("SerbianLatin", "sr-Latin", ui->checkBoxTranslationsYO->isChecked());
2610 createHelpTranslationJob("Slovak", "sk" , ui->checkBoxTranslationsSK->isChecked());
2611 createHelpTranslationJob("Slovenian", "sl" , ui->checkBoxTranslationsSL->isChecked());
2612 createHelpTranslationJob("Sesotho", "st" , ui->checkBoxTranslationsST->isChecked());
2613 createHelpTranslationJob("Shona", "sn" , ui->checkBoxTranslationsSN->isChecked());
2614 createHelpTranslationJob("Sindhi", "sd" , ui->checkBoxTranslationsSD->isChecked());
2615 createHelpTranslationJob("Sinhala", "si" , ui->checkBoxTranslationsSI->isChecked());
2616 createHelpTranslationJob("Somali", "so" , ui->checkBoxTranslationsSO->isChecked());
2617 createHelpTranslationJob("Sorbian", "sb" , ui->checkBoxTranslationsSB->isChecked());
2618 createHelpTranslationJob("Spanish", "es" , ui->checkBoxTranslationsES->isChecked());
2619 createHelpTranslationJob("Sundanese", "su" , ui->checkBoxTranslationsSU->isChecked());
2620 createHelpTranslationJob("Swahili", "sw" , ui->checkBoxTranslationsSW->isChecked());
2621 createHelpTranslationJob("Swedish", "sv" , ui->checkBoxTranslationsSV->isChecked());
2622 createHelpTranslationJob("Tagalog", "tl" , ui->checkBoxTranslationsTL->isChecked());
2623 createHelpTranslationJob("Tahitian", "ty" , ui->checkBoxTranslationsTY->isChecked());
2624 createHelpTranslationJob("Tajik", "tg" , ui->checkBoxTranslationsTG->isChecked());
2625 createHelpTranslationJob("Tamil", "ta" , ui->checkBoxTranslationsTA->isChecked());
2626 createHelpTranslationJob("Tatar", "tt" , ui->checkBoxTranslationsTT->isChecked());
2627 createHelpTranslationJob("Telugu", "te" , ui->checkBoxTranslationsTE->isChecked());
2628 createHelpTranslationJob("Thai", "th" , ui->checkBoxTranslationsTH->isChecked());
2629 createHelpTranslationJob("Tongan", "to" , ui->checkBoxTranslationsTO->isChecked());
2630 createHelpTranslationJob("Tsonga", "ts" , ui->checkBoxTranslationsTS->isChecked());
2631 createHelpTranslationJob("Tswana", "tn" , ui->checkBoxTranslationsTN->isChecked());
2632 createHelpTranslationJob("Turkish", "tr" , ui->checkBoxTranslationsTR->isChecked());
2633 createHelpTranslationJob("Turkmen", "tk" , ui->checkBoxTranslationsTK->isChecked());
2634 createHelpTranslationJob("Uighur", "ub" , ui->checkBoxTranslationsUG->isChecked());
2635 createHelpTranslationJob("Ukrainian", "uk" , ui->checkBoxTranslationsUK->isChecked());
2636 createHelpTranslationJob("Urdu", "ur" , ui->checkBoxTranslationsUR->isChecked());
2637 createHelpTranslationJob("Udmurt", "udm", ui->checkBoxTranslationsYO->isChecked());
2638 createHelpTranslationJob("Uzbek", "uz" , ui->checkBoxTranslationsUZ->isChecked());
2639 createHelpTranslationJob("Venda", "ve" , ui->checkBoxTranslationsVE->isChecked());
2640 createHelpTranslationJob("Vietnamese", "vi" , ui->checkBoxTranslationsVI->isChecked());
2641 createHelpTranslationJob("Welsh", "cy" , ui->checkBoxTranslationsCY->isChecked());
2642 createHelpTranslationJob("Xhosa", "xh" , ui->checkBoxTranslationsXH->isChecked());
2643 createHelpTranslationJob("Yiddish", "yi" , ui->checkBoxTranslationsYI->isChecked());
2644 createHelpTranslationJob("Yoruba", "yo" , ui->checkBoxTranslationsYO->isChecked());
2645 createHelpTranslationJob("YucatecMaya", "yua", ui->checkBoxTranslationsYO->isChecked());
2646 createHelpTranslationJob("Zulu", "zu" , ui->checkBoxTranslationsZU->isChecked());
2647 //
2648 ui->textEditProjects->setText(QString("%1\n").arg(myTranslationQrc));
2649 // Go to Tab
2650 ui->tabWidget->setCurrentIndex(ui->tabWidget->indexOf(ui->tabWidget->findChild<QWidget*>("tabProject")));
2651 //
2652 ui->progressBarProjectsTranslations->setMaximum(myLingoJob.count());
2653 ui->progressBarProjectsTranslations->setValue(0);
2655 ui->progressBarProjectsFiles->setMaximum(myLingoJob.count());
2656 ui->progressBarProjectsFiles->show();
2658 /*
2659 * Now I can run the job with myLingoJob
2660 * Every Language has a Help_xx.md
2661 */
2662 for( int i = 0; i < myLingoJob.count(); ++i )
2663 {
2664 ui->progressBarProjectsFiles->setValue(i);
2665 setMessage("Translating..." + myLingoJob.at(i).getLanguageName(), Debug);
2666 // Skip if current language is the same as source
2667 if (myLingoJob.at(i).getLanguageName() == ui->comboBoxTranslationSourceLanguage->currentText()) { continue; }
2668 QString theHelpFile = myLingoJob.at(i).getTsFile();
2669 // Make sure Source file exists
2670 if (!myLanguageModel->mySetting->isFileExists(theHelpFile))
2671 {
2672 myLanguageModel->mySetting->showMessageBox(tr("Help File not found"), QString("%1: %2").arg(tr("Help File not found"), myLingoJob.at(i).getTsFile()), myLanguageModel->mySetting->Critical);
2675 return;
2676 }
2677 QString theHelpFileContents = myLanguageModel->mySetting->readFile(theHelpFile);
2678 if (theHelpFileContents.isEmpty())
2679 {
2680 myLanguageModel->mySetting->showMessageBox(tr("Help File is Empty"), QString("%1: %2").arg(tr("Help File is Empty"), myLingoJob.at(i).getTsFile()), myLanguageModel->mySetting->Critical);
2683 return;
2684 }
2685 // QString &text, Engine engine, Language translationLang, Language sourceLang, Language uiLang
2686 myTranslation = translateWithReturn(theHelpFileContents, QOnlineTranslator::Engine::Google, myLingoJob.at(i).getLang(), myLingoJob.at(i).getSourceLang(), myQOnlineTranslator.language(QLocale()));
2687 myTranslation = checkTranslationErrors(myTranslation, theHelpFileContents, QOnlineTranslator::Engine::Google, myLingoJob.at(i).getLang(), myLingoJob.at(i).getSourceLang(), myQOnlineTranslator.language(QLocale()));
2688 // if empty use another service
2689 if (myTranslation.isEmpty())
2690 {
2691 myTranslation = translateWithReturn(theHelpFileContents, QOnlineTranslator::Engine::Bing, myLingoJob.at(i).getLang(), myLingoJob.at(i).getSourceLang(), myQOnlineTranslator.language(QLocale()));
2692 myTranslation = checkTranslationErrors(myTranslation, theHelpFileContents, QOnlineTranslator::Engine::Google, myLingoJob.at(i).getLang(), myLingoJob.at(i).getSourceLang(), myQOnlineTranslator.language(QLocale()));
2693 if (myTranslation.isEmpty())
2694 {
2695 myTranslation = translateWithReturn(theHelpFileContents, QOnlineTranslator::Engine::Yandex, myLingoJob.at(i).getLang(), myLingoJob.at(i).getSourceLang(), myQOnlineTranslator.language(QLocale()));
2696 myTranslation = checkTranslationErrors(myTranslation, theHelpFileContents, QOnlineTranslator::Engine::Google, myLingoJob.at(i).getLang(), myLingoJob.at(i).getSourceLang(), myQOnlineTranslator.language(QLocale()));
2697 }
2698 }
2699 // Make sure Translation string has content
2700 if (myTranslation.isEmpty()) { myTranslation = theHelpFileContents; }
2701 myLanguageModel->mySetting->writeFile(myLingoJob.at(i).getDoxyFile(), myTranslation);
2702 if (!myLanguageModel->mySetting->isFileExists(myLingoJob.at(i).getDoxyFile()))
2703 {
2704 myLanguageModel->mySetting->showMessageBox(tr("Help File could not be created"), QString("%1: %2").arg(tr("Help File could not be created"), myLingoJob.at(i).getTsFile()), myLanguageModel->mySetting->Critical);
2707 return;
2708 }
2709 ui->statusbar->showMessage(QString("%1: %2 = %3").arg(myLingoJob.at(i).getLanguageName(), theHelpFileContents.mid(0, 16), myTranslation));
2710 // Set a delay or you will be ban from Engine
2711 myLanguageModel->mySetting->delay(ui->spinBoxSettingsDelay->value());
2712 // Set a delay or you will be ban from Engine
2713 myLanguageModel->mySetting->delay(ui->spinBoxSettingsDelay->value());
2714 ui->progressBarProjectsTranslations->setValue(i);
2715 } // end for( int i = 0; i < myLingoJob.count(); ++i )
2718} // end translateHelp
2719
2724{
2726 ui->progressBarProjectsFiles->hide();
2727 ui->statusbar->showMessage("");
2728}
2729
2734{
2735 myLingoJob.clear();
2736 myHelpTranslationsFiles.clear();
2737 myHelpFileNames.clear();
2738 myTranslationQrc.clear();
2739 //
2741 //
2742 createReadMeTranslationJob("Afrikaans", "af" , ui->checkBoxTranslationsAF->isChecked());
2743 createReadMeTranslationJob("Albanian", "sq" , ui->checkBoxTranslationsSQ->isChecked());
2744 createReadMeTranslationJob("Amharic", "am" , ui->checkBoxTranslationsAM->isChecked());
2745 createReadMeTranslationJob("Arabic", "ar" , ui->checkBoxTranslationsAR->isChecked());
2746 createReadMeTranslationJob("Armenian", "hy" , ui->checkBoxTranslationsHY->isChecked());
2747 createReadMeTranslationJob("Azerbaijani", "az" , ui->checkBoxTranslationsAZ->isChecked());
2748 createReadMeTranslationJob("Bashkir", "ba" , ui->checkBoxTranslationsBA->isChecked());
2749 createReadMeTranslationJob("Basque", "eu" , ui->checkBoxTranslationsEU->isChecked());
2750 createReadMeTranslationJob("Belarusian", "be" , ui->checkBoxTranslationsBE->isChecked());
2751 createReadMeTranslationJob("Bengali", "bn" , ui->checkBoxTranslationsBN->isChecked());
2752 createReadMeTranslationJob("Bosnian", "bs" , ui->checkBoxTranslationsBS->isChecked());
2753 createReadMeTranslationJob("Bulgarian", "bg" , ui->checkBoxTranslationsBG->isChecked());
2754 createReadMeTranslationJob("Cantonese", "yue", ui->checkBoxTranslationsYO->isChecked());
2755 createReadMeTranslationJob("Catalan", "ca" , ui->checkBoxTranslationsCA->isChecked());
2756 createReadMeTranslationJob("Cebuano", "ceb", ui->checkBoxTranslationsYO->isChecked());
2757 createReadMeTranslationJob("Chichewa", "ny" , ui->checkBoxTranslationsNY->isChecked());
2758 createReadMeTranslationJob("Corsican", "co" , ui->checkBoxTranslationsCO->isChecked());
2759 createReadMeTranslationJob("Croatian", "hr" , ui->checkBoxTranslationsHR->isChecked());
2760 createReadMeTranslationJob("Czech", "cs" , ui->checkBoxTranslationsCS->isChecked());
2761 createReadMeTranslationJob("SimplifiedChinese", "zh-CN" , ui->checkBoxTranslationsZH_CN->isChecked());
2762 createReadMeTranslationJob("TraditionalChinese", "zh-TW" , ui->checkBoxTranslationsZH_TW->isChecked());
2763 createReadMeTranslationJob("Danish", "da" , ui->checkBoxTranslationsDA->isChecked());
2764 createReadMeTranslationJob("Dutch", "nl" , ui->checkBoxTranslationsNL->isChecked());
2765 createReadMeTranslationJob("English", "en" , ui->checkBoxTranslationsEN->isChecked());
2766 createReadMeTranslationJob("Estonian", "et" , ui->checkBoxTranslationsET->isChecked());
2767 createReadMeTranslationJob("Esperanto", "eo" , ui->checkBoxTranslationsEO->isChecked());
2768 createReadMeTranslationJob("Faeroese", "fo" , ui->checkBoxTranslationsFO->isChecked());
2769 createReadMeTranslationJob("Farsi", "fa" , ui->checkBoxTranslationsFA->isChecked());
2770 createReadMeTranslationJob("Fijian", "fj" , ui->checkBoxTranslationsFJ->isChecked());
2771 createReadMeTranslationJob("Filipino", "fil", ui->checkBoxTranslationsYO->isChecked());
2772 createReadMeTranslationJob("Finnish", "fi" , ui->checkBoxTranslationsFI->isChecked());
2773 createReadMeTranslationJob("French", "fr" , ui->checkBoxTranslationsFR->isChecked());
2774 createReadMeTranslationJob("Frisian", "fy" , ui->checkBoxTranslationsFY->isChecked());
2775 createReadMeTranslationJob("Gaelic", "gd" , ui->checkBoxTranslationsGD->isChecked());
2776 createReadMeTranslationJob("Galician", "gl" , ui->checkBoxTranslationsGL->isChecked());
2777 createReadMeTranslationJob("Georgian", "ka" , ui->checkBoxTranslationsKA->isChecked());
2778 createReadMeTranslationJob("German", "de" , ui->checkBoxTranslationsDE->isChecked());
2779 createReadMeTranslationJob("Greek", "el" , ui->checkBoxTranslationsEL->isChecked());
2780 createReadMeTranslationJob("Gujarati", "gu" , ui->checkBoxTranslationsGU->isChecked());
2781 createReadMeTranslationJob("Haitian", "ht" , ui->checkBoxTranslationsHT->isChecked());
2782 createReadMeTranslationJob("Hausa", "ha" , ui->checkBoxTranslationsHA->isChecked());
2783 createReadMeTranslationJob("Hawaiian", "haw", ui->checkBoxTranslationsYO->isChecked());
2784 createReadMeTranslationJob("Hebrew", "he" , ui->checkBoxTranslationsHE->isChecked());
2785 createReadMeTranslationJob("HillMari", "mrj", ui->checkBoxTranslationsYO->isChecked());
2786 createReadMeTranslationJob("Hindi", "hi" , ui->checkBoxTranslationsHI->isChecked());
2787 createReadMeTranslationJob("Hmong", "hmn", ui->checkBoxTranslationsYO->isChecked());
2788 createReadMeTranslationJob("Hungarian", "hu" , ui->checkBoxTranslationsHU->isChecked());
2789 createReadMeTranslationJob("Icelandic", "is" , ui->checkBoxTranslationsIS->isChecked());
2790 createReadMeTranslationJob("Igbo", "ig" , ui->checkBoxTranslationsIG->isChecked());
2791 createReadMeTranslationJob("Indonesian", "id" , ui->checkBoxTranslationsID->isChecked());
2792 createReadMeTranslationJob("Irish", "ga" , ui->checkBoxTranslationsGA->isChecked());
2793 createReadMeTranslationJob("Italian", "it" , ui->checkBoxTranslationsIT->isChecked());
2794 createReadMeTranslationJob("Japanese", "ja" , ui->checkBoxTranslationsJA->isChecked());
2795 createReadMeTranslationJob("Javanese", "jw" , ui->checkBoxTranslationsJW->isChecked());
2796 createReadMeTranslationJob("Kannada", "kn" , ui->checkBoxTranslationsKN->isChecked());
2797 createReadMeTranslationJob("Kazakh", "kk" , ui->checkBoxTranslationsKK->isChecked());
2798 createReadMeTranslationJob("Khmer", "km" , ui->checkBoxTranslationsKM->isChecked());
2799 createReadMeTranslationJob("Kinyarwanda", "rw" , ui->checkBoxTranslationsRW->isChecked());
2800 createReadMeTranslationJob("Klingon", "tlh", ui->checkBoxTranslationsYO->isChecked());
2801 createReadMeTranslationJob("KlingonPlqaD", "tlh-Qaak", ui->checkBoxTranslationsYO->isChecked());
2802 createReadMeTranslationJob("Korean", "ko" , ui->checkBoxTranslationsKO->isChecked());
2803 createReadMeTranslationJob("Kurdish", "ku" , ui->checkBoxTranslationsKU->isChecked());
2804 createReadMeTranslationJob("Kyrgyz", "ky" , ui->checkBoxTranslationsKY->isChecked());
2805 createReadMeTranslationJob("Latvian", "lv" , ui->checkBoxTranslationsLV->isChecked());
2806 createReadMeTranslationJob("Lao", "lo" , ui->checkBoxTranslationsLO->isChecked());
2807 createReadMeTranslationJob("Latin", "la" , ui->checkBoxTranslationsLA->isChecked());
2808 createReadMeTranslationJob("LevantineArabic", "apc", ui->checkBoxTranslationsYO->isChecked());
2809 createReadMeTranslationJob("Lithuanian", "lt" , ui->checkBoxTranslationsLT->isChecked());
2810 createReadMeTranslationJob("Luxembourgish", "lb" , ui->checkBoxTranslationsLB->isChecked());
2811 createReadMeTranslationJob("Macedonian", "mk" , ui->checkBoxTranslationsMK->isChecked());
2812 createReadMeTranslationJob("Mari", "mhr", ui->checkBoxTranslationsYO->isChecked());
2813 createReadMeTranslationJob("Maori", "mi" , ui->checkBoxTranslationsMI->isChecked());
2814 createReadMeTranslationJob("Marathi", "mr" , ui->checkBoxTranslationsMR->isChecked());
2815 createReadMeTranslationJob("Malagasy", "mg" , ui->checkBoxTranslationsMG->isChecked());
2816 createReadMeTranslationJob("Malayalam", "ml" , ui->checkBoxTranslationsML->isChecked());
2817 createReadMeTranslationJob("Malaysian", "ms" , ui->checkBoxTranslationsMS->isChecked());
2818 createReadMeTranslationJob("Maltese", "mt" , ui->checkBoxTranslationsMT->isChecked());
2819 createReadMeTranslationJob("Mongolian", "mn" , ui->checkBoxTranslationsMN->isChecked());
2820 createReadMeTranslationJob("Myanmar", "my" , ui->checkBoxTranslationsMY->isChecked());
2821 createReadMeTranslationJob("Norwegian", "no" , ui->checkBoxTranslationsNO->isChecked());
2822 createReadMeTranslationJob("Bokmal", "nb" , ui->checkBoxTranslationsNB->isChecked());
2823 createReadMeTranslationJob("Nepali", "ne" , ui->checkBoxTranslationsNE->isChecked());
2824 createReadMeTranslationJob("Nynorsk", "nn" , ui->checkBoxTranslationsNN->isChecked());
2825 createReadMeTranslationJob("Oriya", "or" , ui->checkBoxTranslationsOR->isChecked());
2826 createReadMeTranslationJob("Pashto", "ps" , ui->checkBoxTranslationsPS->isChecked());
2827 createReadMeTranslationJob("Papiamento", "pap", ui->checkBoxTranslationsYO->isChecked());
2828 createReadMeTranslationJob("Polish", "pl" , ui->checkBoxTranslationsPL->isChecked());
2829 createReadMeTranslationJob("Portuguese", "pt" , ui->checkBoxTranslationsPT->isChecked());
2830 createReadMeTranslationJob("Punjabi", "pa" , ui->checkBoxTranslationsPA->isChecked());
2831 createReadMeTranslationJob("QueretaroOtomi", "otq", ui->checkBoxTranslationsYO->isChecked());
2832 createReadMeTranslationJob("Rhaeto-Romanic", "rm" , ui->checkBoxTranslationsRM->isChecked());
2833 createReadMeTranslationJob("Romanian", "ro" , ui->checkBoxTranslationsRO->isChecked());
2834 createReadMeTranslationJob("Russian", "ru" , ui->checkBoxTranslationsRU->isChecked());
2835 createReadMeTranslationJob("Samoan", "sm" , ui->checkBoxTranslationsSM->isChecked());
2836 createReadMeTranslationJob("Serbian", "sr" , ui->checkBoxTranslationsSR->isChecked());
2837 createReadMeTranslationJob("SerbianLatin", "sr-Latin", ui->checkBoxTranslationsYO->isChecked());
2838 createReadMeTranslationJob("Slovak", "sk" , ui->checkBoxTranslationsSK->isChecked());
2839 createReadMeTranslationJob("Slovenian", "sl" , ui->checkBoxTranslationsSL->isChecked());
2840 createReadMeTranslationJob("Sesotho", "st" , ui->checkBoxTranslationsST->isChecked());
2841 createReadMeTranslationJob("Shona", "sn" , ui->checkBoxTranslationsSN->isChecked());
2842 createReadMeTranslationJob("Sindhi", "sd" , ui->checkBoxTranslationsSD->isChecked());
2843 createReadMeTranslationJob("Sinhala", "si" , ui->checkBoxTranslationsSI->isChecked());
2844 createReadMeTranslationJob("Somali", "so" , ui->checkBoxTranslationsSO->isChecked());
2845 createReadMeTranslationJob("Sorbian", "sb" , ui->checkBoxTranslationsSB->isChecked());
2846 createReadMeTranslationJob("Spanish", "es" , ui->checkBoxTranslationsES->isChecked());
2847 createReadMeTranslationJob("Sundanese", "su" , ui->checkBoxTranslationsSU->isChecked());
2848 createReadMeTranslationJob("Swahili", "sw" , ui->checkBoxTranslationsSW->isChecked());
2849 createReadMeTranslationJob("Swedish", "sv" , ui->checkBoxTranslationsSV->isChecked());
2850 createReadMeTranslationJob("Tagalog", "tl" , ui->checkBoxTranslationsTL->isChecked());
2851 createReadMeTranslationJob("Tahitian", "ty" , ui->checkBoxTranslationsTY->isChecked());
2852 createReadMeTranslationJob("Tajik", "tg" , ui->checkBoxTranslationsTG->isChecked());
2853 createReadMeTranslationJob("Tamil", "ta" , ui->checkBoxTranslationsTA->isChecked());
2854 createReadMeTranslationJob("Tatar", "tt" , ui->checkBoxTranslationsTT->isChecked());
2855 createReadMeTranslationJob("Telugu", "te" , ui->checkBoxTranslationsTE->isChecked());
2856 createReadMeTranslationJob("Thai", "th" , ui->checkBoxTranslationsTH->isChecked());
2857 createReadMeTranslationJob("Tongan", "to" , ui->checkBoxTranslationsTO->isChecked());
2858 createReadMeTranslationJob("Tsonga", "ts" , ui->checkBoxTranslationsTS->isChecked());
2859 createReadMeTranslationJob("Tswana", "tn" , ui->checkBoxTranslationsTN->isChecked());
2860 createReadMeTranslationJob("Turkish", "tr" , ui->checkBoxTranslationsTR->isChecked());
2861 createReadMeTranslationJob("Turkmen", "tk" , ui->checkBoxTranslationsTK->isChecked());
2862 createReadMeTranslationJob("Uighur", "ub" , ui->checkBoxTranslationsUG->isChecked());
2863 createReadMeTranslationJob("Ukrainian", "uk" , ui->checkBoxTranslationsUK->isChecked());
2864 createReadMeTranslationJob("Urdu", "ur" , ui->checkBoxTranslationsUR->isChecked());
2865 createReadMeTranslationJob("Udmurt", "udm", ui->checkBoxTranslationsYO->isChecked());
2866 createReadMeTranslationJob("Uzbek", "uz" , ui->checkBoxTranslationsUZ->isChecked());
2867 createReadMeTranslationJob("Venda", "ve" , ui->checkBoxTranslationsVE->isChecked());
2868 createReadMeTranslationJob("Vietnamese", "vi" , ui->checkBoxTranslationsVI->isChecked());
2869 createReadMeTranslationJob("Welsh", "cy" , ui->checkBoxTranslationsCY->isChecked());
2870 createReadMeTranslationJob("Xhosa", "xh" , ui->checkBoxTranslationsXH->isChecked());
2871 createReadMeTranslationJob("Yiddish", "yi" , ui->checkBoxTranslationsYI->isChecked());
2872 createReadMeTranslationJob("Yoruba", "yo" , ui->checkBoxTranslationsYO->isChecked());
2873 createReadMeTranslationJob("YucatecMaya", "yua", ui->checkBoxTranslationsYO->isChecked());
2874 createReadMeTranslationJob("Zulu", "zu" , ui->checkBoxTranslationsZU->isChecked());
2875 // Read Me
2876 QString theReadMeFile = QString("%1%2%3").arg(ui->lineEditTranslationsProjectFolder->text(), QDir::separator(), "README.md");
2877 //
2878 ui->textEditProjects->setText(QString("%1\n").arg(myTranslationQrc));
2879 // Go to Tab
2880 ui->tabWidget->setCurrentIndex(ui->tabWidget->indexOf(ui->tabWidget->findChild<QWidget*>("tabProject")));
2881 //
2882 ui->progressBarProjectsTranslations->setMaximum(myLingoJob.count());
2883 ui->progressBarProjectsTranslations->setValue(0);
2885 ui->progressBarProjectsFiles->setMaximum(myLingoJob.count());
2886 ui->progressBarProjectsFiles->show();
2887 //
2889 /*
2890 * Now I can run the job with myLingoJob
2891 * Every Language has a Help_xx.md and README_xx.md
2892 * I mixed them in one Job and alternate between them.
2893 */
2894 for( int i = 0; i < myLingoJob.count(); ++i )
2895 {
2896 ui->progressBarProjectsFiles->setValue(i);
2897 setMessage("Translating..." + myLingoJob.at(i).getLanguageName(), Debug);
2898 // Skip if current language is the same as source
2899 if (myLingoJob.at(i).getLanguageName() == ui->comboBoxTranslationSourceLanguage->currentText()) { continue; }
2900 // The Default Languge will not have an under-score Language Code, i.e. README.md
2901 if (!myLingoJob.at(i).getReadMe().contains("_")) { continue; }
2902 // Make sure Source file exists
2903 if (!myLanguageModel->mySetting->isFileExists(theReadMeFile))
2904 {
2905 myLanguageModel->mySetting->showMessageBox(tr("README File not found"), QString("%1: %2").arg(tr("README File not found"), myLingoJob.at(i).getReadMe()), myLanguageModel->mySetting->Critical);
2906 return;
2907 }
2908 QString theReadMeFileContents = myLanguageModel->mySetting->readFile(theReadMeFile);
2909 if (theReadMeFileContents.isEmpty())
2910 {
2911 myLanguageModel->mySetting->showMessageBox(tr("README File is Empty"), QString("%1: %2").arg(tr("README File is Empty"), myLingoJob.at(i).getReadMe()), myLanguageModel->mySetting->Critical);
2912 return;
2913 }
2914 // QString &text, Engine engine, Language translationLang, Language sourceLang, Language uiLang
2915 myTranslation = translateWithReturn(theReadMeFileContents, QOnlineTranslator::Engine::Google, myLingoJob.at(i).getLang(), myLingoJob.at(i).getSourceLang(), myQOnlineTranslator.language(QLocale()));
2916 myTranslation = checkTranslationErrors(myTranslation, theReadMeFileContents, QOnlineTranslator::Engine::Google, myLingoJob.at(i).getLang(), myLingoJob.at(i).getSourceLang(), myQOnlineTranslator.language(QLocale()));
2917 // if empty use another service
2918 if (myTranslation.isEmpty())
2919 {
2920 myTranslation = translateWithReturn(theReadMeFileContents, QOnlineTranslator::Engine::Bing, myLingoJob.at(i).getLang(), myLingoJob.at(i).getSourceLang(), myQOnlineTranslator.language(QLocale()));
2921 myTranslation = checkTranslationErrors(myTranslation, theReadMeFileContents, QOnlineTranslator::Engine::Google, myLingoJob.at(i).getLang(), myLingoJob.at(i).getSourceLang(), myQOnlineTranslator.language(QLocale()));
2922 if (myTranslation.isEmpty())
2923 {
2924 myTranslation = translateWithReturn(theReadMeFileContents, QOnlineTranslator::Engine::Yandex, myLingoJob.at(i).getLang(), myLingoJob.at(i).getSourceLang(), myQOnlineTranslator.language(QLocale()));
2925 myTranslation = checkTranslationErrors(myTranslation, theReadMeFileContents, QOnlineTranslator::Engine::Google, myLingoJob.at(i).getLang(), myLingoJob.at(i).getSourceLang(), myQOnlineTranslator.language(QLocale()));
2926 }
2927 }
2928 // Make sure Translation string has content
2929 if (myTranslation.isEmpty()) { myTranslation = theReadMeFileContents; }
2930 myLanguageModel->mySetting->writeFile(myLingoJob.at(i).getReadMe(), myTranslation);
2931 if (!myLanguageModel->mySetting->isFileExists(myLingoJob.at(i).getReadMe()))
2932 {
2933 myLanguageModel->mySetting->showMessageBox(tr("README File could not be created"), QString("%1: %2").arg(tr("README File could not be created"), myLingoJob.at(i).getReadMe()), myLanguageModel->mySetting->Critical);
2934 return;
2935 }
2936 ui->statusbar->showMessage(QString("%1: %2 = %3").arg(myLingoJob.at(i).getLanguageName(), theReadMeFileContents.mid(0, 16), myTranslation));
2937 // Set a delay or you will be ban from Engine
2938 myLanguageModel->mySetting->delay(ui->spinBoxSettingsDelay->value());
2939 ui->progressBarProjectsTranslations->setValue(i);
2940 } // end for( int i = 0; i < myLingoJob.count(); ++i )
2942 ui->progressBarProjectsFiles->hide();
2943 ui->statusbar->showMessage("");
2945} // end translateReadMe
2946
2951void MainWindow::createTranslationJob(const QString &thisLanguageName, const QString &thisLangCode, const QString &thisSourceLanguage, bool thisChecked)
2952{
2953 setMessage("createTranslationJob(" + thisLanguageName + ", " + thisLangCode + ", " + thisSourceLanguage + ", " + thisChecked + ")", Debug);
2954 //
2955 if (!thisChecked) { return; }
2956 QString theLangCode = thisLangCode;
2957 if (theLangCode.contains("-"))
2958 { theLangCode = theLangCode.replace("-", "_"); }
2959 // Create Translation file names for configuration
2960 QString theTsFile = QString("%1%2%3%4%5%6").arg(ui->lineEditTranslationsSource->text(), QDir::separator(), ui->lineEditProjectName->text(), "_", theLangCode, ".ts");
2961 QString theQmFile = QString("%1%2%3%4%5%6").arg(ui->lineEditTranslationsSource->text(), QDir::separator(), ui->lineEditProjectName->text(), "_", theLangCode, ".qm");
2962 //
2963 QString theTransFile = theTsFile;
2964 QString theTransQmFile = theQmFile;
2965 theTransFile.remove(ui->lineEditTranslationsProjectFolder->text());
2966 theTransQmFile.remove(ui->lineEditTranslationsProjectFolder->text());
2967 if (theTransFile.mid(0, 1) == "/" || theTransFile.mid(0, 1) == "\\") { theTransFile = theTransFile.mid(1); }
2968 if (theTransQmFile.mid(0, 1) == "/" || theTransQmFile.mid(0, 1) == "\\") { theTransQmFile = theTransQmFile.mid(1); }
2969 myTranslationConf.append(QString(" %1").arg(theTransFile));
2970 myTranslationQrc.append(QString("<file>%1</file>\n").arg(theTransQmFile));
2971 // Create Job
2972 // to store a job I need the theSourcePath and Language
2973 MyLingoJobs theTranslationJobs(thisLanguageName, theLangCode, theTsFile, theTransQmFile, "", QOnlineTranslator::language(thisLangCode), QOnlineTranslator::language(myLanguageModel->languageNameToCode(thisSourceLanguage)));
2974 myLingoJob.append(theTranslationJobs);
2975}
2976
2980void MainWindow::createHelpTranslationJob(const QString &thisLanguageName, const QString &thisLangCode, bool thisChecked)
2981{
2982 setMessage("createHelpTranslationJob(" + thisLanguageName + ", " + thisLangCode + ", " + thisChecked + ")", Debug);
2983 //
2984 if (!thisChecked) { return; }
2985 //
2986 QString theLangCode = thisLangCode;
2987 if (theLangCode.contains("-"))
2988 { theLangCode = theLangCode.replace("-", "_"); }
2989
2990 if (ui->labelTranslationsSourceLanguageCode->text() == thisLangCode) { return; }
2991 //
2992 for (QString &theFileName : myHelpFileNames)
2993 {
2994 // Create Translation file names for configuration
2995 QString theMdFile = QString("%1%2%3%4%5%6").arg(ui->lineEditTranslationsHelp->text(), QDir::separator(), theFileName, "_", thisLangCode, ".md");
2996 QString theQmFile = QString("%1%2%3%4%5%6").arg(ui->lineEditTranslationsHelp->text(), QDir::separator(), theFileName, "_", thisLangCode, ".qm");
2997 // ReadMe
2998 QString theHelpSource = QString("%1%2%3%4%5%6").arg(ui->lineEditTranslationsHelp->text(), QDir::separator(), theFileName, "_", ui->labelTranslationsSourceLanguageCode->text(), ".md");
2999 QString theReadMeFile = QString("%1%2%3%4%5%6").arg(ui->lineEditTranslationsProjectFolder->text(), QDir::separator(), "README", "_", thisLangCode, ".md");
3000 //
3001 QString theTransQmFile = theQmFile;
3002 theTransQmFile.remove(ui->lineEditTranslationsProjectFolder->text());
3003 if (theTransQmFile.mid(0, 1) == "/" || theTransQmFile.mid(0, 1) == "\\") { theTransQmFile = theTransQmFile.mid(1); }
3004 // for display
3005 if (!myTranslationQrc.contains(theTransQmFile))
3006 {
3007 myTranslationQrc.append(QString("<file>%1</file>\n").arg(theTransQmFile));
3008 }
3009 // Create Job
3010 // to store a job I need the theSourcePath and Language
3011 MyLingoJobs theTranslationJobs(thisLanguageName, thisLangCode, theHelpSource, theMdFile, theReadMeFile, QOnlineTranslator::language(thisLangCode), QOnlineTranslator::language(ui->labelTranslationsSourceLanguageCode->text()));
3012 myLingoJob.append(theTranslationJobs);
3013 }
3014}
3015
3019void MainWindow::createReadMeTranslationJob(const QString &thisLanguageName, const QString &thisLangCode, bool thisChecked)
3020{
3021 setMessage("createHelpTranslationJob(" + thisLanguageName + ", " + thisLangCode + ", " + thisChecked + ")", Debug);
3022 //
3023 if (!thisChecked) { return; }
3024 if (ui->labelTranslationsSourceLanguageCode->text() == thisLangCode) { return; }
3025 //
3026 QString theLangCode = thisLangCode;
3027 if (theLangCode.contains("-"))
3028 { theLangCode = theLangCode.replace("-", "_"); }
3029 // Create Translation file names for configuration
3030 QString theFileName = "README";
3031 QString theMdFile = QString("%1%2%3%4%5%6").arg(ui->lineEditTranslationsHelp->text(), QDir::separator(), theFileName, "_", theLangCode, ".md");
3032 QString theQmFile = QString("%1%2%3%4%5%6").arg(ui->lineEditTranslationsHelp->text(), QDir::separator(), theFileName, "_", theLangCode, ".qm");
3033 // ReadMe
3034 QString theHelpSource = QString("%1%2%3%4%5%6").arg(ui->lineEditTranslationsHelp->text(), QDir::separator(), theFileName, "_", ui->labelTranslationsSourceLanguageCode->text(), ".md");
3035 QString theReadMeFile = QString("%1%2%3%4%5%6").arg(ui->lineEditTranslationsProjectFolder->text(), QDir::separator(), "README", "_", theLangCode, ".md");
3036 //
3037 QString theTransQmFile = theQmFile;
3038 theTransQmFile.remove(ui->lineEditTranslationsProjectFolder->text());
3039 if (theTransQmFile.mid(0, 1) == "/" || theTransQmFile.mid(0, 1) == "\\") { theTransQmFile = theTransQmFile.mid(1); }
3040 // for display
3041 myTranslationQrc.append(QString("<file>%1</file>\n").arg(theTransQmFile));
3042 // Create Job
3043 // to store a job I need the theSourcePath and Language
3044 MyLingoJobs theTranslationJobs(thisLanguageName, thisLangCode, theHelpSource, theMdFile, theReadMeFile, QOnlineTranslator::language(thisLangCode), QOnlineTranslator::language(ui->labelTranslationsSourceLanguageCode->text()));
3045 myLingoJob.append(theTranslationJobs);
3046}
3047
3052{
3053 setMessage("translateWithReturn(" + text + ", " + engine + ", " + translationLang + ", " + sourceLang + ", " + uiLang + ")", Debug);
3054 // Clear Translation
3055 myTranslation.clear();
3056 // Event Loop
3057 QEventLoop theEventLoop;
3058 // Create Translator
3059 QOnlineTranslator theTranslator;
3060 // Call Translate on a thread
3061 theTranslator.translate(text, engine, translationLang, sourceLang, uiLang);
3062 // Connect to thread finished
3063 QObject::connect(&theTranslator, &QOnlineTranslator::finished, &theEventLoop, [&]
3064 {
3065 if (theTranslator.error() == QOnlineTranslator::NoError)
3066 {
3067 if (isTranslationLog) { qInfo() << theTranslator.translation(); }
3068 myTranslation = theTranslator.translation();
3069 isTranslationError = false; // No Error
3070 myTranslationError.clear(); // No Error Message
3071 }
3072 else
3073 {
3074 qCritical() << theTranslator.errorString();
3075 myTranslationError = QString("%1 %2 %3").arg(tr("Error in Translation phrase"), text, theTranslator.errorString());
3076 isTranslationError = true;
3077 myTranslation.clear();
3078 }
3079 theEventLoop.quit();
3080 });
3081 theEventLoop.exec();
3082 return myTranslation;
3083} // end translateWithReturn
3084
3089{
3090 setMessage("onClipboard", Debug);
3091 //if (!isQtSettingsLoaded) { onCreate();}
3092 clipboard->setText(ui->textEditProjects->toPlainText());
3093}
3094
3098void MainWindow::on_checkBoxSettignsMessaging_stateChanged(int thisCheckState)
3099{
3100 if (!isMainLoaded) { return; }
3101 setMessage("on_checkBoxSettignsMessaging_stateChanged", Debug);
3102 if (thisCheckState == Qt::Checked)
3103 { setMessagingStates(true); }
3104 else
3105 { setMessagingStates(false); }
3106}
3107
3111void MainWindow::setMessagingStates(bool thisMessageState)
3112{
3113 if (thisMessageState)
3114 {
3115 myLanguageModel->mySetting->writeSettings(myConstants->MY_IS_DEBUG_MESSAGE, "true");
3116 isDebugMessage = true;
3117 myDbModel->setDebugMessage(true);
3118 myDbModel->mySqlModel->setDebugMessage(true);
3119 myLanguageModel->mySetting->setDebugMessage(true);
3120 myLanguageModel->setDebugMessage(true);
3121 myLanguageModel->mySetting->myCrypto->setDebugMessage(true);
3122 }
3123 else
3124 {
3125 myLanguageModel->mySetting->writeSettings(myConstants->MY_IS_DEBUG_MESSAGE, "false");
3126 isDebugMessage = false;
3127 myDbModel->setDebugMessage(false);
3128 myDbModel->mySqlModel->setDebugMessage(false);
3129 myLanguageModel->mySetting->setDebugMessage(false);
3130 myLanguageModel->setDebugMessage(false);
3131 myLanguageModel->mySetting->myCrypto->setDebugMessage(false);
3132 }
3133}
3134
3138void MainWindow::on_pushButtonTranslationsHelp_clicked()
3139{
3140 setMessage("on_pushButtonTranslationsHelp_clicked", Debug);
3141 QFileDialog dialogTranslationFolder;
3142 dialogTranslationFolder.setFileMode(QFileDialog::Directory);
3143 dialogTranslationFolder.setOption(QFileDialog::ShowDirsOnly);
3144 dialogTranslationFolder.setOption(QFileDialog::DontResolveSymlinks);
3145 //
3146 QString theTranslationFolder = dialogTranslationFolder.getExistingDirectory(this, tr("Help Folder Location"), myLanguageModel->mySetting->getLastApplicationPath());
3147 if (!theTranslationFolder.isEmpty())
3148 { ui->lineEditTranslationsHelp->setText(theTranslationFolder); }
3149 else
3150 { ui->lineEditTranslationsHelp->setText(""); }
3151}
3152
3156void MainWindow::on_comboBoxTranslationSourceLanguage_currentIndexChanged(const QString &arg1)
3157{
3158 Q_UNUSED(arg1)
3160}
3161
3165void MainWindow::setMessage(const QString &thisMessage, MainWindow::MyMessageTypes thisMessageType)
3166{
3167 if (isDebugMessage && isMainLoaded) { return; }
3168 switch (thisMessageType)
3169 {
3170 case Information:
3171 myLanguageModel->mySetting->showMessageBox(thisMessage, thisMessage, myLanguageModel->mySetting->Information);
3172 break;
3173 case Warning:
3174 myLanguageModel->mySetting->showMessageBox(thisMessage, thisMessage, myLanguageModel->mySetting->Warning);
3175 break;
3176 case Critical:
3177 myLanguageModel->mySetting->showMessageBox(thisMessage, thisMessage, myLanguageModel->mySetting->Critical);
3178 break;
3179 case Debug:
3180 qDebug() << thisMessage;
3181 //std::cout << thisMessage.toStdString() << std::endl;
3182 break;
3183 }
3184}
3185
3190{
3191 isDebugMessage = thisState;
3192 setMessage("setDebugMessage", Debug);
3193}
3194
3199{
3200 setMessage("getDebugMessage", Debug);
3201 return isDebugMessage;
3202}
3203
3208{
3209 //
3210 switch (thisAction)
3211 {
3212 case Translations:
3213 ui->actionTranslate_Help->setDisabled(thisState);
3214 ui->actionTranslate_ReadMe->setDisabled(thisState);
3215 ui->actionAccept_Translations->setDisabled(thisState);
3216 break;
3217 case TranslationHelp:
3218 ui->actionTranslate_Help->setDisabled(thisState);
3219 ui->actionTranslate_ReadMe->setDisabled(thisState);
3220 ui->actionAccept_Translations->setDisabled(thisState);
3221 break;
3222 case TranslationReadMe:
3223 ui->actionTranslate_Help->setDisabled(thisState);
3224 ui->actionTranslate_ReadMe->setDisabled(thisState);
3225 ui->actionAccept_Translations->setDisabled(thisState);
3226 break;
3227 }
3228}
3229
3233void MainWindow::on_tabWidget_currentChanged(int index)
3234{
3235 switch (index)
3236 {
3237 case TabSettings:
3238 break;
3239 case TabSql:
3240 break;
3241 case TabTranslations:
3242 break;
3243 case TabProject:
3244 break;
3245 case TabTabHelp:
3246 if (ui->textEditHelp->toMarkdown().isEmpty())
3247 {
3248 onHelp();
3249 }
3250 break;
3251 case TabAll:
3252 break;
3253 }
3254}
3255
3259void MainWindow::removeArgs(const QString &thisString, const QString &thisTransFile)
3260{
3261 setMessage("removeArgs", Debug);
3262 myRemoveTransArgs.append(QString("%1 |%2| in file %3").arg(tr("Remove Arguments that use Percent Sign x"), thisString, thisTransFile));
3263} // end removeArgs
3264
3269{
3270 setMessage("fileRemoveArgs", Debug);
3271 if (!myRemoveTransArgs.isEmpty())
3272 {
3273 QString theRemoveFileName = QString("%1").arg(myLanguageModel->mySetting->getAppDataLocation(), QDir::separator(), "RemoveArgFile.txt");
3274 myLanguageModel->mySetting->writeFile(theRemoveFileName, myRemoveTransArgs);
3275 myLanguageModel->mySetting->showMessageBox(QObject::tr("Remove Args file is created").toLocal8Bit(), QString("%1: %2 %3 %4").arg(tr("Remove Args"), myRemoveTransArgs, tr("File: "), theRemoveFileName).toLocal8Bit(), myLanguageModel->mySetting->Warning);
3276 }
3277} // end fileRemoveArgs
3278
3282void MainWindow::fixTranslationFile(const QString &thisFile)
3283{
3284 setMessage("fixTranslationFile", Debug);
3285 if (!myLanguageModel->mySetting->isFileExists(thisFile)) { myLanguageModel->mySetting->showMessageBox(tr("File not found").toLocal8Bit(), QString("%1: %2").arg(tr("File not found"), thisFile).toLocal8Bit(), myLanguageModel->mySetting->Critical); return; }
3286 //
3287 QString theNewFileContent;
3288 QFile theInputTxtFile(thisFile);
3289 if (theInputTxtFile.open(QIODevice::ReadOnly))
3290 {
3291 QTextStream theFileStream(&theInputTxtFile);
3292 while (!theFileStream.atEnd())
3293 {
3294 QString theLine = theFileStream.readLine();
3295 if (theLine.mid(0, 1) != "[")
3296 {
3297 QString theTransValue = theLine;
3298 theTransValue.remove(QRegExp("\[([^)]+)\\]"));
3299 //
3300 QRegExp rx("\[([^)]+)\\]");
3301 QString theOnlyID = theLine;
3302 if (rx.indexIn(theLine) == 0) { theOnlyID = rx.cap(1); }
3303 theNewFileContent.append(QString("%1 %2\n").arg(theOnlyID, theTransValue));
3304 }
3305 }
3306 }
3307} // end fixTranslationFile
3308
3312void MainWindow::on_pushButtonSettingsLupdate_clicked()
3313{
3314
3315}
3316
3320void MainWindow::on_pushButtonSettingsLrelease_clicked()
3321{
3322
3323}
3324/* ******************************* End of File ***************************** */
3325
3326
Main Window Constructor. /class MainWindow.
Definition: MainWindow.h:77
MyConstants * myConstants
myConstants
Definition: MainWindow.h:133
void clearTabSettings()
clear Tab Settings
void closeEvent(QCloseEvent *event) override
close Event
Definition: MainWindow.cpp:82
void createTranslationJob(const QString &thisTranslate, const QString &thisLangCode, const QString &thisSourceLanguage, bool thisChecked)
get Translation String
void removeArgs(const QString &thisString, const QString &thisTransFile)
remove Args like "String %1" list. removeArgs
void writeAllSettings()
write Settings
Definition: MainWindow.cpp:440
void readAllSettings()
read Settings
Definition: MainWindow.cpp:423
void setLastLanguageName(const QString &thisLastLanguageName)
setLastLanguageName
Definition: MainWindow.cpp:155
void clearTabHelp()
clear Tab Help
ActionStatesManager
Action States Manager.
Definition: MainWindow.h:126
@ Translations
Translations
Definition: MainWindow.h:127
@ TranslationHelp
TranslationHelp
Definition: MainWindow.h:128
@ TranslationReadMe
TranslationReadMe
Definition: MainWindow.h:129
QString translateWithReturn(const QString &text, QOnlineTranslator::Engine engine, QOnlineTranslator::Language translationLang, QOnlineTranslator::Language sourceLang, QOnlineTranslator::Language uiLang)
translate With Return, note this is blocking
void onTranslateHelp()
translate Help Files
void clearForms(int tabNumber)
clear Forms
void setDebugMessage(bool thisState)
set Debug Message
void setLanguageModel(MyLanguageModel *thisLanguageModel)
set Language Model
Definition: MainWindow.cpp:111
void loadLanguageComboBox()
load Language ComboBox
Definition: MainWindow.cpp:256
void loadLanguageComboBoxSource()
load Language ComboBox Source
Definition: MainWindow.cpp:199
void setTabSettings()
set Tab Settings
void closeTransHelp()
close Trans Help
void onCompile()
on Compile
virtual void changeEvent(QEvent *event) override
change Event
Definition: MainWindow.cpp:94
QString checkTranslationErrors(const QString &thisTranslations, const QString &thisText, QOnlineTranslator::Engine thisEngine, QOnlineTranslator::Language thisTranslationLang, QOnlineTranslator::Language thisSourceLang, QOnlineTranslator::Language thisUiLang)
check Translation Errors
void readStatesChanges()
read States Changes
Definition: MainWindow.cpp:457
void writeStateChanges()
write State Changes
Definition: MainWindow.cpp:484
bool getMainLoaded()
get Main Loaded Set to prevent triggers. getMainLoaded
Definition: MainWindow.cpp:356
void createReadMeTranslationJob(const QString &thisLanguageName, const QString &thisLangCode, bool thisChecked)
create ReadMe Translation Job
@ ErrorTransferring
ErrorTransferring
Definition: MainWindow.h:105
@ NoError
NoError
Definition: MainWindow.h:103
@ HostNotFound
HostNotFound
Definition: MainWindow.h:104
void fixTranslationFile(const QString &thisFile)
fix Translation File; mostly Arabic gets the value before the ID on some fields. fixTranslationFile
void setLanguageCode()
set Language Code Lable in UI
Definition: MainWindow.cpp:248
void fileRemoveArgs()
file Remove Args "String %1". fileRemoveArgs
void clearTabTranslations()
clear Tab Translations
@ TabTranslations
TabTranslations
Definition: MainWindow.h:91
@ TabSettings
TabSettings
Definition: MainWindow.h:89
@ TabAll
TabAll
Definition: MainWindow.h:94
@ TabTabHelp
TabHelp
Definition: MainWindow.h:93
@ TabProject
TabProject
Definition: MainWindow.h:92
@ TabSql
TabSql
Definition: MainWindow.h:90
QString getLastLanguageName()
getLastLanguageName
Definition: MainWindow.cpp:163
bool getDebugMessage()
get Debug Message
void acceptTranslations()
accept Translations
void setMainLoaded(bool thisState)
set Main Loaded
Definition: MainWindow.cpp:190
void readSettingsFirst()
read Settings First
Definition: MainWindow.cpp:403
void onSave()
on Save
Definition: MainWindow.cpp:771
MyMessageTypes
Message Types.
Definition: MainWindow.h:113
@ Warning
Warning
Definition: MainWindow.h:115
@ Information
Information
Definition: MainWindow.h:114
@ Debug
Debug
Definition: MainWindow.h:117
@ Critical
Critical
Definition: MainWindow.h:116
void setActionsDisabled(ActionStatesManager thisAction, bool thisState)
set Actions Disabled
void setCheckMarksTranslation(const QString &thisDbValve)
set Check Marks Translation
MainWindow(QWidget *parent=nullptr)
MainWindow Constructor. MainWindow.
Definition: MainWindow.cpp:20
void onInternetProgress()
on Internet Progress
Definition: MainWindow.cpp:171
void clearTabProject()
clear Tab Project
QString languageChecked()
language Checked
Definition: MainWindow.cpp:918
void setTabAll()
set Tab All
void setTranslationErrorType(const QString &thisTranslations)
set Translation Error Type
void onAuthor()
on Author
Definition: MainWindow.cpp:555
void readSqlDatabaseInfo()
read SQL Database Info
Definition: MainWindow.cpp:530
void setProjectClass(int tabNumber)
set Project Class
void createHelpTranslationJob(const QString &thisLanguageName, const QString &thisLangCode, bool thisChecked)
create Help Translation Job
QString getComboBoxProjectsID(int thisIndex)
get ComboBox Projects ID
Definition: MainWindow.cpp:743
void onClipboard()
on Clipboard
void setMessagingStates(bool thisMessageState)
set Messaging States
void loadQtProjectCombo()
set Qt Project Combo
Definition: MainWindow.cpp:312
void setDatabaseModel()
setDatabaseModel
Definition: MainWindow.cpp:121
void onAbout()
on About
Definition: MainWindow.cpp:570
bool fillForms(const QString &thisProjectID)
fill Forms
void setTabTranslations()
set Tab Translations
void checkLanguage(const QString &thisName, const QString &thisLanguage, bool thisChecked)
check Language
void onTranslateReadMe()
Translate ReadMe.
void loadLanguage(const QString &thisLanguage)
loadLanguage
Definition: MainWindow.cpp:143
void onHelp()
on Help
Definition: MainWindow.cpp:585
void onRunFirstOnStartup()
on Run First On Startup
Definition: MainWindow.cpp:364
void writeSqlDatabaseInfo()
write SQL Database Info
Definition: MainWindow.cpp:509
void retranslate()
retranslate none designer components
Definition: MainWindow.cpp:179
~MainWindow()
MainWindow Deconstructor. ~MainWindow.
Definition: MainWindow.cpp:72
void setMessage(const QString &thisMessage, MainWindow::MyMessageTypes thisMessageType)
set Message
void setSqlBrowseButton()
set SQL Browse Button
Definition: MainWindow.cpp:897
void setPrograms()
set Programs
Definition: MainWindow.cpp:839
Constants are defined as const QString, starting with MY_ all capps.
Definition: MyConstants.h:12
const QString MY_TRANS_ENGINE_GOOGLE_VALUE
MY_TRANS_ENGINE_GOOGLE_VALUE
Definition: MyConstants.h:34
const QString MY_SQL_DB_USER
MY_SQL_DB_USER
Definition: MyConstants.h:25
const QString MY_TRANS_ENGINE_YANDEX_VALUE
MY_TRANS_ENGINE_COMBO_VALUE
Definition: MyConstants.h:36
const QString MY_SQL_DB_NAME
MY_SQL_DB_NAME
Definition: MyConstants.h:21
const QString MY_SQL_DEFAULT
SQL_DEFAULT
Definition: MyConstants.h:18
const QString MY_SQL_DB_HOST
MY_SQL_DB_HOST
Definition: MyConstants.h:24
int MY_TRANS_DELAY
MY_TRANS_DELAY
Definition: MyConstants.h:38
const QString MY_SQL_DB_PASS
MY_SQL_DB_PASS
Definition: MyConstants.h:26
const QString MY_TRANS_DELAY_VALUE
MY_TRANS_DELAY_VALUE
Definition: MyConstants.h:37
const QString MY_SQL_DB_TYPE
MY_SQL_DB_TYPE
Definition: MyConstants.h:22
const QString MY_TRANS_ENGINE_BING_VALUE
MY_TRANS_ENGINE_BING_VALUE
Definition: MyConstants.h:35
const QString MY_IS_DEBUG_MESSAGE
MY_IS_DEBUG_MESSAGE
Definition: MyConstants.h:28
const QString MY_LANGUAGE_COMBO_STATE
MY_LANGUAGE_COMBO_STATE
Definition: MyConstants.h:33
const QString MY_SQL_PROJECT_NAME
MY_SQL_PROJECT_NAME
Definition: MyConstants.h:20
const QString MY_DEFAULT_LANGUAGE_CODE
MY_DEFAULT_LANGUAGE_CODE
Definition: MyConstants.h:47
const QString MY_SQL_PROJECT_ID
SQL_PROJECT_ID
Definition: MyConstants.h:19
const QString MY_TRANSLATION_FOLDER
MY_TRANSLATION_FOLDER
Definition: MyConstants.h:31
const QString MY_SQL_COMBO_STATE
SQL_COMBO_STATE
Definition: MyConstants.h:23
My Datatables.
Definition: MyDatatables.h:50
QString getProjectID()
get Project ID
void setProjectName(const QString &thisProjectName)
set Project Name
QString getQtProjectFullSelectQueryID(const QString &thisWhereID)
get Qt Projects Full Select Query ID
void setDebugMessage(bool thisState)
set Debug Message
MyProjectClass * myProject
myProject
Definition: MyDatatables.h:56
QString getQtProjectNameSelectQuery()
get Qt Projects Name Select Query
bool checkDatabase()
check Database
void setComboBoxSqlValue(const QString &thisComboBoxSqlValue)
set ComboBox SqlValue
MySqlDbtModel * mySqlModel
mySqlModel
Definition: MyDatatables.h:57
void saveQtProject()
save Qt Project
QString getProjectName()
get Project Name
void setProjectID(const QString &thisProjectID)
set Project ID
void deleteQtProject(const QString &thisID)
delete Qt Project
bool addQtProject()
add Qt Project
Abstact Model used for ComboBox. /class MyLanguageModel.
QString getLanguageCode()
get Language Code
QStringList getTsFiles(const QString &thisFolder)
get Ts Files
QStringList getQmFiles(const QString &thisFolder)
get Qm Files
QString getDefaultLanguageCode()
get Default Language Code
void setDebugMessage(bool thisState)
set Debug Message
QString getLangCode(const QString &thisString)
get Lang Code
QString getTranslationSource()
get Translation Source
void setLanguageCode(const QString &thisLanguageCode)
set Language Code
void setMainLoaded(bool thisMainLoaded)
set Main Loaded
QString getLanguageFromFile(const QString &thisPrefix, const QString &thisQmLanguageFile)
get Language From File
QString getLanguageName()
get Language Name
QString translateThis(const QString &thisPhrase)
translate This is required for Translation Files
Q_INVOKABLE void setLanguage(const QString &thisLanguageName)
load Language
MyOrgSettings * mySetting
mySetting
void readLanguage()
read Language
QString getTransFilePrefix()
get TransFile Prefix
QString languageCodeToName(const QString &thisLangageCode)
language Code To Name
QString languageNameToCode(const QString &lang)
language Name to Code Added by Light-Wizzard
My Lingo Jobs.
Definition: MainWindow.h:46
const QString MY_IS_DEBUG_MESSAGE
MY_IS_DEBUG_MESSAGE
Definition: MyOrgSettings.h:92
QString getLastApplicationPath()
get Last Application Path
QString combinePathFileName(const QString &thisPath, const QString &thisFileName)
combine Path File Name
bool isFileExists(const QString &thisFile)
File Functions.
@ Information
Information
Definition: MyOrgSettings.h:72
@ Critical
Critical
Definition: MyOrgSettings.h:75
@ Warning
Warning
Definition: MyOrgSettings.h:74
int readSettingsInt(const QString &thisSetting, int thisDefault)
read Settings Int
QString getAppDataLocation()
get AppData Location
SimpleCrypt * myCrypto
myCrypto
Definition: MyOrgSettings.h:81
void setDebugMessage(bool thisState)
set Debug Message
bool writeFile(const QString &thisFileName, const QString &thisContent)
write File
void sendInternetProgress()
send Internet Progress
QString decryptThis(const QString &thisSecret)
decrypt This
QString encryptThis(const QString &thisSecret)
encrypt This
void delay(int thisSeconds)
delay
const QString MY_DEFAULT_TAB_INDEX
MY_DEFAULT_TAB_INDEX
QString getFileInfo(MyOrgSettings::MyFileinfo thisInfo, const QString &thisFileFolder)
get File Info
int fileNumberLines(const QString &thisFile)
file Number Lines
bool isWord(const QString &thisString) const
is Word
QVariant setMessage(const QString &thisTitle, const QString &thisMessage, MyMessageTypes thisMessageType) const
set Message
QByteArray getGeometry()
get Geometry
QVariant showMessageBox(const QString &thisTitle, const QString &thisMessage, MyMessageTypes thisMessageType) const
show Message Box information, question, warning, critica
bool removeAllFiles(const QString &thisFolder)
remove All Files
void writeSettings(const QString &thisSetting, const QString &thisValue)
write Settings
QString readFile(const QString &thisFileName)
read File
void setWindowState(QByteArray thisWindowState)
get Geometry Min
@ CanonicalFilePath
CanonicalFilePath
Definition: MyOrgSettings.h:51
@ BaseName
BaseName
Definition: MyOrgSettings.h:48
@ IsFile
IsFile
Definition: MyOrgSettings.h:58
const QString MY_LAST_TAB_INDEX
MY_LAST_TAB
QString readSettings(const QString &thisSetting, const QString &thisDefault)
read Settings
bool readSettingsBool(const QString &thisSetting, bool thisDefault)
read Settings Bool
bool getInternetWait()
get Internet Wait
QByteArray getWindowState()
get Geometry Min
bool isMakeDir(const QString &thisPath)
is Make Dir
void setGeometry(QByteArray thisGeometry)
Screen Geometry.
void setID(const QString &s)
Definition: MyDatatables.h:30
void setSourceLanguage(const QString &s)
Definition: MyDatatables.h:36
void setQtProjectName(const QString &s)
Definition: MyDatatables.h:31
void setHelpFolder(const QString &s)
Definition: MyDatatables.h:35
void setMake(const QString &s)
Definition: MyDatatables.h:38
void setQtProjectFolder(const QString &s)
Definition: MyDatatables.h:32
void setSourceFolder(const QString &s)
Definition: MyDatatables.h:33
void setDoxyfileFolder(const QString &s)
Definition: MyDatatables.h:34
void setLanguageIDs(const QString &s)
Definition: MyDatatables.h:37
void setDebugMessage(bool thisState)
set Debug Message
QString getSqlDatabaseName()
getSqlDatabaseName
QString runProcces(const QString &thisExePath, const QString &thisArgument, bool isWait, int thisWaitTimeSec)
run Procces
void setSqlDriver(const QString &thisDriver)
setSqlDriver
int getRunReturnCode()
get Run Return Code
bool moveDb(const QString &thisSourceFile, const QString &thisSourcePath, const QString &thisDestinationFolder)
Move Db.
Tranlator Parser.
void toTS(const QString &inputDir, const QString &outputFile, const QString &langid)
toTS
void toTXT(const QString &inputFile, const QString &outputDir, bool with_unfinished, bool with_vanished, bool unfinished_only)
toTXT
QOnlineTranslator.
static QString languageCode(Language lang)
language Code
QString errorString() const
error String
static Language language(const QLocale &locale)
language
QString translation() const
translation
void translate(const QString &text, Engine engine=Google, Language translationLang=Auto, Language sourceLang=Auto, Language uiLang=Auto)
translate
TranslationError error() const
error
void setDebugMessage(bool thisState)
set Debug Message
Definition: SimpleCrypt.cpp:55
QCheckBox * checkBoxTranslationsIT
QCheckBox * checkBoxTranslationsEU
QCheckBox * checkBoxTranslationsYI
QCheckBox * checkBoxTranslationsLA
QCheckBox * checkBoxTranslationsLV
QTextEdit * textEditHelp
QStatusBar * statusbar
void retranslateUi(QMainWindow *MainWindow)
QCheckBox * checkBoxTranslationsTO
QCheckBox * checkBoxTranslationsHU
QComboBox * comboBoxTranslationSourceLanguage
QCheckBox * checkBoxTranslationsSI
QTabWidget * tabWidget
Definition: ui_MainWindow.h:55
QCheckBox * checkBoxTranslationsHR
QCheckBox * checkBoxTranslationsPS
QCheckBox * checkBoxTranslationsSU
QCheckBox * checkBoxTranslationsVE
QCheckBox * checkBoxTranslationsKK
QCheckBox * checkBoxTranslationsSO
QCheckBox * checkBoxTranslationsTA
QCheckBox * checkBoxTranslationsFA
QCheckBox * checkBoxTranslationsHI
QCheckBox * checkBoxTranslationsCY
QAction * actionHelp
Definition: ui_MainWindow.h:46
QCheckBox * checkBoxTranslationsSR
QAction * actionClipboard
Definition: ui_MainWindow.h:48
QCheckBox * checkBoxTranslationsAZ
QAction * actionExit
Definition: ui_MainWindow.h:44
QCheckBox * checkBoxTranslationsNN
QCheckBox * checkBoxTranslationsNE
QCheckBox * checkBoxTranslationsEN
QCheckBox * checkBoxTranslationsSV
QCheckBox * checkBoxTranslationsKN
QCheckBox * checkBoxSettingsYandex
Definition: ui_MainWindow.h:84
QCheckBox * checkBoxTranslationsSD
QCheckBox * checkBoxTranslationsTK
QCheckBox * checkBoxTranslationsML
QCheckBox * checkBoxTranslationsTLH_QAAK
QCheckBox * checkBoxTranslationsMG
QCheckBox * checkBoxTranslationsZH_TW
QSpinBox * spinBoxSettingsDelay
Definition: ui_MainWindow.h:89
QCheckBox * checkBoxTranslationsHMN
QProgressBar * progressBarProjectsFiles
QCheckBox * checkBoxTranslationsIG
QCheckBox * checkBoxTranslationsET
QCheckBox * checkBoxTranslationsEO
QCheckBox * checkBoxTranslationsTS
QCheckBox * checkBoxTranslationsCS
QCheckBox * checkBoxTranslationsZH_CN
QCheckBox * checkBoxTranslationsCEB
QCheckBox * checkBoxTranslationsST
QCheckBox * checkBoxTranslationsUR
QCheckBox * checkBoxTranslationsAPC
QCheckBox * checkBoxTranslationsSL
QTextEdit * textEditProjects
QCheckBox * checkBoxTranslationsBG
QPushButton * pushButtonTranslationsAdd
QAction * actionAbout
Definition: ui_MainWindow.h:45
QCheckBox * checkBoxTranslationsMS
QCheckBox * checkBoxTranslationsMHR
QLineEdit * lineEditSettingsLrelease
Definition: ui_MainWindow.h:76
QCheckBox * checkBoxTranslationsMRJ
QCheckBox * checkBoxTranslationsKU
QCheckBox * checkBoxTranslationsKO
QCheckBox * checkBoxTranslationsMI
QAction * actionSave
Definition: ui_MainWindow.h:50
QCheckBox * checkBoxTranslationsHA
QCheckBox * checkBoxTranslationsFO
QRadioButton * radioButtonTranslationsCmake
QCheckBox * checkBoxTranslationsKY
QCheckBox * checkBoxTranslationsGL
QPushButton * pushButtonTranslationsDelete
QCheckBox * checkBoxTranslationsMK
QCheckBox * checkBoxTranslationsRU
QProgressBar * progressBarProjectsTranslations
QCheckBox * checkBoxTranslationsTN
QCheckBox * checkBoxTranslationsTE
QCheckBox * checkBoxTranslationsFI
QCheckBox * checkBoxTranslationsOR
QComboBox * comboBoxTranslationsProjectNames
QAction * actionTranslate_ReadMe
Definition: ui_MainWindow.h:53
QCheckBox * checkBoxTranslationsBA
QCheckBox * checkBoxTranslationsTR
QPushButton * pushButtonTranslationsProjectBrowser
QCheckBox * checkBoxTranslationsLB
QComboBox * comboBoxLanguage
Definition: ui_MainWindow.h:62
QCheckBox * checkBoxTranslationsAR
QLineEdit * lineEditTranslationsProjectFolder
QCheckBox * checkBoxTranslationsDA
QCheckBox * checkBoxTranslationsMN
QCheckBox * checkBoxTranslationsCO
QLineEdit * lineEditSqlPassword
QCheckBox * checkBoxTranslationsHY
QLineEdit * lineEditSqlHostName
QCheckBox * checkBoxTranslationsLO
QCheckBox * checkBoxTranslationsES
QCheckBox * checkBoxTranslationsIS
QCheckBox * checkBoxTranslationsFY
QCheckBox * checkBoxTranslationsCA
QCheckBox * checkBoxTranslationsRM
QCheckBox * checkBoxTranslationsUK
QCheckBox * checkBoxTranslationsUZ
QCheckBox * checkBoxTranslationsJW
QComboBox * comboBoxSqlDatabaseType
QCheckBox * checkBoxSettingsBing
Definition: ui_MainWindow.h:85
QAction * actionAccept_Translations
Definition: ui_MainWindow.h:52
QCheckBox * checkBoxTranslationsGU
QCheckBox * checkBoxTranslationsHT
QLineEdit * lineEditSqlUserName
QCheckBox * checkBoxTranslationsUG
QLabel * labelTranslationsOptions
QCheckBox * checkBoxTranslationsMT
QCheckBox * checkBoxTranslationsBS
QCheckBox * checkBoxTranslationsTLH
QCheckBox * checkBoxTranslationsNB
QCheckBox * checkBoxTranslationsRO
QToolBar * toolBar
QCheckBox * checkBoxTranslationsVI
QRadioButton * radioButtonTranslationsQmake
QAction * actionCompile
Definition: ui_MainWindow.h:47
QCheckBox * checkBoxTranslationsID
QCheckBox * checkBoxTranslationsNY
QCheckBox * checkBoxTranslationsPL
QCheckBox * checkBoxTranslationsEL
QCheckBox * checkBoxTranslationsHAW
QCheckBox * checkBoxTranslationsPAP
QCheckBox * checkBoxTranslationsTG
QCheckBox * checkBoxTranslationsGD
QCheckBox * checkBoxTranslationsSQ
QCheckBox * checkBoxTranslationsSR_LATIN
QCheckBox * checkBoxTranslationsBE
QCheckBox * checkBoxTranslationsGA
QCheckBox * checkBoxTranslationsTH
QCheckBox * checkBoxTranslationsRW
QCheckBox * checkBoxTranslationsBN
QLineEdit * lineEditSqlDatabaseName
QCheckBox * checkBoxTranslationsKA
QLineEdit * lineEditTranslationsHelp
QCheckBox * checkBoxTranslationsXH
QCheckBox * checkBoxTranslationsTT
QCheckBox * checkBoxTranslationsYUA
QAction * actionAuthor
Definition: ui_MainWindow.h:49
void setupUi(QMainWindow *MainWindow)
QCheckBox * checkBoxTranslationsYO
QCheckBox * checkBoxTranslationsSM
QLineEdit * lineEditTranslationsDoxyfile
QCheckBox * checkBoxTranslationsAF
QCheckBox * checkBoxTranslationsAM
QCheckBox * checkBoxTranslationsTL
QLineEdit * lineEditTranslationsSource
QLabel * labelRecordIdProject
QCheckBox * checkBoxTranslationsJA
QCheckBox * checkBoxTranslationsOTQ
QLabel * labelSettingsLanguageUI
Definition: ui_MainWindow.h:80
QCheckBox * checkBoxTranslationsPT
QCheckBox * checkBoxTranslationsMY
QCheckBox * checkBoxTranslationsZU
QLineEdit * lineEditProjectName
QCheckBox * checkBoxTranslationsFJ
QCheckBox * checkBoxTranslationsLT
QCheckBox * checkBoxTranslationsHE
QCheckBox * checkBoxTranslationsFIL
QCheckBox * checkBoxTranslationsNO
QCheckBox * checkBoxTranslationsTY
QCheckBox * checkBoxTranslationsSB
QCheckBox * checkBoxTranslationsSK
QCheckBox * checkBoxTranslationsPA
QLineEdit * lineEditSettingsLupdate
Definition: ui_MainWindow.h:72
QCheckBox * checkBoxSettingsGoogle
Definition: ui_MainWindow.h:83
QCheckBox * checkBoxTranslationsMR
QCheckBox * checkBoxSettignsMessaging
Definition: ui_MainWindow.h:99
QCheckBox * checkBoxTranslationsSW
QCheckBox * checkBoxTranslationsKM
QCheckBox * checkBoxTranslationsFR
QCheckBox * checkBoxTranslationsYUE
QAction * actionTranslate_Help
Definition: ui_MainWindow.h:51
QCheckBox * checkBoxTranslationsNL
QPushButton * pushButtonTranslationsSave
QPushButton * pushButtonSqlDatabaseNameBrowse
QCheckBox * checkBoxTranslationsDE
QCheckBox * checkBoxTranslationsUDM
QLabel * labelTranslationsSourceLanguageCode
QCheckBox * checkBoxTranslationsSN
Definition: MainWindow.h:26