Fixed Standard Flags finally
authorinsilmaril
Mon May 18 09:41:31 2009 +0000 (2009-05-18)
changeset 77057ce1ba6d1cb
parent 769 a6931cd6309a
child 771 01f2f6d6789d
Fixed Standard Flags finally
mainwindow.cpp
mapcenteritem.cpp
treeitem.cpp
treeitem.h
version.h
     1.1 --- a/mainwindow.cpp	Fri May 15 15:22:15 2009 +0000
     1.2 +++ b/mainwindow.cpp	Mon May 18 09:41:31 2009 +0000
     1.3 @@ -1166,6 +1166,7 @@
     1.4  	// Create Standard Flags
     1.5  	tb=addToolBar (tr ("Standard Flags","Standard Flag Toolbar"));
     1.6  	tb->setObjectName ("standardFlagTB");
     1.7 +	standardFlagsMaster->setToolBar (tb);
     1.8  
     1.9  	
    1.10  	flag->load(flagsPath+"flag-exclamationmark.png");
    1.11 @@ -1341,6 +1342,7 @@
    1.12  		a=new QAction (flag->getPixmap(),name,this);
    1.13  		// StandardFlag
    1.14  		tb->addAction (a);
    1.15 +		flag->setAction (a);
    1.16  		a->setCheckable(true);
    1.17  		a->setObjectName(name);
    1.18  		a->setToolTip(tooltip);
    1.19 @@ -3300,21 +3302,18 @@
    1.20  				textEditor->setNote(ti->getNoteObj() );
    1.21  			else
    1.22  				textEditor->setNote(NoteObj() );	//FIXME-4 maybe add a clear() to TE
    1.23 +			
    1.24 +			// Show URL and link in statusbar	
    1.25 +			QString status;
    1.26 +			QString s=ti->getURL();
    1.27 +			if (!s.isEmpty() ) status+="URL: "+s+"  ";
    1.28 +			s=ti->getVymLink();
    1.29 +			if (!s.isEmpty() ) status+="Link: "+s;
    1.30 +			if (!status.isEmpty() ) statusMessage (status);
    1.31 +
    1.32  		} else
    1.33  			textEditor->setInactive();
    1.34  
    1.35 -		// Show URL and link in statusbar	
    1.36 -		QString status;
    1.37 -		QString s=model->getURL();
    1.38 -		if (!s.isEmpty() ) status+="URL: "+s+"  ";
    1.39 -		s=model->getVymLink();
    1.40 -		if (!s.isEmpty() ) status+="Link: "+s;
    1.41 -		if (!status.isEmpty() ) statusMessage (status);
    1.42 -
    1.43 -		// Update Toolbar 
    1.44 -		//updateFlagsToolbar();  // FIXME-0, was so far in BranchObj
    1.45 -
    1.46 -
    1.47  		updateActions();
    1.48  	}
    1.49  }
    1.50 @@ -3322,15 +3321,11 @@
    1.51  void Main::updateActions()
    1.52  {
    1.53  	VymModel  *m =currentModel();
    1.54 -	LinkableMapObj *selection;
    1.55  	if (m) 
    1.56  	{
    1.57  		// Printing
    1.58  		actionFilePrint->setEnabled (true);
    1.59  
    1.60 -		// Selection
    1.61 -		selection=m->getSelectedLMO();
    1.62 -
    1.63  		// Link style in context menu
    1.64  		switch (m->getMapLinkStyle())
    1.65  		{
    1.66 @@ -3366,9 +3361,6 @@
    1.67  	{
    1.68  		// Printing
    1.69  		actionFilePrint->setEnabled (false);
    1.70 -
    1.71 -		// Selection
    1.72 -		selection=NULL;
    1.73  	}
    1.74  
    1.75  	// updateActions is also called when NoteEditor is closed
    1.76 @@ -3428,7 +3420,10 @@
    1.77  				}
    1.78  			}
    1.79  			*/
    1.80 -
    1.81 +			//Standard Flags
    1.82 +			standardFlagsMaster->updateToolBar (selbi->activeStandardFlagNames() );
    1.83 +
    1.84 +			// System Flags
    1.85  			actionToggleScroll->setEnabled (true);
    1.86  			if ( selbi->isScrolled() )
    1.87  				actionToggleScroll->setOn(true);
    1.88 @@ -3479,8 +3474,7 @@
    1.89  			for (int i=0; i<actionListBranches.size(); ++i)	
    1.90  				actionListBranches.at(i)->setEnabled(true);
    1.91  			actionDelete->setEnabled (true);
    1.92 -			actionFormatHideLinkUnselected->setOn
    1.93 -				(selection->getHideLinkUnselected());
    1.94 +			//FIXME-2 actionFormatHideLinkUnselected->setOn (selection->getHideLinkUnselected());
    1.95  		}
    1.96  		if ( selti->getType()==TreeItem::Image)
    1.97  		{
    1.98 @@ -3602,6 +3596,7 @@
    1.99  			currentModel()->toggleStandardFlag(sender()->name(),standardFlagsMaster);
   1.100  		else	
   1.101  			currentModel()->toggleStandardFlag(sender()->name());
   1.102 +		updateActions();	
   1.103  	}
   1.104  }
   1.105  
     2.1 --- a/mapcenteritem.cpp	Fri May 15 15:22:15 2009 +0000
     2.2 +++ b/mapcenteritem.cpp	Mon May 18 09:41:31 2009 +0000
     2.3 @@ -6,6 +6,7 @@
     2.4  
     2.5  MapCenterItem::MapCenterItem(const QList<QVariant> &data, TreeItem *parent):BranchItem (data,parent)
     2.6  {
     2.7 +	//cout << "Constr. MapCenterItem\n";
     2.8  	type=MapCenter;
     2.9  }
    2.10  
     3.1 --- a/treeitem.cpp	Fri May 15 15:22:15 2009 +0000
     3.2 +++ b/treeitem.cpp	Mon May 18 09:41:31 2009 +0000
     3.3 @@ -13,6 +13,7 @@
     3.4  
     3.5  TreeItem::TreeItem(const QList<QVariant> &data, TreeItem *parent):MapItem()
     3.6  {
     3.7 +	//cout << "Constructor TreeItem "<<endl;
     3.8  	init();
     3.9      parentItem = parent;
    3.10      itemData = data;
    3.11 @@ -340,7 +341,6 @@
    3.12  void TreeItem::setNoteObj(const NoteObj &n, bool updateNoteEditor) //FIXME-1 setNoteObj is called for every select or so???
    3.13  {
    3.14  	note=n;
    3.15 -	cout << "TI::setNoteObj of "<<getHeadingStd()<<endl;
    3.16  	if (!note.isEmpty() && !systemFlags.isActive ("system-note"))
    3.17  		systemFlags.activate ("system-note");
    3.18  	if (note.isEmpty() && systemFlags.isActive ("system-note"))
    3.19 @@ -411,6 +411,17 @@
    3.20  	return standardFlags.activeFlagNames();
    3.21  }
    3.22  
    3.23 +FlagRow* TreeItem::getStandardFlagRow()
    3.24 +{
    3.25 +	return &standardFlags;
    3.26 +}
    3.27 +
    3.28 +/*
    3.29 +void TreeItem::updateToolBar()
    3.30 +{
    3.31 +	standardFlags.updateToolBar();
    3.32 +}
    3.33 +*/
    3.34  QStringList TreeItem::activeSystemFlagNames ()	//FIXME-1 missing: scrolled-tmp,hideInExport
    3.35  {
    3.36  	return systemFlags.activeFlagNames();
     4.1 --- a/treeitem.h	Fri May 15 15:22:15 2009 +0000
     4.2 +++ b/treeitem.h	Mon May 18 09:41:31 2009 +0000
     4.3 @@ -120,6 +120,9 @@
     4.4  	virtual void toggleStandardFlag(const QString &flag, FlagRow *master=NULL);
     4.5  	virtual bool isActiveStandardFlag (const QString &flag);
     4.6  	virtual QStringList activeStandardFlagNames();
     4.7 +	virtual FlagRow* getStandardFlagRow ();
     4.8 +	//virtual void updateToolBar();
     4.9 +
    4.10  	virtual QStringList activeSystemFlagNames();
    4.11  
    4.12  
     5.1 --- a/version.h	Fri May 15 15:22:15 2009 +0000
     5.2 +++ b/version.h	Mon May 18 09:41:31 2009 +0000
     5.3 @@ -7,7 +7,7 @@
     5.4  #define __VYM_VERSION "1.13.0"
     5.5  //#define __VYM_CODENAME "Codename: RC-1"
     5.6  #define __VYM_CODENAME "Codename: development version, not for production!"
     5.7 -#define __VYM_BUILD_DATE "2009-05-15"
     5.8 +#define __VYM_BUILD_DATE "2009-05-18"
     5.9  
    5.10  
    5.11  bool checkVersion(const QString &);