diff -r c2ce9944148c -r 0bba81dde1bc mainwindow.cpp --- a/mainwindow.cpp Wed Feb 10 13:48:42 2010 +0000 +++ b/mainwindow.cpp Fri Feb 19 13:47:03 2010 +0000 @@ -1133,6 +1133,15 @@ connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleNoteEditor() ) ); actionViewToggleNoteEditor=a; + a = new QAction(QPixmap(), tr( "Show tree editor","View action" ),this); + a->setStatusTip ( tr( "Show tree editor" )); + a->setShortcut ( Qt::CTRL + Qt::Key_T ); // Toggle Note Editor // FIXME-3 originally: color subtree + a->setToggleAction(true); + a->addTo( tb ); + viewMenu->addAction (a); + connect( a, SIGNAL( triggered() ), this, SLOT(windowToggleTreeEditor() ) ); + actionViewToggleTreeEditor=a; + a = new QAction(QPixmap(iconPath+"history.png"), tr( "History Window","View action" ),this ); a->setStatusTip ( tr( "Show History Window" )); a->setShortcut ( Qt::CTRL + Qt::Key_H ); // Toggle history window @@ -1220,22 +1229,25 @@ Flag *flag=new Flag;; flag->setVisible(true); - flag->load(QPixmap(flagsPath+"flag-note.png")); + flag->load(flagsPath+"flag-note.png"); setupFlag (flag,tb,"system-note",tr("Note","SystemFlag")); - flag->load(QPixmap(flagsPath+"flag-url.png")); + flag->load(flagsPath+"flag-url.png"); setupFlag (flag,tb,"system-url",tr("URL to Document ","SystemFlag")); - flag->load(QPixmap(flagsPath+"flag-vymlink.png")); + flag->load(flagsPath+"flag-url-bugzilla-novell.png"); + setupFlag (flag,tb,"system-url-bugzilla-novell",tr("URL to Bugzilla ","SystemFlag")); + + flag->load(flagsPath+"flag-vymlink.png"); setupFlag (flag,tb,"system-vymLink",tr("Link to another vym map","SystemFlag")); - flag->load(QPixmap(flagsPath+"flag-scrolled-right.png")); + flag->load(flagsPath+"flag-scrolled-right.png"); setupFlag (flag,tb,"system-scrolledright",tr("subtree is scrolled","SystemFlag")); - flag->load(QPixmap(flagsPath+"flag-tmpUnscrolled-right.png")); + flag->load(flagsPath+"flag-tmpUnscrolled-right.png"); setupFlag (flag,tb,"system-tmpUnscrolledRight",tr("subtree is temporary scrolled","SystemFlag")); - flag->load(QPixmap(flagsPath+"flag-hideexport.png")); + flag->load(flagsPath+"flag-hideexport.png"); setupFlag (flag,tb,"system-hideInExport",tr("Hide object in exported maps","SystemFlag")); // Create Standard Flags @@ -1569,13 +1581,13 @@ QAction *a; a = new QAction( "Test function 1" , this); a->setStatusTip( "Call test function 1" ); - a->setShortcut (Qt::CTRL + Qt::Key_T); // Test function 1 //FIXME-2 originally: color subtree + a->setShortcut (Qt::SHIFT + Qt::Key_T); // Test function 1 testMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( testFunction1() ) ); a = new QAction( "Test function 2" , this); a->setStatusTip( "Call test function 2" ); - a->setShortcut (Qt::SHIFT + Qt::Key_T); // Test function 2 + a->setShortcut (Qt::ALT + Qt::Key_T); // Test function 2 testMenu->addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( testFunction2() ) ); @@ -1788,6 +1800,13 @@ return NULL; } +VymModel* Main::getModel(uint id) const +{ + if ( tabWidget->currentPage()) + return vymViews.at(tabWidget->currentIndex())->getModel(); + return NULL; +} + void Main::editorChanged(QWidget *) { @@ -3354,6 +3373,12 @@ windowShowNoteEditor(); } +void Main::windowToggleTreeEditor() +{ + if ( tabWidget->currentPage()) + vymViews.at(tabWidget->currentIndex())->toggleTreeEditor(); +} + void Main::windowToggleHistory() { if (historyWindow->isVisible()) @@ -3754,65 +3779,26 @@ } } + +#include "attributeitem.h" void Main::testFunction1() { - - Process p; - QString script="test/sleep.sh"; - p.start (script); - if (!p.waitForStarted()) + VymModel *m=currentModel(); + if (!m) return; + + BranchItem *selbi=m->getSelectedBranch(); + if (selbi) { - cout <<"VM::getBugzillaData couldn't start "< cData; + cData << "new ai" << "undef"; + + AttributeItem *ai=new AttributeItem (cData,selbi); + ai->set ("Key 1","Val a",AttributeItem::FreeString); + + m->addAttribute (ai); } - //QByteArray result=p.readAll(); - QString result=p.getStdout(); - while (result.endsWith("\n")) result.chop(1); - //cout << QString(result).toStdString()<testFunction1();