summaryrefslogtreecommitdiffstats
path: root/mappingtreemodel.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Show mappings in PictureViewer2Arno2012-03-241-0/+45
| | | | | | | | | | | Hell, this was one heck of a bitch. Lots of changes just to show the mapping tree in PictureViewer2. Did I mention that I hate recursion? Added a function for fetching a SmTreeItem * from MappingTreeModel for paths, just to turn it into a QTextDocument in PictureViewer2. Of course everything is recursive. Did I say that I hate recursion? Well, as said in the comments, one recursion function seems fishy, but it works (tm).
* Save settings for PicturesWidgetArno2012-03-181-1/+1
| | | | Remember selected node in PicturesWidget.
* Fix some severe braindamageArno2012-03-181-22/+0
| | | | | | | | | | | | | | It started as a buxfix session, but the more I dug into some ancient code, the more I had to change. Well, first and foremost, this fixes a crash in PicturesWidget. Trying to display the mappings of the selected picture in a different color never was a good idea. Show them in the statusbar instead. While looking at the statusBar code, make PictureWidget emit signals to show the total size and number of selected items. Then I noticed some really, really braindamaged connection madness in the Shemov constructor. Instead of doing all the work in SheMov itself, have the widgets emit signals. This should have been several commits, but one lead to another...
* Make nodes with children selectable in picture widgetArno2012-03-171-1/+26
| | | | | | | | | This was a tough one. Lost in recursion. When selecting nodes with children in the picture widget, all files having this node as mapping parent are shown. Had to make some changes to SmTreeModel::findRecursive for this. I hope I didn't break anything. If I did, I'll fix it :) Also disposed of some comments and unused member variables.
* Fix brute forcing of colorsArno2012-03-031-10/+17
| | | | | Don't brute force coloring MappingTree by calling (begin| it keeps the focus.
* Customize menus and toolbar for PictureViewArno2012-03-031-0/+1
| | | | | | | * Added 4 new icons for PictureView-actions. * simplified SheMov::tabChanged(int) * fix long standing bug with QActionGroups in SheMov. Enable and disable all actions according to the active tab
* Impement editing of picture mappingsArno2012-03-031-0/+4
| | | | Make it possible to edit picture mappings on archived pictures.
* Fix MappingTreeModel::addChild()Arno2012-03-021-6/+7
| | | | | Catch illegal separator in value before making a database entry and insertRows()
* Make add mapping item a context menu entryArno2012-03-021-1/+3
| | | | | | Remove the QLineEdit and QPushButtons from the bottom of MappingTreeWidget and make adding mapping items available in the context menu.
* Prevent usage of "/" in MappingTreeModelArno2012-03-021-0/+8
| | | | | Since "/" is used as path separator, reject any SmTreeModel::Name containing it.
* Make it possible to move mappingsArno2012-03-021-0/+74
| | | | | | | | | | | | | 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.
* Mark active MappingsArno2012-02-261-0/+56
| | | | | When selecting pictures, mark the active mappings with a different color.
* Implement PicturesWidgetArno2012-02-261-0/+1
| | | | | | | | 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-3/+40
| | | | | | 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/+58
| | | | | | | 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.
* Implemented NewPicsDialogArno2012-02-241-1/+1
| | | | | Version 1 of NewPicsDialog. Just one single tab for adding files. Does nothing yet besides adding and removing files.
* Implement MappingTreeWidgetArno2012-02-241-28/+50
| | | | | | | | | | | | | | | 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.
* First shot at MappingTreeModelArno2012-02-241-0/+244
MappingTreeModel is a generic approach at mappings files to generic data, eg atttributes, actors or themes. It compiles, but nothing more. So expect many exciting bugs and SegFaults.