Commit 9991b95a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Now show page list works

Save/load setting

svn path=/trunk/kdegraphics/kpdf/; revision=251090
parent 14ebfddd
......@@ -12,6 +12,7 @@
#include <kinstance.h>
#include <kprinter.h>
#include <kstdaction.h>
#include <kconfig.h>
#include <kparts/genericfactory.h>
#include <kdebug.h>
......@@ -104,11 +105,32 @@ Part::Part(QWidget *parentWidget, const char *widgetName,
// set our XML-UI resource file
setXMLFile("kpdf_part.rc");
readSettings();
}
Part::~Part()
{
delete globalParams;
writeSettings();
}
void Part::writeSettings()
{
KConfigGroup general( KPDFPartFactory::instance()->config(), "General" );
general.writeEntry( "ShowScrollBars", m_showScrollBars->isChecked() );
general.writeEntry( "ShowPageList", m_showPageList->isChecked() );
general.sync();
}
void Part::readSettings()
{
KConfigGroup general( KPDFPartFactory::instance()->config(), "General" );
m_showScrollBars->setChecked( general.readBoolEntry( "ShowScrollBars", true ) );
showScrollBars( m_showScrollBars->isChecked() );
m_showPageList->setChecked( general.readBoolEntry( "ShowPageList", true ) );
showMarkList( m_showPageList->isChecked() );
}
void Part::showScrollBars( bool show )
......@@ -118,11 +140,10 @@ void Part::showScrollBars( bool show )
void Part::showMarkList( bool show )
{
#if 0
_markList->setShown( show );
_scrollBox->setShown( show );
_divider->setShown( show );
#endif
if ( show )
pdfpartview->pagesListBox->show();
else
pdfpartview->pagesListBox->hide();
}
void Part::slotGotoEnd()
......
......@@ -76,8 +76,9 @@ namespace KPDF
*/
virtual bool openFile();
void update();
void update();
void readSettings();
void writeSettings();
protected slots:
void find() { /* stub */ };
void findNext() { /* stub */ };
......
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