summaryrefslogtreecommitdiffstats
path: root/ktnef/gui/ktnefmain.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ktnef/gui/ktnefmain.cpp')
-rw-r--r--ktnef/gui/ktnefmain.cpp118
1 files changed, 59 insertions, 59 deletions
diff --git a/ktnef/gui/ktnefmain.cpp b/ktnef/gui/ktnefmain.cpp
index a31d40161..4c158a21d 100644
--- a/ktnef/gui/ktnefmain.cpp
+++ b/ktnef/gui/ktnefmain.cpp
@@ -25,16 +25,16 @@
#include "attachpropertydialog.h"
#include "messagepropertydialog.h"
-#include <qpopupmenu.h>
+#include <tqpopupmenu.h>
#include <klistview.h>
#include <klocale.h>
#include <kapplication.h>
#include <kiconloader.h>
-#include <qpixmap.h>
+#include <tqpixmap.h>
#include <kstdaccel.h>
-#include <qmessagebox.h>
+#include <tqmessagebox.h>
#include <kfiledialog.h>
-#include <qdir.h>
+#include <tqdir.h>
#include <kprocess.h>
#include <kglobal.h>
#include <kstandarddirs.h>
@@ -55,9 +55,9 @@
#include <kurldrag.h>
-#define NOT_IMPLEMENTED QMessageBox::information(this, "ktnef", "Not implemented yet", QMessageBox::Ok|QMessageBox::Default, 0)
+#define NOT_IMPLEMENTED TQMessageBox::information(this, "ktnef", "Not implemented yet", TQMessageBox::Ok|TQMessageBox::Default, 0)
-KTNEFMain::KTNEFMain(QWidget *parent, const char *name)
+KTNEFMain::KTNEFMain(TQWidget *parent, const char *name)
: KMainWindow(parent, name)
{
setupActions();
@@ -85,19 +85,19 @@ KTNEFMain::~KTNEFMain()
void KTNEFMain::setupActions()
{
// File menu
- KStdAction::open(this, SLOT(openFile()), actionCollection());
- KStdAction::quit(kapp, SLOT(quit()), actionCollection());
+ KStdAction::open(this, TQT_SLOT(openFile()), actionCollection());
+ KStdAction::quit(kapp, TQT_SLOT(quit()), actionCollection());
// Action menu
- new KAction(i18n("View"), QString("viewmag"), 0, this, SLOT(viewFile()), actionCollection(), "view_file");
- new KAction(i18n("View With..."), QString("package_applications"), 0, this, SLOT(viewFileAs()), actionCollection(), "view_file_as");
- new KAction(i18n("Extract"), 0, this, SLOT(extractFile()), actionCollection(), "extract_file");
- new KAction(i18n("Extract To..."), QString("ktnef_extract_to"), 0, this, SLOT(extractFileTo()), actionCollection(), "extract_file_to");
- new KAction(i18n("Extract All To..."), QString("ktnef_extract_all_to"), 0, this, SLOT(extractAllFiles()), actionCollection(), "extract_all_files");
- new KAction( i18n( "Message Properties" ), "help", 0, this, SLOT( slotShowMessageProperties() ), actionCollection(), "msg_properties" );
- new KAction(i18n("Properties"), QString("contents"), 0, this, SLOT(propertiesFile()), actionCollection(), "properties_file");
- new KAction( i18n( "Show Message Text" ), "mail_generic", 0, this, SLOT( slotShowMessageText() ), actionCollection(), "msg_text" );
- new KAction( i18n( "Save Message Text As..." ), "filesave", 0, this, SLOT( slotSaveMessageText() ), actionCollection(), "msg_save" );
+ new KAction(i18n("View"), TQString("viewmag"), 0, this, TQT_SLOT(viewFile()), actionCollection(), "view_file");
+ new KAction(i18n("View With..."), TQString("package_applications"), 0, this, TQT_SLOT(viewFileAs()), actionCollection(), "view_file_as");
+ new KAction(i18n("Extract"), 0, this, TQT_SLOT(extractFile()), actionCollection(), "extract_file");
+ new KAction(i18n("Extract To..."), TQString("ktnef_extract_to"), 0, this, TQT_SLOT(extractFileTo()), actionCollection(), "extract_file_to");
+ new KAction(i18n("Extract All To..."), TQString("ktnef_extract_all_to"), 0, this, TQT_SLOT(extractAllFiles()), actionCollection(), "extract_all_files");
+ new KAction( i18n( "Message Properties" ), "help", 0, this, TQT_SLOT( slotShowMessageProperties() ), actionCollection(), "msg_properties" );
+ new KAction(i18n("Properties"), TQString("contents"), 0, this, TQT_SLOT(propertiesFile()), actionCollection(), "properties_file");
+ new KAction( i18n( "Show Message Text" ), "mail_generic", 0, this, TQT_SLOT( slotShowMessageText() ), actionCollection(), "msg_text" );
+ new KAction( i18n( "Save Message Text As..." ), "filesave", 0, this, TQT_SLOT( slotSaveMessageText() ), actionCollection(), "msg_save" );
actionCollection()->action("view_file")->setEnabled(false);
actionCollection()->action("view_file_as")->setEnabled(false);
actionCollection()->action("extract_file")->setEnabled(false);
@@ -106,12 +106,12 @@ void KTNEFMain::setupActions()
actionCollection()->action("properties_file")->setEnabled(false);
// Option menu
- new KAction(i18n("Default Folder..."), QString("folder_open"), 0, this, SLOT(optionDefaultDir()), actionCollection(), "options_default_dir");
+ new KAction(i18n("Default Folder..."), TQString("folder_open"), 0, this, TQT_SLOT(optionDefaultDir()), actionCollection(), "options_default_dir");
createStandardStatusBarAction();
setStandardToolBarMenuEnabled(true);
- KStdAction::configureToolbars(this, SLOT(slotEditToolbars()), actionCollection());
- KStdAction::keyBindings( this, SLOT( slotConfigureKeys() ), actionCollection() );
+ KStdAction::configureToolbars(this, TQT_SLOT(slotEditToolbars()), actionCollection());
+ KStdAction::keyBindings( this, TQT_SLOT( slotConfigureKeys() ), actionCollection() );
createGUI();
}
@@ -135,25 +135,25 @@ void KTNEFMain::setupTNEF()
parser_ = new KTNEFParser;
setCentralWidget(view_);
- connect(view_, SIGNAL(selectionChanged()), SLOT(viewSelectionChanged()));
- connect(view_, SIGNAL(rightButtonPressed(QListViewItem*,const QPoint&,int)), SLOT(viewRightButtonPressed(QListViewItem*,const QPoint&,int)));
- connect(view_, SIGNAL(doubleClicked(QListViewItem*)), SLOT(viewDoubleClicked(QListViewItem*)));
- connect(view_, SIGNAL(dragRequested(const QValueList<KTNEFAttach*>&)), SLOT(viewDragRequested(const QValueList<KTNEFAttach*>&)));
+ connect(view_, TQT_SIGNAL(selectionChanged()), TQT_SLOT(viewSelectionChanged()));
+ connect(view_, TQT_SIGNAL(rightButtonPressed(TQListViewItem*,const TQPoint&,int)), TQT_SLOT(viewRightButtonPressed(TQListViewItem*,const TQPoint&,int)));
+ connect(view_, TQT_SIGNAL(doubleClicked(TQListViewItem*)), TQT_SLOT(viewDoubleClicked(TQListViewItem*)));
+ connect(view_, TQT_SIGNAL(dragRequested(const TQValueList<KTNEFAttach*>&)), TQT_SLOT(viewDragRequested(const TQValueList<KTNEFAttach*>&)));
}
-void KTNEFMain::loadFile(const QString& filename)
+void KTNEFMain::loadFile(const TQString& filename)
{
filename_ = filename;
setCaption(filename_);
if (!parser_->openFile(filename))
{
- QMessageBox::critical(this, i18n("Error"), i18n("Unable to open file."), QMessageBox::Ok|QMessageBox::Default, 0);
+ TQMessageBox::critical(this, i18n("Error"), i18n("Unable to open file."), TQMessageBox::Ok|TQMessageBox::Default, 0);
view_->setAttachments(0);
enableExtractAll(false);
}
else
{
- QPtrList<KTNEFAttach> list = parser_->message()->attachmentList();
+ TQPtrList<KTNEFAttach> list = parser_->message()->attachmentList();
QString msg;
msg = i18n( "%n attachment found", "%n attachments found", list.count() );
statusBar()->changeItem(msg, 0);
@@ -187,7 +187,7 @@ void KTNEFMain::viewFile()
KRun::runURL(url, mimename);
}
-QString KTNEFMain::extractTemp(KTNEFAttach *att)
+TQString KTNEFMain::extractTemp(KTNEFAttach *att)
{
QString dir = KGlobal::dirs()->localkdedir() + "/share/apps/ktnef/tmp/";
parser_->extractFileTo(att->name(), dir);
@@ -225,13 +225,13 @@ void KTNEFMain::extractAllFiles()
{
lastdir_ = dir;
dir.append("/");
- QPtrList<KTNEFAttach> list = parser_->message()->attachmentList();
- QPtrListIterator<KTNEFAttach> it(list);
+ TQPtrList<KTNEFAttach> list = parser_->message()->attachmentList();
+ TQPtrListIterator<KTNEFAttach> it(list);
for (;it.current();++it)
if (!parser_->extractFileTo(it.current()->name(), dir))
{
QString msg = i18n( "Unable to extract file \"%1\"" ).arg( it.current()->name() );
- QMessageBox::critical(this,i18n("Error"),msg,QMessageBox::Ok|QMessageBox::Default,0);
+ TQMessageBox::critical(this,i18n("Error"),msg,TQMessageBox::Ok|TQMessageBox::Default,0);
return;
}
}
@@ -258,7 +258,7 @@ void KTNEFMain::optionDefaultDir()
void KTNEFMain::viewSelectionChanged()
{
- QPtrList<KTNEFAttach> *list = view_->getSelection();
+ TQPtrList<KTNEFAttach> *list = view_->getSelection();
bool on1 = (list->count() == 1u), on2 = (list->count() > 0u);
actionCollection()->action("view_file")->setEnabled(on1);
actionCollection()->action("view_file_as")->setEnabled(on1);
@@ -286,51 +286,51 @@ void KTNEFMain::enableSingleAction(bool on)
void KTNEFMain::cleanup()
{
QDir d(KGlobal::dirs()->localkdedir() + "/share/apps/ktnef/tmp/");
- const QFileInfoList *list = d.entryInfoList(QDir::Files|QDir::Hidden,QDir::Unsorted);
+ const QFileInfoList *list = d.entryInfoList(TQDir::Files|TQDir::Hidden,TQDir::Unsorted);
QFileInfoListIterator it(*list);
for (;it.current();++it)
d.remove(it.current()->absFilePath());
}
-void KTNEFMain::extractTo(const QString& dirname)
+void KTNEFMain::extractTo(const TQString& dirname)
{
QString dir = dirname;
if (dir.right(1) != "/") dir.append("/");
- QPtrList<KTNEFAttach> *list = view_->getSelection();
- QPtrListIterator<KTNEFAttach> it(*list);
+ TQPtrList<KTNEFAttach> *list = view_->getSelection();
+ TQPtrListIterator<KTNEFAttach> it(*list);
for (;it.current();++it)
if (!parser_->extractFileTo(it.current()->name(), dir))
{
QString msg = i18n("Unable to extract file \"%1\"").arg( it.current()->name() );
- QMessageBox::critical(this,i18n("Error"),msg,QMessageBox::Ok|QMessageBox::Default,0);
+ TQMessageBox::critical(this,i18n("Error"),msg,TQMessageBox::Ok|TQMessageBox::Default,0);
return;
}
}
/* This breaks the saveMainWindowSettings stuff....
- void KTNEFMain::closeEvent(QCloseEvent *e)
+ void KTNEFMain::closeEvent(TQCloseEvent *e)
{
e->accept();
}*/
-void KTNEFMain::viewRightButtonPressed(QListViewItem*, const QPoint& p, int)
+void KTNEFMain::viewRightButtonPressed(TQListViewItem*, const TQPoint& p, int)
{
- QPtrList<KTNEFAttach> *list = view_->getSelection();
- QPopupMenu m;
+ TQPtrList<KTNEFAttach> *list = view_->getSelection();
+ TQPopupMenu m;
if (list->count() > 0u)
{
if (list->count() == 1u)
{
- m.insertItem(SmallIcon("viewmag"), i18n("View"), this, SLOT(viewFile()));
- m.insertItem(SmallIcon("package_applications"), i18n("View With..."), this, SLOT(viewFileAs()));
+ m.insertItem(SmallIcon("viewmag"), i18n("View"), this, TQT_SLOT(viewFile()));
+ m.insertItem(SmallIcon("package_applications"), i18n("View With..."), this, TQT_SLOT(viewFileAs()));
m.insertSeparator();
}
- m.insertItem(i18n("Extract"), this, SLOT(extractFile()));
- m.insertItem(SmallIcon("ktnef_extract_to"), i18n("Extract To..."), this, SLOT(extractFileTo()));
+ m.insertItem(i18n("Extract"), this, TQT_SLOT(extractFile()));
+ m.insertItem(SmallIcon("ktnef_extract_to"), i18n("Extract To..."), this, TQT_SLOT(extractFileTo()));
if (list->count() == 1u)
{
m.insertSeparator();
- m.insertItem(SmallIcon("contents"), i18n("Properties"), this, SLOT(propertiesFile()));
+ m.insertItem(SmallIcon("contents"), i18n("Properties"), this, TQT_SLOT(propertiesFile()));
}
}
else if ( list->count() == 0 )
@@ -338,16 +338,16 @@ void KTNEFMain::viewRightButtonPressed(QListViewItem*, const QPoint& p, int)
m.exec( p );
}
-void KTNEFMain::viewDoubleClicked(QListViewItem *item)
+void KTNEFMain::viewDoubleClicked(TQListViewItem *item)
{
if (item && item->isSelected())
viewFile();
}
-void KTNEFMain::viewDragRequested( const QValueList<KTNEFAttach*>& list )
+void KTNEFMain::viewDragRequested( const TQValueList<KTNEFAttach*>& list )
{
KURL::List urlList;
- for ( QValueList<KTNEFAttach*>::ConstIterator it=list.constBegin(); it!=list.constEnd(); ++it )
+ for ( TQValueList<KTNEFAttach*>::ConstIterator it=list.constBegin(); it!=list.constEnd(); ++it )
urlList << KURL( extractTemp( *it ) );
if ( !list.isEmpty() )
{
@@ -358,16 +358,16 @@ void KTNEFMain::viewDragRequested( const QValueList<KTNEFAttach*>& list )
void KTNEFMain::slotEditToolbars()
{
- saveMainWindowSettings( KGlobal::config(), QString::fromLatin1("MainWindow") );
+ saveMainWindowSettings( KGlobal::config(), TQString::fromLatin1("MainWindow") );
KEditToolbar dlg(actionCollection());
- connect(&dlg, SIGNAL( newToolbarConfig() ), this, SLOT( slotNewToolbarConfig() ));
+ connect(&dlg, TQT_SIGNAL( newToolbarConfig() ), this, TQT_SLOT( slotNewToolbarConfig() ));
dlg.exec();
}
void KTNEFMain::slotNewToolbarConfig()
{
createGUI();
- applyMainWindowSettings( KGlobal::config(), QString::fromLatin1("MainWindow") );
+ applyMainWindowSettings( KGlobal::config(), TQString::fromLatin1("MainWindow") );
}
void KTNEFMain::slotShowMessageProperties()
@@ -378,7 +378,7 @@ void KTNEFMain::slotShowMessageProperties()
void KTNEFMain::slotShowMessageText()
{
- QString rtf = parser_->message()->rtfString();
+ TQString rtf = parser_->message()->rtfString();
qDebug( "%s", rtf.latin1() );
KTempFile tmpFile( KGlobal::dirs()->localkdedir() + "/share/apps/ktnef/tmp/", "rtf");
*( tmpFile.textStream() ) << rtf;
@@ -389,20 +389,20 @@ void KTNEFMain::slotShowMessageText()
void KTNEFMain::slotSaveMessageText()
{
- QString rtf = parser_->message()->rtfString();
- QString filename = KFileDialog::getSaveFileName( QString::null, QString::null, this );
+ TQString rtf = parser_->message()->rtfString();
+ TQString filename = KFileDialog::getSaveFileName( TQString::null, TQString::null, this );
if ( !filename.isEmpty() )
{
- QFile f( filename );
+ TQFile f( filename );
if ( f.open( IO_WriteOnly ) )
{
- QTextStream t( &f );
+ TQTextStream t( &f );
t << rtf;
}
else
- QMessageBox::critical( this, i18n( "Error" ),
+ TQMessageBox::critical( this, i18n( "Error" ),
i18n( "Unable to open file for writing, check file permissions." ),
- QMessageBox::Ok|QMessageBox::Default, 0);
+ TQMessageBox::Ok|TQMessageBox::Default, 0);
}
}