summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--kmicromail/mainwindow.cpp27
-rw-r--r--microkde/kapplication.cpp9
-rw-r--r--microkde/kapplication.h1
3 files changed, 34 insertions, 3 deletions
diff --git a/kmicromail/mainwindow.cpp b/kmicromail/mainwindow.cpp
index 24196b4..e020297 100644
--- a/kmicromail/mainwindow.cpp
+++ b/kmicromail/mainwindow.cpp
@@ -131,97 +131,122 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags flags )
131 connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) ); 131 connect( composeMail, SIGNAL( activated() ), SLOT( slotComposeMail() ) );
132 connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) ); 132 connect( sendQueued, SIGNAL( activated() ), SLOT( slotSendQueued() ) );
133// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) ); 133// connect( searchMails, SIGNAL( activated() ), SLOT( slotSearchMails() ) );
134 connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) ); 134 connect( editAccounts, SIGNAL( activated() ), SLOT( slotEditAccounts() ) );
135 //mailView->setMultiSelection ( true ); 135 //mailView->setMultiSelection ( true );
136 mailView->setSelectionMode( QListView::Extended ); 136 mailView->setSelectionMode( QListView::Extended );
137 QValueList<int> list; 137 QValueList<int> list;
138 int fw = 100; 138 int fw = 100;
139 if ( QApplication::desktop()->width() > 320 ) 139 if ( QApplication::desktop()->width() > 320 )
140 fw = 50; 140 fw = 50;
141 list.append( fw ); 141 list.append( fw );
142 list.append( 100 ); 142 list.append( 100 );
143 split->setSizes( list ); 143 split->setSizes( list );
144 QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) ); 144 QTimer::singleShot( 1000, this, SLOT( slotAdjustColumns() ) );
145 mailView->setShowSortIndicator ( true ); 145 mailView->setShowSortIndicator ( true );
146 QLabel *spacer = new QLabel( toolBar ); 146 QLabel *spacer = new QLabel( toolBar );
147 spacer->setBackgroundMode( QWidget::PaletteButton ); 147 spacer->setBackgroundMode( QWidget::PaletteButton );
148 toolBar->setStretchableWidget( spacer ); 148 toolBar->setStretchableWidget( spacer );
149 149
150 QAction* closeMail = new QAction(tr("Close"),SmallIcon("exit"), 0, 0, this); 150 QAction* closeMail = new QAction(tr("Close"),SmallIcon("exit"), 0, 0, this);
151 connect( closeMail, SIGNAL( activated() ), SLOT( close() ) ); 151 connect( closeMail, SIGNAL( activated() ), SLOT( close() ) );
152 closeMail->addTo(toolBar); 152 closeMail->addTo(toolBar);
153 closeMail->addTo(mailMenu); 153 closeMail->addTo(mailMenu);
154 154
155 155
156 QPopupMenu* helpMenu = new QPopupMenu( menuBar ); 156 QPopupMenu* helpMenu = new QPopupMenu( menuBar );
157 menuBar->insertItem( tr( "Help" ), helpMenu ); 157 menuBar->insertItem( tr( "Help" ), helpMenu );
158 QAction* li = new QAction(tr("About"), QPixmap(), 0, 0, this); 158 QAction* li = new QAction(tr("About"), QPixmap(), 0, 0, this);
159 connect( li, SIGNAL( activated() ), SLOT( showAbout()) ); 159 connect( li, SIGNAL( activated() ), SLOT( showAbout()) );
160 li->addTo(helpMenu); 160 li->addTo(helpMenu);
161 li = new QAction(tr("Licence"),QPixmap(), 0, 0, this); 161 li = new QAction(tr("Licence"),QPixmap(), 0, 0, this);
162 connect( li, SIGNAL( activated() ), SLOT( showLicence()) ); 162 connect( li, SIGNAL( activated() ), SLOT( showLicence()) );
163 li->addTo(helpMenu); 163 li->addTo(helpMenu);
164 li = new QAction(tr("LibEtPan Licence"), QPixmap(), 0, 0, this); 164 li = new QAction(tr("LibEtPan Licence"), QPixmap(), 0, 0, this);
165 connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) ); 165 connect( li, SIGNAL( activated() ), SLOT( showEtpanLicence()) );
166 li->addTo(helpMenu); 166 li->addTo(helpMenu);
167} 167}
168 168
169MainWindow::~MainWindow() 169MainWindow::~MainWindow()
170{ 170{
171} 171}
172 172
173void MainWindow::showLicence() 173void MainWindow::showLicence()
174{ 174{
175 KApplication::showLicence(); 175 KApplication::showLicence();
176} 176}
177void MainWindow::showAbout() 177void MainWindow::showAbout()
178{ 178{
179 qDebug("MainWindow::showAbout() "); 179 QString version;
180#include <../version>
181
182 QString cap = "About KOpieMail/Pi";
183 QString text =i18n("KOpieMail/Platform-independent\n") +
184 "(OM/Pi) " + version + " - "
185
186#ifdef DESKTOP_VERSION
187 "Desktop Edition\n"
188#else
189 "PDA-Edition\nfor: Zaurus 5x00 / 7x0 / 8x0\n"
190#endif
191 "www.pi-sync.net\n\n"
192
193
194
195"Copyright (c) 2004 Lutz Rogowski <lutz@pi-sync.net>\n"
196 "KOpieMail/Pi is based on Opie Mail\n"
197 "Copyright (c) Rajko Albrecht and the Opie team\n"
198 "KOpieMail/Pi is licensed under the GPL\n"
199 "\n"
200 "KOpieMail/Pi uses LibEtPan - a mail stuff library\n"
201 "Copyright (C) 2001, 2002 - DINH Viet Hoa\n"
202 "libEtPan has its own licence - see LibEtPan licence\n";
203
204 KApplication::showText( cap, text );
180} 205}
181void MainWindow::showEtpanLicence() 206void MainWindow::showEtpanLicence()
182{ 207{
183 KApplication::showFile( "LibEtPan licence", "kdepim/kmicromail/COPYRIGHTlibetpan" ); 208 KApplication::showFile( "LibEtPan licence", "kdepim/kmicromail/COPYRIGHTlibetpan" );
184 209
185} 210}
186void MainWindow::appMessage(const QCString &, const QByteArray &) 211void MainWindow::appMessage(const QCString &, const QByteArray &)
187{ 212{
188 qDebug("appMessage implemented by subclass"); 213 qDebug("appMessage implemented by subclass");
189} 214}
190 215
191void MainWindow::slotAdjustLayout() { 216void MainWindow::slotAdjustLayout() {
192 217
193 /* 218 /*
194 QWidget *d = QApplication::desktop(); 219 QWidget *d = QApplication::desktop();
195 220
196 if ( d->width() < d->height() ) { 221 if ( d->width() < d->height() ) {
197 layout->setDirection( QBoxLayout::TopToBottom ); 222 layout->setDirection( QBoxLayout::TopToBottom );
198 } else { 223 } else {
199 layout->setDirection( QBoxLayout::LeftToRight ); 224 layout->setDirection( QBoxLayout::LeftToRight );
200 } 225 }
201 */ 226 */
202} 227}
203 228
204void MainWindow::slotAdjustColumns() 229void MainWindow::slotAdjustColumns()
205{ 230{
206 bool hidden = folderView->isHidden(); 231 bool hidden = folderView->isHidden();
207 if ( hidden ) folderView->show(); 232 if ( hidden ) folderView->show();
208 folderView->setColumnWidth( 0, folderView->visibleWidth() ); 233 folderView->setColumnWidth( 0, folderView->visibleWidth() );
209 if ( hidden ) folderView->hide(); 234 if ( hidden ) folderView->hide();
210 235
211 mailView->setColumnWidth( 0, 10 ); 236 mailView->setColumnWidth( 0, 10 );
212 mailView->setColumnWidth( 1, 100 ); 237 mailView->setColumnWidth( 1, 100 );
213 mailView->setColumnWidth( 2, 100 ); 238 mailView->setColumnWidth( 2, 100 );
214 mailView->setColumnWidth( 3, 50 ); 239 mailView->setColumnWidth( 3, 50 );
215 mailView->setColumnWidth( 4, 120 ); 240 mailView->setColumnWidth( 4, 120 );
216} 241}
217 242
218void MainWindow::slotEditSettings() 243void MainWindow::slotEditSettings()
219{ 244{
220} 245}
221 246
222void MainWindow::slotShowFolders( bool ) 247void MainWindow::slotShowFolders( bool )
223{ 248{
224 qDebug("not implemented: "); 249 qDebug("not implemented: ");
225} 250}
226 251
227void MainWindow::refreshMailView(const QValueList<RecMailP>&) 252void MainWindow::refreshMailView(const QValueList<RecMailP>&)
diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp
index ad0b78e..98ef2f2 100644
--- a/microkde/kapplication.cpp
+++ b/microkde/kapplication.cpp
@@ -15,65 +15,70 @@ int KApplication::random()
15 return rand(); 15 return rand();
16} 16}
17 17
18//US 18//US
19QString KApplication::randomString(int length) 19QString KApplication::randomString(int length)
20{ 20{
21 if (length <=0 ) return QString::null; 21 if (length <=0 ) return QString::null;
22 22
23 QString str; 23 QString str;
24 while (length--) 24 while (length--)
25 { 25 {
26 int r=random() % 62; 26 int r=random() % 62;
27 r+=48; 27 r+=48;
28 if (r>57) r+=7; 28 if (r>57) r+=7;
29 if (r>90) r+=6; 29 if (r>90) r+=6;
30 str += char(r); 30 str += char(r);
31 // so what if I work backwards? 31 // so what if I work backwards?
32 } 32 }
33 return str; 33 return str;
34} 34}
35int KApplication::execDialog( QDialog* d ) 35int KApplication::execDialog( QDialog* d )
36{ 36{
37 if (QApplication::desktop()->width() <= 640 ) 37 if (QApplication::desktop()->width() <= 640 )
38 d->showMaximized(); 38 d->showMaximized();
39 return d->exec(); 39 return d->exec();
40} 40}
41void KApplication::showLicence() 41void KApplication::showLicence()
42{ 42{
43 KApplication::showFile( "KDE-Pim/Pi licence", "kdepim/LICENCE.TXT" ); 43 KApplication::showFile( "KDE-Pim/Pi licence", "kdepim/LICENCE.TXT" );
44} 44}
45 45
46void KApplication::showFile(QString caption, QString fn) 46void KApplication::showFile(QString caption, QString fn)
47{ 47{
48 QString text; 48 QString text;
49 QString fileName; 49 QString fileName;
50#ifndef DESKTOP_VERSION 50#ifndef DESKTOP_VERSION
51 fileName = getenv("QPEDIR"); 51 fileName = getenv("QPEDIR");
52 fileName += "/pics/" + fn ; 52 fileName += "/pics/" + fn ;
53#else 53#else
54 fileName = qApp->applicationDirPath () + "/" + fn; 54 fileName = qApp->applicationDirPath () + "/" + fn;
55#endif 55#endif
56 QFile file( fileName ); 56 QFile file( fileName );
57 if (!file.open( IO_ReadOnly ) ) { 57 if (!file.open( IO_ReadOnly ) ) {
58 return ; 58 return ;
59 } 59 }
60 QTextStream ts( &file ); 60 QTextStream ts( &file );
61 text = ts.read(); 61 text = ts.read();
62 file.close(); 62 file.close();
63 63 KApplication::showText( caption, text );
64
65}
66
67void KApplication::showText(QString caption, QString text)
68{
64 QDialog dia( 0, "name", true ); ; 69 QDialog dia( 0, "name", true ); ;
65 dia.setCaption( caption ); 70 dia.setCaption( caption );
66 QVBoxLayout* lay = new QVBoxLayout( &dia ); 71 QVBoxLayout* lay = new QVBoxLayout( &dia );
67 lay->setSpacing( 3 ); 72 lay->setSpacing( 3 );
68 lay->setMargin( 3 ); 73 lay->setMargin( 3 );
69 QTextBrowser tb ( &dia ); 74 QTextBrowser tb ( &dia );
70 lay->addWidget( &tb ); 75 lay->addWidget( &tb );
71 tb.setText( text ); 76 tb.setText( text );
72#ifdef DESKTOP_VERSION 77#ifdef DESKTOP_VERSION
73 dia.resize( 640, 480); 78 dia.resize( 640, 480);
74#else 79#else
75 dia.showMaximized(); 80 dia.showMaximized();
76#endif 81#endif
77 dia.exec(); 82 dia.exec();
78 83
79} 84}
diff --git a/microkde/kapplication.h b/microkde/kapplication.h
index 5ae5c00..79cdb33 100644
--- a/microkde/kapplication.h
+++ b/microkde/kapplication.h
@@ -1,25 +1,26 @@
1#ifndef MINIKDE_KAPPLICATION_H 1#ifndef MINIKDE_KAPPLICATION_H
2#define MINIKDE_KAPPLICATION_H 2#define MINIKDE_KAPPLICATION_H
3 3
4#include "qstring.h" 4#include "qstring.h"
5#include <qdialog.h> 5#include <qdialog.h>
6 6
7class KApplication 7class KApplication
8{ 8{
9 public: 9 public:
10 static int random(); 10 static int random();
11 11
12//US 12//US
13 /** 13 /**
14 * Generates a random string. It operates in the range [A-Za-z0-9] 14 * Generates a random string. It operates in the range [A-Za-z0-9]
15 * @param length Generate a string of this length. 15 * @param length Generate a string of this length.
16 * @return the random string 16 * @return the random string
17 */ 17 */
18 static QString randomString(int length); 18 static QString randomString(int length);
19 static int execDialog( QDialog* ); 19 static int execDialog( QDialog* );
20 static void showLicence(); 20 static void showLicence();
21 static void showFile(QString caption, QString file); 21 static void showFile(QString caption, QString file);
22 static void showText(QString caption, QString text);
22}; 23};
23 24
24 25
25#endif 26#endif