• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kaddressbook

  • sources
  • kde-4.12
  • kdepim
  • kaddressbook
mainwindow.cpp
Go to the documentation of this file.
1 /*
2  This file is part of KAddressBook.
3 
4  Copyright (c) 2007 Tobias Koenig <tokoe@kde.org>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License along
17  with this program; if not, write to the Free Software Foundation, Inc.,
18  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 */
20 
21 #include "mainwindow.h"
22 #include "mainwidget.h"
23 
24 #include <KAction>
25 #include <KActionCollection>
26 #include <KEditToolBar>
27 #include <KShortcutsDialog>
28 #include <KStandardAction>
29 #include <KToolBar>
30 #include <KLocale>
31 
32 MainWindow::MainWindow()
33  : KXmlGuiWindow( 0 )
34 {
35  mMainWidget = new MainWidget( this, this );
36 
37  setCentralWidget( mMainWidget );
38 
39  initActions();
40 
41  setStandardToolBarMenuEnabled( true );
42 
43  toolBar()->setToolButtonStyle( Qt::ToolButtonTextUnderIcon );
44 
45  setupGUI( Keys | Save | Create, QLatin1String("kaddressbookui.rc") );
46 
47  setAutoSaveSettings();
48 }
49 
50 MainWindow::~MainWindow()
51 {
52 }
53 
54 void MainWindow::initActions()
55 {
56  KStandardAction::quit( this, SLOT(close()), actionCollection() );
57 
58  KAction *action =
59  KStandardAction::keyBindings( this, SLOT(configureKeyBindings()), actionCollection() );
60  action->setWhatsThis(
61  i18nc( "@info:whatsthis",
62  "You will be presented with a dialog where you can configure "
63  "the application-wide shortcuts." ) );
64 
65  KStandardAction::configureToolbars( this, SLOT(configureToolbars()), actionCollection() );
66  KStandardAction::preferences( this, SLOT(configure()), actionCollection() );
67 }
68 
69 void MainWindow::configure()
70 {
71  mMainWidget->configure();
72 }
73 
74 void MainWindow::configureKeyBindings()
75 {
76  KShortcutsDialog::configure( actionCollection(), KShortcutsEditor::LetterShortcutsAllowed, this );
77 }
78 
79 void MainWindow::configureToolbars()
80 {
81  saveMainWindowSettings( KGlobal::config()->group( "MainWindow" ) );
82 
83  KEditToolBar dlg( factory() );
84  connect( &dlg, SIGNAL(newToolBarConfig()), this, SLOT(newToolbarConfig()) );
85  dlg.exec();
86 }
87 
88 void MainWindow::newToolbarConfig()
89 {
90  createGUI( QLatin1String("kaddressbookui.rc") );
91 
92  applyMainWindowSettings( KGlobal::config()->group( "MainWindow" ) );
93 }
94 
95 #include "mainwindow.moc"
MainWidget::configure
void configure()
Definition: mainwidget.cpp:309
KXmlGuiWindow
mainwindow.h
mainwidget.h
MainWindow::MainWindow
MainWindow()
Definition: mainwindow.cpp:32
MainWindow::~MainWindow
~MainWindow()
Definition: mainwindow.cpp:50
MainWidget
Definition: mainwidget.h:63
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:55:51 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kaddressbook

Skip menu "kaddressbook"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal