summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2016-09-07 18:34:26 (GMT)
committerRalf Habacker <ralf.habacker@freenet.de>2016-09-07 19:01:38 (GMT)
commitefa7e85c6e2a55286d64604639a1945a29f5bab5 (patch)
tree2e32b634a00afbc71f6ca64960bcc7d4e7a3f6da
parent3c57b008bc2f732ce2785d04bdf14549aa41e826 (diff)
Add property dialog for class UMLFolder for usage from objects dock window.
-rw-r--r--umbrello/umlmodel/folder.cpp23
-rw-r--r--umbrello/umlmodel/folder.h2
2 files changed, 25 insertions, 0 deletions
diff --git a/umbrello/umlmodel/folder.cpp b/umbrello/umlmodel/folder.cpp
index e97668f..3a18b05 100644
--- a/umbrello/umlmodel/folder.cpp
+++ b/umbrello/umlmodel/folder.cpp
@@ -24,9 +24,15 @@
// kde includes
#include <KLocalizedString>
#include <KMessageBox>
+#if QT_VERSION < 0x050000
+#include <kinputdialog.h>
+#endif
// qt includes
#include <QFile>
+#if QT_VERSION >= 0x050000
+#include <QInputDialog>
+#endif
/**
* Sets up a Folder.
@@ -544,6 +550,23 @@ bool UMLFolder::load(QDomElement& element)
return totalSuccess;
}
+bool UMLFolder::showPropertiesDialog(QWidget *parent)
+{
+ bool ok;
+#if QT_VERSION >= 0x050000
+ QString folderName = QInputDialog::getText(parent,
+ i18n("Folder"), i18n("Enter name:"),
+ QLineEdit::Normal,
+ name(), &ok);
+#else
+ QString folderName = KInputDialog::getText(i18n("Folder"), i18n("Enter name:"), name(), &ok, parent);
+#endif
+ if (ok) {
+ setName(folderName);
+ }
+ return ok;
+}
+
/**
* Overloading operator for debugging output.
*/
diff --git a/umbrello/umlmodel/folder.h b/umbrello/umlmodel/folder.h
index 8acf78a..8cac074 100644
--- a/umbrello/umlmodel/folder.h
+++ b/umbrello/umlmodel/folder.h
@@ -61,6 +61,8 @@ public:
void setFolderFile(const QString& fileName);
QString folderFile() const;
+ bool showPropertiesDialog(QWidget *parent);
+
void saveToXMI(QDomDocument & qDoc, QDomElement & qElement);
friend QDebug operator<<(QDebug out, const UMLFolder& item);