# HG changeset patch # User insilmaril # Date 1266587223 0 # Node ID 0bba81dde1bc14dd29c7a041551a8beb047ed3d4 # Parent c2ce9944148c7f0d9b32aa3cf857967a073fdee2 More fixes diff -r c2ce9944148c -r 0bba81dde1bc attributeitem.cpp --- a/attributeitem.cpp Wed Feb 10 13:48:42 2010 +0000 +++ b/attributeitem.cpp Fri Feb 19 13:47:03 2010 +0000 @@ -9,10 +9,6 @@ AttributeItem::AttributeItem(const QList &data, TreeItem *parent):BranchItem (data,parent) { TreeItem::setType (Attribute); - //table=NULL; - //definition=NULL; - type=Attribute; - internal=false; } @@ -20,6 +16,20 @@ { } +void AttributeItem::set (const QString &k, const QString &v, const Type &t) +{ + key=k; + value=QVariant (v); + setHeading (QString ("K: %1 | V: %2").arg(key).arg(value.toString())); +} + +void AttributeItem::get (QString &k, QString &v, Type &t) +{ + k=key; + v=value.toString(); + t=attrType; +} + void AttributeItem::setKey (const QString &k, const Type &t) { /* @@ -145,6 +155,16 @@ */ } +void AttributeItem::setInternal(bool b) +{ + internal=b; +} + +bool AttributeItem::isInternal() +{ + return internal; +} + QString AttributeItem::getDataXML() { QString a=beginElement ("attribute"); diff -r c2ce9944148c -r 0bba81dde1bc attributeitem.h --- a/attributeitem.h Wed Feb 10 13:48:42 2010 +0000 +++ b/attributeitem.h Fri Feb 19 13:47:03 2010 +0000 @@ -11,7 +11,7 @@ A list of these tables AttributeTable is maintained for every MapEditor. */ class AttributeItem:public BranchItem { - +public: enum Type { Undefined, //!< Undefined type IntList, //!< Free integer @@ -21,9 +21,10 @@ UniqueString//!< UniqueString, e.g. for IDs }; -public: AttributeItem(const QList &data, TreeItem *parent = 0); virtual ~AttributeItem(); + void set (const QString &k, const QString &v, const Type &t); + void get (QString &k, QString &v, Type &t); void setKey (const QString &k, const Type &t); QString getKey (); void setValue (const QString &v); @@ -31,10 +32,14 @@ void setType (const Type &t); AttributeItem::Type getAttributeType (); QString getTypeString (); + void setInternal (bool b); + bool isInternal(); QString getDataXML(); protected: - QString freeString; //!< String value for type FreeString bool internal; //!< Internal attributes cannot be edited by user + QString key; + QVariant value; + Type attrType; }; #endif diff -r c2ce9944148c -r 0bba81dde1bc branchitem.cpp --- a/branchitem.cpp Wed Feb 10 13:48:42 2010 +0000 +++ b/branchitem.cpp Fri Feb 19 13:47:03 2010 +0000 @@ -299,28 +299,24 @@ do { madeChanges=false; - if (inverse) - for(curChildIndex=1;curChildIndexgetHeading().compare(curChild->getHeading())<0) { model->moveUp (curChild); madeChanges=true; } - } - else - for(curChildIndex=1;curChildIndexgetHeading().compare(curChild->getHeading())>0) + } else + if (prevChild->getHeading().compare(curChild->getHeading())>0) { - model->moveUp(curChild); + model->moveUp (curChild); madeChanges=true; } - } + } }while(madeChanges); } diff -r c2ce9944148c -r 0bba81dde1bc branchobj.cpp --- a/branchobj.cpp Wed Feb 10 13:48:42 2010 +0000 +++ b/branchobj.cpp Fri Feb 19 13:47:03 2010 +0000 @@ -39,18 +39,6 @@ model->stopAnimation (this); } - // Check, if this branch was the last child to be deleted - // If so, unset the scrolled flags in parent // FIXME-2 better do this in model? - - /* - BranchObj *po=(BranchObj*)parObj; - BranchObj *bo; - if (po) - { - bo=((BranchObj*)parObj)->getLastBranch(); - if (bo) po->unScroll(); - } - */ clear(); } @@ -465,11 +453,12 @@ heading->setFont(font ); if (mod==NewBranch && !keepFrame) - if (treeItem->depth()==0) - setFrameType (FrameObj::Rectangle); - else - setFrameType (FrameObj::NoFrame); - + { + if (treeItem->depth()==0) + setFrameType (FrameObj::Rectangle); + else + setFrameType (FrameObj::NoFrame); + } if (mod==NewBranch) setColor (treeItem->getHeadingColor() ); else @@ -630,31 +619,6 @@ treeItem->getBranchObjNum(i)->unsetAllRepositionRequests(); } - -QRectF BranchObj::getTotalBBox() // FIXME-2 not really needed, get rid of this -{ - QRectF r=bbox; - - if ( ((BranchItem*)treeItem)->isScrolled() ) return r; - -/* FIXME-2 really include children _here_ ? likely not needed anymore, but done in TreeItem */ - for (int i=0; ibranchCount(); ++i) - if (!treeItem->getBranchNum(i)->isHidden()) - r=addBBox(treeItem->getBranchObjNum(i)->getTotalBBox(),r); - -/* FIXME-3 lots of occurences of treeItem->getBranchObjNum(i) in branchobj.cpp - better check if they are not NULL and maybe simplify... - (have been NULL at least in calcBBoxSizeWithChilds...) -*/ - -/* FIXME-2 in - for (int i=0; iimageCount(); ++i - if (!treeItem->isHidden()) - r=addBBox(treeItem->getImageObjNum(i)->getTotalBBox(),r); -*/ - return r; -} - QRectF BranchObj::getBBoxSizeWithChildren() { return bboxTotal; @@ -678,7 +642,7 @@ return MapObj::getBoundingPolygon(); } - calcBBoxSizeWithChildren(); //FIXME-2 really needed? + calcBBoxSizeWithChildren(); //FIXME-3 really needed? QPolygonF p; p<getID(); + modelID=bi->getModel()->getID(); + bugID=bug; + + script="test/vym-bug.pl"; + + p=new Process; + + connect (p, SIGNAL (finished(int,QProcess::ExitStatus) ), + this, SLOT (processFinished(int,QProcess::ExitStatus) )); + + p->start (script,QStringList()<waitForStarted()) + { + qWarning()<<"BugAgent::getBugzillaData couldn't start "<getModel (modelID); + if (model) + { + BranchItem *bi=(BranchItem*)(model->findID (branchID)); + if (bi) + { + QString oldsel=model->getSelectString (); + model->select (bi); + + // Now do needed changes: + + QString result=p->getStdout(); + while (result.endsWith("\n")) result.chop(1); + //qWarning() << QString(result); + QString err=p->getErrout(); + if (!err.isEmpty()) + { + qWarning() << "VM::BugAgent Error:\n"; + qWarning() <setHeading (bugID + " - " + heading); + qDebug() << "VM: heading="<select (oldsel); + } else + qWarning ()<<"BugAgent: Found model, but not branch #"<%1").arg(quotemeta(current->getHeading())); s+=""; - QRectF fbox=current->getBBoxFlag ("system-url"); + QRectF fbox=current->getBBoxURLFlag (); if (vis) imageMap+=QString(" \n") .arg(fbox.left()-offset.x()) diff -r c2ce9944148c -r 0bba81dde1bc flag.cpp --- a/flag.cpp Wed Feb 10 13:48:42 2010 +0000 +++ b/flag.cpp Fri Feb 19 13:47:03 2010 +0000 @@ -1,7 +1,6 @@ #include "flag.h" -#include -using namespace std; +#include ///////////////////////////////////////////////////////////////// // Flag @@ -49,7 +48,8 @@ void Flag::load (const QString &fn) { - pixmap.load(fn); + if (!pixmap.load(fn)) + qDebug()<<"Flag::load failed to load "< + #include "flagrow.h" -#include -using namespace std; - ///////////////////////////////////////////////////////////////// // FlagRow ///////////////////////////////////////////////////////////////// @@ -47,9 +46,12 @@ } -bool FlagRow::isActive (const QString &name) +bool FlagRow::isActive (const QString &name) //FIXME-2 regression { - return activeNames.contains (name); + QString n; + foreach (n,activeNames) + if (n==name) return true; + return false; } void FlagRow::toggle (const QString &name, FlagRow *masterRow) @@ -76,14 +78,14 @@ void FlagRow::activate (const QString &name) { - if (!activeNames.contains (name)) + if (!isActive (name)) activeNames.append (name); else qWarning (QString("FlagRow::activate - %1 is already active").arg(name)); } -void FlagRow::deactivate (const QString &name) +void FlagRow::deactivate (const QString &name) //FIXME-4 complaints if CTRL-E is pressed with focus on NoteEditor ?! { int n=activeNames.indexOf (name); if (n>=0) @@ -142,23 +144,22 @@ void FlagRow::setMasterRow (FlagRow *row) { - masterRow=row; + masterRow=row; } void FlagRow::updateToolBar (const QStringList &activeNames) { if (toolBar ) { - if (activeNames.isEmpty() ) - for (int i=0;igetAction()->setChecked (false); - else - for (int i=0;igetAction()->setChecked ( - activeNames.contains (flags.at(i)->getName())); + for (int i=0;igetAction()->setChecked (false); + for (int i=0;igetName()); + if (n>=0) + flags.at(i)->getAction()->setChecked (true); + } } - return; - } diff -r c2ce9944148c -r 0bba81dde1bc floatimageobj.cpp --- a/floatimageobj.cpp Wed Feb 10 13:48:42 2010 +0000 +++ b/floatimageobj.cpp Fri Feb 19 13:47:03 2010 +0000 @@ -8,15 +8,6 @@ // FloatImageObj ///////////////////////////////////////////////////////////////// -/* FIXME-3 -FloatImageObj::FloatImageObj ():FloatObj() -{ -// cout << "Const FloatImageObj ()\n"; - setParObj (this); - init(); -} -*/ - FloatImageObj::FloatImageObj (QGraphicsScene* s,TreeItem *ti):FloatObj(s,ti) { //cout << "Const FloatImageObj s="< -using namespace std; +#include "mapitem.h" ///////////////////////////////////////////////////////////////// // FloatObj @@ -19,13 +17,11 @@ // cout << "Destr FloatObj\n"; } -#include -using namespace std; void FloatObj::init () { zPlane=Z_ICON; setLinkStyle (LinkableMapObj::Parabel); - //FIXME-2 setHideLinkUnselected(true); + ((MapItem*)treeItem)->setHideLinkUnselected(true); } void FloatObj::copy (FloatObj* other) @@ -66,11 +62,6 @@ updateLinkGeometry(); } -QRectF FloatObj::getTotalBBox() -{ - return bbox; -} - QRectF FloatObj::getBBoxSizeWithChildren() { return bboxTotal; diff -r c2ce9944148c -r 0bba81dde1bc floatobj.h --- a/floatobj.h Wed Feb 10 13:48:42 2010 +0000 +++ b/floatobj.h Fri Feb 19 13:47:03 2010 +0000 @@ -22,7 +22,6 @@ virtual void setDockPos(); virtual void reposition(); - virtual QRectF getTotalBBox(); // return BBox including children virtual QRectF getBBoxSizeWithChildren(); // return size of BBox including children protected: diff -r c2ce9944148c -r 0bba81dde1bc linkablemapobj.cpp --- a/linkablemapobj.cpp Wed Feb 10 13:48:42 2010 +0000 +++ b/linkablemapobj.cpp Fri Feb 19 13:47:03 2010 +0000 @@ -272,12 +272,6 @@ return style; } -void LinkableMapObj::setHideLinkUnselected() -{ - setVisibility (visible); - updateLinkGeometry(); -} - void LinkableMapObj::setLinkPos(Position lp) { linkpos=lp; diff -r c2ce9944148c -r 0bba81dde1bc linkablemapobj.h --- a/linkablemapobj.h Wed Feb 10 13:48:42 2010 +0000 +++ b/linkablemapobj.h Fri Feb 19 13:47:03 2010 +0000 @@ -73,7 +73,6 @@ void setLinkStyle(Style); Style getLinkStyle(); - void setHideLinkUnselected(); void setLinkPos (Position); Position getLinkPos (); 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(); diff -r c2ce9944148c -r 0bba81dde1bc mainwindow.h --- a/mainwindow.h Wed Feb 10 13:48:42 2010 +0000 +++ b/mainwindow.h Fri Feb 19 13:47:03 2010 +0000 @@ -73,6 +73,8 @@ void showEvent (QShowEvent * ); MapEditor* currentMapEditor() const; VymModel* currentModel() const; +public: + VymModel* getModel(uint) const; private slots: void editorChanged(QWidget*); @@ -209,6 +211,7 @@ void settingsToggleAnimation(); void windowToggleNoteEditor(); + void windowToggleTreeEditor(); void windowToggleHistory(); void windowToggleProperty(); void updateHistory(SimpleSettings &); @@ -355,6 +358,7 @@ QAction *actionFormatHideLinkUnselected; QAction *actionViewToggleNoteEditor; + QAction *actionViewToggleTreeEditor; QAction *actionViewToggleHistoryWindow; QAction *actionViewTogglePropertyWindow; QAction *actionViewToggleAntiAlias; diff -r c2ce9944148c -r 0bba81dde1bc mapeditor.cpp --- a/mapeditor.cpp Wed Feb 10 13:48:42 2010 +0000 +++ b/mapeditor.cpp Fri Feb 19 13:47:03 2010 +0000 @@ -1,8 +1,6 @@ #include "mapeditor.h" -#include -#include -#include +#include #include @@ -89,13 +87,13 @@ a = new QAction( "Select left branch", this); a->setShortcut (Qt::Key_Left ); // a->setShortcutContext (Qt::WindowShortcut); - a->setShortcutContext (Qt::WidgetWithChildrenShortcut); +// a->setShortcutContext (Qt::WidgetWithChildrenShortcut); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( cursorLeft() ) ); a = new QAction( "Select child branch", this); a->setShortcut (Qt::Key_Right); - a->setShortcutContext (Qt::WidgetWithChildrenShortcut); +// a->setShortcutContext (Qt::WidgetWithChildrenShortcut); addAction (a); connect( a, SIGNAL( triggered() ), this, SLOT( cursorRight() ) ); @@ -940,7 +938,9 @@ editingHeading=false; lineEdit->releaseKeyboard(); lineEdit->clearFocus(); - model->setHeading (lineEdit->text() ); + QString s=lineEdit->text(); + s.replace (QRegExp ("\\n")," "); // Don't paste newline chars + model->setHeading (s); model->setSelectionBlocked(false); delete (lineEdit); @@ -1055,7 +1055,7 @@ { // systemFlag clicked model->select (lmo); - if (foname=="system-url") + if (foname.contains("system-url")) { if (e->state() & Qt::ControlModifier) mainWindow->editOpenURLTab(); diff -r c2ce9944148c -r 0bba81dde1bc mapitem.cpp --- a/mapitem.cpp Wed Feb 10 13:48:42 2010 +0000 +++ b/mapitem.cpp Fri Feb 19 13:47:03 2010 +0000 @@ -3,6 +3,8 @@ #include "linkablemapobj.h" #include "ornamentedobj.h" +#include + MapItem::MapItem() { init(); @@ -62,7 +64,12 @@ void MapItem::setHideLinkUnselected (bool b) { hideLinkUnselected=b; - if (lmo) lmo->setHideLinkUnselected(); + if (lmo) + { + //lmo->setHideLinkUnselected(); + lmo->setVisibility (lmo->isVisibleObj()); + lmo->updateLinkGeometry(); + } } bool MapItem::getHideLinkUnselected() @@ -104,6 +111,17 @@ return s; } +QRectF MapItem::getBBoxURLFlag () +{ + QStringList list=systemFlags.activeFlagNames().filter ("system-url"); + if (list.count()>1) + { + qWarning()<<"MapItem::getBBoxURLFlag found more than one system-url*"; + return QRectF (); + } + return getBBoxFlag (list.first()); +} + QRectF MapItem::getBBoxFlag (const QString &fname) { if (lmo) diff -r c2ce9944148c -r 0bba81dde1bc mapitem.h --- a/mapitem.h Wed Feb 10 13:48:42 2010 +0000 +++ b/mapitem.h Fri Feb 19 13:47:03 2010 +0000 @@ -54,6 +54,7 @@ virtual QString getMapAttr(); //! Get attributes for saving as XML + virtual QRectF getBBoxURLFlag();//! get bbox of url flag virtual QRectF getBBoxFlag (const QString &fname); //! get bbox of flag diff -r c2ce9944148c -r 0bba81dde1bc tex/vym.changelog --- a/tex/vym.changelog Wed Feb 10 13:48:42 2010 +0000 +++ b/tex/vym.changelog Fri Feb 19 13:47:03 2010 +0000 @@ -1,3 +1,19 @@ +------------------------------------------------------------------- +Fri Feb 19 08:05:02 CET 2010 - vym@insilmaril.de + +- Bugfix: Fixed regression of flags + +------------------------------------------------------------------- +Wed Feb 17 16:31:34 CET 2010 - vym@insilmaril.de + +- Bugfix: When pasting a heading into the LineEdit, newlines are removed + to avoid broken rendering + +------------------------------------------------------------------- +Wed Feb 17 11:49:09 CET 2010 - vym@insilmaril.de + +- Feature: Novell Bugzilla now has extra flag + ------------------------------------------------------------------- Wed Feb 10 14:47:49 CET 2010 - vym@insilmaril.de diff -r c2ce9944148c -r 0bba81dde1bc texteditor.cpp --- a/texteditor.cpp Wed Feb 10 13:48:42 2010 +0000 +++ b/texteditor.cpp Fri Feb 19 13:47:03 2010 +0000 @@ -521,7 +521,8 @@ // Load note QFileDialog *fd=new QFileDialog( this); QStringList types; - types<< "VYM notes (*.html)" << + types<< "Text (*.txt *.html)"<< + "VYM notes and HTML (*.html)" << "ASCII texts (*.txt)" << "All filed (*)"; fd->setFilters (types); diff -r c2ce9944148c -r 0bba81dde1bc treeitem.cpp --- a/treeitem.cpp Wed Feb 10 13:48:42 2010 +0000 +++ b/treeitem.cpp Fri Feb 19 13:47:03 2010 +0000 @@ -52,7 +52,7 @@ { model=NULL; - // Reset ID //FIXME-2 compare objID (string), so far only used for xLinks during load/save (Id=selString) + // Assign ID idLast++; id=idLast; @@ -342,9 +342,26 @@ { url=u; if (!url.isEmpty()) - systemFlags.activate ("system-url"); + { + if (url.contains ("bugzilla.novell.com")) + { + systemFlags.activate ("system-url-bugzilla-novell"); + if (systemFlags.isActive ("system-url")) + systemFlags.deactivate ("system-url"); + } else + { + systemFlags.activate ("system-url"); + if (systemFlags.isActive ("system-url-bugzilla-novell")) + systemFlags.deactivate ("system-url-bugzilla-novell"); + } + } else - systemFlags.deactivate ("system-url"); + { + if (systemFlags.isActive ("system-url")) + systemFlags.deactivate ("system-url"); + if (systemFlags.isActive ("system-url-bugzilla-novell")) + systemFlags.deactivate ("system-url-bugzilla-novell"); + } } QString TreeItem::getURL () @@ -520,14 +537,10 @@ TreeItem* TreeItem::findID (const uint &n) { - if (n>=0 && nid) - return childItems.at(n); - } - else - return NULL; + for (int i=0;iid) + return childItems.at(n); + return NULL; } @@ -635,14 +648,14 @@ } -void TreeItem::setHideTmp (HideTmpMode mode) //FIXME-2 update visibility in derived objects +void TreeItem::setHideTmp (HideTmpMode mode) //FIXME-3 update visibility in derived objects { if (type==Image || type==Branch || type==MapCenter) // ((ImageItem*)this)->updateVisibility(); { LinkableMapObj* lmo=((MapItem*)this)->getLMO(); - if (mode==HideExport && (hideExport || hasHiddenExportParent() ) ) // FIXME-2 try to avoid calling hasScrolledParent repeatedly + if (mode==HideExport && (hideExport || hasHiddenExportParent() ) ) // FIXME-3 try to avoid calling hasScrolledParent repeatedly { // Hide stuff according to hideExport flag and parents diff -r c2ce9944148c -r 0bba81dde1bc version.h --- a/version.h Wed Feb 10 13:48:42 2010 +0000 +++ b/version.h Fri Feb 19 13:47:03 2010 +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 "2010-02-10" +#define __VYM_BUILD_DATE "2010-02-19" bool checkVersion(const QString &); diff -r c2ce9944148c -r 0bba81dde1bc vym.pro --- a/vym.pro Wed Feb 10 13:48:42 2010 +0000 +++ b/vym.pro Fri Feb 19 13:47:03 2010 +0000 @@ -41,6 +41,7 @@ branchitem.h \ branchobj.h \ branchpropwindow.h\ + bugagent.h \ editxlinkdialog.h \ exportoofiledialog.h \ exportxhtmldialog.h\ @@ -106,6 +107,7 @@ branchitem.cpp \ branchobj.cpp \ branchpropwindow.cpp \ + bugagent.cpp \ editxlinkdialog.cpp \ exportoofiledialog.cpp \ exports.cpp \ diff -r c2ce9944148c -r 0bba81dde1bc vymmodel.cpp --- a/vymmodel.cpp Wed Feb 10 13:48:42 2010 +0000 +++ b/vymmodel.cpp Fri Feb 19 13:47:03 2010 +0000 @@ -6,6 +6,7 @@ #include "attributeitem.h" #include "treeitem.h" #include "branchitem.h" +#include "bugagent.h" #include "editxlinkdialog.h" #include "exports.h" #include "exportxhtmldialog.h" @@ -48,9 +49,7 @@ extern Settings settings; - - -int VymModel::mapNum=0; // make instance +uint VymModel::idLast=0; // make instance VymModel::VymModel() { @@ -83,7 +82,8 @@ mapScene=NULL; // History - mapNum++; + idLast++; + mapID=idLast; mapChanged=false; mapDefault=true; mapUnsaved=false; @@ -145,14 +145,14 @@ //Initialize DBUS object adaptorModel=new AdaptorModel(this); // Created and not deleted as documented in Qt - if (!dbusConnection.registerObject (QString("/vymmodel_%1").arg(mapNum),this)) + if (!dbusConnection.registerObject (QString("/vymmodel_%1").arg(mapID),this)) qWarning ("VymModel: Couldn't register DBUS object!"); } void VymModel::makeTmpDirectories() { // Create unique temporary directories - tmpMapDir = tmpVymDir+QString("/model-%1").arg(mapNum); + tmpMapDir = tmpVymDir+QString("/model-%1").arg(mapID); histPath = tmpMapDir+"/history"; QDir d; d.mkdir (tmpMapDir); @@ -169,7 +169,7 @@ return blockReposition; } -void VymModel::updateActions() // FIXME-2 maybe don't update if blockReposition is set +void VymModel::updateActions() // FIXME-4 maybe don't update if blockReposition is set { //cout << "VM::updateActions \n"; // Tell mainwindow to update states of actions @@ -354,8 +354,6 @@ if (lmode==NewMap) { selModel->clearSelection(); - // FIXME-2 VM not needed??? model->setMapEditor(this); - // (map state is set later at end of load...) } else { BranchItem *bi=getSelectedBranch(); @@ -470,7 +468,7 @@ file.close(); if ( ok ) { - reposition(); // FIXME-2 VM reposition the view instead... + reposition(); emitSelectionChanged(); if (lmode==NewMap) { @@ -952,7 +950,7 @@ QDateTime tmod=QFileInfo (filePath).lastModified(); if (tmod>fileChangedTime) { - // FIXME-2 VM switch to current mapeditor and finish lineedits... + // FIXME-3 VM switch to current mapeditor and finish lineedits... QMessageBox mb( vymName, tr("The file of the map on disk has changed:\n\n" " %1\n\nDo you want to reload that map with the new file?").arg(filePath), @@ -1877,7 +1875,7 @@ } } -void VymModel::setHideLinkUnselected (bool b) // FIXME-2 Images still have visible link after load +void VymModel::setHideLinkUnselected (bool b) { TreeItem *ti=getSelectedItem(); if (ti && (ti->getType()==TreeItem::Image ||ti->isBranchLikeType())) @@ -2489,7 +2487,7 @@ return false; } -void VymModel::deleteSelection() +void VymModel::deleteSelection() //FIXME-2 xLinks in a deleted subtree are not restored on undo { BranchItem *selbi=getSelectedBranch(); @@ -2532,7 +2530,7 @@ emitShowSelection(); } else if (ti->getType()==TreeItem::XLink) { - //FIXME-2 savestate missing + //FIXME-2 savestate for deleting xlink missing deleteItem (ti); } else qWarning ("VymmModel::deleteSelection() unknown type?!"); @@ -2728,7 +2726,7 @@ // saveState & reposition are called in above functions } -void VymModel::unscrollChildren() //FIXME-2 does not update flag yet, possible segfault +void VymModel::unscrollChildren() { BranchItem *selbi=getSelectedBranch(); BranchItem *prev=NULL; @@ -2929,72 +2927,19 @@ void VymModel::getBugzillaData() { - TreeItem *selti=getSelectedItem(); - if (selti) + BranchItem *selbi=getSelectedBranch(); + if (selbi) { - QString url=selti->getURL(); + QString url=selbi->getURL(); if (!url.isEmpty()) { QRegExp rx("(\\d+)"); if (rx.indexIn(url) !=-1) { QString bugID=rx.cap(1); - cout << "VM::getBugzillaData bug="<selectedFile()+"\")", QString("Set vymlink of %1 to %2").arg(getObjectName(bi)).arg(fd->selectedFile()) ); - setVymLink (fd->selectedFile() ); // FIXME-2 ok? + setVymLink (fd->selectedFile() ); } } } -void VymModel::setVymLink (const QString &s) // FIXME-3 no savestate? +void VymModel::setVymLink (const QString &s) { // Internal function, no saveState needed TreeItem *selti=getSelectedItem(); @@ -3297,7 +3242,7 @@ parser.setError (Aborted,"Type of selection is not a branch"); } else if (parser.checkParCount(0)) { - selbi->deactivateAllStandardFlags(); + selbi->deactivateAllStandardFlags(); //FIXME-2 this probably should emitDataChanged and also setChanged. Similar all other direct changes should be done... } ///////////////////////////////////////////////////////////////////// } else if (com=="colorBranch") @@ -4151,7 +4096,6 @@ // Any errors? if (parser.errorLevel()==NoError) { - // setChanged(); FIXME-2 should not be called e.g. for export?! reposition(); errorMsg.clear(); noErr=true; @@ -4536,6 +4480,11 @@ return linkstyle; } +uint VymModel::getID() +{ + return mapID; +} + void VymModel::setMapDefLinkColor(QColor col) { if ( !col.isValid() ) return; diff -r c2ce9944148c -r 0bba81dde1bc vymmodel.h --- a/vymmodel.h Wed Feb 10 13:48:42 2010 +0000 +++ b/vymmodel.h Fri Feb 19 13:47:03 2010 +0000 @@ -34,6 +34,9 @@ QString comment; QDate date; + static uint idLast; //! the last used unique ID + uint mapID; + public: VymModel(); ~VymModel (); @@ -42,6 +45,7 @@ void makeTmpDirectories(); //!< create temporary directories e.g. for history MapEditor* getMapEditor(); // FIXME-2 still necessary? + uint getID(); //! Return unique ID of model bool isRepositionBlocked(); //!< While load or undo there is no need to update graphicsview diff -r c2ce9944148c -r 0bba81dde1bc vymview.cpp --- a/vymview.cpp Wed Feb 10 13:48:42 2010 +0000 +++ b/vymview.cpp Fri Feb 19 13:47:03 2010 +0000 @@ -72,7 +72,7 @@ mapEditor,SLOT (updateSelection(const QItemSelection &,const QItemSelection &))); */ - // FIXME-2 testing, if that reenables updating selbox during animation + // Needed to update selbox during animation connect ( model, SIGNAL (selectionChanged(const QItemSelection &, const QItemSelection &)), mapEditor,SLOT (updateSelection(const QItemSelection &,const QItemSelection &))); @@ -184,7 +184,7 @@ //cout << "VV::changeProxySelection newsel.count="<setCurrentIndex ( newsel.indexes().first(), @@ -319,3 +319,12 @@ if (mapEditor) mapEditor->setFocus(); } +void VymView::toggleTreeEditor() +{ + if (treeEditor->isVisible() ) + treeEditor->hide(); + else + treeEditor->show(); +} + + diff -r c2ce9944148c -r 0bba81dde1bc vymview.h --- a/vymview.h Wed Feb 10 13:48:42 2010 +0000 +++ b/vymview.h Fri Feb 19 13:47:03 2010 +0000 @@ -32,6 +32,7 @@ void hideFindWidget(); void findNext (QString s); void findReset(); + void toggleTreeEditor(); private: VymModel *model; diff -r c2ce9944148c -r 0bba81dde1bc xml-vym.cpp --- a/xml-vym.cpp Wed Feb 10 13:48:42 2010 +0000 +++ b/xml-vym.cpp Fri Feb 19 13:47:03 2010 +0000 @@ -502,7 +502,7 @@ { lastMI=lastImage; - //if (!readOOAttr(a)) return false; FIXME-3 + if (!readOOAttr(a)) return false; if (!a.value( "href").isEmpty() ) {