summaryrefslogtreecommitdiffstats
path: root/filestreemodel.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix alignment in FilesTreeModelArno2013-05-241-1/+2
| | | | Also align columns vertically when Qt:AlignRight is in effect.
* Bugfix when setting DVD numberArno2013-04-071-1/+1
| | | | | | Don't call refresh on model after setting the dvd no for an index. Then the selection is lost and the other selected indexes won't be updated. Call refresh from the view after updating all indexes instead.
* Port to Qt5Arno2013-03-031-8/+8
| | | | | | | | * 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 :)
* Refresh view properly after setting DVD no.Arno2013-02-081-13/+15
|
* Fix "suggest file for burning"Arno2013-02-081-16/+17
| | | | | | Don't use a SQL-Query to find files. Traverse the model instead. Also check if the resulting index is already selected. All in all, make it usable again.
* Revamp MoveToBurnArno2013-02-081-1/+1
| | | | | | Only move selected files + covers to burn directory, not the entire series. Makes suggestForBurn more accurate, and we can kinda trust the selected size :)
* Change sort orderArno2013-02-071-1/+1
| | | | | Change sort order when selecting files for burning... Alphabetically is not very useful here...
* Revamp Show all Files ActionArno2013-02-071-1/+10
| | | | | Change action to show all local movies, no favorites, no pictures, to ease selection of files to burn.
* Fix crash in deleting Files from ArchiveArno2013-01-041-2/+2
| | | | | | The QModelIndexList must be a QList<QPersistentModelIndex> to prevent crashes when removeRows is called. The current QModelIndex could already be invalid.
* Allow moving files from one Series to anotherArno2012-12-301-1/+27
| | | | | Allow moving files from one SeriesPart to another. Had to add another global variable for this.
* Usability: return something if series part is invalidArno2012-10-201-2/+2
| | | | Return "(none)" for readability's sake when we have a single part movie.
* Suggest file for burningArno2011-05-281-8/+9
| | | | | Implemented an action to suggest the best fitting file for burning in FilesTreeWidget. Added 20 Mb of margin to maximum dvd size.
* Implemented FilesTreeModel::fileSizeLessThanArno2011-05-271-0/+17
| | | | | | Implemented function to find movie files less a specific size to suggest suitable files for burning. Not tested, and I guess I have to take the picture size into account.
* Turned dvd size constant into a globalArno2011-05-271-2/+3
| | | | | Moved constant dvd size in bytes to SmGlobals. It spread to several source files, so it seemed to be a candidate.
* Propagate changes from SeriesTreeModel::IsLocaLArno2011-05-221-34/+13
| | | | | Propagate changes to SeriesTreeModel::IsLocal to all attached views. For some reason this wasn't as easy as I thought...
* Implement favoritesArno2011-01-161-9/+23
| | | | | SeriesParts can be marked as favorites. They won't be selectable when filtering by local Movies only.
* Fix qWarnings() at startup and shutdownArno2010-12-301-0/+1
| | | | | | | | | | | | | | Fix unexpected NULL receiver on startup: Turns out this warning is issued when calling deleteLater on a NULL object. This happened in SheMov::createOpenWith*. The "database is still in use" warning was a bit harder to track down. First of all, the destructors weren't called since Qt::WA_DeleteOnClose wasn't set for SheMov, so Qt would simply exit and let the OS do the cleanup without calling the destructors. Then there were several orphan widgets/objects without a parent, so their destructor would never be called.
* Configuration option for archived filesArno2010-12-271-0/+4
| | | | | Added color selection for archived files to make more clearly which files aren't present on the filesystem.
* 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.
* Made colors configurableArno2010-12-261-1/+8
| | | | | | | | | Added a tab to ConfigurationDialog to make some colors configurable. It works somehow. The font color isn't evaluated yet, since I'm not convinced that it is a good idea. But one problem is that calling qApp->setPalette() doesn't propagate to non visible child dialogs. Dunno if it's worth fixing.
* Mark local filesArno2010-12-121-0/+5
| | | | Show files present on filesystem in Qt::darkBlue.
* Hover fixArno2010-12-121-1/+1
| | | | | | | When hovering over movies in local mode both the ToolTip and the hover image was shown. Fixed by only showing the ToolTip when the movie is not available, eg. archive mode. In any other case incorporate the ToolTip info into the hover image.
* Edit values in archiveArno2010-12-061-2/+27
| | | | | | | | | | 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.
* Selectable columns in FilesTreeViewArno2010-12-051-1/+15
| | | | | | | | | Made columns shown in FilesTreeView selectable. Also, the order of columns is saved and restored. This was a difficult one. I even had to make a debug build of qt. But I fixed a serious bug in FilesTreeModel::modeName: don't access the Hash if modeName == -1.
* Allow removing non existant filesArno2010-11-271-9/+0
| | | | | If a file didn't exist on the FS it wasn't possible to remove it. The checks were too zealous.
* 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.
* Bugfix in moveToBurn()Arno2010-11-061-0/+15
| | | | | | | | Using the filename from the QModelIndex isn't enough to determine wether the file is a cover or not. A series can have more than one part. So check the real file type and only copy if it's not of type Movie. This fix should obsolete the new ConsistencyChecker :)
* Fix oddities in NewMovieWizardArno2010-09-111-1/+1
| | | | | | | | | Well, this one should have been easy, but there's always a way to make things complicated. Select proper entries for mPartno and mFileType in NewMovieWizard. Note to self: never ever forget about QObject::blockSignals(bool) again. This is way easier than fiddling around with boolean logic...
* Implemented editing of file part numbersArno2010-08-131-2/+13
| | | | | | Added the possibility to edit file part numbers via context menu in FilesTreeWidget. This action triggers the edit event on the specific QModelIndex.
* Fixed sorting of Display nameArno2010-08-131-3/+13
| | | | | | Fixed sorting of DisplayName column in FilesTreeModel. Now it's sorted by SeriesName and SeriesPart separately instead of taking the whole DisplayName as a string.
* Show picture size or duration in FilesTreeViewArno2010-08-121-22/+103
| | | | | | | | | | | | Finally managed to view size of pictures or duration for movies in the file view. That values are not held in the database, they're created on the fly. For this to perform I created a disk based cache. I also had to create some convenience functions: FilesTreeModel::streamInfo(const QString &) FilesTreeModel::pictureInfo(const QString &) The cache is a QDataStream and will be deleted if the magic doesn't fit.
* Usability fix1.0.0Arno2010-08-071-1/+0
| | | | | Remember selected tab on startup. Also remember selected view mode from archive.
* Added tooltip to FilesTreeViewArno2010-08-071-1/+29
| | | | | Added tooltip to FilesTreeView when showing archived or local movies. The tooltip shows all files associated with the SeriesPart.
* Bugfix when adding files on DVDArno2010-08-061-2/+2
| | | | | Insert a dummy file into the database when adding files already archived.
* Implement FilePropertiesDialogArno2010-07-311-0/+76
| | | | | | | | | | | Implemented a dialog for file properties. When the mime type says it's a video, fork ffprobe to read the properties of all streams and show them in a QTreeView powered by a SmTreeModel. If the mime type is image, use QImage to read some properties and show them in the same dialog. This commit introduces the new class FilePropertiesDialog. I also had to implement a copy constructor for SmTreeItem. It obsoletes classes ActorWidget, ActorModel and MoviePropertiesDialog.
* Don't add quality to coversArno2010-07-291-1/+5
| | | | | | | | | | | | Fix adding quality to cover files in database by binding a NULL value when type != Movie in FilesTreeModel. While fixing this I discovered a typo in the database schema. The sequence for genres was named genres_igrenres_id__seq. Removed the superfluous 'r' in the name and fixed migdb.py on the way. Now SheMov doesn't crash any more when adding a new series part, but the new item still doesn't get selected...
* Set window title in ArchiveTreeViewArno2010-07-241-1/+14
| | | | | | | | Construct a window title in ArchiveTreeView and show it when Tab is activated or file mode is changed. Also deleted the unneded slot newWindowTitle in SheMov: setWindowTitle is a slot by itself.
* Implemented add coversArno2010-07-181-1/+18
| | | | | | 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 delete files from tree viewArno2010-07-181-0/+36
| | | | | Files can now be delete from the files tree view. When doing so, the files will be deleted permanently and also removed from the database.
* Implemented "move to burn directory" for TreeWidgetArno2010-07-181-0/+14
| | | | | Files from the archive can be moved to a configurable directory with this function. The specified files won't be deleted from the database.
* Preparation for new move to burn implementationArno2010-07-171-0/+8
| | | | | | 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.
* Moved item creation in FilesTreeModel to functionArno2010-07-151-40/+64
| | | | | | | Created function populate(QSqlQuery) to make population of model more generic. Preparation for different views of files.
* 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
* First version of NewMovieWizard::acceptArno Moeller2010-07-091-1/+4
| | | | | This version is not tested and may contain some very exiting, new bugs. But it compiles.
* Preparations for NewMovieWizard::acceptArno2010-07-081-0/+32
| | | | | | | -new memfunc: SeriesTreeModel::addSeries -new memfunc: SeriesTreeModel::addSeriesPart started FilesTreeModel::addFile, not finished yet.
* Actors and genre editArno2010-06-261-1/+1
| | | | | | | | | | | | | | | | | | Implemented widgets for actor and genre editing of movies. Created new MappingTableWidget for both genres and actors and revamped ArchiveTreeView to show 2 widgets below the FilesTreeView separated by a splitter. While testing the new setup several bugs were fixed: -an SQL syntax error in FilesTreeModel -fixed SmModelSingleton to properly work with table names I also changed the signature of MappingTableModel::addMapping for the ease of use and added MappingTableModel::removeMapping. MappingTableModel got 2 new convenience functions: 1. bool contains(QString) to check if an item is already present 2. QModelIndex find() to get the index of a specific value from the model.
* Sorting for FilesTreeModelArno Moeller2010-06-251-2/+11
| | | | | | | | Implemented individual sorting for FilesTreeModel: 1. Don't compare the "Movies" and "Covers" nodes, keep the initial order. 2. Compare Size and DvdNo by int/longlong instead of comparing the displayed strings.
* Made FilesTreeWidget workArno2010-06-241-37/+46
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Started implementation of FilesTreeModelArno2010-06-201-0/+179
No visible representation yet. Implemented setData for quality and dvdno, but not tested yet. Dunno yet if anything else has to be editable.