diff -r ffb95cd03156 -r 8c028a5d9083 mainwindow.cpp --- a/mainwindow.cpp Thu Apr 30 11:52:49 2009 +0000 +++ b/mainwindow.cpp Fri May 01 10:30:29 2009 +0000 @@ -689,11 +689,6 @@ editMenu->addAction (a); actionSortChildren=a; - a = new QAction( QPixmap(flagsPath+"flag-scrolled-right.png"), tr( "Scroll branch","Edit menu" ),this); - a->setShortcut ( Qt::Key_ScrollLock ); - a->setStatusTip (tr( "Scroll branch" ) ); - connect( a, SIGNAL( triggered() ), this, SLOT( editToggleScroll() ) ); - alt = new QAction( QPixmap(flagsPath+"flag-scrolled-right.png"), tr( "Scroll branch","Edit menu" ), this); alt->setShortcut ( Qt::Key_S ); // Scroll branch alt->setStatusTip (tr( "Scroll branch" )); @@ -712,6 +707,19 @@ addAction (alt); actionListBranches.append(actionToggleScroll); + a = new QAction( QPixmap(), tr( "Expand all branches","Edit menu" ), this); + a->setShortcut ( Qt::SHIFT + Qt::Key_X ); // Expand all branches + a->setStatusTip (tr( "Expand all branches" )); + connect( a, SIGNAL( triggered() ), this, SLOT( editExpandAll() ) ); + actionExpandAll=a; + actionExpandAll->setEnabled (false); + actionExpandAll->setToggleAction(false); + //tb->addAction (actionExpandAll); + editMenu->addAction ( actionExpandAll); + addAction (a); + actionListBranches.append(actionExpandAll); + + a = new QAction( tr( "Unscroll children","Edit menu" ), this); a->setStatusTip (tr( "Unscroll all scrolled branches in selected subtree" )); editMenu->addAction (a); @@ -1773,7 +1781,6 @@ VymView *Main::createView (VymModel *model) { VymView *vm=new VymView (model); - return vm; } @@ -1784,8 +1791,7 @@ //MapEditor* me = new MapEditor (m); //me->setObjectName ("MapEditor"); - VymView *view=createView (m); - tabWidget->addTab (view,tr("unnamed","MainWindow: name for new and empty file")); + tabWidget->addTab (createView (m),tr("unnamed","MainWindow: name for new and empty file")); tabWidget->setCurrentIndex (tabModel.count() ); // For the very first map we do not have flagrows yet... @@ -1867,8 +1873,7 @@ { vm=new VymModel; tabModel.append (vm); - VymView *view=createView (vm); - tabWidget->addTab (view,fn); + tabWidget->addTab (createView (vm),fn); tabIndex=tabWidget->count()-1; tabWidget->setCurrentPage (tabIndex); } @@ -2928,6 +2933,12 @@ if (m) m->toggleScroll(); } +void Main::editExpandAll() +{ + VymModel *m=currentModel(); + if (m) m->emitExpandAll(); +} + void Main::editUnscrollChildren() { VymModel *m=currentModel(); @@ -2995,7 +3006,7 @@ VymModel *m=currentModel(); if ( m) { - BranchItem *bi=m->createBranch(); //FIXME-1 missing: m->addNewBranch (-1); + BranchItem *bi=m->addNewBranch (-1); if (bi) @@ -3017,7 +3028,7 @@ VymModel *m=currentModel(); if (m) { - BranchItem *bi=m->createBranch();//FIXME-1 *newbo=m->addNewBranch (1); + BranchItem *bi=m->addNewBranch (1); if (bi) m->select (bi); @@ -3286,7 +3297,7 @@ void Main::viewCenter() { VymModel *m=currentModel(); - if (m) m->ensureSelectionVisible(); + if (m) m->emitShowSelection(); } void Main::networkStartServer()