| 1 |
|
|---|
| 2 | /* -------------------------------------------------------------------------
|
|---|
| 3 | * RTNet GUI
|
|---|
| 4 | * -------------------------------------------------------------------------
|
|---|
| 5 | *
|
|---|
| 6 | * Class: t_inpEdit
|
|---|
| 7 | *
|
|---|
| 8 | * Purpose: RTNet Input File
|
|---|
| 9 | *
|
|---|
| 10 | * Author: L. Mervart
|
|---|
| 11 | *
|
|---|
| 12 | * Created: 05-Jan-2013
|
|---|
| 13 | *
|
|---|
| 14 | * Changes:
|
|---|
| 15 | *
|
|---|
| 16 | * -----------------------------------------------------------------------*/
|
|---|
| 17 |
|
|---|
| 18 | #include "inpedit.h"
|
|---|
| 19 | #include "keyword.h"
|
|---|
| 20 | #include "panel.h"
|
|---|
| 21 |
|
|---|
| 22 | using namespace std;
|
|---|
| 23 | using namespace GnssCenter;
|
|---|
| 24 |
|
|---|
| 25 | Q_EXPORT_PLUGIN2(gnsscenter_inpedit, GnssCenter::t_inpEditFactory)
|
|---|
| 26 |
|
|---|
| 27 | // Constructor
|
|---|
| 28 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 29 | t_inpEdit::t_inpEdit() : QMainWindow() {
|
|---|
| 30 |
|
|---|
| 31 | _tabWidget = new t_tabWidget();
|
|---|
| 32 | setCentralWidget(_tabWidget);
|
|---|
| 33 |
|
|---|
| 34 | QMenu* menuFile = menuBar()->addMenu(tr("&File"));
|
|---|
| 35 |
|
|---|
| 36 | QAction* actOpenFile = new QAction(tr("&Open"), this);
|
|---|
| 37 | connect(actOpenFile, SIGNAL(triggered()), this, SLOT(slotOpenFile()));
|
|---|
| 38 | menuFile->addAction(actOpenFile);
|
|---|
| 39 |
|
|---|
| 40 | QAction* actSaveFile = new QAction(tr("&Save"), this);
|
|---|
| 41 | connect(actSaveFile, SIGNAL(triggered()), this, SLOT(slotSaveFile()));
|
|---|
| 42 | menuFile->addAction(actSaveFile);
|
|---|
| 43 | }
|
|---|
| 44 |
|
|---|
| 45 | // Destructor
|
|---|
| 46 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 47 | t_inpEdit::~t_inpEdit() {
|
|---|
| 48 | }
|
|---|
| 49 |
|
|---|
| 50 | //
|
|---|
| 51 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 52 | void t_inpEdit::slotOpenFile() {
|
|---|
| 53 | QString fileName = QFileDialog::getOpenFileName(this);
|
|---|
| 54 | if (!fileName.isEmpty()) {
|
|---|
| 55 | _tabWidget->readInputFile(fileName);
|
|---|
| 56 | }
|
|---|
| 57 | }
|
|---|
| 58 |
|
|---|
| 59 | //
|
|---|
| 60 | ////////////////////////////////////////////////////////////////////////////
|
|---|
| 61 | void t_inpEdit::slotSaveFile() {
|
|---|
| 62 | QString fileName = QFileDialog::getSaveFileName(this);
|
|---|
| 63 | if (!fileName.isEmpty()) {
|
|---|
| 64 | _tabWidget->writeInputFile(fileName);
|
|---|
| 65 | }
|
|---|
| 66 | }
|
|---|