summaryrefslogtreecommitdiff
authorzecke <zecke>2004-03-14 16:13:28 (UTC)
committer zecke <zecke>2004-03-14 16:13:28 (UTC)
commitf3d284849df36ef281dcb5aa2d00f613e3a354d8 (patch) (unidiff)
tree65406b10a839ffa1ba683f59e61ef7227a0093d1
parentf12af18557c8f376f0c6c30e80a85737ff6c592e (diff)
downloadopie-f3d284849df36ef281dcb5aa2d00f613e3a354d8.zip
opie-f3d284849df36ef281dcb5aa2d00f613e3a354d8.tar.gz
opie-f3d284849df36ef281dcb5aa2d00f613e3a354d8.tar.bz2
Fix up depends on LIBOPIE1
Proper signature for signal and slots and namespaces
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/applets/notesapplet/config.in2
-rw-r--r--noncore/apps/advancedfm/advancedfmMenu.cpp8
-rw-r--r--noncore/apps/advancedfm/output.cpp4
-rw-r--r--noncore/apps/opie-console/io_bt.cpp3
-rw-r--r--noncore/apps/opie-console/io_irda.cpp3
-rw-r--r--noncore/apps/opie-console/sz_transfer.cpp4
-rw-r--r--noncore/net/mail/libmailwrapper/mhwrapper.cpp6
-rw-r--r--noncore/net/opietooth/lib/device.cc9
-rw-r--r--noncore/net/opietooth/lib/manager.cc18
-rw-r--r--noncore/net/opietooth/lib/startdunconnection.cpp5
-rw-r--r--noncore/net/opietooth/lib/startpanconnection.cpp8
-rw-r--r--noncore/net/opietooth/manager/pppdialog.cpp3
-rw-r--r--noncore/settings/networksettings/ppp/config.in2
-rw-r--r--noncore/settings/networksettings/wlan/config.in2
-rw-r--r--noncore/unsupported/mail2/bend/bend.cpp2
-rw-r--r--noncore/unsupported/mail2/composerbase.cpp2
-rw-r--r--noncore/unsupported/mail2/main.cpp1
-rw-r--r--noncore/unsupported/mail2/mainwindowbase.cpp2
-rw-r--r--noncore/unsupported/mail2/viewmailbase.cpp2
-rw-r--r--noncore/unsupported/mailit/main.cpp1
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp2
-rw-r--r--noncore/unsupported/qpdf/qpdf.cpp2
22 files changed, 43 insertions, 48 deletions
diff --git a/noncore/applets/notesapplet/config.in b/noncore/applets/notesapplet/config.in
index 866adfb..27a8187 100644
--- a/noncore/applets/notesapplet/config.in
+++ b/noncore/applets/notesapplet/config.in
@@ -1,4 +1,4 @@
1 config NOTESAPPLET 1 config NOTESAPPLET
2 boolean "opie-notesapplet (quick note taking applet)" 2 boolean "opie-notesapplet (quick note taking applet)"
3 default "y" 3 default "y"
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE 4 depends ( LIBQPE || LIBQPE-X11 )
diff --git a/noncore/apps/advancedfm/advancedfmMenu.cpp b/noncore/apps/advancedfm/advancedfmMenu.cpp
index a694b70..6d41ac3 100644
--- a/noncore/apps/advancedfm/advancedfmMenu.cpp
+++ b/noncore/apps/advancedfm/advancedfmMenu.cpp
@@ -1,228 +1,228 @@
1/*************************************************************************** 1/***************************************************************************
2 AdvancedFm.cpp 2 AdvancedFm.cpp
3 ------------------- 3 -------------------
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#include "advancedfm.h" 12#include "advancedfm.h"
13#include "output.h" 13#include "output.h"
14#include "filePermissions.h" 14#include "filePermissions.h"
15 15
16#include <qpe/lnkproperties.h> 16#include <qpe/lnkproperties.h>
17#include <qpe/qpeapplication.h> 17#include <qpe/qpeapplication.h>
18#include <qpe/applnk.h> 18#include <qpe/applnk.h>
19 19
20#include <qmessagebox.h> 20#include <qmessagebox.h>
21 21
22 22
23#include <qpopupmenu.h> 23#include <qpopupmenu.h>
24#include <qlistview.h> 24#include <qlistview.h>
25 25
26#include <errno.h> 26#include <errno.h>
27#include <stdlib.h> 27#include <stdlib.h>
28#include <unistd.h> 28#include <unistd.h>
29#include <sys/stat.h> 29#include <sys/stat.h>
30#include <dirent.h> 30#include <dirent.h>
31#include <sys/sendfile.h> 31#include <sys/sendfile.h>
32#include <fcntl.h> 32#include <fcntl.h>
33 33
34 34
35using namespace Opie::Core; 35using namespace Opie::Core;
36using namespace Opie::Core; 36using namespace Opie::Core;
37void AdvancedFm::doDirChange() { 37void AdvancedFm::doDirChange() {
38 QString pathItem = CurrentView()->currentItem()->text(0); 38 QString pathItem = CurrentView()->currentItem()->text(0);
39 if( pathItem == "../") { 39 if( pathItem == "../") {
40 ListClicked( CurrentView()->currentItem()); 40 ListClicked( CurrentView()->currentItem());
41 } else { 41 } else {
42 if( pathItem.find(" -> ",0,TRUE) != -1) 42 if( pathItem.find(" -> ",0,TRUE) != -1)
43 pathItem = dealWithSymName((const QString&)pathItem)+"/"; 43 pathItem = dealWithSymName((const QString&)pathItem)+"/";
44// qWarning(pathItem); 44// qWarning(pathItem);
45 gotoDirectory( CurrentDir()->path()+"/"+pathItem.left( pathItem.length() - 1) ); 45 gotoDirectory( CurrentDir()->path()+"/"+pathItem.left( pathItem.length() - 1) );
46 } 46 }
47} 47}
48 48
49void AdvancedFm::showMenuHidden() { 49void AdvancedFm::showMenuHidden() {
50 if (b) { 50 if (b) {
51 CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 51 CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
52 OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 52 OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
53 fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); 53 fileMenu->setItemChecked( fileMenu->idAt(0),TRUE);
54 } else { 54 } else {
55 CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); 55 CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
56 OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); 56 OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
57 fileMenu->setItemChecked( fileMenu->idAt(0),FALSE); 57 fileMenu->setItemChecked( fileMenu->idAt(0),FALSE);
58 } 58 }
59 b = !b; 59 b = !b;
60 populateView(); 60 populateView();
61} 61}
62 62
63void AdvancedFm::showHidden() { 63void AdvancedFm::showHidden() {
64 if (b) { 64 if (b) {
65 CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 65 CurrentDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
66 OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All); 66 OtherDir()->setFilter( QDir::Files | QDir::Dirs | QDir::Hidden | QDir::All);
67 } else { 67 } else {
68 CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); 68 CurrentDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
69 OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All); 69 OtherDir()->setFilter( QDir::Files | QDir::Dirs/* | QDir::Hidden*/ | QDir::All);
70 } 70 }
71 populateView(); 71 populateView();
72} 72}
73 73
74QString AdvancedFm::dealWithSymName(const QString &fileName) { 74QString AdvancedFm::dealWithSymName(const QString &fileName) {
75 QString strItem = fileName; 75 QString strItem = fileName;
76 return strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4); 76 return strItem.right( (strItem.length() - strItem.find("->",0,TRUE)) - 4);
77} 77}
78 78
79void AdvancedFm::runThis() { 79void AdvancedFm::runThis() {
80 if( !CurrentView()->currentItem()) return; 80 if( !CurrentView()->currentItem()) return;
81 QString fs; 81 QString fs;
82 QDir *thisDir = CurrentDir(); 82 QDir *thisDir = CurrentDir();
83 83
84 QString curFile = CurrentView()->currentItem()->text(0); 84 QString curFile = CurrentView()->currentItem()->text(0);
85 QString path = thisDir->canonicalPath(); 85 QString path = thisDir->canonicalPath();
86 86
87 if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink 87 if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink
88 88
89 curFile = dealWithSymName((const QString&)curFile); 89 curFile = dealWithSymName((const QString&)curFile);
90 90
91 if(curFile != "../") { 91 if(curFile != "../") {
92 92
93 fs = getFileSystemType((const QString &) path); 93 fs = getFileSystemType((const QString &) path);
94 QFileInfo fileInfo( path + "/" + curFile); 94 QFileInfo fileInfo( path + "/" + curFile);
95// qDebug( fileInfo.owner()); 95// qDebug( fileInfo.owner());
96 96
97 if( (fileInfo.permission( QFileInfo::ExeUser) 97 if( (fileInfo.permission( QFileInfo::ExeUser)
98 | fileInfo.permission( QFileInfo::ExeGroup) 98 | fileInfo.permission( QFileInfo::ExeGroup)
99 | fileInfo.permission( QFileInfo::ExeOther)) // & fs.find("vfat",0,TRUE) == -1) { 99 | fileInfo.permission( QFileInfo::ExeOther)) // & fs.find("vfat",0,TRUE) == -1) {
100 | fs == "vfat" && fileInfo.filePath().contains("/bin") ) { 100 | fs == "vfat" && fileInfo.filePath().contains("/bin") ) {
101 QCopEnvelope e("QPE/System", "execute(QString)" ); 101 QCopEnvelope e("QPE/System", "execute(QString)" );
102 e << curFile; 102 e << curFile;
103 } else { 103 } else {
104 curFile = path + "/" + curFile; 104 curFile = path + "/" + curFile;
105 DocLnk nf(curFile); 105 DocLnk nf(curFile);
106 QString execStr = nf.exec(); 106 QString execStr = nf.exec();
107// qDebug( execStr); 107// qDebug( execStr);
108 if( execStr.isEmpty() ) { 108 if( execStr.isEmpty() ) {
109 } else { 109 } else {
110 nf.execute(); 110 nf.execute();
111 } 111 }
112 } 112 }
113 } 113 }
114} 114}
115 115
116void AdvancedFm::runText() { 116void AdvancedFm::runText() {
117 if( !CurrentView()->currentItem()) return; 117 if( !CurrentView()->currentItem()) return;
118 QString curFile = CurrentView()->currentItem()->text(0); 118 QString curFile = CurrentView()->currentItem()->text(0);
119 if(curFile != "../") { 119 if(curFile != "../") {
120 if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink 120 if( curFile.find("@",0,TRUE) !=-1 || curFile.find("->",0,TRUE) !=-1 ) //if symlink
121 curFile = dealWithSymName((const QString&)curFile); 121 curFile = dealWithSymName((const QString&)curFile);
122 curFile = CurrentDir()->canonicalPath()+"/"+curFile; 122 curFile = CurrentDir()->canonicalPath()+"/"+curFile;
123 QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" ); 123 QCopEnvelope e("QPE/Application/textedit", "setDocument(QString)" );
124 e << curFile; 124 e << curFile;
125 } 125 }
126} 126}
127 127
128void AdvancedFm::makeDir() { 128void AdvancedFm::makeDir() {
129 InputDialog *fileDlg; 129 InputDialog *fileDlg;
130 fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0); 130 fileDlg = new InputDialog(this,tr("Make Directory"),TRUE, 0);
131 fileDlg->exec(); 131 fileDlg->exec();
132 if( fileDlg->result() == 1 ) { 132 if( fileDlg->result() == 1 ) {
133 QDir *thisDir = CurrentDir(); 133 QDir *thisDir = CurrentDir();
134 QString filename = fileDlg->LineEdit1->text(); 134 QString filename = fileDlg->LineEdit1->text();
135 thisDir->mkdir( thisDir->canonicalPath()+"/"+filename); 135 thisDir->mkdir( thisDir->canonicalPath()+"/"+filename);
136 } 136 }
137 populateView(); 137 populateView();
138} 138}
139 139
140void AdvancedFm::doDelete() { 140void AdvancedFm::doDelete() {
141 QStringList curFileList = getPath(); 141 QStringList curFileList = getPath();
142 bool doMsg=true; 142 bool doMsg=true;
143 int count = curFileList.count(); 143 int count = curFileList.count();
144 if( count > 0) { 144 if( count > 0) {
145 if(count > 1 ) { 145 if(count > 1 ) {
146 QString msg; 146 QString msg;
147 msg=tr("Really delete\n%1 files?").arg(count); 147 msg=tr("Really delete\n%1 files?").arg(count);
148 switch ( QMessageBox::warning(this,tr("Delete"),msg 148 switch ( QMessageBox::warning(this,tr("Delete"),msg
149 ,tr("Yes"),tr("No"),0,0,1) ) 149 ,tr("Yes"),tr("No"),0,0,1) )
150 { 150 {
151 case 0: 151 case 0:
152 doMsg=false; 152 doMsg=false;
153 break; 153 break;
154 case 1: 154 case 1:
155 return; 155 return;
156 break; 156 break;
157 }; 157 };
158 } 158 }
159 159
160 QString myFile; 160 QString myFile;
161 161
162 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 162 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
163 myFile = (*it); 163 myFile = (*it);
164 if( myFile.find(" -> ",0,TRUE) != -1) 164 if( myFile.find(" -> ",0,TRUE) != -1)
165 myFile = myFile.left( myFile.find(" -> ",0,TRUE)); 165 myFile = myFile.left( myFile.find(" -> ",0,TRUE));
166 166
167 QString f = CurrentDir()->canonicalPath(); 167 QString f = CurrentDir()->canonicalPath();
168 if(f.right(1).find("/",0,TRUE) == -1) 168 if(f.right(1).find("/",0,TRUE) == -1)
169 f += "/"; 169 f += "/";
170 f += myFile; 170 f += myFile;
171 if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) { 171 if(QDir(f).exists() && !QFileInfo(f).isSymLink() ) {
172 //if file is a directory 172 //if file is a directory
173 173
174 switch ( QMessageBox::warning( this, tr("Delete Directory?"), 174 switch ( QMessageBox::warning( this, tr("Delete Directory?"),
175 tr("Really delete %1\nand all it's contents ?" ).arg( f ) , 175 tr("Really delete %1\nand all it's contents ?" ).arg( f ) ,
176 tr("Yes"), tr("No"), 0, 0, 1) ) { 176 tr("Yes"), tr("No"), 0, 0, 1) ) {
177 case 0: 177 case 0:
178 { 178 {
179 f=f.left(f.length()-1); 179 f=f.left(f.length()-1);
180 QString cmd="rm -rf "+f; 180 QString cmd="rm -rf "+f;
181 startProcess( (const QString)cmd.latin1() ); 181 startProcess( (const QString)cmd.latin1() );
182 populateView(); 182 populateView();
183 } 183 }
184 break; 184 break;
185 case 1: 185 case 1:
186 // exit 186 // exit
187 break; 187 break;
188 }; 188 };
189 189
190 } else { 190 } else {
191 if(doMsg) { 191 if(doMsg) {
192 switch ( QMessageBox::warning(this,tr("Delete"), 192 switch ( QMessageBox::warning(this,tr("Delete"),
193 tr("Really delete\n%1?").arg( myFile ), 193 tr("Really delete\n%1?").arg( myFile ),
194 tr("Yes"), tr("No"), 0, 0, 1) ) { 194 tr("Yes"), tr("No"), 0, 0, 1) ) {
195 case 1: 195 case 1:
196 return; 196 return;
197 break; 197 break;
198 }; 198 };
199 } 199 }
200 200
201 QString cmd="rm "+f; 201 QString cmd="rm "+f;
202 QFile file(f); 202 QFile file(f);
203 QFileInfo fi(myFile); 203 QFileInfo fi(myFile);
204 if( fi.fileName().find("../",0,TRUE)==-1) { 204 if( fi.fileName().find("../",0,TRUE)==-1) {
205// qDebug("remove link files "+myFile); 205// qDebug("remove link files "+myFile);
206 206
207// DocLnk lnk(f); 207// DocLnk lnk(f);
208 DocLnk *lnk; 208 DocLnk *lnk;
209 lnk = new DocLnk(f); 209 lnk = new DocLnk(f);
210// qDebug("Deleting doclnk " + lnk->linkFile()); 210// qDebug("Deleting doclnk " + lnk->linkFile());
211 if(lnk->isValid()) 211 if(lnk->isValid())
212 lnk->removeLinkFile(); 212 lnk->removeLinkFile();
213 // delete lnk; 213 // delete lnk;
214 file.remove(); 214 file.remove();
215 } 215 }
216 } 216 }
217 } 217 }
218 } 218 }
219 populateView(); 219 populateView();
220} 220}
221 221
222void AdvancedFm::filePerms() { 222void AdvancedFm::filePerms() {
223 QStringList curFileList = getPath(); 223 QStringList curFileList = getPath();
224 QString filePath; 224 QString filePath;
225 225
226 filePath = CurrentDir()->canonicalPath()+"/"; 226 filePath = CurrentDir()->canonicalPath()+"/";
227 227
228 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 228 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
@@ -516,323 +516,323 @@ bool AdvancedFm::copyFile( const QString & src, const QString & dest ) {
516 516
517 517
518 bool success = true; 518 bool success = true;
519 struct stat status; 519 struct stat status;
520 QFile srcFile(src); 520 QFile srcFile(src);
521 QFile destFile(dest); 521 QFile destFile(dest);
522 int err=0; 522 int err=0;
523 int read_fd=0; 523 int read_fd=0;
524 int write_fd=0; 524 int write_fd=0;
525 struct stat stat_buf; 525 struct stat stat_buf;
526 off_t offset = 0; 526 off_t offset = 0;
527 if(!srcFile.open( IO_ReadOnly|IO_Raw)) { 527 if(!srcFile.open( IO_ReadOnly|IO_Raw)) {
528// qWarning("open failed"); 528// qWarning("open failed");
529 return success = false; 529 return success = false;
530 } 530 }
531 read_fd = srcFile.handle(); 531 read_fd = srcFile.handle();
532 if(read_fd != -1) { 532 if(read_fd != -1) {
533 fstat (read_fd, &stat_buf); 533 fstat (read_fd, &stat_buf);
534 if( !destFile.open( IO_WriteOnly|IO_Raw ) ) { 534 if( !destFile.open( IO_WriteOnly|IO_Raw ) ) {
535// qWarning("destfile open failed"); 535// qWarning("destfile open failed");
536 return success = false; 536 return success = false;
537 } 537 }
538 write_fd = destFile.handle(); 538 write_fd = destFile.handle();
539 if(write_fd != -1) { 539 if(write_fd != -1) {
540 err = sendfile(write_fd, read_fd, &offset, stat_buf.st_size); 540 err = sendfile(write_fd, read_fd, &offset, stat_buf.st_size);
541 if( err == -1) { 541 if( err == -1) {
542 QString msg; 542 QString msg;
543 switch(err) { 543 switch(err) {
544 case EBADF : msg = "The input file was not opened for reading or the output file was not opened for writing. "; 544 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. "; 545 case EINVAL: msg = "Descriptor is not valid or locked. ";
546 case ENOMEM: msg = "Insufficient memory to read from in_fd."; 546 case ENOMEM: msg = "Insufficient memory to read from in_fd.";
547 case EIO: msg = "Unspecified error while reading from in_fd."; 547 case EIO: msg = "Unspecified error while reading from in_fd.";
548 }; 548 };
549 success = false; 549 success = false;
550// qWarning(msg); 550// qWarning(msg);
551 } 551 }
552 } else { 552 } else {
553 success = false; 553 success = false;
554 } 554 }
555 } else { 555 } else {
556 success = false; 556 success = false;
557 } 557 }
558 srcFile.close(); 558 srcFile.close();
559 destFile.close(); 559 destFile.close();
560 // Set file permissions 560 // Set file permissions
561 if( stat( (const char *) src, &status ) == 0 ) { 561 if( stat( (const char *) src, &status ) == 0 ) {
562 chmod( (const char *) dest, status.st_mode ); 562 chmod( (const char *) dest, status.st_mode );
563 } 563 }
564 564
565 return success; 565 return success;
566} 566}
567 567
568void AdvancedFm::runCommand() { 568void AdvancedFm::runCommand() {
569 if( !CurrentView()->currentItem()) return; 569 if( !CurrentView()->currentItem()) return;
570 QDir *thisDir = CurrentDir(); 570 QDir *thisDir = CurrentDir();
571 571
572 QString curFile; 572 QString curFile;
573 curFile = thisDir->canonicalPath() +"/"+ CurrentView()->currentItem()->text(0); 573 curFile = thisDir->canonicalPath() +"/"+ CurrentView()->currentItem()->text(0);
574 574
575 InputDialog *fileDlg; 575 InputDialog *fileDlg;
576 fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); 576 fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0);
577 fileDlg->setInputText(curFile); 577 fileDlg->setInputText(curFile);
578 fileDlg->exec(); 578 fileDlg->exec();
579 //QString command; 579 //QString command;
580 580
581 if( fileDlg->result() == 1 ) { 581 if( fileDlg->result() == 1 ) {
582// qDebug(fileDlg->LineEdit1->text()); 582// qDebug(fileDlg->LineEdit1->text());
583 QStringList command; 583 QStringList command;
584 584
585 command << "/bin/sh"; 585 command << "/bin/sh";
586 command << "-c"; 586 command << "-c";
587 command << fileDlg->LineEdit1->text(); 587 command << fileDlg->LineEdit1->text();
588 Output *outDlg; 588 Output *outDlg;
589 outDlg = new Output( command, this, tr("AdvancedFm Output"), true); 589 outDlg = new Output( command, this, tr("AdvancedFm Output"), true);
590 QPEApplication::execDialog( outDlg ); 590 QPEApplication::execDialog( outDlg );
591 qApp->processEvents(); 591 qApp->processEvents();
592 592
593 } 593 }
594} 594}
595 595
596void AdvancedFm::runCommandStd() { 596void AdvancedFm::runCommandStd() {
597 if( !CurrentView()->currentItem()) return; 597 if( !CurrentView()->currentItem()) return;
598 QString curFile; 598 QString curFile;
599 QDir *thisDir = CurrentDir(); 599 QDir *thisDir = CurrentDir();
600 QListView *thisView = CurrentView(); 600 QListView *thisView = CurrentView();
601 if( thisView->currentItem()) 601 if( thisView->currentItem())
602 curFile = thisDir->canonicalPath() +"/"+ thisView->currentItem()->text(0); 602 curFile = thisDir->canonicalPath() +"/"+ thisView->currentItem()->text(0);
603 603
604 InputDialog *fileDlg; 604 InputDialog *fileDlg;
605 fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0); 605 fileDlg = new InputDialog(this,tr("Run Command"),TRUE, 0);
606 fileDlg->setInputText(curFile); 606 fileDlg->setInputText(curFile);
607 fileDlg->exec(); 607 fileDlg->exec();
608 608
609 if( fileDlg->result() == 1 ) { 609 if( fileDlg->result() == 1 ) {
610 qApp->processEvents(); 610 qApp->processEvents();
611 startProcess( (const QString)fileDlg->LineEdit1->text().latin1()); 611 startProcess( (const QString)fileDlg->LineEdit1->text().latin1());
612 } 612 }
613} 613}
614 614
615void AdvancedFm::fileStatus() { 615void AdvancedFm::fileStatus() {
616 if( !CurrentView()->currentItem()) return; 616 if( !CurrentView()->currentItem()) return;
617 QString curFile; 617 QString curFile;
618 curFile = CurrentView()->currentItem()->text(0); 618 curFile = CurrentView()->currentItem()->text(0);
619 619
620 QStringList command; 620 QStringList command;
621 command << "/bin/sh"; 621 command << "/bin/sh";
622 command << "-c"; 622 command << "-c";
623 command << "stat -l "+ curFile; 623 command << "stat -l "+ curFile;
624 624
625 Output *outDlg; 625 Output *outDlg;
626 outDlg = new Output( command, this, tr("AdvancedFm Output"), true); 626 outDlg = new Output( command, this, tr("AdvancedFm Output"), true);
627 QPEApplication::execDialog( outDlg ); 627 QPEApplication::execDialog( outDlg );
628 qApp->processEvents(); 628 qApp->processEvents();
629} 629}
630 630
631 631
632void AdvancedFm::mkDir() { 632void AdvancedFm::mkDir() {
633 makeDir(); 633 makeDir();
634} 634}
635 635
636void AdvancedFm::rn() { 636void AdvancedFm::rn() {
637 renameIt(); 637 renameIt();
638} 638}
639 639
640void AdvancedFm::del() { 640void AdvancedFm::del() {
641 doDelete(); 641 doDelete();
642} 642}
643 643
644void AdvancedFm::mkSym() { 644void AdvancedFm::mkSym() {
645 QString cmd; 645 QString cmd;
646 QStringList curFileList = getPath(); 646 QStringList curFileList = getPath();
647 if( curFileList.count() > 0) { 647 if( curFileList.count() > 0) {
648 QDir *thisDir = CurrentDir(); 648 QDir *thisDir = CurrentDir();
649 QDir * thatDir = OtherDir(); 649 QDir * thatDir = OtherDir();
650 650
651 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 651 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
652 652
653 QString destName = thatDir->canonicalPath()+"/"+(*it); 653 QString destName = thatDir->canonicalPath()+"/"+(*it);
654 if(destName.right(1) == "/") { 654 if(destName.right(1) == "/") {
655 destName = destName.left( destName.length() -1); 655 destName = destName.left( destName.length() -1);
656 } 656 }
657 657
658 QString curFile = thisDir->canonicalPath()+"/"+(*it); 658 QString curFile = thisDir->canonicalPath()+"/"+(*it);
659 659
660 if( curFile.right(1) == "/") { 660 if( curFile.right(1) == "/") {
661 curFile = curFile.left( curFile.length() -1); 661 curFile = curFile.left( curFile.length() -1);
662 } 662 }
663 663
664 cmd = "ln -s "+curFile+" "+destName; 664 cmd = "ln -s "+curFile+" "+destName;
665// qDebug(cmd); 665// qDebug(cmd);
666 startProcess( (const QString)cmd ); 666 startProcess( (const QString)cmd );
667 } 667 }
668 rePopulate(); 668 rePopulate();
669 setOtherTabCurrent(); 669 setOtherTabCurrent();
670 } 670 }
671} 671}
672 672
673void AdvancedFm::doBeam() { 673void AdvancedFm::doBeam() {
674 Ir ir; 674 Ir ir;
675 if(!ir.supported()) { 675 if(!ir.supported()) {
676 } else { 676 } else {
677 QStringList curFileList = getPath(); 677 QStringList curFileList = getPath();
678 if( curFileList.count() > 0) { 678 if( curFileList.count() > 0) {
679 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) { 679 for ( QStringList::Iterator it = curFileList.begin(); it != curFileList.end(); ++it ) {
680 QString curFile = (*it); 680 QString curFile = (*it);
681 QString curFilePath = CurrentDir()->canonicalPath()+"/"+curFile; 681 QString curFilePath = CurrentDir()->canonicalPath()+"/"+curFile;
682 if( curFilePath.right(1) == "/") { 682 if( curFilePath.right(1) == "/") {
683 curFilePath = curFilePath.left( curFilePath.length() -1); 683 curFilePath = curFilePath.left( curFilePath.length() -1);
684 } 684 }
685 Ir *file = new Ir(this, "IR"); 685 Ir *file = new Ir(this, "IR");
686 connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished(Ir*))); 686 connect(file, SIGNAL(done(Ir*)), this, SLOT( fileBeamFinished(Ir*)));
687 file->send( curFilePath, curFile ); 687 file->send( curFilePath, curFile );
688 } 688 }
689 } 689 }
690 } 690 }
691} 691}
692 692
693void AdvancedFm::fileBeamFinished( Ir *) { 693void AdvancedFm::fileBeamFinished( Ir *) {
694 QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") ); 694 QMessageBox::message( tr("Advancedfm Beam out"), tr("Ir sent.") ,tr("Ok") );
695} 695}
696 696
697void AdvancedFm::selectAll() { 697void AdvancedFm::selectAll() {
698 QListView *thisView = CurrentView(); 698 QListView *thisView = CurrentView();
699 thisView->selectAll(true); 699 thisView->selectAll(true);
700 thisView->setSelected( thisView->firstChild(),false); 700 thisView->setSelected( thisView->firstChild(),false);
701} 701}
702 702
703void AdvancedFm::startProcess(const QString & cmd) { 703void AdvancedFm::startProcess(const QString & cmd) {
704 QStringList command; 704 QStringList command;
705 OProcess *process; 705 OProcess *process;
706 process = new OProcess(); 706 process = new OProcess();
707 connect(process, SIGNAL(processExited(Opie::Core::OProcess*)), 707 connect(process, SIGNAL(processExited(Opie::Core::OProcess*)),
708 this, SLOT( processEnded(OProcess*))); 708 this, SLOT( processEnded(Opie::Core::OProcess*)));
709 709
710 connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)), 710 connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)),
711 this, SLOT( oprocessStderr(OProcess*,char*,int))); 711 this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int)));
712 712
713 command << "/bin/sh"; 713 command << "/bin/sh";
714 command << "-c"; 714 command << "-c";
715 command << cmd.latin1(); 715 command << cmd.latin1();
716 *process << command; 716 *process << command;
717 if(!process->start(OProcess::NotifyOnExit, OProcess::All) ) 717 if(!process->start(OProcess::NotifyOnExit, OProcess::All) )
718 qDebug("could not start process"); 718 qDebug("could not start process");
719} 719}
720 720
721void AdvancedFm::processEnded(OProcess *) { 721void AdvancedFm::processEnded(OProcess *) {
722 rePopulate(); 722 rePopulate();
723} 723}
724 724
725void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) { 725void AdvancedFm::oprocessStderr(OProcess*, char *buffer, int ) {
726// qWarning("received stderrt %d bytes", buflen); 726// qWarning("received stderrt %d bytes", buflen);
727 727
728 QString lineStr = buffer; 728 QString lineStr = buffer;
729 QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") ); 729 QMessageBox::warning( this, tr("Error"), lineStr ,tr("Ok") );
730} 730}
731 731
732bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) { 732bool AdvancedFm::eventFilter( QObject * o, QEvent * e ) {
733 if ( o->inherits( "QLineEdit" ) ) { 733 if ( o->inherits( "QLineEdit" ) ) {
734 if ( e->type() == QEvent::KeyPress ) { 734 if ( e->type() == QEvent::KeyPress ) {
735 QKeyEvent *ke = (QKeyEvent*)e; 735 QKeyEvent *ke = (QKeyEvent*)e;
736 if ( ke->key() == Key_Return || 736 if ( ke->key() == Key_Return ||
737 ke->key() == Key_Enter ) { 737 ke->key() == Key_Enter ) {
738 okRename(); 738 okRename();
739 return true; 739 return true;
740 } 740 }
741 else if ( ke->key() == Key_Escape ) { 741 else if ( ke->key() == Key_Escape ) {
742 cancelRename(); 742 cancelRename();
743 return true; 743 return true;
744 } 744 }
745 } 745 }
746 else if ( e->type() == QEvent::FocusOut ) { 746 else if ( e->type() == QEvent::FocusOut ) {
747 cancelRename(); 747 cancelRename();
748 return true; 748 return true;
749 } 749 }
750 } 750 }
751 if ( o->inherits( "QListView" ) ) { 751 if ( o->inherits( "QListView" ) ) {
752 if ( e->type() == QEvent::FocusIn ) { 752 if ( e->type() == QEvent::FocusIn ) {
753 if( o == Local_View) { //keep track of which view 753 if( o == Local_View) { //keep track of which view
754 whichTab=1; 754 whichTab=1;
755 } 755 }
756 else { 756 else {
757 whichTab=2; 757 whichTab=2;
758 } 758 }
759 } 759 }
760 OtherView()->setSelected( OtherView()->currentItem(), FALSE );//make sure there's correct selection 760 OtherView()->setSelected( OtherView()->currentItem(), FALSE );//make sure there's correct selection
761 } 761 }
762 762
763 return QWidget::eventFilter( o, e ); 763 return QWidget::eventFilter( o, e );
764} 764}
765 765
766 766
767void AdvancedFm::cancelRename() { 767void AdvancedFm::cancelRename() {
768// qDebug("cancel rename"); 768// qDebug("cancel rename");
769 QListView * view; 769 QListView * view;
770 view = CurrentView(); 770 view = CurrentView();
771 771
772 bool resetFocus = view->viewport()->focusProxy() == renameBox; 772 bool resetFocus = view->viewport()->focusProxy() == renameBox;
773 delete renameBox; 773 delete renameBox;
774 renameBox = 0; 774 renameBox = 0;
775 if ( resetFocus ) { 775 if ( resetFocus ) {
776 view->viewport()->setFocusProxy( view); 776 view->viewport()->setFocusProxy( view);
777 view->setFocus(); 777 view->setFocus();
778 } 778 }
779} 779}
780 780
781void AdvancedFm::doRename(QListView * view) { 781void AdvancedFm::doRename(QListView * view) {
782 if( !CurrentView()->currentItem()) return; 782 if( !CurrentView()->currentItem()) return;
783 783
784 QRect r = view->itemRect( view->currentItem( )); 784 QRect r = view->itemRect( view->currentItem( ));
785 r = QRect( view->viewportToContents( r.topLeft() ), r.size() ); 785 r = QRect( view->viewportToContents( r.topLeft() ), r.size() );
786 r.setX( view->contentsX() ); 786 r.setX( view->contentsX() );
787 787
788 if ( r.width() > view->visibleWidth() ) 788 if ( r.width() > view->visibleWidth() )
789 r.setWidth( view->visibleWidth() ); 789 r.setWidth( view->visibleWidth() );
790 790
791 renameBox = new QLineEdit( view->viewport(), "qt_renamebox" ); 791 renameBox = new QLineEdit( view->viewport(), "qt_renamebox" );
792 renameBox->setFrame(true); 792 renameBox->setFrame(true);
793 793
794 renameBox->setText( view->currentItem()->text(0) ); 794 renameBox->setText( view->currentItem()->text(0) );
795 795
796 renameBox->selectAll(); 796 renameBox->selectAll();
797 renameBox->installEventFilter( this ); 797 renameBox->installEventFilter( this );
798 798
799 view->addChild( renameBox, r.x(), r.y() ); 799 view->addChild( renameBox, r.x(), r.y() );
800 800
801 renameBox->resize( r.size() ); 801 renameBox->resize( r.size() );
802 802
803 view->viewport()->setFocusProxy( renameBox ); 803 view->viewport()->setFocusProxy( renameBox );
804 804
805 renameBox->setFocus(); 805 renameBox->setFocus();
806 renameBox->show(); 806 renameBox->show();
807} 807}
808 808
809 809
810void AdvancedFm::renameIt() { 810void AdvancedFm::renameIt() {
811 if( !CurrentView()->currentItem()) return; 811 if( !CurrentView()->currentItem()) return;
812 812
813 QListView *thisView = CurrentView(); 813 QListView *thisView = CurrentView();
814 oldName = thisView->currentItem()->text(0); 814 oldName = thisView->currentItem()->text(0);
815 doRename( thisView ); 815 doRename( thisView );
816} 816}
817 817
818void AdvancedFm::okRename() { 818void AdvancedFm::okRename() {
819 if( !CurrentView()->currentItem()) return; 819 if( !CurrentView()->currentItem()) return;
820 820
821 QString newName = renameBox->text(); 821 QString newName = renameBox->text();
822 cancelRename(); 822 cancelRename();
823 QListView * view = CurrentView(); 823 QListView * view = CurrentView();
824 QString path = CurrentDir()->canonicalPath() + "/"; 824 QString path = CurrentDir()->canonicalPath() + "/";
825 oldName = path + oldName; 825 oldName = path + oldName;
826 newName = path + newName; 826 newName = path + newName;
827 if( rename( oldName.latin1(), newName.latin1())== -1) 827 if( rename( oldName.latin1(), newName.latin1())== -1)
828 QMessageBox::message(tr("Note"),tr("Could not rename")); 828 QMessageBox::message(tr("Note"),tr("Could not rename"));
829 else 829 else
830 oldName = ""; 830 oldName = "";
831 view->takeItem( view->currentItem() ); 831 view->takeItem( view->currentItem() );
832 delete view->currentItem(); 832 delete view->currentItem();
833 rePopulate(); 833 rePopulate();
834} 834}
835 835
836void AdvancedFm::openSearch() { 836void AdvancedFm::openSearch() {
837 QMessageBox::message(tr("Note"),tr("Not Yet Implemented")); 837 QMessageBox::message(tr("Note"),tr("Not Yet Implemented"));
838} 838}
diff --git a/noncore/apps/advancedfm/output.cpp b/noncore/apps/advancedfm/output.cpp
index 16a0992..6906298 100644
--- a/noncore/apps/advancedfm/output.cpp
+++ b/noncore/apps/advancedfm/output.cpp
@@ -1,278 +1,278 @@
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#include <qpe/qpeapplication.h> 8#include <qpe/qpeapplication.h>
9#include <qpe/applnk.h> 9#include <qpe/applnk.h>
10 10
11#include <qfile.h> 11#include <qfile.h>
12#include <qmultilineedit.h> 12#include <qmultilineedit.h>
13#include <qpushbutton.h> 13#include <qpushbutton.h>
14#include <qlayout.h> 14#include <qlayout.h>
15 15
16#include <errno.h> 16#include <errno.h>
17 17
18/* XPM */ 18/* XPM */
19using namespace Opie::Core; 19using namespace Opie::Core;
20using namespace Opie::Core; 20using namespace Opie::Core;
21static char * filesave_xpm[] = { 21static char * filesave_xpm[] = {
22"16 16 78 1", 22"16 16 78 1",
23" c None", 23" c None",
24". c #343434", 24". c #343434",
25"+ c #A0A0A0", 25"+ c #A0A0A0",
26"@ c #565656", 26"@ c #565656",
27"# c #9E9E9E", 27"# c #9E9E9E",
28"$ c #525252", 28"$ c #525252",
29"% c #929292", 29"% c #929292",
30"& c #676767", 30"& c #676767",
31"* c #848484", 31"* c #848484",
32"= c #666666", 32"= c #666666",
33"- c #D8D8D8", 33"- c #D8D8D8",
34"; c #FFFFFF", 34"; c #FFFFFF",
35"> c #DBDBDB", 35"> c #DBDBDB",
36", c #636363", 36", c #636363",
37"' c #989898", 37"' c #989898",
38") c #2D2D2D", 38") c #2D2D2D",
39"! c #909090", 39"! c #909090",
40"~ c #AEAEAE", 40"~ c #AEAEAE",
41"{ c #EAEAEA", 41"{ c #EAEAEA",
42"] c #575757", 42"] c #575757",
43"^ c #585858", 43"^ c #585858",
44"/ c #8A8A8A", 44"/ c #8A8A8A",
45"( c #828282", 45"( c #828282",
46"_ c #6F6F6F", 46"_ c #6F6F6F",
47": c #C9C9C9", 47": c #C9C9C9",
48"< c #050505", 48"< c #050505",
49"[ c #292929", 49"[ c #292929",
50"} c #777777", 50"} c #777777",
51"| c #616161", 51"| c #616161",
52"1 c #3A3A3A", 52"1 c #3A3A3A",
53"2 c #BEBEBE", 53"2 c #BEBEBE",
54"3 c #2C2C2C", 54"3 c #2C2C2C",
55"4 c #7C7C7C", 55"4 c #7C7C7C",
56"5 c #F6F6F6", 56"5 c #F6F6F6",
57"6 c #FCFCFC", 57"6 c #FCFCFC",
58"7 c #6B6B6B", 58"7 c #6B6B6B",
59"8 c #959595", 59"8 c #959595",
60"9 c #4F4F4F", 60"9 c #4F4F4F",
61"0 c #808080", 61"0 c #808080",
62"a c #767676", 62"a c #767676",
63"b c #818181", 63"b c #818181",
64"c c #B8B8B8", 64"c c #B8B8B8",
65"d c #FBFBFB", 65"d c #FBFBFB",
66"e c #F9F9F9", 66"e c #F9F9F9",
67"f c #CCCCCC", 67"f c #CCCCCC",
68"g c #030303", 68"g c #030303",
69"h c #737373", 69"h c #737373",
70"i c #7A7A7A", 70"i c #7A7A7A",
71"j c #7E7E7E", 71"j c #7E7E7E",
72"k c #6A6A6A", 72"k c #6A6A6A",
73"l c #FAFAFA", 73"l c #FAFAFA",
74"m c #505050", 74"m c #505050",
75"n c #9D9D9D", 75"n c #9D9D9D",
76"o c #333333", 76"o c #333333",
77"p c #7B7B7B", 77"p c #7B7B7B",
78"q c #787878", 78"q c #787878",
79"r c #696969", 79"r c #696969",
80"s c #494949", 80"s c #494949",
81"t c #555555", 81"t c #555555",
82"u c #949494", 82"u c #949494",
83"v c #E6E6E6", 83"v c #E6E6E6",
84"w c #424242", 84"w c #424242",
85"x c #515151", 85"x c #515151",
86"y c #535353", 86"y c #535353",
87"z c #3E3E3E", 87"z c #3E3E3E",
88"A c #D4D4D4", 88"A c #D4D4D4",
89"B c #0C0C0C", 89"B c #0C0C0C",
90"C c #353535", 90"C c #353535",
91"D c #474747", 91"D c #474747",
92"E c #ECECEC", 92"E c #ECECEC",
93"F c #919191", 93"F c #919191",
94"G c #7D7D7D", 94"G c #7D7D7D",
95"H c #000000", 95"H c #000000",
96"I c #404040", 96"I c #404040",
97"J c #858585", 97"J c #858585",
98"K c #323232", 98"K c #323232",
99"L c #D0D0D0", 99"L c #D0D0D0",
100"M c #1C1C1C", 100"M c #1C1C1C",
101" ...+ ", 101" ...+ ",
102" @#$%&..+ ", 102" @#$%&..+ ",
103" .*=-;;>,..+ ", 103" .*=-;;>,..+ ",
104" ')!~;;;;;;{]..", 104" ')!~;;;;;;{]..",
105" ^/(-;;;;;;;_:<", 105" ^/(-;;;;;;;_:<",
106" [}|;;;;;;;{12$", 106" [}|;;;;;;;{12$",
107" #34-55;;;;678$+", 107" #34-55;;;;678$+",
108" 90ab=c;dd;e1fg ", 108" 90ab=c;dd;e1fg ",
109" [ahij((kbl0mn$ ", 109" [ahij((kbl0mn$ ",
110" op^q^^7r&]s/$+ ", 110" op^q^^7r&]s/$+ ",
111"@btu;vbwxy]zAB ", 111"@btu;vbwxy]zAB ",
112"CzDEvEv;;DssF$ ", 112"CzDEvEv;;DssF$ ",
113"G.H{E{E{IxsJ$+ ", 113"G.H{E{E{IxsJ$+ ",
114" +...vEKxzLM ", 114" +...vEKxzLM ",
115" +...z]n$ ", 115" +...z]n$ ",
116" +... "}; 116" +... "};
117 117
118Output::Output( const QStringList commands, QWidget* parent, const char* name, bool modal, WFlags fl) 118Output::Output( const QStringList commands, QWidget* parent, const char* name, bool modal, WFlags fl)
119 : QDialog( parent, name, modal, fl ) 119 : QDialog( parent, name, modal, fl )
120{ 120{
121 QStringList cmmds; 121 QStringList cmmds;
122// cmmds=QStringList::split( " ", commands, false); 122// cmmds=QStringList::split( " ", commands, false);
123 cmmds=commands; 123 cmmds=commands;
124// qDebug("count %d", cmmds.count()); 124// qDebug("count %d", cmmds.count());
125 if ( !name ) 125 if ( !name )
126 setName( tr("Output")); 126 setName( tr("Output"));
127 resize( 196, 269 ); 127 resize( 196, 269 );
128 setCaption( name ); 128 setCaption( name );
129 129
130 OutputLayout = new QGridLayout( this ); 130 OutputLayout = new QGridLayout( this );
131 OutputLayout->setSpacing( 2); 131 OutputLayout->setSpacing( 2);
132 OutputLayout->setMargin( 2); 132 OutputLayout->setMargin( 2);
133 133
134 QPushButton *docButton; 134 QPushButton *docButton;
135 docButton = new QPushButton( QPixmap(( const char** ) filesave_xpm ) ,"",this,"saveButton"); 135 docButton = new QPushButton( QPixmap(( const char** ) filesave_xpm ) ,"",this,"saveButton");
136 docButton->setFixedSize( QSize( 20, 20 ) ); 136 docButton->setFixedSize( QSize( 20, 20 ) );
137 connect( docButton,SIGNAL(released()),this,SLOT( saveOutput() )); 137 connect( docButton,SIGNAL(released()),this,SLOT( saveOutput() ));
138 // docButton->setFlat(TRUE); 138 // docButton->setFlat(TRUE);
139 OutputLayout->addMultiCellWidget( docButton, 0,0,3,3 ); 139 OutputLayout->addMultiCellWidget( docButton, 0,0,3,3 );
140 140
141 OutputEdit = new QMultiLineEdit( this, "OutputEdit" ); 141 OutputEdit = new QMultiLineEdit( this, "OutputEdit" );
142 OutputLayout->addMultiCellWidget( OutputEdit, 1,1,0,3 ); 142 OutputLayout->addMultiCellWidget( OutputEdit, 1,1,0,3 );
143 143
144 proc = new OProcess(); 144 proc = new OProcess();
145 145
146 connect(proc, SIGNAL(processExited(Opie::Core::OProcess*)), 146 connect(proc, SIGNAL(processExited(Opie::Core::OProcess*)),
147 this, SLOT( processFinished())); 147 this, SLOT( processFinished()));
148 148
149 connect(proc, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)), 149 connect(proc, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)),
150 this, SLOT(commandStdout(OProcess*,char*,int))); 150 this, SLOT(commandStdout(Opie::Core::OProcess*,char*,int)));
151 151
152 connect(proc, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)), 152 connect(proc, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)),
153 this, SLOT(commandStderr(OProcess*,char*,int))); 153 this, SLOT(commandStderr(Opie::Core::OProcess*,char*,int)));
154 154
155// connect( , SIGNAL(received(const QByteArray&)), 155// connect( , SIGNAL(received(const QByteArray&)),
156// this, SLOT(commandStdin(const QByteArray&))); 156// this, SLOT(commandStdin(const QByteArray&)));
157 157
158// * proc << commands.latin1(); 158// * proc << commands.latin1();
159 for ( QStringList::Iterator it = cmmds.begin(); it != cmmds.end(); ++it ) { 159 for ( QStringList::Iterator it = cmmds.begin(); it != cmmds.end(); ++it ) {
160 qDebug( "%s", (*it).latin1() ); 160 qDebug( "%s", (*it).latin1() );
161 * proc << (*it).latin1(); 161 * proc << (*it).latin1();
162 } 162 }
163 163
164 if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) { 164 if(!proc->start(OProcess::NotifyOnExit, OProcess::All)) {
165 165
166 OutputEdit->append(tr("Process could not start") ); 166 OutputEdit->append(tr("Process could not start") );
167 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); 167 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE);
168 perror("Error: "); 168 perror("Error: ");
169 QString errorMsg=tr("Error\n")+(QString)strerror(errno); 169 QString errorMsg=tr("Error\n")+(QString)strerror(errno);
170 OutputEdit->append( errorMsg); 170 OutputEdit->append( errorMsg);
171 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); 171 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE);
172 } 172 }
173} 173}
174 174
175Output::~Output() { 175Output::~Output() {
176} 176}
177 177
178void Output::saveOutput() { 178void Output::saveOutput() {
179 179
180 InputDialog *fileDlg; 180 InputDialog *fileDlg;
181 fileDlg = new InputDialog(this,tr("Save output to file (name only)"),TRUE, 0); 181 fileDlg = new InputDialog(this,tr("Save output to file (name only)"),TRUE, 0);
182 fileDlg->exec(); 182 fileDlg->exec();
183 if( fileDlg->result() == 1 ) { 183 if( fileDlg->result() == 1 ) {
184 QString filename = QPEApplication::documentDir(); 184 QString filename = QPEApplication::documentDir();
185 if(filename.right(1).find('/') == -1) 185 if(filename.right(1).find('/') == -1)
186 filename+="/"; 186 filename+="/";
187 QString name = fileDlg->LineEdit1->text(); 187 QString name = fileDlg->LineEdit1->text();
188 filename+="text/plain/"+name; 188 filename+="text/plain/"+name;
189 qDebug(filename); 189 qDebug(filename);
190 190
191 QFile f(filename); 191 QFile f(filename);
192 f.open( IO_WriteOnly); 192 f.open( IO_WriteOnly);
193 if( f.writeBlock( OutputEdit->text(), qstrlen( OutputEdit->text()) ) != -1) { 193 if( f.writeBlock( OutputEdit->text(), qstrlen( OutputEdit->text()) ) != -1) {
194 DocLnk lnk; 194 DocLnk lnk;
195 lnk.setName(name); //sets file name 195 lnk.setName(name); //sets file name
196 lnk.setFile(filename); //sets File property 196 lnk.setFile(filename); //sets File property
197 lnk.setType("text/plain"); 197 lnk.setType("text/plain");
198 if(!lnk.writeLink()) { 198 if(!lnk.writeLink()) {
199 qDebug("Writing doclink did not work"); 199 qDebug("Writing doclink did not work");
200 } 200 }
201 } else 201 } else
202 qWarning("Could not write file"); 202 qWarning("Could not write file");
203 f.close(); 203 f.close();
204 } 204 }
205} 205}
206 206
207void Output::commandStdout(OProcess*, char *buffer, int buflen) { 207void Output::commandStdout(OProcess*, char *buffer, int buflen) {
208 qWarning("received stdout %d bytes", buflen); 208 qWarning("received stdout %d bytes", buflen);
209 209
210// QByteArray data(buflen); 210// QByteArray data(buflen);
211// data.fill(*buffer, buflen); 211// data.fill(*buffer, buflen);
212// for (uint i = 0; i < data.count(); i++ ) { 212// for (uint i = 0; i < data.count(); i++ ) {
213// printf("%c", buffer[i] ); 213// printf("%c", buffer[i] );
214// } 214// }
215// printf("\n"); 215// printf("\n");
216 216
217 QString lineStr = buffer; 217 QString lineStr = buffer;
218 lineStr=lineStr.left(lineStr.length()-1); 218 lineStr=lineStr.left(lineStr.length()-1);
219 OutputEdit->append(lineStr); 219 OutputEdit->append(lineStr);
220 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); 220 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE);
221} 221}
222 222
223 223
224void Output::commandStdin( const QByteArray &data) { 224void Output::commandStdin( const QByteArray &data) {
225 qWarning("received stdin %d bytes", data.size()); 225 qWarning("received stdin %d bytes", data.size());
226 // recieved data from the io layer goes to sz 226 // recieved data from the io layer goes to sz
227 proc->writeStdin(data.data(), data.size()); 227 proc->writeStdin(data.data(), data.size());
228} 228}
229 229
230void Output::commandStderr(OProcess*, char *buffer, int buflen) { 230void Output::commandStderr(OProcess*, char *buffer, int buflen) {
231 qWarning("received stderrt %d bytes", buflen); 231 qWarning("received stderrt %d bytes", buflen);
232 232
233 QString lineStr = buffer; 233 QString lineStr = buffer;
234// lineStr=lineStr.left(lineStr.length()-1); 234// lineStr=lineStr.left(lineStr.length()-1);
235 OutputEdit->append(lineStr); 235 OutputEdit->append(lineStr);
236 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); 236 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE);
237} 237}
238 238
239void Output::processFinished() { 239void Output::processFinished() {
240 240
241 delete proc; 241 delete proc;
242 OutputEdit->append( tr("\nFinished\n") ); 242 OutputEdit->append( tr("\nFinished\n") );
243 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE); 243 OutputEdit->setCursorPosition( OutputEdit->numLines() + 1,0,FALSE);
244// close(); 244// close();
245// disconnect( layer(), SIGNAL(received(const QByteArray&)), 245// disconnect( layer(), SIGNAL(received(const QByteArray&)),
246// this, SLOT(commandStdin(const QByteArray&))); 246// this, SLOT(commandStdin(const QByteArray&)));
247} 247}
248 248
249//============================== 249//==============================
250 250
251InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl ) 251InputDialog::InputDialog( QWidget* parent, const char* name, bool modal, WFlags fl )
252 : QDialog( parent, name, modal, fl ) 252 : QDialog( parent, name, modal, fl )
253{ 253{
254 if ( !name ) 254 if ( !name )
255 setName( "InputDialog" ); 255 setName( "InputDialog" );
256 resize( 234, 50 ); 256 resize( 234, 50 );
257 setMaximumSize( QSize( 240, 50 ) ); 257 setMaximumSize( QSize( 240, 50 ) );
258 setCaption( tr(name ) ); 258 setCaption( tr(name ) );
259 259
260 LineEdit1 = new QLineEdit( this, "LineEdit1" ); 260 LineEdit1 = new QLineEdit( this, "LineEdit1" );
261 LineEdit1->setGeometry( QRect( 10, 10, 216, 22 ) ); 261 LineEdit1->setGeometry( QRect( 10, 10, 216, 22 ) );
262 LineEdit1->setFocus(); 262 LineEdit1->setFocus();
263 LineEdit1->setFocus(); 263 LineEdit1->setFocus();
264 connect(LineEdit1,SIGNAL(returnPressed()),this,SLOT(returned() )); 264 connect(LineEdit1,SIGNAL(returnPressed()),this,SLOT(returned() ));
265} 265}
266 266
267InputDialog::~InputDialog() { 267InputDialog::~InputDialog() {
268 inputText = LineEdit1->text(); 268 inputText = LineEdit1->text();
269} 269}
270 270
271void InputDialog::setInputText(const QString &string) { 271void InputDialog::setInputText(const QString &string) {
272 LineEdit1->setText( string); 272 LineEdit1->setText( string);
273} 273}
274 274
275void InputDialog::returned() { 275void InputDialog::returned() {
276 inputText = LineEdit1->text(); 276 inputText = LineEdit1->text();
277 this->accept(); 277 this->accept();
278} 278}
diff --git a/noncore/apps/opie-console/io_bt.cpp b/noncore/apps/opie-console/io_bt.cpp
index 35a328f..a29fa8e 100644
--- a/noncore/apps/opie-console/io_bt.cpp
+++ b/noncore/apps/opie-console/io_bt.cpp
@@ -1,94 +1,93 @@
1 1
2#include "io_bt.h" 2#include "io_bt.h"
3 3
4using namespace Opie::Core; 4using namespace Opie::Core;
5using namespace Opie::Core;
6IOBt::IOBt( const Profile &config ) : IOSerial( config ) { 5IOBt::IOBt( const Profile &config ) : IOSerial( config ) {
7 m_attach = 0; 6 m_attach = 0;
8} 7}
9 8
10 9
11IOBt::~IOBt() { 10IOBt::~IOBt() {
12 if ( m_attach ) { 11 if ( m_attach ) {
13 delete m_attach; 12 delete m_attach;
14 } 13 }
15} 14}
16 15
17 16
18void IOBt::close() { 17void IOBt::close() {
19 18
20 IOSerial::close(); 19 IOSerial::close();
21 // still need error handling 20 // still need error handling
22 if ( m_attach ) { 21 if ( m_attach ) {
23 delete m_attach; 22 delete m_attach;
24 m_attach = 0; 23 m_attach = 0;
25 } 24 }
26} 25}
27 26
28bool IOBt::open() { 27bool IOBt::open() {
29 bool ret = false; 28 bool ret = false;
30 29
31 // only set up bt stuff if mac address was set, otherwise use the device set 30 // only set up bt stuff if mac address was set, otherwise use the device set
32 if ( !m_mac.isEmpty() ) { 31 if ( !m_mac.isEmpty() ) {
33 32
34 // now it should also be checked, if there is a connection to the device with that mac allready 33 // now it should also be checked, if there is a connection to the device with that mac allready
35 // hciattach here 34 // hciattach here
36 m_attach = new OProcess(); 35 m_attach = new OProcess();
37 *m_attach << "hciattach /dev/ttyS2 any 57600"; 36 *m_attach << "hciattach /dev/ttyS2 any 57600";
38 37
39 // then start hcid, then rcfomm handling (m_mac) 38 // then start hcid, then rcfomm handling (m_mac)
40 39
41 connect( m_attach, SIGNAL( processExited(Opie::Core::OProcess*) ), 40 connect( m_attach, SIGNAL( processExited(Opie::Core::OProcess*) ),
42 this, SLOT( slotExited(OProcess*) ) ); 41 this, SLOT( slotExited(Opie::Core::OProcess*) ) );
43 42
44 if ( m_attach->start() ) { 43 if ( m_attach->start() ) {
45 ret = IOSerial::open(); 44 ret = IOSerial::open();
46 } else { 45 } else {
47 qWarning("could not attach to device"); 46 qWarning("could not attach to device");
48 delete m_attach; 47 delete m_attach;
49 m_attach = 0; 48 m_attach = 0;
50 } 49 }
51 } else { 50 } else {
52 // directly to the normal serial 51 // directly to the normal serial
53 // TODO: look first if the connection really exists. ( is set up ) 52 // TODO: look first if the connection really exists. ( is set up )
54 53
55 ret =IOSerial::open(); 54 ret =IOSerial::open();
56 } 55 }
57 return ret; 56 return ret;
58} 57}
59 58
60void IOBt::reload( const Profile &config ) { 59void IOBt::reload( const Profile &config ) {
61 m_device = config.readEntry("Device", BT_DEFAULT_DEVICE); 60 m_device = config.readEntry("Device", BT_DEFAULT_DEVICE);
62 m_mac = config.readEntry("Mac", BT_DEFAULT_MAC); 61 m_mac = config.readEntry("Mac", BT_DEFAULT_MAC);
63 m_baud = config.readNumEntry("Baud", BT_DEFAULT_BAUD); 62 m_baud = config.readNumEntry("Baud", BT_DEFAULT_BAUD);
64 m_parity = config.readNumEntry("Parity", BT_DEFAULT_PARITY); 63 m_parity = config.readNumEntry("Parity", BT_DEFAULT_PARITY);
65 m_dbits = config.readNumEntry("DataBits", BT_DEFAULT_DBITS); 64 m_dbits = config.readNumEntry("DataBits", BT_DEFAULT_DBITS);
66 m_sbits = config.readNumEntry("StopBits", BT_DEFAULT_SBITS); 65 m_sbits = config.readNumEntry("StopBits", BT_DEFAULT_SBITS);
67 m_flow = config.readNumEntry("Flow", BT_DEFAULT_FLOW); 66 m_flow = config.readNumEntry("Flow", BT_DEFAULT_FLOW);
68} 67}
69 68
70 69
71QString IOBt::identifier() const { 70QString IOBt::identifier() const {
72 return "bluetooth"; 71 return "bluetooth";
73} 72}
74 73
75QString IOBt::name() const { 74QString IOBt::name() const {
76 return "BLuetooth IO Layer"; 75 return "BLuetooth IO Layer";
77} 76}
78 77
79void IOBt::slotExited( OProcess* proc ){ 78void IOBt::slotExited( OProcess* proc ){
80 close(); 79 close();
81 delete proc; 80 delete proc;
82} 81}
83 82
84QBitArray IOBt::supports() const { 83QBitArray IOBt::supports() const {
85 return QBitArray( 3 ); 84 return QBitArray( 3 );
86} 85}
87 86
88bool IOBt::isConnected() { 87bool IOBt::isConnected() {
89 return false; 88 return false;
90} 89}
91 90
92void IOBt::send(const QByteArray &data) { 91void IOBt::send(const QByteArray &data) {
93 qDebug( "Please overload me..." ); 92 qDebug( "Please overload me..." );
94} 93}
diff --git a/noncore/apps/opie-console/io_irda.cpp b/noncore/apps/opie-console/io_irda.cpp
index ba0b0e5..07c2b62 100644
--- a/noncore/apps/opie-console/io_irda.cpp
+++ b/noncore/apps/opie-console/io_irda.cpp
@@ -1,79 +1,78 @@
1 1
2#include "io_irda.h" 2#include "io_irda.h"
3 3
4using namespace Opie::Core; 4using namespace Opie::Core;
5using namespace Opie::Core;
6IOIrda::IOIrda( const Profile &config ) : IOSerial( config ) { 5IOIrda::IOIrda( const Profile &config ) : IOSerial( config ) {
7 m_attach = 0; 6 m_attach = 0;
8} 7}
9 8
10 9
11IOIrda::~IOIrda() { 10IOIrda::~IOIrda() {
12 if ( m_attach ) { 11 if ( m_attach ) {
13 delete m_attach; 12 delete m_attach;
14 } 13 }
15} 14}
16 15
17 16
18void IOIrda::close() { 17void IOIrda::close() {
19 18
20 IOSerial::close(); 19 IOSerial::close();
21 // still need error handling 20 // still need error handling
22 delete m_attach; 21 delete m_attach;
23} 22}
24 23
25bool IOIrda::open() { 24bool IOIrda::open() {
26 bool ret; 25 bool ret;
27 26
28 // irdaattach here 27 // irdaattach here
29 m_attach = new OProcess(); 28 m_attach = new OProcess();
30 *m_attach << "irattach /dev/ttyS2 -s"; 29 *m_attach << "irattach /dev/ttyS2 -s";
31 30
32 connect( m_attach, SIGNAL( processExited(Opie::Core::OProcess*) ), 31 connect( m_attach, SIGNAL( processExited(Opie::Core::OProcess*) ),
33 this, SLOT( slotExited(OProcess*) ) ); 32 this, SLOT( slotExited(Opie::Core::OProcess*) ) );
34 33
35 if ( m_attach->start() ) { 34 if ( m_attach->start() ) {
36 ret= IOSerial::open(); 35 ret= IOSerial::open();
37 } else { 36 } else {
38 // emit error!!! 37 // emit error!!!
39 qWarning("could not attach to device"); 38 qWarning("could not attach to device");
40 delete m_attach; 39 delete m_attach;
41 m_attach = 0l; 40 m_attach = 0l;
42 } 41 }
43 return ret; 42 return ret;
44} 43}
45 44
46void IOIrda::reload( const Profile &config ) { 45void IOIrda::reload( const Profile &config ) {
47 m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE); 46 m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE);
48 m_baud = config.readNumEntry("Baud", IRDA_DEFAULT_BAUD); 47 m_baud = config.readNumEntry("Baud", IRDA_DEFAULT_BAUD);
49 m_parity = config.readNumEntry("Parity", IRDA_DEFAULT_PARITY); 48 m_parity = config.readNumEntry("Parity", IRDA_DEFAULT_PARITY);
50 m_dbits = config.readNumEntry("DataBits", IRDA_DEFAULT_DBITS); 49 m_dbits = config.readNumEntry("DataBits", IRDA_DEFAULT_DBITS);
51 m_sbits = config.readNumEntry("StopBits", IRDA_DEFAULT_SBITS); 50 m_sbits = config.readNumEntry("StopBits", IRDA_DEFAULT_SBITS);
52 m_flow = config.readNumEntry("Flow", IRDA_DEFAULT_FLOW); 51 m_flow = config.readNumEntry("Flow", IRDA_DEFAULT_FLOW);
53} 52}
54 53
55 54
56QString IOIrda::identifier() const { 55QString IOIrda::identifier() const {
57 return "irda"; 56 return "irda";
58} 57}
59 58
60QString IOIrda::name() const { 59QString IOIrda::name() const {
61 return "Irda IO Layer"; 60 return "Irda IO Layer";
62} 61}
63 62
64void IOIrda::slotExited(OProcess* proc ){ 63void IOIrda::slotExited(OProcess* proc ){
65 close(); 64 close();
66 delete proc; 65 delete proc;
67} 66}
68 67
69QBitArray IOIrda::supports()const { 68QBitArray IOIrda::supports()const {
70 return QBitArray( 3 ); 69 return QBitArray( 3 );
71} 70}
72 71
73bool IOIrda::isConnected() { 72bool IOIrda::isConnected() {
74 return false; 73 return false;
75} 74}
76 75
77void IOIrda::send(const QByteArray &data) { 76void IOIrda::send(const QByteArray &data) {
78 qDebug( "Please overload me..." ); 77 qDebug( "Please overload me..." );
79} 78}
diff --git a/noncore/apps/opie-console/sz_transfer.cpp b/noncore/apps/opie-console/sz_transfer.cpp
index 5958e93..fbc5306 100644
--- a/noncore/apps/opie-console/sz_transfer.cpp
+++ b/noncore/apps/opie-console/sz_transfer.cpp
@@ -1,86 +1,86 @@
1 1
2#include "sz_transfer.h" 2#include "sz_transfer.h"
3#include <qfile.h> 3#include <qfile.h>
4#include <stdio.h> 4#include <stdio.h>
5#include <sys/termios.h> 5#include <sys/termios.h>
6 6
7 7
8 8
9using namespace Opie::Core; 9using namespace Opie::Core;
10using namespace Opie::Core; 10using namespace Opie::Core;
11SzTransfer::SzTransfer(Type t, IOLayer *layer) : FileTransferLayer(layer), m_t(t) 11SzTransfer::SzTransfer(Type t, IOLayer *layer) : FileTransferLayer(layer), m_t(t)
12{ 12{
13} 13}
14 14
15SzTransfer::~SzTransfer() { 15SzTransfer::~SzTransfer() {
16} 16}
17 17
18void SzTransfer::sendFile(const QFile& file) { 18void SzTransfer::sendFile(const QFile& file) {
19 19
20 sendFile(file.name()); 20 sendFile(file.name());
21} 21}
22 22
23void SzTransfer::sendFile(const QString& file) { 23void SzTransfer::sendFile(const QString& file) {
24 24
25 //setcbreak(2); /* raw no echo */ 25 //setcbreak(2); /* raw no echo */
26 26
27 proc = new OProcess; 27 proc = new OProcess;
28 *proc << "sz"; 28 *proc << "sz";
29 *proc << "-v" << "-v" << "-b" << file; 29 *proc << "-v" << "-v" << "-b" << file;
30 connect(proc, SIGNAL(processExited(Opie::Core::OProcess*)), 30 connect(proc, SIGNAL(processExited(Opie::Core::OProcess*)),
31 this, SLOT(sent())); 31 this, SLOT(sent()));
32 connect(proc, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)), 32 connect(proc, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)),
33 this, SLOT(SzReceivedStdout(OProcess*,char*,int))); 33 this, SLOT(SzReceivedStdout(Opie::Core::OProcess*,char*,int)));
34 connect(proc, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)), 34 connect(proc, SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)),
35 this, SLOT(SzReceivedStderr(OProcess*,char*,int))); 35 this, SLOT(SzReceivedStderr(Opie::Core::OProcess*,char*,int)));
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
42void SzTransfer::SzReceivedStdout(OProcess *, char *buffer, int buflen) { 42void SzTransfer::SzReceivedStdout(OProcess *, char *buffer, int buflen) {
43 43
44 qWarning("recieved from sz on stdout %d bytes", buflen); 44 qWarning("recieved from sz on stdout %d bytes", buflen);
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
53 // send out through the io layer 53 // send out through the io layer
54 layer()->send(data); 54 layer()->send(data);
55} 55}
56 56
57void SzTransfer::SzReceivedStderr(OProcess *, char *buffer, int length) { 57void SzTransfer::SzReceivedStderr(OProcess *, char *buffer, int length) {
58 58
59 // parse and show data in a progress dialog/widget 59 // parse and show data in a progress dialog/widget
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
66void SzTransfer::receivedStdin(const QByteArray &data) { 66void SzTransfer::receivedStdin(const QByteArray &data) {
67 67
68 qWarning("recieved from io_serial %d bytes", data.size()); 68 qWarning("recieved from io_serial %d bytes", data.size());
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
75void SzTransfer::sent() { 75void SzTransfer::sent() {
76 76
77 qWarning("sent file"); 77 qWarning("sent file");
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
86} 86}
diff --git a/noncore/net/mail/libmailwrapper/mhwrapper.cpp b/noncore/net/mail/libmailwrapper/mhwrapper.cpp
index 21e24a0..5eae31f 100644
--- a/noncore/net/mail/libmailwrapper/mhwrapper.cpp
+++ b/noncore/net/mail/libmailwrapper/mhwrapper.cpp
@@ -1,444 +1,442 @@
1#include "mhwrapper.h" 1#include "mhwrapper.h"
2#include "mailtypes.h" 2#include "mailtypes.h"
3#include "mailwrapper.h" 3#include "mailwrapper.h"
4#include <libetpan/libetpan.h> 4#include <libetpan/libetpan.h>
5#include <qdir.h> 5#include <qdir.h>
6#include <qmessagebox.h> 6#include <qmessagebox.h>
7#include <stdlib.h> 7#include <stdlib.h>
8#include <qpe/global.h> 8#include <qpe/global.h>
9#include <opie2/oprocess.h> 9#include <opie2/oprocess.h>
10 10
11using namespace Opie::Core; 11using namespace Opie::Core;
12using namespace Opie::Core;
13using namespace Opie::Core;
14MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name) 12MHwrapper::MHwrapper(const QString & mbox_dir,const QString&mbox_name)
15 : Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name) 13 : Genericwrapper(),MHPath(mbox_dir),MHName(mbox_name)
16{ 14{
17 if (MHPath.length()>0) { 15 if (MHPath.length()>0) {
18 if (MHPath[MHPath.length()-1]=='/') { 16 if (MHPath[MHPath.length()-1]=='/') {
19 MHPath=MHPath.left(MHPath.length()-1); 17 MHPath=MHPath.left(MHPath.length()-1);
20 } 18 }
21 qDebug(MHPath); 19 qDebug(MHPath);
22 QDir dir(MHPath); 20 QDir dir(MHPath);
23 if (!dir.exists()) { 21 if (!dir.exists()) {
24 dir.mkdir(MHPath); 22 dir.mkdir(MHPath);
25 } 23 }
26 init_storage(); 24 init_storage();
27 } 25 }
28} 26}
29 27
30void MHwrapper::init_storage() 28void MHwrapper::init_storage()
31{ 29{
32 int r; 30 int r;
33 QString pre = MHPath; 31 QString pre = MHPath;
34 if (!m_storage) { 32 if (!m_storage) {
35 m_storage = mailstorage_new(NULL); 33 m_storage = mailstorage_new(NULL);
36 r = mh_mailstorage_init(m_storage,(char*)pre.latin1(),0,0,0); 34 r = mh_mailstorage_init(m_storage,(char*)pre.latin1(),0,0,0);
37 if (r != MAIL_NO_ERROR) { 35 if (r != MAIL_NO_ERROR) {
38 qDebug("error initializing storage"); 36 qDebug("error initializing storage");
39 mailstorage_free(m_storage); 37 mailstorage_free(m_storage);
40 m_storage = 0; 38 m_storage = 0;
41 return; 39 return;
42 } 40 }
43 } 41 }
44 r = mailstorage_connect(m_storage); 42 r = mailstorage_connect(m_storage);
45 if (r!=MAIL_NO_ERROR) { 43 if (r!=MAIL_NO_ERROR) {
46 qDebug("error connecting storage"); 44 qDebug("error connecting storage");
47 mailstorage_free(m_storage); 45 mailstorage_free(m_storage);
48 m_storage = 0; 46 m_storage = 0;
49 } 47 }
50} 48}
51 49
52void MHwrapper::clean_storage() 50void MHwrapper::clean_storage()
53{ 51{
54 if (m_storage) { 52 if (m_storage) {
55 mailstorage_disconnect(m_storage); 53 mailstorage_disconnect(m_storage);
56 mailstorage_free(m_storage); 54 mailstorage_free(m_storage);
57 m_storage = 0; 55 m_storage = 0;
58 } 56 }
59} 57}
60 58
61MHwrapper::~MHwrapper() 59MHwrapper::~MHwrapper()
62{ 60{
63 clean_storage(); 61 clean_storage();
64} 62}
65 63
66void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target ) 64void MHwrapper::listMessages(const QString & mailbox, QValueList<Opie::Core::OSmartPointer<RecMail> > &target )
67{ 65{
68 init_storage(); 66 init_storage();
69 if (!m_storage) { 67 if (!m_storage) {
70 return; 68 return;
71 } 69 }
72 QString f = buildPath(mailbox); 70 QString f = buildPath(mailbox);
73 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); 71 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1());
74 if (r!=MAIL_NO_ERROR) { 72 if (r!=MAIL_NO_ERROR) {
75 qDebug("listMessages: error selecting folder!"); 73 qDebug("listMessages: error selecting folder!");
76 return; 74 return;
77 } 75 }
78 parseList(target,m_storage->sto_session,f); 76 parseList(target,m_storage->sto_session,f);
79 Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count())); 77 Global::statusMessage(tr("Mailbox has %1 mail(s)").arg(target.count()));
80} 78}
81 79
82QValueList<Opie::Core::OSmartPointer<Folder> >* MHwrapper::listFolders() 80QValueList<Opie::Core::OSmartPointer<Folder> >* MHwrapper::listFolders()
83{ 81{
84 QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >(); 82 QValueList<Opie::Core::OSmartPointer<Folder> >* folders = new QValueList<Opie::Core::OSmartPointer<Folder> >();
85 /* this is needed! */ 83 /* this is needed! */
86 if (m_storage) mailstorage_disconnect(m_storage); 84 if (m_storage) mailstorage_disconnect(m_storage);
87 init_storage(); 85 init_storage();
88 if (!m_storage) { 86 if (!m_storage) {
89 return folders; 87 return folders;
90 } 88 }
91 mail_list*flist = 0; 89 mail_list*flist = 0;
92 clistcell*current=0; 90 clistcell*current=0;
93 int r = mailsession_list_folders(m_storage->sto_session,NULL,&flist); 91 int r = mailsession_list_folders(m_storage->sto_session,NULL,&flist);
94 if (r != MAIL_NO_ERROR || !flist) { 92 if (r != MAIL_NO_ERROR || !flist) {
95 qDebug("error getting folder list"); 93 qDebug("error getting folder list");
96 return folders; 94 return folders;
97 } 95 }
98 for (current=clist_begin(flist->mb_list);current!=0;current=clist_next(current)) { 96 for (current=clist_begin(flist->mb_list);current!=0;current=clist_next(current)) {
99 QString t = (char*)current->data; 97 QString t = (char*)current->data;
100 t.replace(0,MHPath.length(),""); 98 t.replace(0,MHPath.length(),"");
101 folders->append(new MHFolder(t,MHPath)); 99 folders->append(new MHFolder(t,MHPath));
102 } 100 }
103 mail_list_free(flist); 101 mail_list_free(flist);
104 return folders; 102 return folders;
105} 103}
106 104
107void MHwrapper::deleteMail(const RecMailP&mail) 105void MHwrapper::deleteMail(const RecMailP&mail)
108{ 106{
109 init_storage(); 107 init_storage();
110 if (!m_storage) { 108 if (!m_storage) {
111 return; 109 return;
112 } 110 }
113 int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1()); 111 int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1());
114 if (r!=MAIL_NO_ERROR) { 112 if (r!=MAIL_NO_ERROR) {
115 qDebug("error selecting folder!"); 113 qDebug("error selecting folder!");
116 return; 114 return;
117 } 115 }
118 r = mailsession_remove_message(m_storage->sto_session,mail->getNumber()); 116 r = mailsession_remove_message(m_storage->sto_session,mail->getNumber());
119 if (r != MAIL_NO_ERROR) { 117 if (r != MAIL_NO_ERROR) {
120 qDebug("error deleting mail"); 118 qDebug("error deleting mail");
121 } 119 }
122} 120}
123 121
124void MHwrapper::answeredMail(const RecMailP&) 122void MHwrapper::answeredMail(const RecMailP&)
125{ 123{
126} 124}
127 125
128RecBody MHwrapper::fetchBody( const RecMailP &mail ) 126RecBody MHwrapper::fetchBody( const RecMailP &mail )
129{ 127{
130 RecBody body; 128 RecBody body;
131 init_storage(); 129 init_storage();
132 if (!m_storage) { 130 if (!m_storage) {
133 return body; 131 return body;
134 } 132 }
135 mailmessage * msg; 133 mailmessage * msg;
136 char*data=0; 134 char*data=0;
137 135
138 /* mail should hold the complete path! */ 136 /* mail should hold the complete path! */
139 int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1()); 137 int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1());
140 if (r != MAIL_NO_ERROR) { 138 if (r != MAIL_NO_ERROR) {
141 return body; 139 return body;
142 } 140 }
143 r = mailsession_get_message(m_storage->sto_session, mail->getNumber(), &msg); 141 r = mailsession_get_message(m_storage->sto_session, mail->getNumber(), &msg);
144 if (r != MAIL_NO_ERROR) { 142 if (r != MAIL_NO_ERROR) {
145 qDebug("Error fetching mail %i",mail->getNumber()); 143 qDebug("Error fetching mail %i",mail->getNumber());
146 return body; 144 return body;
147 } 145 }
148 body = parseMail(msg); 146 body = parseMail(msg);
149 mailmessage_fetch_result_free(msg,data); 147 mailmessage_fetch_result_free(msg,data);
150 return body; 148 return body;
151} 149}
152 150
153void MHwrapper::mbox_progress( size_t current, size_t maximum ) 151void MHwrapper::mbox_progress( size_t current, size_t maximum )
154{ 152{
155 qDebug("MH %i von %i",current,maximum); 153 qDebug("MH %i von %i",current,maximum);
156} 154}
157 155
158QString MHwrapper::buildPath(const QString&p) 156QString MHwrapper::buildPath(const QString&p)
159{ 157{
160 QString f=""; 158 QString f="";
161 if (p.length()==0||p=="/") 159 if (p.length()==0||p=="/")
162 return MHPath; 160 return MHPath;
163 if (!p.startsWith(MHPath)) { 161 if (!p.startsWith(MHPath)) {
164 f+=MHPath; 162 f+=MHPath;
165 } 163 }
166 if (!p.startsWith("/")) { 164 if (!p.startsWith("/")) {
167 f+="/"; 165 f+="/";
168 } 166 }
169 f+=p; 167 f+=p;
170 return f; 168 return f;
171} 169}
172 170
173int MHwrapper::createMbox(const QString&folder,const FolderP&pfolder,const QString&,bool ) 171int MHwrapper::createMbox(const QString&folder,const FolderP&pfolder,const QString&,bool )
174{ 172{
175 init_storage(); 173 init_storage();
176 if (!m_storage) { 174 if (!m_storage) {
177 return 0; 175 return 0;
178 } 176 }
179 QString f; 177 QString f;
180 if (!pfolder) { 178 if (!pfolder) {
181 // toplevel folder 179 // toplevel folder
182 f = buildPath(folder); 180 f = buildPath(folder);
183 } else { 181 } else {
184 f = pfolder->getName(); 182 f = pfolder->getName();
185 f+="/"; 183 f+="/";
186 f+=folder; 184 f+=folder;
187 } 185 }
188 qDebug(f); 186 qDebug(f);
189 int r = mailsession_create_folder(m_storage->sto_session,(char*)f.latin1()); 187 int r = mailsession_create_folder(m_storage->sto_session,(char*)f.latin1());
190 if (r != MAIL_NO_ERROR) { 188 if (r != MAIL_NO_ERROR) {
191 qDebug("error creating folder %i",r); 189 qDebug("error creating folder %i",r);
192 return 0; 190 return 0;
193 } 191 }
194 qDebug("Folder created"); 192 qDebug("Folder created");
195 return 1; 193 return 1;
196} 194}
197 195
198void MHwrapper::storeMessage(const char*msg,size_t length, const QString&Folder) 196void MHwrapper::storeMessage(const char*msg,size_t length, const QString&Folder)
199{ 197{
200 init_storage(); 198 init_storage();
201 if (!m_storage) { 199 if (!m_storage) {
202 return; 200 return;
203 } 201 }
204 QString f = buildPath(Folder); 202 QString f = buildPath(Folder);
205 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); 203 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1());
206 if (r!=MAIL_NO_ERROR) { 204 if (r!=MAIL_NO_ERROR) {
207 qDebug("error selecting folder!"); 205 qDebug("error selecting folder!");
208 return; 206 return;
209 } 207 }
210 r = mailsession_append_message(m_storage->sto_session,(char*)msg,length); 208 r = mailsession_append_message(m_storage->sto_session,(char*)msg,length);
211 if (r!=MAIL_NO_ERROR) { 209 if (r!=MAIL_NO_ERROR) {
212 qDebug("error storing mail"); 210 qDebug("error storing mail");
213 } 211 }
214 return; 212 return;
215} 213}
216 214
217encodedString* MHwrapper::fetchRawBody(const RecMailP&mail) 215encodedString* MHwrapper::fetchRawBody(const RecMailP&mail)
218{ 216{
219 encodedString*result = 0; 217 encodedString*result = 0;
220 init_storage(); 218 init_storage();
221 if (!m_storage) { 219 if (!m_storage) {
222 return result; 220 return result;
223 } 221 }
224 mailmessage * msg = 0; 222 mailmessage * msg = 0;
225 char*data=0; 223 char*data=0;
226 size_t size; 224 size_t size;
227 int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1()); 225 int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1());
228 if (r!=MAIL_NO_ERROR) { 226 if (r!=MAIL_NO_ERROR) {
229 qDebug("error selecting folder!"); 227 qDebug("error selecting folder!");
230 return result; 228 return result;
231 } 229 }
232 r = mailsession_get_message(m_storage->sto_session, mail->getNumber(), &msg); 230 r = mailsession_get_message(m_storage->sto_session, mail->getNumber(), &msg);
233 if (r != MAIL_NO_ERROR) { 231 if (r != MAIL_NO_ERROR) {
234 Global::statusMessage(tr("Error fetching mail %i").arg(mail->getNumber())); 232 Global::statusMessage(tr("Error fetching mail %i").arg(mail->getNumber()));
235 return 0; 233 return 0;
236 } 234 }
237 r = mailmessage_fetch(msg,&data,&size); 235 r = mailmessage_fetch(msg,&data,&size);
238 if (r != MAIL_NO_ERROR) { 236 if (r != MAIL_NO_ERROR) {
239 Global::statusMessage(tr("Error fetching mail %i").arg(mail->getNumber())); 237 Global::statusMessage(tr("Error fetching mail %i").arg(mail->getNumber()));
240 if (msg) mailmessage_free(msg); 238 if (msg) mailmessage_free(msg);
241 return 0; 239 return 0;
242 } 240 }
243 result = new encodedString(data,size); 241 result = new encodedString(data,size);
244 if (msg) mailmessage_free(msg); 242 if (msg) mailmessage_free(msg);
245 return result; 243 return result;
246} 244}
247 245
248void MHwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target) 246void MHwrapper::deleteMails(const QString & mailbox,const QValueList<RecMailP> &target)
249{ 247{
250 QString f = buildPath(mailbox); 248 QString f = buildPath(mailbox);
251 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1()); 249 int r = mailsession_select_folder(m_storage->sto_session,(char*)f.latin1());
252 if (r!=MAIL_NO_ERROR) { 250 if (r!=MAIL_NO_ERROR) {
253 qDebug("deleteMails: error selecting folder!"); 251 qDebug("deleteMails: error selecting folder!");
254 return; 252 return;
255 } 253 }
256 QValueList<RecMailP>::ConstIterator it; 254 QValueList<RecMailP>::ConstIterator it;
257 for (it=target.begin(); it!=target.end();++it) { 255 for (it=target.begin(); it!=target.end();++it) {
258 r = mailsession_remove_message(m_storage->sto_session,(*it)->getNumber()); 256 r = mailsession_remove_message(m_storage->sto_session,(*it)->getNumber());
259 if (r != MAIL_NO_ERROR) { 257 if (r != MAIL_NO_ERROR) {
260 qDebug("error deleting mail"); 258 qDebug("error deleting mail");
261 break; 259 break;
262 } 260 }
263 } 261 }
264} 262}
265 263
266int MHwrapper::deleteAllMail(const FolderP&tfolder) 264int MHwrapper::deleteAllMail(const FolderP&tfolder)
267{ 265{
268 init_storage(); 266 init_storage();
269 if (!m_storage) { 267 if (!m_storage) {
270 return 0; 268 return 0;
271 } 269 }
272 int res = 1; 270 int res = 1;
273 if (!tfolder) return 0; 271 if (!tfolder) return 0;
274 int r = mailsession_select_folder(m_storage->sto_session,(char*)tfolder->getName().latin1()); 272 int r = mailsession_select_folder(m_storage->sto_session,(char*)tfolder->getName().latin1());
275 if (r!=MAIL_NO_ERROR) { 273 if (r!=MAIL_NO_ERROR) {
276 qDebug("error selecting folder!"); 274 qDebug("error selecting folder!");
277 return 0; 275 return 0;
278 } 276 }
279 mailmessage_list*l=0; 277 mailmessage_list*l=0;
280 r = mailsession_get_messages_list(m_storage->sto_session,&l); 278 r = mailsession_get_messages_list(m_storage->sto_session,&l);
281 if (r != MAIL_NO_ERROR) { 279 if (r != MAIL_NO_ERROR) {
282 qDebug("Error message list"); 280 qDebug("Error message list");
283 res = 0; 281 res = 0;
284 } 282 }
285 unsigned j = 0; 283 unsigned j = 0;
286 for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) { 284 for(unsigned int i = 0 ; l!= 0 && res==1 && i < carray_count(l->msg_tab) ; ++i) {
287 mailmessage * msg; 285 mailmessage * msg;
288 msg = (mailmessage*)carray_get(l->msg_tab, i); 286 msg = (mailmessage*)carray_get(l->msg_tab, i);
289 j = msg->msg_index; 287 j = msg->msg_index;
290 r = mailsession_remove_message(m_storage->sto_session,j); 288 r = mailsession_remove_message(m_storage->sto_session,j);
291 if (r != MAIL_NO_ERROR) { 289 if (r != MAIL_NO_ERROR) {
292 Global::statusMessage(tr("Error deleting mail %1").arg(i+1)); 290 Global::statusMessage(tr("Error deleting mail %1").arg(i+1));
293 res = 0; 291 res = 0;
294 break; 292 break;
295 } 293 }
296 } 294 }
297 if (l) mailmessage_list_free(l); 295 if (l) mailmessage_list_free(l);
298 return res; 296 return res;
299} 297}
300 298
301int MHwrapper::deleteMbox(const FolderP&tfolder) 299int MHwrapper::deleteMbox(const FolderP&tfolder)
302{ 300{
303 init_storage(); 301 init_storage();
304 if (!m_storage) { 302 if (!m_storage) {
305 return 0; 303 return 0;
306 } 304 }
307 if (!tfolder) return 0; 305 if (!tfolder) return 0;
308 if (tfolder->getName()=="/" || tfolder->getName().isEmpty()) return 0; 306 if (tfolder->getName()=="/" || tfolder->getName().isEmpty()) return 0;
309 307
310 int r = mailsession_delete_folder(m_storage->sto_session,(char*)tfolder->getName().latin1()); 308 int r = mailsession_delete_folder(m_storage->sto_session,(char*)tfolder->getName().latin1());
311 309
312 if (r != MAIL_NO_ERROR) { 310 if (r != MAIL_NO_ERROR) {
313 qDebug("error deleting mail box"); 311 qDebug("error deleting mail box");
314 return 0; 312 return 0;
315 } 313 }
316 QString cmd = "rm -rf "+tfolder->getName(); 314 QString cmd = "rm -rf "+tfolder->getName();
317 QStringList command; 315 QStringList command;
318 command << "/bin/sh"; 316 command << "/bin/sh";
319 command << "-c"; 317 command << "-c";
320 command << cmd.latin1(); 318 command << cmd.latin1();
321 OProcess *process = new OProcess(); 319 OProcess *process = new OProcess();
322 320
323 connect(process, SIGNAL(processExited(Opie::Core::OProcess*)), 321 connect(process, SIGNAL(processExited(Opie::Core::OProcess*)),
324 this, SLOT( processEnded(OProcess*))); 322 this, SLOT( processEnded(Opie::Core::OProcess*)));
325 connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)), 323 connect(process, SIGNAL( receivedStderr(Opie::Core::OProcess*,char*,int)),
326 this, SLOT( oprocessStderr(OProcess*,char*,int))); 324 this, SLOT( oprocessStderr(Opie::Core::OProcess*,char*,int)));
327 325
328 *process << command; 326 *process << command;
329 removeMboxfailed = false; 327 removeMboxfailed = false;
330 if(!process->start(OProcess::Block, OProcess::All) ) { 328 if(!process->start(OProcess::Block, OProcess::All) ) {
331 qDebug("could not start process"); 329 qDebug("could not start process");
332 return 0; 330 return 0;
333 } 331 }
334 qDebug("mail box deleted"); 332 qDebug("mail box deleted");
335 return 1; 333 return 1;
336} 334}
337 335
338void MHwrapper::processEnded(OProcess *p) 336void MHwrapper::processEnded(OProcess *p)
339{ 337{
340 if (p) delete p; 338 if (p) delete p;
341} 339}
342 340
343void MHwrapper::oprocessStderr(OProcess*, char *buffer, int ) 341void MHwrapper::oprocessStderr(OProcess*, char *buffer, int )
344{ 342{
345 QString lineStr = buffer; 343 QString lineStr = buffer;
346 QMessageBox::warning( 0, tr("Error"), lineStr ,tr("Ok") ); 344 QMessageBox::warning( 0, tr("Error"), lineStr ,tr("Ok") );
347 removeMboxfailed = true; 345 removeMboxfailed = true;
348} 346}
349 347
350void MHwrapper::statusFolder(folderStat&target_stat,const QString & mailbox) 348void MHwrapper::statusFolder(folderStat&target_stat,const QString & mailbox)
351{ 349{
352 init_storage(); 350 init_storage();
353 if (!m_storage) { 351 if (!m_storage) {
354 return; 352 return;
355 } 353 }
356 target_stat.message_count = 0; 354 target_stat.message_count = 0;
357 target_stat.message_unseen = 0; 355 target_stat.message_unseen = 0;
358 target_stat.message_recent = 0; 356 target_stat.message_recent = 0;
359 QString f = buildPath(mailbox); 357 QString f = buildPath(mailbox);
360 int r = mailsession_status_folder(m_storage->sto_session,(char*)f.latin1(),&target_stat.message_count, 358 int r = mailsession_status_folder(m_storage->sto_session,(char*)f.latin1(),&target_stat.message_count,
361 &target_stat.message_recent,&target_stat.message_unseen); 359 &target_stat.message_recent,&target_stat.message_unseen);
362 if (r != MAIL_NO_ERROR) { 360 if (r != MAIL_NO_ERROR) {
363 Global::statusMessage(tr("Error retrieving status")); 361 Global::statusMessage(tr("Error retrieving status"));
364 } 362 }
365} 363}
366 364
367MAILLIB::ATYPE MHwrapper::getType()const 365MAILLIB::ATYPE MHwrapper::getType()const
368{ 366{
369 return MAILLIB::A_MH; 367 return MAILLIB::A_MH;
370} 368}
371 369
372const QString&MHwrapper::getName()const 370const QString&MHwrapper::getName()const
373{ 371{
374 return MHName; 372 return MHName;
375} 373}
376void MHwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) 374void MHwrapper::mvcpMail(const RecMailP&mail,const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
377{ 375{
378 init_storage(); 376 init_storage();
379 if (!m_storage) { 377 if (!m_storage) {
380 return; 378 return;
381 } 379 }
382 if (targetWrapper != this) { 380 if (targetWrapper != this) {
383 qDebug("Using generic"); 381 qDebug("Using generic");
384 Genericwrapper::mvcpMail(mail,targetFolder,targetWrapper,moveit); 382 Genericwrapper::mvcpMail(mail,targetFolder,targetWrapper,moveit);
385 return; 383 return;
386 } 384 }
387 qDebug("Using internal routines for move/copy"); 385 qDebug("Using internal routines for move/copy");
388 QString tf = buildPath(targetFolder); 386 QString tf = buildPath(targetFolder);
389 int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1()); 387 int r = mailsession_select_folder(m_storage->sto_session,(char*)mail->getMbox().latin1());
390 if (r != MAIL_NO_ERROR) { 388 if (r != MAIL_NO_ERROR) {
391 qDebug("Error selecting source mailbox"); 389 qDebug("Error selecting source mailbox");
392 return; 390 return;
393 } 391 }
394 if (moveit) { 392 if (moveit) {
395 r = mailsession_move_message(m_storage->sto_session,mail->getNumber(),(char*)tf.latin1()); 393 r = mailsession_move_message(m_storage->sto_session,mail->getNumber(),(char*)tf.latin1());
396 } else { 394 } else {
397 r = mailsession_copy_message(m_storage->sto_session,mail->getNumber(),(char*)tf.latin1()); 395 r = mailsession_copy_message(m_storage->sto_session,mail->getNumber(),(char*)tf.latin1());
398 } 396 }
399 if (r != MAIL_NO_ERROR) { 397 if (r != MAIL_NO_ERROR) {
400 qDebug("Error copy/moving mail internal (%i)",r); 398 qDebug("Error copy/moving mail internal (%i)",r);
401 } 399 }
402} 400}
403 401
404void MHwrapper::mvcpAllMails(const FolderP&fromFolder, 402void MHwrapper::mvcpAllMails(const FolderP&fromFolder,
405 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit) 403 const QString&targetFolder,AbstractMail*targetWrapper,bool moveit)
406{ 404{
407 init_storage(); 405 init_storage();
408 if (!m_storage) { 406 if (!m_storage) {
409 return; 407 return;
410 } 408 }
411 if (targetWrapper != this) { 409 if (targetWrapper != this) {
412 qDebug("Using generic"); 410 qDebug("Using generic");
413 Genericwrapper::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit); 411 Genericwrapper::mvcpAllMails(fromFolder,targetFolder,targetWrapper,moveit);
414 return; 412 return;
415 } 413 }
416 if (!fromFolder) return; 414 if (!fromFolder) return;
417 int r = mailsession_select_folder(m_storage->sto_session,(char*)fromFolder->getName().latin1()); 415 int r = mailsession_select_folder(m_storage->sto_session,(char*)fromFolder->getName().latin1());
418 if (r!=MAIL_NO_ERROR) { 416 if (r!=MAIL_NO_ERROR) {
419 qDebug("error selecting source folder!"); 417 qDebug("error selecting source folder!");
420 return; 418 return;
421 } 419 }
422 QString tf = buildPath(targetFolder); 420 QString tf = buildPath(targetFolder);
423 mailmessage_list*l=0; 421 mailmessage_list*l=0;
424 r = mailsession_get_messages_list(m_storage->sto_session,&l); 422 r = mailsession_get_messages_list(m_storage->sto_session,&l);
425 if (r != MAIL_NO_ERROR) { 423 if (r != MAIL_NO_ERROR) {
426 qDebug("Error message list"); 424 qDebug("Error message list");
427 } 425 }
428 unsigned j = 0; 426 unsigned j = 0;
429 for(unsigned int i = 0 ; l!= 0 && i < carray_count(l->msg_tab) ; ++i) { 427 for(unsigned int i = 0 ; l!= 0 && i < carray_count(l->msg_tab) ; ++i) {
430 mailmessage * msg; 428 mailmessage * msg;
431 msg = (mailmessage*)carray_get(l->msg_tab, i); 429 msg = (mailmessage*)carray_get(l->msg_tab, i);
432 j = msg->msg_index; 430 j = msg->msg_index;
433 if (moveit) { 431 if (moveit) {
434 r = mailsession_move_message(m_storage->sto_session,j,(char*)tf.latin1()); 432 r = mailsession_move_message(m_storage->sto_session,j,(char*)tf.latin1());
435 } else { 433 } else {
436 r = mailsession_copy_message(m_storage->sto_session,j,(char*)tf.latin1()); 434 r = mailsession_copy_message(m_storage->sto_session,j,(char*)tf.latin1());
437 } 435 }
438 if (r != MAIL_NO_ERROR) { 436 if (r != MAIL_NO_ERROR) {
439 qDebug("Error copy/moving mail internal (%i)",r); 437 qDebug("Error copy/moving mail internal (%i)",r);
440 break; 438 break;
441 } 439 }
442 } 440 }
443 if (l) mailmessage_list_free(l); 441 if (l) mailmessage_list_free(l);
444} 442}
diff --git a/noncore/net/opietooth/lib/device.cc b/noncore/net/opietooth/lib/device.cc
index d913853..18d26e4 100644
--- a/noncore/net/opietooth/lib/device.cc
+++ b/noncore/net/opietooth/lib/device.cc
@@ -1,153 +1,152 @@
1 1
2#include <signal.h> 2#include <signal.h>
3 3
4#include <opie2/oprocess.h> 4#include <opie2/oprocess.h>
5 5
6#include "device.h" 6#include "device.h"
7 7
8using namespace OpieTooth; 8using namespace OpieTooth;
9 9
10using namespace Opie::Core; 10using namespace Opie::Core;
11using namespace Opie::Core;
12namespace { 11namespace {
13 int parsePid( const QCString& par ){ 12 int parsePid( const QCString& par ){
14 int id=0; 13 int id=0;
15 QString string( par ); 14 QString string( par );
16 QStringList list = QStringList::split( '\n', string ); 15 QStringList list = QStringList::split( '\n', string );
17 for( QStringList::Iterator it = list.begin(); it != list.end(); ++it ){ 16 for( QStringList::Iterator it = list.begin(); it != list.end(); ++it ){
18 qWarning("parsePID: %s", (*it).latin1() ); 17 qWarning("parsePID: %s", (*it).latin1() );
19 if( !(*it).startsWith("CSR") ){ 18 if( !(*it).startsWith("CSR") ){
20 id = (*it).toInt(); 19 id = (*it).toInt();
21 break; 20 break;
22 } 21 }
23 } 22 }
24 return id; 23 return id;
25 } 24 }
26} 25}
27 26
28Device::Device(const QString &device, const QString &mode, const QString &speed ) 27Device::Device(const QString &device, const QString &mode, const QString &speed )
29 : QObject(0, "device") { 28 : QObject(0, "device") {
30 29
31 qWarning("OpieTooth::Device create" ); 30 qWarning("OpieTooth::Device create" );
32 m_hci = 0; 31 m_hci = 0;
33 m_process = 0; 32 m_process = 0;
34 m_attached = false; 33 m_attached = false;
35 m_device = device; 34 m_device = device;
36 m_mode = mode; 35 m_mode = mode;
37 m_speed = speed; 36 m_speed = speed;
38 attach(); 37 attach();
39} 38}
40Device::~Device(){ 39Device::~Device(){
41 detach(); 40 detach();
42} 41}
43void Device::attach(){ 42void Device::attach(){
44 qWarning("attaching %s %s %s", m_device.latin1(), m_mode.latin1(), m_speed.latin1() ); 43 qWarning("attaching %s %s %s", m_device.latin1(), m_mode.latin1(), m_speed.latin1() );
45 if(m_process == 0 ){ 44 if(m_process == 0 ){
46 m_output.resize(0); 45 m_output.resize(0);
47 qWarning("new process to create" ); 46 qWarning("new process to create" );
48 m_process = new OProcess(); 47 m_process = new OProcess();
49 *m_process << "hciattach"; 48 *m_process << "hciattach";
50 *m_process << "-p"; 49 *m_process << "-p";
51 *m_process << m_device << m_mode << m_speed; 50 *m_process << m_device << m_mode << m_speed;
52 connect(m_process, SIGNAL( processExited(Opie::Core::OProcess*) ), 51 connect(m_process, SIGNAL( processExited(Opie::Core::OProcess*) ),
53 this, SLOT( slotExited(OProcess* ) ) ); 52 this, SLOT( slotExited(Opie::Core::OProcess* ) ) );
54 connect(m_process, SIGNAL( receivedStdout(Opie::Core::OProcess*, char*, int) ), 53 connect(m_process, SIGNAL( receivedStdout(Opie::Core::OProcess*, char*, int) ),
55 this, SLOT(slotStdOut(OProcess*,char*,int ) ) ); 54 this, SLOT(slotStdOut(Opie::Core::OProcess*,char*,int ) ) );
56 connect(m_process, SIGNAL(receivedStderr(Opie::Core::OProcess*, char*, int ) ), 55 connect(m_process, SIGNAL(receivedStderr(Opie::Core::OProcess*, char*, int ) ),
57 this, SLOT(slotStdErr(OProcess*,char*,int) ) ); 56 this, SLOT(slotStdErr(Opie::Core::OProcess*,char*,int) ) );
58 if(!m_process->start(OProcess::NotifyOnExit, OProcess::AllOutput ) ){ 57 if(!m_process->start(OProcess::NotifyOnExit, OProcess::AllOutput ) ){
59 qWarning("Could not start" ); 58 qWarning("Could not start" );
60 delete m_process; 59 delete m_process;
61 m_process = 0; 60 m_process = 0;
62 } 61 }
63 }; 62 };
64} 63}
65void Device::detach(){ 64void Device::detach(){
66 delete m_hci; 65 delete m_hci;
67 delete m_process; 66 delete m_process;
68 // kill the pid we got 67 // kill the pid we got
69 if(m_attached ){ 68 if(m_attached ){
70 //kill the pid 69 //kill the pid
71 qWarning( "killing" ); 70 qWarning( "killing" );
72 kill(pid, 9); 71 kill(pid, 9);
73 } 72 }
74 qWarning("detached" ); 73 qWarning("detached" );
75} 74}
76bool Device::isLoaded()const{ 75bool Device::isLoaded()const{
77 return m_attached; 76 return m_attached;
78} 77}
79QString Device::devName()const { 78QString Device::devName()const {
80 return QString::fromLatin1("hci0"); 79 return QString::fromLatin1("hci0");
81}; 80};
82void Device::slotExited( OProcess* proc) 81void Device::slotExited( OProcess* proc)
83{ 82{
84 qWarning("prcess exited" ); 83 qWarning("prcess exited" );
85 if(proc== m_process ){ 84 if(proc== m_process ){
86 qWarning("proc == m_process" ); 85 qWarning("proc == m_process" );
87 if( m_process->normalExit() ){ // normal exit 86 if( m_process->normalExit() ){ // normal exit
88 qWarning("normalExit" ); 87 qWarning("normalExit" );
89 int ret = m_process->exitStatus(); 88 int ret = m_process->exitStatus();
90 if( ret == 0 ){ // attached 89 if( ret == 0 ){ // attached
91 qWarning("attached" ); 90 qWarning("attached" );
92 qWarning("Output: %s", m_output.data() ); 91 qWarning("Output: %s", m_output.data() );
93 pid = parsePid( m_output ); 92 pid = parsePid( m_output );
94 qWarning("Pid = %d", pid ); 93 qWarning("Pid = %d", pid );
95 // now hciconfig hci0 up ( determine hciX FIXME) 94 // now hciconfig hci0 up ( determine hciX FIXME)
96 // and call hciconfig hci0 up 95 // and call hciconfig hci0 up
97 // FIXME hardcoded to hci0 now :( 96 // FIXME hardcoded to hci0 now :(
98 m_hci = new OProcess( ); 97 m_hci = new OProcess( );
99 *m_hci << "hciconfig"; 98 *m_hci << "hciconfig";
100 *m_hci << "hci0 up"; 99 *m_hci << "hci0 up";
101 connect(m_hci, SIGNAL( processExited(Opie::Core::OProcess*) ), 100 connect(m_hci, SIGNAL( processExited(Opie::Core::OProcess*) ),
102 this, SLOT( slotExited(OProcess* ) ) ); 101 this, SLOT( slotExited(Opie::Core::OProcess* ) ) );
103 if(!m_hci->start() ){ 102 if(!m_hci->start() ){
104 qWarning("could not start" ); 103 qWarning("could not start" );
105 m_attached = false; 104 m_attached = false;
106 emit device("hci0", false ); 105 emit device("hci0", false );
107 } 106 }
108 }else{ 107 }else{
109 qWarning("crass" ); 108 qWarning("crass" );
110 m_attached = false; 109 m_attached = false;
111 emit device("hci0", false ); 110 emit device("hci0", false );
112 111
113 } 112 }
114 } 113 }
115 delete m_process; 114 delete m_process;
116 m_process = 0; 115 m_process = 0;
117 }else if(proc== m_hci ){ 116 }else if(proc== m_hci ){
118 qWarning("M HCI exited" ); 117 qWarning("M HCI exited" );
119 if( m_hci->normalExit() ){ 118 if( m_hci->normalExit() ){
120 qWarning("normal exit" ); 119 qWarning("normal exit" );
121 int ret = m_hci->exitStatus(); 120 int ret = m_hci->exitStatus();
122 if( ret == 0 ){ 121 if( ret == 0 ){
123 qWarning("attached really really attached" ); 122 qWarning("attached really really attached" );
124 m_attached = true; 123 m_attached = true;
125 emit device("hci0", true ); 124 emit device("hci0", true );
126 }else{ 125 }else{
127 qWarning( "failed" ); 126 qWarning( "failed" );
128 emit device("hci0", false ); 127 emit device("hci0", false );
129 m_attached = false; 128 m_attached = false;
130 } 129 }
131 }// normal exit 130 }// normal exit
132 delete m_hci; 131 delete m_hci;
133 m_hci = 0; 132 m_hci = 0;
134 } 133 }
135} 134}
136void Device::slotStdOut(OProcess* proc, char* chars, int len) 135void Device::slotStdOut(OProcess* proc, char* chars, int len)
137{ 136{
138 qWarning("std out" ); 137 qWarning("std out" );
139 if( len <1 ){ 138 if( len <1 ){
140 qWarning( "len < 1 " ); 139 qWarning( "len < 1 " );
141 return; 140 return;
142 } 141 }
143 if(proc == m_process ){ 142 if(proc == m_process ){
144 QCString string( chars, len+1 ); // \0 == +1 143 QCString string( chars, len+1 ); // \0 == +1
145 qWarning("output: %s", string.data() ); 144 qWarning("output: %s", string.data() );
146 m_output.append( string.data() ); 145 m_output.append( string.data() );
147 } 146 }
148} 147}
149void Device::slotStdErr(OProcess* proc, char* chars, int len) 148void Device::slotStdErr(OProcess* proc, char* chars, int len)
150{ 149{
151 qWarning("std err" ); 150 qWarning("std err" );
152 slotStdOut( proc, chars, len ); 151 slotStdOut( proc, chars, len );
153} 152}
diff --git a/noncore/net/opietooth/lib/manager.cc b/noncore/net/opietooth/lib/manager.cc
index 56156a8..7c9ea5b 100644
--- a/noncore/net/opietooth/lib/manager.cc
+++ b/noncore/net/opietooth/lib/manager.cc
@@ -1,336 +1,336 @@
1 1
2 2
3#include <opie2/oprocess.h> 3#include <opie2/oprocess.h>
4 4
5#include "parser.h" 5#include "parser.h"
6#include "manager.h" 6#include "manager.h"
7 7
8 8
9using namespace OpieTooth; 9using namespace OpieTooth;
10 10
11using namespace Opie::Core; 11using namespace Opie::Core;
12using namespace Opie::Core; 12using namespace Opie::Core;
13Manager::Manager( const QString& dev ) 13Manager::Manager( const QString& dev )
14 : QObject() 14 : QObject()
15{ 15{
16 qWarning("created"); 16 qWarning("created");
17 m_device = dev; 17 m_device = dev;
18 m_hcitool = 0; 18 m_hcitool = 0;
19 m_sdp = 0; 19 m_sdp = 0;
20} 20}
21Manager::Manager( Device* /*dev*/ ) 21Manager::Manager( Device* /*dev*/ )
22 : QObject() 22 : QObject()
23{ 23{
24 m_hcitool = 0; 24 m_hcitool = 0;
25 m_sdp = 0; 25 m_sdp = 0;
26} 26}
27Manager::Manager() 27Manager::Manager()
28 : QObject() 28 : QObject()
29{ 29{
30 m_hcitool = 0; 30 m_hcitool = 0;
31 m_sdp = 0; 31 m_sdp = 0;
32} 32}
33Manager::~Manager(){ 33Manager::~Manager(){
34 delete m_hcitool; 34 delete m_hcitool;
35 delete m_sdp; 35 delete m_sdp;
36} 36}
37void Manager::setDevice( const QString& dev ){ 37void Manager::setDevice( const QString& dev ){
38 m_device = dev; 38 m_device = dev;
39} 39}
40void Manager::setDevice( Device* /*dev*/ ){ 40void Manager::setDevice( Device* /*dev*/ ){
41 41
42} 42}
43void Manager::isAvailable( const QString& device ){ 43void Manager::isAvailable( const QString& device ){
44 OProcess* l2ping = new OProcess(); 44 OProcess* l2ping = new OProcess();
45 l2ping->setName( device.latin1() ); 45 l2ping->setName( device.latin1() );
46 *l2ping << "l2ping" << "-c1" << device; 46 *l2ping << "l2ping" << "-c1" << device;
47 connect(l2ping, SIGNAL(processExited(Opie::Core::OProcess* ) ), 47 connect(l2ping, SIGNAL(processExited(Opie::Core::OProcess* ) ),
48 this, SLOT(slotProcessExited(OProcess*) ) ); 48 this, SLOT(slotProcessExited(Opie::Core::OProcess*) ) );
49 if (!l2ping->start() ) { 49 if (!l2ping->start() ) {
50 emit available( device, false ); 50 emit available( device, false );
51 delete l2ping; 51 delete l2ping;
52 } 52 }
53 53
54} 54}
55 55
56void Manager::isAvailable( Device* /*dev*/ ){ 56void Manager::isAvailable( Device* /*dev*/ ){
57 57
58 58
59} 59}
60void Manager::searchDevices( const QString& device ){ 60void Manager::searchDevices( const QString& device ){
61 qWarning("search devices"); 61 qWarning("search devices");
62 OProcess* hcitool = new OProcess(); 62 OProcess* hcitool = new OProcess();
63 hcitool->setName( device.isEmpty() ? "hci0" : device.latin1() ); 63 hcitool->setName( device.isEmpty() ? "hci0" : device.latin1() );
64 *hcitool << "hcitool" << "scan"; 64 *hcitool << "hcitool" << "scan";
65 connect( hcitool, SIGNAL(processExited(Opie::Core::OProcess*) ) , 65 connect( hcitool, SIGNAL(processExited(Opie::Core::OProcess*) ) ,
66 this, SLOT(slotHCIExited(OProcess* ) ) ); 66 this, SLOT(slotHCIExited(Opie::Core::OProcess* ) ) );
67 connect( hcitool, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int ) ), 67 connect( hcitool, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int ) ),
68 this, SLOT(slotHCIOut(OProcess*, char*, int ) ) ); 68 this, SLOT(slotHCIOut(Opie::Core::OProcess*, char*, int ) ) );
69 if (!hcitool->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { 69 if (!hcitool->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
70 qWarning("could not start"); 70 qWarning("could not start");
71 RemoteDevice::ValueList list; 71 RemoteDevice::ValueList list;
72 emit foundDevices( device, list ); 72 emit foundDevices( device, list );
73 delete hcitool; 73 delete hcitool;
74 } 74 }
75} 75}
76 76
77void Manager::searchDevices(Device* /*d*/ ){ 77void Manager::searchDevices(Device* /*d*/ ){
78 78
79 79
80} 80}
81void Manager::addService(const QString& name ){ 81void Manager::addService(const QString& name ){
82 OProcess proc; 82 OProcess proc;
83 proc << "sdptool" << "add" << name; 83 proc << "sdptool" << "add" << name;
84 bool bo = true; 84 bool bo = true;
85 if (!proc.start(OProcess::DontCare ) ) 85 if (!proc.start(OProcess::DontCare ) )
86 bo = false; 86 bo = false;
87 emit addedService( name, bo ); 87 emit addedService( name, bo );
88} 88}
89void Manager::addServices(const QStringList& list){ 89void Manager::addServices(const QStringList& list){
90 QStringList::ConstIterator it; 90 QStringList::ConstIterator it;
91 for (it = list.begin(); it != list.end(); ++it ) 91 for (it = list.begin(); it != list.end(); ++it )
92 addService( (*it) ); 92 addService( (*it) );
93} 93}
94void Manager::removeService( const QString& name ){ 94void Manager::removeService( const QString& name ){
95 OProcess prc; 95 OProcess prc;
96 prc << "sdptool" << "del" << name; 96 prc << "sdptool" << "del" << name;
97 bool bo = true; 97 bool bo = true;
98 if (!prc.start(OProcess::DontCare ) ) 98 if (!prc.start(OProcess::DontCare ) )
99 bo = false; 99 bo = false;
100 emit removedService( name, bo ); 100 emit removedService( name, bo );
101} 101}
102void Manager::removeServices( const QStringList& list){ 102void Manager::removeServices( const QStringList& list){
103 QStringList::ConstIterator it; 103 QStringList::ConstIterator it;
104 for (it = list.begin(); it != list.end(); ++it ) 104 for (it = list.begin(); it != list.end(); ++it )
105 removeService( (*it) ); 105 removeService( (*it) );
106} 106}
107void Manager::searchServices( const QString& remDevice ){ 107void Manager::searchServices( const QString& remDevice ){
108 OProcess *m_sdp =new OProcess(); 108 OProcess *m_sdp =new OProcess();
109 *m_sdp << "sdptool" << "browse" << remDevice; 109 *m_sdp << "sdptool" << "browse" << remDevice;
110 m_sdp->setName( remDevice.latin1() ); 110 m_sdp->setName( remDevice.latin1() );
111 qWarning("search Services for %s", remDevice.latin1() ); 111 qWarning("search Services for %s", remDevice.latin1() );
112 connect(m_sdp, SIGNAL(processExited(Opie::Core::OProcess*) ), 112 connect(m_sdp, SIGNAL(processExited(Opie::Core::OProcess*) ),
113 this, SLOT(slotSDPExited(OProcess* ) ) ); 113 this, SLOT(slotSDPExited(Opie::Core::OProcess* ) ) );
114 connect(m_sdp, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int ) ), 114 connect(m_sdp, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int ) ),
115 this, SLOT(slotSDPOut(OProcess*, char*, int) ) ); 115 this, SLOT(slotSDPOut(Opie::Core::OProcess*, char*, int) ) );
116 if (!m_sdp->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { 116 if (!m_sdp->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
117 qWarning("could not start sdptool" ); 117 qWarning("could not start sdptool" );
118 delete m_sdp; 118 delete m_sdp;
119 Services::ValueList list; 119 Services::ValueList list;
120 emit foundServices( remDevice, list ); 120 emit foundServices( remDevice, list );
121 } 121 }
122} 122}
123void Manager::searchServices( const RemoteDevice& dev){ 123void Manager::searchServices( const RemoteDevice& dev){
124 searchServices( dev.mac() ); 124 searchServices( dev.mac() );
125} 125}
126QString Manager::toDevice( const QString& /*mac*/ ){ 126QString Manager::toDevice( const QString& /*mac*/ ){
127 return QString::null; 127 return QString::null;
128} 128}
129QString Manager::toMac( const QString &/*device*/ ){ 129QString Manager::toMac( const QString &/*device*/ ){
130 return QString::null; 130 return QString::null;
131} 131}
132void Manager::slotProcessExited(OProcess* proc ) { 132void Manager::slotProcessExited(OProcess* proc ) {
133 bool conn= false; 133 bool conn= false;
134 if (proc->normalExit() && proc->exitStatus() == 0 ) 134 if (proc->normalExit() && proc->exitStatus() == 0 )
135 conn = true; 135 conn = true;
136 136
137 QString name = QString::fromLatin1(proc->name() ); 137 QString name = QString::fromLatin1(proc->name() );
138 emit available( name, conn ); 138 emit available( name, conn );
139 delete proc; 139 delete proc;
140} 140}
141void Manager::slotSDPOut(OProcess* proc, char* ch, int len) 141void Manager::slotSDPOut(OProcess* proc, char* ch, int len)
142{ 142{
143 QCString str(ch, len+1 ); 143 QCString str(ch, len+1 );
144 qWarning("SDP:%s", str.data() ); 144 qWarning("SDP:%s", str.data() );
145 QMap<QString, QString>::Iterator it; 145 QMap<QString, QString>::Iterator it;
146 it = m_out.find(proc->name() ); 146 it = m_out.find(proc->name() );
147 QString string; 147 QString string;
148 if ( it != m_out.end() ) { 148 if ( it != m_out.end() ) {
149 string = it.data(); 149 string = it.data();
150 } 150 }
151 string.append( str ); 151 string.append( str );
152 m_out.replace( proc->name(), string ); 152 m_out.replace( proc->name(), string );
153 153
154} 154}
155void Manager::slotSDPExited( OProcess* proc) 155void Manager::slotSDPExited( OProcess* proc)
156{ 156{
157 qWarning("proc name %s", proc->name() ); 157 qWarning("proc name %s", proc->name() );
158 Services::ValueList list; 158 Services::ValueList list;
159 if (proc->normalExit() ) { 159 if (proc->normalExit() ) {
160 QMap<QString, QString>::Iterator it = m_out.find( proc->name() ); 160 QMap<QString, QString>::Iterator it = m_out.find( proc->name() );
161 if ( it != m_out.end() ) { 161 if ( it != m_out.end() ) {
162 qWarning("found process" ); 162 qWarning("found process" );
163 list = parseSDPOutput( it.data() ); 163 list = parseSDPOutput( it.data() );
164 m_out.remove( it ); 164 m_out.remove( it );
165 } 165 }
166 } 166 }
167 emit foundServices( proc->name(), list ); 167 emit foundServices( proc->name(), list );
168 delete proc; 168 delete proc;
169} 169}
170Services::ValueList Manager::parseSDPOutput( const QString& out ) { 170Services::ValueList Manager::parseSDPOutput( const QString& out ) {
171 Services::ValueList list; 171 Services::ValueList list;
172 qWarning("parsing output" ); 172 qWarning("parsing output" );
173 Parser parser( out ); 173 Parser parser( out );
174 list = parser.services(); 174 list = parser.services();
175 return list; 175 return list;
176} 176}
177 177
178void Manager::slotHCIExited(OProcess* proc ) { 178void Manager::slotHCIExited(OProcess* proc ) {
179 qWarning("process exited"); 179 qWarning("process exited");
180 RemoteDevice::ValueList list; 180 RemoteDevice::ValueList list;
181 if (proc->normalExit() ) { 181 if (proc->normalExit() ) {
182 qWarning("normalExit %s", proc->name() ); 182 qWarning("normalExit %s", proc->name() );
183 QMap<QString, QString>::Iterator it = m_devices.find(proc->name() ); 183 QMap<QString, QString>::Iterator it = m_devices.find(proc->name() );
184 if (it != m_devices.end() ) { 184 if (it != m_devices.end() ) {
185 qWarning("!= end ;)"); 185 qWarning("!= end ;)");
186 list = parseHCIOutput( it.data() ); 186 list = parseHCIOutput( it.data() );
187 m_devices.remove( it ); 187 m_devices.remove( it );
188 } 188 }
189 } 189 }
190 emit foundDevices( proc->name(), list ); 190 emit foundDevices( proc->name(), list );
191 delete proc; 191 delete proc;
192} 192}
193void Manager::slotHCIOut(OProcess* proc, char* ch, int len) { 193void Manager::slotHCIOut(OProcess* proc, char* ch, int len) {
194 QCString str( ch, len+1 ); 194 QCString str( ch, len+1 );
195 qWarning("hci: %s", str.data() ); 195 qWarning("hci: %s", str.data() );
196 QMap<QString, QString>::Iterator it; 196 QMap<QString, QString>::Iterator it;
197 it = m_devices.find( proc->name() ); 197 it = m_devices.find( proc->name() );
198 qWarning("proc->name %s", proc->name() ); 198 qWarning("proc->name %s", proc->name() );
199 QString string; 199 QString string;
200 if (it != m_devices.end() ) { 200 if (it != m_devices.end() ) {
201 qWarning("slotHCIOut "); 201 qWarning("slotHCIOut ");
202 string = it.data(); 202 string = it.data();
203 } 203 }
204 string.append( str ); 204 string.append( str );
205 205
206 m_devices.replace( proc->name(), string ); 206 m_devices.replace( proc->name(), string );
207} 207}
208RemoteDevice::ValueList Manager::parseHCIOutput(const QString& output ) { 208RemoteDevice::ValueList Manager::parseHCIOutput(const QString& output ) {
209 qWarning("parseHCI %s", output.latin1() ); 209 qWarning("parseHCI %s", output.latin1() );
210 RemoteDevice::ValueList list; 210 RemoteDevice::ValueList list;
211 QStringList strList = QStringList::split('\n', output ); 211 QStringList strList = QStringList::split('\n', output );
212 QStringList::Iterator it; 212 QStringList::Iterator it;
213 QString str; 213 QString str;
214 for ( it = strList.begin(); it != strList.end(); ++it ) { 214 for ( it = strList.begin(); it != strList.end(); ++it ) {
215 str = (*it).stripWhiteSpace(); 215 str = (*it).stripWhiteSpace();
216 qWarning("OpieTooth %s", str.latin1() ); 216 qWarning("OpieTooth %s", str.latin1() );
217 int pos = str.findRev(':' ); 217 int pos = str.findRev(':' );
218 if ( pos > 0 ) { 218 if ( pos > 0 ) {
219 QString mac = str.left(17 ); 219 QString mac = str.left(17 );
220 str.remove( 0, 17 ); 220 str.remove( 0, 17 );
221 qWarning("mac %s", mac.latin1() ); 221 qWarning("mac %s", mac.latin1() );
222 qWarning("rest:%s", str.latin1() ); 222 qWarning("rest:%s", str.latin1() );
223 RemoteDevice rem( mac , str.stripWhiteSpace() ); 223 RemoteDevice rem( mac , str.stripWhiteSpace() );
224 list.append( rem ); 224 list.append( rem );
225 } 225 }
226 } 226 }
227 return list; 227 return list;
228} 228}
229 229
230////// hcitool cc and hcitool con 230////// hcitool cc and hcitool con
231 231
232/** 232/**
233 * Create it on the stack as don't care 233 * Create it on the stack as don't care
234 * so we don't need to care for it 234 * so we don't need to care for it
235 * cause hcitool gets reparented 235 * cause hcitool gets reparented
236 */ 236 */
237void Manager::connectTo( const QString& mac) { 237void Manager::connectTo( const QString& mac) {
238 OProcess proc; 238 OProcess proc;
239 proc << "hcitool"; 239 proc << "hcitool";
240 proc << "cc"; 240 proc << "cc";
241 proc << mac; 241 proc << mac;
242 proc.start(OProcess::DontCare); // the lib does not care at this point 242 proc.start(OProcess::DontCare); // the lib does not care at this point
243} 243}
244 244
245 245
246void Manager::searchConnections() { 246void Manager::searchConnections() {
247 qWarning("searching connections?"); 247 qWarning("searching connections?");
248 OProcess* proc = new OProcess(); 248 OProcess* proc = new OProcess();
249 m_hcitoolCon = QString::null; 249 m_hcitoolCon = QString::null;
250 250
251 connect(proc, SIGNAL(processExited(Opie::Core::OProcess*) ), 251 connect(proc, SIGNAL(processExited(Opie::Core::OProcess*) ),
252 this, SLOT(slotConnectionExited( OProcess*) ) ); 252 this, SLOT(slotConnectionExited( Opie::Core::OProcess*) ) );
253 connect(proc, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int) ), 253 connect(proc, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int) ),
254 this, SLOT(slotConnectionOutput(OProcess*, char*, int) ) ); 254 this, SLOT(slotConnectionOutput(Opie::Core::OProcess*, char*, int) ) );
255 *proc << "hcitool"; 255 *proc << "hcitool";
256 *proc << "con"; 256 *proc << "con";
257 257
258 if (!proc->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { 258 if (!proc->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
259 ConnectionState::ValueList list; 259 ConnectionState::ValueList list;
260 emit connections( list ); 260 emit connections( list );
261 delete proc; 261 delete proc;
262 } 262 }
263} 263}
264void Manager::slotConnectionExited( OProcess* proc ) { 264void Manager::slotConnectionExited( OProcess* proc ) {
265 ConnectionState::ValueList list; 265 ConnectionState::ValueList list;
266 list = parseConnections( m_hcitoolCon ); 266 list = parseConnections( m_hcitoolCon );
267 emit connections(list ); 267 emit connections(list );
268 delete proc; 268 delete proc;
269} 269}
270void Manager::slotConnectionOutput(OProcess* /*proc*/, char* cha, int len) { 270void Manager::slotConnectionOutput(OProcess* /*proc*/, char* cha, int len) {
271 QCString str(cha, len ); 271 QCString str(cha, len );
272 m_hcitoolCon.append( str ); 272 m_hcitoolCon.append( str );
273 //delete proc; 273 //delete proc;
274} 274}
275ConnectionState::ValueList Manager::parseConnections( const QString& out ) { 275ConnectionState::ValueList Manager::parseConnections( const QString& out ) {
276 ConnectionState::ValueList list2; 276 ConnectionState::ValueList list2;
277 QStringList list = QStringList::split('\n', out ); 277 QStringList list = QStringList::split('\n', out );
278 QStringList::Iterator it; 278 QStringList::Iterator it;
279 // remove the first line ( "Connections:") 279 // remove the first line ( "Connections:")
280 it = list.begin(); 280 it = list.begin();
281 it = list.remove( it ); 281 it = list.remove( it );
282 for (; it != list.end(); ++it ) { 282 for (; it != list.end(); ++it ) {
283 QString row = (*it).stripWhiteSpace(); 283 QString row = (*it).stripWhiteSpace();
284 QStringList value = QStringList::split(' ', row ); 284 QStringList value = QStringList::split(' ', row );
285 qWarning("0: %s", value[0].latin1() ); 285 qWarning("0: %s", value[0].latin1() );
286 qWarning("1: %s", value[1].latin1() ); 286 qWarning("1: %s", value[1].latin1() );
287 qWarning("2: %s", value[2].latin1() ); 287 qWarning("2: %s", value[2].latin1() );
288 qWarning("3: %s", value[3].latin1() ); 288 qWarning("3: %s", value[3].latin1() );
289 qWarning("4: %s", value[4].latin1() ); 289 qWarning("4: %s", value[4].latin1() );
290 qWarning("5: %s", value[5].latin1() ); 290 qWarning("5: %s", value[5].latin1() );
291 qWarning("6: %s", value[6].latin1() ); 291 qWarning("6: %s", value[6].latin1() );
292 qWarning("7: %s", value[7].latin1() ); 292 qWarning("7: %s", value[7].latin1() );
293 qWarning("8: %s", value[8].latin1() ); 293 qWarning("8: %s", value[8].latin1() );
294 ConnectionState con; 294 ConnectionState con;
295 con.setDirection( value[0] == QString::fromLatin1("<") ? Outgoing : Incoming ); 295 con.setDirection( value[0] == QString::fromLatin1("<") ? Outgoing : Incoming );
296 con.setConnectionMode( value[1] ); 296 con.setConnectionMode( value[1] );
297 con.setMac( value[2] ); 297 con.setMac( value[2] );
298 con.setHandle( value[4].toInt() ); 298 con.setHandle( value[4].toInt() );
299 con.setState( value[6].toInt() ); 299 con.setState( value[6].toInt() );
300 con.setLinkMode( value[8] == QString::fromLatin1("MASTER") ? Master : Client ); 300 con.setLinkMode( value[8] == QString::fromLatin1("MASTER") ? Master : Client );
301 list2.append( con ); 301 list2.append( con );
302 } 302 }
303 return list2; 303 return list2;
304} 304}
305 305
306void Manager::signalStrength( const QString &mac ) { 306void Manager::signalStrength( const QString &mac ) {
307 307
308 OProcess* sig_proc = new OProcess(); 308 OProcess* sig_proc = new OProcess();
309 309
310 connect(sig_proc, SIGNAL(processExited(Opie::Core::OProcess*) ), 310 connect(sig_proc, SIGNAL(processExited(Opie::Core::OProcess*) ),
311 this, SLOT(slotSignalStrengthExited( OProcess*) ) ); 311 this, SLOT(slotSignalStrengthExited( Opie::Core::OProcess*) ) );
312 connect(sig_proc, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int) ), 312 connect(sig_proc, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int) ),
313 this, SLOT(slotSignalStrengthOutput(OProcess*, char*, int) ) ); 313 this, SLOT(slotSignalStrengthOutput(Opie::Core::OProcess*, char*, int) ) );
314 *sig_proc << "hcitool"; 314 *sig_proc << "hcitool";
315 *sig_proc << "lq"; 315 *sig_proc << "lq";
316 *sig_proc << mac; 316 *sig_proc << mac;
317 317
318 sig_proc->setName( mac.latin1() ); 318 sig_proc->setName( mac.latin1() );
319 319
320 if (!sig_proc->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { 320 if (!sig_proc->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
321 emit signalStrength( mac, "-1" ); 321 emit signalStrength( mac, "-1" );
322 delete sig_proc; 322 delete sig_proc;
323 } 323 }
324} 324}
325 325
326void Manager::slotSignalStrengthOutput(OProcess* proc, char* cha, int len) { 326void Manager::slotSignalStrengthOutput(OProcess* proc, char* cha, int len) {
327 QCString str(cha, len ); 327 QCString str(cha, len );
328 QString temp = QString(str).stripWhiteSpace(); 328 QString temp = QString(str).stripWhiteSpace();
329 QStringList value = QStringList::split(' ', temp ); 329 QStringList value = QStringList::split(' ', temp );
330 emit signalStrength( proc->name(), value[2].latin1() ); 330 emit signalStrength( proc->name(), value[2].latin1() );
331} 331}
332 332
333 333
334void Manager::slotSignalStrengthExited( OProcess* proc ) { 334void Manager::slotSignalStrengthExited( OProcess* proc ) {
335 delete proc; 335 delete proc;
336} 336}
diff --git a/noncore/net/opietooth/lib/startdunconnection.cpp b/noncore/net/opietooth/lib/startdunconnection.cpp
index 90ef04a..09b19d2 100644
--- a/noncore/net/opietooth/lib/startdunconnection.cpp
+++ b/noncore/net/opietooth/lib/startdunconnection.cpp
@@ -1,69 +1,68 @@
1 1
2#include "startdunconnection.h" 2#include "startdunconnection.h"
3 3
4using namespace OpieTooth; 4using namespace OpieTooth;
5 5
6 6
7using namespace Opie::Core; 7using namespace Opie::Core;
8using namespace Opie::Core;
9StartDunConnection::StartDunConnection() { 8StartDunConnection::StartDunConnection() {
10 m_dunConnect = 0l; 9 m_dunConnect = 0l;
11 setConnectionType(); 10 setConnectionType();
12} 11}
13 12
14StartDunConnection::~StartDunConnection() { 13StartDunConnection::~StartDunConnection() {
15 delete m_dunConnect; 14 delete m_dunConnect;
16} 15}
17 16
18StartDunConnection::StartDunConnection( QString mac ) { 17StartDunConnection::StartDunConnection( QString mac ) {
19 m_dunConnect = 0l; 18 m_dunConnect = 0l;
20 m_mac = mac; 19 m_mac = mac;
21 setConnectionType(); 20 setConnectionType();
22} 21}
23 22
24void StartDunConnection::setName( QString name ) { 23void StartDunConnection::setName( QString name ) {
25 m_name = name; 24 m_name = name;
26} 25}
27 26
28QString StartDunConnection::name() { 27QString StartDunConnection::name() {
29 return m_name; 28 return m_name;
30} 29}
31 30
32void StartDunConnection::setConnectionType() { 31void StartDunConnection::setConnectionType() {
33 m_connectionType = Pan; 32 m_connectionType = Pan;
34} 33}
35 34
36StartConnection::ConnectionType StartDunConnection::type() { 35StartConnection::ConnectionType StartDunConnection::type() {
37 return m_connectionType; 36 return m_connectionType;
38} 37}
39 38
40void StartDunConnection::start() { 39void StartDunConnection::start() {
41 m_dunConnect = new OProcess(); 40 m_dunConnect = new OProcess();
42 *m_dunConnect << "dund" << "--listen" << "--connect" << m_mac; 41 *m_dunConnect << "dund" << "--listen" << "--connect" << m_mac;
43 42
44 connect( m_dunConnect, SIGNAL( processExited(Opie::Core::OProcess*) ) , 43 connect( m_dunConnect, SIGNAL( processExited(Opie::Core::OProcess*) ) ,
45 this, SLOT( slotExited(OProcess*) ) ); 44 this, SLOT( slotExited(Opie::Core::OProcess*) ) );
46 connect( m_dunConnect, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ), 45 connect( m_dunConnect, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ),
47 this, SLOT( slotStdOut(OProcess*,char*,int) ) ); 46 this, SLOT( slotStdOut(Opie::Core::OProcess*,char*,int) ) );
48 if (!m_dunConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) { 47 if (!m_dunConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) {
49 qWarning( "could not start" ); 48 qWarning( "could not start" );
50 delete m_dunConnect; 49 delete m_dunConnect;
51 } 50 }
52} 51}
53 52
54 53
55void StartDunConnection::slotExited( OProcess* proc ) { 54void StartDunConnection::slotExited( OProcess* proc ) {
56 delete m_dunConnect; 55 delete m_dunConnect;
57} 56}
58 57
59void StartDunConnection::slotStdOut(OProcess* proc, char* chars, int len) 58void StartDunConnection::slotStdOut(OProcess* proc, char* chars, int len)
60{} 59{}
61 60
62 61
63void StartDunConnection::stop() { 62void StartDunConnection::stop() {
64 if ( m_dunConnect ) { 63 if ( m_dunConnect ) {
65 delete m_dunConnect; 64 delete m_dunConnect;
66 m_dunConnect = 0l; 65 m_dunConnect = 0l;
67 } 66 }
68} 67}
69 68
diff --git a/noncore/net/opietooth/lib/startpanconnection.cpp b/noncore/net/opietooth/lib/startpanconnection.cpp
index fef35d9..24ac530 100644
--- a/noncore/net/opietooth/lib/startpanconnection.cpp
+++ b/noncore/net/opietooth/lib/startpanconnection.cpp
@@ -1,84 +1,84 @@
1 1
2#include "startpanconnection.h" 2#include "startpanconnection.h"
3 3
4using namespace OpieTooth; 4using namespace OpieTooth;
5 5
6 6
7using namespace Opie::Core; 7using namespace Opie::Core;
8using namespace Opie::Core; 8using namespace Opie::Core;
9StartPanConnection::StartPanConnection() { 9StartPanConnection::StartPanConnection() {
10 m_panConnect = 0l; 10 m_panConnect = 0l;
11 setConnectionType(); 11 setConnectionType();
12} 12}
13 13
14StartPanConnection::~StartPanConnection() { 14StartPanConnection::~StartPanConnection() {
15 delete m_panConnect; 15 delete m_panConnect;
16} 16}
17 17
18StartPanConnection::StartPanConnection( QString mac ) { 18StartPanConnection::StartPanConnection( QString mac ) {
19 m_panConnect = 0l; 19 m_panConnect = 0l;
20 m_mac = mac; 20 m_mac = mac;
21 setConnectionType(); 21 setConnectionType();
22} 22}
23 23
24void StartPanConnection::setName( QString name ) { 24void StartPanConnection::setName( QString name ) {
25 m_name = name; 25 m_name = name;
26} 26}
27 27
28QString StartPanConnection::name() { 28QString StartPanConnection::name() {
29 return m_name; 29 return m_name;
30} 30}
31 31
32void StartPanConnection::setConnectionType() { 32void StartPanConnection::setConnectionType() {
33 m_connectionType = Pan; 33 m_connectionType = Pan;
34} 34}
35 35
36StartConnection::ConnectionType StartPanConnection::type() { 36StartConnection::ConnectionType StartPanConnection::type() {
37 return m_connectionType; 37 return m_connectionType;
38} 38}
39 39
40void StartPanConnection::start() { 40void StartPanConnection::start() {
41 m_panConnect = new OProcess(); 41 m_panConnect = new OProcess();
42 qDebug( "IM START " + m_mac ); 42 qDebug( "IM START " + m_mac );
43 *m_panConnect << "pand" << "--connect" << m_mac; 43 *m_panConnect << "pand" << "--connect" << m_mac;
44 44
45 connect( m_panConnect, SIGNAL( processExited(Opie::Core::OProcess*) ) , 45 connect( m_panConnect, SIGNAL( processExited(Opie::Core::OProcess*) ) ,
46 this, SLOT( slotExited(OProcess*) ) ); 46 this, SLOT( slotExited(Opie::Core::OProcess*) ) );
47 connect( m_panConnect, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ), 47 connect( m_panConnect, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ),
48 this, SLOT( slotStdOut(OProcess*,char*,int) ) ); 48 this, SLOT( slotStdOut(Opie::Core::OProcess*,char*,int) ) );
49 if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) { 49 if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) {
50 qWarning( "could not start" ); 50 qWarning( "could not start" );
51 delete m_panConnect; 51 delete m_panConnect;
52 } 52 }
53} 53}
54 54
55 55
56void StartPanConnection::slotExited( OProcess* proc ) { 56void StartPanConnection::slotExited( OProcess* proc ) {
57 delete m_panConnect; 57 delete m_panConnect;
58 m_panConnect = 0l; 58 m_panConnect = 0l;
59} 59}
60 60
61void StartPanConnection::slotStdOut(OProcess* proc, char* chars, int len) 61void StartPanConnection::slotStdOut(OProcess* proc, char* chars, int len)
62{} 62{}
63 63
64 64
65void StartPanConnection::stop() { 65void StartPanConnection::stop() {
66 if ( m_panConnect ) { 66 if ( m_panConnect ) {
67 delete m_panConnect; 67 delete m_panConnect;
68 m_panConnect = 0l; 68 m_panConnect = 0l;
69 } 69 }
70 m_panConnect = new OProcess(); 70 m_panConnect = new OProcess();
71 qDebug("IM STOP " + m_mac); 71 qDebug("IM STOP " + m_mac);
72 72
73 *m_panConnect << "pand" << "--kill" << m_mac; 73 *m_panConnect << "pand" << "--kill" << m_mac;
74 74
75 connect( m_panConnect, SIGNAL( processExited(Opie::Core::OProcess*) ) , 75 connect( m_panConnect, SIGNAL( processExited(Opie::Core::OProcess*) ) ,
76 this, SLOT( slotExited(OProcess*) ) ); 76 this, SLOT( slotExited(Opie::Core::OProcess*) ) );
77 connect( m_panConnect, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ), 77 connect( m_panConnect, SIGNAL( receivedStdout(Opie::Core::OProcess*,char*,int) ),
78 this, SLOT( slotStdOut(OProcess*,char*,int) ) ); 78 this, SLOT( slotStdOut(Opie::Core::OProcess*,char*,int) ) );
79 if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) { 79 if (!m_panConnect->start( OProcess::NotifyOnExit, OProcess::AllOutput) ) {
80 qWarning( "could not stop" ); 80 qWarning( "could not stop" );
81 delete m_panConnect; 81 delete m_panConnect;
82 } 82 }
83} 83}
84 84
diff --git a/noncore/net/opietooth/manager/pppdialog.cpp b/noncore/net/opietooth/manager/pppdialog.cpp
index 870e7fd..78c1501 100644
--- a/noncore/net/opietooth/manager/pppdialog.cpp
+++ b/noncore/net/opietooth/manager/pppdialog.cpp
@@ -1,70 +1,69 @@
1 1
2#include "pppdialog.h" 2#include "pppdialog.h"
3#include <qpushbutton.h> 3#include <qpushbutton.h>
4#include <qmultilineedit.h> 4#include <qmultilineedit.h>
5#include <qlineedit.h> 5#include <qlineedit.h>
6#include <qlayout.h> 6#include <qlayout.h>
7#include <qlabel.h> 7#include <qlabel.h>
8#include <opie2/oprocess.h> 8#include <opie2/oprocess.h>
9 9
10using namespace OpieTooth; 10using namespace OpieTooth;
11 11
12using namespace Opie::Core; 12using namespace Opie::Core;
13using namespace Opie::Core;
14PPPDialog::PPPDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device ) 13PPPDialog::PPPDialog( QWidget* parent, const char* name, bool modal, WFlags fl, const QString& device )
15 : QDialog( parent, name, modal, fl ) { 14 : QDialog( parent, name, modal, fl ) {
16 15
17 if ( !name ) 16 if ( !name )
18 setName( "PPPDialog" ); 17 setName( "PPPDialog" );
19 setCaption( tr( "ppp connection " ) ) ; 18 setCaption( tr( "ppp connection " ) ) ;
20 19
21 m_device = device; 20 m_device = device;
22 21
23 layout = new QVBoxLayout( this ); 22 layout = new QVBoxLayout( this );
24 23
25 QLabel* info = new QLabel( this ); 24 QLabel* info = new QLabel( this );
26 info->setText( tr("Enter an ppp script name:") ); 25 info->setText( tr("Enter an ppp script name:") );
27 26
28 cmdLine = new QLineEdit( this ); 27 cmdLine = new QLineEdit( this );
29 28
30 outPut = new QMultiLineEdit( this ); 29 outPut = new QMultiLineEdit( this );
31 QFont outPut_font( outPut->font() ); 30 QFont outPut_font( outPut->font() );
32 outPut_font.setPointSize( 8 ); 31 outPut_font.setPointSize( 8 );
33 outPut->setFont( outPut_font ); 32 outPut->setFont( outPut_font );
34 outPut->setWordWrap( QMultiLineEdit::WidgetWidth ); 33 outPut->setWordWrap( QMultiLineEdit::WidgetWidth );
35 34
36 connectButton = new QPushButton( this ); 35 connectButton = new QPushButton( this );
37 connectButton->setText( tr( "Connect" ) ); 36 connectButton->setText( tr( "Connect" ) );
38 37
39 layout->addWidget(info); 38 layout->addWidget(info);
40 layout->addWidget(cmdLine); 39 layout->addWidget(cmdLine);
41 layout->addWidget(outPut); 40 layout->addWidget(outPut);
42 layout->addWidget(connectButton); 41 layout->addWidget(connectButton);
43 42
44 connect( connectButton, SIGNAL( clicked() ), this, SLOT( connectToDevice() ) ); 43 connect( connectButton, SIGNAL( clicked() ), this, SLOT( connectToDevice() ) );
45 44
46} 45}
47 46
48PPPDialog::~PPPDialog() { 47PPPDialog::~PPPDialog() {
49} 48}
50 49
51void PPPDialog::connectToDevice() { 50void PPPDialog::connectToDevice() {
52 outPut->clear(); 51 outPut->clear();
53 // vom popupmenu beziehen 52 // vom popupmenu beziehen
54 QString connectScript = "/etc/ppp/peers/" + cmdLine->text(); 53 QString connectScript = "/etc/ppp/peers/" + cmdLine->text();
55 OProcess* pppDial = new OProcess(); 54 OProcess* pppDial = new OProcess();
56 *pppDial << "pppd" << m_device << "call" << connectScript; 55 *pppDial << "pppd" << m_device << "call" << connectScript;
57 connect( pppDial, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int) ), 56 connect( pppDial, SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int) ),
58 this, SLOT(fillOutPut(OProcess*,char*,int) ) ); 57 this, SLOT(fillOutPut(Opie::Core::OProcess*,char*,int) ) );
59 if (!pppDial->start(OProcess::DontCare, OProcess::AllOutput) ) { 58 if (!pppDial->start(OProcess::DontCare, OProcess::AllOutput) ) {
60 qWarning("could not start"); 59 qWarning("could not start");
61 delete pppDial; 60 delete pppDial;
62 } 61 }
63} 62}
64 63
65void PPPDialog::fillOutPut( OProcess* pppDial, char* cha, int len ) { 64void PPPDialog::fillOutPut( OProcess* pppDial, char* cha, int len ) {
66 QCString str(cha, len ); 65 QCString str(cha, len );
67 outPut->insertLine( str ); 66 outPut->insertLine( str );
68 delete pppDial; 67 delete pppDial;
69} 68}
70 69
diff --git a/noncore/settings/networksettings/ppp/config.in b/noncore/settings/networksettings/ppp/config.in
index 3b8501d..0b71434 100644
--- a/noncore/settings/networksettings/ppp/config.in
+++ b/noncore/settings/networksettings/ppp/config.in
@@ -1,4 +1,4 @@
1 config PPP 1 config PPP
2 boolean "opie-networksettingsplugin-kppp (PPP module)" 2 boolean "opie-networksettingsplugin-kppp (PPP module)"
3 default "n" if NETWORKSETUP 3 default "n" if NETWORKSETUP
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE && NETWORKSETUP && NETWORKSETUP-CORE && INTERFACES 4 depends ( LIBQPE || LIBQPE-X11 ) && NETWORKSETUP && NETWORKSETUP-CORE && INTERFACES
diff --git a/noncore/settings/networksettings/wlan/config.in b/noncore/settings/networksettings/wlan/config.in
index 97fa468..d4661cb 100644
--- a/noncore/settings/networksettings/wlan/config.in
+++ b/noncore/settings/networksettings/wlan/config.in
@@ -1,6 +1,6 @@
1 config WLAN 1 config WLAN
2 boolean "opie-networksettingsplugin-wlan (wireless LAN module)" 2 boolean "opie-networksettingsplugin-wlan (wireless LAN module)"
3 default "n" if NETWORKSETUP 3 default "n" if NETWORKSETUP
4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2UI && NETWORKSETUP && NETWORKSETUP-CORE && INTERFACES && LIBOPIE2NET 4 depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE2UI && NETWORKSETUP && NETWORKSETUP-CORE && INTERFACES && LIBOPIE2NET
5 #comment "opie-networksettingsplugin-wlan needs libopie2ui, libopie2net and networksetup" 5 #comment "opie-networksettingsplugin-wlan needs libopie2ui, libopie2net and networksetup"
6 #depends !( LIBOPIE2NET && LIBOPIE && NETWORKSETUP) \ No newline at end of file 6 #depends !( LIBOPIE2NET && NETWORKSETUP) \ No newline at end of file
diff --git a/noncore/unsupported/mail2/bend/bend.cpp b/noncore/unsupported/mail2/bend/bend.cpp
index ab6eb45..4ded402 100644
--- a/noncore/unsupported/mail2/bend/bend.cpp
+++ b/noncore/unsupported/mail2/bend/bend.cpp
@@ -1,124 +1,124 @@
1#include <qlayout.h> 1#include <qlayout.h>
2#include <qpixmap.h> 2#include <qpixmap.h>
3#include <qlabel.h> 3#include <qlabel.h>
4#include <qsound.h> 4#include <qsound.h>
5#include <qtimer.h> 5#include <qtimer.h>
6#include <qdir.h> 6#include <qdir.h>
7 7
8#include <qpe/qcopenvelope_qws.h> 8#include <qpe/qcopenvelope_qws.h>
9#include <qpe/resource.h> 9#include <qpe/resource.h>
10#include <qpe/config.h> 10#include <qpe/config.h>
11 11
12#include <opie/odevice.h> 12#include <opie2/odevice.h>
13 13
14#include "imapresponse.h" 14#include "imapresponse.h"
15#include "imaphandler.h" 15#include "imaphandler.h"
16#include "configfile.h" 16#include "configfile.h"
17#include "bend.h" 17#include "bend.h"
18 18
19using namespace Opie; 19using namespace Opie;
20 20
21BenD::BenD(QWidget *parent, const char *name, WFlags fl) 21BenD::BenD(QWidget *parent, const char *name, WFlags fl)
22 : QButton(parent, name, fl) 22 : QButton(parent, name, fl)
23{ 23{
24 _config = new Config("mail"); 24 _config = new Config("mail");
25 _config->setGroup("Settings"); 25 _config->setGroup("Settings");
26 26
27 QVBoxLayout *layout = new QVBoxLayout(this); 27 QVBoxLayout *layout = new QVBoxLayout(this);
28 layout->addItem(new QSpacerItem(0,0)); 28 layout->addItem(new QSpacerItem(0,0));
29 29
30 QLabel *pixmap = new QLabel(this); 30 QLabel *pixmap = new QLabel(this);
31 pixmap->setPixmap(Resource::loadPixmap("mail/mailchecker")); 31 pixmap->setPixmap(Resource::loadPixmap("mail/mailchecker"));
32 layout->addWidget(pixmap); 32 layout->addWidget(pixmap);
33 33
34 layout->addItem(new QSpacerItem(0,0)); 34 layout->addItem(new QSpacerItem(0,0));
35 35
36 hide(); 36 hide();
37 37
38 connect(this, SIGNAL(clicked()), SLOT(slotClicked())); 38 connect(this, SIGNAL(clicked()), SLOT(slotClicked()));
39 39
40 if (!_config->readBoolEntry("Disabled", false)) { 40 if (!_config->readBoolEntry("Disabled", false)) {
41 _intervalMs = _config->readNumEntry("CheckEvery", 5) * 60000; 41 _intervalMs = _config->readNumEntry("CheckEvery", 5) * 60000;
42 _intervalTimer = new QTimer(); 42 _intervalTimer = new QTimer();
43 _intervalTimer->start(_intervalMs); 43 _intervalTimer->start(_intervalMs);
44 connect(_intervalTimer, SIGNAL(timeout()), SLOT(slotCheck())); 44 connect(_intervalTimer, SIGNAL(timeout()), SLOT(slotCheck()));
45 45
46 QTimer::singleShot(0, this, SLOT(slotCheck())); 46 QTimer::singleShot(0, this, SLOT(slotCheck()));
47 } 47 }
48} 48}
49 49
50void BenD::drawButton(QPainter *) { } 50void BenD::drawButton(QPainter *) { }
51void BenD::drawButtonText(QPainter *) { } 51void BenD::drawButtonText(QPainter *) { }
52 52
53void BenD::slotClicked() 53void BenD::slotClicked()
54{ 54{
55 QCopEnvelope e("QPE/System", "execute(QString)"); 55 QCopEnvelope e("QPE/System", "execute(QString)");
56 e << QString("mail"); 56 e << QString("mail");
57 57
58 ODevice *device = ODevice::inst(); 58 ODevice *device = ODevice::inst();
59 if ( !device-> ledList ( ). isEmpty ( )) { 59 if ( !device-> ledList ( ). isEmpty ( )) {
60 OLed led = ( device-> ledList ( ). contains ( Led_Mail )) ? Led_Mail : device-> ledList ( ) [0]; 60 OLed led = ( device-> ledList ( ). contains ( Led_Mail )) ? Led_Mail : device-> ledList ( ) [0];
61 61
62 device->setLedState(led, Led_Off); 62 device->setLedState(led, Led_Off);
63 } 63 }
64} 64}
65 65
66void BenD::slotCheck() 66void BenD::slotCheck()
67{ 67{
68 // Check wether the check interval has been changed. 68 // Check wether the check interval has been changed.
69 int newIntervalMs = _config->readNumEntry("CheckEvery", 5) * 60000; 69 int newIntervalMs = _config->readNumEntry("CheckEvery", 5) * 60000;
70 if (newIntervalMs != _intervalMs) { 70 if (newIntervalMs != _intervalMs) {
71 _intervalTimer->changeInterval(newIntervalMs); 71 _intervalTimer->changeInterval(newIntervalMs);
72 _intervalMs = newIntervalMs; 72 _intervalMs = newIntervalMs;
73#ifndef QT_NO_DEBUG 73#ifndef QT_NO_DEBUG
74 qWarning("BenD: Detected interval change"); 74 qWarning("BenD: Detected interval change");
75#endif 75#endif
76 } 76 }
77 77
78 QValueList<Account> acList = ConfigFile::getAccounts(); 78 QValueList<Account> acList = ConfigFile::getAccounts();
79 QValueList<Account>::Iterator ot; 79 QValueList<Account>::Iterator ot;
80 for (ot = acList.begin(); ot != acList.end(); ot++) { 80 for (ot = acList.begin(); ot != acList.end(); ot++) {
81 if (!((*ot).imapServer().isEmpty() || 81 if (!((*ot).imapServer().isEmpty() ||
82 (*ot).imapPort().isEmpty() || 82 (*ot).imapPort().isEmpty() ||
83 (*ot).user().isEmpty() || 83 (*ot).user().isEmpty() ||
84 (*ot).pass().isEmpty())) { 84 (*ot).pass().isEmpty())) {
85 if (!((*ot).imapSsl() && 85 if (!((*ot).imapSsl() &&
86 (*ot).imapSslPort().isEmpty())) { 86 (*ot).imapSslPort().isEmpty())) {
87 IMAPHandler *handler = new IMAPHandler(*ot); 87 IMAPHandler *handler = new IMAPHandler(*ot);
88 handler->iStatus("INBOX", "RECENT"); 88 handler->iStatus("INBOX", "RECENT");
89 connect(handler, SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPStatus(IMAPResponse&))); 89 connect(handler, SIGNAL(gotResponse(IMAPResponse&)), SLOT(slotIMAPStatus(IMAPResponse&)));
90 } 90 }
91 } 91 }
92 } 92 }
93} 93}
94 94
95void BenD::slotIMAPStatus(IMAPResponse &response) 95void BenD::slotIMAPStatus(IMAPResponse &response)
96{ 96{
97 disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPStatus(IMAPResponse&))); 97 disconnect(response.imapHandler(), SIGNAL(gotResponse(IMAPResponse&)), this, SLOT(slotIMAPStatus(IMAPResponse&)));
98 98
99 if (response.statusResponse().status() == IMAPResponseEnums::OK) { 99 if (response.statusResponse().status() == IMAPResponseEnums::OK) {
100 if (response.STATUS()[0].recent().toInt() > 0) { 100 if (response.STATUS()[0].recent().toInt() > 0) {
101 ODevice *device = ODevice::inst(); 101 ODevice *device = ODevice::inst();
102 if (isHidden()) show(); 102 if (isHidden()) show();
103 if (_config->readBoolEntry("BlinkLed", true)) { 103 if (_config->readBoolEntry("BlinkLed", true)) {
104 if ( !device-> ledList ( ). isEmpty ( )) { 104 if ( !device-> ledList ( ). isEmpty ( )) {
105 OLed led = ( device-> ledList ( ). contains ( Led_Mail )) ? Led_Mail : device-> ledList ( ) [0]; 105 OLed led = ( device-> ledList ( ). contains ( Led_Mail )) ? Led_Mail : device-> ledList ( ) [0];
106 106
107 device->setLedState(led, device-> ledStateList ( led ). contains ( Led_BlinkSlow ) ? Led_BlinkSlow : Led_On ); 107 device->setLedState(led, device-> ledStateList ( led ). contains ( Led_BlinkSlow ) ? Led_BlinkSlow : Led_On );
108 } 108 }
109 } 109 }
110 if (_config->readBoolEntry("PlaySound", false)) 110 if (_config->readBoolEntry("PlaySound", false))
111 device->alarmSound(); 111 device->alarmSound();
112 } else { 112 } else {
113 ODevice *device = ODevice::inst(); 113 ODevice *device = ODevice::inst();
114 if (!isHidden()) hide(); 114 if (!isHidden()) hide();
115 if ( !device-> ledList ( ). isEmpty ( )) { 115 if ( !device-> ledList ( ). isEmpty ( )) {
116 OLed led = ( device-> ledList ( ). contains ( Led_Mail )) ? Led_Mail : device-> ledList ( ) [0]; 116 OLed led = ( device-> ledList ( ). contains ( Led_Mail )) ? Led_Mail : device-> ledList ( ) [0];
117 117
118 device->setLedState(led, Led_Off); 118 device->setLedState(led, Led_Off);
119 } 119 }
120 } 120 }
121 response.imapHandler()->iLogout(); 121 response.imapHandler()->iLogout();
122 } else qWarning("BenD: WARNING: Couldn't retrieve INBOX status."); 122 } else qWarning("BenD: WARNING: Couldn't retrieve INBOX status.");
123} 123}
124 124
diff --git a/noncore/unsupported/mail2/composerbase.cpp b/noncore/unsupported/mail2/composerbase.cpp
index 94de15c..cac3f26 100644
--- a/noncore/unsupported/mail2/composerbase.cpp
+++ b/noncore/unsupported/mail2/composerbase.cpp
@@ -1,202 +1,202 @@
1#include <qmultilineedit.h> 1#include <qmultilineedit.h>
2#include <qpopupmenu.h> 2#include <qpopupmenu.h>
3#include <qcombobox.h> 3#include <qcombobox.h>
4#include <qlineedit.h> 4#include <qlineedit.h>
5#include <qlayout.h> 5#include <qlayout.h>
6#include <qaction.h> 6#include <qaction.h>
7#include <qlabel.h> 7#include <qlabel.h>
8#include <qvbox.h> 8#include <qvbox.h>
9 9
10#include <qpe/qpetoolbar.h> 10#include <qtoolbar.h>
11#include <qmenubar.h> 11#include <qmenubar.h>
12#include <qpe/resource.h> 12#include <qpe/resource.h>
13 13
14#include "mailstatusbar.h" 14#include "mailstatusbar.h"
15#include "listviewplus.h" 15#include "listviewplus.h"
16#include "composerbase.h" 16#include "composerbase.h"
17 17
18ComposerBase::ComposerBase(QWidget *parent, const char *name, WFlags fl) 18ComposerBase::ComposerBase(QWidget *parent, const char *name, WFlags fl)
19 : QMainWindow(parent, name, fl) 19 : QMainWindow(parent, name, fl)
20{ 20{
21 setCaption(tr("Compose Message")); 21 setCaption(tr("Compose Message"));
22 setToolBarsMovable(false); 22 setToolBarsMovable(false);
23 23
24 toolbar = new QToolBar(this); 24 toolbar = new QToolBar(this);
25 menubar = new QMenuBar( toolbar ); 25 menubar = new QMenuBar( toolbar );
26 mailmenu = new QPopupMenu( menubar ); 26 mailmenu = new QPopupMenu( menubar );
27 menubar->insertItem( tr( "Mail" ), mailmenu ); 27 menubar->insertItem( tr( "Mail" ), mailmenu );
28 addToolBar(toolbar); 28 addToolBar(toolbar);
29 toolbar->setHorizontalStretchable(true); 29 toolbar->setHorizontalStretchable(true);
30 30
31 QLabel *spacer = new QLabel(toolbar); 31 QLabel *spacer = new QLabel(toolbar);
32 spacer->setBackgroundMode(QWidget::PaletteButton); 32 spacer->setBackgroundMode(QWidget::PaletteButton);
33 toolbar->setStretchableWidget(spacer); 33 toolbar->setStretchableWidget(spacer);
34 34
35 sendmail = new QAction(tr("Send the mail"), QIconSet(Resource::loadPixmap("mail/sendmail")), 0, 0, this); 35 sendmail = new QAction(tr("Send the mail"), QIconSet(Resource::loadPixmap("mail/sendmail")), 0, 0, this);
36 sendmail->addTo(toolbar); 36 sendmail->addTo(toolbar);
37 sendmail->addTo(mailmenu); 37 sendmail->addTo(mailmenu);
38 38
39 queuemail = new QAction(tr("Queue the mail"), QIconSet(Resource::loadPixmap("mail/sendall")), 0, 0, this); 39 queuemail = new QAction(tr("Queue the mail"), QIconSet(Resource::loadPixmap("mail/sendall")), 0, 0, this);
40 queuemail->addTo(toolbar); 40 queuemail->addTo(toolbar);
41 queuemail->addTo(mailmenu); 41 queuemail->addTo(mailmenu);
42 42
43 attachfile = new QAction(tr("Attach a file"), QIconSet(Resource::loadPixmap("mail/attach")), 0, 0, this, 0, true); 43 attachfile = new QAction(tr("Attach a file"), QIconSet(Resource::loadPixmap("mail/attach")), 0, 0, this, 0, true);
44 attachfile->addTo(toolbar); 44 attachfile->addTo(toolbar);
45 attachfile->addTo(mailmenu); 45 attachfile->addTo(mailmenu);
46 connect(attachfile, SIGNAL(toggled(bool)), SLOT(slotAttachfileChanged(bool))); 46 connect(attachfile, SIGNAL(toggled(bool)), SLOT(slotAttachfileChanged(bool)));
47 47
48 addressbook = new QAction(tr("Addressbook"), QIconSet(Resource::loadPixmap("mail/addbook")), 0, 0, this); 48 addressbook = new QAction(tr("Addressbook"), QIconSet(Resource::loadPixmap("mail/addbook")), 0, 0, this);
49 addressbook->addTo(toolbar); 49 addressbook->addTo(toolbar);
50 addressbook->addTo(mailmenu); 50 addressbook->addTo(mailmenu);
51 51
52 QWidget *main = new QWidget(this); 52 QWidget *main = new QWidget(this);
53 setCentralWidget(main); 53 setCentralWidget(main);
54 54
55 QGridLayout *layout = new QGridLayout(main); 55 QGridLayout *layout = new QGridLayout(main);
56 56
57 fromBox = new QComboBox(main); 57 fromBox = new QComboBox(main);
58 fromBox->insertItem(tr("From"), POPUP_FROM_FROM); 58 fromBox->insertItem(tr("From"), POPUP_FROM_FROM);
59 fromBox->insertItem(tr("Reply"), POPUP_FROM_REPLYTO); 59 fromBox->insertItem(tr("Reply"), POPUP_FROM_REPLYTO);
60 layout->addWidget(fromBox, 0, 0); 60 layout->addWidget(fromBox, 0, 0);
61 61
62 connect(fromBox, SIGNAL(activated(int)), SLOT(slotFromMenuChanged(int))); 62 connect(fromBox, SIGNAL(activated(int)), SLOT(slotFromMenuChanged(int)));
63 63
64 QHBoxLayout *fromLayout = new QHBoxLayout(); 64 QHBoxLayout *fromLayout = new QHBoxLayout();
65 layout->addLayout(fromLayout, 0, 1); 65 layout->addLayout(fromLayout, 0, 1);
66 66
67 from = new QComboBox(main); 67 from = new QComboBox(main);
68 fromLayout->addWidget(from); 68 fromLayout->addWidget(from);
69 69
70 replyto = new QLineEdit(main); 70 replyto = new QLineEdit(main);
71 replyto->hide(); 71 replyto->hide();
72 fromLayout->addWidget(replyto); 72 fromLayout->addWidget(replyto);
73 73
74 receiversBox = new QComboBox(main); 74 receiversBox = new QComboBox(main);
75 receiversBox->insertItem(tr("To"), POPUP_RECV_TO); 75 receiversBox->insertItem(tr("To"), POPUP_RECV_TO);
76 receiversBox->insertItem(tr("Cc"), POPUP_RECV_CC); 76 receiversBox->insertItem(tr("Cc"), POPUP_RECV_CC);
77 receiversBox->insertItem(tr("Bcc"), POPUP_RECV_BCC); 77 receiversBox->insertItem(tr("Bcc"), POPUP_RECV_BCC);
78 layout->addWidget(receiversBox, 1, 0); 78 layout->addWidget(receiversBox, 1, 0);
79 79
80 connect(receiversBox, SIGNAL(activated(int)), SLOT(slotReceiverMenuChanged(int))); 80 connect(receiversBox, SIGNAL(activated(int)), SLOT(slotReceiverMenuChanged(int)));
81 81
82 QHBoxLayout *receiverLayout = new QHBoxLayout(); 82 QHBoxLayout *receiverLayout = new QHBoxLayout();
83 layout->addLayout(receiverLayout, 1, 1); 83 layout->addLayout(receiverLayout, 1, 1);
84 84
85 to = new QLineEdit(main); 85 to = new QLineEdit(main);
86 receiverLayout->addWidget(to); 86 receiverLayout->addWidget(to);
87 87
88 cc = new QLineEdit(main); 88 cc = new QLineEdit(main);
89 cc->hide(); 89 cc->hide();
90 receiverLayout->addWidget(cc); 90 receiverLayout->addWidget(cc);
91 91
92 bcc = new QLineEdit(main); 92 bcc = new QLineEdit(main);
93 bcc->hide(); 93 bcc->hide();
94 receiverLayout->addWidget(bcc); 94 receiverLayout->addWidget(bcc);
95 95
96 subjectBox = new QComboBox(main); 96 subjectBox = new QComboBox(main);
97 subjectBox->insertItem(tr("Subj."), POPUP_SUBJ_SUBJECT); 97 subjectBox->insertItem(tr("Subj."), POPUP_SUBJ_SUBJECT);
98 subjectBox->insertItem(tr("Prio."), POPUP_SUBJ_PRIORITY); 98 subjectBox->insertItem(tr("Prio."), POPUP_SUBJ_PRIORITY);
99 layout->addWidget(subjectBox, 2, 0); 99 layout->addWidget(subjectBox, 2, 0);
100 connect(subjectBox, SIGNAL(activated(int)), SLOT(slotSubjectMenuChanged(int))); 100 connect(subjectBox, SIGNAL(activated(int)), SLOT(slotSubjectMenuChanged(int)));
101 101
102 QHBoxLayout *subjectLayout = new QHBoxLayout(); 102 QHBoxLayout *subjectLayout = new QHBoxLayout();
103 layout->addLayout(subjectLayout, 2, 1); 103 layout->addLayout(subjectLayout, 2, 1);
104 104
105 subject = new QLineEdit(main); 105 subject = new QLineEdit(main);
106 subjectLayout->addWidget(subject); 106 subjectLayout->addWidget(subject);
107 107
108 priority = new QComboBox(main); 108 priority = new QComboBox(main);
109 priority->insertItem(tr("Low"), POPUP_PRIO_LOW); 109 priority->insertItem(tr("Low"), POPUP_PRIO_LOW);
110 priority->insertItem(tr("Normal"), POPUP_PRIO_NORMAL); 110 priority->insertItem(tr("Normal"), POPUP_PRIO_NORMAL);
111 priority->insertItem(tr("High"), POPUP_PRIO_HIGH); 111 priority->insertItem(tr("High"), POPUP_PRIO_HIGH);
112 priority->setCurrentItem(POPUP_PRIO_NORMAL); 112 priority->setCurrentItem(POPUP_PRIO_NORMAL);
113 priority->hide(); 113 priority->hide();
114 subjectLayout->addWidget(priority); 114 subjectLayout->addWidget(priority);
115 115
116 QVBox *view = new QVBox(main); 116 QVBox *view = new QVBox(main);
117 layout->addMultiCellWidget(view, 3, 3, 0, 1); 117 layout->addMultiCellWidget(view, 3, 3, 0, 1);
118 118
119 message = new QMultiLineEdit(view); 119 message = new QMultiLineEdit(view);
120 message->setMinimumHeight(30); 120 message->setMinimumHeight(30);
121 121
122 attachWindow = new QMainWindow(view, 0, 0); 122 attachWindow = new QMainWindow(view, 0, 0);
123 attachWindow->setMinimumHeight(80); 123 attachWindow->setMinimumHeight(80);
124 attachWindow->setMaximumHeight(80); 124 attachWindow->setMaximumHeight(80);
125 attachWindow->setToolBarsMovable(false); 125 attachWindow->setToolBarsMovable(false);
126 attachWindow->hide(); 126 attachWindow->hide();
127 127
128 attachToolbar = new QToolBar(attachWindow); 128 attachToolbar = new QToolBar(attachWindow);
129 attachToolbar->setVerticalStretchable(true); 129 attachToolbar->setVerticalStretchable(true);
130 130
131 addattach = new QAction(tr("Add an Attachement"), QIconSet(Resource::loadPixmap("mail/newmail")), 0, 0, this); 131 addattach = new QAction(tr("Add an Attachement"), QIconSet(Resource::loadPixmap("mail/newmail")), 0, 0, this);
132 addattach->addTo(attachToolbar); 132 addattach->addTo(attachToolbar);
133 133
134 delattach = new QAction(tr("Remove Attachement"), QIconSet(Resource::loadPixmap("mail/delete")), 0, 0, this); 134 delattach = new QAction(tr("Remove Attachement"), QIconSet(Resource::loadPixmap("mail/delete")), 0, 0, this);
135 delattach->addTo(attachToolbar); 135 delattach->addTo(attachToolbar);
136 136
137 QLabel *attachSpacer = new QLabel(attachToolbar); 137 QLabel *attachSpacer = new QLabel(attachToolbar);
138 attachSpacer->setBackgroundMode(QWidget::PaletteButton); 138 attachSpacer->setBackgroundMode(QWidget::PaletteButton);
139 attachToolbar->setStretchableWidget(attachSpacer); 139 attachToolbar->setStretchableWidget(attachSpacer);
140 140
141 attachWindow->addToolBar(attachToolbar, QMainWindow::Left); 141 attachWindow->addToolBar(attachToolbar, QMainWindow::Left);
142 142
143 attachView = new ListViewPlus(attachWindow); 143 attachView = new ListViewPlus(attachWindow);
144 attachView->addColumn(tr("Name"), 80); 144 attachView->addColumn(tr("Name"), 80);
145 attachView->addColumn(tr("Description"), 110); 145 attachView->addColumn(tr("Description"), 110);
146 attachView->setAllColumnsShowFocus(true); 146 attachView->setAllColumnsShowFocus(true);
147 attachWindow->setCentralWidget(attachView); 147 attachWindow->setCentralWidget(attachView);
148 148
149 attachPopup = new QPopupMenu(attachView); 149 attachPopup = new QPopupMenu(attachView);
150 attachPopup->insertItem(tr("Rename"), POPUP_ATTACH_RENAME); 150 attachPopup->insertItem(tr("Rename"), POPUP_ATTACH_RENAME);
151 attachPopup->insertItem(tr("Change Description"), POPUP_ATTACH_DESC); 151 attachPopup->insertItem(tr("Change Description"), POPUP_ATTACH_DESC);
152 attachPopup->insertSeparator(); 152 attachPopup->insertSeparator();
153 attachPopup->insertItem(tr("Remove"), POPUP_ATTACH_REMOVE); 153 attachPopup->insertItem(tr("Remove"), POPUP_ATTACH_REMOVE);
154 attachView->setPopup(attachPopup); 154 attachView->setPopup(attachPopup);
155 155
156 status = new MailStatusBar(view); 156 status = new MailStatusBar(view);
157} 157}
158 158
159void ComposerBase::slotAttachfileChanged(bool toggled) 159void ComposerBase::slotAttachfileChanged(bool toggled)
160{ 160{
161 if (toggled) { 161 if (toggled) {
162 if (attachWindow->isHidden()) attachWindow->show(); 162 if (attachWindow->isHidden()) attachWindow->show();
163 } else { 163 } else {
164 if (!attachWindow->isHidden()) attachWindow->hide(); 164 if (!attachWindow->isHidden()) attachWindow->hide();
165 } 165 }
166} 166}
167 167
168void ComposerBase::slotFromMenuChanged(int id) 168void ComposerBase::slotFromMenuChanged(int id)
169{ 169{
170 if (POPUP_FROM_FROM == id) { 170 if (POPUP_FROM_FROM == id) {
171 if (from->isHidden()) from->show(); 171 if (from->isHidden()) from->show();
172 if (!replyto->isHidden()) replyto->hide(); 172 if (!replyto->isHidden()) replyto->hide();
173 } else if (POPUP_FROM_REPLYTO == id) { 173 } else if (POPUP_FROM_REPLYTO == id) {
174 if (!from->isHidden()) from->hide(); 174 if (!from->isHidden()) from->hide();
175 if (replyto->isHidden()) replyto->show(); 175 if (replyto->isHidden()) replyto->show();
176 } 176 }
177} 177}
178 178
179void ComposerBase::slotReceiverMenuChanged(int id) 179void ComposerBase::slotReceiverMenuChanged(int id)
180{ 180{
181 if (POPUP_RECV_TO == id) { 181 if (POPUP_RECV_TO == id) {
182 if (to->isHidden()) to->show(); 182 if (to->isHidden()) to->show();
183 if (!cc->isHidden()) cc->hide(); 183 if (!cc->isHidden()) cc->hide();
184 if (!bcc->isHidden()) bcc->hide(); 184 if (!bcc->isHidden()) bcc->hide();
185 } else if (POPUP_RECV_CC == id) { 185 } else if (POPUP_RECV_CC == id) {
186 if (!to->isHidden()) to->hide(); 186 if (!to->isHidden()) to->hide();
187 if (cc->isHidden()) cc->show(); 187 if (cc->isHidden()) cc->show();
188 if (!bcc->isHidden()) bcc->hide(); 188 if (!bcc->isHidden()) bcc->hide();
189 } else if (POPUP_RECV_BCC == id) { 189 } else if (POPUP_RECV_BCC == id) {
190 if (!to->isHidden()) to->hide(); 190 if (!to->isHidden()) to->hide();
191 if (!cc->isHidden()) cc->hide(); 191 if (!cc->isHidden()) cc->hide();
192 if (bcc->isHidden()) bcc->show(); 192 if (bcc->isHidden()) bcc->show();
193 } 193 }
194} 194}
195 195
196void ComposerBase::slotSubjectMenuChanged(int id) 196void ComposerBase::slotSubjectMenuChanged(int id)
197{ 197{
198 if (POPUP_SUBJ_SUBJECT == id) { 198 if (POPUP_SUBJ_SUBJECT == id) {
199 if (subject->isHidden()) subject->show(); 199 if (subject->isHidden()) subject->show();
200 if (!priority->isHidden()) priority->hide(); 200 if (!priority->isHidden()) priority->hide();
201 } else if (POPUP_SUBJ_PRIORITY == id) { 201 } else if (POPUP_SUBJ_PRIORITY == id) {
202 if (!subject->isHidden()) subject->hide(); 202 if (!subject->isHidden()) subject->hide();
diff --git a/noncore/unsupported/mail2/main.cpp b/noncore/unsupported/mail2/main.cpp
index a11b4e2..fce9b0b 100644
--- a/noncore/unsupported/mail2/main.cpp
+++ b/noncore/unsupported/mail2/main.cpp
@@ -1,9 +1,10 @@
1#include <qpe/qpeapplication.h> 1#include <qpe/qpeapplication.h>
2 2
3using namespace Opie::Core;
3#include "mainwindow.h" 4#include "mainwindow.h"
4 5
5#include <opie/oapplicationfactory.h> 6#include <opie/oapplicationfactory.h>
6 7
7OPIE_EXPORT_APP( OApplicationFactory<MainWindow> ) 8OPIE_EXPORT_APP( OApplicationFactory<MainWindow> )
8 9
9 10
diff --git a/noncore/unsupported/mail2/mainwindowbase.cpp b/noncore/unsupported/mail2/mainwindowbase.cpp
index 4e804c2..666cc4a 100644
--- a/noncore/unsupported/mail2/mainwindowbase.cpp
+++ b/noncore/unsupported/mail2/mainwindowbase.cpp
@@ -1,75 +1,75 @@
1#include <qpopupmenu.h> 1#include <qpopupmenu.h>
2#include <qaction.h> 2#include <qaction.h>
3#include <qheader.h> 3#include <qheader.h>
4#include <qlabel.h> 4#include <qlabel.h>
5#include <qvbox.h> 5#include <qvbox.h>
6 6
7#include <qpe/qpetoolbar.h> 7#include <qtoolbar.h>
8#include <qmenubar.h> 8#include <qmenubar.h>
9#include <qpe/resource.h> 9#include <qpe/resource.h>
10 10
11#include "mainwindowbase.h" 11#include "mainwindowbase.h"
12#include "mailstatusbar.h" 12#include "mailstatusbar.h"
13#include "folderwidget.h" 13#include "folderwidget.h"
14#include "mailtable.h" 14#include "mailtable.h"
15 15
16MainWindowBase::MainWindowBase(QWidget *parent, const char *name, WFlags fl) 16MainWindowBase::MainWindowBase(QWidget *parent, const char *name, WFlags fl)
17 : QMainWindow(parent, name, fl) 17 : QMainWindow(parent, name, fl)
18{ 18{
19 setCaption(tr("E-Mail")); 19 setCaption(tr("E-Mail"));
20 setToolBarsMovable(false); 20 setToolBarsMovable(false);
21 21
22 toolbar = new QToolBar(this); 22 toolbar = new QToolBar(this);
23 menubar = new QMenuBar( toolbar ); 23 menubar = new QMenuBar( toolbar );
24 mailmenu = new QPopupMenu( menubar ); 24 mailmenu = new QPopupMenu( menubar );
25 servermenu = new QPopupMenu( menubar ); 25 servermenu = new QPopupMenu( menubar );
26 menubar->insertItem( tr( "Mail" ), mailmenu ); 26 menubar->insertItem( tr( "Mail" ), mailmenu );
27 menubar->insertItem( tr( "Servers" ), servermenu ); 27 menubar->insertItem( tr( "Servers" ), servermenu );
28 28
29 addToolBar(toolbar); 29 addToolBar(toolbar);
30 toolbar->setHorizontalStretchable(true); 30 toolbar->setHorizontalStretchable(true);
31 31
32 QLabel *spacer = new QLabel(toolbar); 32 QLabel *spacer = new QLabel(toolbar);
33 spacer->setBackgroundMode(QWidget::PaletteButton); 33 spacer->setBackgroundMode(QWidget::PaletteButton);
34 toolbar->setStretchableWidget(spacer); 34 toolbar->setStretchableWidget(spacer);
35 35
36 compose = new QAction(tr("Compose new mail"), QIconSet(Resource::loadPixmap("mail/newmail")), 0, 0, this); 36 compose = new QAction(tr("Compose new mail"), QIconSet(Resource::loadPixmap("mail/newmail")), 0, 0, this);
37 compose->addTo(toolbar); 37 compose->addTo(toolbar);
38 compose->addTo(mailmenu); 38 compose->addTo(mailmenu);
39 39
40 sendQueue = new QAction(tr("Send queued mails"), QIconSet(Resource::loadPixmap("mail/sendqueue")), 0, 0, this); 40 sendQueue = new QAction(tr("Send queued mails"), QIconSet(Resource::loadPixmap("mail/sendqueue")), 0, 0, this);
41 sendQueue->addTo(toolbar); 41 sendQueue->addTo(toolbar);
42 sendQueue->addTo(mailmenu); 42 sendQueue->addTo(mailmenu);
43 43
44 folders = new QAction(tr("Show/hide folders"), QIconSet(Resource::loadPixmap("mail/folder")), 0, 0, this, 0, true); 44 folders = new QAction(tr("Show/hide folders"), QIconSet(Resource::loadPixmap("mail/folder")), 0, 0, this, 0, true);
45 folders->addTo(toolbar); 45 folders->addTo(toolbar);
46 folders->addTo(servermenu); 46 folders->addTo(servermenu);
47 connect(folders, SIGNAL(toggled(bool)), SLOT(slotFoldersToggled(bool))); 47 connect(folders, SIGNAL(toggled(bool)), SLOT(slotFoldersToggled(bool)));
48 48
49 findmails = new QAction(tr("Search mails"), QIconSet(Resource::loadPixmap("mail/find")), 0, 0, this); 49 findmails = new QAction(tr("Search mails"), QIconSet(Resource::loadPixmap("mail/find")), 0, 0, this);
50 findmails->addTo(toolbar); 50 findmails->addTo(toolbar);
51 findmails->addTo(mailmenu); 51 findmails->addTo(mailmenu);
52 52
53 configure = new QAction(tr("Configuration"), QIconSet(Resource::loadPixmap("mail/configure")), 0, 0, this); 53 configure = new QAction(tr("Configuration"), QIconSet(Resource::loadPixmap("mail/configure")), 0, 0, this);
54 configure->addTo(servermenu); 54 configure->addTo(servermenu);
55 55
56 QVBox *view = new QVBox(this); 56 QVBox *view = new QVBox(this);
57 setCentralWidget(view); 57 setCentralWidget(view);
58 58
59 folderView = new FolderWidget(view); 59 folderView = new FolderWidget(view);
60 folderView->setMinimumHeight(90); 60 folderView->setMinimumHeight(90);
61 folderView->setMaximumHeight(90); 61 folderView->setMaximumHeight(90);
62 folderView->hide(); 62 folderView->hide();
63 63
64 mailView = new MailTable(view); 64 mailView = new MailTable(view);
65 mailView->setMinimumHeight(50); 65 mailView->setMinimumHeight(50);
66 66
67 status = new MailStatusBar(view); 67 status = new MailStatusBar(view);
68} 68}
69 69
70void MainWindowBase::slotFoldersToggled(bool toggled) 70void MainWindowBase::slotFoldersToggled(bool toggled)
71{ 71{
72 if (folderView->isHidden() && toggled) folderView->show(); 72 if (folderView->isHidden() && toggled) folderView->show();
73 if (!folderView->isHidden() && !toggled) folderView->hide(); 73 if (!folderView->isHidden() && !toggled) folderView->hide();
74} 74}
75 75
diff --git a/noncore/unsupported/mail2/viewmailbase.cpp b/noncore/unsupported/mail2/viewmailbase.cpp
index f72026f..ff02a7d 100644
--- a/noncore/unsupported/mail2/viewmailbase.cpp
+++ b/noncore/unsupported/mail2/viewmailbase.cpp
@@ -1,75 +1,75 @@
1#include <qtextbrowser.h> 1#include <qtextbrowser.h>
2#include <qlistview.h> 2#include <qlistview.h>
3#include <qaction.h> 3#include <qaction.h>
4#include <qlabel.h> 4#include <qlabel.h>
5#include <qvbox.h> 5#include <qvbox.h>
6#include <qpopupmenu.h> 6#include <qpopupmenu.h>
7 7
8#include <qpe/qpetoolbar.h> 8#include <qtoolbar.h>
9#include <qmenubar.h> 9#include <qmenubar.h>
10#include <qpe/resource.h> 10#include <qpe/resource.h>
11 11
12#include "viewmailbase.h" 12#include "viewmailbase.h"
13#include "opendiag.h" 13#include "opendiag.h"
14 14
15ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl) 15ViewMailBase::ViewMailBase(QWidget *parent, const char *name, WFlags fl)
16 : QMainWindow(parent, name, fl) 16 : QMainWindow(parent, name, fl)
17{ 17{
18 setCaption(tr("E-Mail by %1")); 18 setCaption(tr("E-Mail by %1"));
19 setToolBarsMovable(false); 19 setToolBarsMovable(false);
20 20
21 toolbar = new QToolBar(this); 21 toolbar = new QToolBar(this);
22 menubar = new QMenuBar( toolbar ); 22 menubar = new QMenuBar( toolbar );
23 mailmenu = new QPopupMenu( menubar ); 23 mailmenu = new QPopupMenu( menubar );
24 menubar->insertItem( tr( "Mail" ), mailmenu ); 24 menubar->insertItem( tr( "Mail" ), mailmenu );
25 25
26 toolbar->setHorizontalStretchable(true); 26 toolbar->setHorizontalStretchable(true);
27 addToolBar(toolbar); 27 addToolBar(toolbar);
28 28
29 QLabel *spacer = new QLabel(toolbar); 29 QLabel *spacer = new QLabel(toolbar);
30 spacer->setBackgroundMode(QWidget::PaletteButton); 30 spacer->setBackgroundMode(QWidget::PaletteButton);
31 toolbar->setStretchableWidget(spacer); 31 toolbar->setStretchableWidget(spacer);
32 32
33 reply = new QAction(tr("Reply"), QIconSet(Resource::loadPixmap("mail/reply")), 0, 0, this); 33 reply = new QAction(tr("Reply"), QIconSet(Resource::loadPixmap("mail/reply")), 0, 0, this);
34 reply->addTo(toolbar); 34 reply->addTo(toolbar);
35 reply->addTo(mailmenu); 35 reply->addTo(mailmenu);
36 36
37 forward = new QAction(tr("Forward"), QIconSet(Resource::loadPixmap("mail/forward")), 0, 0, this); 37 forward = new QAction(tr("Forward"), QIconSet(Resource::loadPixmap("mail/forward")), 0, 0, this);
38 forward->addTo(toolbar); 38 forward->addTo(toolbar);
39 forward->addTo(mailmenu); 39 forward->addTo(mailmenu);
40 40
41 attachbutton = new QAction(tr("Attachments"), QIconSet(Resource::loadPixmap("mail/attach")), 0, 0, this, 0, true); 41 attachbutton = new QAction(tr("Attachments"), QIconSet(Resource::loadPixmap("mail/attach")), 0, 0, this, 0, true);
42 attachbutton->addTo(toolbar); 42 attachbutton->addTo(toolbar);
43 attachbutton->addTo(mailmenu); 43 attachbutton->addTo(mailmenu);
44 connect(attachbutton, SIGNAL(toggled(bool)), SLOT(slotChangeAttachview(bool))); 44 connect(attachbutton, SIGNAL(toggled(bool)), SLOT(slotChangeAttachview(bool)));
45 45
46 deleteMail = new QAction(tr("Delete Mail"), QIconSet(Resource::loadPixmap("mail/delete")), 0, 0, this); 46 deleteMail = new QAction(tr("Delete Mail"), QIconSet(Resource::loadPixmap("mail/delete")), 0, 0, this);
47 deleteMail->addTo(toolbar); 47 deleteMail->addTo(toolbar);
48 deleteMail->addTo(mailmenu); 48 deleteMail->addTo(mailmenu);
49 49
50 QVBox *view = new QVBox(this); 50 QVBox *view = new QVBox(this);
51 setCentralWidget(view); 51 setCentralWidget(view);
52 52
53 attachments = new QListView(view); 53 attachments = new QListView(view);
54 attachments->setMinimumHeight(90); 54 attachments->setMinimumHeight(90);
55 attachments->setMaximumHeight(90); 55 attachments->setMaximumHeight(90);
56 attachments->setAllColumnsShowFocus(true); 56 attachments->setAllColumnsShowFocus(true);
57 attachments->addColumn("Mime Type", 100); 57 attachments->addColumn("Mime Type", 100);
58 attachments->addColumn("Filename", 100); 58 attachments->addColumn("Filename", 100);
59 attachments->addColumn("Description", 100); 59 attachments->addColumn("Description", 100);
60 attachments->hide(); 60 attachments->hide();
61 61
62 browser = new QTextBrowser(view); 62 browser = new QTextBrowser(view);
63 63
64 openDiag = new OpenDiag(view); 64 openDiag = new OpenDiag(view);
65 openDiag->hide(); 65 openDiag->hide();
66 66
67} 67}
68 68
69void ViewMailBase::slotChangeAttachview(bool state) 69void ViewMailBase::slotChangeAttachview(bool state)
70{ 70{
71 if (state) attachments->show(); 71 if (state) attachments->show();
72 else attachments->hide(); 72 else attachments->hide();
73} 73}
74 74
75 75
diff --git a/noncore/unsupported/mailit/main.cpp b/noncore/unsupported/mailit/main.cpp
index 71f8877..1ccd666 100644
--- a/noncore/unsupported/mailit/main.cpp
+++ b/noncore/unsupported/mailit/main.cpp
@@ -1,25 +1,26 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2001 Trolltech AS. All rights reserved. 2** Copyright (C) 2001 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qt Palmtop Environment. 4** This file is part of Qt Palmtop Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19**********************************************************************/ 19**********************************************************************/
20#include <qpe/qpeapplication.h> 20#include <qpe/qpeapplication.h>
21#include "mailitwindow.h" 21#include "mailitwindow.h"
22 22
23#include <opie/oapplicationfactory.h> 23#include <opie/oapplicationfactory.h>
24 24
25using namespace Opie::Core;
25OPIE_EXPORT_APP( OApplicationFactory<MailItWindow> ) \ No newline at end of file 26OPIE_EXPORT_APP( OApplicationFactory<MailItWindow> ) \ No newline at end of file
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp
index cfaadbf..db4db71 100644
--- a/noncore/unsupported/oipkg/pmipkg.cpp
+++ b/noncore/unsupported/oipkg/pmipkg.cpp
@@ -1,207 +1,207 @@
1/*************************************************************************** 1/***************************************************************************
2 * * 2 * *
3 * This program is free software; you can redistribute it and/or modify * 3 * This program is free software; you can redistribute it and/or modify *
4 * it under the terms of the GNU General Public License as published by * 4 * it under the terms of the GNU General Public License as published by *
5 * the Free Software Foundation; either version 2 of the License, or * 5 * the Free Software Foundation; either version 2 of the License, or *
6 * (at your option) any later version. * 6 * (at your option) any later version. *
7 * * 7 * *
8 ***************************************************************************/ 8 ***************************************************************************/
9// (c) 2002 Patrick S. Vogt <tille@handhelds.org> 9// (c) 2002 Patrick S. Vogt <tille@handhelds.org>
10#include "pmipkg.h" 10#include "pmipkg.h"
11#include "pksettings.h" 11#include "pksettings.h"
12#include "package.h" 12#include "package.h"
13#include "packagelistitem.h" 13#include "packagelistitem.h"
14 14
15//#include <opie/oprocess.h> 15//#include <opie2/oprocess.h>
16#include <qpe/resource.h> 16#include <qpe/resource.h>
17#include <qpe/config.h> 17#include <qpe/config.h>
18#include <qpe/stringutil.h> 18#include <qpe/stringutil.h>
19#include <qpe/qpeapplication.h> 19#include <qpe/qpeapplication.h>
20#include <qdir.h> 20#include <qdir.h>
21#include <qfile.h> 21#include <qfile.h>
22#include <qgroupbox.h> 22#include <qgroupbox.h>
23#include <qmultilineedit.h> 23#include <qmultilineedit.h>
24#include <qstring.h> 24#include <qstring.h>
25#include <qcheckbox.h> 25#include <qcheckbox.h>
26#include <qtextstream.h> 26#include <qtextstream.h>
27#include <qtextview.h> 27#include <qtextview.h>
28#include <qmessagebox.h> 28#include <qmessagebox.h>
29#include <qprogressbar.h> 29#include <qprogressbar.h>
30#include <qpushbutton.h> 30#include <qpushbutton.h>
31#include <qlayout.h> 31#include <qlayout.h>
32 32
33#include <stdlib.h> 33#include <stdlib.h>
34#include <unistd.h> 34#include <unistd.h>
35 35
36#include "mainwindow.h" 36#include "mainwindow.h"
37 37
38 38
39 39
40PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f ) 40PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f )
41 : QObject ( p ) 41 : QObject ( p )
42{ 42{
43 settings = s; 43 settings = s;
44 runwindow = new RunWindow( p, name, true, f ); 44 runwindow = new RunWindow( p, name, true, f );
45 45
46 Config cfg( "oipkg", Config::User ); 46 Config cfg( "oipkg", Config::User );
47 cfg.setGroup( "ipkg" ); 47 cfg.setGroup( "ipkg" );
48 ipkg_cmd = cfg.readEntry( "cmd", "ipkg" )+" "; 48 ipkg_cmd = cfg.readEntry( "cmd", "ipkg" )+" ";
49} 49}
50 50
51PmIpkg::~PmIpkg() 51PmIpkg::~PmIpkg()
52{ 52{
53} 53}
54 54
55bool PmIpkg::runIpkg(const QString& args, const QString& dest ) 55bool PmIpkg::runIpkg(const QString& args, const QString& dest )
56{ 56{
57 bool ret=false; 57 bool ret=false;
58 QDir::setCurrent("/tmp"); 58 QDir::setCurrent("/tmp");
59 QString cmd = ipkg_cmd; 59 QString cmd = ipkg_cmd;
60 pvDebug( 3,"PmIpkg::runIpkg got dest="+dest); 60 pvDebug( 3,"PmIpkg::runIpkg got dest="+dest);
61 if (!args.contains("update")) 61 if (!args.contains("update"))
62 { 62 {
63 if ( dest == "" ) 63 if ( dest == "" )
64 cmd += " -dest "+settings->getDestinationName(); 64 cmd += " -dest "+settings->getDestinationName();
65 else 65 else
66 cmd += " -dest "+ dest; 66 cmd += " -dest "+ dest;
67 67
68 cmd += " -force-defaults "; 68 cmd += " -force-defaults ";
69 69
70 if ( installDialog && installDialog->_force_depends ) 70 if ( installDialog && installDialog->_force_depends )
71 { 71 {
72 if (installDialog->_force_depends->isChecked()) 72 if (installDialog->_force_depends->isChecked())
73 cmd += " -force-depends "; 73 cmd += " -force-depends ";
74 if (installDialog->_force_reinstall->isChecked()) 74 if (installDialog->_force_reinstall->isChecked())
75 cmd += " -force-reinstall "; 75 cmd += " -force-reinstall ";
76 if (installDialog->_force_remove->isChecked()) 76 if (installDialog->_force_remove->isChecked())
77 cmd += " -force-removal-of-essential-packages "; 77 cmd += " -force-removal-of-essential-packages ";
78 if (installDialog->_force_overwrite->isChecked()) 78 if (installDialog->_force_overwrite->isChecked())
79 cmd += " -force-overwrite "; 79 cmd += " -force-overwrite ";
80 } 80 }
81 } //!args.contains("update") 81 } //!args.contains("update")
82 82
83 out( "Starting to "+ args+"\n"); 83 out( "Starting to "+ args+"\n");
84 qApp->processEvents(); 84 qApp->processEvents();
85 cmd += args; 85 cmd += args;
86 out( "running:\n"+cmd+"\n" ); 86 out( "running:\n"+cmd+"\n" );
87 pvDebug(2,"running:"+cmd); 87 pvDebug(2,"running:"+cmd);
88 qApp->processEvents(); 88 qApp->processEvents();
89 FILE *fp; 89 FILE *fp;
90 char line[130]; 90 char line[130];
91 QString lineStr, lineStrOld; 91 QString lineStr, lineStrOld;
92 sleep(1); 92 sleep(1);
93 cmd +=" 2>&1"; 93 cmd +=" 2>&1";
94 fp = popen( (const char *) cmd, "r"); 94 fp = popen( (const char *) cmd, "r");
95 if ( fp == NULL ) { 95 if ( fp == NULL ) {
96 qDebug("Could not execute '" + cmd + "'! err=%d", fp); 96 qDebug("Could not execute '" + cmd + "'! err=%d", fp);
97 out("\nError while executing "+ cmd+"\n\n"); 97 out("\nError while executing "+ cmd+"\n\n");
98 ret = false; 98 ret = false;
99 } else { 99 } else {
100 while ( fgets( line, sizeof line, fp) != NULL) 100 while ( fgets( line, sizeof line, fp) != NULL)
101 { 101 {
102 lineStr = line; 102 lineStr = line;
103 lineStr=lineStr.left(lineStr.length()-1); 103 lineStr=lineStr.left(lineStr.length()-1);
104 //Configuring opie-oipkg...Done 104 //Configuring opie-oipkg...Done
105 if (lineStr.contains("Done")) ret = true; 105 if (lineStr.contains("Done")) ret = true;
106 if (lineStr!=lineStrOld) 106 if (lineStr!=lineStrOld)
107 out(lineStr); 107 out(lineStr);
108 lineStrOld = lineStr; 108 lineStrOld = lineStr;
109 qApp->processEvents(); 109 qApp->processEvents();
110 } 110 }
111 } 111 }
112 pclose(fp); 112 pclose(fp);
113 pvDebug(2,QString(ret?"success\n":"failure\n")); 113 pvDebug(2,QString(ret?"success\n":"failure\n"));
114 return ret; 114 return ret;
115} 115}
116 116
117void PmIpkg::makeLinks(OipkgPackage *pack) 117void PmIpkg::makeLinks(OipkgPackage *pack)
118{ 118{
119 pvDebug( 2, "PmIpkg::makeLinks "+ pack->name()); 119 pvDebug( 2, "PmIpkg::makeLinks "+ pack->name());
120 QString pn = pack->name(); 120 QString pn = pack->name();
121 linkPackage( pack->packageName(), pack->dest() ); 121 linkPackage( pack->packageName(), pack->dest() );
122} 122}
123 123
124QStringList* PmIpkg::getList( QString packFileName, QString d ) 124QStringList* PmIpkg::getList( QString packFileName, QString d )
125{ 125{
126 QString dest = settings->getDestinationUrlByName( d ); 126 QString dest = settings->getDestinationUrlByName( d );
127 dest = dest==""?d:dest; 127 dest = dest==""?d:dest;
128 // if (dest == "/" ) return 0; 128 // if (dest == "/" ) return 0;
129 { 129 {
130 Config cfg( "oipkg", Config::User ); 130 Config cfg( "oipkg", Config::User );
131 cfg.setGroup( "Common" ); 131 cfg.setGroup( "Common" );
132 QString statusDir = cfg.readEntry( "statusDir", "" ); 132 QString statusDir = cfg.readEntry( "statusDir", "" );
133 } 133 }
134 QString packFileDir = dest+"/"+statusDir+"/info/"+packFileName+".list"; 134 QString packFileDir = dest+"/"+statusDir+"/info/"+packFileName+".list";
135 QFile f( packFileDir ); 135 QFile f( packFileDir );
136 qDebug("Try to open %s", packFileDir.latin1()); 136 qDebug("Try to open %s", packFileDir.latin1());
137 if ( ! f.open(IO_ReadOnly) ) 137 if ( ! f.open(IO_ReadOnly) )
138 { 138 {
139 out( "Could not open:\n"+packFileDir ); 139 out( "Could not open:\n"+packFileDir );
140 f.close(); 140 f.close();
141 packFileDir = "/"+statusDir+"/info/"+packFileName+".list"; 141 packFileDir = "/"+statusDir+"/info/"+packFileName+".list";
142 f.setName( packFileDir ); 142 f.setName( packFileDir );
143 qDebug("Try to open %s", packFileDir.latin1()); 143 qDebug("Try to open %s", packFileDir.latin1());
144 if ( ! f.open(IO_ReadOnly) ) 144 if ( ! f.open(IO_ReadOnly) )
145 { 145 {
146 qDebug(" Panik! Could not open"+packFileDir); 146 qDebug(" Panik! Could not open"+packFileDir);
147 out( "Could not open:\n"+packFileDir+"\n Panik!" ); 147 out( "Could not open:\n"+packFileDir+"\n Panik!" );
148 return (QStringList*)0; 148 return (QStringList*)0;
149 } 149 }
150 } 150 }
151 QStringList *fileList = new QStringList(); 151 QStringList *fileList = new QStringList();
152 QTextStream t( &f ); 152 QTextStream t( &f );
153 while ( !t.eof() ) 153 while ( !t.eof() )
154 { 154 {
155 *fileList += t.readLine(); 155 *fileList += t.readLine();
156 } 156 }
157 f.close(); 157 f.close();
158 return fileList; 158 return fileList;
159} 159}
160 160
161void PmIpkg::linkPackage( QString packFileName, QString dest ) 161void PmIpkg::linkPackage( QString packFileName, QString dest )
162{ 162{
163 if (dest == "root" || dest == "/" ) return; 163 if (dest == "root" || dest == "/" ) return;
164 QStringList *fileList = getList( packFileName, dest ); 164 QStringList *fileList = getList( packFileName, dest );
165 processFileList( fileList, dest ); 165 processFileList( fileList, dest );
166 delete fileList; 166 delete fileList;
167} 167}
168 168
169void PmIpkg::processFileList( QStringList *fileList, QString d ) 169void PmIpkg::processFileList( QStringList *fileList, QString d )
170{ 170{
171 if (!fileList || fileList->isEmpty()) return; 171 if (!fileList || fileList->isEmpty()) return;
172 for (uint i=0; i < fileList->count(); i++) 172 for (uint i=0; i < fileList->count(); i++)
173 { 173 {
174 QString dest = settings->getDestinationUrlByName( d ); 174 QString dest = settings->getDestinationUrlByName( d );
175 dest = dest==""?d:dest; 175 dest = dest==""?d:dest;
176 processLinkDir( (*fileList)[i], dest ); 176 processLinkDir( (*fileList)[i], dest );
177 } 177 }
178} 178}
179 179
180 180
181void PmIpkg::processLinkDir( QString file, QString dest ) 181void PmIpkg::processLinkDir( QString file, QString dest )
182{ 182{
183 pvDebug( 4,"PmIpkg::processLinkDir "+file+" to "+ dest); 183 pvDebug( 4,"PmIpkg::processLinkDir "+file+" to "+ dest);
184 if (linkOpp==createLink) pvDebug( 4,"opp: createLink"); 184 if (linkOpp==createLink) pvDebug( 4,"opp: createLink");
185 if (linkOpp==removeLink) pvDebug( 4,"opp: removeLink"); 185 if (linkOpp==removeLink) pvDebug( 4,"opp: removeLink");
186 if ( dest == "???" || dest == "" ) return; 186 if ( dest == "???" || dest == "" ) return;
187 QString destFile = file; 187 QString destFile = file;
188 file = dest+"/"+file; 188 file = dest+"/"+file;
189 if (file == dest) return; 189 if (file == dest) return;
190// if (linkOpp==createLink) out( "\ncreating links\n" ); 190// if (linkOpp==createLink) out( "\ncreating links\n" );
191 // if (linkOpp==removeLink) out( "\nremoving links\n" ); 191 // if (linkOpp==removeLink) out( "\nremoving links\n" );
192 QFileInfo fileInfo( file ); 192 QFileInfo fileInfo( file );
193 if ( fileInfo.isDir() ) 193 if ( fileInfo.isDir() )
194 { 194 {
195 pvDebug(4, "process dir "+file); 195 pvDebug(4, "process dir "+file);
196 QDir destDir( destFile ); 196 QDir destDir( destFile );
197 if (linkOpp==createLink) destDir.mkdir( destFile, true ); 197 if (linkOpp==createLink) destDir.mkdir( destFile, true );
198 QDir d( file ); 198 QDir d( file );
199// d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); 199// d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks );
200 const QFileInfoList *list = d.entryInfoList(); 200 const QFileInfoList *list = d.entryInfoList();
201 QFileInfoListIterator it( *list ); 201 QFileInfoListIterator it( *list );
202 QFileInfo *fi; 202 QFileInfo *fi;
203 while ( (fi=it.current()) ) 203 while ( (fi=it.current()) )
204 { 204 {
205 pvDebug(4, "processLinkDir "+fi->absFilePath()); 205 pvDebug(4, "processLinkDir "+fi->absFilePath());
206 processLinkDir( fi->absFilePath(), dest ); 206 processLinkDir( fi->absFilePath(), dest );
207 ++it; 207 ++it;
diff --git a/noncore/unsupported/qpdf/qpdf.cpp b/noncore/unsupported/qpdf/qpdf.cpp
index 75e86d0..df9df54 100644
--- a/noncore/unsupported/qpdf/qpdf.cpp
+++ b/noncore/unsupported/qpdf/qpdf.cpp
@@ -1,215 +1,215 @@
1//======================================================================== 1//========================================================================
2// 2//
3// qpdf.cc 3// qpdf.cc
4// 4//
5// Copyright 2001 Robert Griebl 5// Copyright 2001 Robert Griebl
6// 6//
7//======================================================================== 7//========================================================================
8 8
9#include "aconf.h" 9#include "aconf.h"
10#include "GString.h" 10#include "GString.h"
11#include "PDFDoc.h" 11#include "PDFDoc.h"
12#include "TextOutputDev.h" 12#include "TextOutputDev.h"
13 13
14#include "QPEOutputDev.h" 14#include "QPEOutputDev.h"
15 15
16#include <qpe/qpeapplication.h> 16#include <qpe/qpeapplication.h>
17#include <qpe/resource.h> 17#include <qpe/resource.h>
18#include <qpe/applnk.h> 18#include <qpe/applnk.h>
19#include <qpe/qcopenvelope_qws.h> 19#include <qpe/qcopenvelope_qws.h>
20 20
21 21
22#include <qclipboard.h> 22#include <qclipboard.h>
23#include <qpe/qpetoolbar.h> 23#include <qtoolbar.h>
24#include <qtoolbutton.h> 24#include <qtoolbutton.h>
25#include <qmenubar.h> 25#include <qmenubar.h>
26#include <qpopupmenu.h> 26#include <qpopupmenu.h>
27#include <qwidgetstack.h> 27#include <qwidgetstack.h>
28#include <qtimer.h> 28#include <qtimer.h>
29#include <qfileinfo.h> 29#include <qfileinfo.h>
30#include <qstring.h> 30#include <qstring.h>
31#include <qlineedit.h> 31#include <qlineedit.h>
32#include <qspinbox.h> 32#include <qspinbox.h>
33#include <qlayout.h> 33#include <qlayout.h>
34#include <qdialog.h> 34#include <qdialog.h>
35#include <qlabel.h> 35#include <qlabel.h>
36#include <qmessagebox.h> 36#include <qmessagebox.h>
37 37
38#include "qpdf.h" 38#include "qpdf.h"
39 39
40#ifdef QPDF_QPE_ONLY 40#ifdef QPDF_QPE_ONLY
41#include <qpe/fileselector.h> 41#include <qpe/fileselector.h>
42#else 42#else
43#include <opie/ofileselector.h> 43#include <opie/ofileselector.h>
44#endif 44#endif
45 45
46 46
47int main ( int argc, char **argv ) 47int main ( int argc, char **argv )
48{ 48{
49 QPEApplication app ( argc, argv ); 49 QPEApplication app ( argc, argv );
50 50
51 // read config file 51 // read config file
52 globalParams = new GlobalParams ( "" ); 52 globalParams = new GlobalParams ( "" );
53 globalParams-> setErrQuiet ( true ); 53 globalParams-> setErrQuiet ( true );
54 54
55 QPdfDlg *dlg = new QPdfDlg ( ); 55 QPdfDlg *dlg = new QPdfDlg ( );
56 app. showMainDocumentWidget ( dlg ); 56 app. showMainDocumentWidget ( dlg );
57 57
58 if (( app. argc ( ) == 3 ) && ( app. argv ( ) [1] == QCString ( "-f" ))) 58 if (( app. argc ( ) == 3 ) && ( app. argv ( ) [1] == QCString ( "-f" )))
59 dlg-> openFile ( app. argv ( ) [2] ); 59 dlg-> openFile ( app. argv ( ) [2] );
60 60
61 return app. exec ( ); 61 return app. exec ( );
62} 62}
63 63
64 64
65QPdfDlg::QPdfDlg ( ) : QMainWindow ( ) 65QPdfDlg::QPdfDlg ( ) : QMainWindow ( )
66{ 66{
67 setCaption ( tr( "QPdf" )); 67 setCaption ( tr( "QPdf" ));
68 setIcon ( Resource::loadPixmap ( "qpdf_icon" )); 68 setIcon ( Resource::loadPixmap ( "qpdf_icon" ));
69 69
70 m_busy = false; 70 m_busy = false;
71 71
72 m_doc = 0; 72 m_doc = 0;
73 m_pages = 0; 73 m_pages = 0;
74 m_zoom = 72; 74 m_zoom = 72;
75 m_currentpage = 0; 75 m_currentpage = 0;
76 76
77 m_fullscreen = false; 77 m_fullscreen = false;
78 m_renderok = false; 78 m_renderok = false;
79 79
80 80
81 setToolBarsMovable ( false ); 81 setToolBarsMovable ( false );
82 82
83 m_stack = new QWidgetStack ( this ); 83 m_stack = new QWidgetStack ( this );
84 m_stack-> setSizePolicy ( QSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Expanding )); 84 m_stack-> setSizePolicy ( QSizePolicy ( QSizePolicy::Expanding, QSizePolicy::Expanding ));
85 setCentralWidget ( m_stack ); 85 setCentralWidget ( m_stack );
86 86
87 m_outdev = new QPEOutputDev ( m_stack ); 87 m_outdev = new QPEOutputDev ( m_stack );
88 connect ( m_outdev, SIGNAL( selectionChanged(const QRect&)), this, SLOT( copyToClipboard(const QRect&))); 88 connect ( m_outdev, SIGNAL( selectionChanged(const QRect&)), this, SLOT( copyToClipboard(const QRect&)));
89 89
90#ifdef QPDF_QPE_ONLY 90#ifdef QPDF_QPE_ONLY
91 m_filesel = new FileSelector ( "application/pdf", m_stack, "fs", false, true ); 91 m_filesel = new FileSelector ( "application/pdf", m_stack, "fs", false, true );
92#else 92#else
93 m_filesel = new OFileSelector ( "application/pdf", m_stack, "fs", false, true ); 93 m_filesel = new OFileSelector ( "application/pdf", m_stack, "fs", false, true );
94#endif 94#endif
95 95
96 connect ( m_filesel, SIGNAL( closeMe()), this, SLOT( closeFileSelector())); 96 connect ( m_filesel, SIGNAL( closeMe()), this, SLOT( closeFileSelector()));
97 connect ( m_filesel, SIGNAL( fileSelected(const DocLnk&)), this, SLOT( openFile(const DocLnk&))); 97 connect ( m_filesel, SIGNAL( fileSelected(const DocLnk&)), this, SLOT( openFile(const DocLnk&)));
98 98
99 m_tb_menu = new QToolBar ( this ); 99 m_tb_menu = new QToolBar ( this );
100 m_tb_menu-> setHorizontalStretchable ( true ); 100 m_tb_menu-> setHorizontalStretchable ( true );
101 101
102 QMenuBar *mb = new QMenuBar ( m_tb_menu ); 102 QMenuBar *mb = new QMenuBar ( m_tb_menu );
103 103
104 m_pm_zoom = new QPopupMenu ( mb ); 104 m_pm_zoom = new QPopupMenu ( mb );
105 m_pm_zoom-> setCheckable ( true ); 105 m_pm_zoom-> setCheckable ( true );
106 106
107 mb-> insertItem ( tr( "Zoom" ), m_pm_zoom ); 107 mb-> insertItem ( tr( "Zoom" ), m_pm_zoom );
108 108
109 m_pm_zoom-> insertItem ( tr( "Fit to width" ), 1 ); 109 m_pm_zoom-> insertItem ( tr( "Fit to width" ), 1 );
110 m_pm_zoom-> insertItem ( tr( "Fit to page" ), 2 ); 110 m_pm_zoom-> insertItem ( tr( "Fit to page" ), 2 );
111 m_pm_zoom-> insertSeparator ( ); 111 m_pm_zoom-> insertSeparator ( );
112 m_pm_zoom-> insertItem ( tr( "50%" ), 50 ); 112 m_pm_zoom-> insertItem ( tr( "50%" ), 50 );
113 m_pm_zoom-> insertItem ( tr( "75%" ), 75 ); 113 m_pm_zoom-> insertItem ( tr( "75%" ), 75 );
114 m_pm_zoom-> insertItem ( tr( "100%" ), 100 ); 114 m_pm_zoom-> insertItem ( tr( "100%" ), 100 );
115 m_pm_zoom-> insertItem ( tr( "125%" ), 125 ); 115 m_pm_zoom-> insertItem ( tr( "125%" ), 125 );
116 m_pm_zoom-> insertItem ( tr( "150%" ), 150 ); 116 m_pm_zoom-> insertItem ( tr( "150%" ), 150 );
117 m_pm_zoom-> insertItem ( tr( "200%" ), 200 ); 117 m_pm_zoom-> insertItem ( tr( "200%" ), 200 );
118 118
119 connect ( m_pm_zoom, SIGNAL( activated(int)), this, SLOT( setZoom(int))); 119 connect ( m_pm_zoom, SIGNAL( activated(int)), this, SLOT( setZoom(int)));
120 120
121 m_tb_tool = new QToolBar ( this ); 121 m_tb_tool = new QToolBar ( this );
122 122
123 new QToolButton ( Resource::loadIconSet ( "fileopen" ), tr( "Open..." ), QString::null, this, SLOT( openFile()), m_tb_tool, "open" ); 123 new QToolButton ( Resource::loadIconSet ( "fileopen" ), tr( "Open..." ), QString::null, this, SLOT( openFile()), m_tb_tool, "open" );
124 m_tb_tool-> addSeparator ( ); 124 m_tb_tool-> addSeparator ( );
125 m_to_find = new QToolButton ( Resource::loadIconSet ( "find" ), tr( "Find..." ), QString::null, this, SLOT( toggleFindBar()), m_tb_tool, "find" ); 125 m_to_find = new QToolButton ( Resource::loadIconSet ( "find" ), tr( "Find..." ), QString::null, this, SLOT( toggleFindBar()), m_tb_tool, "find" );
126 m_to_find-> setToggleButton ( true ); 126 m_to_find-> setToggleButton ( true );
127 m_tb_tool-> addSeparator ( ); 127 m_tb_tool-> addSeparator ( );
128 m_to_full = new QToolButton ( Resource::loadIconSet ( "fullscreen" ), tr( "Fullscreen" ), QString::null, this, SLOT( toggleFullscreen()), m_tb_tool, "fullscreen" ); 128 m_to_full = new QToolButton ( Resource::loadIconSet ( "fullscreen" ), tr( "Fullscreen" ), QString::null, this, SLOT( toggleFullscreen()), m_tb_tool, "fullscreen" );
129 m_to_full-> setToggleButton ( true ); 129 m_to_full-> setToggleButton ( true );
130 m_tb_tool-> addSeparator ( ); 130 m_tb_tool-> addSeparator ( );
131 new QToolButton ( Resource::loadIconSet ( "fastback" ), tr( "First page" ), QString::null, this, SLOT( firstPage()), m_tb_tool, "first" ); 131 new QToolButton ( Resource::loadIconSet ( "fastback" ), tr( "First page" ), QString::null, this, SLOT( firstPage()), m_tb_tool, "first" );
132 new QToolButton ( Resource::loadIconSet ( "back" ), tr( "Previous page" ), QString::null, this, SLOT( prevPage()), m_tb_tool, "prev" ); 132 new QToolButton ( Resource::loadIconSet ( "back" ), tr( "Previous page" ), QString::null, this, SLOT( prevPage()), m_tb_tool, "prev" );
133 new QToolButton ( Resource::loadIconSet ( "down" ), tr( "Goto page..." ), QString::null, this, SLOT( gotoPageDialog()), m_tb_tool, "goto" ); 133 new QToolButton ( Resource::loadIconSet ( "down" ), tr( "Goto page..." ), QString::null, this, SLOT( gotoPageDialog()), m_tb_tool, "goto" );
134 new QToolButton ( Resource::loadIconSet ( "forward" ), tr( "Next page" ), QString::null, this, SLOT( nextPage()), m_tb_tool, "next" ); 134 new QToolButton ( Resource::loadIconSet ( "forward" ), tr( "Next page" ), QString::null, this, SLOT( nextPage()), m_tb_tool, "next" );
135 new QToolButton ( Resource::loadIconSet ( "fastforward" ), tr( "Last page" ), QString::null, this, SLOT( lastPage()), m_tb_tool, "last" ); 135 new QToolButton ( Resource::loadIconSet ( "fastforward" ), tr( "Last page" ), QString::null, this, SLOT( lastPage()), m_tb_tool, "last" );
136 136
137 m_tb_find = new QToolBar ( this ); 137 m_tb_find = new QToolBar ( this );
138 addToolBar ( m_tb_find, "Search", QMainWindow::Top, true ); 138 addToolBar ( m_tb_find, "Search", QMainWindow::Top, true );
139 m_tb_find-> setHorizontalStretchable ( true ); 139 m_tb_find-> setHorizontalStretchable ( true );
140 m_tb_find-> hide ( ); 140 m_tb_find-> hide ( );
141 141
142 m_findedit = new QLineEdit ( m_tb_find, "findedit" ); 142 m_findedit = new QLineEdit ( m_tb_find, "findedit" );
143 m_tb_find-> setStretchableWidget ( m_findedit ); 143 m_tb_find-> setStretchableWidget ( m_findedit );
144 connect ( m_findedit, SIGNAL( textChanged(const QString&)), this, SLOT( findText(const QString&))); 144 connect ( m_findedit, SIGNAL( textChanged(const QString&)), this, SLOT( findText(const QString&)));
145 145
146 new QToolButton ( Resource::loadIconSet ( "next" ), tr( "Next" ), QString::null, this, SLOT( findText()), m_tb_find, "findnext" ); 146 new QToolButton ( Resource::loadIconSet ( "next" ), tr( "Next" ), QString::null, this, SLOT( findText()), m_tb_find, "findnext" );
147 147
148 openFile ( ); 148 openFile ( );
149} 149}
150 150
151QPdfDlg::~QPdfDlg ( ) 151QPdfDlg::~QPdfDlg ( )
152{ 152{
153 delete m_doc; 153 delete m_doc;
154} 154}
155 155
156// vv Fullscreen handling (for broken QT-lib) [David Hedbor, www.eongames.com] 156// vv Fullscreen handling (for broken QT-lib) [David Hedbor, www.eongames.com]
157 157
158void QPdfDlg::resizeEvent ( QResizeEvent * ) 158void QPdfDlg::resizeEvent ( QResizeEvent * )
159{ 159{
160 if ( m_fullscreen && ( size ( ) != qApp-> desktop ( )-> size ( ))) 160 if ( m_fullscreen && ( size ( ) != qApp-> desktop ( )-> size ( )))
161 setFullscreen ( true ); 161 setFullscreen ( true );
162} 162}
163 163
164void QPdfDlg::focusInEvent ( QFocusEvent * ) 164void QPdfDlg::focusInEvent ( QFocusEvent * )
165{ 165{
166 if ( m_fullscreen ) 166 if ( m_fullscreen )
167 setFullscreen ( true ); 167 setFullscreen ( true );
168} 168}
169 169
170void QPdfDlg::toggleFullscreen ( ) 170void QPdfDlg::toggleFullscreen ( )
171{ 171{
172 if ( m_to_full-> isOn ( ) == m_fullscreen ) 172 if ( m_to_full-> isOn ( ) == m_fullscreen )
173 m_to_full-> setOn ( !m_fullscreen ); 173 m_to_full-> setOn ( !m_fullscreen );
174 174
175 m_fullscreen = !m_fullscreen; 175 m_fullscreen = !m_fullscreen;
176 setFullscreen ( m_fullscreen ); 176 setFullscreen ( m_fullscreen );
177} 177}
178 178
179void QPdfDlg::setFullscreen ( bool b ) 179void QPdfDlg::setFullscreen ( bool b )
180{ 180{
181 static QSize normalsize; 181 static QSize normalsize;
182 182
183 if ( b ) { 183 if ( b ) {
184 if ( !normalsize. isValid ( )) 184 if ( !normalsize. isValid ( ))
185 normalsize = size ( ); 185 normalsize = size ( );
186 186
187 setFixedSize ( qApp-> desktop ( )-> size ( )); 187 setFixedSize ( qApp-> desktop ( )-> size ( ));
188 showNormal ( ); 188 showNormal ( );
189 reparent ( 0, WStyle_Customize | WStyle_NoBorder, QPoint ( 0, 0 )); 189 reparent ( 0, WStyle_Customize | WStyle_NoBorder, QPoint ( 0, 0 ));
190 showFullScreen ( ); 190 showFullScreen ( );
191 } 191 }
192 else { 192 else {
193 showNormal ( ); 193 showNormal ( );
194 reparent ( 0, 0, QPoint ( 0, 0 )); 194 reparent ( 0, 0, QPoint ( 0, 0 ));
195 resize ( normalsize ); 195 resize ( normalsize );
196 showMaximized ( ); 196 showMaximized ( );
197 normalsize = QSize ( ); 197 normalsize = QSize ( );
198 } 198 }
199} 199}
200 200
201// ^^ Fullscreen handling (for broken QT-lib) 201// ^^ Fullscreen handling (for broken QT-lib)
202 202
203void QPdfDlg::setBusy ( bool b ) 203void QPdfDlg::setBusy ( bool b )
204{ 204{
205 if ( b != m_busy ) { 205 if ( b != m_busy ) {
206 m_busy = b; 206 m_busy = b;
207 207
208 m_outdev-> setBusy ( m_busy ); 208 m_outdev-> setBusy ( m_busy );
209 setEnabled ( !m_busy ); 209 setEnabled ( !m_busy );
210 } 210 }
211} 211}
212 212
213bool QPdfDlg::busy ( ) const 213bool QPdfDlg::busy ( ) const
214{ 214{
215 return m_busy; 215 return m_busy;