author | harlekin <harlekin> | 2003-12-09 18:02:33 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-12-09 18:02:33 (UTC) |
commit | 0b7d74768f00be986f44bfbd61a6342fc854cc3a (patch) (side-by-side diff) | |
tree | 2e314f0d73e3c720783618870fb6d2e16b4acf3e /noncore/net/mail/mainwindow.cpp | |
parent | a30efc4ca72e7689ee35b178d28db82054431fe9 (diff) | |
download | opie-0b7d74768f00be986f44bfbd61a6342fc854cc3a.zip opie-0b7d74768f00be986f44bfbd61a6342fc854cc3a.tar.gz opie-0b7d74768f00be986f44bfbd61a6342fc854cc3a.tar.bz2 |
more updates
Diffstat (limited to 'noncore/net/mail/mainwindow.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp index b25db97..f19f93d 100644 --- a/noncore/net/mail/mainwindow.cpp +++ b/noncore/net/mail/mainwindow.cpp @@ -68,21 +68,13 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) 0, 0, this ); editAccounts->addTo( settingsMenu ); QWidget *view = new QWidget( this ); setCentralWidget( view ); - - QWidget *d = QApplication::desktop(); - QBoxLayout *layout; - - if ( d->width() < d->height() ) { - layout = new QVBoxLayout( view ); - } else { - layout = new QHBoxLayout( view ); - } + layout = new QBoxLayout ( view, QBoxLayout::LeftToRight ); folderView = new AccountView( view ); folderView->header()->hide(); folderView->addColumn( tr( "Mailbox" ) ); folderView->hide(); @@ -96,20 +88,35 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) mailView->setSorting(-1); layout->addWidget( mailView ); layout->setStretchFactor( folderView, 1 ); layout->setStretchFactor( mailView, 2 ); + slotAdjustLayout(); + connect( mailView, SIGNAL( clicked( QListViewItem * ) ),this, SLOT( displayMail( QListViewItem * ) ) ); connect(folderView,SIGNAL(refreshMailview(QList<RecMail>*)),this,SLOT(refreshMailView(QList<RecMail>*))); QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); } + +void MainWindow::slotAdjustLayout() { + + QWidget *d = QApplication::desktop(); + + if ( d->width() < d->height() ) { + layout->setDirection( QBoxLayout::TopToBottom ); + } else { + layout->setDirection( QBoxLayout::LeftToRight ); + } + delete d; +} + void MainWindow::slotAdjustColumns() { bool hidden = folderView->isHidden(); if ( hidden ) folderView->show(); folderView->setColumnWidth( 0, folderView->visibleWidth() ); if ( hidden ) folderView->hide(); @@ -146,13 +153,14 @@ void MainWindow::displayMail(QListViewItem*item) if (!item) return; qDebug("View mail"); RecMail mail = ((MailListViewItem*)item)->data(); RecBody body = folderView->fetchBody(mail); ViewMail readMail( this ); - readMail.setMailInfo( mail.getFrom(), "", mail.getSubject(), "", "", body.Bodytext() ); + + readMail.setMailInfo( mail.getFrom(), mail.To(), mail.getSubject(), mail.CC(), mail.Bcc(), mail.getDate(), body.Bodytext() ); readMail.showMaximized(); readMail.exec(); } MailListViewItem::MailListViewItem(QListView * parent, MailListViewItem * after ) :QListViewItem(parent,after),mail_data() |