summaryrefslogtreecommitdiffabout
path: root/kmicromail/mainwindow.cpp
Unidiff
Diffstat (limited to 'kmicromail/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/mainwindow.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp
index 5f777a3..d130317 100644
--- a/kmicromail/mainwindow.cpp
+++ b/kmicromail/mainwindow.cpp
@@ -63,193 +63,194 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
63 0, 0, this, 0, true ); 63 0, 0, this, 0, true );
64 showFolders->addTo( toolBar ); 64 showFolders->addTo( toolBar );
65 showFolders->addTo( mailMenu ); 65 showFolders->addTo( mailMenu );
66 showFolders->setOn( true ); 66 showFolders->setOn( true );
67 connect(showFolders, SIGNAL( toggled(bool) ), 67 connect(showFolders, SIGNAL( toggled(bool) ),
68 SLOT( slotShowFolders(bool) ) ); 68 SLOT( slotShowFolders(bool) ) );
69 69
70 /* 70 /*
71 searchMails = new QAction( tr( "Search mails" ), SmallIcon("find") ), 71 searchMails = new QAction( tr( "Search mails" ), SmallIcon("find") ),
72 0, 0, this ); 72 0, 0, this );
73 searchMails->addTo( toolBar ); 73 searchMails->addTo( toolBar );
74 searchMails->addTo( mailMenu ); 74 searchMails->addTo( mailMenu );
75 */ 75 */
76 76
77 deleteMails = new QAction(tr("Delete Mail"), SmallIcon("trash"), 0, 0, this); 77 deleteMails = new QAction(tr("Delete Mail"), SmallIcon("trash"), 0, 0, this);
78 deleteMails->addTo( toolBar ); 78 deleteMails->addTo( toolBar );
79 deleteMails->addTo( mailMenu ); 79 deleteMails->addTo( mailMenu );
80 connect( deleteMails, SIGNAL( activated() ), 80 connect( deleteMails, SIGNAL( activated() ),
81 SLOT( slotDeleteMail() ) ); 81 SLOT( slotDeleteMail() ) );
82 82
83 editSettings = new QAction( tr( "Edit settings" ), SmallIcon("SettingsIcon") , 83 editSettings = new QAction( tr( "Edit settings" ), SmallIcon("SettingsIcon") ,
84 0, 0, this ); 84 0, 0, this );
85 editSettings->addTo( settingsMenu ); 85 editSettings->addTo( settingsMenu );
86 connect( editSettings, SIGNAL( activated() ), 86 connect( editSettings, SIGNAL( activated() ),
87 SLOT( slotEditSettings() ) ); 87 SLOT( slotEditSettings() ) );
88 editAccounts = new QAction( tr( "Configure accounts" ), SmallIcon("editaccounts") , 88 editAccounts = new QAction( tr( "Configure accounts" ), SmallIcon("editaccounts") ,
89 0, 0, this ); 89 0, 0, this );
90 editAccounts->addTo( settingsMenu ); 90 editAccounts->addTo( settingsMenu );
91 91
92 //setCentralWidget( view ); 92 //setCentralWidget( view );
93 93
94 QVBox* wrapperBox = new QVBox( this ); 94 QVBox* wrapperBox = new QVBox( this );
95 setCentralWidget( wrapperBox ); 95 setCentralWidget( wrapperBox );
96 96
97 // QWidget *view = new QWidget( wrapperBox ); 97 // QWidget *view = new QWidget( wrapperBox );
98 KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, wrapperBox); 98 KDGanttMinimizeSplitter* split = new KDGanttMinimizeSplitter( Qt::Horizontal, wrapperBox);
99 split->setMinimizeDirection( KDGanttMinimizeSplitter::Left); 99 split->setMinimizeDirection( KDGanttMinimizeSplitter::Left);
100 //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight ); 100 //layout = new QBoxLayout ( split, QBoxLayout::LeftToRight );
101 101
102 folderView = new AccountView( split ); 102 folderView = new AccountView( split );
103 folderView->header()->hide(); 103 folderView->header()->hide();
104 folderView->setRootIsDecorated( false ); 104 folderView->setRootIsDecorated( false );
105 folderView->addColumn( tr( "Mailbox" ) ); 105 folderView->addColumn( tr( "Mailbox" ) );
106 106
107 //layout->addWidget( folderView ); 107 //layout->addWidget( folderView );
108 108
109 mailView = new QListView( split ); 109 mailView = new QListView( split );
110 mailView->addColumn( tr( " " ) ); 110 mailView->addColumn( tr( " " ) );
111 mailView->addColumn( tr( "Subject" ),QListView::Manual ); 111 mailView->addColumn( tr( "Subject" ),QListView::Manual );
112 mailView->addColumn( tr( "Sender" ),QListView::Manual ); 112 mailView->addColumn( tr( "Sender" ),QListView::Manual );
113 mailView->addColumn( tr( "Size" ),QListView::Manual); 113 mailView->addColumn( tr( "Size" ),QListView::Manual);
114 mailView->addColumn( tr( "Date" ),QListView::Manual); 114 mailView->addColumn( tr( "Date" ),QListView::Manual);
115 mailView->setAllColumnsShowFocus(true); 115 mailView->setAllColumnsShowFocus(true);
116 //mailView->setSorting(-1); 116 //mailView->setSorting(-1);
117 mailView->setRootIsDecorated( false ); 117 mailView->setRootIsDecorated( false );
118 statusWidget = new StatusWidget( wrapperBox ); 118 statusWidget = new StatusWidget( wrapperBox );
119 statusWidget->hide(); 119 statusWidget->hide();
120 120
121 //layout->addWidget( mailView ); 121 //layout->addWidget( mailView );
122 //layout->setStretchFactor( folderView, 1 ); 122 //layout->setStretchFactor( folderView, 1 );
123 //layout->setStretchFactor( mailView, 2 ); 123 //layout->setStretchFactor( mailView, 2 );
124 124
125 slotAdjustLayout(); 125 slotAdjustLayout();
126#ifndef DESKTOP_VERSION 126#ifndef DESKTOP_VERSION
127 QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold); 127 QPEApplication::setStylusOperation( mailView->viewport(),QPEApplication::RightOnHold);
128 QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold); 128 QPEApplication::setStylusOperation( folderView->viewport(),QPEApplication::RightOnHold);
129#endif 129#endif
130 connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this, 130 connect( mailView, SIGNAL( doubleClicked (QListViewItem* )),this,
131 SLOT( mailLeftClicked(QListViewItem*) ) ); 131 SLOT( mailLeftClicked(QListViewItem*) ) );
132 connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this, 132 connect( mailView, SIGNAL( returnPressed (QListViewItem* )),this,
133 SLOT( mailLeftClicked(QListViewItem*) ) ); 133 SLOT( mailLeftClicked(QListViewItem*) ) );
134 connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this, 134 connect( mailView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int) ),this,
135 SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) ); 135 SLOT( mailHold(int,QListViewItem*,const QPoint&,int) ) );
136 connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)), 136 connect(folderView, SIGNAL(refreshMailview(const QValueList<RecMailP>&)),
137 this,SLOT(refreshMailView(const QValueList<RecMailP>&))); 137 this,SLOT(refreshMailView(const QValueList<RecMailP>&)));
138 connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); 138 connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) );
139 connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); 139 connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) );
140// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); 140// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) );
141 connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); 141 connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) );
142 //mailView->setMultiSelection ( true ); 142 //mailView->setMultiSelection ( true );
143 mailView->setSelectionMode( QListView::Extended ); 143 mailView->setSelectionMode( QListView::Extended );
144 QValueList<int> list; 144 QValueList<int> list;
145 int fw = 100; 145 int fw = 100;
146 if ( QApplication::desktop()->width() > 320 ) 146 if ( QApplication::desktop()->width() > 320 )
147 fw = 50; 147 fw = 50;
148 list.append( fw ); 148 list.append( fw );
149 list.append( 100 ); 149 list.append( 100 );
150 split->setSizes( list ); 150 split->setSizes( list );
151 QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); 151 QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) );
152 mailView->setShowSortIndicator ( true ); 152 mailView->setShowSortIndicator ( true );
153 QLabel *spacer = new QLabel( toolBar ); 153 QLabel *spacer = new QLabel( toolBar );
154 spacer->setBackgroundMode( QWidget::PaletteButton ); 154 spacer->setBackgroundMode( QWidget::PaletteButton );
155 toolBar->setStretchableWidget( spacer ); 155 toolBar->setStretchableWidget( spacer );
156 156
157 QAction* closeMail = new QAction(tr("Close"),SmallIcon("exit"), 0, 0, this); 157 QAction* closeMail = new QAction(tr("Close"),SmallIcon("exit"), 0, 0, this);
158 connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); 158 connect( closeMail, SIGNAL( activated() ), SLOT( close() ) );
159 closeMail->addTo(toolBar); 159 if ( QApplication::desktop()->width() > 320 )
160 closeMail->addTo(toolBar);
160 closeMail->addTo(mailMenu); 161 closeMail->addTo(mailMenu);
161 162
162 163
163 QPopupMenu* helpMenu = new QPopupMenu( menuBar ); 164 QPopupMenu* helpMenu = new QPopupMenu( menuBar );
164 menuBar->insertItem( tr( "Help" ), helpMenu ); 165 menuBar->insertItem( tr( "Help" ), helpMenu );
165 QAction* li = new QAction(tr("About"), QPixmap(), 0, 0, this); 166 QAction* li = new QAction(tr("About"), QPixmap(), 0, 0, this);
166 connect( li, SIGNAL( activated() ), SLOT( showAbout()) ); 167 connect( li, SIGNAL( activated() ), SLOT( showAbout()) );
167 li->addTo(helpMenu); 168 li->addTo(helpMenu);
168 li = new QAction(tr("Licence"),QPixmap(), 0, 0, this); 169 li = new QAction(tr("Licence"),QPixmap(), 0, 0, this);
169 connect( li, SIGNAL( activated() ), SLOT( showLicence()) ); 170 connect( li, SIGNAL( activated() ), SLOT( showLicence()) );
170 li->addTo(helpMenu); 171 li->addTo(helpMenu);
171 li = new QAction(tr("LibEtPan Licence"), QPixmap(), 0, 0, this); 172 li = new QAction(tr("LibEtPan Licence"), QPixmap(), 0, 0, this);
172 connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) ); 173 connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) );
173 li->addTo(helpMenu); 174 li->addTo(helpMenu);
174} 175}
175 176
176MainWindow::~MainWindow() 177MainWindow::~MainWindow()
177{ 178{
178} 179}
179 180
180void MainWindow::showLicence() 181void MainWindow::showLicence()
181{ 182{
182 KApplication::showLicence(); 183 KApplication::showLicence();
183} 184}
184void MainWindow::showAbout() 185void MainWindow::showAbout()
185{ 186{
186 QString version; 187 QString version;
187#include <../version> 188#include <../version>
188 189
189 QString cap = "About KOpieMail/Pi"; 190 QString cap = "About KOpieMail/Pi";
190 QString text =i18n("KOpieMail/Platform-independent\n") + 191 QString text =i18n("KOpieMail/Platform-independent\n") +
191 "(OM/Pi) " + version + " - " 192 "(OM/Pi) " + version + " - "
192 193
193#ifdef DESKTOP_VERSION 194#ifdef DESKTOP_VERSION
194 "Desktop Edition\n" 195 "Desktop Edition\n"
195#else 196#else
196 "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n" 197 "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n"
197#endif 198#endif
198 "www.pi-sync.net\n\n" 199 "www.pi-sync.net\n\n"
199 200
200 201
201 202
202"Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.net>\n" 203"Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.net>\n"
203 "KOpieMail/Pi is based on Opie Mail\n" 204 "KOpieMail/Pi is based on Opie Mail\n"
204 "Copyright (c) Rajko Albrecht and the Opie team\n" 205 "Copyright (c) Rajko Albrecht and the Opie team\n"
205 "KOpieMail/Pi is licensed under the GPL\n" 206 "KOpieMail/Pi is licensed under the GPL\n"
206 "\n" 207 "\n"
207 "KOpieMail/Pi uses LibEtPan - a mail stuff library\n" 208 "KOpieMail/Pi uses LibEtPan - a mail stuff library\n"
208 "Copyright (C) 2001, 2002 - DINH Viet Hoa\n" 209 "Copyright (C) 2001, 2002 - DINH Viet Hoa\n"
209 "libEtPan has its own licence - see LibEtPan licence\n"; 210 "libEtPan has its own licence - see LibEtPan licence\n";
210 211
211 KApplication::showText( cap, text ); 212 KApplication::showText( cap, text );
212} 213}
213void MainWindow::showEtpanLicence() 214void MainWindow::showEtpanLicence()
214{ 215{
215 KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" ); 216 KApplication::showFile( "LibEtPan licence", "kdepim/kopiemail/COPYRIGHTlibetpan" );
216 217
217} 218}
218void MainWindow::appMessage(const QCString &, const QByteArray &) 219void MainWindow::appMessage(const QCString &, const QByteArray &)
219{ 220{
220 qDebug("appMessage implemented by subclass"); 221 qDebug("appMessage implemented by subclass");
221} 222}
222 223
223void MainWindow::slotAdjustLayout() { 224void MainWindow::slotAdjustLayout() {
224 225
225 /* 226 /*
226 QWidget *d = QApplication::desktop(); 227 QWidget *d = QApplication::desktop();
227 228
228 if ( d->width() < d->height() ) { 229 if ( d->width() < d->height() ) {
229 layout->setDirection( QBoxLayout::TopToBottom ); 230 layout->setDirection( QBoxLayout::TopToBottom );
230 } else { 231 } else {
231 layout->setDirection( QBoxLayout::LeftToRight ); 232 layout->setDirection( QBoxLayout::LeftToRight );
232 } 233 }
233 */ 234 */
234} 235}
235 236
236void MainWindow::slotAdjustColumns() 237void MainWindow::slotAdjustColumns()
237{ 238{
238 bool hidden = folderView->isHidden(); 239 bool hidden = folderView->isHidden();
239 if ( hidden ) folderView->show(); 240 if ( hidden ) folderView->show();
240 folderView->setColumnWidth( 0, folderView->visibleWidth() ); 241 folderView->setColumnWidth( 0, folderView->visibleWidth() );
241 if ( hidden ) folderView->hide(); 242 if ( hidden ) folderView->hide();
242 243
243 mailView->setColumnWidth( 0, 10 ); 244 mailView->setColumnWidth( 0, 10 );
244 mailView->setColumnWidth( 1, 100 ); 245 mailView->setColumnWidth( 1, 100 );
245 mailView->setColumnWidth( 2, 100 ); 246 mailView->setColumnWidth( 2, 100 );
246 mailView->setColumnWidth( 3, 50 ); 247 mailView->setColumnWidth( 3, 50 );
247 mailView->setColumnWidth( 4, 120 ); 248 mailView->setColumnWidth( 4, 120 );
248} 249}
249 250
250void MainWindow::slotEditSettings() 251void MainWindow::slotEditSettings()
251{ 252{
252} 253}
253 254
254void MainWindow::slotShowFolders( bool ) 255void MainWindow::slotShowFolders( bool )
255{ 256{