mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
preferences: create global settingsChanged signal
So far, the PreferencesDialog emitted a settingsChanged signal. This meant that models that listened to that signal had to conditionally compile out the code for mobile or the connection had to be made in MainWindow. Instead, introduce a global signal that does this and move the connects to the listeners to remove inter-dependencies. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
8bbd778c28
commit
2d7be7a0e3
16 changed files with 36 additions and 49 deletions
|
@ -189,13 +189,7 @@ MainWindow::MainWindow() : QMainWindow(),
|
|||
QIcon::setThemeName("subsurface");
|
||||
}
|
||||
connect(diveList, &DiveListView::divesSelected, this, &MainWindow::selectionChanged);
|
||||
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), this, SLOT(readSettings()));
|
||||
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), diveList, SLOT(update()));
|
||||
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), diveList, SLOT(reloadHeaderActions()));
|
||||
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), mainTab.get(), SLOT(updateDiveInfo()));
|
||||
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), divePlannerWidget, SLOT(settingsChanged()));
|
||||
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), divePlannerSettingsWidget, SLOT(settingsChanged()));
|
||||
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), TankInfoModel::instance(), SLOT(update()));
|
||||
connect(&diveListNotifier, &DiveListNotifier::settingsChanged, this, &MainWindow::readSettings);
|
||||
for (int i = 0; i < NUM_RECENT_FILES; i++) {
|
||||
actionsRecent[i] = new QAction(this);
|
||||
actionsRecent[i]->setData(i);
|
||||
|
@ -324,7 +318,7 @@ MainWindow::MainWindow() : QMainWindow(),
|
|||
connect(graphics, &ProfileWidget2::editCurrentDive, this, &MainWindow::editCurrentDive);
|
||||
connect(graphics, &ProfileWidget2::updateDiveInfo, mainTab.get(), &MainTab::updateDiveInfo);
|
||||
|
||||
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), graphics, SLOT(settingsChanged()));
|
||||
connect(&diveListNotifier, &DiveListNotifier::settingsChanged, graphics, &ProfileWidget2::settingsChanged);
|
||||
|
||||
ui.profCalcAllTissues->setChecked(qPrefTechnicalDetails::calcalltissues());
|
||||
ui.profCalcCeiling->setChecked(qPrefTechnicalDetails::calcceiling());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue