SettingsDialog.cc 1.66 KB
Newer Older
1 2 3 4 5 6 7 8
/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/
9

10

11
#include <QSettings>
12
#include <QDesktopWidget>
13

Don Gagne's avatar
Don Gagne committed
14
#include "SettingsDialog.h"
15
#include "MainWindow.h"
Don Gagne's avatar
Don Gagne committed
16
#include "ui_SettingsDialog.h"
lm's avatar
lm committed
17

18 19 20
#include "LinkManager.h"
#include "MAVLinkProtocol.h"
#include "MAVLinkSettingsWidget.h"
21
#include "GAudioOutput.h"
Don Gagne's avatar
Don Gagne committed
22
#include "QGCApplication.h"
Don Gagne's avatar
Don Gagne committed
23
#include "QGCFileDialog.h"
Don Gagne's avatar
Don Gagne committed
24
#include "QGCMessageBox.h"
25
#include "MainToolBarController.h"
26
#include "FlightMapSettings.h"
27

28
SettingsDialog::SettingsDialog(QWidget *parent, Qt::WindowFlags flags)
29 30
    : QDialog(parent, flags)
    , _ui(new Ui::SettingsDialog)
lm's avatar
lm committed
31
{
32
    _ui->setupUi(this);
33

34
    // Center the window on the screen.
35 36 37
    QDesktopWidget *desktop = QApplication::desktop();
    int screen = desktop->screenNumber(parent);

38
    QRect position = frameGeometry();
39
    position.moveCenter(QApplication::desktop()->availableGeometry(screen).center());
40
    move(position.topLeft());
41

42
    MAVLinkSettingsWidget* pMavsettings  = new MAVLinkSettingsWidget(qgcApp()->toolbox()->mavlinkProtocol(), this);
43 44 45 46

    // Add the MAVLink settings pane
    _ui->tabWidget->addTab(pMavsettings,  "MAVLink");

47
    this->window()->setWindowTitle(tr("QGroundControl Settings"));
48

49
    _ui->tabWidget->setCurrentWidget(pMavsettings);
Don Gagne's avatar
Don Gagne committed
50 51

    connect(_ui->buttonBox, &QDialogButtonBox::accepted, this, &SettingsDialog::accept);
lm's avatar
lm committed
52 53
}

54
SettingsDialog::~SettingsDialog()
lm's avatar
lm committed
55
{
56
    delete _ui;
lm's avatar
lm committed
57
}