15#include "ui_MainWindow.h"
23 QApplication::setWindowIcon(QIcon(
":/images/logo32.png"));
44 ui->
toolBar->actions().at(0)->setVisible(
false);
45 ui->
toolBar->actions().at(1)->setVisible(
false);
52 connect(ui->
actionExit, &QAction::triggered,
this, &MainWindow::close);
65 setWindowTitle(QApplication::applicationName());
75 Q_CLEANUP_RESOURCE(QtLingo);
85 if (isSaveSettings)
onSave();
87 QMainWindow::closeEvent(event);
97 if (event ->type() == QEvent::LanguageChange && isMainLoaded)
105 QMainWindow::changeEvent(event);
113 myLanguageModel = thisLanguageModel;
114 myLanguageModel->
mySetting->
setMessage(
"set Language Model",
"setLanguageModel", MyOrgSettings::MyMessageTypes::Debug);
157 myLastLanguageName = thisLastLanguageName;
165 return myLastLanguageName;
173 ui->
statusbar->showMessage(tr(
"Internet is down, trying to reconnect"));
192 isMainLoaded = thisState;
203 QMetaEnum theEnum = QMetaEnum::fromType<QOnlineTranslator::Language>();
204 bool lastIsMainLoaded = isMainLoaded;
207 if (theCurrentIndex < 0)
209 theCurrentIndex = -1;
213 QStandardItemModel *theLangModel =
new QStandardItemModel(
this);
214 theLangModel->setColumnCount(2);
215 for (
int k = 0; k < theEnum.keyCount(); k++)
217 QString theLanguageName = theEnum.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);
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);
237 if (theCurrentIndex == -1)
258 myLanguageModel->
mySetting->
setMessage(
"load Language ComboBox",
"loadLanguageComboBox", MyOrgSettings::MyMessageTypes::Debug);
264 QStandardItemModel *theLangModel =
new QStandardItemModel(
this);
265 theLangModel->setColumnCount(2);
266 for (
int i = 0; i < theQmFiles.size(); ++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);
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);
288 QStandardItemModel *m = qobject_cast<QStandardItemModel *>(ui->
comboBoxLanguage->model());
291 QStandardItem *item = m ? m->item(ui->
comboBoxLanguage->findText(theDefaultLangageName)) :
nullptr;
294 auto f = item->font();
298 if (theCurrentIndex > 0)
316 bool lastIsMainLoaded = isMainLoaded;
317 isMainLoaded =
false;
320 QSqlQueryModel *theModalQtLingo =
new QSqlQueryModel(
this);
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);
336 theTableView->setColumnWidth (1, 296);
348 isMainLoaded = lastIsMainLoaded;
417 ui->
tabWidget->setCurrentIndex(theIndex);
546 if (!thePassword.isEmpty())
561 QString theFileName = QString(
":help/About-Author_%1.md").arg(myLanguageModel->
getLanguageCode());
576 QString theFileName = QString(
":help/About_%1.md").arg(myLanguageModel->
getLanguageCode());
591 QString theFileName = QString(
":help/Help_%1.md").arg(myLanguageModel->
getLanguageCode());
596 QString theLanguageFileName =
":help/Language.txt";
599 theFileContent.append(myLanguageModel->
mySetting->
readFile(theLanguageFileName));
607void MainWindow::on_pushButtonTranslationsSourceBrowse_clicked()
610 QFileDialog dialogTranslationFolder;
611 dialogTranslationFolder.setFileMode(QFileDialog::Directory);
612 dialogTranslationFolder.setOption(QFileDialog::ShowDirsOnly);
613 dialogTranslationFolder.setOption(QFileDialog::DontResolveSymlinks);
615 QString theTranslationFolder = dialogTranslationFolder.getExistingDirectory(
this, tr(
"Translation Source Folder Location"),
myConstants->
MY_TRANSLATION_FOLDER);
617 if (!theTranslationFolder.isEmpty())
624void MainWindow::on_pushButtonTranslationsDoxyfileBrowse_clicked()
627 QFileDialog dialogTranslationFolder;
628 dialogTranslationFolder.setFileMode(QFileDialog::Directory);
629 dialogTranslationFolder.setOption(QFileDialog::ShowDirsOnly);
630 dialogTranslationFolder.setOption(QFileDialog::DontResolveSymlinks);
632 QString theTranslationFolder = dialogTranslationFolder.getExistingDirectory(
this, tr(
"Translation Doxyfile Folder Location"), myLanguageModel->
mySetting->
getLastApplicationPath());
633 if (!theTranslationFolder.isEmpty())
640void MainWindow::on_pushButtonTranslationsProjectFolderBrowse_clicked()
642 setMessage(
"on_pushButtonTranslationsProjectFolderBrowse_clicked",
Debug);
643 QFileDialog dialogTranslationFolder;
644 dialogTranslationFolder.setFileMode(QFileDialog::Directory);
645 dialogTranslationFolder.setOption(QFileDialog::ShowDirsOnly);
646 dialogTranslationFolder.setOption(QFileDialog::DontResolveSymlinks);
648 QString theTranslationFolder = dialogTranslationFolder.getExistingDirectory(
this, tr(
"Projects Folder Location"), myLanguageModel->
mySetting->
getLastApplicationPath());
649 if (!theTranslationFolder.isEmpty())
656void MainWindow::on_comboBoxLanguage_currentIndexChanged(
const QString &thisLanguage)
666void MainWindow::on_checkBoxSettingsGoogle_stateChanged(
int thisArg)
669 if (!isMainLoaded) {
return; }
677void MainWindow::on_checkBoxSettingsBing_stateChanged(
int thisArg)
680 if (!isMainLoaded) {
return; }
688void MainWindow::on_checkBoxSettingsYandex_stateChanged(
int thisArg)
691 if (!isMainLoaded) {
return; }
699void MainWindow::on_pushButtonSqlDatabaseNameBrowse_clicked()
702 QFileDialog dialogSqlDbFolder;
703 dialogSqlDbFolder.setFileMode(QFileDialog::Directory);
704 dialogSqlDbFolder.setOption(QFileDialog::ShowDirsOnly);
705 dialogSqlDbFolder.setOption(QFileDialog::DontResolveSymlinks);
707 QString theSqlFolder = dialogSqlDbFolder.getExistingDirectory(
this, tr(
"Sqlite Folder Location"), myLanguageModel->
mySetting->
getAppDataLocation());
708 if (!theSqlFolder.isEmpty())
712 if (theDbLocation != theDbNewLocation)
719 if (myDbModel->
mySqlModel->
moveDb(theDbNewLocation, thePath, theDbNewLocation))
731void MainWindow::on_comboBoxTranslationsProjectNames_currentIndexChanged(
int thisIndex)
734 if (!isMainLoaded) {
return; }
736 setMessage(
"on_comboBoxTranslationsProjectNames_currentIndexChanged = " + QString::number(thisIndex) +
" and thisIndex = " + theIndex,
Debug);
746 QModelIndex theIndex = theModel->index(thisIndex, 0);
747 return theModel->data(theIndex).toString().trimmed();
753void MainWindow::on_pushButtonSqlPasswordShow_clicked()
762void MainWindow::on_pushButtonSqlSave_clicked()
782void MainWindow::on_pushButtonTranslationsSave_clicked()
791void MainWindow::on_pushButtonTranslationsClear_clicked()
801void MainWindow::on_pushButtonTranslationsAdd_clicked()
813void MainWindow::on_pushButtonTranslationsDelete_clicked()
823void MainWindow::on_pushButtonTranslationsProjectsBrowser_clicked()
826 QFileDialog dialogTranslationFolder;
827 dialogTranslationFolder.setFileMode(QFileDialog::Directory);
828 dialogTranslationFolder.setOption(QFileDialog::ShowDirsOnly);
829 dialogTranslationFolder.setOption(QFileDialog::DontResolveSymlinks);
831 QString theTranslationFolder = dialogTranslationFolder.getExistingDirectory(
this, tr(
"Projects Folder Location"), myLanguageModel->
mySetting->
getLastApplicationPath());
832 if (!theTranslationFolder.isEmpty())
842 QString theLupdatePath =
"/usr/bin/lupdate";
843 QString theLreleasePath =
"/usr/bin/lrelease";
880 if (theLupdatePath.isEmpty())
886 if (theLreleasePath.isEmpty())
906void MainWindow::on_comboBoxSqlDatabaseType_currentIndexChanged(
const QString &thisSqlType)
908 if (!isMainLoaded) {
return; }
909 setMessage(
"on_comboBoxSqlDatabaseType_currentIndexChanged=" + thisSqlType,
Debug);
1065 QString theLangagesIDs = myLanguages;
1066 myLanguageName = thisName;
1069 if (theLangagesIDs.contains(thisLanguage, Qt::CaseInsensitive)) {
return; }
1072 if (theLangagesIDs.isEmpty())
1074 theLangagesIDs.append(QString(
"%1").arg(thisLanguage.toLower()));
1078 theLangagesIDs.append(QString(
", %1").arg(thisLanguage.toLower()));
1084 if (theLangagesIDs.contains(thisLanguage, Qt::CaseInsensitive))
1086 if (theLangagesIDs.indexOf(thisLanguage, Qt::CaseInsensitive) - 1 > -1)
1088 theLangagesIDs.remove(thisLanguage, Qt::CaseInsensitive);
1092 theLangagesIDs.remove(QString(
", %1").arg(thisLanguage), Qt::CaseInsensitive);
1096 myLanguages = theLangagesIDs;
1105 if (thisDbValve.contains(
"af", Qt::CaseInsensitive))
1109 if (thisDbValve.contains(
"am", Qt::CaseInsensitive))
1113 if (thisDbValve.contains(
"ar", Qt::CaseInsensitive))
1117 if (thisDbValve.contains(
"az", Qt::CaseInsensitive))
1121 if (thisDbValve.contains(
"ba", Qt::CaseInsensitive))
1125 if (thisDbValve.contains(
"bn", Qt::CaseInsensitive))
1129 if (thisDbValve.contains(
"bs", Qt::CaseInsensitive))
1133 if (thisDbValve.contains(
"be", Qt::CaseInsensitive))
1137 if (thisDbValve.contains(
"bg", Qt::CaseInsensitive))
1141 if (thisDbValve.contains(
"ca", Qt::CaseInsensitive))
1145 if (thisDbValve.contains(
"cs", Qt::CaseInsensitive))
1149 if (thisDbValve.contains(
"co", Qt::CaseInsensitive))
1153 if (thisDbValve.contains(
"cy", Qt::CaseInsensitive))
1157 if (thisDbValve.contains(
"ceb", Qt::CaseInsensitive))
1161 if (thisDbValve.contains(
"da", Qt::CaseInsensitive))
1165 if (thisDbValve.contains(
"de", Qt::CaseInsensitive))
1169 if (thisDbValve.contains(
"el", Qt::CaseInsensitive))
1173 if (thisDbValve.contains(
"eo", Qt::CaseInsensitive))
1177 if (thisDbValve.contains(
"en", Qt::CaseInsensitive))
1181 if (thisDbValve.contains(
"et", Qt::CaseInsensitive))
1185 if (thisDbValve.contains(
"es", Qt::CaseInsensitive))
1189 if (thisDbValve.contains(
"eu", Qt::CaseInsensitive))
1193 if (thisDbValve.contains(
"fo", Qt::CaseInsensitive))
1197 if (thisDbValve.contains(
"fa", Qt::CaseInsensitive))
1201 if (thisDbValve.contains(
"fi", Qt::CaseInsensitive))
1205 if (thisDbValve.contains(
"fr", Qt::CaseInsensitive))
1209 if (thisDbValve.contains(
"fil", Qt::CaseInsensitive))
1213 if (thisDbValve.contains(
"fj", Qt::CaseInsensitive))
1217 if (thisDbValve.contains(
"fy", Qt::CaseInsensitive))
1221 if (thisDbValve.contains(
"gd", Qt::CaseInsensitive))
1225 if (thisDbValve.contains(
"ga", Qt::CaseInsensitive))
1229 if (thisDbValve.contains(
"gl", Qt::CaseInsensitive))
1233 if (thisDbValve.contains(
"GU", Qt::CaseInsensitive))
1237 if (thisDbValve.contains(
"hr", Qt::CaseInsensitive))
1241 if (thisDbValve.contains(
"haw", Qt::CaseInsensitive))
1245 if (thisDbValve.contains(
"he", Qt::CaseInsensitive))
1249 if (thisDbValve.contains(
"hi", Qt::CaseInsensitive))
1253 if (thisDbValve.contains(
"hu", Qt::CaseInsensitive))
1257 if (thisDbValve.contains(
"HT", Qt::CaseInsensitive))
1261 if (thisDbValve.contains(
"ha", Qt::CaseInsensitive))
1265 if (thisDbValve.contains(
"hy", Qt::CaseInsensitive))
1269 if (thisDbValve.contains(
"id", Qt::CaseInsensitive))
1273 if (thisDbValve.contains(
"ig", Qt::CaseInsensitive))
1277 if (thisDbValve.contains(
"is", Qt::CaseInsensitive))
1281 if (thisDbValve.contains(
"jw", Qt::CaseInsensitive))
1285 if (thisDbValve.contains(
"ka", Qt::CaseInsensitive))
1289 if (thisDbValve.contains(
"kn", Qt::CaseInsensitive))
1293 if (thisDbValve.contains(
"kk", Qt::CaseInsensitive))
1297 if (thisDbValve.contains(
"km", Qt::CaseInsensitive))
1301 if (thisDbValve.contains(
"ky", Qt::CaseInsensitive))
1305 if (thisDbValve.contains(
"lo", Qt::CaseInsensitive))
1309 if (thisDbValve.contains(
"la", Qt::CaseInsensitive))
1313 if (thisDbValve.contains(
"lb", Qt::CaseInsensitive))
1317 if (thisDbValve.contains(
"nl", Qt::CaseInsensitive))
1321 if (thisDbValve.contains(
"it", Qt::CaseInsensitive))
1325 if (thisDbValve.contains(
"ja", Qt::CaseInsensitive))
1329 if (thisDbValve.contains(
"ko", Qt::CaseInsensitive))
1333 if (thisDbValve.contains(
"ku", Qt::CaseInsensitive))
1337 if (thisDbValve.contains(
"lv", Qt::CaseInsensitive))
1341 if (thisDbValve.contains(
"lt", Qt::CaseInsensitive))
1345 if (thisDbValve.contains(
"mk", Qt::CaseInsensitive))
1349 if (thisDbValve.contains(
"ml", Qt::CaseInsensitive))
1353 if (thisDbValve.contains(
"ms", Qt::CaseInsensitive))
1357 if (thisDbValve.contains(
"mt", Qt::CaseInsensitive))
1361 if (thisDbValve.contains(
"mg", Qt::CaseInsensitive))
1365 if (thisDbValve.contains(
"mi", Qt::CaseInsensitive))
1369 if (thisDbValve.contains(
"mr", Qt::CaseInsensitive))
1373 if (thisDbValve.contains(
"mn", Qt::CaseInsensitive))
1377 if (thisDbValve.contains(
"my", Qt::CaseInsensitive))
1381 if (thisDbValve.contains(
"mrj", Qt::CaseInsensitive))
1385 if (thisDbValve.contains(
"hmn", Qt::CaseInsensitive))
1389 if (thisDbValve.contains(
"apc", Qt::CaseInsensitive))
1393 if (thisDbValve.contains(
"mhr", Qt::CaseInsensitive))
1397 if (thisDbValve.contains(
"no", Qt::CaseInsensitive))
1401 if (thisDbValve.contains(
"nb", Qt::CaseInsensitive))
1405 if (thisDbValve.contains(
"nn", Qt::CaseInsensitive))
1409 if (thisDbValve.contains(
"ny", Qt::CaseInsensitive))
1413 if (thisDbValve.contains(
"ne", Qt::CaseInsensitive))
1417 if (thisDbValve.contains(
"or", Qt::CaseInsensitive))
1421 if (thisDbValve.contains(
"otq", Qt::CaseInsensitive))
1425 if (thisDbValve.contains(
"pap", Qt::CaseInsensitive))
1429 if (thisDbValve.contains(
"ps", Qt::CaseInsensitive))
1433 if (thisDbValve.contains(
"pl", Qt::CaseInsensitive))
1437 if (thisDbValve.contains(
"pt", Qt::CaseInsensitive))
1441 if (thisDbValve.contains(
"pa", Qt::CaseInsensitive))
1445 if (thisDbValve.contains(
"rm", Qt::CaseInsensitive))
1449 if (thisDbValve.contains(
"ro", Qt::CaseInsensitive))
1453 if (thisDbValve.contains(
"ru", Qt::CaseInsensitive))
1457 if (thisDbValve.contains(
"rw", Qt::CaseInsensitive))
1461 if (thisDbValve.contains(
"sq", Qt::CaseInsensitive))
1465 if (thisDbValve.contains(
"sr", Qt::CaseInsensitive))
1469 if (thisDbValve.contains(
"sk", Qt::CaseInsensitive))
1473 if (thisDbValve.contains(
"sl", Qt::CaseInsensitive))
1477 if (thisDbValve.contains(
"sb", Qt::CaseInsensitive))
1481 if (thisDbValve.contains(
"sm", Qt::CaseInsensitive))
1485 if (thisDbValve.contains(
"st", Qt::CaseInsensitive))
1489 if (thisDbValve.contains(
"sn", Qt::CaseInsensitive))
1493 if (thisDbValve.contains(
"sd", Qt::CaseInsensitive))
1497 if (thisDbValve.contains(
"si", Qt::CaseInsensitive))
1501 if (thisDbValve.contains(
"so", Qt::CaseInsensitive))
1505 if (thisDbValve.contains(
"su", Qt::CaseInsensitive))
1509 if (thisDbValve.contains(
"sw", Qt::CaseInsensitive))
1513 if (thisDbValve.contains(
"sr-Latin", Qt::CaseInsensitive))
1517 if (thisDbValve.contains(
"sv", Qt::CaseInsensitive))
1521 if (thisDbValve.contains(
"tlh", Qt::CaseInsensitive))
1525 if (thisDbValve.contains(
"tlh-Qaak", Qt::CaseInsensitive))
1529 if (thisDbValve.contains(
"tl", Qt::CaseInsensitive))
1533 if (thisDbValve.contains(
"ty", Qt::CaseInsensitive))
1537 if (thisDbValve.contains(
"tg", Qt::CaseInsensitive))
1541 if (thisDbValve.contains(
"ta", Qt::CaseInsensitive))
1545 if (thisDbValve.contains(
"tt", Qt::CaseInsensitive))
1549 if (thisDbValve.contains(
"te", Qt::CaseInsensitive))
1553 if (thisDbValve.contains(
"to", Qt::CaseInsensitive))
1557 if (thisDbValve.contains(
"tk", Qt::CaseInsensitive))
1561 if (thisDbValve.contains(
"th", Qt::CaseInsensitive))
1565 if (thisDbValve.contains(
"ts", Qt::CaseInsensitive))
1569 if (thisDbValve.contains(
"tn", Qt::CaseInsensitive))
1573 if (thisDbValve.contains(
"tr", Qt::CaseInsensitive))
1577 if (thisDbValve.contains(
"uk", Qt::CaseInsensitive))
1581 if (thisDbValve.contains(
"ur", Qt::CaseInsensitive))
1585 if (thisDbValve.contains(
"ug", Qt::CaseInsensitive))
1589 if (thisDbValve.contains(
"uz", Qt::CaseInsensitive))
1593 if (thisDbValve.contains(
"ve", Qt::CaseInsensitive))
1597 if (thisDbValve.contains(
"udm", Qt::CaseInsensitive))
1601 if (thisDbValve.contains(
"vi", Qt::CaseInsensitive))
1605 if (thisDbValve.contains(
"xh", Qt::CaseInsensitive))
1609 if (thisDbValve.contains(
"yi", Qt::CaseInsensitive))
1613 if (thisDbValve.contains(
"yo", Qt::CaseInsensitive))
1617 if (thisDbValve.contains(
"yue", Qt::CaseInsensitive))
1621 if (thisDbValve.contains(
"yua", Qt::CaseInsensitive))
1625 if (thisDbValve.contains(
"zu", Qt::CaseInsensitive))
1629 if (thisDbValve.contains(
"zh-CN", Qt::CaseInsensitive))
1633 if (thisDbValve.contains(
"zh-TW", Qt::CaseInsensitive))
1645 bool theReturn =
true;
1654 setMessage(
"myConfigurationSelectQuery=|" + myConfigurationSelectQuery +
"|",
Debug);
1658 if (query.exec(myConfigurationSelectQuery))
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);
1664 myRecordID = query.value(
"id").toInt();
1676 mySourceLanguage = query.value(
"SourceLanguage").toString();
1680 theDbValve = query.value(
"LanguageIDs").toString();
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);
1694 isSaveSettings =
false;
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);
2137 myLanguageModel->
mySetting->
showMessageBox(QObject::tr(
"Error running lupdate").toLocal8Bit(), QString(
"%1: %2").arg(tr(
"Error running lupdate"), theLupdateResult).toLocal8Bit(), myLanguageModel->
mySetting->
Critical);
2149 myTranslationConf =
"TRANSLATIONS += ";
2154 myTranslationConf =
"set(TS_FILES ";
2156 myTranslationQrc.clear();
2294 ui->
textEditProjects->setText(QString(
"%1\n\n\n%2").arg(myTranslationConf, myTranslationQrc));
2303 for(
int i = 0; i < myLingoJob.count(); ++i )
2306 setMessage(
"Translating..." + myLingoJob.at(i).getLanguageName(),
Debug);
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);
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);
2321 myTranlatorParser->
toTXT(myLingoJob.at(i).getTsFile(), theTempFoler,
true,
false,
true);
2328 bool isSameLanguage =
false;
2331 QString theTxtFileContent;
2333 QFile theInputTxtFile(theDestTxtFile);
2334 if (theInputTxtFile.open(QIODevice::ReadOnly))
2336 int theTranslastionsCounter = 1;
2338 QTextStream theTxtFileStream(&theInputTxtFile);
2339 while (!theTxtFileStream.atEnd())
2343 QString theLine = theTxtFileStream.readLine();
2345 theTxtFileContent.append(theLine.leftRef(theLine.indexOf(
"\"") -1));
2347 QString theMatch = theLine.section(
'"', 1, 1);
2351 if (theMatch.contains(
"%")) {
removeArgs(theMatch, myLingoJob.at(i).getTsFile()); }
2353 { myTranslation = theMatch; }
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()));
2360 if (myTranslation.isEmpty())
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())
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()));
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));
2378 theInputTxtFile.close();
2384 myTranlatorParser->
toTS(theTempFoler, myLingoJob.at(i).getTsFile(), myLingoJob.at(i).getLangName());
2391 myLanguageModel->
mySetting->
showMessageBox(QObject::tr(
"Error running lrelease").toLocal8Bit(), QString(
"%1: %2").arg(tr(
"Error running lrelease"), theLreleaseResult).toLocal8Bit(), myLanguageModel->
mySetting->
Critical);
2409 if (!myTranslationError.isEmpty())
2411 if (thisTranslations.contains(
"Error transferring"))
2416 else if (thisTranslations.contains(
"Socket operation timed out"))
2421 else if (thisTranslations.contains(
"Host www.bing.com not found"))
2426 else if (thisTranslations.contains(
"Host translate.yandex.com not found"))
2431 else if (thisTranslations.contains(
"Host translate.googleapis.com not found"))
2438 myTranslationErrorType =
NoError;
2449 switch (myTranslationErrorType)
2453 myTranslation =
translateWithReturn(thisText, thisEngine, thisTranslationLang, thisSourceLang, thisUiLang);
2458 myLanguageModel->
mySetting->
delay(myDelayValue + myIncreameantValue);
2459 myTranslation =
translateWithReturn(thisText, thisEngine, thisTranslationLang, thisSourceLang, thisUiLang);
2463 myTranslation = thisTranslations;
2466 return myTranslation;
2475 for (
int i = 0; i < theTsFiles.size(); ++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(
""));
2483 ui->
statusbar->showMessage(tr(
"Accepted all Translations"));
2492 myHelpTranslationsFiles.clear();
2493 myHelpFileNames.clear();
2494 myTranslationQrc.clear();
2496 QDir dir(theHelpPath);
2497 QStringList theFileNames = dir.entryList(QStringList(
"*.md"), QDir::Files, QDir::Name);
2498 for (QString &theFileName : theFileNames)
2500 QString theLangCode = myLanguageModel->
getLangCode(theFileName);
2502 { myHelpTranslationsFiles.append(dir.filePath(theFileName)); }
2504 for (QString &fileName : myHelpTranslationsFiles)
2507 int theIndex = theFileName.indexOf(
"_");
2508 theFileName = theFileName.mid(0, theIndex);
2509 myHelpFileNames.append(theFileName);
2662 for(
int i = 0; i < myLingoJob.count(); ++i )
2665 setMessage(
"Translating..." + myLingoJob.at(i).getLanguageName(),
Debug);
2668 QString theHelpFile = myLingoJob.at(i).getTsFile();
2677 QString theHelpFileContents = myLanguageModel->
mySetting->
readFile(theHelpFile);
2678 if (theHelpFileContents.isEmpty())
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()));
2689 if (myTranslation.isEmpty())
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())
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()));
2700 if (myTranslation.isEmpty()) { myTranslation = theHelpFileContents; }
2701 myLanguageModel->
mySetting->
writeFile(myLingoJob.at(i).getDoxyFile(), myTranslation);
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);
2709 ui->
statusbar->showMessage(QString(
"%1: %2 = %3").arg(myLingoJob.at(i).getLanguageName(), theHelpFileContents.mid(0, 16), myTranslation));
2736 myHelpTranslationsFiles.clear();
2737 myHelpFileNames.clear();
2738 myTranslationQrc.clear();
2894 for(
int i = 0; i < myLingoJob.count(); ++i )
2897 setMessage(
"Translating..." + myLingoJob.at(i).getLanguageName(),
Debug);
2901 if (!myLingoJob.at(i).getReadMe().contains(
"_")) {
continue; }
2908 QString theReadMeFileContents = myLanguageModel->
mySetting->
readFile(theReadMeFile);
2909 if (theReadMeFileContents.isEmpty())
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()));
2918 if (myTranslation.isEmpty())
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())
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()));
2929 if (myTranslation.isEmpty()) { myTranslation = theReadMeFileContents; }
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);
2936 ui->
statusbar->showMessage(QString(
"%1: %2 = %3").arg(myLingoJob.at(i).getLanguageName(), theReadMeFileContents.mid(0, 16), myTranslation));
2953 setMessage(
"createTranslationJob(" + thisLanguageName +
", " + thisLangCode +
", " + thisSourceLanguage +
", " + thisChecked +
")",
Debug);
2955 if (!thisChecked) {
return; }
2956 QString theLangCode = thisLangCode;
2957 if (theLangCode.contains(
"-"))
2958 { theLangCode = theLangCode.replace(
"-",
"_"); }
2963 QString theTransFile = theTsFile;
2964 QString theTransQmFile = theQmFile;
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));
2974 myLingoJob.append(theTranslationJobs);
2982 setMessage(
"createHelpTranslationJob(" + thisLanguageName +
", " + thisLangCode +
", " + thisChecked +
")",
Debug);
2984 if (!thisChecked) {
return; }
2986 QString theLangCode = thisLangCode;
2987 if (theLangCode.contains(
"-"))
2988 { theLangCode = theLangCode.replace(
"-",
"_"); }
2992 for (QString &theFileName : myHelpFileNames)
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");
3001 QString theTransQmFile = theQmFile;
3003 if (theTransQmFile.mid(0, 1) ==
"/" || theTransQmFile.mid(0, 1) ==
"\\") { theTransQmFile = theTransQmFile.mid(1); }
3005 if (!myTranslationQrc.contains(theTransQmFile))
3007 myTranslationQrc.append(QString(
"<file>%1</file>\n").arg(theTransQmFile));
3012 myLingoJob.append(theTranslationJobs);
3021 setMessage(
"createHelpTranslationJob(" + thisLanguageName +
", " + thisLangCode +
", " + thisChecked +
")",
Debug);
3023 if (!thisChecked) {
return; }
3026 QString theLangCode = thisLangCode;
3027 if (theLangCode.contains(
"-"))
3028 { theLangCode = theLangCode.replace(
"-",
"_"); }
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");
3037 QString theTransQmFile = theQmFile;
3039 if (theTransQmFile.mid(0, 1) ==
"/" || theTransQmFile.mid(0, 1) ==
"\\") { theTransQmFile = theTransQmFile.mid(1); }
3041 myTranslationQrc.append(QString(
"<file>%1</file>\n").arg(theTransQmFile));
3045 myLingoJob.append(theTranslationJobs);
3053 setMessage(
"translateWithReturn(" + text +
", " + engine +
", " + translationLang +
", " + sourceLang +
", " + uiLang +
")",
Debug);
3055 myTranslation.clear();
3057 QEventLoop theEventLoop;
3061 theTranslator.
translate(text, engine, translationLang, sourceLang, uiLang);
3067 if (isTranslationLog) { qInfo() << theTranslator.translation(); }
3069 isTranslationError =
false;
3070 myTranslationError.clear();
3075 myTranslationError = QString(
"%1 %2 %3").arg(tr(
"Error in Translation phrase"), text, theTranslator.
errorString());
3076 isTranslationError =
true;
3077 myTranslation.clear();
3079 theEventLoop.quit();
3081 theEventLoop.exec();
3082 return myTranslation;
3098void MainWindow::on_checkBoxSettignsMessaging_stateChanged(
int thisCheckState)
3100 if (!isMainLoaded) {
return; }
3102 if (thisCheckState == Qt::Checked)
3113 if (thisMessageState)
3116 isDebugMessage =
true;
3126 isDebugMessage =
false;
3138void MainWindow::on_pushButtonTranslationsHelp_clicked()
3141 QFileDialog dialogTranslationFolder;
3142 dialogTranslationFolder.setFileMode(QFileDialog::Directory);
3143 dialogTranslationFolder.setOption(QFileDialog::ShowDirsOnly);
3144 dialogTranslationFolder.setOption(QFileDialog::DontResolveSymlinks);
3146 QString theTranslationFolder = dialogTranslationFolder.getExistingDirectory(
this, tr(
"Help Folder Location"), myLanguageModel->
mySetting->
getLastApplicationPath());
3147 if (!theTranslationFolder.isEmpty())
3156void MainWindow::on_comboBoxTranslationSourceLanguage_currentIndexChanged(
const QString &arg1)
3167 if (isDebugMessage && isMainLoaded) {
return; }
3168 switch (thisMessageType)
3180 qDebug() << thisMessage;
3191 isDebugMessage = thisState;
3201 return isDebugMessage;
3233void MainWindow::on_tabWidget_currentChanged(
int index)
3262 myRemoveTransArgs.append(QString(
"%1 |%2| in file %3").arg(tr(
"Remove Arguments that use Percent Sign x"), thisString, thisTransFile));
3271 if (!myRemoveTransArgs.isEmpty())
3273 QString theRemoveFileName = QString(
"%1").arg(myLanguageModel->
mySetting->
getAppDataLocation(), QDir::separator(),
"RemoveArgFile.txt");
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);
3287 QString theNewFileContent;
3288 QFile theInputTxtFile(thisFile);
3289 if (theInputTxtFile.open(QIODevice::ReadOnly))
3291 QTextStream theFileStream(&theInputTxtFile);
3292 while (!theFileStream.atEnd())
3294 QString theLine = theFileStream.readLine();
3295 if (theLine.mid(0, 1) !=
"[")
3297 QString theTransValue = theLine;
3298 theTransValue.remove(QRegExp(
"\[([^)]+)\\]"));
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));
3312void MainWindow::on_pushButtonSettingsLupdate_clicked()
3320void MainWindow::on_pushButtonSettingsLrelease_clicked()
Main Window Constructor. /class MainWindow.
MyConstants * myConstants
myConstants
void clearTabSettings()
clear Tab Settings
void closeEvent(QCloseEvent *event) override
close Event
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
void readAllSettings()
read Settings
void setLastLanguageName(const QString &thisLastLanguageName)
setLastLanguageName
void clearTabHelp()
clear Tab Help
ActionStatesManager
Action States Manager.
@ Translations
Translations
@ TranslationHelp
TranslationHelp
@ TranslationReadMe
TranslationReadMe
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
void loadLanguageComboBox()
load Language ComboBox
void loadLanguageComboBoxSource()
load Language ComboBox Source
void setTabSettings()
set Tab Settings
void closeTransHelp()
close Trans Help
void onCompile()
on Compile
virtual void changeEvent(QEvent *event) override
change Event
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
void writeStateChanges()
write State Changes
bool getMainLoaded()
get Main Loaded Set to prevent triggers. getMainLoaded
void createReadMeTranslationJob(const QString &thisLanguageName, const QString &thisLangCode, bool thisChecked)
create ReadMe Translation Job
@ ErrorTransferring
ErrorTransferring
@ HostNotFound
HostNotFound
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
void fileRemoveArgs()
file Remove Args "String %1". fileRemoveArgs
void clearTabTranslations()
clear Tab Translations
@ TabTranslations
TabTranslations
QString getLastLanguageName()
getLastLanguageName
bool getDebugMessage()
get Debug Message
void acceptTranslations()
accept Translations
void setMainLoaded(bool thisState)
set Main Loaded
void readSettingsFirst()
read Settings First
MyMessageTypes
Message Types.
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.
void onInternetProgress()
on Internet Progress
void clearTabProject()
clear Tab Project
QString languageChecked()
language Checked
void setTabAll()
set Tab All
void setTranslationErrorType(const QString &thisTranslations)
set Translation Error Type
void readSqlDatabaseInfo()
read SQL Database Info
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
void onClipboard()
on Clipboard
void setMessagingStates(bool thisMessageState)
set Messaging States
void loadQtProjectCombo()
set Qt Project Combo
void setDatabaseModel()
setDatabaseModel
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
void onRunFirstOnStartup()
on Run First On Startup
void writeSqlDatabaseInfo()
write SQL Database Info
void retranslate()
retranslate none designer components
~MainWindow()
MainWindow Deconstructor. ~MainWindow.
void setMessage(const QString &thisMessage, MainWindow::MyMessageTypes thisMessageType)
set Message
void setSqlBrowseButton()
set SQL Browse Button
void setPrograms()
set Programs
Constants are defined as const QString, starting with MY_ all capps.
const QString MY_TRANS_ENGINE_GOOGLE_VALUE
MY_TRANS_ENGINE_GOOGLE_VALUE
const QString MY_SQL_DB_USER
MY_SQL_DB_USER
const QString MY_TRANS_ENGINE_YANDEX_VALUE
MY_TRANS_ENGINE_COMBO_VALUE
const QString MY_SQL_DB_NAME
MY_SQL_DB_NAME
const QString MY_SQL_DEFAULT
SQL_DEFAULT
const QString MY_SQL_DB_HOST
MY_SQL_DB_HOST
int MY_TRANS_DELAY
MY_TRANS_DELAY
const QString MY_SQL_DB_PASS
MY_SQL_DB_PASS
const QString MY_TRANS_DELAY_VALUE
MY_TRANS_DELAY_VALUE
const QString MY_SQL_DB_TYPE
MY_SQL_DB_TYPE
const QString MY_TRANS_ENGINE_BING_VALUE
MY_TRANS_ENGINE_BING_VALUE
const QString MY_IS_DEBUG_MESSAGE
MY_IS_DEBUG_MESSAGE
const QString MY_LANGUAGE_COMBO_STATE
MY_LANGUAGE_COMBO_STATE
const QString MY_SQL_PROJECT_NAME
MY_SQL_PROJECT_NAME
const QString MY_DEFAULT_LANGUAGE_CODE
MY_DEFAULT_LANGUAGE_CODE
const QString MY_SQL_PROJECT_ID
SQL_PROJECT_ID
const QString MY_TRANSLATION_FOLDER
MY_TRANSLATION_FOLDER
const QString MY_SQL_COMBO_STATE
SQL_COMBO_STATE
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
QString getQtProjectNameSelectQuery()
get Qt Projects Name Select Query
bool checkDatabase()
check Database
void setComboBoxSqlValue(const QString &thisComboBoxSqlValue)
set ComboBox SqlValue
MySqlDbtModel * mySqlModel
mySqlModel
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
const QString MY_IS_DEBUG_MESSAGE
MY_IS_DEBUG_MESSAGE
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.
int readSettingsInt(const QString &thisSetting, int thisDefault)
read Settings Int
QString getAppDataLocation()
get AppData Location
SimpleCrypt * myCrypto
myCrypto
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
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)
void setSourceLanguage(const QString &s)
void setQtProjectName(const QString &s)
void setHelpFolder(const QString &s)
void setMake(const QString &s)
void setQtProjectFolder(const QString &s)
void setSourceFolder(const QString &s)
void setDoxyfileFolder(const QString &s)
void setLanguageIDs(const QString &s)
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.
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
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
QCheckBox * checkBoxTranslationsIT
QCheckBox * checkBoxTranslationsEU
QCheckBox * checkBoxTranslationsYI
QCheckBox * checkBoxTranslationsLA
QCheckBox * checkBoxTranslationsLV
void retranslateUi(QMainWindow *MainWindow)
QCheckBox * checkBoxTranslationsTO
QCheckBox * checkBoxTranslationsHU
QComboBox * comboBoxTranslationSourceLanguage
QCheckBox * checkBoxTranslationsSI
QCheckBox * checkBoxTranslationsHR
QCheckBox * checkBoxTranslationsPS
QCheckBox * checkBoxTranslationsSU
QCheckBox * checkBoxTranslationsVE
QCheckBox * checkBoxTranslationsKK
QCheckBox * checkBoxTranslationsSO
QCheckBox * checkBoxTranslationsTA
QCheckBox * checkBoxTranslationsFA
QCheckBox * checkBoxTranslationsHI
QCheckBox * checkBoxTranslationsCY
QCheckBox * checkBoxTranslationsSR
QAction * actionClipboard
QCheckBox * checkBoxTranslationsAZ
QCheckBox * checkBoxTranslationsNN
QCheckBox * checkBoxTranslationsNE
QCheckBox * checkBoxTranslationsEN
QCheckBox * checkBoxTranslationsSV
QCheckBox * checkBoxTranslationsKN
QCheckBox * checkBoxSettingsYandex
QCheckBox * checkBoxTranslationsSD
QCheckBox * checkBoxTranslationsTK
QCheckBox * checkBoxTranslationsML
QCheckBox * checkBoxTranslationsTLH_QAAK
QCheckBox * checkBoxTranslationsMG
QCheckBox * checkBoxTranslationsZH_TW
QSpinBox * spinBoxSettingsDelay
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
QCheckBox * checkBoxTranslationsMS
QCheckBox * checkBoxTranslationsMHR
QLineEdit * lineEditSettingsLrelease
QCheckBox * checkBoxTranslationsMRJ
QCheckBox * checkBoxTranslationsKU
QCheckBox * checkBoxTranslationsKO
QCheckBox * checkBoxTranslationsMI
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
QCheckBox * checkBoxTranslationsBA
QCheckBox * checkBoxTranslationsTR
QPushButton * pushButtonTranslationsProjectBrowser
QCheckBox * checkBoxTranslationsLB
QComboBox * comboBoxLanguage
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
QAction * actionAccept_Translations
QCheckBox * checkBoxTranslationsGU
QCheckBox * checkBoxTranslationsHT
QLineEdit * lineEditSqlUserName
QCheckBox * checkBoxTranslationsUG
QLabel * labelTranslationsOptions
QCheckBox * checkBoxTranslationsMT
QCheckBox * checkBoxTranslationsBS
QCheckBox * checkBoxTranslationsTLH
QCheckBox * checkBoxTranslationsNB
QCheckBox * checkBoxTranslationsRO
QCheckBox * checkBoxTranslationsVI
QRadioButton * radioButtonTranslationsQmake
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
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
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
QCheckBox * checkBoxSettingsGoogle
QCheckBox * checkBoxTranslationsMR
QCheckBox * checkBoxSettignsMessaging
QCheckBox * checkBoxTranslationsSW
QCheckBox * checkBoxTranslationsKM
QCheckBox * checkBoxTranslationsFR
QCheckBox * checkBoxTranslationsYUE
QAction * actionTranslate_Help
QCheckBox * checkBoxTranslationsNL
QPushButton * pushButtonTranslationsSave
QPushButton * pushButtonSqlDatabaseNameBrowse
QCheckBox * checkBoxTranslationsDE
QCheckBox * checkBoxTranslationsUDM
QLabel * labelTranslationsSourceLanguageCode
QCheckBox * checkBoxTranslationsSN