summaryrefslogtreecommitdiffabout
path: root/kmicromail/mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'kmicromail/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kmicromail/mainwindow.cpp39
1 files changed, 37 insertions, 2 deletions
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp
index 875ab77..250d114 100644
--- a/kmicromail/mainwindow.cpp
+++ b/kmicromail/mainwindow.cpp
@@ -20,6 +20,7 @@ extern QStatusBar* globalSstatusBarMainWindow;
#endif
#include "defines.h"
#include "mainwindow.h"
+#include "mailistviewitem.h"
#include <KDGanttMinimizeSplitter.h>
#include "koprefs.h"
@@ -116,10 +117,20 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
setCentralWidget( wrapperBox );
// QWidget *view = new QWidget( wrapperBox );
- KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, 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 );
-
+ QWidget* infoBox = new QWidget( splithor );
+ QGridLayout *griLay = new QGridLayout( infoBox, 2,2);
+ griLay->addWidget( new QLabel ( i18n("Su:"), infoBox ),0,0 );
+ griLay->addWidget( new QLabel ( i18n("Fr:"), infoBox ),1,0 );
+ griLay->addWidget( new QLabel ( i18n("To:"), infoBox ),2,0 );
+ griLay->addWidget( subLE = new QLineEdit( infoBox ),0,1) ;
+ griLay->addWidget( fromLE = new QLineEdit( infoBox ),1,1) ;
+ griLay->addWidget( toLE = new QLineEdit( infoBox ),2,1) ;
+ infoBox->setMaximumHeight( infoBox->sizeHint().height() );
folderView = new AccountView( split );
folderView->header()->hide();
folderView->setRootIsDecorated( false );
@@ -149,6 +160,9 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
#ifndef DESKTOP_VERSION
QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold);
QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold);
+ QPEApplication::setStylusOperation( subLE ,QPEApplication::RightOnHold);
+ QPEApplication::setStylusOperation( fromLE ,QPEApplication::RightOnHold);
+ QPEApplication::setStylusOperation( toLE ,QPEApplication::RightOnHold);
#endif
connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this,
SLOT( mailLeftClicked(QListViewItem*) ) );
@@ -158,6 +172,10 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
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( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) );
connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) );
// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) );
@@ -206,6 +224,23 @@ MainWindow::~MainWindow()
{
}
+void MainWindow::setInfoFields(QListViewItem* item )
+{
+ if ( item == 0) {
+ subLE->setText("");
+ fromLE->setText("");
+ toLE->setText("");
+ return;
+ }
+ RecMailP mail = ((MailListViewItem*)item)->data();
+ subLE->setText(mail->getSubject());
+ fromLE->setText(mail->getFrom());
+ toLE->setText(mail->To().join(";" ));
+ subLE->setCursorPosition(0);
+ fromLE->setCursorPosition(0);
+ toLE->setCursorPosition(0);
+
+}
void MainWindow::slotSetCodec( int codec )
{
codecMenu->setItemChecked(KOPrefs::instance()->mCurrentCodec, false );