void MainWindow::cancelCreatingPlace()
{
    deactivateButton(ui->createPlaceButton);
    placeDialog.clear();
    placeCreatedModeOn = false;
    ui->mapWidget->resetMode();
}
void MainWindow::on_removeButton_clicked()
{
    if (!removeModeOn)
    {
        routeDialog.close();
        placeDialog.close();
        placeDialog.clear();
        ui->mapWidget->removeElement();
        deactivateButton(ui->createRouteButton);
        deactivateButton(ui->createPlaceButton);
        activateButton(ui->removeButton);
        placeCreatedModeOn = false;
        routeCreatedModeOn = false;
        removeModeOn = true;
    }
    else
    {
        deactivateButton(ui->removeButton);
        removeModeOn = false;
    }
}
void MainWindow::endEditing()
{
    editModeOn = !editModeOn;
    ui->mapWidget->redrawMap(false);
    fillPlaces(ui->startList);
    fillPlaces(ui->finishList);
    placeDialog.close();
    routeDialog.close();
    deactivateButton(ui->removeButton);
    deactivateButton(ui->createPlaceButton);
    deactivateButton(ui->createRouteButton);

    routeCreatedModeOn = false;
    placeCreatedModeOn = false;
    removeModeOn = false;
    ui->editMapButton->setStyleSheet(" background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1,stop: 0 #f6f7fa, stop: 1 #dadbde); ");
    ui->mapWidget->resetMode();
    ui->createPlaceButton->setEnabled(editModeOn);
    ui->createRouteButton->setEnabled(editModeOn);
    ui->removeButton->setEnabled(editModeOn);
    ui->searchRoutesButton->setEnabled(!editModeOn);

}
//! initialisation
void MultiLocalPathWidget::initMultiLocalPathForm()
{
	m_verticalLayout = new QVBoxLayout(this);
	m_verticalLayout->setSpacing(6);
	m_verticalLayout->setContentsMargins(3, 3, 3, 3);
	
	this->createMultiLocalPathList_obj();
	
	m_deactivButton = new QPushButton();
	m_deactivButton->setText("Deactivate");
	
	m_verticalLayout->addWidget( m_deactivButton );
	
	connect( m_deactivButton , SIGNAL(clicked()), this , SLOT(deactivateButton()) );
}
void MainWindow::onElementRemoved()
{
    deactivateButton(ui->removeButton);
    removeModeOn = false;
    ui->mapWidget->resetMode();
}
void MainWindow::cancelCreatingRoute()
{
    deactivateButton(ui->createRouteButton);
    routeCreatedModeOn = false;
    ui->mapWidget->resetMode();
}