summaryrefslogtreecommitdiffstats
path: root/newpicsdialog.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Fix crash when trying to read an invalid imageArno2024-06-171-0/+3
| | | | | | Helper::picSize assumed that all data passed to it is a valid image and thus crashed with an exception. Wrap it into try - catch and return QVariant() when the pic is invalid.
* Make it run with Qt6Arno2022-04-151-7/+6
| | | | | | | | | This is a huge commit. Changes: * Obviously, make it compile * Make it run (only scarcely tested) * get rid of most of clang's warnings Let's see what surprises are in store...
* Make NewPicsDialog usable by keyboardArno2019-01-121-0/+3
| | | | | | | | | | | | | | Fix focus policy: only change focus between MappingTreeWidget and MappingTreeResultView. Also, block updating the selection of MappingTreeWidget when removing an item from the result view. That operation resets the result selection and by signal changes the selection of the mapping tree. The easiest way I could come up with was a member flag that is set in removeMapping and checked and cleared in resultSelectionChanged. Clearing the flag right after removing the item doesn't work, most likely because of thread affinity (just a guess, didn't check it). If it has side effects remains to be seen...
* Modernize newpicsdialog.cppArno2018-11-231-11/+11
| | | | Use type-safe connect syntax and weed out foreach.
* More code churnArno2018-07-201-0/+1
| | | | | Create separate files for MappingData and MappingTreeResultModel. Hopefully no functional changes.
* Just code shuffle, no functional changeArno2018-07-191-0/+1
| | | | | Split up all the classes in mappingtreewidget into separate files to make editing easier.
* Create file for MappingTreeViewArno2018-07-191-0/+1
| | | | Single it out to a separate file to make editing easier.
* Implement archive pics for FSWidgetArno2018-03-311-36/+0
| | | | And remove a lot of cruft... Still much work to be done :(
* Make unpack directory configurableArno2017-12-271-1/+1
| | | | | Add option and use it. Warn if the directory is not accessible and bail out. Initialize mFilesCtr to 0 so we don't crash if it's < 0
* Add Delete to NewPicsDialogArno2016-10-161-1/+13
| | | | Also fix handling of next picture.
* Add Next> to NewPicsDialogArno2016-10-161-1/+32
| | | | | | Make archiving various pictures easier. When NewPicsDialog is calles with a directory, the Next> button archives the current pic and selects the next.
* Don't crash if we feed a non-picture to NewPicsDialogArno2016-03-311-0/+3
| | | | | Actually use valid. Return when we get something else than an image. Otherwise we'd crash in ImageMagick::ping.
* Remove presets from NewPicsDialogArno2016-03-301-50/+8
| | | | | | | | and replace them with write/readSettings. It was a useless feature anyway, don't even remember what it was good for. Also fix another bug in MappingTreeResultModel: Clear mCurrentData too, when clearData is called.
* Usability fixesArno2015-06-071-0/+5
| | | | | | | | | | * start maximized * focus MappingTree when showing NewPicsDialog * Keyboard Shortcuts for FilesystemWidget: CTRL+UP: go to parent dir CTRL+LEFT: go back CTRL+U: unpack * close UnpackDialog when done
* Accept NewPicsDialog with CTRL+EnterArno2015-06-061-0/+3
|
* Fixes for NewPicsDialogArno2015-06-061-1/+3
| | | | | | | * Position progress bar in the center of the dialog instead of PictureViewer * Set title for progress bar * set appropriate windowTitle for NewPicsDialog
* Fixes for NewPicsDialogArno2015-06-061-2/+5
| | | | | * Make sure that we don't add pictures without mapping * Let the windowmanager position the progress dialog
* Implement presets for NewPicsDialogArno2015-04-081-3/+44
| | | | A set of attributes can now be saved and loaded in NewPicsDialog.
* Save position of NewPicsDialogArno2015-04-081-0/+24
| | | | | Add button to save the position of the NewPicsDialog and move it there when we show()
* Show NewPicsDialog and Progress when adding FilesArno2014-12-271-1/+1
|
* Sprinkled newpicsdialog.cpp with qApp->processEvent()Arno2014-12-231-1/+6
|
* Various Bugfixes and cleanupsArno2014-12-101-3/+1
| | | | | | | | | | | | * remove debug statements from SmDirWatcher * Don't crash on parentDir when current Dir is already deleted * Fix PicFilesModel MappingQuery. It needlessly referenced the table pics in FROM causing an expensive full table scan! * Fix findRecursive in PicFilesModel: Stupid typo! * Give SmDirWatcher a separate DB-Connection. One Thread, one Connection * Remove several includes This should have been 6 commits, but that's how debugging works :(
* Fix commit dc7cc269a4fffe43bdac2ae2dc6548fbd1e3bb5eArno2014-07-091-1/+1
| | | | | | | | Since that commit we not only recorded leaves for Mappings, but also the nodes. This is plain wrong, since we build the path/tree ourselves where it matters (e.g. MappingTreeItem). Fix it by checking recursively if the MappingItem has children.
* Added QProgressdialogArno2014-06-071-1/+13
| | | | Show ProgressDialog when checksumming and archiving pictures
* Fix Style issuesArno2013-10-121-1/+1
| | | | | | * Change fixed width front from "courier" to "Monospace" * Remove foregroundcolor from SmTreeItem. Wasn't used nor needed, quite the opposite: it made SheMov deviate from the default style.
* Fix archiving picsArno2013-08-221-2/+8
| | | | | | | | | | Move the pic to archive first. If the filename returned from moveToArchive is different then the file already existed and was mangled with the md5sum. Record the new filename in the db. Theoretically, the same problem exists with archiving movies, but it's very unlikely to happen (I hope). Also, it's way more difficult to untangle.
* Give Pictures some love!Arno2013-08-221-12/+29
| | | | | | * Show and archive size of pictures * Fix SqlQueries in PicFilesModel: removeFiles and changeMappings * use delegate in PictureView
* Usability fixArno2013-08-211-0/+8
| | | | | | | * repair shortcuts for adding files to NewPicsDialog and showing it from PictureViewer2 * Replace files in NewPicsDialog instead of adding them * add missing header to MappingTreeModel
* Fix NewPicsDialog + NewPicFilesModelArno2013-08-161-31/+16
| | | | | | | * remove some of the Transaction madness * make it possible to archive pics again It's far from finished....
* Revert "Prevent datacollector from running when operating on files"Arno2013-07-291-3/+3
| | | | | | | This reverts commit 06cfadc8386aec27b9c7c43486fc0b057e9fb022. Turns out that this was not the root cause for the crashes. Still stumped.
* Prevent datacollector from running when operating on filesArno2013-07-291-3/+3
| | | | | | | This stuff was racy from the beginning. It could happen that the model got reset after we fetched the selected indexes. Add a mutex and lock it before operating on the file view. Hopefully this will many, if not all random crashes.
* Cleanup closeEventArno2013-07-271-5/+0
| | | | | | | | | | Don't try to delete all the prepared statements manually. Get rid of the ~destructors and just close the QSqlDatabase. close() deletes all Statements. Also, quit() all QThreads on closeEvent() except CompleterProducer. When the experimental archive view gets merged, that QThread is gone. No need to bother...
* Fix setAlternatignRowColorsArno2013-04-101-16/+9
| | | | | | | | | | | | | | | | | | | | 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...
* Fix ColorsArno2013-03-171-0/+3
| | | | | | | 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-6/+6
| | | | | | | | * 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 :)
* Yet another MappingTreeModel fixArno2012-11-171-1/+1
| | | | | Forgot to fix/rename MappingTreeResultModel... Adding pictures works again :)
* More renaming and database cleanupArno2012-11-161-1/+1
| | | | | | | | | | | | | Rename: * drop table pics_mappings * rename pics_mappings2 to pics_mappings (no column renames) Cleanup: * drop tables and sequences: pics_attributes* * drop tables and sequences: pics_actors* * drop tables and sequences: pics_themes* Still works!
* Usability: Make archiving pics easierArno2012-11-161-0/+6
| | | | | | | | | | | To make archiving pictures from different sources easier, add a NewPicsDialog to PictureViewer. Add shortcuts to show the dialog and adding pics to it. After adding all pics with the same mappping, just click OK and add them to the archive. Shortcuts: Meta+s: Show NewPicsDialog Meta+a: Add current pic
* Bugfixes: don't select dirs and don't crash on write settingsArno2012-10-271-1/+1
| | | | | | | Only select files when archiving pics from filemanager. While at it, I noticed a crash on close when no item is selected in PicturesWidget. So check if MappingData is valid on writing settings. Best way is MappingData::isValid(), and for that I needed a explicit constructor.
* Fix archiving picturesArno2012-10-271-4/+4
| | | | | | Well, what can I say. Lost in recursion and parent pointers. This commit actually boils down to using the proper database tables and inserting the right values. 'Nuff said...
* Archive selected picturesArno2012-09-081-4/+19
| | | | | Added convenience function to archive selected pictures. Selected pics in the FileManager will automagically be added to NewPicsDialog.
* Remember last directory when archiving picsArno2012-03-191-1/+3
| | | | Write last opened dir from QFileDialog in NewPicsDialog.
* Move some code from NewPicsDialog aroundArno2012-02-261-43/+3
| | | | | Put mapping editor into a seperate class to make it easier using it for changing mappings later.
* Make NewPicsDialog archive picturesArno2012-02-251-11/+73
| | | | | | Finally NewPicsDialog actually does something. Added another parameter to Helper::moveToArchive. If set to true, files will only be copied instead of moved. Default is false, not changing the expected behavior.
* Implemented mapping widget for NewPicsDialogArno2012-02-251-1/+46
| | | | | | | Make it possible to add mappings to new pictures. This actually was a tough one. Maybe I shouldn't drink and code. Next: make NewPicsDialog actually do something.
* Implemented NewPicsDialogArno2012-02-241-0/+248
Version 1 of NewPicsDialog. Just one single tab for adding files. Does nothing yet besides adding and removing files.