summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Show picture size or duration in FilesTreeViewArno2010-08-126-33/+124
| | | | | | | | | | | | 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.
* Fix doubleclick in FilesTreeWidgetArno2010-08-074-0/+14
| | | | | | | | | Doubleclicking the DvdNo in FilesWidget did 1. play the movie 2. create an editor event in the widget Now doubleclicking only starts the default player. The quality can be edited via context menu.
* Bugfix in NewMovieWizardArno2010-08-072-13/+44
| | | | | | Make Part no work in NewMovieWizard. The logic for this was totally borked. Well, it was not really present. One could only assign one Part number to all files.
* Verion bumpArno2010-08-073-5/+1
| | | | Created version 1.0.0 treemodel. Also removed some <QDebug> includes.
* Usability fix1.0.0Arno2010-08-073-4/+26
| | | | | Remember selected tab on startup. Also remember selected view mode from archive.
* Usability fix in FilesTreeWidgetArno2010-08-071-0/+3
| | | | | Re-select current item from SeriesTreeWidget when changing back to FilesTreeModel::Normal.
* Added tooltip to FilesTreeViewArno2010-08-074-2/+34
| | | | | 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-062-2/+5
| | | | | Insert a dummy file into the database when adding files already archived.
* Fixed edit trigger in SeriesTreeViewArno2010-08-055-0/+23
| | | | | | | | | | | | | | | | | | | | | 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-014-5/+158
| | | | | | | | | | | | | | 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
* Implement FilePropertiesDialogArno2010-07-3121-529/+306
| | | | | | | | | | | 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.
* Added database maintenance codeArno2010-07-317-2/+99
| | | | | | Implemented a function in MappingTableModel to remove all actors/genres with no references in the according mapping table. Available through the "File" menu.
* Bugfix commitArno2010-07-306-7/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The journey through the internals of SheMov started by fixing SeriesTreeWidget::readSettings(). The selected index didn't really get selected on startup because only QItemSelectionModel::setCurrendt() was called. Replace it with QItemSelectionModel::select() and QTreeView::setCurrent(). Also fix SeriesTreeWidget::writeSettings() to only write selected items to QSettings() when something is selected. While working on selections I realized that there is a serious bug in Helper::moveToArchive. The destination directory in the archive must be created if it doesn't exist. For a testcase I needed an easy way to move files back from the archive to incoming directory, so I added FilesTreeWiget::moveToDirectory(). This lets you move files from the FilesTreeWidget to any directory. During testing I realized that SeriesTreeWidget::deleteFromSeries() QMessageBox() doesn't show files when deleting a series part. Fixed that by adding SeriesParts to file list. Finally a newly added SeriesPart gets selected and selected by expanding it first and then calling QItemSelectionModel::select() To make a long story short: 1. fix SeriesTreeWidget::{read,write}Settings 2. add FilesTreeWidget::moveToDirectory() 3. fix SeriesTreeWidget::deleteFromSeries() QMessageBox 4. fix selecting newly added SeriesParts
* Fix SQL errorsArno2010-07-292-2/+12
| | | | | | | | | | | While trying to find out why a newly added SeriesPart won't get selected programmatically, I discovered a not so serious SQL bug. MappingTableModel::addMapping happily tries to execute queries with an invalid seriesPartId. Return if seriesPartId = -1. Now all items expanded previously will be expanded after adding a new movie. (SeriesTreeWidgetT::seriesAdded). Unfortunately the original problem remains unsolved...
* Bugfix in AddCoverDialog::AddCoverDialogArno2010-07-291-1/+1
| | | | | | | | | | | mCurrentType wasn't initialized in AddCoverDialog constructor, so it ended up with a random number. Fortunately it was too big for a Pg::SmallInt and the db choked with the value being too big for a Pg::SmallInt. Fix: Connect QComboBox::currentIndexChanged(QString) first and then add items to the QComboBox. That triggers the SLOT and sets mCurrentType to the right value.
* Don't add quality to coversArno2010-07-292-3/+7
| | | | | | | | | | | | 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...
* Fix selection madness in ArchiveTreeWidgetArno2010-07-294-41/+26
| | | | | | | | | | | | | First try on fixing this. Still use QItemSelectionModel::selectionChanged, but ignore the QItemSelections. Use QItemSelectionModel::selectedRows() instead and compute the seriesPartIds on every change. Hopefully this guarantees having valid QModelIndexes all the time. This fix also obsoletes the quite awkward function SeriesTreeWidget::mapToSource(). Make the QSortProxyModel of SeriesTreeWidget available through SeriesTreeWidget::seriesProxy() instead.
* Reset NewMovieWizardArno2010-07-287-9/+62
| | | | | | | | | | | | | | | | | Well, the point of this commit was to have one NewMovieWizard in memory all the time and just show it when it's needed. For this several things were necessary: 1. implement initializePage() for every QWizardPage. For this I had to implement reset functions in some models. 2. setOption(QWizard::IndependentPages, true) in Wizard constructor. 3. Make NewMovieWizard a member of SheMov... Well, it was, already, but I didn't remove the ptr. The good news: the Wizard works. Bad News: 1. Program crashes in ArchiveViewWizard::currentChanged (see TODOS) 2. Cover files also have a quality Attribute attached.
* Fixed StatisticsDialogArno2010-07-259-360/+245
| | | | | | | adapted StatisticsDialog to the new database schema and make it use WebKit and HTML to display the graph bars. This change obsoleted the classes ActorCountModel and GraphBarWidget.
* Fix selected items in statusbar for archiveArno2010-07-244-6/+12
| | | | | Show number of selected items of FilesTreeView in statusbar when selecting files.
* 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-2412-47/+92
| | | | | | | | | | | | | 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.
* Fix database configurationArno2010-07-242-20/+12
| | | | | Remove default database from SheMov. Now open named database in SmModelSingleton and use configured settings.
* Set window title in ArchiveTreeViewArno2010-07-246-7/+47
| | | | | | | | 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.
* Big code cleanupArno2010-07-2348-4405/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | hopefully removed all code connected to ArchiveViewWidget in this tree. Files removed ({h,cpp}): *archiveeditdialog *listeditor *covereditor *archivefilewidget *addmoviewizard *archivefileview *archiveproxy *sizedelegate *archivedidelegate *archiveitemeditdialog *coveritem *movieitem *moviemodel *moviemodelsingleton *listmodel *listmodelsingleton *archiveviewwidget *archiveiteminfoedit *archiveitemcoveredit *fileinfoitem *fileinfomodel See added file TODOS for stuff that needs fixes.
* Implemented add coversArno2010-07-188-6/+178
| | | | | | 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-186-0/+67
| | | | | 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.
* Bugfix: reset size when appropriateArno2010-07-181-1/+1
| | | | | Also reset the size counter in FilesTreeWidget when changing series in normal view.
* Implemented setDvdNo for FilesTreeArno2010-07-185-2/+89
| | | | | | The dvd number can be set for several files at once with this function. Also fixed a little bug when showing the series name in the status bar. Only show file part number if it is > 0.
* Implemented "move to burn directory" for TreeWidgetArno2010-07-186-0/+89
| | | | | 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-178-1/+100
| | | | | | 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.
* Implemented two new file viewsArno2010-07-175-1/+59
| | | | Implemented filter for showing only local files or only archived files.
* Moved item creation in FilesTreeModel to functionArno2010-07-152-40/+67
| | | | | | | 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-097-22/+41
| | | | | | | | | | | | | | | | | 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-093-5/+73
| | | | | This version is not tested and may contain some very exiting, new bugs. But it compiles.
* Preparations for NewMovieWizard::acceptArno2010-07-084-1/+92
| | | | | | | -new memfunc: SeriesTreeModel::addSeries -new memfunc: SeriesTreeModel::addSeriesPart started FilesTreeModel::addFile, not finished yet.
* Collecting data on NewMovieWizardArno2010-07-041-8/+17
| | | | | Started accept() in NewMovieWizard. Seems we need some major revamping of SeriesTreeModel et al.
* Added actors and genres to NewMovieWizardArno2010-07-043-5/+36
| | | | Implemented 2 new pages for NewMovieWizard: actors and genres.
* Fix MovieInfoPageArno2010-07-047-18/+112
| | | | | | | | | | | | | | | 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
* Started NewMovieWizard for adding moviesArno2010-07-025-2/+346
| | | | | | | | Finished GUI for first page of NewMovieWizard. To make things easier I added two new member functions to SmTreeModel: -QModelIndex find() to find items by value of a column -void reparent() to remove an item from one parent and add it to another
* Implemented "open with" submenu in ArchiveTreeViewArno2010-07-024-8/+19
| | | | | | | | | 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-268-0/+82
| | | | | | | | | | | | | 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.
* Actors and genre editArno2010-06-269-20/+313
| | | | | | | | | | | | | | | | | | 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.
* Update for migdb.pyArno2010-06-251-1/+1
| | | | | Pass the right var to Migrator::newEntry for the file nubmer. Before it passed the series part number as the file number to newEntry.
* New model: MappingTableModelArno2010-06-254-3/+261
| | | | | | | | | Implemented new Model for Mapping tables. This model is intended to replace the old ListModel and Singleton. MappingTableModel is derived from SmTreeModel and can be accessed using SmModelSingleton. It's quite dynamic building its queries, and has yet to be tested. Hopefully I got it right the first time :)
* Sorting for FilesTreeModelArno Moeller2010-06-254-6/+48
| | | | | | | | 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-2410-50/+129
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* Start making FilesView workArno2010-06-236-12/+91
| | | | | Introduced filestreewidget, just like seriestreewidget. The connection is still missing, though.