summaryrefslogtreecommitdiffstats
path: root/mappingtreewidget.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Implement add tree in SlideDlg + othersArno2016-07-211-0/+36
| | | | | | | Yeah! Finalling getting the hang of recursion, I hope! Add a new Button ">>>>" to add a whole subtree. Not really useful when archiving, but very useful when selecting Slide attributes!
* Save mappings from slide dialogArno2016-03-301-0/+23
| | | | | Also fix a long standing bug in MappingTreeModel: also remove item from mCurrentData when the removed item is a parent of one of the items.
* Improve new actor dialog for picturesArno2016-03-201-5/+12
| | | | | If the actor already exists, select it and exit, otherwise create and select it.
* Add refresh button for picture widgetArno2015-07-081-1/+5
|
* Accept NewPicsDialog with CTRL+EnterArno2015-06-061-1/+3
|
* More keyboard navigationArno2015-06-061-2/+27
| | | | Add CTRL+A for new actor to MappingTreeView
* Navigate NewPicsDialog by keyboardArno2015-06-061-22/+49
| | | | | | | | | | | MappingView: * Key_Right: add mapping * Ctrl-Key_Right: shift focus to ResultView * Delete: clear all mappings ResultView: * Key_Left: remove mapping * Ctrl-Key_Left: shift focus to MappingView
* Implement presets for NewPicsDialogArno2015-04-081-0/+4
| | | | A set of attributes can now be saved and loaded in NewPicsDialog.
* NewPicsDialog: Select current item in MappingTree on change inArno2015-04-081-2/+17
| | | | | | | ResultView Usability fix: When selecting a mapping in the result view, select it in the source tree, too.
* Fix MappingTreeResultModel for goodArno2014-07-081-3/+2
| | | | | removeRows and insertRows is buggy. Unfortunately I can't figure out how... So make it easy and reset the model on inserts and removals.
* Clear command Queue before unpacking archivesArno2014-07-081-1/+3
|
* Display unpack output in DialogArno2014-07-081-1/+1
| | | | | This was a difficult one. Got lost in the Semantics of QThread once again, but just 2 days later it works :)
* Fix MappinTreeWidget::addChildArno2014-07-071-6/+9
| | | | | | Fix the lookup of a new child, so it will select the right child if we have more than one child with the same name. Do it by looking up the id instead of the name.
* Major rework of MappingTreeResultView + ModelArno2014-06-291-26/+2
| | | | | | | Well, I hope this fixes the crashes for good. String comparison for looking up the parents really wasn't a prudent thing to do... Use the ParentIds instead.
* Add filter bar to MappingTreeWidgetArno2013-10-131-3/+47
| | | | | Move matchRecursive from ArchiveModel to SmTreeModel so we can use it here, too.
* Fix renaming mapping items for picsArno2013-10-131-2/+8
| | | | | | With some GNOME themes the edit trigger for SmTreeModel is borked. The current name is mixed with the new one, and one can't recognize anything. Use a QInputDialog instead.
* Fix MappingTreeModel for goodArno2013-08-211-11/+17
| | | | | | | * Again: remove the transaction madness besides almost everywhere leaving one instance where it is actually useful. * Hide the buttons to add and delete mapping types. Haven't thought that through complete. What should be deleted on cascade? Do we really want/
* Possible Bugfix in MappingEditWidgetArno2013-04-111-2/+4
| | | | | | SheMov crashed in MappingEditWidget::removeMapping, maybe because of some race. So turn the selected QModelIndex into a PersistentModelIndex and check for validity before removing the row...
* Fix setAlternatignRowColorsArno2013-04-101-3/+2
| | | | | | | | | | | | | | | | | | | | Well, what started as a try to simplify QTreeView ended in a mass header murder... What happened: * I searched for a way to let every QTreeView honor the setAlternatingRowcolors() setting. Unfortunately it isn't enough to just set the global palette and set it to true. So every QTreeView is now derived from SmTreeView * SmTreeView registers itself with SmGlobals, so the property is set _after_ it's constructed. It's definitely not enough to call it in the constructor. I guess that's a bug. But it's enough to append the SmTreeView to a QList<QWidget*> in SmGlobals and call it _after_ the painting is done. * As an added Bonus we can add virt. funcs to every SmTreeView at will While at it I realized that most of the included headers were void, so remove them. No idea what impact it has on the bin size...
* Fix ColorsArno2013-03-171-1/+6
| | | | | | | This is more a qt5-fix than a SmDirModel fix. The global palette doesn't propagate any more, so we have to set the palette in every QTreeView separately. Very annoying and tedious. Maybe I missed a Widget or two, dunno...
* Port to Qt5Arno2013-03-031-11/+11
| | | | | | | | * Change #include to qt5 * Fix missing QX11Info * use explicit constructor for QVariant(QColor) * use beginResetModel() and endResetModel() instead of reset(). The latter was removed. Hopefully it still works :)
* Finally { fix MappingTreeModel }!!!Arno2012-11-171-1/+1
| | | | | | | I think I did it! Fixed MappingTreeModel to make it usable, avoid all the traps with the insane column and variable names! Now we can actually have the same mapping with different parents! Yay! Hope it won't come back and bite me!
* Renaming continued!Arno2012-11-161-1/+1
| | | | Rename enum also! _THAT_ should help, I hope!
* Bugfixes: don't select dirs and don't crash on write settingsArno2012-10-271-3/+2
| | | | | | | Only select files when archiving pics from filemanager. While at it, I noticed a crash on close when no item is selected in PicturesWidget. So check if MappingData is valid on writing settings. Best way is MappingData::isValid(), and for that I needed a explicit constructor.
* Fix archiving picturesArno2012-10-271-14/+4
| | | | | | Well, what can I say. Lost in recursion and parent pointers. This commit actually boils down to using the proper database tables and inserting the right values. 'Nuff said...
* Keep current Pic when adding files to PicViewer2Arno2012-10-191-2/+0
| | | | | | | Try to get the position of the current picture after adding and clearing the file list of PictureViewer2. While thinking of using std::find for this I realized that the operator()-functions in Helper:: weren't used any more, so remove them and the <algorithm> includes.
* Usability: MappingTreeWidgetArno2012-10-101-2/+11
| | | | | Try to select newly added mapping. Only try, because it will fail if we have two children with the same name. The first will win.
* More fixes to MappingTreeModelArno2012-10-061-1/+1
| | | | | | | | | | Fix move, addChild and such. Rename Fields and Roles to more speaking names, but that revealed a much deeper bug: the ParentID isn't really the parent_id, but the mapping_id. That could explain a lot. Nevertheless, it's still faster to repopulate the model after moving oder adding children instead of calling removeRows and insertRows. Another non-working commit... :(
* Fixed adding and deleting children from MappingTreeModelArno2012-10-051-4/+55
| | | | | | | | | | | | | | | | | Another fix to MappingTreeModel's new database layout. I think we're getting there... Insert the mappings into mapping_parents2 and add the MapParentId to the newly created index in the model. For now, the added date remains invalid. Make it possible (again?) to add root items to MappingTreeModel. For this I had to design a new QDialog with a checkbox. This one fixes another bug in SmTreeModel: Don't call parent() on a null pointer. Sometimes I'm getting random SIGBUS-Signals, but maybe that's because of the debug build of qt I'm using. Couldn't track it down yet...
* Fix deleting children in MappingTreeModelArno2012-10-051-1/+3
| | | | | Deleting children tried to remove it from mappings instead of mappings_parents2. The mapping itself should not be deleted.
* Fix Mappings in PictureViewer2Arno2012-10-041-1/+1
| | | | | | | | | | Another fix for the new MappingTreeModel database layout: Make the mappings display correctly when showing an archived picture. For performance reasons I had to make PicFilesModel global and put it into a separate file. Also clean up MappingTreeModel: remove comments and unused functions.
* Foremost a fix for SmTreeModelArno2012-09-301-24/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not working again, but I eventually have to commit the changes. Fixes to SmTreeModel: * Fix SmTreeModel::index(). The previous comment was quite valid. I'm surprised that it worked at all. I have no clue why to return an invalid QModelIndex if the column isn't 0. Now an index with any valid column number can be created. * Fix SmTreeModel::parent(). Again, why shouldn't we create a parent index with a column other than 0? No idea... * Fix SmTreeModel::headerData(). Add some sanity checks. * Fix SmTreeModel::findRecursive(). Well, what is there to say. It never worked for models with a depth > 1, but obviously it didn't really matter until now. To make it work I had to change SmTreeItem as well. SmTreeItem::next() returns the next valid parent/sibling, or 0 if there isn't one. There may be some fallout from these changes, but they're yet to be seen. Changes to PictureView: * fix selecting an item according to the new datasbase layout * same goes for editing items. If an update actually works has to be checked. Overall, it's an intermediate commit that should have been a sane series of commits. Can't be changed now...
* MappingTreeModel Fix: Select pictures from pics_mappings2Arno2012-09-221-1/+1
| | | | | Select pictures referencing pics_mappings2 instead of broken pics_mappings. This just fixes the selection, nothing else!
* MappingTreeModel Fix: repair parent <-> child relationshipArno2012-09-221-0/+1
| | | | | | | | | | | | Warning: this commit seems to work, but it doesn't! Introduce two new tables: mappings_parents2 and pics_mappings2 to create a real parent-child relationship. The pics_mappings need to reference a unique mappings_parents_id so the same mapping can be a child of different parents. For now only the MappingTree references the new tables. Everything else uses the old ones. Hence the warning!
* Save settings for PicturesWidgetArno2012-03-181-0/+9
| | | | Remember selected node in PicturesWidget.
* Impement editing of picture mappingsArno2012-03-031-0/+32
| | | | Make it possible to edit picture mappings on archived pictures.
* Fix MappingTreeModel::addChild()Arno2012-03-021-0/+5
| | | | | Catch illegal separator in value before making a database entry and insertRows()
* Add error checking to MappingTreeWidget::deleteChild()Arno2012-03-021-6/+9
| | | | | Return an error if delete fails. Failure should only happen if there are still references to other tables.
* Make add mapping item a context menu entryArno2012-03-021-18/+4
| | | | | | Remove the QLineEdit and QPushButtons from the bottom of MappingTreeWidget and make adding mapping items available in the context menu.
* Make it possible to move mappingsArno2012-03-021-0/+19
| | | | | | | | | | | | | Move mappings by context menu. Select new parent by QComboBox with available paths, items separated by "/". Note that hell will break loose if a mapping name contains "/". Will be fixed later. Since mapping views don't have setSortingEnabled(), make SmTreeModel::addRow() sort items. This fixes a long standing bug in SmTreeModel::reparent(): Since it alters the model, newParent has to be a QPersistentModelIndex to stay consistent.
* Move some code from NewPicsDialog aroundArno2012-02-261-0/+52
| | | | | Put mapping editor into a seperate class to make it easier using it for changing mappings later.
* Implement PicturesWidgetArno2012-02-261-0/+8
| | | | | | | | Create a tab to show the archived pictures. It's far from complete, but it already does: * show pictures * hover * delete pictures from archive
* Make NewPicsDialog archive picturesArno2012-02-251-1/+6
| | | | | | Finally NewPicsDialog actually does something. Added another parameter to Helper::moveToArchive. If set to true, files will only be copied instead of moved. Default is false, not changing the expected behavior.
* Implemented mapping widget for NewPicsDialogArno2012-02-251-0/+22
| | | | | | | Make it possible to add mappings to new pictures. This actually was a tough one. Maybe I shouldn't drink and code. Next: make NewPicsDialog actually do something.
* Implement MappingTreeWidgetArno2012-02-241-0/+199
This is a rather large commit. It implements MappingTreeWidget using MappingTreeModel unsurprisingly this uncovered some exciting bugs. Fixes the following bugs in MappingTreeModel: * use insertRows() and removeRows() when addings children, because dataChanged() won't do it. * don't use a prepared QSqlQuery when fetching children recursively. This won't work because the query is still active when we invoke ourselves again. Put the query on the stack instead * Keep the model sorted. Also add an entry for a MappingTreeEditor to the File-Menu.