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 | |||
@@ -28,50 +28,50 @@ | |||
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 |
37 | AdvancedFm::AdvancedFm( ) | 37 | AdvancedFm::AdvancedFm( ) |
38 | #else | 38 | #else |
39 | AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags ) | 39 | AdvancedFm::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 | ||
56 | AdvancedFm::~AdvancedFm() { | 56 | AdvancedFm::~AdvancedFm() { |
57 | } | 57 | } |
58 | 58 | ||
59 | 59 | ||
60 | void AdvancedFm::cleanUp() { | 60 | void 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 | ||
71 | void AdvancedFm::tabChanged(QWidget *) { | 71 | void 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); |
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 | |||
@@ -232,55 +232,55 @@ void AdvancedFm::init() { | |||
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 | ||
239 | void AdvancedFm::initConnections() | 239 | void 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 | |||
@@ -660,74 +660,74 @@ void AdvancedFm::mkSym() { | |||
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 | ||
671 | void AdvancedFm::doBeam() { | 671 | void 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 | ||
691 | void AdvancedFm::fileBeamFinished( Ir *) { | 691 | void 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 | ||
695 | void AdvancedFm::selectAll() { | 695 | void 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 | ||
701 | void AdvancedFm::startProcess(const QString & cmd) { | 701 | void 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 | ||
719 | void AdvancedFm::processEnded(OProcess *) { | 719 | void AdvancedFm::processEnded(OProcess *) { |
720 | rePopulate(); | 720 | rePopulate(); |
721 | } | 721 | } |
722 | 722 | ||
723 | void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) { | 723 | void 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 | ||
730 | bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { | 730 | bool 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; |
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 | |||
@@ -120,59 +120,59 @@ Output::Output( const QStringList commands, QWidget* parent, const char* name, | |||
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 | ||
173 | Output::~Output() { | 173 | Output::~Output() { |
174 | } | 174 | } |
175 | 175 | ||
176 | void Output::saveOutput() { | 176 | void Output::saveOutput() { |
177 | 177 | ||
178 | InputDialog *fileDlg; | 178 | InputDialog *fileDlg; |
@@ -219,50 +219,50 @@ void Output::commandStdout(OProcess*, char *buffer, int buflen) { | |||
219 | } | 219 | } |
220 | 220 | ||
221 | 221 | ||
222 | void Output::commandStdin( const QByteArray &data) { | 222 | void 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 | ||
228 | void Output::commandStderr(OProcess*, char *buffer, int buflen) { | 228 | void 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 | ||
237 | void Output::processFinished() { | 237 | void 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 | ||
249 | InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) | 249 | InputDialog::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 | ||
265 | InputDialog::~InputDialog() { | 265 | InputDialog::~InputDialog() { |
266 | inputText = LineEdit1->text(); | 266 | inputText = LineEdit1->text(); |
267 | } | 267 | } |
268 | 268 | ||
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 | |||
@@ -72,197 +72,197 @@ Checkbook::Checkbook( QWidget *parent, CBInfo *i, Cfg *cfg ) | |||
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 | ||
102 | Checkbook::~Checkbook() | 102 | Checkbook::~Checkbook() |
103 | { | 103 | { |
104 | } | 104 | } |
105 | 105 | ||
106 | // --- initInfo --------------------------------------------------------------- | 106 | // --- initInfo --------------------------------------------------------------- |
107 | QWidget *Checkbook::initInfo() | 107 | QWidget *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 ------------------------------------------------------- |
199 | QWidget *Checkbook::initTransactions() | 199 | QWidget *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 ------------------------------------------------------------- |
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 | |||
@@ -34,63 +34,63 @@ | |||
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 --------------------------------------------------------------- |
40 | ListEdit::ListEdit( QWidget *parent, const char *sName ) | 40 | ListEdit::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 -------------------------------------------------------------- |
87 | ListEdit::~ListEdit() | 87 | ListEdit::~ListEdit() |
88 | { | 88 | { |
89 | } | 89 | } |
90 | 90 | ||
91 | 91 | ||
92 | // --- slotEditTypeChanged ---------------------------------------------------- | 92 | // --- slotEditTypeChanged ---------------------------------------------------- |
93 | void ListEdit::slotEditChanged(const QString &str) | 93 | void 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); |
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 | |||
@@ -151,49 +151,49 @@ void MainWindow::buildList() | |||
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 | ||
185 | void MainWindow::addCheckbook( CBInfo *cb ) | 185 | void 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 | } |
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 | |||
@@ -54,44 +54,44 @@ static const char* const showhideimage_data[] = { | |||
54 | ".#....#..#.#..#.", | 54 | ".#....#..#.#..#.", |
55 | "................"}; | 55 | "................"}; |
56 | 56 | ||
57 | Password::Password( QWidget *parent, const char *caption, const char *prompt ) | 57 | Password::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 | ||
84 | Password::~Password() | 84 | Password::~Password() |
85 | { | 85 | { |
86 | } | 86 | } |
87 | 87 | ||
88 | void Password::accept() | 88 | void Password::accept() |
89 | { | 89 | { |
90 | password = pw->text(); | 90 | password = pw->text(); |
91 | QDialog::accept(); | 91 | QDialog::accept(); |
92 | } | 92 | } |
93 | 93 | ||
94 | void Password::slotTogglePassword( bool showPW ) | 94 | void 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 | |||
@@ -78,70 +78,70 @@ Transaction::Transaction( QWidget *parent, bool bNew, const QString &acctname, | |||
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 ); |
@@ -149,52 +149,52 @@ Transaction::Transaction( QWidget *parent, bool bNew, const QString &acctname, | |||
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 ----------------------------------------------------------- |
181 | void Transaction::initFromInfo(TranInfo *info, bool bPopulateOld) | 181 | void 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 ); |
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 | |||
@@ -27,50 +27,50 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | |||
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 | ||
65 | void MainWindow::makeMenu() | 65 | void 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 | ||
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 | |||
@@ -185,31 +185,31 @@ void 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 | ||
198 | void ODict::setupMenus() | 198 | void 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 | |||
@@ -81,51 +81,51 @@ Bartender::Bartender( QWidget* parent, const char* name, WFlags fl ) | |||
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 | ||
117 | Bartender::~Bartender() { | 117 | Bartender::~Bartender() { |
118 | } | 118 | } |
119 | 119 | ||
120 | /* | 120 | /* |
121 | this happens right before exit */ | 121 | this happens right before exit */ |
122 | void Bartender::cleanUp() { | 122 | void Bartender::cleanUp() { |
123 | dbFile.close(); | 123 | dbFile.close(); |
124 | 124 | ||
125 | } | 125 | } |
126 | 126 | ||
127 | void Bartender::initDrinkDb() { | 127 | void 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")) ); |
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 | |||
@@ -8,36 +8,36 @@ | |||
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 | ||
17 | Search_Results::Search_Results( QWidget* parent, const char* name, bool modal, WFlags fl ) | 17 | Search_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 | ||
35 | Search_Results::~Search_Results() { | 35 | Search_Results::~Search_Results() { |
36 | } | 36 | } |
37 | 37 | ||
38 | 38 | ||
39 | void Search_Results::listSelected(QListBoxItem *) { | 39 | void 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 | |||
@@ -11,57 +11,57 @@ | |||
11 | namespace { | 11 | namespace { |
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 | ||
25 | BTConfigWidget::BTConfigWidget( const QString& name, | 25 | BTConfigWidget::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 | ||
58 | BTConfigWidget::~BTConfigWidget() { | 58 | BTConfigWidget::~BTConfigWidget() { |
59 | 59 | ||
60 | } | 60 | } |
61 | void BTConfigWidget::load( const Profile& prof ) { | 61 | void 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() ) { |
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 | |||
@@ -41,49 +41,49 @@ DialDialog::DialDialog( QWidget* parent, const char* name, bool modal, WFlags f | |||
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 | ||
77 | void DialDialog::slotEnterNumber( int number ) { | 77 | void 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 | ||
86 | DialDialog::~DialDialog() { | 86 | DialDialog::~DialDialog() { |
87 | } | 87 | } |
88 | 88 | ||
89 | QString DialDialog::number() { | 89 | QString DialDialog::number() { |
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,47 +1,47 @@ | |||
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 | ||
8 | EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const char* name ) | 8 | EmulationHandler::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 | } |
31 | TEmulation* EmulationHandler::emulation() { | 31 | TEmulation* EmulationHandler::emulation() { |
32 | return m_teEmu; | 32 | return m_teEmu; |
33 | } | 33 | } |
34 | EmulationHandler::~EmulationHandler() { | 34 | EmulationHandler::~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 | ||
41 | void EmulationHandler::load( const Profile& prof) { | 41 | void 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) ; |
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 | |||
@@ -85,60 +85,60 @@ | |||
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 | ||
95 | EmulationLayer::EmulationLayer( WidgetLayer* gui ) | 95 | EmulationLayer::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 | ||
128 | EmulationLayer::~EmulationLayer() | 128 | EmulationLayer::~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 | ||
138 | void EmulationLayer::setScreen(int n) | 138 | void EmulationLayer::setScreen(int n) |
139 | { | 139 | { |
140 | scr = screen[n&1]; | 140 | scr = screen[n&1]; |
141 | } | 141 | } |
142 | 142 | ||
143 | void EmulationLayer::setHistory(bool on) | 143 | void EmulationLayer::setHistory(bool on) |
144 | { | 144 | { |
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 | |||
@@ -239,87 +239,87 @@ void FunctionKeyboard::loadDefaults() { | |||
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 | ||
255 | FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent, const char* na ) | 255 | FunctionKeyboardConfig::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 | } |
308 | FunctionKeyboardConfig::~FunctionKeyboardConfig() { | 308 | FunctionKeyboardConfig::~FunctionKeyboardConfig() { |
309 | 309 | ||
310 | } | 310 | } |
311 | void FunctionKeyboardConfig::load (const Profile& prof) { | 311 | void 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 | ||
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 | |||
@@ -15,50 +15,50 @@ IOBt::~IOBt() { | |||
15 | 15 | ||
16 | void IOBt::close() { | 16 | void 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 | ||
26 | bool IOBt::open() { | 26 | bool 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 | ||
58 | void IOBt::reload( const Profile &config ) { | 58 | void 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); |
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 | |||
@@ -6,50 +6,50 @@ IOIrda::IOIrda( const Profile &config ) : IOSerial( config ) { | |||
6 | } | 6 | } |
7 | 7 | ||
8 | 8 | ||
9 | IOIrda::~IOIrda() { | 9 | IOIrda::~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 | ||
16 | void IOIrda::close() { | 16 | void 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 | ||
23 | bool IOIrda::open() { | 23 | bool 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 | ||
44 | void IOIrda::reload( const Profile &config ) { | 44 | void 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 | ||
54 | QString IOIrda::identifier() const { | 54 | QString IOIrda::identifier() const { |
55 | return "irda"; | 55 | return "irda"; |
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 | |||
@@ -189,88 +189,88 @@ void MainWindow::initUI() { | |||
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 | ||
262 | ProfileManager* MainWindow::manager() { | 262 | ProfileManager* MainWindow::manager() { |
263 | return m_manager; | 263 | return m_manager; |
264 | } | 264 | } |
265 | TabWidget* MainWindow::tabWidget() { | 265 | TabWidget* MainWindow::tabWidget() { |
266 | return m_consoleWindow; | 266 | return m_consoleWindow; |
267 | } | 267 | } |
268 | void MainWindow::populateProfiles() { | 268 | void 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 | ||
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 | |||
@@ -110,52 +110,52 @@ void ProfileEditorDialog::initUI() | |||
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 | ||
141 | ProfileEditorDialog::~ProfileEditorDialog() { | 141 | ProfileEditorDialog::~ProfileEditorDialog() { |
142 | 142 | ||
143 | } | 143 | } |
144 | void ProfileEditorDialog::accept() | 144 | void 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 | ||
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 | |||
@@ -37,50 +37,50 @@ EmulationHandler* Session::emulationHandler() { | |||
37 | return m_emu; | 37 | return m_emu; |
38 | } | 38 | } |
39 | QWidget* Session::widget() { | 39 | QWidget* 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 | } |
45 | Profile Session::profile()const { | 45 | Profile Session::profile()const { |
46 | return m_prof; | 46 | return m_prof; |
47 | } | 47 | } |
48 | /* | 48 | /* |
49 | WidgetLayer* Session::emulationWidget() { | 49 | WidgetLayer* Session::emulationWidget() { |
50 | return m_widLay; | 50 | return m_widLay; |
51 | } | 51 | } |
52 | */ | 52 | */ |
53 | void Session::connect() { | 53 | void 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 | ||
65 | void Session::disconnect() { | 65 | void 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 | ||
76 | void Session::setName( const QString& na){ | 76 | void Session::setName( const QString& na){ |
77 | m_name = na; | 77 | m_name = na; |
78 | } | 78 | } |
79 | 79 | ||
80 | void Session::setWidgetStack( QWidgetStack* wid ) { | 80 | void 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; |
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 | |||
@@ -4,81 +4,81 @@ | |||
4 | #include <stdio.h> | 4 | #include <stdio.h> |
5 | #include <sys/termios.h> | 5 | #include <sys/termios.h> |
6 | 6 | ||
7 | 7 | ||
8 | 8 | ||
9 | SzTransfer::SzTransfer(Type t, IOLayer *layer) : FileTransferLayer(layer), m_t(t) | 9 | SzTransfer::SzTransfer(Type t, IOLayer *layer) : FileTransferLayer(layer), m_t(t) |
10 | { | 10 | { |
11 | } | 11 | } |
12 | 12 | ||
13 | SzTransfer::~SzTransfer() { | 13 | SzTransfer::~SzTransfer() { |
14 | } | 14 | } |
15 | 15 | ||
16 | void SzTransfer::sendFile(const QFile& file) { | 16 | void SzTransfer::sendFile(const QFile& file) { |
17 | 17 | ||
18 | sendFile(file.name()); | 18 | sendFile(file.name()); |
19 | } | 19 | } |
20 | 20 | ||
21 | void SzTransfer::sendFile(const QString& file) { | 21 | void 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 | ||
40 | void SzTransfer::SzReceivedStdout(OProcess *, char *buffer, int buflen) { | 40 | void 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 | ||
55 | void SzTransfer::SzReceivedStderr(OProcess *, char *buffer, int length) { | 55 | void 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 | ||
64 | void SzTransfer::receivedStdin(const QByteArray &data) { | 64 | void 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 | ||
73 | void SzTransfer::sent() { | 73 | void 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 | |||
@@ -5,49 +5,49 @@ | |||
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 | ||
18 | SenderUI::SenderUI() | 18 | SenderUI::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 | } |
39 | SenderUI::~SenderUI() { | 39 | SenderUI::~SenderUI() { |
40 | 40 | ||
41 | } | 41 | } |
42 | void SenderUI::slotSendFile() { | 42 | void 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 | ||
51 | void SenderUI::slotSend() { | 51 | void 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() ); |
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 | |||
@@ -104,61 +104,61 @@ void TransferDialog::slotFilename() | |||
104 | 104 | ||
105 | void TransferDialog::slotTransfer() | 105 | void 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 | ||
145 | void TransferDialog::cleanup() | 145 | void 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 | ||
161 | void TransferDialog::slotCancel() | 161 | void TransferDialog::slotCancel() |
162 | { | 162 | { |
163 | ok->setEnabled(true); | 163 | ok->setEnabled(true); |
164 | statusbar->setText(QObject::tr("Ready")); | 164 | statusbar->setText(QObject::tr("Ready")); |
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 | |||
@@ -308,69 +308,69 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) | |||
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 |
@@ -432,49 +432,49 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) | |||
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 | ||
@@ -705,122 +705,122 @@ QTReaderApp::QTReaderApp( QWidget *parent, const char *name, WFlags f ) | |||
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; |
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 | |||
@@ -53,52 +53,52 @@ fileBrowser::fileBrowser( bool allownew, QWidget* parent, const char* name, boo | |||
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()); |
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 | |||
@@ -20,51 +20,51 @@ | |||
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 | ||
33 | MainWindow::MainWindow(QWidget *parent, const char* n, WFlags fl) | 33 | MainWindow::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 | ||
66 | MainWindow::~MainWindow() | 66 | MainWindow::~MainWindow() |
67 | { | 67 | { |
68 | if (currentDoc) delete currentDoc; | 68 | if (currentDoc) delete currentDoc; |
69 | } | 69 | } |
70 | 70 | ||
@@ -559,49 +559,49 @@ void MainWindow::initMenu() | |||
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 | ||
571 | void MainWindow::initStandardToolbar() | 571 | void 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 | ||
586 | void MainWindow::initFunctionsToolbar() | 586 | void 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 | ||
@@ -618,50 +618,50 @@ void MainWindow::initEditToolbar() | |||
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 | ||
624 | void MainWindow::slotHelpAbout() | 624 | void 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 | ||
637 | void MainWindow::initSheet() | 637 | void 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 | ||
651 | void MainWindow::slotEditAccept() | 651 | void MainWindow::slotEditAccept() |
652 | { | 652 | { |
653 | sheet->setData(editData->text()); | 653 | sheet->setData(editData->text()); |
654 | } | 654 | } |
655 | 655 | ||
656 | void MainWindow::slotEditCancel() | 656 | void MainWindow::slotEditCancel() |
657 | { | 657 | { |
658 | editData->setText(sheet->getData()); | 658 | editData->setText(sheet->getData()); |
659 | } | 659 | } |
660 | 660 | ||
661 | void MainWindow::slotCellSelect(bool lock) | 661 | void MainWindow::slotCellSelect(bool lock) |
662 | { | 662 | { |
663 | sheet->lockClicks(lock); | 663 | sheet->lockClicks(lock); |
664 | } | 664 | } |
665 | 665 | ||
666 | void MainWindow::addToData(const QString &data) | 666 | void MainWindow::addToData(const QString &data) |
667 | { | 667 | { |
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 | |||
@@ -22,50 +22,50 @@ | |||
22 | 22 | ||
23 | #define DEFAULT_COL_WIDTH 50 | 23 | #define DEFAULT_COL_WIDTH 50 |
24 | 24 | ||
25 | Sheet::Sheet(int numRows, int numCols, QWidget *parent) | 25 | Sheet::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 | ||
50 | Sheet::~Sheet() | 50 | Sheet::~Sheet() |
51 | { | 51 | { |
52 | } | 52 | } |
53 | 53 | ||
54 | typeCellData *Sheet::findCellData(int row, int col) | 54 | typeCellData *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 | ||
64 | void Sheet::slotCellSelected(int row, int col) | 64 | void 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(""); |
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 | |||
@@ -102,50 +102,50 @@ private: | |||
102 | 102 | ||
103 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags fl ) | 103 | MainWindow::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 | ||
141 | MainWindow::~MainWindow() | 141 | MainWindow::~MainWindow() |
142 | { | 142 | { |
143 | save(); | 143 | save(); |
144 | } | 144 | } |
145 | 145 | ||
146 | void MainWindow::setupActions() | 146 | void 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 ); |
@@ -192,111 +192,111 @@ void MainWindow::setupActions() | |||
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 | ||
266 | Qt3::QTextEdit *MainWindow::currentEditor() const | 266 | Qt3::QTextEdit *MainWindow::currentEditor() const |
267 | { | 267 | { |
268 | return editor; | 268 | return editor; |
269 | } | 269 | } |
270 | 270 | ||
271 | void MainWindow::doConnections( Qt3::QTextEdit *e ) | 271 | void 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 | ||
281 | void MainWindow::updateFontSizeCombo( const QFont &f ) | 281 | void 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 | ||
291 | void MainWindow::editUndo() | 291 | void MainWindow::editUndo() |
292 | { | 292 | { |
293 | if ( !currentEditor() ) | 293 | if ( !currentEditor() ) |
294 | return; | 294 | return; |
295 | currentEditor()->undo(); | 295 | currentEditor()->undo(); |
296 | } | 296 | } |
297 | 297 | ||
298 | void MainWindow::editRedo() | 298 | void MainWindow::editRedo() |
299 | { | 299 | { |
300 | if ( !currentEditor() ) | 300 | if ( !currentEditor() ) |
301 | return; | 301 | return; |
302 | currentEditor()->redo(); | 302 | currentEditor()->redo(); |
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 | |||
@@ -656,50 +656,50 @@ QTextEdit::QTextEdit( const QString& text, const QString& context, | |||
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 | ||
664 | QTextEdit::~QTextEdit() | 664 | QTextEdit::~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 | ||
673 | void QTextEdit::init() | 673 | void 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 ); |
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,73 +1,73 @@ | |||
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 | ||
10 | extern Account *account; | 10 | extern Account *account; |
11 | extern Transaction *transaction; | 11 | extern Transaction *transaction; |
12 | extern Transfer *transfer; | 12 | extern Transfer *transfer; |
13 | extern Preferences *preferences; | 13 | extern Preferences *preferences; |
14 | 14 | ||
15 | AccountDisplay::AccountDisplay ( QWidget *parent ) : QWidget ( parent ) | 15 | AccountDisplay::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 | ||
56 | void AccountDisplay::setTabs ( QWidget *newtab2, QTabWidget *newtabs ) | 56 | void AccountDisplay::setTabs ( QWidget *newtab2, QTabWidget *newtabs ) |
57 | { | 57 | { |
58 | tab2 = newtab2; | 58 | tab2 = newtab2; |
59 | maintabs = newtabs; | 59 | maintabs = newtabs; |
60 | } | 60 | } |
61 | 61 | ||
62 | void AccountDisplay::addAccount () | 62 | void 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 ) ); |
@@ -204,58 +204,58 @@ void AccountDisplay::setToggleButton () | |||
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 | ||
219 | void AccountDisplay::accountTransfer ( bool state ) | 219 | void 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 | ||
241 | void AccountDisplay::getTransferAccounts ( QListViewItem * item ) | 241 | void 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(); |
@@ -270,49 +270,49 @@ void AccountDisplay::getTransferAccounts ( QListViewItem * item ) | |||
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 | ||
305 | void AccountDisplay::disableParentsWithChildren () | 305 | void 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 | ||
316 | void AccountDisplay::enableAccounts () | 316 | void AccountDisplay::enableAccounts () |
317 | { | 317 | { |
318 | // iterate through accountdisplay listview and enable all accounts | 318 | // iterate through accountdisplay listview and enable all accounts |
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 | |||
@@ -17,90 +17,90 @@ BudgetDisplay::BudgetDisplay ( QWidget *parent ) : QWidget ( parent ) | |||
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 | ||
99 | void BudgetDisplay::deleteBudget () | 99 | void 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(); |
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,82 +1,82 @@ | |||
1 | #include "calculator.h" | 1 | #include "calculator.h" |
2 | 2 | ||
3 | #include <qpushbutton.h> | 3 | #include <qpushbutton.h> |
4 | 4 | ||
5 | Calculator::Calculator ( QWidget* parent ) : QDialog ( parent, 0, TRUE ) | 5 | Calculator::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 | ||
77 | void Calculator::displayOne () | 77 | void Calculator::displayOne () |
78 | { display->insert ( "1" ); } | 78 | { display->insert ( "1" ); } |
79 | 79 | ||
80 | void Calculator::displayTwo () | 80 | void Calculator::displayTwo () |
81 | { display->insert ( "2" ); } | 81 | { display->insert ( "2" ); } |
82 | 82 | ||
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,46 +1,46 @@ | |||
1 | #include "datepicker.h" | 1 | #include "datepicker.h" |
2 | 2 | ||
3 | DatePicker::DatePicker ( QDate entrydate ) : QDialog ( 0, 0, TRUE ) | 3 | DatePicker::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 | ||
34 | void DatePicker::displayDays ( QComboBox *daybox ) | 34 | void 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 | ||
43 | void DatePicker::displayMonths ( QComboBox *monthbox ) | 43 | void 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++ ) |
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,51 +1,51 @@ | |||
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 | ||
5 | extern Memory *memory; | 5 | extern Memory *memory; |
6 | 6 | ||
7 | MemoryDialog::MemoryDialog () : QDialog ( 0, 0, TRUE ) | 7 | MemoryDialog::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 | ||
37 | MemoryDialog::~MemoryDialog() | 37 | MemoryDialog::~MemoryDialog() |
38 | { | 38 | { |
39 | } | 39 | } |
40 | 40 | ||
41 | void MemoryDialog::addItem () | 41 | void 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 | } |
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 | |||
@@ -55,54 +55,54 @@ NewAccount::NewAccount ( QWidget *parent, const char *name, bool modal ) : QDial | |||
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 | ||
87 | NewAccount::~NewAccount () | 87 | NewAccount::~NewAccount () |
88 | { | 88 | { |
89 | } | 89 | } |
90 | 90 | ||
91 | void NewAccount::showChildPulldownMenu () | 91 | void 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 | ||
102 | void NewAccount::hideChildPulldownMenu () | 102 | void NewAccount::hideChildPulldownMenu () |
103 | { | 103 | { |
104 | childlabel->setEnabled ( FALSE ); | 104 | childlabel->setEnabled ( FALSE ); |
105 | childbox->setEnabled ( FALSE ); | 105 | childbox->setEnabled ( FALSE ); |
106 | } | 106 | } |
107 | 107 | ||
108 | void NewAccount::showCalculator () | 108 | void NewAccount::showCalculator () |
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 | |||
@@ -4,109 +4,109 @@ | |||
4 | #include "budget.h" | 4 | #include "budget.h" |
5 | 5 | ||
6 | #include <qmultilineedit.h> | 6 | #include <qmultilineedit.h> |
7 | 7 | ||
8 | extern Budget *budget; | 8 | extern Budget *budget; |
9 | extern Preferences *preferences; | 9 | extern Preferences *preferences; |
10 | 10 | ||
11 | NewTransaction::NewTransaction ( QWidget* parent ) : QDialog ( parent, 0, TRUE ) | 11 | NewTransaction::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 | ||
100 | NewTransaction::~NewTransaction () | 100 | NewTransaction::~NewTransaction () |
101 | { | 101 | { |
102 | } | 102 | } |
103 | 103 | ||
104 | void NewTransaction::showCalculator () | 104 | void 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 | ||
112 | void NewTransaction::showCalendar () | 112 | void NewTransaction::showCalendar () |
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,55 +1,55 @@ | |||
1 | #include "preferencedialogs.h" | 1 | #include "preferencedialogs.h" |
2 | #include "preferences.h" | 2 | #include "preferences.h" |
3 | 3 | ||
4 | extern Preferences *preferences; | 4 | extern Preferences *preferences; |
5 | 5 | ||
6 | DatePreferences::DatePreferences ( QWidget* parent ) : QDialog ( parent, 0, TRUE ) | 6 | DatePreferences::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 | ||
46 | DatePreferences::~DatePreferences () | 46 | DatePreferences::~DatePreferences () |
47 | { | 47 | { |
48 | } | 48 | } |
49 | 49 | ||
50 | void DatePreferences::changeDateFormat ( int index ) | 50 | void DatePreferences::changeDateFormat ( int index ) |
51 | { | 51 | { |
52 | index ++; | 52 | index ++; |
53 | preferences->changePreference ( 1, index ); | 53 | preferences->changePreference ( 1, index ); |
54 | } | 54 | } |
55 | 55 | ||
@@ -81,60 +81,60 @@ TransactionPreferences::TransactionPreferences ( QWidget* parent ) : QDialog ( p | |||
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 | ||
119 | TransactionPreferences::~TransactionPreferences () | 119 | TransactionPreferences::~TransactionPreferences () |
120 | { | 120 | { |
121 | } | 121 | } |
122 | 122 | ||
123 | void TransactionPreferences::changeLimitTransactionsPreference ( int pref ) | 123 | void TransactionPreferences::changeLimitTransactionsPreference ( int pref ) |
124 | { | 124 | { |
125 | preferences->changePreference ( 7, pref ); | 125 | preferences->changePreference ( 7, pref ); |
126 | } | 126 | } |
127 | 127 | ||
128 | void TransactionPreferences::changeShowClearedPreference ( bool state ) | 128 | void 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 | ||
136 | void TransactionPreferences::changeExcludeTranfersPreference ( bool state ) | 136 | void 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 |
@@ -153,58 +153,58 @@ void TransactionPreferences::setDefaultTransactionPreferences () | |||
153 | // START ACCOUNT PREFERNCES | 153 | // START ACCOUNT PREFERNCES |
154 | 154 | ||
155 | AccountPreferences::AccountPreferences ( QWidget* parent ) : QDialog ( parent, 0, TRUE ) | 155 | AccountPreferences::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 | ||
189 | AccountPreferences::~AccountPreferences () | 189 | AccountPreferences::~AccountPreferences () |
190 | { | 190 | { |
191 | } | 191 | } |
192 | 192 | ||
193 | void AccountPreferences::changeCurrencySupport ( bool state ) | 193 | void 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 | ||
201 | void AccountPreferences::changeOneTouchViewing ( bool state ) | 201 | void 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 | ||
209 | void AccountPreferences::setDefaultAccountPreferences () | 209 | void AccountPreferences::setDefaultAccountPreferences () |
210 | { | 210 | { |
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 | |||
@@ -7,88 +7,88 @@ | |||
7 | Budget *budget = new Budget (); | 7 | Budget *budget = new Budget (); |
8 | Preferences *preferences = new Preferences (); | 8 | Preferences *preferences = new Preferences (); |
9 | Account *account = new Account (); | 9 | Account *account = new Account (); |
10 | Transaction *transaction = new Transaction (); | 10 | Transaction *transaction = new Transaction (); |
11 | Transfer *transfer = new Transfer (); | 11 | Transfer *transfer = new Transfer (); |
12 | Memory *memory = new Memory (); | 12 | Memory *memory = new Memory (); |
13 | 13 | ||
14 | QashMoney::QashMoney () : QWidget () | 14 | QashMoney::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 | ||
78 | QashMoney::~QashMoney () | 78 | QashMoney::~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 | ||
88 | void QashMoney::changeTabDisplay () | 88 | void 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 |
@@ -331,56 +331,56 @@ void QashMoney::displayAccountPreferencesDialog () | |||
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 | ||
340 | void QashMoney::displayMemoryDialog () | 340 | void 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 | ||
347 | void QashMoney::showTransactions () | 347 | void QashMoney::showTransactions () |
348 | { | 348 | { |
349 | maintabs->setCurrentPage ( 1 ); | 349 | maintabs->setCurrentPage ( 1 ); |
350 | } | 350 | } |
351 | 351 | ||
352 | void QashMoney::enableOneTouchViewing () | 352 | void 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 | ||
360 | void QashMoney::disableOneTouchViewing () | 360 | void 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 | ||
365 | void QashMoney::toggleOneTouchViewing ( bool state ) | 365 | void 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 | ||
373 | void QashMoney::setTransactionDisplayDate () | 373 | void 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 ); |
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 | |||
@@ -8,83 +8,83 @@ | |||
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 | ||
14 | extern Transaction *transaction; | 14 | extern Transaction *transaction; |
15 | extern Budget *budget; | 15 | extern Budget *budget; |
16 | extern Account *account; | 16 | extern Account *account; |
17 | extern Preferences *preferences; | 17 | extern Preferences *preferences; |
18 | extern Memory *memory; | 18 | extern Memory *memory; |
19 | extern Transfer *transfer; | 19 | extern Transfer *transfer; |
20 | 20 | ||
21 | TransactionDisplay::TransactionDisplay ( QWidget* parent ) : QWidget ( parent ) | 21 | TransactionDisplay::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 | ||
74 | void TransactionDisplay::addTransaction () | 74 | void 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 (); |
@@ -192,49 +192,49 @@ void TransactionDisplay::editTransfer () | |||
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 ); |
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 | |||
@@ -9,49 +9,49 @@ extern Account *account; | |||
9 | TransferDialog::TransferDialog ( QWidget *parent, int fromaccountid, int toaccountid ) : QDialog ( parent, 0, TRUE ) | 9 | TransferDialog::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 ); |
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 | |||
@@ -134,56 +134,56 @@ TableViewerWindow::TableViewerWindow(QWidget *parent, const char *name, WFlags f | |||
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 | */ |
177 | TableViewerWindow::~TableViewerWindow() | 177 | TableViewerWindow::~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 | */ |
186 | void TableViewerWindow::selectDocument() | 186 | void TableViewerWindow::selectDocument() |
187 | { | 187 | { |
188 | if(dirty) | 188 | if(dirty) |
189 | saveDocument(); | 189 | saveDocument(); |
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 | |||
@@ -16,49 +16,49 @@ | |||
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 | ||
31 | DateEdit::DateEdit( QWidget *parent, const char *name, WFlags f ) | 31 | DateEdit::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 | ||
47 | DateEdit::~DateEdit() {} | 47 | DateEdit::~DateEdit() {} |
48 | 48 | ||
49 | QDate DateEdit::date() const | 49 | QDate DateEdit::date() const |
50 | { | 50 | { |
51 | return dateSelector->selectedDate(); | 51 | return dateSelector->selectedDate(); |
52 | } | 52 | } |
53 | 53 | ||
54 | void DateEdit::setDate(QDate d) | 54 | void 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 | ||
60 | QSizePolicy DateEdit::sizePolicy() const | 60 | QSizePolicy 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); |
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 | |||
@@ -33,50 +33,50 @@ | |||
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 | */ |
41 | TVBrowseView::TVBrowseView(TableState *t, QWidget* parent, const char *name, | 41 | TVBrowseView::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 | */ |
69 | TVBrowseView::~TVBrowseView() | 69 | TVBrowseView::~TVBrowseView() |
70 | { | 70 | { |
71 | } | 71 | } |
72 | 72 | ||
73 | void TVBrowseView::rebuildData() | 73 | void 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 | ||
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 | |||
@@ -68,49 +68,49 @@ TVFilterView::TVFilterView(TableState *t, QWidget* parent, | |||
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 | */ |
107 | TVFilterView::~TVFilterView() | 107 | TVFilterView::~TVFilterView() |
108 | { | 108 | { |
109 | } | 109 | } |
110 | 110 | ||
111 | void TVFilterView::rebuildData() | 111 | void TVFilterView::rebuildData() |
112 | { | 112 | { |
113 | } | 113 | } |
114 | 114 | ||
115 | void TVFilterView::reset() | 115 | void TVFilterView::reset() |
116 | { | 116 | { |
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 | |||
@@ -83,50 +83,50 @@ TVListViewItem::TVListViewItem(QListView *parent, DataElem *d) | |||
83 | TVListViewItem::~TVListViewItem() | 83 | TVListViewItem::~TVListViewItem() |
84 | { | 84 | { |
85 | data_reference = 0; | 85 | data_reference = 0; |
86 | } | 86 | } |
87 | 87 | ||
88 | TVListView::TVListView(TableState *t, QWidget* parent, | 88 | TVListView::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 | ||
118 | TVListView::~TVListView() | 118 | TVListView::~TVListView() |
119 | { | 119 | { |
120 | } | 120 | } |
121 | 121 | ||
122 | void TVListView::addItem(DataElem *d) | 122 | void 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 */ |
131 | void TVListView::removeItem() | 131 | void TVListView::removeItem() |
132 | { | 132 | { |
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 | |||
@@ -34,57 +34,57 @@ | |||
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 | ||
46 | StyleChanger::StyleChanger( QWidget *parent ) | 46 | StyleChanger::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 | ||
83 | void StyleChanger::setRef(ItemStyle *s) { | 83 | void 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 | ||
@@ -265,49 +265,49 @@ void HighlightDialogPage::hlNew() { | |||
265 | HlEditDialog::HlEditDialog(HlManager *,QWidget *parent, const char *name, bool modal,HlData *data) | 265 | HlEditDialog::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 | ||
294 | void HlEditDialog::newDocument() | 294 | void 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 | ||
308 | void HlEditDialog::initContextOptions(QVBox *co) | 308 | void 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); |
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 | |||
@@ -147,49 +147,49 @@ KateDocument::KateDocument(bool bSingleViewMode, bool bBrowserView, | |||
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; |
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 | |||
@@ -514,58 +514,58 @@ void ColorConfig::setColors(QColor *colors) | |||
514 | m_selected->setColor( colors[1] ); | 514 | m_selected->setColor( colors[1] ); |
515 | } | 515 | } |
516 | 516 | ||
517 | void ColorConfig::getColors(QColor *colors) | 517 | void 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 | ||
523 | FontConfig::FontConfig( QWidget *parent, char *name ) | 523 | FontConfig::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 | ||
552 | FontConfig::~FontConfig() | 552 | FontConfig::~FontConfig() |
553 | { | 553 | { |
554 | } | 554 | } |
555 | 555 | ||
556 | void FontConfig::setFont ( const QFont &font ) | 556 | void FontConfig::setFont ( const QFont &font ) |
557 | { | 557 | { |
558 | //#if 0 | 558 | //#if 0 |
559 | m_fontselect->setFont (font); | 559 | m_fontselect->setFont (font); |
560 | myFont = font; | 560 | myFont = font; |
561 | //#endif | 561 | //#endif |
562 | } | 562 | } |
563 | 563 | ||
564 | void FontConfig::slotFontSelected( const QFont &font ) | 564 | void 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 | |||
@@ -21,49 +21,49 @@ | |||
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 | ||
30 | TinyKate::TinyKate( QWidget *parent, const char *name, WFlags f) : | 30 | TinyKate::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())); |
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 | |||
@@ -174,55 +174,55 @@ ScQtFileDlg::ScQtFileDlg( QWidget* parent, const char* name, bool modal, WFlags | |||
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 | */ |
212 | ScQtFileDlg::~ScQtFileDlg() | 212 | ScQtFileDlg::~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 | ||
217 | void ScQtFileDlg::slotCancel() | 217 | void ScQtFileDlg::slotCancel() |
218 | { | 218 | { |
219 | qWarning( "ScQtFileDlg::slotCancel(): Not implemented yet!" ); | 219 | qWarning( "ScQtFileDlg::slotCancel(): Not implemented yet!" ); |
220 | } | 220 | } |
221 | 221 | ||
222 | void ScQtFileDlg::slotDirComboBoxChanged( int ) | 222 | void 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 | ||
227 | void ScQtFileDlg::slotDoubleClicked(QListViewItem *) | 227 | void ScQtFileDlg::slotDoubleClicked(QListViewItem *) |
228 | { | 228 | { |
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 | |||
@@ -669,54 +669,54 @@ ZSafe::ZSafe( QWidget* parent, const char* name, bool modal, WFlags fl ) | |||
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 | ||
702 | const QColor *ZSafe::evenRowColor = &Qt::white; | 702 | const QColor *ZSafe::evenRowColor = &Qt::white; |
703 | // const QColor *ZSafe::oddRowColor = &Qt::lightGray; | 703 | // const QColor *ZSafe::oddRowColor = &Qt::lightGray; |
704 | const QColor *ZSafe::oddRowColor = new QColor(216,240,255); | 704 | const 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 | */ |
709 | ZSafe::~ZSafe() | 709 | ZSafe::~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 |
716 | void ZSafe::slotLoadDocu() | 716 | void ZSafe::slotLoadDocu() |
717 | { | 717 | { |
718 | openDocument (filename); | 718 | openDocument (filename); |
719 | } | 719 | } |
720 | 720 | ||
721 | void ZSafe::deletePwd() | 721 | void ZSafe::deletePwd() |
722 | { | 722 | { |
@@ -2558,50 +2558,50 @@ void ZSafe::addCategory() | |||
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 |
@@ -2965,50 +2965,50 @@ void ZSafe::saveCategoryDialogFields(CategoryDialog *dialog) | |||
2965 | } | 2965 | } |
2966 | 2966 | ||
2967 | void ZSafe::editCategory() | 2967 | void 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 |