summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--desktop/rpm/kdepim_rpm2
-rw-r--r--korganizer/mainwindow.cpp4
-rw-r--r--microkde/ofontselector.cpp3
-rw-r--r--version2
4 files changed, 6 insertions, 5 deletions
diff --git a/desktop/rpm/kdepim_rpm b/desktop/rpm/kdepim_rpm
index 5e7783b..af64b99 100644
--- a/desktop/rpm/kdepim_rpm
+++ b/desktop/rpm/kdepim_rpm
@@ -1,84 +1,84 @@
1Summary: A collection of PIM programs 1Summary: A collection of PIM programs
2Name: KDE-Pim-Pi 2Name: KDE-Pim-Pi
3Version: 2.0.24 3Version: 2.0.25
4Release: SuSE_9.2 4Release: SuSE_9.2
5Copyright:GPL 5Copyright:GPL
6Group: Productivity/Pim 6Group: Productivity/Pim
7Source:http://sourceforge.net/projects/kdepimpi/ 7Source:http://sourceforge.net/projects/kdepimpi/
8URL:http://sourceforge.net/projects/kdepimpi/ 8URL:http://sourceforge.net/projects/kdepimpi/
9Packager: zautrix 9Packager: zautrix
10 10
11%description 11%description
12This package contains the platform-independent PIM programs from 12This package contains the platform-independent PIM programs from
13www.pi-sync.info, compiled for SuSE 9.2: 13www.pi-sync.info, compiled for SuSE 9.2:
14KTimeTacker/Pi 14KTimeTacker/Pi
15KPhone/Pi 15KPhone/Pi
16KAddressbook/Pi 16KAddressbook/Pi
17KOrganizer/Pi 17KOrganizer/Pi
18PasswordManager/Pi 18PasswordManager/Pi
19KOPieMail/Pi 19KOPieMail/Pi
20 20
21These applications do not need anything from the KDE-desktop 21These applications do not need anything from the KDE-desktop
22at all to run on Linux. However, there is a dependency from 22at all to run on Linux. However, there is a dependency from
23two KDE libs, because a small command line program is included 23two KDE libs, because a small command line program is included
24to make it possible to sync with the KDE-desktop applications. 24to make it possible to sync with the KDE-desktop applications.
25 25
26These applications are independent from the KDE-desktop 26These applications are independent from the KDE-desktop
27environment. That means, nothing of your existing 27environment. That means, nothing of your existing
28KDE-desktop setup will be changed, or any data 28KDE-desktop setup will be changed, or any data
29(calendar-addressbook) used by the KDE-desktop 29(calendar-addressbook) used by the KDE-desktop
30applications will be changed or accessed. 30applications will be changed or accessed.
31These applications stores their data and config in 31These applications stores their data and config in
32$HOME/kdepim/ 32$HOME/kdepim/
33However, because the same file format is used, 33However, because the same file format is used,
34an easy exchange of data with the KDE-desktop 34an easy exchange of data with the KDE-desktop
35is possible. 35is possible.
36A small command line program is included 36A small command line program is included
37to make it possible to sync with the KDE-desktop applications. 37to make it possible to sync with the KDE-desktop applications.
38You do not need to call this program from the commandline, 38You do not need to call this program from the commandline,
39it is called from the KDE-Pim/Pi apps when you choose there: 39it is called from the KDE-Pim/Pi apps when you choose there:
40Sync with KDE_Desktop. 40Sync with KDE_Desktop.
41If something is going wrong, please start the 41If something is going wrong, please start the
42KDE-Pim/Pi program itself from the console to get detailed output. 42KDE-Pim/Pi program itself from the console to get detailed output.
43 43
44After installation, you should have a 44After installation, you should have a
45PIM-pi 45PIM-pi
46folder in your KDE start menu, where you can 46folder in your KDE start menu, where you can
47start the applications from. 47start the applications from.
48 48
49These programs makes it possible to sync your Zaurus easily 49These programs makes it possible to sync your Zaurus easily
50(with the KDE-Pim/Pi programs running on the Zaurus) 50(with the KDE-Pim/Pi programs running on the Zaurus)
51with the KDE-desktop calendar/addressbook data. 51with the KDE-desktop calendar/addressbook data.
52If you want to use that, you have to update your 52If you want to use that, you have to update your
53KDE-desktop to version 3.3.0 or higher. 53KDE-desktop to version 3.3.0 or higher.
54SuSE 9.2 contains KDE 3.3.0 such that no update is needed. 54SuSE 9.2 contains KDE 3.3.0 such that no update is needed.
55Actually - after the (non difficult) configuration is set up - 55Actually - after the (non difficult) configuration is set up -
56with two mouseklicks on the Zaurus, 56with two mouseklicks on the Zaurus,
57the Zaurus syncs with the corresponding KDE-Pim/Pi 57the Zaurus syncs with the corresponding KDE-Pim/Pi
58program on the Linux Desktop which syncs automatically 58program on the Linux Desktop which syncs automatically
59with the KDE-desktop data. 59with the KDE-desktop data.
60 60
61If you want to use the KDE-desktop calendar/addressbook applications, 61If you want to use the KDE-desktop calendar/addressbook applications,
62just install these apps in this package and use them as a syncing tool for the 62just install these apps in this package and use them as a syncing tool for the
63Zaurus <-> KDE-desktop sync. 63Zaurus <-> KDE-desktop sync.
64The sync requires a network connection from your Zaurus to 64The sync requires a network connection from your Zaurus to
65the PC. A detailed Sync HowTo is available in the 65the PC. A detailed Sync HowTo is available in the
66Help menu of the applications. 66Help menu of the applications.
67 67
68These applications makes it also possible, that you can sync 68These applications makes it also possible, that you can sync
69(or just export the data to) your mobile phone with your 69(or just export the data to) your mobile phone with your
70data of the KDE-desktop calendar/addressbook applications. 70data of the KDE-desktop calendar/addressbook applications.
71This is tested and working for Nokia mobile phones, 71This is tested and working for Nokia mobile phones,
72it may work with others as well. 72it may work with others as well.
73(More info about that: -> Sync HowTo) 73(More info about that: -> Sync HowTo)
74 74
75NOTE: 75NOTE:
76When using SuSE 9.1 you have to update your KDE to 3.3.x 76When using SuSE 9.1 you have to update your KDE to 3.3.x
77and you have to make an online update in SuSE 9.1 to make it 77and you have to make an online update in SuSE 9.1 to make it
78possible to get the infrared connection working, such that 78possible to get the infrared connection working, such that
79you can sync your (Nokia) mobile phone via infrared. 79you can sync your (Nokia) mobile phone via infrared.
80 80
81%files 81%files
82/opt/kde3/share/applnk/PIM-pi/ 82/opt/kde3/share/applnk/PIM-pi/
83/opt/kdepimpi/ 83/opt/kdepimpi/
84/usr/lib/libmicro* 84/usr/lib/libmicro*
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 7aa3b60..9505d06 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -2247,201 +2247,201 @@ void MainWindow::loadCalendar()
2247 QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 2247 QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
2248 i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0, 2248 i18n("Backup file\ndoes not exist!\nNothing loaded!"), 0, 0,
2249 0, 1 ); 2249 0, 1 );
2250 2250
2251 return; 2251 return;
2252 } 2252 }
2253 if ( loadbup ) { 2253 if ( loadbup ) {
2254 mView->openCalendar( fn ); 2254 mView->openCalendar( fn );
2255 KOPrefs::instance()->mLastLoadFile = fn; 2255 KOPrefs::instance()->mLastLoadFile = fn;
2256 mess = i18n("KO/Pi:Loaded %1").arg(fn) ; 2256 mess = i18n("KO/Pi:Loaded %1").arg(fn) ;
2257 setCaption(mess); 2257 setCaption(mess);
2258 } 2258 }
2259 2259
2260} 2260}
2261void MainWindow::quickImportIcal() 2261void MainWindow::quickImportIcal()
2262{ 2262{
2263 importFile( KOPrefs::instance()->mLastImportFile, false ); 2263 importFile( KOPrefs::instance()->mLastImportFile, false );
2264} 2264}
2265void MainWindow::importFile( QString fn, bool quick ) 2265void MainWindow::importFile( QString fn, bool quick )
2266{ 2266{
2267 QFileInfo info; 2267 QFileInfo info;
2268 info.setFile( fn ); 2268 info.setFile( fn );
2269 QString mess; 2269 QString mess;
2270 bool loadbup = true; 2270 bool loadbup = true;
2271 if ( !info. exists() ) { 2271 if ( !info. exists() ) {
2272 mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30)); 2272 mess = i18n("Import file \n...%1\ndoes not exist!\nNothing imported!\n").arg(fn.right( 30));
2273 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), 2273 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),
2274 mess ); 2274 mess );
2275 return; 2275 return;
2276 } 2276 }
2277 int result = 0; 2277 int result = 0;
2278 if ( !quick ) { 2278 if ( !quick ) {
2279 mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false )); 2279 mess = i18n( "Import file \n...%1\nfrom:\n%2\nDuplicated entries\nwill not be imported!\n").arg(fn.right( 25)).arg(KGlobal::locale()->formatDateTime(info.lastModified (), true, false ));
2280 result = QMessageBox::warning( this, "KO/Pi: Warning!", 2280 result = QMessageBox::warning( this, "KO/Pi: Warning!",
2281 mess, 2281 mess,
2282 "Import", "Cancel", 0, 2282 "Import", "Cancel", 0,
2283 0, 1 ); 2283 0, 1 );
2284 } 2284 }
2285 if ( result == 0 ) { 2285 if ( result == 0 ) {
2286 if ( mView->openCalendar( fn, true )) { 2286 if ( mView->openCalendar( fn, true )) {
2287 KOPrefs::instance()->mLastImportFile = fn; 2287 KOPrefs::instance()->mLastImportFile = fn;
2288 setCaption(i18n("Imported file successfully")); 2288 setCaption(i18n("Imported file successfully"));
2289 } else { 2289 } else {
2290 setCaption(i18n("Error importing file")); 2290 setCaption(i18n("Error importing file"));
2291 } 2291 }
2292 } 2292 }
2293} 2293}
2294 2294
2295void MainWindow::importIcal() 2295void MainWindow::importIcal()
2296{ 2296{
2297 2297
2298 QString fn =KOPrefs::instance()->mLastImportFile; 2298 QString fn =KOPrefs::instance()->mLastImportFile;
2299 2299
2300 fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this ); 2300 fn =KFileDialog:: getOpenFileName( fn, i18n("Import filename(*.ics/*.vcs)"), this );
2301 if ( fn == "" ) 2301 if ( fn == "" )
2302 return; 2302 return;
2303 importFile( fn, true ); 2303 importFile( fn, true );
2304 2304
2305} 2305}
2306 2306
2307void MainWindow::exportVCalendar() 2307void MainWindow::exportVCalendar()
2308{ 2308{
2309 QString fn = KOPrefs::instance()->mLastVcalFile; 2309 QString fn = KOPrefs::instance()->mLastVcalFile;
2310 fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this ); 2310 fn = KFileDialog::getSaveFileName( fn, i18n("Export vcal filename(*.vcs)"), this );
2311 if ( fn == "" ) 2311 if ( fn == "" )
2312 return; 2312 return;
2313 QFileInfo info; 2313 QFileInfo info;
2314 info.setFile( fn ); 2314 info.setFile( fn );
2315 QString mes; 2315 QString mes;
2316 bool createbup = true; 2316 bool createbup = true;
2317 if ( info. exists() ) { 2317 if ( info. exists() ) {
2318 mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) ); 2318 mes = i18n("Save file\nalready exists!\nOld save file from:\n%1\nOverwrite?\n").arg (KGlobal::locale()->formatDateTime(info.lastModified (), true, false ) );
2319 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes, 2319 int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mes,
2320 i18n("Overwrite!"), i18n("Cancel"), 0, 2320 i18n("Overwrite!"), i18n("Cancel"), 0,
2321 0, 1 ); 2321 0, 1 );
2322 if ( result != 0 ) { 2322 if ( result != 0 ) {
2323 createbup = false; 2323 createbup = false;
2324 } 2324 }
2325 } 2325 }
2326 if ( createbup ) { 2326 if ( createbup ) {
2327 if ( mView->exportVCalendar( fn ) ) { 2327 if ( mView->exportVCalendar( fn ) ) {
2328 KOPrefs::instance()->mLastVcalFile = fn; 2328 KOPrefs::instance()->mLastVcalFile = fn;
2329 if ( fn.length() > 20 ) 2329 if ( fn.length() > 20 )
2330 mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ; 2330 mes = i18n("KO/Pi:Exported to ...%1").arg(fn.right(20)) ;
2331 else 2331 else
2332 mes = i18n("KO/Pi:Exported to %1").arg(fn ); 2332 mes = i18n("KO/Pi:Exported to %1").arg(fn );
2333 setCaption(mes); 2333 setCaption(mes);
2334 } 2334 }
2335 } 2335 }
2336 2336
2337} 2337}
2338QString MainWindow::sentSyncFile() 2338QString MainWindow::sentSyncFile()
2339{ 2339{
2340#ifdef DESKTOP_VERSION 2340#ifdef DESKTOP_VERSION
2341 return locateLocal( "tmp", "copysynccal.ics" ); 2341 return locateLocal( "tmp", "copysynccal.ics" );
2342#else 2342#else
2343 return QString( "/tmp/copysynccal.ics" ); 2343 return QString( "/tmp/copysynccal.ics" );
2344#endif 2344#endif
2345} 2345}
2346 2346
2347void MainWindow::syncFileRequest() 2347void MainWindow::syncFileRequest()
2348{ 2348{
2349 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { 2349 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) {
2350 mSyncManager->slotSyncMenu( 999 ); 2350 mSyncManager->slotSyncMenu( 999 );
2351 } 2351 }
2352 2352
2353 setCaption(i18n("Saving Data to temp file ..." )); 2353 setCaption(i18n("Saving Data to temp file ..." ));
2354 mView->saveCalendar( sentSyncFile() ); 2354 mView->saveCalendar( sentSyncFile() );
2355 setCaption(i18n("Data saved to temp file!" )); 2355 setCaption(i18n("Data saved to temp file!" ));
2356 2356
2357} 2357}
2358void MainWindow::getFile( bool success ) 2358void MainWindow::getFile( bool success )
2359{ 2359{
2360 if ( ! success ) { 2360 if ( ! success ) {
2361 setCaption( i18n("Error receiving file. Nothing changed!") ); 2361 setCaption( i18n("Error receiving file. Nothing changed!") );
2362 return; 2362 return;
2363 } 2363 }
2364 mView->openCalendar( sentSyncFile() ); 2364 mView->openCalendar( sentSyncFile() );
2365 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { 2365 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) {
2366 mSyncManager->slotSyncMenu( 999 ); 2366 mSyncManager->slotSyncMenu( 999 );
2367 } 2367 }
2368 setCaption( i18n("Pi-Sync successful!") ); 2368 setCaption( i18n("Pi-Sync successful!") );
2369} 2369}
2370 2370
2371void MainWindow::printSel( ) 2371void MainWindow::printSel( )
2372{ 2372{
2373 mView->viewManager()->agendaView()->agenda()->printSelection(); 2373 mView->viewManager()->agendaView()->agenda()->printSelection();
2374} 2374}
2375 2375
2376void MainWindow::printCal() 2376void MainWindow::printCal()
2377{ 2377{
2378 mView->print();//mCp->showDialog(); 2378 mView->print();//mCp->showDialog();
2379} 2379}
2380 2380
2381 2381
2382#include "libkdepim/kdatepicker.h" 2382#include "libkdepim/kdatepicker.h"
2383#include <kdatetbl.h> 2383#include <kdatetbl.h>
2384 2384
2385void MainWindow::weekAction() 2385void MainWindow::weekAction()
2386{ 2386{
2387 int month; 2387 int month;
2388 KPopupFrame* popup = new KPopupFrame(this); 2388 KPopupFrame* popup = new KPopupFrame(this);
2389 KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup); 2389 KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup);
2390 // ----- 2390 // -----
2391 picker->resize(picker->sizeHint()); 2391 picker->resize(picker->sizeHint());
2392 popup->setMainWidget(picker); 2392 popup->setMainWidget(picker);
2393 picker->setFocus(); 2393 picker->setFocus();
2394 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); 2394 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int)));
2395 int x = 0; 2395 int x = 0;
2396 int y = iconToolBar->height(); 2396 int y = iconToolBar->height();
2397 int dX = 0; 2397 int dX = 0;
2398 int dY = 0; 2398 int dY = 0;
2399 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 2399 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
2400 if ( iconToolBar->y() > height()/2 ) { 2400 if ( iconToolBar->y() > height()/2 ) {
2401 dY = picker->sizeHint().height()+8; 2401 dY = picker->sizeHint().height()+8;
2402 y = 0; 2402 y = 0;
2403 } 2403 }
2404 } else { 2404 } else {
2405 if ( iconToolBar->x() > width()/2 ) { // right side 2405 if ( iconToolBar->x() > width()/2 ) { // right side
2406 x=0; 2406 x=0;
2407 dX= picker->sizeHint().width()+8; 2407 dX= picker->sizeHint().width()+8;
2408 y = 0; 2408 y = 0;
2409 } else { 2409 } else {
2410 x= iconToolBar->width(); 2410 x= iconToolBar->width();
2411 y = 0; 2411 y = 0;
2412 } 2412 }
2413 } 2413 }
2414 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); 2414 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
2415 if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)))) 2415 if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))))
2416 { 2416 {
2417 month = picker->getResult(); 2417 month = picker->getResult();
2418 emit selectWeek ( month ); 2418 emit selectWeek ( month );
2419 //qDebug("weekSelected %d ", month); 2419 //qDebug("weekSelected %d ", month);
2420 } 2420 }
2421 delete popup; 2421 delete popup;
2422} 2422}
2423 2423
2424void MainWindow::hideEvent ( QHideEvent * ) 2424void MainWindow::hideEvent ( QHideEvent * )
2425{ 2425{
2426 QString message; 2426 QString message;
2427 QDateTime nextA = mCalendar->nextAlarmEventDateTime(); 2427 QDateTime nextA = mCalendar->nextAlarmEventDateTime();
2428 if ( nextA.isValid() ) { 2428 if ( nextA.isValid() ) {
2429 QString sum = mCalendar->nextSummary(); 2429 QString sum = mCalendar->nextSummary();
2430 2430
2431 message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false)); 2431 message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false));
2432 setCaption( message ); 2432 setCaption( message );
2433 } 2433 }
2434} 2434}
2435 2435
2436void MainWindow::resizeEvent( QResizeEvent* e) 2436void MainWindow::resizeEvent( QResizeEvent* e)
2437{ 2437{
2438#ifndef DESKTOP_VERSION 2438#ifndef DESKTOP_VERSION
2439 if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar ) { 2439 if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar && QApplication::desktop()->width() > 320) {
2440 if (QApplication::desktop()->width() > QApplication::desktop()->height() ) 2440 if (QApplication::desktop()->width() > QApplication::desktop()->height() )
2441 filterToolBar->hide(); 2441 filterToolBar->hide();
2442 else 2442 else
2443 filterToolBar->show(); 2443 filterToolBar->show();
2444 } 2444 }
2445#endif 2445#endif
2446 QMainWindow::resizeEvent( e); 2446 QMainWindow::resizeEvent( e);
2447} 2447}
diff --git a/microkde/ofontselector.cpp b/microkde/ofontselector.cpp
index c8471cc..05095f3 100644
--- a/microkde/ofontselector.cpp
+++ b/microkde/ofontselector.cpp
@@ -1,332 +1,333 @@
1/* 1/*
2               =. This file is part of the OPIE Project 2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org> 3             .=l. Copyright (c) 2002 Robert Griebl <sandman@handhelds.org>
4           .>+-= 4           .>+-=
5 _;:,     .>    :=|. This library is free software; you can 5 _;:,     .>    :=|. This library is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under 6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 7:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
8.="- .-=="i,     .._ License as published by the Free Software 8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License, 9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version. 10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_. 11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This library is distributed in the hope that 12    .i_,=:_.      -<s. This library is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of 14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more 17..}^=.=       =       ; Library General Public License for more
18++=   -.     .`     .: details. 18++=   -.     .`     .: details.
19 :     =  ...= . :.=- 19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU 20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = Library General Public License along with 21  -_. . .   )=.  = Library General Public License along with
22    --        :-=` this library; see the file COPYING.LIB. 22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation, 23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330, 24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA. 25 Boston, MA 02111-1307, USA.
26 26
27*/ 27*/
28 28
29#include <qlayout.h> 29#include <qlayout.h>
30#include <qlistbox.h> 30#include <qlistbox.h>
31#include <qcombobox.h> 31#include <qcombobox.h>
32#include <qlabel.h> 32#include <qlabel.h>
33#include <qfont.h> 33#include <qfont.h>
34#include <qmultilineedit.h> 34#include <qmultilineedit.h>
35 35
36#include <qpe/fontdatabase.h> 36#include <qpe/fontdatabase.h>
37 37
38#include "ofontselector.h" 38#include "ofontselector.h"
39 39
40class OFontSelectorPrivate { 40class OFontSelectorPrivate {
41public: 41public:
42 QListBox * m_font_family_list; 42 QListBox * m_font_family_list;
43 QComboBox * m_font_style_list; 43 QComboBox * m_font_style_list;
44 QComboBox * m_font_size_list; 44 QComboBox * m_font_size_list;
45 QMultiLineEdit *m_preview; 45 QMultiLineEdit *m_preview;
46 46
47 bool m_pointbug : 1; 47 bool m_pointbug : 1;
48 48
49 FontDatabase m_fdb; 49 FontDatabase m_fdb;
50}; 50};
51 51
52namespace { 52namespace {
53 53
54class FontListItem : public QListBoxText { 54class FontListItem : public QListBoxText {
55public: 55public:
56 FontListItem ( const QString &t, const QStringList &styles, const QValueList<int> &sizes ) : QListBoxText ( ) 56 FontListItem ( const QString &t, const QStringList &styles, const QValueList<int> &sizes ) : QListBoxText ( )
57 { 57 {
58 m_name = t; 58 m_name = t;
59 m_styles = styles; 59 m_styles = styles;
60 m_sizes = sizes; 60 m_sizes = sizes;
61 61
62 QString str = t; 62 QString str = t;
63 str [0] = str [0]. upper ( ); 63 str [0] = str [0]. upper ( );
64 setText ( str ); 64 setText ( str );
65 } 65 }
66 66
67 QString family ( ) const 67 QString family ( ) const
68 { 68 {
69 return m_name; 69 return m_name;
70 } 70 }
71 71
72 const QStringList &styles ( ) const 72 const QStringList &styles ( ) const
73 { 73 {
74 return m_styles; 74 return m_styles;
75 } 75 }
76 76
77 const QValueList<int> &sizes ( ) const 77 const QValueList<int> &sizes ( ) const
78 { 78 {
79 return m_sizes; 79 return m_sizes;
80 } 80 }
81 81
82private: 82private:
83 QStringList m_styles; 83 QStringList m_styles;
84 QValueList<int> m_sizes; 84 QValueList<int> m_sizes;
85 QString m_name; 85 QString m_name;
86}; 86};
87 87
88 88
89static int findItemCB ( QComboBox *box, const QString &str ) 89static int findItemCB ( QComboBox *box, const QString &str )
90{ 90{
91 for ( int i = 0; i < box-> count ( ); i++ ) { 91 for ( int i = 0; i < box-> count ( ); i++ ) {
92 if ( box-> text ( i ) == str ) 92 if ( box-> text ( i ) == str )
93 return i; 93 return i;
94 } 94 }
95 return -1; 95 return -1;
96} 96}
97 97
98} 98}
99/* static same as anon. namespace */ 99/* static same as anon. namespace */
100static int qt_version ( ) 100static int qt_version ( )
101{ 101{
102 const char *qver = qVersion ( ); 102 const char *qver = qVersion ( );
103 103
104 return ( qver [0] - '0' ) * 100 + ( qver [2] - '0' ) * 10 + ( qver [4] - '0' ); 104 return ( qver [0] - '0' ) * 100 + ( qver [2] - '0' ) * 10 + ( qver [4] - '0' );
105} 105}
106 106
107/** 107/**
108 * Constructs the Selector object 108 * Constructs the Selector object
109 * @param withpreview If a font preview should be given 109 * @param withpreview If a font preview should be given
110 * @param parent The parent of the Font Selector 110 * @param parent The parent of the Font Selector
111 * @param name The name of the object 111 * @param name The name of the object
112 * @param fl WidgetFlags 112 * @param fl WidgetFlags
113 */ 113 */
114OFontSelector::OFontSelector ( bool withpreview, QWidget *parent, const char *name, WFlags fl ) : QWidget ( parent, name, fl ) 114OFontSelector::OFontSelector ( bool withpreview, QWidget *parent, const char *name, WFlags fl ) : QWidget ( parent, name, fl )
115{ 115{
116 d = new OFontSelectorPrivate ( ); 116 d = new OFontSelectorPrivate ( );
117 117
118 QGridLayout *gridLayout = new QGridLayout ( this, 0, 0, 4, 4 ); 118 QGridLayout *gridLayout = new QGridLayout ( this, 0, 0, 4, 4 );
119 gridLayout->setRowStretch ( 4, 10 ); 119 gridLayout->setRowStretch ( 4, 10 );
120 120
121 d-> m_font_family_list = new QListBox( this, "FontListBox" ); 121 d-> m_font_family_list = new QListBox( this, "FontListBox" );
122 gridLayout->addMultiCellWidget( d-> m_font_family_list, 0, 4, 0, 0 ); 122 gridLayout->addMultiCellWidget( d-> m_font_family_list, 0, 4, 0, 0 );
123 connect( d-> m_font_family_list, SIGNAL( highlighted( int ) ), this, SLOT( fontFamilyClicked( int ) ) ); 123 connect( d-> m_font_family_list, SIGNAL( highlighted( int ) ), this, SLOT( fontFamilyClicked( int ) ) );
124 124
125 QLabel *label = new QLabel( tr( "Style" ), this ); 125 QLabel *label = new QLabel( tr( "Style" ), this );
126 gridLayout->addWidget( label, 0, 1 ); 126 gridLayout->addWidget( label, 0, 1 );
127 127
128 d-> m_font_style_list = new QComboBox( this, "StyleListBox" ); 128 d-> m_font_style_list = new QComboBox( this, "StyleListBox" );
129 connect( d-> m_font_style_list, SIGNAL( activated( int ) ), this, SLOT( fontStyleClicked( int ) ) ); 129 connect( d-> m_font_style_list, SIGNAL( activated( int ) ), this, SLOT( fontStyleClicked( int ) ) );
130 gridLayout->addWidget( d-> m_font_style_list, 1, 1 ); 130 gridLayout->addWidget( d-> m_font_style_list, 1, 1 );
131 131
132 label = new QLabel( tr( "Size" ), this ); 132 label = new QLabel( tr( "Size" ), this );
133 gridLayout->addWidget( label, 2, 1 ); 133 gridLayout->addWidget( label, 2, 1 );
134 134
135 d-> m_font_size_list = new QComboBox( this, "SizeListBox" ); 135 d-> m_font_size_list = new QComboBox( this, "SizeListBox" );
136 connect( d-> m_font_size_list, SIGNAL( activated( int ) ), 136 connect( d-> m_font_size_list, SIGNAL( activated( int ) ),
137 this, SLOT( fontSizeClicked( int ) ) ); 137 this, SLOT( fontSizeClicked( int ) ) );
138 gridLayout->addWidget( d-> m_font_size_list, 3, 1 ); 138 gridLayout->addWidget( d-> m_font_size_list, 3, 1 );
139 139
140 d-> m_pointbug = ( qt_version ( ) <= 233 ); 140 //d-> m_pointbug = ( qt_version ( ) <= 233 );
141 d->m_pointbug = ( qt_version() == 232 || qt_version() == 233 ); // SharpROM uses 2.3.2
141 142
142 if ( withpreview ) { 143 if ( withpreview ) {
143 d-> m_preview = new QMultiLineEdit ( this, "Preview" ); 144 d-> m_preview = new QMultiLineEdit ( this, "Preview" );
144 d-> m_preview-> setAlignment ( AlignCenter ); 145 d-> m_preview-> setAlignment ( AlignCenter );
145 d-> m_preview-> setWordWrap ( QMultiLineEdit::WidgetWidth ); 146 d-> m_preview-> setWordWrap ( QMultiLineEdit::WidgetWidth );
146 d-> m_preview-> setMargin ( 3 ); 147 d-> m_preview-> setMargin ( 3 );
147 d-> m_preview-> setText ( tr( "The Quick Brown Fox Jumps Over The Lazy Dog" )); 148 d-> m_preview-> setText ( tr( "The Quick Brown Fox Jumps Over The Lazy Dog" ));
148 gridLayout-> addRowSpacing ( 5, 4 ); 149 gridLayout-> addRowSpacing ( 5, 4 );
149 gridLayout-> addMultiCellWidget ( d-> m_preview, 6, 6, 0, 1 ); 150 gridLayout-> addMultiCellWidget ( d-> m_preview, 6, 6, 0, 1 );
150 gridLayout-> setRowStretch ( 6, 5 ); 151 gridLayout-> setRowStretch ( 6, 5 );
151 } 152 }
152 else 153 else
153 d-> m_preview = 0; 154 d-> m_preview = 0;
154 155
155 loadFonts ( d-> m_font_family_list ); 156 loadFonts ( d-> m_font_family_list );
156} 157}
157 158
158OFontSelector::~OFontSelector ( ) 159OFontSelector::~OFontSelector ( )
159{ 160{
160 delete d; 161 delete d;
161} 162}
162 163
163/** 164/**
164 * This methods tries to set the font 165 * This methods tries to set the font
165 * @param f The wishes font 166 * @param f The wishes font
166 * @return success or failure 167 * @return success or failure
167 */ 168 */
168bool OFontSelector::setSelectedFont ( const QFont &f ) 169bool OFontSelector::setSelectedFont ( const QFont &f )
169{ 170{
170 return setSelectedFont ( f. family ( ), d-> m_fdb. styleString ( f ), f. pointSize ( ), QFont::encodingName ( f. charSet ( ))); 171 return setSelectedFont ( f. family ( ), d-> m_fdb. styleString ( f ), f. pointSize ( ), QFont::encodingName ( f. charSet ( )));
171} 172}
172 173
173 174
174/** 175/**
175 * This is an overloaded method @see setSelectedFont 176 * This is an overloaded method @see setSelectedFont
176 * @param familyStr The family of the font 177 * @param familyStr The family of the font
177 * @param styleStr The style of the font 178 * @param styleStr The style of the font
178 * @param sizeVal The size of font 179 * @param sizeVal The size of font
179 * @param charset The charset to be used. Will be deprecated by QT3 180 * @param charset The charset to be used. Will be deprecated by QT3
180 */ 181 */
181bool OFontSelector::setSelectedFont ( const QString &familyStr, const QString &styleStr, int sizeVal, const QString & charset ) 182bool OFontSelector::setSelectedFont ( const QString &familyStr, const QString &styleStr, int sizeVal, const QString & charset )
182{ 183{
183 QString sizeStr = QString::number ( sizeVal ); 184 QString sizeStr = QString::number ( sizeVal );
184 185
185 QListBoxItem *family = d-> m_font_family_list-> findItem ( familyStr ); 186 QListBoxItem *family = d-> m_font_family_list-> findItem ( familyStr );
186 if ( !family ) 187 if ( !family )
187 family = d-> m_font_family_list-> findItem ( "Helvetica" ); 188 family = d-> m_font_family_list-> findItem ( "Helvetica" );
188 if ( !family ) 189 if ( !family )
189 family = d-> m_font_family_list-> firstItem ( ); 190 family = d-> m_font_family_list-> firstItem ( );
190 d-> m_font_family_list-> setCurrentItem ( family ); 191 d-> m_font_family_list-> setCurrentItem ( family );
191 fontFamilyClicked ( d-> m_font_family_list-> index ( family )); 192 fontFamilyClicked ( d-> m_font_family_list-> index ( family ));
192 193
193 int style = findItemCB ( d-> m_font_style_list, styleStr ); 194 int style = findItemCB ( d-> m_font_style_list, styleStr );
194 if ( style < 0 ) 195 if ( style < 0 )
195 style = findItemCB ( d-> m_font_style_list, "Regular" ); 196 style = findItemCB ( d-> m_font_style_list, "Regular" );
196 if ( style < 0 && d-> m_font_style_list-> count ( ) > 0 ) 197 if ( style < 0 && d-> m_font_style_list-> count ( ) > 0 )
197 style = 0; 198 style = 0;
198 d-> m_font_style_list-> setCurrentItem ( style ); 199 d-> m_font_style_list-> setCurrentItem ( style );
199 fontStyleClicked ( style ); 200 fontStyleClicked ( style );
200 201
201 int size = findItemCB ( d-> m_font_size_list, sizeStr ); 202 int size = findItemCB ( d-> m_font_size_list, sizeStr );
202 if ( size < 0 ) 203 if ( size < 0 )
203 size = findItemCB ( d-> m_font_size_list, "10" ); 204 size = findItemCB ( d-> m_font_size_list, "10" );
204 if ( size < 0 && d-> m_font_size_list-> count ( ) > 0 ) 205 if ( size < 0 && d-> m_font_size_list-> count ( ) > 0 )
205 size = 0; 206 size = 0;
206 d-> m_font_size_list-> setCurrentItem ( size ); 207 d-> m_font_size_list-> setCurrentItem ( size );
207 fontSizeClicked ( size ); 208 fontSizeClicked ( size );
208 209
209 return (( family ) && ( style >= 0 ) && ( size >= 0 )); 210 return (( family ) && ( style >= 0 ) && ( size >= 0 ));
210} 211}
211 212
212/** 213/**
213 * This method returns the name, style and size of the currently selected 214 * This method returns the name, style and size of the currently selected
214 * font or false if no font is selected 215 * font or false if no font is selected
215 * @param family The font family will be written there 216 * @param family The font family will be written there
216 * @param style The style will be written there 217 * @param style The style will be written there
217 * @param size The size will be written there 218 * @param size The size will be written there
218 * @return success or failure 219 * @return success or failure
219 */ 220 */
220bool OFontSelector::selectedFont ( QString &family, QString &style, int &size ) 221bool OFontSelector::selectedFont ( QString &family, QString &style, int &size )
221{ 222{
222 QString dummy; 223 QString dummy;
223 return selectedFont ( family, style, size, dummy ); 224 return selectedFont ( family, style, size, dummy );
224} 225}
225 226
226 227
227/** 228/**
228 * This method does return the font family or QString::null if there is 229 * This method does return the font family or QString::null if there is
229 * no font item selected 230 * no font item selected
230 * @return the font family 231 * @return the font family
231 */ 232 */
232QString OFontSelector::fontFamily ( ) const 233QString OFontSelector::fontFamily ( ) const
233{ 234{
234 FontListItem *fli = (FontListItem *) d-> m_font_family_list-> item ( d-> m_font_family_list-> currentItem ( )); 235 FontListItem *fli = (FontListItem *) d-> m_font_family_list-> item ( d-> m_font_family_list-> currentItem ( ));
235 236
236 return fli ? fli-> family ( ) : QString::null; 237 return fli ? fli-> family ( ) : QString::null;
237} 238}
238 239
239/** 240/**
240 * This method will return the style of the font or QString::null 241 * This method will return the style of the font or QString::null
241 * @return the style of the font 242 * @return the style of the font
242 */ 243 */
243QString OFontSelector::fontStyle ( ) const 244QString OFontSelector::fontStyle ( ) const
244{ 245{
245 FontListItem *fli = (FontListItem *) d-> m_font_family_list-> item ( d-> m_font_family_list-> currentItem ( )); 246 FontListItem *fli = (FontListItem *) d-> m_font_family_list-> item ( d-> m_font_family_list-> currentItem ( ));
246 int fst = d-> m_font_style_list-> currentItem ( ); 247 int fst = d-> m_font_style_list-> currentItem ( );
247 248
248 return ( fli && fst >= 0 ) ? fli-> styles ( ) [fst] : QString::null; 249 return ( fli && fst >= 0 ) ? fli-> styles ( ) [fst] : QString::null;
249} 250}
250 251
251/** 252/**
252 * This method will return the font size or 10 if no font size is available 253 * This method will return the font size or 10 if no font size is available
253 */ 254 */
254int OFontSelector::fontSize ( ) const 255int OFontSelector::fontSize ( ) const
255{ 256{
256 FontListItem *fli = (FontListItem *) d-> m_font_family_list-> item ( d-> m_font_family_list-> currentItem ( )); 257 FontListItem *fli = (FontListItem *) d-> m_font_family_list-> item ( d-> m_font_family_list-> currentItem ( ));
257 int fsi = d-> m_font_size_list-> currentItem ( ); 258 int fsi = d-> m_font_size_list-> currentItem ( );
258 259
259 return ( fli && fsi >= 0 ) ? fli-> sizes ( ) [fsi] : 10; 260 return ( fli && fsi >= 0 ) ? fli-> sizes ( ) [fsi] : 10;
260} 261}
261 262
262/** 263/**
263 * returns the charset of the font or QString::null 264 * returns the charset of the font or QString::null
264 */ 265 */
265QString OFontSelector::fontCharSet ( ) const 266QString OFontSelector::fontCharSet ( ) const
266{ 267{
267 FontListItem *fli = (FontListItem *) d-> m_font_family_list-> item ( d-> m_font_family_list-> currentItem ( )); 268 FontListItem *fli = (FontListItem *) d-> m_font_family_list-> item ( d-> m_font_family_list-> currentItem ( ));
268 269
269 return fli ? d-> m_fdb. charSets ( fli-> family ( )) [0] : QString::null; 270 return fli ? d-> m_fdb. charSets ( fli-> family ( )) [0] : QString::null;
270} 271}
271 272
272/** 273/**
273 * Overloaded member function see above 274 * Overloaded member function see above
274 * @see selectedFont 275 * @see selectedFont
275 */ 276 */
276bool OFontSelector::selectedFont ( QString &family, QString &style, int &size, QString &charset ) 277bool OFontSelector::selectedFont ( QString &family, QString &style, int &size, QString &charset )
277{ 278{
278 int ffa = d-> m_font_family_list-> currentItem ( ); 279 int ffa = d-> m_font_family_list-> currentItem ( );
279 int fst = d-> m_font_style_list-> currentItem ( ); 280 int fst = d-> m_font_style_list-> currentItem ( );
280 int fsi = d-> m_font_size_list-> currentItem ( ); 281 int fsi = d-> m_font_size_list-> currentItem ( );
281 282
282 FontListItem *fli = (FontListItem *) d-> m_font_family_list-> item ( ffa ); 283 FontListItem *fli = (FontListItem *) d-> m_font_family_list-> item ( ffa );
283 284
284 if ( fli ) { 285 if ( fli ) {
285 family = fli-> family ( ); 286 family = fli-> family ( );
286 style = fst >= 0 ? fli-> styles ( ) [fst] : QString::null; 287 style = fst >= 0 ? fli-> styles ( ) [fst] : QString::null;
287 size = fsi >= 0 ? fli-> sizes ( ) [fsi] : 10; 288 size = fsi >= 0 ? fli-> sizes ( ) [fsi] : 10;
288 charset = d-> m_fdb. charSets ( fli-> family ( )) [0]; 289 charset = d-> m_fdb. charSets ( fli-> family ( )) [0];
289 290
290 return true; 291 return true;
291 } 292 }
292 else 293 else
293 return false; 294 return false;
294} 295}
295 296
296 297
297 298
298 299
299void OFontSelector::loadFonts ( QListBox *list ) 300void OFontSelector::loadFonts ( QListBox *list )
300{ 301{
301 QStringList f = d-> m_fdb. families ( ); 302 QStringList f = d-> m_fdb. families ( );
302 303
303 for ( QStringList::ConstIterator it = f. begin ( ); it != f. end ( ); ++it ) { 304 for ( QStringList::ConstIterator it = f. begin ( ); it != f. end ( ); ++it ) {
304 QValueList <int> ps = d-> m_fdb. pointSizes ( *it ); 305 QValueList <int> ps = d-> m_fdb. pointSizes ( *it );
305 306
306 if ( d-> m_pointbug ) { 307 if ( d-> m_pointbug ) {
307 for ( QValueList <int>::Iterator it = ps. begin ( ); it != ps. end ( ); it++ ) 308 for ( QValueList <int>::Iterator it = ps. begin ( ); it != ps. end ( ); it++ )
308 *it /= 10; 309 *it /= 10;
309 } 310 }
310 311
311 list-> insertItem ( new FontListItem ( *it, d-> m_fdb. styles ( *it ), ps )); 312 list-> insertItem ( new FontListItem ( *it, d-> m_fdb. styles ( *it ), ps ));
312 } 313 }
313} 314}
314 315
315void OFontSelector::fontFamilyClicked ( int index ) 316void OFontSelector::fontFamilyClicked ( int index )
316{ 317{
317 QString oldstyle = d-> m_font_style_list-> currentText ( ); 318 QString oldstyle = d-> m_font_style_list-> currentText ( );
318 QString oldsize = d-> m_font_size_list-> currentText ( ); 319 QString oldsize = d-> m_font_size_list-> currentText ( );
319 320
320 FontListItem *fli = (FontListItem *) d-> m_font_family_list-> item ( index ); 321 FontListItem *fli = (FontListItem *) d-> m_font_family_list-> item ( index );
321 322
322 d-> m_font_style_list-> clear ( ); 323 d-> m_font_style_list-> clear ( );
323 d-> m_font_style_list-> insertStringList ( fli-> styles ( )); 324 d-> m_font_style_list-> insertStringList ( fli-> styles ( ));
324 d-> m_font_style_list-> setEnabled ( !fli-> styles ( ). isEmpty ( )); 325 d-> m_font_style_list-> setEnabled ( !fli-> styles ( ). isEmpty ( ));
325 326
326 int i; 327 int i;
327 328
328 i = findItemCB ( d-> m_font_style_list, oldstyle ); 329 i = findItemCB ( d-> m_font_style_list, oldstyle );
329 if ( i < 0 ) 330 if ( i < 0 )
330 i = findItemCB ( d-> m_font_style_list, "Regular" ); 331 i = findItemCB ( d-> m_font_style_list, "Regular" );
331 if (( i < 0 ) && ( d-> m_font_style_list-> count ( ) > 0 )) 332 if (( i < 0 ) && ( d-> m_font_style_list-> count ( ) > 0 ))
332 i = 0; 333 i = 0;
diff --git a/version b/version
index f601af0..1065c0d 100644
--- a/version
+++ b/version
@@ -1 +1 @@
version = "2.0.24"; version = "2.0.25";