summaryrefslogtreecommitdiffstats
path: root/seriestreewidget.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix hover issuesArno2010-10-231-36/+34
| | | | | | | | | | | | | | Hopefully this commit fixes all issues with hovering over items. First, only use QCursor::pos() to determine the position of the hover window and fix position calculation accordingly. For that SmGlobals now return a QSize of the actual cursor size. Introduced a hoverOffeset to HoverWindow defaulting to SmGlobals::cursorSize() + 30 to prevent a HoverLeave event on showing the HoverWindow. Also fixed Qt::WindowFlags of HoverWindow. We don't want the HoverWindow to show in the taskbar or get sent to background when clicking on an item.
* Fixed crash when remembering selected tab, improve performanceArno2010-10-231-34/+33
| | | | | | | | | | | Strange things happen. As stated in commit 19674f6, SheMov crashed when setting the archive as current tab and then changing to filesystem view. This can be resolved by first showing the MainWindow and then applying the display changes. I guess it's an qt internal thing. Also vastly improved performance when hovering by only entering the hover code path when we actually have a HoverEvent. Before CPU usage spiked at 100% even if SheMov was idle.
* Revert "Revert "Let HoverWindow always stay on screen""Arno2010-10-171-3/+3
| | | | | | This reverts commit 20df1c43f5b7425810b5d16e3658f0772aae9b6c. revert the revert... I actually wanted to check out something...
* Revert "Let HoverWindow always stay on screen"Arno2010-10-171-3/+3
| | | | This reverts commit a3a556cc8af3433de1f8d5e22a4ba62cc029f145.
* Let HoverWindow always stay on screenArno2010-10-171-3/+3
| | | | Fixed HoverWindow so it always stays completely on screeen.
* Made hovering configurableArno2010-10-161-4/+14
| | | | | | Revamped misc tab in configurationdialog to QGroupBoxes. Added options for enabling or disabling hovering over pictures or the archive tree. Also implemented an option to set the opacity for HoverWindow.
* Created general purpose HoverWidgetArno2010-10-161-38/+4
| | | | | | This commit outsources the HoverWindow to a seperate file and makes it possible to set a pixmap to the window. Also the cursor offset is only calculated once in SmGlobals.
* Implemented hover for SeriesTreeWidgetArno2010-10-161-1/+100
| | | | | SeriesTreeWidget show a popup window with the movies assigned to the series when hovering over a series entry.
* 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-5/+44
| | | | | | | | | | | | | | 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
* Bugfix commitArno2010-07-301-7/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-291-2/+9
| | | | | | | | | | | 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.
* Fix selection madness in ArchiveTreeWidgetArno2010-07-291-12/+0
| | | | | | | | | | | | | 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-281-0/+17
| | | | | | | | | | | | | | | | | 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.
* 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