summaryrefslogtreecommitdiffstats
path: root/kmail/kmfolderseldlg.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kmail/kmfolderseldlg.cpp')
-rw-r--r--kmail/kmfolderseldlg.cpp118
1 files changed, 59 insertions, 59 deletions
diff --git a/kmail/kmfolderseldlg.cpp b/kmail/kmfolderseldlg.cpp
index 21fc5323..607b4243 100644
--- a/kmail/kmfolderseldlg.cpp
+++ b/kmail/kmfolderseldlg.cpp
@@ -12,8 +12,8 @@
#include <kpopupmenu.h>
#include <kiconloader.h>
-#include <qlayout.h>
-#include <qtoolbutton.h>
+#include <tqlayout.h>
+#include <tqtoolbutton.h>
namespace KMail {
@@ -41,29 +41,29 @@ class FolderItem : public KFolderTreeItem
// Must overload paintCell because neither KListViewItem::isAlternate()
// or KListViewItem::backgroundColor() are virtual!
- virtual void paintCell( QPainter *p, const QColorGroup &cg,
+ virtual void paintCell( TQPainter *p, const TQColorGroup &cg,
int column, int width, int alignment )
{
KListView* view = static_cast< KListView* >( listView() );
// Set alternate background to invalid
- QColor nocolor;
- QColor alt = view->alternateBackground();
+ TQColor nocolor;
+ TQColor alt = view->alternateBackground();
view->setAlternateBackground( nocolor );
// Set the base and text to the appropriate colors
- QColorGroup *cgroup = (QColorGroup *)&view->viewport()->colorGroup();
- QColor base = cgroup->base();
- QColor text = cgroup->text();
- cgroup->setColor( QColorGroup::Base, isAlternate() ? alt : base );
- cgroup->setColor( QColorGroup::Text, isEnabled() ? text : Qt::lightGray );
+ TQColorGroup *cgroup = (TQColorGroup *)&view->viewport()->colorGroup();
+ TQColor base = cgroup->base();
+ TQColor text = cgroup->text();
+ cgroup->setColor( TQColorGroup::Base, isAlternate() ? alt : base );
+ cgroup->setColor( TQColorGroup::Text, isEnabled() ? text : Qt::lightGray );
// Call the parent paint routine
KListViewItem::paintCell( p, cg, column, width, alignment );
// Restore the base and alternate background
- cgroup->setColor( QColorGroup::Base, base );
- cgroup->setColor( QColorGroup::Text, text );
+ cgroup->setColor( TQColorGroup::Base, base );
+ cgroup->setColor( TQColorGroup::Text, text );
view->setAlternateBackground( alt );
}
@@ -85,9 +85,9 @@ FolderItem::FolderItem( KFolderTreeItem * listViewItem )
{}
//-----------------------------------------------------------------------------
-SimpleFolderTree::SimpleFolderTree( QWidget * parent,
+SimpleFolderTree::SimpleFolderTree( TQWidget * parent,
KMFolderTree * folderTree,
- const QString & preSelection,
+ const TQString & preSelection,
bool mustBeReadWrite )
: KFolderTree( parent ), mFolderTree( folderTree )
{
@@ -95,23 +95,23 @@ SimpleFolderTree::SimpleFolderTree( QWidget * parent,
mFolderColumn = addColumn( i18n( "Folder" ), 0 );
mPathColumn = addColumn( i18n( "Path" ), 0 );
setAllColumnsShowFocus( true );
- setAlternateBackground( QColor( 0xf0, 0xf0, 0xf0 ) );
+ setAlternateBackground( TQColor( 0xf0, 0xf0, 0xf0 ) );
reload( mustBeReadWrite, true, true, preSelection );
readColorConfig();
applyFilter( "" );
- connect(this, SIGNAL(collapsed(QListViewItem*)), SLOT(recolorRows()));
- connect(this, SIGNAL(expanded(QListViewItem*)), SLOT(recolorRows()));
+ connect(this, TQT_SIGNAL(collapsed(TQListViewItem*)), TQT_SLOT(recolorRows()));
+ connect(this, TQT_SIGNAL(expanded(TQListViewItem*)), TQT_SLOT(recolorRows()));
- connect( this, SIGNAL( contextMenuRequested( QListViewItem*, const QPoint &, int ) ),
- this, SLOT( slotContextMenuRequested( QListViewItem*, const QPoint & ) ) );
+ connect( this, TQT_SIGNAL( contextMenuRequested( TQListViewItem*, const TQPoint &, int ) ),
+ this, TQT_SLOT( slotContextMenuRequested( TQListViewItem*, const TQPoint & ) ) );
}
//-----------------------------------------------------------------------------
void SimpleFolderTree::reload( bool mustBeReadWrite, bool showOutbox,
- bool showImapFolders, const QString& preSelection )
+ bool showImapFolders, const TQString& preSelection )
{
mLastMustBeReadWrite = mustBeReadWrite;
mLastShowOutbox = showOutbox;
@@ -123,14 +123,14 @@ void SimpleFolderTree::reload( bool mustBeReadWrite, bool showOutbox,
FolderItem * selectedItem = 0;
int lastDepth = 0;
- QString selected = preSelection;
+ TQString selected = preSelection;
if ( selected.isEmpty() && folder() )
selected = folder()->idString();
mFilter = "";
- QString path;
+ TQString path;
- for ( QListViewItemIterator it( mFolderTree ) ; it.current() ; ++it )
+ for ( TQListViewItemIterator it( mFolderTree ) ; it.current() ; ++it )
{
KMFolderTreeItem * fti = static_cast<KMFolderTreeItem *>( it.current() );
@@ -224,7 +224,7 @@ void SimpleFolderTree::reload( bool mustBeReadWrite, bool showOutbox,
//-----------------------------------------------------------------------------
const KMFolder * SimpleFolderTree::folder() const
{
- QListViewItem * item = currentItem();
+ TQListViewItem * item = currentItem();
if ( item ) {
const KMFolder * folder = static_cast<FolderItem *>( item )->folder();
if( folder ) return folder;
@@ -235,7 +235,7 @@ const KMFolder * SimpleFolderTree::folder() const
//-----------------------------------------------------------------------------
void SimpleFolderTree::setFolder( KMFolder *folder )
{
- for ( QListViewItemIterator it( this ) ; it.current() ; ++it )
+ for ( TQListViewItemIterator it( this ) ; it.current() ; ++it )
{
const KMFolder *fld = static_cast<FolderItem *>( it.current() )->folder();
if ( fld == folder )
@@ -247,7 +247,7 @@ void SimpleFolderTree::setFolder( KMFolder *folder )
}
//-----------------------------------------------------------------------------
-void SimpleFolderTree::setFolder( const QString& idString )
+void SimpleFolderTree::setFolder( const TQString& idString )
{
setFolder( kmkernel->findFolderById( idString ) );
}
@@ -264,8 +264,8 @@ void SimpleFolderTree::addChildFolder()
}
//-----------------------------------------------------------------------------
-void SimpleFolderTree::slotContextMenuRequested( QListViewItem *lvi,
- const QPoint &p )
+void SimpleFolderTree::slotContextMenuRequested( TQListViewItem *lvi,
+ const TQPoint &p )
{
if (!lvi)
return;
@@ -281,7 +281,7 @@ void SimpleFolderTree::slotContextMenuRequested( QListViewItem *lvi,
folderMenu->insertSeparator();
folderMenu->insertItem(SmallIconSet("folder_new"),
i18n("&New Subfolder..."), this,
- SLOT(addChildFolder()));
+ TQT_SLOT(addChildFolder()));
kmkernel->setContextMenuShown( true );
folderMenu->exec (p, 0);
kmkernel->setContextMenuShown( false );
@@ -292,26 +292,26 @@ void SimpleFolderTree::slotContextMenuRequested( QListViewItem *lvi,
//-----------------------------------------------------------------------------
void SimpleFolderTree::readColorConfig (void)
{
- QColor c1=QColor(kapp->palette().active().text());
- QColor c2=QColor(kapp->palette().active().base());
+ TQColor c1=TQColor(kapp->palette().active().text());
+ TQColor c2=TQColor(kapp->palette().active().base());
mPaintInfo.colFore = c1;
mPaintInfo.colBack = c2;
- QPalette newPal = kapp->palette();
- newPal.setColor( QColorGroup::Base, mPaintInfo.colBack );
- newPal.setColor( QColorGroup::Text, mPaintInfo.colFore );
+ TQPalette newPal = kapp->palette();
+ newPal.setColor( TQColorGroup::Base, mPaintInfo.colBack );
+ newPal.setColor( TQColorGroup::Text, mPaintInfo.colFore );
setPalette( newPal );
}
//-----------------------------------------------------------------------------
-static int recurseFilter( QListViewItem * item, const QString& filter, int column )
+static int recurseFilter( TQListViewItem * item, const TQString& filter, int column )
{
if ( item == 0 )
return 0;
- QListViewItem * child;
+ TQListViewItem * child;
child = item->firstChild();
int enabled = 0;
@@ -337,13 +337,13 @@ void SimpleFolderTree::recolorRows()
{
// Iterate through the list to set the alternate row flags.
int alt = 0;
- QListViewItemIterator it ( this );
+ TQListViewItemIterator it ( this );
while ( it.current() ) {
FolderItem * item = static_cast< FolderItem* >( it.current() );
if ( item->isVisible() ) {
bool visible = true;
- QListViewItem * parent = item->parent();
+ TQListViewItem * parent = item->parent();
while ( parent ) {
if (!parent->isOpen()) {
visible = false;
@@ -362,12 +362,12 @@ void SimpleFolderTree::recolorRows()
}
}
-void SimpleFolderTree::applyFilter( const QString& filter )
+void SimpleFolderTree::applyFilter( const TQString& filter )
{
// Reset all items to visible, enabled, and open
- QListViewItemIterator clean( this );
+ TQListViewItemIterator clean( this );
while ( clean.current() ) {
- QListViewItem * item = clean.current();
+ TQListViewItem * item = clean.current();
item->setEnabled( true );
item->setVisible( true );
item->setOpen( true );
@@ -384,9 +384,9 @@ void SimpleFolderTree::applyFilter( const QString& filter )
// Set the visibility and enabled status of each list item.
// The recursive algorithm is necessary because visiblity
// changes are automatically applied to child nodes by Qt.
- QListViewItemIterator it( this );
+ TQListViewItemIterator it( this );
while ( it.current() ) {
- QListViewItem * item = it.current();
+ TQListViewItem * item = it.current();
if ( item->depth() <= 0 )
recurseFilter( item, filter, mPathColumn );
++it;
@@ -396,7 +396,7 @@ void SimpleFolderTree::applyFilter( const QString& filter )
recolorRows();
// Iterate through the list to find the first selectable item
- QListViewItemIterator first ( this );
+ TQListViewItemIterator first ( this );
while ( first.current() ) {
FolderItem * item = static_cast< FolderItem* >( first.current() );
@@ -419,7 +419,7 @@ void SimpleFolderTree::applyFilter( const QString& filter )
}
//-----------------------------------------------------------------------------
-void SimpleFolderTree::keyPressEvent( QKeyEvent *e ) {
+void SimpleFolderTree::keyPressEvent( TQKeyEvent *e ) {
int ch = e->ascii();
if ( ch >= 32 && ch <= 126 )
@@ -438,7 +438,7 @@ void SimpleFolderTree::keyPressEvent( QKeyEvent *e ) {
//-----------------------------------------------------------------------------
-KMFolderSelDlg::KMFolderSelDlg( KMMainWidget * parent, const QString& caption,
+KMFolderSelDlg::KMFolderSelDlg( KMMainWidget * parent, const TQString& caption,
bool mustBeReadWrite, bool useGlobalSettings )
: KDialogBase( parent, "folder dialog", true, caption,
Ok|Cancel|User1, Ok, true,
@@ -450,16 +450,16 @@ KMFolderSelDlg::KMFolderSelDlg( KMMainWidget * parent, const QString& caption,
KMFolderTree * ft = parent->folderTree();
assert( ft );
- QString preSelection = mUseGlobalSettings ?
- GlobalSettings::self()->lastSelectedFolder() : QString::null;
+ TQString preSelection = mUseGlobalSettings ?
+ GlobalSettings::self()->lastSelectedFolder() : TQString::null;
mTreeView = new KMail::SimpleFolderTree( makeVBoxMainWidget(), ft,
preSelection, mustBeReadWrite );
init();
}
//----------------------------------------------------------------------------
-KMFolderSelDlg::KMFolderSelDlg( QWidget * parent, KMFolderTree * tree,
- const QString& caption, bool mustBeReadWrite, bool useGlobalSettings )
+KMFolderSelDlg::KMFolderSelDlg( TQWidget * parent, KMFolderTree * tree,
+ const TQString& caption, bool mustBeReadWrite, bool useGlobalSettings )
: KDialogBase( parent, "folder dialog", true, caption,
Ok|Cancel|User1, Ok, true,
KGuiItem(i18n("&New Subfolder..."), "folder_new",
@@ -467,8 +467,8 @@ KMFolderSelDlg::KMFolderSelDlg( QWidget * parent, KMFolderTree * tree,
), // mainwin as parent, modal
mUseGlobalSettings( useGlobalSettings )
{
- QString preSelection = mUseGlobalSettings ?
- GlobalSettings::self()->lastSelectedFolder() : QString::null;
+ TQString preSelection = mUseGlobalSettings ?
+ GlobalSettings::self()->lastSelectedFolder() : TQString::null;
mTreeView = new KMail::SimpleFolderTree( makeVBoxMainWidget(), tree,
preSelection, mustBeReadWrite );
init();
@@ -478,10 +478,10 @@ KMFolderSelDlg::KMFolderSelDlg( QWidget * parent, KMFolderTree * tree,
void KMFolderSelDlg::init()
{
mTreeView->setFocus();
- connect( mTreeView, SIGNAL( doubleClicked( QListViewItem*, const QPoint&, int ) ),
- this, SLOT( slotSelect() ) );
- connect( mTreeView, SIGNAL( selectionChanged() ),
- this, SLOT( slotUpdateBtnStatus() ) );
+ connect( mTreeView, TQT_SIGNAL( doubleClicked( TQListViewItem*, const TQPoint&, int ) ),
+ this, TQT_SLOT( slotSelect() ) );
+ connect( mTreeView, TQT_SIGNAL( selectionChanged() ),
+ this, TQT_SLOT( slotUpdateBtnStatus() ) );
readConfig();
}
@@ -541,11 +541,11 @@ void KMFolderSelDlg::readConfig()
KConfig *config = KGlobal::config();
config->setGroup( "FolderSelectionDialog" );
- QSize size = config->readSizeEntry( "Size" );
+ TQSize size = config->readSizeEntry( "Size" );
if ( !size.isEmpty() ) resize( size );
else resize( 500, 300 );
- QValueList<int> widths = config->readIntListEntry( "ColumnWidths" );
+ TQValueList<int> widths = config->readIntListEntry( "ColumnWidths" );
if ( !widths.isEmpty() ) {
mTreeView->setColumnWidth(mTreeView->mFolderColumn, widths[0]);
mTreeView->setColumnWidth(mTreeView->mPathColumn, widths[1]);
@@ -563,7 +563,7 @@ void KMFolderSelDlg::writeConfig()
config->setGroup( "FolderSelectionDialog" );
config->writeEntry( "Size", size() );
- QValueList<int> widths;
+ TQValueList<int> widths;
widths.push_back(mTreeView->columnWidth(mTreeView->mFolderColumn));
widths.push_back(mTreeView->columnWidth(mTreeView->mPathColumn));
config->writeEntry( "ColumnWidths", widths );