summaryrefslogtreecommitdiffstats
path: root/kmahjongg/Preview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmahjongg/Preview.cpp')
-rw-r--r--kmahjongg/Preview.cpp116
1 files changed, 58 insertions, 58 deletions
diff --git a/kmahjongg/Preview.cpp b/kmahjongg/Preview.cpp
index edd8ef79..11fbcdbd 100644
--- a/kmahjongg/Preview.cpp
+++ b/kmahjongg/Preview.cpp
@@ -7,33 +7,33 @@
#include <kstdguiitem.h>
#include <kimageio.h>
-#include <qcombobox.h>
-#include <qhgroupbox.h>
-#include <qimage.h>
-#include <qregexp.h>
-#include <qpainter.h>
-#include <qvbox.h>
+#include <tqcombobox.h>
+#include <tqhgroupbox.h>
+#include <tqimage.h>
+#include <tqregexp.h>
+#include <tqpainter.h>
+#include <tqvbox.h>
#include "prefs.h"
#include "Preview.h"
static const char * themeMagicV1_0= "kmahjongg-theme-v1.0";
-Preview::Preview(QWidget* parent) : KDialogBase(parent), m_tiles(true)
+Preview::Preview(TQWidget* parent) : KDialogBase(parent), m_tiles(true)
{
KPushButton *loadButton;
- QGroupBox *group;
- QVBox *page;
+ TQGroupBox *group;
+ TQVBox *page;
- page = new QVBox(this);
+ page = new TQVBox(this);
- group = new QHGroupBox(page);
+ group = new TQHGroupBox(page);
- m_combo = new QComboBox(false, group);
- connect(m_combo, SIGNAL(activated(int)), SLOT(selectionChanged(int)));
+ m_combo = new TQComboBox(false, group);
+ connect(m_combo, TQT_SIGNAL(activated(int)), TQT_SLOT(selectionChanged(int)));
loadButton = new KPushButton(i18n("Load..."), group);
- connect( loadButton, SIGNAL(clicked()), SLOT(load()) );
+ connect( loadButton, TQT_SIGNAL(clicked()), TQT_SLOT(load()) );
m_drawFrame = new FrameImage(page);
m_drawFrame->setFixedSize(310, 236);
@@ -73,10 +73,10 @@ void Preview::markUnchanged()
void Preview::initialise(const PreviewType type)
{
- QString extension;
- QString tile = Prefs::tileSet();
- QString back = Prefs::background();
- QString layout = Prefs::layout();
+ TQString extension;
+ TQString tile = Prefs::tileSet();
+ TQString back = Prefs::background();
+ TQString layout = Prefs::layout();
// set up the concept of the current file. Initialised to the preferences
// value initially. Set the caption to indicate what we are doing
@@ -130,13 +130,13 @@ void Preview::initialise(const PreviewType type)
// get rid of files from the last invocation
m_combo->clear();
- QStringList names;
- QStringList::const_iterator it, itEnd;
+ TQStringList names;
+ TQStringList::const_iterator it, itEnd;
it = m_fileList.begin();
itEnd = m_fileList.end();
for ( ; it != itEnd; ++it)
{
- QFileInfo fi(*it);
+ TQFileInfo fi(*it);
names << fi.baseName();
}
@@ -158,7 +158,7 @@ void Preview::slotOk() {
}
void Preview::load() {
- KURL url = KFileDialog::getOpenURL(QString::null, m_fileSelector, this, i18n("Open Board Layout" ));
+ KURL url = KFileDialog::getOpenURL(TQString::null, m_fileSelector, this, i18n("Open Board Layout" ));
if ( !url.isEmpty() ) {
m_selectedFile = url.path();
drawPreview();
@@ -174,9 +174,9 @@ void Preview::load() {
void Preview::drawPreview()
{
- QString tile = Prefs::tileSet();
- QString back = Prefs::background();
- QString layout = Prefs::layout();
+ TQString tile = Prefs::tileSet();
+ TQString back = Prefs::background();
+ TQString layout = Prefs::layout();
switch (m_previewType)
{
@@ -197,12 +197,12 @@ void Preview::drawPreview()
// specified bits in (layout, background and tileset
if (!m_selectedFile.isEmpty())
{
- QString backRaw, layoutRaw, tilesetRaw, magic;
+ TQString backRaw, layoutRaw, tilesetRaw, magic;
- QFile in(m_selectedFile);
+ TQFile in(m_selectedFile);
if (in.open(IO_ReadOnly))
{
- QTextStream stream(&in);
+ TQTextStream stream(&in);
magic = stream.readLine();
if (magic != themeMagicV1_0)
{
@@ -217,7 +217,7 @@ void Preview::drawPreview()
tile = tilesetRaw;
tile.replace(":", "/kmahjongg/pics/");
- if (!QFile::exists(tile))
+ if (!TQFile::exists(tile))
{
tile = tilesetRaw;
tile = "pics/" + tile.right(tile.length() - tile.find(":") - 1 );
@@ -226,7 +226,7 @@ void Preview::drawPreview()
back = backRaw;
back.replace(":", "/kmahjongg/pics/");
- if (!QFile::exists(back))
+ if (!TQFile::exists(back))
{
back = backRaw;
back = "pics/" + back.right(back.length() - back.find(":") - 1);
@@ -235,7 +235,7 @@ void Preview::drawPreview()
layout = layoutRaw;
layout.replace(":", "/kmahjongg/pics/");
- if (!QFile::exists(layout))
+ if (!TQFile::exists(layout))
{
layout = layoutRaw;
layout = "pics/" + layout.right(layout.length() - layout.find(":") - 1);
@@ -254,7 +254,7 @@ void Preview::drawPreview()
renderTiles(tile, layout);
}
-void Preview::paintEvent( QPaintEvent* ){
+void Preview::paintEvent( TQPaintEvent* ){
m_drawFrame->repaint(false);
}
@@ -296,11 +296,11 @@ void Preview::applyChange()
}
// Render the background to the pixmap.
-void Preview::renderBackground(const QString &bg) {
- QImage img;
- QImage tmp;
- QPixmap *p;
- QPixmap *b;
+void Preview::renderBackground(const TQString &bg) {
+ TQImage img;
+ TQImage tmp;
+ TQPixmap *p;
+ TQPixmap *b;
p = m_drawFrame->getPreviewPixmap();
m_back.load(bg, p->width(), p->height());
b = m_back.getBackground();
@@ -310,11 +310,11 @@ void Preview::renderBackground(const QString &bg) {
// This method draws a mini-tiled board with no tiles missing.
-void Preview::renderTiles(const QString &file, const QString &layout) {
+void Preview::renderTiles(const TQString &file, const TQString &layout) {
m_tiles.loadTileset(file, true);
m_boardLayout.loadBoardLayout(layout);
- QPixmap *dest = m_drawFrame->getPreviewPixmap();
+ TQPixmap *dest = m_drawFrame->getPreviewPixmap();
int xOffset = m_tiles.width()/2;
int yOffset = m_tiles.height()/2;
short tile = 0;
@@ -332,7 +332,7 @@ void Preview::renderTiles(const QString &file, const QString &layout) {
if (m_boardLayout.getBoardData(z, y, x) != '1') {
continue;
}
- QPixmap *t = m_tiles.unselectedPixmaps(tile);
+ TQPixmap *t = m_tiles.unselectedPixmaps(tile);
// Only one compilcation. Since we render top to bottom , left
// to right situations arise where...:
@@ -364,14 +364,14 @@ void Preview::renderTiles(const QString &file, const QString &layout) {
// this really does not belong here. It will be fixed in v1.1 onwards
void Preview::saveTheme() {
- QString tile = Prefs::tileSet();
- QString back = Prefs::background();
- QString layout = Prefs::layout();
+ TQString tile = Prefs::tileSet();
+ TQString back = Prefs::background();
+ TQString layout = Prefs::layout();
- QString with = ":";
+ TQString with = ":";
// we want to replace any path in the default store
// with a +
- QRegExp p(locate("data_dir", "/kmahjongg/pics/"));
+ TQRegExp p(locate("data_dir", "/kmahjongg/pics/"));
back.replace(p,with);
tile.replace(p,with);
@@ -394,7 +394,7 @@ void Preview::saveTheme() {
}
// Are we over writing an existin file, or was a directory selected?
- QFileInfo f( url.path() );
+ TQFileInfo f( url.path() );
if( f.isDir() )
return;
if (f.exists()) {
@@ -402,11 +402,11 @@ void Preview::saveTheme() {
int res=KMessageBox::warningContinueCancel(this,
i18n("A file with that name "
"already exists. Do you "
- "wish to overwrite it?"),QString::null,i18n("Overwrite"));
+ "wish to overwrite it?"),TQString::null,i18n("Overwrite"));
if (res != KMessageBox::Continue)
return ;
}
- FILE *outFile = fopen( QFile::encodeName(url.path()), "w" );
+ FILE *outFile = fopen( TQFile::encodeName(url.path()), "w" );
if (outFile == NULL) {
KMessageBox::sorry(this,
i18n("Could not write to file. Aborting."));
@@ -421,11 +421,11 @@ void Preview::saveTheme() {
fclose(outFile);
}
-FrameImage::FrameImage (QWidget *parent, const char *name)
- : QFrame(parent, name)
+FrameImage::FrameImage (TQWidget *parent, const char *name)
+ : TQFrame(parent, name)
{
rx = -1;
- thePixmap = new QPixmap();
+ thePixmap = new TQPixmap();
}
FrameImage::~FrameImage()
@@ -434,20 +434,20 @@ FrameImage::~FrameImage()
}
void FrameImage::setGeometry(int x, int y, int w, int h) {
- QFrame::setGeometry(x,y,w,h);
+ TQFrame::setGeometry(x,y,w,h);
thePixmap->resize(size());
}
-void FrameImage::paintEvent( QPaintEvent* pa )
+void FrameImage::paintEvent( TQPaintEvent* pa )
{
- QFrame::paintEvent(pa);
+ TQFrame::paintEvent(pa);
- QPainter p(this);
+ TQPainter p(this);
- QPen line;
+ TQPen line;
line.setStyle(DotLine);
line.setWidth(2);
line.setColor(yellow);
@@ -502,11 +502,11 @@ void FrameImage::setRect(int x,int y,int w,int h, int s, int t)
// Pass on the mouse presed event to our owner
-void FrameImage::mousePressEvent(QMouseEvent *m) {
+void FrameImage::mousePressEvent(TQMouseEvent *m) {
mousePressed(m);
}
-void FrameImage::mouseMoveEvent(QMouseEvent *e) {
+void FrameImage::mouseMoveEvent(TQMouseEvent *e) {
mouseMoved(e);
}