summaryrefslogtreecommitdiffstats
path: root/kchart/kchartBackgroundPixmapConfigPage.cc
diff options
context:
space:
mode:
Diffstat (limited to 'kchart/kchartBackgroundPixmapConfigPage.cc')
-rw-r--r--kchart/kchartBackgroundPixmapConfigPage.cc194
1 files changed, 97 insertions, 97 deletions
diff --git a/kchart/kchartBackgroundPixmapConfigPage.cc b/kchart/kchartBackgroundPixmapConfigPage.cc
index b778dca8b..3d653c311 100644
--- a/kchart/kchartBackgroundPixmapConfigPage.cc
+++ b/kchart/kchartBackgroundPixmapConfigPage.cc
@@ -29,16 +29,16 @@
#include <kfilemetainfo.h>
#include <kstringhandler.h>
-#include <qcombobox.h>
-#include <qradiobutton.h>
-#include <qbuttongroup.h>
-#include <qspinbox.h>
-#include <qlayout.h>
-#include <qhbox.h>
-#include <qpushbutton.h>
-#include <qlabel.h>
-#include <qwhatsthis.h>
-#include <qlistbox.h>
+#include <tqcombobox.h>
+#include <tqradiobutton.h>
+#include <tqbuttongroup.h>
+#include <tqspinbox.h>
+#include <tqlayout.h>
+#include <tqhbox.h>
+#include <tqpushbutton.h>
+#include <tqlabel.h>
+#include <tqwhatsthis.h>
+#include <tqlistbox.h>
#include <kcolorbutton.h>
#include "kchart_params.h"
@@ -46,47 +46,47 @@
namespace KChart
{
-KChartBackgroundPixmapConfigPage::KChartBackgroundPixmapConfigPage( KChartParams* params, QWidget* parent )
- : QWidget( parent, "KChartBackgroundPixmapConfigPage" ),
+KChartBackgroundPixmapConfigPage::KChartBackgroundPixmapConfigPage( KChartParams* params, TQWidget* tqparent )
+ : TQWidget( tqparent, "KChartBackgroundPixmapConfigPage" ),
_params( params )
{
- QWhatsThis::add( this,
+ TQWhatsThis::add( this,
i18n( "On this page, you can select colors or images "
"to be displayed behind the different areas. You "
"can also select whether the images should be "
"stretched or scaled or centered or used as "
"background tiles." ) );
- QHBoxLayout* toplevel = new QHBoxLayout( this, 10 );
+ TQHBoxLayout* toplevel = new TQHBoxLayout( this, 10 );
#if 0
- QVBoxLayout* left=new QVBoxLayout(10);
+ TQVBoxLayout* left=new TQVBoxLayout(10);
toplevel->addLayout(left,2);
- regionList=new QListBox(this);
+ regionList=new TQListBox(this);
left->addWidget(regionList);
#endif
- QVBoxLayout* center = new QVBoxLayout( 10 );
+ TQVBoxLayout* center = new TQVBoxLayout( 10 );
toplevel->addLayout( center, 2 );
- QLabel* backgroundLA = new QLabel( i18n( "&Background color:" ), this );
+ TQLabel* backgroundLA = new TQLabel( i18n( "&Background color:" ), this );
center->addWidget( backgroundLA );
_backgroundCB = new KColorButton( this );
backgroundLA->setBuddy( _backgroundCB );
center->addWidget( _backgroundCB);
- QString wtstr = i18n( "Here you set the color in which the background "
+ TQString wtstr = i18n( "Here you set the color in which the background "
"of the chart is painted." );
- QWhatsThis::add( backgroundLA, wtstr );
- QWhatsThis::add( _backgroundCB, wtstr );
+ TQWhatsThis::add( backgroundLA, wtstr );
+ TQWhatsThis::add( _backgroundCB, wtstr );
- QLabel* wallpaperLA = new QLabel( i18n( "Background wallpaper:" ), this );
+ TQLabel* wallpaperLA = new TQLabel( i18n( "Background wallpaper:" ), this );
center->addWidget( wallpaperLA );
- wallCB = new QComboBox( false, this, "wallCombo" );
+ wallCB = new TQComboBox( false, this, "wallCombo" );
wallpaperLA->setBuddy(wallCB);
- QWhatsThis::add( wallCB, i18n( "You can select a background image from "
+ TQWhatsThis::add( wallCB, i18n( "You can select a background image from "
"this list. Initially, the installed KDE "
"wallpapers will be offered. If you do not "
"find what you are looking for here, you can "
@@ -96,78 +96,78 @@ KChartBackgroundPixmapConfigPage::KChartBackgroundPixmapConfigPage( KChartParams
wallCB->insertItem( i18n("None") );
loadWallpaperFilesList();
- QPushButton* browsePB = new QPushButton( i18n("&Browse..."), this );
- QWhatsThis::add( browsePB, i18n( "Click this button to select a background "
+ TQPushButton* browsePB = new TQPushButton( i18n("&Browse..."), this );
+ TQWhatsThis::add( browsePB, i18n( "Click this button to select a background "
"image not yet present in the list above. " ) );
center->addWidget( browsePB );
- connect( browsePB, SIGNAL( clicked() ), SLOT( slotBrowse() ) );
+ connect( browsePB, TQT_SIGNAL( clicked() ), TQT_SLOT( slotBrowse() ) );
- wallWidget = new QWidget( this );
- QWhatsThis::add( wallWidget, i18n( "This area will always display the "
+ wallWidget = new TQWidget( this );
+ TQWhatsThis::add( wallWidget, i18n( "This area will always display the "
"currently selected background image. "
"Note that the image will be scaled and "
"thus might have a different ratio than "
"it originally had." ) );
center->addWidget( wallWidget );
- connect( wallCB, SIGNAL( activated( int ) ),
- this, SLOT( slotWallPaperChanged( int ) ) );
+ connect( wallCB, TQT_SIGNAL( activated( int ) ),
+ this, TQT_SLOT( slotWallPaperChanged( int ) ) );
- right = new QVGroupBox( i18n( "Wallpaper Configuration" ), this );
- QWhatsThis::add( right, i18n( "In this box, you can set various settings "
+ right = new TQVGroupBox( i18n( "Wallpaper Configuration" ), this );
+ TQWhatsThis::add( right, i18n( "In this box, you can set various settings "
"that control how the background image is "
"displayed." ) );
toplevel->addWidget( right );
- QHBox* intensityHB = new QHBox( right );
+ TQHBox* intensityHB = new TQHBox( right );
intensityHB->setSpacing( 10 );
- QLabel* intensityLA = new QLabel(
+ TQLabel* intensityLA = new TQLabel(
// xgettext:no-c-format
i18n( "&Intensity in %:" ), intensityHB );
- intensitySB = new QSpinBox( 1, 100, 1, intensityHB );
+ intensitySB = new TQSpinBox( 1, 100, 1, intensityHB );
intensityLA->setBuddy( intensitySB );
// xgettext:no-c-format
- QString ttstr = i18n( "Here you can select how much the image should be "
+ TQString ttstr = i18n( "Here you can select how much the image should be "
"brightened up so that it does not disturb the "
"selected area too much.<br> Different images require "
"different settings, but 25% is a good value to start "
"with." );
- QWhatsThis::add( intensityLA, ttstr );
- QWhatsThis::add( intensitySB, ttstr );
+ TQWhatsThis::add( intensityLA, ttstr );
+ TQWhatsThis::add( intensitySB, ttstr );
- stretchedRB = new QRadioButton( i18n( "Stretched" ), right );
- QWhatsThis::add( stretchedRB,
+ stretchedRB = new TQRadioButton( i18n( "Stretched" ), right );
+ TQWhatsThis::add( stretchedRB,
i18n( "If you check this box, the selected image will "
"be scaled to fit the total size of the selected "
"area. Image ratio will be adjusted to match "
"the area size and height if necessary." ) );
stretchedRB->setChecked( true );
- scaledRB = new QRadioButton( i18n( "Scaled" ), right );
- QWhatsThis::add( scaledRB,
+ scaledRB = new TQRadioButton( i18n( "Scaled" ), right );
+ TQWhatsThis::add( scaledRB,
i18n( "If you check this box, the selected image will "
"be scaled to match the height or width of the "
"selected area - whichever is reached first." ) );
- centeredRB = new QRadioButton( i18n( "Centered" ), right );
- QWhatsThis::add( centeredRB,
+ centeredRB = new TQRadioButton( i18n( "Centered" ), right );
+ TQWhatsThis::add( centeredRB,
i18n( "If you check this box, the selected image will "
"be centered over the selected area. If the image "
"is larger then the area, you will only see the "
"middle part of it." ) );
- tiledRB = new QRadioButton( i18n( "Tiled" ), right );
- QWhatsThis::add( tiledRB,
+ tiledRB = new TQRadioButton( i18n( "Tiled" ), right );
+ TQWhatsThis::add( tiledRB,
i18n( "If you check this box, the selected image will "
"be used as a background tile. If the image is "
"larger then the selected area, you will only see "
"the upper left part of it." ) );
- QButtonGroup* alignmentBG;
- alignmentBG = new QButtonGroup( right, "GroupBox_Alignment" );
- alignmentBG->setFrameStyle( QFrame::NoFrame );
- alignmentBG->insert( stretchedRB );
- alignmentBG->insert( scaledRB );
- alignmentBG->insert( centeredRB );
- alignmentBG->insert( tiledRB );
+ TQButtonGroup* tqalignmentBG;
+ tqalignmentBG = new TQButtonGroup( right, "GroupBox_Alignment" );
+ tqalignmentBG->setFrameStyle( TQFrame::NoFrame );
+ tqalignmentBG->insert( stretchedRB );
+ tqalignmentBG->insert( scaledRB );
+ tqalignmentBG->insert( centeredRB );
+ tqalignmentBG->insert( tiledRB );
intensitySB->hide(); //the property doesn't work atm
}
@@ -176,65 +176,65 @@ KChartBackgroundPixmapConfigPage::KChartBackgroundPixmapConfigPage( KChartParams
void KChartBackgroundPixmapConfigPage::loadWallpaperFilesList()
{
// Wallpapers
- // the following QMap is lower cased names mapped to cased names and URLs
+ // the following TQMap is lower cased names mapped to cased names and URLs
// this way we get case insensitive sorting
- QMap<QString, QPair<QString, QString> > papers;
+ TQMap<TQString, TQPair<TQString, TQString> > papers;
//search for .desktop files before searching for images without .desktop files
- QStringList lst = KGlobal::dirs()->findAllResources("wallpaper", "*desktop", false, true);
- QStringList files;
- for (QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it)
+ TQStringList lst = KGlobal::dirs()->findAllResources("wallpaper", "*desktop", false, true);
+ TQStringList files;
+ for (TQStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it)
{
KSimpleConfig fileConfig(*it);
fileConfig.setGroup("Wallpaper");
- QString imageCaption = fileConfig.readEntry("Name");
- QString fileName = fileConfig.readEntry("File");
+ TQString imageCaption = fileConfig.readEntry("Name");
+ TQString fileName = fileConfig.readEntry("File");
if (imageCaption.isEmpty())
{
imageCaption = fileName;
- imageCaption.replace('_', ' ');
+ imageCaption.tqreplace('_', ' ');
imageCaption = KStringHandler::capwords(imageCaption);
}
// avoid name collisions
- QString rs = imageCaption;
- QString lrs = rs.lower();
- for (int n = 1; papers.find(lrs) != papers.end(); ++n)
+ TQString rs = imageCaption;
+ TQString lrs = rs.lower();
+ for (int n = 1; papers.tqfind(lrs) != papers.end(); ++n)
{
- rs = imageCaption + " (" + QString::number(n) + ')';
+ rs = imageCaption + " (" + TQString::number(n) + ')';
lrs = rs.lower();
}
- int slash = (*it).findRev('/') + 1;
- QString directory = (*it).left(slash);
+ int slash = (*it).tqfindRev('/') + 1;
+ TQString directory = (*it).left(slash);
bool canLoadScaleable = false;
#ifdef HAVE_LIBART
canLoadScaleable = true;
#endif
if ( fileConfig.readEntry("ImageType") == "pixmap" || canLoadScaleable ) {
- papers[lrs] = qMakePair(rs, directory + fileName);
+ papers[lrs] = tqMakePair(rs, directory + fileName);
files.append(directory + fileName);
}
}
//now find any wallpapers that don't have a .desktop file
lst = KGlobal::dirs()->findAllResources("wallpaper", "*", false, true);
- for (QStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it)
+ for (TQStringList::ConstIterator it = lst.begin(); it != lst.end(); ++it)
{
if ( !(*it).endsWith(".desktop") && files.grep(*it).empty() ) {
// First try to see if we have a comment describing the image. If we do
// just use the first line of said comment.
KFileMetaInfo metaInfo(*it);
- QString imageCaption;
+ TQString imageCaption;
if (metaInfo.isValid() && metaInfo.item("Comment").isValid())
imageCaption = metaInfo.item("Comment").string().section('\n', 0, 0);
if (imageCaption.isEmpty())
{
- int slash = (*it).findRev('/') + 1;
- int endDot = (*it).findRev('.');
+ int slash = (*it).tqfindRev('/') + 1;
+ int endDot = (*it).tqfindRev('.');
// strip the extension if it exists
if (endDot != -1 && endDot > slash)
@@ -242,26 +242,26 @@ void KChartBackgroundPixmapConfigPage::loadWallpaperFilesList()
else
imageCaption = (*it).mid(slash);
- imageCaption.replace('_', ' ');
+ imageCaption.tqreplace('_', ' ');
imageCaption = KStringHandler::capwords(imageCaption);
}
// avoid name collisions
- QString rs = imageCaption;
- QString lrs = rs.lower();
- for (int n = 1; papers.find(lrs) != papers.end(); ++n)
+ TQString rs = imageCaption;
+ TQString lrs = rs.lower();
+ for (int n = 1; papers.tqfind(lrs) != papers.end(); ++n)
{
- rs = imageCaption + " (" + QString::number(n) + ')';
+ rs = imageCaption + " (" + TQString::number(n) + ')';
lrs = rs.lower();
}
- papers[lrs] = qMakePair(rs, *it);
+ papers[lrs] = tqMakePair(rs, *it);
}
}
m_wallpaper.clear();
//don't start to 0, we have None element
int i = 1;
- for (QMap<QString, QPair<QString, QString> >::Iterator it = papers.begin();
+ for (TQMap<TQString, TQPair<TQString, TQString> >::Iterator it = papers.begin();
it != papers.end();
++it)
{
@@ -274,7 +274,7 @@ void KChartBackgroundPixmapConfigPage::loadWallpaperFilesList()
void KChartBackgroundPixmapConfigPage::init()
{
#if 0
- QStringList lst;
+ TQStringList lst;
lst.append(i18n( "Outermost Region" ));
lst.append(i18n( "Innermost Region" ));
lst.append(i18n( "Header+Title+Subtitle" ));
@@ -317,11 +317,11 @@ void KChartBackgroundPixmapConfigPage::init()
_params->frameSettings( KDChartEnums::AreaInnermost, bFound );
if( bFound )
{
- const QPixmap* backPixmap;
+ const TQPixmap* backPixmap;
bool isTiledMode = false;
KDFrame::BackPixmapMode backPixmapMode;
- const QBrush& background = innerFrame->frame().background( backPixmap, backPixmapMode );
- const QColor backColor( background.color() );
+ const TQBrush& background = innerFrame->frame().background( backPixmap, backPixmapMode );
+ const TQColor backColor( background.color() );
// Bg color has to be be set in any case,
// even when a (tiled) pixmap is specified:
@@ -366,7 +366,7 @@ void KChartBackgroundPixmapConfigPage::init()
}
}
else
- _backgroundCB->setColor(QColor(230, 222, 222) );
+ _backgroundCB->setColor(TQColor(230, 222, 222) );
}
void KChartBackgroundPixmapConfigPage::apply()
@@ -385,7 +385,7 @@ void KChartBackgroundPixmapConfigPage::apply()
// if( !load ) {
// _params->backgroundPixmapName = "";
-// _params->backgroundPixmap=QPixmap("");
+// _params->backgroundPixmap=TQPixmap("");
// _params->backgroundPixmapIsDirty = false;
// }
// }
@@ -415,7 +415,7 @@ void KChartBackgroundPixmapConfigPage::apply()
_params->frameSettings( KDChartEnums::AreaInnermost, bFound );
if( bFound )
{
- const QColor backColor( _backgroundCB->color() );
+ const TQColor backColor( _backgroundCB->color() );
KDFrame& frame( const_cast<KDFrame&>(innerFrame->frame()) );
if ( wallCB->currentItem() == 0 )
{
@@ -424,13 +424,13 @@ void KChartBackgroundPixmapConfigPage::apply()
}
else
{
- const QPixmap* pixmap = wallWidget->paletteBackgroundPixmap();
+ const TQPixmap* pixmap = wallWidget->paletteBackgroundPixmap();
if ( tiledRB->isChecked() ){
// We remove the frame's extra pixmap,
frame.setBackPixmap( 0 );
- // because a tiled image is set via a QBrush.
+ // because a tiled image is set via a TQBrush.
if( pixmap )
- frame.setBackground( QBrush( backColor, *pixmap ) );
+ frame.setBackground( TQBrush( backColor, *pixmap ) );
else
frame.setBackground( backColor );
}else{
@@ -451,16 +451,16 @@ void KChartBackgroundPixmapConfigPage::apply()
}
-void KChartBackgroundPixmapConfigPage::showSettings( const QString& fileName )
+void KChartBackgroundPixmapConfigPage::showSettings( const TQString& fileName )
{
wallCB->blockSignals(true);
- if (m_wallpaper.find(fileName) == m_wallpaper.end())
+ if (m_wallpaper.tqfind(fileName) == m_wallpaper.end())
{
int i = wallCB->count();
- QString imageCaption;
- int slash = fileName.findRev('/') + 1;
- int endDot = fileName.findRev('.');
+ TQString imageCaption;
+ int slash = fileName.tqfindRev('/') + 1;
+ int endDot = fileName.tqfindRev('.');
// strip the extension if it exists
if (endDot != -1 && endDot > slash)
@@ -517,7 +517,7 @@ bool KChartBackgroundPixmapConfigPage::loadWallPaper()
wallPixmap.resize(0,0);
wallFile = "";
} else {
- for(QMap<QString,int>::ConstIterator it = m_wallpaper.begin();
+ for(TQMap<TQString,int>::ConstIterator it = m_wallpaper.begin();
it != m_wallpaper.end();
++it)
{
@@ -527,7 +527,7 @@ bool KChartBackgroundPixmapConfigPage::loadWallPaper()
break;
}
}
- QString file = locate("wallpaper", wallFile);
+ TQString file = locate("wallpaper", wallFile);
if( file.isEmpty() ) {
kdWarning(35001) << "Couldn't locate wallpaper " << wallFile << endl;
wallPixmap.resize(0,0);