]> Shamusworld >> Repos - architektonas/blobdiff - src/applicationwindow.cpp
Preliminary Add Line tool work...
[architektonas] / src / applicationwindow.cpp
index 3ade28491bb30af8ec1faa3c62fc800875dfc7ae..23374171066c7ac90c2aa9f4d5e87ca641b777cf 100644 (file)
@@ -103,6 +103,15 @@ void ApplicationWindow::RotateTool(void)
        drawing->SetRotateToolActive(rotateAct->isChecked());
 }
 
+void ApplicationWindow::AddLineTool(void)
+{
+       addCircleAct->setChecked(false);
+       addArcAct->setChecked(false);
+       rotateAct->setChecked(false);
+       RotateTool();
+       drawing->SetAddLineToolActive(addLineAct->isChecked());
+}
+
 void ApplicationWindow::ZoomInTool(void)
 {
        double zoomFactor = 2.0;
@@ -204,11 +213,12 @@ void ApplicationWindow::CreateActions(void)
        addDimensionAct = CreateAction(tr("Add &Dimension"), tr("Add Dimension"), tr("Adds a dimension to the drawing."), QIcon(":/res/dimension-tool.png"), QKeySequence("D,I"), true);
        connect(addDimensionAct, SIGNAL(triggered()), this, SLOT(DimensionTool()));
 
-       addLineAct = CreateAction(tr("Add &Line"), tr("Add Line"), tr("Adds a line to the drawing."), QIcon(":/res/generic-tool.png"), QKeySequence(), true);
+       addLineAct = CreateAction(tr("Add &Line"), tr("Add Line"), tr("Adds lines to the drawing."), QIcon(":/res/generic-tool.png"), QKeySequence("A,L"), true);
+       connect(addLineAct, SIGNAL(triggered()), this, SLOT(AddLineTool()));
 
-       addCircleAct = CreateAction(tr("Add &Circle"), tr("Add Circle"), tr("Adds a circle to the drawing."), QIcon(":/res/generic-tool.png"), QKeySequence(), true);
+       addCircleAct = CreateAction(tr("Add &Circle"), tr("Add Circle"), tr("Adds circles to the drawing."), QIcon(":/res/generic-tool.png"), QKeySequence("A,C"), true);
 
-       addArcAct = CreateAction(tr("Add &Arc"), tr("Add Arc"), tr("Adds an arc to the drawing."), QIcon(":/res/generic-tool.png"), QKeySequence(), true);
+       addArcAct = CreateAction(tr("Add &Arc"), tr("Add Arc"), tr("Adds arcs to the drawing."), QIcon(":/res/generic-tool.png"), QKeySequence("A,A"), true);
 
        aboutAct = CreateAction(tr("About &Architektonas"), tr("About Architektonas"), tr("Gives information about this program."), QIcon(":/res/generic-tool.png"), QKeySequence());
        connect(aboutAct, SIGNAL(triggered()), this, SLOT(HelpAbout()));
@@ -216,7 +226,7 @@ void ApplicationWindow::CreateActions(void)
        rotateAct = CreateAction(tr("&Rotate Objects"), tr("Rotate"), tr("Rotate object(s) around an arbitrary center."), QIcon(":/res/generic-tool.png"), QKeySequence(tr("R,O")), true);
        connect(rotateAct, SIGNAL(triggered()), this, SLOT(RotateTool()));
 
-       zoomInAct = CreateAction2(tr("Zoom &In"), tr("Zoom In"), tr("Zoom in on the document."), QIcon(":/res/zoom-in.png"), QKeySequence(tr("+")), QKeySequence(tr("=")));
+       zoomInAct = CreateAction(tr("Zoom &In"), tr("Zoom In"), tr("Zoom in on the document."), QIcon(":/res/zoom-in.png"), QKeySequence(tr("+")), QKeySequence(tr("=")));
        connect(zoomInAct, SIGNAL(triggered()), this, SLOT(ZoomInTool()));
 
        zoomOutAct = CreateAction(tr("Zoom &Out"), tr("Zoom Out"), tr("Zoom out of the document."), QIcon(":/res/zoom-out.png"), QKeySequence(tr("-")));
@@ -263,7 +273,7 @@ QAction * ApplicationWindow::CreateAction(QString name, QString tooltip, QString
 // This is essentially the same as the previous function, but this allows more
 // than one key sequence to be added as key shortcuts.
 //
-QAction * ApplicationWindow::CreateAction2(QString name, QString tooltip, QString statustip,
+QAction * ApplicationWindow::CreateAction(QString name, QString tooltip, QString statustip,
        QIcon icon, QKeySequence key1, QKeySequence key2, bool checkable/*= false*/)
 {
        QAction * action = new QAction(icon, name, this);