summaryrefslogtreecommitdiff
path: root/noncore/apps
Unidiff
Diffstat (limited to 'noncore/apps') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp4
-rw-r--r--noncore/apps/advancedfm/advancedfmData.cpp28
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp10
-rw-r--r--noncore/apps/advancedfm/output.cpp18
-rw-r--r--noncore/apps/checkbook/checkbook.cpp18
-rw-r--r--noncore/apps/checkbook/listedit.cpp6
-rw-r--r--noncore/apps/checkbook/mainwindow.cpp2
-rw-r--r--noncore/apps/checkbook/password.cpp2
-rw-r--r--noncore/apps/checkbook/transaction.cpp14
-rw-r--r--noncore/apps/confedit/mainwindow.cpp4
-rw-r--r--noncore/apps/odict/odict.cpp2
-rw-r--r--noncore/apps/opie-bartender/bartender.cpp6
-rw-r--r--noncore/apps/opie-bartender/searchresults.cpp2
-rw-r--r--noncore/apps/opie-console/btconfigwidget.cpp4
-rw-r--r--noncore/apps/opie-console/dialdialog.cpp2
-rw-r--r--noncore/apps/opie-console/emulation_handler.cpp8
-rw-r--r--noncore/apps/opie-console/emulation_layer.cpp24
-rw-r--r--noncore/apps/opie-console/function_keyboard.cpp10
-rw-r--r--noncore/apps/opie-console/io_bt.cpp4
-rw-r--r--noncore/apps/opie-console/io_irda.cpp4
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp8
-rw-r--r--noncore/apps/opie-console/profileeditordialog.cpp6
-rw-r--r--noncore/apps/opie-console/session.cpp4
-rw-r--r--noncore/apps/opie-console/sz_transfer.cpp18
-rw-r--r--noncore/apps/opie-console/test/senderui.cpp2
-rw-r--r--noncore/apps/opie-console/transferdialog.cpp12
-rw-r--r--noncore/apps/opie-reader/QTReaderApp.cpp24
-rw-r--r--noncore/apps/opie-reader/fileBrowser.cpp8
-rw-r--r--noncore/apps/opie-sheet/mainwindow.cpp12
-rw-r--r--noncore/apps/opie-sheet/sheet.cpp4
-rw-r--r--noncore/apps/opie-write/mainwindow.cpp24
-rw-r--r--noncore/apps/opie-write/qtextedit.cpp4
-rwxr-xr-xnoncore/apps/qashmoney/accountdisplay.cpp22
-rwxr-xr-xnoncore/apps/qashmoney/budgetdisplay.cpp20
-rwxr-xr-xnoncore/apps/qashmoney/calculator.cpp24
-rwxr-xr-xnoncore/apps/qashmoney/datepicker.cpp6
-rwxr-xr-xnoncore/apps/qashmoney/memorydialog.cpp6
-rwxr-xr-xnoncore/apps/qashmoney/newaccount.cpp8
-rwxr-xr-xnoncore/apps/qashmoney/newtransaction.cpp8
-rwxr-xr-xnoncore/apps/qashmoney/preferencedialogs.cpp20
-rwxr-xr-xnoncore/apps/qashmoney/qashmoney.cpp20
-rwxr-xr-xnoncore/apps/qashmoney/transactiondisplay.cpp18
-rwxr-xr-xnoncore/apps/qashmoney/transferdialog.cpp2
-rw-r--r--noncore/apps/tableviewer/tableviewer.cpp8
-rw-r--r--noncore/apps/tableviewer/ui/commonwidgets.cpp2
-rw-r--r--noncore/apps/tableviewer/ui/tvbrowseview.cpp4
-rw-r--r--noncore/apps/tableviewer/ui/tvfilterview.cpp2
-rw-r--r--noncore/apps/tableviewer/ui/tvlistview.cpp4
-rw-r--r--noncore/apps/tinykate/libkate/document/katedialogs.cpp6
-rw-r--r--noncore/apps/tinykate/libkate/document/katedocument.cpp2
-rw-r--r--noncore/apps/tinykate/libkate/view/kateviewdialog.cpp6
-rw-r--r--noncore/apps/tinykate/tinykate.cpp2
-rw-r--r--noncore/apps/zsafe/scqtfiledlg.cpp12
-rw-r--r--noncore/apps/zsafe/zsafe.cpp20
54 files changed, 260 insertions, 260 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp
index c44d387..2ba3dca 100644
--- a/noncore/apps/advancedfm/advancedfm.cpp
+++ b/noncore/apps/advancedfm/advancedfm.cpp
@@ -4,98 +4,98 @@
4 ** Created: Sat Mar 9 23:33:09 2002 4 ** Created: Sat Mar 9 23:33:09 2002
5 copyright : (C) 2002 by ljp 5 copyright : (C) 2002 by ljp
6 email : ljp@llornkcor.com 6 email : ljp@llornkcor.com
7 * This program is free software; you can redistribute it and/or modify * 7 * This program is free software; you can redistribute it and/or modify *
8 * it under the terms of the GNU General Public License as published by * 8 * it under the terms of the GNU General Public License as published by *
9 * the Free Software Foundation; either version 2 of the License, or * 9 * the Free Software Foundation; either version 2 of the License, or *
10 * (at your option) any later version. * 10 * (at your option) any later version. *
11 ***************************************************************************/ 11 ***************************************************************************/
12#define DEVELOPERS_VERSION 12#define DEVELOPERS_VERSION
13#include "advancedfm.h" 13#include "advancedfm.h"
14 14
15#include <qpe/qpeapplication.h> 15#include <qpe/qpeapplication.h>
16#include <qpe/config.h> 16#include <qpe/config.h>
17#include <qpe/mimetype.h> 17#include <qpe/mimetype.h>
18#include <qpe/applnk.h> 18#include <qpe/applnk.h>
19#include <qpe/resource.h> 19#include <qpe/resource.h>
20#include <qpe/menubutton.h> 20#include <qpe/menubutton.h>
21 21
22#include <qcombobox.h> 22#include <qcombobox.h>
23#include <qpopupmenu.h> 23#include <qpopupmenu.h>
24#include <qlistview.h> 24#include <qlistview.h>
25#include <qmessagebox.h> 25#include <qmessagebox.h>
26#include <qlineedit.h> 26#include <qlineedit.h>
27 27
28 28
29#include <sys/stat.h> 29#include <sys/stat.h>
30#include <time.h> 30#include <time.h>
31#include <dirent.h> 31#include <dirent.h>
32#include <fcntl.h> 32#include <fcntl.h>
33#include <sys/vfs.h> 33#include <sys/vfs.h>
34#include <mntent.h> 34#include <mntent.h>
35 35
36#ifdef NOQUICKLAUNCH 36#ifdef NOQUICKLAUNCH
37AdvancedFm::AdvancedFm( ) 37AdvancedFm::AdvancedFm( )
38#else 38#else
39AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags ) 39AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags )
40#endif 40#endif
41 : QMainWindow( ) { 41 : QMainWindow( ) {
42 init(); 42 init();
43 renameBox = 0; 43 renameBox = 0;
44 44
45 unknownXpm = Resource::loadImage( "UnknownDocument" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); 45 unknownXpm = Resource::loadImage( "UnknownDocument" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() );
46 46
47 initConnections(); 47 initConnections();
48 whichTab=1; 48 whichTab=1;
49 rePopulate(); 49 rePopulate();
50 currentPathCombo->setFocus(); 50 currentPathCombo->setFocus();
51 channel = new QCopChannel( "QPE/Application/advancedfm", this ); 51 channel = new QCopChannel( "QPE/Application/advancedfm", this );
52 connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), 52 connect( channel, SIGNAL(received(const QCString&,const QByteArray&)),
53 this, SLOT( qcopReceive(const QCString&, const QByteArray&)) ); 53 this, SLOT( qcopReceive(const QCString&,const QByteArray&)) );
54} 54}
55 55
56AdvancedFm::~AdvancedFm() { 56AdvancedFm::~AdvancedFm() {
57} 57}
58 58
59 59
60void AdvancedFm::cleanUp() { 60void AdvancedFm::cleanUp() {
61 QString sfile=QDir::homeDirPath(); 61 QString sfile=QDir::homeDirPath();
62 if(sfile.right(1) != "/") 62 if(sfile.right(1) != "/")
63 sfile+="/._temp"; 63 sfile+="/._temp";
64 else 64 else
65 sfile+="._temp"; 65 sfile+="._temp";
66 QFile file( sfile); 66 QFile file( sfile);
67 if(file.exists()) 67 if(file.exists())
68 file.remove(); 68 file.remove();
69} 69}
70 70
71void AdvancedFm::tabChanged(QWidget *) { 71void AdvancedFm::tabChanged(QWidget *) {
72// qWarning("tab changed"); 72// qWarning("tab changed");
73 QString path = CurrentDir()->canonicalPath(); 73 QString path = CurrentDir()->canonicalPath();
74 currentPathCombo->lineEdit()->setText( path ); 74 currentPathCombo->lineEdit()->setText( path );
75 75
76 if(whichTab == 1) { 76 if(whichTab == 1) {
77 viewMenu->setItemChecked(viewMenu->idAt(0), true); 77 viewMenu->setItemChecked(viewMenu->idAt(0), true);
78 viewMenu->setItemChecked(viewMenu->idAt(1), false); 78 viewMenu->setItemChecked(viewMenu->idAt(1), false);
79 } else { 79 } else {
80 viewMenu->setItemChecked(viewMenu->idAt(0), false); 80 viewMenu->setItemChecked(viewMenu->idAt(0), false);
81 viewMenu->setItemChecked(viewMenu->idAt(1), true); 81 viewMenu->setItemChecked(viewMenu->idAt(1), true);
82 } 82 }
83 83
84 QString fs= getFileSystemType( (const QString &) path); 84 QString fs= getFileSystemType( (const QString &) path);
85 85
86 setCaption(tr("AdvancedFm :: ")+fs+" :: " 86 setCaption(tr("AdvancedFm :: ")+fs+" :: "
87 +checkDiskSpace( (const QString &) path )+ tr(" kB free") ); 87 +checkDiskSpace( (const QString &) path )+ tr(" kB free") );
88 chdir( path.latin1()); 88 chdir( path.latin1());
89} 89}
90 90
91 91
92void AdvancedFm::populateView() { 92void AdvancedFm::populateView() {
93 93
94// qWarning("PopulateView"); 94// qWarning("PopulateView");
95 QPixmap pm; 95 QPixmap pm;
96 QListView *thisView = CurrentView(); 96 QListView *thisView = CurrentView();
97 QDir *thisDir = CurrentDir(); 97 QDir *thisDir = CurrentDir();
98 QString path = thisDir->canonicalPath(); 98 QString path = thisDir->canonicalPath();
99 99
100//qWarning("path is "+path); 100//qWarning("path is "+path);
101 thisView->clear(); 101 thisView->clear();
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp
index 763ae34..f791c77 100644
--- a/noncore/apps/advancedfm/advancedfmData.cpp
+++ b/noncore/apps/advancedfm/advancedfmData.cpp
@@ -208,79 +208,79 @@ void AdvancedFm::init() {
208 /////////////// 208 ///////////////
209 209
210 if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) 210 if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" ))
211 zaurusDevice=TRUE; 211 zaurusDevice=TRUE;
212 else 212 else
213 zaurusDevice=FALSE; 213 zaurusDevice=FALSE;
214 214
215 215
216 if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) { 216 if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) {
217 qDebug("not have sd"); 217 qDebug("not have sd");
218 sdButton->hide(); 218 sdButton->hide();
219 } 219 }
220 if( !StorageInfo::hasCf() ) { 220 if( !StorageInfo::hasCf() ) {
221 qDebug("not have cf"); 221 qDebug("not have cf");
222 cfButton->hide(); 222 cfButton->hide();
223 } 223 }
224 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 224 currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
225 currentDir.setPath( QDir::currentDirPath()); 225 currentDir.setPath( QDir::currentDirPath());
226 226
227 currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 227 currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
228 currentRemoteDir.setPath( QDir::currentDirPath()); 228 currentRemoteDir.setPath( QDir::currentDirPath());
229 229
230 // b = TRUE; 230 // b = TRUE;
231 231
232 filterStr="*"; 232 filterStr="*";
233 b=FALSE; 233 b=FALSE;
234 showMenuHidden(); 234 showMenuHidden();
235 TabWidget->setCurrentWidget(0); 235 TabWidget->setCurrentWidget(0);
236 236
237} 237}
238 238
239void AdvancedFm::initConnections() 239void AdvancedFm::initConnections()
240{ 240{
241 241
242 connect( qApp,SIGNAL( aboutToQuit()), 242 connect( qApp,SIGNAL( aboutToQuit()),
243 this, SLOT( cleanUp()) ); 243 this, SLOT( cleanUp()) );
244 connect( qpeDirButton ,SIGNAL(released()), 244 connect( qpeDirButton ,SIGNAL(released()),
245 this,SLOT( QPEButtonPushed()) ); 245 this,SLOT( QPEButtonPushed()) );
246 connect( cfButton ,SIGNAL(released()), 246 connect( cfButton ,SIGNAL(released()),
247 this,SLOT( CFButtonPushed()) ); 247 this,SLOT( CFButtonPushed()) );
248 connect( sdButton ,SIGNAL(released()), 248 connect( sdButton ,SIGNAL(released()),
249 this,SLOT( SDButtonPushed()) ); 249 this,SLOT( SDButtonPushed()) );
250 connect( cdUpButton ,SIGNAL(released()), 250 connect( cdUpButton ,SIGNAL(released()),
251 this,SLOT( upDir()) ); 251 this,SLOT( upDir()) );
252 connect( docButton,SIGNAL(released()), 252 connect( docButton,SIGNAL(released()),
253 this,SLOT( docButtonPushed()) ); 253 this,SLOT( docButtonPushed()) );
254 connect( homeButton,SIGNAL(released()), 254 connect( homeButton,SIGNAL(released()),
255 this,SLOT( homeButtonPushed()) ); 255 this,SLOT( homeButtonPushed()) );
256 connect( currentPathCombo, SIGNAL( activated( const QString & ) ), 256 connect( currentPathCombo, SIGNAL( activated(const QString&) ),
257 this, SLOT( currentPathComboActivated( const QString & ) ) ); 257 this, SLOT( currentPathComboActivated(const QString&) ) );
258 258
259 connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()), 259 connect( currentPathCombo->lineEdit(),SIGNAL(returnPressed()),
260 this,SLOT(currentPathComboChanged())); 260 this,SLOT(currentPathComboChanged()));
261 261
262 connect( Local_View, SIGNAL( clicked( QListViewItem*)), 262 connect( Local_View, SIGNAL( clicked(QListViewItem*)),
263 this,SLOT( ListClicked(QListViewItem *)) ); 263 this,SLOT( ListClicked(QListViewItem*)) );
264 264
265 connect( Local_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), 265 connect( Local_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)),
266 this,SLOT( ListPressed(int, QListViewItem *, const QPoint&, int)) ); 266 this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) );
267 267
268 connect( Local_View, SIGNAL( selectionChanged() ), SLOT( cancelMenuTimer() ) ); 268 connect( Local_View, SIGNAL( selectionChanged() ), SLOT( cancelMenuTimer() ) );
269 269
270 connect( Remote_View, SIGNAL( clicked( QListViewItem*)), 270 connect( Remote_View, SIGNAL( clicked(QListViewItem*)),
271 this,SLOT( ListClicked(QListViewItem *)) ); 271 this,SLOT( ListClicked(QListViewItem*)) );
272 connect( Remote_View, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), 272 connect( Remote_View, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)),
273 this,SLOT( ListPressed(int, QListViewItem *, const QPoint&, int)) ); 273 this,SLOT( ListPressed(int,QListViewItem*,const QPoint&,int)) );
274 274
275 connect( TabWidget,SIGNAL(currentChanged(QWidget *)), 275 connect( TabWidget,SIGNAL(currentChanged(QWidget*)),
276 this,SLOT(tabChanged(QWidget*))); 276 this,SLOT(tabChanged(QWidget*)));
277 277
278 connect( &menuTimer, SIGNAL( timeout() ), SLOT( showFileMenu() ) ); 278 connect( &menuTimer, SIGNAL( timeout() ), SLOT( showFileMenu() ) );
279 279
280 connect( menuButton, SIGNAL( selected(const QString &)), SLOT(gotoCustomDir(const QString&))); 280 connect( menuButton, SIGNAL( selected(const QString&)), SLOT(gotoCustomDir(const QString&)));
281// connect( menuButton, SIGNAL( selected( int)), SLOT( dirMenuSelected(int))); 281// connect( menuButton, SIGNAL( selected(int)), SLOT( dirMenuSelected(int)));
282 connect( viewMenu, SIGNAL( activated(int )), this, SLOT(slotSwitchMenu(int ))); 282 connect( viewMenu, SIGNAL( activated(int)), this, SLOT(slotSwitchMenu(int)));
283// connect( customDirMenu, SIGNAL( activated(int)), this, SLOT( dirMenuSelected(int))); 283// connect( customDirMenu, SIGNAL( activated(int)), this, SLOT( dirMenuSelected(int)));
284 284
285} 285}
286 286
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index 9ad1146..9e740d0 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -636,122 +636,122 @@ void AdvancedFm::rn() {
636} 636}
637 637
638void AdvancedFm::del() { 638void AdvancedFm::del() {
639 doDelete(); 639 doDelete();
640} 640}
641 641
642void AdvancedFm::mkSym() { 642void AdvancedFm::mkSym() {
643 QString cmd; 643 QString cmd;
644 QStringList curFileList = getPath(); 644 QStringList curFileList = getPath();
645 if( curFileList.count() > 0) { 645 if( curFileList.count() > 0) {
646 QDir *thisDir = CurrentDir(); 646 QDir *thisDir = CurrentDir();
647 QDir * thatDir = OtherDir(); 647 QDir * thatDir = OtherDir();
648 648
649 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 649 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
650 650
651 QString destName = thatDir->canonicalPath()+"/"+(*it); 651 QString destName = thatDir->canonicalPath()+"/"+(*it);
652 if(destName.right(1) == "/") { 652 if(destName.right(1) == "/") {
653 destName = destName.left( destName.length() -1); 653 destName = destName.left( destName.length() -1);
654 } 654 }
655 655
656 QString curFile = thisDir->canonicalPath()+"/"+(*it); 656 QString curFile = thisDir->canonicalPath()+"/"+(*it);
657 657
658 if( curFile.right(1) == "/") { 658 if( curFile.right(1) == "/") {
659 curFile = curFile.left( curFile.length() -1); 659 curFile = curFile.left( curFile.length() -1);
660 } 660 }
661 661
662 cmd = "ln -s "+curFile+" "+destName; 662 cmd = "ln -s "+curFile+" "+destName;
663// qDebug(cmd); 663// qDebug(cmd);
664 startProcess( (const QString)cmd ); 664 startProcess( (const QString)cmd );
665 } 665 }
666 rePopulate(); 666 rePopulate();
667 setOtherTabCurrent(); 667 setOtherTabCurrent();
668 } 668 }
669} 669}
670 670
671void AdvancedFm::doBeam() { 671void AdvancedFm::doBeam() {
672 Ir ir; 672 Ir ir;
673 if(!ir.supported()) { 673 if(!ir.supported()) {
674 } else { 674 } else {
675 QStringList curFileList = getPath(); 675 QStringList curFileList = getPath();
676 if( curFileList.count() > 0) { 676 if( curFileList.count() > 0) {
677 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 677 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
678 QString curFile = (*it); 678 QString curFile = (*it);
679 QString curFilePath = CurrentDir()->canonicalPath()+"/"+curFile; 679 QString curFilePath = CurrentDir()->canonicalPath()+"/"+curFile;
680 if( curFilePath.right(1) == "/") { 680 if( curFilePath.right(1) == "/") {
681 curFilePath = curFilePath.left( curFilePath.length() -1); 681 curFilePath = curFilePath.left( curFilePath.length() -1);
682 } 682 }
683 Ir *file = new Ir(this, "IR"); 683 Ir *file = new Ir(this, "IR");
684 connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished( Ir * ))); 684 connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished(Ir*)));
685 file->send( curFilePath, curFile ); 685 file->send( curFilePath, curFile );
686 } 686 }
687 } 687 }
688 } 688 }
689} 689}
690 690
691void AdvancedFm::fileBeamFinished( Ir *) { 691void AdvancedFm::fileBeamFinished( Ir *) {
692 QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") ); 692 QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") );
693} 693}
694 694
695void AdvancedFm::selectAll() { 695void AdvancedFm::selectAll() {
696 QListView *thisView = CurrentView(); 696 QListView *thisView = CurrentView();
697 thisView->selectAll(true); 697 thisView->selectAll(true);
698 thisView->setSelected( thisView->firstChild(),false); 698 thisView->setSelected( thisView->firstChild(),false);
699} 699}
700 700
701void AdvancedFm::startProcess(const QString & cmd) { 701void AdvancedFm::startProcess(const QString & cmd) {
702 QStringList command; 702 QStringList command;
703 OProcess *process; 703 OProcess *process;
704 process = new OProcess(); 704 process = new OProcess();
705 connect(process, SIGNAL(processExited(OProcess *)), 705 connect(process, SIGNAL(processExited(OProcess*)),
706 this, SLOT( processEnded(OProcess *))); 706 this, SLOT( processEnded(OProcess*)));
707 707
708 connect(process, SIGNAL( receivedStderr(OProcess *, char *, int)), 708 connect(process, SIGNAL( receivedStderr(OProcess*,char*,int)),
709 this, SLOT( oprocessStderr(OProcess *, char *, int))); 709 this, SLOT( oprocessStderr(OProcess*,char*,int)));
710 710
711 command << "/bin/sh"; 711 command << "/bin/sh";
712 command << "-c"; 712 command << "-c";
713 command << cmd.latin1(); 713 command << cmd.latin1();
714 *process << command; 714 *process << command;
715 if(!process->start(OProcess::NotifyOnExit, OProcess::All) ) 715 if(!process->start(OProcess::NotifyOnExit, OProcess::All) )
716 qDebug("could not start process"); 716 qDebug("could not start process");
717} 717}
718 718
719void AdvancedFm::processEnded(OProcess *) { 719void AdvancedFm::processEnded(OProcess *) {
720 rePopulate(); 720 rePopulate();
721} 721}
722 722
723void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) { 723void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) {
724// qWarning("received stderrt %d bytes", buflen); 724// qWarning("received stderrt %d bytes", buflen);
725 725
726 QString lineStr = buffer; 726 QString lineStr = buffer;
727 QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") ); 727 QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") );
728} 728}
729 729
730bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { 730bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) {
731 if ( o->inherits( "QLineEdit" ) ) { 731 if ( o->inherits( "QLineEdit" ) ) {
732 if ( e->type() == QEvent::KeyPress ) { 732 if ( e->type() == QEvent::KeyPress ) {
733 QKeyEvent *ke = (QKeyEvent*)e; 733 QKeyEvent *ke = (QKeyEvent*)e;
734 if ( ke->key() == Key_Return || 734 if ( ke->key() == Key_Return ||
735 ke->key() == Key_Enter ) { 735 ke->key() == Key_Enter ) {
736 okRename(); 736 okRename();
737 return true; 737 return true;
738 } 738 }
739 else if ( ke->key() == Key_Escape ) { 739 else if ( ke->key() == Key_Escape ) {
740 cancelRename(); 740 cancelRename();
741 return true; 741 return true;
742 } 742 }
743 } 743 }
744 else if ( e->type() == QEvent::FocusOut ) { 744 else if ( e->type() == QEvent::FocusOut ) {
745 cancelRename(); 745 cancelRename();
746 return true; 746 return true;
747 } 747 }
748 } 748 }
749 if ( o->inherits( "QListView" ) ) { 749 if ( o->inherits( "QListView" ) ) {
750 if ( e->type() == QEvent::FocusIn ) { 750 if ( e->type() == QEvent::FocusIn ) {
751 if( o == Local_View) { //keep track of which view 751 if( o == Local_View) { //keep track of which view
752 whichTab=1; 752 whichTab=1;
753 } 753 }
754 else { 754 else {
755 whichTab=2; 755 whichTab=2;
756 } 756 }
757 } 757 }
diff --git a/noncore/apps/advancedfm/output.cpp b/noncore/apps/advancedfm/output.cpp
index 7dc2416..0bba1d8 100644
--- a/noncore/apps/advancedfm/output.cpp
+++ b/noncore/apps/advancedfm/output.cpp
@@ -96,181 +96,181 @@ static char * filesave_xpm[] = {
96"K c #323232", 96"K c #323232",
97"L c #D0D0D0", 97"L c #D0D0D0",
98"M c #1C1C1C", 98"M c #1C1C1C",
99" ...+ ", 99" ...+ ",
100" @#$%&..+ ", 100" @#$%&..+ ",
101" .*=-;;>,..+ ", 101" .*=-;;>,..+ ",
102" ')!~;;;;;;{]..", 102" ')!~;;;;;;{]..",
103" ^/(-;;;;;;;_:<", 103" ^/(-;;;;;;;_:<",
104" [}|;;;;;;;{12$", 104" [}|;;;;;;;{12$",
105" #34-55;;;;678$+", 105" #34-55;;;;678$+",
106" 90ab=c;dd;e1fg ", 106" 90ab=c;dd;e1fg ",
107" [ahij((kbl0mn$ ", 107" [ahij((kbl0mn$ ",
108" op^q^^7r&]s/$+ ", 108" op^q^^7r&]s/$+ ",
109"@btu;vbwxy]zAB ", 109"@btu;vbwxy]zAB ",
110"CzDEvEv;;DssF$ ", 110"CzDEvEv;;DssF$ ",
111"G.H{E{E{IxsJ$+ ", 111"G.H{E{E{IxsJ$+ ",
112" +...vEKxzLM ", 112" +...vEKxzLM ",
113" +...z]n$ ", 113" +...z]n$ ",
114" +... "}; 114" +... "};
115 115
116Output::Output( const QStringList commands, QWidget* parent, const char* name, bool modal, WFlags fl) 116Output::Output( const QStringList commands, QWidget* parent, const char* name, bool modal, WFlags fl)
117 : QDialog( parent, name, modal, fl ) 117 : QDialog( parent, name, modal, fl )
118{ 118{
119 QStringList cmmds; 119 QStringList cmmds;
120// cmmds=QStringList::split( " ", commands, false); 120// cmmds=QStringList::split( " ", commands, false);
121 cmmds=commands; 121 cmmds=commands;
122// qDebug("count %d", cmmds.count()); 122// qDebug("count %d", cmmds.count());
123 if ( !name ) 123 if ( !name )
124 setName( tr("Output")); 124 setName( tr("Output"));
125 resize( 196, 269 ); 125 resize( 196, 269 );
126 setCaption( name ); 126 setCaption( name );
127 127
128 OutputLayout = new QGridLayout( this ); 128 OutputLayout = new QGridLayout( this );
129 OutputLayout->setSpacing( 2); 129 OutputLayout->setSpacing( 2);
130 OutputLayout->setMargin( 2); 130 OutputLayout->setMargin( 2);
131 131
132 QPushButton *docButton; 132 QPushButton *docButton;
133 docButton = new QPushButton( QPixmap(( const char** ) filesave_xpm ) ,"",this,"saveButton"); 133 docButton = new QPushButton( QPixmap(( const char** ) filesave_xpm ) ,"",this,"saveButton");
134 docButton->setFixedSize( QSize( 20, 20 ) ); 134 docButton->setFixedSize( QSize( 20, 20 ) );
135 connect( docButton,SIGNAL(released()),this,SLOT( saveOutput() )); 135 connect( docButton,SIGNAL(released()),this,SLOT( saveOutput() ));
136 // docButton->setFlat(TRUE); 136 // docButton->setFlat(TRUE);
137 OutputLayout->addMultiCellWidget( docButton, 0,0,3,3 ); 137 OutputLayout->addMultiCellWidget( docButton, 0,0,3,3 );
138 138
139 OutputEdit = new QMultiLineEdit( this, "OutputEdit" ); 139 OutputEdit = new QMultiLineEdit( this, "OutputEdit" );
140 OutputLayout->addMultiCellWidget( OutputEdit, 1,1,0,3 ); 140 OutputLayout->addMultiCellWidget( OutputEdit, 1,1,0,3 );
141 141
142 proc = new OProcess(); 142 proc = new OProcess();
143 143
144 connect(proc, SIGNAL(processExited(OProcess *)), 144 connect(proc, SIGNAL(processExited(OProcess*)),
145 this, SLOT( processFinished())); 145 this, SLOT( processFinished()));
146 146
147 connect(proc, SIGNAL(receivedStdout(OProcess *, char *, int)), 147 connect(proc, SIGNAL(receivedStdout(OProcess*,char*,int)),
148 this, SLOT(commandStdout(OProcess *, char *, int))); 148 this, SLOT(commandStdout(OProcess*,char*,int)));
149 149
150 connect(proc, SIGNAL(receivedStderr(OProcess *, char *, int)), 150 connect(proc, SIGNAL(receivedStderr(OProcess*,char*,int)),
151 this, SLOT(commandStderr(OProcess *, char *, int))); 151 this, SLOT(commandStderr(OProcess*,char*,int)));
152 152
153// connect( , SIGNAL(received(const QByteArray &)), 153// connect( , SIGNAL(received(const QByteArray&)),
154// this, SLOT(commandStdin(const QByteArray &))); 154// this, SLOT(commandStdin(const QByteArray&)));
155 155
156// * proc << commands.latin1(); 156// * proc << commands.latin1();
157 for ( QStringList::Iterator it = cmmds.begin(); it != cmmds.end(); ++it ) { 157 for ( QStringList::Iterator it = cmmds.begin(); it != cmmds.end(); ++it ) {
158 qDebug( "%s", (*it).latin1() ); 158 qDebug( "%s", (*it).latin1() );
159 * proc << (*it).latin1(); 159 * proc << (*it).latin1();
160 } 160 }
161 161
162 if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) { 162 if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) {
163 163
164 OutputEdit->append(tr("Process could not start") ); 164 OutputEdit->append(tr("Process could not start") );
165 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); 165 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE);
166 perror("Error: "); 166 perror("Error: ");
167 QString errorMsg=tr("Error\n")+(QString)strerror(errno); 167 QString errorMsg=tr("Error\n")+(QString)strerror(errno);
168 OutputEdit->append( errorMsg); 168 OutputEdit->append( errorMsg);
169 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); 169 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE);
170 } 170 }
171} 171}
172 172
173Output::~Output() { 173Output::~Output() {
174} 174}
175 175
176void Output::saveOutput() { 176void Output::saveOutput() {
177 177
178 InputDialog *fileDlg; 178 InputDialog *fileDlg;
179 fileDlg = new InputDialog(this,tr("Save output to file (name only)"),TRUE, 0); 179 fileDlg = new InputDialog(this,tr("Save output to file (name only)"),TRUE, 0);
180 fileDlg->exec(); 180 fileDlg->exec();
181 if( fileDlg->result() == 1 ) { 181 if( fileDlg->result() == 1 ) {
182 QString filename = QPEApplication::documentDir(); 182 QString filename = QPEApplication::documentDir();
183 if(filename.right(1).find('/') == -1) 183 if(filename.right(1).find('/') == -1)
184 filename+="/"; 184 filename+="/";
185 QString name = fileDlg->LineEdit1->text(); 185 QString name = fileDlg->LineEdit1->text();
186 filename+="text/plain/"+name; 186 filename+="text/plain/"+name;
187 qDebug(filename); 187 qDebug(filename);
188 188
189 QFile f(filename); 189 QFile f(filename);
190 f.open( IO_WriteOnly); 190 f.open( IO_WriteOnly);
191 if( f.writeBlock( OutputEdit->text(), qstrlen( OutputEdit->text()) ) != -1) { 191 if( f.writeBlock( OutputEdit->text(), qstrlen( OutputEdit->text()) ) != -1) {
192 DocLnk lnk; 192 DocLnk lnk;
193 lnk.setName(name); //sets file name 193 lnk.setName(name); //sets file name
194 lnk.setFile(filename); //sets File property 194 lnk.setFile(filename); //sets File property
195 lnk.setType("text/plain"); 195 lnk.setType("text/plain");
196 if(!lnk.writeLink()) { 196 if(!lnk.writeLink()) {
197 qDebug("Writing doclink did not work"); 197 qDebug("Writing doclink did not work");
198 } 198 }
199 } else 199 } else
200 qWarning("Could not write file"); 200 qWarning("Could not write file");
201 f.close(); 201 f.close();
202 } 202 }
203} 203}
204 204
205void Output::commandStdout(OProcess*, char *buffer, int buflen) { 205void Output::commandStdout(OProcess*, char *buffer, int buflen) {
206 qWarning("received stdout %d bytes", buflen); 206 qWarning("received stdout %d bytes", buflen);
207 207
208// QByteArray data(buflen); 208// QByteArray data(buflen);
209// data.fill(*buffer, buflen); 209// data.fill(*buffer, buflen);
210// for (uint i = 0; i < data.count(); i++ ) { 210// for (uint i = 0; i < data.count(); i++ ) {
211// printf("%c", buffer[i] ); 211// printf("%c", buffer[i] );
212// } 212// }
213// printf("\n"); 213// printf("\n");
214 214
215 QString lineStr = buffer; 215 QString lineStr = buffer;
216 lineStr=lineStr.left(lineStr.length()-1); 216 lineStr=lineStr.left(lineStr.length()-1);
217 OutputEdit->append(lineStr); 217 OutputEdit->append(lineStr);
218 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); 218 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE);
219} 219}
220 220
221 221
222void Output::commandStdin( const QByteArray &data) { 222void Output::commandStdin( const QByteArray &data) {
223 qWarning("received stdin %d bytes", data.size()); 223 qWarning("received stdin %d bytes", data.size());
224 // recieved data from the io layer goes to sz 224 // recieved data from the io layer goes to sz
225 proc->writeStdin(data.data(), data.size()); 225 proc->writeStdin(data.data(), data.size());
226} 226}
227 227
228void Output::commandStderr(OProcess*, char *buffer, int buflen) { 228void Output::commandStderr(OProcess*, char *buffer, int buflen) {
229 qWarning("received stderrt %d bytes", buflen); 229 qWarning("received stderrt %d bytes", buflen);
230 230
231 QString lineStr = buffer; 231 QString lineStr = buffer;
232// lineStr=lineStr.left(lineStr.length()-1); 232// lineStr=lineStr.left(lineStr.length()-1);
233 OutputEdit->append(lineStr); 233 OutputEdit->append(lineStr);
234 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); 234 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE);
235} 235}
236 236
237void Output::processFinished() { 237void Output::processFinished() {
238 238
239 delete proc; 239 delete proc;
240 OutputEdit->append( tr("\nFinished\n") ); 240 OutputEdit->append( tr("\nFinished\n") );
241 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); 241 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE);
242// close(); 242// close();
243// disconnect( layer(), SIGNAL(received(const QByteArray &)), 243// disconnect( layer(), SIGNAL(received(const QByteArray&)),
244// this, SLOT(commandStdin(const QByteArray &))); 244// this, SLOT(commandStdin(const QByteArray&)));
245} 245}
246 246
247//============================== 247//==============================
248 248
249InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) 249InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
250 : QDialog( parent, name, modal, fl ) 250 : QDialog( parent, name, modal, fl )
251{ 251{
252 if ( !name ) 252 if ( !name )
253 setName( "InputDialog" ); 253 setName( "InputDialog" );
254 resize( 234, 50 ); 254 resize( 234, 50 );
255 setMaximumSize( QSize( 240, 50 ) ); 255 setMaximumSize( QSize( 240, 50 ) );
256 setCaption( tr(name ) ); 256 setCaption( tr(name ) );
257 257
258 LineEdit1 = new QLineEdit( this, "LineEdit1" ); 258 LineEdit1 = new QLineEdit( this, "LineEdit1" );
259 LineEdit1->setGeometry( QRect( 10, 10, 216, 22 ) ); 259 LineEdit1->setGeometry( QRect( 10, 10, 216, 22 ) );
260 LineEdit1->setFocus(); 260 LineEdit1->setFocus();
261 LineEdit1->setFocus(); 261 LineEdit1->setFocus();
262 connect(LineEdit1,SIGNAL(returnPressed()),this,SLOT(returned() )); 262 connect(LineEdit1,SIGNAL(returnPressed()),this,SLOT(returned() ));
263} 263}
264 264
265InputDialog::~InputDialog() { 265InputDialog::~InputDialog() {
266 inputText = LineEdit1->text(); 266 inputText = LineEdit1->text();
267} 267}
268 268
269void InputDialog::setInputText(const QString &string) { 269void InputDialog::setInputText(const QString &string) {
270 LineEdit1->setText( string); 270 LineEdit1->setText( string);
271} 271}
272 272
273void InputDialog::returned() { 273void InputDialog::returned() {
274 inputText = LineEdit1->text(); 274 inputText = LineEdit1->text();
275 this->accept(); 275 this->accept();
276} 276}
diff --git a/noncore/apps/checkbook/checkbook.cpp b/noncore/apps/checkbook/checkbook.cpp
index 26b2533..1b933f2 100644
--- a/noncore/apps/checkbook/checkbook.cpp
+++ b/noncore/apps/checkbook/checkbook.cpp
@@ -48,245 +48,245 @@
48#include <qpushbutton.h> 48#include <qpushbutton.h>
49#include <qwhatsthis.h> 49#include <qwhatsthis.h>
50#include <qpopupmenu.h> 50#include <qpopupmenu.h>
51 51
52#define COL_ID 0 52#define COL_ID 0
53#define COL_SORTDATE 1 53#define COL_SORTDATE 1
54#define COL_NUM 2 54#define COL_NUM 2
55#define COL_DATE 3 55#define COL_DATE 3
56#define COL_DESC 4 56#define COL_DESC 4
57#define COL_AMOUNT 5 57#define COL_AMOUNT 5
58#define COL_BAL 6 58#define COL_BAL 6
59 59
60// --- Checkbook -------------------------------------------------------------- 60// --- Checkbook --------------------------------------------------------------
61Checkbook::Checkbook( QWidget *parent, CBInfo *i, Cfg *cfg ) 61Checkbook::Checkbook( QWidget *parent, CBInfo *i, Cfg *cfg )
62 : QDialog( parent, 0, TRUE, WStyle_ContextHelp ) 62 : QDialog( parent, 0, TRUE, WStyle_ContextHelp )
63{ 63{
64 info = i; 64 info = i;
65 _pCfg=cfg; 65 _pCfg=cfg;
66 66
67 // Title bar 67 // Title bar
68 if ( info->name() != "" ) 68 if ( info->name() != "" )
69 { 69 {
70 QString tempstr = info->name(); 70 QString tempstr = info->name();
71 tempstr.append( " - " ); 71 tempstr.append( " - " );
72 tempstr.append( tr( "Checkbook" ) ); 72 tempstr.append( tr( "Checkbook" ) );
73 setCaption( tempstr ); 73 setCaption( tempstr );
74 } 74 }
75 else 75 else
76 { 76 {
77 setCaption( tr( "New checkbook" ) ); 77 setCaption( tr( "New checkbook" ) );
78 } 78 }
79 79
80 80
81 // Setup layout to make everything pretty 81 // Setup layout to make everything pretty
82 QVBoxLayout *layout = new QVBoxLayout( this ); 82 QVBoxLayout *layout = new QVBoxLayout( this );
83 layout->setMargin( 2 ); 83 layout->setMargin( 2 );
84 layout->setSpacing( 4 ); 84 layout->setSpacing( 4 );
85 85
86 // Setup tabs for all info 86 // Setup tabs for all info
87 mainWidget = new OTabWidget( this ); 87 mainWidget = new OTabWidget( this );
88 layout->addWidget( mainWidget ); 88 layout->addWidget( mainWidget );
89 mainWidget->addTab( initInfo(), "checkbook/infotab", tr( "Info" ) ); 89 mainWidget->addTab( initInfo(), "checkbook/infotab", tr( "Info" ) );
90 mainWidget->addTab( initTransactions(), "checkbook/trantab", tr( "Transactions" ) ); 90 mainWidget->addTab( initTransactions(), "checkbook/trantab", tr( "Transactions" ) );
91 mainWidget->addTab( initCharts(), "checkbook/charttab", tr( "Charts" ) ); 91 mainWidget->addTab( initCharts(), "checkbook/charttab", tr( "Charts" ) );
92 if( _pCfg->isShowLastTab() ) 92 if( _pCfg->isShowLastTab() )
93 mainWidget->setCurrentTab( info->getLastTab() ); 93 mainWidget->setCurrentTab( info->getLastTab() );
94 else 94 else
95 mainWidget->setCurrentTab( tr( "Info" ) ); 95 mainWidget->setCurrentTab( tr( "Info" ) );
96 connect( mainWidget, SIGNAL( currentChanged(QWidget *) ), this, SLOT( slotTab(QWidget *) ) ); 96 connect( mainWidget, SIGNAL( currentChanged(QWidget*) ), this, SLOT( slotTab(QWidget*) ) );
97 97
98 // Load checkbook information 98 // Load checkbook information
99 loadCheckbook(); 99 loadCheckbook();
100} 100}
101 101
102Checkbook::~Checkbook() 102Checkbook::~Checkbook()
103{ 103{
104} 104}
105 105
106// --- initInfo --------------------------------------------------------------- 106// --- initInfo ---------------------------------------------------------------
107QWidget *Checkbook::initInfo() 107QWidget *Checkbook::initInfo()
108{ 108{
109 QWidget *control = new QWidget( mainWidget, tr("Info") ); 109 QWidget *control = new QWidget( mainWidget, tr("Info") );
110 110
111 QVBoxLayout *vb = new QVBoxLayout( control ); 111 QVBoxLayout *vb = new QVBoxLayout( control );
112 112
113 QScrollView *sv = new QScrollView( control ); 113 QScrollView *sv = new QScrollView( control );
114 vb->addWidget( sv, 0, 0 ); 114 vb->addWidget( sv, 0, 0 );
115 sv->setResizePolicy( QScrollView::AutoOneFit ); 115 sv->setResizePolicy( QScrollView::AutoOneFit );
116 sv->setFrameStyle( QFrame::NoFrame ); 116 sv->setFrameStyle( QFrame::NoFrame );
117 117
118 QWidget *container = new QWidget( sv->viewport() ); 118 QWidget *container = new QWidget( sv->viewport() );
119 sv->addChild( container ); 119 sv->addChild( container );
120 120
121 QGridLayout *layout = new QGridLayout( container ); 121 QGridLayout *layout = new QGridLayout( container );
122 layout->setSpacing( 2 ); 122 layout->setSpacing( 2 );
123 layout->setMargin( 4 ); 123 layout->setMargin( 4 );
124 124
125 // Password protection 125 // Password protection
126 passwordCB = new QCheckBox( tr( "Password protect" ), container ); 126 passwordCB = new QCheckBox( tr( "Password protect" ), container );
127 QWhatsThis::add( passwordCB, tr( "Click here to enable/disable password protection of this checkbook." ) ); 127 QWhatsThis::add( passwordCB, tr( "Click here to enable/disable password protection of this checkbook." ) );
128 connect( passwordCB, SIGNAL( clicked() ), this, SLOT( slotPasswordClicked() ) ); 128 connect( passwordCB, SIGNAL( clicked() ), this, SLOT( slotPasswordClicked() ) );
129 layout->addMultiCellWidget( passwordCB, 0, 0, 0, 1 ); 129 layout->addMultiCellWidget( passwordCB, 0, 0, 0, 1 );
130 130
131 // Account name 131 // Account name
132 QLabel *label = new QLabel( tr( "Name:" ), container ); 132 QLabel *label = new QLabel( tr( "Name:" ), container );
133 QWhatsThis::add( label, tr( "Enter name of checkbook here." ) ); 133 QWhatsThis::add( label, tr( "Enter name of checkbook here." ) );
134 layout->addWidget( label, 1, 0 ); 134 layout->addWidget( label, 1, 0 );
135 nameEdit = new QLineEdit( container ); 135 nameEdit = new QLineEdit( container );
136 QWhatsThis::add( nameEdit, tr( "Enter name of checkbook here." ) ); 136 QWhatsThis::add( nameEdit, tr( "Enter name of checkbook here." ) );
137 connect( nameEdit, SIGNAL( textChanged( const QString & ) ), 137 connect( nameEdit, SIGNAL( textChanged(const QString&) ),
138 this, SLOT( slotNameChanged( const QString & ) ) ); 138 this, SLOT( slotNameChanged(const QString&) ) );
139 layout->addWidget( nameEdit, 1, 1 ); 139 layout->addWidget( nameEdit, 1, 1 );
140 140
141 // Type of account 141 // Type of account
142 label = new QLabel( tr( "Type:" ), container ); 142 label = new QLabel( tr( "Type:" ), container );
143 QWhatsThis::add( label, tr( "Select type of checkbook here." ) ); 143 QWhatsThis::add( label, tr( "Select type of checkbook here." ) );
144 layout->addWidget( label, 2, 0 ); 144 layout->addWidget( label, 2, 0 );
145 typeList = new QComboBox( container ); 145 typeList = new QComboBox( container );
146 QWhatsThis::add( typeList, tr( "Select type of checkbook here." ) ); 146 QWhatsThis::add( typeList, tr( "Select type of checkbook here." ) );
147 typeList->insertStringList( _pCfg->getAccountTypes() ); 147 typeList->insertStringList( _pCfg->getAccountTypes() );
148 layout->addWidget( typeList, 2, 1 ); 148 layout->addWidget( typeList, 2, 1 );
149 149
150 // Bank/institution name 150 // Bank/institution name
151 label = new QLabel( tr( "Bank:" ), container ); 151 label = new QLabel( tr( "Bank:" ), container );
152 QWhatsThis::add( label, tr( "Enter name of the bank for this checkbook here." ) ); 152 QWhatsThis::add( label, tr( "Enter name of the bank for this checkbook here." ) );
153 layout->addWidget( label, 3, 0 ); 153 layout->addWidget( label, 3, 0 );
154 bankEdit = new QLineEdit( container ); 154 bankEdit = new QLineEdit( container );
155 QWhatsThis::add( bankEdit, tr( "Enter name of the bank for this checkbook here." ) ); 155 QWhatsThis::add( bankEdit, tr( "Enter name of the bank for this checkbook here." ) );
156 layout->addWidget( bankEdit, 3, 1 ); 156 layout->addWidget( bankEdit, 3, 1 );
157 157
158 // Account number 158 // Account number
159 label = new QLabel( tr( "Account number:" ), container ); 159 label = new QLabel( tr( "Account number:" ), container );
160 QWhatsThis::add( label, tr( "Enter account number for this checkbook here." ) ); 160 QWhatsThis::add( label, tr( "Enter account number for this checkbook here." ) );
161 layout->addWidget( label, 4, 0 ); 161 layout->addWidget( label, 4, 0 );
162 acctNumEdit = new QLineEdit( container ); 162 acctNumEdit = new QLineEdit( container );
163 QWhatsThis::add( acctNumEdit, tr( "Enter account number for this checkbook here." ) ); 163 QWhatsThis::add( acctNumEdit, tr( "Enter account number for this checkbook here." ) );
164 layout->addWidget( acctNumEdit, 4, 1 ); 164 layout->addWidget( acctNumEdit, 4, 1 );
165 165
166 // PIN number 166 // PIN number
167 label = new QLabel( tr( "PIN number:" ), container ); 167 label = new QLabel( tr( "PIN number:" ), container );
168 QWhatsThis::add( label, tr( "Enter PIN number for this checkbook here." ) ); 168 QWhatsThis::add( label, tr( "Enter PIN number for this checkbook here." ) );
169 layout->addWidget( label, 5, 0 ); 169 layout->addWidget( label, 5, 0 );
170 pinNumEdit = new QLineEdit( container ); 170 pinNumEdit = new QLineEdit( container );
171 QWhatsThis::add( pinNumEdit, tr( "Enter PIN number for this checkbook here." ) ); 171 QWhatsThis::add( pinNumEdit, tr( "Enter PIN number for this checkbook here." ) );
172 layout->addWidget( pinNumEdit, 5, 1 ); 172 layout->addWidget( pinNumEdit, 5, 1 );
173 173
174 // Starting balance 174 // Starting balance
175 label = new QLabel( tr( "Starting balance:" ), container ); 175 label = new QLabel( tr( "Starting balance:" ), container );
176 QWhatsThis::add( label, tr( "Enter the initial balance for this checkbook here." ) ); 176 QWhatsThis::add( label, tr( "Enter the initial balance for this checkbook here." ) );
177 layout->addWidget( label, 6, 0 ); 177 layout->addWidget( label, 6, 0 );
178 balanceEdit = new QLineEdit( container ); 178 balanceEdit = new QLineEdit( container );
179 QWhatsThis::add( balanceEdit, tr( "Enter the initial balance for this checkbook here." ) ); 179 QWhatsThis::add( balanceEdit, tr( "Enter the initial balance for this checkbook here." ) );
180 connect( balanceEdit, SIGNAL( textChanged( const QString & ) ), 180 connect( balanceEdit, SIGNAL( textChanged(const QString&) ),
181 this, SLOT( slotStartingBalanceChanged( const QString & ) ) ); 181 this, SLOT( slotStartingBalanceChanged(const QString&) ) );
182 layout->addWidget( balanceEdit, 6, 1 ); 182 layout->addWidget( balanceEdit, 6, 1 );
183 183
184 // Notes 184 // Notes
185 label = new QLabel( tr( "Notes:" ), container ); 185 label = new QLabel( tr( "Notes:" ), container );
186 QWhatsThis::add( label, tr( "Enter any additional information for this checkbook here." ) ); 186 QWhatsThis::add( label, tr( "Enter any additional information for this checkbook here." ) );
187 layout->addWidget( label, 7, 0 ); 187 layout->addWidget( label, 7, 0 );
188 notesEdit = new QMultiLineEdit( container ); 188 notesEdit = new QMultiLineEdit( container );
189 QWhatsThis::add( notesEdit, tr( "Enter any additional information for this checkbook here." ) ); 189 QWhatsThis::add( notesEdit, tr( "Enter any additional information for this checkbook here." ) );
190 notesEdit->setMinimumHeight( 25 ); 190 notesEdit->setMinimumHeight( 25 );
191 notesEdit->setMaximumHeight( 65 ); 191 notesEdit->setMaximumHeight( 65 );
192 layout->addMultiCellWidget( notesEdit, 8, 8, 0, 1 ); 192 layout->addMultiCellWidget( notesEdit, 8, 8, 0, 1 );
193 193
194 return control; 194 return control;
195} 195}
196 196
197 197
198// --- initTransactions ------------------------------------------------------- 198// --- initTransactions -------------------------------------------------------
199QWidget *Checkbook::initTransactions() 199QWidget *Checkbook::initTransactions()
200{ 200{
201 QWidget *control = new QWidget( mainWidget, tr("Transactions") ); 201 QWidget *control = new QWidget( mainWidget, tr("Transactions") );
202 202
203 QGridLayout *layout = new QGridLayout( control ); 203 QGridLayout *layout = new QGridLayout( control );
204 layout->setSpacing( 2 ); 204 layout->setSpacing( 2 );
205 layout->setMargin( 4 ); 205 layout->setMargin( 4 );
206 206
207 // Sort selector 207 // Sort selector
208 QLabel *label = new QLabel( tr( "Sort by:" ), control ); 208 QLabel *label = new QLabel( tr( "Sort by:" ), control );
209 QWhatsThis::add( label, tr( "Select checkbook sorting here." ) ); 209 QWhatsThis::add( label, tr( "Select checkbook sorting here." ) );
210 layout->addMultiCellWidget( label, 0, 0, 0, 1 ); 210 layout->addMultiCellWidget( label, 0, 0, 0, 1 );
211 _cbSortType=new QComboBox( control ); 211 _cbSortType=new QComboBox( control );
212 _cbSortType->insertItem( tr("Entry Order") ); 212 _cbSortType->insertItem( tr("Entry Order") );
213 _cbSortType->insertItem( tr("Date") ); 213 _cbSortType->insertItem( tr("Date") );
214 _cbSortType->insertItem( tr("Number") ); 214 _cbSortType->insertItem( tr("Number") );
215 layout->addMultiCellWidget( _cbSortType, 0, 0, 1, 2 ); 215 layout->addMultiCellWidget( _cbSortType, 0, 0, 1, 2 );
216 connect( _cbSortType, SIGNAL( activated(const QString &) ), this, SLOT( slotSortChanged( const QString & ) ) ); 216 connect( _cbSortType, SIGNAL( activated(const QString&) ), this, SLOT( slotSortChanged(const QString&) ) );
217 217
218 // Table 218 // Table
219 tranTable = new QListView( control ); 219 tranTable = new QListView( control );
220 QFont fnt(QPEApplication::font()); 220 QFont fnt(QPEApplication::font());
221 fnt.setPointSize( fnt.pointSize()-1 ); 221 fnt.setPointSize( fnt.pointSize()-1 );
222 tranTable->setFont( fnt ); 222 tranTable->setFont( fnt );
223 QWhatsThis::add( tranTable, tr( "This is a listing of all transactions entered for this checkbook.\n\nTo sort entries by a specific field, click on the column name." ) ); 223 QWhatsThis::add( tranTable, tr( "This is a listing of all transactions entered for this checkbook.\n\nTo sort entries by a specific field, click on the column name." ) );
224 tranTable->addColumn( tr( "Id" ) ); 224 tranTable->addColumn( tr( "Id" ) );
225 tranTable->setColumnWidthMode( COL_ID, QListView::Manual ); 225 tranTable->setColumnWidthMode( COL_ID, QListView::Manual );
226 tranTable->setColumnWidth( COL_ID, 0); 226 tranTable->setColumnWidth( COL_ID, 0);
227 tranTable->addColumn( tr( "SortDate" ) ); 227 tranTable->addColumn( tr( "SortDate" ) );
228 tranTable->setColumnWidthMode( COL_SORTDATE, QListView::Manual ); 228 tranTable->setColumnWidthMode( COL_SORTDATE, QListView::Manual );
229 tranTable->setColumnWidth( COL_SORTDATE, 0); 229 tranTable->setColumnWidth( COL_SORTDATE, 0);
230 tranTable->addColumn( tr( "Num" ) ); 230 tranTable->addColumn( tr( "Num" ) );
231 tranTable->addColumn( tr( "Date" ) ); 231 tranTable->addColumn( tr( "Date" ) );
232 //tranTable->addColumn( tr( "Cleared" ) ); 232 //tranTable->addColumn( tr( "Cleared" ) );
233 tranTable->addColumn( tr( "Description" ) ); 233 tranTable->addColumn( tr( "Description" ) );
234 int column = tranTable->addColumn( tr( "Amount" ) ); 234 int column = tranTable->addColumn( tr( "Amount" ) );
235 tranTable->setColumnAlignment( column, Qt::AlignRight ); 235 tranTable->setColumnAlignment( column, Qt::AlignRight );
236 column=tranTable->addColumn( tr("Balance") ); 236 column=tranTable->addColumn( tr("Balance") );
237 tranTable->setColumnAlignment( column, Qt::AlignRight ); 237 tranTable->setColumnAlignment( column, Qt::AlignRight );
238 tranTable->setAllColumnsShowFocus( TRUE ); 238 tranTable->setAllColumnsShowFocus( TRUE );
239 tranTable->setSorting( -1 ); 239 tranTable->setSorting( -1 );
240 layout->addMultiCellWidget( tranTable, 1, 1, 0, 2 ); 240 layout->addMultiCellWidget( tranTable, 1, 1, 0, 2 );
241 QPEApplication::setStylusOperation( tranTable->viewport(), QPEApplication::RightOnHold ); 241 QPEApplication::setStylusOperation( tranTable->viewport(), QPEApplication::RightOnHold );
242 connect( tranTable, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ), 242 connect( tranTable, SIGNAL( rightButtonPressed(QListViewItem*,const QPoint&,int) ),
243 this, SLOT( slotMenuTran(QListViewItem *, const QPoint &) ) ); 243 this, SLOT( slotMenuTran(QListViewItem*,const QPoint&) ) );
244 connect( tranTable, SIGNAL( doubleClicked( QListViewItem * ) ), 244 connect( tranTable, SIGNAL( doubleClicked(QListViewItem*) ),
245 this, SLOT( slotEditTran() ) ); 245 this, SLOT( slotEditTran() ) );
246 _sortCol=COL_ID; 246 _sortCol=COL_ID;
247 247
248 // Buttons 248 // Buttons
249 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), control ); 249 QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), control );
250 QWhatsThis::add( btn, tr( "Click here to add a new transaction." ) ); 250 QWhatsThis::add( btn, tr( "Click here to add a new transaction." ) );
251 connect( btn, SIGNAL( clicked() ), this, SLOT( slotNewTran() ) ); 251 connect( btn, SIGNAL( clicked() ), this, SLOT( slotNewTran() ) );
252 layout->addWidget( btn, 2, 0 ); 252 layout->addWidget( btn, 2, 0 );
253 253
254 btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Edit" ), control ); 254 btn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Edit" ), control );
255 QWhatsThis::add( btn, tr( "Select a transaction and then click here to edit it." ) ); 255 QWhatsThis::add( btn, tr( "Select a transaction and then click here to edit it." ) );
256 connect( btn, SIGNAL( clicked() ), this, SLOT( slotEditTran() ) ); 256 connect( btn, SIGNAL( clicked() ), this, SLOT( slotEditTran() ) );
257 layout->addWidget( btn, 2, 1 ); 257 layout->addWidget( btn, 2, 1 );
258 258
259 btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), control ); 259 btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), control );
260 QWhatsThis::add( btn, tr( "Select a checkbook and then click here to delete it." ) ); 260 QWhatsThis::add( btn, tr( "Select a checkbook and then click here to delete it." ) );
261 connect( btn, SIGNAL( clicked() ), this, SLOT( slotDeleteTran() ) ); 261 connect( btn, SIGNAL( clicked() ), this, SLOT( slotDeleteTran() ) );
262 layout->addWidget( btn, 2, 2 ); 262 layout->addWidget( btn, 2, 2 );
263 263
264 return( control ); 264 return( control );
265} 265}
266 266
267 267
268// --- initCharts ------------------------------------------------------------- 268// --- initCharts -------------------------------------------------------------
269QWidget *Checkbook::initCharts() 269QWidget *Checkbook::initCharts()
270{ 270{
271 graphInfo = 0x0; 271 graphInfo = 0x0;
272 272
273 QWidget *control = new QWidget( mainWidget, tr("Charts") ); 273 QWidget *control = new QWidget( mainWidget, tr("Charts") );
274 274
275 QGridLayout *layout = new QGridLayout( control ); 275 QGridLayout *layout = new QGridLayout( control );
276 layout->setSpacing( 2 ); 276 layout->setSpacing( 2 );
277 layout->setMargin( 4 ); 277 layout->setMargin( 4 );
278 278
279 graphWidget = new Graph( control ); 279 graphWidget = new Graph( control );
280 QWhatsThis::add( graphWidget, tr( "Select the desired chart below and then click on the Draw button." ) ); 280 QWhatsThis::add( graphWidget, tr( "Select the desired chart below and then click on the Draw button." ) );
281 layout->addMultiCellWidget( graphWidget, 0, 0, 0, 2 ); 281 layout->addMultiCellWidget( graphWidget, 0, 0, 0, 2 );
282 282
283 graphList = new QComboBox( control ); 283 graphList = new QComboBox( control );
284 QWhatsThis::add( graphList, tr( "Click here to select the desired chart type." ) ); 284 QWhatsThis::add( graphList, tr( "Click here to select the desired chart type." ) );
285 graphList->insertItem( tr( "Account balance" ) ); 285 graphList->insertItem( tr( "Account balance" ) );
286 graphList->insertItem( tr( "Withdrawals by category" ) ); 286 graphList->insertItem( tr( "Withdrawals by category" ) );
287 graphList->insertItem( tr( "Deposits by category" ) ); 287 graphList->insertItem( tr( "Deposits by category" ) );
288 288
289 layout->addMultiCellWidget( graphList, 1, 1, 0, 1 ); 289 layout->addMultiCellWidget( graphList, 1, 1, 0, 1 );
290 290
291 QPushButton *btn = new QPushButton( Resource::loadPixmap( "checkbook/drawbtn" ), tr( "Draw" ), control ); 291 QPushButton *btn = new QPushButton( Resource::loadPixmap( "checkbook/drawbtn" ), tr( "Draw" ), control );
292 QWhatsThis::add( btn, tr( "Click here to draw the selected chart." ) ); 292 QWhatsThis::add( btn, tr( "Click here to draw the selected chart." ) );
diff --git a/noncore/apps/checkbook/listedit.cpp b/noncore/apps/checkbook/listedit.cpp
index 37f05f0..d00e305 100644
--- a/noncore/apps/checkbook/listedit.cpp
+++ b/noncore/apps/checkbook/listedit.cpp
@@ -10,111 +10,111 @@
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
11     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
12    .%`+i>       _;_. 12    .%`+i>       _;_.
13    .i_,=:_.      -<s. This file is distributed in the hope that 13    .i_,=:_.      -<s. This file is distributed in the hope that
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
15    : ..    .:,     . . . without even the implied warranty of 15    : ..    .:,     . . . without even the implied warranty of
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
18..}^=.=       =       ; Public License for more details. 18..}^=.=       =       ; Public License for more details.
19++=   -.     .`     .: 19++=   -.     .`     .:
20 :     =  ...= . :.=- You should have received a copy of the GNU 20 :     =  ...= . :.=- You should have received a copy of the GNU
21 -.   .:....=;==+<; General Public License along with this file; 21 -.   .:....=;==+<; General Public License along with this file;
22  -_. . .   )=.  = see the file COPYING. If not, write to the 22  -_. . .   )=.  = see the file COPYING. If not, write to the
23    --        :-=` Free Software Foundation, Inc., 23    --        :-=` Free Software Foundation, Inc.,
24 59 Temple Place - Suite 330, 24 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 "listedit.h" 29#include "listedit.h"
30#include <qlayout.h> 30#include <qlayout.h>
31#include <qlineedit.h> 31#include <qlineedit.h>
32#include <qlistview.h> 32#include <qlistview.h>
33#include <qwidgetstack.h> 33#include <qwidgetstack.h>
34#include <qcombobox.h> 34#include <qcombobox.h>
35#include <qpushbutton.h> 35#include <qpushbutton.h>
36#include <qpe/resource.h> 36#include <qpe/resource.h>
37 37
38 38
39// --- ListEdit --------------------------------------------------------------- 39// --- ListEdit ---------------------------------------------------------------
40ListEdit::ListEdit( QWidget *parent, const char *sName ) 40ListEdit::ListEdit( QWidget *parent, const char *sName )
41 : QWidget(parent, sName), TableDef(sName) 41 : QWidget(parent, sName), TableDef(sName)
42{ 42{
43 // get font height 43 // get font height
44 int fh = fontMetrics().height(); 44 int fh = fontMetrics().height();
45 45
46 // create layout 46 // create layout
47 QGridLayout *layout=new QGridLayout(this); 47 QGridLayout *layout=new QGridLayout(this);
48 layout->setSpacing( 2 ); 48 layout->setSpacing( 2 );
49 layout->setMargin( 4 ); 49 layout->setMargin( 4 );
50 50
51 // type table 51 // type table
52 _typeTable = new QListView( this ); 52 _typeTable = new QListView( this );
53 ColumnDef *def=first(); 53 ColumnDef *def=first();
54 while( def ) { 54 while( def ) {
55 _typeTable->addColumn( def->getName() ); 55 _typeTable->addColumn( def->getName() );
56 def=next(); 56 def=next();
57 } 57 }
58 connect( _typeTable, SIGNAL( clicked(QListViewItem *, const QPoint &, int) ), this, SLOT( slotClick(QListViewItem *, const QPoint &, int ) ) ); 58 connect( _typeTable, SIGNAL( clicked(QListViewItem*,const QPoint&,int) ), this, SLOT( slotClick(QListViewItem*,const QPoint&,int) ) );
59 layout->addMultiCellWidget(_typeTable, 0,4,0,4); 59 layout->addMultiCellWidget(_typeTable, 0,4,0,4);
60 _currentItem=NULL; 60 _currentItem=NULL;
61 61
62 // edit field 62 // edit field
63 _stack=new QWidgetStack( this ); 63 _stack=new QWidgetStack( this );
64 _stack->setMaximumHeight(fh+5); 64 _stack->setMaximumHeight(fh+5);
65 layout->addMultiCellWidget(_stack, 5,5,0,2); 65 layout->addMultiCellWidget(_stack, 5,5,0,2);
66 _typeEdit = new QLineEdit( _stack ); 66 _typeEdit = new QLineEdit( _stack );
67 _stack->raiseWidget(_typeEdit ); 67 _stack->raiseWidget(_typeEdit );
68 connect( _typeEdit, SIGNAL( textChanged(const QString &) ), this, SLOT( slotEditChanged(const QString &) ) ); 68 connect( _typeEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( slotEditChanged(const QString&) ) );
69 69
70 // combo box 70 // combo box
71 _box=new QComboBox( _stack ); 71 _box=new QComboBox( _stack );
72 connect( _box, SIGNAL( activated(const QString &) ), this, SLOT( slotActivated(const QString &) ) ); 72 connect( _box, SIGNAL( activated(const QString&) ), this, SLOT( slotActivated(const QString&) ) );
73 73
74 74
75 // add button 75 // add button
76 QPushButton *btn = new QPushButton( Resource::loadPixmap( "checkbook/add" ), tr( "Add" ), this ); 76 QPushButton *btn = new QPushButton( Resource::loadPixmap( "checkbook/add" ), tr( "Add" ), this );
77 connect( btn, SIGNAL( clicked() ), this, SLOT( slotAdd() ) ); 77 connect( btn, SIGNAL( clicked() ), this, SLOT( slotAdd() ) );
78 layout->addWidget( btn, 5, 3 ); 78 layout->addWidget( btn, 5, 3 );
79 79
80 // delete button 80 // delete button
81 btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), this ); 81 btn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), this );
82 connect( btn, SIGNAL( clicked() ), this, SLOT( slotDel() ) ); 82 connect( btn, SIGNAL( clicked() ), this, SLOT( slotDel() ) );
83 layout->addWidget( btn, 5, 4 ); 83 layout->addWidget( btn, 5, 4 );
84} 84}
85 85
86// --- ~ListEdit -------------------------------------------------------------- 86// --- ~ListEdit --------------------------------------------------------------
87ListEdit::~ListEdit() 87ListEdit::~ListEdit()
88{ 88{
89} 89}
90 90
91 91
92// --- slotEditTypeChanged ---------------------------------------------------- 92// --- slotEditTypeChanged ----------------------------------------------------
93void ListEdit::slotEditChanged(const QString &str) 93void ListEdit::slotEditChanged(const QString &str)
94{ 94{
95 if( !_currentItem || _currentColumn<0 ) return; 95 if( !_currentItem || _currentColumn<0 ) return;
96 _currentItem->setText(_currentColumn, str); 96 _currentItem->setText(_currentColumn, str);
97} 97}
98 98
99// --- slotAddType ------------------------------------------------------------ 99// --- slotAddType ------------------------------------------------------------
100void ListEdit::slotAdd() 100void ListEdit::slotAdd()
101{ 101{
102 // construct new row 102 // construct new row
103 QString args[8]; 103 QString args[8];
104 ColumnDef *pCol=this->first(); 104 ColumnDef *pCol=this->first();
105 int i=0; 105 int i=0;
106 while( pCol && i<8 ) { 106 while( pCol && i<8 ) {
107 args[i++]=pCol->getNewValue(); 107 args[i++]=pCol->getNewValue();
108 pCol=this->next(); 108 pCol=this->next();
109 } 109 }
110 _currentItem=new QListViewItem(_typeTable, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7] ); 110 _currentItem=new QListViewItem(_typeTable, args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7] );
111 111
112 // fix uniques 112 // fix uniques
113 fixTypes(); 113 fixTypes();
114 114
115 // display col 0 of new value 115 // display col 0 of new value
116 QPoint pnt; 116 QPoint pnt;
117 slotClick(_currentItem, pnt, 0); 117 slotClick(_currentItem, pnt, 0);
118 _typeTable->setSelected( _currentItem, true ); 118 _typeTable->setSelected( _currentItem, true );
119 119
120 // make it selected 120 // make it selected
diff --git a/noncore/apps/checkbook/mainwindow.cpp b/noncore/apps/checkbook/mainwindow.cpp
index d0fac3b..254ce6a 100644
--- a/noncore/apps/checkbook/mainwindow.cpp
+++ b/noncore/apps/checkbook/mainwindow.cpp
@@ -127,97 +127,97 @@ MainWindow::MainWindow( QWidget* parent, const char* name, WFlags /*fl*/ )
127 this->show(); 127 this->show();
128 this->showMaximized(); 128 this->showMaximized();
129 QListViewItem *itm=cbList->firstChild(); 129 QListViewItem *itm=cbList->firstChild();
130 while( itm ) { 130 while( itm ) {
131 if( itm->text(posName)==_cfg.getLastBook() ) { 131 if( itm->text(posName)==_cfg.getLastBook() ) {
132 openBook( itm ); 132 openBook( itm );
133 break; 133 break;
134 } 134 }
135 itm=itm->nextSibling(); 135 itm=itm->nextSibling();
136 } 136 }
137 } 137 }
138} 138}
139 139
140 140
141// --- ~MainWindow ------------------------------------------------------------ 141// --- ~MainWindow ------------------------------------------------------------
142MainWindow::~MainWindow() 142MainWindow::~MainWindow()
143{ 143{
144 writeConfig(); 144 writeConfig();
145} 145}
146 146
147 147
148// --- buildList -------------------------------------------------------------- 148// --- buildList --------------------------------------------------------------
149void MainWindow::buildList() 149void MainWindow::buildList()
150{ 150{
151 if ( cbList ) 151 if ( cbList )
152 delete cbList; 152 delete cbList;
153 153
154 cbList = new QListView( this ); 154 cbList = new QListView( this );
155 QWhatsThis::add( cbList, tr( "This is a listing of all checkbooks currently available." ) ); 155 QWhatsThis::add( cbList, tr( "This is a listing of all checkbooks currently available." ) );
156 156
157 if ( _cfg.getShowLocks() ) 157 if ( _cfg.getShowLocks() )
158 { 158 {
159 cbList->addColumn( Resource::loadIconSet( "locked" ), "", 24 ); 159 cbList->addColumn( Resource::loadIconSet( "locked" ), "", 24 );
160 posName = 1; 160 posName = 1;
161 } 161 }
162 else 162 else
163 { 163 {
164 posName = 0; 164 posName = 0;
165 } 165 }
166 cbList->addColumn( tr( "Checkbook Name" ) ); 166 cbList->addColumn( tr( "Checkbook Name" ) );
167 if ( _cfg.getShowBalances() ) 167 if ( _cfg.getShowBalances() )
168 { 168 {
169 int colnum = cbList->addColumn( tr( "Balance" ) ); 169 int colnum = cbList->addColumn( tr( "Balance" ) );
170 cbList->setColumnAlignment( colnum, Qt::AlignRight ); 170 cbList->setColumnAlignment( colnum, Qt::AlignRight );
171 } 171 }
172 cbList->setAllColumnsShowFocus( TRUE ); 172 cbList->setAllColumnsShowFocus( TRUE );
173 cbList->setSorting( posName ); 173 cbList->setSorting( posName );
174 QPEApplication::setStylusOperation( cbList->viewport(), QPEApplication::RightOnHold ); 174 QPEApplication::setStylusOperation( cbList->viewport(), QPEApplication::RightOnHold );
175 connect( cbList, SIGNAL( rightButtonPressed( QListViewItem *, const QPoint &, int ) ), 175 connect( cbList, SIGNAL( rightButtonPressed(QListViewItem*,const QPoint&,int) ),
176 this, SLOT( slotEdit() ) ); 176 this, SLOT( slotEdit() ) );
177 setCentralWidget( cbList ); 177 setCentralWidget( cbList );
178 178
179 for ( CBInfo *cb = checkbooks->first(); cb; cb = checkbooks->next() ) 179 for ( CBInfo *cb = checkbooks->first(); cb; cb = checkbooks->next() )
180 { 180 {
181 addCheckbook( cb ); 181 addCheckbook( cb );
182 } 182 }
183} 183}
184 184
185void MainWindow::addCheckbook( CBInfo *cb ) 185void MainWindow::addCheckbook( CBInfo *cb )
186{ 186{
187 QListViewItem *lvi = new QListViewItem( cbList ); 187 QListViewItem *lvi = new QListViewItem( cbList );
188 if ( _cfg.getShowLocks() && !cb->password().isNull() ) 188 if ( _cfg.getShowLocks() && !cb->password().isNull() )
189 { 189 {
190 lvi->setPixmap( 0, lockIcon ); 190 lvi->setPixmap( 0, lockIcon );
191 } 191 }
192 lvi->setText( posName, cb->name() ); 192 lvi->setText( posName, cb->name() );
193 if ( _cfg.getShowBalances() ) 193 if ( _cfg.getShowBalances() )
194 { 194 {
195 QString balance; 195 QString balance;
196 balance.sprintf( "%s%.2f", _cfg.getCurrencySymbol().latin1(), cb->balance() ); 196 balance.sprintf( "%s%.2f", _cfg.getCurrencySymbol().latin1(), cb->balance() );
197 lvi->setText( posName + 1, balance ); 197 lvi->setText( posName + 1, balance );
198 } 198 }
199} 199}
200 200
201void MainWindow::buildFilename( const QString &name ) 201void MainWindow::buildFilename( const QString &name )
202{ 202{
203 tempFilename = cbDir; 203 tempFilename = cbDir;
204 tempFilename.append( name ); 204 tempFilename.append( name );
205 tempFilename.append( ".qcb" ); 205 tempFilename.append( ".qcb" );
206} 206}
207 207
208void MainWindow::slotNew() 208void MainWindow::slotNew()
209{ 209{
210 CBInfo *cb = new CBInfo(); 210 CBInfo *cb = new CBInfo();
211 211
212 Checkbook *currcb = new Checkbook( this, cb, &_cfg ); 212 Checkbook *currcb = new Checkbook( this, cb, &_cfg );
213 if ( QPEApplication::execDialog( currcb ) == QDialog::Accepted ) 213 if ( QPEApplication::execDialog( currcb ) == QDialog::Accepted )
214 { 214 {
215 // Save new checkbook 215 // Save new checkbook
216 buildFilename( cb->name() ); 216 buildFilename( cb->name() );
217 _cfg.setLastBook( cb->name() ); 217 _cfg.setLastBook( cb->name() );
218 cb->setFilename( tempFilename ); 218 cb->setFilename( tempFilename );
219 cb->write(); 219 cb->write();
220 220
221 // Add to listbox 221 // Add to listbox
222 checkbooks->inSort( cb ); 222 checkbooks->inSort( cb );
223 addCheckbook( cb ); 223 addCheckbook( cb );
diff --git a/noncore/apps/checkbook/password.cpp b/noncore/apps/checkbook/password.cpp
index f381271..89a6bc6 100644
--- a/noncore/apps/checkbook/password.cpp
+++ b/noncore/apps/checkbook/password.cpp
@@ -30,68 +30,68 @@
30 30
31#include <qlabel.h> 31#include <qlabel.h>
32#include <qlayout.h> 32#include <qlayout.h>
33#include <qlineedit.h> 33#include <qlineedit.h>
34#include <qpushbutton.h> 34#include <qpushbutton.h>
35 35
36static const char* const showhideimage_data[] = { 36static const char* const showhideimage_data[] = {
37"16 16 2 1", 37"16 16 2 1",
38". c None", 38". c None",
39"# c #000000", 39"# c #000000",
40"................", 40"................",
41"...#...###...##.", 41"...#...###...##.",
42"..#.#..#..#.##..", 42"..#.#..#..#.##..",
43"..###..###.##...", 43"..###..###.##...",
44".#...#.#..##....", 44".#...#.#..##....",
45".#...#.#.##.....", 45".#...#.#.##.....",
46"........##.#..#.", 46"........##.#..#.",
47"..##...##...##..", 47"..##...##...##..",
48".#..#.###...##..", 48".#..#.###...##..",
49".#...##..#.#..#.", 49".#...##..#.#..#.",
50".#..##..........", 50".#..##..........",
51".#.##.#..#.#..#.", 51".#.##.#..#.#..#.",
52"..##...##...##..", 52"..##...##...##..",
53".##....##...##..", 53".##....##...##..",
54".#....#..#.#..#.", 54".#....#..#.#..#.",
55"................"}; 55"................"};
56 56
57Password::Password( QWidget *parent, const char *caption, const char *prompt ) 57Password::Password( QWidget *parent, const char *caption, const char *prompt )
58 : QDialog( parent, 0x0, TRUE, 0x0 ) 58 : QDialog( parent, 0x0, TRUE, 0x0 )
59{ 59{
60 setCaption( caption ); 60 setCaption( caption );
61 61
62 QGridLayout *layout = new QGridLayout( this ); 62 QGridLayout *layout = new QGridLayout( this );
63 layout->setSpacing( 2 ); 63 layout->setSpacing( 2 );
64 layout->setMargin( 4 ); 64 layout->setMargin( 4 );
65 65
66 QLabel *label = new QLabel( prompt, this ); 66 QLabel *label = new QLabel( prompt, this );
67 label->setAlignment( AlignLeft | AlignTop | WordBreak ); 67 label->setAlignment( AlignLeft | AlignTop | WordBreak );
68 layout->addMultiCellWidget( label, 0, 0, 0, 1 ); 68 layout->addMultiCellWidget( label, 0, 0, 0, 1 );
69 69
70 pw = new QLineEdit( this ); 70 pw = new QLineEdit( this );
71 pw->setEchoMode( QLineEdit::Password ); 71 pw->setEchoMode( QLineEdit::Password );
72 layout->addWidget( pw, 1, 0 ); 72 layout->addWidget( pw, 1, 0 );
73 73
74 QPixmap *pic = new QPixmap( ( const char** ) showhideimage_data ); 74 QPixmap *pic = new QPixmap( ( const char** ) showhideimage_data );
75 QPushButton *btn = new QPushButton( ( QIconSet ) *pic, QString::null, this ); 75 QPushButton *btn = new QPushButton( ( QIconSet ) *pic, QString::null, this );
76 btn->setMaximumSize( pic->width() + 10, pic->height() + 10 ); 76 btn->setMaximumSize( pic->width() + 10, pic->height() + 10 );
77 btn->setToggleButton( TRUE ); 77 btn->setToggleButton( TRUE );
78 connect( btn, SIGNAL( toggled( bool ) ), this, SLOT( slotTogglePassword( bool ) ) ); 78 connect( btn, SIGNAL( toggled(bool) ), this, SLOT( slotTogglePassword(bool) ) );
79 layout->addWidget( btn, 1, 1 ); 79 layout->addWidget( btn, 1, 1 );
80 80
81 password == ""; 81 password == "";
82} 82}
83 83
84Password::~Password() 84Password::~Password()
85{ 85{
86} 86}
87 87
88void Password::accept() 88void Password::accept()
89{ 89{
90 password = pw->text(); 90 password = pw->text();
91 QDialog::accept(); 91 QDialog::accept();
92} 92}
93 93
94void Password::slotTogglePassword( bool showPW ) 94void Password::slotTogglePassword( bool showPW )
95{ 95{
96 showPW ? pw->setEchoMode( QLineEdit::Normal ) : pw->setEchoMode( QLineEdit::Password ); 96 showPW ? pw->setEchoMode( QLineEdit::Normal ) : pw->setEchoMode( QLineEdit::Password );
97} 97}
diff --git a/noncore/apps/checkbook/transaction.cpp b/noncore/apps/checkbook/transaction.cpp
index a72a48b..1b08b24 100644
--- a/noncore/apps/checkbook/transaction.cpp
+++ b/noncore/apps/checkbook/transaction.cpp
@@ -54,171 +54,171 @@ Transaction::Transaction( QWidget *parent, bool bNew, const QString &acctname,
54 tran = info; 54 tran = info;
55 _pCfg=pCfg; 55 _pCfg=pCfg;
56 56
57 QVBoxLayout *vb = new QVBoxLayout( this ); 57 QVBoxLayout *vb = new QVBoxLayout( this );
58 58
59 QScrollView *sv = new QScrollView( this ); 59 QScrollView *sv = new QScrollView( this );
60 vb->addWidget( sv, 0, 0 ); 60 vb->addWidget( sv, 0, 0 );
61 sv->setResizePolicy( QScrollView::AutoOneFit ); 61 sv->setResizePolicy( QScrollView::AutoOneFit );
62 sv->setFrameStyle( QFrame::NoFrame ); 62 sv->setFrameStyle( QFrame::NoFrame );
63 63
64 QWidget *container = new QWidget( sv->viewport() ); 64 QWidget *container = new QWidget( sv->viewport() );
65 sv->addChild( container ); 65 sv->addChild( container );
66 66
67 QGridLayout *layout = new QGridLayout( container ); 67 QGridLayout *layout = new QGridLayout( container );
68 layout->setSpacing( 2 ); 68 layout->setSpacing( 2 );
69 layout->setMargin( 4 ); 69 layout->setMargin( 4 );
70 70
71 // Withdrawal/Deposit 71 // Withdrawal/Deposit
72 QButtonGroup *btngrp = new QButtonGroup( container ); 72 QButtonGroup *btngrp = new QButtonGroup( container );
73 btngrp->setColumnLayout(0, Qt::Vertical ); 73 btngrp->setColumnLayout(0, Qt::Vertical );
74 btngrp->layout()->setSpacing( 0 ); 74 btngrp->layout()->setSpacing( 0 );
75 btngrp->layout()->setMargin( 0 ); 75 btngrp->layout()->setMargin( 0 );
76 btngrp->setMaximumWidth( 220 ); 76 btngrp->setMaximumWidth( 220 );
77 QGridLayout *layout2 = new QGridLayout( btngrp->layout() ); 77 QGridLayout *layout2 = new QGridLayout( btngrp->layout() );
78 layout2->setSpacing( 2 ); 78 layout2->setSpacing( 2 );
79 layout2->setMargin( 2 ); 79 layout2->setMargin( 2 );
80 withBtn = new QRadioButton( tr( "Withdrawal" ), btngrp ); 80 withBtn = new QRadioButton( tr( "Withdrawal" ), btngrp );
81 QWhatsThis::add( withBtn, tr( "Select whether the transaction is a withdrawal or deposit here." ) ); 81 QWhatsThis::add( withBtn, tr( "Select whether the transaction is a withdrawal or deposit here." ) );
82 layout2->addWidget( withBtn, 0, 0 ); 82 layout2->addWidget( withBtn, 0, 0 );
83 connect( withBtn, SIGNAL( clicked() ), this, SLOT( slotWithdrawalClicked() ) ); 83 connect( withBtn, SIGNAL( clicked() ), this, SLOT( slotWithdrawalClicked() ) );
84 depBtn = new QRadioButton( tr( "Deposit" ), btngrp ); 84 depBtn = new QRadioButton( tr( "Deposit" ), btngrp );
85 QWhatsThis::add( depBtn, tr( "Select whether the transaction is a withdrawal or deposit here." ) ); 85 QWhatsThis::add( depBtn, tr( "Select whether the transaction is a withdrawal or deposit here." ) );
86 layout2->addWidget( depBtn, 0, 1 ); 86 layout2->addWidget( depBtn, 0, 1 );
87 btngrp->setMaximumSize( 320, withBtn->height() ); 87 btngrp->setMaximumSize( 320, withBtn->height() );
88 connect( depBtn, SIGNAL( clicked() ), this, SLOT( slotDepositClicked() ) ); 88 connect( depBtn, SIGNAL( clicked() ), this, SLOT( slotDepositClicked() ) );
89 layout->addMultiCellWidget( btngrp, 0, 0, 0, 3 ); 89 layout->addMultiCellWidget( btngrp, 0, 0, 0, 3 );
90 90
91 // Date 91 // Date
92 QLabel *label = new QLabel( tr( "Date:" ), container ); 92 QLabel *label = new QLabel( tr( "Date:" ), container );
93 QWhatsThis::add( label, tr( "Select date of transaction here." ) ); 93 QWhatsThis::add( label, tr( "Select date of transaction here." ) );
94 layout->addWidget( label, 1, 0 ); 94 layout->addWidget( label, 1, 0 );
95 dateBtn = new QPushButton( TimeString::shortDate( QDate::currentDate() ), 95 dateBtn = new QPushButton( TimeString::shortDate( QDate::currentDate() ),
96 container ); 96 container );
97 QWhatsThis::add( dateBtn, tr( "Select date of transaction here." ) ); 97 QWhatsThis::add( dateBtn, tr( "Select date of transaction here." ) );
98 QPopupMenu *m1 = new QPopupMenu( container ); 98 QPopupMenu *m1 = new QPopupMenu( container );
99 datePicker = new DateBookMonth( m1, 0, TRUE ); 99 datePicker = new DateBookMonth( m1, 0, TRUE );
100 m1->insertItem( datePicker ); 100 m1->insertItem( datePicker );
101 dateBtn->setPopup( m1 ); 101 dateBtn->setPopup( m1 );
102 connect( datePicker, SIGNAL( dateClicked( int, int, int ) ), 102 connect( datePicker, SIGNAL( dateClicked(int,int,int) ),
103 this, SLOT( slotDateChanged( int, int, int ) ) ); 103 this, SLOT( slotDateChanged(int,int,int) ) );
104 layout->addWidget( dateBtn, 1, 1 ); 104 layout->addWidget( dateBtn, 1, 1 );
105 105
106 // Check number 106 // Check number
107 label = new QLabel( tr( "Number:" ), container ); 107 label = new QLabel( tr( "Number:" ), container );
108 QWhatsThis::add( label, tr( "Enter check number here." ) ); 108 QWhatsThis::add( label, tr( "Enter check number here." ) );
109 layout->addWidget( label, 1, 2 ); 109 layout->addWidget( label, 1, 2 );
110 numEdit = new QLineEdit( container ); 110 numEdit = new QLineEdit( container );
111 QWhatsThis::add( numEdit, tr( "Enter check number here." ) ); 111 QWhatsThis::add( numEdit, tr( "Enter check number here." ) );
112 numEdit->setMaximumWidth( 40 ); 112 numEdit->setMaximumWidth( 40 );
113 layout->addWidget( numEdit, 1, 3 ); 113 layout->addWidget( numEdit, 1, 3 );
114 114
115 // Description 115 // Description
116 label = new QLabel( tr( "Description:" ), container ); 116 label = new QLabel( tr( "Description:" ), container );
117 QWhatsThis::add( label, tr( "Enter description of transaction here." ) ); 117 QWhatsThis::add( label, tr( "Enter description of transaction here." ) );
118 layout->addWidget( label, 2, 0 ); 118 layout->addWidget( label, 2, 0 );
119 _cbDesc=new QComboBox( true, container ); 119 _cbDesc=new QComboBox( true, container );
120 _cbDesc->insertStringList( _pCfg->getPayees() ); 120 _cbDesc->insertStringList( _pCfg->getPayees() );
121 QWhatsThis::add( _cbDesc, tr( "Enter description of transaction here." ) ); 121 QWhatsThis::add( _cbDesc, tr( "Enter description of transaction here." ) );
122 layout->addMultiCellWidget( _cbDesc, 2, 2, 1, 3 ); 122 layout->addMultiCellWidget( _cbDesc, 2, 2, 1, 3 );
123 connect( _cbDesc, SIGNAL( activated(const QString &) ), this, SLOT( slotActivated(const QString &) ) ); 123 connect( _cbDesc, SIGNAL( activated(const QString&) ), this, SLOT( slotActivated(const QString&) ) );
124 124
125 125
126 // Category 126 // Category
127 label = new QLabel( tr( "Category:" ), container ); 127 label = new QLabel( tr( "Category:" ), container );
128 QWhatsThis::add( label, tr( "Select transaction category here." ) ); 128 QWhatsThis::add( label, tr( "Select transaction category here." ) );
129 layout->addWidget( label, 3, 0 ); 129 layout->addWidget( label, 3, 0 );
130 catList = new QComboBox( container ); 130 catList = new QComboBox( container );
131 QWhatsThis::add( catList, tr( "Select transaction category here." ) ); 131 QWhatsThis::add( catList, tr( "Select transaction category here." ) );
132 layout->addMultiCellWidget( catList, 3, 3, 1, 3 ); 132 layout->addMultiCellWidget( catList, 3, 3, 1, 3 );
133 133
134 // Type 134 // Type
135 label = new QLabel( tr( "Type:" ), container ); 135 label = new QLabel( tr( "Type:" ), container );
136 QWhatsThis::add( label, tr( "Select transaction type here.\n\nThe options available vary based on whether the transaction is a deposit or withdrawal." ) ); 136 QWhatsThis::add( label, tr( "Select transaction type here.\n\nThe options available vary based on whether the transaction is a deposit or withdrawal." ) );
137 layout->addWidget( label, 4, 0 ); 137 layout->addWidget( label, 4, 0 );
138 typeList = new QComboBox( container ); 138 typeList = new QComboBox( container );
139 QWhatsThis::add( typeList, tr( "Select transaction type here.\n\nThe options available vary based on whether the transaction is a deposit or withdrawal." ) ); 139 QWhatsThis::add( typeList, tr( "Select transaction type here.\n\nThe options available vary based on whether the transaction is a deposit or withdrawal." ) );
140 layout->addMultiCellWidget( typeList, 4, 4, 1, 3 ); 140 layout->addMultiCellWidget( typeList, 4, 4, 1, 3 );
141 141
142 142
143 // Amount 143 // Amount
144 label = new QLabel( tr( "Amount:" ), container ); 144 label = new QLabel( tr( "Amount:" ), container );
145 QWhatsThis::add( label, tr( "Enter the amount of transaction here.\n\nThe value entered should always be positive." ) ); 145 QWhatsThis::add( label, tr( "Enter the amount of transaction here.\n\nThe value entered should always be positive." ) );
146 layout->addWidget( label, 5, 0 ); 146 layout->addWidget( label, 5, 0 );
147 amtEdit = new QLineEdit( container ); 147 amtEdit = new QLineEdit( container );
148 QWhatsThis::add( amtEdit, tr( "Enter the amount of transaction here.\n\nThe value entered should always be positive." ) ); 148 QWhatsThis::add( amtEdit, tr( "Enter the amount of transaction here.\n\nThe value entered should always be positive." ) );
149 layout->addMultiCellWidget( amtEdit, 5, 5, 1, 3 ); 149 layout->addMultiCellWidget( amtEdit, 5, 5, 1, 3 );
150 150
151 // Fee 151 // Fee
152 label = new QLabel( tr( "Fee:" ), container ); 152 label = new QLabel( tr( "Fee:" ), container );
153 QWhatsThis::add( label, tr( "Enter any fee amount assoiciated with this transaction.\n\nThe value entered should always be positive." ) ); 153 QWhatsThis::add( label, tr( "Enter any fee amount assoiciated with this transaction.\n\nThe value entered should always be positive." ) );
154 layout->addWidget( label, 6, 0 ); 154 layout->addWidget( label, 6, 0 );
155 feeEdit = new QLineEdit( container ); 155 feeEdit = new QLineEdit( container );
156 QWhatsThis::add( feeEdit, tr( "Enter any fee amount assoiciated with this transaction.\n\nThe value entered should always be positive." ) ); 156 QWhatsThis::add( feeEdit, tr( "Enter any fee amount assoiciated with this transaction.\n\nThe value entered should always be positive." ) );
157 layout->addMultiCellWidget( feeEdit, 6, 6, 1, 3 ); 157 layout->addMultiCellWidget( feeEdit, 6, 6, 1, 3 );
158 158
159 // Notes 159 // Notes
160 label = new QLabel( tr( "Notes:" ), container ); 160 label = new QLabel( tr( "Notes:" ), container );
161 QWhatsThis::add( label, tr( "Enter any additional information for this transaction here." ) ); 161 QWhatsThis::add( label, tr( "Enter any additional information for this transaction here." ) );
162 layout->addWidget( label, 7, 0 ); 162 layout->addWidget( label, 7, 0 );
163 noteEdit = new QMultiLineEdit( container ); 163 noteEdit = new QMultiLineEdit( container );
164 QWhatsThis::add( noteEdit, tr( "Enter any additional information for this transaction here." ) ); 164 QWhatsThis::add( noteEdit, tr( "Enter any additional information for this transaction here." ) );
165 layout->addMultiCellWidget( noteEdit, 8, 8, 0, 3 ); 165 layout->addMultiCellWidget( noteEdit, 8, 8, 0, 3 );
166 166
167 // init date 167 // init date
168 initFromInfo( info ); 168 initFromInfo( info );
169 169
170 // not new handlers 170 // not new handlers
171 connect( withBtn, SIGNAL( toggled(bool) ), this, SLOT( slotNotNew() ) ); 171 connect( withBtn, SIGNAL( toggled(bool) ), this, SLOT( slotNotNew() ) );
172 connect( depBtn, SIGNAL( toggled(bool) ), this, SLOT( slotNotNew() ) ); 172 connect( depBtn, SIGNAL( toggled(bool) ), this, SLOT( slotNotNew() ) );
173 connect( catList, SIGNAL(activated(const QString &)), this, SLOT( slotNotNew() ) ); 173 connect( catList, SIGNAL(activated(const QString&)), this, SLOT( slotNotNew() ) );
174 connect( typeList, SIGNAL(activated(const QString &)), this, SLOT( slotNotNew() ) ); 174 connect( typeList, SIGNAL(activated(const QString&)), this, SLOT( slotNotNew() ) );
175 connect( amtEdit, SIGNAL(textChanged(const QString &)), this, SLOT( slotNotNew() ) ); 175 connect( amtEdit, SIGNAL(textChanged(const QString&)), this, SLOT( slotNotNew() ) );
176 connect( feeEdit, SIGNAL(textChanged(const QString &)), this, SLOT( slotNotNew() ) ); 176 connect( feeEdit, SIGNAL(textChanged(const QString&)), this, SLOT( slotNotNew() ) );
177 connect( noteEdit, SIGNAL(textChanged()), this, SLOT( slotNotNew() ) ); 177 connect( noteEdit, SIGNAL(textChanged()), this, SLOT( slotNotNew() ) );
178} 178}
179 179
180// --- initFromInfo ----------------------------------------------------------- 180// --- initFromInfo -----------------------------------------------------------
181void Transaction::initFromInfo(TranInfo *info, bool bPopulateOld) 181void Transaction::initFromInfo(TranInfo *info, bool bPopulateOld)
182{ 182{
183 // Populate current values if provided 183 // Populate current values if provided
184 if ( info ) 184 if ( info )
185 { 185 {
186 if ( info->withdrawal() ) 186 if ( info->withdrawal() )
187 { 187 {
188 withBtn->setChecked( TRUE ); 188 withBtn->setChecked( TRUE );
189 slotWithdrawalClicked(); 189 slotWithdrawalClicked();
190 } 190 }
191 else 191 else
192 { 192 {
193 depBtn->setChecked( TRUE ); 193 depBtn->setChecked( TRUE );
194 slotDepositClicked(); 194 slotDepositClicked();
195 } 195 }
196 196
197 if( !bPopulateOld ) { 197 if( !bPopulateOld ) {
198 QDate dt = info->date(); 198 QDate dt = info->date();
199 slotDateChanged( dt.year(), dt.month(), dt.day() ); 199 slotDateChanged( dt.year(), dt.month(), dt.day() );
200 datePicker->setDate( dt ); 200 datePicker->setDate( dt );
201 numEdit->setText( info->number() ); 201 numEdit->setText( info->number() );
202 } 202 }
203 QString temptext = info->category(); 203 QString temptext = info->category();
204 204
205 // set description field 205 // set description field
206 int i; 206 int i;
207 for(i=_cbDesc->count()-1; i>=0; i--) { 207 for(i=_cbDesc->count()-1; i>=0; i--) {
208 if( _cbDesc->text(i)==info->desc() ) { 208 if( _cbDesc->text(i)==info->desc() ) {
209 _cbDesc->setCurrentItem(i); 209 _cbDesc->setCurrentItem(i);
210 break; 210 break;
211 } 211 }
212 } 212 }
213 if( i<=0 ) 213 if( i<=0 )
214 _cbDesc->setEditText( info->desc() ); 214 _cbDesc->setEditText( info->desc() );
215 215
216 i = catList->count(); 216 i = catList->count();
217 while ( i > 0 ) 217 while ( i > 0 )
218 { 218 {
219 i--; 219 i--;
220 catList->setCurrentItem( i ); 220 catList->setCurrentItem( i );
221 if ( catList->currentText() == temptext ) 221 if ( catList->currentText() == temptext )
222 { 222 {
223 break; 223 break;
224 } 224 }
diff --git a/noncore/apps/confedit/mainwindow.cpp b/noncore/apps/confedit/mainwindow.cpp
index 5f7ad50..6ef1043 100644
--- a/noncore/apps/confedit/mainwindow.cpp
+++ b/noncore/apps/confedit/mainwindow.cpp
@@ -3,98 +3,98 @@
3 * This program is free software; you can redistribute it and/or modify * 3 * This program is free software; you can redistribute it and/or modify *
4 * it under the terms of the GNU General Public License as published by * 4 * it under the terms of the GNU General Public License as published by *
5 * the Free Software Foundation; either version 2 of the License, or * 5 * the Free Software Foundation; either version 2 of the License, or *
6 * (at your option) any later version. * 6 * (at your option) any later version. *
7 * * 7 * *
8 ***************************************************************************/ 8 ***************************************************************************/
9 9
10// (c) 2002 Patrick S. Vogt <tille@handhelds.org> 10// (c) 2002 Patrick S. Vogt <tille@handhelds.org>
11 11
12 12
13#include "mainwindow.h" 13#include "mainwindow.h"
14 14
15#include <qlabel.h> 15#include <qlabel.h>
16#include <qlayout.h> 16#include <qlayout.h>
17#include <qlineedit.h> 17#include <qlineedit.h>
18 18
19#include "listviewconfdir.h" 19#include "listviewconfdir.h"
20#include "listviewitemconfigentry.h" 20#include "listviewitemconfigentry.h"
21 21
22 22
23MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : 23MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) :
24 QMainWindow( parent, name, f ), _currentItem(0), _fileItem(0) 24 QMainWindow( parent, name, f ), _currentItem(0), _fileItem(0)
25{ 25{
26 setCaption( tr("Conf File Editor") ); 26 setCaption( tr("Conf File Editor") );
27 27
28 //setBaseSize( qApp->globalStrut() ); 28 //setBaseSize( qApp->globalStrut() );
29 setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) ); 29 setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) );
30 30
31 mainLayout = new QVBoxLayout( this ); 31 mainLayout = new QVBoxLayout( this );
32 mainLayout->setSpacing( 0 ); 32 mainLayout->setSpacing( 0 );
33 mainLayout->setMargin( 0 ); 33 mainLayout->setMargin( 0 );
34 34
35 35
36 qDebug("creating settingList"); 36 qDebug("creating settingList");
37 settingList = new ListViewConfDir( QDir::homeDirPath() + "/Settings", this, "settingslist"); 37 settingList = new ListViewConfDir( QDir::homeDirPath() + "/Settings", this, "settingslist");
38 settingList->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) ); 38 settingList->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) );
39 mainLayout->addWidget( settingList, 0); 39 mainLayout->addWidget( settingList, 0);
40 40
41 qDebug("creating editor"); 41 qDebug("creating editor");
42 editor = new EditWidget(this); 42 editor = new EditWidget(this);
43 editor->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum));//, sizePolicy().hasHeightForWidth() ) ); 43 editor->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum));//, sizePolicy().hasHeightForWidth() ) );
44 mainLayout->addWidget( editor, 1 ); 44 mainLayout->addWidget( editor, 1 );
45 editor->layoutType( ListViewItemConf::File ); 45 editor->layoutType( ListViewItemConf::File );
46 46
47 makeMenu(); 47 makeMenu();
48 48
49 connect(settingList, SIGNAL( pressed(QListViewItem*) ), 49 connect(settingList, SIGNAL( pressed(QListViewItem*) ),
50 this, SLOT(setCurrent(QListViewItem*))); 50 this, SLOT(setCurrent(QListViewItem*)));
51 connect( settingList, SIGNAL( clicked( QListViewItem* ) ), 51 connect( settingList, SIGNAL( clicked(QListViewItem*) ),
52 this, SLOT( stopTimer( QListViewItem* ) ) ); 52 this, SLOT( stopTimer(QListViewItem*) ) );
53 53
54 connect( editor->LineEditGroup, SIGNAL( textChanged(const QString&) ), 54 connect( editor->LineEditGroup, SIGNAL( textChanged(const QString&) ),
55 SLOT( groupChanged(const QString&) ) ); 55 SLOT( groupChanged(const QString&) ) );
56 connect( editor->LineEditKey, SIGNAL( textChanged(const QString&) ), 56 connect( editor->LineEditKey, SIGNAL( textChanged(const QString&) ),
57 SLOT( keyChanged(const QString&) ) ); 57 SLOT( keyChanged(const QString&) ) );
58 connect( editor->LineEditValue, SIGNAL( textChanged(const QString&) ), 58 connect( editor->LineEditValue, SIGNAL( textChanged(const QString&) ),
59 SLOT( valueChanged(const QString&) ) ); 59 SLOT( valueChanged(const QString&) ) );
60 60
61 setCurrent(0); 61 setCurrent(0);
62 editor->layoutType(EditWidget::File); 62 editor->layoutType(EditWidget::File);
63} 63}
64 64
65void MainWindow::makeMenu() 65void MainWindow::makeMenu()
66{ 66{
67 popupTimer = new QTimer(this); 67 popupTimer = new QTimer(this);
68 popupMenuFile = new QPopupMenu(this); 68 popupMenuFile = new QPopupMenu(this);
69 popupMenuEntry = new QPopupMenu(this); 69 popupMenuEntry = new QPopupMenu(this);
70 70
71 popupActionSave = new QAction( tr("Save"),QString::null, 0, this, 0 ); 71 popupActionSave = new QAction( tr("Save"),QString::null, 0, this, 0 );
72 popupActionSave->addTo( popupMenuFile ); 72 popupActionSave->addTo( popupMenuFile );
73 // popupActionSave->addTo( popupMenuEntry ); 73 // popupActionSave->addTo( popupMenuEntry );
74 connect( popupActionSave, SIGNAL( activated() ), 74 connect( popupActionSave, SIGNAL( activated() ),
75 this , SLOT( saveConfFile() ) ); 75 this , SLOT( saveConfFile() ) );
76 76
77 popupActionRevert = new QAction( tr("Revert"),QString::null, 0, this, 0 ); 77 popupActionRevert = new QAction( tr("Revert"),QString::null, 0, this, 0 );
78 popupActionRevert->addTo( popupMenuFile ); 78 popupActionRevert->addTo( popupMenuFile );
79 popupActionRevert->addTo( popupMenuEntry ); 79 popupActionRevert->addTo( popupMenuEntry );
80 connect( popupActionRevert, SIGNAL( activated() ), 80 connect( popupActionRevert, SIGNAL( activated() ),
81 this , SLOT( revertConfFile() ) ); 81 this , SLOT( revertConfFile() ) );
82 82
83 popupActionDelete = new QAction( tr("Delete"),QString::null, 0, this, 0 ); 83 popupActionDelete = new QAction( tr("Delete"),QString::null, 0, this, 0 );
84 popupActionDelete->addTo( popupMenuFile ); 84 popupActionDelete->addTo( popupMenuFile );
85 popupActionDelete->addTo( popupMenuEntry ); 85 popupActionDelete->addTo( popupMenuEntry );
86 connect( popupActionDelete, SIGNAL( activated() ), 86 connect( popupActionDelete, SIGNAL( activated() ),
87 this , SLOT( removeConfFile() ) ); 87 this , SLOT( removeConfFile() ) );
88 88
89 connect( popupTimer, SIGNAL(timeout()), 89 connect( popupTimer, SIGNAL(timeout()),
90 this, SLOT(showPopup()) ); 90 this, SLOT(showPopup()) );
91} 91}
92 92
93MainWindow::~MainWindow() 93MainWindow::~MainWindow()
94{ 94{
95} 95}
96 96
97 97
98 98
99void MainWindow::setCurrent(QListViewItem *item) 99void MainWindow::setCurrent(QListViewItem *item)
100{ 100{
diff --git a/noncore/apps/odict/odict.cpp b/noncore/apps/odict/odict.cpp
index d5c6d75..4c99964 100644
--- a/noncore/apps/odict/odict.cpp
+++ b/noncore/apps/odict/odict.cpp
@@ -161,55 +161,55 @@ void ODict::slotStartQuery()
161 } 161 }
162} 162}
163 163
164void ODict::slotSettings() 164void ODict::slotSettings()
165{ 165{
166 ConfigDlg dlg( this, "Config" , true); 166 ConfigDlg dlg( this, "Config" , true);
167 if ( dlg.exec() == QDialog::Accepted ) 167 if ( dlg.exec() == QDialog::Accepted )
168 saveConfig(); 168 saveConfig();
169} 169}
170 170
171void ODict::slotSetParameter( int count ) 171void ODict::slotSetParameter( int count )
172{ 172{
173 if ( count == 0 ) 173 if ( count == 0 )
174 { 174 {
175 if ( casesens ) 175 if ( casesens )
176 casesens = false; 176 casesens = false;
177 else 177 else
178 casesens = true; 178 casesens = true;
179 } 179 }
180 180
181 saveConfig(); 181 saveConfig();
182} 182}
183 183
184void ODict::slotMethodChanged( const QString& methodnumber ) 184void ODict::slotMethodChanged( const QString& methodnumber )
185{ 185{
186 activated_name = methodnumber; 186 activated_name = methodnumber;
187 187
188 if ( activated_name != ding->loadedDict() ) 188 if ( activated_name != ding->loadedDict() )
189 { 189 {
190 ding->loadDict(activated_name); 190 ding->loadDict(activated_name);
191 191
192 lookupLanguageNames( activated_name ); 192 lookupLanguageNames( activated_name );
193 top_name->setText( top_name_content ); 193 top_name->setText( top_name_content );
194 bottom_name->setText( bottom_name_content ); 194 bottom_name->setText( bottom_name_content );
195 } 195 }
196} 196}
197 197
198void ODict::setupMenus() 198void ODict::setupMenus()
199{ 199{
200 menu = new QMenuBar( this ); 200 menu = new QMenuBar( this );
201 201
202 settings = new QPopupMenu( menu ); 202 settings = new QPopupMenu( menu );
203 setting_a = new QAction(tr( "Configuration" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); 203 setting_a = new QAction(tr( "Configuration" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 );
204 connect( setting_a, SIGNAL( activated() ), this, SLOT( slotSettings() ) ); 204 connect( setting_a, SIGNAL( activated() ), this, SLOT( slotSettings() ) );
205 setting_a->addTo( settings ); 205 setting_a->addTo( settings );
206 setting_b = new QAction(tr( "Searchmethods" ), Resource::loadPixmap( "edit" ), QString::null, 0, this, 0 ); 206 setting_b = new QAction(tr( "Searchmethods" ), Resource::loadPixmap( "edit" ), QString::null, 0, this, 0 );
207 207
208 parameter = new QPopupMenu( menu ); 208 parameter = new QPopupMenu( menu );
209 connect( parameter, SIGNAL( activated( int ) ), this, SLOT( slotSetParameter( int ) ) ); 209 connect( parameter, SIGNAL( activated(int) ), this, SLOT( slotSetParameter(int) ) );
210 parameter->insertItem( tr( "C&ase sensitive" ), 0 ,0 ); 210 parameter->insertItem( tr( "C&ase sensitive" ), 0 ,0 );
211 parameter->insertSeparator(); 211 parameter->insertSeparator();
212 212
213 menu->insertItem( tr( "Settings" ) , settings ); 213 menu->insertItem( tr( "Settings" ) , settings );
214 menu->insertItem( tr( "Parameter" ) , parameter ); 214 menu->insertItem( tr( "Parameter" ) , parameter );
215} 215}
diff --git a/noncore/apps/opie-bartender/bartender.cpp b/noncore/apps/opie-bartender/bartender.cpp
index 3c010e9..b6401ed 100644
--- a/noncore/apps/opie-bartender/bartender.cpp
+++ b/noncore/apps/opie-bartender/bartender.cpp
@@ -57,99 +57,99 @@ Bartender::Bartender( QWidget* parent, const char* name, WFlags fl )
57 layout->addMultiCellWidget( ToolBar1, 0, 0, 0, 4 ); 57 layout->addMultiCellWidget( ToolBar1, 0, 0, 0, 4 );
58 58
59 QMenuBar *menuBar = new QMenuBar( ToolBar1 ); 59 QMenuBar *menuBar = new QMenuBar( ToolBar1 );
60 QPopupMenu *fileMenu; 60 QPopupMenu *fileMenu;
61 fileMenu = new QPopupMenu( this); 61 fileMenu = new QPopupMenu( this);
62 menuBar->insertItem( tr("File"), fileMenu ); 62 menuBar->insertItem( tr("File"), fileMenu );
63 63
64 fileMenu->insertItem(tr("New Drink")); 64 fileMenu->insertItem(tr("New Drink"));
65 fileMenu->insertItem(tr("Open Drink")); 65 fileMenu->insertItem(tr("Open Drink"));
66 fileMenu->insertItem(tr("Find by Drink Name")); 66 fileMenu->insertItem(tr("Find by Drink Name"));
67 fileMenu->insertItem(tr("Find by Alcohol")); 67 fileMenu->insertItem(tr("Find by Alcohol"));
68 68
69 QPopupMenu *editMenu; 69 QPopupMenu *editMenu;
70 editMenu = new QPopupMenu( this); 70 editMenu = new QPopupMenu( this);
71 menuBar->insertItem( tr("Edit"), editMenu ); 71 menuBar->insertItem( tr("Edit"), editMenu );
72 editMenu->insertItem(tr("edit")); 72 editMenu->insertItem(tr("edit"));
73 73
74 connect( fileMenu, SIGNAL( activated(int) ), this, SLOT( fileMenuActivated(int) )); 74 connect( fileMenu, SIGNAL( activated(int) ), this, SLOT( fileMenuActivated(int) ));
75 connect( editMenu, SIGNAL( activated(int) ), this, SLOT( editMenuActivated(int) )); 75 connect( editMenu, SIGNAL( activated(int) ), this, SLOT( editMenuActivated(int) ));
76 76
77 77
78 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), "New", 0, this, 0 ); 78 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), "New", 0, this, 0 );
79 connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) ); 79 connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) );
80 a->addTo( ToolBar1 ); 80 a->addTo( ToolBar1 );
81 81
82 a = new QAction( tr( "Open" ), Resource::loadPixmap( "bartender/bartender_sm" ), "open", 0, this, 0 ); 82 a = new QAction( tr( "Open" ), Resource::loadPixmap( "bartender/bartender_sm" ), "open", 0, this, 0 );
83 connect( a, SIGNAL( activated() ), this, SLOT( openCurrentDrink() ) ); 83 connect( a, SIGNAL( activated() ), this, SLOT( openCurrentDrink() ) );
84 a->addTo( ToolBar1 ); 84 a->addTo( ToolBar1 );
85 85
86 a = new QAction( tr( "Find" ), Resource::loadPixmap( "find" ), "Find", 0, this, 0 ); 86 a = new QAction( tr( "Find" ), Resource::loadPixmap( "find" ), "Find", 0, this, 0 );
87 connect( a, SIGNAL( activated() ), this, SLOT( askSearch() ) ); 87 connect( a, SIGNAL( activated() ), this, SLOT( askSearch() ) );
88 a->addTo( ToolBar1 ); 88 a->addTo( ToolBar1 );
89 89
90 a = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ),"Edit", 0, this, 0 ); 90 a = new QAction( tr( "Edit" ), Resource::loadPixmap( "edit" ),"Edit", 0, this, 0 );
91 connect( a, SIGNAL( activated() ), this, SLOT( doEdit() ) ); 91 connect( a, SIGNAL( activated() ), this, SLOT( doEdit() ) );
92 a->addTo( ToolBar1 ); 92 a->addTo( ToolBar1 );
93 93
94 QPushButton *t; 94 QPushButton *t;
95 t= new QPushButton( "BAC", ToolBar1, "bacButtin"); 95 t= new QPushButton( "BAC", ToolBar1, "bacButtin");
96 connect( t, SIGNAL( clicked() ), this, SLOT( doBac() ) ); 96 connect( t, SIGNAL( clicked() ), this, SLOT( doBac() ) );
97 97
98 DrinkView = new QListView( this, "DrinkView" ); 98 DrinkView = new QListView( this, "DrinkView" );
99 DrinkView->addColumn( tr( "Name of Drink" ) ); 99 DrinkView->addColumn( tr( "Name of Drink" ) );
100// DrinkView->setRootIsDecorated( TRUE ); 100// DrinkView->setRootIsDecorated( TRUE );
101 DrinkView->header()->hide(); 101 DrinkView->header()->hide();
102 102
103 QPEApplication::setStylusOperation( DrinkView->viewport(),QPEApplication::RightOnHold); 103 QPEApplication::setStylusOperation( DrinkView->viewport(),QPEApplication::RightOnHold);
104 104
105 connect(DrinkView, SIGNAL( doubleClicked(QListViewItem*)),this,SLOT(showDrink( QListViewItem*))); 105 connect(DrinkView, SIGNAL( doubleClicked(QListViewItem*)),this,SLOT(showDrink(QListViewItem*)));
106 connect(DrinkView, SIGNAL( mouseButtonPressed( int, QListViewItem *, const QPoint&, int)), 106 connect(DrinkView, SIGNAL( mouseButtonPressed(int,QListViewItem*,const QPoint&,int)),
107 this,SLOT( showDrink(int, QListViewItem *, const QPoint&, int))); 107 this,SLOT( showDrink(int,QListViewItem*,const QPoint&,int)));
108 108
109 layout->addMultiCellWidget( DrinkView, 1, 2, 0, 4 ); 109 layout->addMultiCellWidget( DrinkView, 1, 2, 0, 4 );
110 if(QDir("db").exists()) { 110 if(QDir("db").exists()) {
111 dbFile.setName( "db/drinkdb.txt"); 111 dbFile.setName( "db/drinkdb.txt");
112 } else 112 } else
113 dbFile.setName( QPEApplication::qpeDir()+"/etc/bartender/drinkdb.txt"); 113 dbFile.setName( QPEApplication::qpeDir()+"/etc/bartender/drinkdb.txt");
114 initDrinkDb(); 114 initDrinkDb();
115} 115}
116 116
117Bartender::~Bartender() { 117Bartender::~Bartender() {
118} 118}
119 119
120/* 120/*
121this happens right before exit */ 121this happens right before exit */
122void Bartender::cleanUp() { 122void Bartender::cleanUp() {
123 dbFile.close(); 123 dbFile.close();
124 124
125} 125}
126 126
127void Bartender::initDrinkDb() { 127void Bartender::initDrinkDb() {
128 128
129 if(!dbFile.isOpen()) 129 if(!dbFile.isOpen())
130 if ( !dbFile.open( IO_ReadOnly)) { 130 if ( !dbFile.open( IO_ReadOnly)) {
131 QMessageBox::message( (tr("Note")), (tr("Drink database not opened sucessfully.\n")) ); 131 QMessageBox::message( (tr("Note")), (tr("Drink database not opened sucessfully.\n")) );
132 return; 132 return;
133 } 133 }
134 fillList(); 134 fillList();
135} 135}
136 136
137void Bartender::fillList() { 137void Bartender::fillList() {
138 dbFile.at(1); 138 dbFile.at(1);
139 DrinkView->clear(); 139 DrinkView->clear();
140 int i=0; 140 int i=0;
141 QListViewItem * item ; 141 QListViewItem * item ;
142 QTextStream t( &dbFile); 142 QTextStream t( &dbFile);
143 QString s; 143 QString s;
144 while ( !t.eof()) { 144 while ( !t.eof()) {
145 s = t.readLine(); 145 s = t.readLine();
146 if(s.find("#",0,TRUE) != -1) { 146 if(s.find("#",0,TRUE) != -1) {
147// qDebug(s.right(s.length()-2)); 147// qDebug(s.right(s.length()-2));
148 item= new QListViewItem( DrinkView, 0 ); 148 item= new QListViewItem( DrinkView, 0 );
149 item->setText( 0, s.right(s.length()-2)); 149 item->setText( 0, s.right(s.length()-2));
150 i++; 150 i++;
151 } 151 }
152 } 152 }
153 qDebug("there are currently %d of drinks", i); 153 qDebug("there are currently %d of drinks", i);
154} 154}
155 155
diff --git a/noncore/apps/opie-bartender/searchresults.cpp b/noncore/apps/opie-bartender/searchresults.cpp
index 4900d1f..a511a57 100644
--- a/noncore/apps/opie-bartender/searchresults.cpp
+++ b/noncore/apps/opie-bartender/searchresults.cpp
@@ -1,43 +1,43 @@
1/**************************************************************************** 1/****************************************************************************
2** Created: Sat Jul 20 08:23:27 2002 2** Created: Sat Jul 20 08:23:27 2002
3** by: L.J. Potter <ljp@llornkcor.com> 3** by: L.J. Potter <ljp@llornkcor.com>
4** copyright : (C) 2002 by ljp 4** copyright : (C) 2002 by ljp
5 email : ljp@llornkcor.com 5 email : ljp@llornkcor.com
6 * This program is free software; you can redistribute it and/or modify * 6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by * 7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or * 8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. * 9 * (at your option) any later version. *
10 ***************************************************************************/ 10 ***************************************************************************/
11#include "searchresults.h" 11#include "searchresults.h"
12 12
13 13
14#include <qlistbox.h> 14#include <qlistbox.h>
15#include <qlayout.h> 15#include <qlayout.h>
16 16
17Search_Results::Search_Results( QWidget* parent, const char* name, bool modal, WFlags fl ) 17Search_Results::Search_Results( QWidget* parent, const char* name, bool modal, WFlags fl )
18 : QDialog( parent, name, modal, fl ) { 18 : QDialog( parent, name, modal, fl ) {
19 if ( !name ) 19 if ( !name )
20 setName( drinkName); 20 setName( drinkName);
21 21
22 drinkName = name; 22 drinkName = name;
23 setCaption( drinkName ); 23 setCaption( drinkName );
24 24
25 Layout5 = new QGridLayout( this ); 25 Layout5 = new QGridLayout( this );
26 Layout5->setSpacing( 6 ); 26 Layout5->setSpacing( 6 );
27 Layout5->setMargin( 4 ); 27 Layout5->setMargin( 4 );
28 28
29 ListBox1 = new QListBox( this, "ListBox1" ); 29 ListBox1 = new QListBox( this, "ListBox1" );
30 30
31 Layout5->addMultiCellWidget( ListBox1, 0, 1, 0, 3 ); 31 Layout5->addMultiCellWidget( ListBox1, 0, 1, 0, 3 );
32 connect( ListBox1, SIGNAL( clicked( QListBoxItem *)), SLOT( listSelected( QListBoxItem *)) ); 32 connect( ListBox1, SIGNAL( clicked(QListBoxItem*)), SLOT( listSelected(QListBoxItem*)) );
33} 33}
34 34
35Search_Results::~Search_Results() { 35Search_Results::~Search_Results() {
36} 36}
37 37
38 38
39void Search_Results::listSelected(QListBoxItem *) { 39void Search_Results::listSelected(QListBoxItem *) {
40 40
41 QDialog::accept(); 41 QDialog::accept();
42} 42}
43 43
diff --git a/noncore/apps/opie-console/btconfigwidget.cpp b/noncore/apps/opie-console/btconfigwidget.cpp
index 64046d8..0ac337f 100644
--- a/noncore/apps/opie-console/btconfigwidget.cpp
+++ b/noncore/apps/opie-console/btconfigwidget.cpp
@@ -1,91 +1,91 @@
1#include <qlabel.h> 1#include <qlabel.h>
2#include <qlayout.h> 2#include <qlayout.h>
3#include <qlineedit.h> 3#include <qlineedit.h>
4#include <qcombobox.h> 4#include <qcombobox.h>
5#include <qhbox.h> 5#include <qhbox.h>
6#include <qradiobutton.h> 6#include <qradiobutton.h>
7 7
8#include "iolayerbase.h" 8#include "iolayerbase.h"
9#include "btconfigwidget.h" 9#include "btconfigwidget.h"
10 10
11namespace { 11namespace {
12 void setCurrent( const QString& str, QComboBox* bo ) { 12 void setCurrent( const QString& str, QComboBox* bo ) {
13 uint b = bo->count(); 13 uint b = bo->count();
14 for (int i = 0; i < bo->count(); i++ ) { 14 for (int i = 0; i < bo->count(); i++ ) {
15 if ( bo->text(i) == str ) { 15 if ( bo->text(i) == str ) {
16 bo->setCurrentItem( i ); 16 bo->setCurrentItem( i );
17 return; 17 return;
18 } 18 }
19 } 19 }
20 bo->insertItem( str ); 20 bo->insertItem( str );
21 bo->setCurrentItem( b ); 21 bo->setCurrentItem( b );
22 } 22 }
23} 23}
24 24
25BTConfigWidget::BTConfigWidget( const QString& name, 25BTConfigWidget::BTConfigWidget( const QString& name,
26 QWidget* parent, 26 QWidget* parent,
27 const char* na ) 27 const char* na )
28 : ProfileDialogConnectionWidget( name, parent, na ) { 28 : ProfileDialogConnectionWidget( name, parent, na ) {
29 29
30 m_lay = new QVBoxLayout( this ); 30 m_lay = new QVBoxLayout( this );
31 31
32 m_device = new QLabel( tr( "Device" ), this ); 32 m_device = new QLabel( tr( "Device" ), this );
33 QHBox *deviceBox = new QHBox( this ); 33 QHBox *deviceBox = new QHBox( this );
34 m_devRadio = new QRadioButton( deviceBox ); 34 m_devRadio = new QRadioButton( deviceBox );
35 connect( m_devRadio, SIGNAL( toggled( bool ) ), this, SLOT( slotDevRadio( bool ) ) ); 35 connect( m_devRadio, SIGNAL( toggled(bool) ), this, SLOT( slotDevRadio(bool) ) );
36 m_deviceCmb = new QComboBox( deviceBox ); 36 m_deviceCmb = new QComboBox( deviceBox );
37 m_deviceCmb->setEditable( TRUE ); 37 m_deviceCmb->setEditable( TRUE );
38 38
39 QLabel *macLabel = new QLabel( this ); 39 QLabel *macLabel = new QLabel( this );
40 macLabel->setText( tr( "Or peer mac address" ) ); 40 macLabel->setText( tr( "Or peer mac address" ) );
41 QHBox *macBox = new QHBox( this ); 41 QHBox *macBox = new QHBox( this );
42 m_macRadio = new QRadioButton( macBox ); 42 m_macRadio = new QRadioButton( macBox );
43 connect( m_macRadio, SIGNAL( toggled( bool ) ), this, SLOT( slotMacRadio( bool ) ) ); 43 connect( m_macRadio, SIGNAL( toggled(bool) ), this, SLOT( slotMacRadio(bool) ) );
44 m_mac = new QLineEdit( macBox ); 44 m_mac = new QLineEdit( macBox );
45 45
46 m_base = new IOLayerBase(this, "base"); 46 m_base = new IOLayerBase(this, "base");
47 47
48 m_lay->addWidget( m_device ); 48 m_lay->addWidget( m_device );
49 m_lay->addWidget( deviceBox ); 49 m_lay->addWidget( deviceBox );
50 m_lay->addWidget( macLabel ); 50 m_lay->addWidget( macLabel );
51 m_lay->addWidget( macBox ); 51 m_lay->addWidget( macBox );
52 m_lay->addWidget( m_base ); 52 m_lay->addWidget( m_base );
53 53
54 m_deviceCmb->insertItem( "/dev/ttyU0" ); 54 m_deviceCmb->insertItem( "/dev/ttyU0" );
55 m_deviceCmb->insertItem( "/dev/ttyU1" ); 55 m_deviceCmb->insertItem( "/dev/ttyU1" );
56} 56}
57 57
58BTConfigWidget::~BTConfigWidget() { 58BTConfigWidget::~BTConfigWidget() {
59 59
60} 60}
61void BTConfigWidget::load( const Profile& prof ) { 61void BTConfigWidget::load( const Profile& prof ) {
62 int rad_flow = prof.readNumEntry("Flow"); 62 int rad_flow = prof.readNumEntry("Flow");
63 int rad_parity = prof.readNumEntry("Parity"); 63 int rad_parity = prof.readNumEntry("Parity");
64 int speed = prof.readNumEntry("Speed"); 64 int speed = prof.readNumEntry("Speed");
65 QString mac = prof.readEntry("Mac"); 65 QString mac = prof.readEntry("Mac");
66 66
67 if (!mac.isEmpty() ) { 67 if (!mac.isEmpty() ) {
68 m_mac->setText( mac ); 68 m_mac->setText( mac );
69 } else { 69 } else {
70 m_devRadio->setChecked( true ); 70 m_devRadio->setChecked( true );
71 } 71 }
72 72
73 if (rad_flow == 1) { 73 if (rad_flow == 1) {
74 m_base->setFlow( IOLayerBase::Hardware ); 74 m_base->setFlow( IOLayerBase::Hardware );
75 } else if (rad_flow == 2) { 75 } else if (rad_flow == 2) {
76 m_base->setFlow( IOLayerBase::Software ); 76 m_base->setFlow( IOLayerBase::Software );
77 } else if (rad_flow == 0) { 77 } else if (rad_flow == 0) {
78 m_base->setFlow( IOLayerBase::None ); 78 m_base->setFlow( IOLayerBase::None );
79 } 79 }
80 80
81 if (rad_parity == 1) { 81 if (rad_parity == 1) {
82 m_base->setParity( IOLayerBase::Even ); 82 m_base->setParity( IOLayerBase::Even );
83 } else if ( rad_parity == 2 ) { 83 } else if ( rad_parity == 2 ) {
84 m_base->setParity( IOLayerBase::Odd ); 84 m_base->setParity( IOLayerBase::Odd );
85 } else { 85 } else {
86 m_base->setParity( IOLayerBase::NonePar ); 86 m_base->setParity( IOLayerBase::NonePar );
87 } 87 }
88 88
89 switch( speed ) { 89 switch( speed ) {
90 case 115200: 90 case 115200:
91 m_base->setSpeed(IOLayerBase::Baud_115200 ); 91 m_base->setSpeed(IOLayerBase::Baud_115200 );
diff --git a/noncore/apps/opie-console/dialdialog.cpp b/noncore/apps/opie-console/dialdialog.cpp
index 6bc1240..526d55e 100644
--- a/noncore/apps/opie-console/dialdialog.cpp
+++ b/noncore/apps/opie-console/dialdialog.cpp
@@ -17,82 +17,82 @@ DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags f
17 QVBoxLayout *mainLayout = new QVBoxLayout( this ); 17 QVBoxLayout *mainLayout = new QVBoxLayout( this );
18 18
19 QLabel *textLabel = new QLabel( this ); 19 QLabel *textLabel = new QLabel( this );
20 textLabel->setTextFormat( QLabel::RichText ); 20 textLabel->setTextFormat( QLabel::RichText );
21 textLabel->setText( tr("Enter the number you want to dial. When finished, press ok") ); 21 textLabel->setText( tr("Enter the number you want to dial. When finished, press ok") );
22 22
23 m_dialLine = new QLineEdit( this ); 23 m_dialLine = new QLineEdit( this );
24 m_dialLine->setReadOnly( true ); 24 m_dialLine->setReadOnly( true );
25 m_dialLine->setFrame( false ); 25 m_dialLine->setFrame( false );
26 m_dialLine->setAlignment( Qt::AlignLeft ); 26 m_dialLine->setAlignment( Qt::AlignLeft );
27 QFont dialLine_font( m_dialLine->font() ); 27 QFont dialLine_font( m_dialLine->font() );
28 dialLine_font.setBold( TRUE ); 28 dialLine_font.setBold( TRUE );
29 dialLine_font.setPointSize( 18 ); 29 dialLine_font.setPointSize( 18 );
30 m_dialLine->setFont( dialLine_font ); 30 m_dialLine->setFont( dialLine_font );
31 31
32 QWidget* dialWidget = new QWidget( this ); 32 QWidget* dialWidget = new QWidget( this );
33 QGridLayout *layout = new QGridLayout( dialWidget , 4, 3 ); 33 QGridLayout *layout = new QGridLayout( dialWidget , 4, 3 );
34 34
35 QButtonGroup *dialButtons = new QButtonGroup( ); 35 QButtonGroup *dialButtons = new QButtonGroup( );
36 36
37 QPushButton *number0 = new QPushButton( dialWidget ); 37 QPushButton *number0 = new QPushButton( dialWidget );
38 number0->setText( QString( "0" ) ); 38 number0->setText( QString( "0" ) );
39 QFont number0_font( number0->font() ); 39 QFont number0_font( number0->font() );
40 number0_font.setBold( TRUE ); 40 number0_font.setBold( TRUE );
41 number0->setFont( number0_font ); 41 number0->setFont( number0_font );
42 layout->addWidget( number0, 4, 1 ); 42 layout->addWidget( number0, 4, 1 );
43 dialButtons->insert( number0 ); 43 dialButtons->insert( number0 );
44 44
45 int x = 0, y = 0; 45 int x = 0, y = 0;
46 for ( int i = 0 ; i < 9; i++ ) { 46 for ( int i = 0 ; i < 9; i++ ) {
47 QPushButton *number = new QPushButton( dialWidget ); 47 QPushButton *number = new QPushButton( dialWidget );
48 number->setText( QString( "%1" ).arg( i + 1 ) ); 48 number->setText( QString( "%1" ).arg( i + 1 ) );
49 QFont number_font( number->font() ); 49 QFont number_font( number->font() );
50 number_font.setBold( TRUE ); 50 number_font.setBold( TRUE );
51 number->setFont( number_font ); 51 number->setFont( number_font );
52 52
53 dialButtons->insert( number ); 53 dialButtons->insert( number );
54 54
55 layout->addWidget( number, x, y ); 55 layout->addWidget( number, x, y );
56 56
57 if ( y < 2 ) { 57 if ( y < 2 ) {
58 y++; 58 y++;
59 } else { 59 } else {
60 x++; 60 x++;
61 y = 0; 61 y = 0;
62 } 62 }
63 } 63 }
64 64
65 connect( dialButtons, SIGNAL( clicked( int ) ), this, SLOT( slotEnterNumber( int ) ) ); 65 connect( dialButtons, SIGNAL( clicked(int) ), this, SLOT( slotEnterNumber(int) ) );
66 66
67 mainLayout->addStretch( 2 ); 67 mainLayout->addStretch( 2 );
68 mainLayout->addWidget( textLabel ); 68 mainLayout->addWidget( textLabel );
69 mainLayout->addStretch( 1 ); 69 mainLayout->addStretch( 1 );
70 mainLayout->addWidget( m_dialLine ); 70 mainLayout->addWidget( m_dialLine );
71 mainLayout->addStretch( 2 ); 71 mainLayout->addStretch( 2 );
72 mainLayout->addWidget( dialWidget ); 72 mainLayout->addWidget( dialWidget );
73 mainLayout->addStretch( 4 ); 73 mainLayout->addStretch( 4 );
74} 74}
75 75
76 76
77void DialDialog::slotEnterNumber( int number ) { 77void DialDialog::slotEnterNumber( int number ) {
78 78
79 // pretty stupid, just for testing .-) 79 // pretty stupid, just for testing .-)
80 80
81 m_number.append(QString("%1").arg(number)); 81 m_number.append(QString("%1").arg(number));
82 82
83 setNumber(m_number); 83 setNumber(m_number);
84} 84}
85 85
86DialDialog::~DialDialog() { 86DialDialog::~DialDialog() {
87} 87}
88 88
89QString DialDialog::number() { 89QString DialDialog::number() {
90 return m_number; 90 return m_number;
91 91
92} 92}
93 93
94void DialDialog::setNumber( QString number ) 94void DialDialog::setNumber( QString number )
95{ 95{
96 m_dialLine->setText( QString("%1").arg( number ) ); 96 m_dialLine->setText( QString("%1").arg( number ) );
97} 97}
98 98
diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp
index 2c1d888..99d069f 100644
--- a/noncore/apps/opie-console/emulation_handler.cpp
+++ b/noncore/apps/opie-console/emulation_handler.cpp
@@ -1,71 +1,71 @@
1 1
2#include "TEmuVt102.h" 2#include "TEmuVt102.h"
3 3
4#include "profile.h" 4#include "profile.h"
5#include "emulation_handler.h" 5#include "emulation_handler.h"
6#include "script.h" 6#include "script.h"
7 7
8EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const char* name ) 8EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const char* name )
9 : QObject(0, name ) 9 : QObject(0, name )
10{ 10{
11 m_teWid = new TEWidget( parent, "TerminalMain"); 11 m_teWid = new TEWidget( parent, "TerminalMain");
12 // use setWrapAt(0) for classic behaviour (wrap at screen width, no scrollbar) 12 // use setWrapAt(0) for classic behaviour (wrap at screen width, no scrollbar)
13 // use setWrapAt(80) for normal console with scrollbar 13 // use setWrapAt(80) for normal console with scrollbar
14 setWrap(prof.readNumEntry("Wrap", 0) ? 0 : 80); 14 setWrap(prof.readNumEntry("Wrap", 0) ? 0 : 80);
15 m_teWid->setMinimumSize(150, 70 ); 15 m_teWid->setMinimumSize(150, 70 );
16 m_script = 0; 16 m_script = 0;
17 parent->resize( m_teWid->calcSize(80, 24 ) ); 17 parent->resize( m_teWid->calcSize(80, 24 ) );
18 m_teEmu = new TEmuVt102(m_teWid ); 18 m_teEmu = new TEmuVt102(m_teWid );
19 19
20 connect(m_teEmu,SIGNAL(ImageSizeChanged(int, int) ), 20 connect(m_teEmu,SIGNAL(ImageSizeChanged(int,int) ),
21 this, SIGNAL(changeSize(int, int) ) ); 21 this, SIGNAL(changeSize(int,int) ) );
22 connect(m_teEmu, SIGNAL(sndBlock(const char*, int) ), 22 connect(m_teEmu, SIGNAL(sndBlock(const char*,int) ),
23 this, SLOT(recvEmulation(const char*, int) ) ); 23 this, SLOT(recvEmulation(const char*,int) ) );
24 m_teEmu->setConnect( true ); 24 m_teEmu->setConnect( true );
25 m_teEmu->setHistory( TRUE ); 25 m_teEmu->setHistory( TRUE );
26 load( prof ); 26 load( prof );
27 27
28 28
29 29
30} 30}
31TEmulation* EmulationHandler::emulation() { 31TEmulation* EmulationHandler::emulation() {
32 return m_teEmu; 32 return m_teEmu;
33} 33}
34EmulationHandler::~EmulationHandler() { 34EmulationHandler::~EmulationHandler() {
35 if (isRecording()) 35 if (isRecording())
36 clearScript(); 36 clearScript();
37 delete m_teEmu; 37 delete m_teEmu;
38 delete m_teWid; 38 delete m_teWid;
39} 39}
40 40
41void EmulationHandler::load( const Profile& prof) { 41void EmulationHandler::load( const Profile& prof) {
42 m_teWid->setVTFont( font( prof.readNumEntry("Font") ) ); 42 m_teWid->setVTFont( font( prof.readNumEntry("Font") ) );
43 int num = prof.readNumEntry("Color"); 43 int num = prof.readNumEntry("Color");
44 setColor( foreColor(num), backColor(num) ); 44 setColor( foreColor(num), backColor(num) );
45 m_teWid->setBackgroundColor(backColor(num) ); 45 m_teWid->setBackgroundColor(backColor(num) );
46 46
47 int term = prof.readNumEntry("Terminal", 0) ; 47 int term = prof.readNumEntry("Terminal", 0) ;
48 switch(term) { 48 switch(term) {
49 default: 49 default:
50 case Profile::VT102: 50 case Profile::VT102:
51 case Profile::VT100: 51 case Profile::VT100:
52 m_teEmu->setKeytrans("vt100.keytab"); 52 m_teEmu->setKeytrans("vt100.keytab");
53 break; 53 break;
54 case Profile::Linux: 54 case Profile::Linux:
55 m_teEmu->setKeytrans("linux.keytab"); 55 m_teEmu->setKeytrans("linux.keytab");
56 break; 56 break;
57 case Profile::XTerm: 57 case Profile::XTerm:
58 m_teEmu->setKeytrans("default.Keytab"); 58 m_teEmu->setKeytrans("default.Keytab");
59 break; 59 break;
60 } 60 }
61} 61}
62void EmulationHandler::recv( const QByteArray& ar) { 62void EmulationHandler::recv( const QByteArray& ar) {
63 m_teEmu->onRcvBlock(ar.data(), ar.count() ); 63 m_teEmu->onRcvBlock(ar.data(), ar.count() );
64} 64}
65void EmulationHandler::recvEmulation(const char* src, int len ) { 65void EmulationHandler::recvEmulation(const char* src, int len ) {
66 QByteArray ar(len); 66 QByteArray ar(len);
67 67
68 memcpy(ar.data(), src, sizeof(char) * len ); 68 memcpy(ar.data(), src, sizeof(char) * len );
69 if (isRecording()) 69 if (isRecording())
70 m_script->append(ar); 70 m_script->append(ar);
71 emit send(ar); 71 emit send(ar);
diff --git a/noncore/apps/opie-console/emulation_layer.cpp b/noncore/apps/opie-console/emulation_layer.cpp
index 2bef801..fd30ad7 100644
--- a/noncore/apps/opie-console/emulation_layer.cpp
+++ b/noncore/apps/opie-console/emulation_layer.cpp
@@ -61,108 +61,108 @@
61 refresh. This rule suits both bulk display operation as done by curses as 61 refresh. This rule suits both bulk display operation as done by curses as
62 well as individual characters typed. 62 well as individual characters typed.
63 (BULK_TIMEOUT < 1000 / max characters received from keyboard per second). 63 (BULK_TIMEOUT < 1000 / max characters received from keyboard per second).
64 64
65 Additionally, we trigger refreshing by newlines comming in to make visual 65 Additionally, we trigger refreshing by newlines comming in to make visual
66 snapshots of lists as produced by `cat', `ls' and likely programs, thereby 66 snapshots of lists as produced by `cat', `ls' and likely programs, thereby
67 producing the illusion of a permanent and immediate display operation. 67 producing the illusion of a permanent and immediate display operation.
68 68
69 As a sort of catch-all needed for cases where none of the above 69 As a sort of catch-all needed for cases where none of the above
70 conditions catch, the screen refresh is also triggered by a count 70 conditions catch, the screen refresh is also triggered by a count
71 of incoming bulks (`bulk_incnt'). 71 of incoming bulks (`bulk_incnt').
72*/ 72*/
73 73
74/* FIXME 74/* FIXME
75 - evtl. the bulk operations could be made more transparent. 75 - evtl. the bulk operations could be made more transparent.
76*/ 76*/
77 77
78#include "emulation_layer.h" 78#include "emulation_layer.h"
79#include <stdio.h> 79#include <stdio.h>
80#include <stdlib.h> 80#include <stdlib.h>
81#include <unistd.h> 81#include <unistd.h>
82 82
83 83
84/* ------------------------------------------------------------------------- */ 84/* ------------------------------------------------------------------------- */
85/* */ 85/* */
86/* EmulationLayer */ 86/* EmulationLayer */
87/* */ 87/* */
88/* ------------------------------------------------------------------------- */ 88/* ------------------------------------------------------------------------- */
89 89
90#define CNTL(c) ((c)-'@') 90#define CNTL(c) ((c)-'@')
91 91
92/*! 92/*!
93*/ 93*/
94 94
95EmulationLayer::EmulationLayer( WidgetLayer* gui ) 95EmulationLayer::EmulationLayer( WidgetLayer* gui )
96: decoder((QTextDecoder*)NULL) 96: decoder((QTextDecoder*)NULL)
97{ 97{
98 this->gui = gui; 98 this->gui = gui;
99 99
100 screen[0] = new Screen(gui->lines(),gui->columns()); 100 screen[0] = new Screen(gui->lines(),gui->columns());
101 screen[1] = new Screen(gui->lines(),gui->columns()); 101 screen[1] = new Screen(gui->lines(),gui->columns());
102 scr = screen[0]; 102 scr = screen[0];
103 103
104 bulk_nlcnt = 0; // reset bulk newline counter 104 bulk_nlcnt = 0; // reset bulk newline counter
105 bulk_incnt = 0; // reset bulk counter 105 bulk_incnt = 0; // reset bulk counter
106 connected = FALSE; 106 connected = FALSE;
107 107
108 QObject::connect(&bulk_timer, SIGNAL( timeout() ), this, SLOT( showBulk() ) ); 108 QObject::connect(&bulk_timer, SIGNAL( timeout() ), this, SLOT( showBulk() ) );
109 QObject::connect(gui,SIGNAL( imageSizeChanged( int, int ) ), 109 QObject::connect(gui,SIGNAL( imageSizeChanged(int,int) ),
110 this,SLOT( onImageSizeChange( int, int ) ) ); 110 this,SLOT( onImageSizeChange(int,int) ) );
111 QObject::connect(gui,SIGNAL( changedHistoryCursor( int ) ), 111 QObject::connect(gui,SIGNAL( changedHistoryCursor(int) ),
112 this,SLOT( historyCursorChange( int ) ) ); 112 this,SLOT( historyCursorChange(int) ) );
113 QObject::connect(gui,SIGNAL( keyPressed( QKeyEvent* ) ), 113 QObject::connect(gui,SIGNAL( keyPressed(QKeyEvent*) ),
114 this,SLOT( onKeyPress( QKeyEvent* ) ) ); 114 this,SLOT( onKeyPress(QKeyEvent*) ) );
115 QObject::connect(gui,SIGNAL( selectionBegin( const int, const int) ), 115 QObject::connect(gui,SIGNAL( selectionBegin(const int,const int) ),
116 this,SLOT( onSelectionBegin( const int, const int ) ) ); 116 this,SLOT( onSelectionBegin(const int,const int) ) );
117 QObject::connect(gui,SIGNAL( selectionExtended( const int, const int ) ), 117 QObject::connect(gui,SIGNAL( selectionExtended(const int,const int) ),
118 this,SLOT( onSelectionExtend( const int,const int ) ) ); 118 this,SLOT( onSelectionExtend(const int,const int) ) );
119 QObject::connect(gui,SIGNAL( selectionEnd( const bool ) ), 119 QObject::connect(gui,SIGNAL( selectionEnd(const bool) ),
120 this,SLOT( setSelection( const bool ) ) ); 120 this,SLOT( setSelection(const bool) ) );
121 QObject::connect(gui,SIGNAL( selectionCleared() ), 121 QObject::connect(gui,SIGNAL( selectionCleared() ),
122 this,SLOT( clearSelection() ) ); 122 this,SLOT( clearSelection() ) );
123} 123}
124 124
125/*! 125/*!
126*/ 126*/
127 127
128EmulationLayer::~EmulationLayer() 128EmulationLayer::~EmulationLayer()
129{ 129{
130 delete screen[0]; 130 delete screen[0];
131 delete screen[1]; 131 delete screen[1];
132 bulk_timer.stop(); 132 bulk_timer.stop();
133} 133}
134 134
135/*! change between primary and alternate screen 135/*! change between primary and alternate screen
136*/ 136*/
137 137
138void EmulationLayer::setScreen(int n) 138void EmulationLayer::setScreen(int n)
139{ 139{
140 scr = screen[n&1]; 140 scr = screen[n&1];
141} 141}
142 142
143void EmulationLayer::setHistory(bool on) 143void EmulationLayer::setHistory(bool on)
144{ 144{
145 screen[0]->setScroll(on); 145 screen[0]->setScroll(on);
146 if (!connected) return; 146 if (!connected) return;
147 showBulk(); 147 showBulk();
148} 148}
149 149
150bool EmulationLayer::history() 150bool EmulationLayer::history()
151{ 151{
152 return screen[0]->hasScroll(); 152 return screen[0]->hasScroll();
153} 153}
154 154
155void EmulationLayer::setCodec(int c) 155void EmulationLayer::setCodec(int c)
156{ 156{
157 //FIXME: check whether we have to free codec 157 //FIXME: check whether we have to free codec
158 codec = c ? QTextCodec::codecForName("utf8") 158 codec = c ? QTextCodec::codecForName("utf8")
159 : QTextCodec::codecForLocale(); 159 : QTextCodec::codecForLocale();
160 if (decoder) delete decoder; 160 if (decoder) delete decoder;
161 decoder = codec->makeDecoder(); 161 decoder = codec->makeDecoder();
162} 162}
163 163
164void EmulationLayer::setKeytrans(int no) 164void EmulationLayer::setKeytrans(int no)
165{ 165{
166 keytrans = KeyTrans::find(no); 166 keytrans = KeyTrans::find(no);
167} 167}
168 168
diff --git a/noncore/apps/opie-console/function_keyboard.cpp b/noncore/apps/opie-console/function_keyboard.cpp
index c232d89..eb32551 100644
--- a/noncore/apps/opie-console/function_keyboard.cpp
+++ b/noncore/apps/opie-console/function_keyboard.cpp
@@ -215,135 +215,135 @@ QSize FunctionKeyboard::sizeHint() const {
215 215
216 return QSize(width(), keyHeight * numRows + 1); 216 return QSize(width(), keyHeight * numRows + 1);
217} 217}
218 218
219void FunctionKeyboard::loadDefaults() { 219void FunctionKeyboard::loadDefaults() {
220 220
221 numRows = DEFAULT_ROWS; 221 numRows = DEFAULT_ROWS;
222 numCols = DEFAULT_COLS; 222 numCols = DEFAULT_COLS;
223 keyWidth = (double)width()/numCols; // have to reset this thing too 223 keyWidth = (double)width()/numCols; // have to reset this thing too
224 224
225 keys.insert( "r0c0", FKey ("Enter", "enter", Qt::Key_Enter, 0)); 225 keys.insert( "r0c0", FKey ("Enter", "enter", Qt::Key_Enter, 0));
226 keys.insert( "r0c1", FKey ("Space", "space", Qt::Key_Space, Qt::Key_Space)); 226 keys.insert( "r0c1", FKey ("Space", "space", Qt::Key_Space, Qt::Key_Space));
227 keys.insert( "r0c2", FKey ("Tab", "tab", Qt::Key_Tab, 0)); 227 keys.insert( "r0c2", FKey ("Tab", "tab", Qt::Key_Tab, 0));
228 keys.insert( "r0c3", FKey ("Up", "up", Qt::Key_Up, 0)); 228 keys.insert( "r0c3", FKey ("Up", "up", Qt::Key_Up, 0));
229 keys.insert( "r0c4", FKey ("Down", "down", Qt::Key_Down, 0)); 229 keys.insert( "r0c4", FKey ("Down", "down", Qt::Key_Down, 0));
230 230
231 keys.insert( "r0c7", FKey ("Ho", 0, 4112, 0)); 231 keys.insert( "r0c7", FKey ("Ho", 0, 4112, 0));
232 keys.insert( "r0c8", FKey ("End", 0, 4113, 0)); 232 keys.insert( "r0c8", FKey ("End", 0, 4113, 0));
233 keys.insert( "r0c9", FKey ("Pu", 0, 4118, 0)); 233 keys.insert( "r0c9", FKey ("Pu", 0, 4118, 0));
234 keys.insert( "r0c10", FKey ("Pd", 0, 4119, 0)); 234 keys.insert( "r0c10", FKey ("Pd", 0, 4119, 0));
235 keys.insert( "r0c11", FKey ("Esc", 0, Qt::Key_Escape, 0xfff)); 235 keys.insert( "r0c11", FKey ("Esc", 0, Qt::Key_Escape, 0xfff));
236 236
237 keys.insert( "r1c0", FKey ("F1", 0, 4144, 0)); 237 keys.insert( "r1c0", FKey ("F1", 0, 4144, 0));
238 keys.insert( "r1c1", FKey ("F2", 0, 4145, 0)); 238 keys.insert( "r1c1", FKey ("F2", 0, 4145, 0));
239 keys.insert( "r1c2", FKey ("F3", 0, 4146, 0)); 239 keys.insert( "r1c2", FKey ("F3", 0, 4146, 0));
240 keys.insert( "r1c3", FKey ("F4", 0, 4147, 0)); 240 keys.insert( "r1c3", FKey ("F4", 0, 4147, 0));
241 keys.insert( "r1c4", FKey ("F5", 0, 4148, 0)); 241 keys.insert( "r1c4", FKey ("F5", 0, 4148, 0));
242 keys.insert( "r1c5", FKey ("F6", 0, 4149, 0)); 242 keys.insert( "r1c5", FKey ("F6", 0, 4149, 0));
243 keys.insert( "r1c6", FKey ("F7", 0, 4150, 0)); 243 keys.insert( "r1c6", FKey ("F7", 0, 4150, 0));
244 keys.insert( "r1c7", FKey ("F8", 0, 4151, 0)); 244 keys.insert( "r1c7", FKey ("F8", 0, 4151, 0));
245 keys.insert( "r1c8", FKey ("F9", 0, 4152, 0)); 245 keys.insert( "r1c8", FKey ("F9", 0, 4152, 0));
246 keys.insert( "r1c9", FKey ("F10", 0, 4153, 0)); 246 keys.insert( "r1c9", FKey ("F10", 0, 4153, 0));
247 keys.insert( "r1c10", FKey ("F11", 0, 4154, 0)); 247 keys.insert( "r1c10", FKey ("F11", 0, 4154, 0));
248 keys.insert( "r1c11", FKey ("F12", 0, 4155, 0)); 248 keys.insert( "r1c11", FKey ("F12", 0, 4155, 0));
249 249
250 250
251} 251}
252 252
253/* FunctionKeyboardConfig {{{1 */ 253/* FunctionKeyboardConfig {{{1 */
254 254
255FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent, const char* na ) 255FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent, const char* na )
256 : ProfileDialogKeyWidget(name, parent, na), 256 : ProfileDialogKeyWidget(name, parent, na),
257 selectedRow(0), selectedCol(0) 257 selectedRow(0), selectedCol(0)
258{ 258{
259 qWarning("FunctionKeyboardConfig"); 259 qWarning("FunctionKeyboardConfig");
260 260
261 261
262 kb = new FunctionKeyboard(this); 262 kb = new FunctionKeyboard(this);
263 connect (kb, SIGNAL(keyPressed(FKey, ushort, ushort, bool)), 263 connect (kb, SIGNAL(keyPressed(FKey,ushort,ushort,bool)),
264 this, SLOT(slotKeyPressed(FKey, ushort, ushort, bool))); 264 this, SLOT(slotKeyPressed(FKey,ushort,ushort,bool)));
265 265
266 QGroupBox *dimentions = new QGroupBox(2, Qt::Horizontal, tr("Dimensions"), this); 266 QGroupBox *dimentions = new QGroupBox(2, Qt::Horizontal, tr("Dimensions"), this);
267 QLabel *l = new QLabel("Rows", dimentions); 267 QLabel *l = new QLabel("Rows", dimentions);
268 m_rowBox = new QSpinBox(1, 15, 1, dimentions); 268 m_rowBox = new QSpinBox(1, 15, 1, dimentions);
269 connect (m_rowBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeRows(int))); 269 connect (m_rowBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeRows(int)));
270 l = new QLabel("Columns", dimentions); 270 l = new QLabel("Columns", dimentions);
271 m_colBox = new QSpinBox(1, 15, 1, dimentions); 271 m_colBox = new QSpinBox(1, 15, 1, dimentions);
272 connect (m_colBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeCols(int))); 272 connect (m_colBox, SIGNAL(valueChanged(int)), this, SLOT(slotChangeCols(int)));
273 273
274 QGroupBox *editKey = new QGroupBox(2, Qt::Horizontal, tr("Edit Key"), this); 274 QGroupBox *editKey = new QGroupBox(2, Qt::Horizontal, tr("Edit Key"), this);
275 l = new QLabel("Label", editKey); 275 l = new QLabel("Label", editKey);
276 m_labels = new QComboBox(true, editKey); 276 m_labels = new QComboBox(true, editKey);
277 m_labels->setInsertionPolicy(QComboBox::AtCurrent); 277 m_labels->setInsertionPolicy(QComboBox::AtCurrent);
278 m_labels->insertItem(""); 278 m_labels->insertItem("");
279 279
280 QStringList files = QDir( QPEApplication::qpeDir() + "pics/console/keys/", "*.png").entryList(); 280 QStringList files = QDir( QPEApplication::qpeDir() + "pics/console/keys/", "*.png").entryList();
281 281
282 for (uint i = 0; i < files.count(); i++) { 282 for (uint i = 0; i < files.count(); i++) {
283 283
284 m_labels->insertItem( Resource::loadPixmap("console/keys/" + files[i]), files[i]); 284 m_labels->insertItem( Resource::loadPixmap("console/keys/" + files[i]), files[i]);
285 } 285 }
286 connect (m_labels, SIGNAL(activated(int)), this, SLOT(slotChangeIcon(int))); 286 connect (m_labels, SIGNAL(activated(int)), this, SLOT(slotChangeIcon(int)));
287 connect (m_labels, SIGNAL(textChanged(const QString &)), this, SLOT(slotChangeLabelText(const QString&))); 287 connect (m_labels, SIGNAL(textChanged(const QString&)), this, SLOT(slotChangeLabelText(const QString&)));
288 288
289 l = new QLabel("Q Keycode", editKey); 289 l = new QLabel("Q Keycode", editKey);
290 m_qvalues = new QComboBox(true, editKey); 290 m_qvalues = new QComboBox(true, editKey);
291 m_qvalues->setInsertionPolicy(QComboBox::AtTop); 291 m_qvalues->setInsertionPolicy(QComboBox::AtTop);
292 m_qvalues->setDuplicatesEnabled(false); 292 m_qvalues->setDuplicatesEnabled(false);
293 m_qvalues->insertItem(""); 293 m_qvalues->insertItem("");
294 connect (m_qvalues, SIGNAL(textChanged(const QString &)), this, SLOT(slotChangeQCode(const QString&))); 294 connect (m_qvalues, SIGNAL(textChanged(const QString&)), this, SLOT(slotChangeQCode(const QString&)));
295 295
296 l = new QLabel("Unicode Value", editKey); 296 l = new QLabel("Unicode Value", editKey);
297 m_uniValues = new QComboBox(true, editKey); 297 m_uniValues = new QComboBox(true, editKey);
298 m_uniValues->setInsertionPolicy(QComboBox::AtTop); 298 m_uniValues->setInsertionPolicy(QComboBox::AtTop);
299 m_uniValues->setDuplicatesEnabled(false); 299 m_uniValues->setDuplicatesEnabled(false);
300 m_uniValues->insertItem(""); 300 m_uniValues->insertItem("");
301 connect (m_uniValues, SIGNAL(textChanged(const QString &)), this, SLOT(slotChangeUnicode(const QString&))); 301 connect (m_uniValues, SIGNAL(textChanged(const QString&)), this, SLOT(slotChangeUnicode(const QString&)));
302 302
303 QVBoxLayout *root = new QVBoxLayout(this, 2); 303 QVBoxLayout *root = new QVBoxLayout(this, 2);
304 root->addWidget(kb); 304 root->addWidget(kb);
305 root->addWidget(dimentions); 305 root->addWidget(dimentions);
306 root->addWidget(editKey); 306 root->addWidget(editKey);
307} 307}
308FunctionKeyboardConfig::~FunctionKeyboardConfig() { 308FunctionKeyboardConfig::~FunctionKeyboardConfig() {
309 309
310} 310}
311void FunctionKeyboardConfig::load (const Profile& prof) { 311void FunctionKeyboardConfig::load (const Profile& prof) {
312 312
313 kb->keys.clear(); 313 kb->keys.clear();
314 kb->loadDefaults(); 314 kb->loadDefaults();
315 315
316 m_rowBox->setValue(prof.readNumEntry("keb_rows", 2)); 316 m_rowBox->setValue(prof.readNumEntry("keb_rows", 2));
317 m_colBox->setValue(prof.readNumEntry("keb_cols", 10)); 317 m_colBox->setValue(prof.readNumEntry("keb_cols", 10));
318 318
319 /* load all the keys to the keyboard */ 319 /* load all the keys to the keyboard */
320 for (int i = 0; i <= m_rowBox->value() -1; i++) 320 for (int i = 0; i <= m_rowBox->value() -1; i++)
321 for (int j = 0; j <= m_colBox->value() -1; j++) { 321 for (int j = 0; j <= m_colBox->value() -1; j++) {
322 322
323 QString h = "r" + QString::number(i) + "c" + QString::number(j); 323 QString h = "r" + QString::number(i) + "c" + QString::number(j);
324 QString values = prof.readEntry("keb_" + h); 324 QString values = prof.readEntry("keb_" + h);
325 325
326 if (!values.isEmpty()) { 326 if (!values.isEmpty()) {
327 327
328 QStringList l = QStringList::split(QChar('|'), values, TRUE); 328 QStringList l = QStringList::split(QChar('|'), values, TRUE);
329 kb->keys[h] = FKey(l[0], l[1], l[2].toInt(), l[3].toInt()); 329 kb->keys[h] = FKey(l[0], l[1], l[2].toInt(), l[3].toInt());
330 330
331 // load pixmap if used 331 // load pixmap if used
332 if (!l[1].isEmpty()) { 332 if (!l[1].isEmpty()) {
333 333
334 kb->keys[h].pix = new QPixmap( Resource::loadPixmap( "console/keys/" + l[1] ) ); 334 kb->keys[h].pix = new QPixmap( Resource::loadPixmap( "console/keys/" + l[1] ) );
335 } 335 }
336 } 336 }
337 } 337 }
338 338
339} 339}
340void FunctionKeyboardConfig::save (Profile& prof) { 340void FunctionKeyboardConfig::save (Profile& prof) {
341 341
342 prof.writeEntry("keb_rows", m_rowBox->value()); 342 prof.writeEntry("keb_rows", m_rowBox->value());
343 prof.writeEntry("keb_cols", m_colBox->value()); 343 prof.writeEntry("keb_cols", m_colBox->value());
344 344
345 QMap<QString, FKey>::Iterator it; 345 QMap<QString, FKey>::Iterator it;
346 for ( it = kb->keys.begin(); it != kb->keys.end(); it++) { 346 for ( it = kb->keys.begin(); it != kb->keys.end(); it++) {
347 347
348 FKey k = it.data(); 348 FKey k = it.data();
349 QString entry = k.label + "|" 349 QString entry = k.label + "|"
diff --git a/noncore/apps/opie-console/io_bt.cpp b/noncore/apps/opie-console/io_bt.cpp
index 37bf797..1a8c979 100644
--- a/noncore/apps/opie-console/io_bt.cpp
+++ b/noncore/apps/opie-console/io_bt.cpp
@@ -1,88 +1,88 @@
1 1
2#include "io_bt.h" 2#include "io_bt.h"
3 3
4IOBt::IOBt( const Profile &config ) : IOSerial( config ) { 4IOBt::IOBt( const Profile &config ) : IOSerial( config ) {
5 m_attach = 0; 5 m_attach = 0;
6} 6}
7 7
8 8
9IOBt::~IOBt() { 9IOBt::~IOBt() {
10 if ( m_attach ) { 10 if ( m_attach ) {
11 delete m_attach; 11 delete m_attach;
12 } 12 }
13} 13}
14 14
15 15
16void IOBt::close() { 16void IOBt::close() {
17 17
18 IOSerial::close(); 18 IOSerial::close();
19 // still need error handling 19 // still need error handling
20 if ( m_attach ) { 20 if ( m_attach ) {
21 delete m_attach; 21 delete m_attach;
22 m_attach = 0; 22 m_attach = 0;
23 } 23 }
24} 24}
25 25
26bool IOBt::open() { 26bool IOBt::open() {
27 bool ret = false; 27 bool ret = false;
28 28
29 // only set up bt stuff if mac address was set, otherwise use the device set 29 // only set up bt stuff if mac address was set, otherwise use the device set
30 if ( !m_mac.isEmpty() ) { 30 if ( !m_mac.isEmpty() ) {
31 31
32 // now it should also be checked, if there is a connection to the device with that mac allready 32 // now it should also be checked, if there is a connection to the device with that mac allready
33 // hciattach here 33 // hciattach here
34 m_attach = new OProcess(); 34 m_attach = new OProcess();
35 *m_attach << "hciattach /dev/ttyS2 any 57600"; 35 *m_attach << "hciattach /dev/ttyS2 any 57600";
36 36
37 // then start hcid, then rcfomm handling (m_mac) 37 // then start hcid, then rcfomm handling (m_mac)
38 38
39 connect( m_attach, SIGNAL( processExited( OProcess* ) ), 39 connect( m_attach, SIGNAL( processExited(OProcess*) ),
40 this, SLOT( slotExited( OProcess* ) ) ); 40 this, SLOT( slotExited(OProcess*) ) );
41 41
42 if ( m_attach->start() ) { 42 if ( m_attach->start() ) {
43 ret = IOSerial::open(); 43 ret = IOSerial::open();
44 } else { 44 } else {
45 qWarning("could not attach to device"); 45 qWarning("could not attach to device");
46 delete m_attach; 46 delete m_attach;
47 m_attach = 0; 47 m_attach = 0;
48 } 48 }
49 } else { 49 } else {
50 // directly to the normal serial 50 // directly to the normal serial
51 // TODO: look first if the connection really exists. ( is set up ) 51 // TODO: look first if the connection really exists. ( is set up )
52 52
53 ret =IOSerial::open(); 53 ret =IOSerial::open();
54 } 54 }
55 return ret; 55 return ret;
56} 56}
57 57
58void IOBt::reload( const Profile &config ) { 58void IOBt::reload( const Profile &config ) {
59 m_device = config.readEntry("Device", BT_DEFAULT_DEVICE); 59 m_device = config.readEntry("Device", BT_DEFAULT_DEVICE);
60 m_mac = config.readEntry("Mac", BT_DEFAULT_MAC); 60 m_mac = config.readEntry("Mac", BT_DEFAULT_MAC);
61 m_baud = config.readNumEntry("Baud", BT_DEFAULT_BAUD); 61 m_baud = config.readNumEntry("Baud", BT_DEFAULT_BAUD);
62 m_parity = config.readNumEntry("Parity", BT_DEFAULT_PARITY); 62 m_parity = config.readNumEntry("Parity", BT_DEFAULT_PARITY);
63 m_dbits = config.readNumEntry("DataBits", BT_DEFAULT_DBITS); 63 m_dbits = config.readNumEntry("DataBits", BT_DEFAULT_DBITS);
64 m_sbits = config.readNumEntry("StopBits", BT_DEFAULT_SBITS); 64 m_sbits = config.readNumEntry("StopBits", BT_DEFAULT_SBITS);
65 m_flow = config.readNumEntry("Flow", BT_DEFAULT_FLOW); 65 m_flow = config.readNumEntry("Flow", BT_DEFAULT_FLOW);
66} 66}
67 67
68 68
69QString IOBt::identifier() const { 69QString IOBt::identifier() const {
70 return "bluetooth"; 70 return "bluetooth";
71} 71}
72 72
73QString IOBt::name() const { 73QString IOBt::name() const {
74 return "BLuetooth IO Layer"; 74 return "BLuetooth IO Layer";
75} 75}
76 76
77void IOBt::slotExited( OProcess* proc ){ 77void IOBt::slotExited( OProcess* proc ){
78 close(); 78 close();
79 delete proc; 79 delete proc;
80} 80}
81 81
82QBitArray IOBt::supports() const { 82QBitArray IOBt::supports() const {
83 return QBitArray( 3 ); 83 return QBitArray( 3 );
84} 84}
85 85
86bool IOBt::isConnected() { 86bool IOBt::isConnected() {
87 return false; 87 return false;
88} 88}
diff --git a/noncore/apps/opie-console/io_irda.cpp b/noncore/apps/opie-console/io_irda.cpp
index e360fb4..b281b7d 100644
--- a/noncore/apps/opie-console/io_irda.cpp
+++ b/noncore/apps/opie-console/io_irda.cpp
@@ -1,77 +1,77 @@
1 1
2#include "io_irda.h" 2#include "io_irda.h"
3 3
4IOIrda::IOIrda( const Profile &config ) : IOSerial( config ) { 4IOIrda::IOIrda( const Profile &config ) : IOSerial( config ) {
5 m_attach = 0; 5 m_attach = 0;
6} 6}
7 7
8 8
9IOIrda::~IOIrda() { 9IOIrda::~IOIrda() {
10 if ( m_attach ) { 10 if ( m_attach ) {
11 delete m_attach; 11 delete m_attach;
12 } 12 }
13} 13}
14 14
15 15
16void IOIrda::close() { 16void IOIrda::close() {
17 17
18 IOSerial::close(); 18 IOSerial::close();
19 // still need error handling 19 // still need error handling
20 delete m_attach; 20 delete m_attach;
21} 21}
22 22
23bool IOIrda::open() { 23bool IOIrda::open() {
24 bool ret; 24 bool ret;
25 25
26 // irdaattach here 26 // irdaattach here
27 m_attach = new OProcess(); 27 m_attach = new OProcess();
28 *m_attach << "irattach /dev/ttyS2 -s"; 28 *m_attach << "irattach /dev/ttyS2 -s";
29 29
30 connect( m_attach, SIGNAL( processExited( OProcess* ) ), 30 connect( m_attach, SIGNAL( processExited(OProcess*) ),
31 this, SLOT( slotExited( OProcess* ) ) ); 31 this, SLOT( slotExited(OProcess*) ) );
32 32
33 if ( m_attach->start() ) { 33 if ( m_attach->start() ) {
34 ret= IOSerial::open(); 34 ret= IOSerial::open();
35 } else { 35 } else {
36 // emit error!!! 36 // emit error!!!
37 qWarning("could not attach to device"); 37 qWarning("could not attach to device");
38 delete m_attach; 38 delete m_attach;
39 m_attach = 0l; 39 m_attach = 0l;
40 } 40 }
41 return ret; 41 return ret;
42} 42}
43 43
44void IOIrda::reload( const Profile &config ) { 44void IOIrda::reload( const Profile &config ) {
45 m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE); 45 m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE);
46 m_baud = config.readNumEntry("Baud", IRDA_DEFAULT_BAUD); 46 m_baud = config.readNumEntry("Baud", IRDA_DEFAULT_BAUD);
47 m_parity = config.readNumEntry("Parity", IRDA_DEFAULT_PARITY); 47 m_parity = config.readNumEntry("Parity", IRDA_DEFAULT_PARITY);
48 m_dbits = config.readNumEntry("DataBits", IRDA_DEFAULT_DBITS); 48 m_dbits = config.readNumEntry("DataBits", IRDA_DEFAULT_DBITS);
49 m_sbits = config.readNumEntry("StopBits", IRDA_DEFAULT_SBITS); 49 m_sbits = config.readNumEntry("StopBits", IRDA_DEFAULT_SBITS);
50 m_flow = config.readNumEntry("Flow", IRDA_DEFAULT_FLOW); 50 m_flow = config.readNumEntry("Flow", IRDA_DEFAULT_FLOW);
51} 51}
52 52
53 53
54QString IOIrda::identifier() const { 54QString IOIrda::identifier() const {
55 return "irda"; 55 return "irda";
56} 56}
57 57
58QString IOIrda::name() const { 58QString IOIrda::name() const {
59 return "Irda IO Layer"; 59 return "Irda IO Layer";
60} 60}
61 61
62void IOIrda::slotExited(OProcess* proc ){ 62void IOIrda::slotExited(OProcess* proc ){
63 close(); 63 close();
64 delete proc; 64 delete proc;
65} 65}
66 66
67QBitArray IOIrda::supports()const { 67QBitArray IOIrda::supports()const {
68 return QBitArray( 3 ); 68 return QBitArray( 3 );
69} 69}
70 70
71bool IOIrda::isConnected() { 71bool IOIrda::isConnected() {
72 return false; 72 return false;
73} 73}
74 74
75void IOIrda::send(const QByteArray &data) { 75void IOIrda::send(const QByteArray &data) {
76 qDebug( "Please overload me..." ); 76 qDebug( "Please overload me..." );
77} 77}
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 1d2385f..197f799 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -165,136 +165,136 @@ void MainWindow::initUI() {
165 m_closewindow = new QAction(); 165 m_closewindow = new QAction();
166 m_closewindow->setText( tr("Close Window") ); 166 m_closewindow->setText( tr("Close Window") );
167 m_closewindow->addTo( m_console ); 167 m_closewindow->addTo( m_console );
168 connect( m_closewindow, SIGNAL(activated() ), 168 connect( m_closewindow, SIGNAL(activated() ),
169 this, SLOT(slotClose() ) ); 169 this, SLOT(slotClose() ) );
170 170
171 171
172 /* 172 /*
173 * script actions 173 * script actions
174 */ 174 */
175 m_runScript_id = m_scripts->insertItem(tr("Run Script"), m_scriptsPop, -1, 0); 175 m_runScript_id = m_scripts->insertItem(tr("Run Script"), m_scriptsPop, -1, 0);
176 connect(m_scriptsPop, SIGNAL(activated(int)), this, SLOT(slotRunScript(int))); 176 connect(m_scriptsPop, SIGNAL(activated(int)), this, SLOT(slotRunScript(int)));
177 177
178 m_recordScript = new QAction(tr("Record Script"), QString::null, 0, this, 0); 178 m_recordScript = new QAction(tr("Record Script"), QString::null, 0, this, 0);
179 m_recordScript->addTo(m_scripts); 179 m_recordScript->addTo(m_scripts);
180 connect(m_recordScript, SIGNAL(activated()), this, SLOT(slotRecordScript())); 180 connect(m_recordScript, SIGNAL(activated()), this, SLOT(slotRecordScript()));
181 181
182 m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0); 182 m_saveScript = new QAction(tr("Save Script"), QString::null, 0, this, 0);
183 m_saveScript->addTo(m_scripts); 183 m_saveScript->addTo(m_scripts);
184 connect(m_saveScript, SIGNAL(activated()), this, SLOT(slotSaveScript())); 184 connect(m_saveScript, SIGNAL(activated()), this, SLOT(slotSaveScript()));
185 185
186 186
187 /* 187 /*
188 * action that open/closes the keyboard 188 * action that open/closes the keyboard
189 */ 189 */
190 m_openKeys = new QAction (tr("Open Keyboard..."), 190 m_openKeys = new QAction (tr("Open Keyboard..."),
191 Resource::loadPixmap( "console/keys/keyboard_icon" ), 191 Resource::loadPixmap( "console/keys/keyboard_icon" ),
192 QString::null, 0, this, 0); 192 QString::null, 0, this, 0);
193 m_openKeys->setToggleAction(true); 193 m_openKeys->setToggleAction(true);
194 connect (m_openKeys, SIGNAL(toggled(bool)), this, SLOT(slotOpenKeb(bool))); 194 connect (m_openKeys, SIGNAL(toggled(bool)), this, SLOT(slotOpenKeb(bool)));
195 195
196 /* insert the submenu */ 196 /* insert the submenu */
197 m_console->insertItem(tr("New from Profile"), m_sessionsPop, 197 m_console->insertItem(tr("New from Profile"), m_sessionsPop,
198 -1, 0); 198 -1, 0);
199 199
200 /* insert the connection menu */ 200 /* insert the connection menu */
201 m_bar->insertItem( tr("Connection"), m_console ); 201 m_bar->insertItem( tr("Connection"), m_console );
202 202
203 /* the scripts menu */ 203 /* the scripts menu */
204 m_bar->insertItem( tr("Scripts"), m_scripts ); 204 m_bar->insertItem( tr("Scripts"), m_scripts );
205 205
206 /* and the keyboard */ 206 /* and the keyboard */
207 m_keyBar = new QToolBar(this); 207 m_keyBar = new QToolBar(this);
208 addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE ); 208 addToolBar( m_keyBar, "Keyboard", QMainWindow::Top, TRUE );
209 m_keyBar->setHorizontalStretchable( TRUE ); 209 m_keyBar->setHorizontalStretchable( TRUE );
210 m_keyBar->hide(); 210 m_keyBar->hide();
211 211
212 m_kb = new FunctionKeyboard(m_keyBar); 212 m_kb = new FunctionKeyboard(m_keyBar);
213 connect(m_kb, SIGNAL(keyPressed(FKey, ushort, ushort, bool)), 213 connect(m_kb, SIGNAL(keyPressed(FKey,ushort,ushort,bool)),
214 this, SLOT(slotKeyReceived(FKey, ushort, ushort, bool))); 214 this, SLOT(slotKeyReceived(FKey,ushort,ushort,bool)));
215 215
216 216
217 a = new QAction(tr("Copy"), 217 a = new QAction(tr("Copy"),
218 Resource::loadPixmap("copy"), QString::null, 218 Resource::loadPixmap("copy"), QString::null,
219 0, this, 0 ); 219 0, this, 0 );
220 //a->addTo( m_icons ); 220 //a->addTo( m_icons );
221 connect( a, SIGNAL(activated() ), 221 connect( a, SIGNAL(activated() ),
222 this, SLOT(slotCopy() ) ); 222 this, SLOT(slotCopy() ) );
223 223
224 QAction *paste = new QAction(tr("Paste"), 224 QAction *paste = new QAction(tr("Paste"),
225 Resource::loadPixmap("paste"), QString::null, 225 Resource::loadPixmap("paste"), QString::null,
226 0, this, 0 ); 226 0, this, 0 );
227 connect( paste, SIGNAL(activated() ), 227 connect( paste, SIGNAL(activated() ),
228 this, SLOT(slotPaste() ) ); 228 this, SLOT(slotPaste() ) );
229 229
230 230
231 newCon->addTo( m_icons ); 231 newCon->addTo( m_icons );
232 //m_setProfiles->addTo( m_icons ); 232 //m_setProfiles->addTo( m_icons );
233 paste->addTo( m_icons ); 233 paste->addTo( m_icons );
234 m_openKeys->addTo(m_icons); 234 m_openKeys->addTo(m_icons);
235 m_fullscreen->addTo( m_icons ); 235 m_fullscreen->addTo( m_icons );
236 236
237 m_connect->setEnabled( false ); 237 m_connect->setEnabled( false );
238 m_disconnect->setEnabled( false ); 238 m_disconnect->setEnabled( false );
239 m_terminate->setEnabled( false ); 239 m_terminate->setEnabled( false );
240 m_transfer->setEnabled( false ); 240 m_transfer->setEnabled( false );
241 m_scripts->setItemEnabled(m_runScript_id, false); 241 m_scripts->setItemEnabled(m_runScript_id, false);
242 m_recordScript->setEnabled( false ); 242 m_recordScript->setEnabled( false );
243 m_saveScript->setEnabled( false ); 243 m_saveScript->setEnabled( false );
244 m_fullscreen->setEnabled( false ); 244 m_fullscreen->setEnabled( false );
245 m_closewindow->setEnabled( false ); 245 m_closewindow->setEnabled( false );
246 m_wrap->setEnabled( false ); 246 m_wrap->setEnabled( false );
247 247
248 /* 248 /*
249 * connect to the menu activation 249 * connect to the menu activation
250 */ 250 */
251 connect( m_sessionsPop, SIGNAL(activated( int ) ), 251 connect( m_sessionsPop, SIGNAL(activated(int) ),
252 this, SLOT(slotProfile( int ) ) ); 252 this, SLOT(slotProfile(int) ) );
253 253
254 m_consoleWindow = new TabWidget( this, "blah"); 254 m_consoleWindow = new TabWidget( this, "blah");
255 connect(m_consoleWindow, SIGNAL(activated(Session*) ), 255 connect(m_consoleWindow, SIGNAL(activated(Session*) ),
256 this, SLOT(slotSessionChanged(Session*) ) ); 256 this, SLOT(slotSessionChanged(Session*) ) );
257 setCentralWidget( m_consoleWindow ); 257 setCentralWidget( m_consoleWindow );
258 258
259 slotQuickLaunch(); 259 slotQuickLaunch();
260} 260}
261 261
262ProfileManager* MainWindow::manager() { 262ProfileManager* MainWindow::manager() {
263 return m_manager; 263 return m_manager;
264} 264}
265TabWidget* MainWindow::tabWidget() { 265TabWidget* MainWindow::tabWidget() {
266 return m_consoleWindow; 266 return m_consoleWindow;
267} 267}
268void MainWindow::populateProfiles() { 268void MainWindow::populateProfiles() {
269 m_sessionsPop->clear(); 269 m_sessionsPop->clear();
270 Profile::ValueList list = manager()->all(); 270 Profile::ValueList list = manager()->all();
271 for (Profile::ValueList::Iterator it = list.begin(); it != list.end(); ++it ) { 271 for (Profile::ValueList::Iterator it = list.begin(); it != list.end(); ++it ) {
272 m_sessionsPop->insertItem( (*it).name() ); 272 m_sessionsPop->insertItem( (*it).name() );
273 } 273 }
274 274
275} 275}
276 276
277void MainWindow::populateScripts() { 277void MainWindow::populateScripts() {
278 m_scriptsPop->clear(); 278 m_scriptsPop->clear();
279 m_scriptsData.clear(); 279 m_scriptsData.clear();
280 DocLnkSet files(QPEApplication::documentDir(), "text/plain"); 280 DocLnkSet files(QPEApplication::documentDir(), "text/plain");
281 QListIterator<DocLnk> dit(files.children()); 281 QListIterator<DocLnk> dit(files.children());
282 for (; dit.current(); ++dit) { 282 for (; dit.current(); ++dit) {
283 if (*dit && (*dit)->name().length()>0) { 283 if (*dit && (*dit)->name().length()>0) {
284 QFileInfo info((*dit)->file()); 284 QFileInfo info((*dit)->file());
285 if (info.extension(false) == "script") { 285 if (info.extension(false) == "script") {
286 m_scriptsData.append(new DocLnk(**dit)); 286 m_scriptsData.append(new DocLnk(**dit));
287 m_scriptsPop->insertItem((*dit)->name()); 287 m_scriptsPop->insertItem((*dit)->name());
288 } 288 }
289 } 289 }
290 } 290 }
291 291
292} 292}
293 293
294MainWindow::~MainWindow() { 294MainWindow::~MainWindow() {
295 delete m_factory; 295 delete m_factory;
296 manager()->save(); 296 manager()->save();
297} 297}
298 298
299MetaFactory* MainWindow::factory() { 299MetaFactory* MainWindow::factory() {
300 return m_factory; 300 return m_factory;
diff --git a/noncore/apps/opie-console/profileeditordialog.cpp b/noncore/apps/opie-console/profileeditordialog.cpp
index 979e89d..6e1e23e 100644
--- a/noncore/apps/opie-console/profileeditordialog.cpp
+++ b/noncore/apps/opie-console/profileeditordialog.cpp
@@ -86,100 +86,100 @@ void ProfileEditorDialog::initUI()
86 m_name = new QLineEdit(tabprof); 86 m_name = new QLineEdit(tabprof);
87 QLabel *con = new QLabel(tr("Connection"), tabprof ); 87 QLabel *con = new QLabel(tr("Connection"), tabprof );
88 QLabel *term = new QLabel(tr("Terminal"), tabprof ); 88 QLabel *term = new QLabel(tr("Terminal"), tabprof );
89 m_conCmb = new QComboBox( tabprof ); 89 m_conCmb = new QComboBox( tabprof );
90 m_termCmb = new QComboBox( tabprof ); 90 m_termCmb = new QComboBox( tabprof );
91 m_autoConnect = new QCheckBox(tr("Auto connect after load"), tabprof); 91 m_autoConnect = new QCheckBox(tr("Auto connect after load"), tabprof);
92 92
93 // layouting 93 // layouting
94 QVBoxLayout *vbox3 = new QVBoxLayout(tabprof, 2); 94 QVBoxLayout *vbox3 = new QVBoxLayout(tabprof, 2);
95 vbox3->add(name); 95 vbox3->add(name);
96 vbox3->add(m_name); 96 vbox3->add(m_name);
97 vbox3->add(con ); 97 vbox3->add(con );
98 vbox3->add(m_conCmb ); 98 vbox3->add(m_conCmb );
99 vbox3->add(term ); 99 vbox3->add(term );
100 vbox3->add(m_termCmb ); 100 vbox3->add(m_termCmb );
101 vbox3->add(m_autoConnect); 101 vbox3->add(m_autoConnect);
102 vbox3->addStretch(1); 102 vbox3->addStretch(1);
103 103
104 m_showconntab = 0; 104 m_showconntab = 0;
105 tabWidget->addTab(tabprof, "", QObject::tr("Profile")); 105 tabWidget->addTab(tabprof, "", QObject::tr("Profile"));
106 tabWidget->addTab(m_tabCon, "", QObject::tr("Connection")); 106 tabWidget->addTab(m_tabCon, "", QObject::tr("Connection"));
107 tabWidget->addTab(m_tabTerm, "", QObject::tr("Terminal")); 107 tabWidget->addTab(m_tabTerm, "", QObject::tr("Terminal"));
108 tabWidget->addTab(m_tabKey, "", QObject::tr("Special Keys")); 108 tabWidget->addTab(m_tabKey, "", QObject::tr("Special Keys"));
109 tabWidget->setCurrentTab( tabprof ); 109 tabWidget->setCurrentTab( tabprof );
110 110
111 111
112 // fill the comboboxes 112 // fill the comboboxes
113 QStringList list = m_fact->connectionWidgets(); 113 QStringList list = m_fact->connectionWidgets();
114 QStringList::Iterator it; 114 QStringList::Iterator it;
115 for (it =list.begin(); it != list.end(); ++it ) { 115 for (it =list.begin(); it != list.end(); ++it ) {
116 m_conCmb->insertItem( (*it) ); 116 m_conCmb->insertItem( (*it) );
117 } 117 }
118 list = m_fact->terminalWidgets(); 118 list = m_fact->terminalWidgets();
119 for (it =list.begin(); it != list.end(); ++it ) { 119 for (it =list.begin(); it != list.end(); ++it ) {
120 m_termCmb->insertItem( (*it) ); 120 m_termCmb->insertItem( (*it) );
121 } 121 }
122 122
123 // load profile values 123 // load profile values
124 m_name->setText(m_prof.name()); 124 m_name->setText(m_prof.name());
125 slotKeyActivated( "Default Keyboard" ); 125 slotKeyActivated( "Default Keyboard" );
126 setCurrent( m_fact->external(m_prof.ioLayerName() ), m_conCmb ); 126 setCurrent( m_fact->external(m_prof.ioLayerName() ), m_conCmb );
127 setCurrent( m_fact->external(m_prof.terminalName() ), m_termCmb ); 127 setCurrent( m_fact->external(m_prof.terminalName() ), m_termCmb );
128 slotConActivated( m_fact->external(m_prof.ioLayerName() ) ); 128 slotConActivated( m_fact->external(m_prof.ioLayerName() ) );
129 slotTermActivated( m_fact->external(m_prof.terminalName() ) ); 129 slotTermActivated( m_fact->external(m_prof.terminalName() ) );
130 m_autoConnect->setChecked(m_prof.autoConnect()); 130 m_autoConnect->setChecked(m_prof.autoConnect());
131 131
132 132
133 // signal and slots 133 // signal and slots
134 connect(m_conCmb, SIGNAL(activated(const QString& ) ), 134 connect(m_conCmb, SIGNAL(activated(const QString&) ),
135 this, SLOT(slotConActivated(const QString&) ) ); 135 this, SLOT(slotConActivated(const QString&) ) );
136 connect(m_termCmb, SIGNAL(activated(const QString& ) ), 136 connect(m_termCmb, SIGNAL(activated(const QString&) ),
137 this, SLOT(slotTermActivated(const QString& ) ) ); 137 this, SLOT(slotTermActivated(const QString&) ) );
138 138
139} 139}
140 140
141ProfileEditorDialog::~ProfileEditorDialog() { 141ProfileEditorDialog::~ProfileEditorDialog() {
142 142
143} 143}
144void ProfileEditorDialog::accept() 144void ProfileEditorDialog::accept()
145{ 145{
146 if(profName().isEmpty()) 146 if(profName().isEmpty())
147 { 147 {
148 QMessageBox::information(this, 148 QMessageBox::information(this,
149 QObject::tr("Invalid profile"), 149 QObject::tr("Invalid profile"),
150 QObject::tr("Please enter a profile name.")); 150 QObject::tr("Please enter a profile name."));
151 return; 151 return;
152 } 152 }
153 // Save profile and plugin profile 153 // Save profile and plugin profile
154 //if(plugin_plugin) plugin_plugin->save(); 154 //if(plugin_plugin) plugin_plugin->save();
155 155
156 // Save general values 156 // Save general values
157 m_prof.setName( profName() ); 157 m_prof.setName( profName() );
158 m_prof.setIOLayer( m_fact->internal(m_conCmb ->currentText() ) ); 158 m_prof.setIOLayer( m_fact->internal(m_conCmb ->currentText() ) );
159 m_prof.setTerminalName( m_fact->internal(m_termCmb->currentText() ) ); 159 m_prof.setTerminalName( m_fact->internal(m_termCmb->currentText() ) );
160 m_prof.setAutoConnect( m_autoConnect->isChecked() ); 160 m_prof.setAutoConnect( m_autoConnect->isChecked() );
161 161
162 if (m_con ) 162 if (m_con )
163 m_con->save( m_prof ); 163 m_con->save( m_prof );
164 if (m_term ) 164 if (m_term )
165 m_term->save( m_prof ); 165 m_term->save( m_prof );
166 if (m_key) 166 if (m_key)
167 m_key->save( m_prof ); 167 m_key->save( m_prof );
168 168
169 QDialog::accept(); 169 QDialog::accept();
170} 170}
171 171
172 172
173QString ProfileEditorDialog::profName()const 173QString ProfileEditorDialog::profName()const
174{ 174{
175 return m_name->text(); 175 return m_name->text();
176} 176}
177 177
178QCString ProfileEditorDialog::profType()const 178QCString ProfileEditorDialog::profType()const
179{ 179{
180 /*QStringList w = m_fact->configWidgets(); 180 /*QStringList w = m_fact->configWidgets();
181 for(QStringList::Iterator it = w.begin(); it != w.end(); it++) 181 for(QStringList::Iterator it = w.begin(); it != w.end(); it++)
182 if(device_box->currentText() == m_fact->name((*it))) return (*it); 182 if(device_box->currentText() == m_fact->name((*it))) return (*it);
183 */ 183 */
184 return QCString(); 184 return QCString();
185} 185}
diff --git a/noncore/apps/opie-console/session.cpp b/noncore/apps/opie-console/session.cpp
index 1034ede..b7f14c5 100644
--- a/noncore/apps/opie-console/session.cpp
+++ b/noncore/apps/opie-console/session.cpp
@@ -13,98 +13,98 @@ Session::Session() {
13} 13}
14Session::Session( const QString& na, QWidgetStack* widget, IOLayer* lay) 14Session::Session( const QString& na, QWidgetStack* widget, IOLayer* lay)
15 : m_name( na ), m_widget( widget ), m_layer( lay ) 15 : m_name( na ), m_widget( widget ), m_layer( lay )
16{ 16{
17// m_widLay = 0l; 17// m_widLay = 0l;
18// m_emLay = 0l; 18// m_emLay = 0l;
19 m_emu = 0l; 19 m_emu = 0l;
20} 20}
21Session::~Session() { 21Session::~Session() {
22 delete m_layer; 22 delete m_layer;
23 delete m_emu; 23 delete m_emu;
24 delete m_widget; 24 delete m_widget;
25 /* the widget layer should be deleted by the m_widget */ 25 /* the widget layer should be deleted by the m_widget */
26} 26}
27QString Session::name()const { 27QString Session::name()const {
28 return m_name; 28 return m_name;
29} 29}
30QWidgetStack* Session::widgetStack() { 30QWidgetStack* Session::widgetStack() {
31 return m_widget; 31 return m_widget;
32} 32}
33IOLayer* Session::layer() { 33IOLayer* Session::layer() {
34 return m_layer; 34 return m_layer;
35} 35}
36EmulationHandler* Session::emulationHandler() { 36EmulationHandler* Session::emulationHandler() {
37 return m_emu; 37 return m_emu;
38} 38}
39QWidget* Session::widget() { 39QWidget* Session::widget() {
40 if (!m_emu ) 40 if (!m_emu )
41 return 0l; 41 return 0l;
42 42
43 return m_emu->widget(); 43 return m_emu->widget();
44} 44}
45Profile Session::profile()const { 45Profile Session::profile()const {
46 return m_prof; 46 return m_prof;
47} 47}
48/* 48/*
49WidgetLayer* Session::emulationWidget() { 49WidgetLayer* Session::emulationWidget() {
50 return m_widLay; 50 return m_widLay;
51} 51}
52*/ 52*/
53void Session::connect() { 53void Session::connect() {
54 if ( !m_layer || !m_emu ) 54 if ( !m_layer || !m_emu )
55 return; 55 return;
56 56
57 QObject::connect(m_layer, SIGNAL(received(const QByteArray&) ), 57 QObject::connect(m_layer, SIGNAL(received(const QByteArray&) ),
58 m_emu, SLOT(recv(const QByteArray&) ) ); 58 m_emu, SLOT(recv(const QByteArray&) ) );
59 QObject::connect(m_emu, SIGNAL(send(const QByteArray&) ), 59 QObject::connect(m_emu, SIGNAL(send(const QByteArray&) ),
60 m_layer, SLOT(send(const QByteArray&) ) ); 60 m_layer, SLOT(send(const QByteArray&) ) );
61 QObject::connect(m_emu, SIGNAL(changeSize(int, int) ), 61 QObject::connect(m_emu, SIGNAL(changeSize(int,int) ),
62 m_layer, SLOT(setSize(int, int) ) ); 62 m_layer, SLOT(setSize(int,int) ) );
63} 63}
64 64
65void Session::disconnect() { 65void Session::disconnect() {
66 66
67 if ( !m_layer || !m_emu ) 67 if ( !m_layer || !m_emu )
68 return; 68 return;
69 69
70 QObject::disconnect(m_layer, SIGNAL(received(const QByteArray&) ), 70 QObject::disconnect(m_layer, SIGNAL(received(const QByteArray&) ),
71 m_emu, SLOT(recv(const QByteArray&) ) ); 71 m_emu, SLOT(recv(const QByteArray&) ) );
72 QObject::disconnect(m_emu, SIGNAL(send(const QByteArray&) ), 72 QObject::disconnect(m_emu, SIGNAL(send(const QByteArray&) ),
73 m_layer, SLOT(send(const QByteArray&) ) ); 73 m_layer, SLOT(send(const QByteArray&) ) );
74} 74}
75 75
76void Session::setName( const QString& na){ 76void Session::setName( const QString& na){
77 m_name = na; 77 m_name = na;
78} 78}
79 79
80void Session::setWidgetStack( QWidgetStack* wid ) { 80void Session::setWidgetStack( QWidgetStack* wid ) {
81 delete m_emu; 81 delete m_emu;
82 m_emu = 0l; 82 m_emu = 0l;
83 delete m_widget; 83 delete m_widget;
84 /* the EmulationLayer was destroyed... */ 84 /* the EmulationLayer was destroyed... */
85 85
86 m_widget = wid; 86 m_widget = wid;
87} 87}
88void Session::setIOLayer( IOLayer* lay ) { 88void Session::setIOLayer( IOLayer* lay ) {
89 delete m_layer; 89 delete m_layer;
90 m_layer = lay; 90 m_layer = lay;
91} 91}
92 92
93void Session::setEmulationHandler( EmulationHandler* lay ) { 93void Session::setEmulationHandler( EmulationHandler* lay ) {
94 delete m_emu; 94 delete m_emu;
95 m_emu = lay; 95 m_emu = lay;
96} 96}
97void Session::setProfile( const Profile& prof ) { 97void Session::setProfile( const Profile& prof ) {
98 m_prof = prof; 98 m_prof = prof;
99} 99}
100/* 100/*
101void Session::setEmulationWidget( WidgetLayer* lay ) { 101void Session::setEmulationWidget( WidgetLayer* lay ) {
102 delete m_widLay; 102 delete m_widLay;
103 m_widLay = lay; 103 m_widLay = lay;
104} 104}
105*/ 105*/
106void Session::setTransferDialog(QWidget *d) 106void Session::setTransferDialog(QWidget *d)
107{ 107{
108 m_transfer = d; 108 m_transfer = d;
109} 109}
110 110
diff --git a/noncore/apps/opie-console/sz_transfer.cpp b/noncore/apps/opie-console/sz_transfer.cpp
index c47e73e..2f82417 100644
--- a/noncore/apps/opie-console/sz_transfer.cpp
+++ b/noncore/apps/opie-console/sz_transfer.cpp
@@ -1,84 +1,84 @@
1 1
2#include "sz_transfer.h" 2#include "sz_transfer.h"
3#include <qfile.h> 3#include <qfile.h>
4#include <stdio.h> 4#include <stdio.h>
5#include <sys/termios.h> 5#include <sys/termios.h>
6 6
7 7
8 8
9SzTransfer::SzTransfer(Type t, IOLayer *layer) : FileTransferLayer(layer), m_t(t) 9SzTransfer::SzTransfer(Type t, IOLayer *layer) : FileTransferLayer(layer), m_t(t)
10{ 10{
11} 11}
12 12
13SzTransfer::~SzTransfer() { 13SzTransfer::~SzTransfer() {
14} 14}
15 15
16void SzTransfer::sendFile(const QFile& file) { 16void SzTransfer::sendFile(const QFile& file) {
17 17
18 sendFile(file.name()); 18 sendFile(file.name());
19} 19}
20 20
21void SzTransfer::sendFile(const QString& file) { 21void SzTransfer::sendFile(const QString& file) {
22 22
23 //setcbreak(2); /* raw no echo */ 23 //setcbreak(2); /* raw no echo */
24 24
25 proc = new OProcess; 25 proc = new OProcess;
26 *proc << "sz"; 26 *proc << "sz";
27 *proc << "-v" << "-v" << "-b" << file; 27 *proc << "-v" << "-v" << "-b" << file;
28 connect(proc, SIGNAL(processExited(OProcess *)), 28 connect(proc, SIGNAL(processExited(OProcess*)),
29 this, SLOT(sent())); 29 this, SLOT(sent()));
30 connect(proc, SIGNAL(receivedStdout(OProcess *, char *, int)), 30 connect(proc, SIGNAL(receivedStdout(OProcess*,char*,int)),
31 this, SLOT(SzReceivedStdout(OProcess *, char *, int))); 31 this, SLOT(SzReceivedStdout(OProcess*,char*,int)));
32 connect(proc, SIGNAL(receivedStderr(OProcess *, char *, int)), 32 connect(proc, SIGNAL(receivedStderr(OProcess*,char*,int)),
33 this, SLOT(SzReceivedStderr(OProcess *, char *, int))); 33 this, SLOT(SzReceivedStderr(OProcess*,char*,int)));
34 connect(layer(), SIGNAL(received(const QByteArray &)), 34 connect(layer(), SIGNAL(received(const QByteArray&)),
35 this, SLOT(receivedStdin(const QByteArray &))); 35 this, SLOT(receivedStdin(const QByteArray&)));
36 proc->start(OProcess::NotifyOnExit, OProcess::All); 36 proc->start(OProcess::NotifyOnExit, OProcess::All);
37 37
38} 38}
39 39
40void SzTransfer::SzReceivedStdout(OProcess *, char *buffer, int buflen) { 40void SzTransfer::SzReceivedStdout(OProcess *, char *buffer, int buflen) {
41 41
42 qWarning("recieved from sz on stdout %d bytes", buflen); 42 qWarning("recieved from sz on stdout %d bytes", buflen);
43 43
44 QByteArray data(buflen); 44 QByteArray data(buflen);
45 data.fill(*buffer, buflen); 45 data.fill(*buffer, buflen);
46 for (uint i = 0; i < data.count(); i++ ) { 46 for (uint i = 0; i < data.count(); i++ ) {
47 printf("%c", buffer[i] ); 47 printf("%c", buffer[i] );
48 } 48 }
49 printf("\n"); 49 printf("\n");
50 50
51 // send out through the io layer 51 // send out through the io layer
52 layer()->send(data); 52 layer()->send(data);
53} 53}
54 54
55void SzTransfer::SzReceivedStderr(OProcess *, char *buffer, int length) { 55void SzTransfer::SzReceivedStderr(OProcess *, char *buffer, int length) {
56 56
57 // parse and show data in a progress dialog/widget 57 // parse and show data in a progress dialog/widget
58 printf("stderr:\n"); 58 printf("stderr:\n");
59 //for (int i = 0; i < length; i++) 59 //for (int i = 0; i < length; i++)
60 // printf("%c", buffer[i]); 60 // printf("%c", buffer[i]);
61 //printf("\n"); 61 //printf("\n");
62} 62}
63 63
64void SzTransfer::receivedStdin(const QByteArray &data) { 64void SzTransfer::receivedStdin(const QByteArray &data) {
65 65
66 qWarning("recieved from io_serial %d bytes", data.size()); 66 qWarning("recieved from io_serial %d bytes", data.size());
67 67
68 // recieved data from the io layer goes to sz 68 // recieved data from the io layer goes to sz
69 proc->writeStdin(data.data(), data.size()); 69 proc->writeStdin(data.data(), data.size());
70 70
71} 71}
72 72
73void SzTransfer::sent() { 73void SzTransfer::sent() {
74 74
75 qWarning("sent file"); 75 qWarning("sent file");
76 76
77 //setcbreak(0); /* default */ 77 //setcbreak(0); /* default */
78 78
79 79
80 delete proc; 80 delete proc;
81 disconnect(layer(), SIGNAL(received(const QByteArray &)), 81 disconnect(layer(), SIGNAL(received(const QByteArray&)),
82 this, SLOT(receivedStdin(const QByteArray &))); 82 this, SLOT(receivedStdin(const QByteArray&)));
83 83
84} 84}
diff --git a/noncore/apps/opie-console/test/senderui.cpp b/noncore/apps/opie-console/test/senderui.cpp
index 4a7202d..b1725db 100644
--- a/noncore/apps/opie-console/test/senderui.cpp
+++ b/noncore/apps/opie-console/test/senderui.cpp
@@ -1,77 +1,77 @@
1#include <stdlib.h> 1#include <stdlib.h>
2#include <stdio.h> 2#include <stdio.h>
3#include <fcntl.h> 3#include <fcntl.h>
4#include <sys/termios.h> 4#include <sys/termios.h>
5 5
6#include <qmultilineedit.h> 6#include <qmultilineedit.h>
7#include <qsocketnotifier.h> 7#include <qsocketnotifier.h>
8 8
9#include "../profile.h" 9#include "../profile.h"
10#include "../io_serial.h" 10#include "../io_serial.h"
11#include "../filetransfer.h" 11#include "../filetransfer.h"
12#include "../filereceive.h" 12#include "../filereceive.h"
13 13
14#include <opie2/oprocess.h> 14#include <opie2/oprocess.h>
15 15
16#include "senderui.h" 16#include "senderui.h"
17 17
18SenderUI::SenderUI() 18SenderUI::SenderUI()
19 : Sender() { 19 : Sender() {
20 20
21 /* we do that manually */ 21 /* we do that manually */
22 Profile prof; 22 Profile prof;
23 QString str = "/dev/bty0"; 23 QString str = "/dev/bty0";
24 prof.writeEntry("Device",str ); 24 prof.writeEntry("Device",str );
25 prof.writeEntry("Baud", 19200 ); 25 prof.writeEntry("Baud", 19200 );
26 26
27 qWarning("prof " + prof.readEntry("Device") + " " + str); 27 qWarning("prof " + prof.readEntry("Device") + " " + str);
28 ser = new IOSerial(prof); 28 ser = new IOSerial(prof);
29 connect(ser, SIGNAL(received(const QByteArray& ) ), 29 connect(ser, SIGNAL(received(const QByteArray&) ),
30 this, SLOT(got(const QByteArray&) ) ); 30 this, SLOT(got(const QByteArray&) ) );
31 31
32 if ( ser->open() ) 32 if ( ser->open() )
33 qWarning("opened!!!"); 33 qWarning("opened!!!");
34 else 34 else
35 qWarning("could not open"); 35 qWarning("could not open");
36 36
37 37
38} 38}
39SenderUI::~SenderUI() { 39SenderUI::~SenderUI() {
40 40
41} 41}
42void SenderUI::slotSendFile() { 42void SenderUI::slotSendFile() {
43 43
44 sz = new FileTransfer(FileTransfer::SY, ser); 44 sz = new FileTransfer(FileTransfer::SY, ser);
45 sz->sendFile("/home/ich/bootopie-v06-13.jffs2"); 45 sz->sendFile("/home/ich/bootopie-v06-13.jffs2");
46 46
47 connect (sz, SIGNAL(sent()), 47 connect (sz, SIGNAL(sent()),
48 this, SLOT(fileTransComplete())); 48 this, SLOT(fileTransComplete()));
49} 49}
50 50
51void SenderUI::slotSend() { 51void SenderUI::slotSend() {
52 QCString str = MultiLineEdit1->text().utf8(); 52 QCString str = MultiLineEdit1->text().utf8();
53 qWarning("sending: %s", str.data() ); 53 qWarning("sending: %s", str.data() );
54 str = str.replace( QRegExp("\n"), "\r"); 54 str = str.replace( QRegExp("\n"), "\r");
55 ser->send( str ); 55 ser->send( str );
56} 56}
57void SenderUI::got(const QByteArray& ar) { 57void SenderUI::got(const QByteArray& ar) {
58 qWarning("got:"); 58 qWarning("got:");
59 for ( uint i = 0; i < ar.count(); i++ ) { 59 for ( uint i = 0; i < ar.count(); i++ ) {
60 printf("%c", ar[i] ); 60 printf("%c", ar[i] );
61 } 61 }
62 printf("\n"); 62 printf("\n");
63} 63}
64 64
65void SenderUI::fileTransComplete() { 65void SenderUI::fileTransComplete() {
66 66
67 qWarning("file transfer complete"); 67 qWarning("file transfer complete");
68} 68}
69void SenderUI::send() { 69void SenderUI::send() {
70 70
71} 71}
72void SenderUI::slotRev(){ 72void SenderUI::slotRev(){
73qWarning("Going to receive!"); 73qWarning("Going to receive!");
74FileReceive *rev = new FileReceive( FileReceive::SZ, ser ); 74FileReceive *rev = new FileReceive( FileReceive::SZ, ser );
75rev->receive(); 75rev->receive();
76 76
77} 77}
diff --git a/noncore/apps/opie-console/transferdialog.cpp b/noncore/apps/opie-console/transferdialog.cpp
index 30e7caf..d494a6c 100644
--- a/noncore/apps/opie-console/transferdialog.cpp
+++ b/noncore/apps/opie-console/transferdialog.cpp
@@ -80,109 +80,109 @@ TransferDialog::TransferDialog(QWidget *parent, MainWindow *mainwindow, const ch
80 hbox2 = new QHBoxLayout(vbox, 2); 80 hbox2 = new QHBoxLayout(vbox, 2);
81 hbox2->add(ok); 81 hbox2->add(ok);
82 hbox2->add(cancel); 82 hbox2->add(cancel);
83 83
84 setCaption(QObject::tr("File transfer")); 84 setCaption(QObject::tr("File transfer"));
85 show(); 85 show();
86 86
87 connect(selector, SIGNAL(clicked()), SLOT(slotFilename())); 87 connect(selector, SIGNAL(clicked()), SLOT(slotFilename()));
88 connect(ok, SIGNAL(clicked()), SLOT(slotTransfer())); 88 connect(ok, SIGNAL(clicked()), SLOT(slotTransfer()));
89 connect(cancel, SIGNAL(clicked()), SLOT(slotCancel())); 89 connect(cancel, SIGNAL(clicked()), SLOT(slotCancel()));
90 connect(group, SIGNAL(clicked(int)), SLOT(slotMode(int))); 90 connect(group, SIGNAL(clicked(int)), SLOT(slotMode(int)));
91} 91}
92 92
93TransferDialog::~TransferDialog() 93TransferDialog::~TransferDialog()
94{ 94{
95} 95}
96 96
97void TransferDialog::slotFilename() 97void TransferDialog::slotFilename()
98{ 98{
99 QString f; 99 QString f;
100 100
101 f = Opie::OFileDialog::getOpenFileName(0); 101 f = Opie::OFileDialog::getOpenFileName(0);
102 if(!f.isNull()) filename->setText(f); 102 if(!f.isNull()) filename->setText(f);
103} 103}
104 104
105void TransferDialog::slotTransfer() 105void TransferDialog::slotTransfer()
106{ 106{
107 if((m_transfermode == id_send) && (filename->text().isEmpty())) 107 if((m_transfermode == id_send) && (filename->text().isEmpty()))
108 { 108 {
109 QMessageBox::information(this, 109 QMessageBox::information(this,
110 QObject::tr("Attention"), 110 QObject::tr("Attention"),
111 QObject::tr("No file has been specified.")); 111 QObject::tr("No file has been specified."));
112 return; 112 return;
113 } 113 }
114 114
115 ok->setEnabled(false); 115 ok->setEnabled(false);
116 116
117 cleanup(); 117 cleanup();
118 m_autocleanup = 0; 118 m_autocleanup = 0;
119 119
120 if(m_transfermode == id_send) statusbar->setText(QObject::tr("Sending...")); 120 if(m_transfermode == id_send) statusbar->setText(QObject::tr("Sending..."));
121 else statusbar->setText(QObject::tr("Receiving...")); 121 else statusbar->setText(QObject::tr("Receiving..."));
122 122
123 if(m_transfermode == id_send) 123 if(m_transfermode == id_send)
124 { 124 {
125 m_lay = m_win->factory()->newFileTransfer(protocol->currentText(), m_win->currentSession()->layer()); 125 m_lay = m_win->factory()->newFileTransfer(protocol->currentText(), m_win->currentSession()->layer());
126 m_lay->sendFile(filename->text()); 126 m_lay->sendFile(filename->text());
127 127
128 connect(m_lay, SIGNAL(progress(const QString&, int, int, int, int, int)), 128 connect(m_lay, SIGNAL(progress(const QString&,int,int,int,int,int)),
129 SLOT(slotProgress(const QString&, int, int, int, int, int))); 129 SLOT(slotProgress(const QString&,int,int,int,int,int)));
130 connect(m_lay, SIGNAL(error(int, const QString&)), SLOT(slotError(int, const QString&))); 130 connect(m_lay, SIGNAL(error(int,const QString&)), SLOT(slotError(int,const QString&)));
131 connect(m_lay, SIGNAL(sent()), SLOT(slotSent())); 131 connect(m_lay, SIGNAL(sent()), SLOT(slotSent()));
132 } 132 }
133 else 133 else
134 { 134 {
135 m_recvlay = m_win->factory()->newReceive(protocol->currentText(), m_win->currentSession()->layer()); 135 m_recvlay = m_win->factory()->newReceive(protocol->currentText(), m_win->currentSession()->layer());
136 m_recvlay->receive(); 136 m_recvlay->receive();
137 137
138 connect(m_recvlay, SIGNAL(progress(const QString&, int, int, int, int, int)), 138 connect(m_recvlay, SIGNAL(progress(const QString&,int,int,int,int,int)),
139 SLOT(slotProgress(const QString&, int, int, int, int, int))); 139 SLOT(slotProgress(const QString&,int,int,int,int,int)));
140 connect(m_recvlay, SIGNAL(error(int, const QString&)), SLOT(slotError(int, const QString&))); 140 connect(m_recvlay, SIGNAL(error(int,const QString&)), SLOT(slotError(int,const QString&)));
141 connect(m_recvlay, SIGNAL(received(const QString&)), SLOT(slotReceived(const QString&))); 141 connect(m_recvlay, SIGNAL(received(const QString&)), SLOT(slotReceived(const QString&)));
142 } 142 }
143} 143}
144 144
145void TransferDialog::cleanup() 145void TransferDialog::cleanup()
146{ 146{
147 if(m_lay) 147 if(m_lay)
148 { 148 {
149 m_lay->cancel(); 149 m_lay->cancel();
150 delete m_lay; 150 delete m_lay;
151 m_lay = 0l; 151 m_lay = 0l;
152 } 152 }
153 if(m_recvlay) 153 if(m_recvlay)
154 { 154 {
155 m_recvlay->cancel(); 155 m_recvlay->cancel();
156 delete m_recvlay; 156 delete m_recvlay;
157 m_recvlay = 0l; 157 m_recvlay = 0l;
158 } 158 }
159} 159}
160 160
161void TransferDialog::slotCancel() 161void TransferDialog::slotCancel()
162{ 162{
163 ok->setEnabled(true); 163 ok->setEnabled(true);
164 statusbar->setText(QObject::tr("Ready")); 164 statusbar->setText(QObject::tr("Ready"));
165 165
166 if((m_lay) || (m_recvlay)) 166 if((m_lay) || (m_recvlay))
167 { 167 {
168 cleanup(); 168 cleanup();
169 if(m_autocleanup) 169 if(m_autocleanup)
170 { 170 {
171 m_running = false; 171 m_running = false;
172 close(); 172 close();
173 } 173 }
174 else 174 else
175 { 175 {
176 QMessageBox::information(this, 176 QMessageBox::information(this,
177 QObject::tr("Cancelled"), 177 QObject::tr("Cancelled"),
178 QObject::tr("The file transfer has been cancelled.")); 178 QObject::tr("The file transfer has been cancelled."));
179 } 179 }
180 } 180 }
181 else 181 else
182 { 182 {
183 m_running = false; 183 m_running = false;
184 close(); 184 close();
185 } 185 }
186} 186}
187 187
188void TransferDialog::slotProgress(const QString& , int progress, int , int , int, int ) 188void TransferDialog::slotProgress(const QString& , int progress, int , int , int, int )
diff --git a/noncore/apps/opie-reader/QTReaderApp.cpp b/noncore/apps/opie-reader/QTReaderApp.cpp
index e759249..b0d589e 100644
--- a/noncore/apps/opie-reader/QTReaderApp.cpp
+++ b/noncore/apps/opie-reader/QTReaderApp.cpp
@@ -284,117 +284,117 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
284 mb = new QMenuBar( menubar ); 284 mb = new QMenuBar( menubar );
285#else 285#else
286 mb = new QMenuBar( menubar ); 286 mb = new QMenuBar( menubar );
287#endif 287#endif
288 288
289//#ifdef USEQPE 289//#ifdef USEQPE
290 QPopupMenu* tmp = new QPopupMenu(mb); 290 QPopupMenu* tmp = new QPopupMenu(mb);
291 mb->insertItem( geticon( "AppsIcon" ), tmp ); 291 mb->insertItem( geticon( "AppsIcon" ), tmp );
292//#else 292//#else
293// QMenuBar* tmp = mb; 293// QMenuBar* tmp = mb;
294//#endif 294//#endif
295 295
296 QPopupMenu *file = new QPopupMenu( mb ); 296 QPopupMenu *file = new QPopupMenu( mb );
297 tmp->insertItem( tr( "File" ), file ); 297 tmp->insertItem( tr( "File" ), file );
298 298
299 QPopupMenu *navigation = new QPopupMenu(mb); 299 QPopupMenu *navigation = new QPopupMenu(mb);
300 tmp->insertItem( tr( "Navigation" ), navigation ); 300 tmp->insertItem( tr( "Navigation" ), navigation );
301 301
302 QPopupMenu *view = new QPopupMenu( mb ); 302 QPopupMenu *view = new QPopupMenu( mb );
303 tmp->insertItem( tr( "View" ), view ); 303 tmp->insertItem( tr( "View" ), view );
304 304
305 QPopupMenu *marks = new QPopupMenu( this ); 305 QPopupMenu *marks = new QPopupMenu( this );
306 tmp->insertItem( tr( "Marks" ), marks ); 306 tmp->insertItem( tr( "Marks" ), marks );
307 307
308 QPopupMenu *settings = new QPopupMenu( this ); 308 QPopupMenu *settings = new QPopupMenu( this );
309 tmp->insertItem( tr( "Settings" ), settings ); 309 tmp->insertItem( tr( "Settings" ), settings );
310 310
311// addToolBar(menubar, "Menus",QMainWindow::Top); 311// addToolBar(menubar, "Menus",QMainWindow::Top);
312// addToolBar(fileBar, "Toolbar",QMainWindow::Top); 312// addToolBar(fileBar, "Toolbar",QMainWindow::Top);
313 313
314 // QPopupMenu *edit = new QPopupMenu( this ); 314 // QPopupMenu *edit = new QPopupMenu( this );
315 315
316 /* 316 /*
317 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); 317 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 );
318 connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) ); 318 connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) );
319 a->addTo( bar ); 319 a->addTo( bar );
320 a->addTo( file ); 320 a->addTo( file );
321 */ 321 */
322 322
323 editorStack = new QWidgetStack( this ); 323 editorStack = new QWidgetStack( this );
324 setCentralWidget( editorStack ); 324 setCentralWidget( editorStack );
325 325
326 searchVisible = FALSE; 326 searchVisible = FALSE;
327 regVisible = FALSE; 327 regVisible = FALSE;
328 m_fontVisible = false; 328 m_fontVisible = false;
329 329
330 m_annoWin = new CAnnoEdit(editorStack); 330 m_annoWin = new CAnnoEdit(editorStack);
331 editorStack->addWidget(m_annoWin, get_unique_id()); 331 editorStack->addWidget(m_annoWin, get_unique_id());
332 connect( m_annoWin, SIGNAL( finished(const QString&, const QString&) ), this, SLOT( addAnno(const QString&, const QString&) ) ); 332 connect( m_annoWin, SIGNAL( finished(const QString&,const QString&) ), this, SLOT( addAnno(const QString&,const QString&) ) );
333 connect( m_annoWin, SIGNAL( cancelled() ), this, SLOT( infoClose() ) ); 333 connect( m_annoWin, SIGNAL( cancelled() ), this, SLOT( infoClose() ) );
334 334
335 m_infoWin = new infowin(editorStack); 335 m_infoWin = new infowin(editorStack);
336 editorStack->addWidget(m_infoWin, get_unique_id()); 336 editorStack->addWidget(m_infoWin, get_unique_id());
337 connect( m_infoWin, SIGNAL( Close() ), this, SLOT( infoClose() ) ); 337 connect( m_infoWin, SIGNAL( Close() ), this, SLOT( infoClose() ) );
338 338
339 m_graphicwin = new GraphicWin(editorStack); 339 m_graphicwin = new GraphicWin(editorStack);
340 editorStack->addWidget(m_graphicwin, get_unique_id()); 340 editorStack->addWidget(m_graphicwin, get_unique_id());
341 connect( m_graphicwin, SIGNAL( Closed() ), this, SLOT( infoClose() ) ); 341 connect( m_graphicwin, SIGNAL( Closed() ), this, SLOT( infoClose() ) );
342 342
343// bkmkselector = new QListBox(editorStack, "Bookmarks"); 343// bkmkselector = new QListBox(editorStack, "Bookmarks");
344 bkmkselector = new CBkmkSelector(editorStack, "Bookmarks"); 344 bkmkselector = new CBkmkSelector(editorStack, "Bookmarks");
345 // connect(bkmkselector, SIGNAL( selected(const QString&) ), this, SLOT( gotobkmk(const QString&) ) ); 345 // connect(bkmkselector, SIGNAL( selected(const QString&) ), this, SLOT( gotobkmk(const QString&) ) );
346 connect(bkmkselector, SIGNAL( selected(int) ), this, SLOT( gotobkmk(int) ) ); 346 connect(bkmkselector, SIGNAL( selected(int) ), this, SLOT( gotobkmk(int) ) );
347 connect(bkmkselector, SIGNAL( cancelled() ), this, SLOT( cancelbkmk() ) ); 347 connect(bkmkselector, SIGNAL( cancelled() ), this, SLOT( cancelbkmk() ) );
348 editorStack->addWidget( bkmkselector, get_unique_id() ); 348 editorStack->addWidget( bkmkselector, get_unique_id() );
349 349
350/* 350/*
351 importSelector = new FileSelector( "*", editorStack, "importselector", false ); 351 importSelector = new FileSelector( "*", editorStack, "importselector", false );
352 connect( importSelector, SIGNAL( fileSelected( const DocLnk &) ), this, SLOT( importFile( const DocLnk & ) ) ); 352 connect( importSelector, SIGNAL( fileSelected(const DocLnk&) ), this, SLOT( importFile(const DocLnk&) ) );
353 353
354 editorStack->addWidget( importSelector, get_unique_id() ); 354 editorStack->addWidget( importSelector, get_unique_id() );
355 355
356 // don't need the close visible, it is redundant... 356 // don't need the close visible, it is redundant...
357 importSelector->setCloseVisible( FALSE ); 357 importSelector->setCloseVisible( FALSE );
358*/ 358*/
359// qDebug("Reading file list"); 359// qDebug("Reading file list");
360 readfilelist(); 360 readfilelist();
361 361
362 reader = new QTReader( editorStack ); 362 reader = new QTReader( editorStack );
363 363
364 reader->bDoUpdates = false; 364 reader->bDoUpdates = false;
365 365
366#ifdef USEQPE 366#ifdef USEQPE
367 ((QPEApplication*)qApp)->setStylusOperation(reader, QPEApplication::RightOnHold); 367 ((QPEApplication*)qApp)->setStylusOperation(reader, QPEApplication::RightOnHold);
368#endif 368#endif
369 369
370// qDebug("Reading config"); 370// qDebug("Reading config");
371// Config config( APPDIR ); 371// Config config( APPDIR );
372 config.setGroup( "View" ); 372 config.setGroup( "View" );
373 m_debounce = config.readNumEntry("Debounce", 0); 373 m_debounce = config.readNumEntry("Debounce", 0);
374#ifdef USEQPE 374#ifdef USEQPE
375 m_bFloatingDialog = config.readBoolEntry("FloatDialogs", false); 375 m_bFloatingDialog = config.readBoolEntry("FloatDialogs", false);
376#else 376#else
377 m_bFloatingDialog = config.readBoolEntry("FloatDialogs", true); 377 m_bFloatingDialog = config.readBoolEntry("FloatDialogs", true);
378#endif 378#endif
379 reader->bstripcr = config.readBoolEntry( "StripCr", true ); 379 reader->bstripcr = config.readBoolEntry( "StripCr", true );
380 reader->bfulljust = config.readBoolEntry( "FullJust", false ); 380 reader->bfulljust = config.readBoolEntry( "FullJust", false );
381 reader->setextraspace(config.readNumEntry( "ExtraSpace", 0 )); 381 reader->setextraspace(config.readNumEntry( "ExtraSpace", 0 ));
382 reader->setlead(config.readNumEntry( "ExtraLead", 0 )); 382 reader->setlead(config.readNumEntry( "ExtraLead", 0 ));
383 reader->btextfmt = config.readBoolEntry( "TextFmt", false ); 383 reader->btextfmt = config.readBoolEntry( "TextFmt", false );
384 reader->bautofmt = config.readBoolEntry( "AutoFmt", true ); 384 reader->bautofmt = config.readBoolEntry( "AutoFmt", true );
385 reader->bstriphtml = config.readBoolEntry( "StripHtml", false ); 385 reader->bstriphtml = config.readBoolEntry( "StripHtml", false );
386 reader->bpeanut = config.readBoolEntry( "Peanut", false ); 386 reader->bpeanut = config.readBoolEntry( "Peanut", false );
387 reader->bdehyphen = config.readBoolEntry( "Dehyphen", false ); 387 reader->bdehyphen = config.readBoolEntry( "Dehyphen", false );
388 reader->bdepluck = config.readBoolEntry( "Depluck", false ); 388 reader->bdepluck = config.readBoolEntry( "Depluck", false );
389 reader->bdejpluck = config.readBoolEntry( "Dejpluck", false ); 389 reader->bdejpluck = config.readBoolEntry( "Dejpluck", false );
390 reader->bonespace = config.readBoolEntry( "OneSpace", false ); 390 reader->bonespace = config.readBoolEntry( "OneSpace", false );
391 reader->bunindent = config.readBoolEntry( "Unindent", false ); 391 reader->bunindent = config.readBoolEntry( "Unindent", false );
392 reader->brepara = config.readBoolEntry( "Repara", false ); 392 reader->brepara = config.readBoolEntry( "Repara", false );
393 reader->bdblspce = config.readBoolEntry( "DoubleSpace", false ); 393 reader->bdblspce = config.readBoolEntry( "DoubleSpace", false );
394 reader->bindenter = config.readNumEntry( "Indent", 0 ); 394 reader->bindenter = config.readNumEntry( "Indent", 0 );
395 reader->m_textsize = config.readNumEntry( "FontSize", 12 ); 395 reader->m_textsize = config.readNumEntry( "FontSize", 12 );
396 reader->m_delay = config.readNumEntry( "ScrollDelay", 5184); 396 reader->m_delay = config.readNumEntry( "ScrollDelay", 5184);
397 reader->m_lastfile = config.readEntry( "LastFile", QString::null ); 397 reader->m_lastfile = config.readEntry( "LastFile", QString::null );
398 reader->m_lastposn = config.readNumEntry( "LastPosn", 0 ); 398 reader->m_lastposn = config.readNumEntry( "LastPosn", 0 );
399 reader->m_bpagemode = config.readBoolEntry( "PageMode", true ); 399 reader->m_bpagemode = config.readBoolEntry( "PageMode", true );
400 reader->m_bMonoSpaced = config.readBoolEntry( "MonoSpaced", false); 400 reader->m_bMonoSpaced = config.readBoolEntry( "MonoSpaced", false);
@@ -408,97 +408,97 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
408 reader->brepalm = config.readBoolEntry( "Repalm", true ); 408 reader->brepalm = config.readBoolEntry( "Repalm", true );
409#endif 409#endif
410 reader->bremap = config.readBoolEntry( "Remap", true ); 410 reader->bremap = config.readBoolEntry( "Remap", true );
411 reader->bmakebold = config.readBoolEntry( "MakeBold", false ); 411 reader->bmakebold = config.readBoolEntry( "MakeBold", false );
412 reader->setContinuous(config.readBoolEntry( "Continuous", true )); 412 reader->setContinuous(config.readBoolEntry( "Continuous", true ));
413 m_targetapp = config.readEntry( "TargetApp", QString::null ); 413 m_targetapp = config.readEntry( "TargetApp", QString::null );
414 m_targetmsg = config.readEntry( "TargetMsg", QString::null ); 414 m_targetmsg = config.readEntry( "TargetMsg", QString::null );
415#ifdef _SCROLLPIPE 415#ifdef _SCROLLPIPE
416 reader->m_pipetarget = config.readEntry( "PipeTarget", QString::null ); 416 reader->m_pipetarget = config.readEntry( "PipeTarget", QString::null );
417 reader->m_pauseAfterEachPara = config.readBoolEntry( "PauseAfterPara", true ); 417 reader->m_pauseAfterEachPara = config.readBoolEntry( "PauseAfterPara", true );
418#endif 418#endif
419 m_twoTouch = config.readBoolEntry( "TwoTouch", false); 419 m_twoTouch = config.readBoolEntry( "TwoTouch", false);
420 m_doAnnotation = config.readBoolEntry( "Annotation", false); 420 m_doAnnotation = config.readBoolEntry( "Annotation", false);
421 m_doDictionary = config.readBoolEntry( "Dictionary", false); 421 m_doDictionary = config.readBoolEntry( "Dictionary", false);
422 m_doClipboard = config.readBoolEntry( "Clipboard", false); 422 m_doClipboard = config.readBoolEntry( "Clipboard", false);
423 m_spaceTarget = (ActionTypes)config.readNumEntry("SpaceTarget", cesAutoScroll); 423 m_spaceTarget = (ActionTypes)config.readNumEntry("SpaceTarget", cesAutoScroll);
424 m_escapeTarget = (ActionTypes)config.readNumEntry("EscapeTarget", cesNone); 424 m_escapeTarget = (ActionTypes)config.readNumEntry("EscapeTarget", cesNone);
425 m_returnTarget = (ActionTypes)config.readNumEntry("ReturnTarget", cesFullScreen); 425 m_returnTarget = (ActionTypes)config.readNumEntry("ReturnTarget", cesFullScreen);
426 m_leftTarget = (ActionTypes)config.readNumEntry("LeftTarget", cesZoomOut); 426 m_leftTarget = (ActionTypes)config.readNumEntry("LeftTarget", cesZoomOut);
427 m_rightTarget = (ActionTypes)config.readNumEntry("RightTarget", cesZoomIn); 427 m_rightTarget = (ActionTypes)config.readNumEntry("RightTarget", cesZoomIn);
428 m_upTarget = (ActionTypes)config.readNumEntry("UpTarget", cesPageUp); 428 m_upTarget = (ActionTypes)config.readNumEntry("UpTarget", cesPageUp);
429 m_downTarget = (ActionTypes)config.readNumEntry("DownTarget", cesPageDown); 429 m_downTarget = (ActionTypes)config.readNumEntry("DownTarget", cesPageDown);
430 430
431 m_leftScroll = config.readBoolEntry("LeftScroll", false); 431 m_leftScroll = config.readBoolEntry("LeftScroll", false);
432 m_rightScroll = config.readBoolEntry("RightScroll", false); 432 m_rightScroll = config.readBoolEntry("RightScroll", false);
433 m_upScroll = config.readBoolEntry("UpScroll", true); 433 m_upScroll = config.readBoolEntry("UpScroll", true);
434 m_downScroll = config.readBoolEntry("DownScroll", true); 434 m_downScroll = config.readBoolEntry("DownScroll", true);
435 435
436 m_propogatefontchange = config.readBoolEntry( "RequestorFontChange", false); 436 m_propogatefontchange = config.readBoolEntry( "RequestorFontChange", false);
437 reader->setBaseSize(config.readNumEntry( "Basesize", 10 )); 437 reader->setBaseSize(config.readNumEntry( "Basesize", 10 ));
438 438
439#ifndef USEQPE 439#ifndef USEQPE
440 config.setGroup( "Geometry" ); 440 config.setGroup( "Geometry" );
441 setGeometry(0,0, 441 setGeometry(0,0,
442 config.readNumEntry( "width", QApplication::desktop()->width()/2 ), 442 config.readNumEntry( "width", QApplication::desktop()->width()/2 ),
443 config.readNumEntry( "height", QApplication::desktop()->height()/2 )); 443 config.readNumEntry( "height", QApplication::desktop()->height()/2 ));
444 move( 444 move(
445 config.readNumEntry( "x", 20 ), 445 config.readNumEntry( "x", 20 ),
446 config.readNumEntry( "y", 20 )); 446 config.readNumEntry( "y", 20 ));
447#endif 447#endif
448 448
449 449
450 450
451 setTwoTouch(m_twoTouch); 451 setTwoTouch(m_twoTouch);
452 452
453 connect( reader, SIGNAL( OnShowPicture(QImage&) ), this, SLOT( showgraphic(QImage&) ) ); 453 connect( reader, SIGNAL( OnShowPicture(QImage&) ), this, SLOT( showgraphic(QImage&) ) );
454 454
455 connect( reader, SIGNAL( OnRedraw() ), this, SLOT( OnRedraw() ) ); 455 connect( reader, SIGNAL( OnRedraw() ), this, SLOT( OnRedraw() ) );
456 connect( reader, SIGNAL( OnWordSelected(const QString&, size_t, const QString&) ), this, SLOT( OnWordSelected(const QString&, size_t, const QString&) ) ); 456 connect( reader, SIGNAL( OnWordSelected(const QString&,size_t,const QString&) ), this, SLOT( OnWordSelected(const QString&,size_t,const QString&) ) );
457 connect( reader, SIGNAL( OnURLSelected(const QString&) ), this, SLOT( OnURLSelected(const QString&) ) ); 457 connect( reader, SIGNAL( OnURLSelected(const QString&) ), this, SLOT( OnURLSelected(const QString&) ) );
458 editorStack->addWidget( reader, get_unique_id() ); 458 editorStack->addWidget( reader, get_unique_id() );
459 459
460 m_preferences_action = new QAction( tr( "Configuration" ), geticon( "SettingsIcon" ), QString::null, 0, this, NULL); 460 m_preferences_action = new QAction( tr( "Configuration" ), geticon( "SettingsIcon" ), QString::null, 0, this, NULL);
461 connect( m_preferences_action, SIGNAL( activated() ), this, SLOT( showprefs() ) ); 461 connect( m_preferences_action, SIGNAL( activated() ), this, SLOT( showprefs() ) );
462 m_preferences_action->addTo( settings ); 462 m_preferences_action->addTo( settings );
463 463
464 m_saveconfig_action = new QAction( tr( "Save Config" ), QString::null, 0, this, NULL); 464 m_saveconfig_action = new QAction( tr( "Save Config" ), QString::null, 0, this, NULL);
465 connect( m_saveconfig_action, SIGNAL( activated() ), this, SLOT( SaveConfig() ) ); 465 connect( m_saveconfig_action, SIGNAL( activated() ), this, SLOT( SaveConfig() ) );
466 m_saveconfig_action->addTo( settings ); 466 m_saveconfig_action->addTo( settings );
467 467
468 m_loadconfig_action = new QAction( tr( "Load Config" ), QString::null, 0, this, NULL); 468 m_loadconfig_action = new QAction( tr( "Load Config" ), QString::null, 0, this, NULL);
469 connect( m_loadconfig_action, SIGNAL( activated() ), this, SLOT( LoadConfig() ) ); 469 connect( m_loadconfig_action, SIGNAL( activated() ), this, SLOT( LoadConfig() ) );
470 m_loadconfig_action->addTo( settings ); 470 m_loadconfig_action->addTo( settings );
471 471
472 m_tidyconfig_action = new QAction( tr( "Delete Config" ), QString::null, 0, this, NULL); 472 m_tidyconfig_action = new QAction( tr( "Delete Config" ), QString::null, 0, this, NULL);
473 connect( m_tidyconfig_action, SIGNAL( activated() ), this, SLOT( TidyConfig() ) ); 473 connect( m_tidyconfig_action, SIGNAL( activated() ), this, SLOT( TidyConfig() ) );
474 m_tidyconfig_action->addTo( settings ); 474 m_tidyconfig_action->addTo( settings );
475 475
476 settings->insertSeparator(); 476 settings->insertSeparator();
477 m_toolbarprefs_action = new QAction( tr( "Toolbars" ), QString::null, 0, this, NULL); 477 m_toolbarprefs_action = new QAction( tr( "Toolbars" ), QString::null, 0, this, NULL);
478 connect( m_toolbarprefs_action, SIGNAL( activated() ), this, SLOT( showtoolbarprefs() ) ); 478 connect( m_toolbarprefs_action, SIGNAL( activated() ), this, SLOT( showtoolbarprefs() ) );
479 m_toolbarprefs_action->addTo( settings ); 479 m_toolbarprefs_action->addTo( settings );
480 480
481 m_open_action = new QAction( tr( "Open" ), geticon( "fileopen" ), QString::null, 0, this, 0 ); 481 m_open_action = new QAction( tr( "Open" ), geticon( "fileopen" ), QString::null, 0, this, 0 );
482 connect( m_open_action, SIGNAL( activated() ), this, SLOT( fileOpen() ) ); 482 connect( m_open_action, SIGNAL( activated() ), this, SLOT( fileOpen() ) );
483 m_open_action->addTo( file ); 483 m_open_action->addTo( file );
484 484
485 m_close_action = new QAction( tr( "Close" ), geticon( "close" ), QString::null, 0, this, 0 ); 485 m_close_action = new QAction( tr( "Close" ), geticon( "close" ), QString::null, 0, this, 0 );
486 connect( m_close_action, SIGNAL( activated() ), this, SLOT( fileClose() ) ); 486 connect( m_close_action, SIGNAL( activated() ), this, SLOT( fileClose() ) );
487 m_close_action->addTo( file ); 487 m_close_action->addTo( file );
488 488
489#ifdef _SCRIPT 489#ifdef _SCRIPT
490 a = new QAction( tr( "Run Script" ), QString::null, 0, this, NULL); 490 a = new QAction( tr( "Run Script" ), QString::null, 0, this, NULL);
491 connect( a, SIGNAL( activated() ), this, SLOT( RunScript() ) ); 491 connect( a, SIGNAL( activated() ), this, SLOT( RunScript() ) );
492 a->addTo( file ); 492 a->addTo( file );
493#endif 493#endif
494 /* 494 /*
495 a = new QAction( tr( "Revert" ), geticon( "close" ), QString::null, 0, this, 0 ); 495 a = new QAction( tr( "Revert" ), geticon( "close" ), QString::null, 0, this, 0 );
496 connect( a, SIGNAL( activated() ), this, SLOT( fileRevert() ) ); 496 connect( a, SIGNAL( activated() ), this, SLOT( fileRevert() ) );
497 a->addTo( file ); 497 a->addTo( file );
498 498
499 a = new QAction( tr( "Cut" ), geticon( "cut" ), QString::null, 0, this, 0 ); 499 a = new QAction( tr( "Cut" ), geticon( "cut" ), QString::null, 0, this, 0 );
500 connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) ); 500 connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) );
501 a->addTo( filebar() ); 501 a->addTo( filebar() );
502 a->addTo( edit ); 502 a->addTo( edit );
503 */ 503 */
504 504
@@ -681,170 +681,170 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f )
681 connect( m_autogen_action, SIGNAL( activated() ), this, SLOT( do_autogen() ) ); 681 connect( m_autogen_action, SIGNAL( activated() ), this, SLOT( do_autogen() ) );
682 marks->insertSeparator(); 682 marks->insertSeparator();
683 m_autogen_action->addTo( marks ); 683 m_autogen_action->addTo( marks );
684 684
685 m_clear_action = new QAction( tr( "Clear" ), getmyicon( "bookmark_clear" ), QString::null, 0, this, NULL); 685 m_clear_action = new QAction( tr( "Clear" ), getmyicon( "bookmark_clear" ), QString::null, 0, this, NULL);
686 connect( m_clear_action, SIGNAL( activated() ), this, SLOT( clearBkmkList() ) ); 686 connect( m_clear_action, SIGNAL( activated() ), this, SLOT( clearBkmkList() ) );
687 m_clear_action->addTo( marks ); 687 m_clear_action->addTo( marks );
688 688
689 m_save_action = new QAction( tr( "Save" ), getmyicon( "bookmark_save" ), QString::null, 0, this, NULL ); 689 m_save_action = new QAction( tr( "Save" ), getmyicon( "bookmark_save" ), QString::null, 0, this, NULL );
690 connect( m_save_action, SIGNAL( activated() ), this, SLOT( savebkmks() ) ); 690 connect( m_save_action, SIGNAL( activated() ), this, SLOT( savebkmks() ) );
691 m_save_action->addTo( marks ); 691 m_save_action->addTo( marks );
692 692
693 m_tidy_action = new QAction( tr( "Tidy" ), getmyicon( "bookmark_tidy" ), QString::null, 0, this, NULL); 693 m_tidy_action = new QAction( tr( "Tidy" ), getmyicon( "bookmark_tidy" ), QString::null, 0, this, NULL);
694 connect( m_tidy_action, SIGNAL( activated() ), this, SLOT( listBkmkFiles() ) ); 694 connect( m_tidy_action, SIGNAL( activated() ), this, SLOT( listBkmkFiles() ) );
695 marks->insertSeparator(); 695 marks->insertSeparator();
696 m_tidy_action->addTo( marks ); 696 m_tidy_action->addTo( marks );
697 697
698 m_startBlock_action = new QAction( tr( "Start Block" ), geticon( "new" ), QString::null, 0, this, NULL); 698 m_startBlock_action = new QAction( tr( "Start Block" ), geticon( "new" ), QString::null, 0, this, NULL);
699 connect( m_startBlock_action, SIGNAL( activated() ), this, SLOT( editMark() ) ); 699 connect( m_startBlock_action, SIGNAL( activated() ), this, SLOT( editMark() ) );
700 marks->insertSeparator(); 700 marks->insertSeparator();
701 m_startBlock_action->addTo( marks ); 701 m_startBlock_action->addTo( marks );
702 702
703 m_endBlock_action = new QAction( tr( "Copy Block" ), geticon( "copy" ), QString::null, 0, this, NULL); 703 m_endBlock_action = new QAction( tr( "Copy Block" ), geticon( "copy" ), QString::null, 0, this, NULL);
704 connect( m_endBlock_action, SIGNAL( activated() ), this, SLOT( editCopy() ) ); 704 connect( m_endBlock_action, SIGNAL( activated() ), this, SLOT( editCopy() ) );
705 m_endBlock_action->addTo( marks ); 705 m_endBlock_action->addTo( marks );
706 706
707 m_bkmkAvail = NULL; 707 m_bkmkAvail = NULL;
708 708
709 709
710 setToolBarsMovable(m_tbmove); 710 setToolBarsMovable(m_tbmove);
711 addtoolbars(&config); 711 addtoolbars(&config);
712 712
713 pbar = new QProgressBar(this); 713 pbar = new QProgressBar(this);
714 pbar->hide(); 714 pbar->hide();
715 715
716 searchBar = new QFloatBar( "Search", this, QMainWindow::Top, TRUE ); 716 searchBar = new QFloatBar( "Search", this, QMainWindow::Top, TRUE );
717 717
718 searchBar->setHorizontalStretchable( TRUE ); 718 searchBar->setHorizontalStretchable( TRUE );
719 719
720 connect(searchBar, SIGNAL( OnHide() ), this, SLOT( restoreFocus() )); 720 connect(searchBar, SIGNAL( OnHide() ), this, SLOT( restoreFocus() ));
721 721
722 searchEdit = new QLineEdit( searchBar, "searchEdit" ); 722 searchEdit = new QLineEdit( searchBar, "searchEdit" );
723// QFont f("unifont", 16 /*, QFont::Bold*/); 723// QFont f("unifont", 16 /*, QFont::Bold*/);
724// searchEdit->setFont( f ); 724// searchEdit->setFont( f );
725 searchBar->setStretchableWidget( searchEdit ); 725 searchBar->setStretchableWidget( searchEdit );
726 726
727 727
728#ifdef __ISEARCH 728#ifdef __ISEARCH
729 connect( searchEdit, SIGNAL( textChanged( const QString & ) ), 729 connect( searchEdit, SIGNAL( textChanged(const QString&) ),
730 this, SLOT( search( const QString& ) ) ); 730 this, SLOT( search(const QString&) ) );
731#else 731#else
732 connect( searchEdit, SIGNAL( returnPressed( ) ), 732 connect( searchEdit, SIGNAL( returnPressed() ),
733 this, SLOT( search( ) ) ); 733 this, SLOT( search() ) );
734#endif 734#endif
735 QAction*a = new QAction( tr( "Find Next" ), geticon( "next" ), QString::null, 0, this, 0 ); 735 QAction*a = new QAction( tr( "Find Next" ), geticon( "next" ), QString::null, 0, this, 0 );
736 connect( a, SIGNAL( activated() ), this, SLOT( findNext() ) ); 736 connect( a, SIGNAL( activated() ), this, SLOT( findNext() ) );
737 a->addTo( searchBar ); 737 a->addTo( searchBar );
738 738
739 a = new QAction( tr( "Close Find" ), geticon( "close" ), QString::null, 0, this, 0 ); 739 a = new QAction( tr( "Close Find" ), geticon( "close" ), QString::null, 0, this, 0 );
740 connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) ); 740 connect( a, SIGNAL( activated() ), this, SLOT( findClose() ) );
741 a->addTo( searchBar ); 741 a->addTo( searchBar );
742 742
743 searchBar->hide(); 743 searchBar->hide();
744 744
745 regBar = new QFloatBar( "Autogen", this, QMainWindow::Top, TRUE ); 745 regBar = new QFloatBar( "Autogen", this, QMainWindow::Top, TRUE );
746 connect(regBar, SIGNAL( OnHide() ), this, SLOT( restoreFocus() )); 746 connect(regBar, SIGNAL( OnHide() ), this, SLOT( restoreFocus() ));
747 747
748 regBar->setHorizontalStretchable( TRUE ); 748 regBar->setHorizontalStretchable( TRUE );
749 749
750 regEdit = new QLineEdit( regBar, "regEdit" ); 750 regEdit = new QLineEdit( regBar, "regEdit" );
751// regEdit->setFont( f ); 751// regEdit->setFont( f );
752 752
753 regBar->setStretchableWidget( regEdit ); 753 regBar->setStretchableWidget( regEdit );
754 754
755 connect( regEdit, SIGNAL( returnPressed( ) ), 755 connect( regEdit, SIGNAL( returnPressed() ),
756 this, SLOT( do_regaction() ) ); 756 this, SLOT( do_regaction() ) );
757 757
758 a = new QAction( tr( "Do Reg" ), geticon( "enter" ), QString::null, 0, this, 0 ); 758 a = new QAction( tr( "Do Reg" ), geticon( "enter" ), QString::null, 0, this, 0 );
759 connect( a, SIGNAL( activated() ), this, SLOT( do_regaction() ) ); 759 connect( a, SIGNAL( activated() ), this, SLOT( do_regaction() ) );
760 a->addTo( regBar ); 760 a->addTo( regBar );
761 761
762 a = new QAction( tr( "Close Edit" ), geticon( "close" ), QString::null, 0, this, 0 ); 762 a = new QAction( tr( "Close Edit" ), geticon( "close" ), QString::null, 0, this, 0 );
763 connect( a, SIGNAL( activated() ), this, SLOT( regClose() ) ); 763 connect( a, SIGNAL( activated() ), this, SLOT( regClose() ) );
764 a->addTo( regBar ); 764 a->addTo( regBar );
765 765
766 regBar->hide(); 766 regBar->hide();
767 767
768 m_fontBar = new QToolBar( "Autogen", this, QMainWindow::Top, TRUE ); 768 m_fontBar = new QToolBar( "Autogen", this, QMainWindow::Top, TRUE );
769 769
770 m_fontBar->setHorizontalStretchable( TRUE ); 770 m_fontBar->setHorizontalStretchable( TRUE );
771 771
772// qDebug("Font selector"); 772// qDebug("Font selector");
773 m_fontSelector = new QComboBox(false, m_fontBar); 773 m_fontSelector = new QComboBox(false, m_fontBar);
774 m_fontBar->setStretchableWidget( m_fontSelector ); 774 m_fontBar->setStretchableWidget( m_fontSelector );
775 { 775 {
776#ifndef USEQPE 776#ifndef USEQPE
777 QFontDatabase f; 777 QFontDatabase f;
778#else 778#else
779 FontDatabase f; 779 FontDatabase f;
780#endif 780#endif
781 QStringList flist = f.families(); 781 QStringList flist = f.families();
782 bool realfont = false; 782 bool realfont = false;
783 for (QStringList::Iterator nm = flist.begin(); nm != flist.end(); nm++) 783 for (QStringList::Iterator nm = flist.begin(); nm != flist.end(); nm++)
784 { 784 {
785 if (reader->m_fontname == *nm) 785 if (reader->m_fontname == *nm)
786 { 786 {
787 realfont = true; 787 realfont = true;
788 } 788 }
789 if ((*nm).contains(FIXEDFONT,false)) reader->m_fontControl.hasCourier(true, *nm); 789 if ((*nm).contains(FIXEDFONT,false)) reader->m_fontControl.hasCourier(true, *nm);
790 } 790 }
791 if (!realfont) reader->m_fontname = flist[0]; 791 if (!realfont) reader->m_fontname = flist[0];
792 } // delete the FontDatabase!!! 792 } // delete the FontDatabase!!!
793 connect( m_fontSelector, SIGNAL( activated(const QString& ) ), 793 connect( m_fontSelector, SIGNAL( activated(const QString&) ),
794 this, SLOT( do_setfont(const QString&) ) ); 794 this, SLOT( do_setfont(const QString&) ) );
795 connect( m_fontSelector, SIGNAL( activated(int ) ), 795 connect( m_fontSelector, SIGNAL( activated(int) ),
796 this, SLOT( do_setencoding(int) ) ); 796 this, SLOT( do_setencoding(int) ) );
797 797
798 m_fontBar->hide(); 798 m_fontBar->hide();
799 m_fontVisible = false; 799 m_fontVisible = false;
800#ifdef USEMSGS 800#ifdef USEMSGS
801 connect(qApp, SIGNAL( appMessage(const QCString&, const QByteArray& ) ), 801 connect(qApp, SIGNAL( appMessage(const QCString&,const QByteArray&) ),
802 this, SLOT( msgHandler(const QCString&, const QByteArray&) ) ); 802 this, SLOT( msgHandler(const QCString&,const QByteArray&) ) );
803#endif 803#endif
804// qDebug("Initing"); 804// qDebug("Initing");
805 reader->init(); 805 reader->init();
806// qDebug("Inited"); 806// qDebug("Inited");
807// m_buttonAction[m_spaceTarget]->setOn(true); 807// m_buttonAction[m_spaceTarget]->setOn(true);
808// qDebug("fonting"); 808// qDebug("fonting");
809 do_setfont(reader->m_fontname); 809 do_setfont(reader->m_fontname);
810 if (!reader->m_lastfile.isEmpty()) 810 if (!reader->m_lastfile.isEmpty())
811 { 811 {
812 //qDebug("doclnk"); 812 //qDebug("doclnk");
813 //doc = new DocLnk(reader->m_lastfile); 813 //doc = new DocLnk(reader->m_lastfile);
814 //qDebug("doclnk done"); 814 //qDebug("doclnk done");
815 if (pOpenlist != NULL) 815 if (pOpenlist != NULL)
816 { 816 {
817 817
818/* 818/*
819 int ind = 0; 819 int ind = 0;
820 Bkmk* p = (*pOpenlist)[ind]; 820 Bkmk* p = (*pOpenlist)[ind];
821 while (p != NULL && toQString(CFiledata(p->anno()).name()) != reader->m_lastfile) 821 while (p != NULL && toQString(CFiledata(p->anno()).name()) != reader->m_lastfile)
822 { 822 {
823 p = (*pOpenlist)[++ind]; 823 p = (*pOpenlist)[++ind];
824 } 824 }
825*/ 825*/
826 Bkmk* p = NULL; 826 Bkmk* p = NULL;
827 for (CList<Bkmk>::iterator iter = pOpenlist->begin(); iter != pOpenlist->end(); iter++) 827 for (CList<Bkmk>::iterator iter = pOpenlist->begin(); iter != pOpenlist->end(); iter++)
828 { 828 {
829 p = iter.pContent(); 829 p = iter.pContent();
830 if (toQString(CFiledata(p->anno()).name()) == reader->m_lastfile) 830 if (toQString(CFiledata(p->anno()).name()) == reader->m_lastfile)
831 { 831 {
832 break; 832 break;
833 } 833 }
834 // qDebug("Item:%s", (const char*)toQString(CFiledata(p->anno()).name())); 834 // qDebug("Item:%s", (const char*)toQString(CFiledata(p->anno()).name()));
835 p = NULL; 835 p = NULL;
836 } 836 }
837 if (p != NULL) 837 if (p != NULL)
838 { 838 {
839 //qDebug("openfrombkmk"); 839 //qDebug("openfrombkmk");
840 if (!openfrombkmk(p)) 840 if (!openfrombkmk(p))
841 showEditTools(); 841 showEditTools();
842 } 842 }
843 else 843 else
844 { 844 {
845 //qDebug("openfile"); 845 //qDebug("openfile");
846 openFile( reader->m_lastfile ); 846 openFile( reader->m_lastfile );
847 } 847 }
848 } 848 }
849 else 849 else
850 { 850 {
diff --git a/noncore/apps/opie-reader/fileBrowser.cpp b/noncore/apps/opie-reader/fileBrowser.cpp
index ebd14f3..e1cde6c 100644
--- a/noncore/apps/opie-reader/fileBrowser.cpp
+++ b/noncore/apps/opie-reader/fileBrowser.cpp
@@ -29,100 +29,100 @@ fileBrowser::fileBrowser( bool allownew, QWidget* parent, const char* name, boo
29 filterspec(QDir::All) 29 filterspec(QDir::All)
30{ 30{
31// showMaximized(); 31// showMaximized();
32 if ( !name ) 32 if ( !name )
33 setName( "fileBrowser" ); 33 setName( "fileBrowser" );
34/* 34/*
35 if (parent != NULL) 35 if (parent != NULL)
36 { 36 {
37#ifdef OPIE 37#ifdef OPIE
38 move(0,0); 38 move(0,0);
39 resize( parent->width(), parent->height() ); 39 resize( parent->width(), parent->height() );
40#else 40#else
41 setGeometry(parent->x(), parent->y(), parent->width(), parent->height() ); 41 setGeometry(parent->x(), parent->y(), parent->width(), parent->height() );
42#endif 42#endif
43 } 43 }
44*/ 44*/
45// showFullScreen(); 45// showFullScreen();
46 setCaption(tr( "Browse for file" ) ); 46 setCaption(tr( "Browse for file" ) );
47 filterStr=filter; 47 filterStr=filter;
48 48
49 buttonOk = new QPushButton( this, "buttonOk" ); 49 buttonOk = new QPushButton( this, "buttonOk" );
50 buttonOk->setFixedSize( 25, 25 ); 50 buttonOk->setFixedSize( 25, 25 );
51 buttonOk->setAutoDefault( false ); 51 buttonOk->setAutoDefault( false );
52 buttonOk->setText( tr( "/" ) ); 52 buttonOk->setText( tr( "/" ) );
53 53
54 buttonShowHidden = new QPushButton( this, "buttonShowHidden" ); 54 buttonShowHidden = new QPushButton( this, "buttonShowHidden" );
55// buttonShowHidden->setFixedSize( 50, 25 ); 55// buttonShowHidden->setFixedSize( 50, 25 );
56 buttonShowHidden->setText( tr( "Hidden" ) ); 56 buttonShowHidden->setText( tr( "Hidden" ) );
57 buttonShowHidden->setAutoDefault( false ); 57 buttonShowHidden->setAutoDefault( false );
58 buttonShowHidden->setToggleButton( true ); 58 buttonShowHidden->setToggleButton( true );
59 buttonShowHidden->setOn( false ); 59 buttonShowHidden->setOn( false );
60 60
61 dirLabel = new QLabel(this, "DirLabel"); 61 dirLabel = new QLabel(this, "DirLabel");
62 dirLabel->setAlignment(AlignLeft | AlignVCenter | ExpandTabs | WordBreak); 62 dirLabel->setAlignment(AlignLeft | AlignVCenter | ExpandTabs | WordBreak);
63 dirLabel->setText(currentDir.canonicalPath()); 63 dirLabel->setText(currentDir.canonicalPath());
64 64
65 ListView = new QtrListView( this, "ListView" ); 65 ListView = new QtrListView( this, "ListView" );
66 ListView->addColumn( tr( "Name" ) ); 66 ListView->addColumn( tr( "Name" ) );
67 ListView->setSorting( 2, FALSE); 67 ListView->setSorting( 2, FALSE);
68 ListView->addColumn( tr( "Size" ) ); 68 ListView->addColumn( tr( "Size" ) );
69 ListView->setSelectionMode(QListView::Single); 69 ListView->setSelectionMode(QListView::Single);
70 ListView->setAllColumnsShowFocus( TRUE ); 70 ListView->setAllColumnsShowFocus( TRUE );
71 ListView->setColumnWidthMode(0, QListView::Manual); 71 ListView->setColumnWidthMode(0, QListView::Manual);
72 ListView->setColumnWidthMode(1, QListView::Manual); 72 ListView->setColumnWidthMode(1, QListView::Manual);
73 73
74 // signals and slots connections 74 // signals and slots connections
75 connect( buttonShowHidden, SIGNAL( toggled(bool) ), this, SLOT( setHidden(bool) ) ); 75 connect( buttonShowHidden, SIGNAL( toggled(bool) ), this, SLOT( setHidden(bool) ) );
76 connect( buttonOk, SIGNAL( clicked() ), this, SLOT( OnRoot() ) ); 76 connect( buttonOk, SIGNAL( clicked() ), this, SLOT( OnRoot() ) );
77 connect( ListView, SIGNAL(doubleClicked( QListViewItem*)), SLOT(listDoubleClicked(QListViewItem *)) ); 77 connect( ListView, SIGNAL(doubleClicked(QListViewItem*)), SLOT(listDoubleClicked(QListViewItem*)) );
78 connect( ListView, SIGNAL(clicked( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); 78 connect( ListView, SIGNAL(clicked(QListViewItem*)), SLOT(listClicked(QListViewItem*)) );
79 connect( ListView, SIGNAL(OnOKButton( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); 79 connect( ListView, SIGNAL(OnOKButton(QListViewItem*)), SLOT(listClicked(QListViewItem*)) );
80 connect( ListView, SIGNAL(OnCentreButton( QListViewItem*)), SLOT(listClicked(QListViewItem *)) ); 80 connect( ListView, SIGNAL(OnCentreButton(QListViewItem*)), SLOT(listClicked(QListViewItem*)) );
81 connect( ListView, SIGNAL(OnCancelButton()), SLOT(OnCancel()) ); 81 connect( ListView, SIGNAL(OnCancelButton()), SLOT(OnCancel()) );
82 82
83 QVBoxLayout* grid = new QVBoxLayout(this); 83 QVBoxLayout* grid = new QVBoxLayout(this);
84 QHBoxLayout* hgrid = new QHBoxLayout(grid); 84 QHBoxLayout* hgrid = new QHBoxLayout(grid);
85 hgrid->addWidget(dirLabel,1); 85 hgrid->addWidget(dirLabel,1);
86 hgrid->addWidget(buttonShowHidden); 86 hgrid->addWidget(buttonShowHidden);
87 hgrid->addWidget(buttonOk); 87 hgrid->addWidget(buttonOk);
88 grid->addWidget(ListView,1); 88 grid->addWidget(ListView,1);
89 if (allownew) 89 if (allownew)
90 { 90 {
91 m_filename = new QLineEdit(this); 91 m_filename = new QLineEdit(this);
92 grid->addWidget(m_filename); 92 grid->addWidget(m_filename);
93 connect( m_filename, SIGNAL( returnPressed() ), this, SLOT( onReturn() )); 93 connect( m_filename, SIGNAL( returnPressed() ), this, SLOT( onReturn() ));
94 } 94 }
95 else 95 else
96 { 96 {
97 m_filename = NULL; 97 m_filename = NULL;
98 } 98 }
99 99
100 if (QFileInfo(iPath).exists()) 100 if (QFileInfo(iPath).exists())
101 { 101 {
102 currentDir.setPath(iPath); 102 currentDir.setPath(iPath);
103#ifdef _WINDOWS 103#ifdef _WINDOWS
104 _chdir(iPath.latin1()); 104 _chdir(iPath.latin1());
105#else 105#else
106 chdir(iPath.latin1()); 106 chdir(iPath.latin1());
107#endif 107#endif
108 } 108 }
109 else 109 else
110 { 110 {
111 currentDir.setPath(QDir::currentDirPath()); 111 currentDir.setPath(QDir::currentDirPath());
112 chdir(QDir::currentDirPath().latin1()); 112 chdir(QDir::currentDirPath().latin1());
113 } 113 }
114 114
115 populateList(); 115 populateList();
116 116
117 if (modal) 117 if (modal)
118 QPEApplication::showDialog( this ); 118 QPEApplication::showDialog( this );
119} 119}
120 120
121void fileBrowser::resizeEvent(QResizeEvent* e) 121void fileBrowser::resizeEvent(QResizeEvent* e)
122{ 122{
123 ListView->setColumnWidth(1,(ListView->width())/4); 123 ListView->setColumnWidth(1,(ListView->width())/4);
124 ListView->setColumnWidth(0,ListView->width()-20-ListView->columnWidth(1)); 124 ListView->setColumnWidth(0,ListView->width()-20-ListView->columnWidth(1));
125} 125}
126 126
127fileBrowser::~fileBrowser() 127fileBrowser::~fileBrowser()
128{ 128{
diff --git a/noncore/apps/opie-sheet/mainwindow.cpp b/noncore/apps/opie-sheet/mainwindow.cpp
index 1fb2a3d..061748e 100644
--- a/noncore/apps/opie-sheet/mainwindow.cpp
+++ b/noncore/apps/opie-sheet/mainwindow.cpp
@@ -1,94 +1,94 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * This program is free software; you can redistribute it and/or modify * 3 * This program is free software; you can redistribute it and/or modify *
4 * it under the terms of the GNU General Public License as published by * 4 * it under the terms of the GNU General Public License as published by *
5 * the Free Software Foundation; either version 2 of the License, or * 5 * the Free Software Foundation; either version 2 of the License, or *
6 * (at your option) any later version. * 6 * (at your option) any later version. *
7 * * 7 * *
8 ***************************************************************************/ 8 ***************************************************************************/
9 9
10/* 10/*
11 * Opie Sheet (formerly Sheet/Qt) 11 * Opie Sheet (formerly Sheet/Qt)
12 * by Serdar Ozler <sozler@sitebest.com> 12 * by Serdar Ozler <sozler@sitebest.com>
13 */ 13 */
14 14
15#include "mainwindow.h" 15#include "mainwindow.h"
16 16
17#include <qpe/resource.h> 17#include <qpe/resource.h>
18#include <qpe/qpeapplication.h> 18#include <qpe/qpeapplication.h>
19 19
20#include <qmessagebox.h> 20#include <qmessagebox.h>
21#include <qradiobutton.h> 21#include <qradiobutton.h>
22 22
23#include "cellformat.h" 23#include "cellformat.h"
24#include "numberdlg.h" 24#include "numberdlg.h"
25#include "textdlg.h" 25#include "textdlg.h"
26#include "sortdlg.h" 26#include "sortdlg.h"
27#include "finddlg.h" 27#include "finddlg.h"
28 28
29#define DEFAULT_NUM_ROWS 300 29#define DEFAULT_NUM_ROWS 300
30#define DEFAULT_NUM_COLS (26*3) 30#define DEFAULT_NUM_COLS (26*3)
31#define DEFAULT_NUM_SHEETS 3 31#define DEFAULT_NUM_SHEETS 3
32 32
33MainWindow::MainWindow(QWidget *parent, const char* n, WFlags fl) 33MainWindow::MainWindow(QWidget *parent, const char* n, WFlags fl)
34 :QMainWindow(parent, n, fl) 34 :QMainWindow(parent, n, fl)
35{ 35{
36 // initialize variables 36 // initialize variables
37 documentModified=FALSE; 37 documentModified=FALSE;
38 38
39 // construct objects 39 // construct objects
40 currentDoc=0; 40 currentDoc=0;
41 fileSelector=new FileSelector("application/sheet-qt", this, QString::null); 41 fileSelector=new FileSelector("application/sheet-qt", this, QString::null);
42 ExcelSelector=new FileSelector("application/excel",this,QString::null,FALSE); 42 ExcelSelector=new FileSelector("application/excel",this,QString::null,FALSE);
43 connect(fileSelector, SIGNAL(closeMe()), this, SLOT(selectorHide())); 43 connect(fileSelector, SIGNAL(closeMe()), this, SLOT(selectorHide()));
44 connect(fileSelector, SIGNAL(newSelected(const DocLnk &)), this, SLOT(selectorFileNew(const DocLnk &))); 44 connect(fileSelector, SIGNAL(newSelected(const DocLnk&)), this, SLOT(selectorFileNew(const DocLnk&)));
45 connect(fileSelector, SIGNAL(fileSelected(const DocLnk &)), this, SLOT(selectorFileOpen(const DocLnk &))); 45 connect(fileSelector, SIGNAL(fileSelected(const DocLnk&)), this, SLOT(selectorFileOpen(const DocLnk&)));
46 connect(ExcelSelector,SIGNAL(fileSelected(const DocLnk &)),this,SLOT(slotImportExcel(const DocLnk &))); 46 connect(ExcelSelector,SIGNAL(fileSelected(const DocLnk&)),this,SLOT(slotImportExcel(const DocLnk&)));
47 connect(ExcelSelector,SIGNAL(closeMe()), this, SLOT(ExcelSelectorHide())); 47 connect(ExcelSelector,SIGNAL(closeMe()), this, SLOT(ExcelSelectorHide()));
48 48
49 49
50 listSheets.setAutoDelete(TRUE); 50 listSheets.setAutoDelete(TRUE);
51 51
52 initActions(); 52 initActions();
53 initMenu(); 53 initMenu();
54 initEditToolbar(); 54 initEditToolbar();
55 initFunctionsToolbar(); 55 initFunctionsToolbar();
56 initStandardToolbar(); 56 initStandardToolbar();
57 initSheet(); 57 initSheet();
58 58
59 // set window title 59 // set window title
60 setCaption(tr("Opie Sheet")); 60 setCaption(tr("Opie Sheet"));
61 61
62 // create sheets 62 // create sheets
63 selectorFileNew(DocLnk()); 63 selectorFileNew(DocLnk());
64} 64}
65 65
66MainWindow::~MainWindow() 66MainWindow::~MainWindow()
67{ 67{
68 if (currentDoc) delete currentDoc; 68 if (currentDoc) delete currentDoc;
69} 69}
70 70
71void MainWindow::documentSave(DocLnk *lnkDoc) 71void MainWindow::documentSave(DocLnk *lnkDoc)
72{ 72{
73 FileManager fm; 73 FileManager fm;
74 QByteArray streamBuffer; 74 QByteArray streamBuffer;
75 QDataStream stream(streamBuffer, IO_WriteOnly); 75 QDataStream stream(streamBuffer, IO_WriteOnly);
76 76
77 typeSheet *currentSheet=findSheet(sheet->getName()); 77 typeSheet *currentSheet=findSheet(sheet->getName());
78 if (!currentSheet) 78 if (!currentSheet)
79 { 79 {
80 QMessageBox::critical(this, tr("Error"), tr("Inconsistency error!")); 80 QMessageBox::critical(this, tr("Error"), tr("Inconsistency error!"));
81 return; 81 return;
82 } 82 }
83 sheet->copySheetData(&currentSheet->data); 83 sheet->copySheetData(&currentSheet->data);
84 stream.writeRawBytes("SQT100", 6); 84 stream.writeRawBytes("SQT100", 6);
85 stream << (Q_UINT32)listSheets.count(); 85 stream << (Q_UINT32)listSheets.count();
86 for (typeSheet *tempSheet=listSheets.first(); tempSheet; tempSheet=listSheets.next()) 86 for (typeSheet *tempSheet=listSheets.first(); tempSheet; tempSheet=listSheets.next())
87 { 87 {
88 stream << tempSheet->name << (Q_UINT32)tempSheet->data.count(); 88 stream << tempSheet->name << (Q_UINT32)tempSheet->data.count();
89 for (typeCellData *tempCell=tempSheet->data.first(); tempCell; tempCell=tempSheet->data.next()) 89 for (typeCellData *tempCell=tempSheet->data.first(); tempCell; tempCell=tempSheet->data.next())
90 stream << (Q_UINT32)tempCell->col << (Q_UINT32)tempCell->row << tempCell->borders.right << tempCell->borders.bottom << tempCell->background << (Q_UINT32)tempCell->alignment << tempCell->fontColor << tempCell->font << tempCell->data; 90 stream << (Q_UINT32)tempCell->col << (Q_UINT32)tempCell->row << tempCell->borders.right << tempCell->borders.bottom << tempCell->background << (Q_UINT32)tempCell->alignment << tempCell->fontColor << tempCell->font << tempCell->data;
91 } 91 }
92 92
93 lnkDoc->setType("application/sheet-qt"); 93 lnkDoc->setType("application/sheet-qt");
94 if (!fm.saveFile(*lnkDoc, streamBuffer)) 94 if (!fm.saveFile(*lnkDoc, streamBuffer))
@@ -535,157 +535,157 @@ void MainWindow::initMenu()
535 submenuFunc->insertItem(tr("Sta&tistical"), submenuFuncStat); 535 submenuFunc->insertItem(tr("Sta&tistical"), submenuFuncStat);
536 536
537 submenuFuncScientific=new QPopupMenu; 537 submenuFuncScientific=new QPopupMenu;
538 addFlyAction(tr("BESSELI(x,n)"), tr("BESSELI(x,n)"), "BESSELI(",submenuFuncScientific); 538 addFlyAction(tr("BESSELI(x,n)"), tr("BESSELI(x,n)"), "BESSELI(",submenuFuncScientific);
539 addFlyAction(tr("BESSELJ(x,n)"), tr("BESSELJ(x,n)"), "BESSELJ(",submenuFuncScientific); 539 addFlyAction(tr("BESSELJ(x,n)"), tr("BESSELJ(x,n)"), "BESSELJ(",submenuFuncScientific);
540 addFlyAction(tr("BESSELK(x,n)"), tr("BESSELK(x,n)"), "BESSELK(",submenuFuncScientific); 540 addFlyAction(tr("BESSELK(x,n)"), tr("BESSELK(x,n)"), "BESSELK(",submenuFuncScientific);
541 addFlyAction(tr("BESSELY(x,n)"), tr("BESSELY(x,n)"), "BESSELY(",submenuFuncScientific); 541 addFlyAction(tr("BESSELY(x,n)"), tr("BESSELY(x,n)"), "BESSELY(",submenuFuncScientific);
542 submenuFuncScientific->insertSeparator(); 542 submenuFuncScientific->insertSeparator();
543 addFlyAction(tr("BETAI(x,a,b)"), tr("BETAI(x,a,b)"), "BETAI(",submenuFuncScientific); 543 addFlyAction(tr("BETAI(x,a,b)"), tr("BETAI(x,a,b)"), "BETAI(",submenuFuncScientific);
544 addFlyAction(tr("ERF(a,b)"), tr("ERF(a,b)"), "ERF(",submenuFuncScientific); 544 addFlyAction(tr("ERF(a,b)"), tr("ERF(a,b)"), "ERF(",submenuFuncScientific);
545 addFlyAction(tr("ERFC(a,b)"), tr("ERFC(a,b)"), "ERFC(",submenuFuncScientific); 545 addFlyAction(tr("ERFC(a,b)"), tr("ERFC(a,b)"), "ERFC(",submenuFuncScientific);
546 addFlyAction(tr("GAMMALN(x)"), tr("GAMMALN(x)"), "GAMMALN(",submenuFuncScientific); 546 addFlyAction(tr("GAMMALN(x)"), tr("GAMMALN(x)"), "GAMMALN(",submenuFuncScientific);
547 addFlyAction(tr("GAMMAP(x,a)"), tr("GAMMAP(x,a)"), "GAMMAP(",submenuFuncScientific); 547 addFlyAction(tr("GAMMAP(x,a)"), tr("GAMMAP(x,a)"), "GAMMAP(",submenuFuncScientific);
548 addFlyAction(tr("GAMMAQ(x,a)"), tr("GAMMAQ(x,a)"), "GAMMAQ(",submenuFuncScientific); 548 addFlyAction(tr("GAMMAQ(x,a)"), tr("GAMMAQ(x,a)"), "GAMMAQ(",submenuFuncScientific);
549 submenuFunc->insertItem(tr("Scienti&fic"), submenuFuncScientific); 549 submenuFunc->insertItem(tr("Scienti&fic"), submenuFuncScientific);
550 550
551 submenuFuncDistr=new QPopupMenu; 551 submenuFuncDistr=new QPopupMenu;
552 addFlyAction(tr("BETADIST(z,a,b,Q?)"), tr("BETADIST(z,a,b,Q?)"), "BETADIST(",submenuFuncDistr); 552 addFlyAction(tr("BETADIST(z,a,b,Q?)"), tr("BETADIST(z,a,b,Q?)"), "BETADIST(",submenuFuncDistr);
553 addFlyAction(tr("CHI2DIST(x,n,Q?)"), tr("CHI2DIST(x,n,Q?)"), "CHI2DIST(",submenuFuncDistr); 553 addFlyAction(tr("CHI2DIST(x,n,Q?)"), tr("CHI2DIST(x,n,Q?)"), "CHI2DIST(",submenuFuncDistr);
554 addFlyAction(tr("CHIDIST(x,n,Q?)"), tr("CHIDIST(x,n,Q?)"), "CHIDIST(",submenuFuncDistr); 554 addFlyAction(tr("CHIDIST(x,n,Q?)"), tr("CHIDIST(x,n,Q?)"), "CHIDIST(",submenuFuncDistr);
555 addFlyAction(tr("FDIST(z,deg1,deg2,Q?)"), tr("FDIST(z,deg1,deg2,Q?)"), "FDIST(",submenuFuncDistr); 555 addFlyAction(tr("FDIST(z,deg1,deg2,Q?)"), tr("FDIST(z,deg1,deg2,Q?)"), "FDIST(",submenuFuncDistr);
556 addFlyAction(tr("GAMMADIST(x,a,b,Q?)"), tr("GAMMADIST(x,a,b,Q?)"), "GAMMADIST(",submenuFuncDistr); 556 addFlyAction(tr("GAMMADIST(x,a,b,Q?)"), tr("GAMMADIST(x,a,b,Q?)"), "GAMMADIST(",submenuFuncDistr);
557 addFlyAction(tr("NORMALDIST(x,m,s,Q?)"), tr("NORMALDIST(x,m,s,Q?)"), "NORMALDIST(",submenuFuncDistr); 557 addFlyAction(tr("NORMALDIST(x,m,s,Q?)"), tr("NORMALDIST(x,m,s,Q?)"), "NORMALDIST(",submenuFuncDistr);
558 addFlyAction(tr("PHI(x,Q?)"), tr("PHI(x,Q?)"), "PHI(",submenuFuncDistr); 558 addFlyAction(tr("PHI(x,Q?)"), tr("PHI(x,Q?)"), "PHI(",submenuFuncDistr);
559 addFlyAction(tr("POISSON(x,n,Q?)"), tr("POISSON(x,n,Q?)"), "POISSON(",submenuFuncDistr); 559 addFlyAction(tr("POISSON(x,n,Q?)"), tr("POISSON(x,n,Q?)"), "POISSON(",submenuFuncDistr);
560 submenuFunc->insertItem(tr("&Distributions"), submenuFuncDistr); 560 submenuFunc->insertItem(tr("&Distributions"), submenuFuncDistr);
561 561
562 562
563 563
564 menuInsert->insertSeparator(); 564 menuInsert->insertSeparator();
565 insertCells->addTo(menuInsert); 565 insertCells->addTo(menuInsert);
566 insertRows->addTo(menuInsert); 566 insertRows->addTo(menuInsert);
567 insertCols->addTo(menuInsert); 567 insertCols->addTo(menuInsert);
568 insertSheets->addTo(menuInsert); 568 insertSheets->addTo(menuInsert);
569} 569}
570 570
571void MainWindow::initStandardToolbar() 571void MainWindow::initStandardToolbar()
572{ 572{
573 toolbarStandard=new QToolBar(this); 573 toolbarStandard=new QToolBar(this);
574 toolbarStandard->setHorizontalStretchable(TRUE); 574 toolbarStandard->setHorizontalStretchable(TRUE);
575 moveToolBar(toolbarStandard, Top); 575 moveToolBar(toolbarStandard, Top);
576 576
577 fileNew->addTo(toolbarStandard); 577 fileNew->addTo(toolbarStandard);
578 fileOpen->addTo(toolbarStandard); 578 fileOpen->addTo(toolbarStandard);
579 fileSave->addTo(toolbarStandard); 579 fileSave->addTo(toolbarStandard);
580 580
581 comboSheets=new QComboBox(toolbarStandard); 581 comboSheets=new QComboBox(toolbarStandard);
582 toolbarStandard->setStretchableWidget(comboSheets); 582 toolbarStandard->setStretchableWidget(comboSheets);
583 connect(comboSheets, SIGNAL(activated(const QString &)), this, SLOT(slotSheetChanged(const QString &))); 583 connect(comboSheets, SIGNAL(activated(const QString&)), this, SLOT(slotSheetChanged(const QString&)));
584} 584}
585 585
586void MainWindow::initFunctionsToolbar() 586void MainWindow::initFunctionsToolbar()
587{ 587{
588 toolbarFunctions=new QToolBar(this); 588 toolbarFunctions=new QToolBar(this);
589 toolbarFunctions->setHorizontalStretchable(TRUE); 589 toolbarFunctions->setHorizontalStretchable(TRUE);
590 moveToolBar(toolbarFunctions, Bottom); 590 moveToolBar(toolbarFunctions, Bottom);
591 591
592 funcEqual->addTo(toolbarFunctions); 592 funcEqual->addTo(toolbarFunctions);
593 funcPlus->addTo(toolbarFunctions); 593 funcPlus->addTo(toolbarFunctions);
594 funcMinus->addTo(toolbarFunctions); 594 funcMinus->addTo(toolbarFunctions);
595 funcCross->addTo(toolbarFunctions); 595 funcCross->addTo(toolbarFunctions);
596 funcDivide->addTo(toolbarFunctions); 596 funcDivide->addTo(toolbarFunctions);
597 funcParanOpen->addTo(toolbarFunctions); 597 funcParanOpen->addTo(toolbarFunctions);
598 funcParanClose->addTo(toolbarFunctions); 598 funcParanClose->addTo(toolbarFunctions);
599 funcComma->addTo(toolbarFunctions); 599 funcComma->addTo(toolbarFunctions);
600 600
601 toolFunction=new QToolButton(toolbarFunctions); 601 toolFunction=new QToolButton(toolbarFunctions);
602 toolFunction->setPixmap(Resource::loadPixmap( "opie-sheet/func-func" )); 602 toolFunction->setPixmap(Resource::loadPixmap( "opie-sheet/func-func" ));
603 toolFunction->setTextLabel(tr("Functions")); 603 toolFunction->setTextLabel(tr("Functions"));
604 toolFunction->setPopup(submenuFunc); 604 toolFunction->setPopup(submenuFunc);
605 toolFunction->setPopupDelay(0); 605 toolFunction->setPopupDelay(0);
606} 606}
607 607
608void MainWindow::initEditToolbar() 608void MainWindow::initEditToolbar()
609{ 609{
610 toolbarEdit=new QToolBar(this); 610 toolbarEdit=new QToolBar(this);
611 toolbarEdit->setHorizontalStretchable(TRUE); 611 toolbarEdit->setHorizontalStretchable(TRUE);
612 moveToolBar(toolbarEdit, Bottom); 612 moveToolBar(toolbarEdit, Bottom);
613 613
614 editAccept->addTo(toolbarEdit); 614 editAccept->addTo(toolbarEdit);
615 editCancel->addTo(toolbarEdit); 615 editCancel->addTo(toolbarEdit);
616 616
617 editData=new QLineEdit(toolbarEdit); 617 editData=new QLineEdit(toolbarEdit);
618 toolbarEdit->setStretchableWidget(editData); 618 toolbarEdit->setStretchableWidget(editData);
619 connect(editData, SIGNAL(returnPressed()), this, SLOT(slotEditAccept())); 619 connect(editData, SIGNAL(returnPressed()), this, SLOT(slotEditAccept()));
620 620
621 editCellSelect->addTo(toolbarEdit); 621 editCellSelect->addTo(toolbarEdit);
622} 622}
623 623
624void MainWindow::slotHelpAbout() 624void MainWindow::slotHelpAbout()
625{ 625{
626 QDialog dialogAbout(this, 0, TRUE); 626 QDialog dialogAbout(this, 0, TRUE);
627 dialogAbout.resize(width()-40, height()-80); 627 dialogAbout.resize(width()-40, height()-80);
628 dialogAbout.setCaption(tr("About Opie Sheet")); 628 dialogAbout.setCaption(tr("About Opie Sheet"));
629 629
630 QLabel label(tr("Opie Sheet\nSpreadsheet Software for Opie\nQWDC Beta Winner (as Sheet/Qt)\n\nDeveloped by: Serdar Ozler\nRelease 1.0.2\nRelease Date: October 08, 2002\n\nThis product is licensed under GPL. It is freely distributable. If you want to get the latest version and also the source code, please visit the web site.\n\nhttp://qtopia.sitebest.com"), &dialogAbout); 630 QLabel label(tr("Opie Sheet\nSpreadsheet Software for Opie\nQWDC Beta Winner (as Sheet/Qt)\n\nDeveloped by: Serdar Ozler\nRelease 1.0.2\nRelease Date: October 08, 2002\n\nThis product is licensed under GPL. It is freely distributable. If you want to get the latest version and also the source code, please visit the web site.\n\nhttp://qtopia.sitebest.com"), &dialogAbout);
631 label.setGeometry(dialogAbout.rect()); 631 label.setGeometry(dialogAbout.rect());
632 label.setAlignment(Qt::AlignCenter | Qt::WordBreak); 632 label.setAlignment(Qt::AlignCenter | Qt::WordBreak);
633 633
634 dialogAbout.exec(); 634 dialogAbout.exec();
635} 635}
636 636
637void MainWindow::initSheet() 637void MainWindow::initSheet()
638{ 638{
639 sheet=new Sheet(DEFAULT_NUM_ROWS, DEFAULT_NUM_COLS, this); 639 sheet=new Sheet(DEFAULT_NUM_ROWS, DEFAULT_NUM_COLS, this);
640 setCentralWidget(sheet); 640 setCentralWidget(sheet);
641 641
642 connect(sheet, SIGNAL(currentDataChanged(const QString &)), editData, SLOT(setText(const QString &))); 642 connect(sheet, SIGNAL(currentDataChanged(const QString&)), editData, SLOT(setText(const QString&)));
643 connect(sheet, SIGNAL(cellClicked(const QString &)), this, SLOT(slotCellClicked(const QString &))); 643 connect(sheet, SIGNAL(cellClicked(const QString&)), this, SLOT(slotCellClicked(const QString&)));
644 connect(sheet, SIGNAL(sheetModified()), this, SLOT(slotDocModified())); 644 connect(sheet, SIGNAL(sheetModified()), this, SLOT(slotDocModified()));
645 645
646 connect(editCut, SIGNAL(activated()), sheet, SLOT(editCut())); 646 connect(editCut, SIGNAL(activated()), sheet, SLOT(editCut()));
647 connect(editCopy, SIGNAL(activated()), sheet, SLOT(editCopy())); 647 connect(editCopy, SIGNAL(activated()), sheet, SLOT(editCopy()));
648 connect(editClear, SIGNAL(activated()), sheet, SLOT(editClear())); 648 connect(editClear, SIGNAL(activated()), sheet, SLOT(editClear()));
649} 649}
650 650
651void MainWindow::slotEditAccept() 651void MainWindow::slotEditAccept()
652{ 652{
653 sheet->setData(editData->text()); 653 sheet->setData(editData->text());
654} 654}
655 655
656void MainWindow::slotEditCancel() 656void MainWindow::slotEditCancel()
657{ 657{
658 editData->setText(sheet->getData()); 658 editData->setText(sheet->getData());
659} 659}
660 660
661void MainWindow::slotCellSelect(bool lock) 661void MainWindow::slotCellSelect(bool lock)
662{ 662{
663 sheet->lockClicks(lock); 663 sheet->lockClicks(lock);
664} 664}
665 665
666void MainWindow::addToData(const QString &data) 666void MainWindow::addToData(const QString &data)
667{ 667{
668 editData->setText(editData->text().insert(editData->cursorPosition(), data)); 668 editData->setText(editData->text().insert(editData->cursorPosition(), data));
669} 669}
670 670
671void MainWindow::slotFuncOutput() 671void MainWindow::slotFuncOutput()
672{ 672{
673 if (sender()->isA("QAction")) 673 if (sender()->isA("QAction"))
674 addToData(((QAction *)sender())->toolTip()); 674 addToData(((QAction *)sender())->toolTip());
675} 675}
676 676
677void MainWindow::slotInsertRows() 677void MainWindow::slotInsertRows()
678{ 678{
679 NumberDialog dialogNumber(this); 679 NumberDialog dialogNumber(this);
680 if (dialogNumber.exec(tr("Insert Rows"), tr("&Number of rows:"))==QDialog::Accepted) 680 if (dialogNumber.exec(tr("Insert Rows"), tr("&Number of rows:"))==QDialog::Accepted)
681 sheet->insertRows(dialogNumber.getValue()); 681 sheet->insertRows(dialogNumber.getValue());
682} 682}
683 683
684void MainWindow::slotInsertCols() 684void MainWindow::slotInsertCols()
685{ 685{
686 NumberDialog dialogNumber(this); 686 NumberDialog dialogNumber(this);
687 if (dialogNumber.exec(tr("Insert Columns"), tr("&Number of columns:"))==QDialog::Accepted) 687 if (dialogNumber.exec(tr("Insert Columns"), tr("&Number of columns:"))==QDialog::Accepted)
688 sheet->insertColumns(dialogNumber.getValue()); 688 sheet->insertColumns(dialogNumber.getValue());
689} 689}
690 690
691void MainWindow::slotInsertSheets() 691void MainWindow::slotInsertSheets()
diff --git a/noncore/apps/opie-sheet/sheet.cpp b/noncore/apps/opie-sheet/sheet.cpp
index f303d33..d4419af 100644
--- a/noncore/apps/opie-sheet/sheet.cpp
+++ b/noncore/apps/opie-sheet/sheet.cpp
@@ -1,95 +1,95 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * This program is free software; you can redistribute it and/or modify * 3 * This program is free software; you can redistribute it and/or modify *
4 * it under the terms of the GNU General Public License as published by * 4 * it under the terms of the GNU General Public License as published by *
5 * the Free Software Foundation; either version 2 of the License, or * 5 * the Free Software Foundation; either version 2 of the License, or *
6 * (at your option) any later version. * 6 * (at your option) any later version. *
7 * * 7 * *
8 ***************************************************************************/ 8 ***************************************************************************/
9 9
10/* 10/*
11 * Opie Sheet (formerly Sheet/Qt) 11 * Opie Sheet (formerly Sheet/Qt)
12 * by Serdar Ozler <sozler@sitebest.com> 12 * by Serdar Ozler <sozler@sitebest.com>
13 */ 13 */
14 14
15#include "sheet.h" 15#include "sheet.h"
16 16
17#include <qmessagebox.h> 17#include <qmessagebox.h>
18#include <math.h> 18#include <math.h>
19#include <stdlib.h> 19#include <stdlib.h>
20#include <stdio.h> 20#include <stdio.h>
21#include <time.h> 21#include <time.h>
22 22
23#define DEFAULT_COL_WIDTH 50 23#define DEFAULT_COL_WIDTH 50
24 24
25Sheet::Sheet(int numRows, int numCols, QWidget *parent) 25Sheet::Sheet(int numRows, int numCols, QWidget *parent)
26 :QTable(numRows, numCols, parent) 26 :QTable(numRows, numCols, parent)
27{ 27{
28 defaultBorders.right=defaultBorders.bottom=QPen(Qt::gray, 1, Qt::SolidLine); 28 defaultBorders.right=defaultBorders.bottom=QPen(Qt::gray, 1, Qt::SolidLine);
29 defaultCellData.data=""; 29 defaultCellData.data="";
30 defaultCellData.background=QBrush(Qt::white, Qt::SolidPattern); 30 defaultCellData.background=QBrush(Qt::white, Qt::SolidPattern);
31 defaultCellData.alignment=(Qt::AlignmentFlags)(Qt::AlignLeft | Qt::AlignTop); 31 defaultCellData.alignment=(Qt::AlignmentFlags)(Qt::AlignLeft | Qt::AlignTop);
32 defaultCellData.fontColor=Qt::black; 32 defaultCellData.fontColor=Qt::black;
33 defaultCellData.font=font(); 33 defaultCellData.font=font();
34 defaultCellData.borders=defaultBorders; 34 defaultCellData.borders=defaultBorders;
35 35
36 clicksLocked=FALSE; 36 clicksLocked=FALSE;
37 selectionNo=-1; 37 selectionNo=-1;
38 setSelectionMode(QTable::Single); 38 setSelectionMode(QTable::Single);
39 39
40 sheetData.setAutoDelete(TRUE); 40 sheetData.setAutoDelete(TRUE);
41 clipboardData.setAutoDelete(TRUE); 41 clipboardData.setAutoDelete(TRUE);
42 for (int i=0; i<numCols; ++i) 42 for (int i=0; i<numCols; ++i)
43 horizontalHeader()->setLabel(i, getHeaderString(i+1), DEFAULT_COL_WIDTH); 43 horizontalHeader()->setLabel(i, getHeaderString(i+1), DEFAULT_COL_WIDTH);
44 44
45 45
46 connect(this, SIGNAL(currentChanged(int, int)), this, SLOT(slotCellSelected(int, int))); 46 connect(this, SIGNAL(currentChanged(int,int)), this, SLOT(slotCellSelected(int,int)));
47 connect(this, SIGNAL(valueChanged(int, int)), this, SLOT(slotCellChanged(int, int))); 47 connect(this, SIGNAL(valueChanged(int,int)), this, SLOT(slotCellChanged(int,int)));
48} 48}
49 49
50Sheet::~Sheet() 50Sheet::~Sheet()
51{ 51{
52} 52}
53 53
54typeCellData *Sheet::findCellData(int row, int col) 54typeCellData *Sheet::findCellData(int row, int col)
55{ 55{
56 typeCellData *tempCellData; 56 typeCellData *tempCellData;
57 for (tempCellData=sheetData.first(); tempCellData; tempCellData=sheetData.next()) 57 for (tempCellData=sheetData.first(); tempCellData; tempCellData=sheetData.next())
58 { 58 {
59 if (tempCellData->row==row && tempCellData->col==col) return tempCellData; 59 if (tempCellData->row==row && tempCellData->col==col) return tempCellData;
60 } 60 }
61 return NULL; 61 return NULL;
62} 62}
63 63
64void Sheet::slotCellSelected(int row, int col) 64void Sheet::slotCellSelected(int row, int col)
65{ 65{
66 typeCellData *cellData=findCellData(row, col); 66 typeCellData *cellData=findCellData(row, col);
67 if (cellData) 67 if (cellData)
68 { 68 {
69 emit currentDataChanged(cellData->data); 69 emit currentDataChanged(cellData->data);
70 }else 70 }else
71 emit currentDataChanged(""); 71 emit currentDataChanged("");
72} 72}
73 73
74typeCellData *Sheet::createCellData(int row, int col) 74typeCellData *Sheet::createCellData(int row, int col)
75{ 75{
76 if (row<0 || col<0) return NULL; 76 if (row<0 || col<0) return NULL;
77 typeCellData *cellData=new typeCellData; 77 typeCellData *cellData=new typeCellData;
78 cellData->row=row; 78 cellData->row=row;
79 cellData->col=col; 79 cellData->col=col;
80 cellData->data=defaultCellData.data; 80 cellData->data=defaultCellData.data;
81 cellData->borders=defaultCellData.borders; 81 cellData->borders=defaultCellData.borders;
82 cellData->alignment=defaultCellData.alignment; 82 cellData->alignment=defaultCellData.alignment;
83 cellData->font=defaultCellData.font; 83 cellData->font=defaultCellData.font;
84 cellData->fontColor=defaultCellData.fontColor; 84 cellData->fontColor=defaultCellData.fontColor;
85 cellData->background=defaultCellData.background; 85 cellData->background=defaultCellData.background;
86 sheetData.append(cellData); 86 sheetData.append(cellData);
87 return cellData; 87 return cellData;
88} 88}
89 89
90void Sheet::slotCellChanged(int row, int col) 90void Sheet::slotCellChanged(int row, int col)
91{ 91{
92 typeCellData *cellData=findCellData(row, col); 92 typeCellData *cellData=findCellData(row, col);
93 if (!cellData) cellData=createCellData(row, col); 93 if (!cellData) cellData=createCellData(row, col);
94 if (cellData) cellData->data=text(row, col); 94 if (cellData) cellData->data=text(row, col);
95 for (cellData=sheetData.first(); cellData; cellData=sheetData.next()) 95 for (cellData=sheetData.first(); cellData; cellData=sheetData.next())
diff --git a/noncore/apps/opie-write/mainwindow.cpp b/noncore/apps/opie-write/mainwindow.cpp
index 6bb524f..90e1a70 100644
--- a/noncore/apps/opie-write/mainwindow.cpp
+++ b/noncore/apps/opie-write/mainwindow.cpp
@@ -78,249 +78,249 @@ public:
78 } 78 }
79 79
80signals: 80signals:
81 void activated( int id ); 81 void activated( int id );
82 82
83protected slots: 83protected slots:
84 void selected( int id ) { 84 void selected( int id ) {
85 current = id; 85 current = id;
86 setIconSet( *popup()->iconSet( id ) ); 86 setIconSet( *popup()->iconSet( id ) );
87 emit activated( id ); 87 emit activated( id );
88 } 88 }
89 89
90protected: 90protected:
91 virtual void drawButtonLabel( QPainter *p ) { 91 virtual void drawButtonLabel( QPainter *p ) {
92 p->translate( -4, 0 ); 92 p->translate( -4, 0 );
93 QToolButton::drawButtonLabel( p ); 93 QToolButton::drawButtonLabel( p );
94 p->translate( 4, 0 ); 94 p->translate( 4, 0 );
95 } 95 }
96 96
97private: 97private:
98 int current; 98 int current;
99}; 99};
100 100
101//=========================================================================== 101//===========================================================================
102 102
103MainWindow::MainWindow( QWidget *parent, const char *name, WFlags fl ) 103MainWindow::MainWindow( QWidget *parent, const char *name, WFlags fl )
104 : QMainWindow( parent, name, fl ), 104 : QMainWindow( parent, name, fl ),
105 doc( 0 ) 105 doc( 0 )
106{ 106{
107 setRightJustification(TRUE); 107 setRightJustification(TRUE);
108 108
109 editorStack = new QWidgetStack( this ); 109 editorStack = new QWidgetStack( this );
110 110
111 fileSelector = new FileSelector( "text/html", 111 fileSelector = new FileSelector( "text/html",
112 editorStack, "fileselector" ); 112 editorStack, "fileselector" );
113 113
114 114
115 fileSelector->setCloseVisible( FALSE ); 115 fileSelector->setCloseVisible( FALSE );
116 editorStack->addWidget( fileSelector, 0 ); 116 editorStack->addWidget( fileSelector, 0 );
117 117
118 editor = new Qt3::QTextEdit( editorStack ); 118 editor = new Qt3::QTextEdit( editorStack );
119 editor->setTextFormat( Qt::RichText ); 119 editor->setTextFormat( Qt::RichText );
120 editorStack->addWidget( editor, 1 ); 120 editorStack->addWidget( editor, 1 );
121 121
122 setupActions(); 122 setupActions();
123 123
124 QObject::connect( fileSelector, SIGNAL(closeMe()), 124 QObject::connect( fileSelector, SIGNAL(closeMe()),
125 this, SLOT(showEditTools()) ); 125 this, SLOT(showEditTools()) );
126 QObject::connect( fileSelector, SIGNAL(fileSelected(const DocLnk &)), 126 QObject::connect( fileSelector, SIGNAL(fileSelected(const DocLnk&)),
127 this, SLOT(openFile(const DocLnk &)) ); 127 this, SLOT(openFile(const DocLnk&)) );
128 QObject::connect( fileSelector, SIGNAL(newSelected(const DocLnk&)), 128 QObject::connect( fileSelector, SIGNAL(newSelected(const DocLnk&)),
129 this, SLOT(newFile(const DocLnk&)) ); 129 this, SLOT(newFile(const DocLnk&)) );
130 130
131 if ( fileSelector->fileCount() < 1 ) 131 if ( fileSelector->fileCount() < 1 )
132 fileNew(); 132 fileNew();
133 else { 133 else {
134 fileOpen(); 134 fileOpen();
135 } 135 }
136 doConnections( editor ); 136 doConnections( editor );
137 137
138 setCentralWidget( editorStack ); 138 setCentralWidget( editorStack );
139} 139}
140 140
141MainWindow::~MainWindow() 141MainWindow::~MainWindow()
142{ 142{
143 save(); 143 save();
144} 144}
145 145
146void MainWindow::setupActions() 146void MainWindow::setupActions()
147{ 147{
148 setToolBarsMovable(false); 148 setToolBarsMovable(false);
149 149
150 tbMenu = new QToolBar( this ); 150 tbMenu = new QToolBar( this );
151 tbMenu->setHorizontalStretchable( TRUE ); 151 tbMenu->setHorizontalStretchable( TRUE );
152 152
153 QMenuBar *menu = new QMenuBar( tbMenu ); 153 QMenuBar *menu = new QMenuBar( tbMenu );
154 154
155 tbEdit = new QToolBar( this ); 155 tbEdit = new QToolBar( this );
156 156
157 QPopupMenu *file = new QPopupMenu( this ); 157 QPopupMenu *file = new QPopupMenu( this );
158 menu->insertItem( tr("File"), file ); 158 menu->insertItem( tr("File"), file );
159 159
160 QPopupMenu *edit = new QPopupMenu( this ); 160 QPopupMenu *edit = new QPopupMenu( this );
161 menu->insertItem( tr("Edit"), edit ); 161 menu->insertItem( tr("Edit"), edit );
162 162
163 // ### perhaps these shortcut keys should have some 163 // ### perhaps these shortcut keys should have some
164 // IPaq keys defined??? 164 // IPaq keys defined???
165 QAction *a; 165 QAction *a;
166 166
167 a = new QAction( tr( "New" ), Resource::loadPixmap("new"), QString::null, 0, this, 0 ); 167 a = new QAction( tr( "New" ), Resource::loadPixmap("new"), QString::null, 0, this, 0 );
168 connect( a, SIGNAL(activated()), this, SLOT(fileNew()) ); 168 connect( a, SIGNAL(activated()), this, SLOT(fileNew()) );
169 a->addTo( file ); 169 a->addTo( file );
170 170
171 a = new QAction( tr( "Open" ), Resource::loadPixmap( "fileopen" ), QString::null, 0, this, 0 ); 171 a = new QAction( tr( "Open" ), Resource::loadPixmap( "fileopen" ), QString::null, 0, this, 0 );
172 connect( a, SIGNAL(activated()), this, SLOT(fileOpen()) ); 172 connect( a, SIGNAL(activated()), this, SLOT(fileOpen()) );
173 a->addTo( file ); 173 a->addTo( file );
174 174
175 a = new QAction( tr( "Undo" ), Resource::loadIconSet("undo"), 175 a = new QAction( tr( "Undo" ), Resource::loadIconSet("undo"),
176 QString::null, 0, this, "editUndo" ); 176 QString::null, 0, this, "editUndo" );
177 connect( a, SIGNAL( activated() ), this, SLOT( editUndo() ) ); 177 connect( a, SIGNAL( activated() ), this, SLOT( editUndo() ) );
178 connect( editor, SIGNAL(undoAvailable(bool)), a, SLOT(setEnabled(bool)) ); 178 connect( editor, SIGNAL(undoAvailable(bool)), a, SLOT(setEnabled(bool)) );
179 a->addTo( tbEdit ); 179 a->addTo( tbEdit );
180 a->addTo( edit ); 180 a->addTo( edit );
181 a = new QAction( tr( "Redo" ), Resource::loadIconSet("redo"), 181 a = new QAction( tr( "Redo" ), Resource::loadIconSet("redo"),
182 QString::null, 0, this, "editRedo" ); 182 QString::null, 0, this, "editRedo" );
183 connect( a, SIGNAL( activated() ), this, SLOT( editRedo() ) ); 183 connect( a, SIGNAL( activated() ), this, SLOT( editRedo() ) );
184 connect( editor, SIGNAL(redoAvailable(bool)), a, SLOT(setEnabled(bool)) ); 184 connect( editor, SIGNAL(redoAvailable(bool)), a, SLOT(setEnabled(bool)) );
185 a->addTo( tbEdit ); 185 a->addTo( tbEdit );
186 a->addTo( edit ); 186 a->addTo( edit );
187 187
188 edit->insertSeparator(); 188 edit->insertSeparator();
189 189
190 a = new QAction( tr( "Copy" ), Resource::loadIconSet("copy"), 190 a = new QAction( tr( "Copy" ), Resource::loadIconSet("copy"),
191 QString::null, 0, this, "editCopy" ); 191 QString::null, 0, this, "editCopy" );
192 connect( a, SIGNAL( activated() ), this, SLOT( editCopy() ) ); 192 connect( a, SIGNAL( activated() ), this, SLOT( editCopy() ) );
193 connect( editor, SIGNAL(copyAvailable(bool)), a, SLOT(setEnabled(bool)) ); 193 connect( editor, SIGNAL(copyAvailable(bool)), a, SLOT(setEnabled(bool)) );
194 a->addTo( tbEdit ); 194 a->addTo( tbEdit );
195 a->addTo( edit ); 195 a->addTo( edit );
196 a = new QAction( tr( "Cut" ), Resource::loadIconSet("cut"), 196 a = new QAction( tr( "Cut" ), Resource::loadIconSet("cut"),
197 QString::null, 0, this, "editCut" ); 197 QString::null, 0, this, "editCut" );
198 connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) ); 198 connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) );
199 connect( editor, SIGNAL(copyAvailable(bool)), a, SLOT(setEnabled(bool)) ); 199 connect( editor, SIGNAL(copyAvailable(bool)), a, SLOT(setEnabled(bool)) );
200 a->addTo( tbEdit ); 200 a->addTo( tbEdit );
201 a->addTo( edit ); 201 a->addTo( edit );
202 a = new QAction( tr( "Paste" ), Resource::loadPixmap("paste"), 202 a = new QAction( tr( "Paste" ), Resource::loadPixmap("paste"),
203 QString::null, 0, this, "editPaste" ); 203 QString::null, 0, this, "editPaste" );
204 connect( a, SIGNAL( activated() ), this, SLOT( editPaste() ) ); 204 connect( a, SIGNAL( activated() ), this, SLOT( editPaste() ) );
205 a->addTo( tbEdit ); 205 a->addTo( tbEdit );
206 a->addTo( edit ); 206 a->addTo( edit );
207 207
208 tbFont = new QToolBar( this ); 208 tbFont = new QToolBar( this );
209 tbFont->setLabel( "Font Actions" ); 209 tbFont->setLabel( "Font Actions" );
210 tbFont->setHorizontalStretchable(TRUE); 210 tbFont->setHorizontalStretchable(TRUE);
211 211
212 comboFont = new QComboBox( FALSE, tbFont ); 212 comboFont = new QComboBox( FALSE, tbFont );
213 FontDatabase db; 213 FontDatabase db;
214 QStringList f= db.families(); 214 QStringList f= db.families();
215 comboFont->insertStringList( db.families() ); 215 comboFont->insertStringList( db.families() );
216 connect( comboFont, SIGNAL( activated( const QString & ) ), 216 connect( comboFont, SIGNAL( activated(const QString&) ),
217 this, SLOT( textFamily( const QString & ) ) ); 217 this, SLOT( textFamily(const QString&) ) );
218 comboFont->setCurrentItem( comboFont->listBox()->index( comboFont->listBox()->findItem( QApplication::font().family() ) ) ); 218 comboFont->setCurrentItem( comboFont->listBox()->index( comboFont->listBox()->findItem( QApplication::font().family() ) ) );
219 comboFont->setMaximumWidth(90); 219 comboFont->setMaximumWidth(90);
220 220
221 comboSize = new QComboBox( TRUE, tbFont ); 221 comboSize = new QComboBox( TRUE, tbFont );
222 QValueList<int> sizes = db.standardSizes(); 222 QValueList<int> sizes = db.standardSizes();
223 QValueList<int>::Iterator it = sizes.begin(); 223 QValueList<int>::Iterator it = sizes.begin();
224 for ( ; it != sizes.end(); ++it ) 224 for ( ; it != sizes.end(); ++it )
225 comboSize->insertItem( QString::number( *it ) ); 225 comboSize->insertItem( QString::number( *it ) );
226 connect( comboSize, SIGNAL( activated( const QString & ) ), 226 connect( comboSize, SIGNAL( activated(const QString&) ),
227 this, SLOT( textSize( const QString & ) ) ); 227 this, SLOT( textSize(const QString&) ) );
228 comboSize->lineEdit()->setText( QString::number( QApplication::font().pointSize() ) ); 228 comboSize->lineEdit()->setText( QString::number( QApplication::font().pointSize() ) );
229 comboSize->setFixedWidth( 38 ); 229 comboSize->setFixedWidth( 38 );
230 230
231 tbStyle = new QToolBar( this ); 231 tbStyle = new QToolBar( this );
232 tbStyle->setLabel( "Style Actions" ); 232 tbStyle->setLabel( "Style Actions" );
233 233
234 actionTextBold = new QAction( tr( "Bold" ), 234 actionTextBold = new QAction( tr( "Bold" ),
235 Resource::loadPixmap("bold"), 235 Resource::loadPixmap("bold"),
236 QString::null, CTRL + Key_B, 236 QString::null, CTRL + Key_B,
237 this, "textBold" ); 237 this, "textBold" );
238 connect( actionTextBold, SIGNAL( activated() ), this, SLOT( textBold() ) ); 238 connect( actionTextBold, SIGNAL( activated() ), this, SLOT( textBold() ) );
239 actionTextBold->addTo( tbStyle ); 239 actionTextBold->addTo( tbStyle );
240 actionTextBold->setToggleAction( TRUE ); 240 actionTextBold->setToggleAction( TRUE );
241 actionTextItalic = new QAction( tr( "Italic" ), 241 actionTextItalic = new QAction( tr( "Italic" ),
242 Resource::loadPixmap("italic"), 242 Resource::loadPixmap("italic"),
243 tr( "&Italic" ), CTRL + Key_I, 243 tr( "&Italic" ), CTRL + Key_I,
244 this, "textItalic" ); 244 this, "textItalic" );
245 connect( actionTextItalic, SIGNAL( activated() ), this, 245 connect( actionTextItalic, SIGNAL( activated() ), this,
246 SLOT( textItalic() ) ); 246 SLOT( textItalic() ) );
247 actionTextItalic->addTo( tbStyle ); 247 actionTextItalic->addTo( tbStyle );
248 actionTextItalic->setToggleAction( TRUE ); 248 actionTextItalic->setToggleAction( TRUE );
249 actionTextUnderline = new QAction( tr( "Underline" ), 249 actionTextUnderline = new QAction( tr( "Underline" ),
250 Resource::loadPixmap("underline"), 250 Resource::loadPixmap("underline"),
251 tr( "&Underline" ), CTRL + Key_U, 251 tr( "&Underline" ), CTRL + Key_U,
252 this, "textUnderline" ); 252 this, "textUnderline" );
253 connect( actionTextUnderline, SIGNAL( activated() ), 253 connect( actionTextUnderline, SIGNAL( activated() ),
254 this, SLOT( textUnderline() ) ); 254 this, SLOT( textUnderline() ) );
255 actionTextUnderline->addTo( tbStyle ); 255 actionTextUnderline->addTo( tbStyle );
256 actionTextUnderline->setToggleAction( TRUE ); 256 actionTextUnderline->setToggleAction( TRUE );
257 257
258 alignMenu = new ButtonMenu( tbStyle ); 258 alignMenu = new ButtonMenu( tbStyle );
259 alignMenu->insertItem( Resource::loadPixmap("left"), tr("Left"), AlignLeft ); 259 alignMenu->insertItem( Resource::loadPixmap("left"), tr("Left"), AlignLeft );
260 alignMenu->insertItem( Resource::loadPixmap("center"), tr("Center"), AlignCenter ); 260 alignMenu->insertItem( Resource::loadPixmap("center"), tr("Center"), AlignCenter );
261 alignMenu->insertItem( Resource::loadPixmap("right"), tr("Right"), AlignRight ); 261 alignMenu->insertItem( Resource::loadPixmap("right"), tr("Right"), AlignRight );
262 alignMenu->insertItem( Resource::loadPixmap("opie-write/justify"), tr("Full"), Qt3::AlignJustify ); 262 alignMenu->insertItem( Resource::loadPixmap("opie-write/justify"), tr("Full"), Qt3::AlignJustify );
263 connect( alignMenu, SIGNAL(activated(int)), this, SLOT(textAlign(int)) ); 263 connect( alignMenu, SIGNAL(activated(int)), this, SLOT(textAlign(int)) );
264} 264}
265 265
266Qt3::QTextEdit *MainWindow::currentEditor() const 266Qt3::QTextEdit *MainWindow::currentEditor() const
267{ 267{
268 return editor; 268 return editor;
269} 269}
270 270
271void MainWindow::doConnections( Qt3::QTextEdit *e ) 271void MainWindow::doConnections( Qt3::QTextEdit *e )
272{ 272{
273 connect( e, SIGNAL( currentFontChanged( const QFont & ) ), 273 connect( e, SIGNAL( currentFontChanged(const QFont&) ),
274 this, SLOT( fontChanged( const QFont & ) ) ); 274 this, SLOT( fontChanged(const QFont&) ) );
275 connect( e, SIGNAL( currentColorChanged( const QColor & ) ), 275 connect( e, SIGNAL( currentColorChanged(const QColor&) ),
276 this, SLOT( colorChanged( const QColor & ) ) ); 276 this, SLOT( colorChanged(const QColor&) ) );
277 connect( e, SIGNAL( currentAlignmentChanged( int ) ), 277 connect( e, SIGNAL( currentAlignmentChanged(int) ),
278 this, SLOT( alignmentChanged( int ) ) ); 278 this, SLOT( alignmentChanged(int) ) );
279} 279}
280 280
281void MainWindow::updateFontSizeCombo( const QFont &f ) 281void MainWindow::updateFontSizeCombo( const QFont &f )
282{ 282{
283 comboSize->clear(); 283 comboSize->clear();
284 FontDatabase fdb; 284 FontDatabase fdb;
285 QValueList<int> sizes = fdb.pointSizes( f.family() ); 285 QValueList<int> sizes = fdb.pointSizes( f.family() );
286 QValueList<int>::Iterator it = sizes.begin(); 286 QValueList<int>::Iterator it = sizes.begin();
287 for ( ; it != sizes.end(); ++it ) 287 for ( ; it != sizes.end(); ++it )
288 comboSize->insertItem( QString::number( *it ) ); 288 comboSize->insertItem( QString::number( *it ) );
289} 289}
290 290
291void MainWindow::editUndo() 291void MainWindow::editUndo()
292{ 292{
293 if ( !currentEditor() ) 293 if ( !currentEditor() )
294 return; 294 return;
295 currentEditor()->undo(); 295 currentEditor()->undo();
296} 296}
297 297
298void MainWindow::editRedo() 298void MainWindow::editRedo()
299{ 299{
300 if ( !currentEditor() ) 300 if ( !currentEditor() )
301 return; 301 return;
302 currentEditor()->redo(); 302 currentEditor()->redo();
303} 303}
304 304
305void MainWindow::editCut() 305void MainWindow::editCut()
306{ 306{
307 if ( !currentEditor() ) 307 if ( !currentEditor() )
308 return; 308 return;
309 currentEditor()->cut(); 309 currentEditor()->cut();
310} 310}
311 311
312void MainWindow::editCopy() 312void MainWindow::editCopy()
313{ 313{
314 if ( !currentEditor() ) 314 if ( !currentEditor() )
315 return; 315 return;
316 currentEditor()->copy(); 316 currentEditor()->copy();
317} 317}
318 318
319void MainWindow::editPaste() 319void MainWindow::editPaste()
320{ 320{
321 if ( !currentEditor() ) 321 if ( !currentEditor() )
322 return; 322 return;
323 currentEditor()->paste(); 323 currentEditor()->paste();
324} 324}
325 325
326void MainWindow::textBold() 326void MainWindow::textBold()
diff --git a/noncore/apps/opie-write/qtextedit.cpp b/noncore/apps/opie-write/qtextedit.cpp
index 27dd515..73b7b7b 100644
--- a/noncore/apps/opie-write/qtextedit.cpp
+++ b/noncore/apps/opie-write/qtextedit.cpp
@@ -632,98 +632,98 @@ QTextEdit::QTextEdit( QWidget *parent, const char *name )
632/*! 632/*!
633 Constructs a QTextEdit with parent \a parent and name \a name. The 633 Constructs a QTextEdit with parent \a parent and name \a name. The
634 text edit will display the text \a text using context \a context. 634 text edit will display the text \a text using context \a context.
635 635
636 The \a context is a path which the text edit's QMimeSourceFactory 636 The \a context is a path which the text edit's QMimeSourceFactory
637 uses to resolve the locations of files and images. It is passed to 637 uses to resolve the locations of files and images. It is passed to
638 the mimeSourceFactory() when quering data. 638 the mimeSourceFactory() when quering data.
639 639
640 For example if the text contains an image tag, 640 For example if the text contains an image tag,
641 \c{<img src="image.png">}, and the context is "path/to/look/in", the 641 \c{<img src="image.png">}, and the context is "path/to/look/in", the
642 QMimeSourceFactory will try to load the image from 642 QMimeSourceFactory will try to load the image from
643 "path/to/look/in/image.png". If the tag was 643 "path/to/look/in/image.png". If the tag was
644 \c{<img src="/image.png">}, the context will not be used (because 644 \c{<img src="/image.png">}, the context will not be used (because
645 QMimeSourceFactory recognizes that we have used an absolute path) 645 QMimeSourceFactory recognizes that we have used an absolute path)
646 and will try to load "/image.png". The context is applied in exactly 646 and will try to load "/image.png". The context is applied in exactly
647 the same way to \e hrefs, for example, 647 the same way to \e hrefs, for example,
648 \c{<a href="target.html">Target</a>}, would resolve to 648 \c{<a href="target.html">Target</a>}, would resolve to
649 "path/to/look/in/target.html". 649 "path/to/look/in/target.html".
650 650
651*/ 651*/
652 652
653QTextEdit::QTextEdit( const QString& text, const QString& context, 653QTextEdit::QTextEdit( const QString& text, const QString& context,
654 QWidget *parent, const char *name) 654 QWidget *parent, const char *name)
655 : QScrollView( parent, name, WStaticContents | WRepaintNoErase | WResizeNoErase ), 655 : QScrollView( parent, name, WStaticContents | WRepaintNoErase | WResizeNoErase ),
656 doc( new QTextDocument( 0 ) ), undoRedoInfo( doc ) 656 doc( new QTextDocument( 0 ) ), undoRedoInfo( doc )
657{ 657{
658 init(); 658 init();
659 setText( text, context ); 659 setText( text, context );
660} 660}
661 661
662/*! \reimp */ 662/*! \reimp */
663 663
664QTextEdit::~QTextEdit() 664QTextEdit::~QTextEdit()
665{ 665{
666 delete undoRedoInfo.d; 666 delete undoRedoInfo.d;
667 undoRedoInfo.d = 0; 667 undoRedoInfo.d = 0;
668 delete cursor; 668 delete cursor;
669 delete doc; 669 delete doc;
670 delete d; 670 delete d;
671} 671}
672 672
673void QTextEdit::init() 673void QTextEdit::init()
674{ 674{
675 setFrameStyle( Sunken ); 675 setFrameStyle( Sunken );
676 undoEnabled = TRUE; 676 undoEnabled = TRUE;
677 readonly = TRUE; 677 readonly = TRUE;
678 setReadOnly( FALSE ); 678 setReadOnly( FALSE );
679 d = new QTextEditPrivate; 679 d = new QTextEditPrivate;
680 connect( doc, SIGNAL( minimumWidthChanged( int ) ), 680 connect( doc, SIGNAL( minimumWidthChanged(int) ),
681 this, SLOT( documentWidthChanged( int ) ) ); 681 this, SLOT( documentWidthChanged(int) ) );
682 682
683 mousePressed = FALSE; 683 mousePressed = FALSE;
684 inDoubleClick = FALSE; 684 inDoubleClick = FALSE;
685 modified = FALSE; 685 modified = FALSE;
686 onLink = QString::null; 686 onLink = QString::null;
687 overWrite = FALSE; 687 overWrite = FALSE;
688 wrapMode = WidgetWidth; 688 wrapMode = WidgetWidth;
689 wrapWidth = -1; 689 wrapWidth = -1;
690 wPolicy = AtWhiteSpace; 690 wPolicy = AtWhiteSpace;
691 inDnD = FALSE; 691 inDnD = FALSE;
692 692
693 doc->setFormatter( new QTextFormatterBreakWords ); 693 doc->setFormatter( new QTextFormatterBreakWords );
694 doc->formatCollection()->defaultFormat()->setFont( QScrollView::font() ); 694 doc->formatCollection()->defaultFormat()->setFont( QScrollView::font() );
695 doc->formatCollection()->defaultFormat()->setColor( colorGroup().color( QColorGroup::Text ) ); 695 doc->formatCollection()->defaultFormat()->setColor( colorGroup().color( QColorGroup::Text ) );
696 currentFormat = doc->formatCollection()->defaultFormat(); 696 currentFormat = doc->formatCollection()->defaultFormat();
697 currentAlignment = Qt3::AlignAuto; 697 currentAlignment = Qt3::AlignAuto;
698 698
699 viewport()->setBackgroundMode( PaletteBase ); 699 viewport()->setBackgroundMode( PaletteBase );
700 viewport()->setAcceptDrops( TRUE ); 700 viewport()->setAcceptDrops( TRUE );
701 resizeContents( 0, doc->lastParagraph() ? 701 resizeContents( 0, doc->lastParagraph() ?
702 ( doc->lastParagraph()->paragId() + 1 ) * doc->formatCollection()->defaultFormat()->height() : 0 ); 702 ( doc->lastParagraph()->paragId() + 1 ) * doc->formatCollection()->defaultFormat()->height() : 0 );
703 703
704 setKeyCompression( TRUE ); 704 setKeyCompression( TRUE );
705 viewport()->setMouseTracking( TRUE ); 705 viewport()->setMouseTracking( TRUE );
706#ifndef QT_NO_CURSOR 706#ifndef QT_NO_CURSOR
707 viewport()->setCursor( isReadOnly() ? arrowCursor : ibeamCursor ); 707 viewport()->setCursor( isReadOnly() ? arrowCursor : ibeamCursor );
708#endif 708#endif
709 cursor = new QTextCursor( doc ); 709 cursor = new QTextCursor( doc );
710 710
711 formatTimer = new QTimer( this ); 711 formatTimer = new QTimer( this );
712 connect( formatTimer, SIGNAL( timeout() ), 712 connect( formatTimer, SIGNAL( timeout() ),
713 this, SLOT( formatMore() ) ); 713 this, SLOT( formatMore() ) );
714 lastFormatted = doc->firstParagraph(); 714 lastFormatted = doc->firstParagraph();
715 715
716 scrollTimer = new QTimer( this ); 716 scrollTimer = new QTimer( this );
717 connect( scrollTimer, SIGNAL( timeout() ), 717 connect( scrollTimer, SIGNAL( timeout() ),
718 this, SLOT( autoScrollTimerDone() ) ); 718 this, SLOT( autoScrollTimerDone() ) );
719 719
720 interval = 0; 720 interval = 0;
721 changeIntervalTimer = new QTimer( this ); 721 changeIntervalTimer = new QTimer( this );
722 connect( changeIntervalTimer, SIGNAL( timeout() ), 722 connect( changeIntervalTimer, SIGNAL( timeout() ),
723 this, SLOT( doChangeInterval() ) ); 723 this, SLOT( doChangeInterval() ) );
724 724
725 cursorVisible = TRUE; 725 cursorVisible = TRUE;
726 blinkTimer = new QTimer( this ); 726 blinkTimer = new QTimer( this );
727 connect( blinkTimer, SIGNAL( timeout() ), 727 connect( blinkTimer, SIGNAL( timeout() ),
728 this, SLOT( blinkCursor() ) ); 728 this, SLOT( blinkCursor() ) );
729 729
diff --git a/noncore/apps/qashmoney/accountdisplay.cpp b/noncore/apps/qashmoney/accountdisplay.cpp
index 5ef5454..0fe5b09 100755
--- a/noncore/apps/qashmoney/accountdisplay.cpp
+++ b/noncore/apps/qashmoney/accountdisplay.cpp
@@ -1,97 +1,97 @@
1#include <qmessagebox.h> 1#include <qmessagebox.h>
2#include <qheader.h> 2#include <qheader.h>
3 3
4#include "accountdisplay.h" 4#include "accountdisplay.h"
5#include "newaccount.h" 5#include "newaccount.h"
6#include "transaction.h" 6#include "transaction.h"
7#include "transferdialog.h" 7#include "transferdialog.h"
8#include "transfer.h" 8#include "transfer.h"
9 9
10extern Account *account; 10extern Account *account;
11extern Transaction *transaction; 11extern Transaction *transaction;
12extern Transfer *transfer; 12extern Transfer *transfer;
13extern Preferences *preferences; 13extern Preferences *preferences;
14 14
15AccountDisplay::AccountDisplay ( QWidget *parent ) : QWidget ( parent ) 15AccountDisplay::AccountDisplay ( QWidget *parent ) : QWidget ( parent )
16 { 16 {
17 cleared = 0; 17 cleared = 0;
18 18
19 firstline = new QHBox ( this ); 19 firstline = new QHBox ( this );
20 firstline->setSpacing ( 2 ); 20 firstline->setSpacing ( 2 );
21 21
22 newaccount = new QPushButton ( firstline ); 22 newaccount = new QPushButton ( firstline );
23 newaccount->setPixmap ( QPixmap ("/opt/QtPalmtop/pics/new.png") ); 23 newaccount->setPixmap ( QPixmap ("/opt/QtPalmtop/pics/new.png") );
24 connect ( newaccount, SIGNAL ( released () ), this, SLOT ( addAccount () ) ); 24 connect ( newaccount, SIGNAL ( released() ), this, SLOT ( addAccount() ) );
25 25
26 editaccount = new QPushButton ( firstline ); 26 editaccount = new QPushButton ( firstline );
27 editaccount->setPixmap ( QPixmap ("/opt/QtPalmtop/pics/edit.png") ); 27 editaccount->setPixmap ( QPixmap ("/opt/QtPalmtop/pics/edit.png") );
28 connect ( editaccount, SIGNAL ( released () ), this, SLOT ( editAccount () ) ); 28 connect ( editaccount, SIGNAL ( released() ), this, SLOT ( editAccount() ) );
29 29
30 deleteaccount = new QPushButton ( firstline ); 30 deleteaccount = new QPushButton ( firstline );
31 deleteaccount->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/delete.png") ); 31 deleteaccount->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/delete.png") );
32 connect ( deleteaccount, SIGNAL ( released () ), this, SLOT ( deleteAccount () ) ); 32 connect ( deleteaccount, SIGNAL ( released() ), this, SLOT ( deleteAccount() ) );
33 33
34 transferbutton = new QPushButton ( firstline ); 34 transferbutton = new QPushButton ( firstline );
35 transferbutton->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/transfer.png") ); 35 transferbutton->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/transfer.png") );
36 transferbutton->setToggleButton ( TRUE ); 36 transferbutton->setToggleButton ( TRUE );
37 connect ( transferbutton, SIGNAL ( toggled ( bool ) ), this, SLOT ( accountTransfer ( bool ) ) ); 37 connect ( transferbutton, SIGNAL ( toggled(bool) ), this, SLOT ( accountTransfer(bool) ) );
38 38
39 listview = new QListView ( this ); 39 listview = new QListView ( this );
40 listview->setAllColumnsShowFocus ( TRUE ); 40 listview->setAllColumnsShowFocus ( TRUE );
41 listview->setShowSortIndicator ( TRUE ); 41 listview->setShowSortIndicator ( TRUE );
42 listview->setRootIsDecorated ( TRUE ); 42 listview->setRootIsDecorated ( TRUE );
43 listview->setMultiSelection ( FALSE ); 43 listview->setMultiSelection ( FALSE );
44 connect ( listview, SIGNAL ( expanded ( QListViewItem * ) ), this, SLOT ( setAccountExpanded ( QListViewItem * ) ) ); 44 connect ( listview, SIGNAL ( expanded(QListViewItem*) ), this, SLOT ( setAccountExpanded(QListViewItem*) ) );
45 connect ( listview, SIGNAL ( collapsed ( QListViewItem * ) ), this, SLOT ( setAccountCollapsed ( QListViewItem * ) ) ); 45 connect ( listview, SIGNAL ( collapsed(QListViewItem*) ), this, SLOT ( setAccountCollapsed(QListViewItem*) ) );
46 46
47 listview->header()->setTracking ( FALSE ); 47 listview->header()->setTracking ( FALSE );
48 connect ( listview->header(), SIGNAL ( sizeChange ( int, int, int ) ), this, SLOT ( saveColumnSize ( int, int, int ) ) ); 48 connect ( listview->header(), SIGNAL ( sizeChange(int,int,int) ), this, SLOT ( saveColumnSize(int,int,int) ) );
49 connect ( listview->header(), SIGNAL ( clicked ( int ) ), this, SLOT ( saveSortingPreference ( int ) ) ); 49 connect ( listview->header(), SIGNAL ( clicked(int) ), this, SLOT ( saveSortingPreference(int) ) );
50 50
51 layout = new QVBoxLayout ( this, 2, 5 ); 51 layout = new QVBoxLayout ( this, 2, 5 );
52 layout->addWidget ( firstline ); 52 layout->addWidget ( firstline );
53 layout->addWidget ( listview ); 53 layout->addWidget ( listview );
54 } 54 }
55 55
56void AccountDisplay::setTabs ( QWidget *newtab2, QTabWidget *newtabs ) 56void AccountDisplay::setTabs ( QWidget *newtab2, QTabWidget *newtabs )
57 { 57 {
58 tab2 = newtab2; 58 tab2 = newtab2;
59 maintabs = newtabs; 59 maintabs = newtabs;
60 } 60 }
61 61
62void AccountDisplay::addAccount () 62void AccountDisplay::addAccount ()
63 { 63 {
64 // initialize local variables 64 // initialize local variables
65 int parentid = 0; 65 int parentid = 0;
66 type = 0; 66 type = 0;
67 QString parentlist [ listview->childCount() + 1 ] [ 3 ] ; 67 QString parentlist [ listview->childCount() + 1 ] [ 3 ] ;
68 68
69 // create new account window for entering data 69 // create new account window for entering data
70 NewAccount *newaccount = new NewAccount ( this ); 70 NewAccount *newaccount = new NewAccount ( this );
71 int width = this->width(); 71 int width = this->width();
72 newaccount->accountbox->setMaximumWidth ( ( int ) ( width * 0.5 ) ); 72 newaccount->accountbox->setMaximumWidth ( ( int ) ( width * 0.5 ) );
73 newaccount->datebox->setMaximumWidth ( ( int ) ( width * 0.4 ) ); 73 newaccount->datebox->setMaximumWidth ( ( int ) ( width * 0.4 ) );
74 newaccount->childbox->setMaximumWidth ( ( int ) ( width * 0.5 ) ); 74 newaccount->childbox->setMaximumWidth ( ( int ) ( width * 0.5 ) );
75 newaccount->balancebox->setMaximumWidth ( ( int ) ( width * 0.4 ) ); 75 newaccount->balancebox->setMaximumWidth ( ( int ) ( width * 0.4 ) );
76 newaccount->creditlimitbox->setMaximumWidth ( ( int ) ( width * 0.4 ) ); 76 newaccount->creditlimitbox->setMaximumWidth ( ( int ) ( width * 0.4 ) );
77 77
78 // if there are no accounts, disable the child check box 78 // if there are no accounts, disable the child check box
79 if ( account->getNumberOfAccounts () == 0 ) 79 if ( account->getNumberOfAccounts () == 0 )
80 newaccount->childcheckbox->setEnabled ( FALSE ); 80 newaccount->childcheckbox->setEnabled ( FALSE );
81 81
82 // if there are accounts, fill up the pulldown menu for 82 // if there are accounts, fill up the pulldown menu for
83 // selecting a parent account. We should only add those parents without transactions 83 // selecting a parent account. We should only add those parents without transactions
84 else 84 else
85 { 85 {
86 int c = 0; 86 int c = 0;
87 QListViewItemIterator it ( listview ); 87 QListViewItemIterator it ( listview );
88 for ( ; it.current(); ++it ) 88 for ( ; it.current(); ++it )
89 { 89 {
90 int id = it.current()->text ( getIDColumn() ).toInt(); 90 int id = it.current()->text ( getIDColumn() ).toInt();
91 // iterate through accountdisplay listview and add parents with no transactions 91 // iterate through accountdisplay listview and add parents with no transactions
92 // add this item to the list box only if it is a parent and has no transactions 92 // add this item to the list box only if it is a parent and has no transactions
93 if ( transfer->getNumberOfTransfers ( id ) == 0 && transaction->getNumberOfTransactions ( id ) == 0 && it.current()->parent() == 0 ) 93 if ( transfer->getNumberOfTransfers ( id ) == 0 && transaction->getNumberOfTransactions ( id ) == 0 && it.current()->parent() == 0 )
94 { 94 {
95 newaccount->childbox->insertItem ( it.current()->text ( 0 ) ); 95 newaccount->childbox->insertItem ( it.current()->text ( 0 ) );
96 parentlist [ c ] [ 0 ] = it.current()->text ( 0 ); 96 parentlist [ c ] [ 0 ] = it.current()->text ( 0 );
97 parentlist [ c ] [ 1 ] = it.current()->text ( getIDColumn() ); 97 parentlist [ c ] [ 1 ] = it.current()->text ( getIDColumn() );
@@ -180,163 +180,163 @@ void AccountDisplay::deleteAccount ()
180 if ( parentid != -1 ) 180 if ( parentid != -1 )
181 account->changeParentAccountBalance ( parentid ); 181 account->changeParentAccountBalance ( parentid );
182 182
183 //redisplay accounts 183 //redisplay accounts
184 account->displayAccounts ( listview ); 184 account->displayAccounts ( listview );
185 185
186 //remove all the columns from the accountdisplay if there are not any accounts 186 //remove all the columns from the accountdisplay if there are not any accounts
187 if ( account->getNumberOfAccounts() == 0 ) 187 if ( account->getNumberOfAccounts() == 0 )
188 { 188 {
189 int columns = listview->columns(); 189 int columns = listview->columns();
190 int counter; 190 int counter;
191 for ( counter = 0; counter <= columns; counter++ ) 191 for ( counter = 0; counter <= columns; counter++ )
192 listview->removeColumn ( 0 ); 192 listview->removeColumn ( 0 );
193 } 193 }
194 194
195 setToggleButton(); 195 setToggleButton();
196 } 196 }
197 } 197 }
198 maintabs->setTabEnabled ( tab2, FALSE ); 198 maintabs->setTabEnabled ( tab2, FALSE );
199 } 199 }
200 200
201void AccountDisplay::setToggleButton () 201void AccountDisplay::setToggleButton ()
202 { 202 {
203 // iterate through account display and determine how many "transferable" accounts we have 203 // iterate through account display and determine how many "transferable" accounts we have
204 // if there are less than two, disable the transfer button 204 // if there are less than two, disable the transfer button
205 QListViewItemIterator it ( listview ); 205 QListViewItemIterator it ( listview );
206 int counter = 0; 206 int counter = 0;
207 for ( ; it.current(); ++it ) 207 for ( ; it.current(); ++it )
208 { 208 {
209 // add one to counter if we find a transferable account 209 // add one to counter if we find a transferable account
210 if ( it.current()->parent() != 0 || ( it.current()->childCount() ) == 0 ) 210 if ( it.current()->parent() != 0 || ( it.current()->childCount() ) == 0 )
211 counter++; 211 counter++;
212 } 212 }
213 if ( counter > 1 ) 213 if ( counter > 1 )
214 transferbutton->show(); 214 transferbutton->show();
215 else 215 else
216 transferbutton->hide(); 216 transferbutton->hide();
217 } 217 }
218 218
219void AccountDisplay::accountTransfer ( bool state ) 219void AccountDisplay::accountTransfer ( bool state )
220 { 220 {
221 if ( state == TRUE ) 221 if ( state == TRUE )
222 { 222 {
223 firstaccountid = -1; 223 firstaccountid = -1;
224 secondaccountid = -1; 224 secondaccountid = -1;
225 listview->clearSelection (); 225 listview->clearSelection ();
226 listview->setMultiSelection ( TRUE ); 226 listview->setMultiSelection ( TRUE );
227 disableParentsWithChildren (); 227 disableParentsWithChildren ();
228 connect ( listview, SIGNAL ( clicked ( QListViewItem * ) ), this, SLOT ( getTransferAccounts ( QListViewItem * ) ) ); 228 connect ( listview, SIGNAL ( clicked(QListViewItem*) ), this, SLOT ( getTransferAccounts(QListViewItem*) ) );
229 } 229 }
230 else 230 else
231 { 231 {
232 firstaccountid = -1; 232 firstaccountid = -1;
233 secondaccountid = -1; 233 secondaccountid = -1;
234 listview->clearSelection (); 234 listview->clearSelection ();
235 listview->setMultiSelection ( FALSE ); 235 listview->setMultiSelection ( FALSE );
236 enableAccounts (); 236 enableAccounts ();
237 disconnect ( listview, SIGNAL ( clicked ( QListViewItem * ) ), this, SLOT ( getTransferAccounts ( QListViewItem * ) ) ); 237 disconnect ( listview, SIGNAL ( clicked(QListViewItem*) ), this, SLOT ( getTransferAccounts(QListViewItem*) ) );
238 } 238 }
239 } 239 }
240 240
241void AccountDisplay::getTransferAccounts ( QListViewItem * item ) 241void AccountDisplay::getTransferAccounts ( QListViewItem * item )
242 { 242 {
243 if ( item->parent() != 0 || item->childCount() == 0 ) // only set an account for transfer if its a child or parent with no children 243 if ( item->parent() != 0 || item->childCount() == 0 ) // only set an account for transfer if its a child or parent with no children
244 { 244 {
245 if ( firstaccountid == -1 ) 245 if ( firstaccountid == -1 )
246 firstaccountid = item->text ( getIDColumn() ).toInt(); // set first account if we've selected a valid account 246 firstaccountid = item->text ( getIDColumn() ).toInt(); // set first account if we've selected a valid account
247 else 247 else
248 if ( item->text ( getIDColumn() ).toInt() != firstaccountid ) // set the second account if its not equal to the first 248 if ( item->text ( getIDColumn() ).toInt() != firstaccountid ) // set the second account if its not equal to the first
249 secondaccountid = item->text ( getIDColumn() ).toInt(); 249 secondaccountid = item->text ( getIDColumn() ).toInt();
250 } 250 }
251 251
252 // open transfer window if both accounts are set 252 // open transfer window if both accounts are set
253 if ( firstaccountid != -1 && secondaccountid != -1 ) 253 if ( firstaccountid != -1 && secondaccountid != -1 )
254 { 254 {
255 // construct the transferdialog window 255 // construct the transferdialog window
256 TransferDialog *td = new TransferDialog ( this, firstaccountid, secondaccountid ); 256 TransferDialog *td = new TransferDialog ( this, firstaccountid, secondaccountid );
257 257
258 // enter today's date in the date box as default 258 // enter today's date in the date box as default
259 QDate today = QDate::currentDate (); 259 QDate today = QDate::currentDate ();
260 int defaultday = today.day(); 260 int defaultday = today.day();
261 int defaultmonth = today.month(); 261 int defaultmonth = today.month();
262 int defaultyear = today.year(); 262 int defaultyear = today.year();
263 td->date->setText ( preferences->getDate ( defaultyear, defaultmonth, defaultday ) ); 263 td->date->setText ( preferences->getDate ( defaultyear, defaultmonth, defaultday ) );
264 264
265 if ( td->exec() == QDialog::Accepted ) 265 if ( td->exec() == QDialog::Accepted )
266 { 266 {
267 // set the cleared integer if the checkbox is checked 267 // set the cleared integer if the checkbox is checked
268 if ( td->clearedcheckbox->isChecked() == TRUE ) 268 if ( td->clearedcheckbox->isChecked() == TRUE )
269 cleared = 1; 269 cleared = 1;
270 qDebug("Year from transferdialog = %i",td->getYear()); 270 qDebug("Year from transferdialog = %i",td->getYear());
271 // add the transfer with a new date if its been edited or use the default date 271 // add the transfer with a new date if its been edited or use the default date
272 if ( td->getDateEdited () == TRUE ) 272 if ( td->getDateEdited () == TRUE )
273 transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, account->getParentAccountID ( secondaccountid ), td->getDay(), td->getMonth(), td->getYear(), td->amount->text().toFloat(), cleared ); 273 transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, account->getParentAccountID ( secondaccountid ), td->getDay(), td->getMonth(), td->getYear(), td->amount->text().toFloat(), cleared );
274 else 274 else
275 transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, account->getParentAccountID ( secondaccountid ), defaultday, defaultmonth, defaultyear, td->amount->text().toFloat(), cleared ); 275 transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, account->getParentAccountID ( secondaccountid ), defaultday, defaultmonth, defaultyear, td->amount->text().toFloat(), cleared );
276 276
277 // update account balances of both accounts and parents if necessary 277 // update account balances of both accounts and parents if necessary
278 account->updateAccountBalance ( firstaccountid ); 278 account->updateAccountBalance ( firstaccountid );
279 if ( account->getParentAccountID ( firstaccountid ) != -1 ) 279 if ( account->getParentAccountID ( firstaccountid ) != -1 )
280 account->changeParentAccountBalance ( account->getParentAccountID ( firstaccountid ) ); 280 account->changeParentAccountBalance ( account->getParentAccountID ( firstaccountid ) );
281 account->updateAccountBalance ( secondaccountid ); 281 account->updateAccountBalance ( secondaccountid );
282 if ( account->getParentAccountID ( secondaccountid ) != -1 ) 282 if ( account->getParentAccountID ( secondaccountid ) != -1 )
283 account->changeParentAccountBalance ( account->getParentAccountID ( secondaccountid ) ); 283 account->changeParentAccountBalance ( account->getParentAccountID ( secondaccountid ) );
284 284
285 // redisplay accounts 285 // redisplay accounts
286 account->displayAccounts ( listview ); 286 account->displayAccounts ( listview );
287 } 287 }
288 else 288 else
289 { 289 {
290 firstaccountid = -1; 290 firstaccountid = -1;
291 secondaccountid = -1; 291 secondaccountid = -1;
292 listview->clearSelection (); 292 listview->clearSelection ();
293 listview->setMultiSelection ( FALSE ); 293 listview->setMultiSelection ( FALSE );
294 disconnect ( listview, SIGNAL ( clicked ( QListViewItem * ) ), this, SLOT ( getTransferAccounts ( QListViewItem * ) ) ); 294 disconnect ( listview, SIGNAL ( clicked(QListViewItem*) ), this, SLOT ( getTransferAccounts(QListViewItem*) ) );
295 } 295 }
296 296
297 // reset the accounts display window 297 // reset the accounts display window
298 transferbutton->toggle(); // toggling this button with clear the window as well 298 transferbutton->toggle(); // toggling this button with clear the window as well
299 299
300 // reenable all the accounts so the transaction tab will be properly set 300 // reenable all the accounts so the transaction tab will be properly set
301 enableAccounts (); 301 enableAccounts ();
302 } 302 }
303 } 303 }
304 304
305void AccountDisplay::disableParentsWithChildren () 305void AccountDisplay::disableParentsWithChildren ()
306 { 306 {
307 // iterate through accountdisplay listview and disable all the parents that have children 307 // iterate through accountdisplay listview and disable all the parents that have children
308 QListViewItemIterator it ( listview ); 308 QListViewItemIterator it ( listview );
309 for ( ; it.current(); ++it ) 309 for ( ; it.current(); ++it )
310 { 310 {
311 if ( it.current()->parent() == 0 && it.current()->childCount() != 0 ) 311 if ( it.current()->parent() == 0 && it.current()->childCount() != 0 )
312 it.current()->setSelectable ( FALSE ); 312 it.current()->setSelectable ( FALSE );
313 } 313 }
314 } 314 }
315 315
316void AccountDisplay::enableAccounts () 316void AccountDisplay::enableAccounts ()
317 { 317 {
318 // iterate through accountdisplay listview and enable all accounts 318 // iterate through accountdisplay listview and enable all accounts
319 QListViewItemIterator it ( listview ); 319 QListViewItemIterator it ( listview );
320 for ( ; it.current(); ++it ) 320 for ( ; it.current(); ++it )
321 it.current()->setSelectable ( TRUE ); 321 it.current()->setSelectable ( TRUE );
322 } 322 }
323 323
324void AccountDisplay::saveColumnSize ( int column, int oldsize, int newsize ) 324void AccountDisplay::saveColumnSize ( int column, int oldsize, int newsize )
325 { 325 {
326 switch ( column ) 326 switch ( column )
327 { 327 {
328 case 0: 328 case 0:
329 if ( listview->columns() == 3 ) 329 if ( listview->columns() == 3 )
330 preferences->changeColumnPreference ( 1, newsize ); 330 preferences->changeColumnPreference ( 1, newsize );
331 else 331 else
332 preferences->changeColumnPreference ( 10, newsize ); 332 preferences->changeColumnPreference ( 10, newsize );
333 break; 333 break;
334 case 1: 334 case 1:
335 if ( listview->columns() == 3 ) 335 if ( listview->columns() == 3 )
336 preferences->changeColumnPreference ( 2, newsize ); 336 preferences->changeColumnPreference ( 2, newsize );
337 else 337 else
338 preferences->changeColumnPreference ( 11, newsize ); 338 preferences->changeColumnPreference ( 11, newsize );
339 break; 339 break;
340 case 2: 340 case 2:
341 preferences->changeColumnPreference ( 12, newsize ); 341 preferences->changeColumnPreference ( 12, newsize );
342 break; 342 break;
diff --git a/noncore/apps/qashmoney/budgetdisplay.cpp b/noncore/apps/qashmoney/budgetdisplay.cpp
index d4047bf..3fc4e6c 100755
--- a/noncore/apps/qashmoney/budgetdisplay.cpp
+++ b/noncore/apps/qashmoney/budgetdisplay.cpp
@@ -1,130 +1,130 @@
1#include <qmessagebox.h> 1#include <qmessagebox.h>
2#include <qheader.h> 2#include <qheader.h>
3#include <sqlite.h> 3#include <sqlite.h>
4 4
5#include "budgetdisplay.h" 5#include "budgetdisplay.h"
6#include "budget.h" 6#include "budget.h"
7#include "datepicker.h" 7#include "datepicker.h"
8#include "transaction.h" 8#include "transaction.h"
9 9
10extern Preferences *preferences; 10extern Preferences *preferences;
11extern Budget *budget; 11extern Budget *budget;
12extern Transaction *transaction; 12extern Transaction *transaction;
13 13
14BudgetDisplay::BudgetDisplay ( QWidget *parent ) : QWidget ( parent ) 14BudgetDisplay::BudgetDisplay ( QWidget *parent ) : QWidget ( parent )
15 { 15 {
16 QFont font = this->font(); 16 QFont font = this->font();
17 font.setWeight ( QFont::Bold ); 17 font.setWeight ( QFont::Bold );
18 18
19 //set the default date to today 19 //set the default date to today
20 newDate = QDate::currentDate (); 20 newDate = QDate::currentDate ();
21 year = newDate.year(); 21 year = newDate.year();
22 month = newDate.month(); 22 month = newDate.month();
23 day = newDate.day(); 23 day = newDate.day();
24 datelabel = preferences->getDate ( year, month ); 24 datelabel = preferences->getDate ( year, month );
25 25
26 setCaption ( "Budget" ); 26 setCaption ( "Budget" );
27 27
28 firstline = new QHBox ( this ); 28 firstline = new QHBox ( this );
29 firstline->setSpacing ( 2 ); 29 firstline->setSpacing ( 2 );
30 secondline = new QHBox ( this ); 30 secondline = new QHBox ( this );
31 secondline->setSpacing ( 10 ); 31 secondline->setSpacing ( 10 );
32 32
33 menu = new QMenuBar ( this ); 33 menu = new QMenuBar ( this );
34 menu->setFrameStyle ( QFrame::Box | QFrame::Sunken ); 34 menu->setFrameStyle ( QFrame::Box | QFrame::Sunken );
35 budgetmenu = new QPopupMenu ( this ); 35 budgetmenu = new QPopupMenu ( this );
36 lineitemsmenu = new QPopupMenu ( this ); 36 lineitemsmenu = new QPopupMenu ( this );
37 datemenu = new QPopupMenu ( this ); 37 datemenu = new QPopupMenu ( this );
38 menu->insertItem ( "Budget", budgetmenu ); 38 menu->insertItem ( "Budget", budgetmenu );
39 menu->insertItem ( "Line Item", lineitemsmenu ); 39 menu->insertItem ( "Line Item", lineitemsmenu );
40 menu->insertItem ( "Date", datemenu ); 40 menu->insertItem ( "Date", datemenu );
41 budgetmenu->insertItem ( "New", this, SLOT ( newBudget () ), 0, 1 ); 41 budgetmenu->insertItem ( "New", this, SLOT ( newBudget() ), 0, 1 );
42 budgetmenu->insertItem ( "Edit", this, SLOT ( editBudget () ), 0, 2 ); 42 budgetmenu->insertItem ( "Edit", this, SLOT ( editBudget() ), 0, 2 );
43 budgetmenu->insertItem ( "Delete", this, SLOT ( deleteBudget () ), 0, 3 ); 43 budgetmenu->insertItem ( "Delete", this, SLOT ( deleteBudget() ), 0, 3 );
44 lineitemsmenu->insertItem ( "New", this, SLOT ( newLineItem () ), 0, 1 ); 44 lineitemsmenu->insertItem ( "New", this, SLOT ( newLineItem() ), 0, 1 );
45 lineitemsmenu->insertItem ( "Edit", this, SLOT ( editLineItem () ), 0, 2 ); 45 lineitemsmenu->insertItem ( "Edit", this, SLOT ( editLineItem() ), 0, 2 );
46 lineitemsmenu->insertItem ( "Delete", this, SLOT ( deleteLineItem () ), 0, 3 ); 46 lineitemsmenu->insertItem ( "Delete", this, SLOT ( deleteLineItem() ), 0, 3 );
47 datemenu->insertItem ( "Change", this, SLOT ( showCalendar() ) ); 47 datemenu->insertItem ( "Change", this, SLOT ( showCalendar() ) );
48 48
49 budgetbox = new QComboBox ( firstline ); 49 budgetbox = new QComboBox ( firstline );
50 connect ( budgetbox, SIGNAL ( activated ( int ) ), this, SLOT ( setCurrentBudget ( int ) ) ); 50 connect ( budgetbox, SIGNAL ( activated(int) ), this, SLOT ( setCurrentBudget(int) ) );
51 51
52 budgetview = new QComboBox ( firstline ); 52 budgetview = new QComboBox ( firstline );
53 budgetview->insertItem ( "Month" ); 53 budgetview->insertItem ( "Month" );
54 budgetview->insertItem ( "Year" ); 54 budgetview->insertItem ( "Year" );
55 connect ( budgetview, SIGNAL ( activated ( int ) ), this, SLOT ( setCurrentView ( int ) ) ); 55 connect ( budgetview, SIGNAL ( activated(int) ), this, SLOT ( setCurrentView(int) ) );
56 56
57 budgeted = new QLabel ( secondline ); 57 budgeted = new QLabel ( secondline );
58 budgeted->setFont ( font ); 58 budgeted->setFont ( font );
59 actual = new QLabel ( secondline ); 59 actual = new QLabel ( secondline );
60 actual->setFont ( font ); 60 actual->setFont ( font );
61 date = new QLabel ( secondline ); 61 date = new QLabel ( secondline );
62 date->setFont ( font ); 62 date->setFont ( font );
63 63
64 listview = new QListView ( this ); 64 listview = new QListView ( this );
65 listview->setAllColumnsShowFocus ( TRUE ); 65 listview->setAllColumnsShowFocus ( TRUE );
66 listview->setShowSortIndicator ( TRUE ); 66 listview->setShowSortIndicator ( TRUE );
67 listview->setRootIsDecorated ( TRUE ); 67 listview->setRootIsDecorated ( TRUE );
68 listview->setMultiSelection ( FALSE ); 68 listview->setMultiSelection ( FALSE );
69 listview->addColumn ( "Line Item", preferences->getColumnPreference ( 13 ) ); // column id 13 69 listview->addColumn ( "Line Item", preferences->getColumnPreference ( 13 ) ); // column id 13
70 listview->addColumn ( "Budget", preferences->getColumnPreference ( 14 ) ); // column id 14 70 listview->addColumn ( "Budget", preferences->getColumnPreference ( 14 ) ); // column id 14
71 listview->addColumn ( "Actual", preferences->getColumnPreference ( 15 ) ); // column id 15 71 listview->addColumn ( "Actual", preferences->getColumnPreference ( 15 ) ); // column id 15
72 listview->addColumn ( "", 0 ); // line item ids 72 listview->addColumn ( "", 0 ); // line item ids
73 listview->setColumnWidthMode ( 0, QListView::Manual ); 73 listview->setColumnWidthMode ( 0, QListView::Manual );
74 listview->setColumnWidthMode ( 1, QListView::Manual ); 74 listview->setColumnWidthMode ( 1, QListView::Manual );
75 listview->setColumnWidthMode ( 2, QListView::Manual ); 75 listview->setColumnWidthMode ( 2, QListView::Manual );
76 listview->setColumnAlignment ( 1, Qt::AlignRight ); 76 listview->setColumnAlignment ( 1, Qt::AlignRight );
77 listview->setColumnAlignment ( 2, Qt::AlignRight ); 77 listview->setColumnAlignment ( 2, Qt::AlignRight );
78 listview->setColumnWidthMode ( 3, QListView::Manual ); 78 listview->setColumnWidthMode ( 3, QListView::Manual );
79 79
80 listview->header()->setTracking ( FALSE ); 80 listview->header()->setTracking ( FALSE );
81 connect ( listview->header(), SIGNAL ( sizeChange ( int, int, int ) ), this, SLOT ( saveColumnSize ( int, int, int ) ) ); 81 connect ( listview->header(), SIGNAL ( sizeChange(int,int,int) ), this, SLOT ( saveColumnSize(int,int,int) ) );
82 connect ( listview->header(), SIGNAL ( clicked ( int ) ), this, SLOT ( saveSortingPreference ( int ) ) ); 82 connect ( listview->header(), SIGNAL ( clicked(int) ), this, SLOT ( saveSortingPreference(int) ) );
83 83
84 // pull the column sorting preference from the preferences table, and configure the listview accordingly 84 // pull the column sorting preference from the preferences table, and configure the listview accordingly
85 int column = 0; 85 int column = 0;
86 int direction = 0; 86 int direction = 0;
87 preferences->getSortingPreference ( 3, &column, &direction ); 87 preferences->getSortingPreference ( 3, &column, &direction );
88 listview->setSorting ( column, direction ); 88 listview->setSorting ( column, direction );
89 89
90 displayBudgetNames(); 90 displayBudgetNames();
91 91
92 layout = new QVBoxLayout ( this, 2, 2 ); 92 layout = new QVBoxLayout ( this, 2, 2 );
93 layout->setMenuBar ( menu ); 93 layout->setMenuBar ( menu );
94 layout->addWidget ( firstline ); 94 layout->addWidget ( firstline );
95 layout->addWidget ( secondline ); 95 layout->addWidget ( secondline );
96 layout->addWidget ( listview ); 96 layout->addWidget ( listview );
97 } 97 }
98 98
99void BudgetDisplay::deleteBudget () 99void BudgetDisplay::deleteBudget ()
100 { 100 {
101 listview->clear(); 101 listview->clear();
102 transaction->clearBudgetIDs ( currentbudget ); 102 transaction->clearBudgetIDs ( currentbudget );
103 budget->deleteBudget ( currentbudget ); 103 budget->deleteBudget ( currentbudget );
104 if ( budgetbox->count() != 0 ) 104 if ( budgetbox->count() != 0 )
105 displayBudgetNames(); 105 displayBudgetNames();
106 checkBudgets(); 106 checkBudgets();
107 } 107 }
108 108
109void BudgetDisplay::saveColumnSize ( int column, int oldsize, int newsize ) 109void BudgetDisplay::saveColumnSize ( int column, int oldsize, int newsize )
110 { 110 {
111 switch ( column ) 111 switch ( column )
112 { 112 {
113 case 0: 113 case 0:
114 preferences->changeColumnPreference ( 13, newsize ); 114 preferences->changeColumnPreference ( 13, newsize );
115 break; 115 break;
116 case 1: 116 case 1:
117 preferences->changeColumnPreference ( 14, newsize ); 117 preferences->changeColumnPreference ( 14, newsize );
118 break; 118 break;
119 case 2: 119 case 2:
120 preferences->changeColumnPreference ( 15, newsize ); 120 preferences->changeColumnPreference ( 15, newsize );
121 break; 121 break;
122 } 122 }
123 } 123 }
124 124
125void BudgetDisplay::saveSortingPreference ( int column ) 125void BudgetDisplay::saveSortingPreference ( int column )
126 { 126 {
127 preferences->changeSortingPreference ( 3, column ); 127 preferences->changeSortingPreference ( 3, column );
128 } 128 }
129 129
130int BudgetDisplay::getIDColumn () 130int BudgetDisplay::getIDColumn ()
diff --git a/noncore/apps/qashmoney/calculator.cpp b/noncore/apps/qashmoney/calculator.cpp
index 0e0a043..2c92103 100755
--- a/noncore/apps/qashmoney/calculator.cpp
+++ b/noncore/apps/qashmoney/calculator.cpp
@@ -1,106 +1,106 @@
1#include "calculator.h" 1#include "calculator.h"
2 2
3#include <qpushbutton.h> 3#include <qpushbutton.h>
4 4
5Calculator::Calculator ( QWidget* parent ) : QDialog ( parent, 0, TRUE ) 5Calculator::Calculator ( QWidget* parent ) : QDialog ( parent, 0, TRUE )
6 { 6 {
7 7
8 display = new QLineEdit ( this, "display" ); 8 display = new QLineEdit ( this, "display" );
9 display->setFrame ( FALSE ); 9 display->setFrame ( FALSE );
10 display->setAlignment ( Qt::AlignRight ); 10 display->setAlignment ( Qt::AlignRight );
11 11
12 QPushButton *one = new QPushButton ( "1", this, "one" ); // make buttons for first row 12 QPushButton *one = new QPushButton ( "1", this, "one" ); // make buttons for first row
13 one->setFlat ( TRUE ); 13 one->setFlat ( TRUE );
14 connect ( one, SIGNAL ( released () ), this, SLOT ( displayOne () ) ); 14 connect ( one, SIGNAL ( released() ), this, SLOT ( displayOne() ) );
15 15
16 QPushButton *two = new QPushButton ( "2", this, "two" ); 16 QPushButton *two = new QPushButton ( "2", this, "two" );
17 two->setFlat ( TRUE ); 17 two->setFlat ( TRUE );
18 connect ( two, SIGNAL ( released () ), this, SLOT ( displayTwo () ) ); 18 connect ( two, SIGNAL ( released() ), this, SLOT ( displayTwo() ) );
19 19
20 QPushButton *three = new QPushButton ( "3", this, "three" ); 20 QPushButton *three = new QPushButton ( "3", this, "three" );
21 three->setFlat ( TRUE ); 21 three->setFlat ( TRUE );
22 connect ( three, SIGNAL ( released () ), this, SLOT ( displayThree () ) ); 22 connect ( three, SIGNAL ( released() ), this, SLOT ( displayThree() ) );
23 23
24 QPushButton *four = new QPushButton ( "4", this, "four" ); // make buttons for second row 24 QPushButton *four = new QPushButton ( "4", this, "four" ); // make buttons for second row
25 four->setFlat ( TRUE ); 25 four->setFlat ( TRUE );
26 connect ( four, SIGNAL ( released () ), this, SLOT ( displayFour () ) ); 26 connect ( four, SIGNAL ( released() ), this, SLOT ( displayFour() ) );
27 27
28 QPushButton *five = new QPushButton ( "5", this, "five" ); 28 QPushButton *five = new QPushButton ( "5", this, "five" );
29 five->setFlat ( TRUE ); 29 five->setFlat ( TRUE );
30 connect ( five, SIGNAL ( released () ), this, SLOT ( displayFive () ) ); 30 connect ( five, SIGNAL ( released() ), this, SLOT ( displayFive() ) );
31 31
32 QPushButton *six = new QPushButton ( "6", this, "six" ); 32 QPushButton *six = new QPushButton ( "6", this, "six" );
33 six->setFlat ( TRUE ); 33 six->setFlat ( TRUE );
34 connect ( six, SIGNAL ( released () ), this, SLOT ( displaySix () ) ); 34 connect ( six, SIGNAL ( released() ), this, SLOT ( displaySix() ) );
35 35
36 QPushButton *seven = new QPushButton ( "7", this, "seven" ); // make buttons for third row 36 QPushButton *seven = new QPushButton ( "7", this, "seven" ); // make buttons for third row
37 seven->setFlat ( TRUE ); 37 seven->setFlat ( TRUE );
38 connect ( seven, SIGNAL ( released () ), this, SLOT ( displaySeven () ) ); 38 connect ( seven, SIGNAL ( released() ), this, SLOT ( displaySeven() ) );
39 39
40 QPushButton *eight = new QPushButton ( "8", this, "eight" ); 40 QPushButton *eight = new QPushButton ( "8", this, "eight" );
41 eight->setFlat ( TRUE ); 41 eight->setFlat ( TRUE );
42 connect ( eight, SIGNAL ( released () ), this, SLOT ( displayEight () ) ); 42 connect ( eight, SIGNAL ( released() ), this, SLOT ( displayEight() ) );
43 43
44 QPushButton *nine = new QPushButton ( "9", this, "nine" ); 44 QPushButton *nine = new QPushButton ( "9", this, "nine" );
45 nine->setFlat ( TRUE ); 45 nine->setFlat ( TRUE );
46 connect ( nine, SIGNAL ( released () ), this, SLOT ( displayNine () ) ); 46 connect ( nine, SIGNAL ( released() ), this, SLOT ( displayNine() ) );
47 47
48 QPushButton *zero = new QPushButton ( "0", this, "zero" ); 48 QPushButton *zero = new QPushButton ( "0", this, "zero" );
49 zero->setFlat ( TRUE ); 49 zero->setFlat ( TRUE );
50 connect ( zero, SIGNAL ( released () ), this, SLOT ( displayZero () ) ); 50 connect ( zero, SIGNAL ( released() ), this, SLOT ( displayZero() ) );
51 51
52 QPushButton *dp = new QPushButton ( ".", this, "dp" ); 52 QPushButton *dp = new QPushButton ( ".", this, "dp" );
53 dp->setFlat ( TRUE ); 53 dp->setFlat ( TRUE );
54 connect ( dp, SIGNAL ( released () ), this, SLOT ( displayPoint () ) ); 54 connect ( dp, SIGNAL ( released() ), this, SLOT ( displayPoint() ) );
55 55
56 QPushButton *back = new QPushButton ( "<-", this, "back" ); 56 QPushButton *back = new QPushButton ( "<-", this, "back" );
57 back->setFlat ( TRUE ); 57 back->setFlat ( TRUE );
58 connect ( back, SIGNAL ( released () ), this, SLOT ( back () ) ); 58 connect ( back, SIGNAL ( released() ), this, SLOT ( back() ) );
59 59
60 layout = new QGridLayout ( this, 5, 3, 5, 1, "calculatorlayout" ); 60 layout = new QGridLayout ( this, 5, 3, 5, 1, "calculatorlayout" );
61 layout->addMultiCellWidget ( display, 0, 0, 0, 2 ); 61 layout->addMultiCellWidget ( display, 0, 0, 0, 2 );
62 layout->addWidget ( one, 1, 0 ); 62 layout->addWidget ( one, 1, 0 );
63 layout->addWidget ( two, 1, 1 ); 63 layout->addWidget ( two, 1, 1 );
64 layout->addWidget ( three, 1, 2 ); 64 layout->addWidget ( three, 1, 2 );
65 layout->addWidget ( four, 2, 0 ); 65 layout->addWidget ( four, 2, 0 );
66 layout->addWidget ( five, 2, 1 ); 66 layout->addWidget ( five, 2, 1 );
67 layout->addWidget ( six, 2, 2 ); 67 layout->addWidget ( six, 2, 2 );
68 layout->addWidget ( seven, 3, 0 ); 68 layout->addWidget ( seven, 3, 0 );
69 layout->addWidget ( eight, 3, 1 ); 69 layout->addWidget ( eight, 3, 1 );
70 layout->addWidget ( nine, 3, 2 ); 70 layout->addWidget ( nine, 3, 2 );
71 layout->addWidget ( zero, 4, 0 ); 71 layout->addWidget ( zero, 4, 0 );
72 layout->addWidget ( dp, 4, 1 ); 72 layout->addWidget ( dp, 4, 1 );
73 layout->addWidget ( back, 4, 2 ); 73 layout->addWidget ( back, 4, 2 );
74 74
75 } 75 }
76 76
77void Calculator::displayOne () 77void Calculator::displayOne ()
78 { display->insert ( "1" ); } 78 { display->insert ( "1" ); }
79 79
80void Calculator::displayTwo () 80void Calculator::displayTwo ()
81 { display->insert ( "2" ); } 81 { display->insert ( "2" ); }
82 82
83void Calculator::displayThree () 83void Calculator::displayThree ()
84 { display->insert ( "3" ); } 84 { display->insert ( "3" ); }
85 85
86void Calculator::displayFour () 86void Calculator::displayFour ()
87 { display->insert ( "4" ); } 87 { display->insert ( "4" ); }
88 88
89void Calculator::displayFive () 89void Calculator::displayFive ()
90 { display->insert ( "5" ); } 90 { display->insert ( "5" ); }
91 91
92void Calculator::displaySix () 92void Calculator::displaySix ()
93 { display->insert ( "6" ); } 93 { display->insert ( "6" ); }
94 94
95void Calculator::displaySeven () 95void Calculator::displaySeven ()
96 { display->insert ( "7" ); } 96 { display->insert ( "7" ); }
97 97
98void Calculator::displayEight () 98void Calculator::displayEight ()
99 { display->insert ( "8" ); } 99 { display->insert ( "8" ); }
100 100
101void Calculator::displayNine () 101void Calculator::displayNine ()
102 { display->insert ( "9" ); } 102 { display->insert ( "9" ); }
103 103
104void Calculator::displayZero () 104void Calculator::displayZero ()
105 { display->insert ( "0" ); } 105 { display->insert ( "0" ); }
106 106
diff --git a/noncore/apps/qashmoney/datepicker.cpp b/noncore/apps/qashmoney/datepicker.cpp
index 02fbcf3..7997c0b 100755
--- a/noncore/apps/qashmoney/datepicker.cpp
+++ b/noncore/apps/qashmoney/datepicker.cpp
@@ -1,70 +1,70 @@
1#include "datepicker.h" 1#include "datepicker.h"
2 2
3DatePicker::DatePicker ( QDate entrydate ) : QDialog ( 0, 0, TRUE ) 3DatePicker::DatePicker ( QDate entrydate ) : QDialog ( 0, 0, TRUE )
4 { 4 {
5 setCaption ( "Select Date" ); 5 setCaption ( "Select Date" );
6 date = entrydate; 6 date = entrydate;
7 day = date.day(); 7 day = date.day();
8 month = date.month(); 8 month = date.month();
9 year = date.year(); 9 year = date.year();
10 10
11 daylabel = new QLabel ( "Day", this ); 11 daylabel = new QLabel ( "Day", this );
12 monthlabel = new QLabel ( "Month", this ); 12 monthlabel = new QLabel ( "Month", this );
13 yearlabel = new QLabel ( "Year", this ); 13 yearlabel = new QLabel ( "Year", this );
14 14
15 daybox = new QComboBox ( this, "daybox" ); 15 daybox = new QComboBox ( this, "daybox" );
16 connect ( daybox, SIGNAL ( activated ( int ) ), this, SLOT ( setDay ( int ) ) ); 16 connect ( daybox, SIGNAL ( activated(int) ), this, SLOT ( setDay(int) ) );
17 displayDays ( daybox ); 17 displayDays ( daybox );
18 monthbox = new QComboBox ( this, "monthbox" ); 18 monthbox = new QComboBox ( this, "monthbox" );
19 connect ( monthbox, SIGNAL ( activated ( int ) ), this, SLOT ( setMonth ( int ) ) ); 19 connect ( monthbox, SIGNAL ( activated(int) ), this, SLOT ( setMonth(int) ) );
20 displayMonths ( monthbox ); 20 displayMonths ( monthbox );
21 yearbox = new QComboBox ( this, "yearbox" ); 21 yearbox = new QComboBox ( this, "yearbox" );
22 connect ( yearbox, SIGNAL ( activated ( int ) ), this, SLOT ( setYear ( int ) ) ); 22 connect ( yearbox, SIGNAL ( activated(int) ), this, SLOT ( setYear(int) ) );
23 displayYears ( yearbox ); 23 displayYears ( yearbox );
24 24
25 layout = new QGridLayout ( this, 2, 3, 5, 5, "datepickerlayout" ); 25 layout = new QGridLayout ( this, 2, 3, 5, 5, "datepickerlayout" );
26 layout->addWidget ( daylabel, 0, 2 ); 26 layout->addWidget ( daylabel, 0, 2 );
27 layout->addWidget ( monthlabel, 0, 1 ); 27 layout->addWidget ( monthlabel, 0, 1 );
28 layout->addWidget ( yearlabel, 0, 0 ); 28 layout->addWidget ( yearlabel, 0, 0 );
29 layout->addWidget ( daybox, 1, 2 ); 29 layout->addWidget ( daybox, 1, 2 );
30 layout->addWidget ( monthbox, 1, 1 ); 30 layout->addWidget ( monthbox, 1, 1 );
31 layout->addWidget ( yearbox, 1, 0 ); 31 layout->addWidget ( yearbox, 1, 0 );
32 } 32 }
33 33
34void DatePicker::displayDays ( QComboBox *daybox ) 34void DatePicker::displayDays ( QComboBox *daybox )
35 { 35 {
36 int counter; 36 int counter;
37 int days = date.daysInMonth(); 37 int days = date.daysInMonth();
38 for ( counter = 1; counter <= days; counter++ ) 38 for ( counter = 1; counter <= days; counter++ )
39 daybox->insertItem ( QString::number ( counter ) ); 39 daybox->insertItem ( QString::number ( counter ) );
40 daybox->setCurrentItem ( ( date.day() ) - 1 ); 40 daybox->setCurrentItem ( ( date.day() ) - 1 );
41 } 41 }
42 42
43void DatePicker::displayMonths ( QComboBox *monthbox ) 43void DatePicker::displayMonths ( QComboBox *monthbox )
44 { 44 {
45 int counter; 45 int counter;
46 for ( counter = 1; counter <= 12; counter++ ) 46 for ( counter = 1; counter <= 12; counter++ )
47 monthbox->insertItem ( QString::number ( counter ) ); 47 monthbox->insertItem ( QString::number ( counter ) );
48 monthbox->setCurrentItem ( ( date.month() ) - 1 ); 48 monthbox->setCurrentItem ( ( date.month() ) - 1 );
49 } 49 }
50 50
51void DatePicker::displayYears ( QComboBox *yearbox ) 51void DatePicker::displayYears ( QComboBox *yearbox )
52 { 52 {
53 int counter; 53 int counter;
54 int indexcounter = 0; 54 int indexcounter = 0;
55 int yearindex = 0; 55 int yearindex = 0;
56 int year = date.year(); 56 int year = date.year();
57 for ( counter = ( year - 1 ); counter <= ( year + 1 ); counter++ ) 57 for ( counter = ( year - 1 ); counter <= ( year + 1 ); counter++ )
58 { 58 {
59 yearbox->insertItem ( QString::number ( counter ) ); 59 yearbox->insertItem ( QString::number ( counter ) );
60 if ( date.year() == counter ) 60 if ( date.year() == counter )
61 yearindex = indexcounter; 61 yearindex = indexcounter;
62 indexcounter ++; 62 indexcounter ++;
63 } 63 }
64 yearbox->setCurrentItem ( yearindex ); 64 yearbox->setCurrentItem ( yearindex );
65 } 65 }
66 66
67void DatePicker::setDay ( int index ) 67void DatePicker::setDay ( int index )
68 { 68 {
69 day = daybox->text ( index ).toInt(); 69 day = daybox->text ( index ).toInt();
70 } 70 }
diff --git a/noncore/apps/qashmoney/memorydialog.cpp b/noncore/apps/qashmoney/memorydialog.cpp
index e9ebd54..ba11540 100755
--- a/noncore/apps/qashmoney/memorydialog.cpp
+++ b/noncore/apps/qashmoney/memorydialog.cpp
@@ -1,75 +1,75 @@
1#include "memorydialog.h" 1#include "memorydialog.h"
2#include "memory.h" 2#include "memory.h"
3#include <qmessagebox.h> 3#include <qmessagebox.h>
4 4
5extern Memory *memory; 5extern Memory *memory;
6 6
7MemoryDialog::MemoryDialog () : QDialog ( 0, 0, TRUE ) 7MemoryDialog::MemoryDialog () : QDialog ( 0, 0, TRUE )
8{ 8{
9 setCaption ( tr ( "Edit Memory" ) ); 9 setCaption ( tr ( "Edit Memory" ) );
10 10
11 listbox = new QListBox ( this, "listbox" ); 11 listbox = new QListBox ( this, "listbox" );
12 memory->displayMemoryItems ( listbox ); 12 memory->displayMemoryItems ( listbox );
13 listbox->clearSelection(); 13 listbox->clearSelection();
14 14
15 secondline = new QHBox ( this ); 15 secondline = new QHBox ( this );
16 16
17 newbutton = new QPushButton ( secondline ); 17 newbutton = new QPushButton ( secondline );
18 newbutton->setPixmap( QPixmap ("/opt/QtPalmtop/pics/new.png") ); 18 newbutton->setPixmap( QPixmap ("/opt/QtPalmtop/pics/new.png") );
19 connect ( newbutton, SIGNAL ( released () ), this, SLOT ( addItem () ) ); 19 connect ( newbutton, SIGNAL ( released() ), this, SLOT ( addItem() ) );
20 20
21 editbutton = new QPushButton ( secondline ); 21 editbutton = new QPushButton ( secondline );
22 editbutton->setPixmap( QPixmap ("/opt/QtPalmtop/pics/edit.png") ); 22 editbutton->setPixmap( QPixmap ("/opt/QtPalmtop/pics/edit.png") );
23 connect ( editbutton, SIGNAL ( released () ), this, SLOT ( editItem () ) ); 23 connect ( editbutton, SIGNAL ( released() ), this, SLOT ( editItem() ) );
24 24
25 deletebutton = new QPushButton( secondline ); 25 deletebutton = new QPushButton( secondline );
26 deletebutton->setPixmap( QPixmap ("/opt/QtPalmtop/pics/delete.png") ); 26 deletebutton->setPixmap( QPixmap ("/opt/QtPalmtop/pics/delete.png") );
27 connect ( deletebutton, SIGNAL ( released () ), this, SLOT ( deleteItem () ) ); 27 connect ( deletebutton, SIGNAL ( released() ), this, SLOT ( deleteItem() ) );
28 28
29 lineedit = new QLineEdit ( this ); 29 lineedit = new QLineEdit ( this );
30 30
31 layout = new QVBoxLayout ( this, 2, 2 ); 31 layout = new QVBoxLayout ( this, 2, 2 );
32 layout->addWidget ( listbox ); 32 layout->addWidget ( listbox );
33 layout->addWidget ( secondline ); 33 layout->addWidget ( secondline );
34 layout->addWidget ( lineedit ); 34 layout->addWidget ( lineedit );
35} 35}
36 36
37MemoryDialog::~MemoryDialog() 37MemoryDialog::~MemoryDialog()
38 { 38 {
39 } 39 }
40 40
41void MemoryDialog::addItem () 41void MemoryDialog::addItem ()
42 { 42 {
43 if ( lineedit->text().length() != 0 ) 43 if ( lineedit->text().length() != 0 )
44 { 44 {
45 memory->addMemoryItem ( lineedit->text() ); 45 memory->addMemoryItem ( lineedit->text() );
46 listbox->clear (); 46 listbox->clear ();
47 memory->displayMemoryItems ( listbox ); 47 memory->displayMemoryItems ( listbox );
48 listbox->clearFocus(); 48 listbox->clearFocus();
49 listbox->clearSelection (); 49 listbox->clearSelection ();
50 lineedit->clear(); 50 lineedit->clear();
51 } 51 }
52 } 52 }
53 53
54void MemoryDialog::editItem () 54void MemoryDialog::editItem ()
55 { 55 {
56 if ( listbox->currentItem() != -1 ) 56 if ( listbox->currentItem() != -1 )
57 { 57 {
58 lineedit->setText ( listbox->currentText() ); 58 lineedit->setText ( listbox->currentText() );
59 memory->deleteMemoryItem ( listbox->currentText() ); 59 memory->deleteMemoryItem ( listbox->currentText() );
60 listbox->clear (); 60 listbox->clear ();
61 memory->displayMemoryItems ( listbox ); 61 memory->displayMemoryItems ( listbox );
62 listbox->clearSelection(); 62 listbox->clearSelection();
63 } 63 }
64 else 64 else
65 QMessageBox::warning ( this, "QashMoney", "Please select an item to edit." ); 65 QMessageBox::warning ( this, "QashMoney", "Please select an item to edit." );
66 } 66 }
67 67
68void MemoryDialog::deleteItem () 68void MemoryDialog::deleteItem ()
69 { 69 {
70 if ( listbox->currentItem() != -1 ) 70 if ( listbox->currentItem() != -1 )
71 { 71 {
72 memory->deleteMemoryItem ( listbox->currentText() ); 72 memory->deleteMemoryItem ( listbox->currentText() );
73 listbox->clear (); 73 listbox->clear ();
74 memory->displayMemoryItems ( listbox ); 74 memory->displayMemoryItems ( listbox );
75 listbox->clearSelection(); 75 listbox->clearSelection();
diff --git a/noncore/apps/qashmoney/newaccount.cpp b/noncore/apps/qashmoney/newaccount.cpp
index 7e57a18..5932182 100755
--- a/noncore/apps/qashmoney/newaccount.cpp
+++ b/noncore/apps/qashmoney/newaccount.cpp
@@ -31,102 +31,102 @@ NewAccount::NewAccount ( QWidget *parent, const char *name, bool modal ) : QDial
31 31
32 childlabel = new QLabel ( "Child of", this ); 32 childlabel = new QLabel ( "Child of", this );
33 childbox = new QComboBox ( FALSE, this ); 33 childbox = new QComboBox ( FALSE, this );
34 hideChildPulldownMenu (); 34 hideChildPulldownMenu ();
35 35
36 balancelabel = new QLabel ( "Balance", this ); 36 balancelabel = new QLabel ( "Balance", this );
37 37
38 balancebox = new QHBox ( this ); 38 balancebox = new QHBox ( this );
39 accountbalance = new QLineEdit ( balancebox ); 39 accountbalance = new QLineEdit ( balancebox );
40 accountbalance->setText ( "0.00" ); 40 accountbalance->setText ( "0.00" );
41 balancecalculator = new QPushButton( balancebox ); 41 balancecalculator = new QPushButton( balancebox );
42 balancecalculator->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/kcalc.png" ) ); 42 balancecalculator->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/kcalc.png" ) );
43 43
44 creditlimitlabel = new QLabel ( "Credit Limit", this ); 44 creditlimitlabel = new QLabel ( "Credit Limit", this );
45 45
46 creditlimitbox = new QHBox ( this ); 46 creditlimitbox = new QHBox ( this );
47 creditlimit = new QLineEdit ( creditlimitbox ); 47 creditlimit = new QLineEdit ( creditlimitbox );
48 creditlimitbox->setEnabled ( FALSE ); 48 creditlimitbox->setEnabled ( FALSE );
49 creditlimitcalculator = new QPushButton( creditlimitbox ); 49 creditlimitcalculator = new QPushButton( creditlimitbox );
50 creditlimitcalculator->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/kcalc.png" ) ); 50 creditlimitcalculator->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/kcalc.png" ) );
51 51
52 currencybox = new Currency ( this ); 52 currencybox = new Currency ( this );
53 53
54 typelabel = new QLabel ( "Type", this ); 54 typelabel = new QLabel ( "Type", this );
55 accounttype = new QComboBox ( FALSE, this ); 55 accounttype = new QComboBox ( FALSE, this );
56 accounttype->insertItem( tr( "Bank" ) ); 56 accounttype->insertItem( tr( "Bank" ) );
57 accounttype->insertItem( tr( "Cash" ) ); 57 accounttype->insertItem( tr( "Cash" ) );
58 accounttype->insertItem( tr( "Credit Card" ) ); 58 accounttype->insertItem( tr( "Credit Card" ) );
59 accounttype->insertItem( tr( "Equity" ) ); 59 accounttype->insertItem( tr( "Equity" ) );
60 accounttype->insertItem( tr( "Asset" ) ); 60 accounttype->insertItem( tr( "Asset" ) );
61 accounttype->insertItem( tr( "Liability" ) ); 61 accounttype->insertItem( tr( "Liability" ) );
62 62
63 layout = new QGridLayout ( this, 7, 2, 4, 2 ); 63 layout = new QGridLayout ( this, 7, 2, 4, 2 );
64 layout->addWidget ( namelabel , 0, 0, Qt::AlignLeft ); 64 layout->addWidget ( namelabel , 0, 0, Qt::AlignLeft );
65 layout->addWidget ( accountbox, 1, 0, Qt::AlignLeft ); 65 layout->addWidget ( accountbox, 1, 0, Qt::AlignLeft );
66 layout->addWidget ( datelabel, 2, 0, Qt::AlignLeft ); 66 layout->addWidget ( datelabel, 2, 0, Qt::AlignLeft );
67 layout->addWidget ( datebox, 3, 0, Qt::AlignLeft ); 67 layout->addWidget ( datebox, 3, 0, Qt::AlignLeft );
68 layout->addWidget ( childcheckbox, 4, 0, Qt::AlignLeft ); 68 layout->addWidget ( childcheckbox, 4, 0, Qt::AlignLeft );
69 layout->addWidget ( childlabel, 5, 0, Qt::AlignLeft ); 69 layout->addWidget ( childlabel, 5, 0, Qt::AlignLeft );
70 layout->addWidget ( childbox, 6, 0, Qt::AlignLeft ); 70 layout->addWidget ( childbox, 6, 0, Qt::AlignLeft );
71 layout->addWidget ( balancelabel, 0, 1, Qt::AlignLeft ); 71 layout->addWidget ( balancelabel, 0, 1, Qt::AlignLeft );
72 layout->addWidget ( balancebox, 1, 1, Qt::AlignLeft ); 72 layout->addWidget ( balancebox, 1, 1, Qt::AlignLeft );
73 layout->addWidget ( creditlimitlabel, 2, 1, Qt::AlignLeft ); 73 layout->addWidget ( creditlimitlabel, 2, 1, Qt::AlignLeft );
74 layout->addWidget ( creditlimitbox, 3, 1, Qt::AlignLeft ); 74 layout->addWidget ( creditlimitbox, 3, 1, Qt::AlignLeft );
75 layout->addWidget ( currencybox, 4, 1, Qt::AlignLeft ); 75 layout->addWidget ( currencybox, 4, 1, Qt::AlignLeft );
76 layout->addWidget ( typelabel, 5, 1, Qt::AlignLeft ); 76 layout->addWidget ( typelabel, 5, 1, Qt::AlignLeft );
77 layout->addWidget ( accounttype, 6, 1, Qt::AlignLeft ); 77 layout->addWidget ( accounttype, 6, 1, Qt::AlignLeft );
78 78
79 connect ( childcheckbox, SIGNAL ( clicked () ), this, SLOT ( showChildPulldownMenu() ) ); 79 connect ( childcheckbox, SIGNAL ( clicked() ), this, SLOT ( showChildPulldownMenu() ) );
80 connect ( balancecalculator, SIGNAL ( released() ), this, SLOT ( showCalculator() ) ); 80 connect ( balancecalculator, SIGNAL ( released() ), this, SLOT ( showCalculator() ) );
81 connect ( creditlimitcalculator, SIGNAL ( released() ), this, SLOT ( showCreditLimitCalculator() ) ); 81 connect ( creditlimitcalculator, SIGNAL ( released() ), this, SLOT ( showCreditLimitCalculator() ) );
82 connect ( accounttype, SIGNAL ( activated ( int ) ), this, SLOT ( activateCreditLimit ( int ) ) ); 82 connect ( accounttype, SIGNAL ( activated(int) ), this, SLOT ( activateCreditLimit(int) ) );
83 connect ( datebutton, SIGNAL ( released () ), this, SLOT ( showCalendar () ) ); 83 connect ( datebutton, SIGNAL ( released() ), this, SLOT ( showCalendar() ) );
84 connect ( descriptionbutton, SIGNAL ( released () ), this, SLOT ( addAccountDescription() ) ); 84 connect ( descriptionbutton, SIGNAL ( released() ), this, SLOT ( addAccountDescription() ) );
85} 85}
86 86
87NewAccount::~NewAccount () 87NewAccount::~NewAccount ()
88 { 88 {
89 } 89 }
90 90
91void NewAccount::showChildPulldownMenu () 91void NewAccount::showChildPulldownMenu ()
92 { 92 {
93 if ( childcheckbox->isChecked() == TRUE ) 93 if ( childcheckbox->isChecked() == TRUE )
94 { 94 {
95 childlabel->setEnabled ( TRUE ); 95 childlabel->setEnabled ( TRUE );
96 childbox->setEnabled ( TRUE ); 96 childbox->setEnabled ( TRUE );
97 } 97 }
98 else 98 else
99 hideChildPulldownMenu(); 99 hideChildPulldownMenu();
100 } 100 }
101 101
102void NewAccount::hideChildPulldownMenu () 102void NewAccount::hideChildPulldownMenu ()
103 { 103 {
104 childlabel->setEnabled ( FALSE ); 104 childlabel->setEnabled ( FALSE );
105 childbox->setEnabled ( FALSE ); 105 childbox->setEnabled ( FALSE );
106 } 106 }
107 107
108void NewAccount::showCalculator () 108void NewAccount::showCalculator ()
109 { 109 {
110 Calculator *calculator = new Calculator ( this ); 110 Calculator *calculator = new Calculator ( this );
111 calculator->setMaximumWidth ( ( int ) ( this->size().width() * 0.9 ) ); 111 calculator->setMaximumWidth ( ( int ) ( this->size().width() * 0.9 ) );
112 if ( calculator->exec () == QDialog::Accepted ) 112 if ( calculator->exec () == QDialog::Accepted )
113 accountbalance->setText ( calculator->display->text() ); 113 accountbalance->setText ( calculator->display->text() );
114 } 114 }
115 115
116void NewAccount::showCreditLimitCalculator () 116void NewAccount::showCreditLimitCalculator ()
117 { 117 {
118 Calculator *calculator = new Calculator ( this ); 118 Calculator *calculator = new Calculator ( this );
119 calculator->setMaximumWidth ( ( int ) ( this->size().width() * 0.9 ) ); 119 calculator->setMaximumWidth ( ( int ) ( this->size().width() * 0.9 ) );
120 if ( calculator->exec () == QDialog::Accepted ) 120 if ( calculator->exec () == QDialog::Accepted )
121 creditlimit->setText ( calculator->display->text() ); 121 creditlimit->setText ( calculator->display->text() );
122 } 122 }
123 123
124void NewAccount::activateCreditLimit ( int index ) 124void NewAccount::activateCreditLimit ( int index )
125 { 125 {
126 if ( index == 2 || index == 5 ) 126 if ( index == 2 || index == 5 )
127 creditlimitbox->setEnabled ( TRUE ); 127 creditlimitbox->setEnabled ( TRUE );
128 else 128 else
129 { 129 {
130 creditlimit->clear (); 130 creditlimit->clear ();
131 creditlimitbox->setEnabled ( FALSE ); 131 creditlimitbox->setEnabled ( FALSE );
132 } 132 }
diff --git a/noncore/apps/qashmoney/newtransaction.cpp b/noncore/apps/qashmoney/newtransaction.cpp
index 5c78139..87b7f7e 100755
--- a/noncore/apps/qashmoney/newtransaction.cpp
+++ b/noncore/apps/qashmoney/newtransaction.cpp
@@ -1,136 +1,136 @@
1#include "newtransaction.h" 1#include "newtransaction.h"
2#include "calculator.h" 2#include "calculator.h"
3#include "datepicker.h" 3#include "datepicker.h"
4#include "budget.h" 4#include "budget.h"
5 5
6#include <qmultilineedit.h> 6#include <qmultilineedit.h>
7 7
8extern Budget *budget; 8extern Budget *budget;
9extern Preferences *preferences; 9extern Preferences *preferences;
10 10
11NewTransaction::NewTransaction ( QWidget* parent ) : QDialog ( parent, 0, TRUE ) 11NewTransaction::NewTransaction ( QWidget* parent ) : QDialog ( parent, 0, TRUE )
12 { 12 {
13 transactiondescription = ""; 13 transactiondescription = "";
14 currentlineitem = -1; 14 currentlineitem = -1;
15 currentbudget = -1; 15 currentbudget = -1;
16 dateedited = FALSE; 16 dateedited = FALSE;
17 setCaption( tr( "Transaction" ) ); 17 setCaption( tr( "Transaction" ) );
18 18
19 // START FIRST COLUMN 19 // START FIRST COLUMN
20 20
21 namelabel = new QLabel ( "Transaction", this ); 21 namelabel = new QLabel ( "Transaction", this );
22 22
23 transactionnamebox = new QHBox ( this ); 23 transactionnamebox = new QHBox ( this );
24 transactionname = new QComboBox ( transactionnamebox ); 24 transactionname = new QComboBox ( transactionnamebox );
25 transactionname->setEditable ( TRUE ); 25 transactionname->setEditable ( TRUE );
26 descriptionbutton = new QPushButton ( transactionnamebox ); 26 descriptionbutton = new QPushButton ( transactionnamebox );
27 descriptionbutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/info.png" ) ); 27 descriptionbutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/info.png" ) );
28 connect ( descriptionbutton, SIGNAL ( released () ), this, SLOT ( addTransactionDescription() ) ); 28 connect ( descriptionbutton, SIGNAL ( released() ), this, SLOT ( addTransactionDescription() ) );
29 29
30 amountlabel = new QLabel ( "Amount", this ); 30 amountlabel = new QLabel ( "Amount", this );
31 31
32 transactionamountbox = new QHBox ( this ); 32 transactionamountbox = new QHBox ( this );
33 transactionamount = new QLineEdit ( transactionamountbox ); 33 transactionamount = new QLineEdit ( transactionamountbox );
34 transactionamount->setAlignment ( Qt::AlignRight ); 34 transactionamount->setAlignment ( Qt::AlignRight );
35 transactionamount->setText ( "0.00" ); 35 transactionamount->setText ( "0.00" );
36 calculatorbutton = new QPushButton( transactionamountbox ); 36 calculatorbutton = new QPushButton( transactionamountbox );
37 calculatorbutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/kcalc.png" ) ); 37 calculatorbutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/kcalc.png" ) );
38 connect ( calculatorbutton, SIGNAL ( released() ), this, SLOT ( showCalculator() ) ); 38 connect ( calculatorbutton, SIGNAL ( released() ), this, SLOT ( showCalculator() ) );
39 39
40 datelabel = new QLabel ( "Date", this ); 40 datelabel = new QLabel ( "Date", this );
41 41
42 transactiondatebox = new QHBox ( this ); 42 transactiondatebox = new QHBox ( this );
43 transactiondate = new QLineEdit ( transactiondatebox ); 43 transactiondate = new QLineEdit ( transactiondatebox );
44 transactiondate->setAlignment ( Qt::AlignRight ); 44 transactiondate->setAlignment ( Qt::AlignRight );
45 transactiondate->setDisabled ( TRUE ); 45 transactiondate->setDisabled ( TRUE );
46 datebutton = new QPushButton( transactiondatebox ); 46 datebutton = new QPushButton( transactiondatebox );
47 datebutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/date.png" ) ); 47 datebutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/date.png" ) );
48 connect ( datebutton, SIGNAL ( released () ), this, SLOT ( showCalendar () ) ); 48 connect ( datebutton, SIGNAL ( released() ), this, SLOT ( showCalendar() ) );
49 49
50 clearedcheckbox = new QCheckBox ( "Cleared", this ); 50 clearedcheckbox = new QCheckBox ( "Cleared", this );
51 depositbox = new QCheckBox ( "Credit", this ); 51 depositbox = new QCheckBox ( "Credit", this );
52 52
53 // START SECOND COLUMN 53 // START SECOND COLUMN
54 54
55 numberlabel = new QLabel ( "Number", this ); 55 numberlabel = new QLabel ( "Number", this );
56 transactionnumber = new QLineEdit ( this ); 56 transactionnumber = new QLineEdit ( this );
57 57
58 budgetlabel = new QLabel ( "Budget", this ); 58 budgetlabel = new QLabel ( "Budget", this );
59 budgetbox = new QComboBox ( FALSE, this ); 59 budgetbox = new QComboBox ( FALSE, this );
60 60
61 lineitemlabel = new QLabel ( "LineItem", this ); 61 lineitemlabel = new QLabel ( "LineItem", this );
62 lineitembox = new QComboBox ( FALSE, this ); 62 lineitembox = new QComboBox ( FALSE, this );
63 63
64 layout = new QGridLayout ( this, 7, 2, 2, 2 ); 64 layout = new QGridLayout ( this, 7, 2, 2, 2 );
65 layout->addWidget ( namelabel, 0, 0, Qt::AlignLeft ); 65 layout->addWidget ( namelabel, 0, 0, Qt::AlignLeft );
66 layout->addWidget ( transactionnamebox, 1, 0, Qt::AlignLeft ); 66 layout->addWidget ( transactionnamebox, 1, 0, Qt::AlignLeft );
67 layout->addWidget ( amountlabel, 2, 0, Qt::AlignLeft ); 67 layout->addWidget ( amountlabel, 2, 0, Qt::AlignLeft );
68 layout->addWidget ( transactionamountbox, 3, 0, Qt::AlignLeft ); 68 layout->addWidget ( transactionamountbox, 3, 0, Qt::AlignLeft );
69 layout->addWidget ( datelabel, 4, 0, Qt::AlignLeft ); 69 layout->addWidget ( datelabel, 4, 0, Qt::AlignLeft );
70 layout->addWidget ( transactiondatebox, 5, 0, Qt::AlignLeft ); 70 layout->addWidget ( transactiondatebox, 5, 0, Qt::AlignLeft );
71 layout->addWidget ( clearedcheckbox, 6, 0, Qt::AlignLeft ); 71 layout->addWidget ( clearedcheckbox, 6, 0, Qt::AlignLeft );
72 layout->addWidget ( numberlabel, 0, 1, Qt::AlignLeft ); 72 layout->addWidget ( numberlabel, 0, 1, Qt::AlignLeft );
73 layout->addWidget ( transactionnumber, 1, 1, Qt::AlignLeft ); 73 layout->addWidget ( transactionnumber, 1, 1, Qt::AlignLeft );
74 layout->addWidget ( budgetlabel, 2, 1, Qt::AlignLeft ); 74 layout->addWidget ( budgetlabel, 2, 1, Qt::AlignLeft );
75 layout->addWidget ( budgetbox, 3, 1, Qt::AlignLeft ); 75 layout->addWidget ( budgetbox, 3, 1, Qt::AlignLeft );
76 layout->addWidget ( lineitemlabel, 4, 1, Qt::AlignLeft ); 76 layout->addWidget ( lineitemlabel, 4, 1, Qt::AlignLeft );
77 layout->addWidget ( lineitembox, 5, 1, Qt::AlignLeft ); 77 layout->addWidget ( lineitembox, 5, 1, Qt::AlignLeft );
78 layout->addWidget ( depositbox, 6, 1, Qt::AlignLeft ); 78 layout->addWidget ( depositbox, 6, 1, Qt::AlignLeft );
79 79
80 if ( budget->getNumberOfBudgets() != 0 ) 80 if ( budget->getNumberOfBudgets() != 0 )
81 { 81 {
82 budgetnameslist = budget->getBudgetNames(); 82 budgetnameslist = budget->getBudgetNames();
83 budgetidslist = budget->getBudgetIDs(); 83 budgetidslist = budget->getBudgetIDs();
84 budgetbox->insertStringList ( *budgetnameslist ); 84 budgetbox->insertStringList ( *budgetnameslist );
85 lineitemlabel->setEnabled ( FALSE ); 85 lineitemlabel->setEnabled ( FALSE );
86 lineitembox->setEnabled ( FALSE ); 86 lineitembox->setEnabled ( FALSE );
87 connect ( budgetbox, SIGNAL ( activated ( int ) ), this, SLOT ( setCurrentBudget ( int ) ) ); 87 connect ( budgetbox, SIGNAL ( activated(int) ), this, SLOT ( setCurrentBudget(int) ) );
88 connect ( lineitembox, SIGNAL ( activated ( int ) ), this, SLOT ( setCurrentLineItem ( int ) ) ); 88 connect ( lineitembox, SIGNAL ( activated(int) ), this, SLOT ( setCurrentLineItem(int) ) );
89 } 89 }
90 else 90 else
91 { 91 {
92 budgetlabel->setEnabled ( FALSE ); 92 budgetlabel->setEnabled ( FALSE );
93 budgetbox->setEnabled ( FALSE ); 93 budgetbox->setEnabled ( FALSE );
94 lineitemlabel->setEnabled ( FALSE ); 94 lineitemlabel->setEnabled ( FALSE );
95 lineitembox->setEnabled ( FALSE ); 95 lineitembox->setEnabled ( FALSE );
96 } 96 }
97 97
98} 98}
99 99
100NewTransaction::~NewTransaction () 100NewTransaction::~NewTransaction ()
101 { 101 {
102 } 102 }
103 103
104void NewTransaction::showCalculator () 104void NewTransaction::showCalculator ()
105{ 105{
106 Calculator *calculator = new Calculator ( this ); 106 Calculator *calculator = new Calculator ( this );
107 calculator->setMaximumWidth ( ( int ) ( this->size().width() * 0.9 ) ); 107 calculator->setMaximumWidth ( ( int ) ( this->size().width() * 0.9 ) );
108 if ( calculator->exec () == QDialog::Accepted ) 108 if ( calculator->exec () == QDialog::Accepted )
109 transactionamount->setText ( calculator->display->text() ); 109 transactionamount->setText ( calculator->display->text() );
110} 110}
111 111
112void NewTransaction::showCalendar () 112void NewTransaction::showCalendar ()
113 { 113 {
114 QDate newDate = QDate::currentDate (); 114 QDate newDate = QDate::currentDate ();
115 DatePicker *dp = new DatePicker ( newDate ); 115 DatePicker *dp = new DatePicker ( newDate );
116 dp->setMaximumWidth ( ( int ) ( this->size().width() * 0.9 ) ); 116 dp->setMaximumWidth ( ( int ) ( this->size().width() * 0.9 ) );
117 117
118 int response = dp->exec(); 118 int response = dp->exec();
119 if ( response == QDialog::Accepted ) 119 if ( response == QDialog::Accepted )
120 { 120 {
121 // Set date integers 121 // Set date integers
122 year = dp->getYear(); 122 year = dp->getYear();
123 month = dp->getMonth(); 123 month = dp->getMonth();
124 day = dp->getDay(); 124 day = dp->getDay();
125 125
126 // Set dateedited to TRUE 126 // Set dateedited to TRUE
127 // This tells the transactiondisplay object that the user edited an transaction 127 // This tells the transactiondisplay object that the user edited an transaction
128 // and did change the date3 128 // and did change the date3
129 dateedited = TRUE; 129 dateedited = TRUE;
130 130
131 // Display date with our selected format 131 // Display date with our selected format
132 transactiondate->setText ( preferences->getDate ( year, month, day ) ); 132 transactiondate->setText ( preferences->getDate ( year, month, day ) );
133 } 133 }
134 } 134 }
135 135
136bool NewTransaction::getDateEdited () 136bool NewTransaction::getDateEdited ()
diff --git a/noncore/apps/qashmoney/preferencedialogs.cpp b/noncore/apps/qashmoney/preferencedialogs.cpp
index 5408a5b..b83c957 100755
--- a/noncore/apps/qashmoney/preferencedialogs.cpp
+++ b/noncore/apps/qashmoney/preferencedialogs.cpp
@@ -1,216 +1,216 @@
1#include "preferencedialogs.h" 1#include "preferencedialogs.h"
2#include "preferences.h" 2#include "preferences.h"
3 3
4extern Preferences *preferences; 4extern Preferences *preferences;
5 5
6DatePreferences::DatePreferences ( QWidget* parent ) : QDialog ( parent, 0, TRUE ) 6DatePreferences::DatePreferences ( QWidget* parent ) : QDialog ( parent, 0, TRUE )
7 { 7 {
8 setCaption( tr( "Date" ) ); 8 setCaption( tr( "Date" ) );
9 9
10 QLabel *datelabel = new QLabel ( "Format", this ); 10 QLabel *datelabel = new QLabel ( "Format", this );
11 dateformat = new QComboBox ( this ); 11 dateformat = new QComboBox ( this );
12 dateformat->setEditable ( FALSE ); 12 dateformat->setEditable ( FALSE );
13 dateformat->insertItem ( "yyyymmdd" ); 13 dateformat->insertItem ( "yyyymmdd" );
14 dateformat->insertItem ( "yymmdd" ); 14 dateformat->insertItem ( "yymmdd" );
15 dateformat->insertItem ( "mmddyyyy" ); 15 dateformat->insertItem ( "mmddyyyy" );
16 dateformat->insertItem ( "mmddyy" ); 16 dateformat->insertItem ( "mmddyy" );
17 dateformat->insertItem ( "yyyyddmm" ); 17 dateformat->insertItem ( "yyyyddmm" );
18 dateformat->insertItem ( "yyddmm" ); 18 dateformat->insertItem ( "yyddmm" );
19 dateformat->insertItem ( "ddmmyyyy" ); 19 dateformat->insertItem ( "ddmmyyyy" );
20 dateformat->insertItem ( "ddmmyy" ); 20 dateformat->insertItem ( "ddmmyy" );
21 connect ( dateformat, SIGNAL ( activated ( int ) ), this, SLOT ( changeDateFormat ( int ) ) ); 21 connect ( dateformat, SIGNAL ( activated(int) ), this, SLOT ( changeDateFormat(int) ) );
22 22
23 QLabel *dateseparatorlabel = new QLabel ( "Separator", this ); 23 QLabel *dateseparatorlabel = new QLabel ( "Separator", this );
24 dateseparator = new QComboBox ( this ); 24 dateseparator = new QComboBox ( this );
25 dateseparator->insertItem ( "/" ); 25 dateseparator->insertItem ( "/" );
26 dateseparator->insertItem ( "-" ); 26 dateseparator->insertItem ( "-" );
27 dateseparator->insertItem ( "." ); 27 dateseparator->insertItem ( "." );
28 connect ( dateseparator, SIGNAL ( activated ( int ) ), this, SLOT ( changeDateSeparator ( int ) ) ); 28 connect ( dateseparator, SIGNAL ( activated(int) ), this, SLOT ( changeDateSeparator(int) ) );
29 29
30 defaults = new QPushButton ( QPixmap ( "/opt/QtPalmtop/pics/defaults.png" ), "Defaults", this ); 30 defaults = new QPushButton ( QPixmap ( "/opt/QtPalmtop/pics/defaults.png" ), "Defaults", this );
31 connect ( defaults, SIGNAL ( released () ), this, SLOT ( setDefaultDatePreferences () ) ); 31 connect ( defaults, SIGNAL ( released() ), this, SLOT ( setDefaultDatePreferences() ) );
32 32
33 dateformat->setCurrentItem ( ( preferences->getPreference ( 1 ) ) - 1 ); 33 dateformat->setCurrentItem ( ( preferences->getPreference ( 1 ) ) - 1 );
34 dateseparator->setCurrentItem ( ( preferences->getPreference ( 2 ) ) - 1 ); 34 dateseparator->setCurrentItem ( ( preferences->getPreference ( 2 ) ) - 1 );
35 35
36 layout = new QVBoxLayout ( this, 2, 2 ); 36 layout = new QVBoxLayout ( this, 2, 2 );
37 layout->addWidget ( datelabel ); 37 layout->addWidget ( datelabel );
38 layout->addWidget ( dateformat ); 38 layout->addWidget ( dateformat );
39 layout->addWidget ( dateseparatorlabel ); 39 layout->addWidget ( dateseparatorlabel );
40 layout->addWidget ( dateseparator ); 40 layout->addWidget ( dateseparator );
41 layout->insertSpacing ( 4, 5 ); 41 layout->insertSpacing ( 4, 5 );
42 layout->addWidget ( defaults ); 42 layout->addWidget ( defaults );
43 43
44 } 44 }
45 45
46DatePreferences::~DatePreferences () 46DatePreferences::~DatePreferences ()
47 { 47 {
48 } 48 }
49 49
50void DatePreferences::changeDateFormat ( int index ) 50void DatePreferences::changeDateFormat ( int index )
51 { 51 {
52 index ++; 52 index ++;
53 preferences->changePreference ( 1, index ); 53 preferences->changePreference ( 1, index );
54 } 54 }
55 55
56void DatePreferences::changeDateSeparator ( int index ) 56void DatePreferences::changeDateSeparator ( int index )
57 { 57 {
58 index ++; 58 index ++;
59 preferences->changePreference ( 2, index ); 59 preferences->changePreference ( 2, index );
60 } 60 }
61 61
62void DatePreferences::setDefaultDatePreferences () 62void DatePreferences::setDefaultDatePreferences ()
63 { 63 {
64 preferences->setDefaultDatePreferences (); 64 preferences->setDefaultDatePreferences ();
65 dateformat->setCurrentItem ( ( preferences->getPreference ( 1 ) ) - 1 ); 65 dateformat->setCurrentItem ( ( preferences->getPreference ( 1 ) ) - 1 );
66 dateseparator->setCurrentItem ( ( preferences->getPreference ( 2 ) ) - 1 ); 66 dateseparator->setCurrentItem ( ( preferences->getPreference ( 2 ) ) - 1 );
67 } 67 }
68 68
69// START TRANSACTION PREFERENCES 69// START TRANSACTION PREFERENCES
70 70
71TransactionPreferences::TransactionPreferences ( QWidget* parent ) : QDialog ( parent, 0, TRUE ) 71TransactionPreferences::TransactionPreferences ( QWidget* parent ) : QDialog ( parent, 0, TRUE )
72{ 72{
73 setCaption( tr ( "Transaction" ) ); 73 setCaption( tr ( "Transaction" ) );
74 74
75 showclearedtransactions = new QCheckBox ( this ); 75 showclearedtransactions = new QCheckBox ( this );
76 showclearedtransactions->setText ( "Show Cleared Transactions" ); 76 showclearedtransactions->setText ( "Show Cleared Transactions" );
77 77
78 limittransactionsbox = new QHBox ( this ); 78 limittransactionsbox = new QHBox ( this );
79 limittransactionsbox->setSpacing ( 2 ); 79 limittransactionsbox->setSpacing ( 2 );
80 limittransactionslabel = new QLabel ( "Show ", limittransactionsbox ); 80 limittransactionslabel = new QLabel ( "Show ", limittransactionsbox );
81 limittransactions = new QComboBox ( limittransactionsbox ); 81 limittransactions = new QComboBox ( limittransactionsbox );
82 QLabel *limittransactionslabel2 = new QLabel ( "of cleared transactions. ", limittransactionsbox ); 82 QLabel *limittransactionslabel2 = new QLabel ( "of cleared transactions. ", limittransactionsbox );
83 limittransactions->insertItem ( "14 days" ); 83 limittransactions->insertItem ( "14 days" );
84 limittransactions->insertItem ( "30 days" ); 84 limittransactions->insertItem ( "30 days" );
85 limittransactions->insertItem ( "90 days" ); 85 limittransactions->insertItem ( "90 days" );
86 limittransactions->insertItem ( "180 days" ); 86 limittransactions->insertItem ( "180 days" );
87 limittransactions->insertItem ( "365 days" ); 87 limittransactions->insertItem ( "365 days" );
88 limittransactions->insertItem ( "All" ); 88 limittransactions->insertItem ( "All" );
89 limittransactions->setCurrentItem ( preferences->getPreference ( 7 ) ); 89 limittransactions->setCurrentItem ( preferences->getPreference ( 7 ) );
90 90
91 excludetransfers = new QCheckBox ( this ); 91 excludetransfers = new QCheckBox ( this );
92 excludetransfers->setText ( "Include Transfers In Limit View" ); 92 excludetransfers->setText ( "Include Transfers In Limit View" );
93 93
94 if ( preferences->getPreference ( 3 ) == 1 ) 94 if ( preferences->getPreference ( 3 ) == 1 )
95 showclearedtransactions->setChecked ( TRUE ); 95 showclearedtransactions->setChecked ( TRUE );
96 else 96 else
97 showclearedtransactions->setChecked ( FALSE ); 97 showclearedtransactions->setChecked ( FALSE );
98 98
99 if ( preferences->getPreference ( 6 ) == 1 ) 99 if ( preferences->getPreference ( 6 ) == 1 )
100 excludetransfers->setChecked ( TRUE ); 100 excludetransfers->setChecked ( TRUE );
101 else 101 else
102 excludetransfers->setChecked ( FALSE ); 102 excludetransfers->setChecked ( FALSE );
103 103
104 defaults = new QPushButton ( QPixmap ( "/opt/QtPalmtop/pics/defaults.png" ), "Defaults", this ); 104 defaults = new QPushButton ( QPixmap ( "/opt/QtPalmtop/pics/defaults.png" ), "Defaults", this );
105 connect ( defaults, SIGNAL ( released () ), this, SLOT ( setDefaultTransactionPreferences () ) ); 105 connect ( defaults, SIGNAL ( released() ), this, SLOT ( setDefaultTransactionPreferences() ) );
106 106
107 layout = new QVBoxLayout ( this, 2, 2 ); 107 layout = new QVBoxLayout ( this, 2, 2 );
108 layout->addWidget ( showclearedtransactions ); 108 layout->addWidget ( showclearedtransactions );
109 layout->addWidget ( limittransactionsbox ); 109 layout->addWidget ( limittransactionsbox );
110 layout->addWidget ( excludetransfers ); 110 layout->addWidget ( excludetransfers );
111 layout->insertSpacing ( 3, 5 ); 111 layout->insertSpacing ( 3, 5 );
112 layout->addWidget ( defaults ); 112 layout->addWidget ( defaults );
113 113
114 connect ( showclearedtransactions, SIGNAL ( toggled ( bool ) ), this, SLOT ( changeShowClearedPreference ( bool ) ) ); 114 connect ( showclearedtransactions, SIGNAL ( toggled(bool) ), this, SLOT ( changeShowClearedPreference(bool) ) );
115 connect ( excludetransfers, SIGNAL ( toggled ( bool ) ), this, SLOT ( changeExcludeTranfersPreference ( bool ) ) ); 115 connect ( excludetransfers, SIGNAL ( toggled(bool) ), this, SLOT ( changeExcludeTranfersPreference(bool) ) );
116 connect ( limittransactions, SIGNAL ( activated ( int ) ), this, SLOT ( changeLimitTransactionsPreference ( int ) ) ); 116 connect ( limittransactions, SIGNAL ( activated(int) ), this, SLOT ( changeLimitTransactionsPreference(int) ) );
117} 117}
118 118
119TransactionPreferences::~TransactionPreferences () 119TransactionPreferences::~TransactionPreferences ()
120 { 120 {
121 } 121 }
122 122
123void TransactionPreferences::changeLimitTransactionsPreference ( int pref ) 123void TransactionPreferences::changeLimitTransactionsPreference ( int pref )
124 { 124 {
125 preferences->changePreference ( 7, pref ); 125 preferences->changePreference ( 7, pref );
126 } 126 }
127 127
128void TransactionPreferences::changeShowClearedPreference ( bool state ) 128void TransactionPreferences::changeShowClearedPreference ( bool state )
129 { 129 {
130 if ( state == TRUE ) 130 if ( state == TRUE )
131 preferences->changePreference ( 3, 1 ); 131 preferences->changePreference ( 3, 1 );
132 else 132 else
133 preferences->changePreference ( 3, 0 ); 133 preferences->changePreference ( 3, 0 );
134 } 134 }
135 135
136void TransactionPreferences::changeExcludeTranfersPreference ( bool state ) 136void TransactionPreferences::changeExcludeTranfersPreference ( bool state )
137 { 137 {
138 if ( state == TRUE ) 138 if ( state == TRUE )
139 preferences->changePreference ( 6, 1 ); 139 preferences->changePreference ( 6, 1 );
140 else 140 else
141 preferences->changePreference ( 6, 0 ); 141 preferences->changePreference ( 6, 0 );
142 } 142 }
143 143
144void TransactionPreferences::setDefaultTransactionPreferences () 144void TransactionPreferences::setDefaultTransactionPreferences ()
145 { 145 {
146 preferences->changePreference ( 3, 0 ); 146 preferences->changePreference ( 3, 0 );
147 preferences->changePreference ( 6, 0 ); 147 preferences->changePreference ( 6, 0 );
148 preferences->changePreference ( 7, 0 ); 148 preferences->changePreference ( 7, 0 );
149 showclearedtransactions->setChecked ( FALSE ); 149 showclearedtransactions->setChecked ( FALSE );
150 limittransactions->setCurrentItem ( 0 ); 150 limittransactions->setCurrentItem ( 0 );
151 } 151 }
152 152
153// START ACCOUNT PREFERNCES 153// START ACCOUNT PREFERNCES
154 154
155AccountPreferences::AccountPreferences ( QWidget* parent ) : QDialog ( parent, 0, TRUE ) 155AccountPreferences::AccountPreferences ( QWidget* parent ) : QDialog ( parent, 0, TRUE )
156{ 156{
157 157
158 setCaption( tr ( "Account" ) ); 158 setCaption( tr ( "Account" ) );
159 159
160 currencysupport = new QCheckBox ( this ); 160 currencysupport = new QCheckBox ( this );
161 currencysupport->setText ( "Enable Currency Support" ); 161 currencysupport->setText ( "Enable Currency Support" );
162 162
163 onetouch = new QCheckBox ( this ); 163 onetouch = new QCheckBox ( this );
164 onetouch->setText ( "One Touch Account Viewing" ); 164 onetouch->setText ( "One Touch Account Viewing" );
165 165
166 if ( preferences->getPreference ( 4 ) == 1 ) 166 if ( preferences->getPreference ( 4 ) == 1 )
167 currencysupport->setChecked ( TRUE ); 167 currencysupport->setChecked ( TRUE );
168 else 168 else
169 currencysupport->setChecked ( FALSE ); 169 currencysupport->setChecked ( FALSE );
170 170
171 if ( preferences->getPreference ( 5 ) == 1 ) 171 if ( preferences->getPreference ( 5 ) == 1 )
172 onetouch->setChecked ( TRUE ); 172 onetouch->setChecked ( TRUE );
173 else 173 else
174 onetouch->setChecked ( FALSE ); 174 onetouch->setChecked ( FALSE );
175 175
176 defaults = new QPushButton ( QPixmap ( "/opt/QtPalmtop/pics/defaults.png" ), "Defaults", this ); 176 defaults = new QPushButton ( QPixmap ( "/opt/QtPalmtop/pics/defaults.png" ), "Defaults", this );
177 connect ( defaults, SIGNAL ( released () ), this, SLOT ( setDefaultAccountPreferences () ) ); 177 connect ( defaults, SIGNAL ( released() ), this, SLOT ( setDefaultAccountPreferences() ) );
178 178
179 layout = new QVBoxLayout ( this, 2, 2 ); 179 layout = new QVBoxLayout ( this, 2, 2 );
180 layout->addWidget ( currencysupport ); 180 layout->addWidget ( currencysupport );
181 layout->addWidget ( onetouch ); 181 layout->addWidget ( onetouch );
182 layout->insertSpacing ( 2, 5 ); 182 layout->insertSpacing ( 2, 5 );
183 layout->addWidget ( defaults ); 183 layout->addWidget ( defaults );
184 184
185 connect ( currencysupport, SIGNAL ( toggled ( bool ) ), this, SLOT ( changeCurrencySupport ( bool ) ) ); 185 connect ( currencysupport, SIGNAL ( toggled(bool) ), this, SLOT ( changeCurrencySupport(bool) ) );
186 connect ( onetouch, SIGNAL ( toggled ( bool ) ), this, SLOT ( changeOneTouchViewing ( bool ) ) ); 186 connect ( onetouch, SIGNAL ( toggled(bool) ), this, SLOT ( changeOneTouchViewing(bool) ) );
187} 187}
188 188
189AccountPreferences::~AccountPreferences () 189AccountPreferences::~AccountPreferences ()
190 { 190 {
191 } 191 }
192 192
193void AccountPreferences::changeCurrencySupport ( bool state ) 193void AccountPreferences::changeCurrencySupport ( bool state )
194 { 194 {
195 if ( state == TRUE ) 195 if ( state == TRUE )
196 preferences->changePreference ( 4, 1 ); 196 preferences->changePreference ( 4, 1 );
197 else 197 else
198 preferences->changePreference ( 4, 0 ); 198 preferences->changePreference ( 4, 0 );
199 } 199 }
200 200
201void AccountPreferences::changeOneTouchViewing ( bool state ) 201void AccountPreferences::changeOneTouchViewing ( bool state )
202 { 202 {
203 if ( state == TRUE ) 203 if ( state == TRUE )
204 preferences->changePreference ( 5, 1 ); 204 preferences->changePreference ( 5, 1 );
205 else 205 else
206 preferences->changePreference ( 5, 0 ); 206 preferences->changePreference ( 5, 0 );
207 } 207 }
208 208
209void AccountPreferences::setDefaultAccountPreferences () 209void AccountPreferences::setDefaultAccountPreferences ()
210 { 210 {
211 preferences->changePreference ( 4, 0 ); 211 preferences->changePreference ( 4, 0 );
212 preferences->changePreference ( 5, 0 ); 212 preferences->changePreference ( 5, 0 );
213 currencysupport->setChecked ( FALSE ); 213 currencysupport->setChecked ( FALSE );
214 onetouch->setChecked ( FALSE ); 214 onetouch->setChecked ( FALSE );
215 } 215 }
216 216
diff --git a/noncore/apps/qashmoney/qashmoney.cpp b/noncore/apps/qashmoney/qashmoney.cpp
index d4cbc14..1455eb0 100755
--- a/noncore/apps/qashmoney/qashmoney.cpp
+++ b/noncore/apps/qashmoney/qashmoney.cpp
@@ -1,118 +1,118 @@
1#include "qashmoney.h" 1#include "qashmoney.h"
2#include "preferencedialogs.h" 2#include "preferencedialogs.h"
3#include "memorydialog.h" 3#include "memorydialog.h"
4 4
5#include <qheader.h> 5#include <qheader.h>
6 6
7Budget *budget = new Budget (); 7Budget *budget = new Budget ();
8Preferences *preferences = new Preferences (); 8Preferences *preferences = new Preferences ();
9Account *account = new Account (); 9Account *account = new Account ();
10Transaction *transaction = new Transaction (); 10Transaction *transaction = new Transaction ();
11Transfer *transfer = new Transfer (); 11Transfer *transfer = new Transfer ();
12Memory *memory = new Memory (); 12Memory *memory = new Memory ();
13 13
14QashMoney::QashMoney () : QWidget () 14QashMoney::QashMoney () : QWidget ()
15 { 15 {
16 preferences->addPreferences (); 16 preferences->addPreferences ();
17 preferences->initializeColumnPreferences (); 17 preferences->initializeColumnPreferences ();
18 preferences->initializeSortingPreferences (); 18 preferences->initializeSortingPreferences ();
19 19
20 // set the text in the upper part of the frame 20 // set the text in the upper part of the frame
21 setCaption ( tr ( "QashMoney" ) ); 21 setCaption ( tr ( "QashMoney" ) );
22 22
23 // Create new menubar for our mainwindow 23 // Create new menubar for our mainwindow
24 // and add menu items 24 // and add menu items
25 mainmenu = new QMenuBar ( this ); 25 mainmenu = new QMenuBar ( this );
26 mainmenu->setFrameStyle ( QFrame::PopupPanel | QFrame::Raised ); 26 mainmenu->setFrameStyle ( QFrame::PopupPanel | QFrame::Raised );
27 preferencesmenu = new QPopupMenu ( this ); 27 preferencesmenu = new QPopupMenu ( this );
28 utilitiesmenu = new QPopupMenu ( this ); 28 utilitiesmenu = new QPopupMenu ( this );
29 mainmenu->insertItem ( "Preferences", preferencesmenu ); 29 mainmenu->insertItem ( "Preferences", preferencesmenu );
30 mainmenu->insertItem ( "Utilities", utilitiesmenu ); 30 mainmenu->insertItem ( "Utilities", utilitiesmenu );
31 preferencesmenu->insertItem ( "Date", this, SLOT ( displayDatePreferencesDialog () ) ); 31 preferencesmenu->insertItem ( "Date", this, SLOT ( displayDatePreferencesDialog() ) );
32 preferencesmenu->insertItem ( "Account", this, SLOT ( displayAccountPreferencesDialog () ) ); 32 preferencesmenu->insertItem ( "Account", this, SLOT ( displayAccountPreferencesDialog() ) );
33 preferencesmenu->insertItem ( "Transaction", this, SLOT ( displayTransactionPreferencesDialog () ) ); 33 preferencesmenu->insertItem ( "Transaction", this, SLOT ( displayTransactionPreferencesDialog() ) );
34 utilitiesmenu->insertItem ( "Memory", this, SLOT ( displayMemoryDialog () ) ); 34 utilitiesmenu->insertItem ( "Memory", this, SLOT ( displayMemoryDialog() ) );
35 35
36 // create the main tabwidget for displaying accounts and transactions 36 // create the main tabwidget for displaying accounts and transactions
37 maintabs = new QTabWidget ( this ); 37 maintabs = new QTabWidget ( this );
38 tab = new QWidget ( this ); 38 tab = new QWidget ( this );
39 tab_2 = new QWidget ( this ); 39 tab_2 = new QWidget ( this );
40 tab_3 = new QWidget ( this ); 40 tab_3 = new QWidget ( this );
41 maintabs->addTab ( tab, "Accounts" ); 41 maintabs->addTab ( tab, "Accounts" );
42 maintabs->addTab ( tab_2, "Transactions" ); 42 maintabs->addTab ( tab_2, "Transactions" );
43 maintabs->addTab ( tab_3, "Budgets" ); 43 maintabs->addTab ( tab_3, "Budgets" );
44 tabheight = tab->height(); 44 tabheight = tab->height();
45 maintabs->setTabEnabled ( tab_2, FALSE ); 45 maintabs->setTabEnabled ( tab_2, FALSE );
46 46
47 // create a new account display object 47 // create a new account display object
48 accountdisplay = new AccountDisplay ( maintabs ); 48 accountdisplay = new AccountDisplay ( maintabs );
49 accountdisplay->setTabs ( tab_2, maintabs ); 49 accountdisplay->setTabs ( tab_2, maintabs );
50 connect ( accountdisplay->listview, SIGNAL ( selectionChanged () ), this, SLOT ( setTransactionTab () ) ); 50 connect ( accountdisplay->listview, SIGNAL ( selectionChanged() ), this, SLOT ( setTransactionTab() ) );
51 51
52 // set the connection to disable the one touch account viewing if we are transfering money 52 // set the connection to disable the one touch account viewing if we are transfering money
53 connect ( accountdisplay->transferbutton, SIGNAL ( toggled ( bool ) ), this, SLOT ( toggleOneTouchViewing ( bool ) ) ); 53 connect ( accountdisplay->transferbutton, SIGNAL ( toggled(bool) ), this, SLOT ( toggleOneTouchViewing(bool) ) );
54 54
55 // create a new transactiondisplay object 55 // create a new transactiondisplay object
56 transactiondisplay = new TransactionDisplay ( maintabs ); 56 transactiondisplay = new TransactionDisplay ( maintabs );
57 transactiondisplay->hide(); 57 transactiondisplay->hide();
58 58
59 // create new budgetdisplay object 59 // create new budgetdisplay object
60 budgetdisplay = new BudgetDisplay ( maintabs ); 60 budgetdisplay = new BudgetDisplay ( maintabs );
61 budgetdisplay->hide(); 61 budgetdisplay->hide();
62 62
63 tabslayout = new QVBoxLayout ( maintabs, 4, 2 ); 63 tabslayout = new QVBoxLayout ( maintabs, 4, 2 );
64 tabslayout->addSpacing ( tabheight ); 64 tabslayout->addSpacing ( tabheight );
65 tabslayout->addWidget ( accountdisplay ); 65 tabslayout->addWidget ( accountdisplay );
66 tabslayout->addWidget ( transactiondisplay ); 66 tabslayout->addWidget ( transactiondisplay );
67 tabslayout->addWidget ( budgetdisplay ); 67 tabslayout->addWidget ( budgetdisplay );
68 68
69 // connect a change in the maintabs with changing the tab display 69 // connect a change in the maintabs with changing the tab display
70 connect ( maintabs, SIGNAL ( currentChanged ( QWidget * ) ), this, SLOT ( changeTabDisplay () ) ); 70 connect ( maintabs, SIGNAL ( currentChanged(QWidget*) ), this, SLOT ( changeTabDisplay() ) );
71 71
72 // create layout that will contain the menubar and the maintabs 72 // create layout that will contain the menubar and the maintabs
73 layout = new QVBoxLayout ( this, 2, 2 ); 73 layout = new QVBoxLayout ( this, 2, 2 );
74 layout->setMenuBar ( mainmenu ); 74 layout->setMenuBar ( mainmenu );
75 layout->addWidget ( maintabs ); 75 layout->addWidget ( maintabs );
76 } 76 }
77 77
78QashMoney::~QashMoney () 78QashMoney::~QashMoney ()
79 { 79 {
80 delete budget; 80 delete budget;
81 delete preferences; 81 delete preferences;
82 delete account; 82 delete account;
83 delete transaction; 83 delete transaction;
84 delete transfer; 84 delete transfer;
85 delete memory; 85 delete memory;
86 } 86 }
87 87
88void QashMoney::changeTabDisplay () 88void QashMoney::changeTabDisplay ()
89 { 89 {
90 // if the user pressed the transactions tab, hide the account display 90 // if the user pressed the transactions tab, hide the account display
91 // object and create a new transaction display 91 // object and create a new transaction display
92 if ( maintabs->currentPageIndex() == 1 ) 92 if ( maintabs->currentPageIndex() == 1 )
93 { 93 {
94 // initialize variables 94 // initialize variables
95 bool children = FALSE; 95 bool children = FALSE;
96 96
97 // hide the account display and define accountid 97 // hide the account display and define accountid
98 int accountid = accountdisplay->listview->selectedItem()->text ( accountdisplay->getIDColumn() ).toInt(); 98 int accountid = accountdisplay->listview->selectedItem()->text ( accountdisplay->getIDColumn() ).toInt();
99 99
100 //remove all the columns from the transactiondisplay 100 //remove all the columns from the transactiondisplay
101 int columns = transactiondisplay->listview->columns(); 101 int columns = transactiondisplay->listview->columns();
102 int counter; 102 int counter;
103 for ( counter = 0; counter <= columns; counter++ ) 103 for ( counter = 0; counter <= columns; counter++ )
104 transactiondisplay->listview->removeColumn ( 0 ); 104 transactiondisplay->listview->removeColumn ( 0 );
105 105
106 // set the account name and account balance 106 // set the account name and account balance
107 QString name = account->getAccountName ( accountid ); 107 QString name = account->getAccountName ( accountid );
108 QString balance = account->getAccountBalance ( accountid ); 108 QString balance = account->getAccountBalance ( accountid );
109 transactiondisplay->name->setText ( name ); 109 transactiondisplay->name->setText ( name );
110 transactiondisplay->balance->setText ( balance ); 110 transactiondisplay->balance->setText ( balance );
111 111
112 // clear the limitbox 112 // clear the limitbox
113 transactiondisplay->limitbox->clear(); 113 transactiondisplay->limitbox->clear();
114 114
115 // get parent account id 115 // get parent account id
116 int parentaccountid = account->getParentAccountID ( accountid ); 116 int parentaccountid = account->getParentAccountID ( accountid );
117 117
118 // add columns based on which account is selected 118 // add columns based on which account is selected
@@ -307,96 +307,96 @@ void QashMoney::displayTransactionPreferencesDialog ()
307 QString displaytext = "%"; 307 QString displaytext = "%";
308 displaytext.prepend ( transactiondisplay->limitbox->text() ); 308 displaytext.prepend ( transactiondisplay->limitbox->text() );
309 309
310 setTransactionDisplayDate(); 310 setTransactionDisplayDate();
311 if ( transaction->getNumberOfTransactions() > 0 ) 311 if ( transaction->getNumberOfTransactions() > 0 )
312 transaction->displayTransactions ( transactiondisplay->listview, accountid, children, displaytext, newdate ); 312 transaction->displayTransactions ( transactiondisplay->listview, accountid, children, displaytext, newdate );
313 313
314 if ( transfer->getNumberOfTransfers() != 0 ) 314 if ( transfer->getNumberOfTransfers() != 0 )
315 transfer->displayTransfers ( transactiondisplay->listview, accountid, children, newdate ); 315 transfer->displayTransfers ( transactiondisplay->listview, accountid, children, newdate );
316 } 316 }
317 else 317 else
318 { 318 {
319 accountdisplay->listview->clearSelection(); 319 accountdisplay->listview->clearSelection();
320 maintabs->setTabEnabled ( tab_2, FALSE ); 320 maintabs->setTabEnabled ( tab_2, FALSE );
321 } 321 }
322 } 322 }
323 323
324void QashMoney::displayAccountPreferencesDialog () 324void QashMoney::displayAccountPreferencesDialog ()
325 { 325 {
326 // display a dialog for setting preferences for accounts 326 // display a dialog for setting preferences for accounts
327 AccountPreferences *ap = new AccountPreferences ( this ); 327 AccountPreferences *ap = new AccountPreferences ( this );
328 ap->exec (); 328 ap->exec ();
329 329
330 if ( accountdisplay->isVisible() && account->getNumberOfAccounts() != 0 ) 330 if ( accountdisplay->isVisible() && account->getNumberOfAccounts() != 0 )
331 { 331 {
332 accountdisplay->listview->clear(); 332 accountdisplay->listview->clear();
333 account->displayAccounts ( accountdisplay->listview ); 333 account->displayAccounts ( accountdisplay->listview );
334 accountdisplay->listview->clearSelection(); 334 accountdisplay->listview->clearSelection();
335 maintabs->setTabEnabled ( tab_2, FALSE ); 335 maintabs->setTabEnabled ( tab_2, FALSE );
336 } 336 }
337 changeTabDisplay(); 337 changeTabDisplay();
338 } 338 }
339 339
340void QashMoney::displayMemoryDialog () 340void QashMoney::displayMemoryDialog ()
341 { 341 {
342 // opens a dialog to add, edit and delete memory items 342 // opens a dialog to add, edit and delete memory items
343 MemoryDialog *md = new MemoryDialog (); 343 MemoryDialog *md = new MemoryDialog ();
344 md->exec(); 344 md->exec();
345 } 345 }
346 346
347void QashMoney::showTransactions () 347void QashMoney::showTransactions ()
348 { 348 {
349 maintabs->setCurrentPage ( 1 ); 349 maintabs->setCurrentPage ( 1 );
350 } 350 }
351 351
352void QashMoney::enableOneTouchViewing () 352void QashMoney::enableOneTouchViewing ()
353 { 353 {
354 if ( preferences->getPreference ( 5 ) == 1 ) 354 if ( preferences->getPreference ( 5 ) == 1 )
355 connect ( accountdisplay->listview, SIGNAL ( selectionChanged () ), this, SLOT ( showTransactions () ) ); 355 connect ( accountdisplay->listview, SIGNAL ( selectionChanged() ), this, SLOT ( showTransactions() ) );
356 else 356 else
357 disconnect ( accountdisplay->listview, SIGNAL ( selectionChanged () ), this, SLOT ( showTransactions () ) ); 357 disconnect ( accountdisplay->listview, SIGNAL ( selectionChanged() ), this, SLOT ( showTransactions() ) );
358 } 358 }
359 359
360void QashMoney::disableOneTouchViewing () 360void QashMoney::disableOneTouchViewing ()
361 { 361 {
362 disconnect ( accountdisplay->listview, SIGNAL ( selectionChanged () ), this, SLOT ( showTransactions () ) ); 362 disconnect ( accountdisplay->listview, SIGNAL ( selectionChanged() ), this, SLOT ( showTransactions() ) );
363 } 363 }
364 364
365void QashMoney::toggleOneTouchViewing ( bool state ) 365void QashMoney::toggleOneTouchViewing ( bool state )
366 { 366 {
367 if ( state == TRUE ) 367 if ( state == TRUE )
368 disableOneTouchViewing(); 368 disableOneTouchViewing();
369 else 369 else
370 enableOneTouchViewing(); 370 enableOneTouchViewing();
371 } 371 }
372 372
373void QashMoney::setTransactionDisplayDate () 373void QashMoney::setTransactionDisplayDate ()
374 { 374 {
375 // determine how many days of transactions to show 375 // determine how many days of transactions to show
376 int limittype = preferences->getPreference ( 7 ); 376 int limittype = preferences->getPreference ( 7 );
377 if ( limittype != 5 ) // set today's date if we are not showing all transactions 377 if ( limittype != 5 ) // set today's date if we are not showing all transactions
378 { 378 {
379 QDate today = QDate::currentDate (); 379 QDate today = QDate::currentDate ();
380 switch ( limittype ) // if we are not showing all transactions 380 switch ( limittype ) // if we are not showing all transactions
381 { 381 {
382 case 0: // viewing two weeks 382 case 0: // viewing two weeks
383 newdate = today.addDays ( -14 ); 383 newdate = today.addDays ( -14 );
384 break; 384 break;
385 case 1: // viewing one month 385 case 1: // viewing one month
386 newdate = today.addDays ( -30 ); 386 newdate = today.addDays ( -30 );
387 break; 387 break;
388 case 2: // three months 388 case 2: // three months
389 newdate = today.addDays ( -90 ); 389 newdate = today.addDays ( -90 );
390 break; 390 break;
391 case 3: // six months 391 case 3: // six months
392 newdate = today.addDays ( -180 ); 392 newdate = today.addDays ( -180 );
393 break; 393 break;
394 case 4: // one year 394 case 4: // one year
395 newdate = today.addDays ( -365 ); 395 newdate = today.addDays ( -365 );
396 break; 396 break;
397 } 397 }
398 } 398 }
399 else 399 else
400 newdate = QDate ( 1900, 1, 1 ); 400 newdate = QDate ( 1900, 1, 1 );
401 } 401 }
402 402
diff --git a/noncore/apps/qashmoney/transactiondisplay.cpp b/noncore/apps/qashmoney/transactiondisplay.cpp
index 474f11e..0b94d62 100755
--- a/noncore/apps/qashmoney/transactiondisplay.cpp
+++ b/noncore/apps/qashmoney/transactiondisplay.cpp
@@ -1,114 +1,114 @@
1#include "transactiondisplay.h" 1#include "transactiondisplay.h"
2#include "newtransaction.h" 2#include "newtransaction.h"
3#include "account.h" 3#include "account.h"
4#include "budget.h" 4#include "budget.h"
5#include "memory.h" 5#include "memory.h"
6#include "transfer.h" 6#include "transfer.h"
7#include "calculator.h" 7#include "calculator.h"
8#include "datepicker.h" 8#include "datepicker.h"
9 9
10#include <qmessagebox.h> 10#include <qmessagebox.h>
11#include <qheader.h> 11#include <qheader.h>
12#include <qmultilineedit.h> 12#include <qmultilineedit.h>
13 13
14extern Transaction *transaction; 14extern Transaction *transaction;
15extern Budget *budget; 15extern Budget *budget;
16extern Account *account; 16extern Account *account;
17extern Preferences *preferences; 17extern Preferences *preferences;
18extern Memory *memory; 18extern Memory *memory;
19extern Transfer *transfer; 19extern Transfer *transfer;
20 20
21TransactionDisplay::TransactionDisplay ( QWidget* parent ) : QWidget ( parent ) 21TransactionDisplay::TransactionDisplay ( QWidget* parent ) : QWidget ( parent )
22 { 22 {
23 // set transactiondisplay variables; 23 // set transactiondisplay variables;
24 accountid = 0; 24 accountid = 0;
25 children = TRUE; 25 children = TRUE;
26 26
27 firstline = new QHBox ( this ); 27 firstline = new QHBox ( this );
28 firstline->setSpacing ( 2 ); 28 firstline->setSpacing ( 2 );
29 29
30 newtransaction = new QPushButton ( firstline ); 30 newtransaction = new QPushButton ( firstline );
31 newtransaction->setPixmap ( QPixmap ("/opt/QtPalmtop/pics/new.png") ); 31 newtransaction->setPixmap ( QPixmap ("/opt/QtPalmtop/pics/new.png") );
32 connect ( newtransaction, SIGNAL ( released () ), this, SLOT ( addTransaction () ) ); 32 connect ( newtransaction, SIGNAL ( released() ), this, SLOT ( addTransaction() ) );
33 33
34 edittransaction = new QPushButton ( firstline ); 34 edittransaction = new QPushButton ( firstline );
35 edittransaction->setPixmap( QPixmap ("/opt/QtPalmtop/pics/edit.png") ); 35 edittransaction->setPixmap( QPixmap ("/opt/QtPalmtop/pics/edit.png") );
36 connect ( edittransaction, SIGNAL ( released () ), this, SLOT ( checkListViewEdit () ) ); 36 connect ( edittransaction, SIGNAL ( released() ), this, SLOT ( checkListViewEdit() ) );
37 37
38 deletetransaction = new QPushButton ( firstline ); 38 deletetransaction = new QPushButton ( firstline );
39 deletetransaction->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/delete.png") ); 39 deletetransaction->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/delete.png") );
40 connect ( deletetransaction, SIGNAL ( released () ), this, SLOT ( checkListViewDelete () ) ); 40 connect ( deletetransaction, SIGNAL ( released() ), this, SLOT ( checkListViewDelete() ) );
41 41
42 toggletransaction = new QPushButton ( firstline ); 42 toggletransaction = new QPushButton ( firstline );
43 toggletransaction->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/redo.png") ); 43 toggletransaction->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/redo.png") );
44 connect ( toggletransaction, SIGNAL ( released () ), this, SLOT ( checkListViewToggle () ) ); 44 connect ( toggletransaction, SIGNAL ( released() ), this, SLOT ( checkListViewToggle() ) );
45 45
46 viewtransactionnotes = new QPushButton ( firstline ); 46 viewtransactionnotes = new QPushButton ( firstline );
47 viewtransactionnotes->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/info.png") ); 47 viewtransactionnotes->setPixmap( QPixmap ( "/opt/QtPalmtop/pics/info.png") );
48 connect ( viewtransactionnotes, SIGNAL ( released () ), this, SLOT ( showTransactionNotes () ) ); 48 connect ( viewtransactionnotes, SIGNAL ( released() ), this, SLOT ( showTransactionNotes() ) );
49 49
50 secondline = new QHBox ( this ); 50 secondline = new QHBox ( this );
51 secondline->setSpacing ( 5 ); 51 secondline->setSpacing ( 5 );
52 52
53 name = new QLabel ( secondline ); 53 name = new QLabel ( secondline );
54 balance = new QLabel ( secondline ); 54 balance = new QLabel ( secondline );
55 55
56 QLabel *limit = new QLabel ( "Limit", secondline ); 56 QLabel *limit = new QLabel ( "Limit", secondline );
57 limitbox = new QLineEdit ( secondline ); 57 limitbox = new QLineEdit ( secondline );
58 limitbox->setMinimumWidth ( ( int ) ( this->width() / 6 ) ); 58 limitbox->setMinimumWidth ( ( int ) ( this->width() / 6 ) );
59 connect ( limitbox, SIGNAL ( textChanged ( const QString & ) ), this, SLOT ( limitDisplay ( const QString & ) ) ); 59 connect ( limitbox, SIGNAL ( textChanged(const QString&) ), this, SLOT ( limitDisplay(const QString&) ) );
60 60
61 listview = new QListView ( this ); 61 listview = new QListView ( this );
62 listview->setAllColumnsShowFocus ( TRUE ); 62 listview->setAllColumnsShowFocus ( TRUE );
63 listview->setShowSortIndicator ( TRUE ); 63 listview->setShowSortIndicator ( TRUE );
64 listview->header()->setTracking ( FALSE ); 64 listview->header()->setTracking ( FALSE );
65 connect ( listview->header(), SIGNAL ( sizeChange ( int, int, int ) ), this, SLOT ( saveColumnSize ( int, int, int ) ) ); 65 connect ( listview->header(), SIGNAL ( sizeChange(int,int,int) ), this, SLOT ( saveColumnSize(int,int,int) ) );
66 connect ( listview->header(), SIGNAL ( clicked ( int ) ), this, SLOT ( saveSortingPreference ( int ) ) ); 66 connect ( listview->header(), SIGNAL ( clicked(int) ), this, SLOT ( saveSortingPreference(int) ) );
67 67
68 layout = new QVBoxLayout ( this, 2, 2 ); 68 layout = new QVBoxLayout ( this, 2, 2 );
69 layout->addWidget ( firstline ); 69 layout->addWidget ( firstline );
70 layout->addWidget ( secondline ); 70 layout->addWidget ( secondline );
71 layout->addWidget ( listview ); 71 layout->addWidget ( listview );
72 } 72 }
73 73
74void TransactionDisplay::addTransaction () 74void TransactionDisplay::addTransaction ()
75 { 75 {
76 // create local variables 76 // create local variables
77 int cleared = -1; 77 int cleared = -1;
78 78
79 // create new transaction window 79 // create new transaction window
80 NewTransaction *newtransaction = new NewTransaction ( this ); 80 NewTransaction *newtransaction = new NewTransaction ( this );
81 int width = this->size().width(); 81 int width = this->size().width();
82 newtransaction->transactionname->setMaximumWidth ( ( int ) ( width * 0.45 ) ); 82 newtransaction->transactionname->setMaximumWidth ( ( int ) ( width * 0.45 ) );
83 newtransaction->transactionname->setMinimumWidth ( ( int ) ( width * 0.35 ) ); 83 newtransaction->transactionname->setMinimumWidth ( ( int ) ( width * 0.35 ) );
84 newtransaction->lineitembox->setMaximumWidth ( ( int ) ( width * 0.45 ) ); 84 newtransaction->lineitembox->setMaximumWidth ( ( int ) ( width * 0.45 ) );
85 newtransaction->transactiondatebox->setMaximumWidth ( ( int ) ( width * 0.4 ) ); 85 newtransaction->transactiondatebox->setMaximumWidth ( ( int ) ( width * 0.4 ) );
86 newtransaction->transactionamountbox->setMaximumWidth ( ( int ) ( width * 0.4 ) ); 86 newtransaction->transactionamountbox->setMaximumWidth ( ( int ) ( width * 0.4 ) );
87 newtransaction->transactionnumber->setMaximumWidth ( ( int ) ( width * 0.25 ) ); 87 newtransaction->transactionnumber->setMaximumWidth ( ( int ) ( width * 0.25 ) );
88 88
89 // enter today's date in the date box as defaul 89 // enter today's date in the date box as defaul
90 QDate today = QDate::currentDate (); 90 QDate today = QDate::currentDate ();
91 int defaultday = today.day(); 91 int defaultday = today.day();
92 int defaultmonth = today.month(); 92 int defaultmonth = today.month();
93 int defaultyear = today.year(); 93 int defaultyear = today.year();
94 newtransaction->transactiondate->setText ( preferences->getDate ( defaultyear, defaultmonth, defaultday ) ); 94 newtransaction->transactiondate->setText ( preferences->getDate ( defaultyear, defaultmonth, defaultday ) );
95 95
96 // add memory items to the transactionname combobox 96 // add memory items to the transactionname combobox
97 memory->displayMemoryItems ( newtransaction->transactionname ); 97 memory->displayMemoryItems ( newtransaction->transactionname );
98 newtransaction->transactionname->insertItem ( "", 0 ); 98 newtransaction->transactionname->insertItem ( "", 0 );
99 99
100 if ( newtransaction->exec () == QDialog::Accepted ) 100 if ( newtransaction->exec () == QDialog::Accepted )
101 { 101 {
102 if ( newtransaction->clearedcheckbox->isChecked () == TRUE ) // set a parent id and type for a child transaction 102 if ( newtransaction->clearedcheckbox->isChecked () == TRUE ) // set a parent id and type for a child transaction
103 cleared = 1; 103 cleared = 1;
104 else 104 else
105 cleared = 0; 105 cleared = 0;
106 106
107 float amount = newtransaction->transactionamount->text().toFloat(); 107 float amount = newtransaction->transactionamount->text().toFloat();
108 if ( newtransaction->depositbox->isChecked() == FALSE ) 108 if ( newtransaction->depositbox->isChecked() == FALSE )
109 amount = amount * -1; 109 amount = amount * -1;
110 110
111 // add the transaction name to the memory items 111 // add the transaction name to the memory items
112 memory->addMemoryItem ( newtransaction->transactionname->currentText() ); 112 memory->addMemoryItem ( newtransaction->transactionname->currentText() );
113 113
114 // add the transaction 114 // add the transaction
@@ -168,97 +168,97 @@ void TransactionDisplay::showCalendar ()
168 { 168 {
169 year = dp->getYear(); 169 year = dp->getYear();
170 month = dp->getMonth(); 170 month = dp->getMonth();
171 day = dp->getDay(); 171 day = dp->getDay();
172 date->setText ( preferences->getDate ( year, month, day ) ); 172 date->setText ( preferences->getDate ( year, month, day ) );
173 } 173 }
174 } 174 }
175 175
176void TransactionDisplay::editTransfer () 176void TransactionDisplay::editTransfer ()
177 { 177 {
178 transferid = listview->currentItem()->text ( getIDColumn() ).toInt(); 178 transferid = listview->currentItem()->text ( getIDColumn() ).toInt();
179 fromaccount = transfer->getFromAccountID ( transferid ); 179 fromaccount = transfer->getFromAccountID ( transferid );
180 toaccount = transfer->getToAccountID ( transferid ); 180 toaccount = transfer->getToAccountID ( transferid );
181 year = transfer->getYear ( transferid ); 181 year = transfer->getYear ( transferid );
182 month = transfer->getMonth ( transferid ); 182 month = transfer->getMonth ( transferid );
183 day = transfer->getDay ( transferid ); 183 day = transfer->getDay ( transferid );
184 184
185 QDialog *editransfer = new QDialog ( this, "edittransfer", TRUE ); 185 QDialog *editransfer = new QDialog ( this, "edittransfer", TRUE );
186 editransfer->setCaption ( "Transfer" ); 186 editransfer->setCaption ( "Transfer" );
187 187
188 QStringList accountnames = account->getAccountNames(); 188 QStringList accountnames = account->getAccountNames();
189 QStringList accountids = account->getAccountIDs(); 189 QStringList accountids = account->getAccountIDs();
190 190
191 QLabel *fromaccountlabel = new QLabel ( "From Account:", editransfer ); 191 QLabel *fromaccountlabel = new QLabel ( "From Account:", editransfer );
192 QFont f = this->font(); 192 QFont f = this->font();
193 f.setWeight ( QFont::Bold ); 193 f.setWeight ( QFont::Bold );
194 fromaccountlabel->setFont ( f ); 194 fromaccountlabel->setFont ( f );
195 195
196 QComboBox *fromaccountbox = new QComboBox ( editransfer ); 196 QComboBox *fromaccountbox = new QComboBox ( editransfer );
197 fromaccountbox->insertStringList ( accountnames ); 197 fromaccountbox->insertStringList ( accountnames );
198 fromaccountbox->setCurrentItem ( accountids.findIndex ( QString::number ( fromaccount ) ) ); 198 fromaccountbox->setCurrentItem ( accountids.findIndex ( QString::number ( fromaccount ) ) );
199 199
200 QLabel *toaccountlabel = new QLabel ( "To Account:", editransfer ); 200 QLabel *toaccountlabel = new QLabel ( "To Account:", editransfer );
201 toaccountlabel->setFont ( f ); 201 toaccountlabel->setFont ( f );
202 202
203 QComboBox *toaccountbox = new QComboBox ( editransfer ); 203 QComboBox *toaccountbox = new QComboBox ( editransfer );
204 toaccountbox->insertStringList ( accountnames ); 204 toaccountbox->insertStringList ( accountnames );
205 toaccountbox->setCurrentItem ( accountids.findIndex ( QString::number ( toaccount ) ) ); 205 toaccountbox->setCurrentItem ( accountids.findIndex ( QString::number ( toaccount ) ) );
206 206
207 QLabel *datelabel = new QLabel ( "Date", editransfer ); 207 QLabel *datelabel = new QLabel ( "Date", editransfer );
208 QHBox *datebox = new QHBox ( editransfer ); 208 QHBox *datebox = new QHBox ( editransfer );
209 datebox->setSpacing ( 2 ); 209 datebox->setSpacing ( 2 );
210 date = new QLineEdit ( datebox ); 210 date = new QLineEdit ( datebox );
211 date->setAlignment ( Qt::AlignRight ); 211 date->setAlignment ( Qt::AlignRight );
212 date->setDisabled ( TRUE ); 212 date->setDisabled ( TRUE );
213 date->setText ( preferences->getDate ( year, month, day ) ); 213 date->setText ( preferences->getDate ( year, month, day ) );
214 QPushButton *datebutton = new QPushButton ( datebox ); 214 QPushButton *datebutton = new QPushButton ( datebox );
215 datebutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/date.png" ) ); 215 datebutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/date.png" ) );
216 connect ( datebutton, SIGNAL ( released () ), this, SLOT ( showCalendar () ) ); 216 connect ( datebutton, SIGNAL ( released() ), this, SLOT ( showCalendar() ) );
217 217
218 QLabel *amounttlabel = new QLabel ( "Amount", editransfer ); 218 QLabel *amounttlabel = new QLabel ( "Amount", editransfer );
219 219
220 QHBox *amountbox = new QHBox ( editransfer ); 220 QHBox *amountbox = new QHBox ( editransfer );
221 amountbox->setSpacing ( 2 ); 221 amountbox->setSpacing ( 2 );
222 amount = new QLineEdit ( amountbox ); 222 amount = new QLineEdit ( amountbox );
223 amount->setAlignment ( Qt::AlignRight ); 223 amount->setAlignment ( Qt::AlignRight );
224 amount->setText ( transfer->getAmount ( transferid ) ); 224 amount->setText ( transfer->getAmount ( transferid ) );
225 QPushButton *calculatorbutton = new QPushButton( amountbox ); 225 QPushButton *calculatorbutton = new QPushButton( amountbox );
226 calculatorbutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/kcalc.png" ) ); 226 calculatorbutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/kcalc.png" ) );
227 connect ( calculatorbutton, SIGNAL ( released() ), this, SLOT ( showCalculator() ) ); 227 connect ( calculatorbutton, SIGNAL ( released() ), this, SLOT ( showCalculator() ) );
228 228
229 QCheckBox *clearedcheckbox = new QCheckBox ( "Cleared", editransfer ); 229 QCheckBox *clearedcheckbox = new QCheckBox ( "Cleared", editransfer );
230 230
231 QBoxLayout *layout = new QVBoxLayout ( editransfer, 4, 2 ); 231 QBoxLayout *layout = new QVBoxLayout ( editransfer, 4, 2 );
232 layout->addWidget ( fromaccountlabel, Qt::AlignLeft ); 232 layout->addWidget ( fromaccountlabel, Qt::AlignLeft );
233 layout->addWidget ( fromaccountbox, Qt::AlignLeft ); 233 layout->addWidget ( fromaccountbox, Qt::AlignLeft );
234 layout->addWidget ( toaccountlabel, Qt::AlignLeft ); 234 layout->addWidget ( toaccountlabel, Qt::AlignLeft );
235 layout->addWidget ( toaccountbox, Qt::AlignLeft ); 235 layout->addWidget ( toaccountbox, Qt::AlignLeft );
236 layout->addSpacing ( 5 ); 236 layout->addSpacing ( 5 );
237 layout->addWidget ( datelabel, Qt::AlignLeft ); 237 layout->addWidget ( datelabel, Qt::AlignLeft );
238 layout->addWidget ( datebox, Qt::AlignLeft ); 238 layout->addWidget ( datebox, Qt::AlignLeft );
239 layout->addWidget ( amounttlabel, Qt::AlignLeft ); 239 layout->addWidget ( amounttlabel, Qt::AlignLeft );
240 layout->addWidget ( amountbox, Qt::AlignLeft ); 240 layout->addWidget ( amountbox, Qt::AlignLeft );
241 layout->addWidget ( clearedcheckbox, Qt::AlignLeft ); 241 layout->addWidget ( clearedcheckbox, Qt::AlignLeft );
242 242
243 if ( editransfer->exec() == QDialog::Accepted ) 243 if ( editransfer->exec() == QDialog::Accepted )
244 { 244 {
245 //get fromaccount 245 //get fromaccount
246 fromaccount = ( accountids.operator[] ( fromaccountbox->currentItem() ) ).toInt(); 246 fromaccount = ( accountids.operator[] ( fromaccountbox->currentItem() ) ).toInt();
247 247
248 //get to account 248 //get to account
249 toaccount = ( accountids.operator[] ( toaccountbox->currentItem() ) ).toInt(); 249 toaccount = ( accountids.operator[] ( toaccountbox->currentItem() ) ).toInt();
250 250
251 //set cleared flag 251 //set cleared flag
252 int cleared = 0; 252 int cleared = 0;
253 if ( clearedcheckbox->isChecked() == TRUE ) 253 if ( clearedcheckbox->isChecked() == TRUE )
254 cleared = 1; 254 cleared = 1;
255 255
256 //update transfer 256 //update transfer
257 transfer->updateTransfer ( fromaccount, account->getParentAccountID ( fromaccount ), toaccount, account->getParentAccountID ( toaccount ), 257 transfer->updateTransfer ( fromaccount, account->getParentAccountID ( fromaccount ), toaccount, account->getParentAccountID ( toaccount ),
258 day, month, year, amount->text().toFloat(), cleared, transferid ); 258 day, month, year, amount->text().toFloat(), cleared, transferid );
259 259
260 account->updateAccountBalance ( fromaccount ); 260 account->updateAccountBalance ( fromaccount );
261 if ( account->getParentAccountID ( fromaccount ) != -1 ) 261 if ( account->getParentAccountID ( fromaccount ) != -1 )
262 account->changeParentAccountBalance ( account->getParentAccountID ( fromaccount ) ); 262 account->changeParentAccountBalance ( account->getParentAccountID ( fromaccount ) );
263 263
264 updateAndDisplay ( toaccount ); 264 updateAndDisplay ( toaccount );
diff --git a/noncore/apps/qashmoney/transferdialog.cpp b/noncore/apps/qashmoney/transferdialog.cpp
index 558abec..7a12fbf 100755
--- a/noncore/apps/qashmoney/transferdialog.cpp
+++ b/noncore/apps/qashmoney/transferdialog.cpp
@@ -1,81 +1,81 @@
1#include "transferdialog.h" 1#include "transferdialog.h"
2#include "datepicker.h" 2#include "datepicker.h"
3#include "calculator.h" 3#include "calculator.h"
4 4
5 5
6extern Preferences *preferences; 6extern Preferences *preferences;
7extern Account *account; 7extern Account *account;
8 8
9TransferDialog::TransferDialog ( QWidget *parent, int fromaccountid, int toaccountid ) : QDialog ( parent, 0, TRUE ) 9TransferDialog::TransferDialog ( QWidget *parent, int fromaccountid, int toaccountid ) : QDialog ( parent, 0, TRUE )
10 { 10 {
11 dateedited = FALSE; 11 dateedited = FALSE;
12 setCaption ( "Transfer" ); 12 setCaption ( "Transfer" );
13 13
14 fromaccountlabel = new QLabel ( "From account:", this ); 14 fromaccountlabel = new QLabel ( "From account:", this );
15 QFont f = this->font(); 15 QFont f = this->font();
16 f.setWeight ( QFont::Bold ); 16 f.setWeight ( QFont::Bold );
17 fromaccountlabel->setFont ( f ); 17 fromaccountlabel->setFont ( f );
18 fromaccount = new QLabel ( account->getAccountName ( fromaccountid ), this ); 18 fromaccount = new QLabel ( account->getAccountName ( fromaccountid ), this );
19 19
20 toaccountlabel = new QLabel ( "To Account:", this ); 20 toaccountlabel = new QLabel ( "To Account:", this );
21 toaccountlabel->setFont ( f ); 21 toaccountlabel->setFont ( f );
22 toaccount = new QLabel ( account->getAccountName ( toaccountid ), this ); 22 toaccount = new QLabel ( account->getAccountName ( toaccountid ), this );
23 23
24 datelabel = new QLabel ( "Date", this ); 24 datelabel = new QLabel ( "Date", this );
25 25
26 datebox = new QHBox ( this ); 26 datebox = new QHBox ( this );
27 datebox->setSpacing ( 2 ); 27 datebox->setSpacing ( 2 );
28 date = new QLineEdit ( datebox ); 28 date = new QLineEdit ( datebox );
29 date->setAlignment ( Qt::AlignRight ); 29 date->setAlignment ( Qt::AlignRight );
30 date->setDisabled ( TRUE ); 30 date->setDisabled ( TRUE );
31 datebutton = new QPushButton ( datebox ); 31 datebutton = new QPushButton ( datebox );
32 datebutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/date.png" ) ); 32 datebutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/date.png" ) );
33 connect ( datebutton, SIGNAL ( released () ), this, SLOT ( showCalendar () ) ); 33 connect ( datebutton, SIGNAL ( released() ), this, SLOT ( showCalendar() ) );
34 34
35 amounttlabel = new QLabel ( "Amount", this ); 35 amounttlabel = new QLabel ( "Amount", this );
36 36
37 amountbox = new QHBox ( this ); 37 amountbox = new QHBox ( this );
38 amountbox->setSpacing ( 2 ); 38 amountbox->setSpacing ( 2 );
39 amount = new QLineEdit ( amountbox ); 39 amount = new QLineEdit ( amountbox );
40 amount->setAlignment ( Qt::AlignRight ); 40 amount->setAlignment ( Qt::AlignRight );
41 calculatorbutton = new QPushButton( amountbox ); 41 calculatorbutton = new QPushButton( amountbox );
42 calculatorbutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/kcalc.png" ) ); 42 calculatorbutton->setPixmap ( QPixmap ( "/opt/QtPalmtop/pics/kcalc.png" ) );
43 connect ( calculatorbutton, SIGNAL ( released() ), this, SLOT ( showCalculator() ) ); 43 connect ( calculatorbutton, SIGNAL ( released() ), this, SLOT ( showCalculator() ) );
44 44
45 clearedcheckbox = new QCheckBox ( "Cleared", this ); 45 clearedcheckbox = new QCheckBox ( "Cleared", this );
46 46
47 layout = new QVBoxLayout ( this, 4, 2 ); 47 layout = new QVBoxLayout ( this, 4, 2 );
48 layout->addWidget ( fromaccountlabel, Qt::AlignLeft ); 48 layout->addWidget ( fromaccountlabel, Qt::AlignLeft );
49 layout->addWidget ( fromaccount, Qt::AlignLeft ); 49 layout->addWidget ( fromaccount, Qt::AlignLeft );
50 layout->addWidget ( toaccountlabel, Qt::AlignLeft ); 50 layout->addWidget ( toaccountlabel, Qt::AlignLeft );
51 layout->addWidget ( toaccount, Qt::AlignLeft ); 51 layout->addWidget ( toaccount, Qt::AlignLeft );
52 layout->addSpacing ( 5 ); 52 layout->addSpacing ( 5 );
53 layout->addWidget ( datelabel, Qt::AlignLeft ); 53 layout->addWidget ( datelabel, Qt::AlignLeft );
54 layout->addWidget ( datebox, Qt::AlignLeft ); 54 layout->addWidget ( datebox, Qt::AlignLeft );
55 layout->addWidget ( amounttlabel, Qt::AlignLeft ); 55 layout->addWidget ( amounttlabel, Qt::AlignLeft );
56 layout->addWidget ( amountbox, Qt::AlignLeft ); 56 layout->addWidget ( amountbox, Qt::AlignLeft );
57 layout->addWidget ( clearedcheckbox, Qt::AlignLeft ); 57 layout->addWidget ( clearedcheckbox, Qt::AlignLeft );
58 } 58 }
59 59
60bool TransferDialog::getDateEdited () 60bool TransferDialog::getDateEdited ()
61 { 61 {
62 return dateedited; 62 return dateedited;
63 } 63 }
64 64
65void TransferDialog::showCalendar () 65void TransferDialog::showCalendar ()
66 { 66 {
67 QDate newDate = QDate::currentDate (); 67 QDate newDate = QDate::currentDate ();
68 DatePicker *dp = new DatePicker ( newDate ); 68 DatePicker *dp = new DatePicker ( newDate );
69 if ( dp->exec () == QDialog::Accepted ) 69 if ( dp->exec () == QDialog::Accepted )
70 { 70 {
71 // Set date integers 71 // Set date integers
72 year = dp->getYear(); 72 year = dp->getYear();
73 month = dp->getMonth(); 73 month = dp->getMonth();
74 day = dp->getDay(); 74 day = dp->getDay();
75 75
76 // Set dateedited to TRUE 76 // Set dateedited to TRUE
77 // This tells the accountdisplay object that the user edited an account 77 // This tells the accountdisplay object that the user edited an account
78 // and did change the date 78 // and did change the date
79 dateedited = TRUE; 79 dateedited = TRUE;
80 80
81 // Display date with our selected format 81 // Display date with our selected format
diff --git a/noncore/apps/tableviewer/tableviewer.cpp b/noncore/apps/tableviewer/tableviewer.cpp
index f35dfcd..4c6d809 100644
--- a/noncore/apps/tableviewer/tableviewer.cpp
+++ b/noncore/apps/tableviewer/tableviewer.cpp
@@ -110,104 +110,104 @@ TableViewerWindow::TableViewerWindow(QWidget *parent, const char *name, WFlags f
110 QString::null, this, 110 QString::null, this,
111 SLOT(firstItem()), navigation, "First Item"); 111 SLOT(firstItem()), navigation, "First Item");
112 QToolButton *previousItemButton = new QToolButton( 112 QToolButton *previousItemButton = new QToolButton(
113 QIconSet(Resource::loadPixmap("back")), "Previous Item", 113 QIconSet(Resource::loadPixmap("back")), "Previous Item",
114 QString::null, this, 114 QString::null, this,
115 SLOT(previousItem()), navigation, "Previous Item"); 115 SLOT(previousItem()), navigation, "Previous Item");
116 QToolButton *nextItemButton = new QToolButton( 116 QToolButton *nextItemButton = new QToolButton(
117 QIconSet(Resource::loadPixmap("forward")), "Next Item", 117 QIconSet(Resource::loadPixmap("forward")), "Next Item",
118 QString::null, this, 118 QString::null, this,
119 SLOT(nextItem()), navigation, "Next Item"); 119 SLOT(nextItem()), navigation, "Next Item");
120 QToolButton *lastItemButton = new QToolButton( 120 QToolButton *lastItemButton = new QToolButton(
121 QIconSet(Resource::loadPixmap("fastforward")), "Last Item", 121 QIconSet(Resource::loadPixmap("fastforward")), "Last Item",
122 QString::null, this, 122 QString::null, this,
123 SLOT(lastItem()), navigation, "Last Item"); 123 SLOT(lastItem()), navigation, "Last Item");
124 124
125 navigation->addSeparator(); 125 navigation->addSeparator();
126 QToolButton *browseButton = new QToolButton( 126 QToolButton *browseButton = new QToolButton(
127 QIconSet(Resource::loadPixmap("day")), "View Single Item", 127 QIconSet(Resource::loadPixmap("day")), "View Single Item",
128 QString::null, this, 128 QString::null, this,
129 SLOT(browseViewSlot()), navigation, "View Single Item"); 129 SLOT(browseViewSlot()), navigation, "View Single Item");
130 QToolButton *listButton = new QToolButton( 130 QToolButton *listButton = new QToolButton(
131 QIconSet(Resource::loadPixmap("month")), "View Multiple Items", 131 QIconSet(Resource::loadPixmap("month")), "View Multiple Items",
132 QString::null, this, 132 QString::null, this,
133 SLOT(listViewSlot()), navigation, "View Multiple Items"); 133 SLOT(listViewSlot()), navigation, "View Multiple Items");
134 134
135 setToolBarsMovable(FALSE); 135 setToolBarsMovable(FALSE);
136 setToolBarsMovable(FALSE); 136 setToolBarsMovable(FALSE);
137 setToolBarsMovable(FALSE); 137 setToolBarsMovable(FALSE);
138 138
139/* Build widgets */ 139/* Build widgets */
140 browseView = new TVBrowseView(&ts, this, 0); 140 browseView = new TVBrowseView(&ts, this, 0);
141 listView = new TVListView(&ts, this, 0); 141 listView = new TVListView(&ts, this, 0);
142 filterView = new TVFilterView(&ts, this, 0); 142 filterView = new TVFilterView(&ts, this, 0);
143 fileSelector = new FileSelector("text/csv;text/x-xml-tableviewer", 143 fileSelector = new FileSelector("text/csv;text/x-xml-tableviewer",
144 this, "fileselector"); 144 this, "fileselector");
145 fileSelector->setNewVisible(FALSE); 145 fileSelector->setNewVisible(FALSE);
146 fileSelector->setCloseVisible(FALSE); 146 fileSelector->setCloseVisible(FALSE);
147 147
148 cw = new QWidgetStack(this, 0); 148 cw = new QWidgetStack(this, 0);
149 cw->addWidget(listView, ListState); 149 cw->addWidget(listView, ListState);
150 cw->addWidget(browseView, BrowseState); 150 cw->addWidget(browseView, BrowseState);
151 cw->addWidget(filterView, FilterState); 151 cw->addWidget(filterView, FilterState);
152 cw->addWidget(fileSelector, FileState); 152 cw->addWidget(fileSelector, FileState);
153 153
154 current_view = FileState; 154 current_view = FileState;
155 cw->raiseWidget(current_view); 155 cw->raiseWidget(current_view);
156 fileSelector->reread(); 156 fileSelector->reread();
157 157
158 connect(browseView, SIGNAL(searchOnKey(int, TVVariant)), 158 connect(browseView, SIGNAL(searchOnKey(int,TVVariant)),
159 this, SLOT(searchOnKey(int, TVVariant))); 159 this, SLOT(searchOnKey(int,TVVariant)));
160 connect(browseView, SIGNAL(sortChanged(int)), 160 connect(browseView, SIGNAL(sortChanged(int)),
161 this, SLOT(setPrimaryKey(int))); 161 this, SLOT(setPrimaryKey(int)));
162 162
163 connect(fileSelector, SIGNAL(closeMe()), this, SLOT(browseViewSlot())); 163 connect(fileSelector, SIGNAL(closeMe()), this, SLOT(browseViewSlot()));
164 connect(fileSelector, SIGNAL(fileSelected(const DocLnk &)), 164 connect(fileSelector, SIGNAL(fileSelected(const DocLnk&)),
165 this, SLOT(openDocument(const DocLnk &))); 165 this, SLOT(openDocument(const DocLnk&)));
166 166
167 main_layout->addWidget(menu); 167 main_layout->addWidget(menu);
168 main_layout->addWidget(cw); 168 main_layout->addWidget(cw);
169 169
170 setCentralWidget(cw); 170 setCentralWidget(cw);
171 171
172} 172}
173 173
174/*! 174/*!
175 Destroys the TableViewerWindow 175 Destroys the TableViewerWindow
176*/ 176*/
177TableViewerWindow::~TableViewerWindow() 177TableViewerWindow::~TableViewerWindow()
178{ 178{
179 if(dirty) 179 if(dirty)
180 saveDocument(); 180 saveDocument();
181} 181}
182 182
183/*! 183/*!
184 Opens a file dialog and loads the file specified by the dialog 184 Opens a file dialog and loads the file specified by the dialog
185*/ 185*/
186void TableViewerWindow::selectDocument() 186void TableViewerWindow::selectDocument()
187{ 187{
188 if(dirty) 188 if(dirty)
189 saveDocument(); 189 saveDocument();
190 current_view = FileState; 190 current_view = FileState;
191 cw->raiseWidget(current_view); 191 cw->raiseWidget(current_view);
192 fileSelector->reread(); 192 fileSelector->reread();
193} 193}
194 194
195void TableViewerWindow::saveDocument() 195void TableViewerWindow::saveDocument()
196{ 196{
197 if(!dirty) 197 if(!dirty)
198 return; 198 return;
199 199
200 FileManager fm; 200 FileManager fm;
201 QIODevice *dev = fm.saveFile(doc); 201 QIODevice *dev = fm.saveFile(doc);
202 202
203 if(!ds->saveSource(dev, doc.type())){ 203 if(!ds->saveSource(dev, doc.type())){
204 qWarning("Save unsuccessful"); 204 qWarning("Save unsuccessful");
205 return; 205 return;
206 } 206 }
207 dev->close(); 207 dev->close();
208 dirty = FALSE; 208 dirty = FALSE;
209} 209}
210 210
211void TableViewerWindow::newDocument() 211void TableViewerWindow::newDocument()
212{ 212{
213 DocLnk nf; 213 DocLnk nf;
diff --git a/noncore/apps/tableviewer/ui/commonwidgets.cpp b/noncore/apps/tableviewer/ui/commonwidgets.cpp
index 4c47951..e82018c 100644
--- a/noncore/apps/tableviewer/ui/commonwidgets.cpp
+++ b/noncore/apps/tableviewer/ui/commonwidgets.cpp
@@ -1,88 +1,88 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20 20
21#include <qlineedit.h> 21#include <qlineedit.h>
22#include <qlayout.h> 22#include <qlayout.h>
23#include <qlabel.h> 23#include <qlabel.h>
24#include <qcombobox.h> 24#include <qcombobox.h>
25 25
26#include <qpe/datebookmonth.h> 26#include <qpe/datebookmonth.h>
27#include <qpopupmenu.h> 27#include <qpopupmenu.h>
28#include <qspinbox.h> 28#include <qspinbox.h>
29#include "commonwidgets.h" 29#include "commonwidgets.h"
30 30
31DateEdit::DateEdit( QWidget *parent, const char *name, WFlags f ) 31DateEdit::DateEdit( QWidget *parent, const char *name, WFlags f )
32 : QToolButton(parent, name) 32 : QToolButton(parent, name)
33{ 33{
34 QPopupMenu *m1 = new QPopupMenu(this); 34 QPopupMenu *m1 = new QPopupMenu(this);
35 dateSelector = new DateBookMonth(m1, 0, TRUE); 35 dateSelector = new DateBookMonth(m1, 0, TRUE);
36 m1->insertItem(dateSelector); 36 m1->insertItem(dateSelector);
37 setPopup(m1); 37 setPopup(m1);
38 setPopupDelay(0); 38 setPopupDelay(0);
39 39
40 connect(dateSelector, SIGNAL(dateClicked(int, int, int)), 40 connect(dateSelector, SIGNAL(dateClicked(int,int,int)),
41 this, SLOT(subValueChanged())); 41 this, SLOT(subValueChanged()));
42 42
43 setText(dateSelector->selectedDate().toString()); 43 setText(dateSelector->selectedDate().toString());
44} 44}
45 45
46 46
47DateEdit::~DateEdit() {} 47DateEdit::~DateEdit() {}
48 48
49QDate DateEdit::date() const 49QDate DateEdit::date() const
50{ 50{
51 return dateSelector->selectedDate(); 51 return dateSelector->selectedDate();
52} 52}
53 53
54void DateEdit::setDate(QDate d) 54void DateEdit::setDate(QDate d)
55{ 55{
56 dateSelector->setDate(d.year(), d.month(), d.day()); 56 dateSelector->setDate(d.year(), d.month(), d.day());
57 setText(d.toString()); 57 setText(d.toString());
58} 58}
59 59
60QSizePolicy DateEdit::sizePolicy() const 60QSizePolicy DateEdit::sizePolicy() const
61{ 61{
62 QSizePolicy sp; 62 QSizePolicy sp;
63 sp.setHorData(QToolButton::sizePolicy().horData()); 63 sp.setHorData(QToolButton::sizePolicy().horData());
64 sp.setVerData(QSizePolicy::Fixed); 64 sp.setVerData(QSizePolicy::Fixed);
65 65
66 return sp; 66 return sp;
67} 67}
68 68
69void DateEdit::clear() 69void DateEdit::clear()
70{ 70{
71 QDate today = QDate::currentDate(); 71 QDate today = QDate::currentDate();
72 72
73 dateSelector->setDate(today.year(), today.month(), today.day()); 73 dateSelector->setDate(today.year(), today.month(), today.day());
74 setText(today.toString()); 74 setText(today.toString());
75} 75}
76 76
77void DateEdit::subValueChanged() 77void DateEdit::subValueChanged()
78{ 78{
79 QDate current = dateSelector->selectedDate(); 79 QDate current = dateSelector->selectedDate();
80 80
81 setText(current.toString()); 81 setText(current.toString());
82 emit valueChanged(current); 82 emit valueChanged(current);
83} 83}
84 84
85TimeEdit::TimeEdit( QWidget *parent, const char *name, WFlags f ) 85TimeEdit::TimeEdit( QWidget *parent, const char *name, WFlags f )
86 : QWidget(parent, name, f) 86 : QWidget(parent, name, f)
87{ 87{
88 QHBoxLayout *layout = new QHBoxLayout(this, 0); 88 QHBoxLayout *layout = new QHBoxLayout(this, 0);
diff --git a/noncore/apps/tableviewer/ui/tvbrowseview.cpp b/noncore/apps/tableviewer/ui/tvbrowseview.cpp
index 22bac55..8a65ed1 100644
--- a/noncore/apps/tableviewer/ui/tvbrowseview.cpp
+++ b/noncore/apps/tableviewer/ui/tvbrowseview.cpp
@@ -9,98 +9,98 @@
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#include "tvbrowseview.h" 20#include "tvbrowseview.h"
21#include "browsekeyentry.h" 21#include "browsekeyentry.h"
22#include <qtoolbutton.h> 22#include <qtoolbutton.h>
23#include <qtextview.h> 23#include <qtextview.h>
24#include <qtextbrowser.h> 24#include <qtextbrowser.h>
25#include <qlayout.h> 25#include <qlayout.h>
26#include "../xmlencodeattr.h" 26#include "../xmlencodeattr.h"
27 27
28/*! 28/*!
29 \class TVBrowseView 29 \class TVBrowseView
30 \brief The widget describing how to draw the browse view user interface 30 \brief The widget describing how to draw the browse view user interface
31 31
32 This widget allows for the user to browse through the table, one element 32 This widget allows for the user to browse through the table, one element
33 at a time, or search on a single key. Its main goal is to show a 33 at a time, or search on a single key. Its main goal is to show a
34 single element in a readable format and make it easy for the user to 34 single element in a readable format and make it easy for the user to
35 rapidly find specific elements in the table. 35 rapidly find specific elements in the table.
36*/ 36*/
37 37
38/*! 38/*!
39 Constructs a new TVBrowseView widget 39 Constructs a new TVBrowseView widget
40*/ 40*/
41TVBrowseView::TVBrowseView(TableState *t, QWidget* parent, const char *name, 41TVBrowseView::TVBrowseView(TableState *t, QWidget* parent, const char *name,
42 WFlags fl ) 42 WFlags fl )
43{ 43{
44 if (!name) 44 if (!name)
45 setName("BrowseView"); 45 setName("BrowseView");
46 46
47// setSizePolicy(QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding, 0, 0, sizePolicy().hasHeightForWidth() ) ); 47// setSizePolicy(QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding, 0, 0, sizePolicy().hasHeightForWidth() ) );
48 QVBoxLayout *vlayout = new QVBoxLayout(this); 48 QVBoxLayout *vlayout = new QVBoxLayout(this);
49 textViewDisplay = new QTextBrowser(this, "textViewDisplay"); 49 textViewDisplay = new QTextBrowser(this, "textViewDisplay");
50 vlayout->addWidget( textViewDisplay ); 50 vlayout->addWidget( textViewDisplay );
51 51
52 keyEntry = new TVBrowseKeyEntry(this, "keyEntry"); 52 keyEntry = new TVBrowseKeyEntry(this, "keyEntry");
53 vlayout->addWidget( keyEntry ); 53 vlayout->addWidget( keyEntry );
54 54
55 /* connect the signals down */ 55 /* connect the signals down */
56 56
57 connect(keyEntry, SIGNAL(searchOnKey(int, TVVariant)), 57 connect(keyEntry, SIGNAL(searchOnKey(int,TVVariant)),
58 this, SIGNAL(searchOnKey(int, TVVariant))); 58 this, SIGNAL(searchOnKey(int,TVVariant)));
59 connect(keyEntry, SIGNAL(sortChanged(int)), 59 connect(keyEntry, SIGNAL(sortChanged(int)),
60 this, SIGNAL(sortChanged(int))); 60 this, SIGNAL(sortChanged(int)));
61 61
62 ts = t; 62 ts = t;
63 keyEntry->setTableState(t); 63 keyEntry->setTableState(t);
64} 64}
65 65
66/*! 66/*!
67 Destroys the TVBrowseView widget 67 Destroys the TVBrowseView widget
68*/ 68*/
69TVBrowseView::~TVBrowseView() 69TVBrowseView::~TVBrowseView()
70{ 70{
71} 71}
72 72
73void TVBrowseView::rebuildData() 73void TVBrowseView::rebuildData()
74{ 74{
75 if(!ts) 75 if(!ts)
76 return; 76 return;
77 if(!ts->current_elem) { 77 if(!ts->current_elem) {
78 /* also disable buttons */ 78 /* also disable buttons */
79 textViewDisplay->setText(""); 79 textViewDisplay->setText("");
80 return; 80 return;
81 } 81 }
82 82
83 setDisplayText(ts->current_elem); 83 setDisplayText(ts->current_elem);
84} 84}
85 85
86/* Reset to initial state */ 86/* Reset to initial state */
87void TVBrowseView::reset() 87void TVBrowseView::reset()
88{ 88{
89 textViewDisplay->setText(""); 89 textViewDisplay->setText("");
90 keyEntry->reset(); 90 keyEntry->reset();
91} 91}
92 92
93/*! 93/*!
94 sets the data element to be displayed to element 94 sets the data element to be displayed to element
95*/ 95*/
96void TVBrowseView::setDisplayText(const DataElem *element) 96void TVBrowseView::setDisplayText(const DataElem *element)
97{ 97{
98 QString rep = ""; 98 QString rep = "";
99 99
100 KeyListIterator it(*ts->kRep); 100 KeyListIterator it(*ts->kRep);
101 101
102 while (it.current()) { 102 while (it.current()) {
103 if (element->hasValidValue(it.currentKey())) { 103 if (element->hasValidValue(it.currentKey())) {
104 if(it.currentKey() == ts->current_column) { 104 if(it.currentKey() == ts->current_column) {
105 rep += "<A name=\"ckey\"></A><B><FONT COLOR=#FF0000>" 105 rep += "<A name=\"ckey\"></A><B><FONT COLOR=#FF0000>"
106 + encodeAttr(it.current()->name()) 106 + encodeAttr(it.current()->name())
diff --git a/noncore/apps/tableviewer/ui/tvfilterview.cpp b/noncore/apps/tableviewer/ui/tvfilterview.cpp
index b03e846..22f1fb7 100644
--- a/noncore/apps/tableviewer/ui/tvfilterview.cpp
+++ b/noncore/apps/tableviewer/ui/tvfilterview.cpp
@@ -44,97 +44,97 @@ TVFilterView::TVFilterView(TableState *t, QWidget* parent,
44 display->header()->setResizeEnabled(FALSE); 44 display->header()->setResizeEnabled(FALSE);
45 45
46 vlayout->addWidget(display); 46 vlayout->addWidget(display);
47 47
48 QHBoxLayout *hlayout = new QHBoxLayout; 48 QHBoxLayout *hlayout = new QHBoxLayout;
49 hlayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum)); 49 hlayout->addItem(new QSpacerItem(20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum));
50 50
51 newFilterButton = new QPushButton(this, "new Filter"); 51 newFilterButton = new QPushButton(this, "new Filter");
52 newFilterButton->setMaximumSize(QSize(50, 32767)); 52 newFilterButton->setMaximumSize(QSize(50, 32767));
53 newFilterButton->setText("New"); 53 newFilterButton->setText("New");
54 hlayout->addWidget(newFilterButton); 54 hlayout->addWidget(newFilterButton);
55 55
56 deleteFilterButton = new QPushButton(this, "delete Filter"); 56 deleteFilterButton = new QPushButton(this, "delete Filter");
57 deleteFilterButton->setMaximumSize(QSize(50, 32767)); 57 deleteFilterButton->setMaximumSize(QSize(50, 32767));
58 deleteFilterButton->setText("Delete"); 58 deleteFilterButton->setText("Delete");
59 hlayout->addWidget(deleteFilterButton); 59 hlayout->addWidget(deleteFilterButton);
60 60
61 clearFilterButton = new QPushButton(this, "delete Filter"); 61 clearFilterButton = new QPushButton(this, "delete Filter");
62 clearFilterButton->setMaximumSize(QSize(60, 32767)); 62 clearFilterButton->setMaximumSize(QSize(60, 32767));
63 clearFilterButton->setText("Clear All"); 63 clearFilterButton->setText("Clear All");
64 hlayout->addWidget(clearFilterButton); 64 hlayout->addWidget(clearFilterButton);
65 65
66 vlayout->addLayout(hlayout); 66 vlayout->addLayout(hlayout);
67 67
68 QHBoxLayout *hlayout2 = new QHBoxLayout; 68 QHBoxLayout *hlayout2 = new QHBoxLayout;
69 69
70 keyNameCombo = new QComboBox(FALSE, this, "key name"); 70 keyNameCombo = new QComboBox(FALSE, this, "key name");
71 keyNameCombo->setEnabled(FALSE); 71 keyNameCombo->setEnabled(FALSE);
72 hlayout2->addWidget(keyNameCombo); 72 hlayout2->addWidget(keyNameCombo);
73 73
74 QLabel *label = new QLabel(this); 74 QLabel *label = new QLabel(this);
75 label->setText("has value"); 75 label->setText("has value");
76 hlayout2->addWidget(label); 76 hlayout2->addWidget(label);
77 77
78 keyEntry = new TVFilterKeyEntry(this, "key entry"); 78 keyEntry = new TVFilterKeyEntry(this, "key entry");
79 keyEntry->setEnabled(FALSE); 79 keyEntry->setEnabled(FALSE);
80 80
81 vlayout->addLayout(hlayout2); 81 vlayout->addLayout(hlayout2);
82 vlayout->addWidget(keyEntry); 82 vlayout->addWidget(keyEntry);
83 83
84 connect(newFilterButton, SIGNAL( clicked() ), this, SLOT( newTerm() )); 84 connect(newFilterButton, SIGNAL( clicked() ), this, SLOT( newTerm() ));
85 connect(deleteFilterButton, SIGNAL( clicked() ), this, SLOT( deleteTerm())); 85 connect(deleteFilterButton, SIGNAL( clicked() ), this, SLOT( deleteTerm()));
86 connect(clearFilterButton, SIGNAL( clicked() ), this, SLOT( clearTerms())); 86 connect(clearFilterButton, SIGNAL( clicked() ), this, SLOT( clearTerms()));
87 87
88 connect(keyEntry, SIGNAL(valueChanged()), this, SLOT( updateTerm() )); 88 connect(keyEntry, SIGNAL(valueChanged()), this, SLOT( updateTerm() ));
89 connect(keyNameCombo, SIGNAL(activated(int)), this, SLOT( updateTerm() )); 89 connect(keyNameCombo, SIGNAL(activated(int)), this, SLOT( updateTerm() ));
90 90
91 connect(display, SIGNAL(selectionChanged(QListViewItem*)), this, 91 connect(display, SIGNAL(selectionChanged(QListViewItem*)), this,
92 SLOT(setTerm(QListViewItem *))); 92 SLOT(setTerm(QListViewItem*)));
93 93
94 ts = t; 94 ts = t;
95 current = 0; 95 current = 0;
96 terms.setAutoDelete(true); 96 terms.setAutoDelete(true);
97 do_filter = false; 97 do_filter = false;
98 98
99#ifdef Q_WS_QWS 99#ifdef Q_WS_QWS
100 QPEApplication::showDialog( this ); 100 QPEApplication::showDialog( this );
101#endif 101#endif
102} 102}
103 103
104/*! 104/*!
105 Destroys the TVFilterView widget 105 Destroys the TVFilterView widget
106*/ 106*/
107TVFilterView::~TVFilterView() 107TVFilterView::~TVFilterView()
108{ 108{
109} 109}
110 110
111void TVFilterView::rebuildData() 111void TVFilterView::rebuildData()
112{ 112{
113} 113}
114 114
115void TVFilterView::reset() 115void TVFilterView::reset()
116{ 116{
117 keyNameCombo->clear(); 117 keyNameCombo->clear();
118 keyIds.clear(); 118 keyIds.clear();
119} 119}
120 120
121void TVFilterView::rebuildKeys() 121void TVFilterView::rebuildKeys()
122{ 122{
123 int i; 123 int i;
124 124
125 if (!ts) return; 125 if (!ts) return;
126 if(!ts->kRep) return; 126 if(!ts->kRep) return;
127 keyEntry->setTableState(ts); 127 keyEntry->setTableState(ts);
128 128
129 /* set up the list of keys that can be compared on */ 129 /* set up the list of keys that can be compared on */
130 keyNameCombo->clear(); 130 keyNameCombo->clear();
131 KeyListIterator it(*ts->kRep); 131 KeyListIterator it(*ts->kRep);
132 132
133 i = 0; 133 i = 0;
134 while(it.current()) { 134 while(it.current()) {
135 if(ts->kRep->validIndex(it.currentKey())) { 135 if(ts->kRep->validIndex(it.currentKey())) {
136 keyNameCombo->insertItem(it.current()->name()); 136 keyNameCombo->insertItem(it.current()->name());
137 keyIds.insert(i, it.currentKey()); 137 keyIds.insert(i, it.currentKey());
138 ++i; 138 ++i;
139 } 139 }
140 ++it; 140 ++it;
diff --git a/noncore/apps/tableviewer/ui/tvlistview.cpp b/noncore/apps/tableviewer/ui/tvlistview.cpp
index b25e813..b10ff1d 100644
--- a/noncore/apps/tableviewer/ui/tvlistview.cpp
+++ b/noncore/apps/tableviewer/ui/tvlistview.cpp
@@ -59,98 +59,98 @@ public:
59 } 59 }
60 QString key(int i, bool a) const 60 QString key(int i, bool a) const
61 { 61 {
62 return data_reference->toSortableQString(i); 62 return data_reference->toSortableQString(i);
63 } 63 }
64 64
65 void setDataElem(DataElem *d) 65 void setDataElem(DataElem *d)
66 { 66 {
67 data_reference = d; 67 data_reference = d;
68 } 68 }
69 69
70 DataElem *getDataElem() { 70 DataElem *getDataElem() {
71 return data_reference; 71 return data_reference;
72 } 72 }
73private: 73private:
74 DataElem *data_reference; 74 DataElem *data_reference;
75}; 75};
76 76
77TVListViewItem::TVListViewItem(QListView *parent, DataElem *d) 77TVListViewItem::TVListViewItem(QListView *parent, DataElem *d)
78 : QListViewItem(parent) 78 : QListViewItem(parent)
79{ 79{
80 data_reference = d; 80 data_reference = d;
81} 81}
82 82
83TVListViewItem::~TVListViewItem() 83TVListViewItem::~TVListViewItem()
84{ 84{
85 data_reference = 0; 85 data_reference = 0;
86} 86}
87 87
88TVListView::TVListView(TableState *t, QWidget* parent, 88TVListView::TVListView(TableState *t, QWidget* parent,
89 const char *name, WFlags fl ) : QWidget(parent, name, fl) 89 const char *name, WFlags fl ) : QWidget(parent, name, fl)
90{ 90{
91 if (!name) 91 if (!name)
92 setName("TVListView"); 92 setName("TVListView");
93 93
94 // the next two lines need to be rationalized. 94 // the next two lines need to be rationalized.
95 resize(318,457); 95 resize(318,457);
96 setSizePolicy(QSizePolicy((QSizePolicy::SizeType)7, 96 setSizePolicy(QSizePolicy((QSizePolicy::SizeType)7,
97 (QSizePolicy::SizeType)7, sizePolicy().hasHeightForWidth())); 97 (QSizePolicy::SizeType)7, sizePolicy().hasHeightForWidth()));
98 setCaption(tr("List View")); 98 setCaption(tr("List View"));
99 99
100 QVBoxLayout *layout = new QVBoxLayout(this); 100 QVBoxLayout *layout = new QVBoxLayout(this);
101 layout->setSpacing(0); 101 layout->setSpacing(0);
102 layout->setMargin(0); 102 layout->setMargin(0);
103 103
104 listViewDisplay = new TVListViewPrivate(this, "listViewDisplay"); 104 listViewDisplay = new TVListViewPrivate(this, "listViewDisplay");
105 layout->addWidget(listViewDisplay); 105 layout->addWidget(listViewDisplay);
106 106
107 connect(listViewDisplay, SIGNAL(currentChanged(QListViewItem *)), this, 107 connect(listViewDisplay, SIGNAL(currentChanged(QListViewItem*)), this,
108 SLOT(setCurrent(QListViewItem *))); 108 SLOT(setCurrent(QListViewItem*)));
109 connect(listViewDisplay, SIGNAL(sortChanged(int)), this, 109 connect(listViewDisplay, SIGNAL(sortChanged(int)), this,
110 SLOT(setSorting(int))); 110 SLOT(setSorting(int)));
111 111
112 listViewDisplay->setShowSortIndicator(true); 112 listViewDisplay->setShowSortIndicator(true);
113 113
114 it = new QListViewItemIterator(listViewDisplay); 114 it = new QListViewItemIterator(listViewDisplay);
115 ts = t; 115 ts = t;
116} 116}
117 117
118TVListView::~TVListView() 118TVListView::~TVListView()
119{ 119{
120} 120}
121 121
122void TVListView::addItem(DataElem *d) 122void TVListView::addItem(DataElem *d)
123{ 123{
124 TVListViewItem *i = new TVListViewItem(listViewDisplay, d); 124 TVListViewItem *i = new TVListViewItem(listViewDisplay, d);
125 125
126 delete it; 126 delete it;
127 it = new QListViewItemIterator(i); 127 it = new QListViewItemIterator(i);
128} 128}
129 129
130/* remove current (it) item */ 130/* remove current (it) item */
131void TVListView::removeItem() 131void TVListView::removeItem()
132{ 132{
133 QListViewItemIterator other(*it); 133 QListViewItemIterator other(*it);
134 134
135 QListViewItemIterator tmp = *it; 135 QListViewItemIterator tmp = *it;
136 (*it)++; 136 (*it)++;
137 if (!it->current()) { 137 if (!it->current()) {
138 *it = tmp; 138 *it = tmp;
139 (*it)--; 139 (*it)--;
140 if (!it->current()) { 140 if (!it->current()) {
141 delete it; 141 delete it;
142 it = 0; 142 it = 0;
143 } 143 }
144 } 144 }
145 145
146 delete other.current(); 146 delete other.current();
147} 147}
148 148
149void TVListView::clearItems() 149void TVListView::clearItems()
150{ 150{
151 /* This is ok since the destructor for TVListItem does not know about 151 /* This is ok since the destructor for TVListItem does not know about
152 the data_reference pointer.. and hence will leave it alone */ 152 the data_reference pointer.. and hence will leave it alone */
153 listViewDisplay->clear(); 153 listViewDisplay->clear();
154 delete it; 154 delete it;
155 it = new QListViewItemIterator(listViewDisplay); 155 it = new QListViewItemIterator(listViewDisplay);
156} 156}
diff --git a/noncore/apps/tinykate/libkate/document/katedialogs.cpp b/noncore/apps/tinykate/libkate/document/katedialogs.cpp
index 2f0ed7b..f4edd7e 100644
--- a/noncore/apps/tinykate/libkate/document/katedialogs.cpp
+++ b/noncore/apps/tinykate/libkate/document/katedialogs.cpp
@@ -10,105 +10,105 @@
10 10
11/*************************************************************************** 11/***************************************************************************
12 * * 12 * *
13 * This program is free software; you can redistribute it and/or modify * 13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by * 14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or * 15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. * 16 * (at your option) any later version. *
17 * * 17 * *
18 ***************************************************************************/ 18 ***************************************************************************/
19#include "katedialogs.h" 19#include "katedialogs.h"
20#include <klocale.h> 20#include <klocale.h>
21#include <kdebug.h> 21#include <kdebug.h>
22#include <qgroupbox.h> 22#include <qgroupbox.h>
23#include <qvgroupbox.h> 23#include <qvgroupbox.h>
24#include <qhgroupbox.h> 24#include <qhgroupbox.h>
25#include <qhbox.h> 25#include <qhbox.h>
26#include <qvbox.h> 26#include <qvbox.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qpushbutton.h> 28#include <qpushbutton.h>
29#include <qwidgetstack.h> 29#include <qwidgetstack.h>
30#include <qlabel.h> 30#include <qlabel.h>
31#include <qlistview.h> 31#include <qlistview.h>
32#include <qlineedit.h> 32#include <qlineedit.h>
33#include <qcombobox.h> 33#include <qcombobox.h>
34#include <qcheckbox.h> 34#include <qcheckbox.h>
35//FIXME #include <kcharsets.h> 35//FIXME #include <kcharsets.h>
36#include <kglobal.h> 36#include <kglobal.h>
37#include <qmap.h> 37#include <qmap.h>
38#include <kmessagebox.h> 38#include <kmessagebox.h>
39#include <kstddirs.h> 39#include <kstddirs.h>
40 40
41 41
42/******************************************************************************************************************* 42/*******************************************************************************************************************
43* Context Editor * 43* Context Editor *
44*******************************************************************************************************************/ 44*******************************************************************************************************************/
45 45
46StyleChanger::StyleChanger( QWidget *parent ) 46StyleChanger::StyleChanger( QWidget *parent )
47 : QWidget(parent) 47 : QWidget(parent)
48{ 48{
49 QLabel *label; 49 QLabel *label;
50 50
51 QGridLayout *glay = new QGridLayout( this, 4, 3, 0, KDialog::spacingHint() ); 51 QGridLayout *glay = new QGridLayout( this, 4, 3, 0, KDialog::spacingHint() );
52 CHECK_PTR(glay); 52 CHECK_PTR(glay);
53 glay->addColSpacing( 1, KDialog::spacingHint() ); // Looks better 53 glay->addColSpacing( 1, KDialog::spacingHint() ); // Looks better
54 glay->setColStretch( 2, 10 ); 54 glay->setColStretch( 2, 10 );
55 55
56 col = new KColorButton(this); 56 col = new KColorButton(this);
57 CHECK_PTR(col); 57 CHECK_PTR(col);
58 connect(col,SIGNAL(changed(const QColor &)),this,SLOT(changed())); 58 connect(col,SIGNAL(changed(const QColor&)),this,SLOT(changed()));
59 label = new QLabel(col,i18n("Normal:"),this); 59 label = new QLabel(col,i18n("Normal:"),this);
60 CHECK_PTR(label); 60 CHECK_PTR(label);
61 glay->addWidget(label,0,0); 61 glay->addWidget(label,0,0);
62 glay->addWidget(col,1,0); 62 glay->addWidget(col,1,0);
63 63
64 selCol = new KColorButton(this); 64 selCol = new KColorButton(this);
65 CHECK_PTR(selCol); 65 CHECK_PTR(selCol);
66 connect(selCol,SIGNAL(changed(const QColor &)),this,SLOT(changed())); 66 connect(selCol,SIGNAL(changed(const QColor&)),this,SLOT(changed()));
67 label = new QLabel(selCol,i18n("Selected:"),this); 67 label = new QLabel(selCol,i18n("Selected:"),this);
68 CHECK_PTR(label); 68 CHECK_PTR(label);
69 glay->addWidget(label,2,0); 69 glay->addWidget(label,2,0);
70 glay->addWidget(selCol,3,0); 70 glay->addWidget(selCol,3,0);
71 71
72 bold = new QCheckBox(i18n("Bold"),this); 72 bold = new QCheckBox(i18n("Bold"),this);
73 CHECK_PTR(bold); 73 CHECK_PTR(bold);
74 connect(bold,SIGNAL(clicked()),SLOT(changed())); 74 connect(bold,SIGNAL(clicked()),SLOT(changed()));
75 glay->addWidget(bold,1,2); 75 glay->addWidget(bold,1,2);
76 76
77 italic = new QCheckBox(i18n("Italic"),this); 77 italic = new QCheckBox(i18n("Italic"),this);
78 CHECK_PTR(italic); 78 CHECK_PTR(italic);
79 connect(italic,SIGNAL(clicked()),SLOT(changed())); 79 connect(italic,SIGNAL(clicked()),SLOT(changed()));
80 glay->addWidget(italic,2,2); 80 glay->addWidget(italic,2,2);
81} 81}
82 82
83void StyleChanger::setRef(ItemStyle *s) { 83void StyleChanger::setRef(ItemStyle *s) {
84 84
85 style = s; 85 style = s;
86 col->setColor(style->col); 86 col->setColor(style->col);
87 selCol->setColor(style->selCol); 87 selCol->setColor(style->selCol);
88 bold->setChecked(style->bold); 88 bold->setChecked(style->bold);
89 italic->setChecked(style->italic); 89 italic->setChecked(style->italic);
90 90
91} 91}
92 92
93void StyleChanger::setEnabled(bool enable) { 93void StyleChanger::setEnabled(bool enable) {
94 94
95 col->setEnabled(enable); 95 col->setEnabled(enable);
96 selCol->setEnabled(enable); 96 selCol->setEnabled(enable);
97 bold->setEnabled(enable); 97 bold->setEnabled(enable);
98 italic->setEnabled(enable); 98 italic->setEnabled(enable);
99} 99}
100 100
101void StyleChanger::changed() { 101void StyleChanger::changed() {
102 102
103 if (style) { 103 if (style) {
104 style->col = col->color(); 104 style->col = col->color();
105 style->selCol = selCol->color(); 105 style->selCol = selCol->color();
106 style->bold = bold->isChecked(); 106 style->bold = bold->isChecked();
107 style->italic = italic->isChecked(); 107 style->italic = italic->isChecked();
108 } 108 }
109} 109}
110 110
111HighlightDialog::HighlightDialog( HlManager *hlManager, ItemStyleList *styleList, 111HighlightDialog::HighlightDialog( HlManager *hlManager, ItemStyleList *styleList,
112 HlDataList *highlightDataList, 112 HlDataList *highlightDataList,
113 int hlNumber, QWidget *parent, 113 int hlNumber, QWidget *parent,
114 const char *name, bool modal ) 114 const char *name, bool modal )
@@ -241,97 +241,97 @@ void HighlightDialogPage::changed()
241void HighlightDialogPage::writeback() { 241void HighlightDialogPage::writeback() {
242 if (hlData) { 242 if (hlData) {
243 hlData->wildcards = wildcards->text(); 243 hlData->wildcards = wildcards->text();
244 hlData->mimetypes = mimetypes->text(); 244 hlData->mimetypes = mimetypes->text();
245 } 245 }
246} 246}
247 247
248void HighlightDialogPage::saveData() { 248void HighlightDialogPage::saveData() {
249 kdDebug(13010)<<"HighlightDialogPage::saveData()"<<endl; 249 kdDebug(13010)<<"HighlightDialogPage::saveData()"<<endl;
250 writeback(); 250 writeback();
251} 251}
252 252
253 253
254void HighlightDialogPage::hlEdit() { 254void HighlightDialogPage::hlEdit() {
255 HlEditDialog diag(0,0,"hlEdit", true,hlData); 255 HlEditDialog diag(0,0,"hlEdit", true,hlData);
256 diag.show(); 256 diag.show();
257} 257}
258 258
259void HighlightDialogPage::hlNew() { 259void HighlightDialogPage::hlNew() {
260 HlEditDialog diag(0,0,"hlEdit",true,0); 260 HlEditDialog diag(0,0,"hlEdit",true,0);
261 diag.show(); 261 diag.show();
262} 262}
263 263
264 264
265HlEditDialog::HlEditDialog(HlManager *,QWidget *parent, const char *name, bool modal,HlData *data) 265HlEditDialog::HlEditDialog(HlManager *,QWidget *parent, const char *name, bool modal,HlData *data)
266 :KDialogBase(KDialogBase::Swallow, i18n("Highlight Conditions"), Ok|Cancel, Ok, parent, name, modal) 266 :KDialogBase(KDialogBase::Swallow, i18n("Highlight Conditions"), Ok|Cancel, Ok, parent, name, modal)
267{ 267{
268 currentItem=0; 268 currentItem=0;
269 transTableCnt=0; 269 transTableCnt=0;
270 QHBox *wid=new QHBox(this); 270 QHBox *wid=new QHBox(this);
271 QVBox *lbox=new QVBox(wid); 271 QVBox *lbox=new QVBox(wid);
272 contextList=new KListView(lbox); 272 contextList=new KListView(lbox);
273 contextList->setRootIsDecorated(true); 273 contextList->setRootIsDecorated(true);
274 contextList->addColumn(i18n("Syntax structure")); 274 contextList->addColumn(i18n("Syntax structure"));
275 contextList->setSorting(-1); 275 contextList->setSorting(-1);
276 QHBox *bbox=new QHBox(lbox); 276 QHBox *bbox=new QHBox(lbox);
277 QPushButton *addContext=new QPushButton(i18n("New Context"),bbox); 277 QPushButton *addContext=new QPushButton(i18n("New Context"),bbox);
278 QPushButton *addItem=new QPushButton(i18n("New Item"),bbox); 278 QPushButton *addItem=new QPushButton(i18n("New Item"),bbox);
279 QVGroupBox *opt = new QVGroupBox( i18n("Options"), wid); 279 QVGroupBox *opt = new QVGroupBox( i18n("Options"), wid);
280 stack=new QWidgetStack(opt); 280 stack=new QWidgetStack(opt);
281 initContextOptions(contextOptions=new QVBox(stack)); 281 initContextOptions(contextOptions=new QVBox(stack));
282 stack->addWidget(contextOptions,HlEContext); 282 stack->addWidget(contextOptions,HlEContext);
283 initItemOptions(itemOptions=new QVBox(stack)); 283 initItemOptions(itemOptions=new QVBox(stack));
284 stack->addWidget(itemOptions,HlEItem); 284 stack->addWidget(itemOptions,HlEItem);
285 stack->raiseWidget(HlEContext); 285 stack->raiseWidget(HlEContext);
286 setMainWidget(wid); 286 setMainWidget(wid);
287 if (data!=0) loadFromDocument(data); 287 if (data!=0) loadFromDocument(data);
288 else newDocument(); 288 else newDocument();
289 connect(contextList,SIGNAL(currentChanged( QListViewItem*)),this,SLOT(currentSelectionChanged ( QListViewItem * ))); 289 connect(contextList,SIGNAL(currentChanged(QListViewItem*)),this,SLOT(currentSelectionChanged(QListViewItem*)));
290 connect(addContext,SIGNAL(clicked()),this,SLOT(contextAddNew())); 290 connect(addContext,SIGNAL(clicked()),this,SLOT(contextAddNew()));
291 connect(addItem,SIGNAL(clicked()),this,SLOT(ItemAddNew())); 291 connect(addItem,SIGNAL(clicked()),this,SLOT(ItemAddNew()));
292 } 292 }
293 293
294void HlEditDialog::newDocument() 294void HlEditDialog::newDocument()
295{ 295{
296 KStandardDirs *dirs = KGlobal::dirs(); 296 KStandardDirs *dirs = KGlobal::dirs();
297 QStringList list=dirs->findAllResources("data","kate/syntax/syntax.template",false,true); 297 QStringList list=dirs->findAllResources("data","kate/syntax/syntax.template",false,true);
298 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) 298 for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
299 { 299 {
300 HlData data("","",*it); 300 HlData data("","",*it);
301 loadFromDocument(&data); 301 loadFromDocument(&data);
302 return; 302 return;
303 } 303 }
304 KMessageBox::error(this,i18n("Can't find template file")); 304 KMessageBox::error(this,i18n("Can't find template file"));
305} 305}
306 306
307 307
308void HlEditDialog::initContextOptions(QVBox *co) 308void HlEditDialog::initContextOptions(QVBox *co)
309{ 309{
310 if( co!=0) 310 if( co!=0)
311 { 311 {
312 QHBox *tmp = new QHBox(co); 312 QHBox *tmp = new QHBox(co);
313 (void) new QLabel(i18n("Description:"),tmp); 313 (void) new QLabel(i18n("Description:"),tmp);
314 ContextDescr=new QLineEdit(tmp); 314 ContextDescr=new QLineEdit(tmp);
315 tmp= new QHBox(co); 315 tmp= new QHBox(co);
316 (void) new QLabel(i18n("Attribute:"),tmp); 316 (void) new QLabel(i18n("Attribute:"),tmp);
317 ContextAttribute=new QComboBox(tmp); 317 ContextAttribute=new QComboBox(tmp);
318 tmp= new QHBox(co); 318 tmp= new QHBox(co);
319 (void) new QLabel(i18n("LineEnd:"),tmp); 319 (void) new QLabel(i18n("LineEnd:"),tmp);
320 ContextLineEnd = new QComboBox(tmp); 320 ContextLineEnd = new QComboBox(tmp);
321 connect(ContextDescr,SIGNAL(textChanged(const QString&)),this,SLOT(contextDescrChanged(const QString&))); 321 connect(ContextDescr,SIGNAL(textChanged(const QString&)),this,SLOT(contextDescrChanged(const QString&)));
322 connect(ContextLineEnd,SIGNAL(activated(int)),this,SLOT(contextLineEndChanged(int))); 322 connect(ContextLineEnd,SIGNAL(activated(int)),this,SLOT(contextLineEndChanged(int)));
323 connect(ContextAttribute,SIGNAL(activated(int)),this,SLOT(contextAttributeChanged(int))); 323 connect(ContextAttribute,SIGNAL(activated(int)),this,SLOT(contextAttributeChanged(int)));
324 } 324 }
325 else 325 else
326 kdDebug(13010)<<"initContextOptions: Widget is 0"<<endl; 326 kdDebug(13010)<<"initContextOptions: Widget is 0"<<endl;
327} 327}
328 328
329 329
330void HlEditDialog::insertTranslationList(QString tag, QString trans,int length) 330void HlEditDialog::insertTranslationList(QString tag, QString trans,int length)
331 { 331 {
332 ItemInfo data(trans,length); 332 ItemInfo data(trans,length);
333 id2tag.insert(transTableCnt,tag); 333 id2tag.insert(transTableCnt,tag);
334 id2info.insert(transTableCnt,data); 334 id2info.insert(transTableCnt,data);
335 tag2id.insert(tag,transTableCnt); 335 tag2id.insert(tag,transTableCnt);
336 transTableCnt++; 336 transTableCnt++;
337 } 337 }
diff --git a/noncore/apps/tinykate/libkate/document/katedocument.cpp b/noncore/apps/tinykate/libkate/document/katedocument.cpp
index f05e21a..0c742d7 100644
--- a/noncore/apps/tinykate/libkate/document/katedocument.cpp
+++ b/noncore/apps/tinykate/libkate/document/katedocument.cpp
@@ -123,97 +123,97 @@ const char * KateActionGroup::typeName(int type)
123 return ""; 123 return "";
124} 124}
125 125
126const int KateDocument::maxAttribs = 32; 126const int KateDocument::maxAttribs = 32;
127 127
128QStringList KateDocument::searchForList = QStringList(); 128QStringList KateDocument::searchForList = QStringList();
129QStringList KateDocument::replaceWithList = QStringList(); 129QStringList KateDocument::replaceWithList = QStringList();
130 130
131uint KateDocument::uniqueID = 0; 131uint KateDocument::uniqueID = 0;
132 132
133QPtrDict<KateDocument::KateDocPrivate>* KateDocument::d_ptr = 0; 133QPtrDict<KateDocument::KateDocPrivate>* KateDocument::d_ptr = 0;
134 134
135 135
136KateDocument::KateDocument(bool bSingleViewMode, bool bBrowserView, 136KateDocument::KateDocument(bool bSingleViewMode, bool bBrowserView,
137 QWidget *parentWidget, const char *widgetName, 137 QWidget *parentWidget, const char *widgetName,
138 QObject *, const char *) 138 QObject *, const char *)
139 : Kate::Document (), 139 : Kate::Document (),
140 myFont(KGlobalSettings::generalFont()), myFontBold(KGlobalSettings::generalFont()), myFontItalic(KGlobalSettings::generalFont()), myFontBI(KGlobalSettings::generalFont()), 140 myFont(KGlobalSettings::generalFont()), myFontBold(KGlobalSettings::generalFont()), myFontItalic(KGlobalSettings::generalFont()), myFontBI(KGlobalSettings::generalFont()),
141 myFontMetrics (myFont), myFontMetricsBold (myFontBold), myFontMetricsItalic (myFontItalic), myFontMetricsBI (myFontBI), 141 myFontMetrics (myFont), myFontMetricsBold (myFontBold), myFontMetricsItalic (myFontItalic), myFontMetricsBI (myFontBI),
142 hlManager(HlManager::self ()) 142 hlManager(HlManager::self ())
143{ 143{
144 144
145 d(this)->hlSetByUser = false; 145 d(this)->hlSetByUser = false;
146 PreHighlightedTill=0; 146 PreHighlightedTill=0;
147 RequestPreHighlightTill=0; 147 RequestPreHighlightTill=0;
148 148
149 m_bSingleViewMode=bSingleViewMode; 149 m_bSingleViewMode=bSingleViewMode;
150 m_bBrowserView = bBrowserView; 150 m_bBrowserView = bBrowserView;
151 151
152 m_url = QString::null; 152 m_url = QString::null;
153 153
154 // NOTE: QFont::CharSet doesn't provide all the charsets KDE supports 154 // NOTE: QFont::CharSet doesn't provide all the charsets KDE supports
155 // (esp. it doesn't distinguish between UTF-8 and iso10646-1) 155 // (esp. it doesn't distinguish between UTF-8 and iso10646-1)
156 156
157 myEncoding = QString::fromLatin1(QTextCodec::codecForLocale()->name()); 157 myEncoding = QString::fromLatin1(QTextCodec::codecForLocale()->name());
158 158
159 maxLength = -1; 159 maxLength = -1;
160 160
161 setFont (KGlobalSettings::generalFont()); 161 setFont (KGlobalSettings::generalFont());
162 162
163 myDocID = uniqueID; 163 myDocID = uniqueID;
164 uniqueID++; 164 uniqueID++;
165 165
166 myDocName = QString (""); 166 myDocName = QString ("");
167 fileInfo = new QFileInfo (); 167 fileInfo = new QFileInfo ();
168 168
169 myCmd = new KateCmd (this); 169 myCmd = new KateCmd (this);
170 170
171 connect(this,SIGNAL(modifiedChanged ()),this,SLOT(slotModChanged ())); 171 connect(this,SIGNAL(modifiedChanged()),this,SLOT(slotModChanged()));
172 172
173 buffer = new KWBuffer; 173 buffer = new KWBuffer;
174 connect(buffer, SIGNAL(linesChanged(int)), this, SLOT(slotBufferChanged())); 174 connect(buffer, SIGNAL(linesChanged(int)), this, SLOT(slotBufferChanged()));
175// connect(buffer, SIGNAL(textChanged()), this, SIGNAL(textChanged())); 175// connect(buffer, SIGNAL(textChanged()), this, SIGNAL(textChanged()));
176 connect(buffer, SIGNAL(needHighlight(long,long)),this,SLOT(slotBufferHighlight(long,long))); 176 connect(buffer, SIGNAL(needHighlight(long,long)),this,SLOT(slotBufferHighlight(long,long)));
177 177
178 colors[0] = KGlobalSettings::baseColor(); 178 colors[0] = KGlobalSettings::baseColor();
179 colors[1] = KGlobalSettings::highlightColor(); 179 colors[1] = KGlobalSettings::highlightColor();
180 180
181 m_attribs = new Attribute[maxAttribs]; 181 m_attribs = new Attribute[maxAttribs];
182 182
183 m_highlight = 0L; 183 m_highlight = 0L;
184 tabChars = 8; 184 tabChars = 8;
185 185
186 m_singleSelection = false; 186 m_singleSelection = false;
187 187
188 newDocGeometry = false; 188 newDocGeometry = false;
189 readOnly = false; 189 readOnly = false;
190 newDoc = false; 190 newDoc = false;
191 191
192 modified = false; 192 modified = false;
193 193
194 undoList.setAutoDelete(true); 194 undoList.setAutoDelete(true);
195 undoState = 0; 195 undoState = 0;
196 undoSteps = 50; 196 undoSteps = 50;
197 197
198 pseudoModal = 0L; 198 pseudoModal = 0L;
199 clear(); 199 clear();
200 200
201 setHighlight(0); //calls updateFontData() 201 setHighlight(0); //calls updateFontData()
202 // if the user changes the highlight with the dialog, notify the doc 202 // if the user changes the highlight with the dialog, notify the doc
203 connect(hlManager,SIGNAL(changed()),SLOT(hlChanged())); 203 connect(hlManager,SIGNAL(changed()),SLOT(hlChanged()));
204 204
205 newDocGeometry = false; 205 newDocGeometry = false;
206 206
207 readConfig(); 207 readConfig();
208 208
209 setReadOnly(false); 209 setReadOnly(false);
210} 210}
211 211
212void KateDocument::setDontChangeHlOnSave() 212void KateDocument::setDontChangeHlOnSave()
213{ 213{
214 d(this)->hlSetByUser = true; 214 d(this)->hlSetByUser = true;
215} 215}
216 216
217void KateDocument::setFont (QFont font) 217void KateDocument::setFont (QFont font)
218{ 218{
219 kdDebug()<<"Kate:: setFont"<<endl; 219 kdDebug()<<"Kate:: setFont"<<endl;
diff --git a/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp b/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp
index a85fb87..8e68262 100644
--- a/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp
+++ b/noncore/apps/tinykate/libkate/view/kateviewdialog.cpp
@@ -490,82 +490,82 @@ ColorConfig::ColorConfig( QWidget *parent, char *name )
490 label->setAlignment( AlignRight|AlignVCenter ); 490 label->setAlignment( AlignRight|AlignVCenter );
491 m_back = new KColorButton( this ); 491 m_back = new KColorButton( this );
492 glay->addWidget( label, 0, 0 ); 492 glay->addWidget( label, 0, 0 );
493 glay->addWidget( m_back, 0, 1 ); 493 glay->addWidget( m_back, 0, 1 );
494 494
495 label = new QLabel( i18n("Selected:"), this); 495 label = new QLabel( i18n("Selected:"), this);
496 label->setAlignment( AlignRight|AlignVCenter ); 496 label->setAlignment( AlignRight|AlignVCenter );
497 m_selected = new KColorButton( this ); 497 m_selected = new KColorButton( this );
498 glay->addWidget( label, 2, 0 ); 498 glay->addWidget( label, 2, 0 );
499 glay->addWidget( m_selected, 2, 1 ); 499 glay->addWidget( m_selected, 2, 1 );
500 500
501 // QWhatsThis help 501 // QWhatsThis help
502 QWhatsThis::add(m_back, i18n("Sets the background color of the editing area")); 502 QWhatsThis::add(m_back, i18n("Sets the background color of the editing area"));
503 QWhatsThis::add(m_selected, i18n("Sets the background color of the selection. To set the text color for selected text, use the &quot;<b>Configure Highlighting</b>&quot; dialog.")); 503 QWhatsThis::add(m_selected, i18n("Sets the background color of the selection. To set the text color for selected text, use the &quot;<b>Configure Highlighting</b>&quot; dialog."));
504} 504}
505 505
506 506
507ColorConfig::~ColorConfig() 507ColorConfig::~ColorConfig()
508{ 508{
509} 509}
510 510
511void ColorConfig::setColors(QColor *colors) 511void ColorConfig::setColors(QColor *colors)
512{ 512{
513 m_back->setColor( colors[0] ); 513 m_back->setColor( colors[0] );
514 m_selected->setColor( colors[1] ); 514 m_selected->setColor( colors[1] );
515} 515}
516 516
517void ColorConfig::getColors(QColor *colors) 517void ColorConfig::getColors(QColor *colors)
518{ 518{
519 colors[0] = m_back->color(); 519 colors[0] = m_back->color();
520 colors[1] = m_selected->color(); 520 colors[1] = m_selected->color();
521} 521}
522 522
523FontConfig::FontConfig( QWidget *parent, char *name ) 523FontConfig::FontConfig( QWidget *parent, char *name )
524 : QWidget( parent, name ) 524 : QWidget( parent, name )
525{ 525{
526 // sizemanagment 526 // sizemanagment
527 QGridLayout *grid = new QGridLayout( this, 1, 1 ); 527 QGridLayout *grid = new QGridLayout( this, 1, 1 );
528// QString familyStr = cfg. readEntry ( "FontFamily", "Helvetica" ); 528// QString familyStr = cfg. readEntry ( "FontFamily", "Helvetica" );
529// QString styleStr = cfg. readEntry ( "FontStyle", "Regular" ); 529// QString styleStr = cfg. readEntry ( "FontStyle", "Regular" );
530// int size = cfg. readNumEntry ( "FontSize", 10 ); 530// int size = cfg. readNumEntry ( "FontSize", 10 );
531// OFontSelector *m_fontselect; 531// OFontSelector *m_fontselect;
532 532
533 m_fontselect = new Opie::OFontSelector ( false, this, "FontTab" ); 533 m_fontselect = new Opie::OFontSelector ( false, this, "FontTab" );
534// m_fontselect-> setSelectedFont ( familyStr, styleStr, size ); 534// m_fontselect-> setSelectedFont ( familyStr, styleStr, size );
535// QWhatsThis::add( m_fontselect, 535// QWhatsThis::add( m_fontselect,
536// tr( "Select the desired name, style and size of the default font applications will use." ) ); 536// tr( "Select the desired name, style and size of the default font applications will use." ) );
537 537
538 connect( m_fontselect, SIGNAL( fontSelected ( const QFont & )), 538 connect( m_fontselect, SIGNAL( fontSelected(const QFont&)),
539 this, SLOT( slotFontSelected( const QFont & ))); 539 this, SLOT( slotFontSelected(const QFont&)));
540 grid->addWidget( m_fontselect, 0, 0); 540 grid->addWidget( m_fontselect, 0, 0);
541 541
542 542
543// #if 0 543// #if 0
544// m_fontchooser = new KFontChooser ( this ); 544// m_fontchooser = new KFontChooser ( this );
545// m_fontchooser->enableColumn(KFontChooser::StyleList, false); 545// m_fontchooser->enableColumn(KFontChooser::StyleList, false);
546// grid->addWidget( m_fontchooser, 0, 0); 546// grid->addWidget( m_fontchooser, 0, 0);
547 547
548// connect (m_fontchooser, SIGNAL (fontSelected( const QFont & )), this, SLOT (slotFontSelected( const QFont & ))); 548// connect (m_fontchooser, SIGNAL (fontSelected(const QFont&)), this, SLOT (slotFontSelected(const QFont&)));
549// #endif 549// #endif
550} 550}
551 551
552FontConfig::~FontConfig() 552FontConfig::~FontConfig()
553{ 553{
554} 554}
555 555
556void FontConfig::setFont ( const QFont &font ) 556void FontConfig::setFont ( const QFont &font )
557{ 557{
558//#if 0 558//#if 0
559m_fontselect->setFont (font); 559m_fontselect->setFont (font);
560 myFont = font; 560 myFont = font;
561//#endif 561//#endif
562} 562}
563 563
564void FontConfig::slotFontSelected( const QFont &font ) 564void FontConfig::slotFontSelected( const QFont &font )
565{ 565{
566 myFont = font; 566 myFont = font;
567} 567}
568 568
569 569
570 570
571 571
diff --git a/noncore/apps/tinykate/tinykate.cpp b/noncore/apps/tinykate/tinykate.cpp
index 19a0127..32c1eab 100644
--- a/noncore/apps/tinykate/tinykate.cpp
+++ b/noncore/apps/tinykate/tinykate.cpp
@@ -1,93 +1,93 @@
1/*************************************************************************** 1/***************************************************************************
2 tinykate.cpp 2 tinykate.cpp
3 Tiny KATE mainwindow 3 Tiny KATE mainwindow
4 ------------------- 4 -------------------
5 begin : November 2002 5 begin : November 2002
6 copyright : (C) 2002 by Joseph Wenninger <jowenn@kde.org> 6 copyright : (C) 2002 by Joseph Wenninger <jowenn@kde.org>
7 ***************************************************************************/ 7 ***************************************************************************/
8 8
9/*************************************************************************** 9/***************************************************************************
10 * * 10 * *
11 * This program is free softwaSre; you can redistribute it and/or modify * 11 * This program is free softwaSre; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by * 12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation. * 13 * the Free Software Foundation. *
14 * ONLY VERSION 2 OF THE LICENSE IS APPLICABLE * 14 * ONLY VERSION 2 OF THE LICENSE IS APPLICABLE *
15 * * 15 * *
16 ***************************************************************************/ 16 ***************************************************************************/
17#include <qaction.h> 17#include <qaction.h>
18#include <qtoolbutton.h> 18#include <qtoolbutton.h>
19#include <qmenubar.h> 19#include <qmenubar.h>
20#include <qpe/resource.h> 20#include <qpe/resource.h>
21#include <qpe/qpeapplication.h> 21#include <qpe/qpeapplication.h>
22 22
23#include <opie2/ofiledialog.h> 23#include <opie2/ofiledialog.h>
24 24
25#include "tinykate.h" 25#include "tinykate.h"
26 26
27#include <katedocument.h> 27#include <katedocument.h>
28#include <kglobal.h> 28#include <kglobal.h>
29 29
30TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : 30TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) :
31 QMainWindow( parent, name, f ) 31 QMainWindow( parent, name, f )
32{ 32{
33 shutDown=false; 33 shutDown=false;
34 nextUnnamed=0; 34 nextUnnamed=0;
35 currentView=0; 35 currentView=0;
36 viewCount=0; 36 viewCount=0;
37 setCaption(tr("TinyKATE")); 37 setCaption(tr("TinyKATE"));
38 KGlobal::setAppName("TinyKATE"); 38 KGlobal::setAppName("TinyKATE");
39 39
40 QMenuBar *mb = new QMenuBar( this ); 40 QMenuBar *mb = new QMenuBar( this );
41 mb->setMargin( 0 ); 41 mb->setMargin( 0 );
42 42
43 tabwidget=new OTabWidget(this); 43 tabwidget=new OTabWidget(this);
44 setCentralWidget(tabwidget); 44 setCentralWidget(tabwidget);
45 connect(tabwidget,SIGNAL(currentChanged( QWidget *)),this,SLOT(slotCurrentChanged(QWidget *))); 45 connect(tabwidget,SIGNAL(currentChanged(QWidget*)),this,SLOT(slotCurrentChanged(QWidget*)));
46 46
47//FILE ACTIONS 47//FILE ACTIONS
48 QPopupMenu *popup = new QPopupMenu( this ); 48 QPopupMenu *popup = new QPopupMenu( this );
49 49
50 // Action for creating a new document 50 // Action for creating a new document
51 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 ); 51 QAction *a = new QAction( tr( "New" ), Resource::loadPixmap( "new" ), QString::null, 0, this, 0 );
52 a->addTo( popup ); 52 a->addTo( popup );
53 connect(a, SIGNAL(activated()), this, SLOT(slotNew())); 53 connect(a, SIGNAL(activated()), this, SLOT(slotNew()));
54 54
55 // Action for opening an exisiting document 55 // Action for opening an exisiting document
56 a = new QAction( tr( "Open" ),Resource::loadPixmap( "fileopen" ) , QString::null, 0, this, 0 ); 56 a = new QAction( tr( "Open" ),Resource::loadPixmap( "fileopen" ) , QString::null, 0, this, 0 );
57 a->addTo(popup); 57 a->addTo(popup);
58 connect(a, SIGNAL(activated()), this, SLOT(slotOpen())); 58 connect(a, SIGNAL(activated()), this, SLOT(slotOpen()));
59 59
60 60
61 // Action for saving document 61 // Action for saving document
62 a = new QAction( tr( "Save" ), Resource::loadPixmap( "save" ) , QString::null, 0, this, 0 ); 62 a = new QAction( tr( "Save" ), Resource::loadPixmap( "save" ) , QString::null, 0, this, 0 );
63 a->addTo(popup); 63 a->addTo(popup);
64 connect(a, SIGNAL(activated()), this, SLOT(slotSave())); 64 connect(a, SIGNAL(activated()), this, SLOT(slotSave()));
65 65
66 // Action for saving document to a new name 66 // Action for saving document to a new name
67 a = new QAction( tr( "Save As" ),Resource::loadPixmap( "save" ) , QString::null, 0, this, 0 ); 67 a = new QAction( tr( "Save As" ),Resource::loadPixmap( "save" ) , QString::null, 0, this, 0 );
68 a->addTo(popup); 68 a->addTo(popup);
69 connect(a, SIGNAL(activated()), this, SLOT(slotSaveAs())); 69 connect(a, SIGNAL(activated()), this, SLOT(slotSaveAs()));
70 70
71 // Action for closing the currently active document 71 // Action for closing the currently active document
72 a = new QAction( tr( "Close" ), Resource::loadPixmap( "quit_icon" ) , QString::null, 0, this, 0 ); 72 a = new QAction( tr( "Close" ), Resource::loadPixmap( "quit_icon" ) , QString::null, 0, this, 0 );
73 a->addTo(popup); 73 a->addTo(popup);
74 connect(a, SIGNAL(activated()), this, SLOT(slotClose())); 74 connect(a, SIGNAL(activated()), this, SLOT(slotClose()));
75 75
76 76
77 mb->insertItem(tr("File"),popup); 77 mb->insertItem(tr("File"),popup);
78 78
79//EDIT ACTIONS 79//EDIT ACTIONS
80 80
81 // Action for cutting text 81 // Action for cutting text
82 editCut = new QToolButton( 0 ); 82 editCut = new QToolButton( 0 );
83 editCut->setAutoRaise( true ); 83 editCut->setAutoRaise( true );
84 editCut->setIconSet( Resource::loadPixmap( "cut" ) ); 84 editCut->setIconSet( Resource::loadPixmap( "cut" ) );
85 85
86 // Action for Copying text 86 // Action for Copying text
87 editCopy = new QToolButton( 0 ); 87 editCopy = new QToolButton( 0 );
88 editCopy->setAutoRaise( true ); 88 editCopy->setAutoRaise( true );
89 editCopy->setIconSet( Resource::loadPixmap( "copy" ) ); 89 editCopy->setIconSet( Resource::loadPixmap( "copy" ) );
90 90
91 // Action for pasting text 91 // Action for pasting text
92 editPaste = new QToolButton( 0 ); 92 editPaste = new QToolButton( 0 );
93 editPaste->setAutoRaise( true ); 93 editPaste->setAutoRaise( true );
diff --git a/noncore/apps/zsafe/scqtfiledlg.cpp b/noncore/apps/zsafe/scqtfiledlg.cpp
index dd72fdf..52b8d0d 100644
--- a/noncore/apps/zsafe/scqtfiledlg.cpp
+++ b/noncore/apps/zsafe/scqtfiledlg.cpp
@@ -150,103 +150,103 @@ ScQtFileDlg::ScQtFileDlg( QWidget* parent, const char* name, bool modal, WFlags
150 Layout3->addWidget( CancelButton ); 150 Layout3->addWidget( CancelButton );
151 Layout4->addLayout( Layout3 ); 151 Layout4->addLayout( Layout3 );
152 152
153 Layout3_2 = new QHBoxLayout; 153 Layout3_2 = new QHBoxLayout;
154 Layout3_2->setSpacing( 6 ); 154 Layout3_2->setSpacing( 6 );
155 Layout3_2->setMargin( 0 ); 155 Layout3_2->setMargin( 0 );
156 156
157 FNameLineEdit = new QLineEdit( this, "FNameLineEdit" ); 157 FNameLineEdit = new QLineEdit( this, "FNameLineEdit" );
158 QToolTip::add( FNameLineEdit, tr( "shows the selected filename" ) ); 158 QToolTip::add( FNameLineEdit, tr( "shows the selected filename" ) );
159 QWhatsThis::add( FNameLineEdit, tr( "Filename LineEdit\n" 159 QWhatsThis::add( FNameLineEdit, tr( "Filename LineEdit\n"
160"\n" 160"\n"
161"shows the selected file\n" 161"shows the selected file\n"
162"and allows the direct filename\n" 162"and allows the direct filename\n"
163"edit" ) ); 163"edit" ) );
164 Layout3_2->addWidget( FNameLineEdit ); 164 Layout3_2->addWidget( FNameLineEdit );
165 165
166 MkDirButton = new QToolButton( this, "MkDirButton" ); 166 MkDirButton = new QToolButton( this, "MkDirButton" );
167 MkDirButton->setText( tr( "" ) ); 167 MkDirButton->setText( tr( "" ) );
168 MkDirButton->setPixmap( image2 ); 168 MkDirButton->setPixmap( image2 );
169 MkDirButton->setUsesBigPixmap( FALSE ); 169 MkDirButton->setUsesBigPixmap( FALSE );
170 QToolTip::add( MkDirButton, tr( "confirms the selection and closes the form" ) ); 170 QToolTip::add( MkDirButton, tr( "confirms the selection and closes the form" ) );
171 QWhatsThis::add( MkDirButton, tr( "OKButton" ) ); 171 QWhatsThis::add( MkDirButton, tr( "OKButton" ) );
172 Layout3_2->addWidget( MkDirButton ); 172 Layout3_2->addWidget( MkDirButton );
173 Layout4->addLayout( Layout3_2 ); 173 Layout4->addLayout( Layout3_2 );
174 174
175 DirComboBox = new QComboBox( FALSE, this, "DirComboBox" ); 175 DirComboBox = new QComboBox( FALSE, this, "DirComboBox" );
176 DirComboBox->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, DirComboBox->sizePolicy().hasHeightForWidth() ) ); 176 DirComboBox->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, DirComboBox->sizePolicy().hasHeightForWidth() ) );
177 DirComboBox->setEditable( TRUE ); 177 DirComboBox->setEditable( TRUE );
178 DirComboBox->setDuplicatesEnabled( FALSE ); 178 DirComboBox->setDuplicatesEnabled( FALSE );
179 QWhatsThis::add( DirComboBox, tr( "ComboBox Directory \n" 179 QWhatsThis::add( DirComboBox, tr( "ComboBox Directory \n"
180"edit or select the directories name" ) ); 180"edit or select the directories name" ) );
181 Layout4->addWidget( DirComboBox ); 181 Layout4->addWidget( DirComboBox );
182 Layout5->addLayout( Layout4 ); 182 Layout5->addLayout( Layout4 );
183 183
184 ListView = new QListView( this, "ListView" ); 184 ListView = new QListView( this, "ListView" );
185 ListView->addColumn( tr( "Name" ) ); 185 ListView->addColumn( tr( "Name" ) );
186 ListView->addColumn( tr( "size" ) ); 186 ListView->addColumn( tr( "size" ) );
187 ListView->addColumn( tr( "type" ) ); 187 ListView->addColumn( tr( "type" ) );
188 ListView->setRootIsDecorated( TRUE ); 188 ListView->setRootIsDecorated( TRUE );
189 QToolTip::add( ListView, tr( "directory listview" ) ); 189 QToolTip::add( ListView, tr( "directory listview" ) );
190 QWhatsThis::add( ListView, tr( "Directory ListView\n" 190 QWhatsThis::add( ListView, tr( "Directory ListView\n"
191"\n" 191"\n"
192"shows the list of dirs and files" ) ); 192"shows the list of dirs and files" ) );
193 Layout5->addWidget( ListView ); 193 Layout5->addWidget( ListView );
194 ScQtFileDlgLayout->addLayout( Layout5 ); 194 ScQtFileDlgLayout->addLayout( Layout5 );
195 195
196 // signals and slots connections 196 // signals and slots connections
197 connect( OkButton, SIGNAL( clicked() ), this, SLOT( slotOK() ) ); 197 connect( OkButton, SIGNAL( clicked() ), this, SLOT( slotOK() ) );
198 connect( DirComboBox, SIGNAL( activated(int) ), this, SLOT( slotDirComboBoxChanged( int ) ) ); 198 connect( DirComboBox, SIGNAL( activated(int) ), this, SLOT( slotDirComboBoxChanged(int) ) );
199 connect( TypeComboBox, SIGNAL( activated(int) ), this, SLOT( slotTypeComboBoxChanged( int ) ) ); 199 connect( TypeComboBox, SIGNAL( activated(int) ), this, SLOT( slotTypeComboBoxChanged(int) ) );
200 connect( CancelButton, SIGNAL( clicked() ), this, SLOT( slotCancel() ) ); 200 connect( CancelButton, SIGNAL( clicked() ), this, SLOT( slotCancel() ) );
201 connect( ListView, SIGNAL( returnPressed(QListViewItem*) ), this, SLOT( slotSelectionChanged(QListViewItem *) ) ); 201 connect( ListView, SIGNAL( returnPressed(QListViewItem*) ), this, SLOT( slotSelectionChanged(QListViewItem*) ) );
202 connect( ListView, SIGNAL( selectionChanged(QListViewItem*) ), this, SLOT( slotSelectionChanged(QListViewItem *) ) ); 202 connect( ListView, SIGNAL( selectionChanged(QListViewItem*) ), this, SLOT( slotSelectionChanged(QListViewItem*) ) );
203 connect( ListView, SIGNAL( doubleClicked(QListViewItem*) ), this, SLOT( slotDoubleClicked(QListViewItem *) ) ); 203 connect( ListView, SIGNAL( doubleClicked(QListViewItem*) ), this, SLOT( slotDoubleClicked(QListViewItem*) ) );
204 connect( FNameLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( slotFileTextChanged( const QString & ) ) ); 204 connect( FNameLineEdit, SIGNAL( textChanged(const QString&) ), this, SLOT( slotFileTextChanged(const QString&) ) );
205 connect( FNameLineEdit, SIGNAL( returnPressed() ), this, SLOT( slotOK() ) ); 205 connect( FNameLineEdit, SIGNAL( returnPressed() ), this, SLOT( slotOK() ) );
206 connect( MkDirButton, SIGNAL( clicked() ), this, SLOT( slotMkDir() ) ); 206 connect( MkDirButton, SIGNAL( clicked() ), this, SLOT( slotMkDir() ) );
207} 207}
208 208
209/* 209/*
210 * Destroys the object and frees any allocated resources 210 * Destroys the object and frees any allocated resources
211 */ 211 */
212ScQtFileDlg::~ScQtFileDlg() 212ScQtFileDlg::~ScQtFileDlg()
213{ 213{
214 // no need to delete child widgets, Qt does it all for us 214 // no need to delete child widgets, Qt does it all for us
215} 215}
216 216
217void ScQtFileDlg::slotCancel() 217void ScQtFileDlg::slotCancel()
218{ 218{
219 qWarning( "ScQtFileDlg::slotCancel(): Not implemented yet!" ); 219 qWarning( "ScQtFileDlg::slotCancel(): Not implemented yet!" );
220} 220}
221 221
222void ScQtFileDlg::slotDirComboBoxChanged( int ) 222void ScQtFileDlg::slotDirComboBoxChanged( int )
223{ 223{
224 qWarning( "ScQtFileDlg::slotDirComboBoxChanged( int ): Not implemented yet!" ); 224 qWarning( "ScQtFileDlg::slotDirComboBoxChanged( int ): Not implemented yet!" );
225} 225}
226 226
227void ScQtFileDlg::slotDoubleClicked(QListViewItem *) 227void ScQtFileDlg::slotDoubleClicked(QListViewItem *)
228{ 228{
229 qWarning( "ScQtFileDlg::slotDoubleClicked(QListViewItem *): Not implemented yet!" ); 229 qWarning( "ScQtFileDlg::slotDoubleClicked(QListViewItem *): Not implemented yet!" );
230} 230}
231 231
232void ScQtFileDlg::slotFileTextChanged( const QString & ) 232void ScQtFileDlg::slotFileTextChanged( const QString & )
233{ 233{
234 qWarning( "ScQtFileDlg::slotFileTextChanged( const QString & ): Not implemented yet!" ); 234 qWarning( "ScQtFileDlg::slotFileTextChanged( const QString & ): Not implemented yet!" );
235} 235}
236 236
237void ScQtFileDlg::slotMkDir() 237void ScQtFileDlg::slotMkDir()
238{ 238{
239 qWarning( "ScQtFileDlg::slotMkDir(): Not implemented yet!" ); 239 qWarning( "ScQtFileDlg::slotMkDir(): Not implemented yet!" );
240} 240}
241 241
242void ScQtFileDlg::slotOK() 242void ScQtFileDlg::slotOK()
243{ 243{
244 qWarning( "ScQtFileDlg::slotOK(): Not implemented yet!" ); 244 qWarning( "ScQtFileDlg::slotOK(): Not implemented yet!" );
245} 245}
246 246
247void ScQtFileDlg::slotSelectionChanged(QListViewItem *) 247void ScQtFileDlg::slotSelectionChanged(QListViewItem *)
248{ 248{
249 qWarning( "ScQtFileDlg::slotSelectionChanged(QListViewItem *): Not implemented yet!" ); 249 qWarning( "ScQtFileDlg::slotSelectionChanged(QListViewItem *): Not implemented yet!" );
250} 250}
251 251
252void ScQtFileDlg::slotTypeComboBoxChanged( int ) 252void ScQtFileDlg::slotTypeComboBoxChanged( int )
diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp
index a3e805e..a3467e5 100644
--- a/noncore/apps/zsafe/zsafe.cpp
+++ b/noncore/apps/zsafe/zsafe.cpp
@@ -645,102 +645,102 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl )
645 h->addWidget (menu); 645 h->addWidget (menu);
646 h->addWidget (New); 646 h->addWidget (New);
647 h->addWidget (Edit); 647 h->addWidget (Edit);
648 h->addWidget (Delete); 648 h->addWidget (Delete);
649 h->addWidget (Find); 649 h->addWidget (Find);
650*/ 650*/
651 651
652 ListView = new ZListView( this, "ListView" ); 652 ListView = new ZListView( this, "ListView" );
653 ListView->addColumn( tr( "Name" ) ); 653 ListView->addColumn( tr( "Name" ) );
654 ListView->addColumn( tr( "Field 2" ) ); 654 ListView->addColumn( tr( "Field 2" ) );
655 ListView->addColumn( tr( "Field 3" ) ); 655 ListView->addColumn( tr( "Field 3" ) );
656 ListView->addColumn( tr( "Comment" ) ); 656 ListView->addColumn( tr( "Comment" ) );
657 ListView->addColumn( tr( "Field 4" ) ); 657 ListView->addColumn( tr( "Field 4" ) );
658 ListView->addColumn( tr( "Field 5" ) ); 658 ListView->addColumn( tr( "Field 5" ) );
659 ListView->setAllColumnsShowFocus(TRUE); 659 ListView->setAllColumnsShowFocus(TRUE);
660 660
661#ifdef DESKTOP 661#ifdef DESKTOP
662 ListView->setResizePolicy(QScrollView::AutoOneFit); 662 ListView->setResizePolicy(QScrollView::AutoOneFit);
663 // ListView->setGeometry( QRect( 0, 22, this->width(), this->height() - 30 ) ); 663 // ListView->setGeometry( QRect( 0, 22, this->width(), this->height() - 30 ) );
664#else 664#else
665 ListView->setResizePolicy(QScrollView::AutoOneFit); 665 ListView->setResizePolicy(QScrollView::AutoOneFit);
666 // ListView->setGeometry( QRect( 0, 22, 666 // ListView->setGeometry( QRect( 0, 22,
667 // this->width(), this->height() - 30 ) ); 667 // this->width(), this->height() - 30 ) );
668 // ListView->setMaximumSize( QSize( 440, 290 ) ); 668 // ListView->setMaximumSize( QSize( 440, 290 ) );
669#endif 669#endif
670 ListView->setVScrollBarMode( QListView::Auto ); 670 ListView->setVScrollBarMode( QListView::Auto );
671 671
672 QBoxLayout * l = new QVBoxLayout( this ); 672 QBoxLayout * l = new QVBoxLayout( this );
673 l->addWidget (menu); 673 l->addWidget (menu);
674 l->addWidget (ListView); 674 l->addWidget (ListView);
675 675
676#ifndef DESKTOP 676#ifndef DESKTOP
677 // start a timer (100 ms) to load the default document 677 // start a timer (100 ms) to load the default document
678 docuTimer.start( 100, true ); 678 docuTimer.start( 100, true );
679 connect( &docuTimer, SIGNAL(timeout()), SLOT( slotLoadDocu() ) ); 679 connect( &docuTimer, SIGNAL(timeout()), SLOT( slotLoadDocu() ) );
680 raiseFlag = true; 680 raiseFlag = true;
681 connect( &raiseTimer, SIGNAL(timeout()), SLOT( slotRaiseTimer() ) ); 681 connect( &raiseTimer, SIGNAL(timeout()), SLOT( slotRaiseTimer() ) );
682#else 682#else
683 // open the default document 683 // open the default document
684 openDocument(filename); 684 openDocument(filename);
685#endif 685#endif
686 686
687 // signals and slots connections for QTollButton 687 // signals and slots connections for QTollButton
688 connect( New, SIGNAL( clicked() ), this, SLOT( newPwd() ) ); 688 connect( New, SIGNAL( clicked() ), this, SLOT( newPwd() ) );
689 connect( Edit, SIGNAL( clicked() ), this, SLOT( editPwd() ) ); 689 connect( Edit, SIGNAL( clicked() ), this, SLOT( editPwd() ) );
690 connect( Delete, SIGNAL( clicked() ), this, SLOT( deletePwd() ) ); 690 connect( Delete, SIGNAL( clicked() ), this, SLOT( deletePwd() ) );
691 connect( Find, SIGNAL( clicked() ), this, SLOT( findPwd() ) ); 691 connect( Find, SIGNAL( clicked() ), this, SLOT( findPwd() ) );
692 // signals and slots connections for QListView 692 // signals and slots connections for QListView
693 connect( ListView, SIGNAL( selectionChanged( QListViewItem* ) ), 693 connect( ListView, SIGNAL( selectionChanged(QListViewItem*) ),
694 this, SLOT( listViewSelected( QListViewItem* ) ) ); 694 this, SLOT( listViewSelected(QListViewItem*) ) );
695 connect( ListView, SIGNAL( doubleClicked( QListViewItem* ) ), 695 connect( ListView, SIGNAL( doubleClicked(QListViewItem*) ),
696 this, SLOT( showInfo( QListViewItem* ) ) ); 696 this, SLOT( showInfo(QListViewItem*) ) );
697 connect( ListView, SIGNAL( returnPressed( QListViewItem* ) ), 697 connect( ListView, SIGNAL( returnPressed(QListViewItem*) ),
698 this, SLOT( showInfo( QListViewItem* ) ) ); 698 this, SLOT( showInfo(QListViewItem*) ) );
699 699
700} 700}
701 701
702const QColor *ZSafe::evenRowColor = &Qt::white; 702const QColor *ZSafe::evenRowColor = &Qt::white;
703// const QColor *ZSafe::oddRowColor = &Qt::lightGray; 703// const QColor *ZSafe::oddRowColor = &Qt::lightGray;
704const QColor *ZSafe::oddRowColor = new QColor(216,240,255); 704const QColor *ZSafe::oddRowColor = new QColor(216,240,255);
705 705
706/* 706/*
707 * Destroys the object and frees any allocated resources 707 * Destroys the object and frees any allocated resources
708 */ 708 */
709ZSafe::~ZSafe() 709ZSafe::~ZSafe()
710{ 710{
711 // no need to delete child widgets, Qt does it all for us 711 // no need to delete child widgets, Qt does it all for us
712 quitMe(); 712 quitMe();
713} 713}
714 714
715// load the default document 715// load the default document
716void ZSafe::slotLoadDocu() 716void ZSafe::slotLoadDocu()
717{ 717{
718 openDocument (filename); 718 openDocument (filename);
719} 719}
720 720
721void ZSafe::deletePwd() 721void ZSafe::deletePwd()
722{ 722{
723 723
724 if (!selectedItem) 724 if (!selectedItem)
725 return; 725 return;
726 if (!isCategory(selectedItem)) 726 if (!isCategory(selectedItem))
727 { 727 {
728 switch( QMessageBox::information( this, tr("ZSafe"), 728 switch( QMessageBox::information( this, tr("ZSafe"),
729 tr("Do you want to delete?"), 729 tr("Do you want to delete?"),
730 tr("&Delete"), tr("D&on't Delete"), 730 tr("&Delete"), tr("D&on't Delete"),
731 0 // Enter == button 0 731 0 // Enter == button 0
732 ) ) { // Escape == button 2 732 ) ) { // Escape == button 2
733 case 0: // Delete clicked, Alt-S or Enter pressed. 733 case 0: // Delete clicked, Alt-S or Enter pressed.
734 // Delete 734 // Delete
735 modified = true; 735 modified = true;
736 selectedItem->parent()->takeItem(selectedItem); 736 selectedItem->parent()->takeItem(selectedItem);
737 selectedItem = NULL; 737 selectedItem = NULL;
738 break; 738 break;
739 case 1: // Don't delete 739 case 1: // Don't delete
740 break; 740 break;
741 } 741 }
742 } 742 }
743 else 743 else
744 { 744 {
745 delCategory(); 745 delCategory();
746 } 746 }
@@ -2534,98 +2534,98 @@ void ZSafe::quitMe ()
2534 case 1: // 2534 case 1: //
2535 // Save with new password 2535 // Save with new password
2536 modified = false; 2536 modified = false;
2537 saveDocument(filename, TRUE); 2537 saveDocument(filename, TRUE);
2538 exitZs (1); 2538 exitZs (1);
2539 break; 2539 break;
2540 case 2: // Don't Save clicked or Alt-D pressed 2540 case 2: // Don't Save clicked or Alt-D pressed
2541 // don't save but exitZs 2541 // don't save but exitZs
2542 exitZs (1); 2542 exitZs (1);
2543 break; 2543 break;
2544 } 2544 }
2545 } 2545 }
2546 exitZs (1); 2546 exitZs (1);
2547 2547
2548} 2548}
2549 2549
2550void ZSafe::categoryFieldActivated( const QString& category) 2550void ZSafe::categoryFieldActivated( const QString& category)
2551{ 2551{
2552 if (categoryDialog) 2552 if (categoryDialog)
2553 setCategoryDialogFields(categoryDialog, category); 2553 setCategoryDialogFields(categoryDialog, category);
2554} 2554}
2555 2555
2556void ZSafe::addCategory() 2556void ZSafe::addCategory()
2557{ 2557{
2558 if (filename.isEmpty()) 2558 if (filename.isEmpty())
2559 { 2559 {
2560 QMessageBox::critical( 0, tr("ZSafe"), 2560 QMessageBox::critical( 0, tr("ZSafe"),
2561 tr("No document defined.\nYou have to create a new document")); 2561 tr("No document defined.\nYou have to create a new document"));
2562 return; 2562 return;
2563 } 2563 }
2564 else 2564 else
2565 { 2565 {
2566 // open the 'Category' dialog 2566 // open the 'Category' dialog
2567 bool initIcons = false; 2567 bool initIcons = false;
2568 // open the 'Category' dialog 2568 // open the 'Category' dialog
2569 CategoryDialog *dialog; 2569 CategoryDialog *dialog;
2570 if (categoryDialog) 2570 if (categoryDialog)
2571 { 2571 {
2572 dialog = categoryDialog; 2572 dialog = categoryDialog;
2573 } 2573 }
2574 else 2574 else
2575 { 2575 {
2576 categoryDialog = new CategoryDialog(this, tr("Category"), TRUE); 2576 categoryDialog = new CategoryDialog(this, tr("Category"), TRUE);
2577#ifdef WIN32 2577#ifdef WIN32
2578 categoryDialog->setCaption ("Qt " + tr("Category")); 2578 categoryDialog->setCaption ("Qt " + tr("Category"));
2579#endif 2579#endif
2580 dialog = categoryDialog; 2580 dialog = categoryDialog;
2581 connect( dialog->CategoryField, 2581 connect( dialog->CategoryField,
2582 SIGNAL( activated ( const QString &)), 2582 SIGNAL( activated(const QString&)),
2583 this, SLOT( categoryFieldActivated( const QString & ) ) ); 2583 this, SLOT( categoryFieldActivated(const QString&) ) );
2584 initIcons = true; 2584 initIcons = true;
2585 } 2585 }
2586 2586
2587#ifdef DESKTOP 2587#ifdef DESKTOP
2588#ifndef WIN32 2588#ifndef WIN32
2589 QStringList list = conf->entryList( APP_KEY+"/fieldDefs" ); 2589 QStringList list = conf->entryList( APP_KEY+"/fieldDefs" );
2590#else 2590#else
2591 // read all categories from the config file and store 2591 // read all categories from the config file and store
2592 // into a list 2592 // into a list
2593 QFile f (cfgFile); 2593 QFile f (cfgFile);
2594 QStringList list; 2594 QStringList list;
2595 if ( f.open(IO_ReadOnly) ) { // file opened successfully 2595 if ( f.open(IO_ReadOnly) ) { // file opened successfully
2596 QTextStream t( &f ); // use a text stream 2596 QTextStream t( &f ); // use a text stream
2597 QString s; 2597 QString s;
2598 int n = 1; 2598 int n = 1;
2599 while ( !t.eof() ) { // until end of file... 2599 while ( !t.eof() ) { // until end of file...
2600 s = t.readLine(); // line of text excluding '\n' 2600 s = t.readLine(); // line of text excluding '\n'
2601 list.append(s); 2601 list.append(s);
2602 } 2602 }
2603 f.close(); 2603 f.close();
2604 } 2604 }
2605#endif 2605#endif
2606#else 2606#else
2607 // read all categories from the config file and store 2607 // read all categories from the config file and store
2608 // into a list 2608 // into a list
2609 QFile f (cfgFile); 2609 QFile f (cfgFile);
2610 QStringList list; 2610 QStringList list;
2611 if ( f.open(IO_ReadOnly) ) { // file opened successfully 2611 if ( f.open(IO_ReadOnly) ) { // file opened successfully
2612 QTextStream t( &f ); // use a text stream 2612 QTextStream t( &f ); // use a text stream
2613 QString s; 2613 QString s;
2614 while ( !t.eof() ) { // until end of file... 2614 while ( !t.eof() ) { // until end of file...
2615 s = t.readLine(); // line of text excluding '\n' 2615 s = t.readLine(); // line of text excluding '\n'
2616 list.append(s); 2616 list.append(s);
2617 } 2617 }
2618 f.close(); 2618 f.close();
2619 } 2619 }
2620#endif 2620#endif
2621 QStringList::Iterator it = list.begin(); 2621 QStringList::Iterator it = list.begin();
2622 QString categ; 2622 QString categ;
2623 QString firstCategory; 2623 QString firstCategory;
2624 dialog->CategoryField->clear(); // remove all items 2624 dialog->CategoryField->clear(); // remove all items
2625 while( it != list.end() ) 2625 while( it != list.end() )
2626 { 2626 {
2627 QString *cat = new QString (*it); 2627 QString *cat = new QString (*it);
2628 if (cat->contains("-field1", FALSE)) 2628 if (cat->contains("-field1", FALSE))
2629 { 2629 {
2630#ifdef DESKTOP 2630#ifdef DESKTOP
2631#ifndef WIN32 2631#ifndef WIN32
@@ -2941,98 +2941,98 @@ void ZSafe::setCategoryDialogFields(CategoryDialog *dialog, QString category)
2941 2941
2942void ZSafe::saveCategoryDialogFields(CategoryDialog *dialog) 2942void ZSafe::saveCategoryDialogFields(CategoryDialog *dialog)
2943{ 2943{
2944 QString app_key = APP_KEY; 2944 QString app_key = APP_KEY;
2945#ifndef DESKTOP 2945#ifndef DESKTOP
2946 conf->setGroup ("fieldDefs"); 2946 conf->setGroup ("fieldDefs");
2947#else 2947#else
2948#ifndef WIN32 2948#ifndef WIN32
2949 app_key += "/fieldDefs/"; 2949 app_key += "/fieldDefs/";
2950#endif 2950#endif
2951#endif 2951#endif
2952 QString category = dialog->CategoryField->currentText(); 2952 QString category = dialog->CategoryField->currentText();
2953// #ifndef WIN32 2953// #ifndef WIN32
2954 conf->writeEntry(app_key+category+"-field1", dialog->Field1->text()); 2954 conf->writeEntry(app_key+category+"-field1", dialog->Field1->text());
2955 conf->writeEntry(app_key+category+"-field2", dialog->Field2->text()); 2955 conf->writeEntry(app_key+category+"-field2", dialog->Field2->text());
2956 conf->writeEntry(app_key+category+"-field3", dialog->Field3->text()); 2956 conf->writeEntry(app_key+category+"-field3", dialog->Field3->text());
2957 conf->writeEntry(app_key+category+"-field4", dialog->Field4->text()); 2957 conf->writeEntry(app_key+category+"-field4", dialog->Field4->text());
2958 conf->writeEntry(app_key+category+"-field5", dialog->Field5->text()); 2958 conf->writeEntry(app_key+category+"-field5", dialog->Field5->text());
2959 conf->writeEntry(app_key+category+"-field6", dialog->Field6->text()); 2959 conf->writeEntry(app_key+category+"-field6", dialog->Field6->text());
2960// #endif 2960// #endif
2961 saveConf(); 2961 saveConf();
2962#ifndef DESKTOP 2962#ifndef DESKTOP
2963 conf->setGroup ("zsafe"); 2963 conf->setGroup ("zsafe");
2964#endif 2964#endif
2965} 2965}
2966 2966
2967void ZSafe::editCategory() 2967void ZSafe::editCategory()
2968{ 2968{
2969 if (!selectedItem) 2969 if (!selectedItem)
2970 return; 2970 return;
2971 if (isCategory(selectedItem)) 2971 if (isCategory(selectedItem))
2972 { 2972 {
2973 QString category = selectedItem->text(0); 2973 QString category = selectedItem->text(0);
2974 bool initIcons = false; 2974 bool initIcons = false;
2975 // open the 'Category' dialog 2975 // open the 'Category' dialog
2976 CategoryDialog *dialog; 2976 CategoryDialog *dialog;
2977 if (categoryDialog) 2977 if (categoryDialog)
2978 { 2978 {
2979 dialog = categoryDialog; 2979 dialog = categoryDialog;
2980 } 2980 }
2981 else 2981 else
2982 { 2982 {
2983 categoryDialog = new CategoryDialog(this, tr("Category"), TRUE); 2983 categoryDialog = new CategoryDialog(this, tr("Category"), TRUE);
2984#ifdef WIN32 2984#ifdef WIN32
2985 categoryDialog->setCaption ("Qt " + tr("Category")); 2985 categoryDialog->setCaption ("Qt " + tr("Category"));
2986#endif 2986#endif
2987 dialog = categoryDialog; 2987 dialog = categoryDialog;
2988 connect( dialog->CategoryField, 2988 connect( dialog->CategoryField,
2989 SIGNAL( activated ( const QString &)), 2989 SIGNAL( activated(const QString&)),
2990 this, SLOT( categoryFieldActivated( const QString & ) ) ); 2990 this, SLOT( categoryFieldActivated(const QString&) ) );
2991 initIcons = true; 2991 initIcons = true;
2992 } 2992 }
2993 setCategoryDialogFields(dialog); 2993 setCategoryDialogFields(dialog);
2994 2994
2995#ifdef DESKTOP 2995#ifdef DESKTOP
2996#ifndef WIN32 2996#ifndef WIN32
2997 QStringList list = conf->entryList( APP_KEY+"/fieldDefs" ); 2997 QStringList list = conf->entryList( APP_KEY+"/fieldDefs" );
2998#else 2998#else
2999 // read all categories from the config file and store 2999 // read all categories from the config file and store
3000 // into a list 3000 // into a list
3001 QFile f (cfgFile); 3001 QFile f (cfgFile);
3002 QStringList list; 3002 QStringList list;
3003 if ( f.open(IO_ReadOnly) ) { // file opened successfully 3003 if ( f.open(IO_ReadOnly) ) { // file opened successfully
3004 QTextStream t( &f ); // use a text stream 3004 QTextStream t( &f ); // use a text stream
3005 QString s; 3005 QString s;
3006 int n = 1; 3006 int n = 1;
3007 while ( !t.eof() ) { // until end of file... 3007 while ( !t.eof() ) { // until end of file...
3008 s = t.readLine(); // line of text excluding '\n' 3008 s = t.readLine(); // line of text excluding '\n'
3009 list.append(s); 3009 list.append(s);
3010 } 3010 }
3011 f.close(); 3011 f.close();
3012 } 3012 }
3013#endif 3013#endif
3014#else 3014#else
3015 // read all categories from the config file and store 3015 // read all categories from the config file and store
3016 // into a list 3016 // into a list
3017 QFile f (cfgFile); 3017 QFile f (cfgFile);
3018 QStringList list; 3018 QStringList list;
3019 if ( f.open(IO_ReadOnly) ) { // file opened successfully 3019 if ( f.open(IO_ReadOnly) ) { // file opened successfully
3020 QTextStream t( &f ); // use a text stream 3020 QTextStream t( &f ); // use a text stream
3021 QString s; 3021 QString s;
3022 while ( !t.eof() ) { // until end of file... 3022 while ( !t.eof() ) { // until end of file...
3023 s = t.readLine(); // line of text excluding '\n' 3023 s = t.readLine(); // line of text excluding '\n'
3024 list.append(s); 3024 list.append(s);
3025 } 3025 }
3026 f.close(); 3026 f.close();
3027 } 3027 }
3028#endif 3028#endif
3029 QStringList::Iterator it = list.begin(); 3029 QStringList::Iterator it = list.begin();
3030 QString categ; 3030 QString categ;
3031 dialog->CategoryField->clear(); // remove all items 3031 dialog->CategoryField->clear(); // remove all items
3032 int i=0; 3032 int i=0;
3033 bool foundCategory = false; 3033 bool foundCategory = false;
3034 while( it != list.end() ) 3034 while( it != list.end() )
3035 { 3035 {
3036 QString *cat = new QString (*it); 3036 QString *cat = new QString (*it);
3037 if (cat->contains("-field1", FALSE)) 3037 if (cat->contains("-field1", FALSE))
3038 { 3038 {