25 #include <KActionCollection>
26 #include <KEditToolBar>
27 #include <KShortcutsDialog>
28 #include <KStandardAction>
37 setCentralWidget( mMainWidget );
41 setStandardToolBarMenuEnabled(
true );
43 toolBar()->setToolButtonStyle( Qt::ToolButtonTextUnderIcon );
45 setupGUI( Keys | Save | Create, QLatin1String(
"kaddressbookui.rc") );
47 setAutoSaveSettings();
54 void MainWindow::initActions()
56 KStandardAction::quit(
this, SLOT(close()), actionCollection() );
59 KStandardAction::keyBindings(
this, SLOT(configureKeyBindings()), actionCollection() );
61 i18nc(
"@info:whatsthis",
62 "You will be presented with a dialog where you can configure "
63 "the application-wide shortcuts." ) );
65 KStandardAction::configureToolbars(
this, SLOT(configureToolbars()), actionCollection() );
66 KStandardAction::preferences(
this, SLOT(configure()), actionCollection() );
69 void MainWindow::configure()
74 void MainWindow::configureKeyBindings()
76 KShortcutsDialog::configure( actionCollection(), KShortcutsEditor::LetterShortcutsAllowed,
this );
79 void MainWindow::configureToolbars()
81 saveMainWindowSettings( KGlobal::config()->group(
"MainWindow" ) );
83 KEditToolBar dlg( factory() );
84 connect( &dlg, SIGNAL(newToolBarConfig()),
this, SLOT(newToolbarConfig()) );
88 void MainWindow::newToolbarConfig()
90 createGUI( QLatin1String(
"kaddressbookui.rc") );
92 applyMainWindowSettings( KGlobal::config()->group(
"MainWindow" ) );
95 #include "mainwindow.moc"