1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-25 17:25:13 +03:00

companion9x renamed Companion

This commit is contained in:
Dvogonen 2014-01-04 23:20:23 +01:00
parent 64419ffd3f
commit e5ad887be9
55 changed files with 4099 additions and 3548 deletions

View file

@ -103,9 +103,9 @@ downloadDialog_forWait(NULL)
readSettings();
FirmwareInfo *firmware = GetCurrentFirmware();
if (ActiveProfile) {
setWindowTitle(tr("companion9x - Models and Settings Editor - %1 - profile %2").arg(firmware->name).arg(ActiveProfileName));
setWindowTitle(tr("Companion - Models and Settings Editor - %1 - profile %2").arg(firmware->name).arg(ActiveProfileName));
} else {
setWindowTitle(tr("companion9x - Models and Settings Editor - %1").arg(firmware->name));
setWindowTitle(tr("Companion - Models and Settings Editor - %1").arg(firmware->name));
}
setUnifiedTitleAndToolBarOnMac(true);
this->setWindowIcon(QIcon(":/icon.png"));
@ -166,11 +166,11 @@ void MainWindow::displayWarnings()
if (warnId<WARNING_ID && warnId!=0) {
int res=0;
if (WARNING_LEVEL>0) {
QMessageBox::warning(this, "companion9x", WARNING);
res = QMessageBox::question(this, "companion9x",tr("Display previous warning again at startup ?"),QMessageBox::Yes | QMessageBox::No);
QMessageBox::warning(this, "Companion", WARNING);
res = QMessageBox::question(this, "Companion",tr("Display previous warning again at startup ?"),QMessageBox::Yes | QMessageBox::No);
} else {
QMessageBox::about(this, "companion9x", WARNING);
res = QMessageBox::question(this, "companion9x",tr("Display previous message again at startup ?"),QMessageBox::Yes | QMessageBox::No);
QMessageBox::about(this, "Companion", WARNING);
res = QMessageBox::question(this, "Companion",tr("Display previous message again at startup ?"),QMessageBox::Yes | QMessageBox::No);
}
if (res == QMessageBox::No) {
settings.setValue("warningId", WARNING_ID);
@ -243,7 +243,7 @@ void MainWindow::checkForUpdateFinished(QNetworkReply * reply)
QString version = qba.mid(i+14, 4);
if (version.isNull()) {
QMessageBox::warning(this, "companion9x", tr("Unable to check for updates."));
QMessageBox::warning(this, "Companion", tr("Unable to check for updates."));
return;
}
double vnum=version.toDouble();
@ -257,7 +257,7 @@ void MainWindow::checkForUpdateFinished(QNetworkReply * reply)
if (c9xver< vnum) {
#if defined WIN32 || !defined __GNUC__ // || defined __APPLE__ // OSX should only notify of updates since no update packages are available.
showcheckForUpdatesResult = false; // update is available - do not show dialog
int ret = QMessageBox::question(this, "companion9x", tr("A new version of companion9x is available (version %1)<br>"
int ret = QMessageBox::question(this, "Companion", tr("A new version of Companion is available (version %1)<br>"
"Would you like to download it?").arg(version) ,
QMessageBox::Yes | QMessageBox::No);
@ -278,21 +278,21 @@ void MainWindow::checkForUpdateFinished(QNetworkReply * reply)
}
}
#else
QMessageBox::warning(this, tr("New release available"), tr("A new release of companion is available please check the repository"));
QMessageBox::warning(this, tr("New release available"), tr("A new release of Companion is available please check the repository"));
#endif
} else {
if (showcheckForUpdatesResult && check1done && check2done)
QMessageBox::information(this, "companion9x", tr("No updates available at this time."));
QMessageBox::information(this, "Companion", tr("No updates available at this time."));
}
} else {
if(check1done && check2done)
QMessageBox::warning(this, "companion9x", tr("Unable to check for updates."));
QMessageBox::warning(this, "Companion", tr("Unable to check for updates."));
}
}
void MainWindow::updateDownloaded()
{
int ret = QMessageBox::question(this, "companion9x", tr("Would you like to launch the installer?") ,
int ret = QMessageBox::question(this, "Companion", tr("Would you like to launch the installer?") ,
QMessageBox::Yes | QMessageBox::No);
if (ret == QMessageBox::Yes) {
if(QDesktopServices::openUrl(QUrl::fromLocalFile(installer_fileName)))
@ -356,7 +356,7 @@ void MainWindow::reply1Accepted()
errormsg=tr("Compilation server too busy, try later");
break;
case 4:
errormsg=tr("Compilation server requires registration, please check opentx web site");
errormsg=tr("Compilation server requires registration, please check OpenTX web site");
break;
default:
errormsg=tr("Unknown server failure, try later");
@ -396,7 +396,7 @@ void MainWindow::reply1Accepted()
errormsg=tr("Compilation server too busy, try later");
break;
case 4:
errormsg=tr("Compilation server requires registration, please check opentx web site");
errormsg=tr("Compilation server requires registration, please check OpenTX web site");
break;
default:
errormsg=tr("Unknown server failure, try later");
@ -427,7 +427,7 @@ void MainWindow::reply1Accepted()
}
settings.setValue(downloadedFW, currentFWrev);
if (autoflash) {
int ret = QMessageBox::question(this, "companion9x", tr("Do you want to write the firmware to the transmitter now ?"), QMessageBox::Yes | QMessageBox::No);
int ret = QMessageBox::question(this, "Companion", tr("Do you want to write the firmware to the transmitter now ?"), QMessageBox::Yes | QMessageBox::No);
if (ret == QMessageBox::Yes) {
burnToFlash(downloadedFWFilename);
}
@ -464,7 +464,7 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
QString newrev=qba.mid(k).replace('"', "").trimmed();
if(!cres) {
QMessageBox::warning(this, "companion9x", tr("Unable to check for updates."));
QMessageBox::warning(this, "Companion", tr("Unable to check for updates."));
int server = settings.value("fwserver",0).toInt();
server++;
settings.setValue("fwserver",server);
@ -484,6 +484,7 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
showcheckForUpdatesResult = false; // update is available - do not show dialog
QString rn = GetFirmware(fwToUpdate)->rnurl;
QAbstractButton *rnButton;
msgBox.setWindowTitle("Companion");
msgBox.setInformativeText(tr("Firmware %1 does not seem to have ever been downloaded.\nVersion %2 is available.\nDo you want to download it now ?").arg(fwToUpdate).arg(NewFwRev));
QAbstractButton *YesButton = msgBox.addButton(trUtf8("Yes"), QMessageBox::YesRole);
msgBox.addButton(trUtf8("No"), QMessageBox::NoRole);
@ -496,7 +497,7 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
if( msgBox.clickedButton() == rnButton ) {
contributorsDialog *cd = new contributorsDialog(this,2,rn);
cd->exec();
int ret2 = QMessageBox::question(this, "companion9x", tr("Do you want to download release %1 now ?").arg(NewFwRev),
int ret2 = QMessageBox::question(this, "Companion", tr("Do you want to download release %1 now ?").arg(NewFwRev),
QMessageBox::Yes | QMessageBox::No);
if (ret2 == QMessageBox::Yes) {
download = true;
@ -512,7 +513,7 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
showcheckForUpdatesResult = false; // update is available - do not show dialog
QString rn = GetFirmware(fwToUpdate)->rnurl;
QAbstractButton *rnButton;
msgBox.setText("companion9x");
msgBox.setText("Companion");
msgBox.setInformativeText(tr("A new version of %1 firmware is available (current %2 - newer %3).\nDo you want to download it now ?").arg(fwToUpdate).arg(OldFwRev).arg(NewFwRev));
QAbstractButton *YesButton = msgBox.addButton(trUtf8("Yes"), QMessageBox::YesRole);
msgBox.addButton(trUtf8("No"), QMessageBox::NoRole);
@ -526,7 +527,7 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
warning=0;
contributorsDialog *cd = new contributorsDialog(this,2,rn);
cd->exec();
int ret2 = QMessageBox::question(this, "companion9x", tr("Do you want to download release %1 now ?").arg(NewFwRev),
int ret2 = QMessageBox::question(this, "Companion", tr("Do you want to download release %1 now ?").arg(NewFwRev),
QMessageBox::Yes | QMessageBox::No);
if (ret2 == QMessageBox::Yes) {
download = true;
@ -540,10 +541,10 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
}
} else {
if(showcheckForUpdatesResult && check1done && check2done)
QMessageBox::information(this, "companion9x", tr("No updates available at this time."));
QMessageBox::information(this, "Companion", tr("No updates available at this time."));
}
if (ignore) {
int res = QMessageBox::question(this, "companion9x",tr("Ignore this version (r%1)?").arg(rev), QMessageBox::Yes | QMessageBox::No);
int res = QMessageBox::question(this, "Companion",tr("Ignore this version (r%1)?").arg(rev), QMessageBox::Yes | QMessageBox::No);
if (res==QMessageBox::Yes) {
settings.beginGroup("FwRevisions");
settings.setValue(fwToUpdate, NewFwRev);
@ -553,7 +554,7 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
if (warning>0) {
QString rn = GetFirmware(fwToUpdate)->rnurl;
if (!rn.isEmpty()) {
int ret2 = QMessageBox::warning(this, "companion9x", tr("Release notes contain very important informations. Do you want to see them now ?"), QMessageBox::Yes | QMessageBox::No);
int ret2 = QMessageBox::warning(this, "Companion", tr("Release notes contain very important informations. Do you want to see them now ?"), QMessageBox::Yes | QMessageBox::No);
if (ret2 == QMessageBox::Yes) {
contributorsDialog *cd = new contributorsDialog(this,2,rn);
cd->exec();
@ -586,11 +587,11 @@ void MainWindow::reply1Finished(QNetworkReply * reply)
}
}
} else {
QMessageBox::warning(this, "companion9x", tr("Unable to check for updates."));
QMessageBox::warning(this, "Companion", tr("Unable to check for updates."));
}
} else {
if(check1done && check2done) {
QMessageBox::warning(this, "companion9x", tr("Unable to check for updates."));
QMessageBox::warning(this, "Companion", tr("Unable to check for updates."));
int server = settings.value("fwserver",0).toInt();
server++;
settings.setValue("fwserver",server);
@ -712,13 +713,13 @@ void MainWindow::loadProfile()
settings.setValue("profileId", profnum);
current_firmware_variant = GetFirmwareVariant(firmware_id);
FirmwareInfo *firmware = GetCurrentFirmware();
setWindowTitle(tr("companion9x - Models and Settings Editor - %1").arg(firmware->name));
setWindowTitle(tr("Companion - Models and Settings Editor - %1").arg(firmware->name));
// settings.setValue("lastDir", QFileInfo(fileName).dir().absolutePath());
foreach (QMdiSubWindow *window, mdiArea->subWindowList()) {
MdiChild *mdiChild = qobject_cast<MdiChild *>(window->widget());
mdiChild->eepromInterfaceChanged();
}
setWindowTitle(tr("companion9x - Models and Settings Editor - %1 - profile %2").arg(firmware->name).arg(ActiveProfileName));
setWindowTitle(tr("Companion - Models and Settings Editor - %1 - profile %2").arg(firmware->name).arg(ActiveProfileName));
}
}
@ -729,7 +730,7 @@ void MainWindow::unloadProfile()
QSettings settings("companion9x", "companion9x");
settings.setValue("ActiveProfile",0);
FirmwareInfo *firmware = GetCurrentFirmware();
setWindowTitle(tr("companion9x - Models and Settings Editor - %1").arg(firmware->name));
setWindowTitle(tr("Companion - Models and Settings Editor - %1").arg(firmware->name));
}
void MainWindow::preferences()
@ -738,9 +739,9 @@ void MainWindow::preferences()
pd->exec();
FirmwareInfo *firmware = GetCurrentFirmware();
if (ActiveProfile) {
setWindowTitle(tr("companion9x - Models and Settings Editor - %1 - profile %2").arg(firmware->name).arg(ActiveProfileName));
setWindowTitle(tr("Companion - Models and Settings Editor - %1 - profile %2").arg(firmware->name).arg(ActiveProfileName));
} else {
setWindowTitle(tr("companion9x - Models and Settings Editor - %1").arg(firmware->name));
setWindowTitle(tr("Companion - Models and Settings Editor - %1").arg(firmware->name));
}
foreach (QMdiSubWindow *window, mdiArea->subWindowList()) {
@ -1076,10 +1077,10 @@ void MainWindow::burnExtenalToEEPROM()
cd->exec();
if (!fileName.isEmpty()) {
settings.setValue("lastDir", QFileInfo(fileName).dir().absolutePath());
int ret = QMessageBox::question(this, "companion9x", tr("Write Models and settings from %1 to the Tx?").arg(QFileInfo(fileName).fileName()), QMessageBox::Yes | QMessageBox::No);
int ret = QMessageBox::question(this, "Companion", tr("Write Models and settings from %1 to the Tx?").arg(QFileInfo(fileName).fileName()), QMessageBox::Yes | QMessageBox::No);
if (ret != QMessageBox::Yes) return;
if (!isValidEEPROM(fileName))
ret = QMessageBox::question(this, "companion9x", tr("The file %1\nhas not been recognized as a valid Models and Settings file\nWrite anyway ?").arg(QFileInfo(fileName).fileName()), QMessageBox::Yes | QMessageBox::No);
ret = QMessageBox::question(this, "Companion", tr("The file %1\nhas not been recognized as a valid Models and Settings file\nWrite anyway ?").arg(QFileInfo(fileName).fileName()), QMessageBox::Yes | QMessageBox::No);
if (ret != QMessageBox::Yes) return;
bool backupEnable = settings.value("backupEnable", true).toBool();
QString backupPath = settings.value("backupPath", "").toString();
@ -1488,15 +1489,15 @@ void MainWindow::logFile()
void MainWindow::about()
{
QString aboutStr = "<center><img src=\":/images/companion9x-title.png\"><br>";
aboutStr.append(tr("Copyright") +" Bertrand Songis & Romolo Manfredini &copy; 2011- 2013<br>");
QString aboutStr = "<center><img src=\":/images/companion9x-title.png\"></center><br>";
aboutStr.append(tr("Copyright") +" Bertrand Songis & Romolo Manfredini &copy; 2011- 2014<br>");
aboutStr.append(QString("<a href='http://code.google.com/p/companion9x/'>http://code.google.com/p/companion9x/</a><br>")+tr("Version %1 (revision %2), %3").arg(C9X_VERSION).arg(C9X_REVISION).arg(__DATE__)+QString("<br/><br/>"));
aboutStr.append(tr("The companion9x project was originally forked from eePe")+QString(" <a href='http://code.google.com/p/eepe'>http://code.google.com/p/eepe</a><br/><br/>"));
aboutStr.append(tr("The Companion project was originally forked from eePe")+QString(" <a href='http://code.google.com/p/eepe'>http://code.google.com/p/eepe</a><br/><br/>"));
aboutStr.append(tr("If you've found this program useful, please support by"));
aboutStr.append(" <a href='" DONATE_STR "'>");
aboutStr.append(tr("donating") + "</a></center>");
aboutStr.append(tr("donating") + "</a>");
QMessageBox::about(this, tr("About companion9x"),aboutStr);
QMessageBox::about(this, tr("About Companion"),aboutStr);
}
void MainWindow::updateMenus()
@ -1623,15 +1624,15 @@ void MainWindow::createActions()
connect(preferencesAct, SIGNAL(triggered()), this, SLOT(preferences()));
checkForUpdatesAct = new QAction(QIcon(":/images/update.png"), tr("&Check for updates..."), this);
checkForUpdatesAct->setStatusTip(tr("Check for new version of companion9x/er9x"));
checkForUpdatesAct->setStatusTip(tr("Check for new version of Companion"));
connect(checkForUpdatesAct, SIGNAL(triggered()), this, SLOT(doUpdates()));
contributorsAct = new QAction(QIcon(":/images/contributors.png"), tr("Contributors &List..."), this);
contributorsAct->setStatusTip(tr("Show companion9x contributors list"));
contributorsAct->setStatusTip(tr("Show Companion contributors list"));
connect(contributorsAct, SIGNAL(triggered()), this, SLOT(contributors()));
changelogAct = new QAction(QIcon(":/images/changelog.png"), tr("ChangeLog..."), this);
changelogAct->setStatusTip(tr("Show companion9x changelog"));
changelogAct->setStatusTip(tr("Show Companion changelog"));
connect(changelogAct, SIGNAL(triggered()), this, SLOT(changelog()));
fwchangelogAct = new QAction(QIcon(":/images/changelog.png"), tr("Firmware ChangeLog..."), this);