author | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
commit | 16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (unidiff) | |
tree | 0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/apps | |
parent | 8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff) | |
download | opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2 |
convert to Opie Debugging Framework
64 files changed, 432 insertions, 339 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index a60d6ce..a47edd8 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp | |||
@@ -66,17 +66,17 @@ void AdvancedFm::cleanUp() { | |||
66 | else | 66 | else |
67 | sfile+="._temp"; | 67 | sfile+="._temp"; |
68 | QFile file( sfile); | 68 | QFile file( sfile); |
69 | if(file.exists()) | 69 | if(file.exists()) |
70 | file.remove(); | 70 | file.remove(); |
71 | } | 71 | } |
72 | 72 | ||
73 | void AdvancedFm::tabChanged(QWidget *) { | 73 | void AdvancedFm::tabChanged(QWidget *) { |
74 | // qWarning("tab changed"); | 74 | // owarn << "tab changed" << oendl; |
75 | QString path = CurrentDir()->canonicalPath(); | 75 | QString path = CurrentDir()->canonicalPath(); |
76 | currentPathCombo->lineEdit()->setText( path ); | 76 | currentPathCombo->lineEdit()->setText( path ); |
77 | 77 | ||
78 | if(whichTab == 1) { | 78 | if(whichTab == 1) { |
79 | viewMenu->setItemChecked(viewMenu->idAt(0), true); | 79 | viewMenu->setItemChecked(viewMenu->idAt(0), true); |
80 | viewMenu->setItemChecked(viewMenu->idAt(1), false); | 80 | viewMenu->setItemChecked(viewMenu->idAt(1), false); |
81 | } else { | 81 | } else { |
82 | viewMenu->setItemChecked(viewMenu->idAt(0), false); | 82 | viewMenu->setItemChecked(viewMenu->idAt(0), false); |
@@ -88,23 +88,23 @@ void AdvancedFm::tabChanged(QWidget *) { | |||
88 | setCaption(tr("AdvancedFm :: ")+fs+" :: " | 88 | setCaption(tr("AdvancedFm :: ")+fs+" :: " |
89 | +checkDiskSpace( (const QString &) path )+ tr(" kB free") ); | 89 | +checkDiskSpace( (const QString &) path )+ tr(" kB free") ); |
90 | chdir( path.latin1()); | 90 | chdir( path.latin1()); |
91 | } | 91 | } |
92 | 92 | ||
93 | 93 | ||
94 | void AdvancedFm::populateView() { | 94 | void AdvancedFm::populateView() { |
95 | 95 | ||
96 | // qWarning("PopulateView"); | 96 | // owarn << "PopulateView" << oendl; |
97 | QPixmap pm; | 97 | QPixmap pm; |
98 | QListView *thisView = CurrentView(); | 98 | QListView *thisView = CurrentView(); |
99 | QDir *thisDir = CurrentDir(); | 99 | QDir *thisDir = CurrentDir(); |
100 | QString path = thisDir->canonicalPath(); | 100 | QString path = thisDir->canonicalPath(); |
101 | 101 | ||
102 | //qWarning("path is "+path); | 102 | //owarn << "path is "+path << oendl; |
103 | thisView->clear(); | 103 | thisView->clear(); |
104 | thisDir->setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); | 104 | thisDir->setSorting(/* QDir::Size*/ /*| QDir::Reversed | */QDir::DirsFirst); |
105 | thisDir->setMatchAllDirs(TRUE); | 105 | thisDir->setMatchAllDirs(TRUE); |
106 | thisDir->setNameFilter(filterStr); | 106 | thisDir->setNameFilter(filterStr); |
107 | QString fileL, fileS, fileDate; | 107 | QString fileL, fileS, fileDate; |
108 | QString fs= getFileSystemType((const QString &) path); | 108 | QString fs= getFileSystemType((const QString &) path); |
109 | setCaption(tr("AdvancedFm :: ")+fs+" :: " | 109 | setCaption(tr("AdvancedFm :: ")+fs+" :: " |
110 | +checkDiskSpace((const QString &) path)+ tr(" kB free") ); | 110 | +checkDiskSpace((const QString &) path)+ tr(" kB free") ); |
@@ -155,17 +155,17 @@ void AdvancedFm::populateView() { | |||
155 | else { //everything else goes by mimetype | 155 | else { //everything else goes by mimetype |
156 | MimeType mt(fi->filePath()); | 156 | MimeType mt(fi->filePath()); |
157 | pm=mt.pixmap(); //sets the correct pixmap for mimetype | 157 | pm=mt.pixmap(); //sets the correct pixmap for mimetype |
158 | if(pm.isNull()) { | 158 | if(pm.isNull()) { |
159 | pm = unknownXpm; | 159 | pm = unknownXpm; |
160 | } | 160 | } |
161 | } | 161 | } |
162 | if( fi->isSymLink() || fileL.find("->",0,TRUE) != -1) { | 162 | if( fi->isSymLink() || fileL.find("->",0,TRUE) != -1) { |
163 | // qDebug(" overlay link image"); | 163 | // odebug << " overlay link image" << oendl; |
164 | pm= Resource::loadPixmap( "advancedfm/symlink" ); | 164 | pm= Resource::loadPixmap( "advancedfm/symlink" ); |
165 | // pm= Resource::loadPixmap( "folder" ); | 165 | // pm= Resource::loadPixmap( "folder" ); |
166 | // QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); | 166 | // QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); |
167 | // QPainter painter( &pm ); | 167 | // QPainter painter( &pm ); |
168 | // painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); | 168 | // painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); |
169 | // pm.setMask( pm.createHeuristicMask( FALSE ) ); | 169 | // pm.setMask( pm.createHeuristicMask( FALSE ) ); |
170 | } | 170 | } |
171 | item->setPixmap( 0,pm); | 171 | item->setPixmap( 0,pm); |
@@ -179,17 +179,17 @@ void AdvancedFm::populateView() { | |||
179 | struct stat buf; | 179 | struct stat buf; |
180 | dev_t devT; | 180 | dev_t devT; |
181 | DIR *dir; | 181 | DIR *dir; |
182 | struct dirent *mydirent; | 182 | struct dirent *mydirent; |
183 | 183 | ||
184 | if((dir = opendir( path.latin1())) != NULL) | 184 | if((dir = opendir( path.latin1())) != NULL) |
185 | while ((mydirent = readdir(dir)) != NULL) { | 185 | while ((mydirent = readdir(dir)) != NULL) { |
186 | lstat( mydirent->d_name, &buf); | 186 | lstat( mydirent->d_name, &buf); |
187 | // qDebug(mydirent->d_name); | 187 | // odebug << mydirent->d_name << oendl; |
188 | fileL.sprintf("%s", mydirent->d_name); | 188 | fileL.sprintf("%s", mydirent->d_name); |
189 | devT = buf.st_dev; | 189 | devT = buf.st_dev; |
190 | fileS.sprintf("%d, %d", (int) ( devT >>8) &0xFF, (int)devT &0xFF); | 190 | fileS.sprintf("%d, %d", (int) ( devT >>8) &0xFF, (int)devT &0xFF); |
191 | fileDate.sprintf("%s", ctime( &buf.st_mtime)); | 191 | fileDate.sprintf("%s", ctime( &buf.st_mtime)); |
192 | if( fileL.find(".") == -1 ) { | 192 | if( fileL.find(".") == -1 ) { |
193 | item= new QListViewItem( thisView, fileL, fileS, fileDate); | 193 | item= new QListViewItem( thisView, fileL, fileS, fileDate); |
194 | pm = unknownXpm; | 194 | pm = unknownXpm; |
195 | item->setPixmap( 0,pm); | 195 | item->setPixmap( 0,pm); |
@@ -204,30 +204,30 @@ void AdvancedFm::populateView() { | |||
204 | } | 204 | } |
205 | 205 | ||
206 | void AdvancedFm::rePopulate() { | 206 | void AdvancedFm::rePopulate() { |
207 | populateView(); | 207 | populateView(); |
208 | setOtherTabCurrent(); | 208 | setOtherTabCurrent(); |
209 | populateView(); | 209 | populateView(); |
210 | 210 | ||
211 | // int tmpTab = whichTab; | 211 | // int tmpTab = whichTab; |
212 | // // qDebug("%d", tmpTab); | 212 | // // odebug << "" << tmpTab << "" << oendl; |
213 | 213 | ||
214 | // for(int i =1; i < 3; i++) { | 214 | // for(int i =1; i < 3; i++) { |
215 | // TabWidget->setCurrentWidget(i - 1); | 215 | // TabWidget->setCurrentWidget(i - 1); |
216 | // populateView(); | 216 | // populateView(); |
217 | // } | 217 | // } |
218 | // TabWidget->setCurrentWidget( tmpTab - 1); | 218 | // TabWidget->setCurrentWidget( tmpTab - 1); |
219 | } | 219 | } |
220 | 220 | ||
221 | void AdvancedFm::ListClicked(QListViewItem *selectedItem) { | 221 | void AdvancedFm::ListClicked(QListViewItem *selectedItem) { |
222 | //qWarning("listclicked"); | 222 | //owarn << "listclicked" << oendl; |
223 | if(selectedItem) { | 223 | if(selectedItem) { |
224 | QString strItem=selectedItem->text(0); | 224 | QString strItem=selectedItem->text(0); |
225 | // qWarning(strItem); | 225 | // owarn << strItem << oendl; |
226 | QString strSize=selectedItem->text(1); | 226 | QString strSize=selectedItem->text(1); |
227 | strSize=strSize.stripWhiteSpace(); | 227 | strSize=strSize.stripWhiteSpace(); |
228 | bool isDirectory = false; | 228 | bool isDirectory = false; |
229 | QString strItem2; | 229 | QString strItem2; |
230 | 230 | ||
231 | if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) {//if symlink | 231 | if(strItem.find("@",0,TRUE) !=-1 || strItem.find("->",0,TRUE) !=-1 ) {//if symlink |
232 | strItem2 = dealWithSymName((const QString&)strItem); | 232 | strItem2 = dealWithSymName((const QString&)strItem); |
233 | if(QDir(strItem2).exists() ) | 233 | if(QDir(strItem2).exists() ) |
@@ -262,23 +262,23 @@ void AdvancedFm::ListPressed( int mouse, QListViewItem *item, const QPoint& , in | |||
262 | case 2: | 262 | case 2: |
263 | menuTimer.start( 500, TRUE ); | 263 | menuTimer.start( 500, TRUE ); |
264 | break; | 264 | break; |
265 | }; | 265 | }; |
266 | } | 266 | } |
267 | 267 | ||
268 | 268 | ||
269 | void AdvancedFm::switchToLocalTab() { | 269 | void AdvancedFm::switchToLocalTab() { |
270 | //qWarning("switch to local view"); | 270 | //owarn << "switch to local view" << oendl; |
271 | TabWidget->setCurrentWidget(0); | 271 | TabWidget->setCurrentWidget(0); |
272 | Local_View->setFocus(); | 272 | Local_View->setFocus(); |
273 | } | 273 | } |
274 | 274 | ||
275 | void AdvancedFm::switchToRemoteTab() { | 275 | void AdvancedFm::switchToRemoteTab() { |
276 | //qWarning("switch to local view"); | 276 | //owarn << "switch to local view" << oendl; |
277 | TabWidget->setCurrentWidget(1); | 277 | TabWidget->setCurrentWidget(1); |
278 | Remote_View->setFocus(); | 278 | Remote_View->setFocus(); |
279 | } | 279 | } |
280 | 280 | ||
281 | void AdvancedFm::readConfig() { | 281 | void AdvancedFm::readConfig() { |
282 | Config cfg("AdvancedFm"); | 282 | Config cfg("AdvancedFm"); |
283 | } | 283 | } |
284 | 284 | ||
@@ -324,17 +324,17 @@ void AdvancedFm::currentPathComboActivated(const QString & currentPath) { | |||
324 | QStringList AdvancedFm::getPath() { | 324 | QStringList AdvancedFm::getPath() { |
325 | QStringList strList; | 325 | QStringList strList; |
326 | QListView *thisView=CurrentView(); | 326 | QListView *thisView=CurrentView(); |
327 | QList<QListViewItem> * getSelectedItems( QListView * thisView ); | 327 | QList<QListViewItem> * getSelectedItems( QListView * thisView ); |
328 | QListViewItemIterator it( thisView ); | 328 | QListViewItemIterator it( thisView ); |
329 | for ( ; it.current(); ++it ) { | 329 | for ( ; it.current(); ++it ) { |
330 | if ( it.current()->isSelected() ) { | 330 | if ( it.current()->isSelected() ) { |
331 | strList << it.current()->text(0); | 331 | strList << it.current()->text(0); |
332 | // qDebug(it.current()->text(0)); | 332 | // odebug << it.current()->text(0) << oendl; |
333 | } | 333 | } |
334 | } | 334 | } |
335 | return strList; | 335 | return strList; |
336 | } | 336 | } |
337 | 337 | ||
338 | void AdvancedFm::homeButtonPushed() { | 338 | void AdvancedFm::homeButtonPushed() { |
339 | QString current = QDir::homeDirPath(); | 339 | QString current = QDir::homeDirPath(); |
340 | chdir( current.latin1() ); | 340 | chdir( current.latin1() ); |
@@ -375,17 +375,17 @@ void AdvancedFm::CFButtonPushed() { | |||
375 | void AdvancedFm::doAbout() { | 375 | void AdvancedFm::doAbout() { |
376 | QMessageBox::message("AdvancedFm",tr("Advanced FileManager\n" | 376 | QMessageBox::message("AdvancedFm",tr("Advanced FileManager\n" |
377 | "is copyright 2002-2003 by\n" | 377 | "is copyright 2002-2003 by\n" |
378 | "L.J.Potter<llornkcor@handhelds.org>\n" | 378 | "L.J.Potter<llornkcor@handhelds.org>\n" |
379 | "and is licensed by the GPL")); | 379 | "and is licensed by the GPL")); |
380 | } | 380 | } |
381 | 381 | ||
382 | void AdvancedFm::keyPressEvent( QKeyEvent *e) { | 382 | void AdvancedFm::keyPressEvent( QKeyEvent *e) { |
383 | // qWarning("key %d", e->key()); | 383 | // owarn << "key " << e->key() << "" << oendl; |
384 | // if( CurrentView()->hasFocus() ) | 384 | // if( CurrentView()->hasFocus() ) |
385 | { | 385 | { |
386 | switch ( e->key() ) { | 386 | switch ( e->key() ) { |
387 | case Key_Left: | 387 | case Key_Left: |
388 | upDir(); | 388 | upDir(); |
389 | break; | 389 | break; |
390 | case Key_Next: | 390 | case Key_Next: |
391 | break; | 391 | break; |
@@ -633,17 +633,17 @@ QString AdvancedFm::checkDiskSpace(const QString &path) { | |||
633 | void AdvancedFm::addToDocs() { | 633 | void AdvancedFm::addToDocs() { |
634 | QStringList strListPaths = getPath(); | 634 | QStringList strListPaths = getPath(); |
635 | QDir *thisDir = CurrentDir(); | 635 | QDir *thisDir = CurrentDir(); |
636 | 636 | ||
637 | if( strListPaths.count() > 0) { | 637 | if( strListPaths.count() > 0) { |
638 | QString curFile; | 638 | QString curFile; |
639 | for ( QStringList::Iterator it = strListPaths.begin(); it != strListPaths.end(); ++it ) { | 639 | for ( QStringList::Iterator it = strListPaths.begin(); it != strListPaths.end(); ++it ) { |
640 | curFile = thisDir->canonicalPath()+"/"+(*it); | 640 | curFile = thisDir->canonicalPath()+"/"+(*it); |
641 | // qDebug(curFile); | 641 | // odebug << curFile << oendl; |
642 | QFileInfo fi(curFile); | 642 | QFileInfo fi(curFile); |
643 | DocLnk f; | 643 | DocLnk f; |
644 | // curFile.replace(QRegExp("\\..*"),""); | 644 | // curFile.replace(QRegExp("\\..*"),""); |
645 | f.setName(fi.baseName() ); | 645 | f.setName(fi.baseName() ); |
646 | f.setFile( curFile); | 646 | f.setFile( curFile); |
647 | f.writeLink(); | 647 | f.writeLink(); |
648 | } | 648 | } |
649 | } | 649 | } |
@@ -706,17 +706,17 @@ void AdvancedFm::addCustomDir() { | |||
706 | list << dir; | 706 | list << dir; |
707 | } | 707 | } |
708 | 708 | ||
709 | cfg.writeEntry("CustomDir", list, ','); | 709 | cfg.writeEntry("CustomDir", list, ','); |
710 | cfg.write(); | 710 | cfg.write(); |
711 | } | 711 | } |
712 | 712 | ||
713 | void AdvancedFm::removeCustomDir() { | 713 | void AdvancedFm::removeCustomDir() { |
714 | // qDebug("remove custom dir"); | 714 | // odebug << "remove custom dir" << oendl; |
715 | Config cfg("AdvancedFm"); | 715 | Config cfg("AdvancedFm"); |
716 | cfg.setGroup("Menu"); | 716 | cfg.setGroup("Menu"); |
717 | QString dir; | 717 | QString dir; |
718 | QStringList list = cfg.readListEntry( (const QString &)"CustomDir", (const QChar)','); | 718 | QStringList list = cfg.readListEntry( (const QString &)"CustomDir", (const QChar)','); |
719 | QStringList list2; | 719 | QStringList list2; |
720 | dir = CurrentDir()->canonicalPath(); | 720 | dir = CurrentDir()->canonicalPath(); |
721 | int ramble=2; | 721 | int ramble=2; |
722 | // int ramble=-24; | 722 | // int ramble=-24; |
@@ -741,17 +741,17 @@ void AdvancedFm::removeCustomDir() { | |||
741 | cfg.writeEntry("CustomDir", list2, ','); | 741 | cfg.writeEntry("CustomDir", list2, ','); |
742 | cfg.write(); | 742 | cfg.write(); |
743 | } | 743 | } |
744 | // customDirsToMenu(); | 744 | // customDirsToMenu(); |
745 | 745 | ||
746 | } | 746 | } |
747 | 747 | ||
748 | void AdvancedFm::gotoCustomDir(const QString &dir) { | 748 | void AdvancedFm::gotoCustomDir(const QString &dir) { |
749 | // qDebug("gotoCustomDir(const QString &dir) " +dir ); | 749 | // odebug << "gotoCustomDir(const QString &dir) " +dir << oendl; |
750 | // QString curDir = dir; | 750 | // QString curDir = dir; |
751 | // QDir *thisDir = CurrentDir(); | 751 | // QDir *thisDir = CurrentDir(); |
752 | // if( curDir.isEmpty()) { | 752 | // if( curDir.isEmpty()) { |
753 | // } | 753 | // } |
754 | if( dir == s_addBookmark) { | 754 | if( dir == s_addBookmark) { |
755 | addCustomDir(); | 755 | addCustomDir(); |
756 | } | 756 | } |
757 | if( dir == s_removeBookmark) { | 757 | if( dir == s_removeBookmark) { |
@@ -782,60 +782,60 @@ QDir *AdvancedFm::OtherDir() { | |||
782 | return ¤tRemoteDir; | 782 | return ¤tRemoteDir; |
783 | } else { | 783 | } else { |
784 | return ¤tDir; | 784 | return ¤tDir; |
785 | } | 785 | } |
786 | } | 786 | } |
787 | 787 | ||
788 | QListView * AdvancedFm::CurrentView() { | 788 | QListView * AdvancedFm::CurrentView() { |
789 | if ( whichTab == 1) { | 789 | if ( whichTab == 1) { |
790 | // qWarning("CurrentView Tab 1"); | 790 | // owarn << "CurrentView Tab 1" << oendl; |
791 | return Local_View; | 791 | return Local_View; |
792 | } else { | 792 | } else { |
793 | // qWarning("CurrentView Tab 2"); | 793 | // owarn << "CurrentView Tab 2" << oendl; |
794 | return Remote_View; | 794 | return Remote_View; |
795 | } | 795 | } |
796 | } | 796 | } |
797 | 797 | ||
798 | QListView * AdvancedFm::OtherView() { | 798 | QListView * AdvancedFm::OtherView() { |
799 | if ( whichTab == 1) | 799 | if ( whichTab == 1) |
800 | return Remote_View; | 800 | return Remote_View; |
801 | else | 801 | else |
802 | return Local_View; | 802 | return Local_View; |
803 | } | 803 | } |
804 | 804 | ||
805 | void AdvancedFm::setOtherTabCurrent() { | 805 | void AdvancedFm::setOtherTabCurrent() { |
806 | // qWarning("setOtherTabCurrent() %d", whichTab); | 806 | // owarn << "setOtherTabCurrent() " << whichTab << "" << oendl; |
807 | if ( whichTab == 1) { | 807 | if ( whichTab == 1) { |
808 | TabWidget->setCurrentWidget(1); | 808 | TabWidget->setCurrentWidget(1); |
809 | } else { | 809 | } else { |
810 | TabWidget->setCurrentWidget(0); | 810 | TabWidget->setCurrentWidget(0); |
811 | } | 811 | } |
812 | OtherView()->setFocus(); | 812 | OtherView()->setFocus(); |
813 | OtherView()->setSelected( CurrentView()->firstChild(), true); | 813 | OtherView()->setSelected( CurrentView()->firstChild(), true); |
814 | } | 814 | } |
815 | 815 | ||
816 | void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) { | 816 | void AdvancedFm::qcopReceive(const QCString &msg, const QByteArray &data) { |
817 | // qDebug("qcop message "+msg ); | 817 | // odebug << "qcop message "+msg << oendl; |
818 | QDataStream stream ( data, IO_ReadOnly ); | 818 | QDataStream stream ( data, IO_ReadOnly ); |
819 | if ( msg == "openDirectory(QString)" ) { | 819 | if ( msg == "openDirectory(QString)" ) { |
820 | // qDebug("received"); | 820 | // odebug << "received" << oendl; |
821 | QString file; | 821 | QString file; |
822 | stream >> file; | 822 | stream >> file; |
823 | gotoDirectory( (const QString &) file); | 823 | gotoDirectory( (const QString &) file); |
824 | } | 824 | } |
825 | } | 825 | } |
826 | 826 | ||
827 | void AdvancedFm::setDocument(const QString &file) { | 827 | void AdvancedFm::setDocument(const QString &file) { |
828 | gotoDirectory( file); | 828 | gotoDirectory( file); |
829 | 829 | ||
830 | } | 830 | } |
831 | 831 | ||
832 | void AdvancedFm::gotoDirectory(const QString &file) { | 832 | void AdvancedFm::gotoDirectory(const QString &file) { |
833 | // qWarning("goto dir "+file); | 833 | // owarn << "goto dir "+file << oendl; |
834 | QString curDir = file; | 834 | QString curDir = file; |
835 | QDir *thisDir = CurrentDir(); | 835 | QDir *thisDir = CurrentDir(); |
836 | if(QDir( curDir).exists() ) { | 836 | if(QDir( curDir).exists() ) { |
837 | thisDir->setPath( curDir ); | 837 | thisDir->setPath( curDir ); |
838 | chdir( curDir.latin1() ); | 838 | chdir( curDir.latin1() ); |
839 | thisDir->cd( curDir, TRUE); | 839 | thisDir->cd( curDir, TRUE); |
840 | populateView(); | 840 | populateView(); |
841 | } | 841 | } |
@@ -861,17 +861,17 @@ void AdvancedFm::findFile(const QString &fileName) { | |||
861 | if(it.current()->text(0) == fi.fileName()) { | 861 | if(it.current()->text(0) == fi.fileName()) { |
862 | it.current()->setSelected(true); | 862 | it.current()->setSelected(true); |
863 | thisView->ensureItemVisible(it.current()); | 863 | thisView->ensureItemVisible(it.current()); |
864 | } | 864 | } |
865 | } | 865 | } |
866 | } | 866 | } |
867 | 867 | ||
868 | void AdvancedFm::slotSwitchMenu(int ) { | 868 | void AdvancedFm::slotSwitchMenu(int ) { |
869 | // qDebug("Switch %d", item); | 869 | // odebug << "Switch " << item << "" << oendl; |
870 | // viewMenu->setItemChecked(item, true); | 870 | // viewMenu->setItemChecked(item, true); |
871 | } | 871 | } |
872 | 872 | ||
873 | void AdvancedFm::dealWithSchmooSchmaa(QWidget *w) { | 873 | void AdvancedFm::dealWithSchmooSchmaa(QWidget *w) { |
874 | tabChanged( w); | 874 | tabChanged( w); |
875 | if( w == Local_View) { | 875 | if( w == Local_View) { |
876 | Remote_View->clearFocus(); | 876 | Remote_View->clearFocus(); |
877 | } else { | 877 | } else { |
diff --git a/noncore/apps/advancedfm/advancedfm.pro b/noncore/apps/advancedfm/advancedfm.pro index 716343d..f1c518e 100644 --- a/noncore/apps/advancedfm/advancedfm.pro +++ b/noncore/apps/advancedfm/advancedfm.pro | |||
@@ -1,35 +1,15 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | CONFIG += qt warn_on quick-app | 2 | CONFIG += qt warn_on quick-app |
3 | # CONFIG += qt warn_on | ||
4 | HEADERS = advancedfm.h filePermissions.h output.h | 3 | HEADERS = advancedfm.h filePermissions.h output.h |
5 | SOURCES = advancedfm.cpp advancedfmData.cpp advancedfmMenu.cpp filePermissions.cpp output.cpp main.cpp | 4 | SOURCES = advancedfm.cpp advancedfmData.cpp advancedfmMenu.cpp filePermissions.cpp output.cpp main.cpp |
6 | TARGET = advancedfm | 5 | TARGET = advancedfm |
7 | INCLUDEPATH += $(OPIEDIR)/include | 6 | INCLUDEPATH += $(OPIEDIR)/include |
8 | DEPENDPATH += $(OPIEDIR)/include | 7 | DEPENDPATH += $(OPIEDIR)/include |
9 | LIBS += -lqpe -lopiecore2 -lopieui2 | 8 | LIBS += -lqpe -lopiecore2 -lopieui2 |
10 | 9 | ||
11 | TRANSLATIONS = ../../../i18n/de/advancedfm.ts \ | ||
12 | ../../../i18n/nl/advancedfm.ts \ | ||
13 | ../../../i18n/da/advancedfm.ts \ | ||
14 | ../../../i18n/xx/advancedfm.ts \ | ||
15 | ../../../i18n/en/advancedfm.ts \ | ||
16 | ../../../i18n/es/advancedfm.ts \ | ||
17 | ../../../i18n/fr/advancedfm.ts \ | ||
18 | ../../../i18n/hu/advancedfm.ts \ | ||
19 | ../../../i18n/ja/advancedfm.ts \ | ||
20 | ../../../i18n/ko/advancedfm.ts \ | ||
21 | ../../../i18n/no/advancedfm.ts \ | ||
22 | ../../../i18n/pl/advancedfm.ts \ | ||
23 | ../../../i18n/pt/advancedfm.ts \ | ||
24 | ../../../i18n/pt_BR/advancedfm.ts \ | ||
25 | ../../../i18n/sl/advancedfm.ts \ | ||
26 | ../../../i18n/zh_CN/advancedfm.ts \ | ||
27 | ../../../i18n/zh_TW/advancedfm.ts | ||
28 | |||
29 | |||
30 | !contains(CONFIG,quick-app) { | 10 | !contains(CONFIG,quick-app) { |
31 | DESTDIR = $(OPIEDIR)/bin | 11 | DESTDIR = $(OPIEDIR)/bin |
32 | DEFINES += NOQUICKLAUNCH | 12 | DEFINES += NOQUICKLAUNCH |
33 | } | 13 | } |
34 | 14 | ||
35 | include ( $(OPIEDIR)/include.pro ) | 15 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp index 2997c55..29335f8 100644 --- a/noncore/apps/advancedfm/advancedfmData.cpp +++ b/noncore/apps/advancedfm/advancedfmData.cpp | |||
@@ -6,33 +6,37 @@ | |||
6 | email : ljp@llornkcor.com | 6 | email : ljp@llornkcor.com |
7 | * This program is free software; you can redistribute it and/or modify * | 7 | * This program is free software; you can redistribute it and/or modify * |
8 | * it under the terms of the GNU General Public License as published by * | 8 | * it under the terms of the GNU General Public License as published by * |
9 | * the Free Software Foundation; either version 2 of the License, or * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | ***************************************************************************/ | 11 | ***************************************************************************/ |
12 | #include "advancedfm.h" | 12 | #include "advancedfm.h" |
13 | 13 | ||
14 | /* OPIE */ | ||
15 | #include <opie2/odebug.h> | ||
14 | #include <qpe/storage.h> | 16 | #include <qpe/storage.h> |
15 | #include <qpe/qpeapplication.h> | 17 | #include <qpe/qpeapplication.h> |
16 | #include <qpe/resource.h> | 18 | #include <qpe/resource.h> |
17 | #include <qpe/menubutton.h> | 19 | #include <qpe/menubutton.h> |
20 | using namespace Opie::Core; | ||
21 | using namespace Opie::Ui; | ||
18 | 22 | ||
23 | /* QT */ | ||
19 | #include <qlayout.h> | 24 | #include <qlayout.h> |
20 | #include <qhbox.h> | 25 | #include <qhbox.h> |
21 | #include <qmenubar.h> | 26 | #include <qmenubar.h> |
22 | #include <qcombobox.h> | 27 | #include <qcombobox.h> |
23 | #include <qtoolbutton.h> | 28 | #include <qtoolbutton.h> |
24 | #include <qlineedit.h> | 29 | #include <qlineedit.h> |
25 | #include <qlistview.h> | 30 | #include <qlistview.h> |
26 | 31 | ||
32 | /* STD */ | ||
27 | #include <sys/utsname.h> | 33 | #include <sys/utsname.h> |
28 | 34 | ||
29 | |||
30 | using namespace Opie::Ui; | ||
31 | void AdvancedFm::init() { | 35 | void AdvancedFm::init() { |
32 | b = false; | 36 | b = false; |
33 | setCaption( tr( "AdvancedFm" ) ); | 37 | setCaption( tr( "AdvancedFm" ) ); |
34 | 38 | ||
35 | QVBoxLayout *layout = new QVBoxLayout( this ); | 39 | QVBoxLayout *layout = new QVBoxLayout( this ); |
36 | layout->setSpacing( 2); | 40 | layout->setSpacing( 2); |
37 | layout->setMargin( 0); // squeeze | 41 | layout->setMargin( 0); // squeeze |
38 | 42 | ||
@@ -214,21 +218,21 @@ void AdvancedFm::init() { | |||
214 | 218 | ||
215 | if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) | 219 | if ( QFile::exists ( "/dev/sharp_buz" ) || QFile::exists ( "/dev/sharp_led" )) |
216 | zaurusDevice=TRUE; | 220 | zaurusDevice=TRUE; |
217 | else | 221 | else |
218 | zaurusDevice=FALSE; | 222 | zaurusDevice=FALSE; |
219 | 223 | ||
220 | 224 | ||
221 | if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) { | 225 | if( !StorageInfo::hasSd() || !StorageInfo::hasMmc()) { |
222 | qDebug("not have sd"); | 226 | odebug << "not have sd" << oendl; |
223 | sdButton->hide(); | 227 | sdButton->hide(); |
224 | } | 228 | } |
225 | if( !StorageInfo::hasCf() ) { | 229 | if( !StorageInfo::hasCf() ) { |
226 | qDebug("not have cf"); | 230 | odebug << "not have cf" << oendl; |
227 | cfButton->hide(); | 231 | cfButton->hide(); |
228 | } | 232 | } |
229 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 233 | currentDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
230 | currentDir.setPath( QDir::currentDirPath()); | 234 | currentDir.setPath( QDir::currentDirPath()); |
231 | 235 | ||
232 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 236 | currentRemoteDir.setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
233 | currentRemoteDir.setPath( QDir::currentDirPath()); | 237 | currentRemoteDir.setPath( QDir::currentDirPath()); |
234 | 238 | ||
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp index 81a4318..d34f330 100644 --- a/noncore/apps/advancedfm/advancedfmMenu.cpp +++ b/noncore/apps/advancedfm/advancedfmMenu.cpp | |||
@@ -4,49 +4,52 @@ | |||
4 | ** Created: Sat Mar 9 23:33:09 2002 | 4 | ** Created: Sat Mar 9 23:33:09 2002 |
5 | copyright : (C) 2002 by ljp | 5 | copyright : (C) 2002 by ljp |
6 | email : ljp@llornkcor.com | 6 | email : ljp@llornkcor.com |
7 | * This program is free software; you can redistribute it and/or modify * | 7 | * This program is free software; you can redistribute it and/or modify * |
8 | * it under the terms of the GNU General Public License as published by * | 8 | * it under the terms of the GNU General Public License as published by * |
9 | * the Free Software Foundation; either version 2 of the License, or * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | ***************************************************************************/ | 11 | ***************************************************************************/ |
12 | |||
12 | #include "advancedfm.h" | 13 | #include "advancedfm.h" |
13 | #include "output.h" | 14 | #include "output.h" |
14 | #include "filePermissions.h" | 15 | #include "filePermissions.h" |
15 | 16 | ||
17 | /* OPIE */ | ||
18 | #include <opie2/odebug.h> | ||
16 | #include <qpe/lnkproperties.h> | 19 | #include <qpe/lnkproperties.h> |
17 | #include <qpe/qpeapplication.h> | 20 | #include <qpe/qpeapplication.h> |
18 | #include <qpe/applnk.h> | 21 | #include <qpe/applnk.h> |
22 | using namespace Opie::Core; | ||
19 | 23 | ||
20 | #include <qmessagebox.h> | 24 | /* QT*/ |
21 | |||
22 | 25 | ||
26 | #include <qmessagebox.h> | ||
23 | #include <qpopupmenu.h> | 27 | #include <qpopupmenu.h> |
24 | #include <qlistview.h> | 28 | #include <qlistview.h> |
25 | 29 | ||
30 | /* STD */ | ||
31 | |||
26 | #include <errno.h> | 32 | #include <errno.h> |
27 | #include <stdlib.h> | 33 | #include <stdlib.h> |
28 | #include <unistd.h> | 34 | #include <unistd.h> |
29 | #include <sys/stat.h> | 35 | #include <sys/stat.h> |
30 | #include <dirent.h> | 36 | #include <dirent.h> |
31 | #include <sys/sendfile.h> | 37 | #include <sys/sendfile.h> |
32 | #include <fcntl.h> | 38 | #include <fcntl.h> |
33 | 39 | ||
34 | |||
35 | using namespace Opie::Core; | ||
36 | using namespace Opie::Core; | ||
37 | void AdvancedFm::doDirChange() { | 40 | void AdvancedFm::doDirChange() { |
38 | QString pathItem = CurrentView()->currentItem()->text(0); | 41 | QString pathItem = CurrentView()->currentItem()->text(0); |
39 | if( pathItem == "../") { | 42 | if( pathItem == "../") { |
40 | ListClicked( CurrentView()->currentItem()); | 43 | ListClicked( CurrentView()->currentItem()); |
41 | } else { | 44 | } else { |
42 | if( pathItem.find(" -> ",0,TRUE) != -1) | 45 | if( pathItem.find(" -> ",0,TRUE) != -1) |
43 | pathItem = dealWithSymName((const QString&)pathItem)+"/"; | 46 | pathItem = dealWithSymName((const QString&)pathItem)+"/"; |
44 | // qWarning(pathItem); | 47 | // owarn << pathItem << oendl; |
45 | gotoDirectory( CurrentDir()->path()+"/"+pathItem.left( pathItem.length() - 1) ); | 48 | gotoDirectory( CurrentDir()->path()+"/"+pathItem.left( pathItem.length() - 1) ); |
46 | } | 49 | } |
47 | } | 50 | } |
48 | 51 | ||
49 | void AdvancedFm::showMenuHidden() { | 52 | void AdvancedFm::showMenuHidden() { |
50 | if (b) { | 53 | if (b) { |
51 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 54 | CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
52 | OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); | 55 | OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); |
@@ -87,29 +90,29 @@ void AdvancedFm::runThis() { | |||
87 | if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink | 90 | if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink |
88 | 91 | ||
89 | curFile = dealWithSymName((const QString&)curFile); | 92 | curFile = dealWithSymName((const QString&)curFile); |
90 | 93 | ||
91 | if(curFile != "../") { | 94 | if(curFile != "../") { |
92 | 95 | ||
93 | fs = getFileSystemType((const QString &) path); | 96 | fs = getFileSystemType((const QString &) path); |
94 | QFileInfo fileInfo( path + "/" + curFile); | 97 | QFileInfo fileInfo( path + "/" + curFile); |
95 | // qDebug( fileInfo.owner()); | 98 | // odebug << fileInfo.owner() << oendl; |
96 | 99 | ||
97 | if( (fileInfo.permission( QFileInfo::ExeUser) | 100 | if( (fileInfo.permission( QFileInfo::ExeUser) |
98 | | fileInfo.permission( QFileInfo::ExeGroup) | 101 | | fileInfo.permission( QFileInfo::ExeGroup) |
99 | | fileInfo.permission( QFileInfo::ExeOther)) // & fs.find("vfat",0,TRUE) == -1) { | 102 | | fileInfo.permission( QFileInfo::ExeOther)) // & fs.find("vfat",0,TRUE) == -1) { |
100 | | fs == "vfat" && fileInfo.filePath().contains("/bin") ) { | 103 | | fs == "vfat" && fileInfo.filePath().contains("/bin") ) { |
101 | QCopEnvelope e("QPE/System", "execute(QString)" ); | 104 | QCopEnvelope e("QPE/System", "execute(QString)" ); |
102 | e << curFile; | 105 | e << curFile; |
103 | } else { | 106 | } else { |
104 | curFile = path + "/" + curFile; | 107 | curFile = path + "/" + curFile; |
105 | DocLnk nf(curFile); | 108 | DocLnk nf(curFile); |
106 | QString execStr = nf.exec(); | 109 | QString execStr = nf.exec(); |
107 | // qDebug( execStr); | 110 | // odebug << execStr << oendl; |
108 | if( execStr.isEmpty() ) { | 111 | if( execStr.isEmpty() ) { |
109 | } else { | 112 | } else { |
110 | nf.execute(); | 113 | nf.execute(); |
111 | } | 114 | } |
112 | } | 115 | } |
113 | } | 116 | } |
114 | } | 117 | } |
115 | 118 | ||
@@ -197,22 +200,22 @@ void AdvancedFm::doDelete() { | |||
197 | break; | 200 | break; |
198 | }; | 201 | }; |
199 | } | 202 | } |
200 | 203 | ||
201 | QString cmd="rm "+f; | 204 | QString cmd="rm "+f; |
202 | QFile file(f); | 205 | QFile file(f); |
203 | QFileInfo fi(myFile); | 206 | QFileInfo fi(myFile); |
204 | if( fi.fileName().find("../",0,TRUE)==-1) { | 207 | if( fi.fileName().find("../",0,TRUE)==-1) { |
205 | // qDebug("remove link files "+myFile); | 208 | // odebug << "remove link files "+myFile << oendl; |
206 | 209 | ||
207 | // DocLnk lnk(f); | 210 | // DocLnk lnk(f); |
208 | DocLnk *lnk; | 211 | DocLnk *lnk; |
209 | lnk = new DocLnk(f); | 212 | lnk = new DocLnk(f); |
210 | // qDebug("Deleting doclnk " + lnk->linkFile()); | 213 | // odebug << "Deleting doclnk " + lnk->linkFile() << oendl; |
211 | if(lnk->isValid()) | 214 | if(lnk->isValid()) |
212 | lnk->removeLinkFile(); | 215 | lnk->removeLinkFile(); |
213 | // delete lnk; | 216 | // delete lnk; |
214 | file.remove(); | 217 | file.remove(); |
215 | } | 218 | } |
216 | } | 219 | } |
217 | } | 220 | } |
218 | } | 221 | } |
@@ -238,20 +241,20 @@ void AdvancedFm::filePerms() { | |||
238 | void AdvancedFm::doProperties() { | 241 | void AdvancedFm::doProperties() { |
239 | #if defined(QT_QWS_OPIE) | 242 | #if defined(QT_QWS_OPIE) |
240 | 243 | ||
241 | QStringList curFileList = getPath(); | 244 | QStringList curFileList = getPath(); |
242 | 245 | ||
243 | QString filePath; | 246 | QString filePath; |
244 | filePath = CurrentDir()->canonicalPath()+"/"; | 247 | filePath = CurrentDir()->canonicalPath()+"/"; |
245 | 248 | ||
246 | // qDebug("%d",curFileList.count()); | 249 | // odebug << "" << curFileList.count() << "" << oendl; |
247 | 250 | ||
248 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 251 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
249 | // qDebug((filePath+*it)); | 252 | // odebug << (filePath+*it) << oendl; |
250 | DocLnk lnk( (filePath+*it)); | 253 | DocLnk lnk( (filePath+*it)); |
251 | LnkProperties prop( &lnk ); | 254 | LnkProperties prop( &lnk ); |
252 | QPEApplication::execDialog( &prop ); | 255 | QPEApplication::execDialog( &prop ); |
253 | } | 256 | } |
254 | #endif | 257 | #endif |
255 | 258 | ||
256 | } | 259 | } |
257 | 260 | ||
@@ -297,18 +300,18 @@ void AdvancedFm::copy() { | |||
297 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 300 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
298 | item=(*it); | 301 | item=(*it); |
299 | if(item.find("->",0,TRUE)) //symlink | 302 | if(item.find("->",0,TRUE)) //symlink |
300 | item = item.left(item.find("->",0,TRUE)); | 303 | item = item.left(item.find("->",0,TRUE)); |
301 | 304 | ||
302 | curFile = thisDir->canonicalPath()+"/"+ item; | 305 | curFile = thisDir->canonicalPath()+"/"+ item; |
303 | destFile = thatDir->canonicalPath()+"/"+ item; | 306 | destFile = thatDir->canonicalPath()+"/"+ item; |
304 | 307 | ||
305 | // qDebug("Destination file is "+destFile); | 308 | // odebug << "Destination file is "+destFile << oendl; |
306 | // qDebug("CurrentFile file is " + curFile); | 309 | // odebug << "CurrentFile file is " + curFile << oendl; |
307 | 310 | ||
308 | QFile f(destFile); | 311 | QFile f(destFile); |
309 | if( f.exists()) { | 312 | if( f.exists()) { |
310 | if(doMsg) { | 313 | if(doMsg) { |
311 | switch ( QMessageBox::warning(this,tr("File Exists!"), | 314 | switch ( QMessageBox::warning(this,tr("File Exists!"), |
312 | tr("%1 exists. Ok to overwrite?").arg( item ), | 315 | tr("%1 exists. Ok to overwrite?").arg( item ), |
313 | tr("Yes"),tr("No"),0,0,1) ) { | 316 | tr("Yes"),tr("No"),0,0,1) ) { |
314 | case 1: | 317 | case 1: |
@@ -415,17 +418,17 @@ void AdvancedFm::copySameDir() { | |||
415 | }; | 418 | }; |
416 | } | 419 | } |
417 | if(!copyFile( curFile,destFile) ) { | 420 | if(!copyFile( curFile,destFile) ) { |
418 | QMessageBox::message("AdvancedFm",tr("Could not copy\n") | 421 | QMessageBox::message("AdvancedFm",tr("Could not copy\n") |
419 | +curFile +tr("to\n")+destFile); | 422 | +curFile +tr("to\n")+destFile); |
420 | return; | 423 | return; |
421 | } | 424 | } |
422 | 425 | ||
423 | // qDebug("copy "+curFile+" as "+destFile); | 426 | // odebug << "copy "+curFile+" as "+destFile << oendl; |
424 | } | 427 | } |
425 | delete fileDlg; | 428 | delete fileDlg; |
426 | } | 429 | } |
427 | rePopulate(); | 430 | rePopulate(); |
428 | } | 431 | } |
429 | 432 | ||
430 | void AdvancedFm::move() { | 433 | void AdvancedFm::move() { |
431 | qApp->processEvents(); | 434 | qApp->processEvents(); |
@@ -438,23 +441,23 @@ void AdvancedFm::move() { | |||
438 | QDir *thatDir = OtherDir(); | 441 | QDir *thatDir = OtherDir(); |
439 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { | 442 | for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { |
440 | item=(*it); | 443 | item=(*it); |
441 | QString destFile = thatDir->canonicalPath(); | 444 | QString destFile = thatDir->canonicalPath(); |
442 | 445 | ||
443 | if(destFile.right(1).find("/",0,TRUE) == -1) | 446 | if(destFile.right(1).find("/",0,TRUE) == -1) |
444 | destFile+="/"; | 447 | destFile+="/"; |
445 | destFile += item; | 448 | destFile += item; |
446 | // qDebug("Destination file is "+destFile); | 449 | // odebug << "Destination file is "+destFile << oendl; |
447 | 450 | ||
448 | curFile = thisDir->canonicalPath(); | 451 | curFile = thisDir->canonicalPath(); |
449 | if(curFile.right(1).find("/",0,TRUE) == -1) | 452 | if(curFile.right(1).find("/",0,TRUE) == -1) |
450 | curFile +="/"; | 453 | curFile +="/"; |
451 | curFile+= item; | 454 | curFile+= item; |
452 | // qDebug("CurrentFile file is " + curFile); | 455 | // odebug << "CurrentFile file is " + curFile << oendl; |
453 | 456 | ||
454 | if(QFileInfo(curFile).isDir()) { | 457 | if(QFileInfo(curFile).isDir()) { |
455 | moveDirectory( curFile, destFile ); | 458 | moveDirectory( curFile, destFile ); |
456 | rePopulate(); | 459 | rePopulate(); |
457 | return; | 460 | return; |
458 | } | 461 | } |
459 | 462 | ||
460 | QFile f( curFile); | 463 | QFile f( curFile); |
@@ -484,17 +487,17 @@ bool AdvancedFm::moveDirectory( const QString & src, const QString & dest ) { | |||
484 | return false; | 487 | return false; |
485 | } | 488 | } |
486 | return true; | 489 | return true; |
487 | } | 490 | } |
488 | 491 | ||
489 | bool AdvancedFm::copyDirectory( const QString & src, const QString & dest ) { | 492 | bool AdvancedFm::copyDirectory( const QString & src, const QString & dest ) { |
490 | 493 | ||
491 | QString cmd = "/bin/cp -fpR " + src + " " + dest; | 494 | QString cmd = "/bin/cp -fpR " + src + " " + dest; |
492 | qWarning(cmd); | 495 | owarn << cmd << oendl; |
493 | int err = system( (const char *) cmd ); | 496 | int err = system( (const char *) cmd ); |
494 | if ( err != 0 ) { | 497 | if ( err != 0 ) { |
495 | QMessageBox::message("AdvancedFm", | 498 | QMessageBox::message("AdvancedFm", |
496 | tr( "Could not copy \n%1 \nto \n%2").arg( src ).arg( dest ) ); | 499 | tr( "Could not copy \n%1 \nto \n%2").arg( src ).arg( dest ) ); |
497 | return false; | 500 | return false; |
498 | } | 501 | } |
499 | 502 | ||
500 | return true; | 503 | return true; |
@@ -520,39 +523,39 @@ bool AdvancedFm::copyFile( const QString & src, const QString & dest ) { | |||
520 | QFile srcFile(src); | 523 | QFile srcFile(src); |
521 | QFile destFile(dest); | 524 | QFile destFile(dest); |
522 | int err=0; | 525 | int err=0; |
523 | int read_fd=0; | 526 | int read_fd=0; |
524 | int write_fd=0; | 527 | int write_fd=0; |
525 | struct stat stat_buf; | 528 | struct stat stat_buf; |
526 | off_t offset = 0; | 529 | off_t offset = 0; |
527 | if(!srcFile.open( IO_ReadOnly|IO_Raw)) { | 530 | if(!srcFile.open( IO_ReadOnly|IO_Raw)) { |
528 | // qWarning("open failed"); | 531 | // owarn << "open failed" << oendl; |
529 | return success = false; | 532 | return success = false; |
530 | } | 533 | } |
531 | read_fd = srcFile.handle(); | 534 | read_fd = srcFile.handle(); |
532 | if(read_fd != -1) { | 535 | if(read_fd != -1) { |
533 | fstat (read_fd, &stat_buf); | 536 | fstat (read_fd, &stat_buf); |
534 | if( !destFile.open( IO_WriteOnly|IO_Raw ) ) { | 537 | if( !destFile.open( IO_WriteOnly|IO_Raw ) ) { |
535 | // qWarning("destfile open failed"); | 538 | // owarn << "destfile open failed" << oendl; |
536 | return success = false; | 539 | return success = false; |
537 | } | 540 | } |
538 | write_fd = destFile.handle(); | 541 | write_fd = destFile.handle(); |
539 | if(write_fd != -1) { | 542 | if(write_fd != -1) { |
540 | err = sendfile(write_fd, read_fd, &offset, stat_buf.st_size); | 543 | err = sendfile(write_fd, read_fd, &offset, stat_buf.st_size); |
541 | if( err == -1) { | 544 | if( err == -1) { |
542 | QString msg; | 545 | QString msg; |
543 | switch(err) { | 546 | switch(err) { |
544 | case EBADF : msg = "The input file was not opened for reading or the output file was not opened for writing. "; | 547 | case EBADF : msg = "The input file was not opened for reading or the output file was not opened for writing. "; |
545 | case EINVAL: msg = "Descriptor is not valid or locked. "; | 548 | case EINVAL: msg = "Descriptor is not valid or locked. "; |
546 | case ENOMEM: msg = "Insufficient memory to read from in_fd."; | 549 | case ENOMEM: msg = "Insufficient memory to read from in_fd."; |
547 | case EIO: msg = "Unspecified error while reading from in_fd."; | 550 | case EIO: msg = "Unspecified error while reading from in_fd."; |
548 | }; | 551 | }; |
549 | success = false; | 552 | success = false; |
550 | // qWarning(msg); | 553 | // owarn << msg << oendl; |
551 | } | 554 | } |
552 | } else { | 555 | } else { |
553 | success = false; | 556 | success = false; |
554 | } | 557 | } |
555 | } else { | 558 | } else { |
556 | success = false; | 559 | success = false; |
557 | } | 560 | } |
558 | srcFile.close(); | 561 | srcFile.close(); |
@@ -574,17 +577,17 @@ void AdvancedFm::runCommand() { | |||
574 | 577 | ||
575 | InputDialog *fileDlg; | 578 | InputDialog *fileDlg; |
576 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); | 579 | fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); |
577 | fileDlg->setInputText(curFile); | 580 | fileDlg->setInputText(curFile); |
578 | fileDlg->exec(); | 581 | fileDlg->exec(); |
579 | //QString command; | 582 | //QString command; |
580 | 583 | ||
581 | if( fileDlg->result() == 1 ) { | 584 | if( fileDlg->result() == 1 ) { |
582 | // qDebug(fileDlg->LineEdit1->text()); | 585 | // odebug << fileDlg->LineEdit1->text() << oendl; |
583 | QStringList command; | 586 | QStringList command; |
584 | 587 | ||
585 | command << "/bin/sh"; | 588 | command << "/bin/sh"; |
586 | command << "-c"; | 589 | command << "-c"; |
587 | command << fileDlg->LineEdit1->text(); | 590 | command << fileDlg->LineEdit1->text(); |
588 | Output *outDlg; | 591 | Output *outDlg; |
589 | outDlg = new Output( command, this, tr("AdvancedFm Output"), true); | 592 | outDlg = new Output( command, this, tr("AdvancedFm Output"), true); |
590 | QPEApplication::execDialog( outDlg ); | 593 | QPEApplication::execDialog( outDlg ); |
@@ -657,17 +660,17 @@ void AdvancedFm::mkSym() { | |||
657 | 660 | ||
658 | QString curFile = thisDir->canonicalPath()+"/"+(*it); | 661 | QString curFile = thisDir->canonicalPath()+"/"+(*it); |
659 | 662 | ||
660 | if( curFile.right(1) == "/") { | 663 | if( curFile.right(1) == "/") { |
661 | curFile = curFile.left( curFile.length() -1); | 664 | curFile = curFile.left( curFile.length() -1); |
662 | } | 665 | } |
663 | 666 | ||
664 | cmd = "ln -s "+curFile+" "+destName; | 667 | cmd = "ln -s "+curFile+" "+destName; |
665 | // qDebug(cmd); | 668 | // odebug << cmd << oendl; |
666 | startProcess( (const QString)cmd ); | 669 | startProcess( (const QString)cmd ); |
667 | } | 670 | } |
668 | rePopulate(); | 671 | rePopulate(); |
669 | setOtherTabCurrent(); | 672 | setOtherTabCurrent(); |
670 | } | 673 | } |
671 | } | 674 | } |
672 | 675 | ||
673 | void AdvancedFm::doBeam() { | 676 | void AdvancedFm::doBeam() { |
@@ -710,25 +713,25 @@ void AdvancedFm::startProcess(const QString & cmd) { | |||
710 | connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)), | 713 | connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)), |
711 | this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int))); | 714 | this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int))); |
712 | 715 | ||
713 | command << "/bin/sh"; | 716 | command << "/bin/sh"; |
714 | command << "-c"; | 717 | command << "-c"; |
715 | command << cmd.latin1(); | 718 | command << cmd.latin1(); |
716 | *process << command; | 719 | *process << command; |
717 | if(!process->start(OProcess::NotifyOnExit, OProcess::All) ) | 720 | if(!process->start(OProcess::NotifyOnExit, OProcess::All) ) |
718 | qDebug("could not start process"); | 721 | odebug << "could not start process" << oendl; |
719 | } | 722 | } |
720 | 723 | ||
721 | void AdvancedFm::processEnded(OProcess *) { | 724 | void AdvancedFm::processEnded(OProcess *) { |
722 | rePopulate(); | 725 | rePopulate(); |
723 | } | 726 | } |
724 | 727 | ||
725 | void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) { | 728 | void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) { |
726 | // qWarning("received stderrt %d bytes", buflen); | 729 | // owarn << "received stderrt " << buflen << " bytes" << oendl; |
727 | 730 | ||
728 | QString lineStr = buffer; | 731 | QString lineStr = buffer; |
729 | QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") ); | 732 | QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") ); |
730 | } | 733 | } |
731 | 734 | ||
732 | bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { | 735 | bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { |
733 | if ( o->inherits( "QLineEdit" ) ) { | 736 | if ( o->inherits( "QLineEdit" ) ) { |
734 | if ( e->type() == QEvent::KeyPress ) { | 737 | if ( e->type() == QEvent::KeyPress ) { |
@@ -760,17 +763,17 @@ bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { | |||
760 | OtherView()->setSelected( OtherView()->currentItem(), FALSE );//make sure there's correct selection | 763 | OtherView()->setSelected( OtherView()->currentItem(), FALSE );//make sure there's correct selection |
761 | } | 764 | } |
762 | 765 | ||
763 | return QWidget::eventFilter( o, e ); | 766 | return QWidget::eventFilter( o, e ); |
764 | } | 767 | } |
765 | 768 | ||
766 | 769 | ||
767 | void AdvancedFm::cancelRename() { | 770 | void AdvancedFm::cancelRename() { |
768 | // qDebug("cancel rename"); | 771 | // odebug << "cancel rename" << oendl; |
769 | QListView * view; | 772 | QListView * view; |
770 | view = CurrentView(); | 773 | view = CurrentView(); |
771 | 774 | ||
772 | bool resetFocus = view->viewport()->focusProxy() == renameBox; | 775 | bool resetFocus = view->viewport()->focusProxy() == renameBox; |
773 | delete renameBox; | 776 | delete renameBox; |
774 | renameBox = 0; | 777 | renameBox = 0; |
775 | if ( resetFocus ) { | 778 | if ( resetFocus ) { |
776 | view->viewport()->setFocusProxy( view); | 779 | view->viewport()->setFocusProxy( view); |
diff --git a/noncore/apps/advancedfm/filePermissions.cpp b/noncore/apps/advancedfm/filePermissions.cpp index 9698de7..b7d48e8 100644 --- a/noncore/apps/advancedfm/filePermissions.cpp +++ b/noncore/apps/advancedfm/filePermissions.cpp | |||
@@ -27,17 +27,17 @@ | |||
27 | #include <pwd.h> | 27 | #include <pwd.h> |
28 | #include <grp.h> | 28 | #include <grp.h> |
29 | 29 | ||
30 | filePermissions::filePermissions( QWidget* parent, const char* name, bool modal, WFlags fl, const QString &fileName ) | 30 | filePermissions::filePermissions( QWidget* parent, const char* name, bool modal, WFlags fl, const QString &fileName ) |
31 | : QDialog( parent, name, modal, fl ) | 31 | : QDialog( parent, name, modal, fl ) |
32 | { | 32 | { |
33 | if ( !name ) | 33 | if ( !name ) |
34 | setName( tr("filePermissions") ); | 34 | setName( tr("filePermissions") ); |
35 | // qDebug("FilePermissions "+fileName); | 35 | // odebug << "FilePermissions "+fileName << oendl; |
36 | /* resize( 236, 210 ); | 36 | /* resize( 236, 210 ); |
37 | setMaximumSize( QSize( 236, 210 ) ); | 37 | setMaximumSize( QSize( 236, 210 ) ); |
38 | */ setCaption( tr( "Set File Permissions" ) ); | 38 | */ setCaption( tr( "Set File Permissions" ) ); |
39 | 39 | ||
40 | TextLabel1 = new QLabel( this, "TextLabel1" ); | 40 | TextLabel1 = new QLabel( this, "TextLabel1" ); |
41 | TextLabel1->setGeometry( QRect( 25, 5, 175, 20 ) ); | 41 | TextLabel1->setGeometry( QRect( 25, 5, 175, 20 ) ); |
42 | TextLabel1->setText( tr( "Set file permissions for:" ) ); | 42 | TextLabel1->setText( tr( "Set file permissions for:" ) ); |
43 | 43 | ||
diff --git a/noncore/apps/advancedfm/output.cpp b/noncore/apps/advancedfm/output.cpp index 6906298..8c585f4 100644 --- a/noncore/apps/advancedfm/output.cpp +++ b/noncore/apps/advancedfm/output.cpp | |||
@@ -1,28 +1,31 @@ | |||
1 | /**************************************************************************** | 1 | /**************************************************************************** |
2 | ** outputEdit.cpp | 2 | ** outputEdit.cpp |
3 | ** | 3 | ** |
4 | ** Copyright: Fri Apr 12 15:12:58 2002 L.J. Potter <ljp@llornkcor.com> | 4 | ** Copyright: Fri Apr 12 15:12:58 2002 L.J. Potter <ljp@llornkcor.com> |
5 | ****************************************************************************/ | 5 | ****************************************************************************/ |
6 | #include "output.h" | 6 | #include "output.h" |
7 | 7 | ||
8 | /* OPIE */ | ||
9 | #include <opie2/odebug.h> | ||
8 | #include <qpe/qpeapplication.h> | 10 | #include <qpe/qpeapplication.h> |
9 | #include <qpe/applnk.h> | 11 | #include <qpe/applnk.h> |
12 | using namespace Opie::Core; | ||
10 | 13 | ||
14 | /* QT */ | ||
11 | #include <qfile.h> | 15 | #include <qfile.h> |
12 | #include <qmultilineedit.h> | 16 | #include <qmultilineedit.h> |
13 | #include <qpushbutton.h> | 17 | #include <qpushbutton.h> |
14 | #include <qlayout.h> | 18 | #include <qlayout.h> |
15 | 19 | ||
20 | /* STD */ | ||
16 | #include <errno.h> | 21 | #include <errno.h> |
17 | 22 | ||
18 | /* XPM */ | 23 | /* XPM */ |
19 | using namespace Opie::Core; | ||
20 | using namespace Opie::Core; | ||
21 | static char * filesave_xpm[] = { | 24 | static char * filesave_xpm[] = { |
22 | "16 16 78 1", | 25 | "16 16 78 1", |
23 | " c None", | 26 | " c None", |
24 | ". c #343434", | 27 | ". c #343434", |
25 | "+ c #A0A0A0", | 28 | "+ c #A0A0A0", |
26 | "@ c #565656", | 29 | "@ c #565656", |
27 | "# c #9E9E9E", | 30 | "# c #9E9E9E", |
28 | "$ c #525252", | 31 | "$ c #525252", |
@@ -116,17 +119,17 @@ static char * filesave_xpm[] = { | |||
116 | " +... "}; | 119 | " +... "}; |
117 | 120 | ||
118 | Output::Output( const QStringList commands, QWidget* parent, const char* name, bool modal, WFlags fl) | 121 | Output::Output( const QStringList commands, QWidget* parent, const char* name, bool modal, WFlags fl) |
119 | : QDialog( parent, name, modal, fl ) | 122 | : QDialog( parent, name, modal, fl ) |
120 | { | 123 | { |
121 | QStringList cmmds; | 124 | QStringList cmmds; |
122 | // cmmds=QStringList::split( " ", commands, false); | 125 | // cmmds=QStringList::split( " ", commands, false); |
123 | cmmds=commands; | 126 | cmmds=commands; |
124 | // qDebug("count %d", cmmds.count()); | 127 | // odebug << "count " << cmmds.count() << "" << oendl; |
125 | if ( !name ) | 128 | if ( !name ) |
126 | setName( tr("Output")); | 129 | setName( tr("Output")); |
127 | resize( 196, 269 ); | 130 | resize( 196, 269 ); |
128 | setCaption( name ); | 131 | setCaption( name ); |
129 | 132 | ||
130 | OutputLayout = new QGridLayout( this ); | 133 | OutputLayout = new QGridLayout( this ); |
131 | OutputLayout->setSpacing( 2); | 134 | OutputLayout->setSpacing( 2); |
132 | OutputLayout->setMargin( 2); | 135 | OutputLayout->setMargin( 2); |
@@ -152,17 +155,17 @@ Output::Output( const QStringList commands, QWidget* parent, const char* name, | |||
152 | connect(proc, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)), | 155 | connect(proc, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)), |
153 | this, SLOT(commandStderr(Opie::Core::OProcess*,char*,int))); | 156 | this, SLOT(commandStderr(Opie::Core::OProcess*,char*,int))); |
154 | 157 | ||
155 | // connect( , SIGNAL(received(const QByteArray&)), | 158 | // connect( , SIGNAL(received(const QByteArray&)), |
156 | // this, SLOT(commandStdin(const QByteArray&))); | 159 | // this, SLOT(commandStdin(const QByteArray&))); |
157 | 160 | ||
158 | // * proc << commands.latin1(); | 161 | // * proc << commands.latin1(); |
159 | for ( QStringList::Iterator it = cmmds.begin(); it != cmmds.end(); ++it ) { | 162 | for ( QStringList::Iterator it = cmmds.begin(); it != cmmds.end(); ++it ) { |
160 | qDebug( "%s", (*it).latin1() ); | 163 | odebug << "" << (*it).latin1() << "" << oendl; |
161 | * proc << (*it).latin1(); | 164 | * proc << (*it).latin1(); |
162 | } | 165 | } |
163 | 166 | ||
164 | if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) { | 167 | if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) { |
165 | 168 | ||
166 | OutputEdit->append(tr("Process could not start") ); | 169 | OutputEdit->append(tr("Process could not start") ); |
167 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); | 170 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); |
168 | perror("Error: "); | 171 | perror("Error: "); |
@@ -181,59 +184,59 @@ void Output::saveOutput() { | |||
181 | fileDlg = new InputDialog(this,tr("Save output to file (name only)"),TRUE, 0); | 184 | fileDlg = new InputDialog(this,tr("Save output to file (name only)"),TRUE, 0); |
182 | fileDlg->exec(); | 185 | fileDlg->exec(); |
183 | if( fileDlg->result() == 1 ) { | 186 | if( fileDlg->result() == 1 ) { |
184 | QString filename = QPEApplication::documentDir(); | 187 | QString filename = QPEApplication::documentDir(); |
185 | if(filename.right(1).find('/') == -1) | 188 | if(filename.right(1).find('/') == -1) |
186 | filename+="/"; | 189 | filename+="/"; |
187 | QString name = fileDlg->LineEdit1->text(); | 190 | QString name = fileDlg->LineEdit1->text(); |
188 | filename+="text/plain/"+name; | 191 | filename+="text/plain/"+name; |
189 | qDebug(filename); | 192 | odebug << filename << oendl; |
190 | 193 | ||
191 | QFile f(filename); | 194 | QFile f(filename); |
192 | f.open( IO_WriteOnly); | 195 | f.open( IO_WriteOnly); |
193 | if( f.writeBlock( OutputEdit->text(), qstrlen( OutputEdit->text()) ) != -1) { | 196 | if( f.writeBlock( OutputEdit->text(), qstrlen( OutputEdit->text()) ) != -1) { |
194 | DocLnk lnk; | 197 | DocLnk lnk; |
195 | lnk.setName(name); //sets file name | 198 | lnk.setName(name); //sets file name |
196 | lnk.setFile(filename); //sets File property | 199 | lnk.setFile(filename); //sets File property |
197 | lnk.setType("text/plain"); | 200 | lnk.setType("text/plain"); |
198 | if(!lnk.writeLink()) { | 201 | if(!lnk.writeLink()) { |
199 | qDebug("Writing doclink did not work"); | 202 | odebug << "Writing doclink did not work" << oendl; |
200 | } | 203 | } |
201 | } else | 204 | } else |
202 | qWarning("Could not write file"); | 205 | owarn << "Could not write file" << oendl; |
203 | f.close(); | 206 | f.close(); |
204 | } | 207 | } |
205 | } | 208 | } |
206 | 209 | ||
207 | void Output::commandStdout(OProcess*, char *buffer, int buflen) { | 210 | void Output::commandStdout(OProcess*, char *buffer, int buflen) { |
208 | qWarning("received stdout %d bytes", buflen); | 211 | owarn << "received stdout " << buflen << " bytes" << oendl; |
209 | 212 | ||
210 | // QByteArray data(buflen); | 213 | // QByteArray data(buflen); |
211 | // data.fill(*buffer, buflen); | 214 | // data.fill(*buffer, buflen); |
212 | // for (uint i = 0; i < data.count(); i++ ) { | 215 | // for (uint i = 0; i < data.count(); i++ ) { |
213 | // printf("%c", buffer[i] ); | 216 | // printf("%c", buffer[i] ); |
214 | // } | 217 | // } |
215 | // printf("\n"); | 218 | // printf("\n"); |
216 | 219 | ||
217 | QString lineStr = buffer; | 220 | QString lineStr = buffer; |
218 | lineStr=lineStr.left(lineStr.length()-1); | 221 | lineStr=lineStr.left(lineStr.length()-1); |
219 | OutputEdit->append(lineStr); | 222 | OutputEdit->append(lineStr); |
220 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); | 223 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); |
221 | } | 224 | } |
222 | 225 | ||
223 | 226 | ||
224 | void Output::commandStdin( const QByteArray &data) { | 227 | void Output::commandStdin( const QByteArray &data) { |
225 | qWarning("received stdin %d bytes", data.size()); | 228 | owarn << "received stdin " << data.size() << " bytes" << oendl; |
226 | // recieved data from the io layer goes to sz | 229 | // recieved data from the io layer goes to sz |
227 | proc->writeStdin(data.data(), data.size()); | 230 | proc->writeStdin(data.data(), data.size()); |
228 | } | 231 | } |
229 | 232 | ||
230 | void Output::commandStderr(OProcess*, char *buffer, int buflen) { | 233 | void Output::commandStderr(OProcess*, char *buffer, int buflen) { |
231 | qWarning("received stderrt %d bytes", buflen); | 234 | owarn << "received stderrt " << buflen << " bytes" << oendl; |
232 | 235 | ||
233 | QString lineStr = buffer; | 236 | QString lineStr = buffer; |
234 | // lineStr=lineStr.left(lineStr.length()-1); | 237 | // lineStr=lineStr.left(lineStr.length()-1); |
235 | OutputEdit->append(lineStr); | 238 | OutputEdit->append(lineStr); |
236 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); | 239 | OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); |
237 | } | 240 | } |
238 | 241 | ||
239 | void Output::processFinished() { | 242 | void Output::processFinished() { |
diff --git a/noncore/apps/checkbook/checkbook.pro b/noncore/apps/checkbook/checkbook.pro index 34641f4..1472df6 100644 --- a/noncore/apps/checkbook/checkbook.pro +++ b/noncore/apps/checkbook/checkbook.pro | |||
diff --git a/noncore/apps/checkbook/listedit.cpp b/noncore/apps/checkbook/listedit.cpp index d00e305..5026c9d 100644 --- a/noncore/apps/checkbook/listedit.cpp +++ b/noncore/apps/checkbook/listedit.cpp | |||
@@ -22,24 +22,29 @@ | |||
22 | -_. . . )=. = see the file COPYING. If not, write to the | 22 | -_. . . )=. = see the file COPYING. If not, write to the |
23 | -- :-=` Free Software Foundation, Inc., | 23 | -- :-=` Free Software Foundation, Inc., |
24 | 59 Temple Place - Suite 330, | 24 | 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "listedit.h" | 29 | #include "listedit.h" |
30 | |||
31 | /* OPIE */ | ||
32 | #include <opie2/odebug.h> | ||
33 | #include <qpe/resource.h> | ||
34 | using namespace Opie::Core; | ||
35 | |||
36 | /* QT */ | ||
30 | #include <qlayout.h> | 37 | #include <qlayout.h> |
31 | #include <qlineedit.h> | 38 | #include <qlineedit.h> |
32 | #include <qlistview.h> | 39 | #include <qlistview.h> |
33 | #include <qwidgetstack.h> | 40 | #include <qwidgetstack.h> |
34 | #include <qcombobox.h> | 41 | #include <qcombobox.h> |
35 | #include <qpushbutton.h> | 42 | #include <qpushbutton.h> |
36 | #include <qpe/resource.h> | ||
37 | |||
38 | 43 | ||
39 | // --- ListEdit --------------------------------------------------------------- | 44 | // --- ListEdit --------------------------------------------------------------- |
40 | ListEdit::ListEdit( QWidget *parent, const char *sName ) | 45 | ListEdit::ListEdit( QWidget *parent, const char *sName ) |
41 | : QWidget(parent, sName), TableDef(sName) | 46 | : QWidget(parent, sName), TableDef(sName) |
42 | { | 47 | { |
43 | // get font height | 48 | // get font height |
44 | int fh = fontMetrics().height(); | 49 | int fh = fontMetrics().height(); |
45 | 50 | ||
@@ -297,17 +302,17 @@ void ListEdit::slotClick(QListViewItem *itm, const QPoint &pnt, int col) | |||
297 | i++; | 302 | i++; |
298 | } | 303 | } |
299 | if( i>=0 ) { | 304 | if( i>=0 ) { |
300 | _box->insertItem( _currentItem->text(_currentColumn) ); | 305 | _box->insertItem( _currentItem->text(_currentColumn) ); |
301 | _box->setCurrentItem(i); | 306 | _box->setCurrentItem(i); |
302 | } | 307 | } |
303 | _stack->raiseWidget(_box); | 308 | _stack->raiseWidget(_box); |
304 | } else { | 309 | } else { |
305 | qDebug( "Unsupported column type for column %s", (const char *)pDef->getName() ); | 310 | odebug << "Unsupported column type for column " << (const char *)pDef->getName() << "" << oendl; |
306 | _typeEdit->setText(""); | 311 | _typeEdit->setText(""); |
307 | _stack->raiseWidget(_typeEdit); | 312 | _stack->raiseWidget(_typeEdit); |
308 | } | 313 | } |
309 | } | 314 | } |
310 | 315 | ||
311 | 316 | ||
312 | // --- addColumnDef ----------------------------------------------------------- | 317 | // --- addColumnDef ----------------------------------------------------------- |
313 | void ListEdit::addColumnDef(ColumnDef *pDef) | 318 | void ListEdit::addColumnDef(ColumnDef *pDef) |
diff --git a/noncore/apps/checkbook/tabledef.cpp b/noncore/apps/checkbook/tabledef.cpp index 9a42308..745cd80 100644 --- a/noncore/apps/checkbook/tabledef.cpp +++ b/noncore/apps/checkbook/tabledef.cpp | |||
@@ -23,38 +23,40 @@ | |||
23 | -- :-=` Free Software Foundation, Inc., | 23 | -- :-=` Free Software Foundation, Inc., |
24 | 59 Temple Place - Suite 330, | 24 | 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "tabledef.h" | 29 | #include "tabledef.h" |
30 | 30 | ||
31 | #include <opie2/odebug.h> | ||
32 | using namespace Opie::Core; | ||
31 | 33 | ||
32 | // --- ColumnDef -------------------------------------------------------------- | 34 | // --- ColumnDef -------------------------------------------------------------- |
33 | ColumnDef::ColumnDef(const char *sName, ColumnType type, const char *sNewValue) | 35 | ColumnDef::ColumnDef(const char *sName, ColumnType type, const char *sNewValue) |
34 | { | 36 | { |
35 | _sName=sName; | 37 | _sName=sName; |
36 | _type=type; | 38 | _type=type; |
37 | _sNewValue=sNewValue; | 39 | _sNewValue=sNewValue; |
38 | } | 40 | } |
39 | 41 | ||
40 | 42 | ||
41 | // --- addColumnValue --------------------------------------------------------- | 43 | // --- addColumnValue --------------------------------------------------------- |
42 | void ColumnDef::addColumnValue(const QString &sValue) | 44 | void ColumnDef::addColumnValue(const QString &sValue) |
43 | { | 45 | { |
44 | if( (_type & 0x00ffffff) !=typeList ) | 46 | if( (_type & 0x00ffffff) !=typeList ) |
45 | qDebug("Column %s is not a list", (const char *)_sName); | 47 | odebug << "Column " << (const char *)_sName << " is not a list" << oendl; |
46 | else | 48 | else |
47 | _valueList.append(sValue); | 49 | _valueList.append(sValue); |
48 | } | 50 | } |
49 | void ColumnDef::addColumnValue(const char *sValue) | 51 | void ColumnDef::addColumnValue(const char *sValue) |
50 | { | 52 | { |
51 | if( (_type & 0x00ffffff)!=typeList ) | 53 | if( (_type & 0x00ffffff)!=typeList ) |
52 | qDebug("Column %s is not a list", (const char *)_sName); | 54 | odebug << "Column " << (const char *)_sName << " is not a list" << oendl; |
53 | else | 55 | else |
54 | _valueList.append(sValue); | 56 | _valueList.append(sValue); |
55 | } | 57 | } |
56 | 58 | ||
57 | // --- TableDef --------------------------------------------------------------- | 59 | // --- TableDef --------------------------------------------------------------- |
58 | TableDef::TableDef(const char *sName) | 60 | TableDef::TableDef(const char *sName) |
59 | { | 61 | { |
60 | _sName=sName; | 62 | _sName=sName; |
diff --git a/noncore/apps/checkbook/transaction.cpp b/noncore/apps/checkbook/transaction.cpp index 1b08b24..aafb588 100644 --- a/noncore/apps/checkbook/transaction.cpp +++ b/noncore/apps/checkbook/transaction.cpp | |||
@@ -26,18 +26,22 @@ | |||
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include "transaction.h" | 29 | #include "transaction.h" |
30 | #include "traninfo.h" | 30 | #include "traninfo.h" |
31 | #include "cfg.h" | 31 | #include "cfg.h" |
32 | #include "checkbook.h" | 32 | #include "checkbook.h" |
33 | 33 | ||
34 | /* OPIE */ | ||
35 | #include <opie2/odebug.h> | ||
34 | #include <qpe/datebookmonth.h> | 36 | #include <qpe/datebookmonth.h> |
37 | using namespace Opie::Core; | ||
35 | 38 | ||
39 | /* QT */ | ||
36 | #include <qbuttongroup.h> | 40 | #include <qbuttongroup.h> |
37 | #include <qcombobox.h> | 41 | #include <qcombobox.h> |
38 | #include <qlabel.h> | 42 | #include <qlabel.h> |
39 | #include <qlayout.h> | 43 | #include <qlayout.h> |
40 | #include <qlineedit.h> | 44 | #include <qlineedit.h> |
41 | #include <qmultilineedit.h> | 45 | #include <qmultilineedit.h> |
42 | #include <qradiobutton.h> | 46 | #include <qradiobutton.h> |
43 | #include <qwhatsthis.h> | 47 | #include <qwhatsthis.h> |
@@ -327,11 +331,11 @@ void Transaction::slotActivated(const QString &arg ) | |||
327 | amtEdit->setCursorPosition(0); | 331 | amtEdit->setCursorPosition(0); |
328 | } | 332 | } |
329 | } | 333 | } |
330 | } | 334 | } |
331 | 335 | ||
332 | // slotNotNew ----------------------------------------------------------------- | 336 | // slotNotNew ----------------------------------------------------------------- |
333 | void Transaction::slotNotNew() | 337 | void Transaction::slotNotNew() |
334 | { | 338 | { |
335 | qDebug("Not new"); | 339 | odebug << "Not new" << oendl; |
336 | _bNew=false; | 340 | _bNew=false; |
337 | } | 341 | } |
diff --git a/noncore/apps/confedit/confedit.pro b/noncore/apps/confedit/confedit.pro index 5a71680..785c588 100644 --- a/noncore/apps/confedit/confedit.pro +++ b/noncore/apps/confedit/confedit.pro | |||
@@ -1,21 +1,9 @@ | |||
1 | CONFIG = qt warn_on quick-app | 1 | CONFIG = qt warn_on quick-app |
2 | HEADERS = mainwindow.h listviewconfdir.h listviewitemconffile.h listviewitemconfigentry.h editwidget.h listviewitemconf.h | 2 | HEADERS = mainwindow.h listviewconfdir.h listviewitemconffile.h listviewitemconfigentry.h editwidget.h listviewitemconf.h |
3 | SOURCES = main.cpp mainwindow.cpp listviewconfdir.cpp listviewitemconffile.cpp listviewitemconfigentry.cpp editwidget.cpp listviewitemconf.cpp | 3 | SOURCES = main.cpp mainwindow.cpp listviewconfdir.cpp listviewitemconffile.cpp listviewitemconfigentry.cpp editwidget.cpp listviewitemconf.cpp |
4 | INCLUDEPATH += $(OPIEDIR)/include | 4 | INCLUDEPATH += $(OPIEDIR)/include |
5 | DEPENDPATH += $(OPIEDIR)/include | 5 | DEPENDPATH += $(OPIEDIR)/include |
6 | INTERFACES = | 6 | LIBS += -lqpe -lopiecore2 |
7 | LIBS += -lopiecore2 | ||
8 | TARGET = confedit | 7 | TARGET = confedit |
9 | 8 | ||
10 | !contains( platform, x11 ) { | ||
11 | |||
12 | include ( $(OPIEDIR)/include.pro ) | 9 | include ( $(OPIEDIR)/include.pro ) |
13 | LIBS += -lqpe | ||
14 | } | ||
15 | |||
16 | contains( platform, x11 ) { | ||
17 | LIBS += -L$(OPIEDIR)/lib -Wl,-rpath,$(OPIEDIR)/lib | ||
18 | } | ||
19 | |||
20 | |||
21 | |||
diff --git a/noncore/apps/confedit/config.in b/noncore/apps/confedit/config.in index e377307..d7682dc 100644 --- a/noncore/apps/confedit/config.in +++ b/noncore/apps/confedit/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config CONFEDIT | 1 | config CONFEDIT |
2 | boolean "opie-confeditor (generic editor for all Opie settings)" | 2 | boolean "opie-confedit (generic editor for all Opie settings)" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE |
diff --git a/noncore/apps/confedit/listviewconfdir.cpp b/noncore/apps/confedit/listviewconfdir.cpp index 0c2feeb..33bffe1 100644 --- a/noncore/apps/confedit/listviewconfdir.cpp +++ b/noncore/apps/confedit/listviewconfdir.cpp | |||
@@ -4,20 +4,24 @@ | |||
4 | * it under the terms of the GNU General Public License as published by * | 4 | * it under the terms of the GNU General Public License as published by * |
5 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
6 | * (at your option) any later version. * | 6 | * (at your option) any later version. * |
7 | * * | 7 | * * |
8 | ***************************************************************************/ | 8 | ***************************************************************************/ |
9 | // (c) 2002 Patrick S. Vogtp <tille@handhelds.org> | 9 | // (c) 2002 Patrick S. Vogtp <tille@handhelds.org> |
10 | 10 | ||
11 | #include "listviewconfdir.h" | 11 | #include "listviewconfdir.h" |
12 | #include "listviewitemconffile.h" | ||
12 | 13 | ||
13 | #include <qmessagebox.h> | 14 | /* OPIE */ |
15 | #include <opie2/odebug.h> | ||
16 | using namespace Opie::Core; | ||
14 | 17 | ||
15 | #include "listviewitemconffile.h" | 18 | /* QT */ |
19 | #include <qmessagebox.h> | ||
16 | 20 | ||
17 | ListViewConfDir::ListViewConfDir(QString settingsPath, QWidget *parent, const char *name ) | 21 | ListViewConfDir::ListViewConfDir(QString settingsPath, QWidget *parent, const char *name ) |
18 | : QListView(parent,name), confDir(settingsPath) | 22 | : QListView(parent,name), confDir(settingsPath) |
19 | { | 23 | { |
20 | 24 | ||
21 | setRootIsDecorated( true ); | 25 | setRootIsDecorated( true ); |
22 | addColumn(tr("Files")); | 26 | addColumn(tr("Files")); |
23 | 27 | ||
@@ -42,17 +46,17 @@ void ListViewConfDir::readConfFiles() | |||
42 | const QFileInfoList *list = confDir.entryInfoList(); | 46 | const QFileInfoList *list = confDir.entryInfoList(); |
43 | QFileInfoListIterator it( *list ); | 47 | QFileInfoListIterator it( *list ); |
44 | QFileInfo *fi; | 48 | QFileInfo *fi; |
45 | 49 | ||
46 | ListViewItemConfFile *fileEntry; | 50 | ListViewItemConfFile *fileEntry; |
47 | 51 | ||
48 | while ( (fi=it.current()) ) | 52 | while ( (fi=it.current()) ) |
49 | { | 53 | { |
50 | qDebug( "opening: >%s<", fi->fileName().data() ); | 54 | odebug << "opening: >" << fi->fileName().data() << "<" << oendl; |
51 | fileEntry = new ListViewItemConfFile( fi, this ); | 55 | fileEntry = new ListViewItemConfFile( fi, this ); |
52 | QListViewItem *dummy = new QListViewItem(fileEntry, "dummy"); | 56 | QListViewItem *dummy = new QListViewItem(fileEntry, "dummy"); |
53 | ++it; | 57 | ++it; |
54 | } | 58 | } |
55 | } | 59 | } |
56 | 60 | ||
57 | void ListViewConfDir::expand(QListViewItem *item) | 61 | void ListViewConfDir::expand(QListViewItem *item) |
58 | { | 62 | { |
diff --git a/noncore/apps/confedit/listviewitemconffile.cpp b/noncore/apps/confedit/listviewitemconffile.cpp index 1ff2c44..2958cf5 100644 --- a/noncore/apps/confedit/listviewitemconffile.cpp +++ b/noncore/apps/confedit/listviewitemconffile.cpp | |||
@@ -4,19 +4,25 @@ | |||
4 | * it under the terms of the GNU General Public License as published by * | 4 | * it under the terms of the GNU General Public License as published by * |
5 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
6 | * (at your option) any later version. * | 6 | * (at your option) any later version. * |
7 | * * | 7 | * * |
8 | ***************************************************************************/ | 8 | ***************************************************************************/ |
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | 9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> |
10 | 10 | ||
11 | #include "listviewitemconffile.h" | 11 | #include "listviewitemconffile.h" |
12 | #include "listviewitemconfigentry.h" | ||
13 | |||
14 | /* OPIE */ | ||
15 | #include <opie2/odebug.h> | ||
16 | using namespace Opie::Core; | ||
17 | |||
18 | /* QT */ | ||
12 | #include <qmessagebox.h> | 19 | #include <qmessagebox.h> |
13 | #include <qtextstream.h> | 20 | #include <qtextstream.h> |
14 | #include "listviewitemconfigentry.h" | ||
15 | 21 | ||
16 | #define tr QObject::tr | 22 | #define tr QObject::tr |
17 | 23 | ||
18 | ListViewItemConfFile::ListViewItemConfFile(QFileInfo *file, QListView *parent) | 24 | ListViewItemConfFile::ListViewItemConfFile(QFileInfo *file, QListView *parent) |
19 | : ListViewItemConf(parent), _valid(false) | 25 | : ListViewItemConf(parent), _valid(false) |
20 | { | 26 | { |
21 | confFileInfo = file; | 27 | confFileInfo = file; |
22 | // parseFile(); | 28 | // parseFile(); |
@@ -35,53 +41,53 @@ void ListViewItemConfFile::displayText() | |||
35 | 41 | ||
36 | QString ListViewItemConfFile::fileName() | 42 | QString ListViewItemConfFile::fileName() |
37 | { | 43 | { |
38 | return confFileInfo->fileName(); | 44 | return confFileInfo->fileName(); |
39 | } | 45 | } |
40 | 46 | ||
41 | void ListViewItemConfFile::parseFile() | 47 | void ListViewItemConfFile::parseFile() |
42 | { | 48 | { |
43 | //qDebug("ListViewItemConfFile::parseFile BEGIN"); | 49 | //odebug << "ListViewItemConfFile::parseFile BEGIN" << oendl; |
44 | QFile confFile(confFileInfo->absFilePath()); | 50 | QFile confFile(confFileInfo->absFilePath()); |
45 | if(! confFile.open(IO_ReadOnly)) | 51 | if(! confFile.open(IO_ReadOnly)) |
46 | QMessageBox::critical(0,tr("Could not open"),tr("The file ")+confFileInfo->fileName()+tr(" could not be opened."),1,0); | 52 | QMessageBox::critical(0,tr("Could not open"),tr("The file ")+confFileInfo->fileName()+tr(" could not be opened."),1,0); |
47 | QTextStream t( &confFile ); | 53 | QTextStream t( &confFile ); |
48 | QString s; | 54 | QString s; |
49 | QString group; | 55 | QString group; |
50 | ListViewItemConfigEntry *groupItem; | 56 | ListViewItemConfigEntry *groupItem; |
51 | ListViewItemConfigEntry *item; | 57 | ListViewItemConfigEntry *item; |
52 | while ( !t.atEnd() ) | 58 | while ( !t.atEnd() ) |
53 | { | 59 | { |
54 | s = t.readLine().stripWhiteSpace(); | 60 | s = t.readLine().stripWhiteSpace(); |
55 | //qDebug( "line: >%s<\n", s.latin1() ); | 61 | //odebug << "line: >" << s.latin1() << "<\n" << oendl; |
56 | if (s.contains("<?xml")) | 62 | if (s.contains("<?xml")) |
57 | { | 63 | { |
58 | _valid = false; | 64 | _valid = false; |
59 | break; | 65 | break; |
60 | }else | 66 | }else |
61 | if ( s[0] == '[' && s[s.length()-1] == ']' ) | 67 | if ( s[0] == '[' && s[s.length()-1] == ']' ) |
62 | { | 68 | { |
63 | // qDebug("got group"+s); | 69 | // odebug << "got group"+s << oendl; |
64 | group = s.mid(1,s.length()-2); | 70 | group = s.mid(1,s.length()-2); |
65 | if (!groupItem) groupItem = new ListViewItemConfigEntry(this, tr("no group") ); | 71 | if (!groupItem) groupItem = new ListViewItemConfigEntry(this, tr("no group") ); |
66 | groupItem = new ListViewItemConfigEntry(this, group ); | 72 | groupItem = new ListViewItemConfigEntry(this, group ); |
67 | insertItem( groupItem ); | 73 | insertItem( groupItem ); |
68 | } else | 74 | } else |
69 | if ( int pos = s.find('=') ) | 75 | if ( int pos = s.find('=') ) |
70 | { | 76 | { |
71 | // qDebug("got key"+s); | 77 | // odebug << "got key"+s << oendl; |
72 | if (!groupItem) qDebug("PANIK NO GROUP! >%s<",group.latin1()); | 78 | if (!groupItem) odebug << "PANIK NO GROUP! >" << group.latin1() << "<" << oendl; |
73 | item = new ListViewItemConfigEntry(this, group, s ); | 79 | item = new ListViewItemConfigEntry(this, group, s ); |
74 | groupItem->insertItem( item ); | 80 | groupItem->insertItem( item ); |
75 | } | 81 | } |
76 | } | 82 | } |
77 | confFile.close(); | 83 | confFile.close(); |
78 | setExpandable( _valid ); | 84 | setExpandable( _valid ); |
79 | //qDebug("ListViewItemConfFile::parseFile END"); | 85 | //odebug << "ListViewItemConfFile::parseFile END" << oendl; |
80 | } | 86 | } |
81 | 87 | ||
82 | 88 | ||
83 | void ListViewItemConfFile::remove() | 89 | void ListViewItemConfFile::remove() |
84 | { | 90 | { |
85 | QFile::remove(confFileInfo->absFilePath()); | 91 | QFile::remove(confFileInfo->absFilePath()); |
86 | QFile::remove(backupFileName()); | 92 | QFile::remove(backupFileName()); |
87 | delete this; | 93 | delete this; |
diff --git a/noncore/apps/confedit/mainwindow.cpp b/noncore/apps/confedit/mainwindow.cpp index 6ef1043..4b04c97 100644 --- a/noncore/apps/confedit/mainwindow.cpp +++ b/noncore/apps/confedit/mainwindow.cpp | |||
@@ -6,44 +6,47 @@ | |||
6 | * (at your option) any later version. * | 6 | * (at your option) any later version. * |
7 | * * | 7 | * * |
8 | ***************************************************************************/ | 8 | ***************************************************************************/ |
9 | 9 | ||
10 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | 10 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> |
11 | 11 | ||
12 | 12 | ||
13 | #include "mainwindow.h" | 13 | #include "mainwindow.h" |
14 | #include "listviewconfdir.h" | ||
15 | #include "listviewitemconfigentry.h" | ||
14 | 16 | ||
17 | /* OPIE */ | ||
18 | #include <opie2/odebug.h> | ||
19 | using namespace Opie::Core; | ||
20 | |||
21 | /* QT */ | ||
15 | #include <qlabel.h> | 22 | #include <qlabel.h> |
16 | #include <qlayout.h> | 23 | #include <qlayout.h> |
17 | #include <qlineedit.h> | 24 | #include <qlineedit.h> |
18 | 25 | ||
19 | #include "listviewconfdir.h" | ||
20 | #include "listviewitemconfigentry.h" | ||
21 | |||
22 | |||
23 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : | 26 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : |
24 | QMainWindow( parent, name, f ), _currentItem(0), _fileItem(0) | 27 | QMainWindow( parent, name, f ), _currentItem(0), _fileItem(0) |
25 | { | 28 | { |
26 | setCaption( tr("Conf File Editor") ); | 29 | setCaption( tr("Conf File Editor") ); |
27 | 30 | ||
28 | //setBaseSize( qApp->globalStrut() ); | 31 | //setBaseSize( qApp->globalStrut() ); |
29 | setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) ); | 32 | setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) ); |
30 | 33 | ||
31 | mainLayout = new QVBoxLayout( this ); | 34 | mainLayout = new QVBoxLayout( this ); |
32 | mainLayout->setSpacing( 0 ); | 35 | mainLayout->setSpacing( 0 ); |
33 | mainLayout->setMargin( 0 ); | 36 | mainLayout->setMargin( 0 ); |
34 | 37 | ||
35 | 38 | ||
36 | qDebug("creating settingList"); | 39 | odebug << "creating settingList" << oendl; |
37 | settingList = new ListViewConfDir( QDir::homeDirPath() + "/Settings", this, "settingslist"); | 40 | settingList = new ListViewConfDir( QDir::homeDirPath() + "/Settings", this, "settingslist"); |
38 | settingList->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) ); | 41 | settingList->setSizePolicy( QSizePolicy( QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding));//, sizePolicy().hasHeightForWidth() ) ); |
39 | mainLayout->addWidget( settingList, 0); | 42 | mainLayout->addWidget( settingList, 0); |
40 | 43 | ||
41 | qDebug("creating editor"); | 44 | odebug << "creating editor" << oendl; |
42 | editor = new EditWidget(this); | 45 | editor = new EditWidget(this); |
43 | editor->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum));//, sizePolicy().hasHeightForWidth() ) ); | 46 | editor->setSizePolicy( QSizePolicy( QSizePolicy::Minimum, QSizePolicy::Maximum));//, sizePolicy().hasHeightForWidth() ) ); |
44 | mainLayout->addWidget( editor, 1 ); | 47 | mainLayout->addWidget( editor, 1 ); |
45 | editor->layoutType( ListViewItemConf::File ); | 48 | editor->layoutType( ListViewItemConf::File ); |
46 | 49 | ||
47 | makeMenu(); | 50 | makeMenu(); |
48 | 51 | ||
49 | connect(settingList, SIGNAL( pressed(QListViewItem*) ), | 52 | connect(settingList, SIGNAL( pressed(QListViewItem*) ), |
@@ -93,17 +96,17 @@ void MainWindow::makeMenu() | |||
93 | MainWindow::~MainWindow() | 96 | MainWindow::~MainWindow() |
94 | { | 97 | { |
95 | } | 98 | } |
96 | 99 | ||
97 | 100 | ||
98 | 101 | ||
99 | void MainWindow::setCurrent(QListViewItem *item) | 102 | void MainWindow::setCurrent(QListViewItem *item) |
100 | { | 103 | { |
101 | //qDebug("MainWindow::setCurrent"); | 104 | //odebug << "MainWindow::setCurrent" << oendl; |
102 | if (!item) return; | 105 | if (!item) return; |
103 | _item = (ListViewItemConf*) item; | 106 | _item = (ListViewItemConf*) item; |
104 | if (!_item) return; | 107 | if (!_item) return; |
105 | popupTimer->start( 750, true ); | 108 | popupTimer->start( 750, true ); |
106 | if (_item->getType() == ListViewItemConf::File) | 109 | if (_item->getType() == ListViewItemConf::File) |
107 | { | 110 | { |
108 | editor->layoutType(EditWidget::File); | 111 | editor->layoutType(EditWidget::File); |
109 | _currentItem=0; | 112 | _currentItem=0; |
@@ -169,17 +172,17 @@ void MainWindow::revertConfFile() | |||
169 | void MainWindow::removeConfFile() | 172 | void MainWindow::removeConfFile() |
170 | { | 173 | { |
171 | if (!_item) return; | 174 | if (!_item) return; |
172 | _item->remove(); | 175 | _item->remove(); |
173 | } | 176 | } |
174 | 177 | ||
175 | void MainWindow::showPopup() | 178 | void MainWindow::showPopup() |
176 | { | 179 | { |
177 | qDebug("showPopup"); | 180 | odebug << "showPopup" << oendl; |
178 | if (!_item) return; | 181 | if (!_item) return; |
179 | popupActionRevert->setEnabled(_item->revertable()); | 182 | popupActionRevert->setEnabled(_item->revertable()); |
180 | popupActionSave->setEnabled(_item->isChanged()); | 183 | popupActionSave->setEnabled(_item->isChanged()); |
181 | if (_fileItem) | 184 | if (_fileItem) |
182 | { | 185 | { |
183 | popupActionSave->setEnabled(_fileItem->isChanged()); | 186 | popupActionSave->setEnabled(_fileItem->isChanged()); |
184 | popupMenuFile->popup( QCursor::pos() ); | 187 | popupMenuFile->popup( QCursor::pos() ); |
185 | }else if(_currentItem) | 188 | }else if(_currentItem) |
diff --git a/noncore/apps/keyz-cfg/cfgfile.cpp b/noncore/apps/keyz-cfg/cfgfile.cpp index b0dc968..81d1ee1 100644 --- a/noncore/apps/keyz-cfg/cfgfile.cpp +++ b/noncore/apps/keyz-cfg/cfgfile.cpp | |||
@@ -1,11 +1,17 @@ | |||
1 | #include <qmessagebox.h> | ||
2 | #include "cfgfile.h" | 1 | #include "cfgfile.h" |
3 | 2 | ||
3 | /* OPIE */ | ||
4 | #include <opie2/odebug.h> | ||
5 | using namespace Opie::Core; | ||
6 | |||
7 | /* QT */ | ||
8 | #include <qmessagebox.h> | ||
9 | |||
4 | // CfgEntry implementation | 10 | // CfgEntry implementation |
5 | CfgEntry::CfgEntry() { | 11 | CfgEntry::CfgEntry() { |
6 | } | 12 | } |
7 | 13 | ||
8 | CfgEntry::CfgEntry(const QString& f, const QString& l): | 14 | CfgEntry::CfgEntry(const QString& f, const QString& l): |
9 | file(f), label(l) { | 15 | file(f), label(l) { |
10 | } | 16 | } |
11 | 17 | ||
@@ -90,28 +96,28 @@ bool CfgParser::load(QString file, CfgFile& cfg) { | |||
90 | reader.setContentHandler(&p); | 96 | reader.setContentHandler(&p); |
91 | 97 | ||
92 | err = ""; | 98 | err = ""; |
93 | ardelay = -1; | 99 | ardelay = -1; |
94 | arperiod = -1; | 100 | arperiod = -1; |
95 | reader.parse(is); | 101 | reader.parse(is); |
96 | 102 | ||
97 | if (!err.isEmpty()) { | 103 | if (!err.isEmpty()) { |
98 | qDebug(err); | 104 | odebug << err << oendl; |
99 | return false; | 105 | return false; |
100 | } | 106 | } |
101 | 107 | ||
102 | QMap<QString, QString>::Iterator fit, lit; | 108 | QMap<QString, QString>::Iterator fit, lit; |
103 | for(uint i = 0; i < includeList.count(); i++) { | 109 | for(uint i = 0; i < includeList.count(); i++) { |
104 | QString file = *includeList.at(i); | 110 | QString file = *includeList.at(i); |
105 | fit = includes.find(file); | 111 | fit = includes.find(file); |
106 | QString prefix = fit.data(); | 112 | QString prefix = fit.data(); |
107 | QString label = ""; | 113 | QString label = ""; |
108 | 114 | ||
109 | qDebug("include: file=" + fit.key() + ", prefix=" + fit.data()); | 115 | odebug << "include: file=" + fit.key() + ", prefix=" + fit.data() << oendl; |
110 | lit = labels.find(prefix+":*"); | 116 | lit = labels.find(prefix+":*"); |
111 | if (lit != labels.end()) { | 117 | if (lit != labels.end()) { |
112 | label = lit.data(); | 118 | label = lit.data(); |
113 | } | 119 | } |
114 | 120 | ||
115 | cfg.replaceEntry(file, label); | 121 | cfg.replaceEntry(file, label); |
116 | } | 122 | } |
117 | 123 | ||
diff --git a/noncore/apps/keyz-cfg/config.in b/noncore/apps/keyz-cfg/config.in index 29a10f5..8e1be2d 100644 --- a/noncore/apps/keyz-cfg/config.in +++ b/noncore/apps/keyz-cfg/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config KEYZCFG | 1 | config KEYZCFG |
2 | boolean "keyz-cfg (configuration tool for keyz applet)" | 2 | boolean "keyz-cfg (configuration tool for keyz applet)" |
3 | default "n" | 3 | default "n" |
4 | depends ( LIBQPE || LIBQPE-X11 ) | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE |
diff --git a/noncore/apps/keyz-cfg/keyz-cfg.pro b/noncore/apps/keyz-cfg/keyz-cfg.pro index 44bbb5f..7ac604b 100644 --- a/noncore/apps/keyz-cfg/keyz-cfg.pro +++ b/noncore/apps/keyz-cfg/keyz-cfg.pro | |||
@@ -13,12 +13,12 @@ SOURCES = main.cpp \ | |||
13 | cfgfile.cpp \ | 13 | cfgfile.cpp \ |
14 | zkb.cpp \ | 14 | zkb.cpp \ |
15 | zkbcfg.cpp \ | 15 | zkbcfg.cpp \ |
16 | zkbnames.cpp \ | 16 | zkbnames.cpp \ |
17 | zkbxml.cpp | 17 | zkbxml.cpp |
18 | 18 | ||
19 | INCLUDEPATH += $(OPIEDIR)/include | 19 | INCLUDEPATH += $(OPIEDIR)/include |
20 | DEPENDPATH += $(OPIEDIR)/include | 20 | DEPENDPATH += $(OPIEDIR)/include |
21 | LIBS += -lqpe | 21 | LIBS += -lqpe -lopiecore2 |
22 | TARGET = keyz-cfg | 22 | TARGET = keyz-cfg |
23 | 23 | ||
24 | include ( $(OPIEDIR)/include.pro ) | 24 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/apps/keyz-cfg/zkb.cpp b/noncore/apps/keyz-cfg/zkb.cpp index f315d4b..8382615 100644 --- a/noncore/apps/keyz-cfg/zkb.cpp +++ b/noncore/apps/keyz-cfg/zkb.cpp | |||
@@ -359,17 +359,17 @@ State* Keymap::getStateByLabel(const QString& label) { | |||
359 | name=name.left(name.length() - 1); | 359 | name=name.left(name.length() - 1); |
360 | 360 | ||
361 | n = currentStateName.findRev(":"); | 361 | n = currentStateName.findRev(":"); |
362 | if (n >= 0) { | 362 | if (n >= 0) { |
363 | name += currentStateName.mid(n+1); | 363 | name += currentStateName.mid(n+1); |
364 | } | 364 | } |
365 | } | 365 | } |
366 | 366 | ||
367 | //qDebug("look for: %s\n", (const char*) name.utf8()); | 367 | //odebug << "look for: " << (const char*) name.utf8() << "\n" << oendl; |
368 | QMap<QString, State*>::Iterator sit = states.find(name); | 368 | QMap<QString, State*>::Iterator sit = states.find(name); |
369 | if (sit != states.end()) { | 369 | if (sit != states.end()) { |
370 | state = sit.data(); | 370 | state = sit.data(); |
371 | } | 371 | } |
372 | 372 | ||
373 | return state; | 373 | return state; |
374 | } | 374 | } |
375 | 375 | ||
@@ -411,17 +411,17 @@ bool Keymap::setCurrentState(State* state) { | |||
411 | generateLabelStateMaps(); | 411 | generateLabelStateMaps(); |
412 | } | 412 | } |
413 | 413 | ||
414 | QMap<State*, QString>::Iterator tit; | 414 | QMap<State*, QString>::Iterator tit; |
415 | tit = stateLabelMap.find(state); | 415 | tit = stateLabelMap.find(state); |
416 | if (tit != stateLabelMap.end()) { | 416 | if (tit != stateLabelMap.end()) { |
417 | currentLabel = tit.data(); | 417 | currentLabel = tit.data(); |
418 | } else { | 418 | } else { |
419 | // qDebug("no label for: " + currentStateName + "\n"); | 419 | // odebug << "no label for: " + currentStateName + "\n" << oendl; |
420 | currentLabel = ""; | 420 | currentLabel = ""; |
421 | } | 421 | } |
422 | 422 | ||
423 | return true; | 423 | return true; |
424 | } | 424 | } |
425 | } | 425 | } |
426 | 426 | ||
427 | return false; | 427 | return false; |
diff --git a/noncore/apps/keyz-cfg/zkbcfg.cpp b/noncore/apps/keyz-cfg/zkbcfg.cpp index 0992b9a..f1d53ba 100644 --- a/noncore/apps/keyz-cfg/zkbcfg.cpp +++ b/noncore/apps/keyz-cfg/zkbcfg.cpp | |||
@@ -1,42 +1,45 @@ | |||
1 | #include <qfileinfo.h> | ||
2 | |||
3 | #include "zkbcfg.h" | 1 | #include "zkbcfg.h" |
4 | 2 | ||
3 | /* OPIE */ | ||
4 | #include <opie2/odebug.h> | ||
5 | using namespace Opie::Core; | ||
6 | |||
7 | /* QT */ | ||
8 | #include <qfileinfo.h> | ||
5 | 9 | ||
6 | // Implementation of XkbConfig class | 10 | // Implementation of XkbConfig class |
7 | ZkbConfig::ZkbConfig(const QString& dir):path(dir) { | 11 | ZkbConfig::ZkbConfig(const QString& dir):path(dir) { |
8 | } | 12 | } |
9 | 13 | ||
10 | ZkbConfig::~ZkbConfig() { | 14 | ZkbConfig::~ZkbConfig() { |
11 | } | 15 | } |
12 | 16 | ||
13 | bool ZkbConfig::load(const QString& file, Keymap& keymap, const QString& prefix) { | 17 | bool ZkbConfig::load(const QString& file, Keymap& keymap, const QString& prefix) { |
14 | bool ret; | 18 | bool ret; |
15 | QFile f(path+"/"+file); | 19 | QFile f(path+"/"+file); |
16 | QFileInfo fi(f); | 20 | QFileInfo fi(f); |
17 | 21 | ||
18 | qDebug("start loading file=%s\n", (const char*) file.utf8()); | 22 | odebug << "start loading file=" << (const char*) file.utf8() << "\n" << oendl; |
19 | if (includedFiles.find(fi.absFilePath()) != includedFiles.end()) { | 23 | if (includedFiles.find(fi.absFilePath()) != includedFiles.end()) { |
20 | return false; | 24 | return false; |
21 | } | 25 | } |
22 | 26 | ||
23 | includedFiles.insert(fi.absFilePath(), 1); | 27 | includedFiles.insert(fi.absFilePath(), 1); |
24 | QXmlInputSource is(f); | 28 | QXmlInputSource is(f); |
25 | QXmlSimpleReader reader; | 29 | QXmlSimpleReader reader; |
26 | ZkbHandler h(*this, keymap, prefix); | 30 | ZkbHandler h(*this, keymap, prefix); |
27 | 31 | ||
28 | reader.setContentHandler(&h); | 32 | reader.setContentHandler(&h); |
29 | reader.setErrorHandler(this); | 33 | reader.setErrorHandler(this); |
30 | ret = reader.parse(is); | 34 | ret = reader.parse(is); |
31 | includedFiles.remove(fi.absFilePath()); | 35 | includedFiles.remove(fi.absFilePath()); |
32 | 36 | ||
33 | qDebug("end loading file=%s : status=%s\n", (const char*) file.utf8(), | 37 | odebug << "end loading file=" << file.utf8() << ": status=" << err.utf8() << oendl; |
34 | (const char*) err.utf8()); | ||
35 | return ret; | 38 | return ret; |
36 | } | 39 | } |
37 | 40 | ||
38 | bool ZkbConfig::warning(const QXmlParseException& e) { | 41 | bool ZkbConfig::warning(const QXmlParseException& e) { |
39 | QString tmp; | 42 | QString tmp; |
40 | 43 | ||
41 | tmp.sprintf("%d: warning: %s\n", e.lineNumber(), | 44 | tmp.sprintf("%d: warning: %s\n", e.lineNumber(), |
42 | (const char*) e.message().utf8()); | 45 | (const char*) e.message().utf8()); |
@@ -117,17 +120,17 @@ bool ZkbHandler::startLabelElement(const QString& label, | |||
117 | } | 120 | } |
118 | 121 | ||
119 | bool ZkbHandler::startStateElement(const QString& name, | 122 | bool ZkbHandler::startStateElement(const QString& name, |
120 | const QString& parentName, bool dflt) { | 123 | const QString& parentName, bool dflt) { |
121 | 124 | ||
122 | currentStateName = prefix + name; | 125 | currentStateName = prefix + name; |
123 | currentState = keymap.getStateByName(currentStateName); | 126 | currentState = keymap.getStateByName(currentStateName); |
124 | 127 | ||
125 | //qDebug("state name=%s\n", (const char*) currentStateName.utf8()); | 128 | //odebug << "state name=" << (const char*) currentStateName.utf8() << "\n" << oendl; |
126 | 129 | ||
127 | State* parent = 0; | 130 | State* parent = 0; |
128 | if (!parentName.isEmpty()) { | 131 | if (!parentName.isEmpty()) { |
129 | QString pn = prefix + parentName; | 132 | QString pn = prefix + parentName; |
130 | parent = keymap.getStateByName(pn); | 133 | parent = keymap.getStateByName(pn); |
131 | if (parent == 0) { | 134 | if (parent == 0) { |
132 | err = currentStateName + | 135 | err = currentStateName + |
133 | ": undefined parent state: " + pn; | 136 | ": undefined parent state: " + pn; |
diff --git a/noncore/apps/opie-bartender/bartender.cpp b/noncore/apps/opie-bartender/bartender.cpp index e6cb515..59fc242 100644 --- a/noncore/apps/opie-bartender/bartender.cpp +++ b/noncore/apps/opie-bartender/bartender.cpp | |||
@@ -11,41 +11,44 @@ | |||
11 | ***************************************************************************/ | 11 | ***************************************************************************/ |
12 | 12 | ||
13 | #include "bartender.h" | 13 | #include "bartender.h" |
14 | #include "showdrinks.h" | 14 | #include "showdrinks.h" |
15 | #include "inputDialog.h" | 15 | #include "inputDialog.h" |
16 | #include "searchresults.h" | 16 | #include "searchresults.h" |
17 | #include "bac.h" | 17 | #include "bac.h" |
18 | 18 | ||
19 | #include <qtoolbar.h> | 19 | /* OPIE */ |
20 | #include <qmenubar.h> | 20 | #include <opie2/odebug.h> |
21 | //#include <opie2/colorpopupmenu.h> | ||
22 | #include <qpe/qpeapplication.h> | 21 | #include <qpe/qpeapplication.h> |
23 | #include <qpe/resource.h> | 22 | #include <qpe/resource.h> |
23 | using namespace Opie::Core; | ||
24 | 24 | ||
25 | /* QT */ | ||
25 | #include <qlineedit.h> | 26 | #include <qlineedit.h> |
26 | #include <qdir.h> | 27 | #include <qdir.h> |
27 | #include <qpushbutton.h> | 28 | #include <qpushbutton.h> |
28 | #include <qlistbox.h> | 29 | #include <qlistbox.h> |
29 | #include <qmultilineedit.h> | 30 | #include <qmultilineedit.h> |
30 | #include <qmessagebox.h> | 31 | #include <qmessagebox.h> |
31 | #include <qtextstream.h> | 32 | #include <qtextstream.h> |
32 | #include <qaction.h> | 33 | #include <qaction.h> |
33 | #include <qheader.h> | 34 | #include <qheader.h> |
34 | #include <qlistview.h> | 35 | #include <qlistview.h> |
35 | #include <qlayout.h> | 36 | #include <qlayout.h> |
37 | #include <qtoolbar.h> | ||
38 | #include <qmenubar.h> | ||
36 | 39 | ||
40 | /* STD */ | ||
37 | #include <fcntl.h> | 41 | #include <fcntl.h> |
38 | #include <unistd.h> | 42 | #include <unistd.h> |
39 | #include <stdlib.h> | 43 | #include <stdlib.h> |
40 | #include <stdio.h> | 44 | #include <stdio.h> |
41 | #include <errno.h> | 45 | #include <errno.h> |
42 | 46 | ||
43 | |||
44 | Bartender::Bartender( QWidget* parent, const char* name, WFlags fl ) | 47 | Bartender::Bartender( QWidget* parent, const char* name, WFlags fl ) |
45 | : QMainWindow( parent, name, fl ) { | 48 | : QMainWindow( parent, name, fl ) { |
46 | if ( !name ) | 49 | if ( !name ) |
47 | setName( "Bartender" ); | 50 | setName( "Bartender" ); |
48 | QGridLayout *layout = new QGridLayout( this ); | 51 | QGridLayout *layout = new QGridLayout( this ); |
49 | layout->setSpacing( 2); | 52 | layout->setSpacing( 2); |
50 | layout->setMargin( 2); | 53 | layout->setMargin( 2); |
51 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 54 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
@@ -139,23 +142,23 @@ void Bartender::fillList() { | |||
139 | DrinkView->clear(); | 142 | DrinkView->clear(); |
140 | int i=0; | 143 | int i=0; |
141 | QListViewItem * item ; | 144 | QListViewItem * item ; |
142 | QTextStream t( &dbFile); | 145 | QTextStream t( &dbFile); |
143 | QString s; | 146 | QString s; |
144 | while ( !t.eof()) { | 147 | while ( !t.eof()) { |
145 | s = t.readLine(); | 148 | s = t.readLine(); |
146 | if(s.find("#",0,TRUE) != -1) { | 149 | if(s.find("#",0,TRUE) != -1) { |
147 | // qDebug(s.right(s.length()-2)); | 150 | // odebug << s.right(s.length()-2) << oendl; |
148 | item= new QListViewItem( DrinkView, 0 ); | 151 | item= new QListViewItem( DrinkView, 0 ); |
149 | item->setText( 0, s.right(s.length()-2)); | 152 | item->setText( 0, s.right(s.length()-2)); |
150 | i++; | 153 | i++; |
151 | } | 154 | } |
152 | } | 155 | } |
153 | qDebug("there are currently %d of drinks", i); | 156 | odebug << "there are currently " << i << " of drinks" << oendl; |
154 | } | 157 | } |
155 | 158 | ||
156 | void Bartender::fileNew() { | 159 | void Bartender::fileNew() { |
157 | 160 | ||
158 | New_Drink *newDrinks; | 161 | New_Drink *newDrinks; |
159 | newDrinks = new New_Drink(this,"New Drink....", TRUE); | 162 | newDrinks = new New_Drink(this,"New Drink....", TRUE); |
160 | QString newName, newIng; | 163 | QString newName, newIng; |
161 | QPEApplication::execDialog( newDrinks ); | 164 | QPEApplication::execDialog( newDrinks ); |
@@ -166,17 +169,17 @@ void Bartender::fileNew() { | |||
166 | dbFile.close(); | 169 | dbFile.close(); |
167 | if ( !dbFile.open( IO_WriteOnly| IO_Append)) { | 170 | if ( !dbFile.open( IO_WriteOnly| IO_Append)) { |
168 | QMessageBox::message( (tr("Note")), (tr("Drink database not opened sucessfully.\n")) ); | 171 | QMessageBox::message( (tr("Note")), (tr("Drink database not opened sucessfully.\n")) ); |
169 | return; | 172 | return; |
170 | } | 173 | } |
171 | if(newDrinks ->result() == 1 ) { | 174 | if(newDrinks ->result() == 1 ) { |
172 | QString newDrink="\n# "+newName+"\n"; | 175 | QString newDrink="\n# "+newName+"\n"; |
173 | newDrink.append(newIng+"\n"); | 176 | newDrink.append(newIng+"\n"); |
174 | qDebug("writing "+newDrink); | 177 | odebug << "writing "+newDrink << oendl; |
175 | dbFile.writeBlock( newDrink.latin1(), newDrink.length()); | 178 | dbFile.writeBlock( newDrink.latin1(), newDrink.length()); |
176 | clearList(); | 179 | clearList(); |
177 | dbFile.close(); | 180 | dbFile.close(); |
178 | 181 | ||
179 | initDrinkDb(); | 182 | initDrinkDb(); |
180 | } | 183 | } |
181 | delete newDrinks; | 184 | delete newDrinks; |
182 | } | 185 | } |
@@ -202,17 +205,17 @@ void Bartender::showDrink( QListViewItem *item) { | |||
202 | 205 | ||
203 | QString s, s2; | 206 | QString s, s2; |
204 | while ( !t.eof()) { | 207 | while ( !t.eof()) { |
205 | s = t.readLine(); | 208 | s = t.readLine(); |
206 | if(s.find( myDrink, 0, TRUE) != -1) { | 209 | if(s.find( myDrink, 0, TRUE) != -1) { |
207 | for(int i=0;s2.find( "#", 0, TRUE) == -1;i++) { | 210 | for(int i=0;s2.find( "#", 0, TRUE) == -1;i++) { |
208 | s2 = t.readLine(); | 211 | s2 = t.readLine(); |
209 | if(s2.find("#",0,TRUE) == -1 || dbFile.atEnd() ) { | 212 | if(s2.find("#",0,TRUE) == -1 || dbFile.atEnd() ) { |
210 | // qDebug(s2); | 213 | // odebug << s2 << oendl; |
211 | showDrinks->MultiLineEdit1->append(s2); | 214 | showDrinks->MultiLineEdit1->append(s2); |
212 | } | 215 | } |
213 | if( dbFile.atEnd() ) break; | 216 | if( dbFile.atEnd() ) break; |
214 | } | 217 | } |
215 | } | 218 | } |
216 | } | 219 | } |
217 | QPEApplication::execDialog( showDrinks ); | 220 | QPEApplication::execDialog( showDrinks ); |
218 | 221 | ||
@@ -243,17 +246,17 @@ void Bartender::doSearchByName() { | |||
243 | InputDialog *fileDlg; | 246 | InputDialog *fileDlg; |
244 | fileDlg = new InputDialog(this,tr("Find by Drink Name"),TRUE, 0); | 247 | fileDlg = new InputDialog(this,tr("Find by Drink Name"),TRUE, 0); |
245 | fileDlg->exec(); | 248 | fileDlg->exec(); |
246 | if( fileDlg->result() == 1 ) { | 249 | if( fileDlg->result() == 1 ) { |
247 | searchForDrinkName = fileDlg->LineEdit1->text(); | 250 | searchForDrinkName = fileDlg->LineEdit1->text(); |
248 | QListViewItemIterator it( DrinkView ); | 251 | QListViewItemIterator it( DrinkView ); |
249 | for ( ; it.current(); ++it ) { | 252 | for ( ; it.current(); ++it ) { |
250 | if ( it.current()->text(0).find( searchForDrinkName, 0, TRUE) != -1 ) { | 253 | if ( it.current()->text(0).find( searchForDrinkName, 0, TRUE) != -1 ) { |
251 | // qDebug( it.current()->text(0)); | 254 | // odebug << it.current()->text(0) << oendl; |
252 | searchList.append(it.current()->text(0)); | 255 | searchList.append(it.current()->text(0)); |
253 | } | 256 | } |
254 | } | 257 | } |
255 | if(searchList.count() >0) | 258 | if(searchList.count() >0) |
256 | showSearchResult(searchList); | 259 | showSearchResult(searchList); |
257 | else | 260 | else |
258 | QMessageBox::message(tr("Search"),tr("Sorry no results for\n")+searchForDrinkName); | 261 | QMessageBox::message(tr("Search"),tr("Sorry no results for\n")+searchForDrinkName); |
259 | }//end Inputdialog | 262 | }//end Inputdialog |
@@ -274,20 +277,20 @@ void Bartender::doSearchByDrink() { | |||
274 | dbFile.at(0); | 277 | dbFile.at(0); |
275 | QTextStream t( &dbFile); | 278 | QTextStream t( &dbFile); |
276 | 279 | ||
277 | QString s, s2; | 280 | QString s, s2; |
278 | while ( !t.eof()) { | 281 | while ( !t.eof()) { |
279 | s = t.readLine(); | 282 | s = t.readLine(); |
280 | if(s.find("#",0,TRUE) != -1) { | 283 | if(s.find("#",0,TRUE) != -1) { |
281 | lastDrinkName=s.right(s.length()-2); | 284 | lastDrinkName=s.right(s.length()-2); |
282 | // qDebug("last drink name "+lastDrinkName); | 285 | // odebug << "last drink name "+lastDrinkName << oendl; |
283 | } | 286 | } |
284 | else if( s.find( searchForDrinkName ,0, FALSE) != -1 && lastDrinkName != tempName ) { | 287 | else if( s.find( searchForDrinkName ,0, FALSE) != -1 && lastDrinkName != tempName ) { |
285 | // qDebug("appending "+lastDrinkName); | 288 | // odebug << "appending "+lastDrinkName << oendl; |
286 | searchList.append( lastDrinkName); | 289 | searchList.append( lastDrinkName); |
287 | tempName=lastDrinkName; | 290 | tempName=lastDrinkName; |
288 | } | 291 | } |
289 | // if( dbFile.atEnd() ) break; | 292 | // if( dbFile.atEnd() ) break; |
290 | 293 | ||
291 | } //oef | 294 | } //oef |
292 | if(searchList.count() >0) | 295 | if(searchList.count() >0) |
293 | showSearchResult(searchList); | 296 | showSearchResult(searchList); |
@@ -308,17 +311,17 @@ void Bartender::showSearchResult(QStringList &searchList) { | |||
308 | QPEApplication::execDialog( searchDlg ); | 311 | QPEApplication::execDialog( searchDlg ); |
309 | 312 | ||
310 | if( searchDlg->result() == 1 ) { | 313 | if( searchDlg->result() == 1 ) { |
311 | result= searchDlg->ListBox1->currentText(); | 314 | result= searchDlg->ListBox1->currentText(); |
312 | } | 315 | } |
313 | QListViewItemIterator it2( DrinkView ); | 316 | QListViewItemIterator it2( DrinkView ); |
314 | for ( ; it2.current(); ++it2 ) { | 317 | for ( ; it2.current(); ++it2 ) { |
315 | if ( it2.current()->text(0)== result ) { | 318 | if ( it2.current()->text(0)== result ) { |
316 | // qDebug( it2.current()->text(0)); | 319 | // odebug << it2.current()->text(0) << oendl; |
317 | showDrink(it2.current()); | 320 | showDrink(it2.current()); |
318 | } | 321 | } |
319 | } | 322 | } |
320 | delete searchDlg; | 323 | delete searchDlg; |
321 | } | 324 | } |
322 | 325 | ||
323 | void Bartender::doEdit() { | 326 | void Bartender::doEdit() { |
324 | if(DrinkView->currentItem() == NULL) { | 327 | if(DrinkView->currentItem() == NULL) { |
@@ -338,17 +341,17 @@ void Bartender::doEdit() { | |||
338 | QString s, s2; | 341 | QString s, s2; |
339 | while ( !t.eof()) { | 342 | while ( !t.eof()) { |
340 | s = t.readLine(); | 343 | s = t.readLine(); |
341 | if(s.find( myDrink, 0, TRUE) != -1) { | 344 | if(s.find( myDrink, 0, TRUE) != -1) { |
342 | foundAt = dbFile.at() - (s.length()+1); | 345 | foundAt = dbFile.at() - (s.length()+1); |
343 | for(int i=0;s2.find( "#", 0, TRUE) == -1;i++) { | 346 | for(int i=0;s2.find( "#", 0, TRUE) == -1;i++) { |
344 | s2 = t.readLine(); | 347 | s2 = t.readLine(); |
345 | if(s2.find("#",0,TRUE) == -1 || dbFile.atEnd() ) { | 348 | if(s2.find("#",0,TRUE) == -1 || dbFile.atEnd() ) { |
346 | // qDebug(s2); | 349 | // odebug << s2 << oendl; |
347 | newDrinks->MultiLineEdit1->append(s2); | 350 | newDrinks->MultiLineEdit1->append(s2); |
348 | newDrinks->LineEdit1->setText(myDrink); | 351 | newDrinks->LineEdit1->setText(myDrink); |
349 | } | 352 | } |
350 | if( dbFile.atEnd() ) break; | 353 | if( dbFile.atEnd() ) break; |
351 | } | 354 | } |
352 | } | 355 | } |
353 | } | 356 | } |
354 | newDrinks->exec(); | 357 | newDrinks->exec(); |
@@ -365,17 +368,17 @@ void Bartender::doEdit() { | |||
365 | int fd = dbFile.handle(); | 368 | int fd = dbFile.handle(); |
366 | lseek( fd, foundAt, SEEK_SET); | 369 | lseek( fd, foundAt, SEEK_SET); |
367 | 370 | ||
368 | // dbFile.at( foundAt); | 371 | // dbFile.at( foundAt); |
369 | #warning FIXME problems with editing drinks db | 372 | #warning FIXME problems with editing drinks db |
370 | ////////// FIXME write to user file | 373 | ////////// FIXME write to user file |
371 | QString newDrink="# "+newName+"\n"; | 374 | QString newDrink="# "+newName+"\n"; |
372 | newDrink.append(newIng+"\n"); | 375 | newDrink.append(newIng+"\n"); |
373 | qDebug("writing "+newDrink); | 376 | odebug << "writing "+newDrink << oendl; |
374 | dbFile.writeBlock( newDrink.latin1(), newDrink.length()); | 377 | dbFile.writeBlock( newDrink.latin1(), newDrink.length()); |
375 | clearList(); | 378 | clearList(); |
376 | 379 | ||
377 | dbFile.flush(); | 380 | dbFile.flush(); |
378 | 381 | ||
379 | initDrinkDb(); | 382 | initDrinkDb(); |
380 | } | 383 | } |
381 | } | 384 | } |
@@ -392,17 +395,17 @@ void Bartender::doBac() { | |||
392 | } | 395 | } |
393 | 396 | ||
394 | void Bartender::openCurrentDrink() { | 397 | void Bartender::openCurrentDrink() { |
395 | if(DrinkView->currentItem() == NULL) return; | 398 | if(DrinkView->currentItem() == NULL) return; |
396 | showDrink(DrinkView->currentItem()); | 399 | showDrink(DrinkView->currentItem()); |
397 | } | 400 | } |
398 | 401 | ||
399 | void Bartender::fileMenuActivated( int item) { | 402 | void Bartender::fileMenuActivated( int item) { |
400 | qDebug("Item %d", item); | 403 | odebug << "Item " << item << "" << oendl; |
401 | switch(item) { | 404 | switch(item) { |
402 | case -3: // new -3 | 405 | case -3: // new -3 |
403 | fileNew(); | 406 | fileNew(); |
404 | break; | 407 | break; |
405 | case -4:// open -4 | 408 | case -4:// open -4 |
406 | openCurrentDrink(); | 409 | openCurrentDrink(); |
407 | break; | 410 | break; |
408 | case -5:// drink -5 | 411 | case -5:// drink -5 |
@@ -413,17 +416,17 @@ void Bartender::fileMenuActivated( int item) { | |||
413 | doSearchByDrink(); | 416 | doSearchByDrink(); |
414 | 417 | ||
415 | break; | 418 | break; |
416 | 419 | ||
417 | } | 420 | } |
418 | } | 421 | } |
419 | 422 | ||
420 | void Bartender::editMenuActivated(int item) { | 423 | void Bartender::editMenuActivated(int item) { |
421 | qDebug("Item %d", item); | 424 | odebug << "Item " << item << "" << oendl; |
422 | /* | 425 | /* |
423 | edit -8 | 426 | edit -8 |
424 | */ | 427 | */ |
425 | switch(item) { | 428 | switch(item) { |
426 | case -8: | 429 | case -8: |
427 | doEdit() ; | 430 | doEdit() ; |
428 | break; | 431 | break; |
429 | 432 | ||
diff --git a/noncore/apps/opie-bartender/bartender.pro b/noncore/apps/opie-bartender/bartender.pro index 4ad3c31..41fc0e5 100644 --- a/noncore/apps/opie-bartender/bartender.pro +++ b/noncore/apps/opie-bartender/bartender.pro | |||
@@ -1,12 +1,11 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | #CONFIG = qt warn_on | ||
3 | CONFIG = qt warn_on | 2 | CONFIG = qt warn_on |
4 | HEADERS = bartender.h newdrinks.h showdrinks.h inputDialog.h searchresults.h bac.h | 3 | HEADERS = bartender.h newdrinks.h showdrinks.h inputDialog.h searchresults.h bac.h |
5 | SOURCES = main.cpp bartender.cpp newdrinks.cpp showdrinks.cpp inputDialog.cpp searchresults.cpp bac.cpp | 4 | SOURCES = main.cpp bartender.cpp newdrinks.cpp showdrinks.cpp inputDialog.cpp searchresults.cpp bac.cpp |
6 | INCLUDEPATH += $(OPIEDIR)/include | 5 | INCLUDEPATH += $(OPIEDIR)/include |
7 | DEPENDPATH += $(OPIEDIR)/include | 6 | DEPENDPATH += $(OPIEDIR)/include |
8 | LIBS += -lqpe | 7 | LIBS += -lqpe -lopiecore2 |
9 | DESTDIR = $(OPIEDIR)/bin | 8 | DESTDIR = $(OPIEDIR)/bin |
10 | TARGET = bartender | 9 | TARGET = bartender |
11 | 10 | ||
12 | include ( $(OPIEDIR)/include.pro ) | 11 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/apps/opie-bartender/config.in b/noncore/apps/opie-bartender/config.in index c6ca2e6..c39a7d6 100644 --- a/noncore/apps/opie-bartender/config.in +++ b/noncore/apps/opie-bartender/config.in | |||
@@ -1,4 +1,5 @@ | |||
1 | config BARTENDER | 1 | config BARTENDER |
2 | boolean "bartender - bar receipe and blood alcohol estimator" | 2 | boolean "bartender - bar receipe and blood alcohol estimator" |
3 | default "n" | 3 | default "n" |
4 | depends ( LIBQPE || LIBQPE-X11 ) | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE |
5 | |||
diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp index a37f980..6d57703 100644 --- a/noncore/apps/opie-console/MyPty.cpp +++ b/noncore/apps/opie-console/MyPty.cpp | |||
@@ -58,51 +58,55 @@ | |||
58 | 58 | ||
59 | Another technic are UNIX 98 PTY's. These are supported also, and prefered | 59 | Another technic are UNIX 98 PTY's. These are supported also, and prefered |
60 | over the (obsolete) predecessor. | 60 | over the (obsolete) predecessor. |
61 | 61 | ||
62 | There's a sinister ioctl(2), signal(2) and job control stuff | 62 | There's a sinister ioctl(2), signal(2) and job control stuff |
63 | nessesary to make everything work as it should. | 63 | nessesary to make everything work as it should. |
64 | */ | 64 | */ |
65 | 65 | ||
66 | #include "procctl.h" | ||
67 | #include "MyPty.h" | ||
66 | 68 | ||
69 | /* OPIE */ | ||
70 | #include <opie2/odebug.h> | ||
71 | using namespace Opie::Core; | ||
72 | |||
73 | /* QT */ | ||
67 | #include <qsocketnotifier.h> | 74 | #include <qsocketnotifier.h> |
68 | #include <qfile.h> | 75 | #include <qfile.h> |
69 | 76 | ||
77 | /* STD */ | ||
70 | #include <stdlib.h> | 78 | #include <stdlib.h> |
71 | #include <stdio.h> | 79 | #include <stdio.h> |
72 | #include <signal.h> | 80 | #include <signal.h> |
73 | #include <fcntl.h> | 81 | #include <fcntl.h> |
74 | #include <unistd.h> | 82 | #include <unistd.h> |
75 | #include <termios.h> | 83 | #include <termios.h> |
76 | #include <sys/types.h> | 84 | #include <sys/types.h> |
77 | #include <sys/ioctl.h> | 85 | #include <sys/ioctl.h> |
78 | #include <sys/wait.h> | 86 | #include <sys/wait.h> |
79 | 87 | ||
80 | #ifdef HAVE_OPENPTY | 88 | #ifdef HAVE_OPENPTY |
81 | #include <pty.h> | 89 | #include <pty.h> |
82 | #endif | 90 | #endif |
83 | 91 | ||
84 | #include "procctl.h" | ||
85 | #include "MyPty.h" | ||
86 | |||
87 | |||
88 | #undef VERBOSE_DEBUG | 92 | #undef VERBOSE_DEBUG |
89 | 93 | ||
90 | 94 | ||
91 | /* -------------------------------------------------------------------------- */ | 95 | /* -------------------------------------------------------------------------- */ |
92 | 96 | ||
93 | /*! | 97 | /*! |
94 | Informs the client program about the | 98 | Informs the client program about the |
95 | actual size of the window. | 99 | actual size of the window. |
96 | */ | 100 | */ |
97 | 101 | ||
98 | void MyPty::setSize(int lines, int columns) | 102 | void MyPty::setSize(int lines, int columns) |
99 | { | 103 | { |
100 | qWarning("setting size"); | 104 | owarn << "setting size" << oendl; |
101 | struct winsize wsize; | 105 | struct winsize wsize; |
102 | wsize.ws_row = (unsigned short)lines; | 106 | wsize.ws_row = (unsigned short)lines; |
103 | wsize.ws_col = (unsigned short)columns; | 107 | wsize.ws_col = (unsigned short)columns; |
104 | if(m_fd < 0) return; | 108 | if(m_fd < 0) return; |
105 | ioctl(m_fd,TIOCSWINSZ,(char *)&wsize); | 109 | ioctl(m_fd,TIOCSWINSZ,(char *)&wsize); |
106 | } | 110 | } |
107 | 111 | ||
108 | 112 | ||
diff --git a/noncore/apps/opie-console/TEWidget.cpp b/noncore/apps/opie-console/TEWidget.cpp index e535296..d168a5e 100644 --- a/noncore/apps/opie-console/TEWidget.cpp +++ b/noncore/apps/opie-console/TEWidget.cpp | |||
@@ -1024,17 +1024,17 @@ bool TEWidget::eventFilter( QObject *obj, QEvent *e ) | |||
1024 | return FALSE; // not us | 1024 | return FALSE; // not us |
1025 | if ( e->type() == QEvent::Wheel) { | 1025 | if ( e->type() == QEvent::Wheel) { |
1026 | QApplication::sendEvent(scrollbar, e); | 1026 | QApplication::sendEvent(scrollbar, e); |
1027 | } | 1027 | } |
1028 | 1028 | ||
1029 | #ifdef FAKE_CTRL_AND_ALT | 1029 | #ifdef FAKE_CTRL_AND_ALT |
1030 | static bool control = FALSE; | 1030 | static bool control = FALSE; |
1031 | static bool alt = FALSE; | 1031 | static bool alt = FALSE; |
1032 | // qDebug(" Has a keyboard with no CTRL and ALT keys, but we fake it:"); | 1032 | // odebug << " Has a keyboard with no CTRL and ALT keys, but we fake it:" << oendl; |
1033 | bool dele=FALSE; | 1033 | bool dele=FALSE; |
1034 | if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) { | 1034 | if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) { |
1035 | QKeyEvent* ke = (QKeyEvent*)e; | 1035 | QKeyEvent* ke = (QKeyEvent*)e; |
1036 | bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat(); | 1036 | bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat(); |
1037 | switch (ke->key()) { | 1037 | switch (ke->key()) { |
1038 | case Key_F9: // let this be "Control" | 1038 | case Key_F9: // let this be "Control" |
1039 | control = keydown; | 1039 | control = keydown; |
1040 | e = new QKeyEvent(QEvent::KeyPress, Key_Control, 0, ke->state()); | 1040 | e = new QKeyEvent(QEvent::KeyPress, Key_Control, 0, ke->state()); |
@@ -1063,21 +1063,21 @@ bool TEWidget::eventFilter( QObject *obj, QEvent *e ) | |||
1063 | } | 1063 | } |
1064 | #endif | 1064 | #endif |
1065 | 1065 | ||
1066 | if ( e->type() == QEvent::KeyPress ) { | 1066 | if ( e->type() == QEvent::KeyPress ) { |
1067 | QKeyEvent* ke = (QKeyEvent*)e; | 1067 | QKeyEvent* ke = (QKeyEvent*)e; |
1068 | actSel=0; // Key stroke implies a screen update, so TEWidget won't | 1068 | actSel=0; // Key stroke implies a screen update, so TEWidget won't |
1069 | // know where the current selection is. | 1069 | // know where the current selection is. |
1070 | 1070 | ||
1071 | // qDebug("key pressed is 0x%x",ke->key()); | 1071 | // odebug << "key pressed is 0x" << ke->key() << "" << oendl; |
1072 | 1072 | ||
1073 | if( ke->state() == ShiftButton && ke->key() == Key_Tab) { //lets hardcode this sucker | 1073 | if( ke->state() == ShiftButton && ke->key() == Key_Tab) { //lets hardcode this sucker |
1074 | 1074 | ||
1075 | // qDebug("key pressed 2 is 0x%x",ke->key()); | 1075 | // odebug << "key pressed 2 is 0x" << ke->key() << "" << oendl; |
1076 | emitText("\\"); // expose | 1076 | emitText("\\"); // expose |
1077 | } else | 1077 | } else |
1078 | emit keyPressedSignal(ke); // expose | 1078 | emit keyPressedSignal(ke); // expose |
1079 | ke->accept(); | 1079 | ke->accept(); |
1080 | #ifdef FAKE_CTRL_AND_ALT | 1080 | #ifdef FAKE_CTRL_AND_ALT |
1081 | if ( dele ) delete e; | 1081 | if ( dele ) delete e; |
1082 | #endif | 1082 | #endif |
1083 | return true; // stop the event | 1083 | return true; // stop the event |
diff --git a/noncore/apps/opie-console/TEmulation.cpp b/noncore/apps/opie-console/TEmulation.cpp index d0169d7..6ff73af 100644 --- a/noncore/apps/opie-console/TEmulation.cpp +++ b/noncore/apps/opie-console/TEmulation.cpp | |||
@@ -65,16 +65,22 @@ | |||
65 | of incoming bulks (`bulk_incnt'). | 65 | of incoming bulks (`bulk_incnt'). |
66 | */ | 66 | */ |
67 | 67 | ||
68 | /* FIXME | 68 | /* FIXME |
69 | - evtl. the bulk operations could be made more transparent. | 69 | - evtl. the bulk operations could be made more transparent. |
70 | */ | 70 | */ |
71 | 71 | ||
72 | #include "TEmulation.h" | 72 | #include "TEmulation.h" |
73 | |||
74 | /* OPIE */ | ||
75 | #include <opie2/odebug.h> | ||
76 | using namespace Opie::Core; | ||
77 | |||
78 | /* STD */ | ||
73 | #include <stdio.h> | 79 | #include <stdio.h> |
74 | #include <stdlib.h> | 80 | #include <stdlib.h> |
75 | #include <unistd.h> | 81 | #include <unistd.h> |
76 | 82 | ||
77 | 83 | ||
78 | /* ------------------------------------------------------------------------- */ | 84 | /* ------------------------------------------------------------------------- */ |
79 | /* */ | 85 | /* */ |
80 | /* TEmulation */ | 86 | /* TEmulation */ |
@@ -199,17 +205,17 @@ void TEmulation::onRcvChar(int c) | |||
199 | /* */ | 205 | /* */ |
200 | /* ------------------------------------------------------------------------- */ | 206 | /* ------------------------------------------------------------------------- */ |
201 | 207 | ||
202 | /*! | 208 | /*! |
203 | */ | 209 | */ |
204 | 210 | ||
205 | void TEmulation::onKeyPress( QKeyEvent* ev ) | 211 | void TEmulation::onKeyPress( QKeyEvent* ev ) |
206 | { | 212 | { |
207 | qWarning("onKeyPress,...."); | 213 | owarn << "onKeyPress,...." << oendl; |
208 | if (!connected) return; // someone else gets the keys | 214 | if (!connected) return; // someone else gets the keys |
209 | if (scr->getHistCursor() != scr->getHistLines()); | 215 | if (scr->getHistCursor() != scr->getHistLines()); |
210 | scr->setHistCursor(scr->getHistLines()); | 216 | scr->setHistCursor(scr->getHistLines()); |
211 | if (!ev->text().isEmpty()) | 217 | if (!ev->text().isEmpty()) |
212 | { // A block of text | 218 | { // A block of text |
213 | // Note that the text is proper unicode. | 219 | // Note that the text is proper unicode. |
214 | // We should do a conversion here, but since this | 220 | // We should do a conversion here, but since this |
215 | // routine will never be used, we simply emit plain ascii. | 221 | // routine will never be used, we simply emit plain ascii. |
diff --git a/noncore/apps/opie-console/atconfigdialog.cpp b/noncore/apps/opie-console/atconfigdialog.cpp index 8e91b9e..c998f96 100644 --- a/noncore/apps/opie-console/atconfigdialog.cpp +++ b/noncore/apps/opie-console/atconfigdialog.cpp | |||
@@ -1,21 +1,24 @@ | |||
1 | #include "atconfigdialog.h" | ||
2 | #include "io_modem.h" | ||
1 | 3 | ||
4 | /* OPIE */ | ||
5 | #include <opie2/odebug.h> | ||
6 | using namespace Opie::Core; | ||
7 | |||
8 | /* QT */ | ||
2 | #include <qlineedit.h> | 9 | #include <qlineedit.h> |
3 | #include <qspinbox.h> | 10 | #include <qspinbox.h> |
4 | #include <qlayout.h> | 11 | #include <qlayout.h> |
5 | #include <qcombobox.h> | 12 | #include <qcombobox.h> |
6 | #include <qtabwidget.h> | 13 | #include <qtabwidget.h> |
7 | #include <qlabel.h> | 14 | #include <qlabel.h> |
8 | #include <qscrollview.h> | 15 | #include <qscrollview.h> |
9 | 16 | ||
10 | #include "atconfigdialog.h" | ||
11 | #include "io_modem.h" | ||
12 | |||
13 | |||
14 | ATConfigDialog::ATConfigDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) | 17 | ATConfigDialog::ATConfigDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) |
15 | : QDialog( parent, name, modal, fl ) { | 18 | : QDialog( parent, name, modal, fl ) { |
16 | 19 | ||
17 | 20 | ||
18 | setCaption( tr( "Dialing parameter setup" ) ); | 21 | setCaption( tr( "Dialing parameter setup" ) ); |
19 | 22 | ||
20 | QVBoxLayout *layout = new QVBoxLayout( this ); | 23 | QVBoxLayout *layout = new QVBoxLayout( this ); |
21 | QTabWidget *tabWidget = new QTabWidget( this ); | 24 | QTabWidget *tabWidget = new QTabWidget( this ); |
@@ -147,17 +150,17 @@ QWidget* ATConfigDialog::tab1( QWidget* parent ) { | |||
147 | multiLineUntagBox->insertItem( tr("Yes") ); | 150 | multiLineUntagBox->insertItem( tr("Yes") ); |
148 | 151 | ||
149 | return returnWidget; | 152 | return returnWidget; |
150 | 153 | ||
151 | } | 154 | } |
152 | 155 | ||
153 | 156 | ||
154 | void ATConfigDialog::readConfig( const Profile& config ) { | 157 | void ATConfigDialog::readConfig( const Profile& config ) { |
155 | qWarning("config in atconfigdialog"); | 158 | owarn << "config in atconfigdialog" << oendl; |
156 | 159 | ||
157 | initStringLine->setText( config.readEntry("InitString", MODEM_DEFAULT_INIT_STRING ) ); | 160 | initStringLine->setText( config.readEntry("InitString", MODEM_DEFAULT_INIT_STRING ) ); |
158 | resetStringLine->setText( config.readEntry("ResetString", MODEM_DEFAULT_RESET_STRING ) ); | 161 | resetStringLine->setText( config.readEntry("ResetString", MODEM_DEFAULT_RESET_STRING ) ); |
159 | dialPref1Line->setText( config.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 ) ); | 162 | dialPref1Line->setText( config.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 ) ); |
160 | dialSuf1Line->setText( config.readEntry("DialSuffix1", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); | 163 | dialSuf1Line->setText( config.readEntry("DialSuffix1", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); |
161 | dialPref2Line->setText( config.readEntry("DialPrefix2", MODEM_DEFAULT_DIAL_PREFIX1 ) ); | 164 | dialPref2Line->setText( config.readEntry("DialPrefix2", MODEM_DEFAULT_DIAL_PREFIX1 ) ); |
162 | dialSuf2Line->setText( config.readEntry("DialSuffix2", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); | 165 | dialSuf2Line->setText( config.readEntry("DialSuffix2", MODEM_DEFAULT_DIAL_SUFFIX1 ) ); |
163 | dialPref3Line->setText( config.readEntry("DialPrefix3", MODEM_DEFAULT_DIAL_PREFIX1 ) ); | 166 | dialPref3Line->setText( config.readEntry("DialPrefix3", MODEM_DEFAULT_DIAL_PREFIX1 ) ); |
diff --git a/noncore/apps/opie-console/dialer.cpp b/noncore/apps/opie-console/dialer.cpp index 67ad10e..7010594 100644 --- a/noncore/apps/opie-console/dialer.cpp +++ b/noncore/apps/opie-console/dialer.cpp | |||
@@ -1,25 +1,30 @@ | |||
1 | #include "dialer.h" | 1 | #include "dialer.h" |
2 | #include "io_modem.h" | ||
3 | |||
4 | /* OPIE */ | ||
5 | #include <opie2/odebug.h> | ||
6 | using namespace Opie::Core; | ||
2 | 7 | ||
8 | /* QT */ | ||
3 | #include <qlayout.h> | 9 | #include <qlayout.h> |
4 | #include <qprogressbar.h> | 10 | #include <qprogressbar.h> |
5 | #include <qlabel.h> | 11 | #include <qlabel.h> |
6 | #include <qpushbutton.h> | 12 | #include <qpushbutton.h> |
7 | #include <qapp.h> | 13 | #include <qapp.h> |
8 | #include <qtimer.h> | 14 | #include <qtimer.h> |
9 | #include <qmessagebox.h> | 15 | #include <qmessagebox.h> |
10 | 16 | ||
17 | /* STD */ | ||
11 | #include <unistd.h> | 18 | #include <unistd.h> |
12 | #include <string.h> | 19 | #include <string.h> |
13 | #include <fcntl.h> | 20 | #include <fcntl.h> |
14 | #include <errno.h> | 21 | #include <errno.h> |
15 | 22 | ||
16 | #include "io_modem.h" | ||
17 | |||
18 | // State machine: | When an error occurs, we don't have to | 23 | // State machine: | When an error occurs, we don't have to |
19 | // | reset everything. | 24 | // | reset everything. |
20 | // (init) <------+ | But if the user wants to reset, | 25 | // (init) <------+ | But if the user wants to reset, |
21 | // | | | we stop dialing immediately. | 26 | // | | | we stop dialing immediately. |
22 | // v | | | 27 | // v | | |
23 | // (options) ----+ | Following the state machine is necessary | 28 | // (options) ----+ | Following the state machine is necessary |
24 | // | \ | to get determinable results. | 29 | // | \ | to get determinable results. |
25 | // v ^ | | 30 | // v ^ | |
@@ -99,17 +104,17 @@ void Dialer::slotCancel() | |||
99 | } | 104 | } |
100 | else { | 105 | else { |
101 | accept(); | 106 | accept(); |
102 | } | 107 | } |
103 | } | 108 | } |
104 | 109 | ||
105 | void Dialer::reset() | 110 | void Dialer::reset() |
106 | { | 111 | { |
107 | qWarning("reset"); | 112 | owarn << "reset" << oendl; |
108 | switchState(state_cancel); | 113 | switchState(state_cancel); |
109 | } | 114 | } |
110 | 115 | ||
111 | void Dialer::slotAutostart() | 116 | void Dialer::slotAutostart() |
112 | { | 117 | { |
113 | //state = state_preinit; | 118 | //state = state_preinit; |
114 | dial(m_profile.readEntry("Number")); | 119 | dial(m_profile.readEntry("Number")); |
115 | } | 120 | } |
@@ -131,39 +136,39 @@ void Dialer::dial(const QString& number) | |||
131 | // modem hangup | 136 | // modem hangup |
132 | trydial(QString::null); | 137 | trydial(QString::null); |
133 | reject(); | 138 | reject(); |
134 | } | 139 | } |
135 | } | 140 | } |
136 | 141 | ||
137 | void Dialer::trydial(const QString& number) | 142 | void Dialer::trydial(const QString& number) |
138 | { | 143 | { |
139 | qWarning("TryDial:%s", number.latin1() ); | 144 | owarn << "TryDial:" << number.latin1() << "" << oendl; |
140 | if(state != state_cancel) switchState(state_preinit); | 145 | if(state != state_cancel) switchState(state_preinit); |
141 | if(cleanshutdown) | 146 | if(cleanshutdown) |
142 | { | 147 | { |
143 | qWarning("HangupString " + m_profile.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING)); | 148 | owarn << "HangupString " << m_profile.readEntry("HangupString") << oendl; |
144 | send(m_profile.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ) + "\r"); | 149 | send(m_profile.readEntry("HangupString", MODEM_DEFAULT_HANGUP_STRING ) + "\r"); |
145 | } | 150 | } |
146 | 151 | ||
147 | if(state != state_cancel) | 152 | if(state != state_cancel) |
148 | { | 153 | { |
149 | switchState(state_init); | 154 | switchState(state_init); |
150 | // qWarning("Init String " + m_profile.readEntry("InitString") ); | 155 | // owarn << "Init String " + m_profile.readEntry("InitString") << oendl; |
151 | send(m_profile.readEntry("InitString",MODEM_DEFAULT_INIT_STRING ) + "\r"); | 156 | send(m_profile.readEntry("InitString",MODEM_DEFAULT_INIT_STRING ) + "\r"); |
152 | QString response2 = receive(); | 157 | QString response2 = receive(); |
153 | if(!response2.contains("\nOK\r")) | 158 | if(!response2.contains("\nOK\r")) |
154 | reset(); | 159 | reset(); |
155 | } | 160 | } |
156 | 161 | ||
157 | /*if(state != state_cancel) | 162 | /*if(state != state_cancel) |
158 | { | 163 | { |
159 | switchState(state_options); | 164 | switchState(state_options); |
160 | 165 | ||
161 | qWarning("ATM3l3"); | 166 | owarn << "ATM3l3" << oendl; |
162 | send("ATM3L3\r"); | 167 | send("ATM3L3\r"); |
163 | QString response3 = receive(); | 168 | QString response3 = receive(); |
164 | if(!response3.contains("\nOK\r")) | 169 | if(!response3.contains("\nOK\r")) |
165 | reset(); | 170 | reset(); |
166 | } | 171 | } |
167 | */ | 172 | */ |
168 | 173 | ||
169 | if(state != state_cancel) | 174 | if(state != state_cancel) |
@@ -173,17 +178,17 @@ void Dialer::trydial(const QString& number) | |||
173 | send("ATX1\r"); | 178 | send("ATX1\r"); |
174 | QString response4 = receive(); | 179 | QString response4 = receive(); |
175 | if(!response4.contains("\nOK\r")) | 180 | if(!response4.contains("\nOK\r")) |
176 | reset(); | 181 | reset(); |
177 | } | 182 | } |
178 | 183 | ||
179 | if(state != state_cancel) | 184 | if(state != state_cancel) |
180 | { | 185 | { |
181 | qWarning("progress"); | 186 | owarn << "progress" << oendl; |
182 | switchState(state_dialing); | 187 | switchState(state_dialing); |
183 | 188 | ||
184 | // send(QString("ATDT %1\r").arg(number)); | 189 | // send(QString("ATDT %1\r").arg(number)); |
185 | send(QString("%1 %2\r").arg(m_profile.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 )) | 190 | send(QString("%1 %2\r").arg(m_profile.readEntry("DialPrefix1", MODEM_DEFAULT_DIAL_PREFIX1 )) |
186 | .arg(number)); | 191 | .arg(number)); |
187 | 192 | ||
188 | QString response5 = receive(); | 193 | QString response5 = receive(); |
189 | if(!response5.contains("CONNECT") ) | 194 | if(!response5.contains("CONNECT") ) |
@@ -209,17 +214,17 @@ void Dialer::trydial(const QString& number) | |||
209 | } | 214 | } |
210 | 215 | ||
211 | void Dialer::send(const QString& msg) | 216 | void Dialer::send(const QString& msg) |
212 | { | 217 | { |
213 | QString m = msg; | 218 | QString m = msg; |
214 | int bytes; | 219 | int bytes; |
215 | QString termination; | 220 | QString termination; |
216 | 221 | ||
217 | qWarning("Sending: %s", m.latin1()); | 222 | owarn << "Sending: " << m.latin1() << "" << oendl; |
218 | 223 | ||
219 | /*termination = "\r"; | 224 | /*termination = "\r"; |
220 | //termination = m_profile.readEntry("Termination"); | 225 | //termination = m_profile.readEntry("Termination"); |
221 | if(termination == "\n") m = m + "\n"; | 226 | if(termination == "\n") m = m + "\n"; |
222 | else if(termination == "\r") m = m + "\r"; | 227 | else if(termination == "\r") m = m + "\r"; |
223 | else m = m + "\r\n"; | 228 | else m = m + "\r\n"; |
224 | */ | 229 | */ |
225 | m = m.replace(QRegExp("\n"), "\r"); | 230 | m = m.replace(QRegExp("\n"), "\r"); |
@@ -242,21 +247,21 @@ QString Dialer::receive() | |||
242 | { | 247 | { |
243 | ret = ::read(m_fd, buffer, sizeof(buffer)); | 248 | ret = ::read(m_fd, buffer, sizeof(buffer)); |
244 | 249 | ||
245 | if(ret > 0) | 250 | if(ret > 0) |
246 | { | 251 | { |
247 | for(int i = 0; i < ret; i++) | 252 | for(int i = 0; i < ret; i++) |
248 | buffer[i] = buffer[i] & 0x7F; | 253 | buffer[i] = buffer[i] & 0x7F; |
249 | buffer[ret] = 0; | 254 | buffer[ret] = 0; |
250 | qWarning("Got: %s", buffer); | 255 | owarn << "Got: " << buffer << "" << oendl; |
251 | buf.append(QString(buffer)); | 256 | buf.append(QString(buffer)); |
252 | if(buf.contains("OK") || buf.contains("ERROR") || buf.contains("CONNECT") || (buf.contains("BUSY"))) | 257 | if(buf.contains("OK") || buf.contains("ERROR") || buf.contains("CONNECT") || (buf.contains("BUSY"))) |
253 | { | 258 | { |
254 | //qWarning("Receiving: '%s'", buf.latin1()); | 259 | //owarn << "Receiving: '" << buf.latin1() << "'" << oendl; |
255 | cleanshutdown = 1; | 260 | cleanshutdown = 1; |
256 | return buf; | 261 | return buf; |
257 | }else if (buf.contains("NO CARRIER") || buf.contains("NO DIALTONE") ) { | 262 | }else if (buf.contains("NO CARRIER") || buf.contains("NO DIALTONE") ) { |
258 | cleanshutdown = 1; | 263 | cleanshutdown = 1; |
259 | return QString::null; | 264 | return QString::null; |
260 | } | 265 | } |
261 | } | 266 | } |
262 | else if(ret < 0) | 267 | else if(ret < 0) |
diff --git a/noncore/apps/opie-console/emulation_handler.cpp b/noncore/apps/opie-console/emulation_handler.cpp index 99d069f..89b70c6 100644 --- a/noncore/apps/opie-console/emulation_handler.cpp +++ b/noncore/apps/opie-console/emulation_handler.cpp | |||
@@ -1,15 +1,17 @@ | |||
1 | |||
2 | #include "TEmuVt102.h" | 1 | #include "TEmuVt102.h" |
3 | |||
4 | #include "profile.h" | 2 | #include "profile.h" |
5 | #include "emulation_handler.h" | 3 | #include "emulation_handler.h" |
6 | #include "script.h" | 4 | #include "script.h" |
7 | 5 | ||
6 | /* OPIE */ | ||
7 | #include <opie2/odebug.h> | ||
8 | using namespace Opie::Core; | ||
9 | |||
8 | EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const char* name ) | 10 | EmulationHandler::EmulationHandler( const Profile& prof, QWidget* parent,const char* name ) |
9 | : QObject(0, name ) | 11 | : QObject(0, name ) |
10 | { | 12 | { |
11 | m_teWid = new TEWidget( parent, "TerminalMain"); | 13 | m_teWid = new TEWidget( parent, "TerminalMain"); |
12 | // use setWrapAt(0) for classic behaviour (wrap at screen width, no scrollbar) | 14 | // use setWrapAt(0) for classic behaviour (wrap at screen width, no scrollbar) |
13 | // use setWrapAt(80) for normal console with scrollbar | 15 | // use setWrapAt(80) for normal console with scrollbar |
14 | setWrap(prof.readNumEntry("Wrap", 0) ? 0 : 80); | 16 | setWrap(prof.readNumEntry("Wrap", 0) ? 0 : 80); |
15 | m_teWid->setMinimumSize(150, 70 ); | 17 | m_teWid->setMinimumSize(150, 70 ); |
@@ -123,21 +125,21 @@ QColor EmulationHandler::foreColor(int col) { | |||
123 | case Profile::White: | 125 | case Profile::White: |
124 | /* color is black */ | 126 | /* color is black */ |
125 | co = Qt::white; | 127 | co = Qt::white; |
126 | break; | 128 | break; |
127 | case Profile::Black: | 129 | case Profile::Black: |
128 | co = Qt::black; | 130 | co = Qt::black; |
129 | break; | 131 | break; |
130 | case Profile::Green: | 132 | case Profile::Green: |
131 | qWarning("Foreground green"); | 133 | owarn << "Foreground green" << oendl; |
132 | co = Qt::green; | 134 | co = Qt::green; |
133 | break; | 135 | break; |
134 | case Profile::Orange: | 136 | case Profile::Orange: |
135 | qWarning("Foreground orange"); | 137 | owarn << "Foreground orange" << oendl; |
136 | co.setRgb( 231, 184, 98 ); | 138 | co.setRgb( 231, 184, 98 ); |
137 | break; | 139 | break; |
138 | } | 140 | } |
139 | 141 | ||
140 | return co; | 142 | return co; |
141 | } | 143 | } |
142 | QColor EmulationHandler::backColor(int col ) { | 144 | QColor EmulationHandler::backColor(int col ) { |
143 | QColor co; | 145 | QColor co; |
@@ -147,21 +149,21 @@ QColor EmulationHandler::backColor(int col ) { | |||
147 | case Profile::White: | 149 | case Profile::White: |
148 | /* color is white */ | 150 | /* color is white */ |
149 | co = Qt::black; | 151 | co = Qt::black; |
150 | break; | 152 | break; |
151 | case Profile::Black: | 153 | case Profile::Black: |
152 | co = Qt::white; | 154 | co = Qt::white; |
153 | break; | 155 | break; |
154 | case Profile::Green: | 156 | case Profile::Green: |
155 | qWarning("Background black"); | 157 | owarn << "Background black" << oendl; |
156 | co = Qt::black; | 158 | co = Qt::black; |
157 | break; | 159 | break; |
158 | case Profile::Orange: | 160 | case Profile::Orange: |
159 | qWarning("Background black"); | 161 | owarn << "Background black" << oendl; |
160 | co = Qt::black; | 162 | co = Qt::black; |
161 | break; | 163 | break; |
162 | } | 164 | } |
163 | 165 | ||
164 | return co; | 166 | return co; |
165 | } | 167 | } |
166 | 168 | ||
167 | QPushButton* EmulationHandler::cornerButton() { | 169 | QPushButton* EmulationHandler::cornerButton() { |
diff --git a/noncore/apps/opie-console/emulation_widget.cpp b/noncore/apps/opie-console/emulation_widget.cpp index ad8ecba..4688551 100644 --- a/noncore/apps/opie-console/emulation_widget.cpp +++ b/noncore/apps/opie-console/emulation_widget.cpp | |||
@@ -219,19 +219,19 @@ void EmulationWidget::paintEvent( QPaintEvent* pe ) | |||
219 | drawFrame( &painter ); | 219 | drawFrame( &painter ); |
220 | painter.end(); | 220 | painter.end(); |
221 | } | 221 | } |
222 | 222 | ||
223 | void EmulationWidget::calcGeometry() | 223 | void EmulationWidget::calcGeometry() |
224 | { | 224 | { |
225 | m_scrollbar->resize(QApplication::style().scrollBarExtent().width(), contentsRect().height() ); | 225 | m_scrollbar->resize(QApplication::style().scrollBarExtent().width(), contentsRect().height() ); |
226 | 226 | ||
227 | qDebug( QString(" TEST").arg( contentsRect().width() ) ); | 227 | odebug << QString(" TEST").arg( contentsRect().width() ) << oendl; |
228 | qDebug( QString(" TEST").arg( contentsRect().height() ) ); | 228 | odebug << QString(" TEST").arg( contentsRect().height() ) << oendl; |
229 | qDebug("NEUER TESTT!!!!!!!!"); | 229 | odebug << "NEUER TESTT!!!!!!!!" << oendl; |
230 | 230 | ||
231 | switch( scrollLoc ) | 231 | switch( scrollLoc ) |
232 | { | 232 | { |
233 | case SCRNONE : | 233 | case SCRNONE : |
234 | m_columns = ( contentsRect().width() -2 * rimX ) / f_width; | 234 | m_columns = ( contentsRect().width() -2 * rimX ) / f_width; |
235 | m_blX = ( contentsRect().width() - ( m_columns*f_width ) ) / 2; | 235 | m_blX = ( contentsRect().width() - ( m_columns*f_width ) ) / 2; |
236 | m_brX = m_blX; | 236 | m_brX = m_blX; |
237 | m_scrollbar->hide(); | 237 | m_scrollbar->hide(); |
@@ -253,31 +253,31 @@ void EmulationWidget::calcGeometry() | |||
253 | } | 253 | } |
254 | 254 | ||
255 | m_lines = ( contentsRect().height() - 2 * rimY ) / f_height; | 255 | m_lines = ( contentsRect().height() - 2 * rimY ) / f_height; |
256 | m_bY = ( contentsRect().height() - (m_lines * f_height ) ) / 2; | 256 | m_bY = ( contentsRect().height() - (m_lines * f_height ) ) / 2; |
257 | } | 257 | } |
258 | 258 | ||
259 | void EmulationWidget::drawAttrString( QString& string, QPainter &painter, QRect rect, Character attr, bool usePixmap, bool clear ) | 259 | void EmulationWidget::drawAttrString( QString& string, QPainter &painter, QRect rect, Character attr, bool usePixmap, bool clear ) |
260 | { | 260 | { |
261 | qWarning("Color1 %s", color_table[attr.b].color.name().latin1() ); | 261 | owarn << "Color1 " << color_table[attr.b].color.name().latin1() << "" << oendl; |
262 | if ( usePixmap && color_table[attr.b].transparent ) | 262 | if ( usePixmap && color_table[attr.b].transparent ) |
263 | { | 263 | { |
264 | painter.setBackgroundMode( TransparentMode ); | 264 | painter.setBackgroundMode( TransparentMode ); |
265 | if ( clear ) | 265 | if ( clear ) |
266 | erase( rect ); | 266 | erase( rect ); |
267 | } | 267 | } |
268 | else | 268 | else |
269 | { | 269 | { |
270 | if ( blinking ) | 270 | if ( blinking ) |
271 | painter.fillRect( rect, color_table[attr.b].color ); | 271 | painter.fillRect( rect, color_table[attr.b].color ); |
272 | else | 272 | else |
273 | { | 273 | { |
274 | painter.setBackgroundMode( OpaqueMode ); | 274 | painter.setBackgroundMode( OpaqueMode ); |
275 | qWarning("Color %s", color_table[attr.b].color.name().latin1() ); | 275 | owarn << "Color " << color_table[attr.b].color.name().latin1() << "" << oendl; |
276 | painter.setBackgroundColor( color_table[attr.b].color ); | 276 | painter.setBackgroundColor( color_table[attr.b].color ); |
277 | } | 277 | } |
278 | } | 278 | } |
279 | if ( color_table[attr.f].bold ) | 279 | if ( color_table[attr.f].bold ) |
280 | painter.setPen( QColor( 0x8F, 0x00, 0x00 ) ); | 280 | painter.setPen( QColor( 0x8F, 0x00, 0x00 ) ); |
281 | else | 281 | else |
282 | painter.setPen( color_table[attr.f].color ); | 282 | painter.setPen( color_table[attr.f].color ); |
283 | painter.drawText( rect.x(), rect.y() + f_ascent, string ); | 283 | painter.drawText( rect.x(), rect.y() + f_ascent, string ); |
diff --git a/noncore/apps/opie-console/function_keyboard.cpp b/noncore/apps/opie-console/function_keyboard.cpp index eb32551..6613183 100644 --- a/noncore/apps/opie-console/function_keyboard.cpp +++ b/noncore/apps/opie-console/function_keyboard.cpp | |||
@@ -1,10 +1,15 @@ | |||
1 | #include "function_keyboard.h" | 1 | #include "function_keyboard.h" |
2 | 2 | ||
3 | /* OPIE */ | ||
4 | #include <opie2/odebug.h> | ||
5 | using namespace Opie::Core; | ||
6 | |||
7 | /* QT */ | ||
3 | #include <qlayout.h> | 8 | #include <qlayout.h> |
4 | #include <qlistbox.h> | 9 | #include <qlistbox.h> |
5 | #include <qlabel.h> | 10 | #include <qlabel.h> |
6 | #include <qdir.h> | 11 | #include <qdir.h> |
7 | 12 | ||
8 | #define DEFAULT_ROWS 2 | 13 | #define DEFAULT_ROWS 2 |
9 | #define DEFAULT_COLS 12 | 14 | #define DEFAULT_COLS 12 |
10 | 15 | ||
@@ -32,17 +37,17 @@ FunctionKeyboard::FunctionKeyboard(QWidget *parent) : | |||
32 | if (value_list.isEmpty()) continue; | 37 | if (value_list.isEmpty()) continue; |
33 | 38 | ||
34 | keys.insert( | 39 | keys.insert( |
35 | 40 | ||
36 | handle, | 41 | handle, |
37 | FKey (value_list[0], value_list[1], value_list[2].toUShort(), value_list[3].toUShort()) | 42 | FKey (value_list[0], value_list[1], value_list[2].toUShort(), value_list[3].toUShort()) |
38 | ); | 43 | ); |
39 | } | 44 | } |
40 | //qWarning("loaded %d keys", keys.count()); | 45 | //owarn << "loaded " << keys.count() << " keys" << oendl; |
41 | */ | 46 | */ |
42 | if (keys.isEmpty()) loadDefaults(); | 47 | if (keys.isEmpty()) loadDefaults(); |
43 | 48 | ||
44 | 49 | ||
45 | 50 | ||
46 | } | 51 | } |
47 | 52 | ||
48 | FunctionKeyboard::~FunctionKeyboard() {} | 53 | FunctionKeyboard::~FunctionKeyboard() {} |
@@ -251,17 +256,17 @@ void FunctionKeyboard::loadDefaults() { | |||
251 | } | 256 | } |
252 | 257 | ||
253 | /* FunctionKeyboardConfig {{{1 */ | 258 | /* FunctionKeyboardConfig {{{1 */ |
254 | 259 | ||
255 | FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent, const char* na ) | 260 | FunctionKeyboardConfig::FunctionKeyboardConfig(const QString& name, QWidget* parent, const char* na ) |
256 | : ProfileDialogKeyWidget(name, parent, na), | 261 | : ProfileDialogKeyWidget(name, parent, na), |
257 | selectedRow(0), selectedCol(0) | 262 | selectedRow(0), selectedCol(0) |
258 | { | 263 | { |
259 | qWarning("FunctionKeyboardConfig"); | 264 | owarn << "FunctionKeyboardConfig" << oendl; |
260 | 265 | ||
261 | 266 | ||
262 | kb = new FunctionKeyboard(this); | 267 | kb = new FunctionKeyboard(this); |
263 | connect (kb, SIGNAL(keyPressed(FKey,ushort,ushort,bool)), | 268 | connect (kb, SIGNAL(keyPressed(FKey,ushort,ushort,bool)), |
264 | this, SLOT(slotKeyPressed(FKey,ushort,ushort,bool))); | 269 | this, SLOT(slotKeyPressed(FKey,ushort,ushort,bool))); |
265 | 270 | ||
266 | QGroupBox *dimentions = new QGroupBox(2, Qt::Horizontal, tr("Dimensions"), this); | 271 | QGroupBox *dimentions = new QGroupBox(2, Qt::Horizontal, tr("Dimensions"), this); |
267 | QLabel *l = new QLabel("Rows", dimentions); | 272 | QLabel *l = new QLabel("Rows", dimentions); |
diff --git a/noncore/apps/opie-console/io_bt.cpp b/noncore/apps/opie-console/io_bt.cpp index a29fa8e..c102427 100644 --- a/noncore/apps/opie-console/io_bt.cpp +++ b/noncore/apps/opie-console/io_bt.cpp | |||
@@ -1,12 +1,15 @@ | |||
1 | 1 | ||
2 | #include "io_bt.h" | 2 | #include "io_bt.h" |
3 | 3 | ||
4 | /* OPIE */ | ||
5 | #include <opie2/odebug.h> | ||
4 | using namespace Opie::Core; | 6 | using namespace Opie::Core; |
7 | |||
5 | IOBt::IOBt( const Profile &config ) : IOSerial( config ) { | 8 | IOBt::IOBt( const Profile &config ) : IOSerial( config ) { |
6 | m_attach = 0; | 9 | m_attach = 0; |
7 | } | 10 | } |
8 | 11 | ||
9 | 12 | ||
10 | IOBt::~IOBt() { | 13 | IOBt::~IOBt() { |
11 | if ( m_attach ) { | 14 | if ( m_attach ) { |
12 | delete m_attach; | 15 | delete m_attach; |
@@ -38,17 +41,17 @@ bool IOBt::open() { | |||
38 | // then start hcid, then rcfomm handling (m_mac) | 41 | // then start hcid, then rcfomm handling (m_mac) |
39 | 42 | ||
40 | connect( m_attach, SIGNAL( processExited(Opie::Core::OProcess*) ), | 43 | connect( m_attach, SIGNAL( processExited(Opie::Core::OProcess*) ), |
41 | this, SLOT( slotExited(Opie::Core::OProcess*) ) ); | 44 | this, SLOT( slotExited(Opie::Core::OProcess*) ) ); |
42 | 45 | ||
43 | if ( m_attach->start() ) { | 46 | if ( m_attach->start() ) { |
44 | ret = IOSerial::open(); | 47 | ret = IOSerial::open(); |
45 | } else { | 48 | } else { |
46 | qWarning("could not attach to device"); | 49 | owarn << "could not attach to device" << oendl; |
47 | delete m_attach; | 50 | delete m_attach; |
48 | m_attach = 0; | 51 | m_attach = 0; |
49 | } | 52 | } |
50 | } else { | 53 | } else { |
51 | // directly to the normal serial | 54 | // directly to the normal serial |
52 | // TODO: look first if the connection really exists. ( is set up ) | 55 | // TODO: look first if the connection really exists. ( is set up ) |
53 | 56 | ||
54 | ret =IOSerial::open(); | 57 | ret =IOSerial::open(); |
@@ -84,10 +87,10 @@ QBitArray IOBt::supports() const { | |||
84 | return QBitArray( 3 ); | 87 | return QBitArray( 3 ); |
85 | } | 88 | } |
86 | 89 | ||
87 | bool IOBt::isConnected() { | 90 | bool IOBt::isConnected() { |
88 | return false; | 91 | return false; |
89 | } | 92 | } |
90 | 93 | ||
91 | void IOBt::send(const QByteArray &data) { | 94 | void IOBt::send(const QByteArray &data) { |
92 | qDebug( "Please overload me..." ); | 95 | odebug << "Please overload me..." << oendl; |
93 | } | 96 | } |
diff --git a/noncore/apps/opie-console/io_irda.cpp b/noncore/apps/opie-console/io_irda.cpp index 07c2b62..38542f5 100644 --- a/noncore/apps/opie-console/io_irda.cpp +++ b/noncore/apps/opie-console/io_irda.cpp | |||
@@ -1,12 +1,14 @@ | |||
1 | |||
2 | #include "io_irda.h" | 1 | #include "io_irda.h" |
3 | 2 | ||
3 | /* OPIE */ | ||
4 | #include <opie2/odebug.h> | ||
4 | using namespace Opie::Core; | 5 | using namespace Opie::Core; |
6 | |||
5 | IOIrda::IOIrda( const Profile &config ) : IOSerial( config ) { | 7 | IOIrda::IOIrda( const Profile &config ) : IOSerial( config ) { |
6 | m_attach = 0; | 8 | m_attach = 0; |
7 | } | 9 | } |
8 | 10 | ||
9 | 11 | ||
10 | IOIrda::~IOIrda() { | 12 | IOIrda::~IOIrda() { |
11 | if ( m_attach ) { | 13 | if ( m_attach ) { |
12 | delete m_attach; | 14 | delete m_attach; |
@@ -30,17 +32,17 @@ bool IOIrda::open() { | |||
30 | 32 | ||
31 | connect( m_attach, SIGNAL( processExited(Opie::Core::OProcess*) ), | 33 | connect( m_attach, SIGNAL( processExited(Opie::Core::OProcess*) ), |
32 | this, SLOT( slotExited(Opie::Core::OProcess*) ) ); | 34 | this, SLOT( slotExited(Opie::Core::OProcess*) ) ); |
33 | 35 | ||
34 | if ( m_attach->start() ) { | 36 | if ( m_attach->start() ) { |
35 | ret= IOSerial::open(); | 37 | ret= IOSerial::open(); |
36 | } else { | 38 | } else { |
37 | // emit error!!! | 39 | // emit error!!! |
38 | qWarning("could not attach to device"); | 40 | owarn << "could not attach to device" << oendl; |
39 | delete m_attach; | 41 | delete m_attach; |
40 | m_attach = 0l; | 42 | m_attach = 0l; |
41 | } | 43 | } |
42 | return ret; | 44 | return ret; |
43 | } | 45 | } |
44 | 46 | ||
45 | void IOIrda::reload( const Profile &config ) { | 47 | void IOIrda::reload( const Profile &config ) { |
46 | m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE); | 48 | m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE); |
@@ -69,10 +71,10 @@ QBitArray IOIrda::supports()const { | |||
69 | return QBitArray( 3 ); | 71 | return QBitArray( 3 ); |
70 | } | 72 | } |
71 | 73 | ||
72 | bool IOIrda::isConnected() { | 74 | bool IOIrda::isConnected() { |
73 | return false; | 75 | return false; |
74 | } | 76 | } |
75 | 77 | ||
76 | void IOIrda::send(const QByteArray &data) { | 78 | void IOIrda::send(const QByteArray &data) { |
77 | qDebug( "Please overload me..." ); | 79 | odebug << "Please overload me..." << oendl; |
78 | } | 80 | } |
diff --git a/noncore/apps/opie-console/io_modem.cpp b/noncore/apps/opie-console/io_modem.cpp index b74d076..c499dfe 100644 --- a/noncore/apps/opie-console/io_modem.cpp +++ b/noncore/apps/opie-console/io_modem.cpp | |||
@@ -1,23 +1,23 @@ | |||
1 | 1 | ||
2 | #include "io_modem.h" | 2 | #include "io_modem.h" |
3 | |||
4 | #include "dialer.h" | 3 | #include "dialer.h" |
5 | 4 | ||
5 | /* OPIE */ | ||
6 | #include <opie2/odebug.h> | ||
6 | using namespace Opie::Core; | 7 | using namespace Opie::Core; |
7 | using namespace Opie::Core; | 8 | |
8 | IOModem::IOModem( const Profile &profile ) | 9 | IOModem::IOModem( const Profile &profile ) |
9 | : IOSerial( profile ) { | 10 | : IOSerial( profile ) { |
10 | m_profile = profile; | 11 | m_profile = profile; |
11 | } | 12 | } |
12 | 13 | ||
13 | 14 | ||
14 | IOModem::~IOModem() { | 15 | IOModem::~IOModem() { |
15 | |||
16 | } | 16 | } |
17 | 17 | ||
18 | 18 | ||
19 | void IOModem::close() { | 19 | void IOModem::close() { |
20 | // Hangup, discarding result | 20 | // Hangup, discarding result |
21 | //int fd = rawIO(); | 21 | //int fd = rawIO(); |
22 | internDetach(); | 22 | internDetach(); |
23 | Dialer d(m_profile, m_fd); | 23 | Dialer d(m_profile, m_fd); |
@@ -99,10 +99,10 @@ QBitArray IOModem::supports()const { | |||
99 | return QBitArray( 3 ); | 99 | return QBitArray( 3 ); |
100 | } | 100 | } |
101 | 101 | ||
102 | bool IOModem::isConnected() { | 102 | bool IOModem::isConnected() { |
103 | return false; | 103 | return false; |
104 | } | 104 | } |
105 | 105 | ||
106 | void IOModem::send(const QByteArray &data) { | 106 | void IOModem::send(const QByteArray &data) { |
107 | qDebug( "Please overload me..." ); | 107 | odebug << "Please overload me..." << oendl; |
108 | } | 108 | } |
diff --git a/noncore/apps/opie-console/main.cpp b/noncore/apps/opie-console/main.cpp index dfb2f83..1bd4338 100644 --- a/noncore/apps/opie-console/main.cpp +++ b/noncore/apps/opie-console/main.cpp | |||
@@ -86,17 +86,17 @@ void FixIt::fixIt() { | |||
86 | } | 86 | } |
87 | #endif | 87 | #endif |
88 | 88 | ||
89 | int main(int argc, char **argv) { | 89 | int main(int argc, char **argv) { |
90 | // too bad this gives us trouble the taskbar... argv[0]="embeddedkonsole"; | 90 | // too bad this gives us trouble the taskbar... argv[0]="embeddedkonsole"; |
91 | QPEApplication app( argc, argv ); | 91 | QPEApplication app( argc, argv ); |
92 | 92 | ||
93 | #ifdef FSCKED_DISTRIBUTION | 93 | #ifdef FSCKED_DISTRIBUTION |
94 | qWarning("fscked"); | 94 | owarn << "fscked" << oendl; |
95 | FixIt it; | 95 | FixIt it; |
96 | it.fixIt(); | 96 | it.fixIt(); |
97 | #endif | 97 | #endif |
98 | 98 | ||
99 | MainWindow mw; | 99 | MainWindow mw; |
100 | mw.setCaption(QObject::tr("Opie Console") ); | 100 | mw.setCaption(QObject::tr("Opie Console") ); |
101 | app.showMainWidget( &mw ); | 101 | app.showMainWidget( &mw ); |
102 | 102 | ||
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 06a8f7d..b403b4d 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp | |||
@@ -1,35 +1,38 @@ | |||
1 | #include <assert.h> | ||
2 | |||
3 | #include <qaction.h> | ||
4 | #include <qmenubar.h> | ||
5 | #include <qtoolbar.h> | ||
6 | #include <qmessagebox.h> | ||
7 | #include <qwhatsthis.h> | ||
8 | #include <qfileinfo.h> | ||
9 | |||
10 | #include <qpe/filemanager.h> | ||
11 | |||
12 | #include <opie2/ofiledialog.h> | ||
13 | |||
14 | #include "TEmulation.h" | 1 | #include "TEmulation.h" |
15 | #include "profileeditordialog.h" | 2 | #include "profileeditordialog.h" |
16 | #include "configdialog.h" | 3 | #include "configdialog.h" |
17 | #include "default.h" | 4 | #include "default.h" |
18 | #include "profilemanager.h" | 5 | #include "profilemanager.h" |
19 | #include "mainwindow.h" | 6 | #include "mainwindow.h" |
20 | #include "tabwidget.h" | 7 | #include "tabwidget.h" |
21 | #include "transferdialog.h" | 8 | #include "transferdialog.h" |
22 | #include "function_keyboard.h" | 9 | #include "function_keyboard.h" |
23 | #include "emulation_handler.h" | 10 | #include "emulation_handler.h" |
24 | #include "script.h" | 11 | #include "script.h" |
25 | 12 | ||
26 | 13 | /* OPIE */ | |
14 | #include <opie2/odebug.h> | ||
15 | #include <opie2/ofiledialog.h> | ||
16 | #include <qpe/filemanager.h> | ||
17 | using namespace Opie::Core; | ||
27 | using namespace Opie::Ui; | 18 | using namespace Opie::Ui; |
19 | |||
20 | /* QT */ | ||
21 | #include <qaction.h> | ||
22 | #include <qmenubar.h> | ||
23 | #include <qtoolbar.h> | ||
24 | #include <qmessagebox.h> | ||
25 | #include <qwhatsthis.h> | ||
26 | #include <qfileinfo.h> | ||
27 | |||
28 | /* STD */ | ||
29 | #include <assert.h> | ||
30 | |||
28 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { | 31 | MainWindow::MainWindow(QWidget *parent, const char *name, WFlags) : QMainWindow(parent, name, WStyle_ContextHelp) { |
29 | KeyTrans::loadAll(); | 32 | KeyTrans::loadAll(); |
30 | for (int i = 0; i < KeyTrans::count(); i++ ) { | 33 | for (int i = 0; i < KeyTrans::count(); i++ ) { |
31 | KeyTrans* s = KeyTrans::find(i ); | 34 | KeyTrans* s = KeyTrans::find(i ); |
32 | assert( s ); | 35 | assert( s ); |
33 | } | 36 | } |
34 | m_factory = new MetaFactory(); | 37 | m_factory = new MetaFactory(); |
35 | Default def(m_factory); | 38 | Default def(m_factory); |
@@ -441,23 +444,23 @@ void MainWindow::slotConfigure() { | |||
441 | * delete it | 444 | * delete it |
442 | * and set the currentSession() | 445 | * and set the currentSession() |
443 | */ | 446 | */ |
444 | void MainWindow::slotClose() { | 447 | void MainWindow::slotClose() { |
445 | if (!currentSession() ) | 448 | if (!currentSession() ) |
446 | return; | 449 | return; |
447 | 450 | ||
448 | Session* ses = currentSession(); | 451 | Session* ses = currentSession(); |
449 | qWarning("removing! currentSession %s", currentSession()->name().latin1() ); | 452 | owarn << "removing! currentSession " << currentSession()->name().latin1() << "" << oendl; |
450 | /* set to NULL to be safe, if its needed slotSessionChanged resets it automatically */ | 453 | /* set to NULL to be safe, if its needed slotSessionChanged resets it automatically */ |
451 | m_curSession = NULL; | 454 | m_curSession = NULL; |
452 | tabWidget()->remove( /*currentSession()*/ses ); | 455 | tabWidget()->remove( /*currentSession()*/ses ); |
453 | /*it's autodelete */ | 456 | /*it's autodelete */ |
454 | m_sessions.remove( ses ); | 457 | m_sessions.remove( ses ); |
455 | qWarning("after remove!!"); | 458 | owarn << "after remove!!" << oendl; |
456 | 459 | ||
457 | if (!currentSession() ) { | 460 | if (!currentSession() ) { |
458 | m_connect->setEnabled( false ); | 461 | m_connect->setEnabled( false ); |
459 | m_disconnect->setEnabled( false ); | 462 | m_disconnect->setEnabled( false ); |
460 | m_terminate->setEnabled( false ); | 463 | m_terminate->setEnabled( false ); |
461 | m_transfer->setEnabled( false ); | 464 | m_transfer->setEnabled( false ); |
462 | m_recordScript->setEnabled( false ); | 465 | m_recordScript->setEnabled( false ); |
463 | m_saveScript->setEnabled( false ); | 466 | m_saveScript->setEnabled( false ); |
@@ -565,26 +568,26 @@ void MainWindow::slotOpenButtons( bool state ) { | |||
565 | } else { | 568 | } else { |
566 | m_buttonBar->hide(); | 569 | m_buttonBar->hide(); |
567 | } | 570 | } |
568 | } | 571 | } |
569 | 572 | ||
570 | 573 | ||
571 | 574 | ||
572 | void MainWindow::slotSessionChanged( Session* ses ) { | 575 | void MainWindow::slotSessionChanged( Session* ses ) { |
573 | qWarning("changed!"); | 576 | owarn << "changed!" << oendl; |
574 | 577 | ||
575 | if(m_curSession) | 578 | if(m_curSession) |
576 | if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide(); | 579 | if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide(); |
577 | if(ses) | 580 | if(ses) |
578 | if(ses->transferDialog()) ses->transferDialog()->show(); | 581 | if(ses->transferDialog()) ses->transferDialog()->show(); |
579 | 582 | ||
580 | if ( ses ) { | 583 | if ( ses ) { |
581 | m_curSession = ses; | 584 | m_curSession = ses; |
582 | qDebug(QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) ); | 585 | odebug << QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) << oendl; |
583 | if ( m_curSession->layer()->isConnected() ) { | 586 | if ( m_curSession->layer()->isConnected() ) { |
584 | m_connect->setEnabled( false ); | 587 | m_connect->setEnabled( false ); |
585 | m_disconnect->setEnabled( true ); | 588 | m_disconnect->setEnabled( true ); |
586 | m_recordScript->setEnabled(!m_curSession->emulationHandler()->isRecording()); | 589 | m_recordScript->setEnabled(!m_curSession->emulationHandler()->isRecording()); |
587 | m_saveScript->setEnabled(m_curSession->emulationHandler()->isRecording()); | 590 | m_saveScript->setEnabled(m_curSession->emulationHandler()->isRecording()); |
588 | m_scripts->setItemEnabled(m_runScript_id, true); | 591 | m_scripts->setItemEnabled(m_runScript_id, true); |
589 | } else { | 592 | } else { |
590 | m_connect->setEnabled( true ); | 593 | m_connect->setEnabled( true ); |
diff --git a/noncore/apps/opie-console/modemconfigwidget.cpp b/noncore/apps/opie-console/modemconfigwidget.cpp index 3466e3a..9fdaf73 100644 --- a/noncore/apps/opie-console/modemconfigwidget.cpp +++ b/noncore/apps/opie-console/modemconfigwidget.cpp | |||
@@ -1,20 +1,23 @@ | |||
1 | #include "modemconfigwidget.h" | ||
2 | #include "dialdialog.h" | ||
1 | 3 | ||
4 | /* OPIE */ | ||
5 | #include <opie2/odebug.h> | ||
2 | #include <qpe/qpeapplication.h> | 6 | #include <qpe/qpeapplication.h> |
7 | using namespace Opie::Core; | ||
3 | 8 | ||
9 | /* QT */ | ||
4 | #include <qlabel.h> | 10 | #include <qlabel.h> |
5 | #include <qlayout.h> | 11 | #include <qlayout.h> |
6 | #include <qcombobox.h> | 12 | #include <qcombobox.h> |
7 | #include <qpushbutton.h> | 13 | #include <qpushbutton.h> |
8 | #include <qhbox.h> | 14 | #include <qhbox.h> |
9 | 15 | ||
10 | #include "modemconfigwidget.h" | ||
11 | #include "dialdialog.h" | ||
12 | |||
13 | namespace { | 16 | namespace { |
14 | void setCurrent( const QString& str, QComboBox* bo ) { | 17 | void setCurrent( const QString& str, QComboBox* bo ) { |
15 | uint b = bo->count(); | 18 | uint b = bo->count(); |
16 | for (int i = 0; i < bo->count(); i++ ) { | 19 | for (int i = 0; i < bo->count(); i++ ) { |
17 | if ( bo->text(i) == str ) { | 20 | if ( bo->text(i) == str ) { |
18 | bo->setCurrentItem( i ); | 21 | bo->setCurrentItem( i ); |
19 | return; | 22 | return; |
20 | } | 23 | } |
@@ -130,17 +133,17 @@ void ModemConfigWidget::load( const Profile& prof ) { | |||
130 | m_base->setStop( IOLayerBase::Stop_OnePointFive ); | 133 | m_base->setStop( IOLayerBase::Stop_OnePointFive ); |
131 | } else { | 134 | } else { |
132 | m_base->setStop( IOLayerBase::Stop_One ); | 135 | m_base->setStop( IOLayerBase::Stop_One ); |
133 | } | 136 | } |
134 | 137 | ||
135 | 138 | ||
136 | atConf->readConfig( prof ); | 139 | atConf->readConfig( prof ); |
137 | if ( prof.readEntry( "Device" ).isEmpty() ) { | 140 | if ( prof.readEntry( "Device" ).isEmpty() ) { |
138 | qWarning("device empty!"); | 141 | owarn << "device empty!" << oendl; |
139 | return; | 142 | return; |
140 | } | 143 | } |
141 | setCurrent( prof.readEntry( "Device" ), m_deviceCmb ); | 144 | setCurrent( prof.readEntry( "Device" ), m_deviceCmb ); |
142 | 145 | ||
143 | 146 | ||
144 | } | 147 | } |
145 | 148 | ||
146 | /* | 149 | /* |
diff --git a/noncore/apps/opie-console/opie-console.pro b/noncore/apps/opie-console/opie-console.pro index 7a15828..f7e33e9 100644 --- a/noncore/apps/opie-console/opie-console.pro +++ b/noncore/apps/opie-console/opie-console.pro | |||
@@ -1,12 +1,10 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | TMAKE_CXXFLAGS += -DHAVE_OPENPTY | ||
3 | CONFIG += qt warn_on | 2 | CONFIG += qt warn_on |
4 | #CONFIG = qt | ||
5 | DESTDIR = $(OPIEDIR)/bin | 3 | DESTDIR = $(OPIEDIR)/bin |
6 | HEADERS = io_layer.h io_serial.h io_irda.h io_bt.h io_modem.h \ | 4 | HEADERS = io_layer.h io_serial.h io_irda.h io_bt.h io_modem.h \ |
7 | file_layer.h filetransfer.h \ | 5 | file_layer.h filetransfer.h \ |
8 | metafactory.h \ | 6 | metafactory.h \ |
9 | session.h \ | 7 | session.h \ |
10 | mainwindow.h \ | 8 | mainwindow.h \ |
11 | profile.h \ | 9 | profile.h \ |
12 | profileconfig.h \ | 10 | profileconfig.h \ |
@@ -65,12 +63,12 @@ SOURCES = io_layer.cpp io_serial.cpp io_irda.cpp io_bt.cpp io_modem.cpp \ | |||
65 | 63 | ||
66 | 64 | ||
67 | INTERFACES = configurebase.ui editbase.ui | 65 | INTERFACES = configurebase.ui editbase.ui |
68 | INCLUDEPATH += $(OPIEDIR)/include | 66 | INCLUDEPATH += $(OPIEDIR)/include |
69 | DEPENDPATH += $(OPIEDIR)/include | 67 | DEPENDPATH += $(OPIEDIR)/include |
70 | LIBS += -lqpe -lopiecore2 -lopieui2 -lutil | 68 | LIBS += -lqpe -lopiecore2 -lopieui2 -lutil |
71 | TARGET = opie-console | 69 | TARGET = opie-console |
72 | 70 | ||
73 | 71 | DEFINES += HAVE_OPENPTY | |
74 | 72 | ||
75 | 73 | ||
76 | include ( $(OPIEDIR)/include.pro ) | 74 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/apps/opie-console/sz_transfer.cpp b/noncore/apps/opie-console/sz_transfer.cpp index fbc5306..f505998 100644 --- a/noncore/apps/opie-console/sz_transfer.cpp +++ b/noncore/apps/opie-console/sz_transfer.cpp | |||
@@ -36,17 +36,17 @@ void SzTransfer::sendFile(const QString& file) { | |||
36 | connect(layer(), SIGNAL(received(const QByteArray&)), | 36 | connect(layer(), SIGNAL(received(const QByteArray&)), |
37 | this, SLOT(receivedStdin(const QByteArray&))); | 37 | this, SLOT(receivedStdin(const QByteArray&))); |
38 | proc->start(OProcess::NotifyOnExit, OProcess::All); | 38 | proc->start(OProcess::NotifyOnExit, OProcess::All); |
39 | 39 | ||
40 | } | 40 | } |
41 | 41 | ||
42 | void SzTransfer::SzReceivedStdout(OProcess *, char *buffer, int buflen) { | 42 | void SzTransfer::SzReceivedStdout(OProcess *, char *buffer, int buflen) { |
43 | 43 | ||
44 | qWarning("recieved from sz on stdout %d bytes", buflen); | 44 | owarn << "recieved from sz on stdout " << buflen << " bytes" << oendl; |
45 | 45 | ||
46 | QByteArray data(buflen); | 46 | QByteArray data(buflen); |
47 | data.fill(*buffer, buflen); | 47 | data.fill(*buffer, buflen); |
48 | for (uint i = 0; i < data.count(); i++ ) { | 48 | for (uint i = 0; i < data.count(); i++ ) { |
49 | printf("%c", buffer[i] ); | 49 | printf("%c", buffer[i] ); |
50 | } | 50 | } |
51 | printf("\n"); | 51 | printf("\n"); |
52 | 52 | ||
@@ -60,26 +60,26 @@ void SzTransfer::SzReceivedStderr(OProcess *, char *buffer, int length) { | |||
60 | printf("stderr:\n"); | 60 | printf("stderr:\n"); |
61 | //for (int i = 0; i < length; i++) | 61 | //for (int i = 0; i < length; i++) |
62 | // printf("%c", buffer[i]); | 62 | // printf("%c", buffer[i]); |
63 | //printf("\n"); | 63 | //printf("\n"); |
64 | } | 64 | } |
65 | 65 | ||
66 | void SzTransfer::receivedStdin(const QByteArray &data) { | 66 | void SzTransfer::receivedStdin(const QByteArray &data) { |
67 | 67 | ||
68 | qWarning("recieved from io_serial %d bytes", data.size()); | 68 | owarn << "recieved from io_serial " << data.size() << " bytes" << oendl; |
69 | 69 | ||
70 | // recieved data from the io layer goes to sz | 70 | // recieved data from the io layer goes to sz |
71 | proc->writeStdin(data.data(), data.size()); | 71 | proc->writeStdin(data.data(), data.size()); |
72 | 72 | ||
73 | } | 73 | } |
74 | 74 | ||
75 | void SzTransfer::sent() { | 75 | void SzTransfer::sent() { |
76 | 76 | ||
77 | qWarning("sent file"); | 77 | owarn << "sent file" << oendl; |
78 | 78 | ||
79 | //setcbreak(0); /* default */ | 79 | //setcbreak(0); /* default */ |
80 | 80 | ||
81 | 81 | ||
82 | delete proc; | 82 | delete proc; |
83 | disconnect(layer(), SIGNAL(received(const QByteArray&)), | 83 | disconnect(layer(), SIGNAL(received(const QByteArray&)), |
84 | this, SLOT(receivedStdin(const QByteArray&))); | 84 | this, SLOT(receivedStdin(const QByteArray&))); |
85 | 85 | ||
diff --git a/noncore/apps/opie-console/tabwidget.cpp b/noncore/apps/opie-console/tabwidget.cpp index 6429e3c..41a91ed 100644 --- a/noncore/apps/opie-console/tabwidget.cpp +++ b/noncore/apps/opie-console/tabwidget.cpp | |||
@@ -1,23 +1,26 @@ | |||
1 | |||
2 | #include "tabwidget.h" | 1 | #include "tabwidget.h" |
3 | 2 | ||
3 | /* OPIE */ | ||
4 | #include <opie2/odebug.h> | ||
5 | using namespace Opie::Core; | ||
4 | using namespace Opie::Ui; | 6 | using namespace Opie::Ui; |
7 | |||
5 | TabWidget::TabWidget( QWidget* parent, const char* name ) | 8 | TabWidget::TabWidget( QWidget* parent, const char* name ) |
6 | : OTabWidget( parent, name ) { | 9 | : OTabWidget( parent, name ) { |
7 | connect(this, SIGNAL( currentChanged(QWidget*) ), | 10 | connect(this, SIGNAL( currentChanged(QWidget*) ), |
8 | this, SLOT( slotCurChanged(QWidget*) ) ); | 11 | this, SLOT( slotCurChanged(QWidget*) ) ); |
9 | } | 12 | } |
10 | 13 | ||
11 | TabWidget::~TabWidget() { | 14 | TabWidget::~TabWidget() { |
12 | } | 15 | } |
13 | 16 | ||
14 | void TabWidget::add( Session* ses ) { | 17 | void TabWidget::add( Session* ses ) { |
15 | qWarning("session ses " + ses->name() ); | 18 | owarn << "session ses " + ses->name() << oendl; |
16 | if ( !ses->widgetStack() ) return; | 19 | if ( !ses->widgetStack() ) return; |
17 | //reparent( ses->widgetStack(), QPoint() ); | 20 | //reparent( ses->widgetStack(), QPoint() ); |
18 | addTab( ses->widgetStack(), "console/konsole", ses->name() ); | 21 | addTab( ses->widgetStack(), "console/konsole", ses->name() ); |
19 | //addTab( ses->widgetStack(), ses->name() ); | 22 | //addTab( ses->widgetStack(), ses->name() ); |
20 | m_map.insert( ses->widgetStack(), ses ); | 23 | m_map.insert( ses->widgetStack(), ses ); |
21 | } | 24 | } |
22 | 25 | ||
23 | void TabWidget::remove( Session* ses ) { | 26 | void TabWidget::remove( Session* ses ) { |
diff --git a/noncore/apps/opie-console/terminalwidget.cpp b/noncore/apps/opie-console/terminalwidget.cpp index 6870487..087476b 100644 --- a/noncore/apps/opie-console/terminalwidget.cpp +++ b/noncore/apps/opie-console/terminalwidget.cpp | |||
@@ -1,18 +1,23 @@ | |||
1 | #include "terminalwidget.h" | ||
2 | |||
3 | /* OPIE */ | ||
4 | #include <opie2/odebug.h> | ||
5 | using namespace Opie::Core; | ||
6 | |||
7 | /* QT */ | ||
1 | #include <qlabel.h> | 8 | #include <qlabel.h> |
2 | #include <qcheckbox.h> | 9 | #include <qcheckbox.h> |
3 | #include <qcombobox.h> | 10 | #include <qcombobox.h> |
4 | #include <qradiobutton.h> | 11 | #include <qradiobutton.h> |
5 | #include <qhgroupbox.h> | 12 | #include <qhgroupbox.h> |
6 | #include <qhbuttongroup.h> | 13 | #include <qhbuttongroup.h> |
7 | #include <qlayout.h> | 14 | #include <qlayout.h> |
8 | 15 | ||
9 | #include "terminalwidget.h" | ||
10 | |||
11 | namespace { | 16 | namespace { |
12 | enum TermIds { | 17 | enum TermIds { |
13 | id_term_vt100 = 0, | 18 | id_term_vt100 = 0, |
14 | id_term_vt102, | 19 | id_term_vt102, |
15 | id_term_linux, | 20 | id_term_linux, |
16 | id_term_xterm | 21 | id_term_xterm |
17 | }; | 22 | }; |
18 | 23 | ||
@@ -64,17 +69,17 @@ TerminalWidget::TerminalWidget( const QString& name, QWidget* parent, | |||
64 | m_colorBox->add( m_colorLabel ); | 69 | m_colorBox->add( m_colorLabel ); |
65 | m_colorBox->add( m_colorCmb ); | 70 | m_colorBox->add( m_colorCmb ); |
66 | 71 | ||
67 | m_lroot->add( m_groupConv ); | 72 | m_lroot->add( m_groupConv ); |
68 | m_lroot->add( m_groupOptions ); | 73 | m_lroot->add( m_groupOptions ); |
69 | m_lroot->addStretch( 0 ); | 74 | m_lroot->addStretch( 0 ); |
70 | 75 | ||
71 | // Fill in some options | 76 | // Fill in some options |
72 | qWarning("Options for terminal box"); | 77 | owarn << "Options for terminal box" << oendl; |
73 | m_terminalBox->insertItem( tr("VT 100"), 0 ); // /*, id_term_vt100*/ ); | 78 | m_terminalBox->insertItem( tr("VT 100"), 0 ); // /*, id_term_vt100*/ ); |
74 | m_terminalBox->insertItem( tr("VT 102"), 1 ); // /* , id_term_vt102 */); | 79 | m_terminalBox->insertItem( tr("VT 102"), 1 ); // /* , id_term_vt102 */); |
75 | m_terminalBox->insertItem( tr("Linux Console"), 2 ); //, id_term_linux ); | 80 | m_terminalBox->insertItem( tr("Linux Console"), 2 ); //, id_term_linux ); |
76 | m_terminalBox->insertItem( tr("X-Terminal"), 3 ); //, id_term_xterm ); | 81 | m_terminalBox->insertItem( tr("X-Terminal"), 3 ); //, id_term_xterm ); |
77 | //m_terminalBox->insertItem( tr("ANSI"), id_term_ansi ); | 82 | //m_terminalBox->insertItem( tr("ANSI"), id_term_ansi ); |
78 | 83 | ||
79 | m_colorCmb->insertItem( tr("black on white"), id_term_black ); | 84 | m_colorCmb->insertItem( tr("black on white"), id_term_black ); |
80 | m_colorCmb->insertItem( tr("white on black"), id_term_white ); | 85 | m_colorCmb->insertItem( tr("white on black"), id_term_white ); |
diff --git a/noncore/apps/opie-console/test/senderui.cpp b/noncore/apps/opie-console/test/senderui.cpp index df27055..45fd11d 100644 --- a/noncore/apps/opie-console/test/senderui.cpp +++ b/noncore/apps/opie-console/test/senderui.cpp | |||
@@ -21,25 +21,25 @@ SenderUI::SenderUI() | |||
21 | : Sender() { | 21 | : Sender() { |
22 | 22 | ||
23 | /* we do that manually */ | 23 | /* we do that manually */ |
24 | Profile prof; | 24 | Profile prof; |
25 | QString str = "/dev/bty0"; | 25 | QString str = "/dev/bty0"; |
26 | prof.writeEntry("Device",str ); | 26 | prof.writeEntry("Device",str ); |
27 | prof.writeEntry("Baud", 19200 ); | 27 | prof.writeEntry("Baud", 19200 ); |
28 | 28 | ||
29 | qWarning("prof " + prof.readEntry("Device") + " " + str); | 29 | owarn << "prof " + prof.readEntry("Device") + " " + str << oendl; |
30 | ser = new IOSerial(prof); | 30 | ser = new IOSerial(prof); |
31 | connect(ser, SIGNAL(received(const QByteArray&) ), | 31 | connect(ser, SIGNAL(received(const QByteArray&) ), |
32 | this, SLOT(got(const QByteArray&) ) ); | 32 | this, SLOT(got(const QByteArray&) ) ); |
33 | 33 | ||
34 | if ( ser->open() ) | 34 | if ( ser->open() ) |
35 | qWarning("opened!!!"); | 35 | owarn << "opened!!!" << oendl; |
36 | else | 36 | else |
37 | qWarning("could not open"); | 37 | owarn << "could not open" << oendl; |
38 | 38 | ||
39 | 39 | ||
40 | } | 40 | } |
41 | SenderUI::~SenderUI() { | 41 | SenderUI::~SenderUI() { |
42 | 42 | ||
43 | } | 43 | } |
44 | void SenderUI::slotSendFile() { | 44 | void SenderUI::slotSendFile() { |
45 | 45 | ||
@@ -47,33 +47,33 @@ void SenderUI::slotSendFile() { | |||
47 | sz->sendFile("/home/ich/bootopie-v06-13.jffs2"); | 47 | sz->sendFile("/home/ich/bootopie-v06-13.jffs2"); |
48 | 48 | ||
49 | connect (sz, SIGNAL(sent()), | 49 | connect (sz, SIGNAL(sent()), |
50 | this, SLOT(fileTransComplete())); | 50 | this, SLOT(fileTransComplete())); |
51 | } | 51 | } |
52 | 52 | ||
53 | void SenderUI::slotSend() { | 53 | void SenderUI::slotSend() { |
54 | QCString str = MultiLineEdit1->text().utf8(); | 54 | QCString str = MultiLineEdit1->text().utf8(); |
55 | qWarning("sending: %s", str.data() ); | 55 | owarn << "sending: " << str.data() << "" << oendl; |
56 | str = str.replace( QRegExp("\n"), "\r"); | 56 | str = str.replace( QRegExp("\n"), "\r"); |
57 | ser->send( str ); | 57 | ser->send( str ); |
58 | } | 58 | } |
59 | void SenderUI::got(const QByteArray& ar) { | 59 | void SenderUI::got(const QByteArray& ar) { |
60 | qWarning("got:"); | 60 | owarn << "got:" << oendl; |
61 | for ( uint i = 0; i < ar.count(); i++ ) { | 61 | for ( uint i = 0; i < ar.count(); i++ ) { |
62 | printf("%c", ar[i] ); | 62 | printf("%c", ar[i] ); |
63 | } | 63 | } |
64 | printf("\n"); | 64 | printf("\n"); |
65 | } | 65 | } |
66 | 66 | ||
67 | void SenderUI::fileTransComplete() { | 67 | void SenderUI::fileTransComplete() { |
68 | 68 | ||
69 | qWarning("file transfer complete"); | 69 | owarn << "file transfer complete" << oendl; |
70 | } | 70 | } |
71 | void SenderUI::send() { | 71 | void SenderUI::send() { |
72 | 72 | ||
73 | } | 73 | } |
74 | void SenderUI::slotRev(){ | 74 | void SenderUI::slotRev(){ |
75 | qWarning("Going to receive!"); | 75 | owarn << "Going to receive!" << oendl; |
76 | FileReceive *rev = new FileReceive( FileReceive::SZ, ser ); | 76 | FileReceive *rev = new FileReceive( FileReceive::SZ, ser ); |
77 | rev->receive(); | 77 | rev->receive(); |
78 | 78 | ||
79 | } | 79 | } |
diff --git a/noncore/apps/opie-console/widget.cpp b/noncore/apps/opie-console/widget.cpp index e17dfd4..c51983f 100644 --- a/noncore/apps/opie-console/widget.cpp +++ b/noncore/apps/opie-console/widget.cpp | |||
@@ -990,17 +990,17 @@ bool Widget::eventFilter( QObject *obj, QEvent *e ) | |||
990 | return FALSE; // not us | 990 | return FALSE; // not us |
991 | if ( e->type() == QEvent::Wheel) { | 991 | if ( e->type() == QEvent::Wheel) { |
992 | QApplication::sendEvent(scrollbar, e); | 992 | QApplication::sendEvent(scrollbar, e); |
993 | } | 993 | } |
994 | 994 | ||
995 | #ifdef FAKE_CTRL_AND_ALT | 995 | #ifdef FAKE_CTRL_AND_ALT |
996 | static bool control = FALSE; | 996 | static bool control = FALSE; |
997 | static bool alt = FALSE; | 997 | static bool alt = FALSE; |
998 | // qDebug(" Has a keyboard with no CTRL and ALT keys, but we fake it:"); | 998 | // odebug << " Has a keyboard with no CTRL and ALT keys, but we fake it:" << oendl; |
999 | bool dele=FALSE; | 999 | bool dele=FALSE; |
1000 | if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) { | 1000 | if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) { |
1001 | QKeyEvent* ke = (QKeyEvent*)e; | 1001 | QKeyEvent* ke = (QKeyEvent*)e; |
1002 | bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat(); | 1002 | bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat(); |
1003 | switch (ke->key()) { | 1003 | switch (ke->key()) { |
1004 | case Key_F9: // let this be "Control" | 1004 | case Key_F9: // let this be "Control" |
1005 | control = keydown; | 1005 | control = keydown; |
1006 | e = new QKeyEvent(QEvent::KeyPress, Key_Control, 0, ke->state()); | 1006 | e = new QKeyEvent(QEvent::KeyPress, Key_Control, 0, ke->state()); |
@@ -1029,21 +1029,21 @@ bool Widget::eventFilter( QObject *obj, QEvent *e ) | |||
1029 | } | 1029 | } |
1030 | #endif | 1030 | #endif |
1031 | 1031 | ||
1032 | if ( e->type() == QEvent::KeyPress ) { | 1032 | if ( e->type() == QEvent::KeyPress ) { |
1033 | QKeyEvent* ke = (QKeyEvent*)e; | 1033 | QKeyEvent* ke = (QKeyEvent*)e; |
1034 | actSel=0; // Key stroke implies a screen update, so Widget won't | 1034 | actSel=0; // Key stroke implies a screen update, so Widget won't |
1035 | // know where the current selection is. | 1035 | // know where the current selection is. |
1036 | 1036 | ||
1037 | // qDebug("key pressed is 0x%x",ke->key()); | 1037 | // odebug << "key pressed is 0x" << ke->key() << "" << oendl; |
1038 | 1038 | ||
1039 | if( ke->state() == ShiftButton && ke->key() == Key_Tab) { //lets hardcode this sucker | 1039 | if( ke->state() == ShiftButton && ke->key() == Key_Tab) { //lets hardcode this sucker |
1040 | 1040 | ||
1041 | // qDebug("key pressed 2 is 0x%x",ke->key()); | 1041 | // odebug << "key pressed 2 is 0x" << ke->key() << "" << oendl; |
1042 | emitText("\\"); // expose | 1042 | emitText("\\"); // expose |
1043 | } else | 1043 | } else |
1044 | emit keyPressedSignal(ke); // expose | 1044 | emit keyPressedSignal(ke); // expose |
1045 | ke->accept(); | 1045 | ke->accept(); |
1046 | #ifdef FAKE_CTRL_AND_ALT | 1046 | #ifdef FAKE_CTRL_AND_ALT |
1047 | if ( dele ) delete e; | 1047 | if ( dele ) delete e; |
1048 | #endif | 1048 | #endif |
1049 | return true; // stop the event | 1049 | return true; // stop the event |
diff --git a/noncore/apps/opie-console/widget_layer.cpp b/noncore/apps/opie-console/widget_layer.cpp index 96dda1c..ab25919 100644 --- a/noncore/apps/opie-console/widget_layer.cpp +++ b/noncore/apps/opie-console/widget_layer.cpp | |||
@@ -70,17 +70,17 @@ bool WidgetLayer::eventFilter( QObject *obj, QEvent *e ) | |||
70 | return true; | 70 | return true; |
71 | } | 71 | } |
72 | if ( obj != this /* when embedded */ && obj != parent() /* when standalone */ ) | 72 | if ( obj != this /* when embedded */ && obj != parent() /* when standalone */ ) |
73 | return false; // not us | 73 | return false; // not us |
74 | 74 | ||
75 | #ifdef FAKE_CTRL_AND_ALT | 75 | #ifdef FAKE_CTRL_AND_ALT |
76 | static bool control = false; | 76 | static bool control = false; |
77 | static bool alt = false; | 77 | static bool alt = false; |
78 | // qDebug(" Has a keyboard with no CTRL and ALT keys, but we fake it:"); | 78 | // odebug << " Has a keyboard with no CTRL and ALT keys, but we fake it:" << oendl; |
79 | bool dele = false; | 79 | bool dele = false; |
80 | if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) { | 80 | if ( e->type() == QEvent::KeyPress || e->type() == QEvent::KeyRelease ) { |
81 | QKeyEvent* ke = (QKeyEvent*)e; | 81 | QKeyEvent* ke = (QKeyEvent*)e; |
82 | bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat(); | 82 | bool keydown = e->type() == QEvent::KeyPress || ke->isAutoRepeat(); |
83 | switch (ke->key()) { | 83 | switch (ke->key()) { |
84 | case Key_F9: // let this be "Control" | 84 | case Key_F9: // let this be "Control" |
85 | control = keydown; | 85 | control = keydown; |
86 | e = new QKeyEvent(QEvent::KeyPress, Key_Control, 0, ke->state()); | 86 | e = new QKeyEvent(QEvent::KeyPress, Key_Control, 0, ke->state()); |
@@ -110,17 +110,17 @@ QChar(a,0)); | |||
110 | } | 110 | } |
111 | #endif | 111 | #endif |
112 | 112 | ||
113 | if ( e->type() == QEvent::KeyPress ) { | 113 | if ( e->type() == QEvent::KeyPress ) { |
114 | QKeyEvent* ke = (QKeyEvent*)e; | 114 | QKeyEvent* ke = (QKeyEvent*)e; |
115 | //actSel=0; // Key stroke implies a screen update, so Widget won't | 115 | //actSel=0; // Key stroke implies a screen update, so Widget won't |
116 | // know where the current selection is. | 116 | // know where the current selection is. |
117 | 117 | ||
118 | // qDebug("key pressed is 0x%x",ke->key()); | 118 | // odebug << "key pressed is 0x" << ke->key() << "" << oendl; |
119 | 119 | ||
120 | if( ke->state() == ShiftButton && ke->key() == Key_Tab) { //lets hardcode this sucker | 120 | if( ke->state() == ShiftButton && ke->key() == Key_Tab) { //lets hardcode this sucker |
121 | insertText("\\"); // expose | 121 | insertText("\\"); // expose |
122 | } else | 122 | } else |
123 | emit keyPressed( ke ); // expose | 123 | emit keyPressed( ke ); // expose |
124 | ke->accept(); | 124 | ke->accept(); |
125 | #ifdef FAKE_CTRL_AND_ALT | 125 | #ifdef FAKE_CTRL_AND_ALT |
126 | if ( dele ) delete e; | 126 | if ( dele ) delete e; |
diff --git a/noncore/apps/opie-write/mainwindow.cpp b/noncore/apps/opie-write/mainwindow.cpp index 90e1a70..aa03060 100644 --- a/noncore/apps/opie-write/mainwindow.cpp +++ b/noncore/apps/opie-write/mainwindow.cpp | |||
@@ -15,22 +15,26 @@ | |||
15 | ** Agreements. | 15 | ** Agreements. |
16 | ** | 16 | ** |
17 | ** Contact info@trolltech.com if any conditions of this licensing are | 17 | ** Contact info@trolltech.com if any conditions of this licensing are |
18 | ** not clear to you. | 18 | ** not clear to you. |
19 | ** | 19 | ** |
20 | **********************************************************************/ | 20 | **********************************************************************/ |
21 | 21 | ||
22 | #include "mainwindow.h" | 22 | #include "mainwindow.h" |
23 | |||
24 | /* OPIE */ | ||
25 | #include <opie2/odebug.h> | ||
23 | #include <qpe/fileselector.h> | 26 | #include <qpe/fileselector.h> |
24 | #include <qpe/applnk.h> | 27 | #include <qpe/applnk.h> |
25 | #include <qpe/resource.h> | 28 | #include <qpe/resource.h> |
26 | #include <qpe/fontdatabase.h> | 29 | #include <qpe/fontdatabase.h> |
30 | using namespace Opie::Core; | ||
27 | 31 | ||
28 | //#include "qspellchecker.h" | 32 | /* QT */ |
29 | #include "qtextedit.h" | 33 | #include "qtextedit.h" |
30 | #include <qaction.h> | 34 | #include <qaction.h> |
31 | #include <qtoolbar.h> | 35 | #include <qtoolbar.h> |
32 | #include <qtoolbutton.h> | 36 | #include <qtoolbutton.h> |
33 | #include <qtabwidget.h> | 37 | #include <qtabwidget.h> |
34 | #include <qapplication.h> | 38 | #include <qapplication.h> |
35 | #include <qfontdatabase.h> | 39 | #include <qfontdatabase.h> |
36 | #include <qcombobox.h> | 40 | #include <qcombobox.h> |
@@ -439,29 +443,29 @@ void MainWindow::fileOpen() | |||
439 | hideEditTools(); | 443 | hideEditTools(); |
440 | fileSelector->setNewVisible( TRUE ); | 444 | fileSelector->setNewVisible( TRUE ); |
441 | clear(); | 445 | clear(); |
442 | updateCaption(); | 446 | updateCaption(); |
443 | } | 447 | } |
444 | 448 | ||
445 | void MainWindow::fileRevert() | 449 | void MainWindow::fileRevert() |
446 | { | 450 | { |
447 | qDebug( "QMainWindow::fileRevert needs to be done" ); | 451 | odebug << "QMainWindow::fileRevert needs to be done" << oendl; |
448 | } | 452 | } |
449 | 453 | ||
450 | void MainWindow::fileNew() | 454 | void MainWindow::fileNew() |
451 | { | 455 | { |
452 | editor->setTextFormat( Qt::RichText ); | 456 | editor->setTextFormat( Qt::RichText ); |
453 | save(); | 457 | save(); |
454 | newFile(DocLnk()); | 458 | newFile(DocLnk()); |
455 | } | 459 | } |
456 | 460 | ||
457 | void MainWindow::insertTable() | 461 | void MainWindow::insertTable() |
458 | { | 462 | { |
459 | qDebug( "MainWindow::insertTable() needs to be done" ); | 463 | odebug << "MainWindow::insertTable() needs to be done" << oendl; |
460 | } | 464 | } |
461 | 465 | ||
462 | void MainWindow::newFile( const DocLnk &dl ) | 466 | void MainWindow::newFile( const DocLnk &dl ) |
463 | { | 467 | { |
464 | DocLnk nf = dl; | 468 | DocLnk nf = dl; |
465 | nf.setType( "text/html" ); | 469 | nf.setType( "text/html" ); |
466 | clear(); | 470 | clear(); |
467 | editorStack->raiseWidget( editor ); | 471 | editorStack->raiseWidget( editor ); |
@@ -470,17 +474,17 @@ void MainWindow::newFile( const DocLnk &dl ) | |||
470 | updateCaption(); | 474 | updateCaption(); |
471 | } | 475 | } |
472 | 476 | ||
473 | void MainWindow::openFile( const DocLnk &dl ) | 477 | void MainWindow::openFile( const DocLnk &dl ) |
474 | { | 478 | { |
475 | FileManager fm; | 479 | FileManager fm; |
476 | QString txt; | 480 | QString txt; |
477 | if ( !fm.loadFile( dl, txt ) ) | 481 | if ( !fm.loadFile( dl, txt ) ) |
478 | qDebug( "couldn't open file" ); | 482 | odebug << "couldn't open file" << oendl; |
479 | clear(); | 483 | clear(); |
480 | editorStack->raiseWidget( editor ); | 484 | editorStack->raiseWidget( editor ); |
481 | editor->viewport()->setFocus(); | 485 | editor->viewport()->setFocus(); |
482 | doc = new DocLnk( dl ); | 486 | doc = new DocLnk( dl ); |
483 | editor->setText( txt ); | 487 | editor->setText( txt ); |
484 | editor->setModified( FALSE ); | 488 | editor->setModified( FALSE ); |
485 | updateCaption(); | 489 | updateCaption(); |
486 | } | 490 | } |
diff --git a/noncore/apps/opie-write/opie-write.pro b/noncore/apps/opie-write/opie-write.pro index 044ce7e..8e514d4 100644 --- a/noncore/apps/opie-write/opie-write.pro +++ b/noncore/apps/opie-write/opie-write.pro | |||
@@ -1,12 +1,11 @@ | |||
1 | 1 | ||
2 | CONFIG += qt warn on quick-app | 2 | CONFIG += qt warn on quick-app |
3 | 3 | ||
4 | |||
5 | HEADERS = qcleanuphandler.h \ | 4 | HEADERS = qcleanuphandler.h \ |
6 | qcomplextext_p.h \ | 5 | qcomplextext_p.h \ |
7 | qrichtext_p.h \ | 6 | qrichtext_p.h \ |
8 | qstylesheet.h \ | 7 | qstylesheet.h \ |
9 | qtextedit.h \ | 8 | qtextedit.h \ |
10 | mainwindow.h | 9 | mainwindow.h |
11 | 10 | ||
12 | SOURCES = qcomplextext.cpp \ | 11 | SOURCES = qcomplextext.cpp \ |
diff --git a/noncore/apps/opie-write/qcomplextext.cpp b/noncore/apps/opie-write/qcomplextext.cpp index 473f184..00a91c5 100644 --- a/noncore/apps/opie-write/qcomplextext.cpp +++ b/noncore/apps/opie-write/qcomplextext.cpp | |||
@@ -101,17 +101,17 @@ QBidiContext::~QBidiContext() | |||
101 | Two small helper functions for arabic shaping. They get the next shape causing character on either | 101 | Two small helper functions for arabic shaping. They get the next shape causing character on either |
102 | side of the char in question. Implements rule R1. | 102 | side of the char in question. Implements rule R1. |
103 | 103 | ||
104 | leftChar() returns true if the char to the left is a left join-causing char | 104 | leftChar() returns true if the char to the left is a left join-causing char |
105 | rightChar() returns true if the char to the right is a right join-causing char | 105 | rightChar() returns true if the char to the right is a right join-causing char |
106 | */ | 106 | */ |
107 | static inline const QChar *prevChar( const QString &str, int pos ) | 107 | static inline const QChar *prevChar( const QString &str, int pos ) |
108 | { | 108 | { |
109 | //qDebug("leftChar: pos=%d", pos); | 109 | //odebug << "leftChar: pos=" << pos << "" << oendl; |
110 | pos--; | 110 | pos--; |
111 | const QChar *ch = str.unicode() + pos; | 111 | const QChar *ch = str.unicode() + pos; |
112 | while( pos > -1 ) { | 112 | while( pos > -1 ) { |
113 | if( !ch->isMark() ) | 113 | if( !ch->isMark() ) |
114 | return ch; | 114 | return ch; |
115 | pos--; | 115 | pos--; |
116 | ch--; | 116 | ch--; |
117 | } | 117 | } |
@@ -119,17 +119,17 @@ static inline const QChar *prevChar( const QString &str, int pos ) | |||
119 | } | 119 | } |
120 | 120 | ||
121 | static inline const QChar *nextChar( const QString &str, int pos) | 121 | static inline const QChar *nextChar( const QString &str, int pos) |
122 | { | 122 | { |
123 | pos++; | 123 | pos++; |
124 | int len = str.length(); | 124 | int len = str.length(); |
125 | const QChar *ch = str.unicode() + pos; | 125 | const QChar *ch = str.unicode() + pos; |
126 | while( pos < len ) { | 126 | while( pos < len ) { |
127 | //qDebug("rightChar: %d isLetter=%d, joining=%d", pos, ch.isLetter(), ch.joining()); | 127 | //odebug << "rightChar: " << pos << " isLetter=" << ch.isLetter() << ", joining=" << ch.joining() << "" << oendl; |
128 | if( !ch->isMark() ) | 128 | if( !ch->isMark() ) |
129 | return ch; | 129 | return ch; |
130 | // assume it's a transparent char, this might not be 100% correct | 130 | // assume it's a transparent char, this might not be 100% correct |
131 | pos++; | 131 | pos++; |
132 | ch++; | 132 | ch++; |
133 | } | 133 | } |
134 | return &QChar::replacement; | 134 | return &QChar::replacement; |
135 | } | 135 | } |
diff --git a/noncore/apps/opie-write/qrichtext.cpp b/noncore/apps/opie-write/qrichtext.cpp index b77a0fc..c27eb1e 100644 --- a/noncore/apps/opie-write/qrichtext.cpp +++ b/noncore/apps/opie-write/qrichtext.cpp | |||
@@ -32,21 +32,27 @@ | |||
32 | ** | 32 | ** |
33 | ** Contact info@trolltech.com if any conditions of this licensing are | 33 | ** Contact info@trolltech.com if any conditions of this licensing are |
34 | ** not clear to you. | 34 | ** not clear to you. |
35 | ** | 35 | ** |
36 | **********************************************************************/ | 36 | **********************************************************************/ |
37 | 37 | ||
38 | #include "qrichtext_p.h" | 38 | #include "qrichtext_p.h" |
39 | 39 | ||
40 | /* OPIE */ | ||
41 | #include <opie2/odebug.h> | ||
42 | using namespace Opie::Core; | ||
43 | |||
44 | /* QT */ | ||
40 | #include "qdragobject.h" | 45 | #include "qdragobject.h" |
41 | #include "qpaintdevicemetrics.h" | 46 | #include "qpaintdevicemetrics.h" |
42 | #include "qdrawutil.h" | 47 | #include "qdrawutil.h" |
43 | #include "qcleanuphandler.h" | 48 | #include "qcleanuphandler.h" |
44 | 49 | ||
50 | /* STD */ | ||
45 | #include <stdlib.h> | 51 | #include <stdlib.h> |
46 | 52 | ||
47 | using namespace Qt3; | 53 | using namespace Qt3; |
48 | 54 | ||
49 | static QTextCursor* richTextExportStart = 0; | 55 | static QTextCursor* richTextExportStart = 0; |
50 | static QTextCursor* richTextExportEnd = 0; | 56 | static QTextCursor* richTextExportEnd = 0; |
51 | 57 | ||
52 | static QTextFormatCollection *qFormatCollection = 0; | 58 | static QTextFormatCollection *qFormatCollection = 0; |
@@ -179,17 +185,17 @@ QTextDeleteCommand::~QTextDeleteCommand() | |||
179 | } | 185 | } |
180 | text.resize( 0 ); | 186 | text.resize( 0 ); |
181 | } | 187 | } |
182 | 188 | ||
183 | QTextCursor *QTextDeleteCommand::execute( QTextCursor *c ) | 189 | QTextCursor *QTextDeleteCommand::execute( QTextCursor *c ) |
184 | { | 190 | { |
185 | QTextParagraph *s = doc ? doc->paragAt( id ) : parag; | 191 | QTextParagraph *s = doc ? doc->paragAt( id ) : parag; |
186 | if ( !s ) { | 192 | if ( !s ) { |
187 | qWarning( "can't locate parag at %d, last parag: %d", id, doc->lastParagraph()->paragId() ); | 193 | owarn << "can't locate parag at " << id << ", last parag: " << doc->lastParagraph()->paragId() << "" << oendl; |
188 | return 0; | 194 | return 0; |
189 | } | 195 | } |
190 | 196 | ||
191 | cursor.setParagraph( s ); | 197 | cursor.setParagraph( s ); |
192 | cursor.setIndex( index ); | 198 | cursor.setIndex( index ); |
193 | int len = text.size(); | 199 | int len = text.size(); |
194 | if ( c ) | 200 | if ( c ) |
195 | *c = cursor; | 201 | *c = cursor; |
@@ -207,17 +213,17 @@ QTextCursor *QTextDeleteCommand::execute( QTextCursor *c ) | |||
207 | 213 | ||
208 | return c; | 214 | return c; |
209 | } | 215 | } |
210 | 216 | ||
211 | QTextCursor *QTextDeleteCommand::unexecute( QTextCursor *c ) | 217 | QTextCursor *QTextDeleteCommand::unexecute( QTextCursor *c ) |
212 | { | 218 | { |
213 | QTextParagraph *s = doc ? doc->paragAt( id ) : parag; | 219 | QTextParagraph *s = doc ? doc->paragAt( id ) : parag; |
214 | if ( !s ) { | 220 | if ( !s ) { |
215 | qWarning( "can't locate parag at %d, last parag: %d", id, doc->lastParagraph()->paragId() ); | 221 | owarn << "can't locate parag at " << id << ", last parag: " << doc->lastParagraph()->paragId() << "" << oendl; |
216 | return 0; | 222 | return 0; |
217 | } | 223 | } |
218 | 224 | ||
219 | cursor.setParagraph( s ); | 225 | cursor.setParagraph( s ); |
220 | cursor.setIndex( index ); | 226 | cursor.setIndex( index ); |
221 | QString str = QTextString::toString( text ); | 227 | QString str = QTextString::toString( text ); |
222 | cursor.insert( str, TRUE, &text ); | 228 | cursor.insert( str, TRUE, &text ); |
223 | cursor.setParagraph( s ); | 229 | cursor.setParagraph( s ); |
@@ -1539,20 +1545,20 @@ void QTextDocument::setRichTextInternal( const QString &text, QTextCursor* curso | |||
1539 | QBrush *b = new QBrush( QColor( attr["bgcolor"] ) ); | 1545 | QBrush *b = new QBrush( QColor( attr["bgcolor"] ) ); |
1540 | setPaper( b ); | 1546 | setPaper( b ); |
1541 | } | 1547 | } |
1542 | if ( attr.contains( "background" ) ) { | 1548 | if ( attr.contains( "background" ) ) { |
1543 | QImage img; | 1549 | QImage img; |
1544 | QString bg = attr["background"]; | 1550 | QString bg = attr["background"]; |
1545 | const QMimeSource* m = factory_->data( bg, contxt ); | 1551 | const QMimeSource* m = factory_->data( bg, contxt ); |
1546 | if ( !m ) { | 1552 | if ( !m ) { |
1547 | qWarning("QRichText: no mimesource for %s", bg.latin1() ); | 1553 | owarn << "QRichText: no mimesource for " << bg.latin1() << "" << oendl; |
1548 | } else { | 1554 | } else { |
1549 | if ( !QImageDrag::decode( m, img ) ) { | 1555 | if ( !QImageDrag::decode( m, img ) ) { |
1550 | qWarning("QTextImage: cannot decode %s", bg.latin1() ); | 1556 | owarn << "QTextImage: cannot decode " << bg.latin1() << "" << oendl; |
1551 | } | 1557 | } |
1552 | } | 1558 | } |
1553 | if ( !img.isNull() ) { | 1559 | if ( !img.isNull() ) { |
1554 | QPixmap pm; | 1560 | QPixmap pm; |
1555 | pm.convertFromImage( img ); | 1561 | pm.convertFromImage( img ); |
1556 | QBrush *b = new QBrush( QColor(), pm ); | 1562 | QBrush *b = new QBrush( QColor(), pm ); |
1557 | setPaper( b ); | 1563 | setPaper( b ); |
1558 | } | 1564 | } |
@@ -2147,17 +2153,17 @@ QString QTextDocument::richText() const | |||
2147 | } | 2153 | } |
2148 | QTextParagraph* p = fParag; | 2154 | QTextParagraph* p = fParag; |
2149 | 2155 | ||
2150 | QStyleSheetItem* item_p = styleSheet()->item("p"); | 2156 | QStyleSheetItem* item_p = styleSheet()->item("p"); |
2151 | QStyleSheetItem* item_ul = styleSheet()->item("ul"); | 2157 | QStyleSheetItem* item_ul = styleSheet()->item("ul"); |
2152 | QStyleSheetItem* item_ol = styleSheet()->item("ol"); | 2158 | QStyleSheetItem* item_ol = styleSheet()->item("ol"); |
2153 | QStyleSheetItem* item_li = styleSheet()->item("li"); | 2159 | QStyleSheetItem* item_li = styleSheet()->item("li"); |
2154 | if ( !item_p || !item_ul || !item_ol || !item_li ) { | 2160 | if ( !item_p || !item_ul || !item_ol || !item_li ) { |
2155 | qWarning( "QTextEdit: cannot export HTML due to insufficient stylesheet (lack of p, ul, ol, or li)" ); | 2161 | owarn << "QTextEdit: cannot export HTML due to insufficient stylesheet (lack of p, ul, ol, or li)" << oendl; |
2156 | return QString::null; | 2162 | return QString::null; |
2157 | } | 2163 | } |
2158 | int pastListDepth = 0; | 2164 | int pastListDepth = 0; |
2159 | int listDepth = 0; | 2165 | int listDepth = 0; |
2160 | int futureListDepth = 0; | 2166 | int futureListDepth = 0; |
2161 | QMemArray<int> listStyles(10); | 2167 | QMemArray<int> listStyles(10); |
2162 | 2168 | ||
2163 | while ( p ) { | 2169 | while ( p ) { |
@@ -4091,17 +4097,17 @@ int QTextParagraph::lineHeightOfChar( int i, int *bl, int *y ) const | |||
4091 | *y = ( *it )->y; | 4097 | *y = ( *it )->y; |
4092 | return ( *it )->h; | 4098 | return ( *it )->h; |
4093 | } | 4099 | } |
4094 | if ( it == lineStarts.begin() ) | 4100 | if ( it == lineStarts.begin() ) |
4095 | break; | 4101 | break; |
4096 | --it; | 4102 | --it; |
4097 | } | 4103 | } |
4098 | 4104 | ||
4099 | qWarning( "QTextParagraph::lineHeightOfChar: couldn't find lh for %d", i ); | 4105 | owarn << "QTextParagraph::lineHeightOfChar: couldn't find lh for " << i << "" << oendl; |
4100 | return 15; | 4106 | return 15; |
4101 | } | 4107 | } |
4102 | 4108 | ||
4103 | QTextStringChar *QTextParagraph::lineStartOfChar( int i, int *index, int *line ) const | 4109 | QTextStringChar *QTextParagraph::lineStartOfChar( int i, int *index, int *line ) const |
4104 | { | 4110 | { |
4105 | if ( !isValid() ) | 4111 | if ( !isValid() ) |
4106 | ( (QTextParagraph*)this )->format(); | 4112 | ( (QTextParagraph*)this )->format(); |
4107 | 4113 | ||
@@ -4117,17 +4123,17 @@ QTextStringChar *QTextParagraph::lineStartOfChar( int i, int *index, int *line ) | |||
4117 | return &str->at( it.key() ); | 4123 | return &str->at( it.key() ); |
4118 | } | 4124 | } |
4119 | if ( it == lineStarts.begin() ) | 4125 | if ( it == lineStarts.begin() ) |
4120 | break; | 4126 | break; |
4121 | --it; | 4127 | --it; |
4122 | --l; | 4128 | --l; |
4123 | } | 4129 | } |
4124 | 4130 | ||
4125 | qWarning( "QTextParagraph::lineStartOfChar: couldn't find %d", i ); | 4131 | owarn << "QTextParagraph::lineStartOfChar: couldn't find " << i << "" << oendl; |
4126 | return 0; | 4132 | return 0; |
4127 | } | 4133 | } |
4128 | 4134 | ||
4129 | int QTextParagraph::lines() const | 4135 | int QTextParagraph::lines() const |
4130 | { | 4136 | { |
4131 | if ( !isValid() ) | 4137 | if ( !isValid() ) |
4132 | ( (QTextParagraph*)this )->format(); | 4138 | ( (QTextParagraph*)this )->format(); |
4133 | 4139 | ||
@@ -4144,17 +4150,17 @@ QTextStringChar *QTextParagraph::lineStartOfLine( int line, int *index ) const | |||
4144 | while ( line-- > 0 ) | 4150 | while ( line-- > 0 ) |
4145 | ++it; | 4151 | ++it; |
4146 | int i = it.key(); | 4152 | int i = it.key(); |
4147 | if ( index ) | 4153 | if ( index ) |
4148 | *index = i; | 4154 | *index = i; |
4149 | return &str->at( i ); | 4155 | return &str->at( i ); |
4150 | } | 4156 | } |
4151 | 4157 | ||
4152 | qWarning( "QTextParagraph::lineStartOfLine: couldn't find %d", line ); | 4158 | owarn << "QTextParagraph::lineStartOfLine: couldn't find " << line << "" << oendl; |
4153 | return 0; | 4159 | return 0; |
4154 | } | 4160 | } |
4155 | 4161 | ||
4156 | int QTextParagraph::leftGap() const | 4162 | int QTextParagraph::leftGap() const |
4157 | { | 4163 | { |
4158 | if ( !isValid() ) | 4164 | if ( !isValid() ) |
4159 | ( (QTextParagraph*)this )->format(); | 4165 | ( (QTextParagraph*)this )->format(); |
4160 | 4166 | ||
@@ -5692,17 +5698,17 @@ QTextFormat *QTextFormatCollection::format( const QFont &f, const QColor &c ) | |||
5692 | 5698 | ||
5693 | if ( key == defFormat->key() ) | 5699 | if ( key == defFormat->key() ) |
5694 | return defFormat; | 5700 | return defFormat; |
5695 | 5701 | ||
5696 | cachedFormat = createFormat( f, c ); | 5702 | cachedFormat = createFormat( f, c ); |
5697 | cachedFormat->collection = this; | 5703 | cachedFormat->collection = this; |
5698 | cKey.insert( cachedFormat->key(), cachedFormat ); | 5704 | cKey.insert( cachedFormat->key(), cachedFormat ); |
5699 | if ( cachedFormat->key() != key ) | 5705 | if ( cachedFormat->key() != key ) |
5700 | qWarning("ASSERT: keys for format not identical: '%s '%s'", cachedFormat->key().latin1(), key.latin1() ); | 5706 | owarn << "ASSERT: keys for format not identical: '" << cachedFormat->key().latin1() << " '" << key.latin1() << "'" << oendl; |
5701 | return cachedFormat; | 5707 | return cachedFormat; |
5702 | } | 5708 | } |
5703 | 5709 | ||
5704 | void QTextFormatCollection::remove( QTextFormat *f ) | 5710 | void QTextFormatCollection::remove( QTextFormat *f ) |
5705 | { | 5711 | { |
5706 | if ( lastFormat == f ) | 5712 | if ( lastFormat == f ) |
5707 | lastFormat = 0; | 5713 | lastFormat = 0; |
5708 | if ( cres == f ) | 5714 | if ( cres == f ) |
@@ -6078,21 +6084,21 @@ QTextImage::QTextImage( QTextDocument *p, const QMap<QString, QString> &attr, co | |||
6078 | pmi.ref++; | 6084 | pmi.ref++; |
6079 | width = pm.width(); | 6085 | width = pm.width(); |
6080 | height = pm.height(); | 6086 | height = pm.height(); |
6081 | } else { | 6087 | } else { |
6082 | QImage img; | 6088 | QImage img; |
6083 | const QMimeSource* m = | 6089 | const QMimeSource* m = |
6084 | factory.data( imageName, context ); | 6090 | factory.data( imageName, context ); |
6085 | if ( !m ) { | 6091 | if ( !m ) { |
6086 | qWarning("QTextImage: no mimesource for %s", imageName.latin1() ); | 6092 | owarn << "QTextImage: no mimesource for " << imageName.latin1() << "" << oendl; |
6087 | } | 6093 | } |
6088 | else { | 6094 | else { |
6089 | if ( !QImageDrag::decode( m, img ) ) { | 6095 | if ( !QImageDrag::decode( m, img ) ) { |
6090 | qWarning("QTextImage: cannot decode %s", imageName.latin1() ); | 6096 | owarn << "QTextImage: cannot decode " << imageName.latin1() << "" << oendl; |
6091 | } | 6097 | } |
6092 | } | 6098 | } |
6093 | 6099 | ||
6094 | if ( !img.isNull() ) { | 6100 | if ( !img.isNull() ) { |
6095 | if ( width == 0 ) { | 6101 | if ( width == 0 ) { |
6096 | width = img.width(); | 6102 | width = img.width(); |
6097 | if ( height != 0 ) { | 6103 | if ( height != 0 ) { |
6098 | width = img.width() * height / img.height(); | 6104 | width = img.width() * height / img.height(); |
diff --git a/noncore/apps/opie-write/qrichtext_p.cpp b/noncore/apps/opie-write/qrichtext_p.cpp index 6783e0b..2e8b09c 100644 --- a/noncore/apps/opie-write/qrichtext_p.cpp +++ b/noncore/apps/opie-write/qrichtext_p.cpp | |||
@@ -30,16 +30,19 @@ | |||
30 | ** See http://www.trolltech.com/qpl/ for QPL licensing information. | 30 | ** See http://www.trolltech.com/qpl/ for QPL licensing information. |
31 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 31 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
32 | ** | 32 | ** |
33 | ** Contact info@trolltech.com if any conditions of this licensing are | 33 | ** Contact info@trolltech.com if any conditions of this licensing are |
34 | ** not clear to you. | 34 | ** not clear to you. |
35 | ** | 35 | ** |
36 | **********************************************************************/ | 36 | **********************************************************************/ |
37 | 37 | ||
38 | #include <opie2/odebug.h> | ||
39 | using namespace Opie::Core; | ||
40 | |||
38 | #include "qrichtext_p.h" | 41 | #include "qrichtext_p.h" |
39 | 42 | ||
40 | using namespace Qt3; | 43 | using namespace Qt3; |
41 | 44 | ||
42 | QTextCommand::~QTextCommand() {} | 45 | QTextCommand::~QTextCommand() {} |
43 | QTextCommand::Commands QTextCommand::type() const { return Invalid; } | 46 | QTextCommand::Commands QTextCommand::type() const { return Invalid; } |
44 | 47 | ||
45 | 48 | ||
@@ -132,17 +135,17 @@ void QTextCursor::gotoPosition( QTextParagraph* p, int index ) | |||
132 | if ( para && p != para ) { | 135 | if ( para && p != para ) { |
133 | while ( para->document() != p->document() && !indices.isEmpty() ) | 136 | while ( para->document() != p->document() && !indices.isEmpty() ) |
134 | pop(); | 137 | pop(); |
135 | Q_ASSERT( indices.isEmpty() || para->document() == p->document() ); | 138 | Q_ASSERT( indices.isEmpty() || para->document() == p->document() ); |
136 | } | 139 | } |
137 | para = p; | 140 | para = p; |
138 | if ( index < 0 || index >= para->length() ) { | 141 | if ( index < 0 || index >= para->length() ) { |
139 | #if defined(QT_CHECK_RANGE) | 142 | #if defined(QT_CHECK_RANGE) |
140 | qWarning( "QTextCursor::gotoParagraph Index: %d out of range", index ); | 143 | owarn << "QTextCursor::gotoParagraph Index: " << index << " out of range" << oendl; |
141 | #endif | 144 | #endif |
142 | index = index < 0 ? 0 : para->length() - 1; | 145 | index = index < 0 ? 0 : para->length() - 1; |
143 | } | 146 | } |
144 | 147 | ||
145 | tmpIndex = -1; | 148 | tmpIndex = -1; |
146 | idx = index; | 149 | idx = index; |
147 | } | 150 | } |
148 | 151 | ||
@@ -472,66 +475,66 @@ bool QTextParagraph::fullSelected( int id ) const | |||
472 | if ( it == mSelections->end() ) | 475 | if ( it == mSelections->end() ) |
473 | return FALSE; | 476 | return FALSE; |
474 | return ( *it ).start == 0 && ( *it ).end == str->length() - 1; | 477 | return ( *it ).start == 0 && ( *it ).end == str->length() - 1; |
475 | } | 478 | } |
476 | 479 | ||
477 | int QTextParagraph::lineY( int l ) const | 480 | int QTextParagraph::lineY( int l ) const |
478 | { | 481 | { |
479 | if ( l > (int)lineStarts.count() - 1 ) { | 482 | if ( l > (int)lineStarts.count() - 1 ) { |
480 | qWarning( "QTextParagraph::lineY: line %d out of range!", l ); | 483 | owarn << "QTextParagraph::lineY: line " << l << " out of range!" << oendl; |
481 | return 0; | 484 | return 0; |
482 | } | 485 | } |
483 | 486 | ||
484 | if ( !isValid() ) | 487 | if ( !isValid() ) |
485 | ( (QTextParagraph*)this )->format(); | 488 | ( (QTextParagraph*)this )->format(); |
486 | 489 | ||
487 | QMap<int, QTextLineStart*>::ConstIterator it = lineStarts.begin(); | 490 | QMap<int, QTextLineStart*>::ConstIterator it = lineStarts.begin(); |
488 | while ( l-- > 0 ) | 491 | while ( l-- > 0 ) |
489 | ++it; | 492 | ++it; |
490 | return ( *it )->y; | 493 | return ( *it )->y; |
491 | } | 494 | } |
492 | 495 | ||
493 | int QTextParagraph::lineBaseLine( int l ) const | 496 | int QTextParagraph::lineBaseLine( int l ) const |
494 | { | 497 | { |
495 | if ( l > (int)lineStarts.count() - 1 ) { | 498 | if ( l > (int)lineStarts.count() - 1 ) { |
496 | qWarning( "QTextParagraph::lineBaseLine: line %d out of range!", l ); | 499 | owarn << "QTextParagraph::lineBaseLine: line " << l << " out of range!" << oendl; |
497 | return 10; | 500 | return 10; |
498 | } | 501 | } |
499 | 502 | ||
500 | if ( !isValid() ) | 503 | if ( !isValid() ) |
501 | ( (QTextParagraph*)this )->format(); | 504 | ( (QTextParagraph*)this )->format(); |
502 | 505 | ||
503 | QMap<int, QTextLineStart*>::ConstIterator it = lineStarts.begin(); | 506 | QMap<int, QTextLineStart*>::ConstIterator it = lineStarts.begin(); |
504 | while ( l-- > 0 ) | 507 | while ( l-- > 0 ) |
505 | ++it; | 508 | ++it; |
506 | return ( *it )->baseLine; | 509 | return ( *it )->baseLine; |
507 | } | 510 | } |
508 | 511 | ||
509 | int QTextParagraph::lineHeight( int l ) const | 512 | int QTextParagraph::lineHeight( int l ) const |
510 | { | 513 | { |
511 | if ( l > (int)lineStarts.count() - 1 ) { | 514 | if ( l > (int)lineStarts.count() - 1 ) { |
512 | qWarning( "QTextParagraph::lineHeight: line %d out of range!", l ); | 515 | owarn << "QTextParagraph::lineHeight: line " << l << " out of range!" << oendl; |
513 | return 15; | 516 | return 15; |
514 | } | 517 | } |
515 | 518 | ||
516 | if ( !isValid() ) | 519 | if ( !isValid() ) |
517 | ( (QTextParagraph*)this )->format(); | 520 | ( (QTextParagraph*)this )->format(); |
518 | 521 | ||
519 | QMap<int, QTextLineStart*>::ConstIterator it = lineStarts.begin(); | 522 | QMap<int, QTextLineStart*>::ConstIterator it = lineStarts.begin(); |
520 | while ( l-- > 0 ) | 523 | while ( l-- > 0 ) |
521 | ++it; | 524 | ++it; |
522 | return ( *it )->h; | 525 | return ( *it )->h; |
523 | } | 526 | } |
524 | 527 | ||
525 | void QTextParagraph::lineInfo( int l, int &y, int &h, int &bl ) const | 528 | void QTextParagraph::lineInfo( int l, int &y, int &h, int &bl ) const |
526 | { | 529 | { |
527 | if ( l > (int)lineStarts.count() - 1 ) { | 530 | if ( l > (int)lineStarts.count() - 1 ) { |
528 | qWarning( "QTextParagraph::lineInfo: line %d out of range!", l ); | 531 | owarn << "QTextParagraph::lineInfo: line " << l << " out of range!" << oendl; |
529 | qDebug( "%d %d", (int)lineStarts.count() - 1, l ); | 532 | odebug << "" << (int)lineStarts.count() - 1 << " " << l << "" << oendl; |
530 | y = 0; | 533 | y = 0; |
531 | h = 15; | 534 | h = 15; |
532 | bl = 10; | 535 | bl = 10; |
533 | return; | 536 | return; |
534 | } | 537 | } |
535 | 538 | ||
536 | if ( !isValid() ) | 539 | if ( !isValid() ) |
537 | ( (QTextParagraph*)this )->format(); | 540 | ( (QTextParagraph*)this )->format(); |
diff --git a/noncore/apps/qashmoney/accountdisplay.cpp b/noncore/apps/qashmoney/accountdisplay.cpp index 0fe5b09..046d997 100755 --- a/noncore/apps/qashmoney/accountdisplay.cpp +++ b/noncore/apps/qashmoney/accountdisplay.cpp | |||
@@ -1,17 +1,22 @@ | |||
1 | #include <qmessagebox.h> | ||
2 | #include <qheader.h> | ||
3 | |||
4 | #include "accountdisplay.h" | 1 | #include "accountdisplay.h" |
5 | #include "newaccount.h" | 2 | #include "newaccount.h" |
6 | #include "transaction.h" | 3 | #include "transaction.h" |
7 | #include "transferdialog.h" | 4 | #include "transferdialog.h" |
8 | #include "transfer.h" | 5 | #include "transfer.h" |
9 | 6 | ||
7 | /* OPIE */ | ||
8 | #include <opie2/odebug.h> | ||
9 | using namespace Opie::Core; | ||
10 | |||
11 | /* QT */ | ||
12 | #include <qmessagebox.h> | ||
13 | #include <qheader.h> | ||
14 | |||
10 | extern Account *account; | 15 | extern Account *account; |
11 | extern Transaction *transaction; | 16 | extern Transaction *transaction; |
12 | extern Transfer *transfer; | 17 | extern Transfer *transfer; |
13 | extern Preferences *preferences; | 18 | extern Preferences *preferences; |
14 | 19 | ||
15 | AccountDisplay::AccountDisplay ( QWidget *parent ) : QWidget ( parent ) | 20 | AccountDisplay::AccountDisplay ( QWidget *parent ) : QWidget ( parent ) |
16 | { | 21 | { |
17 | cleared = 0; | 22 | cleared = 0; |
@@ -262,17 +267,17 @@ void AccountDisplay::getTransferAccounts ( QListViewItem * item ) | |||
262 | int defaultyear = today.year(); | 267 | int defaultyear = today.year(); |
263 | td->date->setText ( preferences->getDate ( defaultyear, defaultmonth, defaultday ) ); | 268 | td->date->setText ( preferences->getDate ( defaultyear, defaultmonth, defaultday ) ); |
264 | 269 | ||
265 | if ( td->exec() == QDialog::Accepted ) | 270 | if ( td->exec() == QDialog::Accepted ) |
266 | { | 271 | { |
267 | // set the cleared integer if the checkbox is checked | 272 | // set the cleared integer if the checkbox is checked |
268 | if ( td->clearedcheckbox->isChecked() == TRUE ) | 273 | if ( td->clearedcheckbox->isChecked() == TRUE ) |
269 | cleared = 1; | 274 | cleared = 1; |
270 | qDebug("Year from transferdialog = %i",td->getYear()); | 275 | odebug << "Year from transferdialog = " << td->getYear() << "" << oendl; |
271 | // add the transfer with a new date if its been edited or use the default date | 276 | // add the transfer with a new date if its been edited or use the default date |
272 | if ( td->getDateEdited () == TRUE ) | 277 | 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 ); | 278 | transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, account->getParentAccountID ( secondaccountid ), td->getDay(), td->getMonth(), td->getYear(), td->amount->text().toFloat(), cleared ); |
274 | else | 279 | else |
275 | transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, account->getParentAccountID ( secondaccountid ), defaultday, defaultmonth, defaultyear, td->amount->text().toFloat(), cleared ); | 280 | transfer->addTransfer ( firstaccountid, account->getParentAccountID ( firstaccountid ), secondaccountid, account->getParentAccountID ( secondaccountid ), defaultday, defaultmonth, defaultyear, td->amount->text().toFloat(), cleared ); |
276 | 281 | ||
277 | // update account balances of both accounts and parents if necessary | 282 | // update account balances of both accounts and parents if necessary |
278 | account->updateAccountBalance ( firstaccountid ); | 283 | account->updateAccountBalance ( firstaccountid ); |
diff --git a/noncore/apps/qashmoney/config.in b/noncore/apps/qashmoney/config.in index 91739fe..aeed298 100644 --- a/noncore/apps/qashmoney/config.in +++ b/noncore/apps/qashmoney/config.in | |||
@@ -1,4 +1,4 @@ | |||
1 | config QASHMONEY | 1 | config QASHMONEY |
2 | boolean "opie-qashmoney (money manager)" | 2 | boolean "opie-qashmoney (money manager)" |
3 | default "n" | 3 | default "n" |
4 | depends ( LIBQPE || LIBQPE-X11 ) | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE |
diff --git a/noncore/apps/qashmoney/qashmoney.pro b/noncore/apps/qashmoney/qashmoney.pro index 6ad3db3..8a4302f 100755 --- a/noncore/apps/qashmoney/qashmoney.pro +++ b/noncore/apps/qashmoney/qashmoney.pro | |||
@@ -38,12 +38,12 @@ SOURCES = qashmoney.cpp \ | |||
38 | budgetdisplay.cpp \ | 38 | budgetdisplay.cpp \ |
39 | currency.cpp | 39 | currency.cpp |
40 | INCLUDEPATH = $(OPIEDIR)/include | 40 | INCLUDEPATH = $(OPIEDIR)/include |
41 | DEPENDPATH = $(OPIEDIR)/include | 41 | DEPENDPATH = $(OPIEDIR)/include |
42 | 42 | ||
43 | DESTDIR = $(OPIEDIR)/bin | 43 | DESTDIR = $(OPIEDIR)/bin |
44 | 44 | ||
45 | unix:LIBS += -lm | 45 | unix:LIBS += -lm |
46 | LIBS += -lqpe -lqte -lsqlite | 46 | LIBS += -lqpe -lopiecore2 -lsqlite |
47 | 47 | ||
48 | include ( $(OPIEDIR)/include.pro ) | 48 | include ( $(OPIEDIR)/include.pro ) |
49 | 49 | ||
diff --git a/noncore/apps/tableviewer/db/common.cpp b/noncore/apps/tableviewer/db/common.cpp index dbf9370..6e544ba 100644 --- a/noncore/apps/tableviewer/db/common.cpp +++ b/noncore/apps/tableviewer/db/common.cpp | |||
@@ -12,25 +12,33 @@ | |||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include <stdlib.h> | 20 | #include "common.h" |
21 | #include "datacache.h" | ||
22 | |||
23 | /* OPIE */ | ||
24 | #include <opie2/odebug.h> | ||
25 | #include <qpe/timestring.h> | ||
26 | using namespace Opie::Core; | ||
27 | |||
28 | /* QT */ | ||
21 | #include <qstring.h> | 29 | #include <qstring.h> |
22 | #include <qheader.h> | 30 | #include <qheader.h> |
23 | #include <qvector.h> | 31 | #include <qvector.h> |
24 | #include <qdatetime.h> | 32 | #include <qdatetime.h> |
25 | #include <qpe/timestring.h> | 33 | |
26 | #include "common.h" | 34 | /* STD */ |
27 | #include "datacache.h" | ||
28 | #include <assert.h> | 35 | #include <assert.h> |
36 | #include <stdlib.h> | ||
29 | 37 | ||
30 | static const int del_flag = 0x1; | 38 | static const int del_flag = 0x1; |
31 | static const int new_flag = 0x2; | 39 | static const int new_flag = 0x2; |
32 | 40 | ||
33 | /* Helper function */ | 41 | /* Helper function */ |
34 | 42 | ||
35 | int parseNextNumber(QString *q) { | 43 | int parseNextNumber(QString *q) { |
36 | QChar c; | 44 | QChar c; |
@@ -307,17 +315,17 @@ void TVVariant::load(QDataStream &s ) | |||
307 | case Int: | 315 | case Int: |
308 | { | 316 | { |
309 | int x; | 317 | int x; |
310 | s >> x; | 318 | s >> x; |
311 | d->value.i = x; | 319 | d->value.i = x; |
312 | } | 320 | } |
313 | break; | 321 | break; |
314 | default: | 322 | default: |
315 | qFatal("Unrecognized data type"); | 323 | ofatal << "Unrecognized data type" << oendl; |
316 | } | 324 | } |
317 | } | 325 | } |
318 | 326 | ||
319 | void TVVariant::save( QDataStream &s ) const | 327 | void TVVariant::save( QDataStream &s ) const |
320 | { | 328 | { |
321 | s << type(); | 329 | s << type(); |
322 | 330 | ||
323 | switch( d->typ ) { | 331 | switch( d->typ ) { |
@@ -1073,17 +1081,17 @@ QDataStream &operator>>( QDataStream &s, DataElem &d) | |||
1073 | { | 1081 | { |
1074 | int i; | 1082 | int i; |
1075 | int size; | 1083 | int size; |
1076 | TVVariant t; | 1084 | TVVariant t; |
1077 | int index = 0; | 1085 | int index = 0; |
1078 | 1086 | ||
1079 | s >> size; /* redundent data but makes streaming easier */ | 1087 | s >> size; /* redundent data but makes streaming easier */ |
1080 | if (size != d.getNumFields()) { | 1088 | if (size != d.getNumFields()) { |
1081 | qWarning("DataSize mis-match"); | 1089 | owarn << "DataSize mis-match" << oendl; |
1082 | return s; /* sanity check failed.. don't load */ | 1090 | return s; /* sanity check failed.. don't load */ |
1083 | } | 1091 | } |
1084 | 1092 | ||
1085 | for(i = 0; i < size; i++) { | 1093 | for(i = 0; i < size; i++) { |
1086 | s >> (Q_UINT16)index; | 1094 | s >> (Q_UINT16)index; |
1087 | s >> t; | 1095 | s >> t; |
1088 | d.setField(index, t); | 1096 | d.setField(index, t); |
1089 | } | 1097 | } |
@@ -1372,17 +1380,17 @@ bool DataElem::contains(int i, TVVariant v) const | |||
1372 | /* meaningless for ints */ | 1380 | /* meaningless for ints */ |
1373 | /* meaningless for time */ | 1381 | /* meaningless for time */ |
1374 | /* meaningless for dates */ | 1382 | /* meaningless for dates */ |
1375 | case TVVariant::Int: | 1383 | case TVVariant::Int: |
1376 | case TVVariant::Time: | 1384 | case TVVariant::Time: |
1377 | case TVVariant::Date: | 1385 | case TVVariant::Date: |
1378 | break; | 1386 | break; |
1379 | default: | 1387 | default: |
1380 | qWarning("Tried to compare unknown data type"); | 1388 | owarn << "Tried to compare unknown data type" << oendl; |
1381 | } | 1389 | } |
1382 | return FALSE; | 1390 | return FALSE; |
1383 | } | 1391 | } |
1384 | 1392 | ||
1385 | bool DataElem::startsWith(int i, TVVariant v) const | 1393 | bool DataElem::startsWith(int i, TVVariant v) const |
1386 | { | 1394 | { |
1387 | if (!hasValidValue(i)) return FALSE; | 1395 | if (!hasValidValue(i)) return FALSE; |
1388 | 1396 | ||
@@ -1398,17 +1406,17 @@ bool DataElem::startsWith(int i, TVVariant v) const | |||
1398 | /* meaningless for ints */ | 1406 | /* meaningless for ints */ |
1399 | /* meaningless for time */ | 1407 | /* meaningless for time */ |
1400 | /* meaningless for dates */ | 1408 | /* meaningless for dates */ |
1401 | case TVVariant::Int: | 1409 | case TVVariant::Int: |
1402 | case TVVariant::Time: | 1410 | case TVVariant::Time: |
1403 | case TVVariant::Date: | 1411 | case TVVariant::Date: |
1404 | return FALSE; | 1412 | return FALSE; |
1405 | default: | 1413 | default: |
1406 | qWarning("Tried to compare unknown data type"); | 1414 | owarn << "Tried to compare unknown data type" << oendl; |
1407 | } | 1415 | } |
1408 | return FALSE; | 1416 | return FALSE; |
1409 | } | 1417 | } |
1410 | 1418 | ||
1411 | bool DataElem::endsWith(int i, TVVariant v) const | 1419 | bool DataElem::endsWith(int i, TVVariant v) const |
1412 | { | 1420 | { |
1413 | if (!hasValidValue(i)) return FALSE; | 1421 | if (!hasValidValue(i)) return FALSE; |
1414 | 1422 | ||
@@ -1424,17 +1432,17 @@ bool DataElem::endsWith(int i, TVVariant v) const | |||
1424 | /* meaningless for ints */ | 1432 | /* meaningless for ints */ |
1425 | /* meaningless for time */ | 1433 | /* meaningless for time */ |
1426 | /* meaningless for dates */ | 1434 | /* meaningless for dates */ |
1427 | case TVVariant::Int: | 1435 | case TVVariant::Int: |
1428 | case TVVariant::Time: | 1436 | case TVVariant::Time: |
1429 | case TVVariant::Date: | 1437 | case TVVariant::Date: |
1430 | return FALSE; | 1438 | return FALSE; |
1431 | default: | 1439 | default: |
1432 | qWarning("Tried to compare unknown data type"); | 1440 | owarn << "Tried to compare unknown data type" << oendl; |
1433 | } | 1441 | } |
1434 | return FALSE; | 1442 | return FALSE; |
1435 | } | 1443 | } |
1436 | 1444 | ||
1437 | /*! | 1445 | /*! |
1438 | Determins which of the first to parameters are closer to the third, target | 1446 | Determins which of the first to parameters are closer to the third, target |
1439 | parameter. | 1447 | parameter. |
1440 | 1448 | ||
@@ -1456,15 +1464,15 @@ bool DataElem::closer(DataElem*d1, DataElem *d2, TVVariant target, int column) | |||
1456 | 1464 | ||
1457 | if(!target.isValid()) return FALSE; | 1465 | if(!target.isValid()) return FALSE; |
1458 | 1466 | ||
1459 | type = d1->getField(column).type(); | 1467 | type = d1->getField(column).type(); |
1460 | 1468 | ||
1461 | if(d2) { | 1469 | if(d2) { |
1462 | if (type != d2->getField(column).type()) { | 1470 | if (type != d2->getField(column).type()) { |
1463 | /* can't do compare */ | 1471 | /* can't do compare */ |
1464 | qWarning("Tried to compare two incompatable types"); | 1472 | owarn << "Tried to compare two incompatable types" << oendl; |
1465 | return FALSE; | 1473 | return FALSE; |
1466 | } | 1474 | } |
1467 | return target.closer(d1->getField(column), d2->getField(column)); | 1475 | return target.closer(d1->getField(column), d2->getField(column)); |
1468 | } | 1476 | } |
1469 | return target.close(d1->getField(column)); | 1477 | return target.close(d1->getField(column)); |
1470 | } | 1478 | } |
diff --git a/noncore/apps/tableviewer/db/datacache.cpp b/noncore/apps/tableviewer/db/datacache.cpp index 7c14eef..6380e1b 100644 --- a/noncore/apps/tableviewer/db/datacache.cpp +++ b/noncore/apps/tableviewer/db/datacache.cpp | |||
@@ -21,19 +21,27 @@ | |||
21 | * This file is used to load the xml files that represent the database. | 21 | * This file is used to load the xml files that represent the database. |
22 | * The main requirment for said file is each data entry must contain a key, | 22 | * The main requirment for said file is each data entry must contain a key, |
23 | * otherwise any other data headings are allowed. | 23 | * otherwise any other data headings are allowed. |
24 | */ | 24 | */ |
25 | 25 | ||
26 | #include "datacache.h" | 26 | #include "datacache.h" |
27 | #include "xmlsource.h" | 27 | #include "xmlsource.h" |
28 | #include "csvsource.h" | 28 | #include "csvsource.h" |
29 | #include <stdlib.h> | 29 | |
30 | /* OPIE */ | ||
31 | #include <opie2/odebug.h> | ||
32 | using namespace Opie::Core; | ||
33 | |||
34 | /* QT */ | ||
30 | #include <qheader.h> | 35 | #include <qheader.h> |
31 | 36 | ||
37 | /* STD */ | ||
38 | #include <stdlib.h> | ||
39 | |||
32 | #define INIT_TABLE_SIZE 128 | 40 | #define INIT_TABLE_SIZE 128 |
33 | 41 | ||
34 | /*! | 42 | /*! |
35 | \class DBStore datastore.h | 43 | \class DBStore datastore.h |
36 | 44 | ||
37 | \brief The DBStore class is the class responsible for storing, sorting and | 45 | \brief The DBStore class is the class responsible for storing, sorting and |
38 | searching the data loaded by the application | 46 | searching the data loaded by the application |
39 | 47 | ||
@@ -145,17 +153,17 @@ void DBStore::addItem(DataElem *delem) | |||
145 | { | 153 | { |
146 | addItemInternal(delem); | 154 | addItemInternal(delem); |
147 | } | 155 | } |
148 | 156 | ||
149 | void DBStore::addItemInternal(DataElem *delem) | 157 | void DBStore::addItemInternal(DataElem *delem) |
150 | { | 158 | { |
151 | /* if already full, don't over fill, do a qWarning though */ | 159 | /* if already full, don't over fill, do a qWarning though */ |
152 | if (full) { | 160 | if (full) { |
153 | qWarning("Attempted to add items to already full table"); | 161 | owarn << "Attempted to add items to already full table" << oendl; |
154 | return; | 162 | return; |
155 | } | 163 | } |
156 | 164 | ||
157 | master_table.insert(number_elems, delem); | 165 | master_table.insert(number_elems, delem); |
158 | 166 | ||
159 | current_elem = number_elems; | 167 | current_elem = number_elems; |
160 | number_elems++; | 168 | number_elems++; |
161 | 169 | ||
diff --git a/noncore/apps/tableviewer/db/xmlsource.cpp b/noncore/apps/tableviewer/db/xmlsource.cpp index 94fec36..4ca6aee 100644 --- a/noncore/apps/tableviewer/db/xmlsource.cpp +++ b/noncore/apps/tableviewer/db/xmlsource.cpp | |||
@@ -13,22 +13,28 @@ | |||
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include "xmlsource.h" | 20 | #include "xmlsource.h" |
21 | #include <qdict.h> | ||
22 | #include <stdlib.h> | ||
23 | #include <qtextstream.h> | ||
24 | #include "../xmlencodeattr.h" | 21 | #include "../xmlencodeattr.h" |
25 | 22 | ||
23 | /* OPIE */ | ||
24 | #include <opie2/odebug.h> | ||
25 | using namespace Opie::Core; | ||
26 | 26 | ||
27 | /* QT */ | ||
28 | #include <qdict.h> | ||
29 | #include <qtextstream.h> | ||
30 | |||
31 | /* STD */ | ||
32 | #include <stdlib.h> | ||
27 | 33 | ||
28 | DBXml::DBXml(DBStore *d) | 34 | DBXml::DBXml(DBStore *d) |
29 | { | 35 | { |
30 | dstore = d; | 36 | dstore = d; |
31 | } | 37 | } |
32 | 38 | ||
33 | QString DBXml::type() | 39 | QString DBXml::type() |
34 | { | 40 | { |
@@ -135,17 +141,17 @@ DBXmlHandler::DBXmlHandler(DBStore *ds) | |||
135 | Destroys the DBXmlHandler | 141 | Destroys the DBXmlHandler |
136 | */ | 142 | */ |
137 | DBXmlHandler::~DBXmlHandler() | 143 | DBXmlHandler::~DBXmlHandler() |
138 | { | 144 | { |
139 | } | 145 | } |
140 | 146 | ||
141 | QString DBXmlHandler::errorProtocol() | 147 | QString DBXmlHandler::errorProtocol() |
142 | { | 148 | { |
143 | qWarning("Error reading file"); | 149 | owarn << "Error reading file" << oendl; |
144 | return errorProt; | 150 | return errorProt; |
145 | } | 151 | } |
146 | 152 | ||
147 | bool DBXmlHandler::startDocument() | 153 | bool DBXmlHandler::startDocument() |
148 | { | 154 | { |
149 | errorProt = ""; | 155 | errorProt = ""; |
150 | state = StateInit; | 156 | state = StateInit; |
151 | return TRUE; | 157 | return TRUE; |
@@ -167,17 +173,17 @@ bool DBXmlHandler::startElement(const QString&, const QString&, | |||
167 | return TRUE; | 173 | return TRUE; |
168 | } | 174 | } |
169 | if (state == StateHeader && qName == "key") { | 175 | if (state == StateHeader && qName == "key") { |
170 | /* Ok, adding a new key to our KeyList TODO */ | 176 | /* Ok, adding a new key to our KeyList TODO */ |
171 | state = StateKey; | 177 | state = StateKey; |
172 | last_key_type = TVVariant::String; | 178 | last_key_type = TVVariant::String; |
173 | key = atts.value("name"); | 179 | key = atts.value("name"); |
174 | if (key.isEmpty()) { | 180 | if (key.isEmpty()) { |
175 | qWarning("empty key name"); | 181 | owarn << "empty key name" << oendl; |
176 | return FALSE; | 182 | return FALSE; |
177 | } | 183 | } |
178 | if(!atts.value("type").isEmpty()) | 184 | if(!atts.value("type").isEmpty()) |
179 | last_key_type = TVVariant::nameToType(atts.value("type")); | 185 | last_key_type = TVVariant::nameToType(atts.value("type")); |
180 | return TRUE; | 186 | return TRUE; |
181 | } | 187 | } |
182 | if (state == StateDocument && qName == "record") { | 188 | if (state == StateDocument && qName == "record") { |
183 | state = StateRecord; | 189 | state = StateRecord; |
@@ -185,23 +191,23 @@ bool DBXmlHandler::startElement(const QString&, const QString&, | |||
185 | // Now expecting a <record> tag | 191 | // Now expecting a <record> tag |
186 | return TRUE; | 192 | return TRUE; |
187 | } | 193 | } |
188 | if (state == StateRecord) { | 194 | if (state == StateRecord) { |
189 | state = StateField; | 195 | state = StateField; |
190 | /* the qName is the name of a key */ | 196 | /* the qName is the name of a key */ |
191 | if (!keyIndexList[qName]) { | 197 | if (!keyIndexList[qName]) { |
192 | /* invalid key, we failed */ | 198 | /* invalid key, we failed */ |
193 | qWarning("Invalid key in record"); | 199 | owarn << "Invalid key in record" << oendl; |
194 | return FALSE; | 200 | return FALSE; |
195 | } | 201 | } |
196 | keyIndex = *keyIndexList[qName]; | 202 | keyIndex = *keyIndexList[qName]; |
197 | return TRUE; | 203 | return TRUE; |
198 | } | 204 | } |
199 | qWarning("Unable to determine tag type"); | 205 | owarn << "Unable to determine tag type" << oendl; |
200 | return FALSE; | 206 | return FALSE; |
201 | } | 207 | } |
202 | 208 | ||
203 | bool DBXmlHandler::endElement(const QString&, const QString&, | 209 | bool DBXmlHandler::endElement(const QString&, const QString&, |
204 | const QString& qName) | 210 | const QString& qName) |
205 | { | 211 | { |
206 | switch(state) { | 212 | switch(state) { |
207 | case StateField: | 213 | case StateField: |
@@ -220,17 +226,17 @@ bool DBXmlHandler::endElement(const QString&, const QString&, | |||
220 | data_store->addItem(current_data); | 226 | data_store->addItem(current_data); |
221 | state = StateDocument; | 227 | state = StateDocument; |
222 | break; | 228 | break; |
223 | case StateDocument: | 229 | case StateDocument: |
224 | // we are done... | 230 | // we are done... |
225 | break; | 231 | break; |
226 | default: | 232 | default: |
227 | // should only get a 'endElement' from one of the above states. | 233 | // should only get a 'endElement' from one of the above states. |
228 | qWarning("Invalid end tag"); | 234 | owarn << "Invalid end tag" << oendl; |
229 | return FALSE; | 235 | return FALSE; |
230 | break; | 236 | break; |
231 | } | 237 | } |
232 | return TRUE; | 238 | return TRUE; |
233 | } | 239 | } |
234 | 240 | ||
235 | bool DBXmlHandler::characters(const QString& ch) | 241 | bool DBXmlHandler::characters(const QString& ch) |
236 | { | 242 | { |
@@ -249,49 +255,49 @@ bool DBXmlHandler::characters(const QString& ch) | |||
249 | return TRUE; | 255 | return TRUE; |
250 | } | 256 | } |
251 | if (state == StateField) { | 257 | if (state == StateField) { |
252 | /* Ok, need to add data here */ | 258 | /* Ok, need to add data here */ |
253 | current_data->setField(keyIndex, ch_simplified); | 259 | current_data->setField(keyIndex, ch_simplified); |
254 | return TRUE; | 260 | return TRUE; |
255 | } | 261 | } |
256 | 262 | ||
257 | qWarning("Junk characters found... ignored"); | 263 | owarn << "Junk characters found... ignored" << oendl; |
258 | return TRUE; | 264 | return TRUE; |
259 | } | 265 | } |
260 | 266 | ||
261 | QString DBXmlHandler::errorString() | 267 | QString DBXmlHandler::errorString() |
262 | { | 268 | { |
263 | return "the document is not in the expected file format"; | 269 | return "the document is not in the expected file format"; |
264 | } | 270 | } |
265 | 271 | ||
266 | bool DBXmlHandler::warning(const QXmlParseException& exception) | 272 | bool DBXmlHandler::warning(const QXmlParseException& exception) |
267 | { | 273 | { |
268 | errorProt += QString("warning parsing error: %1 in line %2, column %3\n" ) | 274 | errorProt += QString("warning parsing error: %1 in line %2, column %3\n" ) |
269 | .arg(exception.message()) | 275 | .arg(exception.message()) |
270 | .arg(exception.lineNumber()) | 276 | .arg(exception.lineNumber()) |
271 | .arg(exception.columnNumber()); | 277 | .arg(exception.columnNumber()); |
272 | 278 | ||
273 | qWarning(errorProt); | 279 | owarn << errorProt << oendl; |
274 | return QXmlDefaultHandler::fatalError(exception); | 280 | return QXmlDefaultHandler::fatalError(exception); |
275 | } | 281 | } |
276 | 282 | ||
277 | bool DBXmlHandler::error(const QXmlParseException& exception) | 283 | bool DBXmlHandler::error(const QXmlParseException& exception) |
278 | { | 284 | { |
279 | errorProt += QString("error parsing error: %1 in line %2, column %3\n" ) | 285 | errorProt += QString("error parsing error: %1 in line %2, column %3\n" ) |
280 | .arg(exception.message()) | 286 | .arg(exception.message()) |
281 | .arg(exception.lineNumber()) | 287 | .arg(exception.lineNumber()) |
282 | .arg(exception.columnNumber()); | 288 | .arg(exception.columnNumber()); |
283 | 289 | ||
284 | qWarning(errorProt); | 290 | owarn << errorProt << oendl; |
285 | return QXmlDefaultHandler::fatalError(exception); | 291 | return QXmlDefaultHandler::fatalError(exception); |
286 | } | 292 | } |
287 | 293 | ||
288 | bool DBXmlHandler::fatalError(const QXmlParseException& exception) | 294 | bool DBXmlHandler::fatalError(const QXmlParseException& exception) |
289 | { | 295 | { |
290 | errorProt += QString("fatal parsing error: %1 in line %2, column %3\n" ) | 296 | errorProt += QString("fatal parsing error: %1 in line %2, column %3\n" ) |
291 | .arg(exception.message()) | 297 | .arg(exception.message()) |
292 | .arg(exception.lineNumber()) | 298 | .arg(exception.lineNumber()) |
293 | .arg(exception.columnNumber()); | 299 | .arg(exception.columnNumber()); |
294 | 300 | ||
295 | qWarning(errorProt); | 301 | owarn << errorProt << oendl; |
296 | return QXmlDefaultHandler::fatalError(exception); | 302 | return QXmlDefaultHandler::fatalError(exception); |
297 | } | 303 | } |
diff --git a/noncore/apps/tableviewer/tableviewer.cpp b/noncore/apps/tableviewer/tableviewer.cpp index 102b94c..9538cb3 100644 --- a/noncore/apps/tableviewer/tableviewer.cpp +++ b/noncore/apps/tableviewer/tableviewer.cpp | |||
@@ -13,37 +13,39 @@ | |||
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | /* local includes */ | ||
22 | #include "tableviewer.h" | 21 | #include "tableviewer.h" |
23 | #include "ui/tvbrowseview.h" | 22 | #include "ui/tvbrowseview.h" |
24 | #include "ui/tvfilterview.h" | 23 | #include "ui/tvfilterview.h" |
25 | #include "ui/tvlistview.h" | 24 | #include "ui/tvlistview.h" |
26 | #include "ui/tveditview.h" | 25 | #include "ui/tveditview.h" |
27 | #include "ui/tvkeyedit.h" | 26 | #include "ui/tvkeyedit.h" |
28 | #include "db/datacache.h" | 27 | #include "db/datacache.h" |
29 | 28 | ||
30 | /* QPE includes */ | 29 | /* OPIE */ |
30 | #include <opie2/odebug.h> | ||
31 | #include <qpe/fileselector.h> | 31 | #include <qpe/fileselector.h> |
32 | #include <qpe/resource.h> | 32 | #include <qpe/resource.h> |
33 | #include <qtoolbar.h> | 33 | using namespace Opie::Core; |
34 | 34 | ||
35 | /* QTE includes */ | 35 | /* QT */ |
36 | #include <qmenubar.h> | 36 | #include <qmenubar.h> |
37 | #include <qtoolbar.h> | ||
37 | #include <qpopupmenu.h> | 38 | #include <qpopupmenu.h> |
38 | #include <qapplication.h> | 39 | #include <qapplication.h> |
39 | #include <qwidgetstack.h> | 40 | #include <qwidgetstack.h> |
40 | #include <qlayout.h> | 41 | #include <qlayout.h> |
41 | #include <qbuffer.h> | 42 | #include <qbuffer.h> |
43 | |||
42 | /*! | 44 | /*! |
43 | \class TableViewerWindow | 45 | \class TableViewerWindow |
44 | \brief The main window widget of the application | 46 | \brief The main window widget of the application |
45 | 47 | ||
46 | This is the main widget of the table viewer application. | 48 | This is the main widget of the table viewer application. |
47 | It is the co-ordination point. | 49 | It is the co-ordination point. |
48 | */ | 50 | */ |
49 | 51 | ||
@@ -196,17 +198,17 @@ void TableViewerWindow::saveDocument() | |||
196 | { | 198 | { |
197 | if(!dirty) | 199 | if(!dirty) |
198 | return; | 200 | return; |
199 | 201 | ||
200 | FileManager fm; | 202 | FileManager fm; |
201 | QIODevice *dev = fm.saveFile(doc); | 203 | QIODevice *dev = fm.saveFile(doc); |
202 | 204 | ||
203 | if(!ds->saveSource(dev, doc.type())){ | 205 | if(!ds->saveSource(dev, doc.type())){ |
204 | qWarning("Save unsuccessful"); | 206 | owarn << "Save unsuccessful" << oendl; |
205 | return; | 207 | return; |
206 | } | 208 | } |
207 | dev->close(); | 209 | dev->close(); |
208 | dirty = FALSE; | 210 | dirty = FALSE; |
209 | } | 211 | } |
210 | 212 | ||
211 | void TableViewerWindow::newDocument() | 213 | void TableViewerWindow::newDocument() |
212 | { | 214 | { |
@@ -283,17 +285,17 @@ void TableViewerWindow::openDocument(const DocLnk &f) | |||
283 | 285 | ||
284 | QString scratch = "Table Viewer";/* later take from constant */ | 286 | QString scratch = "Table Viewer";/* later take from constant */ |
285 | scratch += " - "; | 287 | scratch += " - "; |
286 | scratch += ds->getName(); | 288 | scratch += ds->getName(); |
287 | setCaption(tr(scratch)); | 289 | setCaption(tr(scratch)); |
288 | 290 | ||
289 | dirty = FALSE; | 291 | dirty = FALSE; |
290 | } else { | 292 | } else { |
291 | qWarning(tr("could not load Document")); | 293 | owarn << tr("could not load Document") << oendl; |
292 | } | 294 | } |
293 | dev->close(); | 295 | dev->close(); |
294 | } | 296 | } |
295 | 297 | ||
296 | /*! | 298 | /*! |
297 | Moves to the first item of the current table | 299 | Moves to the first item of the current table |
298 | */ | 300 | */ |
299 | void TableViewerWindow::firstItem() | 301 | void TableViewerWindow::firstItem() |
diff --git a/noncore/apps/tableviewer/tableviewer.pro b/noncore/apps/tableviewer/tableviewer.pro index 1de23bb..564f50f 100644 --- a/noncore/apps/tableviewer/tableviewer.pro +++ b/noncore/apps/tableviewer/tableviewer.pro | |||
diff --git a/noncore/apps/tableviewer/ui/tvlistview.cpp b/noncore/apps/tableviewer/ui/tvlistview.cpp index b10ff1d..c3e6432 100644 --- a/noncore/apps/tableviewer/ui/tvlistview.cpp +++ b/noncore/apps/tableviewer/ui/tvlistview.cpp | |||
@@ -12,18 +12,25 @@ | |||
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | |||
20 | #include "tvlistview.h" | 21 | #include "tvlistview.h" |
21 | #include "../db/common.h" | 22 | #include "../db/common.h" |
23 | |||
24 | /* OPIE */ | ||
25 | #include <opie2/odebug.h> | ||
26 | using namespace Opie::Core; | ||
27 | |||
28 | /* QT */ | ||
22 | #include <qtoolbutton.h> | 29 | #include <qtoolbutton.h> |
23 | #include <qlistview.h> | 30 | #include <qlistview.h> |
24 | #include <qlayout.h> | 31 | #include <qlayout.h> |
25 | 32 | ||
26 | void TVListViewPrivate::setColumnWidth(int column, int width) | 33 | void TVListViewPrivate::setColumnWidth(int column, int width) |
27 | { | 34 | { |
28 | if(width > 70) width = 70; | 35 | if(width > 70) width = 70; |
29 | QListView::setColumnWidth(column, width); | 36 | QListView::setColumnWidth(column, width); |
@@ -158,17 +165,17 @@ void TVListView::clearItems() | |||
158 | void TVListView::first() | 165 | void TVListView::first() |
159 | { | 166 | { |
160 | delete it; | 167 | delete it; |
161 | it = new QListViewItemIterator(listViewDisplay); | 168 | it = new QListViewItemIterator(listViewDisplay); |
162 | } | 169 | } |
163 | 170 | ||
164 | void TVListView::last() | 171 | void TVListView::last() |
165 | { | 172 | { |
166 | qWarning("TVListView::last not yet implemented"); | 173 | owarn << "TVListView::last not yet implemented" << oendl; |
167 | } | 174 | } |
168 | 175 | ||
169 | void TVListView::next() | 176 | void TVListView::next() |
170 | { | 177 | { |
171 | QListViewItemIterator tmp = *it; | 178 | QListViewItemIterator tmp = *it; |
172 | (*it)++; | 179 | (*it)++; |
173 | if (!it->current()) { | 180 | if (!it->current()) { |
174 | *it = tmp; | 181 | *it = tmp; |
diff --git a/noncore/apps/tinykate/libkate/libkate.pro b/noncore/apps/tinykate/libkate/libkate.pro index 11ee275..1552dff 100644 --- a/noncore/apps/tinykate/libkate/libkate.pro +++ b/noncore/apps/tinykate/libkate/libkate.pro | |||
@@ -21,17 +21,16 @@ HEADERS = microkde/kapplication.h \ | |||
21 | microkde/kfontdialog.h \ | 21 | microkde/kfontdialog.h \ |
22 | microkde/krun.h \ | 22 | microkde/krun.h \ |
23 | microkde/knumvalidator.h \ | 23 | microkde/knumvalidator.h \ |
24 | microkde/kstaticdeleter.h \ | 24 | microkde/kstaticdeleter.h \ |
25 | microkde/klistview.h \ | 25 | microkde/klistview.h \ |
26 | microkde/kglobalsettings.h \ | 26 | microkde/kglobalsettings.h \ |
27 | microkde/kcolorbtn.h \ | 27 | microkde/kcolorbtn.h \ |
28 | \ | 28 | \ |
29 | \ | ||
30 | qt3back/qregexp3.h \ | 29 | qt3back/qregexp3.h \ |
31 | microkde/ksharedptr.h \ | 30 | microkde/ksharedptr.h \ |
32 | document/katebuffer.h document/katedialogs.h \ | 31 | document/katebuffer.h document/katedialogs.h \ |
33 | document/katetextline.h \ | 32 | document/katetextline.h \ |
34 | document/katecmd.h \ | 33 | document/katecmd.h \ |
35 | document/katehighlight.h \ | 34 | document/katehighlight.h \ |
36 | document/katecmds.h document/katedocument.h \ | 35 | document/katecmds.h document/katedocument.h \ |
37 | document/katesyntaxdocument.h \ | 36 | document/katesyntaxdocument.h \ |
@@ -53,29 +52,27 @@ SOURCES = microkde/kapplication.cpp \ | |||
53 | microkde/kurlrequester.cpp \ | 52 | microkde/kurlrequester.cpp \ |
54 | microkde/kfontdialog.cpp \ | 53 | microkde/kfontdialog.cpp \ |
55 | microkde/krun.cpp \ | 54 | microkde/krun.cpp \ |
56 | microkde/knumvalidator.cpp \ | 55 | microkde/knumvalidator.cpp \ |
57 | microkde/kglobal.cpp \ | 56 | microkde/kglobal.cpp \ |
58 | microkde/kglobalsettings.cpp \ | 57 | microkde/kglobalsettings.cpp \ |
59 | microkde/kcolorbtn.cpp \ | 58 | microkde/kcolorbtn.cpp \ |
60 | \ | 59 | \ |
61 | \ | ||
62 | qt3back/qregexp3.cpp \ | 60 | qt3back/qregexp3.cpp \ |
63 | ktexteditor/ktexteditor.cpp \ | 61 | ktexteditor/ktexteditor.cpp \ |
64 | document/katebuffer.cpp document/katedialogs.cpp \ | 62 | document/katebuffer.cpp document/katedialogs.cpp \ |
65 | document/katehighlight.cpp \ | 63 | document/katehighlight.cpp \ |
66 | document/katecmd.cpp \ | 64 | document/katecmd.cpp \ |
67 | document/katesyntaxdocument.cpp document/katecmds.cpp \ | 65 | document/katesyntaxdocument.cpp document/katecmds.cpp \ |
68 | document/katedocument.cpp document/katetextline.cpp \ | 66 | document/katedocument.cpp document/katetextline.cpp \ |
69 | view/kateundohistory.cpp \ | 67 | view/kateundohistory.cpp \ |
70 | view/kateview.cpp \ | 68 | view/kateview.cpp \ |
71 | view/kateviewdialog.cpp \ | 69 | view/kateviewdialog.cpp \ |
72 | interfaces/interfaces.cpp | 70 | interfaces/interfaces.cpp |
73 | |||
74 | INTERFACES = | 71 | INTERFACES = |
75 | INCLUDEPATH += $(OPIEDIR)/include \ | 72 | INCLUDEPATH += $(OPIEDIR)/include \ |
76 | $(OPIEDIR)/noncore/apps/tinykate/libkate \ | 73 | $(OPIEDIR)/noncore/apps/tinykate/libkate \ |
77 | $(OPIEDIR)/noncore/apps/tinykate/libkate/microkde \ | 74 | $(OPIEDIR)/noncore/apps/tinykate/libkate/microkde \ |
78 | $(OPIEDIR)/noncore/apps/tinykate/libkate/document \ | 75 | $(OPIEDIR)/noncore/apps/tinykate/libkate/document \ |
79 | $(OPIEDIR)/noncore/apps/tinykate/libkate/view \ | 76 | $(OPIEDIR)/noncore/apps/tinykate/libkate/view \ |
80 | $(OPIEDIR)/noncore/apps/tinykate/libkate/interfaces \ | 77 | $(OPIEDIR)/noncore/apps/tinykate/libkate/interfaces \ |
81 | $(OPIEDIR)/noncore/apps/tinykate/libkate/ktexteditor \ | 78 | $(OPIEDIR)/noncore/apps/tinykate/libkate/ktexteditor \ |
diff --git a/noncore/apps/tinykate/tinykate.pro b/noncore/apps/tinykate/tinykate.pro index 6f4baa8..d34e519 100644 --- a/noncore/apps/tinykate/tinykate.pro +++ b/noncore/apps/tinykate/tinykate.pro | |||
@@ -1,22 +1,20 @@ | |||
1 | TEMPLATE = app | 1 | TEMPLATE = app |
2 | CONFIG = qt warn_on quick-app | 2 | CONFIG = qt warn_on quick-app |
3 | DESTDIR = $(OPIEDIR)/bin | 3 | DESTDIR = $(OPIEDIR)/bin |
4 | HEADERS = tinykate.h | 4 | HEADERS = tinykate.h |
5 | SOURCES = tinykate.cpp main.cpp | 5 | SOURCES = tinykate.cpp main.cpp |
6 | INTERFACES = | ||
7 | INCLUDEPATH += $(OPIEDIR)/include \ | 6 | INCLUDEPATH += $(OPIEDIR)/include \ |
8 | $(OPIEDIR)/noncore/apps/tinykate/libkate \ | 7 | $(OPIEDIR)/noncore/apps/tinykate/libkate \ |
9 | $(OPIEDIR)/noncore/apps/tinykate/libkate/microkde \ | 8 | $(OPIEDIR)/noncore/apps/tinykate/libkate/microkde \ |
10 | $(OPIEDIR)/noncore/apps/tinykate/libkate/document \ | 9 | $(OPIEDIR)/noncore/apps/tinykate/libkate/document \ |
11 | $(OPIEDIR)/noncore/apps/tinykate/libkate/view \ | 10 | $(OPIEDIR)/noncore/apps/tinykate/libkate/view \ |
12 | $(OPIEDIR)/noncore/apps/tinykate/libkate/interfaces \ | 11 | $(OPIEDIR)/noncore/apps/tinykate/libkate/interfaces \ |
13 | $(OPIEDIR)/noncore/apps/tinykate/libkate/ktexteditor \ | 12 | $(OPIEDIR)/noncore/apps/tinykate/libkate/ktexteditor \ |
14 | $(OPIEDIR)/noncore/apps/tinykate/libkate/qt3back | 13 | $(OPIEDIR)/noncore/apps/tinykate/libkate/qt3back |
15 | |||
16 | DEPENDPATH += $(OPIEDIR)/include | 14 | DEPENDPATH += $(OPIEDIR)/include |
17 | LIBS += -lqpe -ltinykate -lopiecore2 -lopieui2 | 15 | LIBS += -lqpe -ltinykate -lopiecore2 -lopieui2 |
18 | TARGET = kate | 16 | TARGET = kate |
19 | 17 | ||
20 | 18 | ||
21 | 19 | ||
22 | include ( $(OPIEDIR)/include.pro ) | 20 | include ( $(OPIEDIR)/include.pro ) |
diff --git a/noncore/apps/zsafe/config.in b/noncore/apps/zsafe/config.in index 6e321f3..b6d3ffe 100644 --- a/noncore/apps/zsafe/config.in +++ b/noncore/apps/zsafe/config.in | |||
@@ -1,5 +1,5 @@ | |||
1 | config ZSAFE | 1 | config ZSAFE |
2 | boolean "zsafe (Zaurus Password Manager)" | 2 | boolean "zsafe (Zaurus Password Manager)" |
3 | default "y" | 3 | default "y" |
4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2UI | 4 | depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2CORE && LIBOPIE2UI |
5 | 5 | ||
diff --git a/noncore/apps/zsafe/scqtfiledlg.cpp b/noncore/apps/zsafe/scqtfiledlg.cpp index 52b8d0d..c67bbd5 100644 --- a/noncore/apps/zsafe/scqtfiledlg.cpp +++ b/noncore/apps/zsafe/scqtfiledlg.cpp | |||
@@ -1,18 +1,15 @@ | |||
1 | /**************************************************************************** | ||
2 | ** Form implementation generated from reading ui file 'scqtfiledlg.ui' | ||
3 | ** | ||
4 | ** Created: Sun Jun 8 15:51:12 2003 | ||
5 | ** by: The User Interface Compiler (uic) | ||
6 | ** | ||
7 | ** WARNING! All changes made in this file will be lost! | ||
8 | ****************************************************************************/ | ||
9 | #include "scqtfiledlg.h" | 1 | #include "scqtfiledlg.h" |
10 | 2 | ||
3 | /* OPIE */ | ||
4 | #include <opie2/odebug.h> | ||
5 | using namespace Opie::Core; | ||
6 | |||
7 | /* QT */ | ||
11 | #include <qcombobox.h> | 8 | #include <qcombobox.h> |
12 | #include <qlineedit.h> | 9 | #include <qlineedit.h> |
13 | #include <qlistview.h> | 10 | #include <qlistview.h> |
14 | #include <qtoolbutton.h> | 11 | #include <qtoolbutton.h> |
15 | #include <qlayout.h> | 12 | #include <qlayout.h> |
16 | #include <qtooltip.h> | 13 | #include <qtooltip.h> |
17 | #include <qwhatsthis.h> | 14 | #include <qwhatsthis.h> |
18 | 15 | ||
@@ -211,46 +208,46 @@ ScQtFileDlg::ScQtFileDlg( QWidget* parent, const char* name, bool modal, WFlags | |||
211 | */ | 208 | */ |
212 | ScQtFileDlg::~ScQtFileDlg() | 209 | ScQtFileDlg::~ScQtFileDlg() |
213 | { | 210 | { |
214 | // no need to delete child widgets, Qt does it all for us | 211 | // no need to delete child widgets, Qt does it all for us |
215 | } | 212 | } |
216 | 213 | ||
217 | void ScQtFileDlg::slotCancel() | 214 | void ScQtFileDlg::slotCancel() |
218 | { | 215 | { |
219 | qWarning( "ScQtFileDlg::slotCancel(): Not implemented yet!" ); | 216 | owarn << "ScQtFileDlg::slotCancel(): Not implemented yet!" << oendl; |
220 | } | 217 | } |
221 | 218 | ||
222 | void ScQtFileDlg::slotDirComboBoxChanged( int ) | 219 | void ScQtFileDlg::slotDirComboBoxChanged( int ) |
223 | { | 220 | { |
224 | qWarning( "ScQtFileDlg::slotDirComboBoxChanged( int ): Not implemented yet!" ); | 221 | owarn << "ScQtFileDlg::slotDirComboBoxChanged( int ): Not implemented yet!" << oendl; |
225 | } | 222 | } |
226 | 223 | ||
227 | void ScQtFileDlg::slotDoubleClicked(QListViewItem *) | 224 | void ScQtFileDlg::slotDoubleClicked(QListViewItem *) |
228 | { | 225 | { |
229 | qWarning( "ScQtFileDlg::slotDoubleClicked(QListViewItem *): Not implemented yet!" ); | 226 | owarn << "ScQtFileDlg::slotDoubleClicked(QListViewItem *): Not implemented yet!" << oendl; |
230 | } | 227 | } |
231 | 228 | ||
232 | void ScQtFileDlg::slotFileTextChanged( const QString & ) | 229 | void ScQtFileDlg::slotFileTextChanged( const QString & ) |
233 | { | 230 | { |
234 | qWarning( "ScQtFileDlg::slotFileTextChanged( const QString & ): Not implemented yet!" ); | 231 | owarn << "ScQtFileDlg::slotFileTextChanged( const QString & ): Not implemented yet!" << oendl; |
235 | } | 232 | } |
236 | 233 | ||
237 | void ScQtFileDlg::slotMkDir() | 234 | void ScQtFileDlg::slotMkDir() |
238 | { | 235 | { |
239 | qWarning( "ScQtFileDlg::slotMkDir(): Not implemented yet!" ); | 236 | owarn << "ScQtFileDlg::slotMkDir(): Not implemented yet!" << oendl; |
240 | } | 237 | } |
241 | 238 | ||
242 | void ScQtFileDlg::slotOK() | 239 | void ScQtFileDlg::slotOK() |
243 | { | 240 | { |
244 | qWarning( "ScQtFileDlg::slotOK(): Not implemented yet!" ); | 241 | owarn << "ScQtFileDlg::slotOK(): Not implemented yet!" << oendl; |
245 | } | 242 | } |
246 | 243 | ||
247 | void ScQtFileDlg::slotSelectionChanged(QListViewItem *) | 244 | void ScQtFileDlg::slotSelectionChanged(QListViewItem *) |
248 | { | 245 | { |
249 | qWarning( "ScQtFileDlg::slotSelectionChanged(QListViewItem *): Not implemented yet!" ); | 246 | owarn << "ScQtFileDlg::slotSelectionChanged(QListViewItem *): Not implemented yet!" << oendl; |
250 | } | 247 | } |
251 | 248 | ||
252 | void ScQtFileDlg::slotTypeComboBoxChanged( int ) | 249 | void ScQtFileDlg::slotTypeComboBoxChanged( int ) |
253 | { | 250 | { |
254 | qWarning( "ScQtFileDlg::slotTypeComboBoxChanged( int ): Not implemented yet!" ); | 251 | owarn << "ScQtFileDlg::slotTypeComboBoxChanged( int ): Not implemented yet!" << oendl; |
255 | } | 252 | } |
256 | 253 | ||
diff --git a/noncore/apps/zsafe/zsafe.cpp b/noncore/apps/zsafe/zsafe.cpp index 3df55eb..bf8f7f4 100644 --- a/noncore/apps/zsafe/zsafe.cpp +++ b/noncore/apps/zsafe/zsafe.cpp | |||
@@ -24,27 +24,26 @@ | |||
24 | #include "passworddialog.h" | 24 | #include "passworddialog.h" |
25 | #include "infoform.h" | 25 | #include "infoform.h" |
26 | #include "zlistview.h" | 26 | #include "zlistview.h" |
27 | #include "shadedlistitem.h" | 27 | #include "shadedlistitem.h" |
28 | 28 | ||
29 | #ifndef DESKTOP | 29 | #ifndef DESKTOP |
30 | #ifndef NO_OPIE | 30 | #ifndef NO_OPIE |
31 | #include <opie2/ofiledialog.h> | 31 | #include <opie2/ofiledialog.h> |
32 | 32 | #include <opie2/odebug.h> | |
33 | using namespace Opie::Core; | ||
33 | using namespace Opie::Ui; | 34 | using namespace Opie::Ui; |
34 | #else | 35 | #else |
35 | #include "scqtfileedit.h" | 36 | #include "scqtfileedit.h" |
36 | #endif | 37 | #endif |
37 | #endif | 38 | #endif |
38 | 39 | ||
39 | #include <qclipboard.h> | 40 | #include <qclipboard.h> |
40 | 41 | ||
41 | #include <stdio.h> | ||
42 | |||
43 | #include <sys/types.h> | 42 | #include <sys/types.h> |
44 | #include <sys/stat.h> | 43 | #include <sys/stat.h> |
45 | #include <fcntl.h> | 44 | #include <fcntl.h> |
46 | #include <stdlib.h> | 45 | #include <stdlib.h> |
47 | #ifndef WIN32 | 46 | #ifndef WIN32 |
48 | #include <unistd.h> | 47 | #include <unistd.h> |
49 | #endif | 48 | #endif |
50 | #include <string.h> | 49 | #include <string.h> |
@@ -2064,17 +2063,16 @@ int ZSafe::loadInit(const char* _filename, const char *password) | |||
2064 | key[j] = password[j]; | 2063 | key[j] = password[j]; |
2065 | } | 2064 | } |
2066 | keylength = j; | 2065 | keylength = j; |
2067 | krc2->rc2_expandkey (key, keylength, 128); | 2066 | krc2->rc2_expandkey (key, keylength, 128); |
2068 | 2067 | ||
2069 | #ifndef WIN32 | 2068 | #ifndef WIN32 |
2070 | size = read(fileno (fd), (unsigned char *) (charbuf + count), 8); | 2069 | size = read(fileno (fd), (unsigned char *) (charbuf + count), 8); |
2071 | #else | 2070 | #else |
2072 | printf ("LoadInit() read1"); | ||
2073 | size = fread ((unsigned char *) (charbuf + count), sizeof(unsigned char), 8, fd); | 2071 | size = fread ((unsigned char *) (charbuf + count), sizeof(unsigned char), 8, fd); |
2074 | #endif | 2072 | #endif |
2075 | 2073 | ||
2076 | if (size < 8) | 2074 | if (size < 8) |
2077 | return PWERR_DATA; | 2075 | return PWERR_DATA; |
2078 | 2076 | ||
2079 | for (count = 0; count < 4; count++) { | 2077 | for (count = 0; count < 4; count++) { |
2080 | count2 = count << 1; | 2078 | count2 = count << 1; |
@@ -2084,17 +2082,16 @@ int ZSafe::loadInit(const char* _filename, const char *password) | |||
2084 | 2082 | ||
2085 | size = 0; | 2083 | size = 0; |
2086 | bufferIndex = 0; | 2084 | bufferIndex = 0; |
2087 | #ifndef WIN32 | 2085 | #ifndef WIN32 |
2088 | while ((count = read (fileno (fd), (unsigned char *) charbuf, 8)) > 0) { | 2086 | while ((count = read (fileno (fd), (unsigned char *) charbuf, 8)) > 0) { |
2089 | while (count < 8) { | 2087 | while (count < 8) { |
2090 | count2 = read (fileno (fd), (unsigned char *) (charbuf + count), 8); | 2088 | count2 = read (fileno (fd), (unsigned char *) (charbuf + count), 8); |
2091 | #else | 2089 | #else |
2092 | printf ("LoadInit() read2"); | ||
2093 | while ((count = fread ((unsigned char *) (charbuf), sizeof(unsigned char), 8, fd)) > 0) { | 2090 | while ((count = fread ((unsigned char *) (charbuf), sizeof(unsigned char), 8, fd)) > 0) { |
2094 | while (count < 8) { | 2091 | while (count < 8) { |
2095 | count2 = fread ((unsigned char *) (charbuf + count), sizeof(unsigned char), 8, fd); | 2092 | count2 = fread ((unsigned char *) (charbuf + count), sizeof(unsigned char), 8, fd); |
2096 | #endif | 2093 | #endif |
2097 | if (count2 == 0) { | 2094 | if (count2 == 0) { |
2098 | return PWERR_DATA; | 2095 | return PWERR_DATA; |
2099 | } | 2096 | } |
2100 | count += count2; | 2097 | count += count2; |
@@ -2254,17 +2251,17 @@ bool ZSafe::saveDocument(const char* _filename, | |||
2254 | entry[i] = (char*)malloc(strlen("field5")+1); | 2251 | entry[i] = (char*)malloc(strlen("field5")+1); |
2255 | strcpy(entry[i++], "field5"); | 2252 | strcpy(entry[i++], "field5"); |
2256 | entry[i] = (char*)malloc(strlen("field6")+1); | 2253 | entry[i] = (char*)malloc(strlen("field6")+1); |
2257 | strcpy(entry[i++], "field6"); | 2254 | strcpy(entry[i++], "field6"); |
2258 | 2255 | ||
2259 | retval = saveEntry(entry); | 2256 | retval = saveEntry(entry); |
2260 | for (int z=0; z<i; z++) free(entry[z]); | 2257 | for (int z=0; z<i; z++) free(entry[z]); |
2261 | if (retval == PWERR_DATA) { | 2258 | if (retval == PWERR_DATA) { |
2262 | qWarning("1: Error writing file, contents not saved"); | 2259 | owarn << "1: Error writing file, contents not saved" << oendl; |
2263 | saveFinalize(); | 2260 | saveFinalize(); |
2264 | return false; | 2261 | return false; |
2265 | } | 2262 | } |
2266 | // #ifndef WIN32 | 2263 | // #ifndef WIN32 |
2267 | conf->writeEntry(APP_KEY+"valzsafe", 1); | 2264 | conf->writeEntry(APP_KEY+"valzsafe", 1); |
2268 | // #endif | 2265 | // #endif |
2269 | saveConf(); | 2266 | saveConf(); |
2270 | } | 2267 | } |
@@ -2298,26 +2295,26 @@ bool ZSafe::saveDocument(const char* _filename, | |||
2298 | strcpy(entry[j++], si->text(5).utf8()); | 2295 | strcpy(entry[j++], si->text(5).utf8()); |
2299 | 2296 | ||
2300 | retval = saveEntry(entry); | 2297 | retval = saveEntry(entry); |
2301 | for (int z=0; z<j; z++) | 2298 | for (int z=0; z<j; z++) |
2302 | { | 2299 | { |
2303 | free(entry[z]); | 2300 | free(entry[z]); |
2304 | } | 2301 | } |
2305 | if (retval == PWERR_DATA) { | 2302 | if (retval == PWERR_DATA) { |
2306 | qWarning("1: Error writing file, contents not saved"); | 2303 | owarn << "1: Error writing file, contents not saved" << oendl; |
2307 | saveFinalize(); | 2304 | saveFinalize(); |
2308 | return false; | 2305 | return false; |
2309 | } | 2306 | } |
2310 | 2307 | ||
2311 | } | 2308 | } |
2312 | } | 2309 | } |
2313 | 2310 | ||
2314 | if (saveFinalize() == PWERR_DATA) { | 2311 | if (saveFinalize() == PWERR_DATA) { |
2315 | qWarning("2: Error writing file, contents not saved"); | 2312 | owarn << "2: Error writing file, contents not saved" << oendl; |
2316 | return false; | 2313 | return false; |
2317 | } else { | 2314 | } else { |
2318 | #ifndef DESKTOP | 2315 | #ifndef DESKTOP |
2319 | Global::statusMessage (tr("Password file saved.")); | 2316 | Global::statusMessage (tr("Password file saved.")); |
2320 | #endif | 2317 | #endif |
2321 | modified = false; | 2318 | modified = false; |
2322 | return true; | 2319 | return true; |
2323 | } | 2320 | } |
@@ -3185,17 +3182,17 @@ void ZSafe::editCategory() | |||
3185 | saveConf(); | 3182 | saveConf(); |
3186 | } | 3183 | } |
3187 | 3184 | ||
3188 | category = dialog->CategoryField->currentText(); | 3185 | category = dialog->CategoryField->currentText(); |
3189 | icon = dialog->IconField->currentText()+".png"; | 3186 | icon = dialog->IconField->currentText()+".png"; |
3190 | 3187 | ||
3191 | if (cat) | 3188 | if (cat) |
3192 | { | 3189 | { |
3193 | qWarning("Category found"); | 3190 | owarn << "Category found" << oendl; |
3194 | 3191 | ||
3195 | // if (!icon.isEmpty() && !icon.isNull()) | 3192 | // if (!icon.isEmpty() && !icon.isNull()) |
3196 | if (icon != "predefined.png") | 3193 | if (icon != "predefined.png") |
3197 | { | 3194 | { |
3198 | // build the full path | 3195 | // build the full path |
3199 | fullIconPath = iconPath + icon; | 3196 | fullIconPath = iconPath + icon; |
3200 | pix = new QPixmap (fullIconPath); | 3197 | pix = new QPixmap (fullIconPath); |
3201 | if (pix) | 3198 | if (pix) |
diff --git a/noncore/apps/zsafe/zsafe.pro b/noncore/apps/zsafe/zsafe.pro index 72c8fe9..3cae706 100644 --- a/noncore/apps/zsafe/zsafe.pro +++ b/noncore/apps/zsafe/zsafe.pro | |||
@@ -5,13 +5,13 @@ HEADERS = zsafe.h krc2.h category.h categorylist.h zlistview.h \ | |||
5 | scqtfiledlg.h | 5 | scqtfiledlg.h |
6 | SOURCES = main.cpp zsafe.cpp krc2.cpp category.cpp \ | 6 | SOURCES = main.cpp zsafe.cpp krc2.cpp category.cpp \ |
7 | categorylist.cpp zlistview.cpp shadedlistitem.cpp\ | 7 | categorylist.cpp zlistview.cpp shadedlistitem.cpp\ |
8 | scqtfileedit.cpp scqtfileedit.moc.cpp \ | 8 | scqtfileedit.cpp scqtfileedit.moc.cpp \ |
9 | scqtfiledlg.cpp | 9 | scqtfiledlg.cpp |
10 | INTERFACES = newdialog.ui searchdialog.ui passworddialog.ui categorydialog.ui infoform.ui wait.ui | 10 | INTERFACES = newdialog.ui searchdialog.ui passworddialog.ui categorydialog.ui infoform.ui wait.ui |
11 | INCLUDEPATH += $(OPIEDIR)/include | 11 | INCLUDEPATH += $(OPIEDIR)/include |
12 | DEPENDPATH += $(OPIEDIR)/include | 12 | DEPENDPATH += $(OPIEDIR)/include |
13 | LIBS += -Wl,-rpath,$(OPIEDIR)/lib -L$(OPIEDIR)/lib -lqpe -lopiecore2 -lopieui2 | 13 | LIBS += -lqpe -lopiecore2 -lopieui2 |
14 | TARGET = zsafe | 14 | TARGET = zsafe |
15 | 15 | ||
16 | include ( $(OPIEDIR)/include.pro ) | 16 | include ( $(OPIEDIR)/include.pro ) |
17 | 17 | ||