Rename MainWindow files

Sun, 30 Aug 2015 04:53:37 +0300

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Sun, 30 Aug 2015 04:53:37 +0300
changeset 962
a4b463a7ee82
parent 961
f81445a7abde
child 963
c1526d1877d7

Rename MainWindow files

CMakeLists.txt file | annotate | diff | comparison | revisions
src/actions.cpp file | annotate | diff | comparison | revisions
src/actionsEdit.cpp file | annotate | diff | comparison | revisions
src/addObjectDialog.cpp file | annotate | diff | comparison | revisions
src/colors.cpp file | annotate | diff | comparison | revisions
src/configDialog.h file | annotate | diff | comparison | revisions
src/configuration.cpp file | annotate | diff | comparison | revisions
src/dialogs.cpp file | annotate | diff | comparison | revisions
src/dialogs/colorselector.cpp file | annotate | diff | comparison | revisions
src/dialogs/ldrawpathdialog.cpp file | annotate | diff | comparison | revisions
src/editHistory.cpp file | annotate | diff | comparison | revisions
src/editmodes/abstractEditMode.cpp file | annotate | diff | comparison | revisions
src/editmodes/circleMode.cpp file | annotate | diff | comparison | revisions
src/editmodes/linePathMode.cpp file | annotate | diff | comparison | revisions
src/editmodes/magicWandMode.cpp file | annotate | diff | comparison | revisions
src/editmodes/selectMode.cpp file | annotate | diff | comparison | revisions
src/extPrograms.cpp file | annotate | diff | comparison | revisions
src/glRenderer.cpp file | annotate | diff | comparison | revisions
src/ldDocument.cpp file | annotate | diff | comparison | revisions
src/ldObject.cpp file | annotate | diff | comparison | revisions
src/main.cpp file | annotate | diff | comparison | revisions
src/mainWindow.cpp file | annotate | diff | comparison | revisions
src/mainWindow.h file | annotate | diff | comparison | revisions
src/mainwindow.cpp file | annotate | diff | comparison | revisions
src/mainwindow.h file | annotate | diff | comparison | revisions
src/mainwindow.ui file | annotate | diff | comparison | revisions
src/messageLog.cpp file | annotate | diff | comparison | revisions
src/miscallenous.cpp file | annotate | diff | comparison | revisions
src/partDownloader.cpp file | annotate | diff | comparison | revisions
src/primitives.cpp file | annotate | diff | comparison | revisions
ui/ldforge.ui file | annotate | diff | comparison | revisions
--- a/CMakeLists.txt	Sun Aug 30 04:45:16 2015 +0300
+++ b/CMakeLists.txt	Sun Aug 30 04:53:37 2015 +0300
@@ -52,7 +52,7 @@
     src/ldObjectMath.cpp
 	src/ldpaths.cpp
 	src/main.cpp
-	src/mainWindow.cpp
+	src/mainwindow.cpp
 	src/messageLog.cpp
 	src/miscallenous.cpp
 	src/partDownloader.cpp
@@ -95,7 +95,7 @@
 	src/glRenderer.h
 	src/glCompiler.h
 	src/configuration.h
-	src/mainWindow.h
+	src/mainwindow.h
 	src/editHistory.h
 	src/format.h
 	src/ldpaths.h
@@ -124,13 +124,13 @@
 	ui/flip.ui
 	ui/intersector.ui
 	ui/isecalc.ui
-	ui/ldforge.ui
 	ui/makeprim.ui
 	ui/overlay.ui
 	ui/rectifier.ui
 	ui/replcoords.ui
 	ui/rotpoint.ui
 	ui/ytruder.ui
+	src/mainwindow.ui
 	src/dialogs/colorselector.ui
 	src/dialogs/ldrawpathdialog.ui
 	src/dialogs/newpartdialog.ui
--- a/src/actions.cpp	Sun Aug 30 04:45:16 2015 +0300
+++ b/src/actions.cpp	Sun Aug 30 04:53:37 2015 +0300
@@ -24,7 +24,7 @@
 #include <QPushButton>
 #include <QInputDialog>
 
-#include "mainWindow.h"
+#include "mainwindow.h"
 #include "ldDocument.h"
 #include "editHistory.h"
 #include "configDialog.h"
--- a/src/actionsEdit.cpp	Sun Aug 30 04:45:16 2015 +0300
+++ b/src/actionsEdit.cpp	Sun Aug 30 04:53:37 2015 +0300
@@ -22,7 +22,7 @@
 #include <QBoxLayout>
 #include <QClipboard>
 #include <QInputDialog>
-#include "mainWindow.h"
+#include "mainwindow.h"
 #include "main.h"
 #include "ldDocument.h"
 #include "dialogs/colorselector.h"
--- a/src/addObjectDialog.cpp	Sun Aug 30 04:45:16 2015 +0300
+++ b/src/addObjectDialog.cpp	Sun Aug 30 04:53:37 2015 +0300
@@ -25,7 +25,7 @@
 #include <QTreeWidget>
 #include <QLineEdit>
 #include <QPushButton>
-#include "mainWindow.h"
+#include "mainwindow.h"
 #include "addObjectDialog.h"
 #include "ldDocument.h"
 #include "colors.h"
--- a/src/colors.cpp	Sun Aug 30 04:45:16 2015 +0300
+++ b/src/colors.cpp	Sun Aug 30 04:53:37 2015 +0300
@@ -21,7 +21,7 @@
 #include "colors.h"
 #include "ldDocument.h"
 #include "miscallenous.h"
