mirror of
https://github.com/jankae/LibreVNA.git
synced 2026-04-07 07:23:43 +00:00
Import/export options in file menu
This commit is contained in:
parent
009de1af17
commit
b9e4117db1
11 changed files with 120 additions and 31 deletions
|
|
@ -171,6 +171,7 @@ AppWindow::AppWindow(QWidget *parent)
|
|||
};
|
||||
|
||||
connect(modeHandler, &ModeHandler::StatusBarMessageChanged, setModeStatusbar);
|
||||
connect(modeHandler, &ModeHandler::CurrentModeChanged, this, &AppWindow::UpdateImportExportMenus);
|
||||
|
||||
SetupMenu();
|
||||
|
||||
|
|
@ -1384,6 +1385,27 @@ bool AppWindow::LoadSetup(QString filename)
|
|||
return true;
|
||||
}
|
||||
|
||||
void AppWindow::UpdateImportExportMenus()
|
||||
{
|
||||
// clear menus of all actions first
|
||||
ui->menuImport->clear();
|
||||
ui->menuExport->clear();
|
||||
|
||||
// add action from currently active mode
|
||||
auto active = modeHandler->getActiveMode();
|
||||
if(active) {
|
||||
for(auto a : active->getImportOptions()) {
|
||||
ui->menuImport->addAction(a);
|
||||
}
|
||||
for(auto a : active->getExportOptions()) {
|
||||
ui->menuExport->addAction(a);
|
||||
}
|
||||
}
|
||||
// disable/enable menus
|
||||
ui->menuImport->setEnabled(ui->menuImport->actions().size());
|
||||
ui->menuExport->setEnabled(ui->menuExport->actions().size());
|
||||
}
|
||||
|
||||
void AppWindow::LoadSetup(nlohmann::json j)
|
||||
{
|
||||
// auto d = new JSONPickerDialog(j);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue