summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/cmdlineexportallviewsevent.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbd9e6617827818fd043452c08c606f07b78014a0 (patch)
tree425bb4c3168f9c02f10150f235d2cb998dcc6108 /umbrello/umbrello/cmdlineexportallviewsevent.cpp
downloadtdesdk-bd9e6617827818fd043452c08c606f07b78014a0.tar.gz
tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'umbrello/umbrello/cmdlineexportallviewsevent.cpp')
-rw-r--r--umbrello/umbrello/cmdlineexportallviewsevent.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/umbrello/umbrello/cmdlineexportallviewsevent.cpp b/umbrello/umbrello/cmdlineexportallviewsevent.cpp
new file mode 100644
index 00000000..7c4b3caa
--- /dev/null
+++ b/umbrello/umbrello/cmdlineexportallviewsevent.cpp
@@ -0,0 +1,48 @@
+/***************************************************************************
+ * *
+ * 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. *
+ * *
+ * copyright (C) 2006-2007 *
+ * Umbrello UML Modeller Authors <uml-devel@uml.sf.net> *
+ ***************************************************************************/
+
+// own header
+#include "cmdlineexportallviewsevent.h"
+
+// qt includes
+#include <qstringlist.h>
+
+// kde includes
+#include <kapplication.h>
+#include <kdebug.h>
+
+// app includes
+#include "uml.h"
+#include "umlviewimageexportermodel.h"
+
+
+int CmdLineExportAllViewsEvent::getType() {
+ return QEvent::User + 1;
+}
+
+CmdLineExportAllViewsEvent::CmdLineExportAllViewsEvent(const QString &imageType, const KURL &directory, const bool useFolders)
+ : QCustomEvent(CmdLineExportAllViewsEvent::getType()) {
+ m_imageType = imageType;
+ m_directory = directory;
+ m_useFolders = useFolders;
+}
+
+void CmdLineExportAllViewsEvent::exportAllViews() {
+ QStringList errors = UMLViewImageExporterModel().exportAllViews(m_imageType, m_directory, m_useFolders);
+ if (!errors.isEmpty()) {
+ kError() << "Errors while exporting:" << endl;
+ for (QStringList::Iterator it = errors.begin(); it != errors.end(); ++it) {
+ kError() << *it << endl;
+ }
+ }
+
+ kapp->sendEvent(UMLApp::app(), new QCloseEvent());
+}