From d30775a5c0c2c08b63786cf56ef6955cfa61adaa Mon Sep 17 00:00:00 2001 From: don bright Date: Wed, 18 Jul 2012 02:23:37 -0500 Subject: [PATCH 01/13] create bsd build scripts for freebsd 9. --- scripts/freebsd-build-dependencies.sh | 16 ++++++++++++++++ scripts/linux-build-dependencies.sh | 8 +++++++- scripts/setenv-freebsdbuild.sh | 6 ++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100755 scripts/freebsd-build-dependencies.sh create mode 100644 scripts/setenv-freebsdbuild.sh diff --git a/scripts/freebsd-build-dependencies.sh b/scripts/freebsd-build-dependencies.sh new file mode 100755 index 00000000..459d2400 --- /dev/null +++ b/scripts/freebsd-build-dependencies.sh @@ -0,0 +1,16 @@ +#!/bin/sh -e + +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 diff --git a/scripts/linux-build-dependencies.sh b/scripts/linux-build-dependencies.sh index 36dc2ee9..bc1e74d7 100755 --- a/scripts/linux-build-dependencies.sh +++ b/scripts/linux-build-dependencies.sh @@ -188,12 +188,18 @@ build_opencsg() sed -ibak s/"\-lXmu"/"\-L\/usr\/lib64\/libXmu.so.6"/ src/Makefile fi + if [ `uname | grep FreeBSD` ]; then + sed -ibak s/X11R6/local/g src/Makefile + fi + if [ "`command -v qmake-qt4`" ]; then qmake-qt4 else qmake fi + make + cp -av lib/* $DEPLOYDIR/lib cp -av include/* $DEPLOYDIR/include } @@ -235,7 +241,7 @@ if [ ! $NUMCPU ]; then fi if [ ! -d $BASEDIR/bin ]; then - mkdir --parents $BASEDIR/bin + mkdir -p $BASEDIR/bin fi echo "Using basedir:" $BASEDIR diff --git a/scripts/setenv-freebsdbuild.sh b/scripts/setenv-freebsdbuild.sh new file mode 100644 index 00000000..49f17832 --- /dev/null +++ b/scripts/setenv-freebsdbuild.sh @@ -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 From 8e3f3102f5be8042726253a7059495763042584f Mon Sep 17 00:00:00 2001 From: don bright Date: Wed, 18 Jul 2012 02:35:02 -0500 Subject: [PATCH 02/13] indicate which freebsd tested on --- scripts/freebsd-build-dependencies.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/freebsd-build-dependencies.sh b/scripts/freebsd-build-dependencies.sh index 459d2400..1bbca420 100755 --- a/scripts/freebsd-build-dependencies.sh +++ b/scripts/freebsd-build-dependencies.sh @@ -1,5 +1,7 @@ #!/bin/sh -e +echo "Tested on FreeBSD 9. Not guaranteed to work on older" + OPENSCADDIR=$PWD if [ ! -f $OPENSCADDIR/openscad.pro ]; then echo "Must be run from the OpenSCAD source root directory" From 255190589527a6dbe4a6ef26f39abb126d348649 Mon Sep 17 00:00:00 2001 From: don bright Date: Fri, 20 Jul 2012 21:55:14 -0500 Subject: [PATCH 03/13] fix OpenCSG Warning bug where slots were not connected --- src/OpenCSGWarningDialog.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OpenCSGWarningDialog.cc b/src/OpenCSGWarningDialog.cc index 56485760..926a55b7 100644 --- a/src/OpenCSGWarningDialog.cc +++ b/src/OpenCSGWarningDialog.cc @@ -8,12 +8,12 @@ OpenCSGWarningDialog::OpenCSGWarningDialog(QWidget*) connect(this->showBox, SIGNAL(toggled(bool)), Preferences::inst()->openCSGWarningBox, SLOT(setChecked(bool))); connect(this->showBox, SIGNAL(toggled(bool)), - Preferences::inst(), SLOT(openCSGWarningChanged(bool))); + Preferences::inst(), SLOT(on_openCSGWarningBox_toggled(bool))); connect(this->enableOpenCSGBox, SIGNAL(toggled(bool)), Preferences::inst()->enableOpenCSGBox, SLOT(setChecked(bool))); connect(this->enableOpenCSGBox, SIGNAL(toggled(bool)), - Preferences::inst(), SLOT(enableOpenCSGChanged(bool))); + Preferences::inst(), SLOT(on_enableOpenCSGBox_toggled(bool))); } void OpenCSGWarningDialog::setText(const QString &text) From e501bdd222dab12c92bb160876715ef2a140e68a Mon Sep 17 00:00:00 2001 From: don bright Date: Sun, 22 Jul 2012 16:39:22 -0500 Subject: [PATCH 04/13] improve usage on PCBSD --- scripts/freebsd-build-dependencies.sh | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/scripts/freebsd-build-dependencies.sh b/scripts/freebsd-build-dependencies.sh index 1bbca420..dec99c02 100755 --- a/scripts/freebsd-build-dependencies.sh +++ b/scripts/freebsd-build-dependencies.sh @@ -1,6 +1,16 @@ -#!/bin/sh -e +#!/usr/local/bin/bash -e -echo "Tested on FreeBSD 9. Not guaranteed to work on older" +echo "Tested on FreeBSD 9. Please see README.md for info on older systems." + +if [ "`pkg_info | grep -i cgal | echo hi`" ]; 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 From 36d2515282ffc2909f650cf5a4c3b5af34cc6599 Mon Sep 17 00:00:00 2001 From: don bright Date: Sun, 22 Jul 2012 16:42:33 -0500 Subject: [PATCH 05/13] remove debug line --- scripts/freebsd-build-dependencies.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/freebsd-build-dependencies.sh b/scripts/freebsd-build-dependencies.sh index dec99c02..4ea61de2 100755 --- a/scripts/freebsd-build-dependencies.sh +++ b/scripts/freebsd-build-dependencies.sh @@ -2,7 +2,7 @@ echo "Tested on FreeBSD 9. Please see README.md for info on older systems." -if [ "`pkg_info | grep -i cgal | echo hi`" ]; then +if [ "`pkg_info | grep -i cgal `" ]; then echo Stopping. Please remove any CGAL packages you have installed and restart exit fi From 3c7a85af570e5609f4a6625e06410f31fa4d4f0f Mon Sep 17 00:00:00 2001 From: don bright Date: Sun, 22 Jul 2012 20:16:37 -0500 Subject: [PATCH 06/13] debugging and rearranging to find issue --- src/Preferences.cc | 34 ++++++++++++++++++++++++++++++++++ src/editor.cc | 41 +++++++++++++++++++++++++++++++++++++++++ src/editor.h | 4 ++-- src/mainwin.cc | 3 +++ 4 files changed, 80 insertions(+), 2 deletions(-) diff --git a/src/Preferences.cc b/src/Preferences.cc index 802c50ca..d1324d43 100644 --- a/src/Preferences.cc +++ b/src/Preferences.cc @@ -55,17 +55,33 @@ Preferences::Preferences(QWidget *parent) : QMainWindow(parent) this->defaultmap["editor/fontfamily"] = found_family; this->defaultmap["editor/fontsize"] = 12; + uint savedsize = getValue("editor/fontsize").toUInt(); + +// disconnect(this->fontSize, SIGNAL(currentIndexChanged(const QString&)),0,0); +// this, SLOT(on_fontSize_editTextChanged(const QString &))); +#include + std::cout << "pref constructor: savedsize" << savedsize << "\n"; QFontDatabase db; foreach(uint size, db.standardSizes()) { + std::cout << "pref iterate standard sizes" << size << "\n"; + std::cout <<"fontsize->additem started\n"; this->fontSize->addItem(QString::number(size)); + std::cout <<"fontsize->additem completed\n"; if (size == savedsize) { + std::cout << "pref iterate standard sizes - size=savedsize, set index" << this->fontSize->count() - 1 << "\n"; this->fontSize->setCurrentIndex(this->fontSize->count()-1); } } + + std::cout << "connect fontsize to onfontsize_edittextchanged\n"; connect(this->fontSize, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(on_fontSize_editTextChanged(const QString &))); + std::cout << "connect fontsize to onfontsize_edittextchanged done \n"; + + std::cout << "pref constr: setedtext\n"; + this->fontSize->setEditText( QString("%1").arg( savedsize ) ); // Setup default settings this->defaultmap["3dview/colorscheme"] = this->colorSchemeChooser->currentItem()->text(); @@ -164,14 +180,20 @@ void Preferences::on_colorSchemeChooser_itemSelectionChanged() void Preferences::on_fontChooser_activated(const QString &family) { + std::cout << "on fontchooser activated\n"; QSettings settings; settings.setValue("editor/fontfamily", family); + std::cout << "emitting fontchanged " << getValue("editor/fontsize").toString().toStdString() << "\n"; emit fontChanged(family, getValue("editor/fontsize").toUInt()); } void Preferences::on_fontSize_editTextChanged(const QString &size) { + /// size can be wrong. ignore it. + std::cout << "on fontsize edittextchanged. set settings: " << size.toStdString() << "\n"; uint intsize = size.toUInt(); + std::cout << "on fontsize edittextchanged. intsize: " << intsize << "\n"; + std::cout << "on fontisze edittextchanged. othsize" << fontSize->currentText().toStdString() << "\n"; QSettings settings; settings.setValue("editor/fontsize", intsize); emit fontChanged(getValue("editor/fontfamily").toString(), intsize); @@ -251,6 +273,11 @@ void Preferences::removeDefaultSettings() QVariant Preferences::getValue(const QString &key) const { QSettings settings; +#include + std::cout << "prefs: getvalue of key: " << key.toStdString() << "\n"; + std::cout << "prefs: settings.contains key: " << settings.contains(key) << "\n"; + std::cout << "prefs: settings[key]: " << settings.value(key).toString().toStdString() << "\n"; + std::cout << "prefs: defaultmap" << this->defaultmap[key].toString().toStdString() << "\n"; assert(settings.contains(key) || this->defaultmap.contains(key)); return settings.value(key, this->defaultmap[key]); } @@ -263,20 +290,25 @@ void Preferences::updateGUI() Qt::MatchExactly); if (!found.isEmpty()) this->colorSchemeChooser->setCurrentItem(found.first()); +#include QString fontfamily = getValue("editor/fontfamily").toString(); int fidx = this->fontChooser->findText(fontfamily,Qt::MatchContains); if (fidx >= 0) { + std::cout << "font family nofind, set curent index\n"; this->fontChooser->setCurrentIndex(fidx); } QString fontsize = getValue("editor/fontsize").toString(); + std::cout << "updateGUI fontsize:" << fontsize.toStdString() << "\n"; int sidx = this->fontSize->findText(fontsize); if (sidx >= 0) { + std::cout << "font size nofind, set curent index\n"; this->fontSize->setCurrentIndex(sidx); } else { this->fontSize->setEditText(fontsize); } + std::cout << "updateGUI sidx:" << sidx << "\n"; this->openCSGWarningBox->setChecked(getValue("advanced/opencsg_show_warning").toBool()); this->enableOpenCSGBox->setChecked(getValue("advanced/enable_opencsg_opengl1x").toBool()); @@ -288,6 +320,8 @@ void Preferences::updateGUI() void Preferences::apply() const { + std::cout << "Prefs: apply\n"; + std::cout << "editor/fontsize: " << getValue("editor/fontsize").toString().toStdString() << "\n"; emit fontChanged(getValue("editor/fontfamily").toString(), getValue("editor/fontsize").toUInt()); emit requestRedraw(); emit openCSGSettingsChanged(); diff --git a/src/editor.cc b/src/editor.cc index 44825585..5cf5b420 100644 --- a/src/editor.cc +++ b/src/editor.cc @@ -1,4 +1,7 @@ #include "editor.h" +#include "Preferences.h" + +#include #ifndef _QCODE_EDIT_ void Editor::indentSelection() @@ -70,4 +73,42 @@ void Editor::uncommentSelection() cursor.setPosition(p2, QTextCursor::KeepAnchor); setTextCursor(cursor); } + +void Editor::zoomIn() +{ + // We have the fontsize in two places. one, in the in-memory window font + // information that the user sees on the screen, and two, in the + // settings which are persistent on disk. Here we make sure they are + // in sync - we assume the fontsize from the in-memory window to be accurate, + // and trust that there is code elsewhere in OpenSCAD that has initialized + // it properly. We update the on-disk Settings with whatever is in the window. + // + // And of course we increment by one before we do all this. + // See also QT's implementation of QEditor + QSettings settings; + QFont tmp_font = this->font() ; + std::cout << "in fontsize cur" << tmp_font.pointSize() << "\n"; + if ( font().pointSize() >= 1 ) + tmp_font.setPointSize( 1 + font().pointSize() ); + else + tmp_font.setPointSize( 1 ); + std::cout << "in new fontsize cur" << tmp_font.pointSize() << "\n"; + settings.setValue("editor/fontsize", tmp_font.pointSize()); + this->setFont( tmp_font ); +} + +void Editor::zoomOut() +{ + QSettings settings; + QFont tmp_font = this->font(); + std::cout << "out fontsize cur" << tmp_font.pointSize() << "\n"; + if ( font().pointSize() >= 2 ) + tmp_font.setPointSize( -1 + font().pointSize() ); + else + tmp_font.setPointSize( 1 ); + std::cout << "out new fontsize cur" << tmp_font.pointSize() << "\n"; + settings.setValue("editor/fontsize", tmp_font.pointSize()); + this->setFont( tmp_font ); +} + #endif diff --git a/src/editor.h b/src/editor.h index 3088d20a..f39c0670 100644 --- a/src/editor.h +++ b/src/editor.h @@ -18,12 +18,12 @@ public: void setPlainText(const QString& text) { setText(text); } public slots: //void zoomIn() { zoom(1); } - void zoomIn(int n = 1) { zoom(n); } //void zoomOut() { zoom(-1); } - void zoomOut(int n = 1) { zoom(-n); } #else Editor(QWidget *parent) : QTextEdit(parent) { setAcceptRichText(false); } public slots: + void zoomIn(); + void zoomOut(); void setLineWrapping(bool on) { if(on) setWordWrapMode(QTextOption::WrapAnywhere); } void setContentModified(bool y) { document()->setModified(y); } bool isContentModified() { return document()->isModified(); } diff --git a/src/mainwin.cc b/src/mainwin.cc index 3fdee6b4..7c4738cc 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -1822,6 +1822,9 @@ MainWindow::preferences() void MainWindow::setFont(const QString &family, uint size) { +#include + std::cout << "mainwin setFont\n"; + std::cout << "pref size: " << Preferences::inst()->getValue("editor/fontsize").toUInt() << "\n"; QFont font; if (!family.isEmpty()) font.setFamily(family); else font.setFixedPitch(true); From b33a02b372cb1efff5bf6b177a2360e5d5ba87b3 Mon Sep 17 00:00:00 2001 From: don bright Date: Sun, 22 Jul 2012 20:45:12 -0500 Subject: [PATCH 07/13] remove debugging statements --- src/Preferences.cc | 33 +-------------------------------- src/editor.cc | 16 +--------------- src/editor.h | 2 ++ src/mainwin.cc | 3 --- 4 files changed, 4 insertions(+), 50 deletions(-) diff --git a/src/Preferences.cc b/src/Preferences.cc index d1324d43..e70a2a16 100644 --- a/src/Preferences.cc +++ b/src/Preferences.cc @@ -55,32 +55,19 @@ Preferences::Preferences(QWidget *parent) : QMainWindow(parent) this->defaultmap["editor/fontfamily"] = found_family; this->defaultmap["editor/fontsize"] = 12; - uint savedsize = getValue("editor/fontsize").toUInt(); - -// disconnect(this->fontSize, SIGNAL(currentIndexChanged(const QString&)),0,0); -// this, SLOT(on_fontSize_editTextChanged(const QString &))); -#include - std::cout << "pref constructor: savedsize" << savedsize << "\n"; QFontDatabase db; foreach(uint size, db.standardSizes()) { - std::cout << "pref iterate standard sizes" << size << "\n"; - std::cout <<"fontsize->additem started\n"; this->fontSize->addItem(QString::number(size)); - std::cout <<"fontsize->additem completed\n"; if (size == savedsize) { - std::cout << "pref iterate standard sizes - size=savedsize, set index" << this->fontSize->count() - 1 << "\n"; this->fontSize->setCurrentIndex(this->fontSize->count()-1); } } - - std::cout << "connect fontsize to onfontsize_edittextchanged\n"; connect(this->fontSize, SIGNAL(currentIndexChanged(const QString&)), this, SLOT(on_fontSize_editTextChanged(const QString &))); - std::cout << "connect fontsize to onfontsize_edittextchanged done \n"; - std::cout << "pref constr: setedtext\n"; + // reset GUI fontsize if fontSize->addItem emitted signals that changed it. this->fontSize->setEditText( QString("%1").arg( savedsize ) ); // Setup default settings @@ -180,20 +167,14 @@ void Preferences::on_colorSchemeChooser_itemSelectionChanged() void Preferences::on_fontChooser_activated(const QString &family) { - std::cout << "on fontchooser activated\n"; QSettings settings; settings.setValue("editor/fontfamily", family); - std::cout << "emitting fontchanged " << getValue("editor/fontsize").toString().toStdString() << "\n"; emit fontChanged(family, getValue("editor/fontsize").toUInt()); } void Preferences::on_fontSize_editTextChanged(const QString &size) { - /// size can be wrong. ignore it. - std::cout << "on fontsize edittextchanged. set settings: " << size.toStdString() << "\n"; uint intsize = size.toUInt(); - std::cout << "on fontsize edittextchanged. intsize: " << intsize << "\n"; - std::cout << "on fontisze edittextchanged. othsize" << fontSize->currentText().toStdString() << "\n"; QSettings settings; settings.setValue("editor/fontsize", intsize); emit fontChanged(getValue("editor/fontfamily").toString(), intsize); @@ -273,11 +254,6 @@ void Preferences::removeDefaultSettings() QVariant Preferences::getValue(const QString &key) const { QSettings settings; -#include - std::cout << "prefs: getvalue of key: " << key.toStdString() << "\n"; - std::cout << "prefs: settings.contains key: " << settings.contains(key) << "\n"; - std::cout << "prefs: settings[key]: " << settings.value(key).toString().toStdString() << "\n"; - std::cout << "prefs: defaultmap" << this->defaultmap[key].toString().toStdString() << "\n"; assert(settings.contains(key) || this->defaultmap.contains(key)); return settings.value(key, this->defaultmap[key]); } @@ -290,25 +266,20 @@ void Preferences::updateGUI() Qt::MatchExactly); if (!found.isEmpty()) this->colorSchemeChooser->setCurrentItem(found.first()); -#include QString fontfamily = getValue("editor/fontfamily").toString(); int fidx = this->fontChooser->findText(fontfamily,Qt::MatchContains); if (fidx >= 0) { - std::cout << "font family nofind, set curent index\n"; this->fontChooser->setCurrentIndex(fidx); } QString fontsize = getValue("editor/fontsize").toString(); - std::cout << "updateGUI fontsize:" << fontsize.toStdString() << "\n"; int sidx = this->fontSize->findText(fontsize); if (sidx >= 0) { - std::cout << "font size nofind, set curent index\n"; this->fontSize->setCurrentIndex(sidx); } else { this->fontSize->setEditText(fontsize); } - std::cout << "updateGUI sidx:" << sidx << "\n"; this->openCSGWarningBox->setChecked(getValue("advanced/opencsg_show_warning").toBool()); this->enableOpenCSGBox->setChecked(getValue("advanced/enable_opencsg_opengl1x").toBool()); @@ -320,8 +291,6 @@ void Preferences::updateGUI() void Preferences::apply() const { - std::cout << "Prefs: apply\n"; - std::cout << "editor/fontsize: " << getValue("editor/fontsize").toString().toStdString() << "\n"; emit fontChanged(getValue("editor/fontfamily").toString(), getValue("editor/fontsize").toUInt()); emit requestRedraw(); emit openCSGSettingsChanged(); diff --git a/src/editor.cc b/src/editor.cc index 5cf5b420..f237c2e5 100644 --- a/src/editor.cc +++ b/src/editor.cc @@ -1,8 +1,6 @@ #include "editor.h" #include "Preferences.h" -#include - #ifndef _QCODE_EDIT_ void Editor::indentSelection() { @@ -76,23 +74,13 @@ void Editor::uncommentSelection() void Editor::zoomIn() { - // We have the fontsize in two places. one, in the in-memory window font - // information that the user sees on the screen, and two, in the - // settings which are persistent on disk. Here we make sure they are - // in sync - we assume the fontsize from the in-memory window to be accurate, - // and trust that there is code elsewhere in OpenSCAD that has initialized - // it properly. We update the on-disk Settings with whatever is in the window. - // - // And of course we increment by one before we do all this. - // See also QT's implementation of QEditor + // See also QT's implementation of QEditor. QSettings settings; QFont tmp_font = this->font() ; - std::cout << "in fontsize cur" << tmp_font.pointSize() << "\n"; if ( font().pointSize() >= 1 ) tmp_font.setPointSize( 1 + font().pointSize() ); else tmp_font.setPointSize( 1 ); - std::cout << "in new fontsize cur" << tmp_font.pointSize() << "\n"; settings.setValue("editor/fontsize", tmp_font.pointSize()); this->setFont( tmp_font ); } @@ -101,12 +89,10 @@ void Editor::zoomOut() { QSettings settings; QFont tmp_font = this->font(); - std::cout << "out fontsize cur" << tmp_font.pointSize() << "\n"; if ( font().pointSize() >= 2 ) tmp_font.setPointSize( -1 + font().pointSize() ); else tmp_font.setPointSize( 1 ); - std::cout << "out new fontsize cur" << tmp_font.pointSize() << "\n"; settings.setValue("editor/fontsize", tmp_font.pointSize()); this->setFont( tmp_font ); } diff --git a/src/editor.h b/src/editor.h index f39c0670..509cf24f 100644 --- a/src/editor.h +++ b/src/editor.h @@ -18,7 +18,9 @@ public: void setPlainText(const QString& text) { setText(text); } public slots: //void zoomIn() { zoom(1); } + void zoomIn(int n = 1) { zoom(n); } //void zoomOut() { zoom(-1); } + void zoomOut(int n = 1) { zoom(-n); } #else Editor(QWidget *parent) : QTextEdit(parent) { setAcceptRichText(false); } public slots: diff --git a/src/mainwin.cc b/src/mainwin.cc index 7c4738cc..3fdee6b4 100644 --- a/src/mainwin.cc +++ b/src/mainwin.cc @@ -1822,9 +1822,6 @@ MainWindow::preferences() void MainWindow::setFont(const QString &family, uint size) { -#include - std::cout << "mainwin setFont\n"; - std::cout << "pref size: " << Preferences::inst()->getValue("editor/fontsize").toUInt() << "\n"; QFont font; if (!family.isEmpty()) font.setFamily(family); else font.setFixedPitch(true); From 86b5fc02f59626df5e627e6cefac5be03c199385 Mon Sep 17 00:00:00 2001 From: don bright Date: Sun, 22 Jul 2012 20:56:01 -0500 Subject: [PATCH 08/13] on control + mousewheel, zoomin/zoomout text (like firefox, IE, etc) --- src/editor.cc | 10 ++++++++++ src/editor.h | 3 +++ 2 files changed, 13 insertions(+) diff --git a/src/editor.cc b/src/editor.cc index f237c2e5..5282677c 100644 --- a/src/editor.cc +++ b/src/editor.cc @@ -97,4 +97,14 @@ void Editor::zoomOut() 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 diff --git a/src/editor.h b/src/editor.h index 509cf24f..bb338b07 100644 --- a/src/editor.h +++ b/src/editor.h @@ -1,6 +1,7 @@ #include #include #include +#include #ifdef _QCODE_EDIT_ #include @@ -33,5 +34,7 @@ public slots: void unindentSelection(); void commentSelection(); void uncommentSelection(); +private: + void wheelEvent ( QWheelEvent * event ); #endif }; From 7f643121725540bc9f6e41142446cf09f317f0a1 Mon Sep 17 00:00:00 2001 From: don bright Date: Sun, 22 Jul 2012 20:58:07 -0500 Subject: [PATCH 09/13] clarify comment --- src/editor.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/editor.cc b/src/editor.cc index 5282677c..bba8d4fe 100644 --- a/src/editor.cc +++ b/src/editor.cc @@ -74,7 +74,7 @@ void Editor::uncommentSelection() void Editor::zoomIn() { - // See also QT's implementation of QEditor. + // See also QT's implementation in QEditor.cpp QSettings settings; QFont tmp_font = this->font() ; if ( font().pointSize() >= 1 ) From 354aa17feeec0e3a311d804534812050520186bd Mon Sep 17 00:00:00 2001 From: don bright Date: Sun, 22 Jul 2012 22:16:52 -0500 Subject: [PATCH 10/13] add git clone info to README.md , for openscad and MCAD --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 9da63861..6dfd821c 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,20 @@ Follow the instructions for the platform you're compiling on below. * [Bison (2.4)](http://www.gnu.org/software/bison/) * [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 First, make sure that you have XCode installed to get GCC. Then after From 1d40052f82ac50d70914c9abad2c8ada1837a83b Mon Sep 17 00:00:00 2001 From: don bright Date: Sun, 22 Jul 2012 22:19:42 -0500 Subject: [PATCH 11/13] remove opencsg code that belongs in another branch --- src/OpenCSGWarningDialog.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/OpenCSGWarningDialog.cc b/src/OpenCSGWarningDialog.cc index 926a55b7..1ed92171 100644 --- a/src/OpenCSGWarningDialog.cc +++ b/src/OpenCSGWarningDialog.cc @@ -8,12 +8,12 @@ OpenCSGWarningDialog::OpenCSGWarningDialog(QWidget*) connect(this->showBox, SIGNAL(toggled(bool)), Preferences::inst()->openCSGWarningBox, SLOT(setChecked(bool))); connect(this->showBox, SIGNAL(toggled(bool)), - Preferences::inst(), SLOT(on_openCSGWarningBox_toggled(bool))); + Preferences::inst(), SLOT(enableOpenCSGChanged(bool))); connect(this->enableOpenCSGBox, SIGNAL(toggled(bool)), Preferences::inst()->enableOpenCSGBox, SLOT(setChecked(bool))); connect(this->enableOpenCSGBox, SIGNAL(toggled(bool)), - Preferences::inst(), SLOT(on_enableOpenCSGBox_toggled(bool))); + Preferences::inst(), SLOT(enableOpenCSGChanged(bool))); } void OpenCSGWarningDialog::setText(const QString &text) From 54c7cb2422ee59fa456b1d152f2461afea8dfacf Mon Sep 17 00:00:00 2001 From: don bright Date: Sun, 22 Jul 2012 22:20:40 -0500 Subject: [PATCH 12/13] remove code that belongs in another branch --- src/OpenCSGWarningDialog.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/OpenCSGWarningDialog.cc b/src/OpenCSGWarningDialog.cc index 1ed92171..56485760 100644 --- a/src/OpenCSGWarningDialog.cc +++ b/src/OpenCSGWarningDialog.cc @@ -8,7 +8,7 @@ OpenCSGWarningDialog::OpenCSGWarningDialog(QWidget*) connect(this->showBox, SIGNAL(toggled(bool)), Preferences::inst()->openCSGWarningBox, SLOT(setChecked(bool))); connect(this->showBox, SIGNAL(toggled(bool)), - Preferences::inst(), SLOT(enableOpenCSGChanged(bool))); + Preferences::inst(), SLOT(openCSGWarningChanged(bool))); connect(this->enableOpenCSGBox, SIGNAL(toggled(bool)), Preferences::inst()->enableOpenCSGBox, SLOT(setChecked(bool))); From 54bf1cf7d9e93c37d61b574973c20677ad389299 Mon Sep 17 00:00:00 2001 From: don bright Date: Sun, 22 Jul 2012 22:43:16 -0500 Subject: [PATCH 13/13] update README.md lines to look better on github.com --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 9da63861..ec8caf31 100644 --- a/README.md +++ b/README.md @@ -124,9 +124,9 @@ Then after you've cloned this git repository, use a package manager to download packages for the dependency libraries listed above. Convenience scripts are provided for some popular systems: -Ubuntu, Debian: ./scripts/ubuntu-build-dependencies.sh -OpenSUSE: ./scripts/opensuse-build-dependencies.sh -Fedora, Redhat: ./scripts/fedora-build-dependencies.sh + Ubuntu, Debian: ./scripts/ubuntu-build-dependencies.sh + OpenSUSE: ./scripts/opensuse-build-dependencies.sh + Fedora: ./scripts/fedora-build-dependencies.sh Check your library versions to make sure they meet the minimum requirements listed above. After that follow the Compilation