fixed Krazy stuff (headers, K classes in place of Q classes, and use of pointers to modal dialogs)

svn path=/trunk/KDE/kdebase/workspace/; revision=1024127
icc-effect-5.14.5
Hugo Pereira Da Costa 2009-09-16 06:09:31 +00:00
parent 1a0eb644f1
commit 363986a030
20 changed files with 108 additions and 104 deletions

View File

@ -27,19 +27,18 @@
// IN THE SOFTWARE.
//////////////////////////////////////////////////////////////////////////////
#include <KAboutData>
#include <KAboutApplicationDialog>
#include <KConfigGroup>
#include <KGlobal>
#include <KLocale>
#include <kstandarddirs.h>
#include "config.h"
#include "config.moc"
#include "../oxygenconfiguration.h"
#include "../oxygenshadowconfiguration.h"
#include <KAboutData>
#include <KAboutApplicationDialog>
#include <KConfigGroup>
#include <KGlobal>
#include <KLocale>
//_______________________________________________________________________
extern "C"
{
@ -105,7 +104,7 @@ namespace Oxygen
// save standard configuration
KConfigGroup configurationGroup( configuration_, "Windeco");
// when writting text entries, on needs to make sure that strings written
// when writing text entries, on needs to make sure that strings written
// to the configuration file are *not* translated using current locale
configurationGroup.writeEntry(
OxygenConfig::TITLE_ALIGNMENT,

View File

@ -44,7 +44,7 @@ namespace Oxygen
public:
//! constructor
ItemModel(QObject *parent = 0);
explicit ItemModel(QObject *parent = 0);
//! destructor
virtual ~ItemModel()
@ -89,7 +89,7 @@ namespace Oxygen
public:
//! constructor
SortFTor( const int& type, Qt::SortOrder order = Qt::AscendingOrder ):
explicit SortFTor( const int& type, Qt::SortOrder order = Qt::AscendingOrder ):
type_( type ),
order_( order )
{}

View File

@ -23,15 +23,16 @@
// IN THE SOFTWARE.
//////////////////////////////////////////////////////////////////////////////
#include "oxygenconfigurationui.h"
#include "../oxygenconfiguration.h"
#include <kdeversion.h>
#include <QLabel>
#include <QLayout>
#include <QGroupBox>
#include <KLocale>
#include "../oxygenconfiguration.h"
#include "oxygenconfigurationui.h"
#include <KTabWidget>
namespace Oxygen
{
@ -56,7 +57,7 @@ namespace Oxygen
mainLayout->setMargin(0);
// tab widget for basic and advanced mode
QTabWidget* tab( new QTabWidget( this ) );
KTabWidget* tab( new KTabWidget( this ) );
mainLayout->addWidget( tab );
// basic configuration
@ -77,7 +78,7 @@ namespace Oxygen
// frame border
QLabel* label;
gridLayout->addWidget( label = new QLabel( i18n("Border size:"), basicWidget ), 0, 0, 1, 1);
gridLayout->addWidget( frameBorder = new QComboBox(basicWidget), 0, 1, 1, 1);
gridLayout->addWidget( frameBorder = new KComboBox(basicWidget), 0, 1, 1, 1);
frameBorder->setObjectName(QString::fromUtf8("frameBorder"));
frameBorder->insertItems(0, QStringList()
<< OxygenConfiguration::frameBorderName( OxygenConfiguration::BorderNone, true )
@ -96,7 +97,7 @@ namespace Oxygen
// title alignment
gridLayout->addWidget( label = new QLabel( i18n("Title alignment:"), basicWidget ), 1, 0, 1, 1 );
gridLayout->addWidget( titleAlignment = new QComboBox(basicWidget), 1, 1, 1, 1 );
gridLayout->addWidget( titleAlignment = new KComboBox(basicWidget), 1, 1, 1, 1 );
titleAlignment->setObjectName(QString::fromUtf8("titleAlignment"));
titleAlignment->insertItems(0, QStringList()
<< OxygenConfiguration::titleAlignmentName( Qt::AlignLeft, true )
@ -109,7 +110,7 @@ namespace Oxygen
// button size
gridLayout->addWidget( label = new QLabel( i18n("Button size:"), basicWidget ), 2, 0, 1, 1 );
gridLayout->addWidget( buttonSize = new QComboBox(basicWidget), 2, 1, 1, 1 );
gridLayout->addWidget( buttonSize = new KComboBox(basicWidget), 2, 1, 1, 1 );
buttonSize->setObjectName(QString::fromUtf8("buttonSize"));
buttonSize->insertItems(0, QStringList()
<< OxygenConfiguration::buttonSizeName( OxygenConfiguration::ButtonSmall, true )
@ -143,7 +144,7 @@ namespace Oxygen
// title bar blending
QLabel* label;
gridLayout->addWidget( label = new QLabel( i18n("Background style:" ), advancedWidget ), 1, 0, 1, 1 );
gridLayout->addWidget( blendColor = new QComboBox(advancedWidget), 1, 1, 1, 1 );
gridLayout->addWidget( blendColor = new KComboBox(advancedWidget), 1, 1, 1, 1 );
blendColor->setObjectName(QString::fromUtf8("blendColor"));
blendColor->insertItems(0, QStringList()
<< OxygenConfiguration::blendColorName( OxygenConfiguration::NoBlending, true )
@ -155,7 +156,7 @@ namespace Oxygen
// draw size grip
gridLayout->addWidget( label = new QLabel( i18n("Extra Size grip display:"), advancedWidget ), 2, 0, 1, 1 );
gridLayout->addWidget( sizeGripMode = new QComboBox(advancedWidget), 2, 1, 1, 1 );
gridLayout->addWidget( sizeGripMode = new KComboBox(advancedWidget), 2, 1, 1, 1 );
sizeGripMode->setObjectName(QString::fromUtf8("sizeGripMode"));
sizeGripMode->setWhatsThis(i18n(
"The extra size grip is a small triangle shown in the bottom-right corner of a window \n"

View File

@ -27,7 +27,7 @@
#include <kdeversion.h>
#include <QWidget>
#include <QComboBox>
#include <KComboBox>
#include <QCheckBox>
#include <QPushButton>
#include <QVector>
@ -53,19 +53,19 @@ namespace Oxygen
void setupUI( void );
//! title alignment
QComboBox *titleAlignment;
KComboBox *titleAlignment;
//! button size
QComboBox* buttonSize;
KComboBox* buttonSize;
//! frame border
QComboBox *frameBorder;
KComboBox *frameBorder;
//! blend color
QComboBox *blendColor;
KComboBox *blendColor;
//! size grip
QComboBox *sizeGripMode;
KComboBox *sizeGripMode;
//! draw separator
QCheckBox *drawSeparator;

View File

@ -27,6 +27,9 @@
// IN THE SOFTWARE.
//////////////////////////////////////////////////////////////////////////////
#include "oxygendetectwidget.h"
#include "oxygendetectwidget.moc"
#include <cassert>
#include <QButtonGroup>
#include <QLayout>
@ -34,9 +37,6 @@
#include <KLocale>
#include <QMouseEvent>
#include "oxygendetectwidget.h"
#include "oxygendetectwidget.moc"
#include <X11/Xlib.h>
#include <X11/Xatom.h>
#include <X11/Xutil.h>
@ -90,7 +90,7 @@ namespace Oxygen
//_________________________________________________________
OxygenException::Type DetectWidget::exceptionType( void ) const
{
for( CheckBoxMap::const_iterator iter = checkboxes.begin(); iter != checkboxes.end(); iter++ )
for( CheckBoxMap::const_iterator iter = checkboxes.begin(); iter != checkboxes.end(); ++iter )
{ if( iter->first->isChecked() ) return iter->second; }
assert( false );

View File

@ -23,6 +23,10 @@
// IN THE SOFTWARE.
//////////////////////////////////////////////////////////////////////////////
#include "oxygenexceptiondialog.h"
#include "oxygenexceptiondialog.moc"
#include "oxygendetectwidget.h"
#include <cassert>
#include <QGroupBox>
#include <QLabel>
@ -30,9 +34,6 @@
#include <KLocale>
#include <KPushButton>
#include "oxygendetectwidget.h"
#include "oxygenexceptiondialog.h"
#include "oxygenexceptiondialog.moc"
namespace Oxygen
{
@ -65,7 +66,7 @@ namespace Oxygen
// exception type
gridLayout->addWidget( label = new QLabel( i18n( "Matching window property:" ), box ), 0, 0, 1, 1 );
gridLayout->addWidget( exceptionType = new QComboBox(box), 0, 1, 1, 1 );
gridLayout->addWidget( exceptionType = new KComboBox(box), 0, 1, 1, 1 );
exceptionType->insertItems(0, QStringList()
<< OxygenException::typeName( OxygenException::WindowClassName, true )
<< OxygenException::typeName( OxygenException::WindowTitle, true )
@ -99,7 +100,7 @@ namespace Oxygen
// border size
gridLayout->addWidget( checkbox = new QCheckBox( i18n("Border size:" ), box ), 0, 0, 1, 1 );
gridLayout->addWidget( frameBorder = new QComboBox(box), 0, 1, 1, 1 );
gridLayout->addWidget( frameBorder = new KComboBox(box), 0, 1, 1, 1 );
frameBorder->insertItems(0, QStringList()
<< OxygenConfiguration::frameBorderName( OxygenConfiguration::BorderNone, true )
<< OxygenConfiguration::frameBorderName( OxygenConfiguration::BorderNoSide, true )
@ -118,7 +119,7 @@ namespace Oxygen
// blend color
gridLayout->addWidget( checkbox = new QCheckBox( i18n("Background style:" ), box ), 1, 0, 1, 1 );
gridLayout->addWidget( blendColor = new QComboBox(box), 1, 1, 1, 1 );
gridLayout->addWidget( blendColor = new KComboBox(box), 1, 1, 1, 1 );
blendColor->insertItems(0, QStringList()
<< OxygenException::blendColorName( OxygenException::NoBlending, true )
<< OxygenException::blendColorName( OxygenException::RadialBlending, true ) );
@ -129,7 +130,7 @@ namespace Oxygen
// size grip
gridLayout->addWidget( checkbox = new QCheckBox( i18n("Extra size grip display:" ), box ), 2, 0, 1, 1 );
gridLayout->addWidget( sizeGripMode = new QComboBox( box ), 2, 1, 1, 1 );
gridLayout->addWidget( sizeGripMode = new KComboBox( box ), 2, 1, 1, 1 );
sizeGripMode->insertItems(0, QStringList()
<< OxygenConfiguration::sizeGripModeName( OxygenConfiguration::SizeGripNever, true )
<< OxygenConfiguration::sizeGripModeName( OxygenConfiguration::SizeGripWhenNeeded, true )
@ -181,7 +182,7 @@ namespace Oxygen
titleOutline->setValue( exception.drawTitleOutline() );
// mask
for( CheckBoxMap::iterator iter = checkboxes_.begin(); iter != checkboxes_.end(); iter++ )
for( CheckBoxMap::iterator iter = checkboxes_.begin(); iter != checkboxes_.end(); ++iter )
{ iter->second->setChecked( exception.mask() & iter->first ); }
}
@ -202,7 +203,7 @@ namespace Oxygen
// mask
unsigned int mask = OxygenException::None;
for( CheckBoxMap::const_iterator iter = checkboxes_.begin(); iter != checkboxes_.end(); iter++ )
for( CheckBoxMap::const_iterator iter = checkboxes_.begin(); iter != checkboxes_.end(); ++iter )
{ if( iter->second->isChecked() ) mask |= iter->first; }
exception.setMask( mask );
@ -265,7 +266,7 @@ namespace Oxygen
//___________________________________________
OxygenExceptionDialog::ComboBox::ComboBox( QWidget* parent ):
QComboBox( parent )
KComboBox( parent )
{ insertItems( 0, QStringList() << Yes << No ); }
//___________________________________________

View File

@ -27,7 +27,7 @@
#include <KDialog>
#include <KLineEdit>
#include <QComboBox>
#include <KComboBox>
#include <QCheckBox>
#include <map>
@ -68,16 +68,16 @@ namespace Oxygen
KLineEdit* exceptionEditor;
//! blend combobox
QComboBox* exceptionType;
KComboBox* exceptionType;
//! border size
QComboBox* frameBorder;
KComboBox* frameBorder;
//! blend combobox
QComboBox* blendColor;
KComboBox* blendColor;
//! size grip
QComboBox* sizeGripMode;
KComboBox* sizeGripMode;
//! map mask and checkbox
typedef std::map< OxygenException::AttributesMask, QCheckBox*> CheckBoxMap;
@ -89,7 +89,7 @@ namespace Oxygen
OxygenException exception_;
//! local combobox to handle configuration checkboxes
class ComboBox: public QComboBox
class ComboBox: public KComboBox
{
public:

View File

@ -23,13 +23,14 @@
// IN THE SOFTWARE.
//////////////////////////////////////////////////////////////////////////////
#include <QLayout>
#include <KLocale>
#include <KMessageBox>
#include "oxygenexceptiondialog.h"
#include "oxygenexceptionlistwidget.h"
#include "oxygenexceptionlistwidget.moc"
#include "oxygenexceptiondialog.h"
#include <QLayout>
#include <QSharedPointer>
#include <KLocale>
#include <KMessageBox>
//__________________________________________________________
namespace Oxygen
@ -114,7 +115,7 @@ namespace Oxygen
OxygenExceptionModel::List exceptions( _model().get() );
OxygenExceptionList out;
for( OxygenExceptionModel::List::const_iterator iter = exceptions.begin(); iter != exceptions.end(); iter++ )
for( OxygenExceptionModel::List::const_iterator iter = exceptions.begin(); iter != exceptions.end(); ++iter )
{ out.push_back( *iter ); }
return out;
@ -139,12 +140,12 @@ namespace Oxygen
{
// map dialog
OxygenExceptionDialog dialog( this );
dialog.setException( default_configuration_ );
if( dialog.exec() == QDialog::Rejected ) return;
QSharedPointer<OxygenExceptionDialog> dialog( new OxygenExceptionDialog( this ) );
dialog->setException( default_configuration_ );
if( dialog->exec() == QDialog::Accepted ) return;
// retrieve exception and check
OxygenException exception( dialog.exception() );
OxygenException exception( dialog->exception() );
if( !_checkException( exception ) ) return;
// create new item
@ -175,12 +176,12 @@ namespace Oxygen
OxygenException& exception( _model().get( current ) );
// create dialog
OxygenExceptionDialog dialog( this );
dialog.setException( exception );
QSharedPointer<OxygenExceptionDialog> dialog( new OxygenExceptionDialog( this ) );
dialog->setException( exception );
// map dialog
if( dialog.exec() == QDialog::Rejected ) return;
OxygenException new_exception = dialog.exception();
if( dialog->exec() == QDialog::Rejected ) return;
OxygenException new_exception = dialog->exception();
// check if exception was changed
if( exception == new_exception ) return;
@ -200,7 +201,7 @@ namespace Oxygen
void OxygenExceptionListWidget::_remove( void )
{
// shoud use a konfirmation dialog
// should use a konfirmation dialog
if( KMessageBox::questionYesNo( this, i18n("Remove selected exception ?") ) == KMessageBox::No ) return;
// remove
@ -242,7 +243,7 @@ namespace Oxygen
OxygenExceptionModel::List current_exceptions( _model().get() );
OxygenExceptionModel::List new_exceptions;
for( OxygenExceptionModel::List::const_iterator iter = current_exceptions.begin(); iter != current_exceptions.end(); iter++ )
for( OxygenExceptionModel::List::const_iterator iter = current_exceptions.begin(); iter != current_exceptions.end(); ++iter )
{
// check if new list is not empty, current index is selected and last index is not.
@ -265,7 +266,7 @@ namespace Oxygen
// restore selection
_list().selectionModel()->select( _model().index( selected_exceptions.front() ), QItemSelectionModel::Clear|QItemSelectionModel::Select|QItemSelectionModel::Rows );
for( OxygenExceptionModel::List::const_iterator iter = selected_exceptions.begin(); iter != selected_exceptions.end(); iter++ )
for( OxygenExceptionModel::List::const_iterator iter = selected_exceptions.begin(); iter != selected_exceptions.end(); ++iter )
{ _list().selectionModel()->select( _model().index( *iter ), QItemSelectionModel::Select|QItemSelectionModel::Rows ); }
emit changed();
@ -288,7 +289,7 @@ namespace Oxygen
OxygenExceptionModel::List current_exceptions( _model().get() );
OxygenExceptionModel::List new_exceptions;
for( OxygenExceptionModel::List::reverse_iterator iter = current_exceptions.rbegin(); iter != current_exceptions.rend(); iter++ )
for( OxygenExceptionModel::List::reverse_iterator iter = current_exceptions.rbegin(); iter != current_exceptions.rend(); ++iter )
{
// check if new list is not empty, current index is selected and last index is not.
@ -312,7 +313,7 @@ namespace Oxygen
// restore selection
_list().selectionModel()->select( _model().index( selected_exceptions.front() ), QItemSelectionModel::Clear|QItemSelectionModel::Select|QItemSelectionModel::Rows );
for( OxygenExceptionModel::List::const_iterator iter = selected_exceptions.begin(); iter != selected_exceptions.end(); iter++ )
for( OxygenExceptionModel::List::const_iterator iter = selected_exceptions.begin(); iter != selected_exceptions.end(); ++iter )
{ _list().selectionModel()->select( _model().index( *iter ), QItemSelectionModel::Select|QItemSelectionModel::Rows ); }
emit changed();
@ -336,10 +337,10 @@ namespace Oxygen
{
KMessageBox::error( this, i18n("Regular Expression syntax is incorrect") );
OxygenExceptionDialog dialog( this );
dialog.setException( exception );
if( dialog.exec() == QDialog::Rejected ) return false;
exception = dialog.exception();
QSharedPointer<OxygenExceptionDialog> dialog( new OxygenExceptionDialog( this ) );
dialog->setException( exception );
if( dialog->exec() == QDialog::Rejected ) return false;
exception = dialog->exception();
}

View File

@ -1,5 +1,5 @@
#ifndef _OxygenExceptionListWidget_h_
#define _OxygenExceptionListWidget_h_
#ifndef OxygenExceptionListWidget_h
#define OxygenExceptionListWidget_h
//////////////////////////////////////////////////////////////////////////////
// OxygenExceptionListWidget.h
// -------------------
@ -45,7 +45,7 @@ namespace Oxygen
public:
//! constructor
OxygenExceptionListWidget( QWidget* = 0, OxygenConfiguration default_configuration = OxygenConfiguration() );
explicit OxygenExceptionListWidget( QWidget* = 0, OxygenConfiguration default_configuration = OxygenConfiguration() );
//! set exceptions
void setExceptions( const OxygenExceptionList& );
@ -55,7 +55,7 @@ namespace Oxygen
signals:
//! emited when list is changed
//! emitted when list is changed
void changed( void );
protected:

View File

@ -1,5 +1,5 @@
#ifndef _oxygenexceptionmodel_h_
#define _oxygenexceptionmodel_h_
#ifndef oxygenexceptionmodel_h
#define oxygenexceptionmodel_h
//////////////////////////////////////////////////////////////////////////////
// oxygenexceptionmodel.h
// -------------------

View File

@ -23,12 +23,12 @@
// IN THE SOFTWARE.
//////////////////////////////////////////////////////////////////////////////
#include "oxygenshadowconfigurationui.h"
#include <KLocale>
#include <QLabel>
#include <QLayout>
#include "oxygenshadowconfigurationui.h"
namespace Oxygen
{

View File

@ -24,6 +24,10 @@
// IN THE SOFTWARE.
//////////////////////////////////////////////////////////////////////////////
#include "oxygen.h"
#include "oxygen.moc"
#include "oxygenclient.h"
#include <cassert>
#include <kdebug.h>
#include <kconfiggroup.h>
@ -32,11 +36,6 @@
#include <QApplication>
#include <QPainter>
#include "oxygen.h"
#include "oxygen.moc"
#include "oxygenclient.h"
extern "C"
{
KDE_EXPORT KDecorationFactory* create_factory()
@ -200,7 +199,7 @@ namespace Oxygen
QString window_title;
QString class_name;
for( OxygenExceptionList::const_iterator iter = exceptions_.constBegin(); iter != exceptions_.constEnd(); iter++ )
for( OxygenExceptionList::const_iterator iter = exceptions_.constBegin(); iter != exceptions_.constEnd(); ++iter )
{
// discard disabled exceptions
@ -227,7 +226,7 @@ namespace Oxygen
KWindowInfo info( client.windowId(), 0, NET::WM2WindowClass );
QString window_class_name( info.windowClassName() );
QString window_class( info.windowClassClass() );
class_name = window_class_name + " " + window_class;
class_name = window_class_name + ' ' + window_class;
}
value = class_name;

View File

@ -25,6 +25,10 @@
// IN THE SOFTWARE.
//////////////////////////////////////////////////////////////////////////////
#include "oxygenbutton.h"
#include "oxygenclient.h"
#include "oxygen.h"
#include <cmath>
#include <QPainterPath>
@ -34,9 +38,6 @@
#include <KColorUtils>
#include <KColorScheme>
#include <kcommondecoration.h>
#include "oxygenbutton.h"
#include "oxygenclient.h"
#include "oxygen.h"
namespace Oxygen
{

View File

@ -25,6 +25,13 @@
// IN THE SOFTWARE.
//////////////////////////////////////////////////////////////////////////////
#include "oxygenclient.h"
#include "oxygenclient.moc"
#include "oxygen.h"
#include "oxygenbutton.h"
#include "oxygensizegrip.h"
#include <cassert>
#include <cmath>
#include <iostream>
@ -40,12 +47,6 @@
#include <QTextStream>
#include <QApplication>
#include "oxygen.h"
#include "oxygenbutton.h"
#include "oxygenclient.h"
#include "oxygenclient.moc"
#include "oxygensizegrip.h"
using namespace std;
namespace Oxygen
{
@ -115,7 +116,7 @@ namespace Oxygen
{
QList<QLabel*> children( widget()->findChildren<QLabel*>() );
for( QList<QLabel*>::iterator iter = children.begin(); iter != children.end(); iter++ )
for( QList<QLabel*>::iterator iter = children.begin(); iter != children.end(); ++iter )
{ (*iter)->setAutoFillBackground( false ); }
}

View File

@ -22,10 +22,11 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//////////////////////////////////////////////////////////////////////////////
#include <KLocale>
#include "oxygenconfiguration.h"
#include <KLocale>
namespace Oxygen
{

View File

@ -23,9 +23,9 @@
// IN THE SOFTWARE.
//////////////////////////////////////////////////////////////////////////////
#include "oxygenexception.h"
#include <cassert>
#include <KLocale>
#include "oxygenexception.h"
namespace Oxygen
{

View File

@ -23,10 +23,10 @@
// IN THE SOFTWARE.
//////////////////////////////////////////////////////////////////////////////
#include <QTextStream>
#include "oxygenexceptionlist.h"
#include <QTextStream>
namespace Oxygen
{

View File

@ -23,11 +23,11 @@
// IN THE SOFTWARE.
//////////////////////////////////////////////////////////////////////////////
#include "oxygenshadowconfiguration.h"
#include <cassert>
#include <kdecoration.h>
#include "oxygenshadowconfiguration.h"
namespace Oxygen
{

View File

@ -23,6 +23,11 @@
// IN THE SOFTWARE.
//////////////////////////////////////////////////////////////////////////////
#include "oxygensizegrip.h"
#include "oxygenbutton.h"
#include "oxygenclient.h"
#include <cassert>
#include <QPainter>
#include <QPolygon>
@ -30,11 +35,7 @@
#include <kdeversion.h>
#include "oxygenbutton.h"
#include "oxygenclient.h"
#include "oxygensizegrip.h"
#include "x11util.h"
#include <QX11Info>
#include <X11/Xlib.h>

View File

@ -29,7 +29,6 @@
#include <QWidget>
#include <QPaintEvent>
#include <QMouseEvent>
#include <QMouseEvent>
namespace Oxygen
{