summaryrefslogtreecommitdiffstats
path: root/kexi/widget/utils/kexicontextmenuutils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kexi/widget/utils/kexicontextmenuutils.cpp')
-rw-r--r--kexi/widget/utils/kexicontextmenuutils.cpp102
1 files changed, 51 insertions, 51 deletions
diff --git a/kexi/widget/utils/kexicontextmenuutils.cpp b/kexi/widget/utils/kexicontextmenuutils.cpp
index 727cef6f..8c6c3ab2 100644
--- a/kexi/widget/utils/kexicontextmenuutils.cpp
+++ b/kexi/widget/utils/kexicontextmenuutils.cpp
@@ -27,10 +27,10 @@
#include <kdebug.h>
#include <kmessagebox.h>
-#include <qfiledialog.h>
-#include <qapplication.h>
+#include <tqfiledialog.h>
+#include <tqapplication.h>
-#ifdef Q_WS_WIN
+#ifdef TQ_WS_WIN
#include <win32_utils.h>
#include <krecentdirs.h>
#endif
@@ -39,8 +39,8 @@
class KexiImageContextMenu::Private
{
public:
- Private(QWidget *parent)
- : actionCollection(parent)
+ Private(TQWidget *tqparent)
+ : actionCollection(tqparent)
{
}
@@ -55,38 +55,38 @@ public:
//------------
-KexiImageContextMenu::KexiImageContextMenu(QWidget* parent)
- : KPopupMenu(parent)
+KexiImageContextMenu::KexiImageContextMenu(TQWidget* tqparent)
+ : KPopupMenu(tqparent)
, d( new Private(this) )
{
setName("KexiImageContextMenu");
- insertTitle(QString::null);
+ insertTitle(TQString());
d->insertFromFileAction = new KAction(i18n("Insert From &File..."), SmallIconSet("fileopen"), 0,
- this, SLOT(insertFromFile()), &d->actionCollection, "insert");
+ TQT_TQOBJECT(this), TQT_SLOT(insertFromFile()), &d->actionCollection, "insert");
d->insertFromFileAction->plug(this);
- d->saveAsAction = KStdAction::saveAs(this, SLOT(saveAs()), &d->actionCollection);
+ d->saveAsAction = KStdAction::saveAs(TQT_TQOBJECT(this), TQT_SLOT(saveAs()), &d->actionCollection);
// d->saveAsAction->setText(i18n("&Save &As..."));
d->saveAsAction->plug(this);
insertSeparator();
- d->cutAction = KStdAction::cut(this, SLOT(cut()), &d->actionCollection);
+ d->cutAction = KStdAction::cut(TQT_TQOBJECT(this), TQT_SLOT(cut()), &d->actionCollection);
d->cutAction->plug(this);
- d->copyAction = KStdAction::copy(this, SLOT(copy()), &d->actionCollection);
+ d->copyAction = KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(copy()), &d->actionCollection);
d->copyAction->plug(this);
- d->pasteAction = KStdAction::paste(this, SLOT(paste()), &d->actionCollection);
+ d->pasteAction = KStdAction::paste(TQT_TQOBJECT(this), TQT_SLOT(paste()), &d->actionCollection);
d->pasteAction->plug(this);
d->deleteAction = new KAction(i18n("&Clear"), SmallIconSet("editdelete"), 0,
- this, SLOT(clear()), &d->actionCollection, "delete");
+ TQT_TQOBJECT(this), TQT_SLOT(clear()), &d->actionCollection, "delete");
d->deleteAction->plug(this);
#ifdef KEXI_NO_UNFINISHED
d->propertiesAction = 0;
#else
insertSeparator();
d->propertiesAction = new KAction(i18n("Properties"), 0, 0,
- this, SLOT(showProperties()), &d->actionCollection, "properties");
+ this, TQT_SLOT(showProperties()), &d->actionCollection, "properties");
d->propertiesAction->plug(this);
#endif
- connect(this, SIGNAL(aboutToShow()), this, SLOT(updateActionsAvailability()));
+ connect(this, TQT_SIGNAL(aboutToShow()), this, TQT_SLOT(updateActionsAvailability()));
}
KexiImageContextMenu::~KexiImageContextMenu()
@@ -96,12 +96,12 @@ KexiImageContextMenu::~KexiImageContextMenu()
void KexiImageContextMenu::insertFromFile()
{
-// QWidget *focusWidget = qApp->focusWidget();
-#ifdef Q_WS_WIN
- QString recentDir;
- QString fileName = QFileDialog::getOpenFileName(
+// TQWidget *tqfocusWidget = tqApp->tqfocusWidget();
+#ifdef TQ_WS_WIN
+ TQString recentDir;
+ TQString fileName = TQFileDialog::getOpenFileName(
KFileDialog::getStartURL(":LastVisitedImagePath", recentDir).path(),
- convertKFileDialogFilterToQFileDialogFilter(KImageIO::pattern(KImageIO::Reading)),
+ convertKFileDialogFilterToTQFileDialogFilter(KImageIO::pattern(KImageIO::Reading)),
this, 0, i18n("Insert Image From File"));
KURL url;
if (!fileName.isEmpty())
@@ -109,22 +109,22 @@ void KexiImageContextMenu::insertFromFile()
#else
KURL url( KFileDialog::getImageOpenURL(
":LastVisitedImagePath", this, i18n("Insert Image From File")) );
-// QString fileName = url.isLocalFile() ? url.path() : url.prettyURL();
+// TQString fileName = url.isLocalFile() ? url.path() : url.prettyURL();
//! @todo download the file if remote, then set fileName properly
#endif
if (!url.isValid()) {
//focus the app again because to avoid annoying the user with unfocused main window
- if (qApp->mainWidget()) {
- //focusWidget->raise();
- //focusWidget->setFocus();
- qApp->mainWidget()->raise();
+ if (tqApp->mainWidget()) {
+ //tqfocusWidget->raise();
+ //tqfocusWidget->setFocus();
+ tqApp->mainWidget()->raise();
}
return;
}
kexipluginsdbg << "fname=" << url.prettyURL() << endl;
-#ifdef Q_WS_WIN
+#ifdef TQ_WS_WIN
//save last visited path
// KURL url(fileName);
if (url.isLocalFile())
@@ -132,16 +132,16 @@ void KexiImageContextMenu::insertFromFile()
#endif
emit insertFromFileRequested(url);
- if (qApp->mainWidget()) {
-// focusWidget->raise();
-// focusWidget->setFocus();
- qApp->mainWidget()->raise();
+ if (tqApp->mainWidget()) {
+// tqfocusWidget->raise();
+// tqfocusWidget->setFocus();
+ tqApp->mainWidget()->raise();
}
}
void KexiImageContextMenu::saveAs()
{
- QString origFilename, fileExtension;
+ TQString origFilename, fileExtension;
bool dataIsEmpty = false;
emit aboutToSaveAsRequested(origFilename, fileExtension, dataIsEmpty);
@@ -150,44 +150,44 @@ void KexiImageContextMenu::saveAs()
return;
}
if (!origFilename.isEmpty())
- origFilename = QString("/") + origFilename;
+ origFilename = TQString("/") + origFilename;
if (fileExtension.isEmpty()) {
// PNG data is the default
fileExtension = "png";
}
-#ifdef Q_WS_WIN
- QString recentDir;
- QString fileName = QFileDialog::getSaveFileName(
+#ifdef TQ_WS_WIN
+ TQString recentDir;
+ TQString fileName = TQFileDialog::getSaveFileName(
KFileDialog::getStartURL(":LastVisitedImagePath", recentDir).path() + origFilename,
- convertKFileDialogFilterToQFileDialogFilter(KImageIO::pattern(KImageIO::Writing)),
+ convertKFileDialogFilterToTQFileDialogFilter(KImageIO::pattern(KImageIO::Writing)),
this, 0, i18n("Save Image to File"));
#else
//! @todo add originalFileName! (requires access to KRecentDirs)
- QString fileName = KFileDialog::getSaveFileName(
+ TQString fileName = KFileDialog::getSaveFileName(
":LastVisitedImagePath", KImageIO::pattern(KImageIO::Writing), this, i18n("Save Image to File"));
#endif
if (fileName.isEmpty())
return;
- if (QFileInfo(fileName).extension().isEmpty())
- fileName += (QString(".")+fileExtension);
+ if (TQFileInfo(fileName).extension().isEmpty())
+ fileName += (TQString(".")+fileExtension);
kdDebug() << fileName << endl;
KURL url;
url.setPath( fileName );
-#ifdef Q_WS_WIN
+#ifdef TQ_WS_WIN
//save last visited path
if (url.isLocalFile())
KRecentDirs::add(":LastVisitedImagePath", url.directory());
#endif
- QFile f(fileName);
+ TQFile f(fileName);
if (f.exists() && KMessageBox::Yes != KMessageBox::warningYesNo(this,
"<qt>"+i18n("File \"%1\" already exists."
"<p>Do you want to replace it with a new one?")
- .arg(QDir::convertSeparators(fileName))+"</qt>",0,
+ .tqarg(TQDir::convertSeparators(fileName))+"</qt>",0,
KGuiItem(i18n("&Replace")), KGuiItem(i18n("&Don't Replace"))))
{
return;
@@ -244,7 +244,7 @@ KActionCollection* KexiImageContextMenu::actionCollection() const
}
//static
-bool KexiImageContextMenu::updateTitle(QPopupMenu *menu, const QString& title, const QString& iconName)
+bool KexiImageContextMenu::updateTitle(TQPopupMenu *menu, const TQString& title, const TQString& iconName)
{
return KexiContextMenuUtils::updateTitle(menu, title, i18n("Image"), iconName);
}
@@ -252,13 +252,13 @@ bool KexiImageContextMenu::updateTitle(QPopupMenu *menu, const QString& title, c
// -------------------------------------------
//static
-bool KexiContextMenuUtils::updateTitle(QPopupMenu *menu, const QString& objectName,
- const QString& objectTypeName, const QString& iconName)
+bool KexiContextMenuUtils::updateTitle(TQPopupMenu *menu, const TQString& objectName,
+ const TQString& objectTypeName, const TQString& iconName)
{
if (!menu || objectName.isEmpty() || objectTypeName.isEmpty())
return false;
const int id = menu->idAt(0);
- QMenuItem *item = menu->findItem(id);
+ TQMenuItem *item = menu->tqfindItem(id);
if (!item)
return false;
KPopupTitle *title = dynamic_cast<KPopupTitle *>(item->widget());
@@ -267,14 +267,14 @@ bool KexiContextMenuUtils::updateTitle(QPopupMenu *menu, const QString& objectNa
/*! @todo look at makeFirstCharacterUpperCaseInCaptions setting [bool]
(see doc/dev/settings.txt) */
- QString realTitle( i18n("Object name : Object type", "%1 : %2")
- .arg( objectName[0].upper() + objectName.mid(1) )
- .arg( objectTypeName ));
+ TQString realTitle( i18n("Object name : Object type", "%1 : %2")
+ .tqarg( objectName[0].upper() + objectName.mid(1) )
+ .tqarg( objectTypeName ));
if (iconName.isEmpty())
title->setTitle(realTitle);
else {
- QPixmap pixmap(SmallIcon( iconName ));
+ TQPixmap pixmap(SmallIcon( iconName ));
title->setTitle(realTitle, &pixmap);
}
return true;