mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-04-25 07:57:19 +00:00
add checkupdates function
This commit is contained in:
parent
4fc2e238bd
commit
5bf3847bc9
@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>700</width>
|
||||
<height>594</height>
|
||||
<height>592</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
@ -41,9 +41,9 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<y>-126</y>
|
||||
<width>677</width>
|
||||
<height>677</height>
|
||||
<height>702</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_8">
|
||||
@ -423,6 +423,13 @@ $m - uptime minutes without zero</string>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="checkBox_updates">
|
||||
<property name="text">
|
||||
<string>Check for updates</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="spacer_advanced">
|
||||
<property name="orientation">
|
||||
|
@ -234,7 +234,8 @@ void AwesomeWidget::init()
|
||||
timer->start();
|
||||
// check for updates
|
||||
connect(this, SIGNAL(thereIsUpdates(QString)), this, SLOT(showUpdates(QString)));
|
||||
checkUpdates();
|
||||
if (configuration[QString("checkUpdates")].toInt() == 2)
|
||||
checkUpdates();
|
||||
}
|
||||
|
||||
|
||||
|
@ -298,6 +298,10 @@ void AwesomeWidget::createConfigurationInterface(KConfigDialog *parent)
|
||||
Qt::MatchFixedString));
|
||||
uiAdvancedConfig.lineEdit_acOnline->setText(configuration[QString("acOnline")]);
|
||||
uiAdvancedConfig.lineEdit_acOffline->setText(configuration[QString("acOffline")]);
|
||||
if (configuration[QString("checkUpdates")].toInt() == 0)
|
||||
uiAdvancedConfig.checkBox_updates->setCheckState(Qt::Unchecked);
|
||||
else
|
||||
uiAdvancedConfig.checkBox_updates->setCheckState(Qt::Checked);
|
||||
|
||||
// tooltip
|
||||
uiTooltipConfig.spinBox_tooltipNum->setValue(configuration[QString("tooltipNumber")].toInt());
|
||||
@ -515,6 +519,7 @@ void AwesomeWidget::configAccepted()
|
||||
cg.writeEntry("customNetdev", uiAdvancedConfig.comboBox_netdev->currentText());
|
||||
cg.writeEntry("acOnline", uiAdvancedConfig.lineEdit_acOnline->text());
|
||||
cg.writeEntry("acOffline", uiAdvancedConfig.lineEdit_acOffline->text());
|
||||
cg.writeEntry("checkUpdates", QString::number(uiAdvancedConfig.checkBox_updates->checkState()));
|
||||
|
||||
// tooltip
|
||||
cg.writeEntry("tooltipNumber", QString::number(uiTooltipConfig.spinBox_tooltipNum->value()));
|
||||
@ -597,6 +602,7 @@ void AwesomeWidget::configChanged()
|
||||
configuration[QString("customNetdev")] = cg.readEntry("customNetdev", "lo");
|
||||
configuration[QString("acOnline")] = cg.readEntry("acOnline", "(*)");
|
||||
configuration[QString("acOffline")] = cg.readEntry("acOffline", "( )");
|
||||
configuration[QString("checkUpdates")] = cg.readEntry("checkUpdates", "2");
|
||||
|
||||
// tooltip
|
||||
tooltipValues.clear();
|
||||
|
Loading…
Reference in New Issue
Block a user