[KPhotoAlbum] [PATCH] make grid around images optional

Baptiste MATHUS ml at batmat.net
Tue May 8 11:30:24 CEST 2007


Hi all,

I just applied manually Jan's patch to workaround my automatic patch pb.
I did this just after svn updating my wc.

I just tested it and it seems to run fine. The patch adapted against the
current trunk (that works here :-)) is attached.

To the committers: can I commit it?

Thanks

2007/5/4, Baptiste MATHUS <ml at batmat.net>:
>
> Hey,
>
> I just tried applying your patch, but it does not seem to apply on the
> current trunk, should it?
>
> $ patch -p0 < risto.patch
> patching file Settings/SettingsData.h
> Hunk #1 FAILED at 96.
> 1 out of 1 hunk FAILED -- saving rejects to file
> Settings/SettingsData.h.rej
> patching file Settings/SettingsDialog.cpp
> Hunk #1 FAILED at 227.
> Hunk #2 FAILED at 281.
> Hunk #3 FAILED at 404.
> Hunk #4 FAILED at 486.
> 4 out of 4 hunks FAILED -- saving rejects to file
> Settings/SettingsDialog.cpp.rej
> patching file Settings/SettingsDialog.h
> Hunk #1 FAILED at 116.
> 1 out of 1 hunk FAILED -- saving rejects to file
> Settings/SettingsDialog.h.rej
> patching file ThumbnailView/ThumbnailWidget.cpp
> Hunk #1 FAILED at 414.
> Hunk #2 FAILED at 595.
> 2 out of 2 hunks FAILED -- saving rejects to file
> ThumbnailView/ThumbnailWidget.cpp.rej
>
> Thanks
>
> 2007/5/4, Jan Kundrát <jkt at gentoo.org>:
> >
> > Henner Zeller wrote:
> > > Hi,
> > > I haven't applied this patch yet locally, but the
> > >
> > > +    if (Settings::SettingsData::instance()->thumbnailDisplayGrid()) {
> > >
> > > line should probably be
> > >
> > > +    if (_mouseHandler->isResizingGrid() ||
> > > Settings::SettingsData::instance()->thumbnailDisplayGrid()) {
> > >
> > > .. because when we resize the grid, we want to see gridlines.
> >
> > Absolutely, thanks for correction. I missed that because this grid
> > resizing is another feature that I couldn't have used because I can't
> > really use middle button with mouse movement at the same time in my
> > particular setup.
> >
> > Attached is the updated version of the patch which also makes resizing
> > work with left button and control key :), same as in my last patch for
> > enabling panning in Viewer.
> >
> > Thanks again for your review,
> > -jkt
> >
> > --
> > cd /local/pub && more beer > /dev/mouth
> >
> > Index: Settings/SettingsData.h
> > ===================================================================
> > --- Settings/SettingsData.h     (revision 660935)
> > +++ Settings/SettingsData.h     (working copy)
> > @@ -96,6 +96,7 @@
> >      intProperty( Thumbnails, autoShowThumbnailView,
> > setAutoShowThumbnailView, 0 );
> >      boolProperty( Thumbnails, showNewestThumbnailFirst,
> > setShowNewestFirst, false );
> >      boolProperty( Thumbnails, thumbnailDarkBackground,
> > setThumbnailDarkBackground, false );
> > +    boolProperty( Thumbnails, thumbnailDisplayGrid,
> > setThumbnailDisplayGrid, true );
> >
> >      void setThumbnailCache( int value );
> >      int thumbnailCache() const;
> > Index: Settings/SettingsDialog.cpp
> > ===================================================================
> > --- Settings/SettingsDialog.cpp (revision 660935)
> > +++ Settings/SettingsDialog.cpp (working copy)
> > @@ -227,6 +227,12 @@
> >      _thumbnailDarkBackground = new QCheckBox( i18n("Show thumbnails on
> > dark background" ), top, "thumbnailDarkBackground");
> >      lay->addMultiCellWidget( _thumbnailDarkBackground, row, row, 0, 1
> > );
> >
> > +    // Display grid lines in the thumbnail view
> > +    ++row;
> > +    _thumbnailDisplayGrid = new QCheckBox( i18n("Display grid around
> > thumbnails" ),
> > +                                           top,
> > "thumbnailDisplayGrid");
> > +    lay->addMultiCellWidget( _thumbnailDisplayGrid, row, row, 0, 1 );
> > +
> >      // Display Labels
> >      ++row;
> >      _displayLabels = new QCheckBox( i18n("Display labels in thumbnail
> > view" ), top, "displayLabels" );
> > @@ -275,6 +281,10 @@
> >                 "you can set it to be dark instead.</p>");
> >      QWhatsThis::add( _thumbnailDarkBackground, txt );
> >
> > +    txt = i18n("<p>If you want to see grid around your thumbnail
> > images, "
> > +               "select this option.</p>");
> > +    QWhatsThis::add( _thumbnailDisplayGrid, txt );
> > +
> >      txt = i18n("<p>Checking this option will show the base name for the
> > file under "
> >                 "thumbnails in the thumbnail view.</p>");
> >      QWhatsThis::add( _displayLabels, txt );
> > @@ -394,6 +404,7 @@
> >      _albumCategory->setCurrentText( cat->text() );
> >
> >      _thumbnailDarkBackground->setChecked(
> > opt->thumbnailDarkBackground() );
> > +    _thumbnailDisplayGrid->setChecked( opt->thumbnailDisplayGrid() );
> >      _displayLabels->setChecked( opt->displayLabels() );
> >      _displayCategories->setChecked( opt->displayCategories() );
> >      _viewImageSetup->setSize( opt->viewerSize() );
> > @@ -475,6 +486,7 @@
> >
> >      opt->setAlbumCategory( name );
> >      opt->setThumbnailDarkBackground(
> > _thumbnailDarkBackground->isChecked() );
> > +    opt->setThumbnailDisplayGrid( _thumbnailDisplayGrid->isChecked() );
> >
> >      opt->setDisplayLabels( _displayLabels->isChecked() );
> >      opt->setDisplayCategories( _displayCategories->isChecked() );
> >      opt->setViewerSize( _viewImageSetup->size() );
> > Index: Settings/SettingsDialog.h
> > ===================================================================
> > --- Settings/SettingsDialog.h   (revision 660935)
> > +++ Settings/SettingsDialog.h   (working copy)
> > @@ -116,6 +116,7 @@
> >      QCheckBox* _thumbnailDarkBackground;
> >      QCheckBox* _displayLabels;
> >      QCheckBox* _displayCategories;
> > +    QCheckBox* _thumbnailDisplayGrid;
> >      QSpinBox* _autoShowThumbnailView;
> >      QSpinBox* _thumbnailCache;
> >
> > Index: ThumbnailView/ThumbnailWidget.cpp
> > ===================================================================
> > --- ThumbnailView/ThumbnailWidget.cpp   (revision 660935)
> > +++ ThumbnailView/ThumbnailWidget.cpp   (working copy)
> > @@ -414,14 +414,17 @@
> >      else
> >          p->fillRect( rect, palette().active().base() );
> >
> > -    p->setPen( palette().active().dark() );
> > -    // left of frame
> > -    if ( col != 0 )
> > -        p->drawLine( rect.left(), rect.top(), rect.left(), rect.bottom()
> > );
> > +    if (_mouseHandler->isResizingGrid() ||
> > +        Settings::SettingsData::instance()->thumbnailDisplayGrid()) {
> > +        p->setPen( palette().active().dark() );
> > +        // left of frame
> > +        if ( col != 0 )
> > +            p->drawLine( rect.left(), rect.top(), rect.left(),
> > rect.bottom() );
> >
> > -    // bottom line
> > -    if ( row != numRows() -1 ) {
> > -        p->drawLine( rect.left(), rect.bottom() -1, rect.right(),
> > rect.bottom()-1 );
> > +        // bottom line
> > +        if ( row != numRows() -1 ) {
> > +            p->drawLine( rect.left(), rect.bottom() -1, rect.right(),
> > rect.bottom()-1 );
> > +        }
> >      }
> > }
> >
> > @@ -592,7 +595,7 @@
> >
> > void ThumbnailView::ThumbnailWidget::mousePressEvent( QMouseEvent* event
> > )
> > {
> > -    if (event->button() & MidButton )
> > +    if ( (event->button() & MidButton) || (event->state() &
> > Qt::ControlButton) )
> >          _mouseHandler = &_gridResizeInteraction;
> >      else
> >          _mouseHandler = &_selectionInteraction;
> >
> > _______________________________________________
> > KPhotoAlbum mailing list
> > KPhotoAlbum at kdab.net
> > http://mail.kdab.net/mailman/listinfo/kphotoalbum
> >
> >
> >
>
>
> --
> Baptiste <Batmat> MATHUS
> BMathus at Batmat point net - http://batmat.net
> ---------
> Si chacun de nous a une idée et que nous les partageons, nous
> repartirons tous les deux avec deux idées... C'est ça le Libre.




-- 
Baptiste <Batmat> MATHUS
BMathus at Batmat point net - http://batmat.net
---------
Si chacun de nous a une idée et que nous les partageons, nous
repartirons tous les deux avec deux idées... C'est ça le Libre.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /mailman/pipermail/kphotoalbum/attachments/20070508/f4cdd41b/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: jan.patch
Type: text/x-diff
Size: 4902 bytes
Desc: not available
Url : /mailman/pipermail/kphotoalbum/attachments/20070508/f4cdd41b/attachment-0001.bin 


More information about the KPhotoAlbum mailing list