mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-15 06:45:48 +00:00
* move isDebugEnabled method to AWActions
* add "Drop key cache" button
This commit is contained in:
@ -24,9 +24,6 @@ import org.kde.plasma.private.awesomewidget 1.0
|
||||
|
||||
Item {
|
||||
id: aboutPage
|
||||
AWKeys {
|
||||
id: awKeys;
|
||||
}
|
||||
AWActions {
|
||||
id: awActions;
|
||||
}
|
||||
@ -36,7 +33,7 @@ Item {
|
||||
implicitWidth: pageColumn.implicitWidth
|
||||
implicitHeight: pageColumn.implicitHeight
|
||||
|
||||
property bool debug: awKeys.isDebugEnabled()
|
||||
property bool debug: awActions.isDebugEnabled()
|
||||
|
||||
|
||||
Column {
|
||||
|
@ -24,8 +24,8 @@ import org.kde.plasma.private.awesomewidget 1.0
|
||||
Item {
|
||||
id: advancedPage
|
||||
// backend
|
||||
AWKeys {
|
||||
id: awKeys;
|
||||
AWActions {
|
||||
id: awActions;
|
||||
}
|
||||
|
||||
width: childrenRect.width
|
||||
@ -33,7 +33,7 @@ Item {
|
||||
implicitWidth: pageColumn.implicitWidth
|
||||
implicitHeight: pageColumn.implicitHeight
|
||||
|
||||
property bool debug: awKeys.isDebugEnabled()
|
||||
property bool debug: awActions.isDebugEnabled()
|
||||
|
||||
property alias cfg_height: widgetHeight.value
|
||||
property alias cfg_width: widgetWidth.value
|
||||
@ -254,6 +254,24 @@ Item {
|
||||
text: plasmoid.configuration.acOffline
|
||||
}
|
||||
}
|
||||
|
||||
Row {
|
||||
height: implicitHeight
|
||||
width: parent.width
|
||||
QtControls.Label {
|
||||
height: parent.height
|
||||
width: parent.width * 2 / 5
|
||||
// horizontalAlignment: Text.AlignRight
|
||||
// verticalAlignment: Text.AlignVCenter
|
||||
// text: i18n("Font")
|
||||
}
|
||||
QtControls.Button {
|
||||
id: selectFont
|
||||
width: parent.width * 3 / 5
|
||||
text: i18n("Drop key cache")
|
||||
onClicked: awActions.dropCache()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
|
@ -26,8 +26,8 @@ import org.kde.plasma.private.awesomewidget 1.0
|
||||
Item {
|
||||
id: appearancePage
|
||||
// backend
|
||||
AWKeys {
|
||||
id: awKeys;
|
||||
AWActions {
|
||||
id: awActions;
|
||||
}
|
||||
|
||||
width: childrenRect.width
|
||||
@ -35,7 +35,7 @@ Item {
|
||||
implicitWidth: pageColumn.implicitWidth
|
||||
implicitHeight: pageColumn.implicitHeight
|
||||
|
||||
property bool debug: awKeys.isDebugEnabled()
|
||||
property bool debug: awActions.isDebugEnabled()
|
||||
property variant weight: {
|
||||
25: 0,
|
||||
50: 1,
|
||||
|
@ -39,7 +39,7 @@ Item {
|
||||
implicitWidth: pageColumn.implicitWidth
|
||||
implicitHeight: pageColumn.implicitHeight
|
||||
|
||||
property bool debug: awKeys.isDebugEnabled()
|
||||
property bool debug: awActions.isDebugEnabled()
|
||||
property variant tooltipSettings: {
|
||||
"tooltipNumber": plasmoid.configuration.tooltipNumber,
|
||||
"useTooltipBackground": plasmoid.configuration.useTooltipBackground,
|
||||
|
@ -36,7 +36,7 @@ Item {
|
||||
id: awActions;
|
||||
}
|
||||
|
||||
property bool debug: awKeys.isDebugEnabled()
|
||||
property bool debug: awActions.isDebugEnabled()
|
||||
property variant settings: {
|
||||
"customTime": plasmoid.configuration.customTime,
|
||||
"customUptime": plasmoid.configuration.customUptime,
|
||||
|
@ -26,8 +26,8 @@ import org.kde.plasma.private.awesomewidget 1.0
|
||||
Item {
|
||||
id: tooltipPage
|
||||
// backend
|
||||
AWKeys {
|
||||
id: awKeys;
|
||||
AWActions {
|
||||
id: awActions;
|
||||
}
|
||||
|
||||
width: childrenRect.width
|
||||
@ -35,7 +35,7 @@ Item {
|
||||
implicitWidth: pageColumn.implicitWidth
|
||||
implicitHeight: pageColumn.implicitHeight
|
||||
|
||||
property bool debug: awKeys.isDebugEnabled()
|
||||
property bool debug: awActions.isDebugEnabled()
|
||||
|
||||
property alias cfg_tooltipNumber: tooltipNumber.value
|
||||
property alias cfg_useTooltipBackground: useTooltipBackground.checked
|
||||
|
@ -37,7 +37,7 @@ Item {
|
||||
implicitWidth: pageColumn.implicitWidth
|
||||
implicitHeight: pageColumn.implicitHeight
|
||||
|
||||
property bool debug: awKeys.isDebugEnabled()
|
||||
property bool debug: awActions.isDebugEnabled()
|
||||
property variant settings: {
|
||||
"customTime": plasmoid.configuration.customTime,
|
||||
"customUptime": plasmoid.configuration.customUptime,
|
||||
|
@ -67,6 +67,25 @@ void AWActions::checkUpdates()
|
||||
}
|
||||
|
||||
|
||||
bool AWActions::dropCache()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
|
||||
QString fileName = QString("%1/awesomewidgets.ndx")
|
||||
.arg(QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation));
|
||||
|
||||
return QFile(fileName).remove();
|
||||
}
|
||||
|
||||
|
||||
bool AWActions::isDebugEnabled()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
|
||||
void AWActions::runCmd(const QString cmd)
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
|
@ -35,6 +35,8 @@ public:
|
||||
~AWActions();
|
||||
|
||||
Q_INVOKABLE void checkUpdates();
|
||||
Q_INVOKABLE bool dropCache();
|
||||
Q_INVOKABLE bool isDebugEnabled();
|
||||
Q_INVOKABLE void runCmd(const QString cmd = QString("/usr/bin/true"));
|
||||
Q_INVOKABLE void sendEmail();
|
||||
Q_INVOKABLE void showReadme();
|
||||
|
@ -136,14 +136,6 @@ void AWKeys::setWrapNewLines(const bool wrap)
|
||||
}
|
||||
|
||||
|
||||
bool AWKeys::isDebugEnabled()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
|
||||
return debug;
|
||||
}
|
||||
|
||||
|
||||
QString AWKeys::parsePattern()
|
||||
{
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
@ -799,7 +791,7 @@ void AWKeys::loadKeysFromCache()
|
||||
if (debug) qDebug() << PDEBUG;
|
||||
|
||||
QString fileName = QString("%1/awesomewidgets.ndx")
|
||||
.arg(QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation));
|
||||
.arg(QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation));
|
||||
if (debug) qDebug() << PDEBUG << ":" << "Cache file" << fileName;
|
||||
QSettings cache(fileName, QSettings::IniFormat);
|
||||
QStringList cachedKeys;
|
||||
|
@ -55,7 +55,6 @@ public:
|
||||
Q_INVOKABLE void initTooltip(const QVariantMap tooltipParams);
|
||||
Q_INVOKABLE void setPopupEnabled(const bool popup = false);
|
||||
Q_INVOKABLE void setWrapNewLines(const bool wrap = false);
|
||||
Q_INVOKABLE bool isDebugEnabled();
|
||||
Q_INVOKABLE QString parsePattern();
|
||||
Q_INVOKABLE QSize toolTipSize();
|
||||
// keys
|
||||
|
Reference in New Issue
Block a user