X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Factions%2Factionlibraryinsert.cpp;h=3a433dfabbf7ba6c4103e13f58c43620bbcf0d60;hb=f62cebc26c7c3af447f0e4e4c43331f8589dce22;hp=91d43a1302316452e5538750ab041625006e305e;hpb=865303923fcb231a171992b75a73364ff469ff8c;p=architektonas diff --git a/src/actions/actionlibraryinsert.cpp b/src/actions/actionlibraryinsert.cpp index 91d43a1..3a433df 100644 --- a/src/actions/actionlibraryinsert.cpp +++ b/src/actions/actionlibraryinsert.cpp @@ -16,16 +16,16 @@ #include "actionlibraryinsert.h" -#include "rs_commandevent.h" -#include "rs_dialogfactory.h" +#include "commandevent.h" +#include "dialogfactory.h" #include "graphicview.h" -#include "rs_preview.h" -#include "rs_units.h" +#include "preview.h" +#include "units.h" /** * Constructor. */ -ActionLibraryInsert::ActionLibraryInsert(RS_EntityContainer & container, GraphicView & graphicView): +ActionLibraryInsert::ActionLibraryInsert(EntityContainer & container, GraphicView & graphicView): ActionInterface("Library Insert", container, graphicView) { } @@ -59,12 +59,12 @@ void ActionLibraryInsert::setFile(const QString & file) data.file = file; if (!prev.open(file, RS2::FormatUnknown)) - RS_DIALOGFACTORY->commandMessage(tr("Cannot open file '%1'").arg(file)); + DIALOGFACTORY->commandMessage(tr("Cannot open file '%1'").arg(file)); } void ActionLibraryInsert::reset() { - /*data = RS_InsertData("", + /*data = InsertData("", Vector(0.0,0.0), Vector(1.0,1.0), 0.0, @@ -84,7 +84,7 @@ void ActionLibraryInsert::trigger() deletePreview(); clearPreview(); - RS_Creation creation(container, graphicView); + Creation creation(container, graphicView); creation.createLibraryInsert(data); graphicView->redraw(); @@ -106,7 +106,7 @@ void ActionLibraryInsert::mouseMoveEvent(QMouseEvent * e) // unit conversion: if (graphic) { - double uf = RS_Units::convert(1.0, prev.getUnit(), graphic->getUnit()); + double uf = Units::convert(1.0, prev.getUnit(), graphic->getUnit()); // preview->scale(data.insertionPoint, Vector(uf, uf)); } @@ -142,13 +142,13 @@ void ActionLibraryInsert::coordinateEvent(Vector * e) trigger(); } -void ActionLibraryInsert::commandEvent(RS_CommandEvent * e) +void ActionLibraryInsert::commandEvent(CommandEvent * e) { QString c = e->getCommand().toLower(); if (checkCommand("help", c)) { - RS_DIALOGFACTORY->commandMessage(msgAvailableCommands() + getAvailableCommands().join(", ")); + DIALOGFACTORY->commandMessage(msgAvailableCommands() + getAvailableCommands().join(", ")); return; } @@ -177,14 +177,14 @@ void ActionLibraryInsert::commandEvent(RS_CommandEvent * e) case SetAngle: { bool ok; - double a = RS_Math::eval(c, &ok); + double a = Math::eval(c, &ok); if (ok == true) - data.angle = RS_Math::deg2rad(a); + data.angle = Math::deg2rad(a); else - RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression")); + DIALOGFACTORY->commandMessage(tr("Not a valid expression")); - RS_DIALOGFACTORY->requestOptions(this, true, true); + DIALOGFACTORY->requestOptions(this, true, true); setStatus(lastStatus); } break; @@ -192,14 +192,14 @@ void ActionLibraryInsert::commandEvent(RS_CommandEvent * e) case SetFactor: { bool ok; - double f = RS_Math::eval(c, &ok); + double f = Math::eval(c, &ok); if (ok == true) setFactor(f); else - RS_DIALOGFACTORY->commandMessage(tr("Not a valid expression")); + DIALOGFACTORY->commandMessage(tr("Not a valid expression")); - RS_DIALOGFACTORY->requestOptions(this, true, true); + DIALOGFACTORY->requestOptions(this, true, true); setStatus(lastStatus); } break; @@ -231,14 +231,14 @@ void ActionLibraryInsert::showOptions() { ActionInterface::showOptions(); - RS_DIALOGFACTORY->requestOptions(this, true); + DIALOGFACTORY->requestOptions(this, true); } void ActionLibraryInsert::hideOptions() { ActionInterface::hideOptions(); - RS_DIALOGFACTORY->requestOptions(this, false); + DIALOGFACTORY->requestOptions(this, false); } void ActionLibraryInsert::updateMouseButtonHints() @@ -246,19 +246,19 @@ void ActionLibraryInsert::updateMouseButtonHints() switch (getStatus()) { case SetTargetPoint: - RS_DIALOGFACTORY->updateMouseWidget(tr("Specify reference point"), tr("Cancel")); + DIALOGFACTORY->updateMouseWidget(tr("Specify reference point"), tr("Cancel")); break; case SetAngle: - RS_DIALOGFACTORY->updateMouseWidget(tr("Enter angle:"), ""); + DIALOGFACTORY->updateMouseWidget(tr("Enter angle:"), ""); break; case SetFactor: - RS_DIALOGFACTORY->updateMouseWidget(tr("Enter factor:"), ""); + DIALOGFACTORY->updateMouseWidget(tr("Enter factor:"), ""); break; default: - RS_DIALOGFACTORY->updateMouseWidget("", ""); + DIALOGFACTORY->updateMouseWidget("", ""); break; } } @@ -271,9 +271,9 @@ void ActionLibraryInsert::updateMouseCursor() void ActionLibraryInsert::updateToolBar() { if (!isFinished()) - RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); + DIALOGFACTORY->requestToolBar(RS2::ToolBarSnap); else - RS_DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); + DIALOGFACTORY->requestToolBar(RS2::ToolBarMain); } double ActionLibraryInsert::getAngle()