summaryrefslogtreecommitdiffstats
path: root/archivetreeview.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix qWarnings() at startup and shutdownArno2010-12-301-2/+2
| | | | | | | | | | | | | | 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.
* Made all icons in qresource available for UIArno2010-12-271-0/+10
| | | | | | | | | | | | | | | | 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-0/+9
| | | | | | | | | 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.
* Fixed windowTitle when showing archiveArno2010-12-121-1/+1
| | | | | In d617e0679b426 I fixed a bug not to access the mode name hash when mode = -1, but forgot to fix ArchiveTreeView::constructWindowTitle().
* Selectable columns in FilesTreeViewArno2010-12-051-15/+4
| | | | | | | | | 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.
* Added action to copy file path to clipboardArno2010-11-281-0/+38
| | | | | | | | | 4 new actions to copy the file path to clipboard. It's either the unix full path, the unix dir, the windows full path or the windows dir. For the latter '/' is replaced with '\' and a drive letter is prepended. The drive letter is configurable in the ConfigurationDialog. While at it I revamped it and added another tab to make it more user friendly.
* Streamline database accessArno2010-11-271-0/+5
| | | | | | | | | 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-0/+190
| | | | | | | | | 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.
* Fixed sorting of Display nameArno2010-08-131-0/+2
| | | | | | 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-5/+6
| | | | | | | | | | | | 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 fix in FilesTreeWidgetArno2010-08-071-0/+3
| | | | | Re-select current item from SeriesTreeWidget when changing back to FilesTreeModel::Normal.
* Added database maintenance codeArno2010-07-311-0/+29
| | | | | | Implemented a function in MappingTableModel to remove all actors/genres with no references in the according mapping table. Available through the "File" menu.
* Fix selection madness in ArchiveTreeWidgetArno2010-07-291-24/+25
| | | | | | | | | | | | | 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.
* Act on doubleClick in FileTreeWidgetArno2010-07-241-5/+5
| | | | | | | | | | | | | 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.
* Set window title in ArchiveTreeViewArno2010-07-241-0/+9
| | | | | | | | 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-0/+1
| | | | | | 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.
* Bugfix: reset size when appropriateArno2010-07-181-1/+1
| | | | | Also reset the size counter in FilesTreeWidget when changing series in normal view.
* Preparation for new move to burn implementationArno2010-07-171-0/+1
| | | | | | 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-171-0/+19
| | | | Implemented filter for showing only local files or only archived files.
* 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/+28
| | | | | | | | | | | | | 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-261-1/+47
| | | | | | | | | | | | | | | | | | 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.
* Made FilesTreeWidget workArno2010-06-241-8/+42
| | | | | | | | | | | | | | | | | | | | | | | | 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-231-2/+22
| | | | | Introduced filestreewidget, just like seriestreewidget. The connection is still missing, though.
* Singleton cleanupArno2010-06-231-6/+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.
* Implemented SeriesTreeWidgetArno2010-06-131-4/+4
| | | | | | | | | 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
* Made ArchiveTreeView workArno2010-06-121-0/+1
| | | | | Made ArchiveTreeView work and took a look at it. Right now flat view seems to be the better alternative.
* Created basic ArchiveTreeViewArno2010-06-121-0/+35
Implemented Widget for archive tree view. It's very basic and does nothing.