mirror of
				https://github.com/arcan1s/awesome-widgets.git
				synced 2025-11-03 22:33:42 +00:00 
			
		
		
		
	fix library translations
This commit is contained in:
		@ -3,20 +3,13 @@ set (SUBPROJECT ${PROJECT_LIBRARY})
 | 
				
			|||||||
message (STATUS "Subproject ${SUBPROJECT}")
 | 
					message (STATUS "Subproject ${SUBPROJECT}")
 | 
				
			||||||
add_definitions(-DTRANSLATION_DOMAIN=\"plasma_applet_org.kde.plasma.awesomewidget\")
 | 
					add_definitions(-DTRANSLATION_DOMAIN=\"plasma_applet_org.kde.plasma.awesomewidget\")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# find required libaries
 | 
					 | 
				
			||||||
find_package (Qt5 REQUIRED COMPONENTS Core Network Widgets)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
add_definitions (${Qt5Core_DEFINITIONS} ${Qt5DBus_DEFINITIONS}
 | 
					 | 
				
			||||||
                 ${Qt5Network_DEFINITIONS} ${Qt5Widgets_DEFINITIONS})
 | 
					 | 
				
			||||||
set (Qt_INCLUDE ${Qt5Core_INCLUDE_DIRS} ${Qt5DBus_INCLUDE_DIRS}
 | 
					 | 
				
			||||||
                ${Qt5Network_INCLUDE_DIRS} ${Qt5Widgets_INCLUDE_DIRS})
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
include_directories (${CMAKE_SOURCE_DIR}
 | 
					include_directories (${CMAKE_SOURCE_DIR}
 | 
				
			||||||
                     ${CMAKE_BINARY_DIR}
 | 
					                     ${CMAKE_BINARY_DIR}
 | 
				
			||||||
                     ${CMAKE_CURRENT_BINARY_DIR}
 | 
					                     ${CMAKE_CURRENT_BINARY_DIR}
 | 
				
			||||||
                     ${CMAKE_CURRENT_BINARY_DIR}/../
 | 
					                     ${CMAKE_CURRENT_BINARY_DIR}/../
 | 
				
			||||||
                     ${PROJECT_TRDPARTY_DIR}
 | 
					                     ${PROJECT_TRDPARTY_DIR}
 | 
				
			||||||
                     ${Qt_INCLUDE})
 | 
					                     ${Qt_INCLUDE}
 | 
				
			||||||
 | 
					                     ${Kf5_INCLUDE})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
file (GLOB_RECURSE SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/qreplytimeout/*.cpp)
 | 
					file (GLOB_RECURSE SUBPROJECT_SOURCE *.cpp ${PROJECT_TRDPARTY_DIR}/qreplytimeout/*.cpp)
 | 
				
			||||||
file (GLOB SUBPROJECT_HEADER *.h ${PROJECT_TRDPARTY_DIR}/qreplytimeout/*.h)
 | 
					file (GLOB SUBPROJECT_HEADER *.h ${PROJECT_TRDPARTY_DIR}/qreplytimeout/*.h)
 | 
				
			||||||
@ -32,11 +25,11 @@ qt5_wrap_cpp (SUBPROJECT_MOC_SOURCE ${SUBPROJECT_HEADER})
 | 
				
			|||||||
qt5_wrap_ui (SUBPROJECT_UI_HEADER ${SUBPROJECT_UI})
 | 
					qt5_wrap_ui (SUBPROJECT_UI_HEADER ${SUBPROJECT_UI})
 | 
				
			||||||
add_library (${SUBPROJECT} STATIC ${SUBPROJECT_SOURCE} ${SUBPROJECT_MOC_SOURCE}
 | 
					add_library (${SUBPROJECT} STATIC ${SUBPROJECT_SOURCE} ${SUBPROJECT_MOC_SOURCE}
 | 
				
			||||||
                                  ${SUBPROJECT_HEADER} ${SUBPROJECT_UI_HEADER})
 | 
					                                  ${SUBPROJECT_HEADER} ${SUBPROJECT_UI_HEADER})
 | 
				
			||||||
target_link_libraries (${SUBPROJECT} ${Qt5Core_LIBRARIES} ${Qt5Network_LIBRARIES} ${Qt5Widgets_LIBRARIES})
 | 
					target_link_libraries (${SUBPROJECT} ${Qt_LIBRARIES} ${Kf5_LIBRARIES})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# install
 | 
					# install
 | 
				
			||||||
install (DIRECTORY ${SUBPROJECT_GRAPHITEMS} DESTINATION share/${PROJECT_NAME})
 | 
					install (DIRECTORY ${SUBPROJECT_GRAPHITEMS} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME})
 | 
				
			||||||
install (DIRECTORY ${SUBPROJECT_QUOTES} DESTINATION share/${PROJECT_NAME})
 | 
					install (DIRECTORY ${SUBPROJECT_QUOTES} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME})
 | 
				
			||||||
install (DIRECTORY ${SUBPROJECT_SCRIPTS} DESTINATION share/${PROJECT_NAME})
 | 
					install (DIRECTORY ${SUBPROJECT_SCRIPTS} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME})
 | 
				
			||||||
install (DIRECTORY ${SUBPROJECT_UPGRADE} DESTINATION share/${PROJECT_NAME})
 | 
					install (DIRECTORY ${SUBPROJECT_UPGRADE} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME})
 | 
				
			||||||
install (DIRECTORY ${SUBPROJECT_WEATHER} DESTINATION share/${PROJECT_NAME})
 | 
					install (DIRECTORY ${SUBPROJECT_WEATHER} DESTINATION ${DATA_INSTALL_DIR}/${PROJECT_NAME})
 | 
				
			||||||
 | 
				
			|||||||
@ -72,6 +72,7 @@ private:
 | 
				
			|||||||
    QString m_fileName;
 | 
					    QString m_fileName;
 | 
				
			||||||
    QStringList m_dirs;
 | 
					    QStringList m_dirs;
 | 
				
			||||||
    bool debug;
 | 
					    bool debug;
 | 
				
			||||||
 | 
					    virtual void translate() = 0;
 | 
				
			||||||
    // properties
 | 
					    // properties
 | 
				
			||||||
    int m_apiVersion = 0;
 | 
					    int m_apiVersion = 0;
 | 
				
			||||||
    bool m_active = true;
 | 
					    bool m_active = true;
 | 
				
			||||||
 | 
				
			|||||||
@ -17,6 +17,8 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
#include "abstractextitemaggregator.h"
 | 
					#include "abstractextitemaggregator.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <KI18n/KLocalizedString>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QDebug>
 | 
					#include <QDebug>
 | 
				
			||||||
#include <QHBoxLayout>
 | 
					#include <QHBoxLayout>
 | 
				
			||||||
#include <QInputDialog>
 | 
					#include <QInputDialog>
 | 
				
			||||||
@ -33,9 +35,9 @@ AbstractExtItemAggregator::AbstractExtItemAggregator(QWidget *parent, const bool
 | 
				
			|||||||
    widgetDialog = new QListWidget(dialog);
 | 
					    widgetDialog = new QListWidget(dialog);
 | 
				
			||||||
    dialogButtons = new QDialogButtonBox(QDialogButtonBox::Open | QDialogButtonBox::Close,
 | 
					    dialogButtons = new QDialogButtonBox(QDialogButtonBox::Open | QDialogButtonBox::Close,
 | 
				
			||||||
                                         Qt::Vertical, dialog);
 | 
					                                         Qt::Vertical, dialog);
 | 
				
			||||||
    copyButton = dialogButtons->addButton(tr("Copy"), QDialogButtonBox::ActionRole);
 | 
					    copyButton = dialogButtons->addButton(i18n("Copy"), QDialogButtonBox::ActionRole);
 | 
				
			||||||
    createButton = dialogButtons->addButton(tr("Create"), QDialogButtonBox::ActionRole);
 | 
					    createButton = dialogButtons->addButton(i18n("Create"), QDialogButtonBox::ActionRole);
 | 
				
			||||||
    deleteButton = dialogButtons->addButton(tr("Remove"), QDialogButtonBox::ActionRole);
 | 
					    deleteButton = dialogButtons->addButton(i18n("Remove"), QDialogButtonBox::ActionRole);
 | 
				
			||||||
    QHBoxLayout *layout = new QHBoxLayout(dialog);
 | 
					    QHBoxLayout *layout = new QHBoxLayout(dialog);
 | 
				
			||||||
    layout->addWidget(widgetDialog);
 | 
					    layout->addWidget(widgetDialog);
 | 
				
			||||||
    layout->addWidget(dialogButtons);
 | 
					    layout->addWidget(dialogButtons);
 | 
				
			||||||
@ -62,8 +64,8 @@ QString AbstractExtItemAggregator::getName()
 | 
				
			|||||||
    if (debug) qDebug() << PDEBUG;
 | 
					    if (debug) qDebug() << PDEBUG;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    bool ok;
 | 
					    bool ok;
 | 
				
			||||||
    QString name = QInputDialog::getText(this, tr("Enter file name"),
 | 
					    QString name = QInputDialog::getText(this, i18n("Enter file name"),
 | 
				
			||||||
                                         tr("File name"), QLineEdit::Normal,
 | 
					                                         i18n("File name"), QLineEdit::Normal,
 | 
				
			||||||
                                         QString(""), &ok);
 | 
					                                         QString(""), &ok);
 | 
				
			||||||
    if ((!ok) || (name.isEmpty())) return QString("");
 | 
					    if ((!ok) || (name.isEmpty())) return QString("");
 | 
				
			||||||
    if (!name.endsWith(QString(".desktop"))) name += QString(".desktop");
 | 
					    if (!name.endsWith(QString(".desktop"))) name += QString(".desktop");
 | 
				
			||||||
 | 
				
			|||||||
@ -26,6 +26,7 @@
 | 
				
			|||||||
#include <QWidget>
 | 
					#include <QWidget>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// additinal class since QObject macro does not allow class templates
 | 
				
			||||||
class AbstractExtItemAggregator : public QWidget
 | 
					class AbstractExtItemAggregator : public QWidget
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    Q_OBJECT
 | 
					    Q_OBJECT
 | 
				
			||||||
 | 
				
			|||||||
@ -18,6 +18,8 @@
 | 
				
			|||||||
#ifndef EXTITEMAGGREGATOR_H
 | 
					#ifndef EXTITEMAGGREGATOR_H
 | 
				
			||||||
#define EXTITEMAGGREGATOR_H
 | 
					#define EXTITEMAGGREGATOR_H
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <KI18n/KLocalizedString>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QDebug>
 | 
					#include <QDebug>
 | 
				
			||||||
#include <QDir>
 | 
					#include <QDir>
 | 
				
			||||||
#include <QSettings>
 | 
					#include <QSettings>
 | 
				
			||||||
@ -146,9 +148,9 @@ private:
 | 
				
			|||||||
        for (int i=0; i<m_items.count(); i++) {
 | 
					        for (int i=0; i<m_items.count(); i++) {
 | 
				
			||||||
            QListWidgetItem *item = new QListWidgetItem(m_items[i]->fileName(), widgetDialog);
 | 
					            QListWidgetItem *item = new QListWidgetItem(m_items[i]->fileName(), widgetDialog);
 | 
				
			||||||
            QStringList tooltip;
 | 
					            QStringList tooltip;
 | 
				
			||||||
            tooltip.append(tr("Name: %1").arg(m_items[i]->name()));
 | 
					            tooltip.append(i18n("Name: %1", m_items[i]->name()));
 | 
				
			||||||
            tooltip.append(tr("Comment: %1").arg(m_items[i]->comment()));
 | 
					            tooltip.append(i18n("Comment: %1", m_items[i]->comment()));
 | 
				
			||||||
            tooltip.append(tr("Identity: %1").arg(m_items[i]->uniq()));
 | 
					            tooltip.append(i18n("Identity: %1", m_items[i]->uniq()));
 | 
				
			||||||
            item->setToolTip(tooltip.join(QChar('\n')));
 | 
					            item->setToolTip(tooltip.join(QChar('\n')));
 | 
				
			||||||
            widgetDialog->addItem(item);
 | 
					            widgetDialog->addItem(item);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
				
			|||||||
@ -18,6 +18,8 @@
 | 
				
			|||||||
#include "extquotes.h"
 | 
					#include "extquotes.h"
 | 
				
			||||||
#include "ui_extquotes.h"
 | 
					#include "ui_extquotes.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <KI18n/KLocalizedString>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QDebug>
 | 
					#include <QDebug>
 | 
				
			||||||
#include <QDir>
 | 
					#include <QDir>
 | 
				
			||||||
#include <QJsonDocument>
 | 
					#include <QJsonDocument>
 | 
				
			||||||
@ -40,6 +42,7 @@ ExtQuotes::ExtQuotes(QWidget *parent, const QString quotesName,
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    readConfiguration();
 | 
					    readConfiguration();
 | 
				
			||||||
    ui->setupUi(this);
 | 
					    ui->setupUi(this);
 | 
				
			||||||
 | 
					    translate();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    values[QString("ask")] = 0.0;
 | 
					    values[QString("ask")] = 0.0;
 | 
				
			||||||
    values[QString("askchg")] = 0.0;
 | 
					    values[QString("askchg")] = 0.0;
 | 
				
			||||||
@ -237,6 +240,20 @@ void ExtQuotes::quotesReplyReceived(QNetworkReply *reply)
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void ExtQuotes::translate()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    if (debug) qDebug() << PDEBUG;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ui->label_name->setText(i18n("Name"));
 | 
				
			||||||
 | 
					    ui->label_comment->setText(i18n("Comment"));
 | 
				
			||||||
 | 
					    ui->label_number->setText(i18n("Tag"));
 | 
				
			||||||
 | 
					    ui->label->setText(i18n("<html><head/><body><p>Use YAHOO! finance ticker to get quotes for the instrument. Refer to <a href=\"http://finance.yahoo.com/\"><span style=\" text-decoration: underline; color:#0057ae;\">http://finance.yahoo.com/</span></a></p></body></html>"));
 | 
				
			||||||
 | 
					    ui->label_ticker->setText(i18n("Ticker"));
 | 
				
			||||||
 | 
					    ui->checkBox_active->setText(i18n("Active"));
 | 
				
			||||||
 | 
					    ui->label_interval->setText(i18n("Interval"));
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
QString ExtQuotes::url() const
 | 
					QString ExtQuotes::url() const
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    if (debug) qDebug() << PDEBUG;
 | 
					    if (debug) qDebug() << PDEBUG;
 | 
				
			||||||
 | 
				
			|||||||
@ -61,6 +61,7 @@ private:
 | 
				
			|||||||
    QNetworkAccessManager *manager;
 | 
					    QNetworkAccessManager *manager;
 | 
				
			||||||
    bool isRunning = false;
 | 
					    bool isRunning = false;
 | 
				
			||||||
    Ui::ExtQuotes *ui;
 | 
					    Ui::ExtQuotes *ui;
 | 
				
			||||||
 | 
					    void translate();
 | 
				
			||||||
    QString url() const;
 | 
					    QString url() const;
 | 
				
			||||||
    // properties
 | 
					    // properties
 | 
				
			||||||
    QString m_ticker = QString("EURUSD=X");
 | 
					    QString m_ticker = QString("EURUSD=X");
 | 
				
			||||||
 | 
				
			|||||||
@ -18,6 +18,8 @@
 | 
				
			|||||||
#include "extscript.h"
 | 
					#include "extscript.h"
 | 
				
			||||||
#include "ui_extscript.h"
 | 
					#include "ui_extscript.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <KI18n/KLocalizedString>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QDebug>
 | 
					#include <QDebug>
 | 
				
			||||||
#include <QDir>
 | 
					#include <QDir>
 | 
				
			||||||
#include <QJsonDocument>
 | 
					#include <QJsonDocument>
 | 
				
			||||||
@ -40,6 +42,7 @@ ExtScript::ExtScript(QWidget *parent, const QString scriptName,
 | 
				
			|||||||
    readConfiguration();
 | 
					    readConfiguration();
 | 
				
			||||||
    readJsonFilters();
 | 
					    readJsonFilters();
 | 
				
			||||||
    ui->setupUi(this);
 | 
					    ui->setupUi(this);
 | 
				
			||||||
 | 
					    translate();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    value[QString("value")] = QString("");
 | 
					    value[QString("value")] = QString("");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -407,3 +410,23 @@ void ExtScript::updateValue()
 | 
				
			|||||||
    // filters
 | 
					    // filters
 | 
				
			||||||
    value[QString("value")] = applyFilters(value[QString("value")].toString());
 | 
					    value[QString("value")] = applyFilters(value[QString("value")].toString());
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void ExtScript::translate()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    if (debug) qDebug() << PDEBUG;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ui->label_name->setText(i18n("Name"));
 | 
				
			||||||
 | 
					    ui->label_comment->setText(i18n("Comment"));
 | 
				
			||||||
 | 
					    ui->label_number->setText(i18n("Tag"));
 | 
				
			||||||
 | 
					    ui->label_command->setText(i18n("Command"));
 | 
				
			||||||
 | 
					    ui->label_prefix->setText(i18n("Prefix"));
 | 
				
			||||||
 | 
					    ui->checkBox_active->setText(i18n("Active"));
 | 
				
			||||||
 | 
					    ui->checkBox_output->setText(i18n("Has output"));
 | 
				
			||||||
 | 
					    ui->label_redirect->setText(i18n("Redirect"));
 | 
				
			||||||
 | 
					    ui->label_interval->setText(i18n("Interval"));
 | 
				
			||||||
 | 
					    ui->groupBox_filters->setTitle(i18n("Additional filters"));
 | 
				
			||||||
 | 
					    ui->checkBox_colorFilter->setText(i18n("Wrap colors"));
 | 
				
			||||||
 | 
					    ui->checkBox_linesFilter->setText(i18n("Wrap new lines"));
 | 
				
			||||||
 | 
					    ui->checkBox_spaceFilter->setText(i18n("Wrap spaces"));
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -83,6 +83,7 @@ private:
 | 
				
			|||||||
    bool debug;
 | 
					    bool debug;
 | 
				
			||||||
    QProcess *process = nullptr;
 | 
					    QProcess *process = nullptr;
 | 
				
			||||||
    Ui::ExtScript *ui;
 | 
					    Ui::ExtScript *ui;
 | 
				
			||||||
 | 
					    void translate();
 | 
				
			||||||
    // properties
 | 
					    // properties
 | 
				
			||||||
    QString m_executable = QString("/usr/bin/true");
 | 
					    QString m_executable = QString("/usr/bin/true");
 | 
				
			||||||
    QStringList m_filters = QStringList();
 | 
					    QStringList m_filters = QStringList();
 | 
				
			||||||
 | 
				
			|||||||
@ -18,6 +18,8 @@
 | 
				
			|||||||
#include "extupgrade.h"
 | 
					#include "extupgrade.h"
 | 
				
			||||||
#include "ui_extupgrade.h"
 | 
					#include "ui_extupgrade.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <KI18n/KLocalizedString>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QDebug>
 | 
					#include <QDebug>
 | 
				
			||||||
#include <QDir>
 | 
					#include <QDir>
 | 
				
			||||||
#include <QSettings>
 | 
					#include <QSettings>
 | 
				
			||||||
@ -36,6 +38,7 @@ ExtUpgrade::ExtUpgrade(QWidget *parent, const QString upgradeName,
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    readConfiguration();
 | 
					    readConfiguration();
 | 
				
			||||||
    ui->setupUi(this);
 | 
					    ui->setupUi(this);
 | 
				
			||||||
 | 
					    translate();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    value[QString("value")] = 0;
 | 
					    value[QString("value")] = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -211,3 +214,17 @@ void ExtUpgrade::updateValue()
 | 
				
			|||||||
    QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process->readAllStandardOutput()).trimmed();
 | 
					    QString qoutput = QTextCodec::codecForMib(106)->toUnicode(process->readAllStandardOutput()).trimmed();
 | 
				
			||||||
    value[QString("value")] = qoutput.split(QChar('\n'), QString::SkipEmptyParts).count() - m_null;
 | 
					    value[QString("value")] = qoutput.split(QChar('\n'), QString::SkipEmptyParts).count() - m_null;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void ExtUpgrade::translate()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    if (debug) qDebug() << PDEBUG;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ui->label_name->setText(i18n("Name"));
 | 
				
			||||||
 | 
					    ui->label_comment->setText(i18n("Comment"));
 | 
				
			||||||
 | 
					    ui->label_number->setText(i18n("Tag"));
 | 
				
			||||||
 | 
					    ui->label_command->setText(i18n("Command"));
 | 
				
			||||||
 | 
					    ui->checkBox_active->setText(i18n("Active"));
 | 
				
			||||||
 | 
					    ui->label_null->setText(i18n("Null"));
 | 
				
			||||||
 | 
					    ui->label_interval->setText(i18n("Interval"));
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -60,6 +60,7 @@ private:
 | 
				
			|||||||
    bool debug;
 | 
					    bool debug;
 | 
				
			||||||
    QProcess *process = nullptr;
 | 
					    QProcess *process = nullptr;
 | 
				
			||||||
    Ui::ExtUpgrade *ui;
 | 
					    Ui::ExtUpgrade *ui;
 | 
				
			||||||
 | 
					    void translate();
 | 
				
			||||||
    // properties
 | 
					    // properties
 | 
				
			||||||
    QString m_executable = QString("/usr/bin/true");
 | 
					    QString m_executable = QString("/usr/bin/true");
 | 
				
			||||||
    int m_null = 0;
 | 
					    int m_null = 0;
 | 
				
			||||||
 | 
				
			|||||||
@ -18,6 +18,8 @@
 | 
				
			|||||||
#include "extweather.h"
 | 
					#include "extweather.h"
 | 
				
			||||||
#include "ui_extweather.h"
 | 
					#include "ui_extweather.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <KI18n/KLocalizedString>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QDebug>
 | 
					#include <QDebug>
 | 
				
			||||||
#include <QDir>
 | 
					#include <QDir>
 | 
				
			||||||
#include <QJsonDocument>
 | 
					#include <QJsonDocument>
 | 
				
			||||||
@ -40,6 +42,7 @@ ExtWeather::ExtWeather(QWidget *parent, const QString weatherName,
 | 
				
			|||||||
{
 | 
					{
 | 
				
			||||||
    readConfiguration();
 | 
					    readConfiguration();
 | 
				
			||||||
    ui->setupUi(this);
 | 
					    ui->setupUi(this);
 | 
				
			||||||
 | 
					    translate();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    values[QString("weatherId")] = 0;
 | 
					    values[QString("weatherId")] = 0;
 | 
				
			||||||
    values[QString("weather")] = QString("");
 | 
					    values[QString("weather")] = QString("");
 | 
				
			||||||
@ -398,6 +401,21 @@ QVariantMap ExtWeather::parseSingleJson(const QVariantMap json) const
 | 
				
			|||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void ExtWeather::translate()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    if (debug) qDebug() << PDEBUG;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ui->label_name->setText(i18n("Name"));
 | 
				
			||||||
 | 
					    ui->label_comment->setText(i18n("Comment"));
 | 
				
			||||||
 | 
					    ui->label_number->setText(i18n("Tag"));
 | 
				
			||||||
 | 
					    ui->label_city->setText(i18n("City"));
 | 
				
			||||||
 | 
					    ui->label_country->setText(i18n("Country"));
 | 
				
			||||||
 | 
					    ui->label_timestamp->setText(i18n("Timestamp"));
 | 
				
			||||||
 | 
					    ui->checkBox_active->setText(i18n("Active"));
 | 
				
			||||||
 | 
					    ui->label_interval->setText(i18n("Interval"));
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
QString ExtWeather::url(const bool isForecast) const
 | 
					QString ExtWeather::url(const bool isForecast) const
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    if (debug) qDebug() << PDEBUG;
 | 
					    if (debug) qDebug() << PDEBUG;
 | 
				
			||||||
 | 
				
			|||||||
@ -70,6 +70,7 @@ private:
 | 
				
			|||||||
    bool isRunning = false;
 | 
					    bool isRunning = false;
 | 
				
			||||||
    Ui::ExtWeather *ui;
 | 
					    Ui::ExtWeather *ui;
 | 
				
			||||||
    QVariantMap parseSingleJson(const QVariantMap json) const;
 | 
					    QVariantMap parseSingleJson(const QVariantMap json) const;
 | 
				
			||||||
 | 
					    void translate();
 | 
				
			||||||
    QString url(const bool isForecast = false) const;
 | 
					    QString url(const bool isForecast = false) const;
 | 
				
			||||||
    // properties
 | 
					    // properties
 | 
				
			||||||
    QString m_city = QString("London");
 | 
					    QString m_city = QString("London");
 | 
				
			||||||
 | 
				
			|||||||
@ -18,6 +18,8 @@
 | 
				
			|||||||
#include "graphicalitem.h"
 | 
					#include "graphicalitem.h"
 | 
				
			||||||
#include "ui_graphicalitem.h"
 | 
					#include "ui_graphicalitem.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#include <KI18n/KLocalizedString>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QBuffer>
 | 
					#include <QBuffer>
 | 
				
			||||||
#include <QColorDialog>
 | 
					#include <QColorDialog>
 | 
				
			||||||
#include <QDebug>
 | 
					#include <QDebug>
 | 
				
			||||||
@ -39,8 +41,9 @@ GraphicalItem::GraphicalItem(QWidget *parent, const QString desktopName,
 | 
				
			|||||||
      ui(new Ui::GraphicalItem)
 | 
					      ui(new Ui::GraphicalItem)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
    readConfiguration();
 | 
					    readConfiguration();
 | 
				
			||||||
 | 
					 | 
				
			||||||
    ui->setupUi(this);
 | 
					    ui->setupUi(this);
 | 
				
			||||||
 | 
					    translate();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    connect(ui->pushButton_activeColor, SIGNAL(clicked()), this, SLOT(changeColor()));
 | 
					    connect(ui->pushButton_activeColor, SIGNAL(clicked()), this, SLOT(changeColor()));
 | 
				
			||||||
    connect(ui->pushButton_inactiveColor, SIGNAL(clicked()), this, SLOT(changeColor()));
 | 
					    connect(ui->pushButton_inactiveColor, SIGNAL(clicked()), this, SLOT(changeColor()));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@ -491,3 +494,19 @@ QColor GraphicalItem::stringToColor(const QString _color) const
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    return qcolor;
 | 
					    return qcolor;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					void GraphicalItem::translate()
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    if (debug) qDebug() << PDEBUG;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    ui->label_name->setText(i18n("Name"));
 | 
				
			||||||
 | 
					    ui->label_comment->setText(i18n("Comment"));
 | 
				
			||||||
 | 
					    ui->label_value->setText(i18n("Value"));
 | 
				
			||||||
 | 
					    ui->label_activeColor->setText(i18n("Active color"));
 | 
				
			||||||
 | 
					    ui->label_inactiveColor->setText(i18n("Inactive color"));
 | 
				
			||||||
 | 
					    ui->label_type->setText(i18n("Type"));
 | 
				
			||||||
 | 
					    ui->label_direction->setText(i18n("Direction"));
 | 
				
			||||||
 | 
					    ui->label_height->setText(i18n("Height"));
 | 
				
			||||||
 | 
					    ui->label_width->setText(i18n("Width"));
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
@ -87,11 +87,12 @@ private slots:
 | 
				
			|||||||
    void changeColor();
 | 
					    void changeColor();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
    QColor stringToColor(const QString _color) const;
 | 
					 | 
				
			||||||
    QString m_fileName;
 | 
					    QString m_fileName;
 | 
				
			||||||
    QStringList m_dirs;
 | 
					    QStringList m_dirs;
 | 
				
			||||||
    bool debug;
 | 
					    bool debug;
 | 
				
			||||||
    Ui::GraphicalItem *ui;
 | 
					    Ui::GraphicalItem *ui;
 | 
				
			||||||
 | 
					    QColor stringToColor(const QString _color) const;
 | 
				
			||||||
 | 
					    void translate();
 | 
				
			||||||
    // properties
 | 
					    // properties
 | 
				
			||||||
    int m_apiVersion = 0;
 | 
					    int m_apiVersion = 0;
 | 
				
			||||||
    QString m_name = QString("none");
 | 
					    QString m_name = QString("none");
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user