2010-05-02 18:34:08 +00:00
|
|
|
#ifndef oxygenexceptionlistwidget_h
|
|
|
|
#define oxygenexceptionlistwidget_h
|
2009-08-24 16:15:14 +00:00
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
2010-05-02 18:34:08 +00:00
|
|
|
// oxygenexceptionlistwidget.h
|
2009-08-24 16:15:14 +00:00
|
|
|
// -------------------
|
2009-09-09 00:55:55 +00:00
|
|
|
//
|
2009-08-25 04:15:13 +00:00
|
|
|
// Copyright (c) 2009 Hugo Pereira Da Costa <hugo.pereira@free.fr>
|
2009-08-24 16:15:14 +00:00
|
|
|
//
|
|
|
|
// 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
|
|
|
|
2009-10-31 03:54:11 +00:00
|
|
|
#include "ui_oxygenexceptionlistwidget.h"
|
2009-09-15 07:12:54 +00:00
|
|
|
#include "oxygenexceptionmodel.h"
|
|
|
|
#include "../oxygenexceptionlist.h"
|
2009-08-22 08:24:06 +00:00
|
|
|
|
|
|
|
//! QDialog used to commit selected files
|
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 ExceptionListWidget: public QWidget
|
|
|
|
{
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! Qt meta object
|
|
|
|
Q_OBJECT
|
2009-09-09 00:55:55 +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
|
2011-02-24 16:47:38 +00:00
|
|
|
explicit ExceptionListWidget( QWidget* = 0, Configuration defaultConfiguration = Configuration() );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! set exceptions
|
|
|
|
void setExceptions( const ExceptionList& );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! get exceptions
|
|
|
|
ExceptionList exceptions( void ) const;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
signals:
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! emitted when list is changed
|
|
|
|
void changed( void );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
protected:
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! model
|
2011-02-24 16:47:38 +00:00
|
|
|
const ExceptionModel& model() const
|
|
|
|
{ return _model; }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! model
|
2011-02-24 16:47:38 +00:00
|
|
|
ExceptionModel& model()
|
|
|
|
{ return _model; }
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
protected slots:
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! update button states
|
2011-02-24 16:47:38 +00:00
|
|
|
virtual void updateButtons( void );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! add
|
2011-02-24 16:47:38 +00:00
|
|
|
virtual void add( void );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! edit
|
2011-02-24 16:47:38 +00:00
|
|
|
virtual void edit( void );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! remove
|
2011-02-24 16:47:38 +00:00
|
|
|
virtual void remove( void );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! toggle
|
2011-02-24 16:47:38 +00:00
|
|
|
virtual void toggle( const QModelIndex& );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! move up
|
2011-02-24 16:47:38 +00:00
|
|
|
virtual void up( void );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! move down
|
2011-02-24 16:47:38 +00:00
|
|
|
virtual void down( void );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2011-07-18 10:20:58 +00:00
|
|
|
protected:
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! resize columns
|
2011-02-24 16:47:38 +00:00
|
|
|
void resizeColumns( void ) const;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! check exception
|
2011-02-24 16:47:38 +00:00
|
|
|
bool checkException( Exception& );
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2011-07-18 10:20:58 +00:00
|
|
|
private:
|
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! default configuration
|
2011-02-24 16:47:38 +00:00
|
|
|
Configuration _defaultConfiguration;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! model
|
2011-02-24 16:47:38 +00:00
|
|
|
ExceptionModel _model;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
2010-05-02 18:34:08 +00:00
|
|
|
//! ui
|
|
|
|
Ui_OxygenExceptionListWidget ui;
|
2009-09-09 00:55:55 +00:00
|
|
|
|
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
|