summaryrefslogtreecommitdiffstats
path: root/seriestreemodel.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Bugfix in editing SeriesArno2011-06-121-4/+4
| | | | | | Some conditions were placed outside if(role == Qt::EditRole) in SeriesTreeModel. Because of that most of the fields for a Part couldn't be updated since the condition would never be met.
* Update IsLocal when setting DVD no.Arno2011-05-221-4/+14
| | | | | | The field IsLocal in the SeriesTreeModel is now properly updated when the DVD no. changes. It still doesn't propagate to the file view, though.
* Use new field IsLocal in SeriesTreeModelArno2011-05-141-3/+6
| | | | | Use field IsLocal in SeriesTreeModel when filtering local or archived files.
* Add field isLocal to SeriesTreeModelArno2011-05-141-7/+23
| | | | | | | | | | Indicate if SeriesPart has local files in SeriesTreeModel. The cost for this is an additional Query when populating the model, but fortunately the performance impact isn't noticeable. Also introduced a new enum NumFields to SeriesTreeModel. It represents the number of fields for a SmTreeItem so extending the model isn't that cumbersome any more.
* Fix adding movies with subtitlesArno2011-05-141-1/+9
| | | | | | When a movie has a subtitle, use a negative seriespart as id. I guess this will haunt me at some point, but for now it works. Added a sequence to the database layout for that.
* Fix editing series and seriespartsArno2011-05-071-14/+25
| | | | | | I guess this didn't work for quite some time. Show a dialog when editing series or seriesparts. Before SeriesTreeModel::edit was called, but that didn't really work.
* Implement additional title element for seriespartsArno2011-05-071-22/+30
| | | | | | Series parts can now have an additional title elemet, the so called subtitle. Obviously that's not really a good name but it's the best I could come up with :)
* Implement metadataArno2011-01-231-2/+2
| | | | | | | | | Added a WizardPage to add metadata like releaseyear, releasegroup, newsgroup subject and such. Metadata can't be displayed at the moment and needs to be revameped seriously. I guess it's time for another model keeping the metadata. Created a new table in the database for this.
* Added filter option for favoritesArno2011-01-221-0/+30
| | | | | Added filter for only showing series marked as favorites. The other filter options are disabled when in this mode.
* Bugfix for favoritesArno2011-01-221-2/+2
| | | | | Fix bug in SeriesTreeWidget when filtering. Take into account new column Favorite when filtering, so it will be hidden in SeriesTree.
* Implement favoritesArno2011-01-161-28/+85
| | | | | SeriesParts can be marked as favorites. They won't be selectable when filtering by local Movies only.
* Enhance filters in SeriesTreeWidget a little moreArno2010-12-301-6/+8
| | | | | | | | | | | Allow operators in filter. Operators are only valid if it's a NumericQuery. Operators are <>=. Also allow postfixes for numbers: k, m, g for kilobytes, megabytes and gigabytes. Also fix a little usability bug when filtering. If the result set was empty, the root item was collapsed. On the next search with a result, the root item was still collapsed. Since it wasn't shown there was no way to expand it.
* Made all icons in qresource available for UIArno2010-12-271-1/+1
| | | | | | | | | | | | | | | | Every registered icon can be chosen as Qt::DecorationRole for all models at once. Suitable icons must be added to SmGlobals::mIcons. Key is a descriptive text, value is the icon path. To make things easier SmTreeModel got two new member functions: -QIcon decorationIcon() returning the current Icon -void setDecorationIcon() to set the current Icon The current Icon is initialized in the constructor from QSettings - ui/iconfolder To update the TreeViews connected to the FileSystemModel a little hack is needed: Just set the QFileIconProvider again. This causes the Model to update connected views.
* Edit values in archiveArno2010-12-061-1/+1
| | | | | | | | | | This commit introduces QInputDialogs for all values editable in the archive. Inline editing in the view doesn't seem the right choice regarding usability. Fixed a long standing bug in nextDvdNo(). That was off by one. Return one more than max(value). Also got rid of DvdNoDialog, replaced by a QInputDialog.
* Streamline database accessArno2010-11-271-1/+2
| | | | | | | | | An unsuccessfull attempt to get rid of the warning "connection treedb is still in use..." by trying to delete all queries and setting mDb to QSqlDatabase() in the destructor. Strangely enough, the warning is only issued from inside QtCreator... Maybe it's some kind of race.
* Implemented dialog for showing movies without coversArno2010-11-271-3/+7
| | | | | | | | | Implemented a new dialog to show movies without covers. The view is a QTreeView with another model. While working on the model several shortcomings of SmTreeModel were resolved. findValue() now takes another argument to indicate the column the returned QModelIndex() should represent. Also, itemAt() was promoted from private to protected. It's quite useful for derived classes.
* First try on ConsistencyCheckerArno2010-10-311-0/+1
| | | | | | | Well, it works, so let's shit it :) Unfortunately the database is inconsistent, so add a checker for that. Still needs some work, though. Eg. display errors seperately and make it possible to delete stray files. Also the Filesystem check must be implemented.
* Verion bumpArno2010-08-071-2/+0
| | | | Created version 1.0.0 treemodel. Also removed some <QDebug> includes.
* Fixed edit trigger in SeriesTreeViewArno2010-08-051-0/+9
| | | | | | | | | | | | | | | | | | | | | Until now doubleclicking an item with children in SeriesTreeWidget did 3 things: 1. Expand or collapse the item 2. Trigger editing 3. Start playing all child movies in the default player This is not really expected behavior. So I disabled all EditTriggers on SeriesTreeView and set expandsOnDoubleClick to false. To still retain the ability to edit series a new slot was introduced to SeriesTreeWidget triggering the edit event. It's available from the SeriesTreeWidget context menu. Now doubleclicking an item in SeriesTreeView just plays all child movies. Child items also have their name changed when changing the parent item. This bug was long present in renameSeries. mergeSeries always did the right thing (tm).
* Implemented extended filtersArno2010-08-011-0/+103
| | | | | | | | | | | | | | Extended the filter function in SeriesTreeWidget. By passing an operator to the filter dialog series can be filtered. The code generates highly dynamic SQL queries. I hope I didn't introduce possible SQL injections. Filter operators: g: genre a: actor q: quality n: filename d: dvd no s: size
* Added database maintenance codeArno2010-07-311-0/+1
| | | | | | Implemented a function in MappingTableModel to remove all actors/genres with no references in the according mapping table. Available through the "File" menu.
* Preparation for new move to burn implementationArno2010-07-171-0/+16
| | | | | | Show size of selected items in status bar when files are selected in the FileView. Also show series name of current selected file in the general status bar.
* Final version of NewMovieWizard::accept() (hopefully)Arno2010-07-091-1/+1
| | | | | | | | | | | | | | | | | Actually made this function work. Forgot to handle actors and genres. Also several bugfixes in other parts: -fix typo in FilesTreeModel query -commit changes ind MappingTableModel::addItem, making the genre and actor widgets work as intended -remove redundant MappingTableModel::find(), already implemented in SmTreeModel -call next() instead of exec() in SeriesTreeModel::addSeriesPart. Query is already executing if it's a select -use QModelIndex::row() instead of column() in MappingTableWidget::removeItem() -add partNo to layout in MovieInfopage::MovieInfoPage() -add convenience function setMappings() to MappingTableModel
* Preparations for NewMovieWizard::acceptArno2010-07-081-0/+52
| | | | | | | -new memfunc: SeriesTreeModel::addSeries -new memfunc: SeriesTreeModel::addSeriesPart started FilesTreeModel::addFile, not finished yet.
* Fix MovieInfoPageArno2010-07-041-0/+11
| | | | | | | | | | | | | | | The first page of NewMovieWizard gave me quite a headache. It crashed with a segmentation fault because of exposing mDvdNo via registerField() without actually assigning a QCheckBox to it. The backtrace isn't very helpful in such a case. I also fixed some bugs on the way: 1. use SmTreeItem::setData in SmTreeModel::addRow instead of deleting the old item and creating a new one. This way I don't need to take care of the parent. 2. get data of old item in SmTreeModel::reparent before calling removeRows. This call deletes the item. 3. Fix column alignments in WizardTreeModel for size column
* Implemented "open with" submenu in ArchiveTreeViewArno2010-07-021-2/+2
| | | | | | | | | Changes: -changed signature of ArchiveTreeView::playSelected() to take a QString argument for the preferred player -Bugfix in SeriesTreeModel::findSortedMovies: use SeriesId for mSortedMovieListQuery -SheMov: use mOpenWithMapperAV for mATree instead of deprecated mAVWidget
* Implemented playing a movie on doubleclickArno2010-06-261-0/+17
| | | | | | | | | | | | | 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/+14
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* SeriesTreeModel::findMoviesArno2010-06-181-0/+19
| | | | | Implemented function to return a QFileInfoList of only the movies for a given QModelIndex.
* Created frontend for SeriesTreeModel::deleteFromSeriesArno2010-06-181-0/+1
| | | | | | | | | | | 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/+25
| | | | It compiles, let's ship it. Totally untested.
* Streamline SeriesTreeModel::findFilesArno Moeller2010-06-181-14/+14
| | | | | Avoid code duplication by handling the two different queries more generic so the result set can be fetched in just one while loop.
* SeriesTreeModel::findFilesArno2010-06-171-0/+32
| | | | | | Implemented SeriesTreeModel::findFiles in preparation for deleting files from SeriesTreeView. Totally untested, of course, and the new action in SheMov doesn't do anything.
* Finished New series in SeriesTreeWidgetArno2010-06-171-39/+81
| | | | | | | | 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-1/+1
| | | | | | 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.
* Bugfix in SeriesTreeModelArno Moeller2010-06-171-0/+3
| | | | | Return false from setData if new name == old name. This made the entries disappear from tree.
* GUI fixesArno Moeller2010-06-171-1/+1
| | | | | -Hide columns 1 - 5 in SeriesTreeWidget -Resort SeriesTreeWidget when SeriesName is changed
* Fixed SeriesTreeModelArno Moeller2010-06-171-4/+5
| | | | | There was no serious problem with the database schema. Maybe I should have gone to bed earlier. Updating and changing series names now works.
* Treemodel DevelopmentArno2010-06-161-0/+188
-Changed the database schema. Attached quality to files -Subclassed SmTreeModel for SeriesTreeModel -Made SmTreeModel virtual for that Well, it seems there is a serious problem with the database schema. Curiously everything inside the model works beside the db update. Seems I have it wrong with the fks :(