Commit 4eaf99c0 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

Allow editing of both toolbars, part and shell

svn path=/trunk/kdegraphics/kpdf/; revision=366241
parent 2024932e
......@@ -31,7 +31,7 @@
<Action name="show_page_list" group="show_merge"/>
</Menu>
</MenuBar>
<ToolBar name="mainToolBar">
<ToolBar name="mainToolBar"><text>Main Toolbar</text>
<Action name="zoom_in"/>
<Action name="zoomTo" />
<Action name="zoom_out"/>
......
......@@ -26,6 +26,7 @@
#include <kaction.h>
#include <kapplication.h>
#include <kconfig.h>
#include <kedittoolbar.h>
#include <kfiledialog.h>
#include <klibloader.h>
#include <kmessagebox.h>
......@@ -65,7 +66,7 @@ Shell::Shell()
// tell the KParts::MainWindow that this is indeed the main widget
setCentralWidget(m_part->widget());
// and integrate the part's GUI with the shell's
setupGUI(ToolBar | Keys | Save);
setupGUI(Keys | Save);
createGUI(m_part);
}
}
......@@ -128,6 +129,7 @@ Shell::setupActions()
setStandardToolBarMenuEnabled(true);
m_showMenuBarAction = KStdAction::showMenubar( this, SLOT( slotShowMenubar() ), actionCollection(), "options_show_menubar" );
KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection());
m_fullScreenAction = KStdAction::fullScreen( this, SLOT( slotUpdateFullScreen() ), actionCollection(), this );
m_popup = new KPopupMenu( this, "rmb popup" );
m_fullScreenAction->plug( m_popup );
......@@ -182,6 +184,15 @@ Shell::fileOpen()
openURL(url);
}
void
Shell::optionsConfigureToolbars()
{
saveMainWindowSettings(KGlobal::config(), "MainWindow");
KEditToolbar dlg(factory());
connect(&dlg, SIGNAL(newToolbarConfig()), this, SLOT(applyNewToolbarConfig()));
dlg.exec();
}
void
Shell::applyNewToolbarConfig()
{
......
......@@ -71,6 +71,7 @@ namespace KPDF
void slotQuit();
void optionsConfigureToolbars();
void applyNewToolbarConfig();
void slotUpdateFullScreen();
void slotRMBClick();
......
......@@ -13,4 +13,6 @@
</Menu>
<Merge/>
</MenuBar>
<ToolBar name="mainToolBar"><text>Main Toolbar</text>
</ToolBar>
</kpartgui>
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