vymview.cpp
changeset 742 54d44ecd6097
parent 735 84ae10f6e3a3
child 745 2d4cc445a86a
     1.1 --- a/vymview.cpp	Fri Mar 06 15:02:58 2009 +0000
     1.2 +++ b/vymview.cpp	Thu Mar 19 11:45:28 2009 +0000
     1.3 @@ -1,6 +1,7 @@
     1.4  #include "vymview.h"
     1.5  
     1.6  #include <iostream>
     1.7 +using namespace std;
     1.8  
     1.9  #include "mainwindow.h"
    1.10  #include "mapeditor.h"
    1.11 @@ -8,8 +9,10 @@
    1.12  extern Main *mainWindow;
    1.13  
    1.14  
    1.15 -VymView::VymView(VymModel *model)
    1.16 +VymView::VymView(VymModel *m)
    1.17  {
    1.18 +	model=m;
    1.19 +
    1.20  	// Create TreeView
    1.21  	treeview=new QTreeView;
    1.22  	treeview->setModel ((QAbstractItemModel*)model);
    1.23 @@ -61,11 +64,28 @@
    1.24  }
    1.25  
    1.26  
    1.27 -void VymView::changeSelection (const QItemSelection &newSel, const QItemSelection &delSel)
    1.28 +void VymView::changeSelection (const QItemSelection &, const QItemSelection &)
    1.29  {
    1.30 -	// FIXME Currently this works only from treeview->ME
    1.31 -	treeview->expandAll();	//FIXME only for testing
    1.32 +	cout << "VymView::changeSelection (newsel,delsel)\n";
    1.33 +	//treeview->expandAll();	//FIXME only for testing
    1.34  
    1.35  	//((VymModel*)treeview->model())->select ();
    1.36 +
    1.37 +	// Show URL and link in statusbar
    1.38 +	QString status;
    1.39 +	QString s=model->getURL();
    1.40 +	if (!s.isEmpty() ) status+="URL: "+s+"  ";
    1.41 +	s=model->getVymLink();
    1.42 +	if (!s.isEmpty() ) status+="Link: "+s;
    1.43 +	if (!status.isEmpty() ) mainWindow->statusMessage (status);
    1.44 +
    1.45 +/* FIXME, was so far in BranchObj
    1.46 +	// Update Toolbar
    1.47 +	//updateFlagsToolbar();
    1.48 +
    1.49 +*/
    1.50 +
    1.51 +	// Update actions
    1.52 +	mainWindow->updateActions();
    1.53  }
    1.54