diff options
Diffstat (limited to 'plugins/gui-error-log')
-rw-r--r-- | plugins/gui-error-log/CMakeL10n.txt | 6 | ||||
-rw-r--r-- | plugins/gui-error-log/Makefile.am | 17 | ||||
-rw-r--r-- | plugins/gui-error-log/errorlog.cpp | 263 | ||||
-rw-r--r-- | plugins/gui-error-log/errorlog.h | 90 | ||||
-rw-r--r-- | plugins/gui-error-log/po/Makefile.am | 2 | ||||
-rw-r--r-- | plugins/gui-error-log/po/de.po | 86 | ||||
-rw-r--r-- | plugins/gui-error-log/po/ru.po | 87 | ||||
-rw-r--r-- | plugins/gui-error-log/po/tderadio-gui-error-log.pot | 82 |
8 files changed, 633 insertions, 0 deletions
diff --git a/plugins/gui-error-log/CMakeL10n.txt b/plugins/gui-error-log/CMakeL10n.txt new file mode 100644 index 0000000..ba6c0c8 --- /dev/null +++ b/plugins/gui-error-log/CMakeL10n.txt @@ -0,0 +1,6 @@ +##### create translation templates ############## + +tde_l10n_create_template( + CATALOG "tderadio-gui-error-log" + DESTINATION "po" +) diff --git a/plugins/gui-error-log/Makefile.am b/plugins/gui-error-log/Makefile.am new file mode 100644 index 0000000..0e19ea4 --- /dev/null +++ b/plugins/gui-error-log/Makefile.am @@ -0,0 +1,17 @@ +SUBDIRS = po . + +INCLUDES = $(all_includes) +METASOURCES = AUTO + +libtderadio_LTLIBRARIES = liberror-log.la +liberror_log_la_SOURCES = errorlog.cpp +liberror_log_la_LDFLAGS = -module -avoid-version $(KDE_RPATH) $(all_libraries) + +noinst_HEADERS = errorlog.h + +#messages: rc.cpp +# $(XGETTEXT) *.cpp *.h -o po/tderadio-gui-error-log.pot + +messages: rc.cpp + $(EXTRACTRC) *.rc *.ui >> rc.cpp + $(XGETTEXT) rc.cpp *.h *.cpp -o po/tderadio-gui-error-log.pot diff --git a/plugins/gui-error-log/errorlog.cpp b/plugins/gui-error-log/errorlog.cpp new file mode 100644 index 0000000..1ed8fdf --- /dev/null +++ b/plugins/gui-error-log/errorlog.cpp @@ -0,0 +1,263 @@ +/*************************************************************************** + errorlog.cpp - description + ------------------- + begin : Sa Sep 13 2003 + copyright : (C) 2003 by Martin Witte + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#include "errorlog.h" + +#include <tqframe.h> +#include <tqdatetime.h> +#include <tqlayout.h> + +#include <tdelocale.h> +#include <kiconloader.h> +#include <tqtextedit.h> +#include <tdefiledialog.h> +#include <kurl.h> +#include <tdetempfile.h> +#include <tdeio/netaccess.h> + +#define PAGE_ID_INFO 0 +#define PAGE_ID_WARN 1 +#define PAGE_ID_ERROR 2 +#define PAGE_ID_DEBUG 3 + +/////////////////////////////////////////////////////////////////////// + +PLUGIN_LIBRARY_FUNCTIONS(ErrorLog, "tderadio-gui-error-log", i18n("Error Logging Window for TDERadio")); + +///////////////////////////////////////////////////////////////////////////// + +ErrorLog::ErrorLog(const TQString &name) + : KDialogBase(KDialogBase::IconList, + "", + KDialogBase::Close|KDialogBase::User1, + KDialogBase::Close, + NULL, + name.ascii(), + false, + false, + KGuiItem(i18n("Save &as"), "document-save-as") + ), + WidgetPluginBase(name, i18n("Error Logger")), + init_done(false) +{ + TQWidget::setCaption(i18n("TDERadio Logger")); + TQFrame *info = addPage(i18n("Information"), i18n("Information"), + TDEGlobal::instance()->iconLoader()->loadIcon( + "messagebox_info", TDEIcon::NoGroup, TDEIcon::SizeMedium + ) + ); + + TQGridLayout *linfo = new TQGridLayout(info); + linfo->setSpacing( 5 ); + linfo->setMargin ( 0 ); + m_teInfos = new TQTextEdit(info); + linfo->addWidget(m_teInfos, 0, 0); + m_teInfos->setReadOnly(true); + logInfo(i18n("logging started")); + + + TQFrame *warn = addPage(i18n("Warnings"), i18n("Warnings"), + TDEGlobal::instance()->iconLoader()->loadIcon( + "messagebox_warning", TDEIcon::NoGroup, TDEIcon::SizeMedium + ) + ); + TQGridLayout *lwarn = new TQGridLayout(warn); + lwarn->setSpacing( 5 ); + lwarn->setMargin ( 0 ); + m_teWarnings = new TQTextEdit(warn); + lwarn->addWidget(m_teWarnings, 0, 0); + m_teWarnings->setReadOnly(true); + logWarning(i18n("logging started")); + + + + TQFrame *err = addPage(i18n("Errors"), i18n("Errors"), + TDEGlobal::instance()->iconLoader()->loadIcon( + "messagebox_critical", TDEIcon::NoGroup, TDEIcon::SizeMedium + ) + ); + TQGridLayout *lerr = new TQGridLayout(err); + lerr->setSpacing( 5 ); + lerr->setMargin ( 0 ); + m_teErrors = new TQTextEdit(err); + lerr->addWidget(m_teErrors, 0, 0); + m_teErrors->setReadOnly(true); + logError(i18n("logging started")); + + TQFrame *debug = addPage(i18n("Debugging"), i18n("Debugging"), + TDEGlobal::instance()->iconLoader()->loadIcon( + "edit-find", TDEIcon::NoGroup, TDEIcon::SizeMedium + ) + ); + + TQGridLayout *ldebug = new TQGridLayout(debug); + ldebug->setSpacing( 5 ); + ldebug->setMargin ( 0 ); + m_teDebug = new TQTextEdit(debug); + ldebug->addWidget(m_teDebug, 0, 0); + m_teDebug->setReadOnly(true); + logDebug(i18n("logging started")); + + init_done = true; +} + + +ErrorLog::~ErrorLog() +{ +} + +bool ErrorLog::connectI (Interface *i) +{ + bool a = IErrorLog::connectI(i); + bool b = PluginBase::connectI(i); + return a || b; +} + +bool ErrorLog::disconnectI (Interface *i) +{ + bool a = IErrorLog::disconnectI(i); + bool b = PluginBase::disconnectI(i); + return a || b; +} + +void ErrorLog::restoreState (TDEConfig *config) +{ + config->setGroup(TQString("errorlog-") + WidgetPluginBase::name()); + WidgetPluginBase::restoreState(config, false); +} + + +void ErrorLog::saveState (TDEConfig *config) const +{ + config->setGroup(TQString("errorlog-") + WidgetPluginBase::name()); + WidgetPluginBase::saveState(config); +} + + +void ErrorLog::show() +{ + WidgetPluginBase::pShow(); + KDialogBase::show(); +} + +void ErrorLog::showOnOrgDesktop() +{ + WidgetPluginBase::pShowOnOrgDesktop(); + //KDialogBase::show(); +} + +void ErrorLog::hide() +{ + logDebug(TQString("%1, ErrorLog::hide: all: %2, desktop: %3, visible:%4, anywherevisible:%5, cachevalid: %6").arg(name()).arg(m_saveSticky).arg(m_saveDesktop).arg(isReallyVisible()).arg(isAnywhereVisible()).arg(m_geoCacheValid)); + WidgetPluginBase::pHide(); + KDialogBase::hide(); +} + +void ErrorLog::showEvent(TQShowEvent *e) +{ + KDialogBase::showEvent(e); + WidgetPluginBase::pShowEvent(e); +} + +void ErrorLog::hideEvent(TQHideEvent *e) +{ + KDialogBase::hideEvent(e); + WidgetPluginBase::pHideEvent(e); +} + +// IErrorLog + +bool ErrorLog::logError (const TQString &s) +{ + m_teErrors->append("<i>" + TQDateTime::currentDateTime().toString(Qt::ISODate) + "</i> " + s + "\n"); + if (init_done) { + showPage(PAGE_ID_ERROR); + show(); + } + return true; +} + +bool ErrorLog::logWarning(const TQString &s) +{ + m_teWarnings->append("<i>" + TQDateTime::currentDateTime().toString(Qt::ISODate) + "</i> " + s + "\n"); + return true; +} + +bool ErrorLog::logInfo (const TQString &s) +{ + m_teInfos->append("<i>" + TQDateTime::currentDateTime().toString(Qt::ISODate) + "</i> " + s + "\n"); + return true; +} + +bool ErrorLog::logDebug (const TQString &s) +{ + m_teDebug->append("<i>" + TQDateTime::currentDateTime().toString(Qt::ISODate) + "</i> " + s + "\n"); + return true; +} + +// KDialogBase + + +// store Log Data +void ErrorLog::slotUser1() +{ + KFileDialog fd("", + ("*.log|" + i18n("Log Files") + "( *.log )").ascii(), + this, + i18n("Select Log File").ascii(), + true); + fd.setMode(KFile::File); + fd.setOperationMode(KFileDialog::Saving); + fd.setCaption (i18n("Save TDERadio Logging Data as ...")); + + if (fd.exec() == TQDialog::Accepted) { + KURL url = fd.selectedURL(); + + KTempFile tmpFile; + tmpFile.setAutoDelete(true); + TQFile *outf = tmpFile.file(); + + TQTextStream outs(outf); + outs.setEncoding(TQTextStream::UnicodeUTF8); + + switch (activePageIndex()) { + case PAGE_ID_INFO: outs << m_teInfos->text(); break; + case PAGE_ID_WARN: outs << m_teWarnings->text(); break; + case PAGE_ID_ERROR: outs << m_teErrors->text(); break; + case PAGE_ID_DEBUG: outs << m_teDebug->text(); break; + default: break; + } + + if (outf->status() != IO_Ok) { + logError("ErrorLogger: " + + i18n("error writing to tempfile %1").arg(tmpFile.name())); + return; + } + + // close hopefully flushes buffers ;) + outf->close(); + + if (!TDEIO::NetAccess::upload(tmpFile.name(), url, this)) { + logError("ErrorLogger: " + + i18n("error uploading preset file %1").arg(url.url())); + } + } + setIconListAllVisible(true); +} + + +#include "errorlog.moc" diff --git a/plugins/gui-error-log/errorlog.h b/plugins/gui-error-log/errorlog.h new file mode 100644 index 0000000..26bd0c0 --- /dev/null +++ b/plugins/gui-error-log/errorlog.h @@ -0,0 +1,90 @@ +/*************************************************************************** + errorlog.h - description + ------------------- + begin : Sa Sep 13 2003 + copyright : (C) 2003 by Martin Witte + email : [email protected] + ***************************************************************************/ + +/*************************************************************************** + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + ***************************************************************************/ + +#ifndef KRADIO_ERRORLOG_H +#define KRADIO_ERRORLOG_H + +#include <kdialogbase.h> + +#include "../../src/include/errorlog-interfaces.h" +#include "../../src/include/widgetplugins.h" + + +class TQTextEdit; +class ErrorLog : public KDialogBase, + public WidgetPluginBase, + public IErrorLog +{ +Q_OBJECT + +public: + ErrorLog(const TQString &name = TQString()); + ~ErrorLog(); + + virtual TQString pluginClassName() const { return "ErrorLog"; } + virtual const TQString &name() const { return PluginBase::name(); } + virtual TQString &name() { return PluginBase::name(); } + + virtual bool connectI (Interface *); + virtual bool disconnectI (Interface *); + +// WidgetPluginBase + + virtual void saveState (TDEConfig *) const; + virtual void restoreState (TDEConfig *); + +public slots: + virtual void showOnOrgDesktop(); + virtual void show(); + virtual void hide(); + virtual void toggleShown () { WidgetPluginBase::pToggleShown(); } + +protected: + TQWidget *getWidget() { return this; } + const TQWidget *getWidget() const { return this; } + + virtual void showEvent(TQShowEvent *); + virtual void hideEvent(TQHideEvent *); + + virtual ConfigPageInfo createConfigurationPage () { return ConfigPageInfo(); } + virtual AboutPageInfo createAboutPage () { return AboutPageInfo(); } + +// IErrorLog + +RECEIVERS: + bool logError (const TQString &); + bool logWarning(const TQString &); + bool logInfo (const TQString &); + bool logDebug (const TQString &); + +// KDialogBase + +protected slots: + + void slotUser1(); + +protected: + + TQTextEdit *m_teDebug, + *m_teInfos, + *m_teWarnings, + *m_teErrors; + + bool init_done; +}; + +#endif diff --git a/plugins/gui-error-log/po/Makefile.am b/plugins/gui-error-log/po/Makefile.am new file mode 100644 index 0000000..cab56dc --- /dev/null +++ b/plugins/gui-error-log/po/Makefile.am @@ -0,0 +1,2 @@ +PACKAGE = tderadio-gui-error-log +POFILES = AUTO diff --git a/plugins/gui-error-log/po/de.po b/plugins/gui-error-log/po/de.po new file mode 100644 index 0000000..10ceda9 --- /dev/null +++ b/plugins/gui-error-log/po/de.po @@ -0,0 +1,86 @@ +# translation of de.po to +# translation of tderadio-gui-error-log.po to +# This file is put in the public domain. +# +# Ernst Martin Witte <[email protected]>, 2006. +msgid "" +msgstr "" +"Project-Id-Version: de\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-05-11 04:30+0200\n" +"PO-Revision-Date: 2019-08-31 00:45+0000\n" +"Last-Translator: Chris <[email protected]>\n" +"Language-Team: German <https://mirror.git.trinitydesktop.org/weblate/" +"projects/applications/tderadio-gui-error-log/de/>\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 3.8\n" + +#. Instead of a literal translation, add your name to the end of the list (separated by a comma). +msgid "" +"_: NAME OF TRANSLATORS\n" +"Your names" +msgstr "Chris (TDE)" + +#. Instead of a literal translation, add your email to the end of the list (separated by a comma). +msgid "" +"_: EMAIL OF TRANSLATORS\n" +"Your emails" +msgstr "(Keine Email)" + +#: errorlog.cpp:39 +msgid "Error Logging Window for TDERadio" +msgstr "Fehlerprotokollierungsfenster für TDERadio" + +#: errorlog.cpp:52 +msgid "Save &as" +msgstr "Sichern &unter" + +#: errorlog.cpp:54 +msgid "Error Logger" +msgstr "Fehlerprotokoll" + +#: errorlog.cpp:57 +msgid "TDERadio Logger" +msgstr "TDERadio Fehlerprotokoll" + +#: errorlog.cpp:70 errorlog.cpp:84 errorlog.cpp:99 errorlog.cpp:113 +msgid "logging started" +msgstr "Beginn des Protokollierung" + +#: errorlog.cpp:73 +msgid "Warnings" +msgstr "Warnungen" + +#: errorlog.cpp:88 +msgid "Errors" +msgstr "Fehler" + +#: errorlog.cpp:101 +msgid "Debugging" +msgstr "Fehlersuche" + +#: errorlog.cpp:219 +msgid "Log Files" +msgstr "Protokoll-Dateien" + +#: errorlog.cpp:221 +msgid "Select Log File" +msgstr "Auswahl der Protokolldatei" + +#: errorlog.cpp:225 +msgid "Save TDERadio Logging Data as ..." +msgstr "TDERadio-Fehlerprotokoll sichern untern ..." + +#: errorlog.cpp:247 +#, c-format +msgid "error writing to tempfile %1" +msgstr "Fehler beim schreiben in die temporäre Datei %1" + +#: errorlog.cpp:256 +#, c-format +msgid "error uploading preset file %1" +msgstr "Fehler beim Upload der Senderdatei %1" diff --git a/plugins/gui-error-log/po/ru.po b/plugins/gui-error-log/po/ru.po new file mode 100644 index 0000000..c8d2ef3 --- /dev/null +++ b/plugins/gui-error-log/po/ru.po @@ -0,0 +1,87 @@ +# translation of ru.po to +# translation of tderadio-gui-error-log.po to +# This file is put in the public domain. +# Алексей Кузнецов <[email protected]>, 2006. +# +msgid "" +msgstr "" +"Project-Id-Version: ru\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2020-05-11 04:30+0200\n" +"PO-Revision-Date: 2020-01-03 16:07+0000\n" +"Last-Translator: Serg Bormant <[email protected]>\n" +"Language-Team: Russian <https://mirror.git.trinitydesktop.org/weblate/" +"projects/applications/tderadio-gui-error-log/ru/>\n" +"Language: ru\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Generator: Weblate 3.10\n" + +#. Instead of a literal translation, add your name to the end of the list (separated by a comma). +msgid "" +"_: NAME OF TRANSLATORS\n" +"Your names" +msgstr "" + +#. Instead of a literal translation, add your email to the end of the list (separated by a comma). +msgid "" +"_: EMAIL OF TRANSLATORS\n" +"Your emails" +msgstr "" + +#: errorlog.cpp:39 +msgid "Error Logging Window for TDERadio" +msgstr "Окно ведения журнала ошибок TDERadio" + +#: errorlog.cpp:52 +msgid "Save &as" +msgstr "Сохранить &как" + +#: errorlog.cpp:54 +msgid "Error Logger" +msgstr "Журнал ошибок" + +#: errorlog.cpp:57 +msgid "TDERadio Logger" +msgstr "Журнал TDERadio" + +#: errorlog.cpp:70 errorlog.cpp:84 errorlog.cpp:99 errorlog.cpp:113 +msgid "logging started" +msgstr "Журналирование включено" + +#: errorlog.cpp:73 +msgid "Warnings" +msgstr "Предупреждения" + +#: errorlog.cpp:88 +msgid "Errors" +msgstr "Ошибки" + +#: errorlog.cpp:101 +msgid "Debugging" +msgstr "Отладка" + +#: errorlog.cpp:219 +msgid "Log Files" +msgstr "Файлы журнала" + +#: errorlog.cpp:221 +msgid "Select Log File" +msgstr "Выберите файлы журнала" + +#: errorlog.cpp:225 +msgid "Save TDERadio Logging Data as ..." +msgstr "Сохранить данные журнала TDERadio как..." + +#: errorlog.cpp:247 +#, c-format +msgid "error writing to tempfile %1" +msgstr "Ошибка записи во временный файл %1" + +#: errorlog.cpp:256 +#, c-format +msgid "error uploading preset file %1" +msgstr "Ошибка выгрузки файла настроек %1" diff --git a/plugins/gui-error-log/po/tderadio-gui-error-log.pot b/plugins/gui-error-log/po/tderadio-gui-error-log.pot new file mode 100644 index 0000000..b836a14 --- /dev/null +++ b/plugins/gui-error-log/po/tderadio-gui-error-log.pot @@ -0,0 +1,82 @@ +# SOME DESCRIPTIVE TITLE. +# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: PACKAGE VERSION\n" +"POT-Creation-Date: 2020-05-11 04:30+0200\n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" +"Language-Team: LANGUAGE <[email protected]>\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#. Instead of a literal translation, add your name to the end of the list (separated by a comma). +#, ignore-inconsistent +msgid "" +"_: NAME OF TRANSLATORS\n" +"Your names" +msgstr "" + +#. Instead of a literal translation, add your email to the end of the list (separated by a comma). +#, ignore-inconsistent +msgid "" +"_: EMAIL OF TRANSLATORS\n" +"Your emails" +msgstr "" + +#: errorlog.cpp:39 +msgid "Error Logging Window for TDERadio" +msgstr "" + +#: errorlog.cpp:52 +msgid "Save &as" +msgstr "" + +#: errorlog.cpp:54 +msgid "Error Logger" +msgstr "" + +#: errorlog.cpp:57 +msgid "TDERadio Logger" +msgstr "" + +#: errorlog.cpp:70 errorlog.cpp:84 errorlog.cpp:99 errorlog.cpp:113 +msgid "logging started" +msgstr "" + +#: errorlog.cpp:73 +msgid "Warnings" +msgstr "" + +#: errorlog.cpp:88 +msgid "Errors" +msgstr "" + +#: errorlog.cpp:101 +msgid "Debugging" +msgstr "" + +#: errorlog.cpp:219 +msgid "Log Files" +msgstr "" + +#: errorlog.cpp:221 +msgid "Select Log File" +msgstr "" + +#: errorlog.cpp:225 +msgid "Save TDERadio Logging Data as ..." +msgstr "" + +#: errorlog.cpp:247 +#, c-format +msgid "error writing to tempfile %1" +msgstr "" + +#: errorlog.cpp:256 +#, c-format +msgid "error uploading preset file %1" +msgstr "" |