author | zautrix <zautrix> | 2004-07-04 12:40:46 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-07-04 12:40:46 (UTC) |
commit | deb87bff56cd9cbb41e352c2ccfa97be142d6e48 (patch) (unidiff) | |
tree | d711d6085e4143e1731da440732e823e69c092a3 /kmicromail/mainwindow.cpp | |
parent | 4a947dbc08cc7640dda4f8a89ddb3c80ecc5f9ea (diff) | |
download | kdepimpi-deb87bff56cd9cbb41e352c2ccfa97be142d6e48.zip kdepimpi-deb87bff56cd9cbb41e352c2ccfa97be142d6e48.tar.gz kdepimpi-deb87bff56cd9cbb41e352c2ccfa97be142d6e48.tar.bz2 |
Make sorting in KM working
-rw-r--r-- | kmicromail/mainwindow.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp index 78377ea..ddc7b3e 100644 --- a/kmicromail/mainwindow.cpp +++ b/kmicromail/mainwindow.cpp | |||
@@ -50,178 +50,178 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags ) | |||
50 | syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, | 50 | syncFolders = new QAction( tr( "Sync mailfolders" ), ICON_SYNC, |
51 | 0, 0, this ); | 51 | 0, 0, this ); |
52 | syncFolders->addTo( toolBar ); | 52 | syncFolders->addTo( toolBar ); |
53 | syncFolders->addTo( mailMenu ); | 53 | syncFolders->addTo( mailMenu ); |
54 | */ | 54 | */ |
55 | 55 | ||
56 | showFolders = new QAction( tr( "Show/Hide folders" ), SmallIcon("showfolders") , | 56 | showFolders = new QAction( tr( "Show/Hide folders" ), SmallIcon("showfolders") , |
57 | 0, 0, this, 0, true ); | 57 | 0, 0, this, 0, true ); |
58 | showFolders->addTo( toolBar ); | 58 | showFolders->addTo( toolBar ); |
59 | showFolders->addTo( mailMenu ); | 59 | showFolders->addTo( mailMenu ); |
60 | showFolders->setOn( true ); | 60 | showFolders->setOn( true ); |
61 | connect(showFolders, SIGNAL( toggled(bool) ), | 61 | connect(showFolders, SIGNAL( toggled(bool) ), |
62 | SLOT( slotShowFolders(bool) ) ); | 62 | SLOT( slotShowFolders(bool) ) ); |
63 | 63 | ||
64 | /* | 64 | /* |
65 | searchMails = new QAction( tr( "Search mails" ), SmallIcon("find") ), | 65 | searchMails = new QAction( tr( "Search mails" ), SmallIcon("find") ), |
66 | 0, 0, this ); | 66 | 0, 0, this ); |
67 | searchMails->addTo( toolBar ); | 67 | searchMails->addTo( toolBar ); |
68 | searchMails->addTo( mailMenu ); | 68 | searchMails->addTo( mailMenu ); |
69 | */ | 69 | */ |
70 | 70 | ||
71 | deleteMails = new QAction(tr("Delete Mail"), SmallIcon("trash"), 0, 0, this); | 71 | deleteMails = new QAction(tr("Delete Mail"), SmallIcon("trash"), 0, 0, this); |
72 | deleteMails->addTo( toolBar ); | 72 | deleteMails->addTo( toolBar ); |
73 | deleteMails->addTo( mailMenu ); | 73 | deleteMails->addTo( mailMenu ); |
74 | connect( deleteMails, SIGNAL( activated() ), | 74 | connect( deleteMails, SIGNAL( activated() ), |
75 | SLOT( slotDeleteMail() ) ); | 75 | SLOT( slotDeleteMail() ) ); |
76 | 76 | ||
77 | editSettings = new QAction( tr( "Edit settings" ), SmallIcon("SettingsIcon") , | 77 | editSettings = new QAction( tr( "Edit settings" ), SmallIcon("SettingsIcon") , |
78 | 0, 0, this ); | 78 | 0, 0, this ); |
79 | editSettings->addTo( settingsMenu ); | 79 | editSettings->addTo( settingsMenu ); |
80 | connect( editSettings, SIGNAL( activated() ), | 80 | connect( editSettings, SIGNAL( activated() ), |
81 | SLOT( slotEditSettings() ) ); | 81 | SLOT( slotEditSettings() ) ); |
82 | editAccounts = new QAction( tr( "Configure accounts" ), SmallIcon("editaccounts") , | 82 | editAccounts = new QAction( tr( "Configure accounts" ), SmallIcon("editaccounts") , |
83 | 0, 0, this ); | 83 | 0, 0, this ); |
84 | editAccounts->addTo( settingsMenu ); | 84 | editAccounts->addTo( settingsMenu ); |
85 | 85 | ||
86 | //setCentralWidget( view ); | 86 | //setCentralWidget( view ); |
87 | 87 | ||
88 | QVBox* wrapperBox = new QVBox( this ); | 88 | QVBox* wrapperBox = new QVBox( this ); |
89 | setCentralWidget( wrapperBox ); | 89 | setCentralWidget( wrapperBox ); |
90 | 90 | ||
91 | // QWidget *view = new QWidget( wrapperBox ); | 91 | // QWidget *view = new QWidget( wrapperBox ); |
92 | KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, wrapperBox); | 92 | KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, wrapperBox); |
93 | split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); | 93 | split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); |
94 | //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); | 94 | //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); |
95 | 95 | ||
96 | folderView = new AccountView( split ); | 96 | folderView = new AccountView( split ); |
97 | folderView->header()->hide(); | 97 | folderView->header()->hide(); |
98 | folderView->setRootIsDecorated( true ); | 98 | folderView->setRootIsDecorated( false ); |
99 | folderView->addColumn( tr( "Mailbox" ) ); | 99 | folderView->addColumn( tr( "Mailbox" ) ); |
100 | 100 | ||
101 | //layout->addWidget( folderView ); | 101 | //layout->addWidget( folderView ); |
102 | 102 | ||
103 | mailView = new QListView( split ); | 103 | mailView = new QListView( split ); |
104 | mailView->addColumn( tr( "" ) ); | 104 | mailView->addColumn( tr( " " ) ); |
105 | mailView->addColumn( tr( "Subject" ),QListView::Manual ); | 105 | mailView->addColumn( tr( "Subject" ),QListView::Manual ); |
106 | mailView->addColumn( tr( "Sender" ),QListView::Manual ); | 106 | mailView->addColumn( tr( "Sender" ),QListView::Manual ); |
107 | mailView->addColumn( tr( "Size" ),QListView::Manual); | 107 | mailView->addColumn( tr( "Size" ),QListView::Manual); |
108 | mailView->addColumn( tr( "Date" )); | 108 | mailView->addColumn( tr( "Date" ),QListView::Manual); |
109 | mailView->setAllColumnsShowFocus(true); | 109 | mailView->setAllColumnsShowFocus(true); |
110 | //mailView->setSorting(-1); | 110 | //mailView->setSorting(-1); |
111 | 111 | mailView->setRootIsDecorated( false ); | |
112 | statusWidget = new StatusWidget( wrapperBox ); | 112 | statusWidget = new StatusWidget( wrapperBox ); |
113 | statusWidget->hide(); | 113 | statusWidget->hide(); |
114 | 114 | ||
115 | //layout->addWidget( mailView ); | 115 | //layout->addWidget( mailView ); |
116 | //layout->setStretchFactor( folderView, 1 ); | 116 | //layout->setStretchFactor( folderView, 1 ); |
117 | //layout->setStretchFactor( mailView, 2 ); | 117 | //layout->setStretchFactor( mailView, 2 ); |
118 | 118 | ||
119 | slotAdjustLayout(); | 119 | slotAdjustLayout(); |
120 | #ifndef DESKTOP_VERSION | 120 | #ifndef DESKTOP_VERSION |
121 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); | 121 | QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); |
122 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); | 122 | QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); |
123 | #endif | 123 | #endif |
124 | connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, | 124 | connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, |
125 | SLOT( mailLeftClicked(QListViewItem*) ) ); | 125 | SLOT( mailLeftClicked(QListViewItem*) ) ); |
126 | connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, | 126 | connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, |
127 | SLOT( mailLeftClicked(QListViewItem*) ) ); | 127 | SLOT( mailLeftClicked(QListViewItem*) ) ); |
128 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, | 128 | connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, |
129 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); | 129 | SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); |
130 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), | 130 | connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), |
131 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); | 131 | this,SLOT(refreshMailView(const QValueList<RecMailP>&))); |
132 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); | 132 | connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); |
133 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); | 133 | connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); |
134 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); | 134 | // connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); |
135 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); | 135 | connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); |
136 | mailView->setMultiSelection ( true ); | 136 | mailView->setMultiSelection ( true ); |
137 | //mailView->setSelectionMode( QListView::Extended ); | 137 | //mailView->setSelectionMode( QListView::Extended ); |
138 | QValueList<int> list; | 138 | QValueList<int> list; |
139 | int fw = 100; | 139 | int fw = 100; |
140 | if ( QApplication::desktop()->width() > 320 ) | 140 | if ( QApplication::desktop()->width() > 320 ) |
141 | fw = 50; | 141 | fw = 50; |
142 | list.append( fw ); | 142 | list.append( fw ); |
143 | list.append( 100 ); | 143 | list.append( 100 ); |
144 | split->setSizes( list ); | 144 | split->setSizes( list ); |
145 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); | 145 | QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); |
146 | mailView->setShowSortIndicator ( true ); | 146 | mailView->setShowSortIndicator ( true ); |
147 | } | 147 | } |
148 | 148 | ||
149 | MainWindow::~MainWindow() | 149 | MainWindow::~MainWindow() |
150 | { | 150 | { |
151 | } | 151 | } |
152 | 152 | ||
153 | void MainWindow::appMessage(const QCString &, const QByteArray &) | 153 | void MainWindow::appMessage(const QCString &, const QByteArray &) |
154 | { | 154 | { |
155 | qDebug("appMessage implemented by subclass"); | 155 | qDebug("appMessage implemented by subclass"); |
156 | } | 156 | } |
157 | 157 | ||
158 | void MainWindow::slotAdjustLayout() { | 158 | void MainWindow::slotAdjustLayout() { |
159 | 159 | ||
160 | /* | 160 | /* |
161 | QWidget *d = QApplication::desktop(); | 161 | QWidget *d = QApplication::desktop(); |
162 | 162 | ||
163 | if ( d->width() < d->height() ) { | 163 | if ( d->width() < d->height() ) { |
164 | layout->setDirection( QBoxLayout::TopToBottom ); | 164 | layout->setDirection( QBoxLayout::TopToBottom ); |
165 | } else { | 165 | } else { |
166 | layout->setDirection( QBoxLayout::LeftToRight ); | 166 | layout->setDirection( QBoxLayout::LeftToRight ); |
167 | } | 167 | } |
168 | */ | 168 | */ |
169 | } | 169 | } |
170 | 170 | ||
171 | void MainWindow::slotAdjustColumns() | 171 | void MainWindow::slotAdjustColumns() |
172 | { | 172 | { |
173 | bool hidden = folderView->isHidden(); | 173 | bool hidden = folderView->isHidden(); |
174 | if ( hidden ) folderView->show(); | 174 | if ( hidden ) folderView->show(); |
175 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); | 175 | folderView->setColumnWidth( 0, folderView->visibleWidth() ); |
176 | if ( hidden ) folderView->hide(); | 176 | if ( hidden ) folderView->hide(); |
177 | 177 | ||
178 | mailView->setColumnWidth( 0, 10 ); | 178 | mailView->setColumnWidth( 0, 10 ); |
179 | mailView->setColumnWidth( 1, mailView->visibleWidth() - 130 ); | 179 | mailView->setColumnWidth( 1, 80 ); |
180 | mailView->setColumnWidth( 2, 80 ); | 180 | mailView->setColumnWidth( 2, 80 ); |
181 | mailView->setColumnWidth( 3, 50 ); | 181 | mailView->setColumnWidth( 3, 50 ); |
182 | mailView->setColumnWidth( 4, 50 ); | 182 | mailView->setColumnWidth( 4, 50 ); |
183 | } | 183 | } |
184 | 184 | ||
185 | void MainWindow::slotEditSettings() | 185 | void MainWindow::slotEditSettings() |
186 | { | 186 | { |
187 | } | 187 | } |
188 | 188 | ||
189 | void MainWindow::slotShowFolders( bool ) | 189 | void MainWindow::slotShowFolders( bool ) |
190 | { | 190 | { |
191 | qDebug("not implemented: "); | 191 | qDebug("not implemented: "); |
192 | } | 192 | } |
193 | 193 | ||
194 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) | 194 | void MainWindow::refreshMailView(const QValueList<RecMailP>&) |
195 | { | 195 | { |
196 | qDebug("not implemented: "); | 196 | qDebug("not implemented: "); |
197 | } | 197 | } |
198 | 198 | ||
199 | void MainWindow::mailLeftClicked(QListViewItem * ) | 199 | void MainWindow::mailLeftClicked(QListViewItem * ) |
200 | { | 200 | { |
201 | qDebug("not implemented: "); | 201 | qDebug("not implemented: "); |
202 | } | 202 | } |
203 | 203 | ||
204 | void MainWindow::displayMail() | 204 | void MainWindow::displayMail() |
205 | { | 205 | { |
206 | qDebug("not implemented: "); | 206 | qDebug("not implemented: "); |
207 | } | 207 | } |
208 | 208 | ||
209 | void MainWindow::slotDeleteMail() | 209 | void MainWindow::slotDeleteMail() |
210 | { | 210 | { |
211 | qDebug("not implemented: "); | 211 | qDebug("not implemented: "); |
212 | } | 212 | } |
213 | 213 | ||
214 | void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) | 214 | void MainWindow::mailHold(int, QListViewItem *,const QPoint&,int ) |
215 | { | 215 | { |
216 | qDebug("not implemented: "); | 216 | qDebug("not implemented: "); |
217 | } | 217 | } |
218 | 218 | ||
219 | void MainWindow::slotSendQueued() | 219 | void MainWindow::slotSendQueued() |
220 | { | 220 | { |
221 | qDebug("not implemented: "); | 221 | qDebug("not implemented: "); |
222 | } | 222 | } |
223 | 223 | ||
224 | void MainWindow::slotEditAccounts() | 224 | void MainWindow::slotEditAccounts() |
225 | { | 225 | { |
226 | qDebug("not implemented: "); | 226 | qDebug("not implemented: "); |
227 | } | 227 | } |