summaryrefslogtreecommitdiffstats
path: root/src/translators/xsltexporter.cpp
diff options
context:
space:
mode:
authorSlávek Banko <[email protected]>2014-03-03 13:46:44 +0100
committerSlávek Banko <[email protected]>2014-03-03 13:46:44 +0100
commit2e02da046d3e56cdf4744f644af35ad07424f48b (patch)
treef2dcf353aa2338eae1c2ff2c41af971c580c2762 /src/translators/xsltexporter.cpp
parent3c13229d98167ae4ae0710d5eeef23fef5005bf0 (diff)
downloadtellico-2e02da046d3e56cdf4744f644af35ad07424f48b.tar.gz
tellico-2e02da046d3e56cdf4744f644af35ad07424f48b.zip
Update to upstream version 1.3.6
Diffstat (limited to 'src/translators/xsltexporter.cpp')
-rw-r--r--src/translators/xsltexporter.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/translators/xsltexporter.cpp b/src/translators/xsltexporter.cpp
index c08ee0f..b0642b3 100644
--- a/src/translators/xsltexporter.cpp
+++ b/src/translators/xsltexporter.cpp
@@ -18,6 +18,8 @@
#include <tdelocale.h>
#include <kurlrequester.h>
+#include <kuser.h>
+#include <tdeconfig.h>
#include <tqlabel.h>
#include <tqgroupbox.h>
@@ -49,6 +51,9 @@ bool XSLTExporter::exec() {
}
// XSLTHandler handler(FileHandler::readXMLFile(url));
XSLTHandler handler(u);
+ handler.addStringParam("date", TQDate::currentDate().toString(TQt::ISODate).latin1());
+ handler.addStringParam("time", TQTime::currentTime().toString(TQt::ISODate).latin1());
+ handler.addStringParam("user", KUser(KUser::UseRealUserID).loginName().latin1());
TellicoXMLExporter exporter;
exporter.setEntries(entries());
@@ -75,6 +80,25 @@ TQWidget* XSLTExporter::widget(TQWidget* parent_, const char* name_/*=0*/) {
m_URLRequester = new KURLRequester(box);
TQWhatsThis::add(m_URLRequester, i18n("Choose the XSLT file used to transform the Tellico XML data."));
+ TQString filter = i18n("*.xsl|XSL Files (*.xsl)") + TQChar('\n');
+ filter += i18n("*|All Files");
+ m_URLRequester->setFilter(filter);
+ m_URLRequester->setMode(static_cast<KFile::Mode>(KFile::File | KFile::ExistingOnly));
+ if(!m_xsltFile.isEmpty()) {
+ m_URLRequester->setURL(m_xsltFile);
+ }
+
l->addStretch(1);
return m_widget;
}
+
+void XSLTExporter::readOptions(TDEConfig* config_) {
+ TDEConfigGroup group(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString()));
+ m_xsltFile = group.readEntry("Last File", TQString());
+}
+
+void XSLTExporter::saveOptions(TDEConfig* config_) {
+ TDEConfigGroup group(config_, TQString::fromLatin1("ExportOptions - %1").arg(formatString()));
+ m_xsltFile = m_URLRequester->url();
+ group.writeEntry("Last File", m_xsltFile);
+}