mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 05:25:26 +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()
|
||||
{
|
||||
BufferView * view = controller_.bufferview();
|
||||
if (!view) {
|
||||
document_->setPlainText(QString());
|
||||
setEnabled(false);
|
||||
return;
|
||||
}
|
||||
if (autoUpdateCB->isChecked())
|
||||
update(viewFullSourceCB->isChecked());
|
||||
document_->setPlainText(controller_.getContent(
|
||||
viewFullSourceCB->isChecked()));
|
||||
|
||||
GuiViewSource::Row row = controller_.getRows();
|
||||
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,
|
||||
Qt::DockWidgetArea area, Qt::WindowFlags 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*/)
|
||||
{
|
||||
setWindowTitle(title());
|
||||
|
@ -44,8 +44,6 @@ public:
|
||||
public Q_SLOTS:
|
||||
// update content
|
||||
void updateView();
|
||||
///
|
||||
void update(bool full_source);
|
||||
|
||||
private:
|
||||
///
|
||||
@ -78,6 +76,7 @@ public:
|
||||
bool canApply() const { return true; }
|
||||
bool canApplyToReadOnly() const { return true; }
|
||||
void updateView();
|
||||
void enableView(bool enable);
|
||||
///@}
|
||||
|
||||
/// The title displayed by the dialog reflects source type.
|
||||
|
Loading…
Reference in New Issue
Block a user