-#include "mainWindow.h"
+#include "mainwindow.h"
 
 struct ColorDataEntry
 {
--- a/src/configDialog.h	Sun Aug 30 04:45:16 2015 +0300
+++ b/src/configDialog.h	Sun Aug 30 04:53:37 2015 +0300
@@ -17,7 +17,7 @@
  */
 
 #pragma once
-#include "mainWindow.h"
+#include "mainwindow.h"
 #include <QDialog>
 
 class Ui_ConfigUI;
--- a/src/configuration.cpp	Sun Aug 30 04:45:16 2015 +0300
+++ b/src/configuration.cpp	Sun Aug 30 04:53:37 2015 +0300
@@ -29,7 +29,7 @@
 #include "main.h"
 #include "configuration.h"
 #include "miscallenous.h"
-#include "mainWindow.h"
+#include "mainwindow.h"
 #include "ldDocument.h"
 #include "glRenderer.h"
 #include "configuration.inc"
--- a/src/dialogs.cpp	Sun Aug 30 04:45:16 2015 +0300
+++ b/src/dialogs.cpp	Sun Aug 30 04:53:37 2015 +0300
@@ -32,7 +32,7 @@
 #include <QUrl>
 #include "dialogs.h"
 #include "radioGroup.h"
-#include "mainWindow.h"
+#include "mainwindow.h"
 #include "glRenderer.h"
 #include "documentation.h"
 #include "ldDocument.h"
--- a/src/dialogs/colorselector.cpp	Sun Aug 30 04:45:16 2015 +0300
+++ b/src/dialogs/colorselector.cpp	Sun Aug 30 04:53:37 2015 +0300
@@ -22,7 +22,7 @@
 #include <QScrollBar>
 #include <QColorDialog>
 #include "../main.h"
-#include "../mainWindow.h"
+#include "../mainwindow.h"
 #include "../colors.h"
 #include "../configuration.h"
 #include "../miscallenous.h"
--- a/src/dialogs/ldrawpathdialog.cpp	Sun Aug 30 04:45:16 2015 +0300
+++ b/src/dialogs/ldrawpathdialog.cpp	Sun Aug 30 04:53:37 2015 +0300
@@ -21,7 +21,7 @@
 #include <QLabel>
 #include "ldrawpathdialog.h"
 #include "ui_ldrawpathdialog.h"
-#include "../mainWindow.h"
+#include "../mainwindow.h"
 
 LDrawPathDialog::LDrawPathDialog (const QString& defaultPath, bool validDefault, QWidget* parent, Qt::WindowFlags f) :
 	QDialog (parent, f),
--- a/src/editHistory.cpp	Sun Aug 30 04:45:16 2015 +0300
+++ b/src/editHistory.cpp	Sun Aug 30 04:53:37 2015 +0300
@@ -20,7 +20,7 @@
 #include "ldObject.h"
 #include "ldDocument.h"
 #include "miscallenous.h"
-#include "mainWindow.h"
+#include "mainwindow.h"
 #include "glRenderer.h"
 
 // =============================================================================
--- a/src/editmodes/abstractEditMode.cpp	Sun Aug 30 04:45:16 2015 +0300
+++ b/src/editmodes/abstractEditMode.cpp	Sun Aug 30 04:53:37 2015 +0300
@@ -25,7 +25,7 @@
 #include "circleMode.h"
 #include "magicWandMode.h"
 #include "linePathMode.h"
-#include "../mainWindow.h"
+#include "../mainwindow.h"
 #include "../glRenderer.h"
 
 CFGENTRY (Bool, DrawLineLengths, true)
--- a/src/editmodes/circleMode.cpp	Sun Aug 30 04:45:16 2015 +0300
+++ b/src/editmodes/circleMode.cpp	Sun Aug 30 04:53:37 2015 +0300
@@ -24,7 +24,7 @@
 #include "../ringFinder.h"
 #include "../primitives.h"
 #include "../glRenderer.h"
-#include "../mainWindow.h"
+#include "../mainwindow.h"
 #include "../ldObjectMath.h"
 
 CircleMode::CircleMode (GLRenderer* renderer) :
--- a/src/editmodes/linePathMode.cpp	Sun Aug 30 04:45:16 2015 +0300
+++ b/src/editmodes/linePathMode.cpp	Sun Aug 30 04:53:37 2015 +0300
@@ -1,6 +1,6 @@
 #include "linePathMode.h"
 #include "../glRenderer.h"
-#include "../mainWindow.h"
+#include "../mainwindow.h"
 #include <QKeyEvent>
 
 LinePathMode::LinePathMode (GLRenderer *renderer) :
--- a/src/editmodes/magicWandMode.cpp	Sun Aug 30 04:45:16 2015 +0300
+++ b/src/editmodes/magicWandMode.cpp	Sun Aug 30 04:53:37 2015 +0300
@@ -19,7 +19,7 @@
 #include <QMouseEvent>
 #include "magicWandMode.h"
 #include "../ldDocument.h"
-#include "../mainWindow.h"
+#include "../mainwindow.h"
 #include "../glRenderer.h"
 
 MagicWandMode::MagicWandMode (GLRenderer* renderer) :
--- a/src/editmodes/selectMode.cpp	Sun Aug 30 04:45:16 2015 +0300
+++ b/src/editmodes/selectMode.cpp	Sun Aug 30 04:53:37 2015 +0300
@@ -20,7 +20,7 @@
 #include "selectMode.h"
 #include "../glRenderer.h"
 #include "../addObjectDialog.h"
-#include "../mainWindow.h"
+#include "../mainwindow.h"
 #include "../glRenderer.h"
 
 SelectMode::SelectMode (GLRenderer* renderer) :
--- a/src/extPrograms.cpp	Sun Aug 30 04:45:16 2015 +0300
+++ b/src/extPrograms.cpp	Sun Aug 30 04:53:37 2015 +0300
@@ -28,7 +28,7 @@
 #include "main.h"
 #include "configuration.h"
 #include "miscallenous.h"
-#include "mainWindow.h"
+#include "mainwindow.h"
 #include "ldDocument.h"
 #include "radioGroup.h"
 #include "editHistory.h"
--- a/src/glRenderer.cpp	Sun Aug 30 04:45:16 2015 +0300
+++ b/src/glRenderer.cpp	Sun Aug 30 04:53:37 2015 +0300
@@ -33,7 +33,7 @@
 #include "ldDocument.h"
 #include "glRenderer.h"
 #include "colors.h"
-#include "mainWindow.h"
+#include "mainwindow.h"
 #include "miscallenous.h"
 #include "editHistory.h"
 #include "dialogs.h"
--- a/src/ldDocument.cpp	Sun Aug 30 04:45:16 2015 +0300
+++ b/src/ldDocument.cpp	Sun Aug 30 04:53:37 2015 +0300
@@ -25,7 +25,7 @@
 #include "configuration.h"
 #include "ldDocument.h"
 #include "miscallenous.h"
-#include "mainWindow.h"
+#include "mainwindow.h"
 #include "editHistory.h"
 #include "glRenderer.h"
 #include "glCompiler.h"
--- a/src/ldObject.cpp	Sun Aug 30 04:45:16 2015 +0300
+++ b/src/ldObject.cpp	Sun Aug 30 04:53:37 2015 +0300
@@ -21,7 +21,7 @@
 #include "ldObject.h"
 #include "ldDocument.h"
 #include "miscallenous.h"
-#include "mainWindow.h"
+#include "mainwindow.h"
 #include "editHistory.h"
 #include "glRenderer.h"
 #include "colors.h"
--- a/src/main.cpp	Sun Aug 30 04:45:16 2015 +0300
+++ b/src/main.cpp	Sun Aug 30 04:53:37 2015 +0300
@@ -22,7 +22,7 @@
 #include <QFile>
 #include <QTextStream>
 #include <QDir>
-#include "mainWindow.h"
+#include "mainwindow.h"
 #include "ldDocument.h"
 #include "miscallenous.h"
 #include "configuration.h"
--- a/src/mainWindow.cpp	Sun Aug 30 04:45:16 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1190 +0,0 @@
-/*
- *  LDForge: LDraw parts authoring CAD
- *  Copyright (C) 2013, 2014 Teemu Piippo
- *
- *  This program is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <QGridLayout>
-#include <QMessageBox>
-#include <QEvent>
-#include <QContextMenuEvent>
-#include <QMenuBar>
-#include <QStatusBar>
-#include <QSplitter>
-#include <QListWidget>
-#include <QToolButton>
-#include <QComboBox>
-#include <QDialogButtonBox>
-#include <QToolBar>
-#include <QProgressBar>
-#include <QLabel>
-#include <QFileDialog>
-#include <QPushButton>
-#include <QCoreApplication>
-#include <QTimer>
-#include <QMetaMethod>
-#include <QSettings>
-#include "main.h"
-#include "glRenderer.h"
-#include "mainWindow.h"
-#include "ldDocument.h"
-#include "configuration.h"
-#include "miscallenous.h"
-#include "colors.h"
-#include "editHistory.h"
-#include "radioGroup.h"
-#include "addObjectDialog.h"
-#include "messageLog.h"
-#include "configuration.h"
-#include "ui_ldforge.h"
-#include "primitives.h"
-#include "editmodes/abstractEditMode.h"
-
-static bool g_isSelectionLocked = false;
-static QMap<QAction*, QKeySequence> g_defaultShortcuts;
-
-CFGENTRY (Bool, ColorizeObjectsList, true)
-CFGENTRY (String, QuickColorToolbar, "4:25:14:27:2:3:11:1:22:|:0:72:71:15")
-CFGENTRY (Bool, ListImplicitFiles, false)
-CFGENTRY (List, HiddenToolbars, {})
-EXTERN_CFGENTRY (List, RecentFiles)
-EXTERN_CFGENTRY (Bool, DrawAxes)
-EXTERN_CFGENTRY (String, MainColor)
-EXTERN_CFGENTRY (Float, MainColorAlpha)
-EXTERN_CFGENTRY (Bool, DrawWireframe)
-EXTERN_CFGENTRY (Bool, BFCRedGreenView)
-EXTERN_CFGENTRY (Bool, DrawAngles)
-EXTERN_CFGENTRY (Bool, RandomColors)
-EXTERN_CFGENTRY (Bool, DrawSurfaces)
-EXTERN_CFGENTRY (Bool, DrawEdgeLines)
-EXTERN_CFGENTRY (Bool, DrawConditionalLines)
-
-// =============================================================================
-//
-MainWindow::MainWindow (QWidget* parent, Qt::WindowFlags flags) :
-	QMainWindow (parent, flags)
-{
-	g_win = this;
-	ui = new Ui_LDForgeUI;
-	ui->setupUi (this);
-	m_updatingTabs = false;
-	m_renderer = new GLRenderer (this);
-	m_tabs = new QTabBar;
-	m_tabs->setTabsClosable (true);
-	ui->verticalLayout->insertWidget (0, m_tabs);
-
-	// Stuff the renderer into its frame
-	QVBoxLayout* rendererLayout = new QVBoxLayout (ui->rendererFrame);
-	rendererLayout->addWidget (R());
-
-	connect (ui->objectList, SIGNAL (itemSelectionChanged()), this, SLOT (slot_selectionChanged()));
-	connect (ui->objectList, SIGNAL (itemDoubleClicked (QListWidgetItem*)), this, SLOT (slot_editObject (QListWidgetItem*)));
-	connect (m_tabs, SIGNAL (currentChanged(int)), this, SLOT (changeCurrentFile()));
-	connect (m_tabs, SIGNAL (tabCloseRequested (int)), this, SLOT (closeTab (int)));
-
-	if (ActivePrimitiveScanner() != null)
-		connect (ActivePrimitiveScanner(), SIGNAL (workDone()), this, SLOT (updatePrimitives()));
-	else
-		updatePrimitives();
-
-	m_msglog = new MessageManager;
-	m_msglog->setRenderer (R());
-	m_renderer->setMessageLog (m_msglog);
-	m_quickColors = LoadQuickColorList();
-	slot_selectionChanged();
-	setStatusBar (new QStatusBar);
-	updateActions();
-
-	// Connect all actions and save default sequences
-	applyToActions ([&](QAction* act)
-	{
-		connect (act, SIGNAL (triggered()), this, SLOT (slot_action()));
-		g_defaultShortcuts[act] = act->shortcut();
-	});
-
-	updateGridToolBar();
-	updateEditModeActions();
-	updateRecentFilesMenu();
-	updateColorToolbar();
-	updateTitle();
-	loadShortcuts (Config::SettingsObject());
-	setMinimumSize (300, 200);
-	connect (qApp, SIGNAL (aboutToQuit()), this, SLOT (slot_lastSecondCleanup()));
-	connect (ui->ringToolHiRes, SIGNAL (clicked (bool)), this, SLOT (ringToolHiResClicked (bool)));
-	connect (ui->ringToolSegments, SIGNAL (valueChanged (int)),
-		this, SLOT (circleToolSegmentsChanged()));
-	circleToolSegmentsChanged(); // invoke it manually for initial label text
-
-	for (QVariant const& toolbarname : cfg::HiddenToolbars)
-	{
-		QToolBar* toolbar = findChild<QToolBar*> (toolbarname.toString());
-
-		if (toolbar != null)
-			toolbar->hide();
-	}
-}
-
-MainWindow::~MainWindow()
-{
-	g_win = null;
-}
-
-// =============================================================================
-//
-void MainWindow::slot_action()
-{
-	// Get the name of the sender object and use it to compose the slot name,
-	// then invoke this slot to call the action.
-	QMetaObject::invokeMethod (this,
-		qPrintable (format ("slot_%1", sender()->objectName())), Qt::DirectConnection);
-	endAction();
-}
-
-// =============================================================================
-//
-void MainWindow::endAction()
-{
-	// Add a step in the history now.
-	CurrentDocument()->addHistoryStep();
-
-	// Update the list item of the current file - we may need to draw an icon
-	// now that marks it as having unsaved changes.
-	updateDocumentListItem (CurrentDocument());
-	refresh();
-}
-
-// =============================================================================
-//
-void MainWindow::slot_lastSecondCleanup()
-{
-	delete m_renderer;
-	delete ui;
-}
-
-// =============================================================================
-//
-void MainWindow::updateRecentFilesMenu()
-{
-	// First, clear any items in the recent files menu
-for (QAction * recent : m_recentFiles)
-		delete recent;
-
-	m_recentFiles.clear();
-
-	QAction* first = null;
-
-	for (const QVariant& it : cfg::RecentFiles)
-	{
-		QString file = it.toString();
-		QAction* recent = new QAction (GetIcon ("open-recent"), file, this);
-
-		connect (recent, SIGNAL (triggered()), this, SLOT (slot_recentFile()));
-		ui->menuOpenRecent->insertAction (first, recent);
-		m_recentFiles << recent;
-		first = recent;
-	}
-}
-
-// =============================================================================
-//
-QList<LDQuickColor> LoadQuickColorList()
-{
-	QList<LDQuickColor> colors;
-
-	for (QString colorname : cfg::QuickColorToolbar.split (":"))
-	{
-		if (colorname == "|")
-			colors << LDQuickColor::getSeparator();
-		else
-		{
-			LDColor color = colorname.toInt();
-
-			if (color.isValid())
-				colors << LDQuickColor (color, null);
-		}
-	}
-
-	return colors;
-}
-
-// =============================================================================
-//
-void MainWindow::updateColorToolbar()
-{
-	m_colorButtons.clear();
-	ui->toolBarColors->clear();
-	ui->toolBarColors->addAction (ui->actionUncolor);
-	ui->toolBarColors->addSeparator();
-
-	for (LDQuickColor& entry : m_quickColors)
-	{
-		if (entry.isSeparator())
-		{
-			ui->toolBarColors->addSeparator();
-		}
-		else
-		{
-			QToolButton* colorButton = new QToolButton;
-			colorButton->setIcon (MakeColorIcon (entry.color(), 16));
-			colorButton->setIconSize (QSize (16, 16));
-			colorButton->setToolTip (entry.color().name());
-
-			connect (colorButton, SIGNAL (clicked()), this, SLOT (slot_quickColor()));
-			ui->toolBarColors->addWidget (colorButton);
-			m_colorButtons << colorButton;
-
-			entry.setToolButton (colorButton);
-		}
-	}
-
-	updateGridToolBar();
-}
-
-// =============================================================================
-//
-void MainWindow::updateGridToolBar()
-{
-	// Ensure that the current grid - and only the current grid - is selected.
-	ui->actionGridCoarse->setChecked (cfg::Grid == Grid::Coarse);
-	ui->actionGridMedium->setChecked (cfg::Grid == Grid::Medium);
-	ui->actionGridFine->setChecked (cfg::Grid == Grid::Fine);
-}
-
-// =============================================================================
-//
-void MainWindow::updateTitle()
-{
-	QString title = format (APPNAME " " VERSION_STRING);
-
-	// Append our current file if we have one
-	if (CurrentDocument())
-	{
-		title += ": ";
-		title += CurrentDocument()->getDisplayName();
-
-		if (CurrentDocument()->getObjectCount() > 0 and
-			CurrentDocument()->getObject (0)->type() == OBJ_Comment)
-		{
-			// Append title
-			LDComment* comm = static_cast <LDComment*> (CurrentDocument()->getObject (0));
-			title += format (": %1", comm->text());
-		}
-
-		if (CurrentDocument()->hasUnsavedChanges())
-			title += '*';
-	}
-
-#ifdef DEBUG
-	title += " [debug build]";
-#elif BUILD_ID != BUILD_RELEASE
-	title += " [pre-release build]";
-#endif // DEBUG
-
-	if (strlen (commitTimeString()))
-		title += format (" (%1)", QString::fromUtf8 (commitTimeString()));
-
-	setWindowTitle (title);
-}
-
-// =============================================================================
-//
-int MainWindow::deleteSelection()
-{
-	if (Selection().isEmpty())
-		return 0;
-
-	LDObjectList selCopy = Selection();
-
-	// Delete the objects that were being selected
-	for (LDObject* obj : selCopy)
-		obj->destroy();
-
-	refresh();
-	return selCopy.size();
-}
-
-// =============================================================================
-//
-void MainWindow::buildObjList()
-{
-	if (not CurrentDocument())
-		return;
-
-	// Lock the selection while we do this so that refreshing the object list
-	// doesn't trigger selection updating so that the selection doesn't get lost
-	// while this is done.
-	g_isSelectionLocked = true;
-
-	for (int i = 0; i < ui->objectList->count(); ++i)
-		delete ui->objectList->item (i);
-
-	ui->objectList->clear();
-
-	for (LDObject* obj : CurrentDocument()->objects())
-	{
-		QString descr;
-
-		switch (obj->type())
-		{
-			case OBJ_Comment:
-			{
-				descr = static_cast<LDComment*> (obj)->text();
-
-				// Remove leading whitespace
-				while (descr[0] == ' ')
-					descr.remove (0, 1);
-
-				break;
-			}
-
-			case OBJ_Empty:
-				break; // leave it empty
-
-			case OBJ_Line:
-			case OBJ_Triangle:
-			case OBJ_Quad:
-			case OBJ_CondLine:
-			{
-				for (int i = 0; i < obj->numVertices(); ++i)
-				{
-					if (i != 0)
-						descr += ", ";
-
-					descr += obj->vertex (i).toString (true);
-				}
-				break;
-			}
-
-			case OBJ_Error:
-			{
-				descr = format ("ERROR: %1", obj->asText());
-				break;
-			}
-
-			case OBJ_Subfile:
-			{
-				LDSubfile* ref = static_cast<LDSubfile*> (obj);
-
-				descr = format ("%1 %2, (", ref->fileInfo()->getDisplayName(), ref->position().toString (true));
-
-				for (int i = 0; i < 9; ++i)
-					descr += format ("%1%2", ref->transform()[i], (i != 8) ? " " : "");
-
-				descr += ')';
-				break;
-			}
-
-			case OBJ_BFC:
-			{
-				descr = LDBFC::StatementStrings[int (static_cast<LDBFC*> (obj)->statement())];
-				break;
-			}
-
-			case OBJ_Overlay:
-			{
-				LDOverlay* ovl = static_cast<LDOverlay*> (obj);
-				descr = format ("[%1] %2 (%3, %4), %5 x %6", g_CameraNames[ovl->camera()],
-					Basename (ovl->fileName()), ovl->x(), ovl->y(),
-					ovl->width(), ovl->height());
-				break;
-			}
-
-			default:
-			{
-				descr = obj->typeName();
-				break;
-			}
-		}
-
-		QListWidgetItem* item = new QListWidgetItem (descr);
-		item->setIcon (GetIcon (obj->typeName()));
-
-		// Use italic font if hidden
-		if (obj->isHidden())
-		{
-			QFont font = item->font();
-			font.setItalic (true);
-			item->setFont (font);
-		}
-
-		// Color gibberish orange on red so it stands out.
-		if (obj->type() == OBJ_Error)
-		{
-			item->setBackground (QColor ("#AA0000"));
-			item->setForeground (QColor ("#FFAA00"));
-		}
-		else if (cfg::ColorizeObjectsList and obj->isColored() and
-			obj->color().isValid() and obj->color() != MainColor and obj->color() != EdgeColor)
-		{
-			// If the object isn't in the main or edge color, draw this list entry in that color.
-			item->setForeground (obj->color().faceColor());
-		}
-
-		obj->qObjListEntry = item;
-		ui->objectList->insertItem (ui->objectList->count(), item);
-	}
-
-	g_isSelectionLocked = false;
-	updateSelection();
-	scrollToSelection();
-}
-
-// =============================================================================
-//
-void MainWindow::scrollToSelection()
-{
-	if (Selection().isEmpty())
-		return;
-
-	LDObject* obj = Selection().last();
-	ui->objectList->scrollToItem (obj->qObjListEntry);
-}
-
-// =============================================================================
-//
-void MainWindow::slot_selectionChanged()
-{
-	if (g_isSelectionLocked == true or CurrentDocument() == null)
-		return;
-
-	LDObjectList priorSelection = Selection();
-
-	// Get the objects from the object list selection
-	CurrentDocument()->clearSelection();
-	const QList<QListWidgetItem*> items = ui->objectList->selectedItems();
-
-	for (LDObject* obj : CurrentDocument()->objects())
-	{
-		for (QListWidgetItem* item : items)
-		{
-			if (item == obj->qObjListEntry)
-			{
-				obj->select();
-				break;
-			}
-		}
-	}
-
-	// The select() method calls may have selected additional items (i.e. invertnexts)
-	// Update it all now.
-	updateSelection();
-
-	// Update the GL renderer
-	LDObjectList compound = priorSelection + Selection();
-	RemoveDuplicates (compound);
-
-	for (LDObject* obj : compound)
-		R()->compileObject (obj);
-
-	R()->update();
-}
-
-// =============================================================================
-//
-void MainWindow::slot_recentFile()
-{
-	QAction* qAct = static_cast<QAction*> (sender());
-	OpenMainModel (qAct->text());
-}
-
-// =============================================================================
-//
-void MainWindow::slot_quickColor()
-{
-	QToolButton* button = static_cast<QToolButton*> (sender());
-	LDColor color = LDColor::nullColor();
-
-	for (const LDQuickColor& entry : m_quickColors)
-	{
-		if (entry.toolButton() == button)
-		{
-			color = entry.color();
-			break;
-		}
-	}
-
-	if (not color.isValid())
-		return;
-
-	for (LDObject* obj : Selection())
-	{
-		if (not obj->isColored())
-			continue; // uncolored object
-
-		obj->setColor (color);
-		R()->compileObject (obj);
-	}
-
-	endAction();
-	refresh();
-}
-
-// =============================================================================
-//
-int MainWindow::getInsertionPoint()
-{
-	// If we have a selection, put the item after it.
-	if (not Selection().isEmpty())
-		return Selection().last()->lineNumber() + 1;
-
-	// Otherwise place the object at the end.
-	return CurrentDocument()->getObjectCount();
-}
-
-// =============================================================================
-//
-void MainWindow::doFullRefresh()
-{
-	buildObjList();
-	m_renderer->hardRefresh();
-}
-
-// =============================================================================
-//
-void MainWindow::refresh()
-{
-	buildObjList();
-	m_renderer->update();
-}
-
-// =============================================================================
-//
-void MainWindow::updateSelection()
-{
-	g_isSelectionLocked = true;
-	QItemSelection itemselect;
-	int top = -1;
-	int bottom = -1;
-
-	for (LDObject* obj : Selection())
-	{
-		if (obj->qObjListEntry == null)
-			continue;
-
-		int row = ui->objectList->row (obj->qObjListEntry);
-
-		if (top == -1)
-		{
-			top = bottom = row;
-		}
-		else
-		{
-			if (row != bottom + 1)
-			{
-				itemselect.select (ui->objectList->model()->index (top, 0),
-					ui->objectList->model()->index (bottom, 0));
-				top = -1;
-			}
-
-			bottom = row;
-		}
-	}
-
-	if (top != -1)
-	{
-		itemselect.select (ui->objectList->model()->index (top, 0),
-			ui->objectList->model()->index (bottom, 0));
-	}
-
-	ui->objectList->selectionModel()->select (itemselect, QItemSelectionModel::ClearAndSelect);
-	g_isSelectionLocked = false;
-}
-
-// =============================================================================
-//
-LDColor MainWindow::getSelectedColor()
-{
-	LDColor result;
-
-	for (LDObject* obj : Selection())
-	{
-		if (not obj->isColored())
-			continue; // This one doesn't use color so it doesn't have a say
-
-		if (result.isValid() and obj->color() != result)
-			return LDColor::nullColor(); // No consensus in object color
-
-		if (not result.isValid())
-			result = obj->color();
-	}
-
-	return result;
-}
-
-// =============================================================================
-//
-void MainWindow::closeEvent (QCloseEvent* ev)
-{
-	// Check whether it's safe to close all files.
-	if (not IsSafeToCloseAll())
-	{
-		ev->ignore();
-		return;
-	}
-
-	// Save the toolbar set
-	cfg::HiddenToolbars.clear();
-
-	for (QToolBar* toolbar : findChildren<QToolBar*>())
-	{
-		if (toolbar->isHidden())
-			cfg::HiddenToolbars << toolbar->objectName();
-	}
-
-	// Save the configuration before leaving.
-	Config::Save();
-	ev->accept();
-}
-
-// =============================================================================
-//
-void MainWindow::spawnContextMenu (const QPoint pos)
-{
-	const bool single = (Selection().size() == 1);
-	LDObject* singleObj = single ? Selection().first() : nullptr;
-
-	bool hasSubfiles = false;
-
-	for (LDObject* obj : Selection())
-	{
-		if (obj->type() == OBJ_Subfile)
-		{
-			hasSubfiles = true;
-			break;
-		}
-	}
-
-	QMenu* contextMenu = new QMenu;
-
-	if (single and singleObj->type() != OBJ_Empty)
-	{
-		contextMenu->addAction (ui->actionEdit);
-		contextMenu->addSeparator();
-	}
-
-	contextMenu->addAction (ui->actionCut);
-	contextMenu->addAction (ui->actionCopy);
-	contextMenu->addAction (ui->actionPaste);
-	contextMenu->addAction (ui->actionDelete);
-	contextMenu->addSeparator();
-	contextMenu->addAction (ui->actionSetColor);
-
-	if (single)
-		contextMenu->addAction (ui->actionEditRaw);
-
-	contextMenu->addAction (ui->actionBorders);
-	contextMenu->addAction (ui->actionSetOverlay);
-	contextMenu->addAction (ui->actionClearOverlay);
-
-	if (hasSubfiles)
-	{
-		contextMenu->addSeparator();
-		contextMenu->addAction (ui->actionOpenSubfiles);
-	}
-
-	contextMenu->addSeparator();
-	contextMenu->addAction (ui->actionModeSelect);
-	contextMenu->addAction (ui->actionModeDraw);
-	contextMenu->addAction (ui->actionModeCircle);
-
-	if (not Selection().isEmpty())
-	{
-		contextMenu->addSeparator();
-		contextMenu->addAction (ui->actionSubfileSelection);
-	}
-
-	if (R()->camera() != EFreeCamera)
-	{
-		contextMenu->addSeparator();
-		contextMenu->addAction (ui->actionSetDrawDepth);
-	}
-
-	contextMenu->exec (pos);
-}
-
-// =============================================================================
-//
-void MainWindow::deleteByColor (LDColor color)
-{
-	LDObjectList objs;
-
-	for (LDObject* obj : CurrentDocument()->objects())
-	{
-		if (not obj->isColored() or obj->color() != color)
-			continue;
-
-		objs << obj;
-	}
-
-	for (LDObject* obj : objs)
-		obj->destroy();
-}
-
-// =============================================================================
-//
-void MainWindow::updateEditModeActions()
-{
-	const EditModeType mode = R()->currentEditModeType();
-	ui->actionModeSelect->setChecked (mode == EditModeType::Select);
-	ui->actionModeDraw->setChecked (mode == EditModeType::Draw);
-	ui->actionModeRectangle->setChecked (mode == EditModeType::Rectangle);
-	ui->actionModeCircle->setChecked (mode == EditModeType::Circle);
-	ui->actionModeMagicWand->setChecked (mode == EditModeType::MagicWand);
-	ui->actionModeLinePath->setChecked (mode == EditModeType::LinePath);
-}
-
-// =============================================================================
-//
-void MainWindow::slot_editObject (QListWidgetItem* listitem)
-{
-	for (LDObject* it : CurrentDocument()->objects())
-	{
-		if (it->qObjListEntry == listitem)
-		{
-			AddObjectDialog::staticDialog (it->type(), it);
-			break;
-		}
-	}
-}
-
-// =============================================================================
-//
-bool MainWindow::save (LDDocument* doc, bool saveAs)
-{
-	QString path = doc->fullPath();
-	int64 savesize;
-
-	if (saveAs or path.isEmpty())
-	{
-		QString name = doc->defaultName();
-
-		if (not doc->fullPath().isEmpty()) 
-			name = doc->fullPath();
-		elif (not doc->name().isEmpty())
-			name = doc->name();
-
-		name.replace ("\\", "/");
-		path = QFileDialog::getSaveFileName (g_win, tr ("Save As"),
-			name, tr ("LDraw files (*.dat *.ldr)"));
-
-		if (path.isEmpty())
-		{
-			// User didn't give a file name, abort.
-			return false;
-		}
-	}
-
-	if (doc->save (path, &savesize))
-	{
-		if (doc == CurrentDocument())
-			updateTitle();
-
-		print ("Saved to %1 (%2)", path, MakePrettyFileSize (savesize));
-
-		// Add it to recent files
-		AddRecentFile (path);
-		return true;
-	}
-
-	QString message = format (tr ("Failed to save to %1: %2"), path, strerror (errno));
-
-	// Tell the user the save failed, and give the option for saving as with it.
-	QMessageBox dlg (QMessageBox::Critical, tr ("Save Failure"), message, QMessageBox::Close, g_win);
-
-	// Add a save-as button
-	QPushButton* saveAsBtn = new QPushButton (tr ("Save As"));
-	saveAsBtn->setIcon (GetIcon ("file-save-as"));
-	dlg.addButton (saveAsBtn, QMessageBox::ActionRole);
-	dlg.setDefaultButton (QMessageBox::Close);
-	dlg.exec();
-
-	if (dlg.clickedButton() == saveAsBtn)
-		return save (doc, true); // yay recursion!
-
-	return false;
-}
-
-void MainWindow::addMessage (QString msg)
-{
-	m_msglog->addLine (msg);
-}
-
-// ============================================================================
-void ObjectList::contextMenuEvent (QContextMenuEvent* ev)
-{
-	g_win->spawnContextMenu (ev->globalPos());
-}
-
-// =============================================================================
-//
-QPixmap GetIcon (QString iconName)
-{
-	return (QPixmap (format (":/icons/%1.png", iconName)));
-}
-
-// =============================================================================
-//
-bool Confirm (const QString& message)
-{
-	return Confirm (MainWindow::tr ("Confirm"), message);
-}
-
-// =============================================================================
-//
-bool Confirm (const QString& title, const QString& message)
-{
-	return QMessageBox::question (g_win, title, message,
-		(QMessageBox::Yes | QMessageBox::No), QMessageBox::No) == QMessageBox::Yes;
-}
-
-// =============================================================================
-//
-void Critical (const QString& message)
-{
-	QMessageBox::critical (g_win, MainWindow::tr ("Error"), message,
-		(QMessageBox::Close), QMessageBox::Close);
-}
-
-// =============================================================================
-//
-QIcon MakeColorIcon (LDColor colinfo, const int size)
-{
-	// Create an image object and link a painter to it.
-	QImage img (size, size, QImage::Format_ARGB32);
-	QPainter paint (&img);
-	QColor col = colinfo.faceColor();
-
-	if (colinfo == MainColor)
-	{
-		// Use the user preferences for main color here
-		col = cfg::MainColor;
-		col.setAlphaF (cfg::MainColorAlpha);
-	}
-
-	// Paint the icon border
-	paint.fillRect (QRect (0, 0, size, size), colinfo.edgeColor());
-
-	// Paint the checkerboard background, visible with translucent icons
-	paint.drawPixmap (QRect (1, 1, size - 2, size - 2), GetIcon ("checkerboard"), QRect (0, 0, 8, 8));
-
-	// Paint the color above the checkerboard
-	paint.fillRect (QRect (1, 1, size - 2, size - 2), col);
-	return QIcon (QPixmap::fromImage (img));
-}
-
-// =============================================================================
-//
-void MakeColorComboBox (QComboBox* box)
-{
-	std::map<LDColor, int> counts;
-
-	for (LDObject* obj : CurrentDocument()->objects())
-	{
-		if (not obj->isColored() or not obj->color().isValid())
-			continue;
-
-		if (counts.find (obj->color()) == counts.end())
-			counts[obj->color()] = 1;
-		else
-			counts[obj->color()]++;
-	}
-
-	box->clear();
-	int row = 0;
-
-	for (const auto& pair : counts)
-	{
-		QIcon ico = MakeColorIcon (pair.first, 16);
-		box->addItem (ico, format ("[%1] %2 (%3 object%4)",
-			pair.first, pair.first.name(), pair.second, Plural (pair.second)));
-		box->setItemData (row, pair.first.index());
-
-		++row;
-	}
-}
-
-// =============================================================================
-//
-void MainWindow::updateDocumentList()
-{
-	m_updatingTabs = true;
-
-	while (m_tabs->count() > 0)
-		m_tabs->removeTab (0);
-
-	for (LDDocument* f : LDDocument::explicitDocuments())
-	{
-		// Add an item to the list for this file and store the tab index
-		// in the document so we can find documents by tab index.
-		f->setTabIndex (m_tabs->addTab (""));
-		updateDocumentListItem (f);
-	}
-
-	m_updatingTabs = false;
-}
-
-// =============================================================================
-//
-void MainWindow::updateDocumentListItem (LDDocument* doc)
-{
-	bool oldUpdatingTabs = m_updatingTabs;
-	m_updatingTabs = true;
-
-	if (doc->tabIndex() == -1)
-	{
-		// We don't have a list item for this file, so the list either doesn't
-		// exist yet or is out of date. Build the list now.
-		updateDocumentList();
-		return;
-	}
-
-	// If this is the current file, it also needs to be the selected item on
-	// the list.
-	if (doc == CurrentDocument())
-		m_tabs->setCurrentIndex (doc->tabIndex());
-
-	m_tabs->setTabText (doc->tabIndex(), doc->getDisplayName());
-
-	// If the document.has unsaved changes, draw a little icon next to it to mark that.
-	m_tabs->setTabIcon (doc->tabIndex(), doc->hasUnsavedChanges() ? GetIcon ("file-save") : QIcon());
-	m_tabs->setTabData (doc->tabIndex(), doc->name());
-	m_updatingTabs = oldUpdatingTabs;
-}
-
-// =============================================================================
-//
-// A file is selected from the list of files on the left of the screen. Find out
-// which file was picked and change to it.
-//
-void MainWindow::changeCurrentFile()
-{
-	if (m_updatingTabs)
-		return;
-
-	LDDocument* file = nullptr;
-	int tabIndex = m_tabs->currentIndex();
-
-	// Find the file pointer of the item that was selected.
-	for (LDDocument* it : LDDocument::explicitDocuments())
-	{
-		if (it->tabIndex() == tabIndex)
-		{
-			file = it;
-			break;
-		}
-	}
-
-	// If we picked the same file we're currently on, we don't need to do
-	// anything.
-	if (file == null or file == CurrentDocument())
-		return;
-
-	LDDocument::setCurrent (file);
-}
-
-// =============================================================================
-//
-void MainWindow::refreshObjectList()
-{
-#if 0
-	ui->objectList->clear();
-	LDDocument* f = getCurrentDocument();
-
-for (LDObject* obj : *f)
-		ui->objectList->addItem (obj->qObjListEntry);
-
-#endif
-
-	buildObjList();
-}
-
-// =============================================================================
-//
-void MainWindow::updateActions()
-{
-	if (CurrentDocument() != null and CurrentDocument()->history() != null)
-	{
-		History* his = CurrentDocument()->history();
-		int pos = his->position();
-		ui->actionUndo->setEnabled (pos != -1);
-		ui->actionRedo->setEnabled (pos < (long) his->getSize() - 1);
-	}
-
-	ui->actionWireframe->setChecked (cfg::DrawWireframe);
-	ui->actionAxes->setChecked (cfg::DrawAxes);
-	ui->actionBFCView->setChecked (cfg::BFCRedGreenView);
-	ui->actionRandomColors->setChecked (cfg::RandomColors);
-	ui->actionDrawAngles->setChecked (cfg::DrawAngles);
-	ui->actionDrawSurfaces->setChecked (cfg::DrawSurfaces);
-	ui->actionDrawEdgeLines->setChecked (cfg::DrawEdgeLines);
-	ui->actionDrawConditionalLines->setChecked (cfg::DrawConditionalLines);
-}
-
-// =============================================================================
-//
-void MainWindow::updatePrimitives()
-{
-	PopulatePrimitives (ui->primitives);
-}
-
-// =============================================================================
-//
-void MainWindow::closeTab (int tabindex)
-{
-	LDDocument* doc = FindDocument (m_tabs->tabData (tabindex).toString());
-
-	if (doc == null)
-		return;
-
-	doc->dismiss();
-}
-
-// =============================================================================
-//
-void MainWindow::loadShortcuts (QSettings const* settings)
-{
-	for (QAction* act : findChildren<QAction*>())
-	{
-		QKeySequence seq = settings->value ("shortcut_" + act->objectName(), act->shortcut()).value<QKeySequence>();
-		act->setShortcut (seq);
-	}
-}
-
-// =============================================================================
-//
-void MainWindow::saveShortcuts (QSettings* settings)
-{
-	applyToActions ([&](QAction* act)
-	{
-		QString const key = "shortcut_" + act->objectName();
-
-		if (g_defaultShortcuts[act] != act->shortcut())
-			settings->setValue (key, act->shortcut());
-		else
-			settings->remove (key);
-	});
-}
-
-// =============================================================================
-//
-void MainWindow::applyToActions (std::function<void(QAction*)> function)
-{
-	for (QAction* act : findChildren<QAction*>())
-	{
-		if (not act->objectName().isEmpty())
-			function (act);
-	}
-}
-
-// =============================================================================
-//
-QKeySequence MainWindow::defaultShortcut (QAction* act) // [static]
-{
-	return g_defaultShortcuts[act];
-}
-
-// =============================================================================
-//
-bool MainWindow::ringToolHiRes() const
-{
-	return ui->ringToolHiRes->isChecked();
-}
-
-// =============================================================================
-//
-int MainWindow::ringToolSegments() const
-{
-	return ui->ringToolSegments->value();
-}
-
-// =============================================================================
-//
-void MainWindow::ringToolHiResClicked (bool checked)
-{
-	if (checked)
-	{
-		ui->ringToolSegments->setMaximum (HighResolution);
-		ui->ringToolSegments->setValue (ui->ringToolSegments->value() * 3);
-	}
-	else
-	{
-		ui->ringToolSegments->setValue (ui->ringToolSegments->value() / 3);
-		ui->ringToolSegments->setMaximum (LowResolution);
-	}
-}
-
-// =============================================================================
-//
-void MainWindow::circleToolSegmentsChanged()
-{
-	int numerator (ui->ringToolSegments->value());
-	int denominator (ui->ringToolHiRes->isChecked() ? HighResolution : LowResolution);
-	Simplify (numerator, denominator);
-	ui->ringToolSegmentsLabel->setText (format ("%1 / %2", numerator, denominator));
-}
-
-// =============================================================================
-//
-QImage GetImageFromScreencap (uchar* data, int w, int h)
-{
-	// GL and Qt formats have R and B swapped. Also, GL flips Y - correct it as well.
-	return QImage (data, w, h, QImage::Format_ARGB32).rgbSwapped().mirrored();
-}
-
-// =============================================================================
-//
-LDQuickColor::LDQuickColor (LDColor color, QToolButton* toolButton) :
-	m_color (color),
-	m_toolButton (toolButton) {}
-
-// =============================================================================
-//
-LDQuickColor LDQuickColor::getSeparator()
-{
-	return LDQuickColor (LDColor::nullColor(), null);
-}
-
-// =============================================================================
-//
-bool LDQuickColor::isSeparator() const
-{
-	return color() == LDColor::nullColor();
-}
-
-void PopulatePrimitives (QTreeWidget* tw, QString const& selectByDefault)
-{
-	tw->clear();
-
-	for (PrimitiveCategory* cat : g_PrimitiveCategories)
-	{
-		SubfileListItem* parentItem = new SubfileListItem (tw, null);
-		parentItem->setText (0, cat->name());
-		QList<QTreeWidgetItem*> subfileItems;
-
-		for (Primitive& prim : cat->prims)
-		{
-			SubfileListItem* item = new SubfileListItem (parentItem, &prim);
-			item->setText (0, format ("%1 - %2", prim.name, prim.title));
-			subfileItems << item;
-
-			// If this primitive is the one the current object points to,
-			// select it by default
-			if (selectByDefault == prim.name)
-				tw->setCurrentItem (item);
-		}
-
-		tw->addTopLevelItem (parentItem);
-	}
-}
--- a/src/mainWindow.h	Sun Aug 30 04:45:16 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,391 +0,0 @@
-/*
- *  LDForge: LDraw parts authoring CAD
- *  Copyright (C) 2013, 2014 Teemu Piippo
- *
- *  This program is free software: you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation, either version 3 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#pragma once
-#include <functional>
-#include <QMainWindow>
-#include <QAction>
-#include <QListWidget>
-#include <QRadioButton>
-#include "configuration.h"
-#include "ldObject.h"
-#include "ui_ldforge.h"
-#include "colors.h"
-
-class MessageManager;
-class MainWindow;
-class QToolButton;
-class QDialogButtonBox;
-class GLRenderer;
-class QComboBox;
-class QProgressBar;
-class Ui_LDForgeUI;
-struct Primitive;
-
-// Stuff for dialogs
-#define IMPLEMENT_DIALOG_BUTTONS \
-	bbx_buttons = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel); \
-	connect (bbx_buttons, SIGNAL (accepted()), this, SLOT (accept())); \
-	connect (bbx_buttons, SIGNAL (rejected()), this, SLOT (reject())); \
-
-class LDQuickColor
-{
-	PROPERTY (public,	LDColor,		color,		setColor,		STOCK_WRITE)
-	PROPERTY (public,	QToolButton*,	toolButton,	setToolButton,	STOCK_WRITE)
-
-	public:
-		LDQuickColor (LDColor color, QToolButton* toolButton);
-		bool isSeparator() const;
-
-		static LDQuickColor getSeparator();
-};
-
-//
-// Object list class for MainWindow
-//
-class ObjectList : public QListWidget
-{
-	Q_OBJECT
-
-	protected:
-		void contextMenuEvent (QContextMenuEvent* ev);
-};
-
-//
-// LDForge's main GUI class.
-//
-class MainWindow : public QMainWindow
-{
-	Q_OBJECT
-
-public:
-	explicit MainWindow (QWidget* parent = null, Qt::WindowFlags flags = 0);
-	~MainWindow();
-
-	// Rebuilds the object list.
-	void buildObjList();
-
-	// Updates the window title.
-	void updateTitle();
-
-	// Builds the object list and tells the GL renderer to init a full
-	// refresh.
-	void doFullRefresh();
-
-	// Builds the object list and tells the GL renderer to do a soft update.
-	void refresh();
-
-	// Returns the suggested position to place a new object at.
-	int getInsertionPoint();
-
-	// Updates the quick color toolbar
-	void updateColorToolbar();
-
-	// Rebuilds the recent files submenu
-	void updateRecentFilesMenu();
-
-	// Sets the selection based on what's selected in the object list.
-	void updateSelection();
-
-	// Updates the grids, selects the selected grid and deselects others.
-	void updateGridToolBar();
-
-	// Updates the edit modes, current one is selected and others are deselected.
-	void updateEditModeActions();
-
-	// Rebuilds the document tab list.
-	void updateDocumentList();
-
-	// Updates the document tab for \c doc. If no such tab exists, the
-	// document list is rebuilt instead.
-	void updateDocumentListItem (LDDocument* doc);
-
-	// Returns the uniform selected color (i.e. 4 if everything selected is
-	// red), -1 if there is no such consensus.
-	LDColor getSelectedColor();
-
-	// Automatically scrolls the object list so that it points to the first
-	// selected object.
-	void scrollToSelection();
-
-	// Spawns the context menu at the given position.
-	void spawnContextMenu (const QPoint pos);
-
-	// Deletes all selected objects, returns the count of deleted objects.
-	int deleteSelection();
-
-	// Deletes all objects by the given color number.
-	void deleteByColor (LDColor color);
-
-	// Tries to save the given document.
-	bool save (LDDocument* doc, bool saveAs);
-
-	// Updates various actions, undo/redo are set enabled/disabled where
-	// appropriate, togglable actions are updated based on configuration,
-	// etc.
-	void updateActions();
-
-	// Returns a pointer to the renderer
-	inline GLRenderer* R()
-	{
-		return m_renderer;
-	}
-
-	// Sets the quick color list to the given list of colors.
-	inline void setQuickColors (const QList<LDQuickColor>& colors)
-	{
-		m_quickColors = colors;
-		updateColorToolbar();
-	}
-
-	// Adds a message to the renderer's message manager.
-	void addMessage (QString msg);
-
-	// Updates the object list. Right now this just rebuilds it.
-	void refreshObjectList();
-
-	void endAction();
-
-	inline QTreeWidget* getPrimitivesTree() const
-	{
-		return ui->primitives;
-	}
-
-	static QKeySequence defaultShortcut (QAction* act);
-	void loadShortcuts (QSettings const* settings);
-	void saveShortcuts (QSettings* settings);
-	void applyToActions (std::function<void(QAction*)> function);
-
-	bool ringToolHiRes() const;
-	int ringToolSegments() const;
-
-public slots:
-	void updatePrimitives();
-	void changeCurrentFile();
-	void closeTab (int tabindex);
-	void ringToolHiResClicked (bool clicked);
-	void circleToolSegmentsChanged();
-	void slot_action();
-	void slot_actionNew();
-	void slot_actionNewFile();
-	void slot_actionOpen();
-	void slot_actionDownloadFrom();
-	void slot_actionSave();
-	void slot_actionSaveAs();
-	void slot_actionSaveAll();
-	void slot_actionClose();
-	void slot_actionCloseAll();
-	void slot_actionInsertFrom();
-	void slot_actionExportTo();
-	void slot_actionSettings();
-	void slot_actionSetLDrawPath();
-	void slot_actionScanPrimitives();
-	void slot_actionExit();
-	void slot_actionResetView();
-	void slot_actionAxes();
-	void slot_actionWireframe();
-	void slot_actionBFCView();
-	void slot_actionSetOverlay();
-	void slot_actionClearOverlay();
-	void slot_actionScreenshot();
-	void slot_actionInsertRaw();
-	void slot_actionNewSubfile();
-	void slot_actionNewLine();
-	void slot_actionNewTriangle();
-	void slot_actionNewQuad();
-	void slot_actionNewCLine();
-	void slot_actionNewComment();
-	void slot_actionNewBFC();
-	void slot_actionNewVertex();
-	void slot_actionUndo();
-	void slot_actionRedo();
-	void slot_actionCut();
-	void slot_actionCopy();
-	void slot_actionPaste();
-	void slot_actionDelete();
-	void slot_actionSelectAll();
-	void slot_actionSelectByColor();
-	void slot_actionSelectByType();
-	void slot_actionModeDraw();
-	void slot_actionModeSelect();
-	void slot_actionModeRectangle();
-	void slot_actionModeCircle();
-	void slot_actionModeMagicWand();
-	void slot_actionModeLinePath();
-	void slot_actionSetDrawDepth();
-	void slot_actionSetColor();
-	void slot_actionAutocolor();
-	void slot_actionUncolor();
-	void slot_actionInline();
-	void slot_actionInlineDeep();
-	void slot_actionInvert();
-	void slot_actionMakePrimitive();
-	void slot_actionSplitQuads();
-	void slot_actionEditRaw();
-	void slot_actionBorders();
-	void slot_actionRoundCoordinates();
-	void slot_actionVisibilityHide();
-	void slot_actionVisibilityReveal();
-	void slot_actionVisibilityToggle();
-	void slot_actionReplaceCoords();
-	void slot_actionFlip();
-	void slot_actionDemote();
-	void slot_actionYtruder();
-	void slot_actionRectifier();
-	void slot_actionIntersector();
-	void slot_actionIsecalc();
-	void slot_actionCoverer();
-	void slot_actionEdger2();
-	void slot_actionHelp();
-	void slot_actionAbout();
-	void slot_actionAboutQt();
-	void slot_actionGridCoarse();
-	void slot_actionGridMedium();
-	void slot_actionGridFine();
-	void slot_actionEdit();
-	void slot_actionMoveUp();
-	void slot_actionMoveDown();
-	void slot_actionMoveXNeg();
-	void slot_actionMoveXPos();
-	void slot_actionMoveYNeg();
-	void slot_actionMoveYPos();
-	void slot_actionMoveZNeg();
-	void slot_actionMoveZPos();
-	void slot_actionRotateXNeg();
-	void slot_actionRotateXPos();
-	void slot_actionRotateYNeg();
-	void slot_actionRotateYPos();
-	void slot_actionRotateZNeg();
-	void slot_actionRotateZPos();
-	void slot_actionRotationPoint();
-	void slot_actionAddHistoryLine();
-	void slot_actionJumpTo();
-	void slot_actionSubfileSelection();
-	void slot_actionDrawAngles();
-	void slot_actionRandomColors();
-	void slot_actionOpenSubfiles();
-	void slot_actionSplitLines();
-	void slot_actionDrawSurfaces();
-	void slot_actionDrawEdgeLines();
-	void slot_actionDrawConditionalLines();
-
-protected:
-	void closeEvent (QCloseEvent* ev);
-
-private:
-	GLRenderer*			m_renderer;
-	LDObjectList		m_sel;
-	QList<LDQuickColor>	m_quickColors;
-	QList<QToolButton*>	m_colorButtons;
-	QList<QAction*>		m_recentFiles;
-	MessageManager*		m_msglog;
-	Ui_LDForgeUI*		ui;
-	QTabBar*			m_tabs;
-	bool				m_updatingTabs;
-
-private slots:
-	void slot_selectionChanged();
-	void slot_recentFile();
-	void slot_quickColor();
-	void slot_lastSecondCleanup();
-	void slot_editObject (QListWidgetItem* listitem);
-};
-
-//! Pointer to the instance of MainWindow.
-extern MainWindow* g_win;
-
-//! Get an icon by name from the resources directory.
-QPixmap GetIcon (QString iconName);
-
-//! \returns a list of quick colors based on the configuration entry.
-QList<LDQuickColor> LoadQuickColorList();
-
-//! Asks the user a yes/no question with the given \c message and the given
-//! window \c title.
-//! \returns true if the user answered yes, false if no.
-bool Confirm (const QString& title, const QString& message); // Generic confirm prompt
-
-//! An overload of \c confirm(), this asks the user a yes/no question with the
-//! given \c message.
-//! \returns true if the user answered yes, false if no.
-bool Confirm (const QString& message);
-
-//! Displays an error prompt with the given \c message
-void Critical (const QString& message);
-
-//! Makes an icon of \c size x \c size pixels to represent \c colinfo
-QIcon MakeColorIcon (LDColor colinfo, const int size);
-
-//! Fills the given combo-box with color information
-void MakeColorComboBox (QComboBox* box);
-
-//! \returns a QImage from the given raw GL \c data
-QImage GetImageFromScreencap (uchar* data, int w, int h);
-
-//!
-//! Takes in pairs of radio buttons and respective values and finds the first
-//! selected one.
-//! \returns returns the value of the first found radio button that was checked
-//! \returns by the user.
-//!
-template<class T>
-T RadioSwitch (const T& defval, QList<Pair<QRadioButton*, T>> haystack)
-{
-	for (Pair<QRadioButton*, const T&> i : haystack)
-	{
-		if (i.first->isChecked())
-			return i.second;
-	}
-
-	return defval;
-}
-
-//!
-//! Takes in pairs of radio buttons and respective values and checks the first
-//! found radio button whose respsective value matches \c expr have the given value.
-//!
-template<class T>
-void RadioDefault (const T& expr, QList<Pair<QRadioButton*, T>> haystack)
-{
-	for (Pair<QRadioButton*, const T&> i : haystack)
-	{
-		if (i.second == expr)
-		{
-			i.first->setChecked (true);
-			return;
-		}
-	}
-}
-
-// =============================================================================
-//
-class SubfileListItem : public QTreeWidgetItem
-{
-	PROPERTY (public, Primitive*,	primitive, setPrimitive, STOCK_WRITE)
-
-public:
-	SubfileListItem (QTreeWidgetItem* parent, Primitive* info) :
-		QTreeWidgetItem (parent),
-		m_primitive (info) {}
-
-	SubfileListItem (QTreeWidget* parent, Primitive* info) :
-		QTreeWidgetItem (parent),
-		m_primitive (info) {}
-};
-
-void PopulatePrimitives (QTreeWidget* tw, const QString& selectByDefault = QString());
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/mainwindow.cpp	Sun Aug 30 04:53:37 2015 +0300
@@ -0,0 +1,1190 @@
+/*
+ *  LDForge: LDraw parts authoring CAD
+ *  Copyright (C) 2013, 2014 Teemu Piippo
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include <QGridLayout>
+#include <QMessageBox>
+#include <QEvent>
+#include <QContextMenuEvent>
+#include <QMenuBar>
+#include <QStatusBar>
+#include <QSplitter>
+#include <QListWidget>
+#include <QToolButton>
+#include <QComboBox>
+#include <QDialogButtonBox>
+#include <QToolBar>
+#include <QProgressBar>
+#include <QLabel>
+#include <QFileDialog>
+#include <QPushButton>
+#include <QCoreApplication>
+#include <QTimer>
+#include <QMetaMethod>
+#include <QSettings>
+#include "main.h"
+#include "glRenderer.h"
+#include "mainwindow.h"
+#include "ldDocument.h"
+#include "configuration.h"
+#include "miscallenous.h"
+#include "colors.h"
+#include "editHistory.h"
+#include "radioGroup.h"
+#include "addObjectDialog.h"
+#include "messageLog.h"
+#include "configuration.h"
+#include "ui_ldforge.h"
+#include "primitives.h"
+#include "editmodes/abstractEditMode.h"
+
+static bool g_isSelectionLocked = false;
+static QMap<QAction*, QKeySequence> g_defaultShortcuts;
+
+CFGENTRY (Bool, ColorizeObjectsList, true)
+CFGENTRY (String, QuickColorToolbar, "4:25:14:27:2:3:11:1:22:|:0:72:71:15")
+CFGENTRY (Bool, ListImplicitFiles, false)
+CFGENTRY (List, HiddenToolbars, {})
+EXTERN_CFGENTRY (List, RecentFiles)
+EXTERN_CFGENTRY (Bool, DrawAxes)
+EXTERN_CFGENTRY (String, MainColor)
+EXTERN_CFGENTRY (Float, MainColorAlpha)
+EXTERN_CFGENTRY (Bool, DrawWireframe)
+EXTERN_CFGENTRY (Bool, BFCRedGreenView)
+EXTERN_CFGENTRY (Bool, DrawAngles)
+EXTERN_CFGENTRY (Bool, RandomColors)
+EXTERN_CFGENTRY (Bool, DrawSurfaces)
+EXTERN_CFGENTRY (Bool, DrawEdgeLines)
+EXTERN_CFGENTRY (Bool, DrawConditionalLines)
+
+// =============================================================================
+//
+MainWindow::MainWindow (QWidget* parent, Qt::WindowFlags flags) :
+	QMainWindow (parent, flags)
+{
+	g_win = this;
+	ui = new Ui_LDForgeUI;
+	ui->setupUi (this);
+	m_updatingTabs = false;
+	m_renderer = new GLRenderer (this);
+	m_tabs = new QTabBar;
+	m_tabs->setTabsClosable (true);
+	ui->verticalLayout->insertWidget (0, m_tabs);
+
+	// Stuff the renderer into its frame
+	QVBoxLayout* rendererLayout = new QVBoxLayout (ui->rendererFrame);
+	rendererLayout->addWidget (R());
+
+	connect (ui->objectList, SIGNAL (itemSelectionChanged()), this, SLOT (slot_selectionChanged()));
+	connect (ui->objectList, SIGNAL (itemDoubleClicked (QListWidgetItem*)), this, SLOT (slot_editObject (QListWidgetItem*)));
+	connect (m_tabs, SIGNAL (currentChanged(int)), this, SLOT (changeCurrentFile()));
+	connect (m_tabs, SIGNAL (tabCloseRequested (int)), this, SLOT (closeTab (int)));
+
+	if (ActivePrimitiveScanner() != null)
+		connect (ActivePrimitiveScanner(), SIGNAL (workDone()), this, SLOT (updatePrimitives()));
+	else
+		updatePrimitives();
+
+	m_msglog = new MessageManager;
+	m_msglog->setRenderer (R());
+	m_renderer->setMessageLog (m_msglog);
+	m_quickColors = LoadQuickColorList();
+	slot_selectionChanged();
+	setStatusBar (new QStatusBar);
+	updateActions();
+
+	// Connect all actions and save default sequences
+	applyToActions ([&](QAction* act)
+	{
+		connect (act, SIGNAL (triggered()), this, SLOT (slot_action()));
+		g_defaultShortcuts[act] = act->shortcut();
+	});
+
+	updateGridToolBar();
+	updateEditModeActions();
+	updateRecentFilesMenu();
+	updateColorToolbar();
+	updateTitle();
+	loadShortcuts (Config::SettingsObject());
+	setMinimumSize (300, 200);
+	connect (qApp, SIGNAL (aboutToQuit()), this, SLOT (slot_lastSecondCleanup()));
+	connect (ui->ringToolHiRes, SIGNAL (clicked (bool)), this, SLOT (ringToolHiResClicked (bool)));
+	connect (ui->ringToolSegments, SIGNAL (valueChanged (int)),
+		this, SLOT (circleToolSegmentsChanged()));
+	circleToolSegmentsChanged(); // invoke it manually for initial label text
+
+	for (QVariant const& toolbarname : cfg::HiddenToolbars)
+	{
+		QToolBar* toolbar = findChild<QToolBar*> (toolbarname.toString());
+
+		if (toolbar != null)
+			toolbar->hide();
+	}
+}
+
+MainWindow::~MainWindow()
+{
+	g_win = null;
+}
+
+// =============================================================================
+//
+void MainWindow::slot_action()
+{
+	// Get the name of the sender object and use it to compose the slot name,
+	// then invoke this slot to call the action.
+	QMetaObject::invokeMethod (this,
+		qPrintable (format ("slot_%1", sender()->objectName())), Qt::DirectConnection);
+	endAction();
+}
+
+// =============================================================================
+//
+void MainWindow::endAction()
+{
+	// Add a step in the history now.
+	CurrentDocument()->addHistoryStep();
+
+	// Update the list item of the current file - we may need to draw an icon
+	// now that marks it as having unsaved changes.
+	updateDocumentListItem (CurrentDocument());
+	refresh();
+}
+
+// =============================================================================
+//
+void MainWindow::slot_lastSecondCleanup()
+{
+	delete m_renderer;
+	delete ui;
+}
+
+// =============================================================================
+//
+void MainWindow::updateRecentFilesMenu()
+{
+	// First, clear any items in the recent files menu
+for (QAction * recent : m_recentFiles)
+		delete recent;
+
+	m_recentFiles.clear();
+
+	QAction* first = null;
+
+	for (const QVariant& it : cfg::RecentFiles)
+	{
+		QString file = it.toString();
+		QAction* recent = new QAction (GetIcon ("open-recent"), file, this);
+
+		connect (recent, SIGNAL (triggered()), this, SLOT (slot_recentFile()));
+		ui->menuOpenRecent->insertAction (first, recent);
+		m_recentFiles << recent;
+		first = recent;
+	}
+}
+
+// =============================================================================
+//
+QList<LDQuickColor> LoadQuickColorList()
+{
+	QList<LDQuickColor> colors;
+
+	for (QString colorname : cfg::QuickColorToolbar.split (":"))
+	{
+		if (colorname == "|")
+			colors << LDQuickColor::getSeparator();
+		else
+		{
+			LDColor color = colorname.toInt();
+
+			if (color.isValid())
+				colors << LDQuickColor (color, null);
+		}
+	}
+
+	return colors;
+}
+
+// =============================================================================
+//
+void MainWindow::updateColorToolbar()
+{
+	m_colorButtons.clear();
+	ui->toolBarColors->clear();
+	ui->toolBarColors->addAction (ui->actionUncolor);
+	ui->toolBarColors->addSeparator();
+
+	for (LDQuickColor& entry : m_quickColors)
+	{
+		if (entry.isSeparator())
+		{
+			ui->toolBarColors->addSeparator();
+		}
+		else
+		{
+			QToolButton* colorButton = new QToolButton;
+			colorButton->setIcon (MakeColorIcon (entry.color(), 16));
+			colorButton->setIconSize (QSize (16, 16));
+			colorButton->setToolTip (entry.color().name());
+
+			connect (colorButton, SIGNAL (clicked()), this, SLOT (slot_quickColor()));
+			ui->toolBarColors->addWidget (colorButton);
+			m_colorButtons << colorButton;
+
+			entry.setToolButton (colorButton);
+		}
+	}
+
+	updateGridToolBar();
+}
+
+// =============================================================================
+//
+void MainWindow::updateGridToolBar()
+{
+	// Ensure that the current grid - and only the current grid - is selected.
+	ui->actionGridCoarse->setChecked (cfg::Grid == Grid::Coarse);
+	ui->actionGridMedium->setChecked (cfg::Grid == Grid::Medium);
+	ui->actionGridFine->setChecked (cfg::Grid == Grid::Fine);
+}
+
+// =============================================================================
+//
+void MainWindow::updateTitle()
+{
+	QString title = format (APPNAME " " VERSION_STRING);
+
+	// Append our current file if we have one
+	if (CurrentDocument())
+	{
+		title += ": ";
+		title += CurrentDocument()->getDisplayName();
+
+		if (CurrentDocument()->getObjectCount() > 0 and
+			CurrentDocument()->getObject (0)->type() == OBJ_Comment)
+		{
+			// Append title
+			LDComment* comm = static_cast <LDComment*> (CurrentDocument()->getObject (0));
+			title += format (": %1", comm->text());
+		}
+
+		if (CurrentDocument()->hasUnsavedChanges())
+			title += '*';
+	}
+
+#ifdef DEBUG
+	title += " [debug build]";
+#elif BUILD_ID != BUILD_RELEASE
+	title += " [pre-release build]";
+#endif // DEBUG
+
+	if (strlen (commitTimeString()))
+		title += format (" (%1)", QString::fromUtf8 (commitTimeString()));
+
+	setWindowTitle (title);
+}
+
+// =============================================================================
+//
+int MainWindow::deleteSelection()
+{
+	if (Selection().isEmpty())
+		return 0;
+
+	LDObjectList selCopy = Selection();
+
+	// Delete the objects that were being selected
+	for (LDObject* obj : selCopy)
+		obj->destroy();
+
+	refresh();
+	return selCopy.size();
+}
+
+// =============================================================================
+//
+void MainWindow::buildObjList()
+{
+	if (not CurrentDocument())
+		return;
+
+	// Lock the selection while we do this so that refreshing the object list
+	// doesn't trigger selection updating so that the selection doesn't get lost
+	// while this is done.
+	g_isSelectionLocked = true;
+
+	for (int i = 0; i < ui->objectList->count(); ++i)
+		delete ui->objectList->item (i);
+
+	ui->objectList->clear();
+
+	for (LDObject* obj : CurrentDocument()->objects())
+	{
+		QString descr;
+
+		switch (obj->type())
+		{
+			case OBJ_Comment:
+			{
+				descr = static_cast<LDComment*> (obj)->text();
+
+				// Remove leading whitespace
+				while (descr[0] == ' ')
+					descr.remove (0, 1);
+
+				break;
+			}
+
+			case OBJ_Empty:
+				break; // leave it empty
+
+			case OBJ_Line:
+			case OBJ_Triangle:
+			case OBJ_Quad:
+			case OBJ_CondLine:
+			{
+				for (int i = 0; i < obj->numVertices(); ++i)
+				{
+					if (i != 0)
+						descr += ", ";
+
+					descr += obj->vertex (i).toString (true);
+				}
+				break;
+			}
+
+			case OBJ_Error:
+			{
+				descr = format ("ERROR: %1", obj->asText());
+				break;
+			}
+
+			case OBJ_Subfile:
+			{
+				LDSubfile* ref = static_cast<LDSubfile*> (obj);
+
+				descr = format ("%1 %2, (", ref->fileInfo()->getDisplayName(), ref->position().toString (true));
+
+				for (int i = 0; i < 9; ++i)
+					descr += format ("%1%2", ref->transform()[i], (i != 8) ? " " : "");
+
+				descr += ')';
+				break;
+			}
+
+			case OBJ_BFC:
+			{
+				descr = LDBFC::StatementStrings[int (static_cast<LDBFC*> (obj)->statement())];
+				break;
+			}
+
+			case OBJ_Overlay:
+			{
+				LDOverlay* ovl = static_cast<LDOverlay*> (obj);
+				descr = format ("[%1] %2 (%3, %4), %5 x %6", g_CameraNames[ovl->camera()],
+					Basename (ovl->fileName()), ovl->x(), ovl->y(),
+					ovl->width(), ovl->height());
+				break;
+			}
+
+			default:
+			{
+				descr = obj->typeName();
+				break;
+			}
+		}
+
+		QListWidgetItem* item = new QListWidgetItem (descr);
+		item->setIcon (GetIcon (obj->typeName()));
+
+		// Use italic font if hidden
+		if (obj->isHidden())
+		{
+			QFont font = item->font();
+			font.setItalic (true);
+			item->setFont (font);
+		}
+
+		// Color gibberish orange on red so it stands out.
+		if (obj->type() == OBJ_Error)
+		{
+			item->setBackground (QColor ("#AA0000"));
+			item->setForeground (QColor ("#FFAA00"));
+		}
+		else if (cfg::ColorizeObjectsList and obj->isColored() and
+			obj->color().isValid() and obj->color() != MainColor and obj->color() != EdgeColor)
+		{
+			// If the object isn't in the main or edge color, draw this list entry in that color.
+			item->setForeground (obj->color().faceColor());
+		}
+
+		obj->qObjListEntry = item;
+		ui->objectList->insertItem (ui->objectList->count(), item);
+	}
+
+	g_isSelectionLocked = false;
+	updateSelection();
+	scrollToSelection();
+}
+
+// =============================================================================
+//
+void MainWindow::scrollToSelection()
+{
+	if (Selection().isEmpty())
+		return;
+
+	LDObject* obj = Selection().last();
+	ui->objectList->scrollToItem (obj->qObjListEntry);
+}
+
+// =============================================================================
+//
+void MainWindow::slot_selectionChanged()
+{
+	if (g_isSelectionLocked == true or CurrentDocument() == null)
+		return;
+
+	LDObjectList priorSelection = Selection();
+
+	// Get the objects from the object list selection
+	CurrentDocument()->clearSelection();
+	const QList<QListWidgetItem*> items = ui->objectList->selectedItems();
+
+	for (LDObject* obj : CurrentDocument()->objects())
+	{
+		for (QListWidgetItem* item : items)
+		{
+			if (item == obj->qObjListEntry)
+			{
+				obj->select();
+				break;
+			}
+		}
+	}
+
+	// The select() method calls may have selected additional items (i.e. invertnexts)
+	// Update it all now.
+	updateSelection();
+
+	// Update the GL renderer
+	LDObjectList compound = priorSelection + Selection();
+	RemoveDuplicates (compound);
+
+	for (LDObject* obj : compound)
+		R()->compileObject (obj);
+
+	R()->update();
+}
+
+// =============================================================================
+//
+void MainWindow::slot_recentFile()
+{
+	QAction* qAct = static_cast<QAction*> (sender());
+	OpenMainModel (qAct->text());
+}
+
+// =============================================================================
+//
+void MainWindow::slot_quickColor()
+{
+	QToolButton* button = static_cast<QToolButton*> (sender());
+	LDColor color = LDColor::nullColor();
+
+	for (const LDQuickColor& entry : m_quickColors)
+	{
+		if (entry.toolButton() == button)
+		{
+			color = entry.color();
+			break;
+		}
+	}
+
+	if (not color.isValid())
+		return;
+
+	for (LDObject* obj : Selection())
+	{
+		if (not obj->isColored())
+			continue; // uncolored object
+
+		obj->setColor (color);
+		R()->compileObject (obj);
+	}
+
+	endAction();
+	refresh();
+}
+
+// =============================================================================
+//
+int MainWindow::getInsertionPoint()
+{
+	// If we have a selection, put the item after it.
+	if (not Selection().isEmpty())
+		return Selection().last()->lineNumber() + 1;
+
+	// Otherwise place the object at the end.
+	return CurrentDocument()->getObjectCount();
+}
+
+// =============================================================================
+//
+void MainWindow::doFullRefresh()
+{
+	buildObjList();
+	m_renderer->hardRefresh();
+}
+
+// =============================================================================
+//
+void MainWindow::refresh()
+{
+	buildObjList();
+	m_renderer->update();
+}
+
+// =============================================================================
+//
+void MainWindow::updateSelection()
+{
+	g_isSelectionLocked = true;
+	QItemSelection itemselect;
+	int top = -1;
+	int bottom = -1;
+
+	for (LDObject* obj : Selection())
+	{
+		if (obj->qObjListEntry == null)
+			continue;
+
+		int row = ui->objectList->row (obj->qObjListEntry);
+
+		if (top == -1)
+		{
+			top = bottom = row;
+		}
+		else
+		{
+			if (row != bottom + 1)
+			{
+				itemselect.select (ui->objectList->model()->index (top, 0),
+					ui->objectList->model()->index (bottom, 0));
+				top = -1;
+			}
+
+			bottom = row;
+		}
+	}
+
+	if (top != -1)
+	{
+		itemselect.select (ui->objectList->model()->index (top, 0),
+			ui->objectList->model()->index (bottom, 0));
+	}
+
+	ui->objectList->selectionModel()->select (itemselect, QItemSelectionModel::ClearAndSelect);
+	g_isSelectionLocked = false;
+}
+
+// =============================================================================
+//
+LDColor MainWindow::getSelectedColor()
+{
+	LDColor result;
+
+	for (LDObject* obj : Selection())
+	{
+		if (not obj->isColored())
+			continue; // This one doesn't use color so it doesn't have a say
+
+		if (result.isValid() and obj->color() != result)
+			return LDColor::nullColor(); // No consensus in object color
+
+		if (not result.isValid())
+			result = obj->color();
+	}
+
+	return result;
+}
+
+// =============================================================================
+//
+void MainWindow::closeEvent (QCloseEvent* ev)
+{
+	// Check whether it's safe to close all files.
+	if (not IsSafeToCloseAll())
+	{
+		ev->ignore();
+		return;
+	}
+
+	// Save the toolbar set
+	cfg::HiddenToolbars.clear();
+
+	for (QToolBar* toolbar : findChildren<QToolBar*>())
+	{
+		if (toolbar->isHidden())
+			cfg::HiddenToolbars << toolbar->objectName();
+	}
+
+	// Save the configuration before leaving.
+	Config::Save();
+	ev->accept();
+}
+
+// =============================================================================
+//
+void MainWindow::spawnContextMenu (const QPoint pos)
+{
+	const bool single = (Selection().size() == 1);
+	LDObject* singleObj = single ? Selection().first() : nullptr;
+
+	bool hasSubfiles = false;
+
+	for (LDObject* obj : Selection())
+	{
+		if (obj->type() == OBJ_Subfile)
+		{
+			hasSubfiles = true;
+			break;
+		}
+	}
+
+	QMenu* contextMenu = new QMenu;
+
+	if (single and singleObj->type() != OBJ_Empty)
+	{
+		contextMenu->addAction (ui->actionEdit);
+		contextMenu->addSeparator();
+	}
+
+	contextMenu->addAction (ui->actionCut);
+	contextMenu->addAction (ui->actionCopy);
+	contextMenu->addAction (ui->actionPaste);
+	contextMenu->addAction (ui->actionDelete);
+	contextMenu->addSeparator();
+	contextMenu->addAction (ui->actionSetColor);
+
+	if (single)
+		contextMenu->addAction (ui->actionEditRaw);
+
+	contextMenu->addAction (ui->actionBorders);
+	contextMenu->addAction (ui->actionSetOverlay);
+	contextMenu->addAction (ui->actionClearOverlay);
+
+	if (hasSubfiles)
+	{
+		contextMenu->addSeparator();
+		contextMenu->addAction (ui->actionOpenSubfiles);
+	}
+
+	contextMenu->addSeparator();
+	contextMenu->addAction (ui->actionModeSelect);
+	contextMenu->addAction (ui->actionModeDraw);
+	contextMenu->addAction (ui->actionModeCircle);
+
+	if (not Selection().isEmpty())
+	{
+		contextMenu->addSeparator();
+		contextMenu->addAction (ui->actionSubfileSelection);
+	}
+
+	if (R()->camera() != EFreeCamera)
+	{
+		contextMenu->addSeparator();
+		contextMenu->addAction (ui->actionSetDrawDepth);
+	}
+
+	contextMenu->exec (pos);
+}
+
+// =============================================================================
+//
+void MainWindow::deleteByColor (LDColor color)
+{
+	LDObjectList objs;
+
+	for (LDObject* obj : CurrentDocument()->objects())
+	{
+		if (not obj->isColored() or obj->color() != color)
+			continue;
+
+		objs << obj;
+	}
+
+	for (LDObject* obj : objs)
+		obj->destroy();
+}
+
+// =============================================================================
+//
+void MainWindow::updateEditModeActions()
+{
+	const EditModeType mode = R()->currentEditModeType();
+	ui->actionModeSelect->setChecked (mode == EditModeType::Select);
+	ui->actionModeDraw->setChecked (mode == EditModeType::Draw);
+	ui->actionModeRectangle->setChecked (mode == EditModeType::Rectangle);
+	ui->actionModeCircle->setChecked (mode == EditModeType::Circle);
+	ui->actionModeMagicWand->setChecked (mode == EditModeType::MagicWand);
+	ui->actionModeLinePath->setChecked (mode == EditModeType::LinePath);
+}
+
+// =============================================================================
+//
+void MainWindow::slot_editObject (QListWidgetItem* listitem)
+{
+	for (LDObject* it : CurrentDocument()->objects())
+	{
+		if (it->qObjListEntry == listitem)
+		{
+			AddObjectDialog::staticDialog (it->type(), it);
+			break;
+		}
+	}
+}
+
+// =============================================================================
+//
+bool MainWindow::save (LDDocument* doc, bool saveAs)
+{
+	QString path = doc->fullPath();
+	int64 savesize;
+
+	if (saveAs or path.isEmpty())
+	{
+		QString name = doc->defaultName();
+
+		if (not doc->fullPath().isEmpty()) 
+			name = doc->fullPath();
+		elif (not doc->name().isEmpty())
+			name = doc->name();
+
+		name.replace ("\\", "/");
+		path = QFileDialog::getSaveFileName (g_win, tr ("Save As"),
+			name, tr ("LDraw files (*.dat *.ldr)"));
+
+		if (path.isEmpty())
+		{
+			// User didn't give a file name, abort.
+			return false;
+		}
+	}
+
+	if (doc->save (path, &savesize))
+	{
+		if (doc == CurrentDocument())
+			updateTitle();
+
+		print ("Saved to %1 (%2)", path, MakePrettyFileSize (savesize));
+
+		// Add it to recent files
+		AddRecentFile (path);
+		return true;
+	}
+
+	QString message = format (tr ("Failed to save to %1: %2"), path, strerror (errno));
+
+	// Tell the user the save failed, and give the option for saving as with it.
+	QMessageBox dlg (QMessageBox::Critical, tr ("Save Failure"), message, QMessageBox::Close, g_win);
+
+	// Add a save-as button
+	QPushButton* saveAsBtn = new QPushButton (tr ("Save As"));
+	saveAsBtn->setIcon (GetIcon ("file-save-as"));
+	dlg.addButton (saveAsBtn, QMessageBox::ActionRole);
+	dlg.setDefaultButton (QMessageBox::Close);
+	dlg.exec();
+
+	if (dlg.clickedButton() == saveAsBtn)
+		return save (doc, true); // yay recursion!
+
+	return false;
+}
+
+void MainWindow::addMessage (QString msg)
+{
+	m_msglog->addLine (msg);
+}
+
+// ============================================================================
+void ObjectList::contextMenuEvent (QContextMenuEvent* ev)
+{
+	g_win->spawnContextMenu (ev->globalPos());
+}
+
+// =============================================================================
+//
+QPixmap GetIcon (QString iconName)
+{
+	return (QPixmap (format (":/icons/%1.png", iconName)));
+}
+
+// =============================================================================
+//
+bool Confirm (const QString& message)
+{
+	return Confirm (MainWindow::tr ("Confirm"), message);
+}
+
+// =============================================================================
+//
+bool Confirm (const QString& title, const QString& message)
+{
+	return QMessageBox::question (g_win, title, message,
+		(QMessageBox::Yes | QMessageBox::No), QMessageBox::No) == QMessageBox::Yes;
+}
+
+// =============================================================================
+//
+void Critical (const QString& message)
+{
+	QMessageBox::critical (g_win, MainWindow::tr ("Error"), message,
+		(QMessageBox::Close), QMessageBox::Close);
+}
+
+// =============================================================================
+//
+QIcon MakeColorIcon (LDColor colinfo, const int size)
+{
+	// Create an image object and link a painter to it.
+	QImage img (size, size, QImage::Format_ARGB32);
+	QPainter paint (&img);
+	QColor col = colinfo.faceColor();
+
+	if (colinfo == MainColor)
+	{
+		// Use the user preferences for main color here
+		col = cfg::MainColor;
+		col.setAlphaF (cfg::MainColorAlpha);
+	}
+
+	// Paint the icon border
+	paint.fillRect (QRect (0, 0, size, size), colinfo.edgeColor());
+
+	// Paint the checkerboard background, visible with translucent icons
+	paint.drawPixmap (QRect (1, 1, size - 2, size - 2), GetIcon ("checkerboard"), QRect (0, 0, 8, 8));
+
+	// Paint the color above the checkerboard
+	paint.fillRect (QRect (1, 1, size - 2, size - 2), col);
+	return QIcon (QPixmap::fromImage (img));
+}
+
+// =============================================================================
+//
+void MakeColorComboBox (QComboBox* box)
+{
+	std::map<LDColor, int> counts;
+
+	for (LDObject* obj : CurrentDocument()->objects())
+	{
+		if (not obj->isColored() or not obj->color().isValid())
+			continue;
+
+		if (counts.find (obj->color()) == counts.end())
+			counts[obj->color()] = 1;
+		else
+			counts[obj->color()]++;
+	}
+
+	box->clear();
+	int row = 0;
+
+	for (const auto& pair : counts)
+	{
+		QIcon ico = MakeColorIcon (pair.first, 16);
+		box->addItem (ico, format ("[%1] %2 (%3 object%4)",
+			pair.first, pair.first.name(), pair.second, Plural (pair.second)));
+		box->setItemData (row, pair.first.index());
+
+		++row;
+	}
+}
+
+// =============================================================================
+//
+void MainWindow::updateDocumentList()
+{
+	m_updatingTabs = true;
+
+	while (m_tabs->count() > 0)
+		m_tabs->removeTab (0);
+
+	for (LDDocument* f : LDDocument::explicitDocuments())
+	{
+		// Add an item to the list for this file and store the tab index
+		// in the document so we can find documents by tab index.
+		f->setTabIndex (m_tabs->addTab (""));
+		updateDocumentListItem (f);
+	}
+
+	m_updatingTabs = false;
+}
+
+// =============================================================================
+//
+void MainWindow::updateDocumentListItem (LDDocument* doc)
+{
+	bool oldUpdatingTabs = m_updatingTabs;
+	m_updatingTabs = true;
+
+	if (doc->tabIndex() == -1)
+	{
+		// We don't have a list item for this file, so the list either doesn't
+		// exist yet or is out of date. Build the list now.
+		updateDocumentList();
+		return;
+	}
+
+	// If this is the current file, it also needs to be the selected item on
+	// the list.
+	if (doc == CurrentDocument())
+		m_tabs->setCurrentIndex (doc->tabIndex());
+
+	m_tabs->setTabText (doc->tabIndex(), doc->getDisplayName());
+
+	// If the document.has unsaved changes, draw a little icon next to it to mark that.
+	m_tabs->setTabIcon (doc->tabIndex(), doc->hasUnsavedChanges() ? GetIcon ("file-save") : QIcon());
+	m_tabs->setTabData (doc->tabIndex(), doc->name());
+	m_updatingTabs = oldUpdatingTabs;
+}
+
+// =============================================================================
+//
+// A file is selected from the list of files on the left of the screen. Find out
+// which file was picked and change to it.
+//
+void MainWindow::changeCurrentFile()
+{
+	if (m_updatingTabs)
+		return;
+
+	LDDocument* file = nullptr;
+	int tabIndex = m_tabs->currentIndex();
+
+	// Find the file pointer of the item that was selected.
+	for (LDDocument* it : LDDocument::explicitDocuments())
+	{
+		if (it->tabIndex() == tabIndex)
+		{
+			file = it;
+			break;
+		}
+	}
+
+	// If we picked the same file we're currently on, we don't need to do
+	// anything.
+	if (file == null or file == CurrentDocument())
+		return;
+
+	LDDocument::setCurrent (file);
+}
+
+// =============================================================================
+//
+void MainWindow::refreshObjectList()
+{
+#if 0
+	ui->objectList->clear();
+	LDDocument* f = getCurrentDocument();
+
+for (LDObject* obj : *f)
+		ui->objectList->addItem (obj->qObjListEntry);
+
+#endif
+
+	buildObjList();
+}
+
+// =============================================================================
+//
+void MainWindow::updateActions()
+{
+	if (CurrentDocument() != null and CurrentDocument()->history() != null)
+	{
+		History* his = CurrentDocument()->history();
+		int pos = his->position();
+		ui->actionUndo->setEnabled (pos != -1);
+		ui->actionRedo->setEnabled (pos < (long) his->getSize() - 1);
+	}
+
+	ui->actionWireframe->setChecked (cfg::DrawWireframe);
+	ui->actionAxes->setChecked (cfg::DrawAxes);
+	ui->actionBFCView->setChecked (cfg::BFCRedGreenView);
+	ui->actionRandomColors->setChecked (cfg::RandomColors);
+	ui->actionDrawAngles->setChecked (cfg::DrawAngles);
+	ui->actionDrawSurfaces->setChecked (cfg::DrawSurfaces);
+	ui->actionDrawEdgeLines->setChecked (cfg::DrawEdgeLines);
+	ui->actionDrawConditionalLines->setChecked (cfg::DrawConditionalLines);
+}
+
+// =============================================================================
+//
+void MainWindow::updatePrimitives()
+{
+	PopulatePrimitives (ui->primitives);
+}
+
+// =============================================================================
+//
+void MainWindow::closeTab (int tabindex)
+{
+	LDDocument* doc = FindDocument (m_tabs->tabData (tabindex).toString());
+
+	if (doc == null)
+		return;
+
+	doc->dismiss();
+}
+
+// =============================================================================
+//
+void MainWindow::loadShortcuts (QSettings const* settings)
+{
+	for (QAction* act : findChildren<QAction*>())
+	{
+		QKeySequence seq = settings->value ("shortcut_" + act->objectName(), act->shortcut()).value<QKeySequence>();
+		act->setShortcut (seq);
+	}
+}
+
+// =============================================================================
+//
+void MainWindow::saveShortcuts (QSettings* settings)
+{
+	applyToActions ([&](QAction* act)
+	{
+		QString const key = "shortcut_" + act->objectName();
+
+		if (g_defaultShortcuts[act] != act->shortcut())
+			settings->setValue (key, act->shortcut());
+		else
+			settings->remove (key);
+	});
+}
+
+// =============================================================================
+//
+void MainWindow::applyToActions (std::function<void(QAction*)> function)
+{
+	for (QAction* act : findChildren<QAction*>())
+	{
+		if (not act->objectName().isEmpty())
+			function (act);
+	}
+}
+
+// =============================================================================
+//
+QKeySequence MainWindow::defaultShortcut (QAction* act) // [static]
+{
+	return g_defaultShortcuts[act];
+}
+
+// =============================================================================
+//
+bool MainWindow::ringToolHiRes() const
+{
+	return ui->ringToolHiRes->isChecked();
+}
+
+// =============================================================================
+//
+int MainWindow::ringToolSegments() const
+{
+	return ui->ringToolSegments->value();
+}
+
+// =============================================================================
+//
+void MainWindow::ringToolHiResClicked (bool checked)
+{
+	if (checked)
+	{
+		ui->ringToolSegments->setMaximum (HighResolution);
+		ui->ringToolSegments->setValue (ui->ringToolSegments->value() * 3);
+	}
+	else
+	{
+		ui->ringToolSegments->setValue (ui->ringToolSegments->value() / 3);
+		ui->ringToolSegments->setMaximum (LowResolution);
+	}
+}
+
+// =============================================================================
+//
+void MainWindow::circleToolSegmentsChanged()
+{
+	int numerator (ui->ringToolSegments->value());
+	int denominator (ui->ringToolHiRes->isChecked() ? HighResolution : LowResolution);
+	Simplify (numerator, denominator);
+	ui->ringToolSegmentsLabel->setText (format ("%1 / %2", numerator, denominator));
+}
+
+// =============================================================================
+//
+QImage GetImageFromScreencap (uchar* data, int w, int h)
+{
+	// GL and Qt formats have R and B swapped. Also, GL flips Y - correct it as well.
+	return QImage (data, w, h, QImage::Format_ARGB32).rgbSwapped().mirrored();
+}
+
+// =============================================================================
+//
+LDQuickColor::LDQuickColor (LDColor color, QToolButton* toolButton) :
+	m_color (color),
+	m_toolButton (toolButton) {}
+
+// =============================================================================
+//
+LDQuickColor LDQuickColor::getSeparator()
+{
+	return LDQuickColor (LDColor::nullColor(), null);
+}
+
+// =============================================================================
+//
+bool LDQuickColor::isSeparator() const
+{
+	return color() == LDColor::nullColor();
+}
+
+void PopulatePrimitives (QTreeWidget* tw, QString const& selectByDefault)
+{
+	tw->clear();
+
+	for (PrimitiveCategory* cat : g_PrimitiveCategories)
+	{
+		SubfileListItem* parentItem = new SubfileListItem (tw, null);
+		parentItem->setText (0, cat->name());
+		QList<QTreeWidgetItem*> subfileItems;
+
+		for (Primitive& prim : cat->prims)
+		{
+			SubfileListItem* item = new SubfileListItem (parentItem, &prim);
+			item->setText (0, format ("%1 - %2", prim.name, prim.title));
+			subfileItems << item;
+
+			// If this primitive is the one the current object points to,
+			// select it by default
+			if (selectByDefault == prim.name)
+				tw->setCurrentItem (item);
+		}
+
+		tw->addTopLevelItem (parentItem);
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/mainwindow.h	Sun Aug 30 04:53:37 2015 +0300
@@ -0,0 +1,391 @@
+/*
+ *  LDForge: LDraw parts authoring CAD
+ *  Copyright (C) 2013, 2014 Teemu Piippo
+ *
+ *  This program is free software: you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation, either version 3 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+#include <functional>
+#include <QMainWindow>
+#include <QAction>
+#include <QListWidget>
+#include <QRadioButton>
+#include "configuration.h"
+#include "ldObject.h"
+#include "ui_ldforge.h"
+#include "colors.h"
+
+class MessageManager;
+class MainWindow;
+class QToolButton;
+class QDialogButtonBox;
+class GLRenderer;
+class QComboBox;
+class QProgressBar;
+class Ui_LDForgeUI;
+struct Primitive;
+
+// Stuff for dialogs
+#define IMPLEMENT_DIALOG_BUTTONS \
+	bbx_buttons = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel); \
+	connect (bbx_buttons, SIGNAL (accepted()), this, SLOT (accept())); \
+	connect (bbx_buttons, SIGNAL (rejected()), this, SLOT (reject())); \
+
+class LDQuickColor
+{
+	PROPERTY (public,	LDColor,		color,		setColor,		STOCK_WRITE)
+	PROPERTY (public,	QToolButton*,	toolButton,	setToolButton,	STOCK_WRITE)
+
+	public:
+		LDQuickColor (LDColor color, QToolButton* toolButton);
+		bool isSeparator() const;
+
+		static LDQuickColor getSeparator();
+};
+
+//
+// Object list class for MainWindow
+//
+class ObjectList : public QListWidget
+{
+	Q_OBJECT
+
+	protected:
+		void contextMenuEvent (QContextMenuEvent* ev);
+};
+
+//
+// LDForge's main GUI class.
+//
+class MainWindow : public QMainWindow
+{
+	Q_OBJECT
+
+public:
+	explicit MainWindow (QWidget* parent = null, Qt::WindowFlags flags = 0);
+	~MainWindow();
+
+	// Rebuilds the object list.
+	void buildObjList();
+
+	// Updates the window title.
+	void updateTitle();
+
+	// Builds the object list and tells the GL renderer to init a full
+	// refresh.
+	void doFullRefresh();
+
+	// Builds the object list and tells the GL renderer to do a soft update.
+	void refresh();
+
+	// Returns the suggested position to place a new object at.
+	int getInsertionPoint();
+
+	// Updates the quick color toolbar
+	void updateColorToolbar();
+
+	// Rebuilds the recent files submenu
+	void updateRecentFilesMenu();
+
+	// Sets the selection based on what's selected in the object list.
+	void updateSelection();
+
+	// Updates the grids, selects the selected grid and deselects others.
+	void updateGridToolBar();
+
+	// Updates the edit modes, current one is selected and others are deselected.
+	void updateEditModeActions();
+
+	// Rebuilds the document tab list.
+	void updateDocumentList();
+
+	// Updates the document tab for \c doc. If no such tab exists, the
+	// document list is rebuilt instead.
+	void updateDocumentListItem (LDDocument* doc);
+
+	// Returns the uniform selected color (i.e. 4 if everything selected is
+	// red), -1 if there is no such consensus.
+	LDColor getSelectedColor();
+
+	// Automatically scrolls the object list so that it points to the first
+	// selected object.
+	void scrollToSelection();
+
+	// Spawns the context menu at the given position.
+	void spawnContextMenu (const QPoint pos);
+
+	// Deletes all selected objects, returns the count of deleted objects.
+	int deleteSelection();
+
+	// Deletes all objects by the given color number.
+	void deleteByColor (LDColor color);
+
+	// Tries to save the given document.
+	bool save (LDDocument* doc, bool saveAs);
+
+	// Updates various actions, undo/redo are set enabled/disabled where
+	// appropriate, togglable actions are updated based on configuration,
+	// etc.
+	void updateActions();
+
+	// Returns a pointer to the renderer
+	inline GLRenderer* R()
+	{
+		return m_renderer;
+	}
+
+	// Sets the quick color list to the given list of colors.
+	inline void setQuickColors (const QList<LDQuickColor>& colors)
+	{
+		m_quickColors = colors;
+		updateColorToolbar();
+	}
+
+	// Adds a message to the renderer's message manager.
+	void addMessage (QString msg);
+
+	// Updates the object list. Right now this just rebuilds it.
+	void refreshObjectList();
+
+	void endAction();
+
+	inline QTreeWidget* getPrimitivesTree() const
+	{
+		return ui->primitives;
+	}
+
+	static QKeySequence defaultShortcut (QAction* act);
+	void loadShortcuts (QSettings const* settings);
+	void saveShortcuts (QSettings* settings);
+	void applyToActions (std::function<void(QAction*)> function);
+
+	bool ringToolHiRes() const;
+	int ringToolSegments() const;
+
+public slots:
+	void updatePrimitives();
+	void changeCurrentFile();
+	void closeTab (int tabindex);
+	void ringToolHiResClicked (bool clicked);
+	void circleToolSegmentsChanged();
+	void slot_action();
+	void slot_actionNew();
+	void slot_actionNewFile();
+	void slot_actionOpen();
+	void slot_actionDownloadFrom();
+	void slot_actionSave();
+	void slot_actionSaveAs();
+	void slot_actionSaveAll();
+	void slot_actionClose();
+	void slot_actionCloseAll();
+	void slot_actionInsertFrom();
+	void slot_actionExportTo();
+	void slot_actionSettings();
+	void slot_actionSetLDrawPath();
+	void slot_actionScanPrimitives();
+	void slot_actionExit();
+	void slot_actionResetView();
+	void slot_actionAxes();
+	void slot_actionWireframe();
+	void slot_actionBFCView();
+	void slot_actionSetOverlay();
+	void slot_actionClearOverlay();
+	void slot_actionScreenshot();
+	void slot_actionInsertRaw();
+	void slot_actionNewSubfile();
+	void slot_actionNewLine();
+	void slot_actionNewTriangle();
+	void slot_actionNewQuad();
+	void slot_actionNewCLine();
+	void slot_actionNewComment();
+	void slot_actionNewBFC();
+	void slot_actionNewVertex();
+	void slot_actionUndo();
+	void slot_actionRedo();
+	void slot_actionCut();
+	void slot_actionCopy();
+	void slot_actionPaste();
+	void slot_actionDelete();
+	void slot_actionSelectAll();
+	void slot_actionSelectByColor();
+	void slot_actionSelectByType();
+	void slot_actionModeDraw();
+	void slot_actionModeSelect();
+	void slot_actionModeRectangle();
+	void slot_actionModeCircle();
+	void slot_actionModeMagicWand();
+	void slot_actionModeLinePath();
+	void slot_actionSetDrawDepth();
+	void slot_actionSetColor();
+	void slot_actionAutocolor();
+	void slot_actionUncolor();
+	void slot_actionInline();
+	void slot_actionInlineDeep();
+	void slot_actionInvert();
+	void slot_actionMakePrimitive();
+	void slot_actionSplitQuads();
+	void slot_actionEditRaw();
+	void slot_actionBorders();
+	void slot_actionRoundCoordinates();
+	void slot_actionVisibilityHide();
+	void slot_actionVisibilityReveal();
+	void slot_actionVisibilityToggle();
+	void slot_actionReplaceCoords();
+	void slot_actionFlip();
+	void slot_actionDemote();
+	void slot_actionYtruder();
+	void slot_actionRectifier();
+	void slot_actionIntersector();
+	void slot_actionIsecalc();
+	void slot_actionCoverer();
+	void slot_actionEdger2();
+	void slot_actionHelp();
+	void slot_actionAbout();
+	void slot_actionAboutQt();
+	void slot_actionGridCoarse();
+	void slot_actionGridMedium();
+	void slot_actionGridFine();
+	void slot_actionEdit();
+	void slot_actionMoveUp();
+	void slot_actionMoveDown();
+	void slot_actionMoveXNeg();
+	void slot_actionMoveXPos();
+	void slot_actionMoveYNeg();
+	void slot_actionMoveYPos();
+	void slot_actionMoveZNeg();
+	void slot_actionMoveZPos();
+	void slot_actionRotateXNeg();
+	void slot_actionRotateXPos();
+	void slot_actionRotateYNeg();
+	void slot_actionRotateYPos();
+	void slot_actionRotateZNeg();
+	void slot_actionRotateZPos();
+	void slot_actionRotationPoint();
+	void slot_actionAddHistoryLine();
+	void slot_actionJumpTo();
+	void slot_actionSubfileSelection();
+	void slot_actionDrawAngles();
+	void slot_actionRandomColors();
+	void slot_actionOpenSubfiles();
+	void slot_actionSplitLines();
+	void slot_actionDrawSurfaces();
+	void slot_actionDrawEdgeLines();
+	void slot_actionDrawConditionalLines();
+
+protected:
+	void closeEvent (QCloseEvent* ev);
+
+private:
+	GLRenderer*			m_renderer;
+	LDObjectList		m_sel;
+	QList<LDQuickColor>	m_quickColors;
+	QList<QToolButton*>	m_colorButtons;
+	QList<QAction*>		m_recentFiles;
+	MessageManager*		m_msglog;
+	Ui_LDForgeUI*		ui;
+	QTabBar*			m_tabs;
+	bool				m_updatingTabs;
+
+private slots:
+	void slot_selectionChanged();
+	void slot_recentFile();
+	void slot_quickColor();
+	void slot_lastSecondCleanup();
+	void slot_editObject (QListWidgetItem* listitem);
+};
+
+//! Pointer to the instance of MainWindow.
+extern MainWindow* g_win;
+
+//! Get an icon by name from the resources directory.
+QPixmap GetIcon (QString iconName);
+
+//! \returns a list of quick colors based on the configuration entry.
+QList<LDQuickColor> LoadQuickColorList();
+
+//! Asks the user a yes/no question with the given \c message and the given
+//! window \c title.
+//! \returns true if the user answered yes, false if no.
+bool Confirm (const QString& title, const QString& message); // Generic confirm prompt
+
+//! An overload of \c confirm(), this asks the user a yes/no question with the
+//! given \c message.
+//! \returns true if the user answered yes, false if no.
+bool Confirm (const QString& message);
+
+//! Displays an error prompt with the given \c message
+void Critical (const QString& message);
+
+//! Makes an icon of \c size x \c size pixels to represent \c colinfo
+QIcon MakeColorIcon (LDColor colinfo, const int size);
+
+//! Fills the given combo-box with color information
+void MakeColorComboBox (QComboBox* box);
+
+//! \returns a QImage from the given raw GL \c data
+QImage GetImageFromScreencap (uchar* data, int w, int h);
+
+//!
+//! Takes in pairs of radio buttons and respective values and finds the first
+//! selected one.
+//! \returns returns the value of the first found radio button that was checked
+//! \returns by the user.
+//!
+template<class T>
+T RadioSwitch (const T& defval, QList<Pair<QRadioButton*, T>> haystack)
+{
+	for (Pair<QRadioButton*, const T&> i : haystack)
+	{
+		if (i.first->isChecked())
+			return i.second;
+	}
+
+	return defval;
+}
+
+//!
+//! Takes in pairs of radio buttons and respective values and checks the first
+//! found radio button whose respsective value matches \c expr have the given value.
+//!
+template<class T>
+void RadioDefault (const T& expr, QList<Pair<QRadioButton*, T>> haystack)
+{
+	for (Pair<QRadioButton*, const T&> i : haystack)
+	{
+		if (i.second == expr)
+		{
+			i.first->setChecked (true);
+			return;
+		}
+	}
+}
+
+// =============================================================================
+//
+class SubfileListItem : public QTreeWidgetItem
+{
+	PROPERTY (public, Primitive*,	primitive, setPrimitive, STOCK_WRITE)
+
+public:
+	SubfileListItem (QTreeWidgetItem* parent, Primitive* info) :
+		QTreeWidgetItem (parent),
+		m_primitive (info) {}
+
+	SubfileListItem (QTreeWidget* parent, Primitive* info) :
+		QTreeWidgetItem (parent),
+		m_primitive (info) {}
+};
+
+void PopulatePrimitives (QTreeWidget* tw, const QString& selectByDefault = QString());
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/mainwindow.ui	Sun Aug 30 04:53:37 2015 +0300
@@ -0,0 +1,1713 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>LDForgeUI</class>
+ <widget class="QMainWindow" name="LDForgeUI">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>1010</width>
+    <height>641</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string/>
+  </property>
+  <property name="windowIcon">
+   <iconset>
+    <normaloff>:/icons/ldforge.png</normaloff>:/icons/ldforge.png</iconset>
+  </property>
+  <widget class="QWidget" name="centralwidget">
+   <layout class="QVBoxLayout" name="verticalLayout">
+    <item>
+     <layout class="QHBoxLayout" name="horizontalLayout" stretch="3,1">
+      <item>
+       <widget class="QFrame" name="rendererFrame">
+        <property name="sizePolicy">
+         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+          <horstretch>0</horstretch>
+          <verstretch>0</verstretch>
+         </sizepolicy>
+        </property>
+        <property name="frameShape">
+         <enum>QFrame::StyledPanel</enum>
+        </property>
+        <property name="frameShadow">
+         <enum>QFrame::Raised</enum>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QToolBox" name="toolBox">
+        <property name="currentIndex">
+         <number>0</number>
+        </property>
+        <widget class="QWidget" name="pageDocument">
+         <property name="geometry">
+          <rect>
+           <x>0</x>
+           <y>0</y>
+           <width>234</width>
+           <height>402</height>
+          </rect>
+         </property>
+         <attribute name="label">
+          <string>Document</string>
+         </attribute>
+         <layout class="QVBoxLayout" name="verticalLayout_2">
+          <item>
+           <widget class="QListWidget" name="objectList">
+            <property name="sizePolicy">
+             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
+              <horstretch>0</horstretch>
+              <verstretch>0</verstretch>
+             </sizepolicy>
+            </property>
+            <property name="selectionMode">
+             <enum>QAbstractItemView::ExtendedSelection</enum>
+            </property>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+        <widget class="QWidget" name="pageEditModeOptions">
+         <property name="geometry">
+          <rect>
+           <x>0</x>
+           <y>0</y>
+           <width>234</width>
+           <height>402</height>
+          </rect>
+         </property>
+         <attribute name="label">
+          <string>Tool Options</string>
+         </attribute>
+         <layout class="QVBoxLayout" name="verticalLayout_4">
+          <item>
+           <widget class="QGroupBox" name="groupBox">
+            <property name="title">
+             <string>Circle Tool Options</string>
+            </property>
+            <layout class="QVBoxLayout" name="verticalLayout_5">
+             <item>
+              <layout class="QFormLayout" name="formLayout">
+               <item row="0" column="1">
+                <widget class="QCheckBox" name="ringToolHiRes">
+                 <property name="text">
+                  <string>High resolution</string>
+                 </property>
+                </widget>
+               </item>
+               <item row="1" column="0">
+                <widget class="QLabel" name="label">
+                 <property name="text">
+                  <string>Segments:</string>
+                 </property>
+                </widget>
+               </item>
+               <item row="1" column="1">
+                <layout class="QHBoxLayout" name="horizontalLayout_2">
+                 <item>
+                  <widget class="QSpinBox" name="ringToolSegments">
+                   <property name="enabled">
+                    <bool>true</bool>
+                   </property>
+                   <property name="minimum">
+                    <number>1</number>
+                   </property>
+                   <property name="maximum">
+                    <number>16</number>
+                   </property>
+                   <property name="value">
+                    <number>16</number>
+                   </property>
+                  </widget>
+                 </item>
+                 <item>
+                  <widget class="QLabel" name="ringToolSegmentsLabel">
+                   <property name="text">
+                    <string>a / b</string>
+                   </property>
+                  </widget>
+                 </item>
+                </layout>
+               </item>
+              </layout>
+             </item>
+            </layout>
+           </widget>
+          </item>
+          <item>
+           <spacer name="verticalSpacer">
+            <property name="orientation">
+             <enum>Qt::Vertical</enum>
+            </property>
+            <property name="sizeHint" stdset="0">
+             <size>
+              <width>20</width>
+              <height>40</height>
+             </size>
+            </property>
+           </spacer>
+          </item>
+         </layout>
+        </widget>
+        <widget class="QWidget" name="pagePrimitives">
+         <property name="geometry">
+          <rect>
+           <x>0</x>
+           <y>0</y>
+           <width>234</width>
+           <height>402</height>
+          </rect>
+         </property>
+         <attribute name="label">
+          <string>Primitives</string>
+         </attribute>
+         <layout class="QVBoxLayout" name="verticalLayout_3">
+          <item>
+           <widget class="QTreeWidget" name="primitives">
+            <property name="dragDropMode">
+             <enum>QAbstractItemView::DragOnly</enum>
+            </property>
+            <attribute name="headerVisible">
+             <bool>false</bool>
+            </attribute>
+            <column>
+             <property name="text">
+              <string notr="true">1</string>
+             </property>
+            </column>
+           </widget>
+          </item>
+         </layout>
+        </widget>
+       </widget>
+      </item>
+     </layout>
+    </item>
+   </layout>
+  </widget>
+  <widget class="QMenuBar" name="menubar">
+   <property name="geometry">
+    <rect>
+     <x>0</x>
+     <y>0</y>
+     <width>1010</width>
+     <height>30</height>
+    </rect>
+   </property>
+   <widget class="QMenu" name="menuFile">
+    <property name="title">
+     <string>Fi&amp;le</string>
+    </property>
+    <widget class="QMenu" name="menuOpenRecent">
+     <property name="title">
+      <string>Open &amp;Recent...</string>
+     </property>
+     <property name="icon">
+      <iconset>
+       <normaloff>:/icons/open-recent.png</normaloff>:/icons/open-recent.png</iconset>
+     </property>
+    </widget>
+    <addaction name="actionNew"/>
+    <addaction name="actionNewFile"/>
+    <addaction name="actionOpen"/>
+    <addaction name="menuOpenRecent"/>
+    <addaction name="actionSave"/>
+    <addaction name="actionSaveAs"/>
+    <addaction name="actionSaveAll"/>
+    <addaction name="separator"/>
+    <addaction name="actionDownloadFrom"/>
+    <addaction name="separator"/>
+    <addaction name="actionClose"/>
+    <addaction name="actionCloseAll"/>
+    <addaction name="separator"/>
+    <addaction name="actionInsertFrom"/>
+    <addaction name="actionExportTo"/>
+    <addaction name="separator"/>
+    <addaction name="actionSettings"/>
+    <addaction name="actionSetLDrawPath"/>
+    <addaction name="actionScanPrimitives"/>
+    <addaction name="separator"/>
+    <addaction name="actionExit"/>
+   </widget>
+   <widget class="QMenu" name="menuView">
+    <property name="title">
+     <string>&amp;View</string>
+    </property>
+    <addaction name="actionResetView"/>
+    <addaction name="actionAxes"/>
+    <addaction name="actionWireframe"/>
+    <addaction name="actionBFCView"/>
+    <addaction name="actionDrawAngles"/>
+    <addaction name="actionRandomColors"/>
+    <addaction name="separator"/>
+    <addaction name="actionDrawSurfaces"/>
+    <addaction name="actionDrawEdgeLines"/>
+    <addaction name="actionDrawConditionalLines"/>
+    <addaction name="separator"/>
+    <addaction name="actionSetOverlay"/>
+    <addaction name="actionClearOverlay"/>
+    <addaction name="separator"/>
+    <addaction name="actionScreenshot"/>
+   </widget>
+   <widget class="QMenu" name="menuInsert">
+    <property name="title">
+     <string>I&amp;nsert</string>
+    </property>
+    <addaction name="actionInsertRaw"/>
+    <addaction name="separator"/>
+    <addaction name="actionNewSubfile"/>
+    <addaction name="actionNewLine"/>
+    <addaction name="actionNewTriangle"/>
+    <addaction name="actionNewQuad"/>
+    <addaction name="actionNewCLine"/>
+    <addaction name="actionNewComment"/>
+    <addaction name="actionNewBFC"/>
+    <addaction name="actionNewVertex"/>
+   </widget>
+   <widget class="QMenu" name="menuEdit">
+    <property name="title">
+     <string>Edit</string>
+    </property>
+    <addaction name="actionUndo"/>
+    <addaction name="actionRedo"/>
+    <addaction name="separator"/>
+    <addaction name="actionEdit"/>
+    <addaction name="separator"/>
+    <addaction name="actionCut"/>
+    <addaction name="actionCopy"/>
+    <addaction name="actionPaste"/>
+    <addaction name="actionDelete"/>
+    <addaction name="separator"/>
+    <addaction name="actionSelectAll"/>
+    <addaction name="actionSelectByColor"/>
+    <addaction name="actionSelectByType"/>
+    <addaction name="separator"/>
+    <addaction name="actionModeSelect"/>
+    <addaction name="actionModeMagicWand"/>
+    <addaction name="actionModeDraw"/>
+    <addaction name="actionModeRectangle"/>
+    <addaction name="actionModeCircle"/>
+    <addaction name="actionModeLinePath"/>
+    <addaction name="separator"/>
+    <addaction name="actionSetDrawDepth"/>
+    <addaction name="separator"/>
+    <addaction name="actionJumpTo"/>
+   </widget>
+   <widget class="QMenu" name="menuTools">
+    <property name="title">
+     <string>Tools</string>
+    </property>
+    <addaction name="actionSetColor"/>
+    <addaction name="actionAutocolor"/>
+    <addaction name="actionUncolor"/>
+    <addaction name="separator"/>
+    <addaction name="actionInvert"/>
+    <addaction name="actionInline"/>
+    <addaction name="actionInlineDeep"/>
+    <addaction name="actionMakePrimitive"/>
+    <addaction name="separator"/>
+    <addaction name="actionAddHistoryLine"/>
+    <addaction name="separator"/>
+    <addaction name="actionSplitQuads"/>
+    <addaction name="actionEditRaw"/>
+    <addaction name="actionBorders"/>
+    <addaction name="actionRoundCoordinates"/>
+    <addaction name="actionReplaceCoords"/>
+    <addaction name="actionFlip"/>
+    <addaction name="actionDemote"/>
+    <addaction name="actionOpenSubfiles"/>
+    <addaction name="actionSplitLines"/>
+    <addaction name="separator"/>
+    <addaction name="actionVisibilityHide"/>
+    <addaction name="actionVisibilityToggle"/>
+    <addaction name="actionVisibilityReveal"/>
+   </widget>
+   <widget class="QMenu" name="menuExternal_Tools">
+    <property name="title">
+     <string>E&amp;xternal Tools</string>
+    </property>
+    <addaction name="actionYtruder"/>
+    <addaction name="actionRectifier"/>
+    <addaction name="actionIntersector"/>
+    <addaction name="actionIsecalc"/>
+    <addaction name="actionCoverer"/>
+    <addaction name="actionEdger2"/>
+   </widget>
+   <widget class="QMenu" name="menuHelp">
+    <property name="title">
+     <string>Help</string>
+    </property>
+    <addaction name="actionHelp"/>
+    <addaction name="separator"/>
+    <addaction name="actionAbout"/>
+    <addaction name="actionAboutQt"/>
+   </widget>
+   <widget class="QMenu" name="menuMov">
+    <property name="title">
+     <string>&amp;Move</string>
+    </property>
+    <widget class="QMenu" name="menuGrids">
+     <property name="title">
+      <string>&amp;Grids</string>
+     </property>
+     <addaction name="actionGridCoarse"/>
+     <addaction name="actionGridMedium"/>
+     <addaction name="actionGridFine"/>
+    </widget>
+    <widget class="QMenu" name="menuMove_Objects">
+     <property name="title">
+      <string>&amp;Move Objects</string>
+     </property>
+     <addaction name="actionMoveXNeg"/>
+     <addaction name="actionMoveXPos"/>
+     <addaction name="actionMoveYNeg"/>
+     <addaction name="actionMoveYPos"/>
+     <addaction name="actionMoveZNeg"/>
+     <addaction name="actionMoveZPos"/>
+    </widget>
+    <widget class="QMenu" name="menuObject_List">
+     <property name="title">
+      <string>&amp;Object List</string>
+     </property>
+     <addaction name="actionMoveUp"/>
+     <addaction name="actionMoveDown"/>
+    </widget>
+    <widget class="QMenu" name="menuRotate">
+     <property name="title">
+      <string>&amp;Rotate</string>
+     </property>
+     <addaction name="actionRotateXNeg"/>
+     <addaction name="actionRotateXPos"/>
+     <addaction name="actionRotateYNeg"/>
+     <addaction name="actionRotateYPos"/>
+     <addaction name="actionRotateZNeg"/>
+     <addaction name="actionRotateZPos"/>
+    </widget>
+    <addaction name="menuGrids"/>
+    <addaction name="menuMove_Objects"/>
+    <addaction name="menuRotate"/>
+    <addaction name="menuObject_List"/>
+    <addaction name="separator"/>
+    <addaction name="actionRotationPoint"/>
+   </widget>
+   <addaction name="menuFile"/>
+   <addaction name="menuView"/>
+   <addaction name="menuInsert"/>
+   <addaction name="menuEdit"/>
+   <addaction name="menuMov"/>
+   <addaction name="menuTools"/>
+   <addaction name="menuExternal_Tools"/>
+   <addaction name="menuHelp"/>
+  </widget>
+  <widget class="QStatusBar" name="statusbar"/>
+  <widget class="QToolBar" name="toolBarFile">
+   <property name="windowTitle">
+    <string>File</string>
+   </property>
+   <attribute name="toolBarArea">
+    <enum>TopToolBarArea</enum>
+   </attribute>
+   <attribute name="toolBarBreak">
+    <bool>false</bool>
+   </attribute>
+   <addaction name="actionNew"/>
+   <addaction name="actionNewFile"/>
+   <addaction name="actionOpen"/>
+   <addaction name="actionSave"/>
+   <addaction name="actionSaveAs"/>
+  </widget>
+  <widget class="QToolBar" name="toolBarNewObject">
+   <property name="windowTitle">
+    <string>New Object</string>
+   </property>
+   <attribute name="toolBarArea">
+    <enum>TopToolBarArea</enum>
+   </attribute>
+   <attribute name="toolBarBreak">
+    <bool>false</bool>
+   </attribute>
+   <addaction name="actionNewSubfile"/>
+   <addaction name="actionNewLine"/>
+   <addaction name="actionNewTriangle"/>
+   <addaction name="actionNewQuad"/>
+   <addaction name="actionNewCLine"/>
+   <addaction name="actionNewComment"/>
+   <addaction name="actionNewBFC"/>
+   <addaction name="actionNewVertex"/>
+  </widget>
+  <widget class="QToolBar" name="toolBarBasicTools">
+   <property name="windowTitle">
+    <string>Basic tools</string>
+   </property>
+   <attribute name="toolBarArea">
+    <enum>TopToolBarArea</enum>
+   </attribute>
+   <attribute name="toolBarBreak">
+    <bool>false</bool>
+   </attribute>
+   <addaction name="actionUndo"/>
+   <addaction name="actionRedo"/>
+   <addaction name="actionCut"/>
+   <addaction name="actionCopy"/>
+   <addaction name="actionPaste"/>
+   <addaction name="actionDelete"/>
+  </widget>
+  <widget class="QToolBar" name="toolBarSelect">
+   <property name="windowTitle">
+    <string>Select</string>
+   </property>
+   <attribute name="toolBarArea">
+    <enum>TopToolBarArea</enum>
+   </attribute>
+   <attribute name="toolBarBreak">
+    <bool>false</bool>
+   </attribute>
+   <addaction name="actionSelectAll"/>
+   <addaction name="actionSelectByColor"/>
+   <addaction name="actionSelectByType"/>
+  </widget>
+  <widget class="QToolBar" name="toolBarGrid">
+   <property name="windowTitle">
+    <string>Grid</string>
+   </property>
+   <attribute name="toolBarArea">
+    <enum>TopToolBarArea</enum>
+   </attribute>
+   <attribute name="toolBarBreak">
+    <bool>false</bool>
+   </attribute>
+   <addaction name="actionGridCoarse"/>
+   <addaction name="actionGridMedium"/>
+   <addaction name="actionGridFine"/>
+  </widget>
+  <widget class="QToolBar" name="toolBarDisplay">
+   <property name="windowTitle">
+    <string>Display options</string>
+   </property>
+   <attribute name="toolBarArea">
+    <enum>TopToolBarArea</enum>
+   </attribute>
+   <attribute name="toolBarBreak">
+    <bool>true</bool>
+   </attribute>
+   <addaction name="actionAxes"/>
+   <addaction name="actionWireframe"/>
+   <addaction name="actionBFCView"/>
+   <addaction name="actionRandomColors"/>
+   <addaction name="actionDrawAngles"/>
+  </widget>
+  <widget class="QToolBar" name="toolBarEditTools">
+   <property name="windowTitle">
+    <string>Editing tools</string>
+   </property>
+   <attribute name="toolBarArea">
+    <enum>TopToolBarArea</enum>
+   </attribute>
+   <attribute name="toolBarBreak">
+    <bool>false</bool>
+   </attribute>
+   <addaction name="actionSetColor"/>
+   <addaction name="actionAutocolor"/>
+   <addaction name="actionInvert"/>
+   <addaction name="actionSplitQuads"/>
+   <addaction name="actionInline"/>
+   <addaction name="actionEditRaw"/>
+   <addaction name="actionBorders"/>
+   <addaction name="actionReplaceCoords"/>
+   <addaction name="actionRoundCoordinates"/>
+   <addaction name="actionVisibilityHide"/>
+   <addaction name="actionVisibilityToggle"/>
+   <addaction name="actionVisibilityReveal"/>
+  </widget>
+  <widget class="QToolBar" name="toolBarEditModes">
+   <property name="windowTitle">
+    <string>Editing modes</string>
+   </property>
+   <attribute name="toolBarArea">
+    <enum>LeftToolBarArea</enum>
+   </attribute>
+   <attribute name="toolBarBreak">
+    <bool>false</bool>
+   </attribute>
+   <addaction name="actionModeSelect"/>
+   <addaction name="actionModeMagicWand"/>
+   <addaction name="actionModeDraw"/>
+   <addaction name="actionModeRectangle"/>
+   <addaction name="actionModeCircle"/>
+   <addaction name="actionModeLinePath"/>
+  </widget>
+  <widget class="QToolBar" name="toolBarColors">
+   <property name="windowTitle">
+    <string>Colors</string>
+   </property>
+   <attribute name="toolBarArea">
+    <enum>RightToolBarArea</enum>
+   </attribute>
+   <attribute name="toolBarBreak">
+    <bool>false</bool>
+   </attribute>
+  </widget>
+  <widget class="QToolBar" name="toolBarExternalPrograms">
+   <property name="windowTitle">
+    <string>External Programs</string>
+   </property>
+   <attribute name="toolBarArea">
+    <enum>TopToolBarArea</enum>
+   </attribute>
+   <attribute name="toolBarBreak">
+    <bool>false</bool>
+   </attribute>
+   <addaction name="actionYtruder"/>
+   <addaction name="actionRectifier"/>
+   <addaction name="actionIntersector"/>
+   <addaction name="actionIsecalc"/>
+   <addaction name="actionCoverer"/>
+   <addaction name="actionEdger2"/>
+  </widget>
+  <action name="actionNew">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/brick.png</normaloff>:/icons/brick.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;New Part</string>
+   </property>
+   <property name="statusTip">
+    <string>Create a new part model.</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+N</string>
+   </property>
+  </action>
+  <action name="actionOpen">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/file-open.png</normaloff>:/icons/file-open.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Open</string>
+   </property>
+   <property name="statusTip">
+    <string>Load a part model from a file.</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+O</string>
+   </property>
+  </action>
+  <action name="actionSave">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/file-save.png</normaloff>:/icons/file-save.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Save</string>
+   </property>
+   <property name="statusTip">
+    <string>Save the part model.</string>
+   </property>
+   <property name="whatsThis">
+    <string/>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+S</string>
+   </property>
+  </action>
+  <action name="actionSaveAs">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/file-save-as.png</normaloff>:/icons/file-save-as.png</iconset>
+   </property>
+   <property name="text">
+    <string>Sa&amp;ve As..</string>
+   </property>
+   <property name="whatsThis">
+    <string>Save the part model to a specific file.</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+Shift+S</string>
+   </property>
+  </action>
+  <action name="actionInsertFrom">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/file-import.png</normaloff>:/icons/file-import.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Insert From..</string>
+   </property>
+  </action>
+  <action name="actionExportTo">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/file-export.png</normaloff>:/icons/file-export.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Export To..</string>
+   </property>
+  </action>
+  <action name="actionSettings">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/settings.png</normaloff>:/icons/settings.png</iconset>
+   </property>
+   <property name="text">
+    <string>Settin&amp;gs</string>
+   </property>
+   <property name="statusTip">
+    <string>Edit the settings of LDForge.</string>
+   </property>
+   <property name="whatsThis">
+    <string/>
+   </property>
+  </action>
+  <action name="actionSetLDrawPath">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/settings.png</normaloff>:/icons/settings.png</iconset>
+   </property>
+   <property name="text">
+    <string>Set &amp;LDraw Path</string>
+   </property>
+   <property name="statusTip">
+    <string>Change the LDraw directory path.</string>
+   </property>
+  </action>
+  <action name="actionScanPrimitives">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/radial.png</normaloff>:/icons/radial.png</iconset>
+   </property>
+   <property name="text">
+    <string>Scan &amp;Primitives</string>
+   </property>
+   <property name="statusTip">
+    <string>Scan the primitives folder for primitive info. Use this if you add new primitives.</string>
+   </property>
+  </action>
+  <action name="actionExit">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/exit.png</normaloff>:/icons/exit.png</iconset>
+   </property>
+   <property name="text">
+    <string>E&amp;xit</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+Q</string>
+   </property>
+  </action>
+  <action name="actionResetView">
+   <property name="text">
+    <string>&amp;Reset View</string>
+   </property>
+  </action>
+  <action name="actionAxes">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="checked">
+    <bool>true</bool>
+   </property>
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/axes.png</normaloff>:/icons/axes.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Draw Axes</string>
+   </property>
+  </action>
+  <action name="actionWireframe">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/wireframe.png</normaloff>:/icons/wireframe.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Wireframe</string>
+   </property>
+  </action>
+  <action name="actionBFCView">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/bfc-view.png</normaloff>:/icons/bfc-view.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;BFC Red/Green View</string>
+   </property>
+   <property name="shortcut">
+    <string>Shift+B</string>
+   </property>
+  </action>
+  <action name="actionSetOverlay">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/overlay.png</normaloff>:/icons/overlay.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Set Overlay Image</string>
+   </property>
+  </action>
+  <action name="actionClearOverlay">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/overlay-clear.png</normaloff>:/icons/overlay-clear.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Clear Overlay Image</string>
+   </property>
+  </action>
+  <action name="actionScreenshot">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/screencap.png</normaloff>:/icons/screencap.png</iconset>
+   </property>
+   <property name="text">
+    <string>Screens&amp;hot</string>
+   </property>
+  </action>
+  <action name="actionInsertRaw">
+   <property name="text">
+    <string>&amp;LDraw Code..</string>
+   </property>
+  </action>
+  <action name="actionNewLine">
+   <property name="icon">
+    <iconset resource="../ldforge.qrc">
+     <normaloff>:/icons/add-line.png</normaloff>:/icons/add-line.png</iconset>
+   </property>
+   <property name="text">
+    <string>N&amp;ew Line</string>
+   </property>
+  </action>
+  <action name="actionNewSubfile">
+   <property name="icon">
+    <iconset resource="../ldforge.qrc">
+     <normaloff>:/icons/add-subfile.png</normaloff>:/icons/add-subfile.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;New Subfile Reference</string>
+   </property>
+  </action>
+  <action name="actionNewTriangle">
+   <property name="icon">
+    <iconset resource="../ldforge.qrc">
+     <normaloff>:/icons/add-triangle.png</normaloff>:/icons/add-triangle.png</iconset>
+   </property>
+   <property name="text">
+    <string>Ne&amp;w Triangle</string>
+   </property>
+  </action>
+  <action name="actionNewQuad">
+   <property name="icon">
+    <iconset resource="../ldforge.qrc">
+     <normaloff>:/icons/add-quad.png</normaloff>:/icons/add-quad.png</iconset>
+   </property>
+   <property name="text">
+    <string>New &amp;Quadrilateral</string>
+   </property>
+  </action>
+  <action name="actionNewCLine">
+   <property name="icon">
+    <iconset resource="../ldforge.qrc">
+     <normaloff>:/icons/add-condline.png</normaloff>:/icons/add-condline.png</iconset>
+   </property>
+   <property name="text">
+    <string>New &amp;Conditional Line</string>
+   </property>
+  </action>
+  <action name="actionNewComment">
+   <property name="icon">
+    <iconset resource="../ldforge.qrc">
+     <normaloff>:/icons/add-comment.png</normaloff>:/icons/add-comment.png</iconset>
+   </property>
+   <property name="text">
+    <string>New C&amp;omment</string>
+   </property>
+  </action>
+  <action name="actionNewBFC">
+   <property name="icon">
+    <iconset resource="../ldforge.qrc">
+     <normaloff>:/icons/add-bfc.png</normaloff>:/icons/add-bfc.png</iconset>
+   </property>
+   <property name="text">
+    <string>New &amp;BFC Statement</string>
+   </property>
+  </action>
+  <action name="actionNewVertex">
+   <property name="icon">
+    <iconset resource="../ldforge.qrc">
+     <normaloff>:/icons/add-vertex.png</normaloff>:/icons/add-vertex.png</iconset>
+   </property>
+   <property name="text">
+    <string>New &amp;Vertex</string>
+   </property>
+  </action>
+  <action name="actionUndo">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/undo.png</normaloff>:/icons/undo.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Undo</string>
+   </property>
+   <property name="statusTip">
+    <string>Undo a step.</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+Z</string>
+   </property>
+  </action>
+  <action name="actionRedo">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/redo.png</normaloff>:/icons/redo.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Redo</string>
+   </property>
+   <property name="statusTip">
+    <string>Redo a step.</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+Shift+Z</string>
+   </property>
+  </action>
+  <action name="actionCut">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/cut.png</normaloff>:/icons/cut.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Cut</string>
+   </property>
+   <property name="statusTip">
+    <string>Cut the current selection to clipboard.</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+X</string>
+   </property>
+  </action>
+  <action name="actionCopy">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/copy.png</normaloff>:/icons/copy.png</iconset>
+   </property>
+   <property name="text">
+    <string>C&amp;opy</string>
+   </property>
+   <property name="statusTip">
+    <string>Copy the current selection to clipboard.</string>
+   </property>
+   <property name="whatsThis">
+    <string/>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+C</string>
+   </property>
+  </action>
+  <action name="actionPaste">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/paste.png</normaloff>:/icons/paste.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Paste</string>
+   </property>
+   <property name="statusTip">
+    <string>Paste clipboard contents.</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+V</string>
+   </property>
+  </action>
+  <action name="actionDelete">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/delete.png</normaloff>:/icons/delete.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Delete</string>
+   </property>
+   <property name="statusTip">
+    <string>Delete the selection</string>
+   </property>
+   <property name="shortcut">
+    <string>Del</string>
+   </property>
+  </action>
+  <action name="actionSelectAll">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/select-all.png</normaloff>:/icons/select-all.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Select All</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+A</string>
+   </property>
+  </action>
+  <action name="actionSelectByColor">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/select-color.png</normaloff>:/icons/select-color.png</iconset>
+   </property>
+   <property name="text">
+    <string>Select &amp;by Color</string>
+   </property>
+  </action>
+  <action name="actionSelectByType">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/select-type.png</normaloff>:/icons/select-type.png</iconset>
+   </property>
+   <property name="text">
+    <string>Select b&amp;y Type</string>
+   </property>
+  </action>
+  <action name="actionModeSelect">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="checked">
+    <bool>true</bool>
+   </property>
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/mode-select.png</normaloff>:/icons/mode-select.png</iconset>
+   </property>
+   <property name="text">
+    <string>Select Mode</string>
+   </property>
+   <property name="shortcut">
+    <string>S</string>
+   </property>
+  </action>
+  <action name="actionModeDraw">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/mode-draw.png</normaloff>:/icons/mode-draw.png</iconset>
+   </property>
+   <property name="text">
+    <string>Dra&amp;w Mode</string>
+   </property>
+   <property name="shortcut">
+    <string>D</string>
+   </property>
+  </action>
+  <action name="actionSetDrawDepth">
+   <property name="text">
+    <string>Set Draw Dept&amp;h</string>
+   </property>
+  </action>
+  <action name="actionSetColor">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/palette.png</normaloff>:/icons/palette.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Set Color</string>
+   </property>
+   <property name="statusTip">
+    <string>Set the color on given objects.</string>
+   </property>
+   <property name="shortcut">
+    <string>Shift+C</string>
+   </property>
+  </action>
+  <action name="actionAutocolor">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/autocolor.png</normaloff>:/icons/autocolor.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Auto-color</string>
+   </property>
+   <property name="statusTip">
+    <string>Set the color of the given object to the first found unused color.</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+Shift+C</string>
+   </property>
+  </action>
+  <action name="actionUncolor">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/uncolorize.png</normaloff>:/icons/uncolorize.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Uncolor</string>
+   </property>
+   <property name="toolTip">
+    <string>Uncolor</string>
+   </property>
+   <property name="statusTip">
+    <string>Reduce colors of everything selected to main and edge colors</string>
+   </property>
+  </action>
+  <action name="actionInline">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/inline.png</normaloff>:/icons/inline.png</iconset>
+   </property>
+   <property name="text">
+    <string>I&amp;nline</string>
+   </property>
+   <property name="statusTip">
+    <string>Inline selected subfiles.</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+I</string>
+   </property>
+  </action>
+  <action name="actionInlineDeep">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/inline-deep.png</normaloff>:/icons/inline-deep.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Deep Inline</string>
+   </property>
+   <property name="statusTip">
+    <string>Recursively inline selected subfiles down to polygons only.</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+Shift+I</string>
+   </property>
+  </action>
+  <action name="actionInvert">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/invert.png</normaloff>:/icons/invert.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Invert</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+Shift+W</string>
+   </property>
+  </action>
+  <action name="actionMakePrimitive">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/radial.png</normaloff>:/icons/radial.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Generate Primitive</string>
+   </property>
+  </action>
+  <action name="actionSplitQuads">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/quad-split.png</normaloff>:/icons/quad-split.png</iconset>
+   </property>
+   <property name="text">
+    <string>Split &amp;Quads</string>
+   </property>
+   <property name="statusTip">
+    <string>Split quads into triangles.</string>
+   </property>
+  </action>
+  <action name="actionEditRaw">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/set-contents.png</normaloff>:/icons/set-contents.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Edit LDraw Code</string>
+   </property>
+   <property name="statusTip">
+    <string>Edit the LDraw code of this object.</string>
+   </property>
+  </action>
+  <action name="actionBorders">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/make-borders.png</normaloff>:/icons/make-borders.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Make Borders</string>
+   </property>
+   <property name="statusTip">
+    <string>Add borders around given polygons.</string>
+   </property>
+  </action>
+  <action name="actionRoundCoordinates">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/round-coords.png</normaloff>:/icons/round-coords.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Round Coordinates</string>
+   </property>
+   <property name="statusTip">
+    <string>Round coordinates down to 3/4 decimals</string>
+   </property>
+  </action>
+  <action name="actionVisibilityToggle">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/visibility-toggle.png</normaloff>:/icons/visibility-toggle.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Toggle Visibility</string>
+   </property>
+   <property name="statusTip">
+    <string>Toggles visibility/hiding on objects.</string>
+   </property>
+  </action>
+  <action name="actionReplaceCoords">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/replace-coords.png</normaloff>:/icons/replace-coords.png</iconset>
+   </property>
+   <property name="text">
+    <string>Re&amp;place Coordinates</string>
+   </property>
+   <property name="statusTip">
+    <string>Find and replace coordinate values.</string>
+   </property>
+  </action>
+  <action name="actionFlip">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/flip.png</normaloff>:/icons/flip.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Flip</string>
+   </property>
+   <property name="statusTip">
+    <string>Flip coordinates.</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+Shift+F</string>
+   </property>
+  </action>
+  <action name="actionDemote">
+   <property name="text">
+    <string>Demote Conditional Lines</string>
+   </property>
+   <property name="statusTip">
+    <string>Demote conditional lines down to normal lines.</string>
+   </property>
+  </action>
+  <action name="actionYtruder">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/ytruder.png</normaloff>:/icons/ytruder.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Ytruder</string>
+   </property>
+   <property name="statusTip">
+    <string>Extrude selected lines to a given plane</string>
+   </property>
+  </action>
+  <action name="actionRectifier">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/rectifier.png</normaloff>:/icons/rectifier.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Rectifier</string>
+   </property>
+   <property name="statusTip">
+    <string>Optimizes quads into rect primitives.</string>
+   </property>
+  </action>
+  <action name="actionIntersector">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/intersector.png</normaloff>:/icons/intersector.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Intersector</string>
+   </property>
+   <property name="statusTip">
+    <string>Perform clipping between two input groups.</string>
+   </property>
+  </action>
+  <action name="actionIsecalc">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/isecalc.png</normaloff>:/icons/isecalc.png</iconset>
+   </property>
+   <property name="text">
+    <string>I&amp;secalc</string>
+   </property>
+   <property name="statusTip">
+    <string>Compute intersection edgelines between two input groups.</string>
+   </property>
+  </action>
+  <action name="actionCoverer">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/coverer.png</normaloff>:/icons/coverer.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Coverer</string>
+   </property>
+   <property name="statusTip">
+    <string>Fill the space between two line shapes</string>
+   </property>
+  </action>
+  <action name="actionEdger2">
+   <property name="text">
+    <string>&amp;Edger 2</string>
+   </property>
+  </action>
+  <action name="actionHelp">
+   <property name="enabled">
+    <bool>false</bool>
+   </property>
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/help.png</normaloff>:/icons/help.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Help</string>
+   </property>
+   <property name="shortcut">
+    <string>F1</string>
+   </property>
+  </action>
+  <action name="actionAbout">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/ldforge.png</normaloff>:/icons/ldforge.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;About LDForge</string>
+   </property>
+  </action>
+  <action name="actionAboutQt">
+   <property name="text">
+    <string>About &amp;Qt</string>
+   </property>
+  </action>
+  <action name="actionGridCoarse">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/grid-coarse.png</normaloff>:/icons/grid-coarse.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Coarse Grid</string>
+   </property>
+  </action>
+  <action name="actionGridMedium">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="checked">
+    <bool>true</bool>
+   </property>
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/grid-medium.png</normaloff>:/icons/grid-medium.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Medium Grid</string>
+   </property>
+  </action>
+  <action name="actionGridFine">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/grid-fine.png</normaloff>:/icons/grid-fine.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Fine Grid</string>
+   </property>
+  </action>
+  <action name="actionEdit">
+   <property name="text">
+    <string>&amp;Edit Selected Object</string>
+   </property>
+  </action>
+  <action name="actionMoveUp">
+   <property name="icon">
+    <iconset resource="../ldforge.qrc">
+     <normaloff>:/icons/arrow-up.png</normaloff>:/icons/arrow-up.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Move Up</string>
+   </property>
+   <property name="shortcut">
+    <string>PgUp</string>
+   </property>
+  </action>
+  <action name="actionMoveDown">
+   <property name="icon">
+    <iconset resource="../ldforge.qrc">
+     <normaloff>:/icons/arrow-down.png</normaloff>:/icons/arrow-down.png</iconset>
+   </property>
+   <property name="text">
+    <string>Move &amp;Down</string>
+   </property>
+   <property name="shortcut">
+    <string>PgDown</string>
+   </property>
+  </action>
+  <action name="actionMoveXNeg">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/move-x-neg.png</normaloff>:/icons/move-x-neg.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Move -X</string>
+   </property>
+   <property name="shortcut">
+    <string>Left</string>
+   </property>
+  </action>
+  <action name="actionMoveXPos">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/move-x-pos.png</normaloff>:/icons/move-x-pos.png</iconset>
+   </property>
+   <property name="text">
+    <string>Move +&amp;X</string>
+   </property>
+   <property name="shortcut">
+    <string>Right</string>
+   </property>
+  </action>
+  <action name="actionMoveYNeg">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/move-y-neg.png</normaloff>:/icons/move-y-neg.png</iconset>
+   </property>
+   <property name="text">
+    <string>Move -&amp;Y</string>
+   </property>
+   <property name="shortcut">
+    <string>Home</string>
+   </property>
+  </action>
+  <action name="actionMoveYPos">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/move-y-pos.png</normaloff>:/icons/move-y-pos.png</iconset>
+   </property>
+   <property name="text">
+    <string>M&amp;ove +Y</string>
+   </property>
+   <property name="shortcut">
+    <string>End</string>
+   </property>
+  </action>
+  <action name="actionMoveZNeg">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/move-z-neg.png</normaloff>:/icons/move-z-neg.png</iconset>
+   </property>
+   <property name="text">
+    <string>Move -&amp;Z</string>
+   </property>
+   <property name="shortcut">
+    <string>Down</string>
+   </property>
+  </action>
+  <action name="actionMoveZPos">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/move-z-pos.png</normaloff>:/icons/move-z-pos.png</iconset>
+   </property>
+   <property name="text">
+    <string>Mo&amp;ve +Z</string>
+   </property>
+   <property name="shortcut">
+    <string>Up</string>
+   </property>
+  </action>
+  <action name="actionRotateXNeg">
+   <property name="text">
+    <string>&amp;Rotate -X</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+Left</string>
+   </property>
+  </action>
+  <action name="actionRotateXPos">
+   <property name="text">
+    <string>Rotate +&amp;X</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+Right</string>
+   </property>
+  </action>
+  <action name="actionRotateYNeg">
+   <property name="text">
+    <string>Rotate -&amp;Y</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+End</string>
+   </property>
+  </action>
+  <action name="actionRotateYPos">
+   <property name="text">
+    <string>R&amp;otate +Y</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+Home</string>
+   </property>
+  </action>
+  <action name="actionRotateZNeg">
+   <property name="text">
+    <string>Rotate -&amp;Z</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+Down</string>
+   </property>
+  </action>
+  <action name="actionRotateZPos">
+   <property name="text">
+    <string>Rotat&amp;e +Z</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+Up</string>
+   </property>
+  </action>
+  <action name="actionRotationPoint">
+   <property name="text">
+    <string>&amp;Set Rotation Point</string>
+   </property>
+  </action>
+  <action name="actionSaveAll">
+   <property name="text">
+    <string>Save All</string>
+   </property>
+  </action>
+  <action name="actionClose">
+   <property name="text">
+    <string>&amp;Close</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+W</string>
+   </property>
+  </action>
+  <action name="actionCloseAll">
+   <property name="text">
+    <string>Close All</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+Shift+W</string>
+   </property>
+  </action>
+  <action name="actionNewFile">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/file-new.png</normaloff>:/icons/file-new.png</iconset>
+   </property>
+   <property name="text">
+    <string>New &amp;File</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+N</string>
+   </property>
+  </action>
+  <action name="actionDownloadFrom">
+   <property name="text">
+    <string>&amp;Download From...</string>
+   </property>
+  </action>
+  <action name="actionAddHistoryLine">
+   <property name="text">
+    <string>Add History Line</string>
+   </property>
+  </action>
+  <action name="actionJumpTo">
+   <property name="text">
+    <string>&amp;Go to Line...</string>
+   </property>
+   <property name="shortcut">
+    <string>Ctrl+G</string>
+   </property>
+  </action>
+  <action name="actionModeCircle">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/mode-circle.png</normaloff>:/icons/mode-circle.png</iconset>
+   </property>
+   <property name="text">
+    <string>C&amp;ircle Mode</string>
+   </property>
+   <property name="shortcut">
+    <string>C</string>
+   </property>
+  </action>
+  <action name="actionVisibilityHide">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/visibility-hide.png</normaloff>:/icons/visibility-hide.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Hide</string>
+   </property>
+   <property name="toolTip">
+    <string>Hides objects from view</string>
+   </property>
+  </action>
+  <action name="actionVisibilityReveal">
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/visibility-show.png</normaloff>:/icons/visibility-show.png</iconset>
+   </property>
+   <property name="text">
+    <string>Re&amp;veal</string>
+   </property>
+   <property name="toolTip">
+    <string>Reveals objects. Undoes hiding.</string>
+   </property>
+  </action>
+  <action name="actionSubfileSelection">
+   <property name="text">
+    <string>Subfile Selection</string>
+   </property>
+  </action>
+  <action name="actionDrawAngles">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/mode-angle.png</normaloff>:/icons/mode-angle.png</iconset>
+   </property>
+   <property name="text">
+    <string>Draw An&amp;gles</string>
+   </property>
+   <property name="toolTip">
+    <string>Draw angle information when drawing lines</string>
+   </property>
+  </action>
+  <action name="actionRandomColors">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/random-colors.png</normaloff>:/icons/random-colors.png</iconset>
+   </property>
+   <property name="text">
+    <string>Ra&amp;ndom colors</string>
+   </property>
+   <property name="shortcut">
+    <string>Shift+R</string>
+   </property>
+  </action>
+  <action name="actionOpenSubfiles">
+   <property name="text">
+    <string>&amp;Open Subfiles for Editing</string>
+   </property>
+   <property name="toolTip">
+    <string>Opens the documents used by the selected subparts for editing.</string>
+   </property>
+  </action>
+  <action name="actionSplitLines">
+   <property name="text">
+    <string>Split &amp;Lines...</string>
+   </property>
+  </action>
+  <action name="actionDrawSurfaces">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="text">
+    <string>Draw s&amp;urfaces</string>
+   </property>
+   <property name="toolTip">
+    <string>Render surfaces (i.e. quads and triangles) on the viewport.</string>
+   </property>
+  </action>
+  <action name="actionDrawEdgeLines">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="text">
+    <string>Draw &amp;edgelines</string>
+   </property>
+   <property name="toolTip">
+    <string>Render edgelines on the viewport</string>
+   </property>
+  </action>
+  <action name="actionDrawConditionalLines">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="text">
+    <string>Draw conditional &amp;lines</string>
+   </property>
+   <property name="toolTip">
+    <string>Render conditional lines on the viewport.</string>
+   </property>
+  </action>
+  <action name="actionModeMagicWand">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/mode-magicwand.png</normaloff>:/icons/mode-magicwand.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Magic wand</string>
+   </property>
+   <property name="shortcut">
+    <string>W</string>
+   </property>
+  </action>
+  <action name="actionModeRectangle">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/mode-rectangle.png</normaloff>:/icons/mode-rectangle.png</iconset>
+   </property>
+   <property name="text">
+    <string>Recta&amp;ngle Mode</string>
+   </property>
+   <property name="shortcut">
+    <string>R</string>
+   </property>
+  </action>
+  <action name="actionModeLinePath">
+   <property name="checkable">
+    <bool>true</bool>
+   </property>
+   <property name="icon">
+    <iconset>
+     <normaloff>:/icons/line.png</normaloff>:/icons/line.png</iconset>
+   </property>
+   <property name="text">
+    <string>&amp;Line Path Mode</string>
+   </property>
+   <property name="shortcut">
+    <string>P</string>
+   </property>
+  </action>
+ </widget>
+ <resources>
+  <include location="../ldforge.qrc"/>
+ </resources>
+ <connections/>
+</ui>
--- a/src/messageLog.cpp	Sun Aug 30 04:45:16 2015 +0300
+++ b/src/messageLog.cpp	Sun Aug 30 04:53:37 2015 +0300
@@ -20,7 +20,7 @@
 #include <QDate>
 #include "messageLog.h"
 #include "glRenderer.h"
-#include "mainWindow.h"
+#include "mainwindow.h"
 
 enum
 {
--- a/src/miscallenous.cpp	Sun Aug 30 04:45:16 2015 +0300
+++ b/src/miscallenous.cpp	Sun Aug 30 04:53:37 2015 +0300
@@ -21,7 +21,7 @@
 #include <QColor>
 #include "main.h"
 #include "miscallenous.h"
-#include "mainWindow.h"
+#include "mainwindow.h"
 #include "dialogs.h"
 #include "ldDocument.h"
 #include "ui_rotpoint.h"
--- a/src/partDownloader.cpp	Sun Aug 30 04:45:16 2015 +0300
+++ b/src/partDownloader.cpp	Sun Aug 30 04:53:37 2015 +0300
@@ -27,7 +27,7 @@
 #include "partDownloader.h"
 #include "ui_downloadfrom.h"
 #include "basics.h"
-#include "mainWindow.h"
+#include "mainwindow.h"
 #include "ldDocument.h"
 #include "glRenderer.h"
 
--- a/src/primitives.cpp	Sun Aug 30 04:45:16 2015 +0300
+++ b/src/primitives.cpp	Sun Aug 30 04:53:37 2015 +0300
@@ -20,7 +20,7 @@
 #include <QRegExp>
 #include <QFileDialog>
 #include "ldDocument.h"
-#include "mainWindow.h"
+#include "mainwindow.h"
 #include "primitives.h"
 #include "ui_makeprim.h"
 #include "miscallenous.h"
--- a/ui/ldforge.ui	Sun Aug 30 04:45:16 2015 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1713 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>LDForgeUI</class>
- <widget class="QMainWindow" name="LDForgeUI">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>1010</width>
-    <height>641</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string/>
-  </property>
-  <property name="windowIcon">
-   <iconset>
-    <normaloff>:/icons/ldforge.png</normaloff>:/icons/ldforge.png</iconset>
-  </property>
-  <widget class="QWidget" name="centralwidget">
-   <layout class="QVBoxLayout" name="verticalLayout">
-    <item>
-     <layout class="QHBoxLayout" name="horizontalLayout" stretch="3,1">
-      <item>
-       <widget class="QFrame" name="rendererFrame">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="frameShape">
-         <enum>QFrame::StyledPanel</enum>
-        </property>
-        <property name="frameShadow">
-         <enum>QFrame::Raised</enum>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QToolBox" name="toolBox">
-        <property name="currentIndex">
-         <number>0</number>
-        </property>
-        <widget class="QWidget" name="pageDocument">
-         <property name="geometry">
-          <rect>
-           <x>0</x>
-           <y>0</y>
-           <width>234</width>
-           <height>402</height>
-          </rect>
-         </property>
-         <attribute name="label">
-          <string>Document</string>
-         </attribute>
-         <layout class="QVBoxLayout" name="verticalLayout_2">
-          <item>
-           <widget class="QListWidget" name="objectList">
-            <property name="sizePolicy">
-             <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
-              <horstretch>0</horstretch>
-              <verstretch>0</verstretch>
-             </sizepolicy>
-            </property>
-            <property name="selectionMode">
-             <enum>QAbstractItemView::ExtendedSelection</enum>
-            </property>
-           </widget>
-          </item>
-         </layout>
-        </widget>
-        <widget class="QWidget" name="pageEditModeOptions">
-         <property name="geometry">
-          <rect>
-           <x>0</x>
-           <y>0</y>
-           <width>234</width>
-           <height>402</height>
-          </rect>
-         </property>
-         <attribute name="label">
-          <string>Tool Options</string>
-         </attribute>
-         <layout class="QVBoxLayout" name="verticalLayout_4">
-          <item>
-           <widget class="QGroupBox" name="groupBox">
-            <property name="title">
-             <string>Circle Tool Options</string>
-            </property>
-            <layout class="QVBoxLayout" name="verticalLayout_5">
-             <item>
-              <layout class="QFormLayout" name="formLayout">
-               <item row="0" column="1">
-                <widget class="QCheckBox" name="ringToolHiRes">
-                 <property name="text">
-                  <string>High resolution</string>
-                 </property>
-                </widget>
-               </item>
-               <item row="1" column="0">
-                <widget class="QLabel" name="label">
-                 <property name="text">
-                  <string>Segments:</string>
-                 </property>
-                </widget>
-               </item>
-               <item row="1" column="1">
-                <layout class="QHBoxLayout" name="horizontalLayout_2">
-                 <item>
-                  <widget class="QSpinBox" name="ringToolSegments">
-                   <property name="enabled">
-                    <bool>true</bool>
-                   </property>
-                   <property name="minimum">
-                    <number>1</number>
-                   </property>
-                   <property name="maximum">
-                    <number>16</number>
-                   </property>
-                   <property name="value">
-                    <number>16</number>
-                   </property>
-                  </widget>
-                 </item>
-                 <item>
-                  <widget class="QLabel" name="ringToolSegmentsLabel">
-                   <property name="text">
-                    <string>a / b</string>
-                   </property>
-                  </widget>
-                 </item>
-                </layout>
-               </item>
-              </layout>
-             </item>
-            </layout>
-           </widget>
-          </item>
-          <item>
-           <spacer name="verticalSpacer">
-            <property name="orientation">
-             <enum>Qt::Vertical</enum>
-            </property>
-            <property name="sizeHint" stdset="0">
-             <size>
-              <width>20</width>
-              <height>40</height>
-             </size>
-            </property>
-           </spacer>
-          </item>
-         </layout>
-        </widget>
-        <widget class="QWidget" name="pagePrimitives">
-         <property name="geometry">
-          <rect>
-           <x>0</x>
-           <y>0</y>
-           <width>234</width>
-           <height>402</height>
-          </rect>
-         </property>
-         <attribute name="label">
-          <string>Primitives</string>
-         </attribute>
-         <layout class="QVBoxLayout" name="verticalLayout_3">
-          <item>
-           <widget class="QTreeWidget" name="primitives">
-            <property name="dragDropMode">
-             <enum>QAbstractItemView::DragOnly</enum>
-            </property>
-            <attribute name="headerVisible">
-             <bool>false</bool>
-            </attribute>
-            <column>
-             <property name="text">
-              <string notr="true">1</string>
-             </property>
-            </column>
-           </widget>
-          </item>
-         </layout>
-        </widget>
-       </widget>
-      </item>
-     </layout>
-    </item>
-   </layout>
-  </widget>
-  <widget class="QMenuBar" name="menubar">
-   <property name="geometry">
-    <rect>
-     <x>0</x>
-     <y>0</y>
-     <width>1010</width>
-     <height>30</height>
-    </rect>
-   </property>
-   <widget class="QMenu" name="menuFile">
-    <property name="title">
-     <string>Fi&amp;le</string>
-    </property>
-    <widget class="QMenu" name="menuOpenRecent">
-     <property name="title">
-      <string>Open &amp;Recent...</string>
-     </property>
-     <property name="icon">
-      <iconset>
-       <normaloff>:/icons/open-recent.png</normaloff>:/icons/open-recent.png</iconset>
-     </property>
-    </widget>
-    <addaction name="actionNew"/>
-    <addaction name="actionNewFile"/>
-    <addaction name="actionOpen"/>
-    <addaction name="menuOpenRecent"/>
-    <addaction name="actionSave"/>
-    <addaction name="actionSaveAs"/>
-    <addaction name="actionSaveAll"/>
-    <addaction name="separator"/>
-    <addaction name="actionDownloadFrom"/>
-    <addaction name="separator"/>
-    <addaction name="actionClose"/>
-    <addaction name="actionCloseAll"/>
-    <addaction name="separator"/>
-    <addaction name="actionInsertFrom"/>
-    <addaction name="actionExportTo"/>
-    <addaction name="separator"/>
-    <addaction name="actionSettings"/>
-    <addaction name="actionSetLDrawPath"/>
-    <addaction name="actionScanPrimitives"/>
-    <addaction name="separator"/>
-    <addaction name="actionExit"/>
-   </widget>
-   <widget class="QMenu" name="menuView">
-    <property name="title">
-     <string>&amp;View</string>
-    </property>
-    <addaction name="actionResetView"/>
-    <addaction name="actionAxes"/>
-    <addaction name="actionWireframe"/>
-    <addaction name="actionBFCView"/>
-    <addaction name="actionDrawAngles"/>
-    <addaction name="actionRandomColors"/>
-    <addaction name="separator"/>
-    <addaction name="actionDrawSurfaces"/>
-    <addaction name="actionDrawEdgeLines"/>
-    <addaction name="actionDrawConditionalLines"/>
-    <addaction name="separator"/>
-    <addaction name="actionSetOverlay"/>
-    <addaction name="actionClearOverlay"/>
-    <addaction name="separator"/>
-    <addaction name="actionScreenshot"/>
-   </widget>
-   <widget class="QMenu" name="menuInsert">
-    <property name="title">
-     <string>I&amp;nsert</string>
-    </property>
-    <addaction name="actionInsertRaw"/>
-    <addaction name="separator"/>
-    <addaction name="actionNewSubfile"/>
-    <addaction name="actionNewLine"/>
-    <addaction name="actionNewTriangle"/>
-    <addaction name="actionNewQuad"/>
-    <addaction name="actionNewCLine"/>
-    <addaction name="actionNewComment"/>
-    <addaction name="actionNewBFC"/>
-    <addaction name="actionNewVertex"/>
-   </widget>
-   <widget class="QMenu" name="menuEdit">
-    <property name="title">
-     <string>Edit</string>
-    </property>
-    <addaction name="actionUndo"/>
-    <addaction name="actionRedo"/>
-    <addaction name="separator"/>
-    <addaction name="actionEdit"/>
-    <addaction name="separator"/>
-    <addaction name="actionCut"/>
-    <addaction name="actionCopy"/>
-    <addaction name="actionPaste"/>
-    <addaction name="actionDelete"/>
-    <addaction name="separator"/>
-    <addaction name="actionSelectAll"/>
-    <addaction name="actionSelectByColor"/>
-    <addaction name="actionSelectByType"/>
-    <addaction name="separator"/>
-    <addaction name="actionModeSelect"/>
-    <addaction name="actionModeMagicWand"/>
-    <addaction name="actionModeDraw"/>
-    <addaction name="actionModeRectangle"/>
-    <addaction name="actionModeCircle"/>
-    <addaction name="actionModeLinePath"/>
-    <addaction name="separator"/>
-    <addaction name="actionSetDrawDepth"/>
-    <addaction name="separator"/>
-    <addaction name="actionJumpTo"/>
-   </widget>
-   <widget class="QMenu" name="menuTools">
-    <property name="title">
-     <string>Tools</string>
-    </property>
-    <addaction name="actionSetColor"/>
-    <addaction name="actionAutocolor"/>
-    <addaction name="actionUncolor"/>
-    <addaction name="separator"/>
-    <addaction name="actionInvert"/>
-    <addaction name="actionInline"/>
-    <addaction name="actionInlineDeep"/>
-    <addaction name="actionMakePrimitive"/>
-    <addaction name="separator"/>
-    <addaction name="actionAddHistoryLine"/>
-    <addaction name="separator"/>
-    <addaction name="actionSplitQuads"/>
-    <addaction name="actionEditRaw"/>
-    <addaction name="actionBorders"/>
-    <addaction name="actionRoundCoordinates"/>
-    <addaction name="actionReplaceCoords"/>
-    <addaction name="actionFlip"/>
-    <addaction name="actionDemote"/>
-    <addaction name="actionOpenSubfiles"/>
-    <addaction name="actionSplitLines"/>
-    <addaction name="separator"/>
-    <addaction name="actionVisibilityHide"/>
-    <addaction name="actionVisibilityToggle"/>
-    <addaction name="actionVisibilityReveal"/>
-   </widget>
-   <widget class="QMenu" name="menuExternal_Tools">
-    <property name="title">
-     <string>E&amp;xternal Tools</string>
-    </property>
-    <addaction name="actionYtruder"/>
-    <addaction name="actionRectifier"/>
-    <addaction name="actionIntersector"/>
-    <addaction name="actionIsecalc"/>
-    <addaction name="actionCoverer"/>
-    <addaction name="actionEdger2"/>
-   </widget>
-   <widget class="QMenu" name="menuHelp">
-    <property name="title">
-     <string>Help</string>
-    </property>
-    <addaction name="actionHelp"/>
-    <addaction name="separator"/>
-    <addaction name="actionAbout"/>
-    <addaction name="actionAboutQt"/>
-   </widget>
-   <widget class="QMenu" name="menuMov">
-    <property name="title">
-     <string>&amp;Move</string>
-    </property>
-    <widget class="QMenu" name="menuGrids">
-     <property name="title">
-      <string>&amp;Grids</string>
-     </property>
-     <addaction name="actionGridCoarse"/>
-     <addaction name="actionGridMedium"/>
-     <addaction name="actionGridFine"/>
-    </widget>
-    <widget class="QMenu" name="menuMove_Objects">
-     <property name="title">
-      <string>&amp;Move Objects</string>
-     </property>
-     <addaction name="actionMoveXNeg"/>
-     <addaction name="actionMoveXPos"/>
-     <addaction name="actionMoveYNeg"/>
-     <addaction name="actionMoveYPos"/>
-     <addaction name="actionMoveZNeg"/>
-     <addaction name="actionMoveZPos"/>
-    </widget>
-    <widget class="QMenu" name="menuObject_List">
-     <property name="title">
-      <string>&amp;Object List</string>
-     </property>
-     <addaction name="actionMoveUp"/>
-     <addaction name="actionMoveDown"/>
-    </widget>
-    <widget class="QMenu" name="menuRotate">
-     <property name="title">
-      <string>&amp;Rotate</string>
-     </property>
-     <addaction name="actionRotateXNeg"/>
-     <addaction name="actionRotateXPos"/>
-     <addaction name="actionRotateYNeg"/>
-     <addaction name="actionRotateYPos"/>
-     <addaction name="actionRotateZNeg"/>
-     <addaction name="actionRotateZPos"/>
-    </widget>
-    <addaction name="menuGrids"/>
-    <addaction name="menuMove_Objects"/>
-    <addaction name="menuRotate"/>
-    <addaction name="menuObject_List"/>
-    <addaction name="separator"/>
-    <addaction name="actionRotationPoint"/>
-   </widget>
-   <addaction name="menuFile"/>
-   <addaction name="menuView"/>
-   <addaction name="menuInsert"/>
-   <addaction name="menuEdit"/>
-   <addaction name="menuMov"/>
-   <addaction name="menuTools"/>
-   <addaction name="menuExternal_Tools"/>
-   <addaction name="menuHelp"/>
-  </widget>
-  <widget class="QStatusBar" name="statusbar"/>
-  <widget class="QToolBar" name="toolBarFile">
-   <property name="windowTitle">
-    <string>File</string>
-   </property>
-   <attribute name="toolBarArea">
-    <enum>TopToolBarArea</enum>
-   </attribute>
-   <attribute name="toolBarBreak">
-    <bool>false</bool>
-   </attribute>
-   <addaction name="actionNew"/>
-   <addaction name="actionNewFile"/>
-   <addaction name="actionOpen"/>
-   <addaction name="actionSave"/>
-   <addaction name="actionSaveAs"/>
-  </widget>
-  <widget class="QToolBar" name="toolBarNewObject">
-   <property name="windowTitle">
-    <string>New Object</string>
-   </property>
-   <attribute name="toolBarArea">
-    <enum>TopToolBarArea</enum>
-   </attribute>
-   <attribute name="toolBarBreak">
-    <bool>false</bool>
-   </attribute>
-   <addaction name="actionNewSubfile"/>
-   <addaction name="actionNewLine"/>
-   <addaction name="actionNewTriangle"/>
-   <addaction name="actionNewQuad"/>
-   <addaction name="actionNewCLine"/>
-   <addaction name="actionNewComment"/>
-   <addaction name="actionNewBFC"/>
-   <addaction name="actionNewVertex"/>
-  </widget>
-  <widget class="QToolBar" name="toolBarBasicTools">
-   <property name="windowTitle">
-    <string>Basic tools</string>
-   </property>
-   <attribute name="toolBarArea">
-    <enum>TopToolBarArea</enum>
-   </attribute>
-   <attribute name="toolBarBreak">
-    <bool>false</bool>
-   </attribute>
-   <addaction name="actionUndo"/>
-   <addaction name="actionRedo"/>
-   <addaction name="actionCut"/>
-   <addaction name="actionCopy"/>
-   <addaction name="actionPaste"/>
-   <addaction name="actionDelete"/>
-  </widget>
-  <widget class="QToolBar" name="toolBarSelect">
-   <property name="windowTitle">
-    <string>Select</string>
-   </property>
-   <attribute name="toolBarArea">
-    <enum>TopToolBarArea</enum>
-   </attribute>
-   <attribute name="toolBarBreak">
-    <bool>false</bool>
-   </attribute>
-   <addaction name="actionSelectAll"/>
-   <addaction name="actionSelectByColor"/>
-   <addaction name="actionSelectByType"/>
-  </widget>
-  <widget class="QToolBar" name="toolBarGrid">
-   <property name="windowTitle">
-    <string>Grid</string>
-   </property>
-   <attribute name="toolBarArea">
-    <enum>TopToolBarArea</enum>
-   </attribute>
-   <attribute name="toolBarBreak">
-    <bool>false</bool>
-   </attribute>
-   <addaction name="actionGridCoarse"/>
-   <addaction name="actionGridMedium"/>
-   <addaction name="actionGridFine"/>
-  </widget>
-  <widget class="QToolBar" name="toolBarDisplay">
-   <property name="windowTitle">
-    <string>Display options</string>
-   </property>
-   <attribute name="toolBarArea">
-    <enum>TopToolBarArea</enum>
-   </attribute>
-   <attribute name="toolBarBreak">
-    <bool>true</bool>
-   </attribute>
-   <addaction name="actionAxes"/>
-   <addaction name="actionWireframe"/>
-   <addaction name="actionBFCView"/>
-   <addaction name="actionRandomColors"/>
-   <addaction name="actionDrawAngles"/>
-  </widget>
-  <widget class="QToolBar" name="toolBarEditTools">
-   <property name="windowTitle">
-    <string>Editing tools</string>
-   </property>
-   <attribute name="toolBarArea">
-    <enum>TopToolBarArea</enum>
-   </attribute>
-   <attribute name="toolBarBreak">
-    <bool>false</bool>
-   </attribute>
-   <addaction name="actionSetColor"/>
-   <addaction name="actionAutocolor"/>
-   <addaction name="actionInvert"/>
-   <addaction name="actionSplitQuads"/>
-   <addaction name="actionInline"/>
-   <addaction name="actionEditRaw"/>
-   <addaction name="actionBorders"/>
-   <addaction name="actionReplaceCoords"/>
-   <addaction name="actionRoundCoordinates"/>
-   <addaction name="actionVisibilityHide"/>
-   <addaction name="actionVisibilityToggle"/>
-   <addaction name="actionVisibilityReveal"/>
-  </widget>
-  <widget class="QToolBar" name="toolBarEditModes">
-   <property name="windowTitle">
-    <string>Editing modes</string>
-   </property>
-   <attribute name="toolBarArea">
-    <enum>LeftToolBarArea</enum>
-   </attribute>
-   <attribute name="toolBarBreak">
-    <bool>false</bool>
-   </attribute>
-   <addaction name="actionModeSelect"/>
-   <addaction name="actionModeMagicWand"/>
-   <addaction name="actionModeDraw"/>
-   <addaction name="actionModeRectangle"/>
-   <addaction name="actionModeCircle"/>
-   <addaction name="actionModeLinePath"/>
-  </widget>
-  <widget class="QToolBar" name="toolBarColors">
-   <property name="windowTitle">
-    <string>Colors</string>
-   </property>
-   <attribute name="toolBarArea">
-    <enum>RightToolBarArea</enum>
-   </attribute>
-   <attribute name="toolBarBreak">
-    <bool>false</bool>
-   </attribute>
-  </widget>
-  <widget class="QToolBar" name="toolBarExternalPrograms">
-   <property name="windowTitle">
-    <string>External Programs</string>
-   </property>
-   <attribute name="toolBarArea">
-    <enum>TopToolBarArea</enum>
-   </attribute>
-   <attribute name="toolBarBreak">
-    <bool>false</bool>
-   </attribute>
-   <addaction name="actionYtruder"/>
-   <addaction name="actionRectifier"/>
-   <addaction name="actionIntersector"/>
-   <addaction name="actionIsecalc"/>
-   <addaction name="actionCoverer"/>
-   <addaction name="actionEdger2"/>
-  </widget>
-  <action name="actionNew">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/brick.png</normaloff>:/icons/brick.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;New Part</string>
-   </property>
-   <property name="statusTip">
-    <string>Create a new part model.</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+N</string>
-   </property>
-  </action>
-  <action name="actionOpen">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/file-open.png</normaloff>:/icons/file-open.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Open</string>
-   </property>
-   <property name="statusTip">
-    <string>Load a part model from a file.</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+O</string>
-   </property>
-  </action>
-  <action name="actionSave">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/file-save.png</normaloff>:/icons/file-save.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Save</string>
-   </property>
-   <property name="statusTip">
-    <string>Save the part model.</string>
-   </property>
-   <property name="whatsThis">
-    <string/>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+S</string>
-   </property>
-  </action>
-  <action name="actionSaveAs">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/file-save-as.png</normaloff>:/icons/file-save-as.png</iconset>
-   </property>
-   <property name="text">
-    <string>Sa&amp;ve As..</string>
-   </property>
-   <property name="whatsThis">
-    <string>Save the part model to a specific file.</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+Shift+S</string>
-   </property>
-  </action>
-  <action name="actionInsertFrom">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/file-import.png</normaloff>:/icons/file-import.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Insert From..</string>
-   </property>
-  </action>
-  <action name="actionExportTo">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/file-export.png</normaloff>:/icons/file-export.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Export To..</string>
-   </property>
-  </action>
-  <action name="actionSettings">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/settings.png</normaloff>:/icons/settings.png</iconset>
-   </property>
-   <property name="text">
-    <string>Settin&amp;gs</string>
-   </property>
-   <property name="statusTip">
-    <string>Edit the settings of LDForge.</string>
-   </property>
-   <property name="whatsThis">
-    <string/>
-   </property>
-  </action>
-  <action name="actionSetLDrawPath">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/settings.png</normaloff>:/icons/settings.png</iconset>
-   </property>
-   <property name="text">
-    <string>Set &amp;LDraw Path</string>
-   </property>
-   <property name="statusTip">
-    <string>Change the LDraw directory path.</string>
-   </property>
-  </action>
-  <action name="actionScanPrimitives">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/radial.png</normaloff>:/icons/radial.png</iconset>
-   </property>
-   <property name="text">
-    <string>Scan &amp;Primitives</string>
-   </property>
-   <property name="statusTip">
-    <string>Scan the primitives folder for primitive info. Use this if you add new primitives.</string>
-   </property>
-  </action>
-  <action name="actionExit">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/exit.png</normaloff>:/icons/exit.png</iconset>
-   </property>
-   <property name="text">
-    <string>E&amp;xit</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+Q</string>
-   </property>
-  </action>
-  <action name="actionResetView">
-   <property name="text">
-    <string>&amp;Reset View</string>
-   </property>
-  </action>
-  <action name="actionAxes">
-   <property name="checkable">
-    <bool>true</bool>
-   </property>
-   <property name="checked">
-    <bool>true</bool>
-   </property>
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/axes.png</normaloff>:/icons/axes.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Draw Axes</string>
-   </property>
-  </action>
-  <action name="actionWireframe">
-   <property name="checkable">
-    <bool>true</bool>
-   </property>
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/wireframe.png</normaloff>:/icons/wireframe.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Wireframe</string>
-   </property>
-  </action>
-  <action name="actionBFCView">
-   <property name="checkable">
-    <bool>true</bool>
-   </property>
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/bfc-view.png</normaloff>:/icons/bfc-view.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;BFC Red/Green View</string>
-   </property>
-   <property name="shortcut">
-    <string>Shift+B</string>
-   </property>
-  </action>
-  <action name="actionSetOverlay">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/overlay.png</normaloff>:/icons/overlay.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Set Overlay Image</string>
-   </property>
-  </action>
-  <action name="actionClearOverlay">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/overlay-clear.png</normaloff>:/icons/overlay-clear.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Clear Overlay Image</string>
-   </property>
-  </action>
-  <action name="actionScreenshot">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/screencap.png</normaloff>:/icons/screencap.png</iconset>
-   </property>
-   <property name="text">
-    <string>Screens&amp;hot</string>
-   </property>
-  </action>
-  <action name="actionInsertRaw">
-   <property name="text">
-    <string>&amp;LDraw Code..</string>
-   </property>
-  </action>
-  <action name="actionNewLine">
-   <property name="icon">
-    <iconset resource="../ldforge.qrc">
-     <normaloff>:/icons/add-line.png</normaloff>:/icons/add-line.png</iconset>
-   </property>
-   <property name="text">
-    <string>N&amp;ew Line</string>
-   </property>
-  </action>
-  <action name="actionNewSubfile">
-   <property name="icon">
-    <iconset resource="../ldforge.qrc">
-     <normaloff>:/icons/add-subfile.png</normaloff>:/icons/add-subfile.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;New Subfile Reference</string>
-   </property>
-  </action>
-  <action name="actionNewTriangle">
-   <property name="icon">
-    <iconset resource="../ldforge.qrc">
-     <normaloff>:/icons/add-triangle.png</normaloff>:/icons/add-triangle.png</iconset>
-   </property>
-   <property name="text">
-    <string>Ne&amp;w Triangle</string>
-   </property>
-  </action>
-  <action name="actionNewQuad">
-   <property name="icon">
-    <iconset resource="../ldforge.qrc">
-     <normaloff>:/icons/add-quad.png</normaloff>:/icons/add-quad.png</iconset>
-   </property>
-   <property name="text">
-    <string>New &amp;Quadrilateral</string>
-   </property>
-  </action>
-  <action name="actionNewCLine">
-   <property name="icon">
-    <iconset resource="../ldforge.qrc">
-     <normaloff>:/icons/add-condline.png</normaloff>:/icons/add-condline.png</iconset>
-   </property>
-   <property name="text">
-    <string>New &amp;Conditional Line</string>
-   </property>
-  </action>
-  <action name="actionNewComment">
-   <property name="icon">
-    <iconset resource="../ldforge.qrc">
-     <normaloff>:/icons/add-comment.png</normaloff>:/icons/add-comment.png</iconset>
-   </property>
-   <property name="text">
-    <string>New C&amp;omment</string>
-   </property>
-  </action>
-  <action name="actionNewBFC">
-   <property name="icon">
-    <iconset resource="../ldforge.qrc">
-     <normaloff>:/icons/add-bfc.png</normaloff>:/icons/add-bfc.png</iconset>
-   </property>
-   <property name="text">
-    <string>New &amp;BFC Statement</string>
-   </property>
-  </action>
-  <action name="actionNewVertex">
-   <property name="icon">
-    <iconset resource="../ldforge.qrc">
-     <normaloff>:/icons/add-vertex.png</normaloff>:/icons/add-vertex.png</iconset>
-   </property>
-   <property name="text">
-    <string>New &amp;Vertex</string>
-   </property>
-  </action>
-  <action name="actionUndo">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/undo.png</normaloff>:/icons/undo.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Undo</string>
-   </property>
-   <property name="statusTip">
-    <string>Undo a step.</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+Z</string>
-   </property>
-  </action>
-  <action name="actionRedo">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/redo.png</normaloff>:/icons/redo.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Redo</string>
-   </property>
-   <property name="statusTip">
-    <string>Redo a step.</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+Shift+Z</string>
-   </property>
-  </action>
-  <action name="actionCut">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/cut.png</normaloff>:/icons/cut.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Cut</string>
-   </property>
-   <property name="statusTip">
-    <string>Cut the current selection to clipboard.</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+X</string>
-   </property>
-  </action>
-  <action name="actionCopy">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/copy.png</normaloff>:/icons/copy.png</iconset>
-   </property>
-   <property name="text">
-    <string>C&amp;opy</string>
-   </property>
-   <property name="statusTip">
-    <string>Copy the current selection to clipboard.</string>
-   </property>
-   <property name="whatsThis">
-    <string/>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+C</string>
-   </property>
-  </action>
-  <action name="actionPaste">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/paste.png</normaloff>:/icons/paste.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Paste</string>
-   </property>
-   <property name="statusTip">
-    <string>Paste clipboard contents.</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+V</string>
-   </property>
-  </action>
-  <action name="actionDelete">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/delete.png</normaloff>:/icons/delete.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Delete</string>
-   </property>
-   <property name="statusTip">
-    <string>Delete the selection</string>
-   </property>
-   <property name="shortcut">
-    <string>Del</string>
-   </property>
-  </action>
-  <action name="actionSelectAll">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/select-all.png</normaloff>:/icons/select-all.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Select All</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+A</string>
-   </property>
-  </action>
-  <action name="actionSelectByColor">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/select-color.png</normaloff>:/icons/select-color.png</iconset>
-   </property>
-   <property name="text">
-    <string>Select &amp;by Color</string>
-   </property>
-  </action>
-  <action name="actionSelectByType">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/select-type.png</normaloff>:/icons/select-type.png</iconset>
-   </property>
-   <property name="text">
-    <string>Select b&amp;y Type</string>
-   </property>
-  </action>
-  <action name="actionModeSelect">
-   <property name="checkable">
-    <bool>true</bool>
-   </property>
-   <property name="checked">
-    <bool>true</bool>
-   </property>
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/mode-select.png</normaloff>:/icons/mode-select.png</iconset>
-   </property>
-   <property name="text">
-    <string>Select Mode</string>
-   </property>
-   <property name="shortcut">
-    <string>S</string>
-   </property>
-  </action>
-  <action name="actionModeDraw">
-   <property name="checkable">
-    <bool>true</bool>
-   </property>
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/mode-draw.png</normaloff>:/icons/mode-draw.png</iconset>
-   </property>
-   <property name="text">
-    <string>Dra&amp;w Mode</string>
-   </property>
-   <property name="shortcut">
-    <string>D</string>
-   </property>
-  </action>
-  <action name="actionSetDrawDepth">
-   <property name="text">
-    <string>Set Draw Dept&amp;h</string>
-   </property>
-  </action>
-  <action name="actionSetColor">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/palette.png</normaloff>:/icons/palette.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Set Color</string>
-   </property>
-   <property name="statusTip">
-    <string>Set the color on given objects.</string>
-   </property>
-   <property name="shortcut">
-    <string>Shift+C</string>
-   </property>
-  </action>
-  <action name="actionAutocolor">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/autocolor.png</normaloff>:/icons/autocolor.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Auto-color</string>
-   </property>
-   <property name="statusTip">
-    <string>Set the color of the given object to the first found unused color.</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+Shift+C</string>
-   </property>
-  </action>
-  <action name="actionUncolor">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/uncolorize.png</normaloff>:/icons/uncolorize.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Uncolor</string>
-   </property>
-   <property name="toolTip">
-    <string>Uncolor</string>
-   </property>
-   <property name="statusTip">
-    <string>Reduce colors of everything selected to main and edge colors</string>
-   </property>
-  </action>
-  <action name="actionInline">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/inline.png</normaloff>:/icons/inline.png</iconset>
-   </property>
-   <property name="text">
-    <string>I&amp;nline</string>
-   </property>
-   <property name="statusTip">
-    <string>Inline selected subfiles.</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+I</string>
-   </property>
-  </action>
-  <action name="actionInlineDeep">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/inline-deep.png</normaloff>:/icons/inline-deep.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Deep Inline</string>
-   </property>
-   <property name="statusTip">
-    <string>Recursively inline selected subfiles down to polygons only.</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+Shift+I</string>
-   </property>
-  </action>
-  <action name="actionInvert">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/invert.png</normaloff>:/icons/invert.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Invert</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+Shift+W</string>
-   </property>
-  </action>
-  <action name="actionMakePrimitive">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/radial.png</normaloff>:/icons/radial.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Generate Primitive</string>
-   </property>
-  </action>
-  <action name="actionSplitQuads">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/quad-split.png</normaloff>:/icons/quad-split.png</iconset>
-   </property>
-   <property name="text">
-    <string>Split &amp;Quads</string>
-   </property>
-   <property name="statusTip">
-    <string>Split quads into triangles.</string>
-   </property>
-  </action>
-  <action name="actionEditRaw">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/set-contents.png</normaloff>:/icons/set-contents.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Edit LDraw Code</string>
-   </property>
-   <property name="statusTip">
-    <string>Edit the LDraw code of this object.</string>
-   </property>
-  </action>
-  <action name="actionBorders">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/make-borders.png</normaloff>:/icons/make-borders.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Make Borders</string>
-   </property>
-   <property name="statusTip">
-    <string>Add borders around given polygons.</string>
-   </property>
-  </action>
-  <action name="actionRoundCoordinates">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/round-coords.png</normaloff>:/icons/round-coords.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Round Coordinates</string>
-   </property>
-   <property name="statusTip">
-    <string>Round coordinates down to 3/4 decimals</string>
-   </property>
-  </action>
-  <action name="actionVisibilityToggle">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/visibility-toggle.png</normaloff>:/icons/visibility-toggle.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Toggle Visibility</string>
-   </property>
-   <property name="statusTip">
-    <string>Toggles visibility/hiding on objects.</string>
-   </property>
-  </action>
-  <action name="actionReplaceCoords">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/replace-coords.png</normaloff>:/icons/replace-coords.png</iconset>
-   </property>
-   <property name="text">
-    <string>Re&amp;place Coordinates</string>
-   </property>
-   <property name="statusTip">
-    <string>Find and replace coordinate values.</string>
-   </property>
-  </action>
-  <action name="actionFlip">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/flip.png</normaloff>:/icons/flip.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Flip</string>
-   </property>
-   <property name="statusTip">
-    <string>Flip coordinates.</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+Shift+F</string>
-   </property>
-  </action>
-  <action name="actionDemote">
-   <property name="text">
-    <string>Demote Conditional Lines</string>
-   </property>
-   <property name="statusTip">
-    <string>Demote conditional lines down to normal lines.</string>
-   </property>
-  </action>
-  <action name="actionYtruder">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/ytruder.png</normaloff>:/icons/ytruder.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Ytruder</string>
-   </property>
-   <property name="statusTip">
-    <string>Extrude selected lines to a given plane</string>
-   </property>
-  </action>
-  <action name="actionRectifier">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/rectifier.png</normaloff>:/icons/rectifier.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Rectifier</string>
-   </property>
-   <property name="statusTip">
-    <string>Optimizes quads into rect primitives.</string>
-   </property>
-  </action>
-  <action name="actionIntersector">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/intersector.png</normaloff>:/icons/intersector.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Intersector</string>
-   </property>
-   <property name="statusTip">
-    <string>Perform clipping between two input groups.</string>
-   </property>
-  </action>
-  <action name="actionIsecalc">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/isecalc.png</normaloff>:/icons/isecalc.png</iconset>
-   </property>
-   <property name="text">
-    <string>I&amp;secalc</string>
-   </property>
-   <property name="statusTip">
-    <string>Compute intersection edgelines between two input groups.</string>
-   </property>
-  </action>
-  <action name="actionCoverer">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/coverer.png</normaloff>:/icons/coverer.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Coverer</string>
-   </property>
-   <property name="statusTip">
-    <string>Fill the space between two line shapes</string>
-   </property>
-  </action>
-  <action name="actionEdger2">
-   <property name="text">
-    <string>&amp;Edger 2</string>
-   </property>
-  </action>
-  <action name="actionHelp">
-   <property name="enabled">
-    <bool>false</bool>
-   </property>
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/help.png</normaloff>:/icons/help.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Help</string>
-   </property>
-   <property name="shortcut">
-    <string>F1</string>
-   </property>
-  </action>
-  <action name="actionAbout">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/ldforge.png</normaloff>:/icons/ldforge.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;About LDForge</string>
-   </property>
-  </action>
-  <action name="actionAboutQt">
-   <property name="text">
-    <string>About &amp;Qt</string>
-   </property>
-  </action>
-  <action name="actionGridCoarse">
-   <property name="checkable">
-    <bool>true</bool>
-   </property>
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/grid-coarse.png</normaloff>:/icons/grid-coarse.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Coarse Grid</string>
-   </property>
-  </action>
-  <action name="actionGridMedium">
-   <property name="checkable">
-    <bool>true</bool>
-   </property>
-   <property name="checked">
-    <bool>true</bool>
-   </property>
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/grid-medium.png</normaloff>:/icons/grid-medium.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Medium Grid</string>
-   </property>
-  </action>
-  <action name="actionGridFine">
-   <property name="checkable">
-    <bool>true</bool>
-   </property>
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/grid-fine.png</normaloff>:/icons/grid-fine.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Fine Grid</string>
-   </property>
-  </action>
-  <action name="actionEdit">
-   <property name="text">
-    <string>&amp;Edit Selected Object</string>
-   </property>
-  </action>
-  <action name="actionMoveUp">
-   <property name="icon">
-    <iconset resource="../ldforge.qrc">
-     <normaloff>:/icons/arrow-up.png</normaloff>:/icons/arrow-up.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Move Up</string>
-   </property>
-   <property name="shortcut">
-    <string>PgUp</string>
-   </property>
-  </action>
-  <action name="actionMoveDown">
-   <property name="icon">
-    <iconset resource="../ldforge.qrc">
-     <normaloff>:/icons/arrow-down.png</normaloff>:/icons/arrow-down.png</iconset>
-   </property>
-   <property name="text">
-    <string>Move &amp;Down</string>
-   </property>
-   <property name="shortcut">
-    <string>PgDown</string>
-   </property>
-  </action>
-  <action name="actionMoveXNeg">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/move-x-neg.png</normaloff>:/icons/move-x-neg.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Move -X</string>
-   </property>
-   <property name="shortcut">
-    <string>Left</string>
-   </property>
-  </action>
-  <action name="actionMoveXPos">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/move-x-pos.png</normaloff>:/icons/move-x-pos.png</iconset>
-   </property>
-   <property name="text">
-    <string>Move +&amp;X</string>
-   </property>
-   <property name="shortcut">
-    <string>Right</string>
-   </property>
-  </action>
-  <action name="actionMoveYNeg">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/move-y-neg.png</normaloff>:/icons/move-y-neg.png</iconset>
-   </property>
-   <property name="text">
-    <string>Move -&amp;Y</string>
-   </property>
-   <property name="shortcut">
-    <string>Home</string>
-   </property>
-  </action>
-  <action name="actionMoveYPos">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/move-y-pos.png</normaloff>:/icons/move-y-pos.png</iconset>
-   </property>
-   <property name="text">
-    <string>M&amp;ove +Y</string>
-   </property>
-   <property name="shortcut">
-    <string>End</string>
-   </property>
-  </action>
-  <action name="actionMoveZNeg">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/move-z-neg.png</normaloff>:/icons/move-z-neg.png</iconset>
-   </property>
-   <property name="text">
-    <string>Move -&amp;Z</string>
-   </property>
-   <property name="shortcut">
-    <string>Down</string>
-   </property>
-  </action>
-  <action name="actionMoveZPos">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/move-z-pos.png</normaloff>:/icons/move-z-pos.png</iconset>
-   </property>
-   <property name="text">
-    <string>Mo&amp;ve +Z</string>
-   </property>
-   <property name="shortcut">
-    <string>Up</string>
-   </property>
-  </action>
-  <action name="actionRotateXNeg">
-   <property name="text">
-    <string>&amp;Rotate -X</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+Left</string>
-   </property>
-  </action>
-  <action name="actionRotateXPos">
-   <property name="text">
-    <string>Rotate +&amp;X</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+Right</string>
-   </property>
-  </action>
-  <action name="actionRotateYNeg">
-   <property name="text">
-    <string>Rotate -&amp;Y</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+End</string>
-   </property>
-  </action>
-  <action name="actionRotateYPos">
-   <property name="text">
-    <string>R&amp;otate +Y</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+Home</string>
-   </property>
-  </action>
-  <action name="actionRotateZNeg">
-   <property name="text">
-    <string>Rotate -&amp;Z</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+Down</string>
-   </property>
-  </action>
-  <action name="actionRotateZPos">
-   <property name="text">
-    <string>Rotat&amp;e +Z</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+Up</string>
-   </property>
-  </action>
-  <action name="actionRotationPoint">
-   <property name="text">
-    <string>&amp;Set Rotation Point</string>
-   </property>
-  </action>
-  <action name="actionSaveAll">
-   <property name="text">
-    <string>Save All</string>
-   </property>
-  </action>
-  <action name="actionClose">
-   <property name="text">
-    <string>&amp;Close</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+W</string>
-   </property>
-  </action>
-  <action name="actionCloseAll">
-   <property name="text">
-    <string>Close All</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+Shift+W</string>
-   </property>
-  </action>
-  <action name="actionNewFile">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/file-new.png</normaloff>:/icons/file-new.png</iconset>
-   </property>
-   <property name="text">
-    <string>New &amp;File</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+N</string>
-   </property>
-  </action>
-  <action name="actionDownloadFrom">
-   <property name="text">
-    <string>&amp;Download From...</string>
-   </property>
-  </action>
-  <action name="actionAddHistoryLine">
-   <property name="text">
-    <string>Add History Line</string>
-   </property>
-  </action>
-  <action name="actionJumpTo">
-   <property name="text">
-    <string>&amp;Go to Line...</string>
-   </property>
-   <property name="shortcut">
-    <string>Ctrl+G</string>
-   </property>
-  </action>
-  <action name="actionModeCircle">
-   <property name="checkable">
-    <bool>true</bool>
-   </property>
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/mode-circle.png</normaloff>:/icons/mode-circle.png</iconset>
-   </property>
-   <property name="text">
-    <string>C&amp;ircle Mode</string>
-   </property>
-   <property name="shortcut">
-    <string>C</string>
-   </property>
-  </action>
-  <action name="actionVisibilityHide">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/visibility-hide.png</normaloff>:/icons/visibility-hide.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Hide</string>
-   </property>
-   <property name="toolTip">
-    <string>Hides objects from view</string>
-   </property>
-  </action>
-  <action name="actionVisibilityReveal">
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/visibility-show.png</normaloff>:/icons/visibility-show.png</iconset>
-   </property>
-   <property name="text">
-    <string>Re&amp;veal</string>
-   </property>
-   <property name="toolTip">
-    <string>Reveals objects. Undoes hiding.</string>
-   </property>
-  </action>
-  <action name="actionSubfileSelection">
-   <property name="text">
-    <string>Subfile Selection</string>
-   </property>
-  </action>
-  <action name="actionDrawAngles">
-   <property name="checkable">
-    <bool>true</bool>
-   </property>
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/mode-angle.png</normaloff>:/icons/mode-angle.png</iconset>
-   </property>
-   <property name="text">
-    <string>Draw An&amp;gles</string>
-   </property>
-   <property name="toolTip">
-    <string>Draw angle information when drawing lines</string>
-   </property>
-  </action>
-  <action name="actionRandomColors">
-   <property name="checkable">
-    <bool>true</bool>
-   </property>
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/random-colors.png</normaloff>:/icons/random-colors.png</iconset>
-   </property>
-   <property name="text">
-    <string>Ra&amp;ndom colors</string>
-   </property>
-   <property name="shortcut">
-    <string>Shift+R</string>
-   </property>
-  </action>
-  <action name="actionOpenSubfiles">
-   <property name="text">
-    <string>&amp;Open Subfiles for Editing</string>
-   </property>
-   <property name="toolTip">
-    <string>Opens the documents used by the selected subparts for editing.</string>
-   </property>
-  </action>
-  <action name="actionSplitLines">
-   <property name="text">
-    <string>Split &amp;Lines...</string>
-   </property>
-  </action>
-  <action name="actionDrawSurfaces">
-   <property name="checkable">
-    <bool>true</bool>
-   </property>
-   <property name="text">
-    <string>Draw s&amp;urfaces</string>
-   </property>
-   <property name="toolTip">
-    <string>Render surfaces (i.e. quads and triangles) on the viewport.</string>
-   </property>
-  </action>
-  <action name="actionDrawEdgeLines">
-   <property name="checkable">
-    <bool>true</bool>
-   </property>
-   <property name="text">
-    <string>Draw &amp;edgelines</string>
-   </property>
-   <property name="toolTip">
-    <string>Render edgelines on the viewport</string>
-   </property>
-  </action>
-  <action name="actionDrawConditionalLines">
-   <property name="checkable">
-    <bool>true</bool>
-   </property>
-   <property name="text">
-    <string>Draw conditional &amp;lines</string>
-   </property>
-   <property name="toolTip">
-    <string>Render conditional lines on the viewport.</string>
-   </property>
-  </action>
-  <action name="actionModeMagicWand">
-   <property name="checkable">
-    <bool>true</bool>
-   </property>
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/mode-magicwand.png</normaloff>:/icons/mode-magicwand.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Magic wand</string>
-   </property>
-   <property name="shortcut">
-    <string>W</string>
-   </property>
-  </action>
-  <action name="actionModeRectangle">
-   <property name="checkable">
-    <bool>true</bool>
-   </property>
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/mode-rectangle.png</normaloff>:/icons/mode-rectangle.png</iconset>
-   </property>
-   <property name="text">
-    <string>Recta&amp;ngle Mode</string>
-   </property>
-   <property name="shortcut">
-    <string>R</string>
-   </property>
-  </action>
-  <action name="actionModeLinePath">
-   <property name="checkable">
-    <bool>true</bool>
-   </property>
-   <property name="icon">
-    <iconset>
-     <normaloff>:/icons/line.png</normaloff>:/icons/line.png</iconset>
-   </property>
-   <property name="text">
-    <string>&amp;Line Path Mode</string>
-   </property>
-   <property name="shortcut">
-    <string>P</string>
-   </property>
-  </action>
- </widget>
- <resources>
-  <include location="../ldforge.qrc"/>
- </resources>
- <connections/>
-</ui>

mercurial