2009-09-15 07:12:54 +00:00
|
|
|
#ifndef oxygenexceptiondialog_h
|
|
|
|
#define oxygenexceptiondialog_h
|
2009-08-24 16:15:14 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2009-09-15 07:12:54 +00:00
|
|
|
// oxygenexceptiondialog.h
|
2009-08-24 16:15:14 +00:00
|
|
|
// -------------------
|
2009-09-09 00:55:55 +00:00
|
|
|
//
|
2009-08-24 16:15:14 +00:00
|
|
|
// Copyright (c) 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr>
|
|
|
|
//
|
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
// of this software and associated documentation files (the "Software"), to
|
|
|
|
// deal in the Software without restriction, including without limitation the
|
|
|
|
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
|
|
// sell copies of the Software, and to permit persons to whom the Software is
|
|
|
|
// furnished to do so, subject to the following conditions:
|
|
|
|
//
|
|
|
|
// The above copyright notice and this permission notice shall be included in
|
|
|
|
// all copies or substantial portions of the Software.
|
|
|
|
//
|
|
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
2009-09-09 00:55:55 +00:00
|
|
|
// IN THE SOFTWARE.
|
2009-08-24 16:15:14 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2009-08-22 08:24:06 +00:00
|
|
|
|
2012-11-23 09:09:39 +00:00
|
|
|
#include "ui_oxygenexceptiondialog.h"
|
|
|
|
#include "../oxygendecorationdefines.h"
|
|
|
|
|
2009-08-22 08:24:06 +00:00
|
|
|
#include <KDialog>
|
|
|
|
#include <KLineEdit>
|
2009-09-16 06:09:31 +00:00
|
|
|
#include <KComboBox>
|
2009-09-20 07:42:03 +00:00
|
|
|
#include <QtGui/QCheckBox>
|
2012-11-23 09:09:39 +00:00
|
|
|
#include <QtCore/QMap>
|
2009-08-22 08:24:06 +00:00
|
|
|
|
2009-09-15 07:12:54 +00:00
|
|
|
namespace Oxygen
|
2009-08-22 08:24:06 +00:00
|
|
|
{
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
class DetectDialog;
|
2009-09-13 16:43:26 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! oxygen exceptions list
|
|
|
|
class ExceptionDialog: public KDialog
|
|
|
|
{
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
Q_OBJECT
|
2009-09-13 16:43:26 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
public:
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! constructor
|
2012-12-29 06:34:38 +00:00
|
|
|
explicit ExceptionDialog( QWidget* parent );
|
2009-08-22 08:24:06 +00:00
|
|
|
|
2012-11-26 21:36:15 +00:00
|
|
|
//! destructor
|
|
|
|
virtual ~ExceptionDialog( void )
|
|
|
|
{}
|
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! set exception
|
2012-11-23 09:09:39 +00:00
|
|
|
void setException( ConfigurationPtr );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2012-11-23 09:09:39 +00:00
|
|
|
//! save exception
|
|
|
|
void save( void );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2012-11-27 08:36:48 +00:00
|
|
|
//! true if changed
|
|
|
|
virtual bool isChanged( void ) const
|
|
|
|
{ return _changed; }
|
|
|
|
|
|
|
|
signals:
|
|
|
|
|
|
|
|
//! emmited when changed
|
|
|
|
void changed( bool );
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
|
|
|
//! set changed state
|
|
|
|
virtual void setChanged( bool value )
|
|
|
|
{
|
|
|
|
_changed = value;
|
|
|
|
emit changed( value );
|
|
|
|
}
|
|
|
|
|
|
|
|
protected slots:
|
|
|
|
|
|
|
|
//! check whether configuration is changed and emit appropriate signal if yes
|
|
|
|
virtual void updateChanged();
|
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
private slots:
|
2009-09-13 16:43:26 +00:00
|
|
|
|
2012-11-27 08:36:48 +00:00
|
|
|
//! select window properties from grabbed pointers
|
2010-05-02 18:34:08 +00:00
|
|
|
void selectWindowProperties( void );
|
2009-09-13 16:43:26 +00:00
|
|
|
|
2012-11-27 08:36:48 +00:00
|
|
|
//! read properties of selected window
|
2010-05-02 18:34:08 +00:00
|
|
|
void readWindowProperties( bool );
|
2009-09-13 16:43:26 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
private:
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
Ui_OxygenExceptionWidget ui;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! map mask and checkbox
|
2012-11-23 09:09:39 +00:00
|
|
|
typedef QMap< ExceptionMask, QCheckBox*> CheckBoxMap;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! map mask and checkbox
|
2011-02-24 16:47:38 +00:00
|
|
|
CheckBoxMap _checkBoxes;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! internal exception
|
2012-11-23 09:09:39 +00:00
|
|
|
ConfigurationPtr _exception;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! detection dialog
|
2011-02-24 16:47:38 +00:00
|
|
|
DetectDialog* _detectDialog;
|
2009-09-13 16:43:26 +00:00
|
|
|
|
2012-11-27 08:36:48 +00:00
|
|
|
//! changed state
|
|
|
|
bool _changed;
|
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
};
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2009-08-24 06:27:49 +00:00
|
|
|
}
|
2009-08-22 08:24:06 +00:00
|
|
|
|
|
|
|
#endif
|