LYX_OPTION(ASPELL "Require aspell" OFF ALL)
LYX_OPTION(ENCHANT "Require Enchant" OFF ALL)
LYX_OPTION(HUNSPELL "Require Hunspell" OFF ALL)
-LYX_OPTION(DEVEL_VERSION "Build developer version" OFF ALL)
LYX_OPTION(RELEASE "Build release version, build debug when disabled" OFF ALL)
LYX_OPTION(DEBUG "Enforce debug build" OFF ALL)
LYX_OPTION(NO_OPTIMIZE "Don't use any optimization/debug flags" OFF ALL)
-- LYX_ASPELL = OFF : Require aspell
-- LYX_ENCHANT = OFF : Require Enchant
-- LYX_HUNSPELL = OFF : Require Hunspell
- -- LYX_DEVEL_VERSION = OFF : Build developer version
-- LYX_RELEASE = OFF : Build release version, build debug when disabled
-- LYX_PACKAGE_SUFFIX = ON : Use version suffix for packaging
-- LYX_PCH = OFF : Use precompiled headers
lyx_flags="$lyx_flags build=$build_type"
case $build_type in
development) lyx_devel_version=yes
- AC_DEFINE(DEVEL_VERSION, 1, [Define if you are building a development version of LyX])
LYX_DATE="not released yet" ;;
prerelease) lyx_prerelease=yes ;;
esac
Documentation
* Better documentation, variable naming, more automake-like
- * what does LYX_DEVEL_VERSION do?
- * What is the difference with LYX_RELEASE=OFF?
* how do I specify whether I want debug informations (-g flag) for unix?
#endif
-#cmakedefine LYX_DEVEL_VERSION 1
-#if defined(LYX_DEVEL_VERSION)
- #define DEVEL_VERSION 1
-#else
- #undef DEVEL_VERSION
-#endif
#cmakedefine PACKAGE "${PACKAGE}"
#cmakedefine PACKAGE_VERSION "${PACKAGE_VERSION}"
#define PACKAGE_STRING "LyX ${PACKAGE_VERSION}"
break;
case LFUN_FONT_STATE:
- dr.setMessage(cur.currentState());
+ dr.setMessage(cur.currentState(false));
break;
case LFUN_BOOKMARK_SAVE:
}
-void Cursor::info(odocstream & os) const
+void Cursor::info(odocstream & os, bool devel_mode) const
{
for (int i = 1, n = depth(); i < n; ++i) {
operator[](i).inset().infoize(os);
if (inset)
prevInset()->infoize2(os);
}
+ if (devel_mode) {
+ InsetMath * math = inset().asInsetMath();
+ if (math)
+ os << _(", Inset: ") << math->id();
+ os << _(", Cell: ") << idx();
+ os << _(", Position: ") << pos();
+ }
+
}
}
-docstring Cursor::currentState() const
+docstring Cursor::currentState(bool devel_mode) const
{
if (inMathed()) {
odocstringstream os;
- info(os);
-#ifdef DEVEL_VERSION
- InsetMath * math = inset().asInsetMath();
- if (math)
- os << _(", Inset: ") << math->id();
- os << _(", Cell: ") << idx();
- os << _(", Position: ") << pos();
-#endif
+ info(os, devel_mode);
return os.str();
}
if (inTexted())
- return text()->currentState(*this);
+ return text()->currentState(*this, devel_mode);
return docstring();
}
///
docstring selectionAsString(bool with_label) const;
///
- docstring currentState() const;
+ docstring currentState(bool devel_mode) const;
/// auto-correct mode
bool autocorrect() const { return autocorrect_; }
/// access to owning BufferView
BufferView & bv() const;
/// get some interesting description of top position
- void info(odocstream & os) const;
+ void info(odocstream & os, bool devel_mode) const;
/// are we in math mode (2), text mode (1) or unsure (0)?
int currentMode();
/// reset cursor bottom to the beginning of the top inset
LFUN_BUFFER_ZOOM, // daniel, 20161028
LFUN_TOOLBAR_MOVABLE, // daniel, 20160712
LFUN_FONT_CROSSOUT, // uwestoehr 20170404
+ LFUN_DEVEL_MODE_TOGGLE, // lasgouttes 20170723
LFUN_LASTACTION // end of the table
};
{ LFUN_DEPTH_INCREMENT, "depth-increment", Noop, Edit },
+/*!
+ * \var lyx::FuncCode lyx::LFUN_DEVEL_MODE_TOGGLE
+ * \li Action: toggle a mode where more information is given in UI
+ * \li Syntax: devel-mode-toggle
+ * \li Notion: in so called "devel" mode, the information given in the
+ * status bar is more precise, and the help documents are
+ * open in editing mode.
+ * \li Origin: lasgouttes, 23 Jul 2017
+ * \endvar
+ */
+ { LFUN_DEVEL_MODE_TOGGLE, "devel-mode-toggle", NoBuffer, System },
+
+
/*!
* \var lyx::FuncCode lyx::LFUN_DIALOG_DISCONNECT_INSET
* \li Action: Closes opened connection to opened inset.
// Returns the current font and depth as a message.
-docstring Text::currentState(Cursor const & cur) const
+docstring Text::currentState(Cursor const & cur, bool devel_mode) const
{
LBUFERR(this == cur.text());
Buffer & buf = *cur.buffer();
}
}
-#ifdef DEVEL_VERSION
- os << _(", Inset: ") << &cur.inset();
- os << _(", Paragraph: ") << cur.pit();
- os << _(", Id: ") << par.id();
- os << _(", Position: ") << cur.pos();
- // FIXME: Why is the check for par.size() needed?
- // We are called with cur.pos() == par.size() quite often.
- if (!par.empty() && cur.pos() < par.size()) {
- // Force output of code point, not character
- size_t const c = par.getChar(cur.pos());
- os << _(", Char: 0x") << hex << c;
- }
- os << _(", Boundary: ") << cur.boundary();
-// Row & row = cur.textRow();
-// os << bformat(_(", Row b:%1$d e:%2$d"), row.pos(), row.endpos());
-#endif
+ if (devel_mode) {
+ os << _(", Inset: ") << &cur.inset();
+ os << _(", Paragraph: ") << cur.pit();
+ os << _(", Id: ") << par.id();
+ os << _(", Position: ") << cur.pos();
+ // FIXME: Why is the check for par.size() needed?
+ // We are called with cur.pos() == par.size() quite often.
+ if (!par.empty() && cur.pos() < par.size()) {
+ // Force output of code point, not character
+ size_t const c = par.getChar(cur.pos());
+ os << _(", Char: 0x") << hex << c;
+ }
+ os << _(", Boundary: ") << cur.boundary();
+// Row & row = cur.textRow();
+// os << bformat(_(", Row b:%1$d e:%2$d"), row.pos(), row.endpos());
+ }
return os.str();
}
/// read-write access to individual paragraph
Paragraph & getPar(pit_type pit) { return pars_[pit]; }
// Returns the current font and depth as a message.
- /// FIXME: replace Cursor with DocIterator.
- docstring currentState(Cursor const & cur) const;
+ // When \param devel_mode is true, add more precise information
+ docstring currentState(Cursor const & cur, bool devel_mode) const;
/** Find the word under \c from in the relative location
* defined by \c word_location.
current_view_->message(bformat(_("Opening help file %1$s..."),
makeDisplayPath(fname.absFileName())));
Buffer * buf = current_view_->loadDocument(fname, false);
-
-#ifndef DEVEL_VERSION
if (buf)
- buf->setReadonly(true);
-#else
- (void) buf;
-#endif
+ buf->setReadonly(!current_view_->develMode());
break;
}
}
-docstring const GuiCommandBuffer::getCurrentState() const
-{
- return view_->currentBufferView()->cursor().currentState();
-}
-
-
vector<string> const
GuiCommandBuffer::completions(string const & prefix, string & new_prefix)
{
/// return the next history entry if any
std::string const historyDown();
- /// return the font and depth in the active BufferView as a message.
- docstring const getCurrentState() const;
-
/// open a listbox and show the contents of the list. When reversed
/// is true, the contents of the list is filled bottom-up.
void showList(std::vector<std::string> const & list,
GuiView::GuiView(int id)
: d(*new GuiViewPrivate(this)), id_(id), closing_(false), busy_(0),
- command_execute_(false), minibuffer_focus_(false)
+ command_execute_(false), minibuffer_focus_(false), devel_mode_(false)
{
connect(this, SIGNAL(bufferViewChanged()),
this, SLOT(onBufferViewChanged()));
{
QSettings settings;
settings.setValue("zoom", lyxrc.currentZoom);
+ settings.setValue("devel_mode", devel_mode_);
settings.beginGroup("views");
settings.beginGroup(QString::number(id_));
#if defined(Q_WS_X11) || defined(QPA_XCB)
QSettings settings;
lyxrc.currentZoom = settings.value("zoom", lyxrc.zoom).toInt();
lyx::dispatch(FuncRequest(LFUN_BUFFER_ZOOM, convert<docstring>(lyxrc.currentZoom)));
+ devel_mode_ = settings.value("devel_mode", devel_mode_).toBool();
settings.beginGroup("views");
settings.beginGroup(QString::number(id_));
QString const icon_key = "icon_size";
if (msg.isEmpty()) {
BufferView const * bv = currentBufferView();
if (bv)
- msg = toqstr(bv->cursor().currentState());
+ msg = toqstr(bv->cursor().currentState(devel_mode_));
else
msg = qt_("Welcome to LyX!");
}
enable = d.tabWorkAreaCount() > 1;
break;
+ case LFUN_DEVEL_MODE_TOGGLE:
+ flag.setOnOff(devel_mode_);
+ break;
+
case LFUN_TOOLBAR_TOGGLE: {
string const name = cmd.getArg(0);
if (GuiToolbar * t = toolbar(name))
closeBufferAll();
break;
+ case LFUN_DEVEL_MODE_TOGGLE:
+ devel_mode_ = !devel_mode_;
+ if (devel_mode_)
+ dr.setMessage(_("Developer mode is now enabled."));
+ else
+ dr.setMessage(_("Developer mode is now disabled."));
+ break;
+
case LFUN_TOOLBAR_TOGGLE: {
string const name = cmd.getArg(0);
if (GuiToolbar * t = toolbar(name))
void hideDialog(std::string const & name, Inset * inset);
///
void disconnectDialog(std::string const & name);
+ ///
+ bool develMode() const { return devel_mode_; }
private:
/// Saves the layout and geometry of the window
// movability flag of all toolbars
bool toolbarsMovable_;
+
+ // developer mode
+ bool devel_mode_;
};
} // namespace frontend
masterPerspectiveCB->isChecked());
QString old = document_->toPlainText();
QString qcontent = toqstr(content);
-#ifdef DEVEL_VERSION
- // output tex<->row correspondences in the source panel if the "-dbg latex"
- // option is given.
- if (texrow_ && lyx::lyxerr.debugging(Debug::LATEX)) {
- QStringList list = qcontent.split(QChar('\n'));
- docstring_list dlist;
- for (QStringList::const_iterator it = list.begin(); it != list.end(); ++it)
- dlist.push_back(from_utf8(fromqstr(*it)));
- texrow_->prepend(dlist);
- qcontent.clear();
- for (docstring_list::iterator it = dlist.begin(); it != dlist.end(); ++it)
- qcontent += toqstr(*it) + '\n';
+ if (guiApp->currentView()->develMode()) {
+ // output tex<->row correspondences in the source panel if the "-dbg latex"
+ // option is given.
+ if (texrow_ && lyx::lyxerr.debugging(Debug::LATEX)) {
+ QStringList list = qcontent.split(QChar('\n'));
+ docstring_list dlist;
+ for (QStringList::const_iterator it = list.begin(); it != list.end(); ++it)
+ dlist.push_back(from_utf8(fromqstr(*it)));
+ texrow_->prepend(dlist);
+ qcontent.clear();
+ for (docstring_list::iterator it = dlist.begin(); it != dlist.end(); ++it)
+ qcontent += toqstr(*it) + '\n';
+ }
}
-#endif
+
// prevent gotoCursor()
QSignalBlocker blocker(viewSourceTV);
bool const changed = setText(qcontent);
if (!cur.inMathed())
return;
odocstringstream os;
- cur.info(os);
+ cur.info(os, false);
cur.message(os.str());
/*
// write something to the minibuffer