Create new Troubleshooting submenu under Help and move a bunch of items there.

Also change "archive" to "zip" in the menu and prompts for sending diagnostic data.
This commit is contained in:
sawinglogz 2020-01-27 14:13:41 -05:00
parent 6d47210c95
commit 7a42caeccf
2 changed files with 25 additions and 18 deletions

View File

@ -2633,7 +2633,7 @@ void MainWindow::on_mainsplitter_splitterMoved(int, int)
void MainWindow::on_actionCreate_Card_zip_triggered()
{
QList<ImportPath> datacards = selectCPAPDataCards(tr("Would you like to archive this card?"));
QList<ImportPath> datacards = selectCPAPDataCards(tr("Would you like to zip this card?"));
for (auto & datacard : datacards) {
QString cardPath = QDir(datacard.path).canonicalPath();
@ -2653,7 +2653,7 @@ void MainWindow::on_actionCreate_Card_zip_triggered()
}
folder += QDir::separator() + infostr + ".zip";
filename = QFileDialog::getSaveFileName(this, tr("Choose where to save archive"), folder, tr("ZIP files (*.zip)"));
filename = QFileDialog::getSaveFileName(this, tr("Choose where to save zip"), folder, tr("ZIP files (*.zip)"));
if (filename.isEmpty()) {
return; // aborted
@ -2663,7 +2663,7 @@ void MainWindow::on_actionCreate_Card_zip_triggered()
QString selectedPath = QFileInfo(filename).dir().canonicalPath();
if (selectedPath.startsWith(cardPath)) {
if (QMessageBox::warning(nullptr, STR_MessageBox_Error,
QObject::tr("Please select a location for your archive other than the data card itself!"),
QObject::tr("Please select a location for your zip other than the data card itself!"),
QMessageBox::Ok)) {
continue;
}
@ -2682,7 +2682,7 @@ void MainWindow::on_actionCreate_Card_zip_triggered()
bool ok = z.Open(filename);
if (ok) {
ProgressDialog * prog = new ProgressDialog(this);
prog->setMessage(tr("Creating archive..."));
prog->setMessage(tr("Creating zip..."));
ok = z.AddDirectory(cardPath, prog);
z.Close();
} else {
@ -2690,7 +2690,7 @@ void MainWindow::on_actionCreate_Card_zip_triggered()
}
if (!ok) {
QMessageBox::warning(nullptr, STR_MessageBox_Error,
QObject::tr("Unable to create archive!"),
QObject::tr("Unable to create zip!"),
QMessageBox::Ok);
}
}
@ -2705,7 +2705,7 @@ void MainWindow::on_actionCreate_OSCAR_Data_zip_triggered()
folder += QDir::separator() + STR_AppData + ".zip";
QString filename = QFileDialog::getSaveFileName(this, tr("Choose where to save archive"), folder, tr("ZIP files (*.zip)"));
QString filename = QFileDialog::getSaveFileName(this, tr("Choose where to save zip"), folder, tr("ZIP files (*.zip)"));
if (filename.isEmpty()) {
return; // aborted
@ -2733,7 +2733,7 @@ void MainWindow::on_actionCreate_OSCAR_Data_zip_triggered()
files.AddDirectory(oscarData.canonicalPath(), oscarData.dirName());
files.Remove(debugLog.fileName());
prog->setMessage(tr("Creating archive..."));
prog->setMessage(tr("Creating zip..."));
// Create the zip.
ok = z.AddFiles(files, prog);
@ -2746,7 +2746,7 @@ void MainWindow::on_actionCreate_OSCAR_Data_zip_triggered()
QString debugLogName = oscarData.dirName() + QDir::separator() + QFileInfo(debugLog).fileName();
ok = z.AddFile(debugLog.fileName(), debugLogName);
if (!ok) {
qWarning() << "Unable to add debug log to archive!";
qWarning() << "Unable to add debug log to zip!";
}
}
}
@ -2757,7 +2757,7 @@ void MainWindow::on_actionCreate_OSCAR_Data_zip_triggered()
}
if (!ok) {
QMessageBox::warning(nullptr, STR_MessageBox_Error,
QObject::tr("Unable to create archive!"),
QObject::tr("Unable to create zip!"),
QMessageBox::Ok);
}
}

View File

@ -2856,12 +2856,10 @@ p, li { white-space: pre-wrap; }
<property name="title">
<string>&amp;Help</string>
</property>
<addaction name="actionOnline_Users_Guide"/>
<addaction name="action_Frequently_Asked_Questions"/>
<addaction name="actionSleep_Disorder_Terms_Glossary"/>
<addaction name="separator"/>
<addaction name="actionChange_Language"/>
<addaction name="separator"/>
<widget class="QMenu" name="menuTroubleshooting">
<property name="title">
<string>Troubleshooting</string>
</property>
<addaction name="actionDebug"/>
<addaction name="actionShow_Performance_Counters"/>
<addaction name="separator"/>
@ -2870,6 +2868,15 @@ p, li { white-space: pre-wrap; }
<addaction name="actionReport_a_Bug"/>
<addaction name="separator"/>
<addaction name="actionSystem_Information"/>
</widget>
<addaction name="actionOnline_Users_Guide"/>
<addaction name="action_Frequently_Asked_Questions"/>
<addaction name="actionSleep_Disorder_Terms_Glossary"/>
<addaction name="separator"/>
<addaction name="actionChange_Language"/>
<addaction name="separator"/>
<addaction name="menuTroubleshooting"/>
<addaction name="separator"/>
<addaction name="action_About"/>
</widget>
<widget class="QMenu" name="menu_Data">
@ -3212,12 +3219,12 @@ p, li { white-space: pre-wrap; }
</action>
<action name="actionCreate_Card_zip">
<property name="text">
<string>Create archive of CPAP data card</string>
<string>Create zip of CPAP data card</string>
</property>
</action>
<action name="actionCreate_OSCAR_Data_zip">
<property name="text">
<string>Create archive of all OSCAR data</string>
<string>Create zip of all OSCAR data</string>
</property>
</action>
<action name="actionExport_CSV">