mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-15 06:45:48 +00:00
more pretty configuration interface
implement quotes changes
This commit is contained in:
@ -48,6 +48,12 @@ Item {
|
||||
text: AWActions.getAboutText("header")
|
||||
}
|
||||
|
||||
QtControls.Label {
|
||||
QtLayouts.Layout.fillWidth: true
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: AWActions.getAboutText("version")
|
||||
}
|
||||
|
||||
QtControls.Label {
|
||||
QtLayouts.Layout.fillWidth: true
|
||||
horizontalAlignment: Text.AlignJustify
|
||||
@ -62,9 +68,11 @@ Item {
|
||||
}
|
||||
|
||||
QtControls.Label {
|
||||
QtLayouts.Layout.fillHeight: true
|
||||
QtLayouts.Layout.fillWidth: true
|
||||
font.capitalization: Font.SmallCaps
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignBottom
|
||||
textFormat: Text.RichText
|
||||
text: AWActions.getAboutText("copy")
|
||||
}
|
||||
@ -83,8 +91,10 @@ Item {
|
||||
}
|
||||
|
||||
QtControls.Label {
|
||||
QtLayouts.Layout.fillHeight: true
|
||||
QtLayouts.Layout.fillWidth: true
|
||||
horizontalAlignment: Text.AlignJustify
|
||||
verticalAlignment: Text.AlignTop
|
||||
textFormat: Text.RichText
|
||||
text: AWActions.getAboutText("3rdparty")
|
||||
}
|
||||
|
@ -76,6 +76,7 @@ Item {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
QtControls.Button {
|
||||
width: parent.width * 3 / 12
|
||||
text: i18n("Font")
|
||||
iconName: "font"
|
||||
|
||||
@ -98,6 +99,7 @@ Item {
|
||||
}
|
||||
}
|
||||
QtControls.Button {
|
||||
width: parent.width / 12
|
||||
iconName: "format-indent-more"
|
||||
|
||||
onClicked: {
|
||||
@ -111,6 +113,7 @@ Item {
|
||||
}
|
||||
|
||||
QtControls.Button {
|
||||
width: parent.width / 12
|
||||
iconName: "format-text-bold"
|
||||
|
||||
onClicked: {
|
||||
@ -123,6 +126,7 @@ Item {
|
||||
}
|
||||
}
|
||||
QtControls.Button {
|
||||
width: parent.width / 12
|
||||
iconName: "format-text-italic"
|
||||
|
||||
onClicked: {
|
||||
@ -135,6 +139,7 @@ Item {
|
||||
}
|
||||
}
|
||||
QtControls.Button {
|
||||
width: parent.width / 12
|
||||
iconName: "format-text-underline"
|
||||
|
||||
onClicked: {
|
||||
@ -147,6 +152,7 @@ Item {
|
||||
}
|
||||
}
|
||||
QtControls.Button {
|
||||
width: parent.width / 12
|
||||
iconName: "format-text-strikethrough"
|
||||
|
||||
onClicked: {
|
||||
@ -160,6 +166,7 @@ Item {
|
||||
}
|
||||
|
||||
QtControls.Button {
|
||||
width: parent.width / 12
|
||||
iconName: "format-justify-left"
|
||||
|
||||
onClicked: {
|
||||
@ -172,6 +179,7 @@ Item {
|
||||
}
|
||||
}
|
||||
QtControls.Button {
|
||||
width: parent.width / 12
|
||||
iconName: "format-justify-center"
|
||||
|
||||
onClicked: {
|
||||
@ -184,6 +192,7 @@ Item {
|
||||
}
|
||||
}
|
||||
QtControls.Button {
|
||||
width: parent.width / 12
|
||||
iconName: "format-justify-right"
|
||||
|
||||
onClicked: {
|
||||
@ -196,6 +205,7 @@ Item {
|
||||
}
|
||||
}
|
||||
QtControls.Button {
|
||||
width: parent.width / 12
|
||||
iconName: "format-justify-fill"
|
||||
|
||||
onClicked: {
|
||||
|
@ -101,6 +101,8 @@ QString AWActions::getAboutText(const QString type)
|
||||
QString text;
|
||||
if (type == QString("header"))
|
||||
text = QString(NAME);
|
||||
else if (type == QString("version"))
|
||||
text = i18n("Version %1 (build date %2)", QString(VERSION), QString(BUILD_DATE));
|
||||
else if (type == QString("description"))
|
||||
text = i18n("A set of minimalistic plasmoid widgets");
|
||||
else if (type == QString("links"))
|
||||
|
@ -315,8 +315,14 @@ QStringList AWKeys::dictKeys(const bool sorted)
|
||||
// quotes
|
||||
for (int i=extQuotes.count()-1; i>=0; i--) {
|
||||
allKeys.append(extQuotes[i]->tag(QString("ask")));
|
||||
allKeys.append(extQuotes[i]->tag(QString("askchg")));
|
||||
allKeys.append(extQuotes[i]->tag(QString("percaskchg")));
|
||||
allKeys.append(extQuotes[i]->tag(QString("bid")));
|
||||
allKeys.append(extQuotes[i]->tag(QString("bidchg")));
|
||||
allKeys.append(extQuotes[i]->tag(QString("percbidchg")));
|
||||
allKeys.append(extQuotes[i]->tag(QString("price")));
|
||||
allKeys.append(extQuotes[i]->tag(QString("pricechg")));
|
||||
allKeys.append(extQuotes[i]->tag(QString("percpricechg")));
|
||||
}
|
||||
// custom
|
||||
for (int i=extScripts.count()-1; i>=0; i--)
|
||||
@ -560,7 +566,7 @@ bool AWKeys::setDataBySource(const QString sourceName, const QVariantMap data,
|
||||
values[QString("down%1").arg(i)] = QString("%1").arg(data[QString("value")].toFloat(), 4, 'f', 0);
|
||||
break;
|
||||
}
|
||||
if (device == networkDevice()) {
|
||||
if (device == values[QString("netdev")]) {
|
||||
values[QString("down")] = QString("%1").arg(data[QString("value")].toFloat(), 4, 'f', 0);
|
||||
if (toolTip != nullptr) toolTip->setData(QString("downTooltip"),
|
||||
data[QString("value")].toFloat());
|
||||
@ -575,7 +581,7 @@ bool AWKeys::setDataBySource(const QString sourceName, const QVariantMap data,
|
||||
values[QString("up%1").arg(i)] = QString("%1").arg(data[QString("value")].toFloat(), 4, 'f', 0);
|
||||
break;
|
||||
}
|
||||
if (device == networkDevice()) {
|
||||
if (device == values[QString("netdev")]) {
|
||||
values[QString("up")] = QString("%1").arg(data[QString("value")].toFloat(), 4, 'f', 0);
|
||||
if (toolTip != nullptr) toolTip->setData(QString("upTooltip"),
|
||||
data[QString("value")].toFloat());
|
||||
@ -716,11 +722,9 @@ QString AWKeys::infoByKey(QString key)
|
||||
if (extUpgrade[i]->tag() != key) continue;
|
||||
return extUpgrade[i]->executable();
|
||||
}
|
||||
else if ((key.startsWith(QString("ask"))) ||
|
||||
(key.startsWith(QString("bid"))) ||
|
||||
(key.startsWith(QString("price"))))
|
||||
else if (key.contains(QRegExp(QString("(^|perc)(ask|bid|price)(chg|)"))))
|
||||
for (int i=0; i<extQuotes.count(); i++) {
|
||||
if (extQuotes[i]->number() != key.remove(QRegExp(QString("^(ask|bid|price)"))).toInt()) continue;
|
||||
if (extQuotes[i]->number() != key.remove(QRegExp(QString("(^|perc)(ask|bid|price)(chg|)"))).toInt()) continue;
|
||||
return extQuotes[i]->ticker();
|
||||
}
|
||||
else if (key.startsWith(QString("temp")))
|
||||
@ -1300,25 +1304,6 @@ QString AWKeys::htmlValue(QString key)
|
||||
}
|
||||
|
||||
|
||||
QString AWKeys::networkDevice()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
|
||||
QString device = QString("lo");
|
||||
QList<QNetworkInterface> rawInterfaceList = QNetworkInterface::allInterfaces();
|
||||
for (int i=0; i<rawInterfaceList.count(); i++)
|
||||
if ((rawInterfaceList[i].flags().testFlag(QNetworkInterface::IsUp)) &&
|
||||
(!rawInterfaceList[i].flags().testFlag(QNetworkInterface::IsLoopBack)) &&
|
||||
(!rawInterfaceList[i].flags().testFlag(QNetworkInterface::IsPointToPoint))) {
|
||||
device = rawInterfaceList[i].name();
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
return device;
|
||||
}
|
||||
|
||||
|
||||
int AWKeys::numberCpus()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
|
@ -87,7 +87,6 @@ private:
|
||||
void addKeyToCache(const QString type, const QString key = QString(""));
|
||||
bool checkKeys(const QVariantMap data);
|
||||
QString htmlValue(QString key);
|
||||
QString networkDevice();
|
||||
int numberCpus();
|
||||
float temperature(const float temp, const QString units);
|
||||
// find methods
|
||||
|
Reference in New Issue
Block a user