#include "blockwidget.h"
#include "commandprocessor.h"
#include "consolewidget.h"
+#include "drawingsettingsdlg.h"
#include "drawingview.h"
#include "fileio.h"
#include "generaltab.h"
// Do object rendering...
for(int i=0; i<Global::numLayers; i++)
- drawing->RenderObjects(&painter, drawing->document.objects, i);
+ {
+ if (Global::layerHidden[i] == false)
+ drawing->RenderObjects(&painter, drawing->document.objects, i);
+ }
// Restore vars
Global::origin = originSave;
QAction * actionList[] = {
addArcAct, addLineAct, addCircleAct, addDimensionAct, addPolygonAct,
addSplineAct, deleteAct, rotateAct, mirrorAct, trimAct,
- triangulateAct, 0
+ triangulateAct, parallelAct, 0
};
for(int i=0; actionList[i]!=0; i++)
else
Global::tool = TTNone;
- cw->SetToolPrompt();//cw->cmdline);
+ cw->SetToolPrompt();
drawing->update();
}
WriteSettings();
}
+void ApplicationWindow::DrawingSettings(void)
+{
+ DrawingSettingsDlg dlg(this);
+ dlg.baseUnit->setCurrentIndex(drawing->document.baseUnit);
+ dlg.unitStyle->setCurrentIndex(drawing->document.unitStyle);
+ dlg.decimalPrecision->setCurrentIndex(drawing->document.decimalPrecision);
+ dlg.fractionalPrecision->setCurrentIndex(drawing->document.fractionalPrecision);
+
+ if (dlg.exec() == false)
+ return;
+
+ // Deal with stuff here (since user hit "OK" button...)
+ drawing->document.baseUnit = dlg.baseUnit->currentIndex();
+ drawing->document.unitStyle = dlg.unitStyle->currentIndex();
+ drawing->document.decimalPrecision= dlg.decimalPrecision->currentIndex();
+ drawing->document.fractionalPrecision = dlg.fractionalPrecision->currentIndex();
+ drawing->update();
+}
+
//
// Group a bunch of selected objects (which can include other groups) together
// or ungroup a selected group.
settingsAct = CreateAction(tr("&Settings"), tr("Settings"), tr("Change certain defaults for Architektonas."), QIcon(":/res/settings.png"), QKeySequence());
connect(settingsAct, SIGNAL(triggered()), this, SLOT(Settings()));
+ drawingSettingsAct = CreateAction(tr("&Drawing Settings"), tr("Drawing settings"), tr("Change certain defaults for the current drawing."), QIcon(":/res/settings.png"), QKeySequence());
+ connect(drawingSettingsAct, SIGNAL(triggered()), this, SLOT(DrawingSettings()));
+
groupAct = CreateAction(tr("&Group"), tr("Group"), tr("Group/ungroup selected objects."), QIcon(":/res/group-tool.png"), QKeySequence("g"));
connect(groupAct, SIGNAL(triggered()), this, SLOT(HandleGrouping()));
menu->addAction(addSplineAct);
menu->addAction(addDimensionAct);
menu->addSeparator();
+ menu->addAction(drawingSettingsAct);
menu->addAction(settingsAct);
menu = menuBar()->addMenu(tr("&Help"));
QPoint pos = settings.value("pos", QPoint(200, 200)).toPoint();
QSize size = settings.value("size", QSize(400, 400)).toSize();
drawing->useAntialiasing = settings.value("useAntialiasing", true).toBool();
- snapToGridAct->setChecked(settings.value("snapToGrid", true).toBool());
+ Global::snapToGrid = settings.value("snapToGrid", true).toBool();
+ snapToGridAct->setChecked(Global::snapToGrid);
resize(size);
move(pos);
restoreState(settings.value("windowState").toByteArray());