[Uml-devel] kdesdk/umbrello/umbrello
Luis De la Parra Blum
lparrab at gmx.net
Sat May 3 10:42:21 UTC 2003
CVS commit by luis:
ask for name while creating a ( experimental-code) diagram
M +4 -3 uml.cpp 1.36
M +5 -1 umldoc.cpp 1.38
M +1 -1 umldoc.h 1.20
--- kdesdk/umbrello/umbrello/uml.cpp #1.35:1.36
@@ -801,7 +801,8 @@ void UMLApp::UcreateDiagram()
t = Diagram::SequenceDiagram;
Umbrello::Diagram *d =
- getDocument()->UcreateDiagram( t, "FIXME ask for name here" );
-Umbrello::DiagramView *v = new Umbrello::DiagramView(d,getWorkToolBar(),viewStack);
-v->show();
+ getDocument()->UcreateDiagram( t );
+if(!d)
+ return;
+Umbrello::DiagramView *v = d->createView(viewStack);
diagramViews[d->getID()] = v;
kdDebug()<<"diagram created with id = "<<d->getID()<<endl;
--- kdesdk/umbrello/umbrello/umldoc.h #1.19:1.20
@@ -273,5 +273,5 @@ public:
void createDiagram(Diagram_Type type, bool askForName = true);
- Umbrello::Diagram* UcreateDiagram(Umbrello::Diagram::DiagramType, const QString& = QString::null );
+ Umbrello::Diagram* UcreateDiagram(Umbrello::Diagram::DiagramType);
/**
--- kdesdk/umbrello/umbrello/umldoc.cpp #1.37:1.38
@@ -832,6 +832,10 @@ QString UMLDoc::uniqViewName(const Diagr
-Umbrello::Diagram* UMLDoc::UcreateDiagram(Diagram::DiagramType dType, const QString& name)
+Umbrello::Diagram* UMLDoc::UcreateDiagram(Diagram::DiagramType dType)
{
+ bool ok = true;
+ QString name = KLineEditDlg::getText(i18n("Enter name:"), i18n("new_diagram"), &ok, UMLApp::app() );
+ if(!ok)
+ return (Umbrello::Diagram*)0L;
int id = getUniqueID();
Diagram *diagram = new Diagram(dType, this, id, name);
More information about the umbrello-devel
mailing list