summaryrefslogtreecommitdiffstats
path: root/seriestreewidget.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Get rid of old archiveArno2013-07-271-710/+0
| | | | Yeah, finally it's gone! Lot's of useless, unneeded code vanished :)
* Fix setAlternatignRowColorsArno2013-04-101-21/+4
| | | | | | | | | | | | | | | | | | | | Well, what started as a try to simplify QTreeView ended in a mass header murder... What happened: * I searched for a way to let every QTreeView honor the setAlternatingRowcolors() setting. Unfortunately it isn't enough to just set the global palette and set it to true. So every QTreeView is now derived from SmTreeView * SmTreeView registers itself with SmGlobals, so the property is set _after_ it's constructed. It's definitely not enough to call it in the constructor. I guess that's a bug. But it's enough to append the SmTreeView to a QList<QWidget*> in SmGlobals and call it _after_ the painting is done. * As an added Bonus we can add virt. funcs to every SmTreeView at will While at it I realized that most of the included headers were void, so remove them. No idea what impact it has on the bin size...
* New Class: SmTreeViewArno2013-04-051-1/+1
| | | | | | | | | | Code reusage: all 3 tabs had the same funtions: readHeaderConfig, writeHeaderConfig and toggleHeader, so turn it into a class derived from QTreeView. Unfortunately mATree didn't do things as later added Views, so it took some time to find the culprit in SheMov::readSettings :( Hopefully I didn't break too much...
* Fix ColorsArno2013-03-171-0/+1
| | | | | | | This is more a qt5-fix than a SmDirModel fix. The global palette doesn't propagate any more, so we have to set the palette in every QTreeView separately. Very annoying and tedious. Maybe I missed a Widget or two, dunno...
* Port to Qt5Arno2013-03-031-17/+17
| | | | | | | | * 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 :)
* Revamp Show all Files ActionArno2013-02-071-1/+1
| | | | | Change action to show all local movies, no favorites, no pictures, to ease selection of files to burn.
* Filter out favoritesArno2013-02-061-1/+1
| | | | | Filter out favorites when showing all files. Makes it easier to select files for burning.
* Bugfix: fix sorting with subtitlesArno2012-10-271-5/+3
| | | | Sort by subtitle string when there's no partno in SeriesTreeWidget.
* SeriesTreeModel fixArno2012-10-101-23/+15
| | | | | | | | | * make it possible to delete whole series again. No code fix, just the database layout: add on delete cascade to metadata * get rid of propertiesdialog.{cpp,h}. It was useless and called from the "Edit.." context menu. Code bloat, I guess... * Do something useful when calling "Edit...". Rename Series or ask for a new SeriesPart
* Foremost a fix for SmTreeModelArno2012-09-301-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not working again, but I eventually have to commit the changes. Fixes to SmTreeModel: * Fix SmTreeModel::index(). The previous comment was quite valid. I'm surprised that it worked at all. I have no clue why to return an invalid QModelIndex if the column isn't 0. Now an index with any valid column number can be created. * Fix SmTreeModel::parent(). Again, why shouldn't we create a parent index with a column other than 0? No idea... * Fix SmTreeModel::headerData(). Add some sanity checks. * Fix SmTreeModel::findRecursive(). Well, what is there to say. It never worked for models with a depth > 1, but obviously it didn't really matter until now. To make it work I had to change SmTreeItem as well. SmTreeItem::next() returns the next valid parent/sibling, or 0 if there isn't one. There may be some fallout from these changes, but they're yet to be seen. Changes to PictureView: * fix selecting an item according to the new datasbase layout * same goes for editing items. If an update actually works has to be checked. Overall, it's an intermediate commit that should have been a sane series of commits. Can't be changed now...
* Made FileInfoItem configurableArno2012-03-241-1/+1
| | | | | | | Create copious options for FileInfoItem, reintroducing the Pictures tab in ConfigurationDialog. Also fixed a long standing bug in SeriesTreeWidget: don't static_cast() an event. It'll succeed even when called from a destructor.
* Fix FrameCache and HoverWindowArno2012-03-181-4/+5
| | | | | | Another commit that should be two. While fixing FrameCache to delete invalid Pixmaps, I ventured into the depths of HoverWindow. Now it hides when focus leaves the widget we're hovering over.
* Hmm, checking out treemodel again. This seems way too complex...Arno2011-08-231-2/+3
|
* First draft of PropertiesDialogArno2011-08-221-2/+8
| | | | | | Kinda mock-up of new PropertiesDialog. The caption label works, though for some reason I can't set a background image via Stylesheets. It also shows the files belonging to the SeriesPart.
* Center Dialogs on screenArno2011-08-171-1/+1
| | | | | | Since I'm now using a tiling window manager dialogs have to center themselves on the screen. Otherwise they end up at QPoint(0,0). Not very nice. Subclassed QDialog to SmDialog and converted all dialogs.
* Use new field IsLocal in SeriesTreeModelArno2011-05-141-1/+42
| | | | | Use field IsLocal in SeriesTreeModel when filtering local or archived files.
* Add field isLocal to SeriesTreeModelArno2011-05-141-1/+1
| | | | | | | | | | 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 editing series and seriespartsArno2011-05-071-3/+88
| | | | | | 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-1/+1
| | | | | | 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 :)
* Fix Hotspot of X-Cursor when hoveringArno2011-04-301-1/+2
| | | | | Made Y-Offset for the cursor configurable. After switching from kwin to awesome WM the hotspot for hovering was way off.
* Added filter option for favoritesArno2011-01-221-0/+15
| | | | | Added filter for only showing series marked as favorites. The other filter options are disabled when in this mode.
* Bugfix for favoritesArno2011-01-221-1/+1
| | | | | 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-1/+19
| | | | | 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-1/+6
| | | | | | | | | | | 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.
* Fix qWarnings() at startup and shutdownArno2010-12-301-0/+9
| | | | | | | | | | | | | | 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.
* Pimp my filters!Arno2010-12-281-21/+97
| | | | | | | | | | | | Enhanced the filter function in ArchiveTreeView. The prefixes are gone. The filter mode is now selectable by menu or toolbar. Created 7 new icons, also selectable in the configuration menu. As a bonus the filter QLineEdit now comes with a QCompleter. The QStringListModel of the completer is filled in a separate thread. The QThread is only used as a resource for control. The work is done in a QObject connected to the QThread's started() signal as described in http://labs.qt.nokia.com/2006/12/04/threading-without-the-headache/
* Made colors configurableArno2010-12-261-2/+4
| | | | | | | | | 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.
* Bugfix in addCoverArno2010-11-271-2/+1
| | | | | | Fixed long standing bug in SeriesTreeWidget::addCover(). If the target directory didn't exist, the file wouldn't be copied. Use Helper::moveToArchive instead of QFile::rename.
* 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.