summaryrefslogtreecommitdiff
path: root/src/mainwin.cc
diff options
context:
space:
mode:
authorDon Bright <hugh.m.bright@gmail.com>2013-12-30 00:06:31 (GMT)
committerDon Bright <hugh.m.bright@gmail.com>2013-12-30 00:06:31 (GMT)
commit275f3baa3de6480d622fa61cc0bf77687ca0d1cf (patch)
treedf826a2eaf854b791805229d7082819aac7811d6 /src/mainwin.cc
parent98345828823f1c91860217478858b9943adee9bb (diff)
parentbf193472481d3e708da841d59df5f323e2785db7 (diff)
Merge branch 'master' of github.com:openscad/openscad
Diffstat (limited to 'src/mainwin.cc')
-rw-r--r--src/mainwin.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mainwin.cc b/src/mainwin.cc
index 1ad8bc8..c2a7b7e 100644
--- a/src/mainwin.cc
+++ b/src/mainwin.cc
@@ -369,6 +369,8 @@ MainWindow::MainWindow(const QString &filename)
this, SLOT(setFont(const QString&,uint)));
connect(Preferences::inst(), SIGNAL(openCSGSettingsChanged()),
this, SLOT(openCSGSettingsChanged()));
+ connect(Preferences::inst(), SIGNAL(syntaxHighlightChanged(const QString&)),
+ this, SLOT(setSyntaxHighlight(const QString&)));
Preferences::inst()->apply();
// make sure it looks nice..
@@ -1899,6 +1901,12 @@ void MainWindow::setFont(const QString &family, uint size)
editor->setFont(font);
}
+void MainWindow::setSyntaxHighlight(const QString &s)
+{
+ this->highlighter->assignFormatsToTokens( s );
+ this->highlighter->rehighlight(); // slow on large files
+}
+
void MainWindow::quit()
{
QCloseEvent ev;
contact: Jan Huwald // Impressum