~ubuntu-branches/ubuntu/karmic/kdepim/karmic-backports

« back to all changes in this revision

Viewing changes to akonadi/akonadiconsole/mainwindow.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi, Alessandro Ghersi, Harald Sitter
  • Date: 2009-06-27 04:40:05 UTC
  • mfrom: (1.1.39 upstream)
  • Revision ID: james.westby@ubuntu.com-20090627044005-4y2vm9xz7rvmzi4p
Tags: 4:4.2.95svn20090701-0ubuntu1
[ Alessandro Ghersi ]
* New upstream release
  - Bump build-deps
* Remove akonadi-kde and libmaildir4 packages
  - remove akonadi-kde.install and libmaildir4.install
  - remove libmaildir4 from debian/rules
  - remove akonadi-kde and libmaildir4 from depends
  - remove akonadi-kde and libmaildir4 from installgen
* Update kdepim-dev.install
* Update kpilot.install
* Add akonadi-kde and libmaildir4 transitional packages

[ Harald Sitter ]
* KAddressbook replaces Kontact << 4.2.85 (LP: #378373)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    This file is part of Akonadi.
 
3
 
 
4
    Copyright (c) 2006 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
 
17
    along with this program; if not, write to the Free Software
 
18
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 
19
    USA.
 
20
*/
 
21
 
 
22
#include "mainwindow.h"
 
23
 
 
24
#include "mainwidget.h"
 
25
#include "libkdepim-copy/uistatesaver.h"
 
26
 
 
27
#include <akonadi/control.h>
 
28
 
 
29
#include <KAction>
 
30
#include <KActionCollection>
 
31
#include <KConfigGroup>
 
32
#include <KLocale>
 
33
#include <KMessageBox>
 
34
#include <KStandardAction>
 
35
#include <QApplication>
 
36
 
 
37
MainWindow::MainWindow( QWidget *parent )
 
38
  : KXmlGuiWindow( parent )
 
39
{
 
40
  Akonadi::Control::start( this );
 
41
  setCentralWidget( new MainWidget( this ) );
 
42
 
 
43
  KStandardAction::quit( qApp, SLOT(quit()), actionCollection() );
 
44
 
 
45
  setupGUI( Keys /*| ToolBar | StatusBar*/ | Save | Create, "akonadiconsoleui.rc" );
 
46
 
 
47
  KPIM::UiStateSaver::restoreState( this, KConfigGroup( KGlobal::config(), "UiState" ) );
 
48
 
 
49
  KMessageBox::information( this, i18n("<p>Akonadi Console is purely a development tool. "
 
50
      "It allows you to view and change internal data structures of Akonadi. "
 
51
      "You should only change data in here if you know what you are doing, otherwise "
 
52
      "you risk damaging or losing your personal information management data.<br/>"
 
53
      "<b>Use at your own risk!</b></p>"),
 
54
       QString(), "UseAtYourOwnRiskWarning" );
 
55
}
 
56
 
 
57
bool MainWindow::queryExit()
 
58
{
 
59
  KConfigGroup config( KGlobal::config(), "UiState" );
 
60
  KPIM::UiStateSaver::saveState( this, config );
 
61
  KGlobal::config()->sync();
 
62
  return KXmlGuiWindow::queryExit();
 
63
}