secondarywindow.cpp
00001 /*************************************************************************** 00002 * Copyright (C) 2006 - 2007 by Martin Mueller * 00003 * orvio@orvio.de * 00004 * * 00005 * This program is free software; you can redistribute it and/or modify * 00006 * it under the terms of the GNU General Public License as published by * 00007 * the Free Software Foundation; either version 2 of the License, or * 00008 * (at your option) any later version. * 00009 * * 00010 * This program is distributed in the hope that it will be useful, * 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00013 * GNU General Public License for more details. * 00014 * * 00015 * You should have received a copy of the GNU General Public License * 00016 * along with this program; if not, write to the * 00017 * Free Software Foundation, Inc., * 00018 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 00019 ***************************************************************************/ 00020 #include "secondarywindow.h" 00021 #include "secondarywindow.moc" 00022 00023 #include "globalsettings.h" 00024 #include "../blokkalbehavioursettings.h" 00025 00026 #include <kapplication.h> 00027 00028 #include <QCloseEvent> 00029 00030 Blokkal::Ui::SecondaryWindow::SecondaryWindow( QWidget * parent, Qt::WindowFlags flags ) : 00031 KXmlGuiWindow( parent, flags ) 00032 { 00033 } 00034 00035 Blokkal::Ui::SecondaryWindow::~SecondaryWindow( void ) 00036 {} 00037 00038 void Blokkal::Ui::SecondaryWindow::closeEvent( QCloseEvent * event ) 00039 { 00040 if ( BehaviourSettings::showSystemTray() ) 00041 { 00042 //->Code from KMainWindow 00043 // Save settings if auto-save is enabled, and settings have changed 00044 if ( settingsDirty() && autoSaveSettings() ) { 00045 saveAutoSaveSettings(); 00046 } 00047 if ( queryClose() ) { 00048 event->accept(); 00049 } 00050 else { 00051 event->ignore(); 00052 } 00053 //<-Code from KMainWindow 00054 } 00055 }