[EMAIL PROTECTED] wrote:

Author: kuemmel
Date: Sun Oct 29 12:13:46 2006
New Revision: 15598

URL: http://www.lyx.org/trac/changeset/15598
Log:
Show Change Tracking toolbar, prepare hiding/positioning:
Peter, I really would have liked to get Bo's opinion first before you commit your patch. I don't know whether the *.ui settings will survive Bo's session management at all.

However, now that the code has been committed, please find a few comments and a new patch below.

URL: http://www.lyx.org/trac/file/lyx-devel/trunk/lib/ui/default.ui?rev=15598
==============================================================================
--- lyx-devel/trunk/lib/ui/default.ui (original)
+++ lyx-devel/trunk/lib/ui/default.ui Sun Oct 29 12:13:46 2006
@@ -38,4 +38,5 @@
        "table" "table,bottom"
        "math" "math,bottom"
        "minibuffer" "off,bottom"
+       "review" "review,top"
End
"review" was already defined. Just have a look four lines above (not visible in this code snippet). I am going to revert your patch.

URL: 
http://www.lyx.org/trac/file/lyx-devel/trunk/src/frontends/LyXView.C?rev=15598
==============================================================================
--- lyx-devel/trunk/src/frontends/LyXView.C (original)
+++ lyx-devel/trunk/src/frontends/LyXView.C Sun Oct 29 12:13:46 2006
@@ -290,7 +290,10 @@
        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);
I guess that you want to activate the toolbar if you are in CT mode. The attached patch fixes this...

URL: 
http://www.lyx.org/trac/file/lyx-devel/trunk/src/frontends/Toolbars.C?rev=15598
==============================================================================
--- lyx-devel/trunk/src/frontends/Toolbars.C (original)
+++ lyx-devel/trunk/src/frontends/Toolbars.C Sun Oct 29 12:13:46 2006
@@ -65,7 +65,7 @@
}


-void Toolbars::update(bool in_math, bool in_table)
+void Toolbars::update(bool in_math, bool in_table, bool change_tracking)
I prefer sticking to the term "review" for consistency. The toolbar covers more than just change tracking.

URL: 
http://www.lyx.org/trac/file/lyx-devel/trunk/src/frontends/Toolbars.h?rev=15598
==============================================================================
--- lyx-devel/trunk/src/frontends/Toolbars.h (original)
+++ lyx-devel/trunk/src/frontends/Toolbars.h Sun Oct 29 12:13:46 2006
@@ -82,8 +82,9 @@

        /// 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);
dito.

I am going to commit the attached patch.

Michael

Index: src/frontends/Toolbars.C
===================================================================
--- src/frontends/Toolbars.C	(Revision 15609)
+++ src/frontends/Toolbars.C	(Arbeitskopie)
@@ -65,7 +65,7 @@
 }
 
 
-void Toolbars::update(bool in_math, bool in_table, bool change_tracking)
+void Toolbars::update(bool in_math, bool in_table, bool review)
 {
 	update();
 
@@ -79,7 +79,7 @@
 		else if (cit->flags & ToolbarBackend::TABLE)
 			displayToolbar(*cit, in_table);
 		else if (cit->flags & ToolbarBackend::REVIEW)
-			displayToolbar(*cit, change_tracking);
+			displayToolbar(*cit, review);
 	}
 }
 
Index: src/frontends/LyXView.C
===================================================================
--- src/frontends/LyXView.C	(Revision 15609)
+++ src/frontends/LyXView.C	(Arbeitskopie)
@@ -287,13 +287,15 @@
 
 void LyXView::updateToolbars()
 {
-	bool const math = work_area_->bufferView().cursor().inMathed();
+	bool const math =
+		work_area_->bufferView().cursor().inMathed();
 	bool const table =
 		lyx::getStatus(FuncRequest(LFUN_LAYOUT_TABULAR)).enabled();
-	// TODO: How should we handle the CT toolbar?
-	bool const change_tracking = true;
+	bool const review =
+		lyx::getStatus(FuncRequest(LFUN_CHANGES_TRACK)).enabled() &&
+		lyx::getStatus(FuncRequest(LFUN_CHANGES_TRACK)).onoff(true);
 		
-	toolbars_->update(math, table, change_tracking);
+	toolbars_->update(math, table, review);
 	// 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: src/frontends/Toolbars.h
===================================================================
--- src/frontends/Toolbars.h	(Revision 15609)
+++ src/frontends/Toolbars.h	(Arbeitskopie)
@@ -84,7 +84,7 @@
 	void display(std::string const & name, bool show);
 
 	/// Update the state of the toolbars.
-	void update(bool in_math, bool in_table, bool change_tracking);
+	void update(bool in_math, bool in_table, bool review);
 
 	/// Select the right layout in the combox.
 	void setLayout(std::string const & layout);
Index: lib/ui/default.ui
===================================================================
--- lib/ui/default.ui	(Revision 15609)
+++ lib/ui/default.ui	(Arbeitskopie)
@@ -38,5 +38,4 @@
 	"table" "table,bottom"
 	"math" "math,bottom"
 	"minibuffer" "off,bottom"
-	"review" "review,top"
 End

Reply via email to