Skip to content

Commit

Permalink
Merge branch 'release/0.9.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
guidotack committed Jul 30, 2015
2 parents 927705d + 846695f commit ca42d60
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 12 deletions.
6 changes: 6 additions & 0 deletions MiniZincIDE/CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2015-07-30
v0.9.9
- Fix for clicking on error messages on Windows
- Fix syntax highlighting, used to turn itself off when saving file
under a different name
- Set default font more consistently on different platforms
2015-07-01
v0.9.8
- Add "dark mode" to change text colours
Expand Down
2 changes: 1 addition & 1 deletion MiniZincIDE/MiniZincIDE.pro
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = MiniZincIDE
TEMPLATE = app

VERSION = 0.9.8
VERSION = 0.9.9
DEFINES += MINIZINC_IDE_VERSION=\\\"$$VERSION\\\"

bundled {
Expand Down
2 changes: 1 addition & 1 deletion MiniZincIDE/codeeditor.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void CodeEditor::setDocument(QTextDocument *document)
QPlainTextEdit::setDocument(document);
if (document) {
QFont f= font();
highlighter = new Highlighter(f,document);
highlighter = new Highlighter(f,darkMode,document);
connect(document, SIGNAL(modificationChanged(bool)), this, SLOT(docChanged(bool)));
}
}
Expand Down
40 changes: 30 additions & 10 deletions MiniZincIDE/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,15 @@ IDE::IDE(int& argc, char* argv[]) : QApplication(argc,argv) {
QSettings settings;
settings.beginGroup("MainWindow");

QFont defaultFont("Courier New");
defaultFont.setStyleHint(QFont::Monospace);
QFont defaultFont;
defaultFont.setFamily("Menlo");
if (!defaultFont.exactMatch()) {
defaultFont.setFamily("Consolas");
}
if (!defaultFont.exactMatch()) {
defaultFont.setFamily("Courier New");
}
defaultFont.setStyleHint(QFont::TypeWriter);
defaultFont.setPointSize(13);
QFont editorFont = settings.value("editorFont", defaultFont).value<QFont>();
bool darkMode = settings.value("darkMode", false).value<bool>();
Expand Down Expand Up @@ -640,8 +647,15 @@ void MainWindow::init(const QString& projectFile)
QSettings settings;
settings.beginGroup("MainWindow");

QFont defaultFont("Courier New");
defaultFont.setStyleHint(QFont::Monospace);
QFont defaultFont;
defaultFont.setFamily("Menlo");
if (!defaultFont.exactMatch()) {
defaultFont.setFamily("Consolas");
}
if (!defaultFont.exactMatch()) {
defaultFont.setFamily("Courier New");
}
defaultFont.setStyleHint(QFont::TypeWriter);
defaultFont.setPointSize(13);
editorFont = settings.value("editorFont", defaultFont).value<QFont>();
darkMode = settings.value("darkMode", false).value<bool>();
Expand Down Expand Up @@ -1189,10 +1203,10 @@ void MainWindow::tabChange(int tab) {
}
if (curEditor->filepath.isEmpty()) {
setWindowFilePath(curEditor->filename);
setWindowTitle(curEditor->filename+p);
setWindowTitle(curEditor->filename+p+"[*]");
} else {
setWindowFilePath(curEditor->filepath);
setWindowTitle(curEditor->filename+p);
setWindowTitle(curEditor->filename+p+"[*]");
}
ui->actionSave->setEnabled(true);
ui->actionSave_as->setEnabled(true);
Expand Down Expand Up @@ -1247,7 +1261,7 @@ void MainWindow::tabChange(int tab) {
QFileInfo fi(projectPath);
p = "Project: "+fi.baseName();
}
setWindowTitle(p);
setWindowTitle(p+"[*]");
}
}
}
Expand Down Expand Up @@ -2144,15 +2158,21 @@ void MainWindow::on_actionAbout_MiniZinc_IDE_triggered()
AboutDialog(IDE::instance()->applicationVersion()).exec();
}

void MainWindow::errorClicked(const QUrl & url)
void MainWindow::errorClicked(const QUrl & anUrl)
{
QUrl url = anUrl;
QString query = url.query();
url.setQuery("");
url.setScheme("file");
QFileInfo urlinfo(url.toLocalFile());
IDE::instance()->stats.errorsClicked++;
for (int i=0; i<ui->tabWidget->count(); i++) {
if (ui->tabWidget->widget(i) != ui->configuration) {
CodeEditor* ce = static_cast<CodeEditor*>(ui->tabWidget->widget(i));
if (ce->filepath == url.path()) {
QFileInfo ceinfo(ce->filepath);
if (ceinfo.canonicalFilePath() == urlinfo.canonicalFilePath()) {
QRegExp re_line("line=([0-9]+)");
if (re_line.indexIn(url.query()) != -1) {
if (re_line.indexIn(query) != -1) {
bool ok;
int line = re_line.cap(1).toInt(&ok);
if (ok) {
Expand Down

0 comments on commit ca42d60

Please sign in to comment.