Changeset 5099 in ntrip for trunk


Ignore:
Timestamp:
Apr 12, 2013, 4:12:04 PM (11 years ago)
Author:
mervart
Message:
 
Location:
trunk/GnssCenter/inpedit
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/GnssCenter/inpedit/inpedit.cpp

    r5090 r5099  
    3333 
    3434  QMenu*   menuFile = menuBar()->addMenu(tr("&File"));
     35
    3536  QAction* actOpenFile = new QAction(tr("&Open"), this);
    3637  connect(actOpenFile, SIGNAL(triggered()), this, SLOT(slotOpenFile()));
    3738  menuFile->addAction(actOpenFile);
     39
     40  QAction* actSaveFile = new QAction(tr("&Save"), this);
     41  connect(actSaveFile, SIGNAL(triggered()), this, SLOT(slotSaveFile()));
     42  menuFile->addAction(actSaveFile);
    3843}
    3944
     
    4853  QString fileName = QFileDialog::getOpenFileName(this);
    4954  if (!fileName.isEmpty()) {
    50     _tabWidget->setInputFile(fileName);
     55    _tabWidget->readInputFile(fileName);
    5156  }
    5257}
     58
     59//
     60////////////////////////////////////////////////////////////////////////////
     61void t_inpEdit::slotSaveFile() {
     62  QString fileName = QFileDialog::getSaveFileName(this);
     63  if (!fileName.isEmpty()) {
     64    _tabWidget->writeInputFile(fileName);
     65  }
     66}
  • trunk/GnssCenter/inpedit/inpedit.h

    r5089 r5099  
    1818 private slots:
    1919  void slotOpenFile();
     20  void slotSaveFile();
    2021 private:
    2122  t_tabWidget* _tabWidget;
  • trunk/GnssCenter/inpedit/tabwidget.cpp

    r5097 r5099  
    4141//
    4242////////////////////////////////////////////////////////////////////////////
    43 void t_tabWidget::setInputFile(const QString& fileName) {
     43void t_tabWidget::readInputFile(const QString& fileName) {
     44
    4445  _fileName = fileName;
    45   readFile();
    46 }
    47 
    48 //
    49 ////////////////////////////////////////////////////////////////////////////
    50 void t_tabWidget::readFile() {
    5146
    5247  _staticLines.clear();
     
    9388    }
    9489  }
     90}
    9591
    96   //// beg test
     92//
     93////////////////////////////////////////////////////////////////////////////
     94void t_tabWidget::writeInputFile(const QString& fileName) {
    9795  for (int ii = 0; ii < _staticLines.size(); ii++) {
    9896    cout << _staticLines[ii].toAscii().data() << endl;
    9997  }
    100   //// end test
    10198}
  • trunk/GnssCenter/inpedit/tabwidget.h

    r5097 r5099  
    1313  t_tabWidget();
    1414  ~t_tabWidget();
    15   void setInputFile(const QString&);
     15  void readInputFile(const QString&);
     16  void writeInputFile(const QString&);
    1617 private:
    17   void readFile();
    1818  QString                   _fileName;
    1919  QMap<QString, t_keyword*> _keywords;
Note: See TracChangeset for help on using the changeset viewer.