2
This file is part of Akonadi.
4
Copyright (c) 2006 Tobias Koenig <tokoe@kde.org>
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.
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.
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,
22
#include "mainwindow.h"
24
#include "mainwidget.h"
25
#include "libkdepim-copy/uistatesaver.h"
27
#include <akonadi/control.h>
30
#include <KActionCollection>
31
#include <KConfigGroup>
33
#include <KMessageBox>
34
#include <KStandardAction>
35
#include <QApplication>
37
MainWindow::MainWindow( QWidget *parent )
38
: KXmlGuiWindow( parent )
40
Akonadi::Control::start( this );
41
setCentralWidget( new MainWidget( this ) );
43
KStandardAction::quit( qApp, SLOT(quit()), actionCollection() );
45
setupGUI( Keys /*| ToolBar | StatusBar*/ | Save | Create, "akonadiconsoleui.rc" );
47
KPIM::UiStateSaver::restoreState( this, KConfigGroup( KGlobal::config(), "UiState" ) );
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" );
57
bool MainWindow::queryExit()
59
KConfigGroup config( KGlobal::config(), "UiState" );
60
KPIM::UiStateSaver::saveState( this, config );
61
KGlobal::config()->sync();
62
return KXmlGuiWindow::queryExit();