Merge branch 'master' of github.com:arcan1s/awesome-widgets

This commit is contained in:
arcan1s 2014-10-01 02:02:13 +04:00
commit 952fa97fcc
6 changed files with 12 additions and 9 deletions

View File

@ -1,5 +1,5 @@
Ver.2.0.5: Ver.2.0.5:
+ add tooltip bottom (#20) + add tooltip bottom (#30)
* fix battery tooltip bug * fix battery tooltip bug
Ver.2.0.4: Ver.2.0.4:

View File

@ -1,5 +1,5 @@
Вер.2.0.5: Вер.2.0.5:
+ добавлен нижний край к тултипу (#20) + добавлен нижний край к тултипу (#30)
* исправлен баг с тултипом батареи * исправлен баг с тултипом батареи
Вер.2.0.4: Вер.2.0.4:

View File

@ -83,9 +83,9 @@ void AwesomeWidget::createActions()
connect(contextMenu[1], SIGNAL(triggered(bool)), this, SLOT(showReadme())); connect(contextMenu[1], SIGNAL(triggered(bool)), this, SLOT(showReadme()));
contextMenu.append(new QAction(QIcon::fromTheme(QString("stock-refresh")), contextMenu.append(new QAction(QIcon::fromTheme(QString("stock-refresh")),
i18n("Update text"), this)); i18n("Update text"), this));
connect(contextMenu[2], SIGNAL(triggered(bool)), this, SLOT(updateNetworkDevice()));
connect(contextMenu[2], SIGNAL(triggered(bool)), extsysmonEngine, SLOT(updateAllSources())); connect(contextMenu[2], SIGNAL(triggered(bool)), extsysmonEngine, SLOT(updateAllSources()));
connect(contextMenu[2], SIGNAL(triggered(bool)), sysmonEngine, SLOT(updateAllSources())); connect(contextMenu[2], SIGNAL(triggered(bool)), sysmonEngine, SLOT(updateAllSources()));
connect(contextMenu[2], SIGNAL(triggered(bool)), this, SLOT(updateNetworkDevice()));
} }

View File

@ -65,7 +65,7 @@ public slots:
void configChanged(); void configChanged();
// update events // update events
void sendNotification(const QString eventId, const QString message); void sendNotification(const QString eventId, const QString message);
void updateNetworkDevice(); void updateNetworkDevice(const bool delay = true);
void updateText(const bool clear = false); void updateText(const bool clear = false);
void updateTooltip(); void updateTooltip();

View File

@ -340,12 +340,12 @@ void AwesomeWidget::dataUpdated(const QString &sourceName, const Plasma::DataEng
tooltipValues[QString("down")].append(data[QString("value")].toFloat()); tooltipValues[QString("down")].append(data[QString("value")].toFloat());
} }
networkDeviceUpdate++; networkDeviceUpdate++;
if (networkDeviceUpdate == 30) { if (networkDeviceUpdate >= 30) {
networkDeviceUpdate = 0; networkDeviceUpdate = 0;
if (configuration[QString("useCustomNetdev")].toInt() == 0) { if (configuration[QString("useCustomNetdev")].toInt() == 0) {
sysmonEngine->disconnectSource(QString("network/interfaces/") + values[QString("netdev")] + QString("/transmitter/data"), this); sysmonEngine->disconnectSource(QString("network/interfaces/") + values[QString("netdev")] + QString("/transmitter/data"), this);
sysmonEngine->disconnectSource(QString("network/interfaces/") + values[QString("netdev")] + QString("/receiver/data"), this); sysmonEngine->disconnectSource(QString("network/interfaces/") + values[QString("netdev")] + QString("/receiver/data"), this);
updateNetworkDevice(); updateNetworkDevice(false);
sysmonEngine->connectSource(QString("network/interfaces/") + values[QString("netdev")] + QString("/transmitter/data"), sysmonEngine->connectSource(QString("network/interfaces/") + values[QString("netdev")] + QString("/transmitter/data"),
this, configuration[QString("interval")].toInt()); this, configuration[QString("interval")].toInt());
sysmonEngine->connectSource(QString("network/interfaces/") + values[QString("netdev")] + QString("/receiver/data"), sysmonEngine->connectSource(QString("network/interfaces/") + values[QString("netdev")] + QString("/receiver/data"),

View File

@ -43,7 +43,7 @@ void AwesomeWidget::reinit()
keys = getKeys(); keys = getKeys();
foundKeys = findKeys(); foundKeys = findKeys();
updateNetworkDevice(); updateNetworkDevice(false);
connectToEngine(); connectToEngine();
} }
@ -63,11 +63,14 @@ void AwesomeWidget::sendNotification(const QString eventId, const QString messag
} }
void AwesomeWidget::updateNetworkDevice() void AwesomeWidget::updateNetworkDevice(const bool delay)
{ {
if (debug) qDebug() << PDEBUG; if (debug) qDebug() << PDEBUG;
values[QString("netdev")] = getNetworkDevice(); if (delay)
networkDeviceUpdate = 30;
else
values[QString("netdev")] = getNetworkDevice();
} }