kitchensync Library API Documentation

mainwindow.cpp

00001 /*
00002     This file is part of KitchenSync.
00003 
00004     Copyright (c) 2002,2003 Holger Freyther <zecke@handhelds.org>
00005     Copyright (c) 2002,2003 Maximilian Reiß <harlekin@handhelds.org>
00006     Copyright (c) 2003 Cornelius Schumacher <schumacher@kde.org>
00007 
00008     This library is free software; you can redistribute it and/or
00009     modify it under the terms of the GNU Library General Public
00010     License as published by the Free Software Foundation; either
00011     version 2 of the License, or (at your option) any later version.
00012 
00013     This library is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016     Library General Public License for more details.
00017 
00018     You should have received a copy of the GNU Library General Public License
00019     along with this library; see the file COPYING.LIB.  If not, write to
00020     the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
00021     Boston, MA 02111-1307, USA.
00022 */
00023 
00024 #include <qwidgetstack.h>
00025 
00026 #include <klocale.h>
00027 #include <kstatusbar.h>
00028 #include <kfiledialog.h>
00029 #include <kdebug.h>
00030 #include <kiconloader.h>
00031 #include <kcmultidialog.h>
00032 
00033 #include <kparts/componentfactory.h>
00034 #include <kparts/mainwindow.h>
00035 #include <kpopupmenu.h>
00036 
00037 #include <syncer.h>
00038 #include <syncuikde.h>
00039 
00040 #include <konnectormanager.h>
00041 #include <konnector.h>
00042 #include <error.h>
00043 #include <progress.h>
00044 
00045 #include "syncconfig.h"
00046 #include "configuredialog.h"
00047 #include "partbar.h"
00048 #include "profiledialog.h"
00049 
00050 #include "konnectorbar.h"
00051 #include "kitchensync.h"
00052 #include "syncalgo.h"
00053 #include "actionmanager.h"
00054 
00055 #include "mainwindow.h"
00056 
00057 using namespace KSync;
00058 
00059 MainWindow::MainWindow( QWidget *widget, const char *name )
00060   : KParts::MainWindow( widget, name )
00061 {
00062   mActionManager = new ActionManager( actionCollection() );
00063 
00064   mView = new KitchenSync( mActionManager, this );
00065   setCentralWidget( mView );
00066 
00067   mActionManager->setView( mView );
00068   mActionManager->initActions();
00069   KStdAction::quit( this, SLOT( close() ), actionCollection() );
00070   setXMLFile( "ksyncgui.rc" );
00071   createGUI( 0 );
00072 
00073   mView->initProfiles();
00074   mActionManager->readConfig();
00075   mView->activateProfile();
00076 
00077   m_konBar = new KonnectorBar( statusBar() );
00078   connect( m_konBar, SIGNAL( toggled( bool ) ),
00079            mView, SLOT( slotKonnectorBar( bool ) ) );
00080   statusBar()->addWidget( m_konBar, 0, true );
00081   statusBar()->show();
00082 
00083   setAutoSaveSettings();
00084 }
00085 
00086 MainWindow::~MainWindow()
00087 {
00088   delete mActionManager;
00089 }
00090 
00091 int MainWindow::currentProfile()
00092 {
00093   return m_profAct->currentItem();
00094 }
00095 
00096 void MainWindow::setProfiles( const QStringList &profiles )
00097 {
00098   m_profAct->setItems( profiles );
00099 }
00100 
00101 #include "mainwindow.moc"
KDE Logo
This file is part of the documentation for kitchensync Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Oct 4 14:41:09 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003