# HG changeset patch
# User insilmaril
# Date 1242639691 0
# Node ID 57ce1ba6d1cba508c3db572760da7733d2332a73
# Parent  a6931cd6309a902c500f364d121f969288fa43d4
Fixed Standard Flags finally

diff -r a6931cd6309a -r 57ce1ba6d1cb mainwindow.cpp
--- a/mainwindow.cpp	Fri May 15 15:22:15 2009 +0000
+++ b/mainwindow.cpp	Mon May 18 09:41:31 2009 +0000
@@ -1166,6 +1166,7 @@
 	// Create Standard Flags
 	tb=addToolBar (tr ("Standard Flags","Standard Flag Toolbar"));
 	tb->setObjectName ("standardFlagTB");
+	standardFlagsMaster->setToolBar (tb);
 
 	
 	flag->load(flagsPath+"flag-exclamationmark.png");
@@ -1341,6 +1342,7 @@
 		a=new QAction (flag->getPixmap(),name,this);
 		// StandardFlag
 		tb->addAction (a);
+		flag->setAction (a);
 		a->setCheckable(true);
 		a->setObjectName(name);
 		a->setToolTip(tooltip);
@@ -3300,21 +3302,18 @@
 				textEditor->setNote(ti->getNoteObj() );
 			else
 				textEditor->setNote(NoteObj() );	//FIXME-4 maybe add a clear() to TE
+			
+			// Show URL and link in statusbar	
+			QString status;
+			QString s=ti->getURL();
+			if (!s.isEmpty() ) status+="URL: "+s+"  ";
+			s=ti->getVymLink();
+			if (!s.isEmpty() ) status+="Link: "+s;
+			if (!status.isEmpty() ) statusMessage (status);
+
 		} else
 			textEditor->setInactive();
 
-		// Show URL and link in statusbar	
-		QString status;
-		QString s=model->getURL();
-		if (!s.isEmpty() ) status+="URL: "+s+"  ";
-		s=model->getVymLink();
-		if (!s.isEmpty() ) status+="Link: "+s;
-		if (!status.isEmpty() ) statusMessage (status);
-
-		// Update Toolbar 
-		//updateFlagsToolbar();  // FIXME-0, was so far in BranchObj
-
-
 		updateActions();
 	}
 }
@@ -3322,15 +3321,11 @@
 void Main::updateActions()
 {
 	VymModel  *m =currentModel();
-	LinkableMapObj *selection;
 	if (m) 
 	{
 		// Printing
 		actionFilePrint->setEnabled (true);
 
-		// Selection
-		selection=m->getSelectedLMO();
-
 		// Link style in context menu
 		switch (m->getMapLinkStyle())
 		{
@@ -3366,9 +3361,6 @@
 	{
 		// Printing
 		actionFilePrint->setEnabled (false);
-
-		// Selection
-		selection=NULL;
 	}
 
 	// updateActions is also called when NoteEditor is closed
@@ -3428,7 +3420,10 @@
 				}
 			}
 			*/
-
+			//Standard Flags
+			standardFlagsMaster->updateToolBar (selbi->activeStandardFlagNames() );
+
+			// System Flags
 			actionToggleScroll->setEnabled (true);
 			if ( selbi->isScrolled() )
 				actionToggleScroll->setOn(true);
@@ -3479,8 +3474,7 @@
 			for (int i=0; i<actionListBranches.size(); ++i)	
 				actionListBranches.at(i)->setEnabled(true);
 			actionDelete->setEnabled (true);
-			actionFormatHideLinkUnselected->setOn
-				(selection->getHideLinkUnselected());
+			//FIXME-2 actionFormatHideLinkUnselected->setOn (selection->getHideLinkUnselected());
 		}
 		if ( selti->getType()==TreeItem::Image)
 		{
@@ -3602,6 +3596,7 @@
 			currentModel()->toggleStandardFlag(sender()->name(),standardFlagsMaster);
 		else	
 			currentModel()->toggleStandardFlag(sender()->name());
+		updateActions();	
 	}
 }
 
diff -r a6931cd6309a -r 57ce1ba6d1cb mapcenteritem.cpp
--- a/mapcenteritem.cpp	Fri May 15 15:22:15 2009 +0000
+++ b/mapcenteritem.cpp	Mon May 18 09:41:31 2009 +0000
@@ -6,6 +6,7 @@
 
 MapCenterItem::MapCenterItem(const QList<QVariant> &data, TreeItem *parent):BranchItem (data,parent)
 {
+	//cout << "Constr. MapCenterItem\n";
 	type=MapCenter;
 }
 
diff -r a6931cd6309a -r 57ce1ba6d1cb treeitem.cpp
--- a/treeitem.cpp	Fri May 15 15:22:15 2009 +0000
+++ b/treeitem.cpp	Mon May 18 09:41:31 2009 +0000
@@ -13,6 +13,7 @@
 
 TreeItem::TreeItem(const QList<QVariant> &data, TreeItem *parent):MapItem()
 {
+	//cout << "Constructor TreeItem "<<endl;
 	init();
     parentItem = parent;
     itemData = data;
@@ -340,7 +341,6 @@
 void TreeItem::setNoteObj(const NoteObj &n, bool updateNoteEditor) //FIXME-1 setNoteObj is called for every select or so???
 {
 	note=n;
-	cout << "TI::setNoteObj of "<<getHeadingStd()<<endl;
 	if (!note.isEmpty() && !systemFlags.isActive ("system-note"))
 		systemFlags.activate ("system-note");
 	if (note.isEmpty() && systemFlags.isActive ("system-note"))
@@ -411,6 +411,17 @@
 	return standardFlags.activeFlagNames();
 }
 
+FlagRow* TreeItem::getStandardFlagRow()
+{
+	return &standardFlags;
+}
+
+/*
+void TreeItem::updateToolBar()
+{
+	standardFlags.updateToolBar();
+}
+*/
 QStringList TreeItem::activeSystemFlagNames ()	//FIXME-1 missing: scrolled-tmp,hideInExport
 {
 	return systemFlags.activeFlagNames();
diff -r a6931cd6309a -r 57ce1ba6d1cb treeitem.h
--- a/treeitem.h	Fri May 15 15:22:15 2009 +0000
+++ b/treeitem.h	Mon May 18 09:41:31 2009 +0000
@@ -120,6 +120,9 @@
 	virtual void toggleStandardFlag(const QString &flag, FlagRow *master=NULL);
 	virtual bool isActiveStandardFlag (const QString &flag);
 	virtual QStringList activeStandardFlagNames();
+	virtual FlagRow* getStandardFlagRow ();
+	//virtual void updateToolBar();
+
 	virtual QStringList activeSystemFlagNames();
 
 
diff -r a6931cd6309a -r 57ce1ba6d1cb version.h
--- a/version.h	Fri May 15 15:22:15 2009 +0000
+++ b/version.h	Mon May 18 09:41:31 2009 +0000
@@ -7,7 +7,7 @@
 #define __VYM_VERSION "1.13.0"
 //#define __VYM_CODENAME "Codename: RC-1"
 #define __VYM_CODENAME "Codename: development version, not for production!"
-#define __VYM_BUILD_DATE "2009-05-15"
+#define __VYM_BUILD_DATE "2009-05-18"
 
 
 bool checkVersion(const QString &);