From: Peter Kümmel Date: Sun, 29 Oct 2006 11:13:46 +0000 (+0000) Subject: Show Change Tracking toolbar, prepare hiding/positioning: X-Git-Tag: 1.6.10~12153 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=577eaa14f81064a1c9634a5501f0d7a5d51d216b;p=features.git Show Change Tracking toolbar, prepare hiding/positioning: - src/frontends/Toolbars.h: control displaying of CT toolbar with a parameter - src/frontends/Toolbars.C: control displaying of CT toolbar with a parameter - src/frontends/LyXView.C : show CT toolbar - src/ToolbarBackend.C : add CT toolbar to default.ui as REVIEW - lib/ui/default.ui : add CT toolbar to default.ui - src/ToolbarBackend.h : add CT toolbar type REVIEW git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15598 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/lib/ui/default.ui b/lib/ui/default.ui index 737fcf18cb..66c0b4d4b5 100644 --- a/lib/ui/default.ui +++ b/lib/ui/default.ui @@ -38,4 +38,5 @@ Toolbars "table" "table,bottom" "math" "math,bottom" "minibuffer" "off,bottom" + "review" "review,top" End diff --git a/src/ToolbarBackend.C b/src/ToolbarBackend.C index 6f459bd095..f2dd5d8a26 100644 --- a/src/ToolbarBackend.C +++ b/src/ToolbarBackend.C @@ -186,6 +186,8 @@ void ToolbarBackend::readToolbars(LyXLex & lex) flag = MATH; else if (!compare_ascii_no_case(*cit, "table")) flag = TABLE; + else if (!compare_ascii_no_case(*cit, "review")) + flag = REVIEW; else if (!compare_ascii_no_case(*cit, "top")) flag = TOP; else if (!compare_ascii_no_case(*cit, "bottom")) diff --git a/src/ToolbarBackend.h b/src/ToolbarBackend.h index 33694481cd..bdbed6a6db 100644 --- a/src/ToolbarBackend.h +++ b/src/ToolbarBackend.h @@ -52,7 +52,8 @@ public: TOP = 16, //< show at top BOTTOM = 32, //< show at bottom LEFT = 64, //< show at left - RIGHT = 128 //< show at right + RIGHT = 128, //< show at right + REVIEW = 256 //< shown when change tracking is enabled }; /// a toolbar diff --git a/src/frontends/LyXView.C b/src/frontends/LyXView.C index 5b506ff57d..a793d80fdc 100644 --- a/src/frontends/LyXView.C +++ b/src/frontends/LyXView.C @@ -290,7 +290,10 @@ void LyXView::updateToolbars() bool const math = work_area_->bufferView().cursor().inMathed(); bool const table = lyx::getStatus(FuncRequest(LFUN_LAYOUT_TABULAR)).enabled(); - toolbars_->update(math, table); + // TODO: How should we handle the CT toolbar? + bool const change_tracking = true; + + toolbars_->update(math, table, change_tracking); // update redaonly status of open dialogs. This could also be in // updateMenubar(), but since updateToolbars() and updateMenubar() // are always called together it is only here. diff --git a/src/frontends/Toolbars.C b/src/frontends/Toolbars.C index 44798a69b8..4d2ed7cfa8 100644 --- a/src/frontends/Toolbars.C +++ b/src/frontends/Toolbars.C @@ -65,7 +65,7 @@ void Toolbars::display(string const & name, bool show) } -void Toolbars::update(bool in_math, bool in_table) +void Toolbars::update(bool in_math, bool in_table, bool change_tracking) { update(); @@ -78,6 +78,8 @@ void Toolbars::update(bool in_math, bool in_table) displayToolbar(*cit, in_math); else if (cit->flags & ToolbarBackend::TABLE) displayToolbar(*cit, in_table); + else if (cit->flags & ToolbarBackend::REVIEW) + displayToolbar(*cit, change_tracking); } } diff --git a/src/frontends/Toolbars.h b/src/frontends/Toolbars.h index 1c62d74590..7fe1c57e24 100644 --- a/src/frontends/Toolbars.h +++ b/src/frontends/Toolbars.h @@ -82,8 +82,9 @@ public: /// Show/hide the named toolbar. void display(std::string const & name, bool show); + /// Update the state of the toolbars. - void update(bool in_math, bool in_table); + void update(bool in_math, bool in_table, bool change_tracking); /// Select the right layout in the combox. void setLayout(std::string const & layout);