|
@@ -189,10 +189,12 @@ void Fb2MainWindow::documentWasModified()
|
|
if (isWindowModified()) return;
|
|
if (isWindowModified()) return;
|
|
QFileInfo info = windowFilePath();
|
|
QFileInfo info = windowFilePath();
|
|
QString title = info.fileName();
|
|
QString title = info.fileName();
|
|
- if (textEdit && textEdit->isModified()) title += QString("[*]");
|
|
|
|
|
|
+ title += QString("[*]");
|
|
title += QString(" - ") += qApp->applicationName();
|
|
title += QString(" - ") += qApp->applicationName();
|
|
setWindowTitle(title);
|
|
setWindowTitle(title);
|
|
setWindowModified(true);
|
|
setWindowModified(true);
|
|
|
|
+ if (qsciEdit) disconnect(qsciEdit, SIGNAL(textChanged()), this, SLOT(documentWasModified()));
|
|
|
|
+ if (textEdit) disconnect(textEdit->page(), SIGNAL(contentsChanged()), this, SLOT(documentWasModified()));
|
|
}
|
|
}
|
|
|
|
|
|
QIcon Fb2MainWindow::icon(const QString &name)
|
|
QIcon Fb2MainWindow::icon(const QString &name)
|
|
@@ -470,6 +472,7 @@ void Fb2MainWindow::createQsci()
|
|
|
|
|
|
if (qsciEdit) return;
|
|
if (qsciEdit) return;
|
|
qsciEdit = new QsciScintilla;
|
|
qsciEdit = new QsciScintilla;
|
|
|
|
+ qsciEdit->zoomTo(1);
|
|
qsciEdit->setUtf8(true);
|
|
qsciEdit->setUtf8(true);
|
|
qsciEdit->setCaretLineVisible(true);
|
|
qsciEdit->setCaretLineVisible(true);
|
|
qsciEdit->setCaretLineBackgroundColor(QColor("gainsboro"));
|
|
qsciEdit->setCaretLineBackgroundColor(QColor("gainsboro"));
|
|
@@ -507,8 +510,6 @@ void Fb2MainWindow::createQsci()
|
|
|
|
|
|
setCentralWidget(qsciEdit);
|
|
setCentralWidget(qsciEdit);
|
|
qsciEdit->setFocus();
|
|
qsciEdit->setFocus();
|
|
-
|
|
|
|
- // connect(qsciEdit, SIGNAL(textChanged()), this, SLOT(documentWasModified()));
|
|
|
|
}
|
|
}
|
|
|
|
|
|
void Fb2MainWindow::createStatusBar()
|
|
void Fb2MainWindow::createStatusBar()
|
|
@@ -602,6 +603,11 @@ Fb2MainWindow *Fb2MainWindow::findFb2MainWindow(const QString &fileName)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+void Fb2MainWindow::zoomOrig()
|
|
|
|
+{
|
|
|
|
+ if (qsciEdit) qsciEdit->zoomTo(1);
|
|
|
|
+}
|
|
|
|
+
|
|
void Fb2MainWindow::viewQsci()
|
|
void Fb2MainWindow::viewQsci()
|
|
{
|
|
{
|
|
if (centralWidget() == qsciEdit) return;
|
|
if (centralWidget() == qsciEdit) return;
|
|
@@ -610,9 +616,21 @@ void Fb2MainWindow::viewQsci()
|
|
FB2DELETE(textEdit);
|
|
FB2DELETE(textEdit);
|
|
FB2DELETE(dockTree);
|
|
FB2DELETE(dockTree);
|
|
FB2DELETE(headTree);
|
|
FB2DELETE(headTree);
|
|
- FB2DELETE(toolEdit);
|
|
|
|
createQsci();
|
|
createQsci();
|
|
qsciEdit->setText(xml);
|
|
qsciEdit->setText(xml);
|
|
|
|
+
|
|
|
|
+ FB2DELETE(toolEdit);
|
|
|
|
+ QToolBar *tool = toolEdit = addToolBar(tr("Edit"));
|
|
|
|
+ tool->addSeparator();
|
|
|
|
+ tool->addAction(actionZoomIn);
|
|
|
|
+ tool->addAction(actionZoomOut);
|
|
|
|
+ tool->addAction(actionZoomOrig);
|
|
|
|
+ tool->setMovable(false);
|
|
|
|
+
|
|
|
|
+ connect(qsciEdit, SIGNAL(textChanged()), this, SLOT(documentWasModified()));
|
|
|
|
+ connect(actionZoomIn, SIGNAL(triggered()), qsciEdit, SLOT(zoomIn()));
|
|
|
|
+ connect(actionZoomOut, SIGNAL(triggered()), qsciEdit, SLOT(zoomOut()));
|
|
|
|
+ connect(actionZoomOrig, SIGNAL(triggered()), this, SLOT(zoomOrig()));
|
|
}
|
|
}
|
|
|
|
|
|
void Fb2MainWindow::viewText()
|
|
void Fb2MainWindow::viewText()
|
|
@@ -758,10 +776,10 @@ void Fb2MainWindow::viewHead()
|
|
|
|
|
|
FB2DELETE(toolEdit);
|
|
FB2DELETE(toolEdit);
|
|
QToolBar *tool = toolEdit = addToolBar(tr("Edit"));
|
|
QToolBar *tool = toolEdit = addToolBar(tr("Edit"));
|
|
|
|
+ tool->addSeparator();
|
|
tool->addAction(actionInsert);
|
|
tool->addAction(actionInsert);
|
|
tool->addAction(actionDelete);
|
|
tool->addAction(actionDelete);
|
|
tool->setMovable(false);
|
|
tool->setMovable(false);
|
|
- tool->addSeparator();
|
|
|
|
}
|
|
}
|
|
|
|
|
|
void Fb2MainWindow::viewTree()
|
|
void Fb2MainWindow::viewTree()
|