Summary: | Rotate & set background image to right click menu | ||
---|---|---|---|
Product: | [Applications] kphotoalbum | Reporter: | Risto H. Kurppa <risto> |
Component: | Browser | Assignee: | KPhotoAlbum Bugs <kpabugs> |
Status: | RESOLVED FIXED | ||
Severity: | wishlist | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Risto H. Kurppa
2007-05-18 15:04:42 UTC
Rotate thumbnails or rotate image itself? If first, yes. I guess it would be a good idea to add shortcut if not already existing. If second, then no. KPA basic idea is to never touch the original images directly. Image manipulation are done via the plugins available through the KIPI interface. We could discuss it on the ml, if you think it deserves to. SVN commit 676746 by jkt: Allow rotating images from the thumbnail viewer as well BUG: 145632 M +30 -0 MainWindow/Window.cpp M +5 -0 MainWindow/Window.h M +3 -0 kphotoalbumui.rc --- branches/extragear/kde3/graphics/kphotoalbum/MainWindow/Window.cpp #676745:676746 @@ -563,6 +563,8 @@ actionCollection(), "oneProp" ); _configAllSimultaniously = new KAction( i18n( "Annotate Multiple Items at a Time" ), CTRL+Key_2, this, SLOT( slotConfigureAllImages() ), actionCollection(), "allProp" ); + _rotLeft = new KAction( i18n( "Rotate Left" ), 0, this, SLOT( slotRotateSelectedLeft() ), actionCollection(), "rotateLeft" ); + _rotRight = new KAction( i18n( "Rotate Right" ), 0, this, SLOT( slotRotateSelectedRight() ), actionCollection(), "rotateRight" ); // The Images menu _view = new KAction( i18n("View"), CTRL+Key_I, this, SLOT( slotView() ), @@ -867,6 +869,8 @@ #endif menu.insertSeparator(); + _rotLeft->plug( &menu ); + _rotRight->plug( &menu ); _recreateThumbnails->plug( &menu ); menu.insertSeparator(); @@ -1013,8 +1017,34 @@ _configOneAtATime->setEnabled(selection.count() >= 1 ); _sortByDateAndTime->setEnabled(selection.count() > 1 ); _recreateThumbnails->setEnabled( selection.count() >= 1 ); + _rotLeft->setEnabled( selection.count() >= 1 ); + _rotRight->setEnabled( selection.count() >= 1 ); } +void MainWindow::Window::rotateSelected( int angle ) +{ + QStringList list = selected(); + if ( list.count() == 0 ) { + QMessageBox::warning( this, i18n("No Selection"), i18n("No item is selected.") ); + } else { + for ( QStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) { + DB::ImageDB::instance()->info( *it )->rotate( angle ); + } + _dirtyIndicator->markDirty(); + reloadThumbnailsAndFlushCache(); + } +} + +void MainWindow::Window::slotRotateSelectedLeft() +{ + rotateSelected( -90 ); +} + +void MainWindow::Window::slotRotateSelectedRight() +{ + rotateSelected( 90 ); +} + void MainWindow::Window::reloadThumbnails(bool flushCache) { _thumbnailView->reload( flushCache ); --- branches/extragear/kde3/graphics/kphotoalbum/MainWindow/Window.h #676745:676746 @@ -132,6 +132,9 @@ void slotOrderIncr(); void slotOrderDecr(); void slotRecreateThumbnail(); + void slotRotateSelectedLeft(); + void slotRotateSelectedRight(); + void rotateSelected( int angle ); protected: void configureImages( bool oneAtATime ); @@ -176,6 +179,8 @@ KAction* _configOneAtATime; KAction* _configAllSimultaniously; KAction* _view; + KAction* _rotLeft; + KAction* _rotRight; KAction* _sortByDateAndTime; KAction* _viewInNewWindow; KActionMenu* _viewMenu; --- branches/extragear/kde3/graphics/kphotoalbum/kphotoalbumui.rc #676745:676746 @@ -10,6 +10,9 @@ <Action name="deleteSelected" /> <Action name="removeTokens" /> <Separator/> + <Action name="rotateLeft" /> + <Action name="rotateRight" /> + <Separator/> <Action name="oneProp"/> <Action name="allProp"/> </Menu> |