Commit 0de54211 authored by Enrico Ros's avatar Enrico Ros

Annotations: Author name request. Configure::generalDialog: changes.

svn path=/branches/kpdf_annotations/kdegraphics/kpdf/; revision=397322
parent 9023b05e
......@@ -8,8 +8,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>328</width>
<height>305</height>
<width>296</width>
<height>311</height>
</rect>
</property>
<vbox>
......@@ -38,6 +38,14 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QCheckBox">
<property name="name">
<cstring>kcfg_ShowScrollBars</cstring>
</property>
<property name="text">
<string>Show scroll&amp;bars</string>
</property>
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>kcfg_ShowSearchBar</cstring>
......@@ -62,20 +70,78 @@
</widget>
<widget class="QCheckBox">
<property name="name">
<cstring>kcfg_ShowScrollBars</cstring>
<cstring>kcfg_ShowOSD</cstring>
</property>
<property name="text">
<string>Show scroll&amp;bars</string>
<string>Show &amp;hints and info messages</string>
</property>
</widget>
<widget class="QCheckBox">
</vbox>
</widget>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout3_2</cstring>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<property name="name">
<cstring>kcfg_ShowOSD</cstring>
<cstring>pixmapLabel1_2</cstring>
</property>
<property name="text">
<string>Show &amp;hints and info messages</string>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="pixmap">
<pixmap>"kpdf", 32</pixmap>
</property>
</widget>
<spacer>
<property name="name">
<cstring>spacerV1</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Minimum</enum>
</property>
<property name="sizeHint">
<size>
<width>20</width>
<height>1</height>
</size>
</property>
</spacer>
</vbox>
</widget>
</hbox>
</widget>
<widget class="QGroupBox">
<property name="name">
<cstring>groupBox3</cstring>
</property>
<property name="title">
<string>Program Features</string>
</property>
<hbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout4</cstring>
</property>
<vbox>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QCheckBox">
<property name="name">
<cstring>kcfg_ObeyDRM</cstring>
......@@ -96,7 +162,7 @@
</widget>
<widget class="QLayoutWidget">
<property name="name">
<cstring>layout3_2</cstring>
<cstring>layout3_2_2</cstring>
</property>
<vbox>
<property name="name">
......@@ -104,7 +170,7 @@
</property>
<widget class="QLabel">
<property name="name">
<cstring>pixmapLabel1_2</cstring>
<cstring>pixmapLabel1_2_2</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
......@@ -115,12 +181,12 @@
</sizepolicy>
</property>
<property name="pixmap">
<pixmap>"kpdf", 32</pixmap>
<pixmap>"exec", 32</pixmap>
</property>
</widget>
<spacer>
<property name="name">
<cstring>spacerV1</cstring>
<cstring>spacerV1_2</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
......
......@@ -46,6 +46,9 @@
<max>6</max>
</entry>
</group>
<group name="Annotations" >
<entry key="AnnotationsAuthor" type="String" />
</group>
<group name="General" >
<entry key="ShowOSD" type="Bool" >
<default>true</default>
......
......@@ -15,6 +15,8 @@
#include <kiconloader.h>
#include <klocale.h>
#include <kstandarddirs.h>
#include <kinputdialog.h>
#include <kuser.h>
#include <kdebug.h>
// system includes
......@@ -358,6 +360,25 @@ void PageViewAnnotator::setEnabled( bool on )
// show the toolBar
m_toolBar->showItems( (PageViewToolBar::Side)Settings::editToolBarPlacement(), items );
// ask for Author's name if not already set
if ( Settings::annotationsAuthor().isEmpty() )
{
// get default username from the kdelibs/kdecore/KUser
KUser currentUser;
QString userName = currentUser.fullName();
// ask the user for confirmation/change
bool firstTry = true;
while ( firstTry || userName.isEmpty() )
{
QString prompt = firstTry ? i18n( "Please insert your name or initials:" ) :
i18n( "You must set this name:" );
userName = KInputDialog::getText( i18n("Annotations author"), prompt, userName );
firstTry = false;
}
// save the name
Settings::setAnnotationsAuthor( userName );
}
}
bool PageViewAnnotator::routeEvents() const
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment