Merge branch 'gui-updates'
Before Width: | Height: | Size: 50 KiB After Width: | Height: | Size: 43 KiB |
After Width: | Height: | Size: 722 B |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 726 B |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 580 B |
After Width: | Height: | Size: 4.1 KiB |
After Width: | Height: | Size: 577 B |
After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 4.1 KiB After Width: | Height: | Size: 4.1 KiB |
Before Width: | Height: | Size: 425 B After Width: | Height: | Size: 529 B |
Before Width: | Height: | Size: 500 B After Width: | Height: | Size: 503 B |
After Width: | Height: | Size: 369 B |
Before Width: | Height: | Size: 265 B After Width: | Height: | Size: 348 B |
After Width: | Height: | Size: 581 B |
After Width: | Height: | Size: 530 B |
After Width: | Height: | Size: 582 B |
After Width: | Height: | Size: 535 B |
17
openscad.qrc
|
@ -1,5 +1,19 @@
|
||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
|
<file>images/zoom-text-in-white.png</file>
|
||||||
|
<file>images/zoom-text-in.png</file>
|
||||||
|
<file>images/zoom-text-out-white.png</file>
|
||||||
|
<file>images/zoom-text-out.png</file>
|
||||||
|
<file>images/Command-Redo-32-white.png</file>
|
||||||
|
<file>images/Command-Reset-32-white.png</file>
|
||||||
|
<file>images/Command-Undo-32-white.png</file>
|
||||||
|
<file>images/Decrease-Indent-32-white.png</file>
|
||||||
|
<file>images/Increase-Indent-32-white.png</file>
|
||||||
|
<file>images/Command-Redo-32.png</file>
|
||||||
|
<file>images/Command-Reset-32.png</file>
|
||||||
|
<file>images/Command-Undo-32.png</file>
|
||||||
|
<file>images/Decrease-Indent-32.png</file>
|
||||||
|
<file>images/Increase-Indent-32.png</file>
|
||||||
<file>icons/close.png</file>
|
<file>icons/close.png</file>
|
||||||
<file>icons/information-icons-error.png</file>
|
<file>icons/information-icons-error.png</file>
|
||||||
<file>icons/information-icons-info.png</file>
|
<file>icons/information-icons-info.png</file>
|
||||||
|
@ -59,11 +73,12 @@
|
||||||
<file>images/perspective1.png</file>
|
<file>images/perspective1.png</file>
|
||||||
<file>images/Preview-32.png</file>
|
<file>images/Preview-32.png</file>
|
||||||
<file>images/animate.png</file>
|
<file>images/animate.png</file>
|
||||||
<file>images/Preview-32 (1).png</file>
|
|
||||||
<file>images/orthogonalwhite.png</file>
|
<file>images/orthogonalwhite.png</file>
|
||||||
<file>images/perspective1white.png</file>
|
<file>images/perspective1white.png</file>
|
||||||
|
<file>images/Preview-32-white.png</file>
|
||||||
<file>images/crosswhite.png</file>
|
<file>images/crosswhite.png</file>
|
||||||
<file>icons/background.png</file>
|
<file>icons/background.png</file>
|
||||||
<file>images/scalemarkers.png</file>
|
<file>images/scalemarkers.png</file>
|
||||||
|
<file>images/scalemarkers-white.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|
|
@ -26,8 +26,7 @@ void Camera::setup(std::vector<double> params)
|
||||||
type = Camera::GIMBAL;
|
type = Camera::GIMBAL;
|
||||||
object_trans << params[0], params[1], params[2];
|
object_trans << params[0], params[1], params[2];
|
||||||
object_rot << params[3], params[4], params[5];
|
object_rot << params[3], params[4], params[5];
|
||||||
viewer_distance = params[6];
|
height = viewer_distance = params[6];
|
||||||
height = params[6];
|
|
||||||
} else if (params.size() == 6) {
|
} else if (params.size() == 6) {
|
||||||
type = Camera::VECTOR;
|
type = Camera::VECTOR;
|
||||||
eye << params[0], params[1], params[2];
|
eye << params[0], params[1], params[2];
|
||||||
|
@ -74,13 +73,13 @@ void Camera::viewAll(const BoundingBox &bbox, float scalefactor)
|
||||||
|
|
||||||
switch (this->projection) {
|
switch (this->projection) {
|
||||||
case Camera::ORTHOGONAL:
|
case Camera::ORTHOGONAL:
|
||||||
this->height = bbox.diagonal().norm();
|
this->height = this->viewer_distance = bbox.diagonal().norm();
|
||||||
break;
|
break;
|
||||||
case Camera::PERSPECTIVE: {
|
case Camera::PERSPECTIVE: {
|
||||||
double radius = bbox.diagonal().norm()/2;
|
double radius = bbox.diagonal().norm()/2;
|
||||||
switch (this->type) {
|
switch (this->type) {
|
||||||
case Camera::GIMBAL:
|
case Camera::GIMBAL:
|
||||||
this->viewer_distance = radius / tan(this->fov*M_PI/360);
|
this->height = this->viewer_distance = radius / tan(this->fov*M_PI/360);
|
||||||
break;
|
break;
|
||||||
case Camera::VECTOR: {
|
case Camera::VECTOR: {
|
||||||
Vector3d cameradir = (this->center - this->eye).normalized();
|
Vector3d cameradir = (this->center - this->eye).normalized();
|
||||||
|
@ -101,8 +100,7 @@ void Camera::viewAll(const BoundingBox &bbox, float scalefactor)
|
||||||
|
|
||||||
void Camera::zoom(int delta)
|
void Camera::zoom(int delta)
|
||||||
{
|
{
|
||||||
this->viewer_distance *= pow(0.9, delta / 120.0);
|
this->height = this->viewer_distance *= pow(0.9, delta / 120.0);
|
||||||
this->height = this->viewer_distance;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Camera::setProjection(ProjectionType type)
|
void Camera::setProjection(ProjectionType type)
|
||||||
|
@ -115,8 +113,7 @@ void Camera::resetView()
|
||||||
type = Camera::GIMBAL;
|
type = Camera::GIMBAL;
|
||||||
object_rot << 35, 0, -25;
|
object_rot << 35, 0, -25;
|
||||||
object_trans << 0, 0, 0;
|
object_trans << 0, 0, 0;
|
||||||
height = 140;
|
height = viewer_distance = 140;
|
||||||
viewer_distance = 140;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double Camera::zoomValue()
|
double Camera::zoomValue()
|
||||||
|
|
|
@ -99,6 +99,7 @@ private slots:
|
||||||
void showProgress();
|
void showProgress();
|
||||||
void openCSGSettingsChanged();
|
void openCSGSettingsChanged();
|
||||||
private:
|
private:
|
||||||
|
void initActionIcon(QAction *action, const char *darkResource, const char *lightResource);
|
||||||
void openFile(const QString &filename);
|
void openFile(const QString &filename);
|
||||||
void handleFileDrop(const QString &filename);
|
void handleFileDrop(const QString &filename);
|
||||||
void refreshDocument();
|
void refreshDocument();
|
||||||
|
@ -205,7 +206,7 @@ public slots:
|
||||||
void actionReloadRenderPreview();
|
void actionReloadRenderPreview();
|
||||||
void on_editorDock_visibilityChanged(bool);
|
void on_editorDock_visibilityChanged(bool);
|
||||||
void on_consoleDock_visibilityChanged(bool);
|
void on_consoleDock_visibilityChanged(bool);
|
||||||
void on_pushButtonCompileResultClose_clicked();
|
void on_toolButtonCompileResultClose_clicked();
|
||||||
void editorTopLevelChanged(bool);
|
void editorTopLevelChanged(bool);
|
||||||
void consoleTopLevelChanged(bool);
|
void consoleTopLevelChanged(bool);
|
||||||
#ifdef ENABLE_OPENCSG
|
#ifdef ENABLE_OPENCSG
|
||||||
|
|
|
@ -43,39 +43,20 @@
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="gridLayout_2">
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
<property name="leftMargin">
|
<property name="leftMargin">
|
||||||
<number>9</number>
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="rightMargin">
|
<property name="rightMargin">
|
||||||
<number>2</number>
|
<number>6</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="bottomMargin">
|
<property name="bottomMargin">
|
||||||
<number>2</number>
|
<number>4</number>
|
||||||
|
</property>
|
||||||
|
<property name="horizontalSpacing">
|
||||||
|
<number>4</number>
|
||||||
</property>
|
</property>
|
||||||
<item row="0" column="0">
|
|
||||||
<widget class="QLabel" name="labelCompileResultIcon">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="maximumSize">
|
|
||||||
<size>
|
|
||||||
<width>26</width>
|
|
||||||
<height>26</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string/>
|
|
||||||
</property>
|
|
||||||
<property name="pixmap">
|
|
||||||
<pixmap resource="../openscad.qrc">:/icons/information-icons-error.png</pixmap>
|
|
||||||
</property>
|
|
||||||
<property name="scaledContents">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QLabel" name="labelCompileResultMessage">
|
<widget class="QLabel" name="labelCompileResultMessage">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -86,7 +67,6 @@
|
||||||
</property>
|
</property>
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>14</pointsize>
|
|
||||||
<weight>75</weight>
|
<weight>75</weight>
|
||||||
<bold>true</bold>
|
<bold>true</bold>
|
||||||
</font>
|
</font>
|
||||||
|
@ -94,10 +74,16 @@
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Message</string>
|
<string>Message</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="wordWrap">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="2">
|
<item row="0" column="2">
|
||||||
<widget class="QPushButton" name="pushButtonCompileResultClose">
|
<widget class="QToolButton" name="toolButtonCompileResultClose">
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true"/>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string/>
|
<string/>
|
||||||
</property>
|
</property>
|
||||||
|
@ -105,11 +91,43 @@
|
||||||
<iconset resource="../openscad.qrc">
|
<iconset resource="../openscad.qrc">
|
||||||
<normaloff>:/icons/close.png</normaloff>:/icons/close.png</iconset>
|
<normaloff>:/icons/close.png</normaloff>:/icons/close.png</iconset>
|
||||||
</property>
|
</property>
|
||||||
<property name="flat">
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>22</width>
|
||||||
|
<height>22</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="toolButtonStyle">
|
||||||
|
<enum>Qt::ToolButtonIconOnly</enum>
|
||||||
|
</property>
|
||||||
|
<property name="autoRaise">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QToolButton" name="toolButtonCompileResultIcon">
|
||||||
|
<property name="styleSheet">
|
||||||
|
<string notr="true">QToolButton { border: none; }</string>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../openscad.qrc">
|
||||||
|
<normaloff>:/icons/information-icons-error.png</normaloff>:/icons/information-icons-error.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>22</width>
|
||||||
|
<height>22</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="autoRaise">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -195,6 +213,7 @@
|
||||||
<addaction name="viewActionViewAll"/>
|
<addaction name="viewActionViewAll"/>
|
||||||
<addaction name="viewActionZoomIn"/>
|
<addaction name="viewActionZoomIn"/>
|
||||||
<addaction name="viewActionZoomOut"/>
|
<addaction name="viewActionZoomOut"/>
|
||||||
|
<addaction name="viewActionResetView"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="viewActionRight"/>
|
<addaction name="viewActionRight"/>
|
||||||
<addaction name="viewActionTop"/>
|
<addaction name="viewActionTop"/>
|
||||||
|
@ -205,7 +224,9 @@
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="viewActionPerspective"/>
|
<addaction name="viewActionPerspective"/>
|
||||||
<addaction name="viewActionOrthogonal"/>
|
<addaction name="viewActionOrthogonal"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
<addaction name="viewActionShowAxes"/>
|
<addaction name="viewActionShowAxes"/>
|
||||||
|
<addaction name="viewActionShowScaleProportional"/>
|
||||||
<addaction name="viewActionShowEdges"/>
|
<addaction name="viewActionShowEdges"/>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
@ -296,8 +317,8 @@
|
||||||
<addaction name="editActionFindPrevious"/>
|
<addaction name="editActionFindPrevious"/>
|
||||||
<addaction name="editActionUseSelectionForFind"/>
|
<addaction name="editActionUseSelectionForFind"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
<addaction name="editActionZoomIn"/>
|
<addaction name="editActionZoomTextIn"/>
|
||||||
<addaction name="editActionZoomOut"/>
|
<addaction name="editActionZoomTextOut"/>
|
||||||
<addaction name="editActionPreferences"/>
|
<addaction name="editActionPreferences"/>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QMenu" name="menu_Design">
|
<widget class="QMenu" name="menu_Design">
|
||||||
|
@ -389,6 +410,11 @@
|
||||||
<addaction name="fileActionOpen"/>
|
<addaction name="fileActionOpen"/>
|
||||||
<addaction name="fileActionSave"/>
|
<addaction name="fileActionSave"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
|
<addaction name="editActionUndo"/>
|
||||||
|
<addaction name="editActionRedo"/>
|
||||||
|
<addaction name="editActionUnindent"/>
|
||||||
|
<addaction name="editActionIndent"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
<addaction name="designActionPreview"/>
|
<addaction name="designActionPreview"/>
|
||||||
<addaction name="designActionRender"/>
|
<addaction name="designActionRender"/>
|
||||||
<addaction name="separator"/>
|
<addaction name="separator"/>
|
||||||
|
@ -586,6 +612,10 @@
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="editActionUndo">
|
<action name="editActionUndo">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../openscad.qrc">
|
||||||
|
<normaloff>:/images/Command-Undo-32.png</normaloff>:/images/Command-Undo-32.png</iconset>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Undo</string>
|
<string>&Undo</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -597,6 +627,10 @@
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="editActionRedo">
|
<action name="editActionRedo">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../openscad.qrc">
|
||||||
|
<normaloff>:/images/Command-Redo-32.png</normaloff>:/images/Command-Redo-32.png</iconset>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Redo</string>
|
<string>&Redo</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -641,6 +675,10 @@
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="editActionIndent">
|
<action name="editActionIndent">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../openscad.qrc">
|
||||||
|
<normaloff>:/images/Increase-Indent-32.png</normaloff>:/images/Increase-Indent-32.png</iconset>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>&Indent</string>
|
<string>&Indent</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -648,14 +686,6 @@
|
||||||
<string>Ctrl+I</string>
|
<string>Ctrl+I</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="editActionUnindent">
|
|
||||||
<property name="text">
|
|
||||||
<string>U&nindent</string>
|
|
||||||
</property>
|
|
||||||
<property name="shortcut">
|
|
||||||
<string>Ctrl+Shift+I</string>
|
|
||||||
</property>
|
|
||||||
</action>
|
|
||||||
<action name="editActionComment">
|
<action name="editActionComment">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>C&omment</string>
|
<string>C&omment</string>
|
||||||
|
@ -685,17 +715,17 @@
|
||||||
<string>Paste viewport rotation</string>
|
<string>Paste viewport rotation</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="editActionZoomIn">
|
<action name="editActionZoomTextIn">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Zoom In</string>
|
<string>Increase Font Size</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="shortcut">
|
<property name="shortcut">
|
||||||
<string>Ctrl++</string>
|
<string>Ctrl++</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="editActionZoomOut">
|
<action name="editActionZoomTextOut">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Zoom Out</string>
|
<string>Decrease Font Size</string>
|
||||||
</property>
|
</property>
|
||||||
<property name="shortcut">
|
<property name="shortcut">
|
||||||
<string>Ctrl+-</string>
|
<string>Ctrl+-</string>
|
||||||
|
@ -1122,6 +1152,10 @@
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="viewActionResetView">
|
<action name="viewActionResetView">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../openscad.qrc">
|
||||||
|
<normaloff>:/images/Command-Reset-32.png</normaloff>:/images/Command-Reset-32.png</iconset>
|
||||||
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Reset View</string>
|
<string>Reset View</string>
|
||||||
</property>
|
</property>
|
||||||
|
@ -1187,6 +1221,18 @@
|
||||||
<string>Hide toolbars</string>
|
<string>Hide toolbars</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="editActionUnindent">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="../openscad.qrc">
|
||||||
|
<normaloff>:/images/Decrease-Indent-32.png</normaloff>:/images/Decrease-Indent-32.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>U&nindent</string>
|
||||||
|
</property>
|
||||||
|
<property name="shortcut">
|
||||||
|
<string>Ctrl+Shift+I</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
<action name="helpActionCheatSheet">
|
<action name="helpActionCheatSheet">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Cheat Sheet</string>
|
<string>Cheat Sheet</string>
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
#include <QKeyEvent>
|
#include <QKeyEvent>
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QStatusBar>
|
#include <QStatusBar>
|
||||||
|
#include <boost/algorithm/string.hpp>
|
||||||
#include "GeometryCache.h"
|
#include "GeometryCache.h"
|
||||||
#include "AutoUpdater.h"
|
#include "AutoUpdater.h"
|
||||||
#include "feature.h"
|
#include "feature.h"
|
||||||
|
@ -49,18 +50,27 @@ class SettingsReader : public Settings::Visitor
|
||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
const Value getValue(const Settings::SettingsEntry& entry, const std::string& value) const {
|
const Value getValue(const Settings::SettingsEntry& entry, const std::string& value) const {
|
||||||
if (value.empty()) {
|
std::string trimmed_value(value);
|
||||||
|
boost::trim(trimmed_value);
|
||||||
|
|
||||||
|
if (trimmed_value.empty()) {
|
||||||
return entry.defaultValue();
|
return entry.defaultValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
switch (entry.defaultValue().type()) {
|
switch (entry.defaultValue().type()) {
|
||||||
case Value::STRING:
|
case Value::STRING:
|
||||||
return Value(value);
|
return Value(trimmed_value);
|
||||||
case Value::NUMBER:
|
case Value::NUMBER:
|
||||||
return Value(boost::lexical_cast<int>(value));
|
return Value(boost::lexical_cast<int>(trimmed_value));
|
||||||
case Value::BOOL:
|
case Value::BOOL:
|
||||||
return Value(boost::lexical_cast<bool>(value));
|
boost::to_lower(trimmed_value);
|
||||||
|
if ("false" == trimmed_value) {
|
||||||
|
return Value(false);
|
||||||
|
} else if ("true" == trimmed_value) {
|
||||||
|
return Value(true);
|
||||||
|
}
|
||||||
|
return Value(boost::lexical_cast<bool>(trimmed_value));
|
||||||
default:
|
default:
|
||||||
assert(false && "invalid value type for settings");
|
assert(false && "invalid value type for settings");
|
||||||
}
|
}
|
||||||
|
@ -74,7 +84,9 @@ class SettingsReader : public Settings::Visitor
|
||||||
|
|
||||||
std::string key = entry.category() + "/" + entry.name();
|
std::string key = entry.category() + "/" + entry.name();
|
||||||
std::string value = settings.value(QString::fromStdString(key)).toString().toStdString();
|
std::string value = settings.value(QString::fromStdString(key)).toString().toStdString();
|
||||||
s->set(entry, getValue(entry, value));
|
const Value v = getValue(entry, value);
|
||||||
|
PRINTDB("SettingsReader R: %s = '%s' => '%s'", key.c_str() % value.c_str() % v.toString());
|
||||||
|
s->set(entry, v);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -87,9 +99,11 @@ class SettingsWriter : public Settings::Visitor
|
||||||
QString key = QString::fromStdString(entry.category() + "/" + entry.name());
|
QString key = QString::fromStdString(entry.category() + "/" + entry.name());
|
||||||
if (entry.is_default()) {
|
if (entry.is_default()) {
|
||||||
settings.remove(key);
|
settings.remove(key);
|
||||||
|
PRINTDB("SettingsWriter D: %s", key.toStdString().c_str());
|
||||||
} else {
|
} else {
|
||||||
Value value = s->get(entry);
|
Value value = s->get(entry);
|
||||||
settings.setValue(key, QString::fromStdString(value.toString()));
|
settings.setValue(key, QString::fromStdString(value.toString()));
|
||||||
|
PRINTDB("SettingsWriter W: %s = '%s'", key.toStdString().c_str() % value.toString().c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -471,6 +485,12 @@ void Preferences::on_launcherBox_toggled(bool state)
|
||||||
settings.setValue("launcher/showOnStartup", state);
|
settings.setValue("launcher/showOnStartup", state);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Preferences::on_checkBoxShowWarningsIn3dView_toggled(bool val)
|
||||||
|
{
|
||||||
|
Settings::Settings::inst()->set(Settings::Settings::showWarningsIn3dView, Value(val));
|
||||||
|
writeSettings();
|
||||||
|
}
|
||||||
|
|
||||||
void Preferences::on_spinBoxIndentationWidth_valueChanged(int val)
|
void Preferences::on_spinBoxIndentationWidth_valueChanged(int val)
|
||||||
{
|
{
|
||||||
Settings::Settings::inst()->set(Settings::Settings::indentationWidth, Value(val));
|
Settings::Settings::inst()->set(Settings::Settings::indentationWidth, Value(val));
|
||||||
|
@ -669,6 +689,7 @@ void Preferences::updateGUI()
|
||||||
this->checkBoxAutoIndent->setChecked(s->get(Settings::Settings::autoIndent).toBool());
|
this->checkBoxAutoIndent->setChecked(s->get(Settings::Settings::autoIndent).toBool());
|
||||||
this->checkBoxHighlightCurrentLine->setChecked(s->get(Settings::Settings::highlightCurrentLine).toBool());
|
this->checkBoxHighlightCurrentLine->setChecked(s->get(Settings::Settings::highlightCurrentLine).toBool());
|
||||||
this->checkBoxEnableBraceMatching->setChecked(s->get(Settings::Settings::enableBraceMatching).toBool());
|
this->checkBoxEnableBraceMatching->setChecked(s->get(Settings::Settings::enableBraceMatching).toBool());
|
||||||
|
this->checkBoxShowWarningsIn3dView->setChecked(s->get(Settings::Settings::showWarningsIn3dView).toBool());
|
||||||
}
|
}
|
||||||
|
|
||||||
void Preferences::initComboBox(QComboBox *comboBox, const Settings::SettingsEntry& entry)
|
void Preferences::initComboBox(QComboBox *comboBox, const Settings::SettingsEntry& entry)
|
||||||
|
|
|
@ -46,6 +46,7 @@ public slots:
|
||||||
void on_launcherBox_toggled(bool);
|
void on_launcherBox_toggled(bool);
|
||||||
void on_editorType_editTextChanged(const QString &);
|
void on_editorType_editTextChanged(const QString &);
|
||||||
|
|
||||||
|
void on_checkBoxShowWarningsIn3dView_toggled(bool);
|
||||||
//
|
//
|
||||||
// editor settings
|
// editor settings
|
||||||
//
|
//
|
||||||
|
|
|
@ -6,8 +6,8 @@
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>621</width>
|
<width>675</width>
|
||||||
<height>413</height>
|
<height>476</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
@ -31,6 +31,9 @@
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="page3DView">
|
<widget class="QWidget" name="page3DView">
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_4">
|
<layout class="QVBoxLayout" name="verticalLayout_4">
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,3">
|
<layout class="QHBoxLayout" name="horizontalLayout" stretch="1,3">
|
||||||
<item>
|
<item>
|
||||||
|
@ -75,6 +78,16 @@
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QCheckBox" name="checkBoxShowWarningsIn3dView">
|
||||||
|
<property name="text">
|
||||||
|
<string>Show Warnings and Errors in 3D View</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QWidget" name="pageEditor">
|
<widget class="QWidget" name="pageEditor">
|
||||||
|
|
|
@ -25,8 +25,8 @@ LaunchingScreen::LaunchingScreen(QWidget *parent) : QDialog(parent)
|
||||||
{
|
{
|
||||||
LaunchingScreen::inst = this;
|
LaunchingScreen::inst = this;
|
||||||
setupUi(this);
|
setupUi(this);
|
||||||
this->setStyleSheet("QDialog {background-image:url(':/icons/background.png')}"
|
|
||||||
"QPushButton {color:white;}");
|
this->setStyleSheet("QDialog {background-image:url(':/icons/background.png')} QPushButton {color:white;}");
|
||||||
|
|
||||||
this->versionNumberLabel->setText(openscad_version.c_str());
|
this->versionNumberLabel->setText(openscad_version.c_str());
|
||||||
|
|
||||||
|
|
126
src/mainwin.cc
|
@ -256,7 +256,7 @@ MainWindow::MainWindow(const QString &filename)
|
||||||
knownFileExtensions["scad"] = "";
|
knownFileExtensions["scad"] = "";
|
||||||
knownFileExtensions["csg"] = "";
|
knownFileExtensions["csg"] = "";
|
||||||
|
|
||||||
editActionZoomIn->setShortcuts(QList<QKeySequence>() << editActionZoomIn->shortcuts() << QKeySequence("CTRL+="));
|
editActionZoomTextIn->setShortcuts(QList<QKeySequence>() << editActionZoomTextIn->shortcuts() << QKeySequence("CTRL+="));
|
||||||
|
|
||||||
connect(this, SIGNAL(highlightError(int)), editor, SLOT(highlightError(int)));
|
connect(this, SIGNAL(highlightError(int)), editor, SLOT(highlightError(int)));
|
||||||
connect(this, SIGNAL(unhighlightLastError()), editor, SLOT(unhighlightLastError()));
|
connect(this, SIGNAL(unhighlightLastError()), editor, SLOT(unhighlightLastError()));
|
||||||
|
@ -330,8 +330,8 @@ MainWindow::MainWindow(const QString &filename)
|
||||||
connect(this->editActionConvertTabsToSpaces, SIGNAL(triggered()), this, SLOT(convertTabsToSpaces()));
|
connect(this->editActionConvertTabsToSpaces, SIGNAL(triggered()), this, SLOT(convertTabsToSpaces()));
|
||||||
connect(this->editActionPasteVPT, SIGNAL(triggered()), this, SLOT(pasteViewportTranslation()));
|
connect(this->editActionPasteVPT, SIGNAL(triggered()), this, SLOT(pasteViewportTranslation()));
|
||||||
connect(this->editActionPasteVPR, SIGNAL(triggered()), this, SLOT(pasteViewportRotation()));
|
connect(this->editActionPasteVPR, SIGNAL(triggered()), this, SLOT(pasteViewportRotation()));
|
||||||
connect(this->editActionZoomIn, SIGNAL(triggered()), editor, SLOT(zoomIn()));
|
connect(this->editActionZoomTextIn, SIGNAL(triggered()), editor, SLOT(zoomIn()));
|
||||||
connect(this->editActionZoomOut, SIGNAL(triggered()), editor, SLOT(zoomOut()));
|
connect(this->editActionZoomTextOut, SIGNAL(triggered()), editor, SLOT(zoomOut()));
|
||||||
connect(this->editActionPreferences, SIGNAL(triggered()), this, SLOT(preferences()));
|
connect(this->editActionPreferences, SIGNAL(triggered()), this, SLOT(preferences()));
|
||||||
// Edit->Find
|
// Edit->Find
|
||||||
connect(this->editActionFind, SIGNAL(triggered()), this, SLOT(find()));
|
connect(this->editActionFind, SIGNAL(triggered()), this, SLOT(find()));
|
||||||
|
@ -474,60 +474,37 @@ MainWindow::MainWindow(const QString &filename)
|
||||||
addKeyboardShortCut(this->viewerToolBar->actions());
|
addKeyboardShortCut(this->viewerToolBar->actions());
|
||||||
addKeyboardShortCut(this->editortoolbar->actions());
|
addKeyboardShortCut(this->editortoolbar->actions());
|
||||||
|
|
||||||
//Toolbar
|
initActionIcon(fileActionNew, ":/images/blackNew.png", ":/images/Document-New-128.png");
|
||||||
int defaultcolor = viewerToolBar->palette().background().color().lightness();
|
initActionIcon(fileActionOpen, ":/images/Open-32.png", ":/images/Open-128.png");
|
||||||
|
initActionIcon(fileActionSave, ":/images/Save-32.png", ":/images/Save-128.png");
|
||||||
if (defaultcolor > 165) {
|
initActionIcon(editActionZoomTextIn, ":/images/zoom-text-in.png", ":/images/zoom-text-in-white.png");
|
||||||
fileActionNew->setIcon(QIcon("://images/blackNew.png"));
|
initActionIcon(editActionZoomTextOut, ":/images/zoom-text-out.png", ":/images/zoom-text-out-white.png");
|
||||||
fileActionOpen->setIcon(QIcon("://images/Open-32.png"));
|
initActionIcon(designActionRender, ":/images/blackRender.png", ":/images/Arrowhead-Right-32.png");
|
||||||
fileActionSave->setIcon(QIcon("://images/Save-32.png"));
|
initActionIcon(viewActionShowAxes, ":/images/blackaxes.png", ":/images/axes.png");
|
||||||
editActionZoomIn->setIcon(QIcon("://images/zoomin.png"));
|
initActionIcon(viewActionShowEdges, ":/images/Rotation-32.png", ":/images/grid.png");
|
||||||
editActionZoomOut->setIcon(QIcon("://images/zoomout.png"));
|
initActionIcon(viewActionZoomIn, ":/images/zoomin.png", ":/images/Zoom-In-32.png");
|
||||||
designActionRender->setIcon(QIcon("://images/blackRender.png"));
|
initActionIcon(viewActionZoomOut, ":/images/zoomout.png", ":/images/Zoom-Out-32.png");
|
||||||
viewActionShowAxes->setIcon(QIcon("://images/blackaxes.png"));
|
initActionIcon(viewActionTop, ":/images/blackUp.png", ":/images/up.png");
|
||||||
viewActionShowEdges->setIcon(QIcon("://images/Rotation-32.png"));
|
initActionIcon(viewActionBottom, ":/images/blackbottom.png", ":/images/bottom.png");
|
||||||
viewActionZoomIn->setIcon(QIcon("://images/zoomin.png"));
|
initActionIcon(viewActionLeft, ":/images/blackleft (copy).png", ":/images/left.png");
|
||||||
viewActionZoomOut->setIcon(QIcon("://images/zoomout.png"));
|
initActionIcon(viewActionRight, ":/images/rightright.png", ":/images/right.png");
|
||||||
viewActionTop->setIcon(QIcon("://images/blackUp.png"));
|
initActionIcon(viewActionFront, ":/images/blackfront.png", ":/images/front.png");
|
||||||
viewActionBottom->setIcon(QIcon("://images/blackbottom.png"));
|
initActionIcon(viewActionBack, ":/images/blackback.png", ":/images/back.png");
|
||||||
viewActionLeft->setIcon(QIcon("://images/blackleft (copy).png"));
|
initActionIcon(viewActionSurfaces, ":/images/surface.png", ":/images/surfaceWhite.png");
|
||||||
viewActionRight->setIcon(QIcon("://images/rightright.png"));
|
initActionIcon(viewActionWireframe, ":/images/wireframe1.png", ":/images/wireframeWhite.png");
|
||||||
viewActionFront->setIcon(QIcon("://images/blackfront.png"));
|
initActionIcon(viewActionShowCrosshairs, ":/images/cross.png", ":/images/crosswhite.png");
|
||||||
viewActionBack->setIcon(QIcon("://images/blackback.png"));
|
initActionIcon(viewActionPerspective, ":/images/perspective1.png", ":/images/perspective1white.png");
|
||||||
viewActionSurfaces->setIcon(QIcon("://images/surface.png"));
|
initActionIcon(viewActionOrthogonal, ":/images/orthogonal.png", ":/images/orthogonalwhite.png");
|
||||||
viewActionWireframe->setIcon(QIcon("://images/wireframe1.png"));
|
initActionIcon(designActionPreview, ":/images/Preview-32.png", ":/images/Preview-32-white.png");
|
||||||
viewActionShowCrosshairs->setIcon(QIcon("://images/cross.png"));
|
initActionIcon(viewActionAnimate, ":/images/animate.png", ":/images/animate.png");
|
||||||
viewActionPerspective->setIcon(QIcon("://images/perspective1.png"));
|
initActionIcon(designActionExportSTL, ":/images/export.png", ":/images/export-white.png");
|
||||||
viewActionOrthogonal->setIcon(QIcon("://images/orthogonal.png"));
|
initActionIcon(viewActionViewAll, ":/images/zoom-all.png", ":/images/zoom-all-white.png");
|
||||||
viewActionPreview->setIcon(QIcon("://images/Preview-32.png"));
|
initActionIcon(editActionUndo, ":/images/Command-Undo-32.png", ":/images/Command-Undo-32-white.png");
|
||||||
viewActionAnimate->setIcon(QIcon("://images/animate.png"));
|
initActionIcon(editActionRedo, ":/images/Command-Redo-32.png", ":/images/Command-Redo-32-white.png");
|
||||||
} else {
|
initActionIcon(editActionUnindent, ":/images/Decrease-Indent-32.png", ":/images/Decrease-Indent-32-white.png");
|
||||||
fileActionNew->setIcon(QIcon("://images/Document-New-128.png"));
|
initActionIcon(editActionIndent, ":/images/Increase-Indent-32.png", ":/images/Increase-Indent-32-white.png");
|
||||||
fileActionOpen->setIcon(QIcon("://images/Open-128.png"));
|
initActionIcon(viewActionResetView, ":/images/Command-Reset-32.png", ":/images/Command-Reset-32-white.png");
|
||||||
fileActionSave->setIcon(QIcon("://images/Save-128.png"));
|
initActionIcon(viewActionShowScaleProportional, ":/images/scalemarkers.png", ":/images/scalemarkers-white.png");
|
||||||
editActionZoomIn->setIcon(QIcon("://images/Zoom-In-32.png"));
|
|
||||||
editActionZoomOut->setIcon(QIcon("://images/Zoom-Out-32.png"));
|
|
||||||
designActionRender->setIcon(QIcon("://images/Arrowhead-Right-32.png"));
|
|
||||||
viewActionZoomIn->setIcon(QIcon("://images/Zoom-In-32.png"));
|
|
||||||
viewActionZoomOut->setIcon(QIcon("://images/Zoom-Out-32.png"));
|
|
||||||
viewActionShowAxes->setIcon(QIcon("://images/axes.png"));
|
|
||||||
viewActionShowEdges->setIcon(QIcon("://images/grid.png"));
|
|
||||||
viewActionTop->setIcon(QIcon("://images/up.png"));
|
|
||||||
viewActionBottom->setIcon(QIcon("://images/bottom.png"));
|
|
||||||
viewActionLeft->setIcon(QIcon("://images/left.png"));
|
|
||||||
viewActionRight->setIcon(QIcon("://images/right.png"));
|
|
||||||
viewActionFront->setIcon(QIcon("://images/front.png"));
|
|
||||||
viewActionBack->setIcon(QIcon("://images/back.png"));
|
|
||||||
viewActionSurfaces->setIcon(QIcon("://images/surfaceWhite.png"));
|
|
||||||
viewActionWireframe->setIcon(QIcon("://images/wireframeWhite.png"));
|
|
||||||
viewActionShowCrosshairs->setIcon(QIcon("://images/crosswhite.png"));
|
|
||||||
viewActionPreview->setIcon(QIcon("://images/Preview-32(1).png"));
|
|
||||||
viewActionPerspective->setIcon(QIcon("://images/perspective1white.png"));
|
|
||||||
viewActionOrthogonal->setIcon(QIcon("://images/orthogonalwhite.png"));
|
|
||||||
viewActionAnimate->setIcon(QIcon("://images/animate.png"));
|
|
||||||
designActionExportSTL->setIcon(QIcon(":/images/export-white.png"));
|
|
||||||
viewActionViewAll->setIcon(QIcon(":/images/zoom-all-white.png"));
|
|
||||||
}
|
|
||||||
|
|
||||||
// make sure it looks nice..
|
// make sure it looks nice..
|
||||||
QByteArray windowState = settings.value("window/state", QByteArray()).toByteArray();
|
QByteArray windowState = settings.value("window/state", QByteArray()).toByteArray();
|
||||||
|
@ -588,6 +565,13 @@ MainWindow::MainWindow(const QString &filename)
|
||||||
clearCurrentOutput();
|
clearCurrentOutput();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::initActionIcon(QAction *action, const char *darkResource, const char *lightResource)
|
||||||
|
{
|
||||||
|
int defaultcolor = viewerToolBar->palette().background().color().lightness();
|
||||||
|
const char *resource = (defaultcolor > 165) ? darkResource : lightResource;
|
||||||
|
action->setIcon(QIcon(resource));
|
||||||
|
}
|
||||||
|
|
||||||
void MainWindow::addKeyboardShortCut(const QList<QAction *> &actions)
|
void MainWindow::addKeyboardShortCut(const QList<QAction *> &actions)
|
||||||
{
|
{
|
||||||
foreach (QAction *action, actions) {
|
foreach (QAction *action, actions) {
|
||||||
|
@ -958,7 +942,7 @@ void MainWindow::waitAfterReload()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_pushButtonCompileResultClose_clicked()
|
void MainWindow::on_toolButtonCompileResultClose_clicked()
|
||||||
{
|
{
|
||||||
frameCompileResult->hide();
|
frameCompileResult->hide();
|
||||||
}
|
}
|
||||||
|
@ -970,6 +954,11 @@ void MainWindow::updateCompileResult()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Settings::Settings *s = Settings::Settings::inst();
|
||||||
|
if (!s->get(Settings::Settings::showWarningsIn3dView).toBool()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QString msg;
|
QString msg;
|
||||||
if (compileErrors > 0) {
|
if (compileErrors > 0) {
|
||||||
if (fileName.isEmpty()) {
|
if (fileName.isEmpty()) {
|
||||||
|
@ -978,11 +967,18 @@ void MainWindow::updateCompileResult()
|
||||||
QFileInfo fileInfo(fileName);
|
QFileInfo fileInfo(fileName);
|
||||||
msg = QString(_("Error while compiling '%1'.")).arg(fileInfo.fileName());
|
msg = QString(_("Error while compiling '%1'.")).arg(fileInfo.fileName());
|
||||||
}
|
}
|
||||||
labelCompileResultIcon->setPixmap(QPixmap(QString::fromUtf8(":/icons/information-icons-error.png")));
|
toolButtonCompileResultIcon->setIcon(QIcon(QString::fromUtf8(":/icons/information-icons-error.png")));
|
||||||
} else {
|
} else {
|
||||||
msg = QString(_("Compilation generated %1 warnings.")).arg(compileWarnings);
|
const char *fmt = ngettext("Compilation generated %1 warning.", "Compilation generated %1 warnings.", compileWarnings);
|
||||||
labelCompileResultIcon->setPixmap(QPixmap(QString::fromUtf8(":/icons/information-icons-warning.png")));
|
msg = QString(fmt).arg(compileWarnings);
|
||||||
|
toolButtonCompileResultIcon->setIcon(QIcon(QString::fromUtf8(":/icons/information-icons-warning.png")));
|
||||||
}
|
}
|
||||||
|
QFontMetrics fm(labelCompileResultMessage->font());
|
||||||
|
int sizeIcon = std::max(12, std::min(32, fm.height()));
|
||||||
|
int sizeClose = std::max(10, std::min(32, fm.height()) - 4);
|
||||||
|
toolButtonCompileResultIcon->setIconSize(QSize(sizeIcon, sizeIcon));
|
||||||
|
toolButtonCompileResultClose->setIconSize(QSize(sizeClose, sizeClose));
|
||||||
|
|
||||||
msg += _(" For details see <a href=\"#console\">console window</a>.");
|
msg += _(" For details see <a href=\"#console\">console window</a>.");
|
||||||
labelCompileResultMessage->setText(msg);
|
labelCompileResultMessage->setText(msg);
|
||||||
frameCompileResult->show();
|
frameCompileResult->show();
|
||||||
|
@ -1995,7 +1991,7 @@ void MainWindow::actionExport(export_type_e, QString, QString)
|
||||||
setCurrentOutput();
|
setCurrentOutput();
|
||||||
|
|
||||||
if (!this->root_geom) {
|
if (!this->root_geom) {
|
||||||
PRINT("Nothing to export! Try building first (press F6).");
|
PRINT("WARNING: Nothing to export! Try building first (press F6).");
|
||||||
clearCurrentOutput();
|
clearCurrentOutput();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -2075,13 +2071,13 @@ QString MainWindow::get2dExportFilename(QString format, QString extension) {
|
||||||
setCurrentOutput();
|
setCurrentOutput();
|
||||||
|
|
||||||
if (!this->root_geom) {
|
if (!this->root_geom) {
|
||||||
PRINT("Nothing to export! Try building first (press F6).");
|
PRINT("WARNING: Nothing to export! Try building first (press F6).");
|
||||||
clearCurrentOutput();
|
clearCurrentOutput();
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->root_geom->getDimension() != 2) {
|
if (this->root_geom->getDimension() != 2) {
|
||||||
PRINT("Current top level object is not a 2D object.");
|
PRINT("WARNING: Current top level object is not a 2D object.");
|
||||||
clearCurrentOutput();
|
clearCurrentOutput();
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
|
@ -2134,7 +2130,7 @@ void MainWindow::actionExportCSG()
|
||||||
setCurrentOutput();
|
setCurrentOutput();
|
||||||
|
|
||||||
if (!this->root_node) {
|
if (!this->root_node) {
|
||||||
PRINT("Nothing to export. Please try compiling first...");
|
PRINT("WARNING: Nothing to export. Please try compiling first...");
|
||||||
clearCurrentOutput();
|
clearCurrentOutput();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -331,7 +331,6 @@ void ScintillaEditor::noColor()
|
||||||
qsci->setIndicatorForegroundColor(QColor(255, 0, 0, 128), indicatorNumber);
|
qsci->setIndicatorForegroundColor(QColor(255, 0, 0, 128), indicatorNumber);
|
||||||
qsci->setIndicatorOutlineColor(QColor(0, 0, 0, 255), indicatorNumber); // only alpha part is used
|
qsci->setIndicatorOutlineColor(QColor(0, 0, 0, 255), indicatorNumber); // only alpha part is used
|
||||||
qsci->setCaretLineBackgroundColor(Qt::white);
|
qsci->setCaretLineBackgroundColor(Qt::white);
|
||||||
qsci->setWhitespaceBackgroundColor(Qt::white);
|
|
||||||
qsci->setWhitespaceForegroundColor(Qt::black);
|
qsci->setWhitespaceForegroundColor(Qt::black);
|
||||||
qsci->setMarginsBackgroundColor(Qt::white);
|
qsci->setMarginsBackgroundColor(Qt::white);
|
||||||
qsci->setMarginsForegroundColor(Qt::black);
|
qsci->setMarginsForegroundColor(Qt::black);
|
||||||
|
|
|
@ -121,6 +121,7 @@ Visitor::~Visitor()
|
||||||
* external settings file. The second value is the display value that
|
* external settings file. The second value is the display value that
|
||||||
* can be translated.
|
* can be translated.
|
||||||
*/
|
*/
|
||||||
|
SettingsEntry Settings::showWarningsIn3dView("3dview", "showWarningsIn3dView", Value(true), Value(true));
|
||||||
SettingsEntry Settings::indentationWidth("editor", "indentationWidth", Value(Value::RangeType(1, 16)), Value(4));
|
SettingsEntry Settings::indentationWidth("editor", "indentationWidth", Value(Value::RangeType(1, 16)), Value(4));
|
||||||
SettingsEntry Settings::tabWidth("editor", "tabWidth", Value(Value::RangeType(1, 16)), Value(8));
|
SettingsEntry Settings::tabWidth("editor", "tabWidth", Value(Value::RangeType(1, 16)), Value(8));
|
||||||
SettingsEntry Settings::lineWrap("editor", "lineWrap", values("None", _("None"), "Char", _("Wrap at character boundaries"), "Word", _("Wrap at word boundaries")), Value("Word"));
|
SettingsEntry Settings::lineWrap("editor", "lineWrap", values("None", _("None"), "Char", _("Wrap at character boundaries"), "Word", _("Wrap at word boundaries")), Value("Word"));
|
||||||
|
|
|
@ -35,6 +35,7 @@ protected:
|
||||||
class Settings
|
class Settings
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
static SettingsEntry showWarningsIn3dView;
|
||||||
static SettingsEntry indentationWidth;
|
static SettingsEntry indentationWidth;
|
||||||
static SettingsEntry tabWidth;
|
static SettingsEntry tabWidth;
|
||||||
static SettingsEntry lineWrap;
|
static SettingsEntry lineWrap;
|
||||||
|
|