diff options
Diffstat (limited to 'src/modules/theme')
-rw-r--r-- | src/modules/theme/libkvitheme.cpp | 22 | ||||
-rw-r--r-- | src/modules/theme/managementdialog.cpp | 142 | ||||
-rw-r--r-- | src/modules/theme/managementdialog.h | 37 | ||||
-rw-r--r-- | src/modules/theme/packthemedialog.cpp | 210 | ||||
-rw-r--r-- | src/modules/theme/packthemedialog.h | 27 | ||||
-rw-r--r-- | src/modules/theme/savethemedialog.cpp | 142 | ||||
-rw-r--r-- | src/modules/theme/savethemedialog.h | 33 | ||||
-rw-r--r-- | src/modules/theme/themefunctions.cpp | 164 | ||||
-rw-r--r-- | src/modules/theme/themefunctions.h | 28 |
9 files changed, 404 insertions, 401 deletions
diff --git a/src/modules/theme/libkvitheme.cpp b/src/modules/theme/libkvitheme.cpp index cba1b4e8..c2b34f5b 100644 --- a/src/modules/theme/libkvitheme.cpp +++ b/src/modules/theme/libkvitheme.cpp @@ -40,9 +40,9 @@ #include "managementdialog.h" #include "themefunctions.h" -#include <qfileinfo.h> +#include <tqfileinfo.h> -QRect g_rectManagementDialogGeometry(0,0,0,0); +TQRect g_rectManagementDialogGeometry(0,0,0,0); /* @@ -61,13 +61,13 @@ QRect g_rectManagementDialogGeometry(0,0,0,0); static bool theme_kvs_cmd_install(KviKvsModuleCommandCall * c) { - QString szThemePackFile; + TQString szThemePackFile; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("package_path",KVS_PT_STRING,0,szThemePackFile) KVSM_PARAMETERS_END(c) - QString szError; + TQString szError; if(!KviThemeFunctions::installThemePackage(szThemePackFile,szError)) { c->error(__tr2qs_ctx("Error installing theme package: %Q","theme"),&szError); @@ -95,7 +95,7 @@ static bool theme_kvs_cmd_install(KviKvsModuleCommandCall * c) static bool theme_kvs_cmd_screenshot(KviKvsModuleCommandCall * c) { - QString szFileName; + TQString szFileName; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETER("file_name_path",KVS_PT_STRING,KVS_PF_OPTIONAL,szFileName) @@ -104,7 +104,7 @@ static bool theme_kvs_cmd_screenshot(KviKvsModuleCommandCall * c) KviFileUtils::adjustFilePath(szFileName); - QString szTmp; + TQString szTmp; c->enterBlockingSection(); bool bResult = KviFileDialog::askForSaveFileName(szTmp,__tr2qs_ctx("Choose a file to save the screenshot to","theme"),szFileName,"*.png"); @@ -116,10 +116,10 @@ static bool theme_kvs_cmd_screenshot(KviKvsModuleCommandCall * c) if(szFileName.isEmpty())return true; // done KviFileUtils::adjustFilePath(szFileName); - if(QFileInfo(szFileName).extension(false)!="png") + if(TQFileInfo(szFileName).extension(false)!="png") szFileName+=".png"; - QString szError; + TQString szError; if(!KviThemeFunctions::makeKVIrcScreenshot(szFileName)) { c->error(__tr2qs_ctx("Error making screenshot","theme")); // FIXME: a nicer error ? @@ -155,10 +155,10 @@ static bool theme_module_init(KviModule *m) KVSM_REGISTER_SIMPLE_COMMAND(m,"install",theme_kvs_cmd_install); KVSM_REGISTER_SIMPLE_COMMAND(m,"screenshot",theme_kvs_cmd_screenshot); - QString szBuf; + TQString szBuf; m->getDefaultConfigFileName(szBuf); KviConfig cfg(szBuf,KviConfig::Read); - g_rectManagementDialogGeometry = cfg.readRectEntry("EditorGeometry",QRect(10,10,390,440)); + g_rectManagementDialogGeometry = cfg.readRectEntry("EditorGeometry",TQRect(10,10,390,440)); return true; } @@ -167,7 +167,7 @@ static bool theme_module_cleanup(KviModule *m) { KviThemeManagementDialog::cleanup(); - QString szBuf; + TQString szBuf; m->getDefaultConfigFileName(szBuf); KviConfig cfg(szBuf,KviConfig::Write); cfg.writeEntry("EditorGeometry",g_rectManagementDialogGeometry); diff --git a/src/modules/theme/managementdialog.cpp b/src/modules/theme/managementdialog.cpp index bfd75283..7ed10db7 100644 --- a/src/modules/theme/managementdialog.cpp +++ b/src/modules/theme/managementdialog.cpp @@ -37,28 +37,28 @@ #include "kvi_msgbox.h" -#include <qlayout.h> -#include <qpushbutton.h> +#include <tqlayout.h> +#include <tqpushbutton.h> #include "kvi_tal_listbox.h" -#include <qlineedit.h> +#include <tqlineedit.h> #include <kvi_tal_textedit.h> -#include <qregexp.h> -#include <qmessagebox.h> -#include <qdir.h> -#include <qstringlist.h> -#include <qdatetime.h> -#include <qfiledialog.h> +#include <tqregexp.h> +#include <tqmessagebox.h> +#include <tqdir.h> +#include <tqstringlist.h> +#include <tqdatetime.h> +#include <tqfiledialog.h> #include "kvi_tal_popupmenu.h" -#include <qcombobox.h> -#include <qpainter.h> -#include <qtooltip.h> -#include <qimage.h> +#include <tqcombobox.h> +#include <tqpainter.h> +#include <tqtooltip.h> +#include <tqimage.h> #include <kvi_tal_textedit.h> -//#include <qmultilineedit.h> +//#include <tqmultilineedit.h> #ifdef COMPILE_USE_QT4 -#include <QCloseEvent> +#include <TQCloseEvent> #endif -#include <qbuffer.h> +#include <tqbuffer.h> #include "kvi_options.h" #include "kvi_locale.h" @@ -77,7 +77,7 @@ #include <stdlib.h> // rand & srand -extern QRect g_rectManagementDialogGeometry; +extern TQRect g_rectManagementDialogGeometry; @@ -85,7 +85,7 @@ KviThemeListBoxItem::KviThemeListBoxItem(KviTalListBox * box,KviThemeInfo * inf) : KviTalListBoxText(box) { m_pThemeInfo = inf; - QString t; + TQString t; t = "<nobr><b>"; t += inf->name(); t += "</b>"; @@ -121,14 +121,14 @@ KviThemeListBoxItem::~KviThemeListBoxItem() delete m_pText; } -void KviThemeListBoxItem::paint(QPainter * p) +void KviThemeListBoxItem::paint(TQPainter * p) { KviTalListBoxText::paint(p); - p->drawPixmap(LVI_BORDER,LVI_BORDER, *(g_pIconManager->getBigIcon(QString(KVI_BIGICON_THEME))) ); + p->drawPixmap(LVI_BORDER,LVI_BORDER, *(g_pIconManager->getBigIcon(TQString(KVI_BIGICON_THEME))) ); int afterIcon = LVI_BORDER + LVI_ICON_SIZE + LVI_SPACING; int www = p->window().width() - (afterIcon + LVI_BORDER); m_pText->setWidth(www); - m_pText->draw(p,afterIcon,LVI_BORDER,QRect(afterIcon,LVI_BORDER,www,p->window().height() - (LVI_BORDER * 2)),listBox()->viewport()->colorGroup()); + m_pText->draw(p,afterIcon,LVI_BORDER,TQRect(afterIcon,LVI_BORDER,www,p->window().height() - (LVI_BORDER * 2)),listBox()->viewport()->tqcolorGroup()); } int KviThemeListBoxItem::height(const KviTalListBox * lb) const @@ -141,8 +141,8 @@ int KviThemeListBoxItem::height(const KviTalListBox * lb) const KviThemeManagementDialog * KviThemeManagementDialog::m_pInstance = 0; -KviThemeManagementDialog::KviThemeManagementDialog(QWidget * parent) -: QDialog(parent,"theme_options_widget") +KviThemeManagementDialog::KviThemeManagementDialog(TQWidget * tqparent) +: TQDialog(tqparent,"theme_options_widget") { setCaption(__tr2qs_ctx("Manage Themes - KVIrc","theme")); setIcon(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_THEME))); @@ -151,70 +151,70 @@ KviThemeManagementDialog::KviThemeManagementDialog(QWidget * parent) m_pInstance = this; - QGridLayout * g = new QGridLayout(this,3,2,4,4); + TQGridLayout * g = new TQGridLayout(this,3,2,4,4); KviTalHBox *hb = new KviTalHBox(this); g->addMultiCellWidget(hb,0,0,0,1); KviStyledToolButton * tb; - QFrame * sep; + TQFrame * sep; tb = new KviStyledToolButton(hb); tb->setIconSet(*(g_pIconManager->getBigIcon(KVI_BIGICON_SAVE))); tb->setUsesBigPixmap(true); - QToolTip::add(tb,__tr2qs_ctx("Save Current Theme...","theme")); - connect(tb,SIGNAL(clicked()),this,SLOT(saveCurrentTheme())); + TQToolTip::add(tb,__tr2qs_ctx("Save Current Theme...","theme")); + connect(tb,TQT_SIGNAL(clicked()),this,TQT_SLOT(saveCurrentTheme())); - sep = new QFrame(hb); - sep->setFrameStyle(QFrame::VLine | QFrame::Sunken); + sep = new TQFrame(hb); + sep->setFrameStyle(TQFrame::VLine | TQFrame::Sunken); sep->setMinimumWidth(12); m_pPackThemeButton = new KviStyledToolButton(hb); m_pPackThemeButton->setIconSet(*(g_pIconManager->getBigIcon(KVI_BIGICON_PACK))); m_pPackThemeButton->setUsesBigPixmap(true); - QToolTip::add(m_pPackThemeButton,__tr2qs_ctx("Export Selected Themes to a Distributable Package","theme")); - connect(m_pPackThemeButton,SIGNAL(clicked()),this,SLOT(packTheme())); + TQToolTip::add(m_pPackThemeButton,__tr2qs_ctx("Export Selected Themes to a Distributable Package","theme")); + connect(m_pPackThemeButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(packTheme())); m_pDeleteThemeButton = new KviStyledToolButton(hb); m_pDeleteThemeButton->setIconSet(*(g_pIconManager->getBigIcon(KVI_BIGICON_REMOVE))); m_pDeleteThemeButton->setUsesBigPixmap(true); - QToolTip::add(m_pDeleteThemeButton,__tr2qs_ctx("Delete Selected Themes","theme")); - connect(m_pDeleteThemeButton,SIGNAL(clicked()),this,SLOT(deleteTheme())); + TQToolTip::add(m_pDeleteThemeButton,__tr2qs_ctx("Delete Selected Themes","theme")); + connect(m_pDeleteThemeButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(deleteTheme())); - sep = new QFrame(hb); - sep->setFrameStyle(QFrame::VLine | QFrame::Sunken); + sep = new TQFrame(hb); + sep->setFrameStyle(TQFrame::VLine | TQFrame::Sunken); sep->setMinimumWidth(12); tb = new KviStyledToolButton(hb); tb->setIconSet(*(g_pIconManager->getBigIcon(KVI_BIGICON_OPEN))); tb->setUsesBigPixmap(true); - QToolTip::add(tb,__tr2qs_ctx("Install Theme Package From Disk","theme")); - connect(tb,SIGNAL(clicked()),this,SLOT(installFromFile())); + TQToolTip::add(tb,__tr2qs_ctx("Install Theme Package From Disk","theme")); + connect(tb,TQT_SIGNAL(clicked()),this,TQT_SLOT(installFromFile())); tb = new KviStyledToolButton(hb); tb->setIconSet(*(g_pIconManager->getBigIcon(KVI_BIGICON_WWW))); tb->setUsesBigPixmap(true); - QToolTip::add(tb,__tr2qs_ctx("Get More Themes...","theme")); - connect(tb,SIGNAL(clicked()),this,SLOT(getMoreThemes())); + TQToolTip::add(tb,__tr2qs_ctx("Get More Themes...","theme")); + connect(tb,TQT_SIGNAL(clicked()),this,TQT_SLOT(getMoreThemes())); - QWidget *w= new QWidget(hb); - w->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum); + TQWidget *w= new TQWidget(hb); + w->tqsetSizePolicy(TQSizePolicy::Expanding,TQSizePolicy::Minimum); m_pListBox = new KviTalListBox(this); m_pListBox->setMinimumHeight(400); m_pListBox->setMinimumWidth(400); m_pListBox->setSelectionMode(KviTalListBox::Extended); - connect(m_pListBox,SIGNAL(doubleClicked(KviTalListBoxItem *)),this,SLOT(applyTheme(KviTalListBoxItem *))); - connect(m_pListBox,SIGNAL(contextMenuRequested(KviTalListBoxItem *,const QPoint &)), - this,SLOT(contextMenuRequested(KviTalListBoxItem *,const QPoint &))); - connect(m_pListBox,SIGNAL(selectionChanged()),this,SLOT(enableDisableButtons())); + connect(m_pListBox,TQT_SIGNAL(doubleClicked(KviTalListBoxItem *)),this,TQT_SLOT(applyTheme(KviTalListBoxItem *))); + connect(m_pListBox,TQT_SIGNAL(contextMenuRequested(KviTalListBoxItem *,const TQPoint &)), + this,TQT_SLOT(contextMenuRequested(KviTalListBoxItem *,const TQPoint &))); + connect(m_pListBox,TQT_SIGNAL(selectionChanged()),this,TQT_SLOT(enableDisableButtons())); g->addMultiCellWidget(m_pListBox,1,1,0,1); KviDynamicToolTip * tip = new KviDynamicToolTip(m_pListBox); - connect(tip,SIGNAL(tipRequest(KviDynamicToolTip *,const QPoint &)),this,SLOT(tipRequest(KviDynamicToolTip *,const QPoint &))); + connect(tip,TQT_SIGNAL(tipRequest(KviDynamicToolTip *,const TQPoint &)),this,TQT_SLOT(tipRequest(KviDynamicToolTip *,const TQPoint &))); - QPushButton * b = new QPushButton(__tr2qs("Close"),this); - connect(b,SIGNAL(clicked()),this,SLOT(closeClicked())); + TQPushButton * b = new TQPushButton(__tr2qs("Close"),this); + connect(b,TQT_SIGNAL(clicked()),this,TQT_SLOT(closeClicked())); g->addWidget(b,2,1); g->setRowStretch(1,0); @@ -235,7 +235,7 @@ KviThemeManagementDialog::KviThemeManagementDialog(QWidget * parent) KviThemeManagementDialog::~KviThemeManagementDialog() { - g_rectManagementDialogGeometry = QRect(pos().x(),pos().y(),size().width(),size().height()); + g_rectManagementDialogGeometry = TQRect(pos().x(),pos().y(),size().width(),size().height()); m_pInstance = 0; } @@ -277,14 +277,14 @@ void KviThemeManagementDialog::packTheme() } -void KviThemeManagementDialog::contextMenuRequested(KviTalListBoxItem * it,const QPoint & pos) +void KviThemeManagementDialog::contextMenuRequested(KviTalListBoxItem * it,const TQPoint & pos) { if(it) { m_pListBox->setCurrentItem(it); m_pContextPopup->clear(); - m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MINUS)),__tr2qs_ctx("&Remove Theme","theme"),this,SLOT(deleteTheme())); - m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ACCEPT)),__tr2qs_ctx("&Apply Theme","theme"),this,SLOT(applyCurrentTheme())); + m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_MINUS)),__tr2qs_ctx("&Remove Theme","theme"),this,TQT_SLOT(deleteTheme())); + m_pContextPopup->insertItem(*(g_pIconManager->getSmallIcon(KVI_SMALLICON_ACCEPT)),__tr2qs_ctx("&Apply Theme","theme"),this,TQT_SLOT(applyCurrentTheme())); m_pContextPopup->popup(pos); } } @@ -304,17 +304,17 @@ void KviThemeManagementDialog::applyCurrentTheme() __tr2qs_ctx("Do you wish to apply theme \"%Q\" (version %Q)?","theme"), &(it->themeInfo()->name()),&(it->themeInfo()->version()))) { - QString szPath = it->themeInfo()->absoluteDirectory(); + TQString szPath = it->themeInfo()->absoluteDirectory(); if(szPath.isEmpty())return; KviThemeInfo out; if(!KviTheme::load(szPath,out)) { - QString szErr = out.lastError(); - QString szMsg; - KviQString::sprintf(szMsg,__tr2qs_ctx("Failed to apply the specified theme: %Q","theme"),&szErr); - QMessageBox::critical(this,__tr2qs_ctx("Apply theme - KVIrc","theme"),szMsg, - QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); + TQString szErr = out.lastError(); + TQString szMsg; + KviTQString::sprintf(szMsg,__tr2qs_ctx("Failed to apply the specified theme: %Q","theme"),&szErr); + TQMessageBox::critical(this,__tr2qs_ctx("Apply theme - KVIrc","theme"),szMsg, + TQMessageBox::Ok,TQMessageBox::NoButton,TQMessageBox::NoButton); } } @@ -340,10 +340,10 @@ jump_out: void KviThemeManagementDialog::installFromFile() { int iThemeCount=0; - QString szFileName; - QString szError; + TQString szFileName; + TQString szError; - if(!KviFileDialog::askForOpenFileName(szFileName,__tr2qs_ctx("Open Theme - KVIrc","theme"),QString::null,"*.kvt")) + if(!KviFileDialog::askForOpenFileName(szFileName,__tr2qs_ctx("Open Theme - KVIrc","theme"),TQString(),"*.kvt")) return; if(!KviThemeFunctions::installThemePackage(szFileName,szError,this)) @@ -368,18 +368,18 @@ void KviThemeManagementDialog::saveCurrentTheme() fillThemeBox(); } -void KviThemeManagementDialog::fillThemeBox(const QString &szDir) +void KviThemeManagementDialog::fillThemeBox(const TQString &szDir) { - QDir d(szDir); + TQDir d(szDir); - QStringList sl = d.entryList(QDir::Dirs); + TQStringList sl = d.entryList(TQDir::Dirs); - for(QStringList::Iterator it = sl.begin();it != sl.end();++it) + for(TQStringList::Iterator it = sl.begin();it != sl.end();++it) { if(*it == ".")continue; if(*it == "..")continue; - QString szTest = szDir; + TQString szTest = szDir; szTest += KVI_PATH_SEPARATOR_CHAR; szTest += *it; @@ -399,7 +399,7 @@ void KviThemeManagementDialog::fillThemeBox() { m_pListBox->clear(); - QString szDir; + TQString szDir; g_pApp->getGlobalKvircDirectory(szDir,KviApp::Themes); fillThemeBox(szDir); g_pApp->getLocalKvircDirectory(szDir,KviApp::Themes); @@ -425,13 +425,13 @@ void KviThemeManagementDialog::enableDisableButtons() m_pDeleteThemeButton->setEnabled(b); } -void KviThemeManagementDialog::closeEvent(QCloseEvent * e) +void KviThemeManagementDialog::closeEvent(TQCloseEvent * e) { e->ignore(); delete this; } -void KviThemeManagementDialog::tipRequest(KviDynamicToolTip *pTip,const QPoint &pnt) +void KviThemeManagementDialog::tipRequest(KviDynamicToolTip *pTip,const TQPoint &pnt) { KviThemeListBoxItem * it = (KviThemeListBoxItem *)(m_pListBox->itemAt(pnt)); @@ -439,7 +439,7 @@ void KviThemeManagementDialog::tipRequest(KviDynamicToolTip *pTip,const QPoint & KviThemeInfo * pThemeInfo = it->themeInfo(); - QString szThemeDescription; + TQString szThemeDescription; KviThemeFunctions::getThemeHtmlDescription( szThemeDescription, @@ -455,5 +455,5 @@ void KviThemeManagementDialog::tipRequest(KviDynamicToolTip *pTip,const QPoint & 0 ); - pTip->tip(m_pListBox->itemRect(it),szThemeDescription); + pTip->tip(m_pListBox->tqitemRect(it),szThemeDescription); } diff --git a/src/modules/theme/managementdialog.h b/src/modules/theme/managementdialog.h index 52ae0f86..97e47344 100644 --- a/src/modules/theme/managementdialog.h +++ b/src/modules/theme/managementdialog.h @@ -28,28 +28,28 @@ #include "kvi_pointerlist.h" #include "kvi_theme.h" -#include <qdialog.h> +#include <tqdialog.h> #ifdef COMPILE_USE_QT4 -#include <q3simplerichtext.h> +#include <tq3simplerichtext.h> #define KviTalSimpleRichText Q3SimpleRichText #else -#include <qsimplerichtext.h> -#define KviTalSimpleRichText QSimpleRichText +#include <tqsimplerichtext.h> +#define KviTalSimpleRichText TQSimpleRichText #endif #include "kvi_tal_listbox.h" -#include <qcombobox.h> +#include <tqcombobox.h> #include "kvi_tal_popupmenu.h" -#include <qcursor.h> +#include <tqcursor.h> #include <kvi_tal_wizard.h> -class QLineEdit; +class TQLineEdit; class KviTalTextEdit; -class QPushButton; -class QLabel; -class QCheckBox; +class TQPushButton; +class TQLabel; +class TQCheckBox; -//class QMultiLineEdit; +//class TQMultiLineEdit; class KviDynamicToolTip; class KviStyledToolButton; @@ -67,15 +67,16 @@ public: KviThemeInfo * themeInfo(){ return m_pThemeInfo; }; virtual int height ( const KviTalListBox * lb ) const ; protected: - virtual void paint ( QPainter * painter ); + virtual void paint ( TQPainter * painter ); }; -class KviThemeManagementDialog : public QDialog +class KviThemeManagementDialog : public TQDialog { Q_OBJECT + TQ_OBJECT public: - KviThemeManagementDialog(QWidget * parent); + KviThemeManagementDialog(TQWidget * tqparent); virtual ~KviThemeManagementDialog(); protected: static KviThemeManagementDialog * m_pInstance; @@ -88,9 +89,9 @@ public: static void display(); static void cleanup(); protected: - void fillThemeBox(const QString &szDir); + void fillThemeBox(const TQString &szDir); bool hasSelectedItems(); - virtual void closeEvent(QCloseEvent * e); + virtual void closeEvent(TQCloseEvent * e); protected slots: void saveCurrentTheme(); void getMoreThemes(); @@ -102,8 +103,8 @@ protected slots: void applyTheme(KviTalListBoxItem *); void applyCurrentTheme(); void enableDisableButtons(); - void contextMenuRequested(KviTalListBoxItem * item, const QPoint & pos); - void tipRequest(KviDynamicToolTip *pTip,const QPoint &pnt); + void contextMenuRequested(KviTalListBoxItem * item, const TQPoint & pos); + void tipRequest(KviDynamicToolTip *pTip,const TQPoint &pnt); }; #endif //!_MANAGEMENTDIALOG_H_ diff --git a/src/modules/theme/packthemedialog.cpp b/src/modules/theme/packthemedialog.cpp index 88b248a8..de9b2333 100644 --- a/src/modules/theme/packthemedialog.cpp +++ b/src/modules/theme/packthemedialog.cpp @@ -25,26 +25,26 @@ #include "packthemedialog.h" #include "themefunctions.h" -#include <qlayout.h> -#include <qpushbutton.h> -#include <qlineedit.h> -#include <qregexp.h> -#include <qmessagebox.h> -#include <qdir.h> -#include <qcombobox.h> -#include <qpainter.h> -#include <qtooltip.h> -#include <qimage.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqlineedit.h> +#include <tqregexp.h> +#include <tqmessagebox.h> +#include <tqdir.h> +#include <tqcombobox.h> +#include <tqpainter.h> +#include <tqtooltip.h> +#include <tqimage.h> #include <kvi_tal_textedit.h> #ifdef COMPILE_USE_QT4 -#include <q3multilineedit.h> -#include <QDateTime> +#include <tq3multilineedit.h> +#include <TQDateTime> #else -#include <qmultilineedit.h> +#include <tqmultilineedit.h> #endif -#include <qbuffer.h> -#include <qlabel.h> -#include <qregexp.h> +#include <tqbuffer.h> +#include <tqlabel.h> +#include <tqregexp.h> #include "kvi_options.h" @@ -65,19 +65,19 @@ -KviPackThemeDialog::KviPackThemeDialog(QWidget * pParent,KviPointerList<KviThemeInfo> * pThemeInfoList) +KviPackThemeDialog::KviPackThemeDialog(TQWidget * pParent,KviPointerList<KviThemeInfo> * pThemeInfoList) : KviTalWizard(pParent) { m_pThemeInfoList = pThemeInfoList; KviThemeInfo * pThemeInfo; - QString szPackageName; - QString szPackageAuthor; - QString szPackageDescription; - QString szPackageVersion; + TQString szPackageName; + TQString szPackageAuthor; + TQString szPackageDescription; + TQString szPackageVersion; - m_szPackagePath = QDir::homeDirPath(); - KviQString::ensureLastCharIs(m_szPackagePath,QChar(KVI_PATH_SEPARATOR_CHAR)); + m_szPackagePath = TQDir::homeDirPath(); + KviTQString::ensureLastCharIs(m_szPackagePath,TQChar(KVI_PATH_SEPARATOR_CHAR)); bool bPackagePathSet = false; @@ -97,7 +97,7 @@ KviPackThemeDialog::KviPackThemeDialog(QWidget * pParent,KviPointerList<KviTheme szPackageVersion = pThemeInfo->version(); m_szPackagePath += pThemeInfo->subdirectory(); - if(m_szPackagePath.find(QRegExp("[0-9]\\.[0-9]")) == -1) + if(m_szPackagePath.tqfind(TQRegExp("[0-9]\\.[0-9]")) == -1) { m_szPackagePath += "-"; m_szPackagePath += szPackageVersion; @@ -122,11 +122,11 @@ KviPackThemeDialog::KviPackThemeDialog(QWidget * pParent,KviPointerList<KviTheme setMinimumSize(400,350); // welcome page ================================================================================== - QWidget * pPage = new QWidget(this); - QGridLayout * pLayout = new QGridLayout(pPage,2,1,4,4); + TQWidget * pPage = new TQWidget(this); + TQGridLayout * pLayout = new TQGridLayout(pPage,2,1,4,4); - QLabel * pLabel = new QLabel(pPage); - QString szText = "<p>"; + TQLabel * pLabel = new TQLabel(pPage); + TQString szText = "<p>"; szText += __tr2qs_ctx("This procedure allows you to export the selected themes to a single package. It is useful when you want to distribute your themes to the public.","theme"); szText += "</p><p>"; szText += __tr2qs_ctx("You will be asked to provide a package name, a description and, if you want, an icon/screenshot.","theme"); @@ -146,23 +146,23 @@ KviPackThemeDialog::KviPackThemeDialog(QWidget * pParent,KviPointerList<KviTheme // theme data name ================================================================================ - pPage = new QWidget(this); - pLayout = new QGridLayout(pPage,2,1,4,4); + pPage = new TQWidget(this); + pLayout = new TQGridLayout(pPage,2,1,4,4); - pLabel = new QLabel(pPage); + pLabel = new TQLabel(pPage); pLabel->setText(__tr2qs_ctx("This is the information list for the themes you're packaging. If it looks OK press \"Next\" to continue, otherwise press \"Cancel\" and rewiew your themes first.","theme")); - pLabel->setTextFormat(Qt::RichText); + pLabel->setTextFormat(TQt::RichText); pLayout->addWidget(pLabel,0,0); - QString szThemesDescription = "<html><body bgcolor=\"#ffffff\">"; + TQString szThemesDescription = "<html><body bgcolor=\"#ffffff\">"; int iIdx = 0; - QPixmap pixScreenshot; - QString szScreenshotPath; + TQPixmap pixScreenshot; + TQString szScreenshotPath; for(pThemeInfo = m_pThemeInfoList->first();pThemeInfo;pThemeInfo = m_pThemeInfoList->next()) { - QString szThemeDescription; + TQString szThemeDescription; if(pixScreenshot.isNull()) { @@ -194,7 +194,7 @@ KviPackThemeDialog::KviPackThemeDialog(QWidget * pParent,KviPointerList<KviTheme szThemesDescription += "</body></html>"; KviTalTextEdit * pTextEdit = new KviTalTextEdit(pPage); - pTextEdit->setPaper(QBrush(QColor(255,255,255))); + pTextEdit->setPaper(TQBrush(TQColor(255,255,255))); pTextEdit->setReadOnly(true); pTextEdit->setText(szThemesDescription); pLayout->addWidget(pTextEdit,1,0); @@ -208,31 +208,31 @@ KviPackThemeDialog::KviPackThemeDialog(QWidget * pParent,KviPointerList<KviTheme // packager informations ================================================================================ - pPage = new QWidget(this); - pLayout = new QGridLayout(pPage,5,2,4,4); + pPage = new TQWidget(this); + pLayout = new TQGridLayout(pPage,5,2,4,4); - pLabel = new QLabel(pPage); + pLabel = new TQLabel(pPage); pLabel->setText(__tr2qs_ctx("Here you need to provide informations about you (the packager) and a short description of the package you're creating.","theme")); - pLabel->setTextFormat(Qt::RichText); + pLabel->setTextFormat(TQt::RichText); pLayout->addMultiCellWidget(pLabel,0,0,0,1); - pLabel = new QLabel(pPage); + pLabel = new TQLabel(pPage); pLabel->setText(__tr2qs_ctx("Package Name:","theme")); pLayout->addWidget(pLabel,1,0); - m_pPackageNameEdit = new QLineEdit(pPage); + m_pPackageNameEdit = new TQLineEdit(pPage); m_pPackageNameEdit->setText(szPackageName); pLayout->addWidget(m_pPackageNameEdit,1,1); - pLabel = new QLabel(pPage); + pLabel = new TQLabel(pPage); pLabel->setText(__tr2qs_ctx("Version:","theme")); pLayout->addWidget(pLabel,2,0); - m_pPackageVersionEdit = new QLineEdit(pPage); + m_pPackageVersionEdit = new TQLineEdit(pPage); m_pPackageVersionEdit->setText(szPackageVersion); pLayout->addWidget(m_pPackageVersionEdit,2,1); - pLabel = new QLabel(pPage); + pLabel = new TQLabel(pPage); pLabel->setText(__tr2qs_ctx("Description:","theme")); pLayout->addWidget(pLabel,3,0); @@ -240,11 +240,11 @@ KviPackThemeDialog::KviPackThemeDialog(QWidget * pParent,KviPointerList<KviTheme m_pPackageDescriptionEdit->setText(szPackageDescription); pLayout->addWidget(m_pPackageDescriptionEdit,3,1); - pLabel = new QLabel(pPage); + pLabel = new TQLabel(pPage); pLabel->setText(__tr2qs_ctx("Package Author:","theme")); pLayout->addWidget(pLabel,4,0); - m_pPackagerNameEdit = new QLineEdit(pPage); + m_pPackagerNameEdit = new TQLineEdit(pPage); m_pPackagerNameEdit->setText(szPackageAuthor); pLayout->addWidget(m_pPackagerNameEdit,4,1); @@ -260,23 +260,23 @@ KviPackThemeDialog::KviPackThemeDialog(QWidget * pParent,KviPointerList<KviTheme // screenshot/logo/icon ================================================================================ - pPage = new QWidget(this); - pLayout = new QGridLayout(pPage,3,1,4,4); + pPage = new TQWidget(this); + pLayout = new TQGridLayout(pPage,3,1,4,4); - pLabel = new QLabel(pPage); + pLabel = new TQLabel(pPage); pLabel->setText(__tr2qs_ctx("Here you can choose the image that will appear in the installation dialog for your theme package. It can be an icon, a logo or a screenshot and it should be not larger than 300x225. If you don't provide an image a simple default icon will be used at installation stage.","theme")); - pLabel->setTextFormat(Qt::RichText); + pLabel->setTextFormat(TQt::RichText); pLayout->addWidget(pLabel,0,0); - m_pImageLabel = new QLabel(pPage); - m_pImageLabel->setFrameStyle(QFrame::Sunken | QFrame::Panel); + m_pImageLabel = new TQLabel(pPage); + m_pImageLabel->setFrameStyle(TQFrame::Sunken | TQFrame::Panel); m_pImageLabel->setMinimumSize(300,225); - m_pImageLabel->setAlignment(Qt::AlignCenter | Qt::AlignVCenter); + m_pImageLabel->tqsetAlignment(TQt::AlignCenter | TQt::AlignVCenter); pLayout->addWidget(m_pImageLabel,1,0); - QString szFilter = "*.png *.jpg *.xpm"; + TQString szFilter = "*.png *.jpg *.xpm"; m_pImageSelector = new KviFileSelector(pPage,"",&m_szImagePath,true,0,szFilter); - connect(m_pImageSelector,SIGNAL(selectionChanged(const QString &)),this,SLOT(imageSelectionChanged(const QString &))); + connect(m_pImageSelector,TQT_SIGNAL(selectionChanged(const TQString &)),this,TQT_SLOT(imageSelectionChanged(const TQString &))); pLayout->addWidget(m_pImageSelector,2,0); pLayout->setRowStretch(1,1); @@ -289,12 +289,12 @@ KviPackThemeDialog::KviPackThemeDialog(QWidget * pParent,KviPointerList<KviTheme // save file name ================================================================================ - pPage = new QWidget(this); - pLayout = new QGridLayout(pPage,4,1,4,4); + pPage = new TQWidget(this); + pLayout = new TQGridLayout(pPage,4,1,4,4); - pLabel = new QLabel(pPage); - pLabel->setText(__tr2qs_ctx("Here you must choose the file name for the theme package. It should have a *.%1 extension.","theme").arg(KVI_FILEEXTENSION_THEMEPACKAGE)); - pLabel->setTextFormat(Qt::RichText); + pLabel = new TQLabel(pPage); + pLabel->setText(__tr2qs_ctx("Here you must choose the file name for the theme package. It should have a *.%1 extension.","theme").tqarg(KVI_FILEEXTENSION_THEMEPACKAGE)); + pLabel->setTextFormat(TQt::RichText); pLayout->addWidget(pLabel,0,0); szFilter = "*."; @@ -302,9 +302,9 @@ KviPackThemeDialog::KviPackThemeDialog(QWidget * pParent,KviPointerList<KviTheme m_pPathSelector = new KviFileSelector(pPage,"",&m_szPackagePath,true,KviFileSelector::ChooseSaveFileName,szFilter); pLayout->addWidget(m_pPathSelector,1,0); - pLabel = new QLabel(pPage); + pLabel = new TQLabel(pPage); pLabel->setText(__tr2qs_ctx("Finally hit the \"Finish\" button to complete the packaging operation.","theme")); - pLabel->setTextFormat(Qt::RichText); + pLabel->setTextFormat(TQt::RichText); pLayout->addWidget(pLabel,3,0); pLayout->setRowStretch(2,1); @@ -326,17 +326,17 @@ KviPackThemeDialog::~KviPackThemeDialog() { } -void KviPackThemeDialog::imageSelectionChanged(const QString &szImagePath) +void KviPackThemeDialog::imageSelectionChanged(const TQString &szImagePath) { - QImage pix(szImagePath); + TQImage pix(szImagePath); if(!pix.isNull()) { - QPixmap out; + TQPixmap out; if(pix.width() > 300 || pix.height() > 225) #ifdef COMPILE_USE_QT4 - out.convertFromImage(pix.scaled(300,225,Qt::KeepAspectRatio,Qt::SmoothTransformation)); + out.convertFromImage(pix.scaled(300,225,TQt::KeepAspectRatio,TQt::SmoothTransformation)); #else - out.convertFromImage(pix.smoothScale(300,225,QImage::ScaleMin)); + out.convertFromImage(pix.smoothScale(300,225,TQ_ScaleMin)); #endif else out.convertFromImage(pix); @@ -344,11 +344,11 @@ void KviPackThemeDialog::imageSelectionChanged(const QString &szImagePath) return; } - QMessageBox::critical(this,__tr2qs_ctx("Export Theme - KVIrc","theme"),__tr2qs_ctx("Failed to load the selected image","theme"), - QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); + TQMessageBox::critical(this,__tr2qs_ctx("Export Theme - KVIrc","theme"),__tr2qs_ctx("Failed to load the selected image","theme"), + TQMessageBox::Ok,TQMessageBox::NoButton,TQMessageBox::NoButton); m_pImageSelector->setSelection(""); - m_pImageLabel->setPixmap(QPixmap()); + m_pImageLabel->setPixmap(TQPixmap()); } @@ -364,28 +364,28 @@ bool KviPackThemeDialog::packTheme() m_pImageSelector->commit(); m_pPathSelector->commit(); - QString szPackageAuthor = m_pPackagerNameEdit->text(); - QString szPackageName = m_pPackageNameEdit->text(); - QString szPackageDescription = m_pPackageDescriptionEdit->text(); - QString szPackageVersion = m_pPackageVersionEdit->text(); + TQString szPackageAuthor = m_pPackagerNameEdit->text(); + TQString szPackageName = m_pPackageNameEdit->text(); + TQString szPackageDescription = m_pPackageDescriptionEdit->text(); + TQString szPackageVersion = m_pPackageVersionEdit->text(); - QImage pix(m_szImagePath); - QPixmap out; + TQImage pix(m_szImagePath); + TQPixmap out; if(!pix.isNull()) { if(pix.width() > 300 || pix.height() > 225) #ifdef COMPILE_USE_QT4 - out.convertFromImage(pix.scaled(300,225,Qt::KeepAspectRatio)); + out.convertFromImage(pix.scaled(300,225,TQt::KeepAspectRatio)); #else - out.convertFromImage(pix.smoothScale(300,225,QImage::ScaleMin)); + out.convertFromImage(pix.smoothScale(300,225,TQ_ScaleMin)); #endif else out.convertFromImage(pix); } else { if(!m_szImagePath.isEmpty()) { - QMessageBox::critical(this,__tr2qs_ctx("Export Theme - KVIrc","theme"),__tr2qs_ctx("Failed to load the selected image: please fix it","theme"), - QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); + TQMessageBox::critical(this,__tr2qs_ctx("Export Theme - KVIrc","theme"),__tr2qs_ctx("Failed to load the selected image: please fix it","theme"), + TQMessageBox::Ok,TQMessageBox::NoButton,TQMessageBox::NoButton); setCurrentPage(m_pImageSelectionPage); return false; } @@ -393,7 +393,7 @@ bool KviPackThemeDialog::packTheme() KviPackageWriter f; - QString szTmp = QDateTime::currentDateTime().toString(); + TQString szTmp = TQDateTime::tqcurrentDateTime().toString(); f.addInfoField("PackageType","ThemePack"); f.addInfoField("ThemePackVersion","1"); @@ -406,11 +406,11 @@ bool KviPackThemeDialog::packTheme() if(!out.isNull()) { - QByteArray * pba = new QByteArray(); + TQByteArray * pba = new TQByteArray(); #ifdef COMPILE_USE_QT4 - QBuffer buffer(pba,0); + TQBuffer buffer(pba,0); #else - QBuffer buffer(*pba); + TQBuffer buffer(*pba); #endif buffer.open(IO_WriteOnly); out.save(&buffer,"PNG"); @@ -424,31 +424,31 @@ bool KviPackThemeDialog::packTheme() int iIdx = 0; for(KviThemeInfo * pInfo = m_pThemeInfoList->first();pInfo;pInfo = m_pThemeInfoList->next()) { - KviQString::sprintf(szTmp,"Theme%dName",iIdx); + KviTQString::sprintf(szTmp,"Theme%dName",iIdx); f.addInfoField(szTmp,pInfo->name()); - KviQString::sprintf(szTmp,"Theme%dVersion",iIdx); + KviTQString::sprintf(szTmp,"Theme%dVersion",iIdx); f.addInfoField(szTmp,pInfo->version()); - KviQString::sprintf(szTmp,"Theme%dDescription",iIdx); + KviTQString::sprintf(szTmp,"Theme%dDescription",iIdx); f.addInfoField(szTmp,pInfo->description()); - KviQString::sprintf(szTmp,"Theme%dDate",iIdx); + KviTQString::sprintf(szTmp,"Theme%dDate",iIdx); f.addInfoField(szTmp,pInfo->date()); - KviQString::sprintf(szTmp,"Theme%dSubdirectory",iIdx); + KviTQString::sprintf(szTmp,"Theme%dSubdirectory",iIdx); f.addInfoField(szTmp,pInfo->subdirectory()); - KviQString::sprintf(szTmp,"Theme%dAuthor",iIdx); + KviTQString::sprintf(szTmp,"Theme%dAuthor",iIdx); f.addInfoField(szTmp,pInfo->author()); - KviQString::sprintf(szTmp,"Theme%dApplication",iIdx); + KviTQString::sprintf(szTmp,"Theme%dApplication",iIdx); f.addInfoField(szTmp,pInfo->application()); - KviQString::sprintf(szTmp,"Theme%dThemeEngineVersion",iIdx); + KviTQString::sprintf(szTmp,"Theme%dThemeEngineVersion",iIdx); f.addInfoField(szTmp,pInfo->themeEngineVersion()); - QPixmap pixScreenshot = pInfo->smallScreenshot(); + TQPixmap pixScreenshot = pInfo->smallScreenshot(); if(!pixScreenshot.isNull()) { - KviQString::sprintf(szTmp,"Theme%dScreenshot",iIdx); - QByteArray * pba = new QByteArray(); + KviTQString::sprintf(szTmp,"Theme%dScreenshot",iIdx); + TQByteArray * pba = new TQByteArray(); #ifdef COMPILE_USE_QT4 - QBuffer bufferz(pba,0); + TQBuffer bufferz(pba,0); #else - QBuffer bufferz(*pba); + TQBuffer bufferz(*pba); #endif bufferz.open(IO_WriteOnly); pixScreenshot.save(&bufferz,"PNG"); @@ -461,8 +461,8 @@ bool KviPackThemeDialog::packTheme() szTmp = __tr2qs_ctx("Packaging failed","theme"); szTmp += ": "; szTmp += f.lastError(); - QMessageBox::critical(this,__tr2qs_ctx("Export Theme - KVIrc","theme"),szTmp, - QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); + TQMessageBox::critical(this,__tr2qs_ctx("Export Theme - KVIrc","theme"),szTmp, + TQMessageBox::Ok,TQMessageBox::NoButton,TQMessageBox::NoButton); } iIdx++; @@ -473,16 +473,16 @@ bool KviPackThemeDialog::packTheme() szTmp = __tr2qs_ctx("Packaging failed","theme"); szTmp += ": "; szTmp += f.lastError(); - QMessageBox::critical(this,__tr2qs_ctx("Export Theme - KVIrc","theme"),szTmp, - QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); + TQMessageBox::critical(this,__tr2qs_ctx("Export Theme - KVIrc","theme"),szTmp, + TQMessageBox::Ok,TQMessageBox::NoButton,TQMessageBox::NoButton); return false; } //KviPackageReader r; //r.unpack("/root/test.kvt","/root/unpacked_test_kvt"); - QMessageBox::information(this,__tr2qs_ctx("Export Theme - KVIrc","theme"),__tr2qs("Package saved succesfully"), - QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); + TQMessageBox::information(this,__tr2qs_ctx("Export Theme - KVIrc","theme"),__tr2qs("Package saved succesfully"), + TQMessageBox::Ok,TQMessageBox::NoButton,TQMessageBox::NoButton); return true; } diff --git a/src/modules/theme/packthemedialog.h b/src/modules/theme/packthemedialog.h index 7731cc30..6fab163f 100644 --- a/src/modules/theme/packthemedialog.h +++ b/src/modules/theme/packthemedialog.h @@ -28,39 +28,40 @@ #include "kvi_pointerlist.h" #include "kvi_theme.h" -#include <qdialog.h> +#include <tqdialog.h> #include <kvi_tal_wizard.h> -class QLineEdit; +class TQLineEdit; class KviTalTextEdit; -class QLabel; -class QMultiLineEdit; +class TQLabel; +class TQMultiLineEdit; class KviFileSelector; class KviPackThemeDialog : public KviTalWizard { Q_OBJECT + TQ_OBJECT public: - KviPackThemeDialog(QWidget * pParent,KviPointerList<KviThemeInfo> * pThemeInfoList); + KviPackThemeDialog(TQWidget * pParent,KviPointerList<KviThemeInfo> * pThemeInfoList); virtual ~KviPackThemeDialog(); protected: - QString m_szImagePath; + TQString m_szImagePath; KviFileSelector * m_pImageSelector; - QString m_szPackagePath; + TQString m_szPackagePath; KviFileSelector * m_pPathSelector; - QLabel * m_pImageLabel; + TQLabel * m_pImageLabel; KviPointerList<KviThemeInfo> * m_pThemeInfoList; - QLineEdit * m_pPackageNameEdit; + TQLineEdit * m_pPackageNameEdit; KviTalTextEdit * m_pPackageDescriptionEdit; - QLineEdit * m_pPackageVersionEdit; - QLineEdit * m_pPackagerNameEdit; - QWidget * m_pImageSelectionPage; + TQLineEdit * m_pPackageVersionEdit; + TQLineEdit * m_pPackagerNameEdit; + TQWidget * m_pImageSelectionPage; protected: virtual void accept(); bool packTheme(); protected slots: - void imageSelectionChanged(const QString &szImagePath); + void imageSelectionChanged(const TQString &szImagePath); }; #endif //!_PACKTHEMEDIALOG_H_ diff --git a/src/modules/theme/savethemedialog.cpp b/src/modules/theme/savethemedialog.cpp index 79319e60..fb7cee03 100644 --- a/src/modules/theme/savethemedialog.cpp +++ b/src/modules/theme/savethemedialog.cpp @@ -25,25 +25,25 @@ #include "savethemedialog.h" #include "themefunctions.h" -#include <qlayout.h> -#include <qpushbutton.h> -#include <qlineedit.h> -#include <qregexp.h> -#include <qmessagebox.h> -#include <qdir.h> -#include <qcombobox.h> -#include <qpainter.h> -#include <qtooltip.h> -#include <qimage.h> +#include <tqlayout.h> +#include <tqpushbutton.h> +#include <tqlineedit.h> +#include <tqregexp.h> +#include <tqmessagebox.h> +#include <tqdir.h> +#include <tqcombobox.h> +#include <tqpainter.h> +#include <tqtooltip.h> +#include <tqimage.h> #include <kvi_tal_textedit.h> #ifdef COMPILE_USE_QT4 -#include <q3multilineedit.h> -#include <QDateTime> +#include <tq3multilineedit.h> +#include <TQDateTime> #else -#include <qmultilineedit.h> +#include <tqmultilineedit.h> #endif -#include <qbuffer.h> -#include <qlabel.h> +#include <tqbuffer.h> +#include <tqlabel.h> #include "kvi_options.h" @@ -64,18 +64,18 @@ -KviSaveThemeDialog::KviSaveThemeDialog(QWidget * pParent) +KviSaveThemeDialog::KviSaveThemeDialog(TQWidget * pParent) : KviTalWizard(pParent) { setCaption(__tr2qs_ctx("Save Current Theme - KVIrc","theme")); setMinimumSize(400,350); // welcome page ================================================================================== - QWidget * pPage = new QWidget(this); - QGridLayout * pLayout = new QGridLayout(pPage,2,1,4,4); + TQWidget * pPage = new TQWidget(this); + TQGridLayout * pLayout = new TQGridLayout(pPage,2,1,4,4); - QLabel * pLabel = new QLabel(pPage); - QString szText = "<p>"; + TQLabel * pLabel = new TQLabel(pPage); + TQString szText = "<p>"; szText += __tr2qs_ctx("This procedure allows you to save the current theme settings to a single directory. It is useful if you want to apply other themes or play with the theme settings and later come back to this theme with a single click. It will also allow you to manually modify the theme settings and later export them to a distributable package.","theme"); szText += "</p><p>"; szText += __tr2qs_ctx("You will be asked to provide a theme name, a description and, if you want, a screenshot.","theme"); @@ -95,31 +95,31 @@ KviSaveThemeDialog::KviSaveThemeDialog(QWidget * pParent) // packager informations ================================================================================ - pPage = new QWidget(this); - pLayout = new QGridLayout(pPage,5,2,4,4); + pPage = new TQWidget(this); + pLayout = new TQGridLayout(pPage,5,2,4,4); - pLabel = new QLabel(pPage); + pLabel = new TQLabel(pPage); pLabel->setText(__tr2qs_ctx("Here you need to provide informations about you (the author) and a short description of the theme you're creating.","theme")); - pLabel->setTextFormat(Qt::RichText); + pLabel->setTextFormat(TQt::RichText); pLayout->addMultiCellWidget(pLabel,0,0,0,1); - pLabel = new QLabel(pPage); + pLabel = new TQLabel(pPage); pLabel->setText(__tr2qs_ctx("Theme Name:","theme")); pLayout->addWidget(pLabel,1,0); - m_pThemeNameEdit = new QLineEdit(pPage); + m_pThemeNameEdit = new TQLineEdit(pPage); //m_pThemeNameEdit->setText(szThemeName); pLayout->addWidget(m_pThemeNameEdit,1,1); - pLabel = new QLabel(pPage); + pLabel = new TQLabel(pPage); pLabel->setText(__tr2qs_ctx("Version:","theme")); pLayout->addWidget(pLabel,2,0); - m_pThemeVersionEdit = new QLineEdit(pPage); + m_pThemeVersionEdit = new TQLineEdit(pPage); //m_pThemeVersionEdit->setText(szThemeVersion); pLayout->addWidget(m_pThemeVersionEdit,2,1); - pLabel = new QLabel(pPage); + pLabel = new TQLabel(pPage); pLabel->setText(__tr2qs_ctx("Description:","theme")); pLayout->addWidget(pLabel,3,0); @@ -127,11 +127,11 @@ KviSaveThemeDialog::KviSaveThemeDialog(QWidget * pParent) //m_pThemeDescriptionEdit->setText(szThemeDescription); pLayout->addWidget(m_pThemeDescriptionEdit,3,1); - pLabel = new QLabel(pPage); + pLabel = new TQLabel(pPage); pLabel->setText(__tr2qs_ctx("Theme Author:","theme")); pLayout->addWidget(pLabel,4,0); - m_pAuthorNameEdit = new QLineEdit(pPage); + m_pAuthorNameEdit = new TQLineEdit(pPage); //m_pAuthorNameEdit->setText(szThemeAuthor); pLayout->addWidget(m_pAuthorNameEdit,4,1); @@ -147,28 +147,28 @@ KviSaveThemeDialog::KviSaveThemeDialog(QWidget * pParent) // screenshot/logo/icon ================================================================================ - pPage = new QWidget(this); - pLayout = new QGridLayout(pPage,4,1,4,4); + pPage = new TQWidget(this); + pLayout = new TQGridLayout(pPage,4,1,4,4); - pLabel = new QLabel(pPage); + pLabel = new TQLabel(pPage); pLabel->setText(__tr2qs_ctx("Here you can either choose a screenshot image from disk or make one now. The screenshot will be displayed in the tooltips of the theme management dialog and will be also visible in the package installation dialog if you will export the theme to a distributable package.","theme")); - pLabel->setTextFormat(Qt::RichText); + pLabel->setTextFormat(TQt::RichText); pLayout->addWidget(pLabel,0,0); - m_pImageLabel = new QLabel(pPage); - m_pImageLabel->setFrameStyle(QFrame::Sunken | QFrame::Panel); + m_pImageLabel = new TQLabel(pPage); + m_pImageLabel->setFrameStyle(TQFrame::Sunken | TQFrame::Panel); m_pImageLabel->setMinimumSize(300,225); - m_pImageLabel->setAlignment(Qt::AlignCenter | Qt::AlignVCenter); + m_pImageLabel->tqsetAlignment(TQt::AlignCenter | TQt::AlignVCenter); pLayout->addWidget(m_pImageLabel,1,0); - QString szFilter = "*.png *.jpg *.xpm"; + TQString szFilter = "*.png *.jpg *.xpm"; m_pImageSelector = new KviFileSelector(pPage,"",&m_szScreenshotPath,true,0,szFilter); - connect(m_pImageSelector,SIGNAL(selectionChanged(const QString &)),this,SLOT(imageSelectionChanged(const QString &))); + connect(m_pImageSelector,TQT_SIGNAL(selectionChanged(const TQString &)),this,TQT_SLOT(imageSelectionChanged(const TQString &))); pLayout->addWidget(m_pImageSelector,2,0); - QPushButton * pButton = new QPushButton(pPage); + TQPushButton * pButton = new TQPushButton(pPage); pButton->setText(__tr2qs_ctx("Make Screenshot Now","theme")); - connect(pButton,SIGNAL(clicked()),this,SLOT(makeScreenshot())); + connect(pButton,TQT_SIGNAL(clicked()),this,TQT_SLOT(makeScreenshot())); pLayout->addWidget(pButton,3,0); pLayout->setRowStretch(1,1); @@ -185,17 +185,17 @@ KviSaveThemeDialog::~KviSaveThemeDialog() { } -void KviSaveThemeDialog::imageSelectionChanged(const QString &szImagePath) +void KviSaveThemeDialog::imageSelectionChanged(const TQString &szImagePath) { - QImage pix(szImagePath); + TQImage pix(szImagePath); if(!pix.isNull()) { - QPixmap out; + TQPixmap out; if(pix.width() > 300 || pix.height() > 225) #ifdef COMPILE_USE_QT4 - out.convertFromImage(pix.scaled(300,225,Qt::KeepAspectRatio)); + out.convertFromImage(pix.scaled(300,225,TQt::KeepAspectRatio)); #else - out.convertFromImage(pix.smoothScale(300,225,QImage::ScaleMin)); + out.convertFromImage(pix.smoothScale(300,225,TQ_ScaleMin)); #endif else out.convertFromImage(pix); @@ -203,11 +203,11 @@ void KviSaveThemeDialog::imageSelectionChanged(const QString &szImagePath) return; } - QMessageBox::critical(this,__tr2qs_ctx("Save Current Theme - KVIrc","theme"),__tr2qs_ctx("Failed to load the selected image","theme"), - QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); + TQMessageBox::critical(this,__tr2qs_ctx("Save Current Theme - KVIrc","theme"),__tr2qs_ctx("Failed to load the selected image","theme"), + TQMessageBox::Ok,TQMessageBox::NoButton,TQMessageBox::NoButton); m_pImageSelector->setSelection(""); - m_pImageLabel->setPixmap(QPixmap()); + m_pImageLabel->setPixmap(TQPixmap()); } @@ -220,12 +220,12 @@ void KviSaveThemeDialog::accept() void KviSaveThemeDialog::makeScreenshot() { - QString szFileName; + TQString szFileName; g_pApp->getTmpFileName(szFileName,"screenshot.png"); if(!KviThemeFunctions::makeKVIrcScreenshot(szFileName)) { - QMessageBox::critical(this,__tr2qs_ctx("Acquire Screenshot - KVIrc","theme"),__tr2qs_ctx("Failed to make screenshot","theme"), - QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); + TQMessageBox::critical(this,__tr2qs_ctx("Acquire Screenshot - KVIrc","theme"),__tr2qs_ctx("Failed to make screenshot","theme"), + TQMessageBox::Ok,TQMessageBox::NoButton,TQMessageBox::NoButton); return; } m_pImageSelector->setSelection(szFileName); @@ -240,29 +240,29 @@ bool KviSaveThemeDialog::saveTheme() sto.setName(m_pThemeNameEdit->text()); if(sto.name().isEmpty()) { - QMessageBox::critical(this,__tr2qs_ctx("Save Current Theme - KVIrc","theme"),__tr2qs_ctx("You must choose a theme name!","theme"),QMessageBox::Ok, - QMessageBox::NoButton,QMessageBox::NoButton); + TQMessageBox::critical(this,__tr2qs_ctx("Save Current Theme - KVIrc","theme"),__tr2qs_ctx("You must choose a theme name!","theme"),TQMessageBox::Ok, + TQMessageBox::NoButton,TQMessageBox::NoButton); return false; } sto.setAuthor(m_pAuthorNameEdit->text()); sto.setDescription(m_pThemeDescriptionEdit->text()); - sto.setDate(QDateTime::currentDateTime().toString()); + sto.setDate(TQDateTime::tqcurrentDateTime().toString()); sto.setVersion(m_pThemeVersionEdit->text()); sto.setApplication("KVIrc " KVI_VERSION "." KVI_SOURCES_DATE); if(sto.version().isEmpty())sto.setVersion("1.0.0"); - QString szSubdir = sto.name() + QString("-") + sto.version(); - szSubdir.replace(QRegExp("[ \\\\/:][ \\\\/:]*"),"_"); + TQString szSubdir = sto.name() + TQString("-") + sto.version(); + szSubdir.tqreplace(TQRegExp("[ \\\\/:][ \\\\/:]*"),"_"); sto.setSubdirectory(szSubdir); - QString szAbsDir; + TQString szAbsDir; g_pApp->getLocalKvircDirectory(szAbsDir,KviApp::Themes,sto.subdirectory(),true); if(!KviFileUtils::makeDir(szAbsDir)) { - QMessageBox::critical(this,__tr2qs_ctx("Save Current Theme - KVIrc","theme"),__tr2qs_ctx("Unable to create theme directory.","theme"), - QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); + TQMessageBox::critical(this,__tr2qs_ctx("Save Current Theme - KVIrc","theme"),__tr2qs_ctx("Unable to create theme directory.","theme"), + TQMessageBox::Ok,TQMessageBox::NoButton,TQMessageBox::NoButton); return false; } @@ -270,11 +270,11 @@ bool KviSaveThemeDialog::saveTheme() if(!KviTheme::save(sto)) { - QString szMsg2; - QString szErr = sto.lastError(); - KviQString::sprintf(szMsg2,__tr2qs_ctx("Unable to save theme: %Q","theme"),&szErr); - QMessageBox::critical(this,__tr2qs_ctx("Save Current Theme - KVIrc","theme"),szMsg2, - QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); + TQString szMsg2; + TQString szErr = sto.lastError(); + KviTQString::sprintf(szMsg2,__tr2qs_ctx("Unable to save theme: %Q","theme"),&szErr); + TQMessageBox::critical(this,__tr2qs_ctx("Save Current Theme - KVIrc","theme"),szMsg2, + TQMessageBox::Ok,TQMessageBox::NoButton,TQMessageBox::NoButton); return false; } // write down the screenshot, if needed @@ -283,18 +283,18 @@ bool KviSaveThemeDialog::saveTheme() { if(!KviTheme::saveScreenshots(sto,m_szScreenshotPath)) { - QMessageBox::critical(this,__tr2qs_ctx("Save Current Theme - KVIrc","theme"),__tr2qs_ctx("Failed to load the selected screenshot image: please fix it","theme"), - QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); + TQMessageBox::critical(this,__tr2qs_ctx("Save Current Theme - KVIrc","theme"),__tr2qs_ctx("Failed to load the selected screenshot image: please fix it","theme"), + TQMessageBox::Ok,TQMessageBox::NoButton,TQMessageBox::NoButton); setCurrentPage(m_pImageSelectionPage); return false; } } - QString szMsg = __tr2qs_ctx("Theme saved successfully to ","theme"); + TQString szMsg = __tr2qs_ctx("Theme saved successfully to ","theme"); szMsg += sto.absoluteDirectory(); - QMessageBox::information(this,__tr2qs_ctx("Save Theme - KVIrc","theme"),szMsg,QMessageBox::Ok, - QMessageBox::NoButton,QMessageBox::NoButton); + TQMessageBox::information(this,__tr2qs_ctx("Save Theme - KVIrc","theme"),szMsg,TQMessageBox::Ok, + TQMessageBox::NoButton,TQMessageBox::NoButton); return true; } diff --git a/src/modules/theme/savethemedialog.h b/src/modules/theme/savethemedialog.h index df55ee92..b8723aa7 100644 --- a/src/modules/theme/savethemedialog.h +++ b/src/modules/theme/savethemedialog.h @@ -28,42 +28,43 @@ #include "kvi_pointerlist.h" #include "kvi_theme.h" -#include <qdialog.h> +#include <tqdialog.h> #include <kvi_tal_wizard.h> -class QLineEdit; +class TQLineEdit; class KviTalTextEdit; -class QPushButton; -class QCheckBox; -class QLabel; -class QMultiLineEdit; +class TQPushButton; +class TQCheckBox; +class TQLabel; +class TQMultiLineEdit; class KviFileSelector; class KviSaveThemeDialog : public KviTalWizard { Q_OBJECT + TQ_OBJECT public: - KviSaveThemeDialog(QWidget * pParent); + KviSaveThemeDialog(TQWidget * pParent); virtual ~KviSaveThemeDialog(); protected: - QString m_szScreenshotPath; + TQString m_szScreenshotPath; KviFileSelector * m_pImageSelector; - QLabel * m_pImageLabel; - QLineEdit * m_pThemeNameEdit; + TQLabel * m_pImageLabel; + TQLineEdit * m_pThemeNameEdit; KviTalTextEdit * m_pThemeDescriptionEdit; - QLineEdit * m_pThemeVersionEdit; - QLineEdit * m_pAuthorNameEdit; - QWidget * m_pImageSelectionPage; - QPushButton * m_pOkButton; + TQLineEdit * m_pThemeVersionEdit; + TQLineEdit * m_pAuthorNameEdit; + TQWidget * m_pImageSelectionPage; + TQPushButton * m_pOkButton; protected: virtual void accept(); bool saveTheme(); protected slots: void makeScreenshot(); - void imageSelectionChanged(const QString &szImagePath); - //void themeNameChanged(const QString &txt); + void imageSelectionChanged(const TQString &szImagePath); + //void themeNameChanged(const TQString &txt); }; diff --git a/src/modules/theme/themefunctions.cpp b/src/modules/theme/themefunctions.cpp index 0a011956..c215d943 100644 --- a/src/modules/theme/themefunctions.cpp +++ b/src/modules/theme/themefunctions.cpp @@ -36,28 +36,28 @@ #include "kvi_frame.h" #ifdef COMPILE_USE_QT4 #define KviTalMimeSourceFactory Q3MimeSourceFactory -#include <q3mimefactory.h> +#include <tq3mimefactory.h> #else -#define KviTalMimeSourceFactory QMimeSourceFactory +#define KviTalMimeSourceFactory TQMimeSourceFactory #endif -#include <qmime.h> +#include <tqmime.h> namespace KviThemeFunctions { - static bool notAValidThemePackage(QString &szError) + static bool notAValidThemePackage(TQString &szError) { - KviQString::sprintf(szError,__tr2qs_ctx("The selected file does not seem to be a valid KVIrc theme package","theme")); + KviTQString::sprintf(szError,__tr2qs_ctx("The selected file does not seem to be a valid KVIrc theme package","theme")); return false; } - bool installThemePackage(const QString &szThemePackageFileName,QString &szError,QWidget * pDialogParent) + bool installThemePackage(const TQString &szThemePackageFileName,TQString &szError,TQWidget * pDialogParent) { - KviPointerHashTable<QString,QString> * pInfoFields; - QString * pValue; + KviPointerHashTable<TQString,TQString> * pInfoFields; + TQString * pValue; bool bInstall; - QPixmap pix; - QByteArray * pByteArray; + TQPixmap pix; + TQByteArray * pByteArray; KviHtmlDialogData hd; const char * check_fields[] = { "Name", "Version", "Author", "Description", "Date", "Application" }; @@ -66,28 +66,28 @@ namespace KviThemeFunctions KviPackageReader r; if(!r.readHeader(szThemePackageFileName)) { - QString szErr = r.lastError(); - KviQString::sprintf(szError,__tr2qs_ctx("The selected file does not seem to be a valid KVIrc package: %Q","theme"),&szErr); + TQString szErr = r.lastError(); + KviTQString::sprintf(szError,__tr2qs_ctx("The selected file does not seem to be a valid KVIrc package: %Q","theme"),&szErr); return false; } pInfoFields = r.stringInfoFields(); - pValue = pInfoFields->find("PackageType"); + pValue = pInfoFields->tqfind("PackageType"); if(!pValue)return notAValidThemePackage(szError); - if(!KviQString::equalCI(*pValue,"ThemePack"))return notAValidThemePackage(szError); - pValue = pInfoFields->find("ThemePackVersion"); + if(!KviTQString::equalCI(*pValue,"ThemePack"))return notAValidThemePackage(szError); + pValue = pInfoFields->tqfind("ThemePackVersion"); if(!pValue)return notAValidThemePackage(szError); - if(!KviQString::equalCI(*pValue,"1"))return notAValidThemePackage(szError); + if(!KviTQString::equalCI(*pValue,"1"))return notAValidThemePackage(szError); // make sure the default fields exist for(int i=0;i<6;i++) { - pValue = pInfoFields->find(check_fields[i]); + pValue = pInfoFields->tqfind(check_fields[i]); if(!pValue)return notAValidThemePackage(szError); } - pValue = pInfoFields->find("ThemeCount"); + pValue = pInfoFields->tqfind("ThemeCount"); if(!pValue)return notAValidThemePackage(szError); bool bOk; int iThemeCount = pValue->toInt(&bOk); @@ -97,7 +97,7 @@ namespace KviThemeFunctions // ok.. it should be really valid at this point // load its picture - pByteArray = r.binaryInfoFields()->find("Image"); + pByteArray = r.binaryInfoFields()->tqfind("Image"); if(pByteArray) pix.loadFromData(*pByteArray,0,0); @@ -107,17 +107,17 @@ namespace KviThemeFunctions pix = *(g_pIconManager->getBigIcon(KVI_BIGICON_THEME)); } - QString szPackageName; - QString szPackageVersion; - QString szPackageAuthor; - QString szPackageDescription; - QString szPackageDate; - QString szPackageThemeEngineVersion; - QString szPackageApplication; + TQString szPackageName; + TQString szPackageVersion; + TQString szPackageAuthor; + TQString szPackageDescription; + TQString szPackageDate; + TQString szPackageThemeEngineVersion; + TQString szPackageApplication; - QString szAuthor = __tr2qs_ctx("Author","theme"); - QString szCreatedAt = __tr2qs_ctx("Created at","theme"); - QString szCreatedOn = __tr2qs_ctx("Created with","theme"); + TQString szAuthor = __tr2qs_ctx("Author","theme"); + TQString szCreatedAt = __tr2qs_ctx("Created at","theme"); + TQString szCreatedOn = __tr2qs_ctx("Created with","theme"); r.getStringInfoField("Name",szPackageName); r.getStringInfoField("Version",szPackageVersion); @@ -126,9 +126,9 @@ namespace KviThemeFunctions r.getStringInfoField("Application",szPackageApplication); r.getStringInfoField("Date",szPackageDate); - QString szWarnings; - QString szDetails = "<html><body bgcolor=\"#ffffff\">"; - QString szTmp; + TQString szWarnings; + TQString szDetails = "<html><body bgcolor=\"#ffffff\">"; + TQString szTmp; int iIdx = 0; int iValidThemeCount = iThemeCount; @@ -137,34 +137,34 @@ namespace KviThemeFunctions { bool bValid = true; - QString szThemeName; - QString szThemeVersion; - QString szThemeDescription; - QString szThemeDate; - QString szThemeSubdirectory; - QString szThemeAuthor; - QString szThemeThemeEngineVersion; - QString szThemeApplication; - - KviQString::sprintf(szTmp,"Theme%dName",iIdx); + TQString szThemeName; + TQString szThemeVersion; + TQString szThemeDescription; + TQString szThemeDate; + TQString szThemeSubdirectory; + TQString szThemeAuthor; + TQString szThemeThemeEngineVersion; + TQString szThemeApplication; + + KviTQString::sprintf(szTmp,"Theme%dName",iIdx); r.getStringInfoField(szTmp,szThemeName); - KviQString::sprintf(szTmp,"Theme%dVersion",iIdx); + KviTQString::sprintf(szTmp,"Theme%dVersion",iIdx); r.getStringInfoField(szTmp,szThemeVersion); - KviQString::sprintf(szTmp,"Theme%dApplication",iIdx); + KviTQString::sprintf(szTmp,"Theme%dApplication",iIdx); r.getStringInfoField(szTmp,szThemeApplication); - KviQString::sprintf(szTmp,"Theme%dDescription",iIdx); + KviTQString::sprintf(szTmp,"Theme%dDescription",iIdx); r.getStringInfoField(szTmp,szThemeDescription); - KviQString::sprintf(szTmp,"Theme%dDate",iIdx); + KviTQString::sprintf(szTmp,"Theme%dDate",iIdx); r.getStringInfoField(szTmp,szThemeDate); - KviQString::sprintf(szTmp,"Theme%dSubdirectory",iIdx); + KviTQString::sprintf(szTmp,"Theme%dSubdirectory",iIdx); r.getStringInfoField(szTmp,szThemeSubdirectory); - KviQString::sprintf(szTmp,"Theme%dAuthor",iIdx); + KviTQString::sprintf(szTmp,"Theme%dAuthor",iIdx); r.getStringInfoField(szTmp,szThemeAuthor); - KviQString::sprintf(szTmp,"Theme%dThemeEngineVersion",iIdx); + KviTQString::sprintf(szTmp,"Theme%dThemeEngineVersion",iIdx); r.getStringInfoField(szTmp,szThemeThemeEngineVersion); - KviQString::sprintf(szTmp,"Theme%dScreenshot",iIdx); - QPixmap pixScreenshot; - pByteArray = r.binaryInfoFields()->find(szTmp); + KviTQString::sprintf(szTmp,"Theme%dScreenshot",iIdx); + TQPixmap pixScreenshot; + pByteArray = r.binaryInfoFields()->tqfind(szTmp); if(pByteArray) pixScreenshot.loadFromData(*pByteArray,0,0); @@ -173,7 +173,7 @@ namespace KviThemeFunctions if(KviMiscUtils::compareVersions(szThemeThemeEngineVersion,KVI_CURRENT_THEME_ENGINE_VERSION) < 0) bValid = false; - QString szDetailsBuffer; + TQString szDetailsBuffer; getThemeHtmlDescription( szDetailsBuffer, @@ -217,9 +217,9 @@ namespace KviThemeFunctions szWarnings += "</b></font></center></p>"; } - QString szShowDetails = __tr2qs_ctx("Show Details","theme"); + TQString szShowDetails = __tr2qs_ctx("Show Details","theme"); - KviQString::sprintf(hd.szHtmlText, + KviTQString::sprintf(hd.szHtmlText, "<html bgcolor=\"#ffffff\">" \ "<body bgcolor=\"#ffffff\">" \ "<p><center>" \ @@ -266,8 +266,8 @@ namespace KviThemeFunctions KviTalMimeSourceFactory::defaultFactory()->setText("theme_dialog_details",szDetails); KviTalMimeSourceFactory::defaultFactory()->setText("theme_dialog_main",hd.szHtmlText); - QString beginCenter = "<center>"; - QString endCenter = "</center>"; + TQString beginCenter = "<center>"; + TQString endCenter = "</center>"; hd.szCaption = __tr2qs_ctx("Install Theme Pack - KVIrc","theme"); hd.szUpperLabelText = beginCenter + __tr2qs_ctx("You're about to install the following theme package","theme") + endCenter; @@ -285,12 +285,12 @@ namespace KviThemeFunctions if(bInstall) { - QString szUnpackPath; + TQString szUnpackPath; g_pApp->getLocalKvircDirectory(szUnpackPath,KviApp::Themes); if(!r.unpack(szThemePackageFileName,szUnpackPath)) { - QString szErr2 = r.lastError(); - KviQString::sprintf(szError,__tr2qs_ctx("Failed to unpack the selected file: %Q","theme"),&szErr2); + TQString szErr2 = r.lastError(); + KviTQString::sprintf(szError,__tr2qs_ctx("Failed to unpack the selected file: %Q","theme"),&szErr2); return true; } } @@ -300,37 +300,37 @@ namespace KviThemeFunctions void getThemeHtmlDescription( - QString &szBuffer, - const QString &szThemeName, - const QString &szThemeVersion, - const QString &szThemeDescription, - const QString &szThemeSubdirectory, - const QString &szThemeApplication, - const QString &szThemeAuthor, - const QString &szThemeDate, - const QString &szThemeThemeEngineVersion, - const QPixmap &pixScreenshot, + TQString &szBuffer, + const TQString &szThemeName, + const TQString &szThemeVersion, + const TQString &szThemeDescription, + const TQString &szThemeSubdirectory, + const TQString &szThemeApplication, + const TQString &szThemeAuthor, + const TQString &szThemeDate, + const TQString &szThemeThemeEngineVersion, + const TQPixmap &pixScreenshot, int iUniqueIndexInDocument ) { - QString szAuthor = __tr2qs_ctx("Author","theme"); - QString szCreatedAt = __tr2qs_ctx("Created at","theme"); - QString szCreatedOn = __tr2qs_ctx("Created with","theme"); - QString szThemeEngineVersion = __tr2qs_ctx("Theme Engine Version","theme"); - QString szSubdirectory = __tr2qs_ctx("Subdirectory","theme"); + TQString szAuthor = __tr2qs_ctx("Author","theme"); + TQString szCreatedAt = __tr2qs_ctx("Created at","theme"); + TQString szCreatedOn = __tr2qs_ctx("Created with","theme"); + TQString szThemeEngineVersion = __tr2qs_ctx("Theme Engine Version","theme"); + TQString szSubdirectory = __tr2qs_ctx("Subdirectory","theme"); - QString szScreenshot; + TQString szScreenshot; if(!pixScreenshot.isNull()) { - KviQString::sprintf(szScreenshot,"<p><center><img src=\"theme_shot%d\"></center></p>",iUniqueIndexInDocument); - QString szTmp; - KviQString::sprintf(szTmp,"theme_shot%d",iUniqueIndexInDocument); + KviTQString::sprintf(szScreenshot,"<p><center><img src=\"theme_shot%d\"></center></p>",iUniqueIndexInDocument); + TQString szTmp; + KviTQString::sprintf(szTmp,"theme_shot%d",iUniqueIndexInDocument); KviTalMimeSourceFactory::defaultFactory()->setPixmap(szTmp,pixScreenshot); } else { szScreenshot = ""; } - KviQString::sprintf( + KviTQString::sprintf( szBuffer, "<p><center>" \ "<h2>%Q %Q</h2>" \ @@ -367,7 +367,7 @@ namespace KviThemeFunctions ); } - bool makeKVIrcScreenshot(const QString &szSavePngFilePath,bool bMaximizeFrame) + bool makeKVIrcScreenshot(const TQString &szSavePngFilePath,bool bMaximizeFrame) { if(bMaximizeFrame) { @@ -378,7 +378,7 @@ namespace KviThemeFunctions if(bMaximizeFrame) g_pFrame->showMaximized(); - QPixmap pix = QPixmap::grabWidget(g_pFrame); + TQPixmap pix = TQPixmap::grabWidget(g_pFrame); bool bResult = true; if(pix.isNull()) diff --git a/src/modules/theme/themefunctions.h b/src/modules/theme/themefunctions.h index 124a65f6..29cec356 100644 --- a/src/modules/theme/themefunctions.h +++ b/src/modules/theme/themefunctions.h @@ -27,26 +27,26 @@ #include "kvi_settings.h" #include "kvi_qstring.h" -#include <qwidget.h> -#include <qpixmap.h> +#include <tqwidget.h> +#include <tqpixmap.h> namespace KviThemeFunctions { - bool installThemePackage(const QString &szThemePackageFileName,QString &szError,QWidget * pDialogParent = 0); + bool installThemePackage(const TQString &szThemePackageFileName,TQString &szError,TQWidget * pDialogParent = 0); void getThemeHtmlDescription( - QString &szBuffer, - const QString &szThemeName, - const QString &szThemeVersion, - const QString &szThemeDescription, - const QString &szThemeSubdirectory, - const QString &szThemeApplication, - const QString &szThemeAuthor, - const QString &szThemeDate, - const QString &szThemeThemeEngineVersion, - const QPixmap &pixScreenshot, + TQString &szBuffer, + const TQString &szThemeName, + const TQString &szThemeVersion, + const TQString &szThemeDescription, + const TQString &szThemeSubdirectory, + const TQString &szThemeApplication, + const TQString &szThemeAuthor, + const TQString &szThemeDate, + const TQString &szThemeThemeEngineVersion, + const TQPixmap &pixScreenshot, int iUniqueIndexInDocument = 0 ); - bool makeKVIrcScreenshot(const QString &szSavePngFilePath,bool bMaximizeFrame = false); + bool makeKVIrcScreenshot(const TQString &szSavePngFilePath,bool bMaximizeFrame = false); }; |