summaryrefslogtreecommitdiffstats
path: root/seriestreewidget.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix bug in SeriesTreeWidget::readSettings()Arno2010-07-241-1/+1
| | | | | | | Select the last selected series with QItemSelectionModel::setCurrentIndex(), otherwise the current index won't be set. On closing the program currentIndex() would be invalid and nothing is selected when starting SheMov again.
* Act on doubleClick in FileTreeWidgetArno2010-07-241-4/+4
| | | | | | | | | | | | | When doubleclicking a picture in FileTreeWidget the pictureViewer is shown. Doubleclicking a movie file launches the default movie player. Since PictureViewer is now used in FileSystemWidget and ArchiveTreeView a global instance is needed. The appropriate place for this is a singleton. Since we already had a singleton for QAbstractItemModels I renamed it to SmGlobals and added a function to return a PictureViewer object. Renaming it was quite easy thanks to QtCreator's ability to rename variable names.
* Remember last selected seriesArno2010-07-241-0/+8
| | | | | | | | | | SeriesTreeWidget::writeSettings() writes currentIndex() to QSettings on close. readSettings() selects it again on startup. I tried to remember all selected indexes, but that got way too complex and didn't work when SeriesParts were selected. Somehow QItemSelectionModel wouldn't select indexes with parents other than QModelIndex().
* Fix readSettings in seriesTreeWidgetArno2010-07-241-1/+0
| | | | | | Don't add items to mExpandedItems in readSettings. This already happens in the slot itemExpanded. Before the list quickly filled up with duplicate entries.
* Implemented add coversArno2010-07-181-0/+113
| | | | | | Finally we can add covers to already existsing series. Seems to work, but I encountered a crash when merging series while testing... Unfortunately I don't know the cause.
* Implemented playing a movie on doubleclickArno2010-06-261-0/+4
| | | | | | | | | | | | | Movie files are played in the default player when double clicking on a movie, but not when doubleclicking on a series. The latter invokes the edit event on the series. Don't yet know if this is a good thing or not. Changes on the way there: 1. new helper function for finding the right player. Still need to fix FileSystemWidget to also use the Helper::function. It's a simple copy & paste from there. 2. added function SeriesTreeModel::findSortedMovies. It returns a QFileInfoList sorted by seriespart and fileno.
* Made FilesTreeWidget workArno2010-06-241-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | It wasn't as easy as I thought. Quite big changes: 1. I changed the query for setIds in FilesTreeModel. Initially it executed a database query for every id. Changed it to WHERE seriespart_id IN (ids). I didn't have a chance to test the first version, but this one is blazing fast. 2. Fixed a recursio ad infinitum in FilesTreeModel. This happens if you call data() from data(). Either use the *item or use a role different from what you've been called. 3. Introduce a new function in SeriesTreeModel: QList<QVariant> childrenColumnList. It returns a QList from the children values of the given column. 4. Lot's of UI changes. Hide unneded columns, align the remaining ones properly. What doesn't work: we can't let the database do the sorting of files. We need a proxy for this.
* Singleton cleanupArno2010-06-231-3/+2
| | | | | | | | | | The SmUberModel class wasn't needed at all, so I removed it. Instead I renamed SmUmberModelSingleton into a real singleton for all QAbstractItemModel*, though right now it only supports the SeriesTreeModel and FileTreeModel. But it should eventually evolve into a singleton for all QAbstractItemModel *. For this I renamed the class SmUberModelSingleton to SmModelSingleton.
* expand/collape actions for SeriesTreeWidgetArno2010-06-181-0/+9
| | | | Implemented expand and collapse actions for SeriesTreeWidget.
* read/write settings for SeriesTreeWidgetArno2010-06-181-0/+32
| | | | | SeriesTreeWidget now retains its last state regarding sort order and expanded items.
* Sort for SeriesTreeModel/ViewArno2010-06-181-1/+10
| | | | Sort Parts regarding to their part number.
* Created frontend for SeriesTreeModel::deleteFromSeriesArno2010-06-181-0/+54
| | | | | | | | | | | Implemented frontend for SeriesTreeModel::deleteFromSeries. I hope QPersistentModelIndexes work as advertised. From the qt-sources it seems that a QPersistentModelIndex is automatically updated by QAbstractItemModel when calling begin(Remove|Insert)Rows. Testing worked out fine. While at it I found a bug in SmTreeModel. removeRows has to be called with (i - 1) instead of (i) to remove the correct nodes.
* Implemented SeriesTreeModel::deleteFromSeriesArno Moeller2010-06-181-0/+9
| | | | It compiles, let's ship it. Totally untested.
* Finished New series in SeriesTreeWidgetArno2010-06-171-2/+5
| | | | | | | | Another not so atomic commit. Inserting a new serie by triggering the action in the context menu now works. While at it I revamped setData and put the if/elses into functions. Also fixed a bug in setData: Use TypeRole instead of the Fields enum.
* Partial implementation of adding new SeriesArno Moeller2010-06-171-3/+25
| | | | | | Adding an item to the TreeView works, but it doesn't get focus after inserting. Also the data is not shown. And setting the title of the new item should make the database puke.
* GUI fixesArno Moeller2010-06-171-3/+11
| | | | | -Hide columns 1 - 5 in SeriesTreeWidget -Resort SeriesTreeWidget when SeriesName is changed
* Implemented SeriesTreeWidgetArno2010-06-131-0/+56
Implemented a widget for showing series in a tree. Also implemented filtering and sorting for this widget. Some bugfixes and enhancements: -Show dildo as DecorationRole in SeriesWidget -removed Quality from SeriesWidget