# HG changeset patch # User insilmaril # Date 1268235379 0 # Node ID 0fad394bc330313a9bb75d515891458c9efb911c # Parent bfacef6f29c1db4dc838d497b2ca5429ce45537e Minor fixes diff -r bfacef6f29c1 -r 0fad394bc330 findwidget.cpp --- a/findwidget.cpp Tue Mar 09 13:09:05 2010 +0000 +++ b/findwidget.cpp Wed Mar 10 15:36:19 2010 +0000 @@ -46,13 +46,17 @@ nextbutton = new QPushButton; nextbutton->setText (tr("Next","Find widget")); - nextbutton->setDefault (true); - nextbutton->setShortcut (Qt::Key_Return); connect ( nextbutton, SIGNAL( clicked() ), this, SLOT( nextPressed() ) ); + // QAction needed to only activate shortcut while FindWidget has focus + QAction *a=new QAction (nextbutton->text(),this); + a->setShortcut (Qt::Key_Return); + a->setShortcutContext (Qt::WidgetWithChildrenShortcut); + connect ( a, SIGNAL( triggered() ), this, SLOT( nextPressed() ) ); + addAction (a); + showAllButton = new QPushButton; showAllButton->setText (tr("Show all","Find widget")); - //connect ( showAllButton, SIGNAL( clicked() ), this, SLOT( showAllPressed() ) ); connect ( showAllButton, SIGNAL( clicked() ), mainWindow, SLOT( editOpenFindWidget() ) ); row2Layout->addWidget (cancelbutton); diff -r bfacef6f29c1 -r 0fad394bc330 mainwindow.cpp --- a/mainwindow.cpp Tue Mar 09 13:09:05 2010 +0000 +++ b/mainwindow.cpp Wed Mar 10 15:36:19 2010 +0000 @@ -1921,11 +1921,12 @@ return NULL; } -VymModel* Main::getModel(uint id) const //FIXME-2 id not used +VymModel* Main::getModel(uint id) const { // Used in BugAgent - if ( tabWidget->currentPage()) - return vymViews.at(tabWidget->currentIndex())->getModel(); + for (int i=0; igetModel()->getID()==id) + return vymViews.at(i)->getModel(); return NULL; } @@ -3961,28 +3962,10 @@ if (!currentMapEditor()) return; currentMapEditor()->testFunction1(); */ -/* - - VymModel *m=currentModel(); - if (!m) return; - - bool ok; - QString text = QInputDialog::getText( - "VYM", "Enter Filter:", QLineEdit::Normal, // FIXME-3 no translation yet - m->getSortFilter(), &ok, NULL); - if ( ok) - // user entered something and pressed OK - m->setSortFilter (text); -*/ } void Main::testFunction2() { - findResultWidget->setModel (currentModel()); - findResultWidget->addResult ("Test",currentModel()->getSelectedItem()); - - return; - if (!currentMapEditor()) return; currentMapEditor()->testFunction2(); } diff -r bfacef6f29c1 -r 0fad394bc330 mapeditor.cpp --- a/mapeditor.cpp Tue Mar 09 13:09:05 2010 +0000 +++ b/mapeditor.cpp Wed Mar 10 15:36:19 2010 +0000 @@ -1,7 +1,5 @@ #include "mapeditor.h" -#include - #include #include "branchitem.h" @@ -31,7 +29,7 @@ /////////////////////////////////////////////////////////////////////// MapEditor::MapEditor( VymModel *vm) { - //cout << "Constructor ME "<setBackgroundBrush (QBrush(Qt::white, Qt::SolidPattern)); @@ -162,7 +160,7 @@ MapEditor::~MapEditor() { - //cout <<"Destructor MapEditor for "<getMapName().toStdString()<getMapName(); model->unregisterEditor(this); } @@ -425,8 +423,8 @@ if (rt.isNull()) rt=r1; rt=addBBox (r1, rt); - //FIXME-2 cout <<"ME: r1="<getHeadingStd()<getHeadingStd(); + //qDebug() <<" rt="<nextBranch(cur,prev); @@ -472,7 +470,7 @@ mapCenter->calcBBoxSizeWithChilds(); QRectF totalBBox=mapCenter->getTotalBBox(); //QRectF mapRect=totalBBox; - cout << " map has =("<setDuration(5000); - //animation->setEasingCurve ( QtEasingCurve::OutElastic); - animation->setEasingCurve ( QtEasingCurve::OutQuint); - animation->setStartValue(sceneRect() ); - animation->setEndValue(QRectF(50, 50, 1000, 1000)); - - animation->start(); -*/ -/* - QDialog *dia= new QDialog (this); - dia->setGeometry (50,50,10,10); - - dia->show(); - dia ->raise(); - - QtPropertyAnimation *animation=new QtPropertyAnimation(dia, "geometry"); - animation->setDuration(1000); - //animation->setEasingCurve ( QtEasingCurve::OutElastic); - animation->setEasingCurve ( QtEasingCurve::OutQuint); - animation->setStartValue(QRect(50, 50, 10, 10)); - animation->setEndValue(QRect(250, 250, 100, 100)); - - animation->start(); - */ - -} - -void MapEditor::testFunction2() -{ - model->setExportMode (false); - return; - // Create list with all bounding polygons QList mapobjects; QList polys; @@ -659,19 +559,19 @@ if (polygonCollision (polys.at(i),polys.at(j), QPointF(0,0)).intersect ) { collisions++; - //cout << "Collision: "<getOrientation()); - mapobjects[i]->moveBy(v.x(),v.y() ); - mapobjects[i]->setRelPos(); + // mapobjects[i]->moveBy(v.x(),v.y() ); + // mapobjects[i]->setRelPos(); + model->startAnimation ((BranchObj*)mapobjects[i], mapobjects[i]->getAbsPos(), mapobjects[i]->getAbsPos() + v); } + /* model->reposition(); orientationChanged=false; for (int i=0;isetDuration(5000); + //animation->setEasingCurve ( QtEasingCurve::OutElastic); + animation->setEasingCurve ( QtEasingCurve::OutQuint); + animation->setStartValue(sceneRect() ); + animation->setEndValue(QRectF(50, 50, 1000, 1000)); + + animation->start(); +*/ +/* + QDialog *dia= new QDialog (this); + dia->setGeometry (50,50,10,10); + + dia->show(); + dia ->raise(); + + QtPropertyAnimation *animation=new QtPropertyAnimation(dia, "geometry"); + animation->setDuration(1000); + //animation->setEasingCurve ( QtEasingCurve::OutElastic); + animation->setEasingCurve ( QtEasingCurve::OutQuint); + animation->setStartValue(QRect(50, 50, 10, 10)); + animation->setEndValue(QRect(250, 250, 100, 100)); + + animation->start(); + */ + +} + +void MapEditor::testFunction2() +{ + autoLayout(); +} + BranchItem* MapEditor::getBranchDirectAbove (BranchItem *bi) { if (bi) @@ -1021,11 +1025,11 @@ void MapEditor::mousePressEvent(QMouseEvent* e) { -//cout << "ME::mousePressed\n"; //FIXME-3 +//qDebug() << "ME::mousePressed\n"; //FIXME-3 // Ignore right clicks, these will go to context menus if (e->button() == Qt::RightButton ) { - //cout << " ME::ignoring right mouse event...\n"; + //qDebug() << " ME::ignoring right mouse event...\n"; e->ignore(); return; } @@ -1033,7 +1037,7 @@ //Ignore clicks while editing heading if (model->isSelectionBlocked() ) { - //cout << " ME::ignoring other mouse event...\n"; + //qDebug() << " ME::ignoring other mouse event...\n"; e->ignore(); return; } @@ -1136,9 +1140,9 @@ if (lmo) { /* - cout << "ME::mouse pressed\n"; - cout << " lmo="<mimeData()->urls()) - cout << " URL:"<mimeData()->text()) - // cout << " PLAIN:"<mimeData()->data("STRING"); QString s; s=ba; - cout << " STRING:" <mimeData()->data("TEXT"); s=ba; - cout << " TEXT:" <mimeData()->data("COMPOUND_TEXT"); s=ba; - cout << " CTEXT:" <mimeData()->data("text/x-moz-url"); s=ba; - cout << " x-moz-url:" <updating...\n"; + // qDebug() << " ->updating...\n"; BranchObj *bo=(BranchObj*) ( ((MapItem*)ti)->getLMO()); bo->updateData(); } diff -r bfacef6f29c1 -r 0fad394bc330 mapeditor.h --- a/mapeditor.h Tue Mar 09 13:09:05 2010 +0000 +++ b/mapeditor.h Wed Mar 10 15:36:19 2010 +0000 @@ -56,6 +56,7 @@ void setAntiAlias (bool); //!< Set or unset antialiasing void setSmoothPixmap(bool); //!< Set or unset smoothing of pixmaps void setHideTmp (bool); //!< Hide parts temporary + void autoLayout(); //!< Auto layout of map by using collision detection public: TreeItem *findMapItem (QPointF p,TreeItem *exclude); //! find item in map at position p. Ignore item exclude diff -r bfacef6f29c1 -r 0fad394bc330 tex/vym.changelog --- a/tex/vym.changelog Tue Mar 09 13:09:05 2010 +0000 +++ b/tex/vym.changelog Wed Mar 10 15:36:19 2010 +0000 @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Mar 10 16:35:23 CET 2010 - vym@insilmaril.de + +- Bugfix: MainWindow::getModel() returns correct model now +- Bugfix: Better focus handling in FindWidget + ------------------------------------------------------------------- Tue Mar 9 14:04:10 CET 2010 - vym@insilmaril.de diff -r bfacef6f29c1 -r 0fad394bc330 version.h --- a/version.h Tue Mar 09 13:09:05 2010 +0000 +++ b/version.h Wed Mar 10 15:36:19 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-03-09" +#define __VYM_BUILD_DATE "2010-03-10" bool checkVersion(const QString &); diff -r bfacef6f29c1 -r 0fad394bc330 vymmodel.cpp --- a/vymmodel.cpp Tue Mar 09 13:09:05 2010 +0000 +++ b/vymmodel.cpp Wed Mar 10 15:36:19 2010 +0000 @@ -1562,6 +1562,7 @@ } selti->setNote(s); emitNoteHasChanged(selti); + emitDataHasChanged(selti); } QString VymModel::getNote() @@ -1660,8 +1661,7 @@ { i=cur->getNote().indexOf (s,i,cs); if (i>=0) i++; - qDebug()<<"i="<