summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordon bright <hugh.m.bright@gmail.com>2012-07-23 01:45:12 (GMT)
committerdon bright <hugh.m.bright@gmail.com>2012-07-23 01:45:12 (GMT)
commitb33a02b372cb1efff5bf6b177a2360e5d5ba87b3 (patch)
tree52d7fb8428cc0aa9b7e4d90c0986bb47d2a50179
parent3c7a85af570e5609f4a6625e06410f31fa4d4f0f (diff)
remove debugging statements
-rw-r--r--src/Preferences.cc33
-rw-r--r--src/editor.cc16
-rw-r--r--src/editor.h2
-rw-r--r--src/mainwin.cc3
4 files changed, 4 insertions, 50 deletions
diff --git a/src/Preferences.cc b/src/Preferences.cc
index d1324d4..e70a2a1 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 <iostream>
- 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 <iostream>
- 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 <iostream>
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 5cf5b42..f237c2e 100644
--- a/src/editor.cc
+++ b/src/editor.cc
@@ -1,8 +1,6 @@
#include "editor.h"
#include "Preferences.h"
-#include <iostream>
-
#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 f39c067..509cf24 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 7c4738c..3fdee6b 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -1822,9 +1822,6 @@ MainWindow::preferences()
void MainWindow::setFont(const QString &family, uint size)
{
-#include <iostream>
- 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);
contact: Jan Huwald // Impressum