# HG changeset patch # User Heiko Schlittermann (JUMPER) # Date 1327188965 -3600 # Node ID 46b8d9898143e54e9770e8260c05adbbaa1cb81f # Parent 71093d26a4de2fd5c4c545ef976009604b6af4ae open dialog diff -r 71093d26a4de -r 46b8d9898143 igc.pro --- a/igc.pro Sat Jan 21 23:52:16 2012 +0100 +++ b/igc.pro Sun Jan 22 00:36:05 2012 +0100 @@ -2,6 +2,8 @@ # Automatically generated by qmake (2.01a) Sat Jan 21 23:39:20 2012 ###################################################################### +CONFIG += debug + TEMPLATE = app TARGET = DEPENDPATH += . @@ -9,6 +11,7 @@ UI_DIR = .build/ OBJECTS_DIR = .build/ +MOC_DIR = .build/ # Input HEADERS += mainwindow.h diff -r 71093d26a4de -r 46b8d9898143 mainwindow.cc --- a/mainwindow.cc Sat Jan 21 23:52:16 2012 +0100 +++ b/mainwindow.cc Sun Jan 22 00:36:05 2012 +0100 @@ -1,3 +1,6 @@ +#include +#include +#include #include "mainwindow.h" #include "ui_mainwindow.h" @@ -5,5 +8,22 @@ : QMainWindow(parent), ui(new Ui::MainWindow) { ui->setupUi(this); - dumpObjectTree(); + connect(ui->actionAboutQt, SIGNAL(triggered()), qApp, SLOT(aboutQt())); + connect(ui->actionExit, SIGNAL(triggered()), qApp, SLOT(quit())); + connect(ui->actionOpen, SIGNAL(triggered()), this, SLOT(open())); +} + +MainWindow::~MainWindow() +{ + delete ui; } + +void MainWindow::open() +{ + currentFile = QFileDialog::getOpenFileName(this, + tr("Open IGC file"), + "", tr("*.igc")); + + setWindowTitle(QFileInfo(currentFile).baseName()); + statusBar()->showMessage("opening " + currentFile, 5000); +} diff -r 71093d26a4de -r 46b8d9898143 mainwindow.h --- a/mainwindow.h Sat Jan 21 23:52:16 2012 +0100 +++ b/mainwindow.h Sun Jan 22 00:36:05 2012 +0100 @@ -7,9 +7,14 @@ class MainWindow : public QMainWindow { + Q_OBJECT public: MainWindow(QWidget *parent = 0); + ~MainWindow(); + protected slots: + void open(); private: + QString currentFile; Ui::MainWindow *ui; };