summaryrefslogtreecommitdiffstats
path: root/kpdf/shell/shell.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kpdf/shell/shell.cpp')
-rw-r--r--kpdf/shell/shell.cpp33
1 files changed, 26 insertions, 7 deletions
diff --git a/kpdf/shell/shell.cpp b/kpdf/shell/shell.cpp
index 79d1d83d..c0df6a4f 100644
--- a/kpdf/shell/shell.cpp
+++ b/kpdf/shell/shell.cpp
@@ -108,7 +108,6 @@ void Shell::init()
setupActions();
setupGUI(Keys | Save);
- readSettings();
if (!TDEGlobal::config()->hasGroup("MainWindow"))
{
TDEMainWindowInterface kmwi(this);
@@ -122,6 +121,7 @@ void Shell::init()
TQTimer::singleShot(0, this, TQ_SLOT(delayedOpen()));
}
+ readSettings();
reconfigure();
}
@@ -186,15 +186,38 @@ void Shell::readSettings()
m_recent->setToolTip( i18n("Click to open a file\nClick and hold to open a recent file") );
TDEGlobal::config()->setDesktopGroup();
+ m_menuBarWasShown = TDEGlobal::config()->readBoolEntry( "ShowMenuBar", true );
+ m_showMenuBarAction->setChecked(m_menuBarWasShown);
+ slotShowMenubar();
+
+ m_toolBarWasShown = TDEGlobal::config()->readBoolEntry( "ShowToolBar", true );
+ m_showToolBarAction = static_cast<TDEToggleAction*>(toolBarMenuAction());
+ if (m_toolBarWasShown)
+ {
+ toolBar()->show();
+ }
+ else
+ {
+ toolBar()->hide();
+ }
+
bool fullScreen = TDEGlobal::config()->readBoolEntry( "FullScreen", false );
- setFullScreen( fullScreen );
+ setFullScreen(fullScreen);
}
void Shell::writeSettings()
{
m_recent->saveEntries( TDEGlobal::config() );
TDEGlobal::config()->setDesktopGroup();
- TDEGlobal::config()->writeEntry( "FullScreen", m_fullScreenAction->isChecked());
+ bool fullScreen = m_fullScreenAction->isChecked();
+ if (!fullScreen)
+ {
+ m_menuBarWasShown = m_showMenuBarAction->isChecked();
+ m_toolBarWasShown = m_showToolBarAction->isChecked();
+ }
+ TDEGlobal::config()->writeEntry( "ShowMenuBar", m_menuBarWasShown);
+ TDEGlobal::config()->writeEntry( "ShowToolBar", m_toolBarWasShown);
+ TDEGlobal::config()->writeEntry( "FullScreen", fullScreen);
TDEGlobal::config()->sync();
}
@@ -385,10 +408,6 @@ KParts::ReadOnlyPart* Shell::createTab()
part->widget()->show();
m_manager->addPart(part, true);
- if (!m_showToolBarAction)
- {
- m_showToolBarAction = static_cast<TDEToggleAction*>(toolBarMenuAction());
- }
return part;
}