create an Identity settings section and move the author field there

svn path=/trunk/playground/graphics/okular/; revision=601335
remotes/origin/KDE/4.0
Pino Toscano 20 years ago
parent 91611a9afc
commit 5862ea6dc8
  1. 4
      conf/okular.kcfg
  2. 6
      ui/pageviewannotator.cpp

@ -128,7 +128,6 @@
</entry> </entry>
</group> </group>
<group name="General" > <group name="General" >
<entry key="AnnotationsAuthor" type="String" />
<entry key="ObeyDRM" type="Bool" > <entry key="ObeyDRM" type="Bool" >
<default>true</default> <default>true</default>
</entry> </entry>
@ -205,4 +204,7 @@
<max>4.0</max> <max>4.0</max>
</entry> </entry>
</group> </group>
<group name="Identity" >
<entry key="IdentityAuthor" type="String" />
</group>
</kcfg> </kcfg>

@ -605,7 +605,7 @@ void PageViewAnnotator::setEnabled( bool on )
m_toolBar->showItems( (PageViewToolBar::Side)Okular::Settings::editToolBarPlacement(), items ); m_toolBar->showItems( (PageViewToolBar::Side)Okular::Settings::editToolBarPlacement(), items );
// ask for Author's name if not already set // ask for Author's name if not already set
if ( Okular::Settings::annotationsAuthor().isEmpty() ) if ( Okular::Settings::identityAuthor().isEmpty() )
{ {
// get default username from the kdelibs/kdecore/KUser // get default username from the kdelibs/kdecore/KUser
KUser currentUser; KUser currentUser;
@ -620,7 +620,7 @@ void PageViewAnnotator::setEnabled( bool on )
firstTry = false; firstTry = false;
} }
// save the name // save the name
Okular::Settings::setAnnotationsAuthor( userName ); Okular::Settings::setIdentityAuthor( userName );
Okular::Settings::writeConfig(); Okular::Settings::writeConfig();
} }
} }
@ -695,7 +695,7 @@ QRect PageViewAnnotator::routeEvent( QMouseEvent * e, PageViewItem * item )
if ( !annotation ) continue; if ( !annotation ) continue;
annotation->creationDate = annotation->modifyDate = QDateTime::currentDateTime(); annotation->creationDate = annotation->modifyDate = QDateTime::currentDateTime();
annotation->author = Okular::Settings::annotationsAuthor(); annotation->author = Okular::Settings::identityAuthor();
m_document->addPageAnnotation( m_lockedItem->pageNumber(), annotation ); m_document->addPageAnnotation( m_lockedItem->pageNumber(), annotation );
} }

Loading…
Cancel
Save