mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-10 18:58:10 +00:00
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24754 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
2a18b2a5cc
commit
42d79d543b
@ -68,8 +68,15 @@ ViewSourceWidget::ViewSourceWidget(GuiViewSource & controller)
|
|||||||
|
|
||||||
void ViewSourceWidget::updateView()
|
void ViewSourceWidget::updateView()
|
||||||
{
|
{
|
||||||
|
BufferView * view = controller_.bufferview();
|
||||||
|
if (!view) {
|
||||||
|
document_->setPlainText(QString());
|
||||||
|
setEnabled(false);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (autoUpdateCB->isChecked())
|
if (autoUpdateCB->isChecked())
|
||||||
update(viewFullSourceCB->isChecked());
|
document_->setPlainText(controller_.getContent(
|
||||||
|
viewFullSourceCB->isChecked()));
|
||||||
|
|
||||||
GuiViewSource::Row row = controller_.getRows();
|
GuiViewSource::Row row = controller_.getRows();
|
||||||
QTextCursor c = QTextCursor(viewSourceTV->document());
|
QTextCursor c = QTextCursor(viewSourceTV->document());
|
||||||
@ -81,12 +88,6 @@ void ViewSourceWidget::updateView()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ViewSourceWidget::update(bool full_source)
|
|
||||||
{
|
|
||||||
document_->setPlainText(controller_.getContent(full_source));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
GuiViewSource::GuiViewSource(GuiView & parent,
|
GuiViewSource::GuiViewSource(GuiView & parent,
|
||||||
Qt::DockWidgetArea area, Qt::WindowFlags flags)
|
Qt::DockWidgetArea area, Qt::WindowFlags flags)
|
||||||
: DockView(parent, "view-source", qt_("LaTeX Source"), area, flags)
|
: DockView(parent, "view-source", qt_("LaTeX Source"), area, flags)
|
||||||
@ -108,6 +109,15 @@ void GuiViewSource::updateView()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void GuiViewSource::enableView(bool enable)
|
||||||
|
{
|
||||||
|
if (!enable)
|
||||||
|
// In the opposite case, updateView() will be called anyway.
|
||||||
|
widget_->updateView();
|
||||||
|
widget_->setEnabled(enable);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool GuiViewSource::initialiseParams(string const & /*source*/)
|
bool GuiViewSource::initialiseParams(string const & /*source*/)
|
||||||
{
|
{
|
||||||
setWindowTitle(title());
|
setWindowTitle(title());
|
||||||
|
@ -44,8 +44,6 @@ public:
|
|||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
// update content
|
// update content
|
||||||
void updateView();
|
void updateView();
|
||||||
///
|
|
||||||
void update(bool full_source);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
///
|
///
|
||||||
@ -78,6 +76,7 @@ public:
|
|||||||
bool canApply() const { return true; }
|
bool canApply() const { return true; }
|
||||||
bool canApplyToReadOnly() const { return true; }
|
bool canApplyToReadOnly() const { return true; }
|
||||||
void updateView();
|
void updateView();
|
||||||
|
void enableView(bool enable);
|
||||||
///@}
|
///@}
|
||||||
|
|
||||||
/// The title displayed by the dialog reflects source type.
|
/// The title displayed by the dialog reflects source type.
|
||||||
|
Loading…
Reference in New Issue
Block a user