author | harlekin <harlekin> | 2003-12-09 18:02:33 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2003-12-09 18:02:33 (UTC) |
commit | 0b7d74768f00be986f44bfbd61a6342fc854cc3a (patch) (unidiff) | |
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) (ignore 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 | |||
@@ -71,15 +71,7 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
71 | QWidget *view = new QWidget( this ); | 71 | QWidget *view = new QWidget( this ); |
72 | setCentralWidget( view ); | 72 | setCentralWidget( view ); |
73 | 73 | ||
74 | 74 | layout = new QBoxLayout ( view, QBoxLayout::LeftToRight ); | |
75 | QWidget *d = QApplication::desktop(); | ||
76 | QBoxLayout *layout; | ||
77 | |||
78 | if ( d->width() < d->height() ) { | ||
79 | layout = new QVBoxLayout( view ); | ||
80 | } else { | ||
81 | layout = new QHBoxLayout( view ); | ||
82 | } | ||
83 | 75 | ||
84 | folderView = new AccountView( view ); | 76 | folderView = new AccountView( view ); |
85 | folderView->header()->hide(); | 77 | folderView->header()->hide(); |
@@ -99,6 +91,8 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
99 | layout->setStretchFactor( folderView, 1 ); | 91 | layout->setStretchFactor( folderView, 1 ); |
100 | layout->setStretchFactor( mailView, 2 ); | 92 | layout->setStretchFactor( mailView, 2 ); |
101 | 93 | ||
94 | slotAdjustLayout(); | ||
95 | |||
102 | connect( mailView, SIGNAL( clicked( QListViewItem * ) ),this, | 96 | connect( mailView, SIGNAL( clicked( QListViewItem * ) ),this, |
103 | SLOT( displayMail( QListViewItem * ) ) ); | 97 | SLOT( displayMail( QListViewItem * ) ) ); |
104 | 98 | ||
@@ -107,6 +101,19 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
107 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); | 101 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); |
108 | } | 102 | } |
109 | 103 | ||
104 | |||
105 | void MainWindow::slotAdjustLayout() { | ||
106 | |||
107 | QWidget *d = QApplication::desktop(); | ||
108 | |||
109 | if ( d->width() < d->height() ) { | ||
110 | layout->setDirection( QBoxLayout::TopToBottom ); | ||
111 | } else { | ||
112 | layout->setDirection( QBoxLayout::LeftToRight ); | ||
113 | } | ||
114 | delete d; | ||
115 | } | ||
116 | |||
110 | void MainWindow::slotAdjustColumns() | 117 | void MainWindow::slotAdjustColumns() |
111 | { | 118 | { |
112 | bool hidden = folderView->isHidden(); | 119 | bool hidden = folderView->isHidden(); |
@@ -149,7 +156,8 @@ void MainWindow::displayMail(QListViewItem*item) | |||
149 | RecBody body = folderView->fetchBody(mail); | 156 | RecBody body = folderView->fetchBody(mail); |
150 | 157 | ||
151 | ViewMail readMail( this ); | 158 | ViewMail readMail( this ); |
152 | readMail.setMailInfo( mail.getFrom(), "", mail.getSubject(), "", "", body.Bodytext() ); | 159 | |
160 | readMail.setMailInfo( mail.getFrom(), mail.To(), mail.getSubject(), mail.CC(), mail.Bcc(), mail.getDate(), body.Bodytext() ); | ||
153 | readMail.showMaximized(); | 161 | readMail.showMaximized(); |
154 | readMail.exec(); | 162 | readMail.exec(); |
155 | } | 163 | } |