X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fapplicationwindow.cpp;h=77767f0610ae2a32b9d2df941a48f1db2e97f5b1;hb=f3110724be7ad4d4e8c6b97d350ff8af7fbf3799;hp=a9108eb5f6d3d2b5d96b5280b99e13652013f6ed;hpb=ba6723b86d8dd67ebc7b11b245de3e7ff64f06b1;p=architektonas diff --git a/src/applicationwindow.cpp b/src/applicationwindow.cpp index a9108eb..77767f0 100644 --- a/src/applicationwindow.cpp +++ b/src/applicationwindow.cpp @@ -197,7 +197,17 @@ void ApplicationWindow::FixLength(void) // We want certain tools to be exclusive, and this approach isn't working correctly... void ApplicationWindow::DeleteTool(void) { - + // For this tool, we check first to see if anything is selected. If so, we + // delete those and *don't* select the delete tool. + if (drawing->document.ItemsSelected() > 0) + { + drawing->document.DeleteSelectedItems(); + drawing->update(); + deleteAct->setChecked(false); + return; + } + + // Otherwise, toggle the state of the tool ClearUIToolStatesExcept(deleteAct); SetInternalToolStates(); } @@ -382,10 +392,13 @@ void ApplicationWindow::Settings(void) } +// +// Group a bunch of selected objects (which can include other groups) together +// or ungroup a selected group. +// void ApplicationWindow::HandleGrouping(void) { - // Group a bunch of selected objects together or ungroup a selected group. - + // If nothing selected, do nothing if (drawing->document.ItemsSelected() == 0) { statusBar()->showMessage(tr("No objects selected to make a group from.")); @@ -451,7 +464,7 @@ void ApplicationWindow::CreateActions(void) QIcon(":/res/fix-length.png"), QKeySequence(tr("F,L")), true); connect(fixLengthAct, SIGNAL(triggered()), this, SLOT(FixLength())); - deleteAct = CreateAction(tr("&Delete"), tr("Delete Object"), tr("Deletes selected objects."), QIcon(":/res/delete-tool.png"), QKeySequence(), true); + deleteAct = CreateAction(tr("&Delete"), tr("Delete Object"), tr("Deletes selected objects."), QIcon(":/res/delete-tool.png"), QKeySequence(tr("Delete")), true); connect(deleteAct, SIGNAL(triggered()), this, SLOT(DeleteTool())); addDimensionAct = CreateAction(tr("Add &Dimension"), tr("Add Dimension"), tr("Adds a dimension to the drawing."), QIcon(":/res/dimension-tool.png"), QKeySequence("D,I"), true);