Fix point #1 of 213258, open the dialog editor just after adding a note, because adding a note without text is probably not what you want to do.

Will be in KDE *4.7*
Patch by Victor Blazquez <victor.blazquez@gmail.com>
BUGS: 213258

svn path=/trunk/KDE/kdegraphics/okular/; revision=1209674
This commit is contained in:
Albert Astals Cid 2010-12-27 22:16:11 +00:00
parent a54fdcb923
commit 870fd3ba12
4 changed files with 28 additions and 0 deletions

View file

@ -669,6 +669,12 @@ void Annotation::translate( const NormalizedPoint &coord )
}
}
bool Annotation::openDialogAfterCreation() const
{
Q_D( const Annotation );
return d->openDialogAfterCreation();
}
Annotation::Style & Annotation::style()
{
Q_D( Annotation );
@ -868,6 +874,11 @@ void AnnotationPrivate::translate( const NormalizedPoint &coord )
m_boundary.bottom = m_boundary.bottom + coord.y;
}
bool AnnotationPrivate::openDialogAfterCreation() const
{
return false;
}
//END Annotation implementation
@ -887,6 +898,7 @@ class Okular::TextAnnotationPrivate : public Okular::AnnotationPrivate
virtual void baseTransform( const QMatrix &matrix );
virtual void resetTransformation();
virtual void translate( const NormalizedPoint &coord );
virtual bool openDialogAfterCreation() const;
TextAnnotation::TextType m_textType;
QString m_textIcon;
@ -1156,6 +1168,11 @@ void TextAnnotationPrivate::translate( const NormalizedPoint &coord )
#undef ADD_COORD
}
bool TextAnnotationPrivate::openDialogAfterCreation() const
{
return ( m_textType == Okular::TextAnnotation::Linked );
}
/** LineAnnotation [Annotation] */
class Okular::LineAnnotationPrivate : public Okular::AnnotationPrivate

View file

@ -626,6 +626,13 @@ class OKULAR_EXPORT Annotation
*/
bool canBeMoved() const;
/**
* Returns whether the annotation dialog should be open after creation of the annotation or not
*
* @since 0.13 (KDE 4.7)
*/
bool openDialogAfterCreation() const;
/**
* Returns the sub type of the annotation.
*/

View file

@ -42,6 +42,7 @@ class AnnotationPrivate
virtual void baseTransform( const QMatrix &matrix );
virtual void resetTransformation();
virtual void translate( const NormalizedPoint &coord );
virtual bool openDialogAfterCreation() const;
PagePrivate * m_page;

View file

@ -766,6 +766,9 @@ QRect PageViewAnnotator::routeEvent( QMouseEvent * e, PageViewItem * item )
annotation->setModificationDate( QDateTime::currentDateTime() );
annotation->setAuthor( Okular::Settings::identityAuthor() );
m_document->addPageAnnotation( m_lockedItem->pageNumber(), annotation );
if ( annotation->openDialogAfterCreation() )
m_pageView->setAnnotationWindow( annotation );
}
// go on creating annotations of the same type