~ubuntu-branches/ubuntu/saucy/rocs/saucy

« back to all changes in this revision

Viewing changes to VisualEditor/Tools/AssignValues/AssignValuesToolsPlugin.cpp

  • Committer: Package Import Robot
  • Author(s): Rohan Garg, Rohan Garg, Philip Muškovac
  • Date: 2013-06-21 02:04:20 UTC
  • mfrom: (1.1.27)
  • Revision ID: package-import@ubuntu.com-20130621020420-lzlui9y7qc6w3xog
Tags: 4:4.10.80-0ubuntu1
[ Rohan Garg ]
* New upstream release

[ Philip Muškovac ]
* Build-depend on libgrantlee-dev and libx11-dev
* Update rocs.install and not-installed 

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
#include <CoreTypes.h>
23
23
#include <Document.h>
24
24
#include <DataStructure.h>
 
25
#include <DocumentManager.h>
25
26
 
26
27
#include <QtCore/QString>
27
28
#include <QtCore/QStringList>
54
55
 
55
56
}
56
57
 
57
 
QString AssignValuesToolPlugin::run(QObject* doc) const
 
58
void AssignValuesToolPlugin::run(Document *document) const
58
59
{
59
 
    Document* graphDoc = qobject_cast<Document*> (doc);
60
 
    QPointer<AssignValuesWidget> dialog = new AssignValuesWidget(graphDoc);
 
60
    if (document == 0) {
 
61
        document = DocumentManager::self().activeDocument();
 
62
    }
 
63
    QPointer<AssignValuesWidget> dialog = new AssignValuesWidget(document);
61
64
 
62
65
    // data structures to selector box
63
 
    QList< DataStructurePtr > dsList = graphDoc->dataStructures();
 
66
    QList< DataStructurePtr > dsList = document->dataStructures();
64
67
    QStringList dsNames;
65
68
    foreach(DataStructurePtr ds, dsList) {
66
69
        dsNames << ds->name();
68
71
    dialog->addDataStructures(dsNames);
69
72
 
70
73
    dialog->exec();
71
 
    return "";
 
74
    return;
72
75
}