Merge branch 'master' of github.com:openscad/openscad

Conflicts:
	scripts/linux-build-dependencies.sh
felipesanches-svg
Marius Kintel 2012-07-23 22:43:43 -04:00
commit f1634d545d
7 changed files with 102 additions and 4 deletions

View File

@ -97,6 +97,20 @@ Follow the instructions for the platform you're compiling on below.
* [Bison (2.4)](http://www.gnu.org/software/bison/) * [Bison (2.4)](http://www.gnu.org/software/bison/)
* [Flex (2.5.35)](http://flex.sourceforge.net/) * [Flex (2.5.35)](http://flex.sourceforge.net/)
### Getting the source code
Install git (http://git-scm.com/) onto your system. Then run a clone:
git clone git://github.com/openscad/openscad.git
This will download the latest sources into a directory named 'openscad'.
To pull the MCAD library (http://reprap.org/wiki/MCAD), do the following:
cd openscad
git submodule init
git submodule update
### Building for Mac OS X ### Building for Mac OS X
First, make sure that you have XCode installed to get GCC. Then after First, make sure that you have XCode installed to get GCC. Then after
@ -124,9 +138,9 @@ Then after you've cloned this git repository, use a package manager to
download packages for the dependency libraries listed above. Convenience download packages for the dependency libraries listed above. Convenience
scripts are provided for some popular systems: scripts are provided for some popular systems:
Ubuntu, Debian: ./scripts/ubuntu-build-dependencies.sh Ubuntu, Debian: ./scripts/ubuntu-build-dependencies.sh
OpenSUSE: ./scripts/opensuse-build-dependencies.sh OpenSUSE: ./scripts/opensuse-build-dependencies.sh
Fedora, Redhat: ./scripts/fedora-build-dependencies.sh Fedora: ./scripts/fedora-build-dependencies.sh
Check your library versions to make sure they meet the minimum Check your library versions to make sure they meet the minimum
requirements listed above. After that follow the Compilation requirements listed above. After that follow the Compilation

View File

@ -0,0 +1,28 @@
#!/usr/local/bin/bash -e
echo "Tested on FreeBSD 9. Please see README.md for info on older systems."
if [ "`pkg_info | grep -i cgal `" ]; then
echo Stopping. Please remove any CGAL packages you have installed and restart
exit
fi
if [ "`pkg_info | grep -i opencsg`" ]; then
echo Stopping. Please remove any OpenCSG packages you have installed and restart
exit
fi
OPENSCADDIR=$PWD
if [ ! -f $OPENSCADDIR/openscad.pro ]; then
echo "Must be run from the OpenSCAD source root directory"
exit 0
fi
. ./scripts/setenv-freebsdbuild.sh
pkg_add -r bison boost-libs cmake git bash eigen2 flex gmake gmp mpfr
pkg_add -r xorg libGLU libXmu libXi xorg-vfbserver glew
pkg_add -r qt4-corelib qt4-gui qt4-moc qt4-opengl qt4-qmake qt4-rcc qt4-uic
BASEDIR=/usr/local ./scripts/linux-build-dependencies.sh cgal-use-sys-libs
BASEDIR=/usr/local ./scripts/linux-build-dependencies.sh opencsg

View File

@ -207,6 +207,10 @@ build_opencsg()
fi fi
fi fi
if [ `uname | grep FreeBSD` ]; then
sed -ibak s/X11R6/local/g src/Makefile
fi
if [ "`command -v qmake-qt4`" ]; then if [ "`command -v qmake-qt4`" ]; then
OPENCSG_QMAKE=qmake-qt4 OPENCSG_QMAKE=qmake-qt4
else else
@ -225,6 +229,7 @@ build_opencsg()
fi fi
make make
cp -av lib/* $DEPLOYDIR/lib cp -av lib/* $DEPLOYDIR/lib
cp -av include/* $DEPLOYDIR/include cp -av include/* $DEPLOYDIR/include
cd $OPENSCADDIR cd $OPENSCADDIR
@ -267,7 +272,7 @@ if [ ! $NUMCPU ]; then
fi fi
if [ ! -d $BASEDIR/bin ]; then if [ ! -d $BASEDIR/bin ]; then
mkdir --parents $BASEDIR/bin mkdir -p $BASEDIR/bin
fi fi
echo "Using basedir:" $BASEDIR echo "Using basedir:" $BASEDIR

View File

@ -0,0 +1,6 @@
# run with '. ./scripts/setenv-freebsdbuild.sh'
# use in conjuction with freebsd-build-dependencies.sh
QMAKESPEC=freebsd-g++
QTDIR=/usr/local/share/qt4

View File

@ -67,6 +67,9 @@ Preferences::Preferences(QWidget *parent) : QMainWindow(parent)
connect(this->fontSize, SIGNAL(currentIndexChanged(const QString&)), connect(this->fontSize, SIGNAL(currentIndexChanged(const QString&)),
this, SLOT(on_fontSize_editTextChanged(const QString &))); this, SLOT(on_fontSize_editTextChanged(const QString &)));
// reset GUI fontsize if fontSize->addItem emitted signals that changed it.
this->fontSize->setEditText( QString("%1").arg( savedsize ) );
// Setup default settings // Setup default settings
this->defaultmap["3dview/colorscheme"] = this->colorSchemeChooser->currentItem()->text(); this->defaultmap["3dview/colorscheme"] = this->colorSchemeChooser->currentItem()->text();
this->defaultmap["advanced/opencsg_show_warning"] = true; this->defaultmap["advanced/opencsg_show_warning"] = true;

View File

@ -1,4 +1,5 @@
#include "editor.h" #include "editor.h"
#include "Preferences.h"
#ifndef _QCODE_EDIT_ #ifndef _QCODE_EDIT_
void Editor::indentSelection() void Editor::indentSelection()
@ -70,4 +71,40 @@ void Editor::uncommentSelection()
cursor.setPosition(p2, QTextCursor::KeepAnchor); cursor.setPosition(p2, QTextCursor::KeepAnchor);
setTextCursor(cursor); setTextCursor(cursor);
} }
void Editor::zoomIn()
{
// See also QT's implementation in QEditor.cpp
QSettings settings;
QFont tmp_font = this->font() ;
if ( font().pointSize() >= 1 )
tmp_font.setPointSize( 1 + font().pointSize() );
else
tmp_font.setPointSize( 1 );
settings.setValue("editor/fontsize", tmp_font.pointSize());
this->setFont( tmp_font );
}
void Editor::zoomOut()
{
QSettings settings;
QFont tmp_font = this->font();
if ( font().pointSize() >= 2 )
tmp_font.setPointSize( -1 + font().pointSize() );
else
tmp_font.setPointSize( 1 );
settings.setValue("editor/fontsize", tmp_font.pointSize());
this->setFont( tmp_font );
}
void Editor::wheelEvent ( QWheelEvent * event )
{
if (event->modifiers() == Qt::ControlModifier) {
if (event->delta() > 0 )
zoomIn();
else if (event->delta() < 0 )
zoomOut();
}
}
#endif #endif

View File

@ -1,6 +1,7 @@
#include <QObject> #include <QObject>
#include <QString> #include <QString>
#include <QWidget> #include <QWidget>
#include <QWheelEvent>
#ifdef _QCODE_EDIT_ #ifdef _QCODE_EDIT_
#include <qeditor.h> #include <qeditor.h>
@ -24,6 +25,8 @@ public slots:
#else #else
Editor(QWidget *parent) : QTextEdit(parent) { setAcceptRichText(false); } Editor(QWidget *parent) : QTextEdit(parent) { setAcceptRichText(false); }
public slots: public slots:
void zoomIn();
void zoomOut();
void setLineWrapping(bool on) { if(on) setWordWrapMode(QTextOption::WrapAnywhere); } void setLineWrapping(bool on) { if(on) setWordWrapMode(QTextOption::WrapAnywhere); }
void setContentModified(bool y) { document()->setModified(y); } void setContentModified(bool y) { document()->setModified(y); }
bool isContentModified() { return document()->isModified(); } bool isContentModified() { return document()->isModified(); }
@ -31,5 +34,7 @@ public slots:
void unindentSelection(); void unindentSelection();
void commentSelection(); void commentSelection();
void uncommentSelection(); void uncommentSelection();
private:
void wheelEvent ( QWheelEvent * event );
#endif #endif
}; };