[Uml-devel] kdesdk/umbrello/umbrello
Jonathan Riddell
jri at jriddell.org
Tue Jul 22 11:08:07 UTC 2003
CVS commit by jriddell:
Allow entry of an empty object widget name.
call setModified() after changing object widget name so undo can be done.
M +8 -4 objectwidget.cpp 1.15
--- kdesdk/umbrello/umbrello/objectwidget.cpp #1.14:1.15
@@ -9,4 +9,5 @@
#include <qpainter.h>
+#include <qvalidator.h>
#include <klineeditdlg.h>
@@ -79,15 +80,18 @@ void ObjectWidget::slotMenuSelection(int
switch(sel) {
case ListPopupMenu::mt_Rename_Object:
-
+ {
bool ok;
- name = KLineEditDlg::getText(i18n("Enter object name:"), ((ObjectWidgetData*)m_pData)->m_InstanceName, &ok, m_pView);
- if(ok) {
+ QRegExpValidator* validator = new QRegExpValidator(QRegExp(".*"), 0);
+ name = KLineEditDlg::getText(i18n("Enter object name:"), ((ObjectWidgetData*)m_pData)->m_InstanceName, &ok, m_pView, validator);
+ if (ok) {
((ObjectWidgetData*)m_pData)->m_InstanceName = name;
calculateSize();
moveEvent( 0 );
update();
+ m_pView->getDocument()->setModified(true);
}
+ delete validator;
break;
-
+ }
case ListPopupMenu::mt_Properties:
m_pView->getDocument() -> showProperties(this);
More information about the umbrello-devel
mailing list