|
@@ -586,13 +586,6 @@ FbMainWindow *FbMainWindow::findFbMainWindow(const QString &fileName)
|
|
|
return 0;
|
|
|
}
|
|
|
/*
|
|
|
-void FbMainWindow::checkScintillaUndo()
|
|
|
-{
|
|
|
- if (!codeEdit) return;
|
|
|
- actionUndo->setEnabled(codeEdit->isUndoAvailable());
|
|
|
- actionRedo->setEnabled(codeEdit->isRedoAvailable());
|
|
|
-}
|
|
|
-
|
|
|
void FbMainWindow::viewText(FbTextPage *page)
|
|
|
{
|
|
|
if (textFrame && centralWidget() == textFrame) return;
|
|
@@ -707,139 +700,6 @@ void FbMainWindow::viewHead()
|
|
|
actionPictures->setEnabled(false);
|
|
|
actionInspect->setEnabled(true);
|
|
|
}
|
|
|
-
|
|
|
-void FbMainWindow::viewCode()
|
|
|
-{
|
|
|
- if (codeEdit && centralWidget() == codeEdit) return;
|
|
|
-
|
|
|
- bool load = false;
|
|
|
- QByteArray xml;
|
|
|
- if (textFrame) {
|
|
|
- textFrame->view()->save(&xml);
|
|
|
- isSwitched = true;
|
|
|
- load = true;
|
|
|
- }
|
|
|
-
|
|
|
- FB2DELETE(textFrame);
|
|
|
- FB2DELETE(dockTree);
|
|
|
- FB2DELETE(dockImgs);
|
|
|
- FB2DELETE(headTree);
|
|
|
-
|
|
|
- if (!codeEdit) {
|
|
|
- codeEdit = new FbCodeEdit;
|
|
|
- }
|
|
|
- if (load) codeEdit->load(xml);
|
|
|
- setCentralWidget(codeEdit);
|
|
|
- codeEdit->setFocus();
|
|
|
-
|
|
|
- FB2DELETE(toolEdit);
|
|
|
- QToolBar *tool = toolEdit = addToolBar(tr("Edit"));
|
|
|
- tool->addSeparator();
|
|
|
- tool->addAction(actionUndo);
|
|
|
- tool->addAction(actionRedo);
|
|
|
- tool->addSeparator();
|
|
|
- tool->addAction(actionCut);
|
|
|
- tool->addAction(actionCopy);
|
|
|
- tool->addAction(actionPaste);
|
|
|
- tool->addSeparator();
|
|
|
- tool->addAction(actionZoomIn);
|
|
|
- tool->addAction(actionZoomOut);
|
|
|
- tool->addAction(actionZoomReset);
|
|
|
- tool->setMovable(false);
|
|
|
-
|
|
|
- connect(codeEdit, SIGNAL(textChanged()), this, SLOT(documentWasModified()));
|
|
|
- connect(codeEdit, SIGNAL(textChanged()), this, SLOT(checkScintillaUndo()));
|
|
|
-
|
|
|
- connect(codeEdit, SIGNAL(copyAvailable(bool)), actionCut, SLOT(setEnabled(bool)));
|
|
|
- connect(codeEdit, SIGNAL(copyAvailable(bool)), actionCopy, SLOT(setEnabled(bool)));
|
|
|
-
|
|
|
- connect(actionUndo, SIGNAL(triggered()), codeEdit, SLOT(undo()));
|
|
|
- connect(actionRedo, SIGNAL(triggered()), codeEdit, SLOT(redo()));
|
|
|
-
|
|
|
- connect(actionCut, SIGNAL(triggered()), codeEdit, SLOT(cut()));
|
|
|
- connect(actionCopy, SIGNAL(triggered()), codeEdit, SLOT(copy()));
|
|
|
- connect(actionPaste, SIGNAL(triggered()), codeEdit, SLOT(paste()));
|
|
|
-
|
|
|
- connect(actionFind, SIGNAL(triggered()), codeEdit, SLOT(find()));
|
|
|
-
|
|
|
- connect(actionZoomIn, SIGNAL(triggered()), codeEdit, SLOT(zoomIn()));
|
|
|
- connect(actionZoomOut, SIGNAL(triggered()), codeEdit, SLOT(zoomOut()));
|
|
|
- connect(actionZoomReset, SIGNAL(triggered()), codeEdit, SLOT(zoomReset()));
|
|
|
-
|
|
|
- actionContents->setEnabled(false);
|
|
|
- actionPictures->setEnabled(false);
|
|
|
- actionInspect->setEnabled(false);
|
|
|
-}
|
|
|
-
|
|
|
-void FbMainWindow::viewHtml()
|
|
|
-{
|
|
|
- if (codeEdit && centralWidget() == codeEdit) return;
|
|
|
- if (!textFrame) return;
|
|
|
-
|
|
|
- QString html = textFrame->view()->page()->mainFrame()->toHtml();
|
|
|
- isSwitched = true;
|
|
|
-
|
|
|
- FB2DELETE(textFrame);
|
|
|
- FB2DELETE(dockTree);
|
|
|
- FB2DELETE(dockImgs);
|
|
|
- FB2DELETE(headTree);
|
|
|
-
|
|
|
- if (!codeEdit) {
|
|
|
- codeEdit = new FbCodeEdit;
|
|
|
- }
|
|
|
-
|
|
|
- codeEdit->setPlainText(html);
|
|
|
- setCentralWidget(codeEdit);
|
|
|
- codeEdit->setFocus();
|
|
|
-
|
|
|
- FB2DELETE(toolEdit);
|
|
|
- QToolBar *tool = toolEdit = addToolBar(tr("Edit"));
|
|
|
- tool->addSeparator();
|
|
|
- tool->addAction(actionUndo);
|
|
|
- tool->addAction(actionRedo);
|
|
|
- tool->addSeparator();
|
|
|
- tool->addAction(actionCut);
|
|
|
- tool->addAction(actionCopy);
|
|
|
- tool->addAction(actionPaste);
|
|
|
- tool->addSeparator();
|
|
|
- tool->addAction(actionZoomIn);
|
|
|
- tool->addAction(actionZoomOut);
|
|
|
- tool->addAction(actionZoomReset);
|
|
|
- tool->setMovable(false);
|
|
|
-
|
|
|
- connect(codeEdit, SIGNAL(textChanged()), this, SLOT(documentWasModified()));
|
|
|
- connect(codeEdit, SIGNAL(textChanged()), this, SLOT(checkScintillaUndo()));
|
|
|
-
|
|
|
- connect(codeEdit, SIGNAL(copyAvailable(bool)), actionCut, SLOT(setEnabled(bool)));
|
|
|
- connect(codeEdit, SIGNAL(copyAvailable(bool)), actionCopy, SLOT(setEnabled(bool)));
|
|
|
-
|
|
|
- connect(actionUndo, SIGNAL(triggered()), codeEdit, SLOT(undo()));
|
|
|
- connect(actionRedo, SIGNAL(triggered()), codeEdit, SLOT(redo()));
|
|
|
-
|
|
|
- connect(actionCut, SIGNAL(triggered()), codeEdit, SLOT(cut()));
|
|
|
- connect(actionCopy, SIGNAL(triggered()), codeEdit, SLOT(copy()));
|
|
|
- connect(actionPaste, SIGNAL(triggered()), codeEdit, SLOT(paste()));
|
|
|
-
|
|
|
- connect(actionFind, SIGNAL(triggered()), codeEdit, SLOT(find()));
|
|
|
-
|
|
|
- connect(actionZoomIn, SIGNAL(triggered()), codeEdit, SLOT(zoomIn()));
|
|
|
- connect(actionZoomOut, SIGNAL(triggered()), codeEdit, SLOT(zoomOut()));
|
|
|
- connect(actionZoomReset, SIGNAL(triggered()), codeEdit, SLOT(zoomReset()));
|
|
|
-
|
|
|
- actionContents->setEnabled(false);
|
|
|
- actionPictures->setEnabled(false);
|
|
|
- actionInspect->setEnabled(false);
|
|
|
-}
|
|
|
-
|
|
|
-void FbMainWindow::viewTree()
|
|
|
-{
|
|
|
- if (dockTree) dockTree->deleteLater(); else createTree();
|
|
|
-}
|
|
|
-
|
|
|
-void FbMainWindow::viewImgs()
|
|
|
-{
|
|
|
- if (dockImgs) dockImgs->deleteLater(); else createImgs();
|
|
|
-}
|
|
|
*/
|
|
|
void FbMainWindow::status(const QString &text)
|
|
|
{
|