]> git.lyx.org Git - features.git/commitdiff
Show Change Tracking toolbar, prepare hiding/positioning:
authorPeter Kümmel <syntheticpp@gmx.net>
Sun, 29 Oct 2006 11:13:46 +0000 (11:13 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Sun, 29 Oct 2006 11:13:46 +0000 (11:13 +0000)
 - 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

lib/ui/default.ui
src/ToolbarBackend.C
src/ToolbarBackend.h
src/frontends/LyXView.C
src/frontends/Toolbars.C
src/frontends/Toolbars.h

index 737fcf18cbecd1e426837ed7066511de473cdb67..66c0b4d4b560013ec4032dbd858c9295a1c2ccc3 100644 (file)
@@ -38,4 +38,5 @@ Toolbars
        "table" "table,bottom"
        "math" "math,bottom"
        "minibuffer" "off,bottom"
+       "review" "review,top"
 End
index 6f459bd095353e99769ef768ab03b25aa0eefae0..f2dd5d8a26ad361283204cf8fee9e09680ae9602 100644 (file)
@@ -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"))
index 33694481cdfec0b2522353d286a04b77cc13172a..bdbed6a6db9f19ed125f460426eaae91f48e26cf 100644 (file)
@@ -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
index 5b506ff57d528cabd2cafdd9106879c870932e2f..a793d80fdc5f094292c10aec89e4ddcc507c67e5 100644 (file)
@@ -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.
index 44798a69b85cac333368a20ad3123ca61b6dfd54..4d2ed7cfa8cb359e341489b723d05190ccf2103b 100644 (file)
@@ -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);
        }
 }
 
index 1c62d745907d2bf9049f70a248486b3032faf477..7fe1c57e2476edd9a3dd5df77b5a3774d2cf8ffe 100644 (file)
@@ -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);