All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Slots | Public Member Functions
GeopsyGui::CityLoader Class Reference

Brief description of class still missing. More...

#include <CityLoader.h>

Inheritance diagram for GeopsyGui::CityLoader:
QGpGuiTools::Dialog QGpGuiTools::FrameGrabber

List of all members.

Public Slots

void on_clearBut_clicked ()
void on_closeBut_clicked ()
void on_loadBut_clicked ()
void on_mountBut_clicked ()
void on_pathBrowse_clicked ()
void on_unmountBut_clicked ()
void scan ()

Public Member Functions

 CityLoader (QWidget *parent=0)
 ~CityLoader ()

Detailed Description

Brief description of class still missing.

Full description of class still missing


Constructor & Destructor Documentation

GeopsyGui::CityLoader::CityLoader ( QWidget *  parent = 0)

Description of constructor still missing

References scan(), and TRACE.

    : Dialog(parent)
{
  TRACE;
  setupUi(this);

  _scanner=new CityScanner(this);
  // Create log stream for scanner thread
  Application::instance()->setStream(logView , _scanner);

  signalView->setModel(new CitySignalItem (_scanner, this) );
  signalView->setSelectionBehavior(QAbstractItemView::SelectRows);
  signalView->setSelectionMode(QAbstractItemView::ExtendedSelection);
  signalView->setEditTriggers(QAbstractItemView::NoEditTriggers);

  connect (pathEdit, SIGNAL(textChanged( const QString& )), this, SLOT(scan()) );
  connect (_scanner, SIGNAL(signalsChanged()), this, SLOT(resetSignalView()), Qt::QueuedConnection);

#ifndef Q_WS_X11
  delete mountBut;
  mountBut=0;
  delete unmountBut;
  unmountBut=0;
#endif
}

Description of destructor still missing

References TRACE.

{
  TRACE;
  logView->remove();
}

Member Function Documentation

References GeopsyCore::CityScanner::cleanStop(), GeopsyCore::CityScanner::erase(), MSG_ID, QGpCoreTools::tr(), and TRACE.

{
  TRACE;
  if(Message::question(MSG_ID, tr("Erasing a flash card"),
                       tr("Do you really want to erase this flash card and loose all recorded data?"),
                       Message::yes(), Message::no())==Message::Answer0) {
    _scanner->cleanStop();
    _scanner->erase();
  }
}

References GeopsyCore::CityScanner::cleanStop(), and TRACE.

{
  TRACE;
  _scanner->cleanStop();
  reject();
}

References GeopsyCore::SubSignalPool::addFile(), GeopsyCore::CityScanner::at(), GeopsyCore::CityScanner::cleanStop(), GeopsyCore::CityScanner::count(), GeopsyCore::GeopsyCoreEngine::currentDB(), GeopsyCore::SignalDB::filePool(), GeopsyCore::geopsyCore, GeopsyCore::SubSignalPool::isEmpty(), GeopsyCore::SignalFilePool::last(), GeopsyCore::CitySignal::loadSignals(), MSG_ID, GeopsyCore::GeopsyPreferences::oneWindowPerFile(), GeopsyCore::GeopsyCoreEngine::preferences(), GeopsyCore::CityScanner::readStream(), GeopsyCore::GeopsyCoreEngine::showLoadedSignals(), QGpCoreTools::tr(), and TRACE.

{
  TRACE;
  _scanner->cleanStop();

  bool selectAll=false;
  if( !isAnySelected()) {
    if(Message::question(MSG_ID, tr( "Loading flash card" ),
                               tr( "No files were selected, do you want to load all of them?" ),
                               Message::yes(), Message::cancel())==Message::Answer1) {
      return ;
    }
    selectAll=true;
  }

  QFile * stream=_scanner->readStream();
  SignalFilePool& fpool=geopsyCore->currentDB() ->filePool();
  SubSignalPool subPool;
  if(stream) {
    QItemSelectionModel & selModel=*signalView->selectionModel();
    QModelIndex rIndex=signalView->rootIndex();
    int n=_scanner->count();
    for(int i=0;i < n;i++ ) {
      if(selectAll || selModel.isRowSelected(i, rIndex) ) {
        if(_scanner->at(i)->loadSignals(stream)) {
          subPool.addFile(fpool.last());
          if(geopsyCore->preferences()->oneWindowPerFile()) {
            SubSignalPool subPool;
            subPool.addFile(fpool.last());
            geopsyCore->showLoadedSignals(subPool);
          }
        }
      }
    }
    if(!geopsyCore->preferences()->oneWindowPerFile() && !subPool.isEmpty()) {
      geopsyCore->showLoadedSignals(subPool);
    }
    delete stream;
  }
}

References QGpCoreTools::endl(), scan(), QGpCoreTools::tr(), and TRACE.

{
  TRACE;
#ifdef Q_WS_X11
  if(mountUnmount("mount")) {
    App::stream(_scanner) << tr("Flash card successfully mounted") << endl;
    scan();
  }
#endif
}

References str, QGpCoreTools::tr(), and TRACE.

{
  TRACE;
  QString str=Message::getExistingDirectory(tr("Flash card directory"), pathEdit->text());
  if(!str.isEmpty()) {
    pathEdit->setText(str);
  }
}

References GeopsyCore::CityScanner::clear(), QGpCoreTools::endl(), QGpCoreTools::tr(), and TRACE.

{
  TRACE;
#ifdef Q_WS_X11
  _scanner->clear(); // Make sure scanner is not reading card
  if(mountUnmount("umount")) {
    resetSignalView();
    App::stream(_scanner) << tr("Flash card successfully unmounted") << endl;
  }
#endif
}
void GeopsyGui::CityLoader::scan ( ) [slot]

References GeopsyCore::CityScanner::setPath(), and TRACE.

Referenced by CityLoader(), GeopsyMainWindow::loadCity(), and on_mountBut_clicked().

{
  TRACE;
  if(!pathEdit->text().isEmpty()) {
    QDir d(pathEdit->text());
    logView->clear();
    _scanner->setPath(d);
  }
}

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines