mirror of
				https://github.com/arcan1s/awesome-widgets.git
				synced 2025-10-31 21:23:41 +00:00 
			
		
		
		
	commit before tests
This commit is contained in:
		| @ -60,7 +60,7 @@ public slots: | |||||||
|     void configAccepted(); |     void configAccepted(); | ||||||
|     void configChanged(); |     void configChanged(); | ||||||
|     // update events |     // update events | ||||||
|     void updateText(); |     void updateText(bool clear = false); | ||||||
|     void updateTooltip(); |     void updateTooltip(); | ||||||
|  |  | ||||||
| private slots: | private slots: | ||||||
|  | |||||||
| @ -521,7 +521,7 @@ void AwesomeWidget::configChanged() | |||||||
|     configuration[QString("upColor")] = cg.readEntry("upColor", "#ff00ff"); |     configuration[QString("upColor")] = cg.readEntry("upColor", "#ff00ff"); | ||||||
|  |  | ||||||
|     // appearance |     // appearance | ||||||
|     configuration[QString("interval")] = cg.readEntry("interval", "100"); |     configuration[QString("interval")] = cg.readEntry("interval", "1000"); | ||||||
|     QString fontFamily = cg.readEntry("fontFamily", "Terminus"); |     QString fontFamily = cg.readEntry("fontFamily", "Terminus"); | ||||||
|     int fontSize = cg.readEntry("fontSize", 10); |     int fontSize = cg.readEntry("fontSize", 10); | ||||||
|     QString fontColor = cg.readEntry("fontColor", "#000000"); |     QString fontColor = cg.readEntry("fontColor", "#000000"); | ||||||
| @ -529,13 +529,13 @@ void AwesomeWidget::configChanged() | |||||||
|     QString fontStyle = cg.readEntry("fontStyle", "normal"); |     QString fontStyle = cg.readEntry("fontStyle", "normal"); | ||||||
|     formatLine[0] = QString("<html><head><meta name=\"qrichtext\" content=\"1\" />\ |     formatLine[0] = QString("<html><head><meta name=\"qrichtext\" content=\"1\" />\ | ||||||
|     <style type=\"text/css\">p, li { white-space: pre-wrap; }</style>\ |     <style type=\"text/css\">p, li { white-space: pre-wrap; }</style>\ | ||||||
|     </head><body style=\"font-family:'%1'; font-size:%2pt; font-weight:%3; font-style:%4; color:%5;\"><p>") |     </head><body style=\"font-family:'%1'; font-size:%2pt; font-weight:%3; font-style:%4; color:%5;\"><pre>") | ||||||
|                 .arg(fontFamily) |                 .arg(fontFamily) | ||||||
|                 .arg(QString::number(fontSize)) |                 .arg(QString::number(fontSize)) | ||||||
|                 .arg(QString::number(fontWeight)) |                 .arg(QString::number(fontWeight)) | ||||||
|                 .arg(fontStyle) |                 .arg(fontStyle) | ||||||
|                 .arg(fontColor); |                 .arg(fontColor); | ||||||
|     formatLine[1] = QString("</p></body></html>"); |     formatLine[1] = QString("</pre></body></html>"); | ||||||
|  |  | ||||||
|     // counts |     // counts | ||||||
|     QMap<QString, QString> deSettings = readDataEngineConfiguration(); |     QMap<QString, QString> deSettings = readDataEngineConfiguration(); | ||||||
|  | |||||||
| @ -62,18 +62,20 @@ void AwesomeWidget::reinit() | |||||||
|     values[QString("netdev")] = getNetworkDevice(); |     values[QString("netdev")] = getNetworkDevice(); | ||||||
| //    thread()->wait(60000); | //    thread()->wait(60000); | ||||||
|     connectToEngine(); |     connectToEngine(); | ||||||
|  |     updateText(true); | ||||||
|     resize(10, 10); |     resize(10, 10); | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| void AwesomeWidget::updateText() | void AwesomeWidget::updateText(bool clear) | ||||||
| { | { | ||||||
|     if (debug) qDebug() << PDEBUG; |     if (debug) qDebug() << PDEBUG; | ||||||
|  |  | ||||||
|     QString text = configuration[QString("text")]; |     QString text = configuration[QString("text")]; | ||||||
|     for (int i=0; i<foundKeys.count(); i++) |     if (!clear) | ||||||
|         text.replace(QString("$") + foundKeys[i] + QString("$"), values[foundKeys[i]]); |         for (int i=0; i<foundKeys.count(); i++) | ||||||
|     textLabel->setText(text); |             text.replace(QString("$") + foundKeys[i] + QString("$"), values[foundKeys[i]]); | ||||||
|  |     textLabel->setText(formatLine[0] + text + formatLine[1]); | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user