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

kaddressbook

  • sources
  • kde-4.14
  • 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 #include "xxport/xxportmanager.h"
24 
25 #include <KAction>
26 #include <KActionCollection>
27 #include <KEditToolBar>
28 #include <KShortcutsDialog>
29 #include <KStandardAction>
30 #include <KLocalizedString>
31 #include <KToolBar>
32 
33 MainWindow::MainWindow()
34  : KXmlGuiWindow( 0 )
35 {
36  mMainWidget = new MainWidget( this, this );
37 
38  setCentralWidget( mMainWidget );
39 
40  initActions();
41 
42  setStandardToolBarMenuEnabled( true );
43 
44  toolBar()->setToolButtonStyle( Qt::ToolButtonTextUnderIcon );
45 
46  setupGUI( Save | Create, QLatin1String("kaddressbookui.rc") );
47 
48  setAutoSaveSettings();
49 }
50 
51 MainWindow::~MainWindow()
52 {
53 }
54 
55 MainWidget *MainWindow::mainWidget() const
56 {
57  return mMainWidget;
58 }
59 
60 void MainWindow::initActions()
61 {
62  KStandardAction::quit( this, SLOT(close()), actionCollection() );
63 
64  KAction *action =
65  KStandardAction::keyBindings( this, SLOT(configureKeyBindings()), actionCollection() );
66  action->setWhatsThis(
67  i18nc( "@info:whatsthis",
68  "You will be presented with a dialog where you can configure "
69  "the application-wide shortcuts." ) );
70  KStandardAction::configureToolbars( this, SLOT(configureToolbars()), actionCollection() );
71  KStandardAction::preferences( this, SLOT(configure()), actionCollection() );
72 }
73 
74 void MainWindow::configure()
75 {
76  mMainWidget->configure();
77 }
78 
79 void MainWindow::configureKeyBindings()
80 {
81  if (KShortcutsDialog::configure( actionCollection(), KShortcutsEditor::LetterShortcutsAllowed, this )) {
82  mMainWidget->updateQuickSearchText();
83  }
84 }
85 
86 void MainWindow::configureToolbars()
87 {
88  saveMainWindowSettings( KGlobal::config()->group( "MainWindow" ) );
89 
90  KEditToolBar dlg( factory() );
91  connect( &dlg, SIGNAL(newToolBarConfig()), this, SLOT(newToolbarConfig()) );
92  dlg.exec();
93 }
94 
95 void MainWindow::newToolbarConfig()
96 {
97  createGUI( QLatin1String("kaddressbookui.rc") );
98 
99  applyMainWindowSettings( KGlobal::config()->group( "MainWindow" ) );
100 }
101 
MainWidget::configure
void configure()
Definition: mainwidget.cpp:344
xxportmanager.h
KXmlGuiWindow
mainwindow.h
mainwidget.h
MainWindow::MainWindow
MainWindow()
Definition: mainwindow.cpp:33
MainWindow::mainWidget
MainWidget * mainWidget() const
Definition: mainwindow.cpp:55
QLatin1String
MainWidget::updateQuickSearchText
void updateQuickSearchText()
Definition: mainwidget.cpp:370
MainWindow::~MainWindow
~MainWindow()
Definition: mainwindow.cpp:51
MainWidget
Definition: mainwidget.h:64
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:32:34 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
  • pimprint

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