summaryrefslogtreecommitdiffabout
path: root/kmicromail/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'kmicromail/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/mainwindow.cpp74
1 files changed, 40 insertions, 34 deletions
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp
index d547dda..627d92e 100644
--- a/kmicromail/mainwindow.cpp
+++ b/kmicromail/mainwindow.cpp
@@ -1,15 +1,21 @@
// CHANGED 2004-08-06 Lutz Rogowski
#include <qlabel.h>
-#include <qvbox.h>
-#include <qheader.h>
+#include <q3vbox.h>
+#include <q3header.h>
#include <qtimer.h>
#include <qlayout.h>
+//Added by qt3to4:
+#include <Q3CString>
+#include <Q3GridLayout>
+#include <Q3ValueList>
+#include <QPixmap>
+#include <Q3PopupMenu>
//#include <kdialog.h>
#include <kiconloader.h>
#include <kapplication.h>
#ifdef DESKTOP_VERSION
#include <qapplication.h>
#include <qstatusbar.h>
#include <kabc/stdaddressbook.h>
@@ -22,30 +28,30 @@ extern QStatusBar* globalSstatusBarMainWindow;
#include "koprefs.h"
#include "mainwindow.h"
#include "mailistviewitem.h"
#include <KDGanttMinimizeSplitter.h>
#include <libkdepim/kpimglobalprefs.h>
#include "koprefs.h"
-MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
- : QMainWindow( parent, name ) //, flags )
+MainWindow::MainWindow( QWidget *parent, const char *name, Qt::WFlags flags )
+ : Q3MainWindow( parent, name ) //, flags )
{
#ifdef DESKTOP_VERSION
globalSstatusBarMainWindow = statusBar();
#endif
setCaption( i18n( "KOpieMail/Pi" ) );
setToolBarsMovable( false );
//KABC::StdAddressBook::self();
- toolBar = new QToolBar( this );
+ toolBar = new Q3ToolBar( this );
menuBar = new QPEMenuBar( toolBar );
- mailMenu = new QPopupMenu( menuBar );
+ mailMenu = new Q3PopupMenu( menuBar );
menuBar->insertItem( i18n( "Mail" ), mailMenu );
- settingsMenu = new QPopupMenu( menuBar );
+ settingsMenu = new Q3PopupMenu( menuBar );
menuBar->insertItem( i18n( "Settings" ), settingsMenu );
addToolBar( toolBar );
toolBar->setHorizontalStretchable( true );
QAction* getMail = new QAction( i18n( "Get all new mails" ), SmallIcon("enter"),
0, 0, this );
connect(getMail, SIGNAL( activated() ),
SLOT( slotGetAllMail() ) );
@@ -109,42 +115,42 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
connect( editSettings2, SIGNAL( activated() ),
SLOT( slotEditGlobalSettings() ) );
editAccounts = new QAction( i18n( "Configure accounts" ), SmallIcon("editaccounts") ,
0, 0, this );
editAccounts->addTo( settingsMenu );
- codecMenu = new QPopupMenu( menuBar );
+ codecMenu = new Q3PopupMenu( menuBar );
codecMenu->insertItem( "Western (iso-8859-1)",0,0);
codecMenu->insertItem( "Cyrillic (iso-8859-5)",1,1);
codecMenu->insertItem( "Western (iso-8859-15)",2,2);
codecMenu->insertItem( "Chinese (big-5)",3,3);
codecMenu->insertItem( "Unicode (utf-8)",4,4);
codecMenu->insertItem( "Userdefined ("+KOPrefs::instance()->mSendCodec+")",5,5);
//disabled
//settingsMenu->insertItem( i18n("Codec for new mails"), codecMenu);
//setCentralWidget( view );
- QVBox* wrapperBox = new QVBox( this );
+ Q3VBox* wrapperBox = new Q3VBox( this );
setCentralWidget( wrapperBox );
// QWidget *view = new QWidget( wrapperBox );
KDGanttMinimizeSplitter* splithor = new KDGanttMinimizeSplitter( Qt::Vertical, wrapperBox);
splithor->setMinimizeDirection( KDGanttMinimizeSplitter::Down);
KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, splithor);
split->setMinimizeDirection( KDGanttMinimizeSplitter::Left);
//layout = new QBoxLayout ( split, QBoxLayout::LeftToRight );
subLE = 0;
fromLE = 0;
toLE = 0;
if ( KOPrefs::instance()->mShowInfoSub || KOPrefs::instance()->mShowInfoFrom || KOPrefs::instance()->mShowInfoTo ) {
QWidget* infoBox = new QWidget( splithor );
- QGridLayout *griLay = new QGridLayout( infoBox, 2,2);
+ Q3GridLayout *griLay = new Q3GridLayout( infoBox, 2,2);
if ( KOPrefs::instance()->mShowInfoSub ) {
griLay->addWidget( new QLabel ( i18n("Su:"), infoBox ),0,0 );
griLay->addWidget( subLE = new QLineEdit( infoBox ),0,1) ;
}
if ( KOPrefs::instance()->mShowInfoFrom ) {
griLay->addWidget( new QLabel ( i18n("Fr:"), infoBox ),1,0 );
griLay->addWidget( fromLE = new QLineEdit( infoBox ),1,1) ;
}
@@ -163,28 +169,28 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
folderView->header()->hide();
folderView->setRootIsDecorated( false );
folderView->addColumn( i18n( "Mailbox" ) );
//layout->addWidget( folderView );
mailView = new KListView( split );
mailView->addColumn( i18n( " " ) );
- mailView->addColumn( i18n( "Subject" ),QListView::Manual );
- mailView->addColumn( i18n( "Sender" ),QListView::Manual );
- mailView->addColumn( i18n( "Size" ),QListView::Manual);
- mailView->addColumn( i18n( "Date" ),QListView::Manual);
+ mailView->addColumn( i18n( "Subject" ),Q3ListView::Manual );
+ mailView->addColumn( i18n( "Sender" ),Q3ListView::Manual );
+ mailView->addColumn( i18n( "Size" ),Q3ListView::Manual);
+ mailView->addColumn( i18n( "Date" ),Q3ListView::Manual);
if ( KOPrefs::instance()->mShowToField )
- mailView->addColumn( i18n( "To" ),QListView::Manual);
+ mailView->addColumn( i18n( "To" ),Q3ListView::Manual);
mailView->setAllColumnsShowFocus(true);
//mailView->setSorting(-1);
mailView->setRootIsDecorated( false );
statusWidget = new StatusWidget( wrapperBox );
statusWidget->hide();
- mailView->setSelectionMode( QListView::Multi );
+ mailView->setSelectionMode( Q3ListView::Multi );
mailView->setMultiSelection( true);
mailView->setAlternateBackground(KPimGlobalPrefs::instance()->mAlternateColor );
//layout->addWidget( mailView );
//layout->setStretchFactor( folderView, 1 );
//layout->setStretchFactor( mailView, 2 );
slotAdjustLayout();
#ifndef DESKTOP_VERSION
@@ -192,35 +198,35 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold);
if ( subLE )
QPEApplication::setStylusOperation( subLE ,QPEApplication::RightOnHold);
if ( fromLE )
QPEApplication::setStylusOperation( fromLE ,QPEApplication::RightOnHold);
if ( toLE )
QPEApplication::setStylusOperation( toLE ,QPEApplication::RightOnHold);
#endif
- connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this,
- SLOT( mailLeftClicked(QListViewItem*) ) );
- connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this,
- SLOT( mailLeftClicked(QListViewItem*) ) );
- connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this,
- SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) );
- connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)),
- this,SLOT(refreshMailView(const QValueList<RecMailP>&)));
-
- connect( mailView, SIGNAL( currentChanged (QListViewItem* )),this,
- SLOT( setInfoFields(QListViewItem*) ) );
+ connect( mailView, SIGNAL( doubleClicked (Q3ListViewItem* )),this,
+ SLOT( mailLeftClicked(Q3ListViewItem*) ) );
+ connect( mailView, SIGNAL( returnPressed (Q3ListViewItem* )),this,
+ SLOT( mailLeftClicked(Q3ListViewItem*) ) );
+ connect( mailView, SIGNAL( mouseButtonPressed(int,Q3ListViewItem*,const QPoint&,int) ),this,
+ SLOT( mailHold(int,Q3ListViewItem*,const QPoint&,int) ) );
+ connect(folderView, SIGNAL(refreshMailview(const Q3ValueList<RecMailP>&)),
+ this,SLOT(refreshMailView(const Q3ValueList<RecMailP>&)));
+
+ connect( mailView, SIGNAL( currentChanged (Q3ListViewItem* )),this,
+ SLOT( setInfoFields(Q3ListViewItem*) ) );
connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) );
connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) );
// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) );
connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) );
//mailView->setMultiSelection ( true );
//mailView->setSelectionMode( QListView::Extended );
- QValueList<int> list;
+ Q3ValueList<int> list;
int fw = 100;
if ( QApplication::desktop()->width() > 320 )
fw = 50;
list.append( fw );
list.append( 100 );
split->setSizes( list );
QTimer::singleShot( 100, this, SLOT( slotAdjustColumns() ) );
mailView->setShowSortIndicator ( true );
@@ -230,17 +236,17 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
QAction* closeMail = new QAction(i18n("Close"),SmallIcon("exit"), 0, 0, this);
connect( closeMail, SIGNAL( activated() ), SLOT( close() ) );
if ( QApplication::desktop()->width() > 320 )
closeMail->addTo(toolBar);
closeMail->addTo(mailMenu);
- QPopupMenu* helpMenu = new QPopupMenu( menuBar );
+ Q3PopupMenu* helpMenu = new Q3PopupMenu( menuBar );
menuBar->insertItem( i18n( "Help" ), helpMenu );
QAction* li = new QAction(i18n("About"), QPixmap(), 0, 0, this);
connect( li, SIGNAL( activated() ), SLOT( showAbout()) );
li->addTo(helpMenu);
li = new QAction(i18n("Licence"),QPixmap(), 0, 0, this);
connect( li, SIGNAL( activated() ), SLOT( showLicence()) );
li->addTo(helpMenu);
li = new QAction(i18n("LibEtPan Licence"), QPixmap(), 0, 0, this);
@@ -254,17 +260,17 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
resize ( 640, 480 );
#endif
}
MainWindow::~MainWindow()
{
}
-void MainWindow::setInfoFields(QListViewItem* item )
+void MainWindow::setInfoFields(Q3ListViewItem* item )
{
if ( item == 0) {
if ( subLE ) subLE->setText("");
if ( fromLE ) fromLE->setText("");
if ( toLE ) toLE->setText("");
return;
}
RecMailP mail = ((MailListViewItem*)item)->data();
@@ -340,17 +346,17 @@ void MainWindow::showAbout()
KApplication::showText( cap, text );
}
void MainWindow::showEtpanLicence()
{
KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" );
}
-void MainWindow::appMessage(const QCString &, const QByteArray &)
+void MainWindow::appMessage(const Q3CString &, const QByteArray &)
{
qDebug("appMessage implemented by subclass");
}
void MainWindow::slotAdjustLayout() {
/*
QWidget *d = QApplication::desktop();
@@ -400,37 +406,37 @@ void MainWindow::slotEditGlobalSettings()
{
}
void MainWindow::slotShowFolders( bool )
{
qDebug("not implemented: ");
}
-void MainWindow::refreshMailView(const QValueList<RecMailP>&)
+void MainWindow::refreshMailView(const Q3ValueList<RecMailP>&)
{
qDebug("not implemented: ");
}
-void MainWindow::mailLeftClicked(QListViewItem * )
+void MainWindow::mailLeftClicked(Q3ListViewItem * )
{
qDebug("not implemented: ");
}
void MainWindow::displayMail()
{
qDebug("not implemented: ");
}
void MainWindow::slotDeleteMail()
{
qDebug("not implemented: ");
}
-void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int )
+void MainWindow::mailHold(int, Q3ListViewItem *,const QPoint&,int )
{
qDebug("not implemented: ");
}
void MainWindow::slotSendQueued()
{
qDebug("not implemented: ");
}