summaryrefslogtreecommitdiffstats
path: root/kommander/editor/paletteeditoradvancedimpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kommander/editor/paletteeditoradvancedimpl.cpp')
-rw-r--r--kommander/editor/paletteeditoradvancedimpl.cpp208
1 files changed, 104 insertions, 104 deletions
diff --git a/kommander/editor/paletteeditoradvancedimpl.cpp b/kommander/editor/paletteeditoradvancedimpl.cpp
index 3b5ccffd..69c90c33 100644
--- a/kommander/editor/paletteeditoradvancedimpl.cpp
+++ b/kommander/editor/paletteeditoradvancedimpl.cpp
@@ -23,13 +23,13 @@
#include "mainwindow.h"
#include "formwindow.h"
-#include <qcheckbox.h>
-#include <qcombobox.h>
-#include <qapplication.h>
-#include <qpushbutton.h>
-#include <qlistbox.h>
-#include <qpainter.h>
-#include <qgroupbox.h>
+#include <tqcheckbox.h>
+#include <tqcombobox.h>
+#include <tqapplication.h>
+#include <tqpushbutton.h>
+#include <tqlistbox.h>
+#include <tqpainter.h>
+#include <tqgroupbox.h>
/*!
Class used by PaletteEditor for bold combobox items
@@ -38,36 +38,36 @@
class BoldListBoxText : public QListBoxText
{
public:
- BoldListBoxText( QString text, QListBox* lb = 0 );
+ BoldListBoxText( TQString text, TQListBox* lb = 0 );
protected:
- virtual void paint( QPainter* );
+ virtual void paint( TQPainter* );
};
-BoldListBoxText::BoldListBoxText( QString text, QListBox* lb )
- : QListBoxText( lb )
+BoldListBoxText::BoldListBoxText( TQString text, TQListBox* lb )
+ : TQListBoxText( lb )
{
setText( text );
}
-void BoldListBoxText::paint( QPainter* painter )
+void BoldListBoxText::paint( TQPainter* painter )
{
- QFont f = painter->font();
+ TQFont f = painter->font();
f.setBold( true );
painter->setFont( f );
- QListBoxText::paint( painter );
+ TQListBoxText::paint( painter );
}
-PaletteEditorAdvanced::PaletteEditorAdvanced( FormWindow *fw, QWidget * parent,
+PaletteEditorAdvanced::PaletteEditorAdvanced( FormWindow *fw, TQWidget * parent,
const char * name, bool modal, WFlags f )
: PaletteEditorAdvancedBase( parent, name, modal, f ), formWindow( fw ), selectedPalette(0)
{
- connect( buttonHelp, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) );
+ connect( buttonHelp, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) );
buttonPixmap->setEditor( StyledButton::PixmapEditor );
- editPalette = QApplication::palette();
+ editPalette = TQApplication::palette();
setPreviewPalette( editPalette );
buttonPixmap->setFormWindow( formWindow );
@@ -187,58 +187,58 @@ void PaletteEditorAdvanced::onToggleBuildEffects( bool on )
buildDisabledEffect();
}
-QColorGroup::ColorRole PaletteEditorAdvanced::centralFromItem( int item )
+TQColorGroup::ColorRole PaletteEditorAdvanced::centralFromItem( int item )
{
switch( item ) {
case 0:
- return QColorGroup::Background;
+ return TQColorGroup::Background;
case 1:
- return QColorGroup::Foreground;
+ return TQColorGroup::Foreground;
case 2:
- return QColorGroup::Button;
+ return TQColorGroup::Button;
case 3:
- return QColorGroup::Base;
+ return TQColorGroup::Base;
case 4:
- return QColorGroup::Text;
+ return TQColorGroup::Text;
case 5:
- return QColorGroup::BrightText;
+ return TQColorGroup::BrightText;
case 6:
- return QColorGroup::ButtonText;
+ return TQColorGroup::ButtonText;
case 7:
- return QColorGroup::Highlight;
+ return TQColorGroup::Highlight;
case 8:
- return QColorGroup::HighlightedText;
+ return TQColorGroup::HighlightedText;
case 9:
- return QColorGroup::Link;
+ return TQColorGroup::Link;
case 10:
- return QColorGroup::LinkVisited;
+ return TQColorGroup::LinkVisited;
default:
- return QColorGroup::NColorRoles;
+ return TQColorGroup::NColorRoles;
}
}
-QColorGroup::ColorRole PaletteEditorAdvanced::effectFromItem( int item )
+TQColorGroup::ColorRole PaletteEditorAdvanced::effectFromItem( int item )
{
switch( item ) {
case 0:
- return QColorGroup::Light;
+ return TQColorGroup::Light;
case 1:
- return QColorGroup::Midlight;
+ return TQColorGroup::Midlight;
case 2:
- return QColorGroup::Mid;
+ return TQColorGroup::Mid;
case 3:
- return QColorGroup::Dark;
+ return TQColorGroup::Dark;
case 4:
- return QColorGroup::Shadow;
+ return TQColorGroup::Shadow;
default:
- return QColorGroup::NColorRoles;
+ return TQColorGroup::NColorRoles;
}
}
void PaletteEditorAdvanced::onCentral( int item )
{
- QPixmap* p = 0;
- QColor c;
+ TQPixmap* p = 0;
+ TQColor c;
switch(selectedPalette) {
case 0:
@@ -261,12 +261,12 @@ void PaletteEditorAdvanced::onCentral( int item )
if (p)
buttonPixmap->setPixmap( *p );
else
- buttonPixmap->setPixmap( QPixmap() );
+ buttonPixmap->setPixmap( TQPixmap() );
}
void PaletteEditorAdvanced::onEffect( int item )
{
- QColor c;
+ TQColor c;
switch(selectedPalette) {
case 0:
default:
@@ -282,9 +282,9 @@ void PaletteEditorAdvanced::onEffect( int item )
buttonEffect->setColor(c);
}
-void PaletteEditorAdvanced::mapToActiveCentralRole( const QColor& c )
+void PaletteEditorAdvanced::mapToActiveCentralRole( const TQColor& c )
{
- QColorGroup cg = editPalette.active();
+ TQColorGroup cg = editPalette.active();
cg.setColor( centralFromItem(comboCentral->currentItem()), c );
editPalette.setActive( cg );
@@ -297,9 +297,9 @@ void PaletteEditorAdvanced::mapToActiveCentralRole( const QColor& c )
setPreviewPalette( editPalette );
}
-void PaletteEditorAdvanced::mapToActiveEffectRole( const QColor& c )
+void PaletteEditorAdvanced::mapToActiveEffectRole( const TQColor& c )
{
- QColorGroup cg = editPalette.active();
+ TQColorGroup cg = editPalette.active();
cg.setColor( effectFromItem(comboEffect->currentItem()), c );
editPalette.setActive( cg );
@@ -311,14 +311,14 @@ void PaletteEditorAdvanced::mapToActiveEffectRole( const QColor& c )
setPreviewPalette( editPalette );
}
-void PaletteEditorAdvanced::mapToActivePixmapRole( const QPixmap& pm )
+void PaletteEditorAdvanced::mapToActivePixmapRole( const TQPixmap& pm )
{
- QColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem());
- QColorGroup cg = editPalette.active();
+ TQColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem());
+ TQColorGroup cg = editPalette.active();
if ( !pm.isNull() )
- cg.setBrush( role, QBrush( cg.color( role ), pm ) );
+ cg.setBrush( role, TQBrush( cg.color( role ), pm ) );
else
- cg.setBrush( role, QBrush( cg.color( role ) ) );
+ cg.setBrush( role, TQBrush( cg.color( role ) ) );
editPalette.setActive( cg );
@@ -331,9 +331,9 @@ void PaletteEditorAdvanced::mapToActivePixmapRole( const QPixmap& pm )
setPreviewPalette( editPalette );
}
-void PaletteEditorAdvanced::mapToInactiveCentralRole( const QColor& c )
+void PaletteEditorAdvanced::mapToInactiveCentralRole( const TQColor& c )
{
- QColorGroup cg = editPalette.inactive();
+ TQColorGroup cg = editPalette.inactive();
cg.setColor( centralFromItem(comboCentral->currentItem()), c );
editPalette.setInactive( cg );
@@ -342,31 +342,31 @@ void PaletteEditorAdvanced::mapToInactiveCentralRole( const QColor& c )
setPreviewPalette( editPalette );
}
-void PaletteEditorAdvanced::mapToInactiveEffectRole( const QColor& c )
+void PaletteEditorAdvanced::mapToInactiveEffectRole( const TQColor& c )
{
- QColorGroup cg = editPalette.inactive();
+ TQColorGroup cg = editPalette.inactive();
cg.setColor( effectFromItem(comboEffect->currentItem()), c );
editPalette.setInactive( cg );
setPreviewPalette( editPalette );
}
-void PaletteEditorAdvanced::mapToInactivePixmapRole( const QPixmap& pm )
+void PaletteEditorAdvanced::mapToInactivePixmapRole( const TQPixmap& pm )
{
- QColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem());
- QColorGroup cg = editPalette.inactive();
+ TQColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem());
+ TQColorGroup cg = editPalette.inactive();
if ( !pm.isNull() )
- cg.setBrush( role, QBrush( cg.color( role ), pm ) );
+ cg.setBrush( role, TQBrush( cg.color( role ), pm ) );
else
- cg.setBrush( role, QBrush( cg.color( role ) ) );
+ cg.setBrush( role, TQBrush( cg.color( role ) ) );
editPalette.setInactive( cg );
setPreviewPalette( editPalette );
}
-void PaletteEditorAdvanced::mapToDisabledCentralRole( const QColor& c )
+void PaletteEditorAdvanced::mapToDisabledCentralRole( const TQColor& c )
{
- QColorGroup cg = editPalette.disabled();
+ TQColorGroup cg = editPalette.disabled();
cg.setColor( centralFromItem(comboCentral->currentItem()), c );
editPalette.setDisabled( cg );
@@ -375,23 +375,23 @@ void PaletteEditorAdvanced::mapToDisabledCentralRole( const QColor& c )
setPreviewPalette( editPalette );
}
-void PaletteEditorAdvanced::mapToDisabledEffectRole( const QColor& c )
+void PaletteEditorAdvanced::mapToDisabledEffectRole( const TQColor& c )
{
- QColorGroup cg = editPalette.disabled();
+ TQColorGroup cg = editPalette.disabled();
cg.setColor( effectFromItem(comboEffect->currentItem()), c );
editPalette.setDisabled( cg );
setPreviewPalette( editPalette );
}
-void PaletteEditorAdvanced::mapToDisabledPixmapRole( const QPixmap& pm )
+void PaletteEditorAdvanced::mapToDisabledPixmapRole( const TQPixmap& pm )
{
- QColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem());
- QColorGroup cg = editPalette.disabled();
+ TQColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem());
+ TQColorGroup cg = editPalette.disabled();
if ( !pm.isNull() )
- cg.setBrush( role, QBrush( cg.color( role ), pm ) );
+ cg.setBrush( role, TQBrush( cg.color( role ), pm ) );
else
- cg.setBrush( role, QBrush( cg.color( role ) ) );
+ cg.setBrush( role, TQBrush( cg.color( role ) ) );
editPalette.setDisabled( cg );
@@ -400,10 +400,10 @@ void PaletteEditorAdvanced::mapToDisabledPixmapRole( const QPixmap& pm )
void PaletteEditorAdvanced::buildActiveEffect()
{
- QColorGroup cg = editPalette.active();
- QColor btn = cg.color( QColorGroup::Button );
+ TQColorGroup cg = editPalette.active();
+ TQColor btn = cg.color( TQColorGroup::Button );
- QPalette temp( btn, btn );
+ TQPalette temp( btn, btn );
for (int i = 0; i<5; i++)
cg.setColor( effectFromItem(i), temp.active().color( effectFromItem(i) ) );
@@ -422,10 +422,10 @@ void PaletteEditorAdvanced::buildInactive()
void PaletteEditorAdvanced::buildInactiveEffect()
{
- QColorGroup cg = editPalette.inactive();
+ TQColorGroup cg = editPalette.inactive();
- QColor light, midlight, mid, dark, shadow;
- QColor btn = cg.color( QColorGroup::Button );
+ TQColor light, midlight, mid, dark, shadow;
+ TQColor btn = cg.color( TQColorGroup::Button );
light = btn.light(150);
midlight = btn.light(115);
@@ -433,11 +433,11 @@ void PaletteEditorAdvanced::buildInactiveEffect()
dark = btn.dark();
shadow = black;
- cg.setColor( QColorGroup::Light, light );
- cg.setColor( QColorGroup::Midlight, midlight );
- cg.setColor( QColorGroup::Mid, mid );
- cg.setColor( QColorGroup::Dark, dark );
- cg.setColor( QColorGroup::Shadow, shadow );
+ cg.setColor( TQColorGroup::Light, light );
+ cg.setColor( TQColorGroup::Midlight, midlight );
+ cg.setColor( TQColorGroup::Mid, mid );
+ cg.setColor( TQColorGroup::Dark, dark );
+ cg.setColor( TQColorGroup::Shadow, shadow );
editPalette.setInactive( cg );
setPreviewPalette( editPalette );
@@ -446,9 +446,9 @@ void PaletteEditorAdvanced::buildInactiveEffect()
void PaletteEditorAdvanced::buildDisabled()
{
- QColorGroup cg = editPalette.active();
- cg.setColor( QColorGroup::ButtonText, darkGray );
- cg.setColor( QColorGroup::Foreground, darkGray );
+ TQColorGroup cg = editPalette.active();
+ cg.setColor( TQColorGroup::ButtonText, darkGray );
+ cg.setColor( TQColorGroup::Foreground, darkGray );
editPalette.setDisabled( cg );
buildDisabledEffect();
@@ -456,10 +456,10 @@ void PaletteEditorAdvanced::buildDisabled()
void PaletteEditorAdvanced::buildDisabledEffect()
{
- QColorGroup cg = editPalette.disabled();
+ TQColorGroup cg = editPalette.disabled();
- QColor light, midlight, mid, dark, shadow;
- QColor btn = cg.color( QColorGroup::Button );
+ TQColor light, midlight, mid, dark, shadow;
+ TQColor btn = cg.color( TQColorGroup::Button );
light = btn.light(150);
midlight = btn.light(115);
@@ -467,20 +467,20 @@ void PaletteEditorAdvanced::buildDisabledEffect()
dark = btn.dark();
shadow = black;
- cg.setColor( QColorGroup::Light, light );
- cg.setColor( QColorGroup::Midlight, midlight );
- cg.setColor( QColorGroup::Mid, mid );
- cg.setColor( QColorGroup::Dark, dark );
- cg.setColor( QColorGroup::Shadow, shadow );
+ cg.setColor( TQColorGroup::Light, light );
+ cg.setColor( TQColorGroup::Midlight, midlight );
+ cg.setColor( TQColorGroup::Mid, mid );
+ cg.setColor( TQColorGroup::Dark, dark );
+ cg.setColor( TQColorGroup::Shadow, shadow );
editPalette.setDisabled( cg );
setPreviewPalette( editPalette );
updateStyledButtons();
}
-void PaletteEditorAdvanced::setPreviewPalette( const QPalette& pal )
+void PaletteEditorAdvanced::setPreviewPalette( const TQPalette& pal )
{
- QColorGroup cg;
+ TQColorGroup cg;
switch (selectedPalette) {
case 0:
@@ -501,8 +501,8 @@ void PaletteEditorAdvanced::setPreviewPalette( const QPalette& pal )
void PaletteEditorAdvanced::updateStyledButtons()
{
- QColor central, effect;
- QPixmap *pm = 0;
+ TQColor central, effect;
+ TQPixmap *pm = 0;
switch (selectedPalette) {
case 0:
default:
@@ -527,17 +527,17 @@ void PaletteEditorAdvanced::updateStyledButtons()
if ( pm && !pm->isNull() )
buttonPixmap->setPixmap( *pm );
else
- buttonPixmap->setPixmap(QPixmap());
+ buttonPixmap->setPixmap(TQPixmap());
}
-void PaletteEditorAdvanced::setPal( const QPalette& pal )
+void PaletteEditorAdvanced::setPal( const TQPalette& pal )
{
editPalette = pal;
setPreviewPalette( pal );
updateStyledButtons();
}
-QPalette PaletteEditorAdvanced::pal() const
+TQPalette PaletteEditorAdvanced::pal() const
{
return editPalette;
}
@@ -599,32 +599,32 @@ void PaletteEditorAdvanced::setupBackgroundMode( BackgroundMode mode )
if (initRole > 8 ) {
comboEffect->setCurrentItem( initRole - 9 );
if ( comboEffect->listBox() ) {
- QString text = comboEffect->currentText();
+ TQString text = comboEffect->currentText();
comboEffect->listBox()->changeItem( new BoldListBoxText( text ), initRole - 9 );
}
}
else {
comboCentral->setCurrentItem( initRole );
if ( comboCentral->listBox() ) {
- QString text = comboCentral->currentText();
+ TQString text = comboCentral->currentText();
comboCentral->listBox()->changeItem( new BoldListBoxText( text ), initRole );
}
}
}
-QPalette PaletteEditorAdvanced::getPalette( bool *ok, const QPalette &init,
- BackgroundMode mode, QWidget* parent,
+TQPalette PaletteEditorAdvanced::getPalette( bool *ok, const TQPalette &init,
+ BackgroundMode mode, TQWidget* parent,
const char* name, FormWindow *fw )
{
PaletteEditorAdvanced* dlg = new PaletteEditorAdvanced( fw, parent, name, true );
dlg->setupBackgroundMode( mode );
- if ( init != QPalette() )
+ if ( init != TQPalette() )
dlg->setPal( init );
int resultCode = dlg->exec();
- QPalette result = init;
- if ( resultCode == QDialog::Accepted ) {
+ TQPalette result = init;
+ if ( resultCode == TQDialog::Accepted ) {
if ( ok )
*ok = true;
result = dlg->pal();