Diffstat (limited to 'noncore/net/mail/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/mail/mainwindow.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/noncore/net/mail/mainwindow.cpp b/noncore/net/mail/mainwindow.cpp index 6252fc2..c115b32 100644 --- a/noncore/net/mail/mainwindow.cpp +++ b/noncore/net/mail/mainwindow.cpp | |||
@@ -82,137 +82,138 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
82 | 82 | ||
83 | //setCentralWidget( view ); | 83 | //setCentralWidget( view ); |
84 | 84 | ||
85 | QVBox* wrapperBox = new QVBox( this ); | 85 | QVBox* wrapperBox = new QVBox( this ); |
86 | setCentralWidget( wrapperBox ); | 86 | setCentralWidget( wrapperBox ); |
87 | 87 | ||
88 | QWidget *view = new QWidget( wrapperBox ); | 88 | QWidget *view = new QWidget( wrapperBox ); |
89 | 89 | ||
90 | layout = new QBoxLayout ( view, QBoxLayout::LeftToRight ); | 90 | layout = new QBoxLayout ( view, QBoxLayout::LeftToRight ); |
91 | 91 | ||
92 | folderView = new AccountView( view ); | 92 | folderView = new AccountView( view ); |
93 | folderView->header()->hide(); | 93 | folderView->header()->hide(); |
94 | folderView->setRootIsDecorated( true ); | 94 | folderView->setRootIsDecorated( true ); |
95 | folderView->addColumn( tr( "Mailbox" ) ); | 95 | folderView->addColumn( tr( "Mailbox" ) ); |
96 | 96 | ||
97 | layout->addWidget( folderView ); | 97 | layout->addWidget( folderView ); |
98 | 98 | ||
99 | mailView = new QListView( view ); | 99 | mailView = new QListView( view ); |
100 | mailView->addColumn( "" ); | 100 | mailView->addColumn( "" ); |
101 | mailView->addColumn( tr( "Subject" ),QListView::Manual ); | 101 | mailView->addColumn( tr( "Subject" ),QListView::Manual ); |
102 | mailView->addColumn( tr( "Sender" ),QListView::Manual ); | 102 | mailView->addColumn( tr( "Sender" ),QListView::Manual ); |
103 | mailView->addColumn( tr( "Size" ),QListView::Manual); | 103 | mailView->addColumn( tr( "Size" ),QListView::Manual); |
104 | mailView->addColumn( tr( "Date" )); | 104 | mailView->addColumn( tr( "Date" )); |
105 | mailView->setAllColumnsShowFocus(true); | 105 | mailView->setAllColumnsShowFocus(true); |
106 | mailView->setSorting(-1); | 106 | mailView->setShowSortIndicator(true); |
107 | mailView->setSorting(4,false); | ||
107 | 108 | ||
108 | statusWidget = new StatusWidget( wrapperBox ); | 109 | statusWidget = new StatusWidget( wrapperBox ); |
109 | statusWidget->hide(); | 110 | statusWidget->hide(); |
110 | 111 | ||
111 | layout->addWidget( mailView ); | 112 | layout->addWidget( mailView ); |
112 | layout->setStretchFactor( folderView, 1 ); | 113 | layout->setStretchFactor( folderView, 1 ); |
113 | layout->setStretchFactor( mailView, 2 ); | 114 | layout->setStretchFactor( mailView, 2 ); |
114 | 115 | ||
115 | slotAdjustLayout(); | 116 | slotAdjustLayout(); |
116 | 117 | ||
117 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); | 118 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); |
118 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); | 119 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); |
119 | 120 | ||
120 | connect( mailView, SIGNAL( mouseButtonClicked(int,QListViewItem*,const QPoint&,int) ),this, | 121 | connect( mailView, SIGNAL( mouseButtonClicked(int,QListViewItem*,const QPoint&,int) ),this, |
121 | SLOT( mailLeftClicked(int,QListViewItem*,const QPoint&,int) ) ); | 122 | SLOT( mailLeftClicked(int,QListViewItem*,const QPoint&,int) ) ); |
122 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, | 123 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, |
123 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); | 124 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); |
124 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), | 125 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), |
125 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); | 126 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); |
126 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); | 127 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); |
127 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); | 128 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); |
128 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); | 129 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); |
129 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); | 130 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); |
130 | // Added by Stefan Eilers to allow starting by addressbook.. | 131 | // Added by Stefan Eilers to allow starting by addressbook.. |
131 | // copied from old mail2 | 132 | // copied from old mail2 |
132 | #if !defined(QT_NO_COP) | 133 | #if !defined(QT_NO_COP) |
133 | connect( qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ), | 134 | connect( qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ), |
134 | this, SLOT( appMessage(const QCString&,const QByteArray&) ) ); | 135 | this, SLOT( appMessage(const QCString&,const QByteArray&) ) ); |
135 | #endif | 136 | #endif |
136 | 137 | ||
137 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); | 138 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); |
138 | } | 139 | } |
139 | 140 | ||
140 | MainWindow::~MainWindow() | 141 | MainWindow::~MainWindow() |
141 | { | 142 | { |
142 | } | 143 | } |
143 | 144 | ||
144 | void MainWindow::appMessage(const QCString &, const QByteArray &) | 145 | void MainWindow::appMessage(const QCString &, const QByteArray &) |
145 | { | 146 | { |
146 | odebug << "appMessage not reached" << oendl; | 147 | odebug << "appMessage not reached" << oendl; |
147 | } | 148 | } |
148 | 149 | ||
149 | void MainWindow::slotAdjustLayout() { | 150 | void MainWindow::slotAdjustLayout() { |
150 | 151 | ||
151 | QWidget *d = QApplication::desktop(); | 152 | QWidget *d = QApplication::desktop(); |
152 | 153 | ||
153 | if ( d->width() < d->height() ) { | 154 | if ( d->width() < d->height() ) { |
154 | layout->setDirection( QBoxLayout::TopToBottom ); | 155 | layout->setDirection( QBoxLayout::TopToBottom ); |
155 | } else { | 156 | } else { |
156 | layout->setDirection( QBoxLayout::LeftToRight ); | 157 | layout->setDirection( QBoxLayout::LeftToRight ); |
157 | } | 158 | } |
158 | } | 159 | } |
159 | 160 | ||
160 | void MainWindow::slotAdjustColumns() | 161 | void MainWindow::slotAdjustColumns() |
161 | { | 162 | { |
162 | bool hidden = folderView->isHidden(); | 163 | bool hidden = folderView->isHidden(); |
163 | if ( hidden ) folderView->show(); | 164 | if ( hidden ) folderView->show(); |
164 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); | 165 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); |
165 | if ( hidden ) folderView->hide(); | 166 | if ( hidden ) folderView->hide(); |
166 | 167 | ||
167 | mailView->setColumnWidth( 0, 10 ); | 168 | mailView->setColumnWidth( 0, 10 ); |
168 | mailView->setColumnWidth( 1, mailView->visibleWidth() - 130 ); | 169 | mailView->setColumnWidth( 1, mailView->visibleWidth() - 130 ); |
169 | mailView->setColumnWidth( 2, 80 ); | 170 | mailView->setColumnWidth( 2, 80 ); |
170 | mailView->setColumnWidth( 3, 50 ); | 171 | mailView->setColumnWidth( 3, 50 ); |
171 | mailView->setColumnWidth( 4, 50 ); | 172 | mailView->setColumnWidth( 4, 50 ); |
172 | } | 173 | } |
173 | 174 | ||
174 | void MainWindow::slotEditSettings() | 175 | void MainWindow::slotEditSettings() |
175 | { | 176 | { |
176 | } | 177 | } |
177 | 178 | ||
178 | void MainWindow::slotShowFolders( bool ) | 179 | void MainWindow::slotShowFolders( bool ) |
179 | { | 180 | { |
180 | odebug << "slotShowFolders not reached" << oendl; | 181 | odebug << "slotShowFolders not reached" << oendl; |
181 | } | 182 | } |
182 | 183 | ||
183 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) | 184 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) |
184 | { | 185 | { |
185 | odebug << "refreshMailView not reached" << oendl; | 186 | odebug << "refreshMailView not reached" << oendl; |
186 | } | 187 | } |
187 | 188 | ||
188 | void MainWindow::mailLeftClicked(int, QListViewItem *,const QPoint&,int ) | 189 | void MainWindow::mailLeftClicked(int, QListViewItem *,const QPoint&,int ) |
189 | { | 190 | { |
190 | odebug << "mailLeftClicked not reached" << oendl; | 191 | odebug << "mailLeftClicked not reached" << oendl; |
191 | } | 192 | } |
192 | 193 | ||
193 | void MainWindow::displayMail() | 194 | void MainWindow::displayMail() |
194 | { | 195 | { |
195 | odebug << "displayMail not reached" << oendl; | 196 | odebug << "displayMail not reached" << oendl; |
196 | } | 197 | } |
197 | 198 | ||
198 | void MainWindow::slotDeleteMail() | 199 | void MainWindow::slotDeleteMail() |
199 | { | 200 | { |
200 | odebug << "deleteMail not reached" << oendl; | 201 | odebug << "deleteMail not reached" << oendl; |
201 | } | 202 | } |
202 | 203 | ||
203 | void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) | 204 | void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) |
204 | { | 205 | { |
205 | odebug << "mailHold not reached" << oendl; | 206 | odebug << "mailHold not reached" << oendl; |
206 | } | 207 | } |
207 | 208 | ||
208 | void MainWindow::slotSendQueued() | 209 | void MainWindow::slotSendQueued() |
209 | { | 210 | { |
210 | } | 211 | } |
211 | 212 | ||
212 | void MainWindow::slotEditAccounts() | 213 | void MainWindow::slotEditAccounts() |
213 | { | 214 | { |
214 | } | 215 | } |
215 | 216 | ||
216 | void MainWindow::slotComposeMail() | 217 | void MainWindow::slotComposeMail() |
217 | { | 218 | { |
218 | } | 219 | } |