All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines
Public Types | Public Member Functions
QGpGuiTools::UpdateIcon Class Reference

Brief description of class still missing. More...

#include <UpdateIcon.h>

List of all members.

Public Types

enum  State { Connecting, NotConnected, Connected, NewRelease }

Public Member Functions

void addPlugin (const QString &n)
void addPlugins (const QStringList &nl)
void setName (const QString &n)
void setVersion (const QString &v)
void setVersionType (const QString &vt)
 UpdateIcon (QWidget *parent=0)
 ~UpdateIcon ()

Detailed Description

Brief description of class still missing.

Full description of class still missing


Member Enumeration Documentation

Enumerator:
Connecting 
NotConnected 
Connected 
NewRelease 

Constructor & Destructor Documentation

QGpGuiTools::UpdateIcon::UpdateIcon ( QWidget *  parent = 0)

Checking of new release availability starts automatically after returning to the event loop. Name and plugin list must be setup right after constructor.

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

      : QLabel(parent)
  {
    TRACE;
    _access=new HttpAccess("http://www.geopsy.org/access_testing.txt", this);
    connect(_access, SIGNAL(ready()), this, SLOT(checkAvailability()));
    connect(_access, SIGNAL(finished(bool)), this, SLOT(sent(bool)));

    _state=Connecting;
    setPixmap(QPixmap( ":/images/update_unavailable.png" ));
    setToolTip(tr("Live update: connecting ..."));

    QAction * a;

    a=new QAction(tr( "&Download" ), this);
    a->setStatusTip(tr( "Open your browser at download page" ));
    connect(a, SIGNAL(triggered()), this, SLOT(download()) );
    addAction(a);

    setContextMenuPolicy(Qt::ActionsContextMenu);
  }

Description of destructor still missing

References TRACE.

  {
    TRACE;
    clear();
  }

Member Function Documentation

void QGpGuiTools::UpdateIcon::addPlugin ( const QString &  n)

Adds one plugin.
can have an absolute path and library suffix and prefix. Everything is stripped in a platform-independent way before adding it.

References TRACE.

Referenced by addPlugins().

  {
    TRACE;
    QFileInfo fi(n);
    QString ns=fi.fileName();  // Removes path name
#if defined(Q_WS_MAC)
    if(ns.startsWith("lib") && ns.endsWith(".dylib")) {
      ns=ns.mid(3, ns.count()-9);
    }
#elif defined(Q_WS_WIN32)
    QRegExp r("[0-9]{1,}\\.dll$");
    int i=r.indexIn(ns);
    if(i>0) {
      ns=ns.left(i);
    }
#else
    if(ns.startsWith("lib") && ns.endsWith(".so")) {
      ns=ns.mid(3, ns.count()-6);
    }
#endif
    _plugins.append(ns);
  }
void QGpGuiTools::UpdateIcon::addPlugins ( const QStringList &  nl)

Add several plugins using addPlugin(const QString& n).

References addPlugin(), and TRACE.

Referenced by DinverGui::DinverGui(), and GeopsyMainWindow::GeopsyMainWindow().

  {
    TRACE;
    for(QStringList::const_iterator it=nl.begin(); it!=nl.end(); it++) {
      addPlugin(*it);
    }
  }
void QGpGuiTools::UpdateIcon::setName ( const QString &  n) [inline]
void QGpGuiTools::UpdateIcon::setVersion ( const QString &  v) [inline]
void QGpGuiTools::UpdateIcon::setVersionType ( const QString &  vt) [inline]

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