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 configChanged(); | ||||
|     // update events | ||||
|     void updateText(); | ||||
|     void updateText(bool clear = false); | ||||
|     void updateTooltip(); | ||||
|  | ||||
| private slots: | ||||
|  | ||||
| @ -521,7 +521,7 @@ void AwesomeWidget::configChanged() | ||||
|     configuration[QString("upColor")] = cg.readEntry("upColor", "#ff00ff"); | ||||
|  | ||||
|     // appearance | ||||
|     configuration[QString("interval")] = cg.readEntry("interval", "100"); | ||||
|     configuration[QString("interval")] = cg.readEntry("interval", "1000"); | ||||
|     QString fontFamily = cg.readEntry("fontFamily", "Terminus"); | ||||
|     int fontSize = cg.readEntry("fontSize", 10); | ||||
|     QString fontColor = cg.readEntry("fontColor", "#000000"); | ||||
| @ -529,13 +529,13 @@ void AwesomeWidget::configChanged() | ||||
|     QString fontStyle = cg.readEntry("fontStyle", "normal"); | ||||
|     formatLine[0] = QString("<html><head><meta name=\"qrichtext\" content=\"1\" />\ | ||||
|     <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(QString::number(fontSize)) | ||||
|                 .arg(QString::number(fontWeight)) | ||||
|                 .arg(fontStyle) | ||||
|                 .arg(fontColor); | ||||
|     formatLine[1] = QString("</p></body></html>"); | ||||
|     formatLine[1] = QString("</pre></body></html>"); | ||||
|  | ||||
|     // counts | ||||
|     QMap<QString, QString> deSettings = readDataEngineConfiguration(); | ||||
|  | ||||
| @ -62,18 +62,20 @@ void AwesomeWidget::reinit() | ||||
|     values[QString("netdev")] = getNetworkDevice(); | ||||
| //    thread()->wait(60000); | ||||
|     connectToEngine(); | ||||
|     updateText(true); | ||||
|     resize(10, 10); | ||||
| } | ||||
|  | ||||
|  | ||||
| void AwesomeWidget::updateText() | ||||
| void AwesomeWidget::updateText(bool clear) | ||||
| { | ||||
|     if (debug) qDebug() << PDEBUG; | ||||
|  | ||||
|     QString text = configuration[QString("text")]; | ||||
|     for (int i=0; i<foundKeys.count(); i++) | ||||
|         text.replace(QString("$") + foundKeys[i] + QString("$"), values[foundKeys[i]]); | ||||
|     textLabel->setText(text); | ||||
|     if (!clear) | ||||
|         for (int i=0; i<foundKeys.count(); i++) | ||||
|             text.replace(QString("$") + foundKeys[i] + QString("$"), values[foundKeys[i]]); | ||||
|     textLabel->setText(formatLine[0] + text + formatLine[1]); | ||||
| } | ||||
|  | ||||
|  | ||||
|  | ||||
		Reference in New Issue
	
	Block a user