summaryrefslogtreecommitdiffstats
path: root/korn/subjectsdlg.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:53:50 +0000
commit7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch)
tree8474f9b444b2756228600050f07a7ff25de532b2 /korn/subjectsdlg.cpp
parentf587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff)
downloadtdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz
tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'korn/subjectsdlg.cpp')
-rw-r--r--korn/subjectsdlg.cpp130
1 files changed, 65 insertions, 65 deletions
diff --git a/korn/subjectsdlg.cpp b/korn/subjectsdlg.cpp
index 9b675e0bf..f16d3a913 100644
--- a/korn/subjectsdlg.cpp
+++ b/korn/subjectsdlg.cpp
@@ -1,25 +1,25 @@
#include "subjectsdlg.h"
#include "maildrop.h"
-#include <qapplication.h>
+#include <tqapplication.h>
#include <kcursor.h>
#include <kdebug.h>
-#include <qlayout.h>
-#include <qdatetime.h>
-#include <qtimer.h>
+#include <tqlayout.h>
+#include <tqdatetime.h>
+#include <tqtimer.h>
#include "mailsubject.h"
#include <klocale.h>
-#include <qprogressdialog.h>
+#include <tqprogressdialog.h>
#include <kmessagebox.h>
#include "maildlg.h"
#include "progress_dialog.h"
-KornSubjectsDlg::SubjectListViewItem::SubjectListViewItem( QListView *parent, KornMailSubject * item)
+KornSubjectsDlg::SubjectListViewItem::SubjectListViewItem( TQListView *parent, KornMailSubject * item)
// set the column strings except column 2 (date)
: KListViewItem(parent, item->getSender(), item->getSubject(), "", KGlobal::locale()->formatNumber(item->getSize(), 0))
, _mailSubject( new KornMailSubject( *item ) )
{
// convert the date according to the user settings and show it in column 2
- QDateTime date;
+ TQDateTime date;
date.setTime_t(_mailSubject->getDate());
setText(2, KGlobal::locale()->formatDateTime(date, true, true));
}
@@ -29,12 +29,12 @@ KornSubjectsDlg::SubjectListViewItem::~SubjectListViewItem()
delete _mailSubject;
}
-int KornSubjectsDlg::SubjectListViewItem::compare( QListViewItem* item, int column, bool ascending ) const
+int KornSubjectsDlg::SubjectListViewItem::compare( TQListViewItem* item, int column, bool ascending ) const
{
if ( column == 2 )
{
// if column 2 was clicked, compare the dates.
- QDateTime d, e;
+ TQDateTime d, e;
d.setTime_t(_mailSubject->getDate());
e.setTime_t(((SubjectListViewItem *)item)->_mailSubject->getDate());
return e.secsTo( d );
@@ -53,8 +53,8 @@ int KornSubjectsDlg::SubjectListViewItem::compare( QListViewItem* item, int colu
}
}
-KornSubjectsDlg::KornSubjectsDlg( QWidget *parent )
- : KDialogBase( parent, "urldialog", true, "test", Close, Close, true), _mailDrop( new QPtrList< KMailDrop > ),
+KornSubjectsDlg::KornSubjectsDlg( TQWidget *parent )
+ : KDialogBase( parent, "urldialog", true, "test", Close, Close, true), _mailDrop( new TQPtrList< KMailDrop > ),
_subjects(0), _delete(0), mailDlg(0), _canDeleteMaildrop( true )
{
_loadSubjectsCanceled = false;
@@ -62,7 +62,7 @@ KornSubjectsDlg::KornSubjectsDlg( QWidget *parent )
// The dialog contains a list view and several buttons.
// Two box layouts hol dthem.
- QWidget * page = new QWidget( this );
+ TQWidget * page = new TQWidget( this );
setMainWidget(page);
invertSelButton = new KPushButton(i18n("&Invert Selection"), page);
clearSelButton = new KPushButton(i18n("&Remove Selection"), page);
@@ -70,8 +70,8 @@ KornSubjectsDlg::KornSubjectsDlg( QWidget *parent )
showButton = new KPushButton(i18n("&Show"), page);
deleteButton->setEnabled(false);
showButton->setEnabled(false);
- QVBoxLayout * topLayout = new QVBoxLayout( page, 0, spacingHint() );
- QHBoxLayout * buttons = new QHBoxLayout();
+ TQVBoxLayout * topLayout = new TQVBoxLayout( page, 0, spacingHint() );
+ TQHBoxLayout * buttons = new TQHBoxLayout();
_list = new KListView(page);
topLayout->addWidget(_list, 10);
topLayout->addLayout(buttons, 0);
@@ -82,7 +82,7 @@ KornSubjectsDlg::KornSubjectsDlg( QWidget *parent )
buttons->addStretch(10);
// feed the list view with its colums
- _list->setSelectionMode(QListView::Multi);
+ _list->setSelectionMode(TQListView::Multi);
_list->addColumn(i18n("From"));
_list->addColumn(i18n("Subject"));
_list->addColumn(i18n("Date"));
@@ -93,15 +93,15 @@ KornSubjectsDlg::KornSubjectsDlg( QWidget *parent )
_list->setItemMargin(3);
// connect the selection changed and double click events of the list view
- connect(_list, SIGNAL(selectionChanged()), this, SLOT(listSelectionChanged()));
- connect(_list, SIGNAL(executed(QListViewItem *)), this, SLOT(doubleClicked(QListViewItem *)));
+ connect(_list, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(listSelectionChanged()));
+ connect(_list, TQT_SIGNAL(executed(TQListViewItem *)), this, TQT_SLOT(doubleClicked(TQListViewItem *)));
// connect the buttons
- connect(invertSelButton, SIGNAL(clicked()), this, SLOT(invertSelection()));
- connect(clearSelButton, SIGNAL(clicked()), this, SLOT(removeSelection()));
- connect(showButton, SIGNAL(clicked()), this, SLOT(showMessage()));
- connect(deleteButton, SIGNAL(clicked()), this, SLOT(deleteMessage()));
- setInitialSize(QSize(QApplication::desktop()->width(), QApplication::desktop()->height()));
+ connect(invertSelButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(invertSelection()));
+ connect(clearSelButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeSelection()));
+ connect(showButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(showMessage()));
+ connect(deleteButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(deleteMessage()));
+ setInitialSize(TQSize(TQApplication::desktop()->width(), TQApplication::desktop()->height()));
}
void KornSubjectsDlg::clear()
@@ -122,7 +122,7 @@ void KornSubjectsDlg::loadMessages()
void KornSubjectsDlg::listSelectionChanged()
{
- QPtrList< QListViewItem > list( _list->selectedItems() );
+ TQPtrList< TQListViewItem > list( _list->selectedItems() );
if (!_mailDrop)
return;
@@ -147,7 +147,7 @@ void KornSubjectsDlg::listSelectionChanged()
deleteButton->setEnabled(enableDelete);
}
-void KornSubjectsDlg::doubleClicked(QListViewItem * item)
+void KornSubjectsDlg::doubleClicked(TQListViewItem * item)
{
// show the message
showMessage(item);
@@ -181,14 +181,14 @@ void KornSubjectsDlg::showMessage()
return;
// get selcted item
- QPtrList<QListViewItem> messages = _list->selectedItems();
- QListViewItem * item = messages.first();
+ TQPtrList<TQListViewItem> messages = _list->selectedItems();
+ TQListViewItem * item = messages.first();
// and show it
showMessage(item);
}
-void KornSubjectsDlg::showMessage(QListViewItem * item )
+void KornSubjectsDlg::showMessage(TQListViewItem * item )
{
if (!item)
return;
@@ -202,7 +202,7 @@ void KornSubjectsDlg::showMessage(QListViewItem * item )
mailDlg->exec();
}
-void KornSubjectsDlg::showSubjectsDlg( const QString& name )
+void KornSubjectsDlg::showSubjectsDlg( const TQString& name )
{
setCaption( i18n("Mails in Box: %1").arg( name ) );
@@ -215,7 +215,7 @@ void KornSubjectsDlg::showSubjectsDlg( const QString& name )
void KornSubjectsDlg::closeDialog( )
{
- disconnect( this, SIGNAL( finished() ), this, SLOT( closeDialog() ) );
+ disconnect( this, TQT_SIGNAL( finished() ), this, TQT_SLOT( closeDialog() ) );
}
//----------------------------
@@ -253,13 +253,13 @@ void KornSubjectsDlg::prepareStep1Subjects( KMailDrop *drop )
_subjects->progress->setProgress( 0 );
_subjects->atRechecking = true;
- connect( drop, SIGNAL( rechecked() ), this, SLOT( slotReloadRechecked() ) );
+ connect( drop, TQT_SIGNAL( rechecked() ), this, TQT_SLOT( slotReloadRechecked() ) );
drop->recheck();
}
void KornSubjectsDlg::removeStep1Subjects( KMailDrop *drop )
{
- disconnect( drop, SIGNAL( rechecked() ), this, SLOT( slotReloadRechecked() ) );
+ disconnect( drop, TQT_SIGNAL( rechecked() ), this, TQT_SLOT( slotReloadRechecked() ) );
}
void KornSubjectsDlg::prepareStep2Subjects( KMailDrop *drop )
@@ -267,11 +267,11 @@ void KornSubjectsDlg::prepareStep2Subjects( KMailDrop *drop )
_subjects->progress->setText( i18n( "Fetching messages..." ) );
_subjects->atRechecking = false;
- connect( drop, SIGNAL( readSubject( KornMailSubject* ) ), this, SLOT( subjectAvailable( KornMailSubject* ) ) );
- connect( drop, SIGNAL( readSubjectsReady( bool ) ), this, SLOT( subjectsReady( bool ) ) );
- connect( drop, SIGNAL( readSubjectsTotalSteps( int ) ), _subjects->progress, SLOT( setNumberOfSteps( int ) ) );
- connect( drop, SIGNAL( readSubjectsProgress( int ) ), _subjects->progress, SLOT( setProgress( int ) ) );
- connect( _subjects->progress, SIGNAL( cancelPressed() ), drop, SLOT( readSubjectsCanceled() ) );
+ connect( drop, TQT_SIGNAL( readSubject( KornMailSubject* ) ), this, TQT_SLOT( subjectAvailable( KornMailSubject* ) ) );
+ connect( drop, TQT_SIGNAL( readSubjectsReady( bool ) ), this, TQT_SLOT( subjectsReady( bool ) ) );
+ connect( drop, TQT_SIGNAL( readSubjectsTotalSteps( int ) ), _subjects->progress, TQT_SLOT( setNumberOfSteps( int ) ) );
+ connect( drop, TQT_SIGNAL( readSubjectsProgress( int ) ), _subjects->progress, TQT_SLOT( setProgress( int ) ) );
+ connect( _subjects->progress, TQT_SIGNAL( cancelPressed() ), drop, TQT_SLOT( readSubjectsCanceled() ) );
if( _subjects->it->current()->canReadSubjects() )
_subjects->it->current()->readSubjects( 0 );
@@ -281,11 +281,11 @@ void KornSubjectsDlg::prepareStep2Subjects( KMailDrop *drop )
void KornSubjectsDlg::removeStep2Subjects( KMailDrop *drop )
{
- disconnect( drop, SIGNAL( readSubject( KornMailSubject* ) ), this, SLOT( subjectAvailable( KornMailSubject* ) ) );
- disconnect( drop, SIGNAL( readSubjectsReady( bool ) ), this, SLOT( subjectsReady( bool ) ) );
- disconnect( drop, SIGNAL( readSubjectsTotalSteps( int ) ), _subjects->progress, SLOT( setNumberOfSteps( int ) ) );
- disconnect( drop, SIGNAL( readSubjectsProgress( int ) ), _subjects->progress, SLOT( setProgress( int ) ) );
- disconnect( _subjects->progress, SIGNAL( cancelPressed() ), drop, SLOT( readSubjectsCanceled() ) );
+ disconnect( drop, TQT_SIGNAL( readSubject( KornMailSubject* ) ), this, TQT_SLOT( subjectAvailable( KornMailSubject* ) ) );
+ disconnect( drop, TQT_SIGNAL( readSubjectsReady( bool ) ), this, TQT_SLOT( subjectsReady( bool ) ) );
+ disconnect( drop, TQT_SIGNAL( readSubjectsTotalSteps( int ) ), _subjects->progress, TQT_SLOT( setNumberOfSteps( int ) ) );
+ disconnect( drop, TQT_SIGNAL( readSubjectsProgress( int ) ), _subjects->progress, TQT_SLOT( setProgress( int ) ) );
+ disconnect( _subjects->progress, TQT_SIGNAL( cancelPressed() ), drop, TQT_SLOT( readSubjectsCanceled() ) );
}
bool KornSubjectsDlg::makeSubjectsStruct()
@@ -294,12 +294,12 @@ bool KornSubjectsDlg::makeSubjectsStruct()
return false;
_subjects = new SubjectsData;
- _subjects->it = new QPtrListIterator< KMailDrop >( *_mailDrop );
- _subjects->subjects = new QValueVector< KornMailSubject >;
+ _subjects->it = new TQPtrListIterator< KMailDrop >( *_mailDrop );
+ _subjects->subjects = new TQValueVector< KornMailSubject >;
_subjects->progress = new DoubleProgressDialog( this, "progress" );
_subjects->atRechecking = true;
- connect( _subjects->progress, SIGNAL( cancelPressed() ), this, SLOT( slotSubjectsCanceled() ) );
+ connect( _subjects->progress, TQT_SIGNAL( cancelPressed() ), this, TQT_SLOT( slotSubjectsCanceled() ) );
return true;
}
@@ -309,7 +309,7 @@ void KornSubjectsDlg::deleteSubjectsStruct()
if( !_subjects )
return;
- disconnect( _subjects->progress, SIGNAL( cancelPressed() ), this, SLOT( slotSubjectsCanceled() ) );
+ disconnect( _subjects->progress, TQT_SIGNAL( cancelPressed() ), this, TQT_SLOT( slotSubjectsCanceled() ) );
this->unsetCursor();
@@ -325,7 +325,7 @@ void KornSubjectsDlg::slotReloadRechecked()
_subjects->progress->setText( i18n( "Downloading subjects..." ) ); //Progress message when fetching messages
removeStep1Subjects( _subjects->it->current() );
- _subjects->subjects->reserve( _subjects->it->current()->count() ); //enlarge QValueVector to speed adding up.
+ _subjects->subjects->reserve( _subjects->it->current()->count() ); //enlarge TQValueVector to speed adding up.
prepareStep2Subjects( _subjects->it->current() );
}
@@ -377,7 +377,7 @@ void KornSubjectsDlg::subjectsReady( bool success )
_list->clear();
//All subjects downloaded
- for( QValueVector<KornMailSubject>::iterator it = _subjects->subjects->begin(); it != _subjects->subjects->end();
+ for( TQValueVector<KornMailSubject>::iterator it = _subjects->subjects->begin(); it != _subjects->subjects->end();
++it )
{ //Draw entry's
new SubjectListViewItem(_list, &(*it));
@@ -415,7 +415,7 @@ void KornSubjectsDlg::deleteMessage()
_delete->totalNumberOfMessages = _delete->messages->count();
}
- QString confirmation = i18n( "Do you really want to delete %n message?",
+ TQString confirmation = i18n( "Do you really want to delete %n message?",
"Do you really want to delete %n messages?", _delete->messages->count() );
if( KMessageBox::questionYesNo( this, confirmation, i18n( "Confirmation" ), KStdGuiItem::del(), KStdGuiItem::cancel() ) != KMessageBox::Yes )
@@ -436,17 +436,17 @@ void KornSubjectsDlg::deleteMessage()
void KornSubjectsDlg::makeDeleteStruct()
{
_delete = new DeleteData;
- _delete->messages = new QPtrList< KornMailSubject >;
- _delete->ids = new QPtrList< const KornMailId >;
- _delete->progress = new QProgressDialog( this, "progress" );
+ _delete->messages = new TQPtrList< KornMailSubject >;
+ _delete->ids = new TQPtrList< const KornMailId >;
+ _delete->progress = new TQProgressDialog( this, "progress" );
_delete->totalNumberOfMessages = 0;
- connect( _delete->progress, SIGNAL( canceled() ), this, SLOT( slotDeleteCanceled() ) );
+ connect( _delete->progress, TQT_SIGNAL( canceled() ), this, TQT_SLOT( slotDeleteCanceled() ) );
}
void KornSubjectsDlg::deleteDeleteStruct()
{
- disconnect( _delete->progress, SIGNAL( canceled() ), this, SLOT( slotDeleteCanceled() ) );
+ disconnect( _delete->progress, TQT_SIGNAL( canceled() ), this, TQT_SLOT( slotDeleteCanceled() ) );
delete _delete->messages;
delete _delete->ids;
@@ -456,8 +456,8 @@ void KornSubjectsDlg::deleteDeleteStruct()
void KornSubjectsDlg::fillDeleteMessageList()
{
- QListViewItem *current;
- QPtrList< QListViewItem > list( _list->selectedItems() );
+ TQListViewItem *current;
+ TQPtrList< TQListViewItem > list( _list->selectedItems() );
for( current = list.first(); current; current = list.next() )
_delete->messages->append( ( ( KornSubjectsDlg::SubjectListViewItem * ) current )->getMailSubject() );
@@ -487,24 +487,24 @@ void KornSubjectsDlg::deleteNextMessage()
{
if( _delete->messages->count() == 0 ) //No more messages to delete
{
- QTimer::singleShot( 100, this, SLOT( reloadSubjects() ) );
+ TQTimer::singleShot( 100, this, TQT_SLOT( reloadSubjects() ) );
deleteDeleteStruct();
//reloadSubjects(); //Reload all subjects again
return;
}
- _delete->ids = new QPtrList< const KornMailId >;
+ _delete->ids = new TQPtrList< const KornMailId >;
_delete->drop = _delete->messages->getFirst()->getMailDrop();
fillDeleteIdList( _delete->drop );
// Connect the progress bar signals of the mail box
- connect( _delete->drop, SIGNAL( deleteMailsTotalSteps( int ) ), _delete->progress, SLOT( setTotalSteps( int ) ) );
- connect( _delete->drop, SIGNAL( deleteMailsProgress( int ) ), _delete->progress, SLOT( setProgress( int ) ) );
- connect( _delete->drop, SIGNAL( deleteMailsReady( bool ) ), this, SLOT( deleteMailsReady( bool ) ) );
+ connect( _delete->drop, TQT_SIGNAL( deleteMailsTotalSteps( int ) ), _delete->progress, TQT_SLOT( setTotalSteps( int ) ) );
+ connect( _delete->drop, TQT_SIGNAL( deleteMailsProgress( int ) ), _delete->progress, TQT_SLOT( setProgress( int ) ) );
+ connect( _delete->drop, TQT_SIGNAL( deleteMailsReady( bool ) ), this, TQT_SLOT( deleteMailsReady( bool ) ) );
// connect the cancel button of the progress bar
- connect( _delete->progress, SIGNAL( canceled() ), _delete->drop, SLOT( deleteMailsCanceled() ) );
+ connect( _delete->progress, TQT_SIGNAL( canceled() ), _delete->drop, TQT_SLOT( deleteMailsCanceled() ) );
// delete the mails
_delete->drop->deleteMails( _delete->ids, 0 );
@@ -515,12 +515,12 @@ void KornSubjectsDlg::deleteMailsReady( bool /*success*/ )
if( !_delete )
return;
- disconnect( _delete->drop, SIGNAL( deleteMailsTotalSteps( int ) ), _delete->progress, SLOT( setTotalSteps( int ) ) );
- disconnect( _delete->drop, SIGNAL( deleteMailsProgress( int ) ), _delete->progress, SLOT( setProgress( int ) ) );
- disconnect( _delete->drop, SIGNAL( deleteMailsReady( bool ) ), this, SLOT( deleteMailsReady( bool ) ) );
+ disconnect( _delete->drop, TQT_SIGNAL( deleteMailsTotalSteps( int ) ), _delete->progress, TQT_SLOT( setTotalSteps( int ) ) );
+ disconnect( _delete->drop, TQT_SIGNAL( deleteMailsProgress( int ) ), _delete->progress, TQT_SLOT( setProgress( int ) ) );
+ disconnect( _delete->drop, TQT_SIGNAL( deleteMailsReady( bool ) ), this, TQT_SLOT( deleteMailsReady( bool ) ) );
// disconnect the cancel button of the progress bar
- disconnect( _delete->progress, SIGNAL( canceled() ), _delete->drop, SLOT( deleteMailsCanceled() ) );
+ disconnect( _delete->progress, TQT_SIGNAL( canceled() ), _delete->drop, TQT_SLOT( deleteMailsCanceled() ) );
deleteNextMessage();
}