Brief description of class still missing. More...
#include <UpdateIcon.h>
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 () | |
Brief description of class still missing.
Full description of class still missing
| 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);
}
| 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().
| void QGpGuiTools::UpdateIcon::setName | ( | const QString & | n | ) | [inline] |
Referenced by DinverGui::DinverGui(), GeopsyMainWindow::GeopsyMainWindow(), and MainWindow::MainWindow().
{_name=n;}
| void QGpGuiTools::UpdateIcon::setVersion | ( | const QString & | v | ) | [inline] |
Referenced by DinverGui::DinverGui(), GeopsyMainWindow::GeopsyMainWindow(), and MainWindow::MainWindow().
{_version=Version(v);}
| void QGpGuiTools::UpdateIcon::setVersionType | ( | const QString & | vt | ) | [inline] |
Referenced by DinverGui::DinverGui(), GeopsyMainWindow::GeopsyMainWindow(), and MainWindow::MainWindow().
{_versionType= vt;}