~ubuntu-branches/ubuntu/intrepid/kdesdk/intrepid-updates

« back to all changes in this revision

Viewing changes to umbrello/umbrello/cmds/cmd_create_componentdiag.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2008-05-28 10:11:43 UTC
  • mto: This revision was merged to the branch mainline in revision 37.
  • Revision ID: james.westby@ubuntu.com-20080528101143-gzc3styjz1b70zxu
Tags: upstream-4.0.80
ImportĀ upstreamĀ versionĀ 4.0.80

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *                                                                         *
 
3
 *   This program is free software; you can redistribute it and/or modify  *
 
4
 *   it under the terms of the GNU General Public License as published by  *
 
5
 *   the Free Software Foundation; either version 2 of the License, or     *
 
6
 *   (at your option) any later version.                                   *
 
7
 *                                                                         *
 
8
 *  copyright (C) 2002-2006                                                *
 
9
 *  Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                   *
 
10
 ***************************************************************************/
 
11
 
 
12
#include "cmd_create_componentdiag.h"
 
13
 
 
14
#include "uml.h"
 
15
 
 
16
#include <klocale.h>
 
17
 
 
18
namespace Uml
 
19
{
 
20
 
 
21
    cmdCreateComponentDiag::cmdCreateComponentDiag(UMLDoc* doc, const QString& name):m_pUMLDoc(doc),m_pUMLView(NULL),m_Name(name)
 
22
    {
 
23
        setText(i18n("Create component diagram"));
 
24
    }
 
25
 
 
26
    cmdCreateComponentDiag::~cmdCreateComponentDiag()
 
27
    {
 
28
    }
 
29
 
 
30
    void cmdCreateComponentDiag::redo()
 
31
    {
 
32
        UMLFolder* temp = m_pUMLDoc->getRootFolder(Uml::mt_Component);
 
33
        m_pUMLView = m_pUMLDoc->createDiagram(temp, Uml::dt_Component);
 
34
    }
 
35
 
 
36
    void cmdCreateComponentDiag::undo()
 
37
    {
 
38
        if(m_pUMLView)
 
39
        {
 
40
            m_pUMLDoc->removeDiagram(m_pUMLView->getID());
 
41
        }
 
42
    }
 
43
 
 
44
}