Fork me on GitHub
2.15.20
FGx
A cross-platform launcher for FlightGear
importairportsdialog.cpp
Go to the documentation of this file.
1 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-
2 // FGx FlightGear Launcher // importairportsdialog.cpp
3 // -=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=--=-=-=-=-=-=-
4 // (c) 2010-2012
5 // Yves Sablonier, Pete Morgan
6 // Geoff McLane
7 // GNU GPLv2, see main.cpp and shipped licence.txt for further information
8 
9 
10 #include <QFileInfo>
11 #include <QProcess>
12 #include <QVariant>
13 
14 
15 #include <QVBoxLayout>
16 #include <QHBoxLayout>
17 #include <QWidget>
18 #include <QRadioButton>
19 #include <QIcon>
20 #include <QLabel>
21 #include <QCheckBox>
22 #include <QProgressDialog>
23 
24 
26 
27 /* Shows the import airports widget
28 
29  TODO: MessageOBx to confirm import and this will take a while
30  Close after import finished
31  */
32 
34  QDialog(parent)
35 {
36 
37 
38 
39  setWindowTitle("Import Airports");
40  setWindowIcon(QIcon(":/icon/import"));
41 
42  setFixedWidth(400);
43 
44  QVBoxLayout *outerContainer = new QVBoxLayout();
45  this->setLayout(outerContainer);
46  outerContainer->setContentsMargins(0,0,0,0);
47  outerContainer->setSpacing(10);
48 
49  QVBoxLayout *mainVBox = new QVBoxLayout();
50  outerContainer->addLayout(mainVBox);
51  int m = 20;
52  mainVBox->setContentsMargins(m,m,m,m);
53  mainVBox->setSpacing(10);
54 
55 
56  QString s("This import scans the scenery directories, and extracts data from xml files.\n\nImporting can take a few moments !");
57  //s.append("\n\nSoon we ")
58 
59  QLabel *lblHelp = new QLabel(s);
60  mainVBox->addWidget(lblHelp, 1);
61  lblHelp->setStyleSheet("background-color: #efefef; padding: 5px; border: 1px solid #000099;");
62 
63  //*****************************************************************
64  //** Bottom Button Box
65  QHBoxLayout *buttonBox = new QHBoxLayout();
66  mainVBox->addLayout(buttonBox);
67  buttonBox->addStretch(10);
68 
69 
70  //* Cancel Import button
71  buttCancelImport = new QPushButton();
72  buttonBox->addWidget(buttCancelImport);
73  buttCancelImport->setText(tr("Cancel"));
74  buttCancelImport->setIcon(QIcon(":/icon/black"));
75  connect(buttCancelImport, SIGNAL(clicked()), this, SLOT(reject()));
76 
77  //* Import button
78  buttImport = new QPushButton();
79  buttonBox->addWidget(buttImport);
80  buttImport->setText(tr("Import"));
81  buttImport->setIcon(QIcon(":/icon/import"));
82  connect(buttImport, SIGNAL(clicked()), this, SLOT(accept()) );
83 
84 
85 }
86 
87 
88 
89 
90 
91 
QPushButton * buttCancelImport
ImportAirportsDialog(QWidget *parent=0)