| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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...
|
|
|
|
|
|
|
|
|
|
| |
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...
|
|
|
|
|
|
|
| |
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...
|
|
|
|
|
|
|
|
| |
* 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 :)
|
|
|
|
|
| |
Change action to show all local movies, no favorites, no pictures, to
ease selection of files to burn.
|
|
|
|
|
| |
Filter out favorites when showing all files. Makes it easier to select
files for burning.
|
|
|
|
| |
Sort by subtitle string when there's no partno in SeriesTreeWidget.
|
|
|
|
|
|
|
|
|
| |
* 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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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...
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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 field IsLocal in SeriesTreeModel when filtering local or
archived files.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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 :)
|
|
|
|
|
| |
Made Y-Offset for the cursor configurable. After switching from
kwin to awesome WM the hotspot for hovering was way off.
|
|
|
|
|
| |
Added filter for only showing series marked as favorites. The other
filter options are disabled when in this mode.
|
|
|
|
|
| |
Fix bug in SeriesTreeWidget when filtering. Take into account new column
Favorite when filtering, so it will be hidden in SeriesTree.
|
|
|
|
|
| |
SeriesParts can be marked as favorites. They won't be selectable when
filtering by local Movies only.
|
|
|
|
|
|
|
|
|
|
|
| |
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 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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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/
|
|
|
|
|
|
|
|
|
| |
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 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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
This reverts commit 20df1c43f5b7425810b5d16e3658f0772aae9b6c.
revert the revert... I actually wanted to check out something...
|
|
|
|
| |
This reverts commit a3a556cc8af3433de1f8d5e22a4ba62cc029f145.
|
|
|
|
| |
Fixed HoverWindow so it always stays completely on screeen.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
SeriesTreeWidget show a popup window with the movies assigned to the
series when hovering over a series entry.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
| |
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...
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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().
|
|
|
|
|
|
| |
Don't add items to mExpandedItems in readSettings. This already happens
in the slot itemExpanded. Before the list quickly filled up with
duplicate entries.
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|