diff options
author | Kandrashin Denis <mail@lintest.ru> | 2012-11-03 21:04:51 +0400 |
---|---|---|
committer | Kandrashin Denis <mail@lintest.ru> | 2012-11-03 21:04:51 +0400 |
commit | 9bbb61940b1c83d4b91331457fd55a8421ec0708 (patch) | |
tree | e5c406f440a978b1abfbb94bed03017dc43956d8 /source | |
parent | c511698cb52f86e8c659efa0481988be90726f43 (diff) |
Update head when switch mode
Diffstat (limited to 'source')
-rw-r--r-- | source/fb2code.hpp | 3 | ||||
-rw-r--r-- | source/fb2dock.cpp | 5 | ||||
-rw-r--r-- | source/fb2dock.hpp | 3 | ||||
-rw-r--r-- | source/fb2head.cpp | 2 | ||||
-rw-r--r-- | source/fb2text.cpp | 11 |
5 files changed, 19 insertions, 5 deletions
diff --git a/source/fb2code.hpp b/source/fb2code.hpp index 12d938c..e368d1e 100644 --- a/source/fb2code.hpp +++ b/source/fb2code.hpp @@ -99,6 +99,9 @@ public: bool isModified() const { return document()->isModified(); } +signals: + void status(const QString &text); + public slots: void find(); void zoomIn(); diff --git a/source/fb2dock.cpp b/source/fb2dock.cpp index 71418ce..39f6dfe 100644 --- a/source/fb2dock.cpp +++ b/source/fb2dock.cpp @@ -46,6 +46,9 @@ FbMainDock::FbMainDock(QWidget *parent) addWidget(m_code);
connect(m_text->page(), SIGNAL(status(QString)), parent, SLOT(status(QString)));
+ connect(m_head, SIGNAL(status(QString)), parent, SLOT(status(QString)));
+ connect(m_code, SIGNAL(status(QString)), parent, SLOT(status(QString)));
+ connect(this, SIGNAL(status(QString)), parent, SLOT(status(QString)));
}
void FbMainDock::switchMode(Fb::Mode mode)
@@ -82,6 +85,7 @@ void FbMainDock::setMode(Fb::Mode mode) case Fb::Code: setModeCode(); break;
case Fb::Html: setModeHtml(); break;
}
+ emit status(QString());
}
void FbMainDock::setModeText()
@@ -102,6 +106,7 @@ void FbMainDock::setModeHead() m_text->disconnectActions();
m_code->disconnectActions();
m_head->connectActions(m_tool);
+ m_head->updateTree();
}
void FbMainDock::setModeCode()
diff --git a/source/fb2dock.hpp b/source/fb2dock.hpp index 61fa151..5bf23ef 100644 --- a/source/fb2dock.hpp +++ b/source/fb2dock.hpp @@ -33,7 +33,8 @@ public: bool isModified() const;
signals:
-
+ void status(const QString &text);
+
public slots:
private:
diff --git a/source/fb2head.cpp b/source/fb2head.cpp index be18f89..e462cf1 100644 --- a/source/fb2head.cpp +++ b/source/fb2head.cpp @@ -598,6 +598,8 @@ void FbHeadEdit::setAction(Fb::Actions index, QAction *action) void FbHeadEdit::connectActions(QToolBar *tool) { tool->clear(); + tool->addAction(actionInsert); + tool->addAction(actionDelete); } void FbHeadEdit::disconnectActions() diff --git a/source/fb2text.cpp b/source/fb2text.cpp index 4914e4f..6aaa44f 100644 --- a/source/fb2text.cpp +++ b/source/fb2text.cpp @@ -335,6 +335,9 @@ void FbTextEdit::disconnectActions() a->disconnectAction(); } } + viewContents(false); + viewPictures(false); + viewInspector(false); } void FbTextEdit::viewContents(bool show) @@ -346,7 +349,7 @@ void FbTextEdit::viewContents(bool show) connect(dockTree, SIGNAL(visibilityChanged(bool)), act(Fb::ViewContents), SLOT(setChecked(bool))); connect(dockTree, SIGNAL(destroyed()), SLOT(treeDestroyed())); m_owner->addDockWidget(Qt::LeftDockWidgetArea, dockTree); - } else { + } else if (dockTree) { dockTree->deleteLater(); dockTree = 0; } @@ -361,7 +364,7 @@ void FbTextEdit::viewPictures(bool show) connect(dockImgs, SIGNAL(visibilityChanged(bool)), act(Fb::ViewPictures), SLOT(setChecked(bool))); connect(dockImgs, SIGNAL(destroyed()), SLOT(imgsDestroyed())); m_owner->addDockWidget(Qt::RightDockWidgetArea, dockImgs); - } else { + } else if (dockImgs) { dockImgs->deleteLater(); dockImgs = 0; } @@ -378,8 +381,8 @@ void FbTextEdit::viewInspector(bool show) dockInsp->setWidget(inspector); connect(dockInsp, SIGNAL(visibilityChanged(bool)), act(Fb::ViewInspector), SLOT(setChecked(bool))); m_owner->addDockWidget(Qt::BottomDockWidgetArea, dockInsp); - } else { - dockImgs->hide(); + } else if (dockInsp) { + dockInsp->hide(); } } |