summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndi Fischer <[email protected]>2014-10-22 22:05:02 +0200
committerAndi Fischer <[email protected]>2014-10-22 22:05:02 +0200
commit0898e0b6c81f2e969cc15598fe1c915b8f5e4278 (patch)
treed31fb704497dfca2988acd4bf0faa6282bdc1cac
parent6884d17bc78f4c4e880cb5a8f8d40cad16bf34e8 (diff)
KInputDialog --> QInputDialog
-rw-r--r--umbrello/dialogs/dialog_utils.cpp7
-rw-r--r--umbrello/dialogs/pages/activitypage.cpp15
-rw-r--r--umbrello/enumliteral.cpp8
-rw-r--r--umbrello/object_factory.cpp7
-rw-r--r--umbrello/package.cpp10
-rw-r--r--umbrello/stereotype.cpp9
-rw-r--r--umbrello/umldoc.cpp23
-rw-r--r--umbrello/umllistview.cpp8
-rw-r--r--umbrello/umlscene.cpp23
-rw-r--r--umbrello/widgets/activitywidget.cpp7
-rw-r--r--umbrello/widgets/associationwidget.cpp20
-rw-r--r--umbrello/widgets/combinedfragmentwidget.cpp18
-rw-r--r--umbrello/widgets/floatingdashlinewidget.cpp7
-rw-r--r--umbrello/widgets/floatingtextwidget.cpp18
-rw-r--r--umbrello/widgets/notewidget.cpp7
-rw-r--r--umbrello/widgets/objectnodewidget.cpp19
-rw-r--r--umbrello/widgets/objectwidget.cpp15
-rw-r--r--umbrello/widgets/pinwidget.cpp6
-rw-r--r--umbrello/widgets/portwidget.cpp6
-rw-r--r--umbrello/widgets/preconditionwidget.cpp10
-rw-r--r--umbrello/widgets/signalwidget.cpp6
-rw-r--r--umbrello/widgets/statewidget.cpp18
-rw-r--r--umbrello/widgets/toolbarstateonewidget.cpp11
23 files changed, 190 insertions, 88 deletions
diff --git a/umbrello/dialogs/dialog_utils.cpp b/umbrello/dialogs/dialog_utils.cpp
index 3dc7172..2e6ed91 100644
--- a/umbrello/dialogs/dialog_utils.cpp
+++ b/umbrello/dialogs/dialog_utils.cpp
@@ -18,7 +18,6 @@
#include "umlwidget.h"
// kde includes
-#include <kinputdialog.h>
#include <kmessagebox.h>
#include <klocale.h>
#include <klineedit.h>
@@ -26,6 +25,7 @@
// qt includes
#include <QGridLayout>
+#include <QInputDialog>
#include <QLabel>
#include <QLineEdit>
@@ -69,7 +69,10 @@ void askNameForWidget(UMLWidget * &targetWidget, const QString& dialogTitle,
{
bool pressedOK = false;
- QString name = KInputDialog::getText(dialogTitle, dialogPrompt, defaultName, &pressedOK, UMLApp::app());
+ QString name = QInputDialog::getText(UMLApp::app(),
+ dialogTitle, dialogPrompt,
+ QLineEdit::Normal,
+ defaultName, &pressedOK);
if (pressedOK) {
targetWidget->setName(name);
diff --git a/umbrello/dialogs/pages/activitypage.cpp b/umbrello/dialogs/pages/activitypage.cpp
index 210cf97..e964613 100644
--- a/umbrello/dialogs/pages/activitypage.cpp
+++ b/umbrello/dialogs/pages/activitypage.cpp
@@ -15,13 +15,13 @@
#include "statewidget.h"
#include "uml.h"
-#include <kinputdialog.h>
#include <klocale.h>
#include <QDialogButtonBox>
#include <QHBoxLayout>
#include <QGridLayout>
#include <QGroupBox>
+#include <QInputDialog>
#include <QLayout>
#include <QPushButton>
#include <QStringList>
@@ -172,8 +172,11 @@ void ActivityPage::slotMenuSelection(QAction* action)
void ActivityPage::slotNewActivity()
{
bool ok = false;
- QString name = KInputDialog::getText(i18n("New Activity"),
- i18n("Enter the name of the new activity:"), i18n("new activity"), &ok, UMLApp::app());
+ QString name = QInputDialog::getText(UMLApp::app(),
+ i18n("New Activity"),
+ i18n("Enter the name of the new activity:"),
+ QLineEdit::Normal,
+ i18n("new activity"), &ok);
if (ok && name.length() > 0) {
m_pActivityLW->addItem(name);
m_pActivityLW->setCurrentRow(m_pActivityLW->count() - 1);
@@ -195,7 +198,11 @@ void ActivityPage::slotRename()
bool ok = false;
QString name = m_pActivityLW->currentItem()->text();
QString oldName = name;
- name = KInputDialog::getText(i18n("Rename Activity"), i18n("Enter the new name of the activity:"), name, &ok, UMLApp::app());
+ name = QInputDialog::getText(UMLApp::app(),
+ i18n("Rename Activity"),
+ i18n("Enter the new name of the activity:"),
+ QLineEdit::Normal,
+ name, &ok);
if (ok && name.length() > 0) {
QListWidgetItem* item = m_pActivityLW->currentItem();
item->setText(name);
diff --git a/umbrello/enumliteral.cpp b/umbrello/enumliteral.cpp
index aed3217..d27014f 100644
--- a/umbrello/enumliteral.cpp
+++ b/umbrello/enumliteral.cpp
@@ -10,9 +10,10 @@
#include "enumliteral.h"
-#include <kinputdialog.h>
#include <klocale.h>
+#include <QInputDialog>
+
/**
* Sets up an enum literal.
* @param parent The parent of this UMLEnumLiteral.
@@ -101,7 +102,10 @@ bool UMLEnumLiteral::load(QDomElement& element)
bool UMLEnumLiteral::showPropertiesDialog(QWidget* parent)
{
bool ok;
- QString enumName = KInputDialog::getText(i18nc("enum name", "Name"), i18n("Enter name:"), name(), &ok, parent);
+ QString enumName = QInputDialog::getText(parent,
+ i18nc("enum name", "Name"), i18n("Enter name:"),
+ QLineEdit::Normal,
+ name(), &ok);
if (ok && !enumName.isEmpty()) {
setName(enumName);
return true;
diff --git a/umbrello/object_factory.cpp b/umbrello/object_factory.cpp
index 148a31b..683cbad 100644
--- a/umbrello/object_factory.cpp
+++ b/umbrello/object_factory.cpp
@@ -44,10 +44,10 @@
// kde includes
#include <klocale.h>
#include <kmessagebox.h>
-#include <kinputdialog.h>
// qt includes
#include <QApplication>
+#include <QInputDialog>
#include <QRegExp>
#include <QStringList>
@@ -233,7 +233,10 @@ UMLObject* createUMLObject(UMLObject::ObjectType type, const QString &n,
bool ok = false;
while (bValidNameEntered == false) {
- name = KInputDialog::getText(i18nc("UMLObject name", "Name"), i18n("Enter name:"), name, &ok, (QWidget*)UMLApp::app());
+ name = QInputDialog::getText(UMLApp::app(),
+ i18nc("UMLObject name", "Name"), i18n("Enter name:"),
+ QLineEdit::Normal,
+ name, &ok);
if (!ok) {
return 0;
}
diff --git a/umbrello/package.cpp b/umbrello/package.cpp
index 1dd8050..7cdbd15 100644
--- a/umbrello/package.cpp
+++ b/umbrello/package.cpp
@@ -23,9 +23,11 @@
// kde includes
#include <klocale.h>
-#include <kinputdialog.h>
#include <kmessagebox.h>
+// qt includes
+#include <QInputDialog>
+
using namespace Uml;
/**
@@ -163,9 +165,11 @@ bool UMLPackage::addObject(UMLObject *pObject)
QString prevName = name;
name = Model_Utils::uniqObjectName(pObject->baseType(), this);
bool ok = true;
- name = KInputDialog::getText(i18nc("object name", "Name"),
+ name = QInputDialog::getText((QWidget*)UMLApp::app(),
+ i18nc("object name", "Name"),
i18n("An object with the name %1\nalready exists in the package %2.\nPlease enter a new name:", prevName, this->name()),
- name, &ok, (QWidget*)UMLApp::app());
+ QLineEdit::Normal,
+ name, &ok);
if (!ok) {
name = oldName;
continue;
diff --git a/umbrello/stereotype.cpp b/umbrello/stereotype.cpp
index b6744e7..d7965cf 100644
--- a/umbrello/stereotype.cpp
+++ b/umbrello/stereotype.cpp
@@ -18,7 +18,9 @@
// kde includes
#include <klocale.h>
-#include <kinputdialog.h>
+
+// qt includes
+#include <QInputDialog>
/**
@@ -108,7 +110,10 @@ void UMLStereotype::saveToXMI(QDomDocument& qDoc, QDomElement& qElement)
bool UMLStereotype::showPropertiesDialog(QWidget* parent)
{
bool ok;
- QString stereoTypeName = KInputDialog::getText(i18n("Stereotype"), i18n("Enter name:"), name(), &ok, parent);
+ QString stereoTypeName = QInputDialog::getText(parent,
+ i18n("Stereotype"), i18n("Enter name:"),
+ QLineEdit::Normal,
+ name(), &ok);
if (ok) {
setName(stereoTypeName);
}
diff --git a/umbrello/umldoc.cpp b/umbrello/umldoc.cpp
index 563fe27..c1cf383 100644
--- a/umbrello/umldoc.cpp
+++ b/umbrello/umldoc.cpp
@@ -52,7 +52,6 @@
#include <kmessagebox.h>
#include <kmimetype.h>
#include <ktar.h>
-#include <kinputdialog.h>
#include <kapplication.h>
// qt includes
@@ -61,6 +60,7 @@
#include <QDir>
#include <QDomDocument>
#include <QDomElement>
+#include <QInputDialog>
#include <QPainter>
#include <QPrinter>
#include <QRegExp>
@@ -1278,8 +1278,10 @@ QString UMLDoc::createDiagramName(Uml::DiagramType::Enum type, bool askForName /
while (true) {
if (askForName) {
- name = KInputDialog::getText(i18nc("diagram name", "Name"), i18n("Enter name:"),
- defaultName, &ok, (QWidget*)UMLApp::app());
+ name = QInputDialog::getText(UMLApp::app(),
+ i18nc("diagram name", "Name"), i18n("Enter name:"),
+ QLineEdit::Normal,
+ defaultName, &ok);
}
if (!ok) {
break;
@@ -1350,7 +1352,10 @@ void UMLDoc::renameDiagram(Uml::ID::Type id)
QString oldName= view->umlScene()->name();
while (true) {
- QString name = KInputDialog::getText(i18nc("renaming diagram", "Name"), i18n("Enter name:"), oldName, &ok, (QWidget*)UMLApp::app());
+ QString name = QInputDialog::getText(UMLApp::app(),
+ i18nc("renaming diagram", "Name"), i18n("Enter name:"),
+ QLineEdit::Normal,
+ oldName, &ok);
if (!ok) {
break;
@@ -1381,7 +1386,10 @@ void UMLDoc::renameUMLObject(UMLObject *o)
bool ok = false;
QString oldName= o->name();
while (true) {
- QString name = KInputDialog::getText(i18nc("renaming uml object", "Name"), i18n("Enter name:"), oldName, &ok, (QWidget*)UMLApp::app());
+ QString name = QInputDialog::getText(UMLApp::app(),
+ i18nc("renaming uml object", "Name"), i18n("Enter name:"),
+ QLineEdit::Normal,
+ oldName, &ok);
if (!ok) {
break;
}
@@ -1415,7 +1423,10 @@ void UMLDoc::renameChildUMLObject(UMLObject *o)
QString oldName= o->name();
while (true) {
- QString name = KInputDialog::getText(i18nc("renaming child uml object", "Name"), i18n("Enter name:"), oldName, &ok, (QWidget*)UMLApp::app());
+ QString name = QInputDialog::getText(UMLApp::app(),
+ i18nc("renaming child uml object", "Name"), i18n("Enter name:"),
+ QLineEdit::Normal,
+ oldName, &ok);
if (!ok) {
break;
}
diff --git a/umbrello/umllistview.cpp b/umbrello/umllistview.cpp
index ec601e3..5a30c7a 100644
--- a/umbrello/umllistview.cpp
+++ b/umbrello/umllistview.cpp
@@ -63,7 +63,6 @@
#include <kfiledialog.h>
#include <klocale.h>
#include <kmessagebox.h>
-#include <kinputdialog.h>
#include <kapplication.h>
// qt includes
@@ -71,6 +70,7 @@
#include <QDropEvent>
#include <QEvent>
#include <QFocusEvent>
+#include <QInputDialog>
#include <QKeyEvent>
#include <QMouseEvent>
#include <QPointer>
@@ -555,9 +555,11 @@ void UMLListView::slotMenuSelection(QAction* action, const QPoint &position)
case ListPopupMenu::mt_Model:
{
bool ok = false;
- QString name = KInputDialog::getText(i18n("Enter Model Name"),
+ QString name = QInputDialog::getText(UMLApp::app(),
+ i18n("Enter Model Name"),
i18n("Enter the new name of the model:"),
- m_doc->name(), &ok, UMLApp::app());
+ QLineEdit::Normal,
+ m_doc->name(), &ok);
if (ok) {
setTitle(0, name);
m_doc->setName(name);
diff --git a/umbrello/umlscene.cpp b/umbrello/umlscene.cpp
index deab534..d5e6914 100644
--- a/umbrello/umlscene.cpp
+++ b/umbrello/umlscene.cpp
@@ -75,11 +75,11 @@
#include <kmessagebox.h>
#include <kcursor.h>
#include <kfiledialog.h>
-#include <kinputdialog.h>
#include <klocale.h>
// include files for Qt
#include <QColor>
+#include <QInputDialog>
#include <QPainter>
#include <QPixmap>
#include <QPrinter>
@@ -3042,9 +3042,12 @@ void UMLScene::slotMenuSelection(QAction* action)
case ListPopupMenu::mt_State:
{
bool ok = false;
- QString name = KInputDialog::getText(i18n("Enter State Name"),
+ QString name = QInputDialog::getText(UMLApp::app(),
+ i18n("Enter State Name"),
i18n("Enter the name of the new state:"),
- i18n("new state"), &ok, UMLApp::app());
+ QLineEdit::Normal,
+ i18n("new state"),
+ &ok);
if (ok) {
StateWidget* state = new StateWidget(this);
state->setName(name);
@@ -3077,9 +3080,12 @@ void UMLScene::slotMenuSelection(QAction* action)
case ListPopupMenu::mt_Activity:
{
bool ok = false;
- QString name = KInputDialog::getText(i18n("Enter Activity Name"),
+ QString name = QInputDialog::getText(UMLApp::app(),
+ i18n("Enter Activity Name"),
i18n("Enter the name of the new activity:"),
- i18n("new activity"), &ok, UMLApp::app());
+ QLineEdit::Normal,
+ i18n("new activity"),
+ &ok);
if (ok) {
ActivityWidget* activity = new ActivityWidget(this, ActivityWidget::Normal);
activity->setName(name);
@@ -3115,9 +3121,12 @@ void UMLScene::slotMenuSelection(QAction* action)
case ListPopupMenu::mt_Rename:
{
bool ok = false;
- QString newName = KInputDialog::getText(i18n("Enter Diagram Name"),
+ QString newName = QInputDialog::getText(UMLApp::app(),
+ i18n("Enter Diagram Name"),
i18n("Enter the new name of the diagram:"),
- name(), &ok, UMLApp::app());
+ QLineEdit::Normal,
+ name(),
+ &ok);
if (ok) {
setName(newName);
m_doc->signalDiagramRenamed(activeView());
diff --git a/umbrello/widgets/activitywidget.cpp b/umbrello/widgets/activitywidget.cpp
index 46a6a58..acffe5e 100644
--- a/umbrello/widgets/activitywidget.cpp
+++ b/umbrello/widgets/activitywidget.cpp
@@ -23,10 +23,11 @@
// kde includes
#include <klocale.h>
-#include <kinputdialog.h>
// qt includes
+#include <QInputDialog>
#include <QPointer>
+
/**
* Creates a Activity widget.
*
@@ -369,8 +370,10 @@ void ActivityWidget::slotMenuSelection(QAction* action)
{
bool ok = false;
QString n = name();
- n = KInputDialog::getText(i18n("Enter Activity Name"),
+ n = QInputDialog::getText(Q_NULLPTR,
+ i18n("Enter Activity Name"),
i18n("Enter the name of the new activity:"),
+ QLineEdit::Normal,
n, &ok);
if (ok && !n.isEmpty()) {
setName(n);
diff --git a/umbrello/widgets/associationwidget.cpp b/umbrello/widgets/associationwidget.cpp
index 4ef3b93..3fd8f2c 100644
--- a/umbrello/widgets/associationwidget.cpp
+++ b/umbrello/widgets/associationwidget.cpp
@@ -36,12 +36,12 @@
#include "widget_utils.h"
// kde includes
-#include <kinputdialog.h>
#include <kfontdialog.h>
#include <klocale.h>
#include <kcolordialog.h>
// qt includes
+#include <QInputDialog>
#include <QPainterPath>
#include <QPointer>
#include <QRegExpValidator>
@@ -3033,9 +3033,11 @@ void AssociationWidget::slotMenuSelection(QAction* action)
oldText = m_role[r].multiplicityWidget->text();
else
oldText = QString();
- newText = KInputDialog::getText(i18n("Multiplicity"),
+ newText = QInputDialog::getText(m_scene->activeView(),
+ i18n("Multiplicity"),
i18n("Enter multiplicity:"),
- oldText, NULL, m_scene->activeView(), &v);
+ QLineEdit::Normal,
+ oldText, NULL); //FIXME KF5 ", &v);"
if (newText != oldText) {
if (FloatingTextWidget::isTextValid(newText)) {
setMultiplicity(newText, r);
@@ -3051,9 +3053,11 @@ void AssociationWidget::slotMenuSelection(QAction* action)
oldText = m_nameWidget->text();
else
oldText = QString();
- newText = KInputDialog::getText(i18n("Association Name"),
+ newText = QInputDialog::getText(m_scene->activeView(),
+ i18n("Association Name"),
i18n("Enter association name:"),
- oldText, NULL, m_scene->activeView(), &v);
+ QLineEdit::Normal,
+ oldText, NULL); //FIXME KF5 ", &v);"
if (newText != oldText) {
if (FloatingTextWidget::isTextValid(newText)) {
setName(newText);
@@ -3071,9 +3075,11 @@ void AssociationWidget::slotMenuSelection(QAction* action)
oldText = m_role[r].roleWidget->text();
else
oldText = QString();
- newText = KInputDialog::getText(i18n("Role Name"),
+ newText = QInputDialog::getText(m_scene->activeView(),
+ i18n("Role Name"),
i18n("Enter role name:"),
- oldText, NULL, m_scene->activeView(), &v);
+ QLineEdit::Normal,
+ oldText, NULL); //FIXME KF5 ", &v);"
if (newText != oldText) {
if (FloatingTextWidget::isTextValid(newText)) {
setRoleName(newText, r);
diff --git a/umbrello/widgets/combinedfragmentwidget.cpp b/umbrello/widgets/combinedfragmentwidget.cpp
index 07af9ed..ab2ef8b 100644
--- a/umbrello/widgets/combinedfragmentwidget.cpp
+++ b/umbrello/widgets/combinedfragmentwidget.cpp
@@ -21,10 +21,11 @@
#include "umlview.h"
// kde includes
-#include <klocale.h>
#include <kinputdialog.h>
+#include <klocale.h>
// qt includes
+#include <QInputDialog>
#include <QPainter>
#include <QString>
@@ -404,13 +405,22 @@ void CombinedFragmentWidget::slotMenuSelection(QAction* action)
QString name = m_Text;
if (m_CombinedFragment == Alt) {
- name = KInputDialog::getText(i18n("Enter first alternative"), i18n("Enter first alternative :"), m_Text, &ok);
+ name = QInputDialog::getText(Q_NULLPTR,
+ i18n("Enter first alternative"), i18n("Enter first alternative :"),
+ QLineEdit::Normal,
+ m_Text, &ok);
}
else if (m_CombinedFragment == Ref) {
- name = KInputDialog::getText(i18n("Enter referenced diagram name"), i18n("Enter referenced diagram name :"), m_Text, &ok);
+ name = QInputDialog::getText(Q_NULLPTR,
+ i18n("Enter referenced diagram name"), i18n("Enter referenced diagram name :"),
+ QLineEdit::Normal,
+ m_Text, &ok);
}
else if (m_CombinedFragment == Loop) {
- name = KInputDialog::getText(i18n("Enter the guard of the loop"), i18n("Enter the guard of the loop:"), m_Text, &ok);
+ name = QInputDialog::getText(Q_NULLPTR,
+ i18n("Enter the guard of the loop"), i18n("Enter the guard of the loop:"),
+ QLineEdit::Normal,
+ m_Text, &ok);
}
if (ok && name.length() > 0)
m_Text = name;
diff --git a/umbrello/widgets/floatingdashlinewidget.cpp b/umbrello/widgets/floatingdashlinewidget.cpp
index 815ba16..1c1fe8d 100644
--- a/umbrello/widgets/floatingdashlinewidget.cpp
+++ b/umbrello/widgets/floatingdashlinewidget.cpp
@@ -12,7 +12,6 @@
#include "combinedfragmentwidget.h"
//kde includes
-#include <kinputdialog.h>
#include <klocale.h>
//app includes
@@ -22,6 +21,7 @@
#include "listpopupmenu.h"
// qt includes
+#include <QInputDialog>
#include <QPainter>
DEBUG_REGISTER_DISABLED(FloatingDashLineWidget)
@@ -102,7 +102,10 @@ void FloatingDashLineWidget::slotMenuSelection(QAction* action)
{
bool ok = false;
QString name = m_Text;
- name = KInputDialog::getText(i18n("Enter alternative Name"), i18n("Enter the alternative:"), m_Text, &ok);
+ name = QInputDialog::getText(Q_NULLPTR,
+ i18n("Enter alternative Name"), i18n("Enter the alternative:"),
+ QLineEdit::Normal,
+ m_Text, &ok);
if (ok && name.length() > 0)
m_Text = name;
}
diff --git a/umbrello/widgets/floatingtextwidget.cpp b/umbrello/widgets/floatingtextwidget.cpp
index ec9af68..b443920 100644
--- a/umbrello/widgets/floatingtextwidget.cpp
+++ b/umbrello/widgets/floatingtextwidget.cpp
@@ -32,10 +32,10 @@
// kde includes
#include <kfontdialog.h>
-#include <kinputdialog.h>
#include <klocale.h>
// qt includes
+#include <QInputDialog>
#include <QPointer>
#include <QRegExp>
#include <QPainter>
@@ -202,7 +202,10 @@ void FloatingTextWidget::setTextcmd(const QString &t)
void FloatingTextWidget::showChangeTextDialog()
{
bool ok = false;
- QString newText = KInputDialog::getText(i18n("Change Text"), i18n("Enter new text:"), text(), &ok, m_scene->activeView());
+ QString newText = QInputDialog::getText(m_scene->activeView(),
+ i18n("Change Text"), i18n("Enter new text:"),
+ QLineEdit::Normal,
+ text(), &ok);
if (ok && newText != text() && isTextValid(newText)) {
setText(newText);
@@ -406,7 +409,10 @@ void FloatingTextWidget::handleRename()
t = i18n("ERROR");
}
bool ok = false;
- QString newText = KInputDialog::getText(i18n("Rename"), t, text(), &ok, m_scene->activeView(), &v);
+ QString newText = QInputDialog::getText(m_scene->activeView(),
+ i18n("Rename"), t,
+ QLineEdit::Normal,
+ text(), &ok); //FIXME KF5 ", &v);"
if (!ok || newText == text()) {
return;
}
@@ -757,9 +763,11 @@ void FloatingTextWidget::slotMenuSelection(QAction* action)
UMLClassifier* c = m_linkWidget->operationOwner();
if (c == 0) {
bool ok = false;
- QString opText = KInputDialog::getText(i18nc("operation name", "Name"),
+ QString opText = QInputDialog::getText(m_scene->activeView(),
+ i18nc("operation name", "Name"),
i18n("Enter operation name:"),
- text(), &ok, m_scene->activeView());
+ QLineEdit::Normal,
+ text(), &ok);
if (ok)
m_linkWidget->setCustomOpText(opText);
return;
diff --git a/umbrello/widgets/notewidget.cpp b/umbrello/widgets/notewidget.cpp
index 8d5a15e..164ed26 100644
--- a/umbrello/widgets/notewidget.cpp
+++ b/umbrello/widgets/notewidget.cpp
@@ -23,9 +23,9 @@
// kde includes
#include <klocale.h>
#include <kcolordialog.h>
-#include <kinputdialog.h>
// qt includes
+#include <QInputDialog>
#include <QPainter>
NoteWidget * NoteWidget::s_pCurrentNote;
@@ -184,8 +184,9 @@ void NoteWidget::askForNoteType(UMLWidget* &targetWidget)
<< i18n("Postcondition")
<< i18n("Transformation");
bool pressedOK = false;
- QString type = KInputDialog::getItem (i18n("Note Type"), i18n("Select the Note Type"), list,
- 0, false, &pressedOK, UMLApp::app());
+ QString type = QInputDialog::getItem (UMLApp::app(),
+ i18n("Note Type"), i18n("Select the Note Type"), list,
+ 0, false, &pressedOK);
if (pressedOK) {
dynamic_cast<NoteWidget*>(targetWidget)->setNoteType(type);
diff --git a/umbrello/widgets/objectnodewidget.cpp b/umbrello/widgets/objectnodewidget.cpp
index dd1868a..387b5be 100644
--- a/umbrello/widgets/objectnodewidget.cpp
+++ b/umbrello/widgets/objectnodewidget.cpp
@@ -24,10 +24,10 @@
// kde includes
#include <klocale.h>
-#include <kinputdialog.h>
#include <kdialog.h>
// qt includes
+#include <QInputDialog>
#include <QPainter>
#include <QPointer>
@@ -234,9 +234,11 @@ void ObjectNodeWidget::slotMenuSelection(QAction* action)
{
bool ok = false;
QString text = name();
- text = KInputDialog::getText(i18n("Enter Object Node Name"),
- i18n("Enter the name of the object node :"),
- name(), &ok);
+ text = QInputDialog::getText(Q_NULLPTR,
+ i18n("Enter Object Node Name"),
+ i18n("Enter the name of the object node :"),
+ QLineEdit::Normal,
+ name(), &ok);
if (ok && !text.isEmpty()) {
setName(text);
}
@@ -308,7 +310,9 @@ void ObjectNodeWidget::askForObjectNodeType(UMLWidget* &targetWidget)
<< QLatin1String("Data store")
<< QLatin1String("Object Flow");
- QString type = KInputDialog::getItem (i18n("Select Object node type"), i18n("Select the object node type"), list, current, false, &pressedOK, UMLApp::app());
+ QString type = QInputDialog::getItem (UMLApp::app(),
+ i18n("Select Object node type"), i18n("Select the object node type"),
+ list, current, false, &pressedOK);
if (pressedOK) {
dynamic_cast<ObjectNodeWidget*>(targetWidget)->setObjectNodeType(type);
@@ -334,7 +338,10 @@ void ObjectNodeWidget::askForObjectNodeType(UMLWidget* &targetWidget)
void ObjectNodeWidget::askStateForWidget()
{
bool pressedOK = false;
- QString state = KInputDialog::getText(i18n("Enter Object Flow State"), i18n("Enter State (keep '-' if there is no state for the object) "), i18n("-"), &pressedOK, UMLApp::app());
+ QString state = QInputDialog::getText(UMLApp::app(),
+ i18n("Enter Object Flow State"), i18n("Enter State (keep '-' if there is no state for the object) "),
+ QLineEdit::Normal,
+ i18n("-"), &pressedOK);
if (pressedOK) {
setState(state);
diff --git a/umbrello/widgets/objectwidget.cpp b/umbrello/widgets/objectwidget.cpp
index f93f4f2..4d913d7 100644
--- a/umbrello/widgets/objectwidget.cpp
+++ b/umbrello/widgets/objectwidget.cpp
@@ -26,9 +26,9 @@
// kde includes
#include <klocale.h>
-#include <kinputdialog.h>
// qt includes
+#include <QInputDialog>
#include <QPointer>
#include <QPainter>
#include <QValidator>
@@ -163,13 +163,12 @@ void ObjectWidget::slotMenuSelection(QAction* action)
{
bool ok;
QRegExpValidator* validator = new QRegExpValidator(QRegExp(QLatin1String(".*")), 0);
- QString name = KInputDialog::getText
- (i18n("Rename Object"),
- i18n("Enter object name:"),
- m_instanceName,
- &ok,
- m_scene->activeView(),
- validator);
+ QString name = QInputDialog::getText(m_scene->activeView(),
+ i18n("Rename Object"),
+ i18n("Enter object name:"),
+ QLineEdit::Normal,
+ m_instanceName,
+ &ok); //FIXME KF5 ", validator);"
if (ok) {
m_instanceName = name;
updateGeometry();
diff --git a/umbrello/widgets/pinwidget.cpp b/umbrello/widgets/pinwidget.cpp
index 64d7126..2594e71 100644
--- a/umbrello/widgets/pinwidget.cpp
+++ b/umbrello/widgets/pinwidget.cpp
@@ -19,10 +19,10 @@
#include "activitywidget.h"
// kde includes
-#include <kinputdialog.h>
#include <klocale.h>
// qt includes
+#include <QInputDialog>
#include <QPainter>
DEBUG_REGISTER_DISABLED(PinWidget)
@@ -74,8 +74,10 @@ void PinWidget::slotMenuSelection(QAction* action)
{
bool ok = false;
QString name = m_Text;
- name = KInputDialog::getText(i18n("Enter Pin Name"),
+ name = QInputDialog::getText(Q_NULLPTR,
+ i18n("Enter Pin Name"),
i18n("Enter the pin name :"),
+ QLineEdit::Normal,
m_Text, &ok);
if (ok) {
setName(name);
diff --git a/umbrello/widgets/portwidget.cpp b/umbrello/widgets/portwidget.cpp
index 423465e..56430c3 100644
--- a/umbrello/widgets/portwidget.cpp
+++ b/umbrello/widgets/portwidget.cpp
@@ -21,10 +21,10 @@
#include "floatingtextwidget.h"
// kde includes
-#include <kinputdialog.h>
#include <klocale.h>
// qt includes
+#include <QInputDialog>
#include <QPainter>
#include <QToolTip>
@@ -79,7 +79,9 @@ void PortWidget::slotMenuSelection(QAction* action)
{
bool ok = false;
QString newName;
- newName = KInputDialog::getText(i18n("Enter Port Name"), i18n("Enter the port name :"),
+ newName = QInputDialog::getText(Q_NULLPTR,
+ i18n("Enter Port Name"), i18n("Enter the port name :"),
+ QLineEdit::Normal,
name(), &ok);
if (ok) {
setName(newName);
diff --git a/umbrello/widgets/preconditionwidget.cpp b/umbrello/widgets/preconditionwidget.cpp
index e35ffc7..068270a 100644
--- a/umbrello/widgets/preconditionwidget.cpp
+++ b/umbrello/widgets/preconditionwidget.cpp
@@ -21,10 +21,10 @@
#include "idchangelog.h"
// kde includes
-#include <kinputdialog.h>
#include <klocale.h>
// qt includes
+#include <QInputDialog>
#include <QPainter>
DEBUG_REGISTER_DISABLED(PreconditionWidget)
@@ -256,9 +256,11 @@ void PreconditionWidget::slotMenuSelection(QAction* action)
{
bool ok = false;
QString text = name();
- text = KInputDialog::getText(i18n("Enter Precondition Name"),
- i18n("Enter the precondition :"),
- text, &ok);
+ text = QInputDialog::getText(Q_NULLPTR,
+ i18n("Enter Precondition Name"),
+ i18n("Enter the precondition :"),
+ QLineEdit::Normal,
+ text, &ok);
if (ok && !text.isEmpty()) {
setName(text);
}
diff --git a/umbrello/widgets/signalwidget.cpp b/umbrello/widgets/signalwidget.cpp
index 91ea1e8..1737790 100644
--- a/umbrello/widgets/signalwidget.cpp
+++ b/umbrello/widgets/signalwidget.cpp
@@ -25,10 +25,10 @@
// kde includes
#include <klocale.h>
-#include <kinputdialog.h>
// qt includes
#include <QEvent>
+#include <QInputDialog>
#include <QPolygon>
/**
@@ -323,8 +323,10 @@ void SignalWidget::slotMenuSelection(QAction* action)
{
bool ok = false;
QString name = m_Text;
- name = KInputDialog::getText(i18n("Enter signal name"),
+ name = QInputDialog::getText(Q_NULLPTR,
+ i18n("Enter signal name"),
i18n("Enter the signal name :"),
+ QLineEdit::Normal,
m_Text, &ok);
if (ok && name.length() > 0) {
setName(name);
diff --git a/umbrello/widgets/statewidget.cpp b/umbrello/widgets/statewidget.cpp
index 60c5e11..47de970 100644
--- a/umbrello/widgets/statewidget.cpp
+++ b/umbrello/widgets/statewidget.cpp
@@ -24,9 +24,9 @@
// kde includes
#include <klocale.h>
-#include <kinputdialog.h>
// qt includes
+#include <QInputDialog>
#include <QPointer>
/**
@@ -480,9 +480,11 @@ void StateWidget::slotMenuSelection(QAction* action)
ListPopupMenu::MenuType sel = ListPopupMenu::typeFromAction(action);
switch(sel) {
case ListPopupMenu::mt_Rename:
- nameNew = KInputDialog::getText(i18n("Enter State Name"),
- i18n("Enter the name of the new state:"),
- name(), &ok);
+ nameNew = QInputDialog::getText(Q_NULLPTR,
+ i18n("Enter State Name"),
+ i18n("Enter the name of the new state:"),
+ QLineEdit::Normal,
+ name(), &ok);
if (ok && nameNew.length() > 0) {
setName(nameNew);
}
@@ -493,9 +495,11 @@ void StateWidget::slotMenuSelection(QAction* action)
break;
case ListPopupMenu::mt_New_Activity:
- nameNew = KInputDialog::getText(i18n("Enter Activity"),
- i18n("Enter the name of the new activity:"),
- i18n("new activity"), &ok);
+ nameNew = QInputDialog::getText(Q_NULLPTR,
+ i18n("Enter Activity"),
+ i18n("Enter the name of the new activity:"),
+ QLineEdit::Normal,
+ i18n("new activity"), &ok);
if (ok && nameNew.length() > 0) {
addActivity(nameNew);
}
diff --git a/umbrello/widgets/toolbarstateonewidget.cpp b/umbrello/widgets/toolbarstateonewidget.cpp
index 38879ca..de89e29 100644
--- a/umbrello/widgets/toolbarstateonewidget.cpp
+++ b/umbrello/widgets/toolbarstateonewidget.cpp
@@ -32,7 +32,9 @@
// kde includes
#include <klocale.h>
#include <kmessagebox.h>
-#include <kinputdialog.h>
+
+// qt includes
+#include <QInputDialog>
// using namespace Uml;
@@ -189,8 +191,11 @@ void ToolBarStateOneWidget::setWidget(UMLWidget* firstObject)
// Create the widget. Some setup functions can remove the widget.
} else if (m_firstObject->baseType() == WidgetBase::wt_Component) {
bool pressedOK = false;
- QString name = KInputDialog::getText(i18n("Enter Port Name"), i18n("Enter the port"), i18n("new port"),
- &pressedOK, UMLApp::app());
+ QString name = QInputDialog::getText(UMLApp::app(),
+ i18n("Enter Port Name"), i18n("Enter the port"),
+ QLineEdit::Normal,
+ i18n("new port"),
+ &pressedOK);
if (pressedOK) {
UMLPackage* component = static_cast<UMLPackage*>(m_firstObject->umlObject());
UMLObject *port = Object_Factory::createUMLObject(UMLObject::ot_Port, name, component);