Connect the signals

Connect the signals and slots so we can use the stuff I programmed.

Sorry for the noise on the patch - most of this is whitespace
fixes done by the QtCreator.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2015-06-04 00:44:00 -03:00 committed by Dirk Hohndel
parent ddc7717ab8
commit d29d2a43ec
2 changed files with 18 additions and 13 deletions

View file

@ -57,7 +57,7 @@ MainTab::MainTab(QWidget *parent) : QTabWidget(parent),
ui.extraData->setModel(extraDataModel); ui.extraData->setModel(extraDataModel);
closeMessage(); closeMessage();
connect(ui.addDiveSite, SIGNAL(clicked()), this, SLOT(prepareDiveSiteEdit())); connect(ui.addDiveSite, SIGNAL(clicked()), this, SIGNAL(requestDiveSiteAdd()));
QAction *action = new QAction(tr("Apply changes"), this); QAction *action = new QAction(tr("Apply changes"), this);
connect(action, SIGNAL(triggered(bool)), this, SLOT(acceptChanges())); connect(action, SIGNAL(triggered(bool)), this, SLOT(acceptChanges()));

View file

@ -139,10 +139,14 @@ MainWindow::MainWindow() : QMainWindow(),
connect(DivePlannerPointsModel::instance(), SIGNAL(planCreated()), this, SLOT(planCreated())); connect(DivePlannerPointsModel::instance(), SIGNAL(planCreated()), this, SLOT(planCreated()));
connect(DivePlannerPointsModel::instance(), SIGNAL(planCanceled()), this, SLOT(planCanceled())); connect(DivePlannerPointsModel::instance(), SIGNAL(planCanceled()), this, SLOT(planCanceled()));
connect(plannerDetails->printPlan(), SIGNAL(pressed()), divePlannerWidget(), SLOT(printDecoPlan())); connect(plannerDetails->printPlan(), SIGNAL(pressed()), divePlannerWidget(), SLOT(printDecoPlan()));
connect(mainTab, SIGNAL(requestDiveSiteEdit(uint32_t)), this, SLOT(enableDiveSiteEdit(uint32_t))); connect(mainTab, SIGNAL(requestDiveSiteAdd()), this, SLOT(enableDiveSiteCreation()));
connect(locationInformation, SIGNAL(informationManagementEnded()), this, SLOT(setDefaultState())); connect(locationInformation, SIGNAL(informationManagementEnded()), this, SLOT(setDefaultState()));
connect(locationInformation, SIGNAL(informationManagementEnded()), information(), SLOT(showLocation())); connect(locationInformation, SIGNAL(informationManagementEnded()), information(), SLOT(showLocation()));
connect(locationInformation, SIGNAL(coordinatesChanged()), globe(), SLOT(repopulateLabels())); connect(locationInformation, SIGNAL(coordinatesChanged()), globe(), SLOT(repopulateLabels()));
connect(globeGps, SIGNAL(coordinatesChanged()), locationInformation, SLOT(updateGpsCoordinates()));
connect(locationInformation, SIGNAL(startEditDiveSite(uint32_t)), globeGps, SLOT(prepareForGetDiveCoordinates()));
connect(locationInformation, SIGNAL(endEditDiveSite()), globeGps, SLOT(prepareForGetDiveCoordinates()));
connect(information(), SIGNAL(diveSiteChanged()), globeGps, SLOT(centerOnCurrentDive()));
#ifdef NO_PRINTING #ifdef NO_PRINTING
plannerDetails->printPlan()->hide(); plannerDetails->printPlan()->hide();
@ -727,6 +731,7 @@ void MainWindow::on_actionEditDive_triggered()
disableShortcuts(); disableShortcuts();
DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD); DivePlannerPointsModel::instance()->setPlanMode(DivePlannerPointsModel::ADD);
graphics()->setAddState(); graphics()->setAddState();
globe()->endGetDiveCoordinates();
setApplicationState("EditDive"); setApplicationState("EditDive");
DivePlannerPointsModel::instance()->loadFromDive(current_dive); DivePlannerPointsModel::instance()->loadFromDive(current_dive);
information()->enableEdition(MainTab::MANUALLY_ADDED_DIVE); information()->enableEdition(MainTab::MANUALLY_ADDED_DIVE);