#include <boost/scoped_ptr.hpp>
+#include "support/docstring.h"
+
#include <string>
LyXVC();
///
~LyXVC();
- /// Name of the underlying VCS
- std::string vcname() const;
+ /// Status of the underlying VCS
+ docstring vcstatus() const;
/// Is \p fn under version control?
static bool fileInVC(support::FileName const & fn);
/** Not a good name perhaps. This function should be called whenever
if (buf.lyxvc().inUse()) {
version_control_->show();
- if (buf.lyxvc().locking())
- version_control_->setText(
- toqstr(bformat(_("%1$s lock"),
- from_ascii(buf.lyxvc().vcname()))));
- else
- version_control_->setText(toqstr(buf.lyxvc().vcname()));
+ version_control_->setText(toqstr(buf.lyxvc().vcstatus()));
} else
version_control_->hide();
}
#include "support/convert.h"
#include "support/debug.h"
#include "support/gettext.h"
-#include "support/FileName.h"
#include "support/lassert.h"
#include "support/TempFile.h"
GuiWorkArea::Private::Private(GuiWorkArea * parent)
-: p(parent), screen_(0), buffer_view_(0), read_only_(false), lyx_view_(0),
-cursor_visible_(false), cursor_(0),
-need_resize_(false), schedule_redraw_(false), preedit_lines_(1),
-pixel_ratio_(1.0),
-completer_(new GuiCompleter(p, p)), dialog_mode_(false)
+: p(parent), screen_(0), buffer_view_(0), lyx_view_(0),
+ cursor_visible_(false), cursor_(0),
+ need_resize_(false), schedule_redraw_(false), preedit_lines_(1),
+ pixel_ratio_(1.0),
+ completer_(new GuiCompleter(p, p)), dialog_mode_(false),
+ read_only_(false), clean_(true)
{
}
void GuiWorkArea::updateWindowTitle()
{
- d->lyx_view_->updateWindowTitle(this);
- titleChanged(this);
+ Buffer const & buf = bufferView().buffer();
+ if (buf.fileName() != d->file_name_ || buf.isReadonly() != d->read_only_
+ || buf.lyxvc().vcstatus() != d->vc_status_ || buf.isClean() != d->clean_) {
+ d->file_name_ = buf.fileName();
+ d->read_only_ = buf.isReadonly();
+ d->vc_status_ = buf.lyxvc().vcstatus();
+ d->clean_ = buf.isClean();
+ titleChanged(this);
+ }
}
#include "FuncRequest.h"
#include "LyXRC.h"
+#include "support/FileName.h"
#include "support/Timeout.h"
#include <QMouseEvent>
QPaintDevice * screen_;
///
BufferView * buffer_view_;
- /// Read only Buffer status cache.
- bool read_only_;
///
GuiView * lyx_view_;
/// is the cursor currently displayed
/// when the menu is actually shown (after releasing on Windows)
/// and after the DEPM has done its job.
std::string context_menu_name_;
+
+ /// stuff related to window title
+ ///
+ support::FileName file_name_;
+ ///
+ bool read_only_;
+ ///
+ docstring vc_status_;
+ ///
+ bool clean_;
+
}; // GuiWorkArea
} // namespace frontend