author | zecke <zecke> | 2002-06-23 14:19:13 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-06-23 14:19:13 (UTC) |
commit | ce9178fb13908eca5b7835e785fc0914a5022615 (patch) (unidiff) | |
tree | d848ef07fb25ba6c21d3729140c4e3be9d69f6f6 | |
parent | 3b02ead2254e59159db948d2a0980892eeb14ed8 (diff) | |
download | opie-ce9178fb13908eca5b7835e785fc0914a5022615.zip opie-ce9178fb13908eca5b7835e785fc0914a5022615.tar.gz opie-ce9178fb13908eca5b7835e785fc0914a5022615.tar.bz2 |
Simon thanks for the patch. Some clean ups. Patch provided by tronical
OAOAOAOAOAOAOAOAOAOAOAOAOBOBCVS: noncore/tools/remote/dvdgroupconf.cpp
29 files changed, 51 insertions, 48 deletions
diff --git a/core/applets/cardmon/cardmon.cpp b/core/applets/cardmon/cardmon.cpp index 3dd9f54..93bc97a 100644 --- a/core/applets/cardmon/cardmon.cpp +++ b/core/applets/cardmon/cardmon.cpp | |||
@@ -131,49 +131,49 @@ void CardMonitor::mousePressEvent( QMouseEvent * ) { | |||
131 | if ( ( err == 127 ) || ( err < 0 ) ) { | 131 | if ( ( err == 127 ) || ( err < 0 ) ) { |
132 | qDebug("Could not execute `/sbin/cardctl eject 1'! err=%d", err); | 132 | qDebug("Could not execute `/sbin/cardctl eject 1'! err=%d", err); |
133 | popUp( tr("CF/PCMCIA card eject failed!")); | 133 | popUp( tr("CF/PCMCIA card eject failed!")); |
134 | } | 134 | } |
135 | } | 135 | } |
136 | 136 | ||
137 | delete menu; | 137 | delete menu; |
138 | } | 138 | } |
139 | 139 | ||
140 | 140 | ||
141 | void CardMonitor::cardMessage( const QCString &msg, const QByteArray & ) { | 141 | void CardMonitor::cardMessage( const QCString &msg, const QByteArray & ) { |
142 | if ( msg == "stabChanged()" ) { | 142 | if ( msg == "stabChanged()" ) { |
143 | // qDebug("Pcmcia: stabchanged"); | 143 | // qDebug("Pcmcia: stabchanged"); |
144 | if ( getStatusPcmcia() ) { | 144 | if ( getStatusPcmcia() ) { |
145 | repaint(FALSE); | 145 | repaint(FALSE); |
146 | } | 146 | } |
147 | } else if ( msg == "mtabChanged()" ) { | 147 | } else if ( msg == "mtabChanged()" ) { |
148 | // qDebug("Pcmcia: mtabchanged"); | 148 | // qDebug("Pcmcia: mtabchanged"); |
149 | if ( getStatusSd() ) { | 149 | if ( getStatusSd() ) { |
150 | repaint(FALSE); | 150 | repaint(FALSE); |
151 | } | 151 | } |
152 | } | 152 | } |
153 | } | 153 | } |
154 | 154 | ||
155 | bool CardMonitor::getStatusPcmcia( int showPopUp = FALSE ) { | 155 | bool CardMonitor::getStatusPcmcia( int showPopUp ) { |
156 | 156 | ||
157 | bool cardWas0 = cardInPcmcia0; // remember last state | 157 | bool cardWas0 = cardInPcmcia0; // remember last state |
158 | bool cardWas1 = cardInPcmcia1; | 158 | bool cardWas1 = cardInPcmcia1; |
159 | 159 | ||
160 | QString fileName; | 160 | QString fileName; |
161 | 161 | ||
162 | // one of these 3 files should exist | 162 | // one of these 3 files should exist |
163 | if (QFile::exists("/var/run/stab")) { | 163 | if (QFile::exists("/var/run/stab")) { |
164 | fileName = "/var/run/stab"; | 164 | fileName = "/var/run/stab"; |
165 | } else if (QFile::exists("/var/state/pcmcia/stab")) { | 165 | } else if (QFile::exists("/var/state/pcmcia/stab")) { |
166 | fileName="/var/state/pcmcia/stab"; | 166 | fileName="/var/state/pcmcia/stab"; |
167 | } else { | 167 | } else { |
168 | fileName="/var/lib/pcmcia/stab"; | 168 | fileName="/var/lib/pcmcia/stab"; |
169 | } | 169 | } |
170 | 170 | ||
171 | QFile f(fileName); | 171 | QFile f(fileName); |
172 | 172 | ||
173 | if ( f.open(IO_ReadOnly) ) { | 173 | if ( f.open(IO_ReadOnly) ) { |
174 | QStringList list; | 174 | QStringList list; |
175 | QTextStream stream ( &f); | 175 | QTextStream stream ( &f); |
176 | QString streamIn; | 176 | QString streamIn; |
177 | streamIn = stream.read(); | 177 | streamIn = stream.read(); |
178 | list = QStringList::split("\n", streamIn); | 178 | list = QStringList::split("\n", streamIn); |
179 | for(QStringList::Iterator line=list.begin(); line!=list.end(); line++) { | 179 | for(QStringList::Iterator line=list.begin(); line!=list.end(); line++) { |
@@ -214,49 +214,49 @@ bool CardMonitor::getStatusPcmcia( int showPopUp = FALSE ) { | |||
214 | if( !showPopUp && (cardWas0 != cardInPcmcia0 || cardWas1 != cardInPcmcia1)) { | 214 | if( !showPopUp && (cardWas0 != cardInPcmcia0 || cardWas1 != cardInPcmcia1)) { |
215 | QString text = ""; | 215 | QString text = ""; |
216 | if(cardWas0 != cardInPcmcia0) { | 216 | if(cardWas0 != cardInPcmcia0) { |
217 | if(cardInPcmcia0) { text += tr("New card: "); } | 217 | if(cardInPcmcia0) { text += tr("New card: "); } |
218 | else { text += tr("Ejected: "); } | 218 | else { text += tr("Ejected: "); } |
219 | text += cardInPcmcia0Name; | 219 | text += cardInPcmcia0Name; |
220 | } | 220 | } |
221 | if(cardWas0 != cardInPcmcia0 && cardWas1 != cardInPcmcia1) { | 221 | if(cardWas0 != cardInPcmcia0 && cardWas1 != cardInPcmcia1) { |
222 | text += "\n"; | 222 | text += "\n"; |
223 | } | 223 | } |
224 | if(cardWas1 != cardInPcmcia1) { | 224 | if(cardWas1 != cardInPcmcia1) { |
225 | if(cardInPcmcia1) { text += tr("New card: "); } | 225 | if(cardInPcmcia1) { text += tr("New card: "); } |
226 | else { text += tr("Ejected: "); } | 226 | else { text += tr("Ejected: "); } |
227 | text += cardInPcmcia1Name; | 227 | text += cardInPcmcia1Name; |
228 | } | 228 | } |
229 | popUp( text ); | 229 | popUp( text ); |
230 | } | 230 | } |
231 | 231 | ||
232 | f.close(); | 232 | f.close(); |
233 | 233 | ||
234 | return ((cardWas0 == cardInPcmcia0 || cardWas1 == cardInPcmcia1) ? FALSE : TRUE); | 234 | return ((cardWas0 == cardInPcmcia0 || cardWas1 == cardInPcmcia1) ? FALSE : TRUE); |
235 | } | 235 | } |
236 | 236 | ||
237 | 237 | ||
238 | bool CardMonitor::getStatusSd( int showPopUp = FALSE ) { | 238 | bool CardMonitor::getStatusSd( int showPopUp ) { |
239 | 239 | ||
240 | bool cardWas=cardInSd; // remember last state | 240 | bool cardWas=cardInSd; // remember last state |
241 | cardInSd=false; | 241 | cardInSd=false; |
242 | 242 | ||
243 | #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) | 243 | #if defined(_OS_LINUX_) || defined(Q_OS_LINUX) |
244 | struct mntent *me; | 244 | struct mntent *me; |
245 | FILE *mntfp = setmntent( "/etc/mtab", "r" ); | 245 | FILE *mntfp = setmntent( "/etc/mtab", "r" ); |
246 | 246 | ||
247 | if ( mntfp ) { | 247 | if ( mntfp ) { |
248 | while ( (me = getmntent( mntfp )) != 0 ) { | 248 | while ( (me = getmntent( mntfp )) != 0 ) { |
249 | QString fs = me->mnt_fsname; | 249 | QString fs = me->mnt_fsname; |
250 | if ( fs.left(7)=="/dev/sd" || fs.left(9) == "/dev/mmcd" ) { | 250 | if ( fs.left(7)=="/dev/sd" || fs.left(9) == "/dev/mmcd" ) { |
251 | cardInSd=true; | 251 | cardInSd=true; |
252 | } | 252 | } |
253 | } | 253 | } |
254 | endmntent( mntfp ); | 254 | endmntent( mntfp ); |
255 | } | 255 | } |
256 | if(!showPopUp && cardWas != cardInSd) { | 256 | if(!showPopUp && cardWas != cardInSd) { |
257 | QString text = ""; | 257 | QString text = ""; |
258 | if(cardInSd) { text += "SD Inserted"; } | 258 | if(cardInSd) { text += "SD Inserted"; } |
259 | else { text += "SD Removed"; } | 259 | else { text += "SD Removed"; } |
260 | popUp( text ); | 260 | popUp( text ); |
261 | } | 261 | } |
262 | 262 | ||
diff --git a/core/applets/vmemo/vmemo.cpp b/core/applets/vmemo/vmemo.cpp index b29ee62..4278f46 100644 --- a/core/applets/vmemo/vmemo.cpp +++ b/core/applets/vmemo/vmemo.cpp | |||
@@ -605,25 +605,26 @@ int VMemo::setToggleButton(int tog) { | |||
605 | break; | 605 | break; |
606 | case 2: | 606 | case 2: |
607 | return Key_Escape; | 607 | return Key_Escape; |
608 | break; | 608 | break; |
609 | case 3: | 609 | case 3: |
610 | return Key_Space; | 610 | return Key_Space; |
611 | break; | 611 | break; |
612 | case 4: | 612 | case 4: |
613 | return Key_F12; | 613 | return Key_F12; |
614 | break; | 614 | break; |
615 | case 5: | 615 | case 5: |
616 | return Key_F9; | 616 | return Key_F9; |
617 | break; | 617 | break; |
618 | case 6: | 618 | case 6: |
619 | return Key_F10; | 619 | return Key_F10; |
620 | break; | 620 | break; |
621 | case 7: | 621 | case 7: |
622 | return Key_F11; | 622 | return Key_F11; |
623 | break; | 623 | break; |
624 | case 8: | 624 | case 8: |
625 | return Key_F13; | 625 | return Key_F13; |
626 | break; | 626 | break; |
627 | }; | 627 | }; |
628 | } | 628 | } |
629 | return -1; | ||
629 | } | 630 | } |
diff --git a/libopie/ofileselector.cc b/libopie/ofileselector.cc index 8299b3d..7a67ab2 100644 --- a/libopie/ofileselector.cc +++ b/libopie/ofileselector.cc | |||
@@ -92,50 +92,50 @@ namespace { | |||
92 | private: | 92 | private: |
93 | bool mLocked:1; | 93 | bool mLocked:1; |
94 | bool dir:1; | 94 | bool dir:1; |
95 | QString m_dir; | 95 | QString m_dir; |
96 | }; | 96 | }; |
97 | }; | 97 | }; |
98 | 98 | ||
99 | 99 | ||
100 | OFileSelector::OFileSelector( QWidget *wid, int mode, int selector, | 100 | OFileSelector::OFileSelector( QWidget *wid, int mode, int selector, |
101 | const QString &dirName, | 101 | const QString &dirName, |
102 | const QString &fileName, | 102 | const QString &fileName, |
103 | const QStringList &mimeTypes ) | 103 | const QStringList &mimeTypes ) |
104 | : QWidget( wid, "OFileSelector") | 104 | : QWidget( wid, "OFileSelector") |
105 | { | 105 | { |
106 | m_mimetypes = mimeTypes; | 106 | m_mimetypes = mimeTypes; |
107 | initVars(); | 107 | initVars(); |
108 | m_mode = mode; | 108 | m_mode = mode; |
109 | m_selector = selector; | 109 | m_selector = selector; |
110 | m_currentDir = dirName; | 110 | m_currentDir = dirName; |
111 | init(); | 111 | init(); |
112 | QTimer::singleShot(6*1000, this, SLOT( slotTest() ) ); | 112 | QTimer::singleShot(6*1000, this, SLOT( slotTest() ) ); |
113 | } | 113 | } |
114 | 114 | ||
115 | OFileSelector::OFileSelector(const QString &mimeFilter, QWidget *parent, | 115 | OFileSelector::OFileSelector(const QString &mimeFilter, QWidget *parent, |
116 | const char *name, bool newVisible = TRUE, | 116 | const char *name, bool newVisible, |
117 | bool closeVisible = FALSE ) | 117 | bool closeVisible ) |
118 | : QWidget( parent, name ) | 118 | : QWidget( parent, name ) |
119 | { | 119 | { |
120 | m_mimetypes = QStringList::split(";", mimeFilter ); | 120 | m_mimetypes = QStringList::split(";", mimeFilter ); |
121 | initVars(); | 121 | initVars(); |
122 | m_currentDir = QPEApplication::documentDir(); | 122 | m_currentDir = QPEApplication::documentDir(); |
123 | m_mode = OPEN; | 123 | m_mode = OPEN; |
124 | m_selector = NORMAL; | 124 | m_selector = NORMAL; |
125 | m_shClose = closeVisible; | 125 | m_shClose = closeVisible; |
126 | m_shNew = newVisible; | 126 | m_shNew = newVisible; |
127 | m_shLne = false; | 127 | m_shLne = false; |
128 | m_shPerm = false; | 128 | m_shPerm = false; |
129 | m_shYesNo = false; | 129 | m_shYesNo = false; |
130 | init(); | 130 | init(); |
131 | 131 | ||
132 | 132 | ||
133 | } | 133 | } |
134 | 134 | ||
135 | OFileSelector::~OFileSelector() | 135 | OFileSelector::~OFileSelector() |
136 | { | 136 | { |
137 | 137 | ||
138 | } | 138 | } |
139 | 139 | ||
140 | void OFileSelector::setNewVisible( bool visible ) | 140 | void OFileSelector::setNewVisible( bool visible ) |
141 | { | 141 | { |
diff --git a/noncore/net/opieftp/opieftp.cpp b/noncore/net/opieftp/opieftp.cpp index 293c391..8f2b9c9 100644 --- a/noncore/net/opieftp/opieftp.cpp +++ b/noncore/net/opieftp/opieftp.cpp | |||
@@ -478,52 +478,52 @@ void OpieFtp::localUpload() | |||
478 | QString msg; | 478 | QString msg; |
479 | msg.sprintf(tr("Unable to upload\n")+"%s",FtpLastResponse(conn)); | 479 | msg.sprintf(tr("Unable to upload\n")+"%s",FtpLastResponse(conn)); |
480 | msg.replace(QRegExp(":"),"\n"); | 480 | msg.replace(QRegExp(":"),"\n"); |
481 | QMessageBox::message(tr("Note"),msg); | 481 | QMessageBox::message(tr("Note"),msg); |
482 | } | 482 | } |
483 | } else { | 483 | } else { |
484 | QMessageBox::message(tr("Note"),tr("Cannot upload directories")); | 484 | QMessageBox::message(tr("Note"),tr("Cannot upload directories")); |
485 | } | 485 | } |
486 | ProgressBar->reset(); | 486 | ProgressBar->reset(); |
487 | nullifyCallBack(); | 487 | nullifyCallBack(); |
488 | it.current()->setSelected(FALSE); | 488 | it.current()->setSelected(FALSE); |
489 | } //end currentSelected | 489 | } //end currentSelected |
490 | } | 490 | } |
491 | for ( ; it.current(); ++it ) { | 491 | for ( ; it.current(); ++it ) { |
492 | Local_View->clearSelection(); | 492 | Local_View->clearSelection(); |
493 | } | 493 | } |
494 | Local_View->clearFocus(); | 494 | Local_View->clearFocus(); |
495 | TabWidget->setCurrentPage(1); | 495 | TabWidget->setCurrentPage(1); |
496 | remoteDirList( (const QString &)currentRemoteDir); //this also calls populate | 496 | remoteDirList( (const QString &)currentRemoteDir); //this also calls populate |
497 | // QCopEnvelope ( "QPE/System", "notBusy()" ); | 497 | // QCopEnvelope ( "QPE/System", "notBusy()" ); |
498 | } | 498 | } |
499 | 499 | ||
500 | void OpieFtp::nullifyCallBack() | 500 | void OpieFtp::nullifyCallBack() |
501 | { | 501 | { |
502 | FtpOptions(FTPLIB_CALLBACK, NULL, conn); | 502 | FtpOptions(FTPLIB_CALLBACK, 0, conn); |
503 | FtpOptions(FTPLIB_IDLETIME, NULL, conn); | 503 | FtpOptions(FTPLIB_IDLETIME, 0, conn); |
504 | FtpOptions(FTPLIB_CALLBACKARG, NULL, conn); | 504 | FtpOptions(FTPLIB_CALLBACKARG, 0, conn); |
505 | FtpOptions(FTPLIB_CALLBACKBYTES, NULL, conn); | 505 | FtpOptions(FTPLIB_CALLBACKBYTES, 0, conn); |
506 | } | 506 | } |
507 | 507 | ||
508 | void OpieFtp::remoteDownload() | 508 | void OpieFtp::remoteDownload() |
509 | { | 509 | { |
510 | // qApp->processEvents(); | 510 | // qApp->processEvents(); |
511 | int fsz; | 511 | int fsz; |
512 | // QCopEnvelope ( "QPE/System", "busy()" ); | 512 | // QCopEnvelope ( "QPE/System", "busy()" ); |
513 | 513 | ||
514 | QList<QListViewItem> * getSelectedItems( QListView * Remote_View ); | 514 | QList<QListViewItem> * getSelectedItems( QListView * Remote_View ); |
515 | QListViewItemIterator it( Remote_View ); | 515 | QListViewItemIterator it( Remote_View ); |
516 | for ( ; it.current(); ++it ) { | 516 | for ( ; it.current(); ++it ) { |
517 | if ( it.current()->isSelected() ) { | 517 | if ( it.current()->isSelected() ) { |
518 | QString strItem = it.current()->text(0); | 518 | QString strItem = it.current()->text(0); |
519 | // strItem=strItem.right(strItem.length()-1); | 519 | // strItem=strItem.right(strItem.length()-1); |
520 | QString localFile = currentDir.canonicalPath(); | 520 | QString localFile = currentDir.canonicalPath(); |
521 | if(localFile.right(1).find("/",0,TRUE) == -1) | 521 | if(localFile.right(1).find("/",0,TRUE) == -1) |
522 | localFile += "/"; | 522 | localFile += "/"; |
523 | localFile += strItem; | 523 | localFile += strItem; |
524 | // QString localFile = currentDir.canonicalPath()+"/"+strItem; | 524 | // QString localFile = currentDir.canonicalPath()+"/"+strItem; |
525 | QString remoteFile= currentRemoteDir+strItem; | 525 | QString remoteFile= currentRemoteDir+strItem; |
526 | if (!FtpSize( remoteFile.latin1(), &fsz, FTPLIB_ASCII, conn)) | 526 | if (!FtpSize( remoteFile.latin1(), &fsz, FTPLIB_ASCII, conn)) |
527 | fsz = 0; | 527 | fsz = 0; |
528 | QString temp; | 528 | QString temp; |
529 | temp.sprintf( remoteFile+" "+" %dkb", fsz); | 529 | temp.sprintf( remoteFile+" "+" %dkb", fsz); |
diff --git a/noncore/settings/sound/soundsettings.cpp b/noncore/settings/sound/soundsettings.cpp index b490072..672548f 100644 --- a/noncore/settings/sound/soundsettings.cpp +++ b/noncore/settings/sound/soundsettings.cpp | |||
@@ -17,50 +17,50 @@ | |||
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "soundsettings.h" | 21 | #include "soundsettings.h" |
22 | 22 | ||
23 | #include <qpe/qpeapplication.h> | 23 | #include <qpe/qpeapplication.h> |
24 | #include <qpe/config.h> | 24 | #include <qpe/config.h> |
25 | #include <qpe/qcopenvelope_qws.h> | 25 | #include <qpe/qcopenvelope_qws.h> |
26 | #include <qpe/storage.h> | 26 | #include <qpe/storage.h> |
27 | 27 | ||
28 | #include <qapplication.h> | 28 | #include <qapplication.h> |
29 | #include <qslider.h> | 29 | #include <qslider.h> |
30 | #include <qcheckbox.h> | 30 | #include <qcheckbox.h> |
31 | #include <qlineedit.h> | 31 | #include <qlineedit.h> |
32 | #include <qcombobox.h> | 32 | #include <qcombobox.h> |
33 | 33 | ||
34 | #include <sys/utsname.h> | 34 | #include <sys/utsname.h> |
35 | #include <sys/time.h> | 35 | #include <sys/time.h> |
36 | #include <sys/types.h> | 36 | #include <sys/types.h> |
37 | #include <unistd.h> | 37 | #include <unistd.h> |
38 | #include <stdio.h> | 38 | #include <stdio.h> |
39 | #include <sys/stat.h> | 39 | #include <sys/stat.h> |
40 | 40 | ||
41 | SoundSettings::SoundSettings( QWidget* parent, const char* name, WFlags fl ) | 41 | SoundSettings::SoundSettings( QWidget* parent, const char* objname, WFlags fl ) |
42 | : SoundSettingsBase( parent, name, TRUE, fl ) | 42 | : SoundSettingsBase( parent, objname, TRUE, fl ) |
43 | { | 43 | { |
44 | keyReset=FALSE; | 44 | keyReset=FALSE; |
45 | 45 | ||
46 | Config config( "qpe"); | 46 | Config config( "qpe"); |
47 | config.setGroup( "Volume" ); | 47 | config.setGroup( "Volume" ); |
48 | volume->setValue(100-config.readNumEntry("VolumePercent")); | 48 | volume->setValue(100-config.readNumEntry("VolumePercent")); |
49 | mic->setValue(100-config.readNumEntry("Mic")); | 49 | mic->setValue(100-config.readNumEntry("Mic")); |
50 | // touchsound->setChecked(config.readBoolEntry("TouchSound")); | 50 | // touchsound->setChecked(config.readBoolEntry("TouchSound")); |
51 | // keysound->setChecked(config.readBoolEntry("KeySound")); | 51 | // keysound->setChecked(config.readBoolEntry("KeySound")); |
52 | Config cfg("Vmemo"); | 52 | Config cfg("Vmemo"); |
53 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); | 53 | connect( qApp,SIGNAL( aboutToQuit()),SLOT( cleanUp()) ); |
54 | AlertCheckBox->setChecked(cfg.readBoolEntry("Alert")); | 54 | AlertCheckBox->setChecked(cfg.readBoolEntry("Alert")); |
55 | 55 | ||
56 | cfg.setGroup("Record"); | 56 | cfg.setGroup("Record"); |
57 | int rate=config.readNumEntry("SampleRate", 22050); | 57 | int rate=config.readNumEntry("SampleRate", 22050); |
58 | if(rate == 8000) | 58 | if(rate == 8000) |
59 | sampleRate->setCurrentItem(0); | 59 | sampleRate->setCurrentItem(0); |
60 | else if(rate == 11025) | 60 | else if(rate == 11025) |
61 | sampleRate->setCurrentItem(1); | 61 | sampleRate->setCurrentItem(1); |
62 | else if(rate == 22050) | 62 | else if(rate == 22050) |
63 | sampleRate->setCurrentItem(2); | 63 | sampleRate->setCurrentItem(2); |
64 | else if(rate == 33075) | 64 | else if(rate == 33075) |
65 | sampleRate->setCurrentItem(3); | 65 | sampleRate->setCurrentItem(3); |
66 | else if(rate==44100) | 66 | else if(rate==44100) |
diff --git a/noncore/tools/opie-sh/fviewer.cpp b/noncore/tools/opie-sh/fviewer.cpp index 882c72c..6f8f054 100644 --- a/noncore/tools/opie-sh/fviewer.cpp +++ b/noncore/tools/opie-sh/fviewer.cpp | |||
@@ -1,42 +1,42 @@ | |||
1 | /* | 1 | /* |
2 | Opie-sh. convinience app to allow you to use qdialogs in scripts (mainly shell scripts) | 2 | Opie-sh. convinience app to allow you to use qdialogs in scripts (mainly shell scripts) |
3 | Copyright (C) 2002 Thomas Stephens | 3 | Copyright (C) 2002 Thomas Stephens |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public | 5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public |
6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later | 6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later |
7 | version. | 7 | version. |
8 | 8 | ||
9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the | 9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the |
10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | 10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
11 | Public License for more details. | 11 | Public License for more details. |
12 | 12 | ||
13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free | 13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free |
14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
15 | */ | 15 | */ |
16 | #include "fviewer.h" | 16 | #include "fviewer.h" |
17 | 17 | ||
18 | FViewer::FViewer(QString icon, QString filename, QString title, QWidget *parent=0, const char*name=0):QWidget(parent, name) | 18 | FViewer::FViewer(QString icon, QString filename, QString title, QWidget *parent, const char*name):QWidget(parent, name) |
19 | { | 19 | { |
20 | QVBoxLayout *layout = new QVBoxLayout(this); | 20 | QVBoxLayout *layout = new QVBoxLayout(this); |
21 | 21 | ||
22 | setIcon(Resource::loadPixmap("opie-sh")); | 22 | setIcon(Resource::loadPixmap("opie-sh")); |
23 | 23 | ||
24 | textView = new QTextBrowser(this, "textview"); | 24 | textView = new QTextBrowser(this, "textview"); |
25 | layout->addWidget(textView); | 25 | layout->addWidget(textView); |
26 | 26 | ||
27 | QString string; | 27 | QString string; |
28 | 28 | ||
29 | if(title.isNull()) | 29 | if(title.isNull()) |
30 | { | 30 | { |
31 | setCaption(filename); | 31 | setCaption(filename); |
32 | } | 32 | } |
33 | else | 33 | else |
34 | { | 34 | { |
35 | setCaption(title); | 35 | setCaption(title); |
36 | } | 36 | } |
37 | 37 | ||
38 | file = new QFile(); | 38 | file = new QFile(); |
39 | 39 | ||
40 | if(!filename.isNull()) | 40 | if(!filename.isNull()) |
41 | { | 41 | { |
42 | file->setName(filename); | 42 | file->setName(filename); |
diff --git a/noncore/tools/opie-sh/inputdialog.cpp b/noncore/tools/opie-sh/inputdialog.cpp index 0780def..1c4e688 100644 --- a/noncore/tools/opie-sh/inputdialog.cpp +++ b/noncore/tools/opie-sh/inputdialog.cpp | |||
@@ -1,42 +1,42 @@ | |||
1 | /* | 1 | /* |
2 | Opie-sh. convinience app to allow you to use qdialogs in scripts (mainly shell scripts) | 2 | Opie-sh. convinience app to allow you to use qdialogs in scripts (mainly shell scripts) |
3 | Copyright (C) 2002 Thomas Stephens | 3 | Copyright (C) 2002 Thomas Stephens |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public | 5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public |
6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later | 6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later |
7 | version. | 7 | version. |
8 | 8 | ||
9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the | 9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the |
10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | 10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
11 | Public License for more details. | 11 | Public License for more details. |
12 | 12 | ||
13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free | 13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free |
14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
15 | */ | 15 | */ |
16 | #include "inputdialog.h" | 16 | #include "inputdialog.h" |
17 | 17 | ||
18 | InputDialog::InputDialog(int w, int h, int newtype, QString labelString, QString title, QString filename, bool edit, QWidget *parent=0, const char *name=0, bool modal=true, WFlags f=0):QDialog(parent, name, modal, f) | 18 | InputDialog::InputDialog(int w, int h, int newtype, QString labelString, QString title, QString filename, bool edit, QWidget *parent, const char *name, bool modal, WFlags f):QDialog(parent, name, modal, f) |
19 | { | 19 | { |
20 | type = newtype; | 20 | type = newtype; |
21 | QHBoxLayout *layout = new QHBoxLayout(this); | 21 | QHBoxLayout *layout = new QHBoxLayout(this); |
22 | layout->addStrut(32); | 22 | layout->addStrut(32); |
23 | QLabel *label = new QLabel(labelString, this, "label"); | 23 | QLabel *label = new QLabel(labelString, this, "label"); |
24 | setCaption(title); | 24 | setCaption(title); |
25 | int x, y; | 25 | int x, y; |
26 | 26 | ||
27 | layout->addSpacing(5); | 27 | layout->addSpacing(5); |
28 | layout->addWidget(label); | 28 | layout->addWidget(label); |
29 | layout->addSpacing(5); | 29 | layout->addSpacing(5); |
30 | 30 | ||
31 | switch(type) | 31 | switch(type) |
32 | { | 32 | { |
33 | case 0: | 33 | case 0: |
34 | lineEdit = new QLineEdit(this, "line edit"); | 34 | lineEdit = new QLineEdit(this, "line edit"); |
35 | layout->addWidget(lineEdit); | 35 | layout->addWidget(lineEdit); |
36 | break; | 36 | break; |
37 | case 1: | 37 | case 1: |
38 | comboBox = new QComboBox(edit, this, "combo box"); | 38 | comboBox = new QComboBox(edit, this, "combo box"); |
39 | layout->addWidget(comboBox); | 39 | layout->addWidget(comboBox); |
40 | if(!filename.isNull()) | 40 | if(!filename.isNull()) |
41 | { | 41 | { |
42 | QFile file(filename); | 42 | QFile file(filename); |
@@ -93,25 +93,26 @@ QString InputDialog::getString() | |||
93 | switch (type) | 93 | switch (type) |
94 | { | 94 | { |
95 | case 0: | 95 | case 0: |
96 | return ((QLineEdit *)child("line edit"))->text(); | 96 | return ((QLineEdit *)child("line edit"))->text(); |
97 | break; | 97 | break; |
98 | case 1: | 98 | case 1: |
99 | return ((QComboBox *)child("combo box"))->currentText(); | 99 | return ((QComboBox *)child("combo box"))->currentText(); |
100 | break; | 100 | break; |
101 | case 2: | 101 | case 2: |
102 | QString string; | 102 | QString string; |
103 | int i; | 103 | int i; |
104 | for(i = 0; i < listBox->count(); i++) | 104 | for(i = 0; i < listBox->count(); i++) |
105 | { | 105 | { |
106 | if(listBox->isSelected(i)) | 106 | if(listBox->isSelected(i)) |
107 | { | 107 | { |
108 | string+=listBox->text(i)+'\n'; | 108 | string+=listBox->text(i)+'\n'; |
109 | } | 109 | } |
110 | } | 110 | } |
111 | if(string[string.length()-1] == '\n') | 111 | if(string[string.length()-1] == '\n') |
112 | { | 112 | { |
113 | string.truncate(string.length()-1); | 113 | string.truncate(string.length()-1); |
114 | } | 114 | } |
115 | return string; | 115 | return string; |
116 | } | 116 | } |
117 | return QString::null; | ||
117 | } | 118 | } |
diff --git a/noncore/tools/opie-sh/mbox.cpp b/noncore/tools/opie-sh/mbox.cpp index cb3ea1b..04b397d 100644 --- a/noncore/tools/opie-sh/mbox.cpp +++ b/noncore/tools/opie-sh/mbox.cpp | |||
@@ -1,43 +1,43 @@ | |||
1 | /* | 1 | /* |
2 | Opie-sh. convinience app to allow you to use qdialogs in scripts (mainly shell scripts) | 2 | Opie-sh. convinience app to allow you to use qdialogs in scripts (mainly shell scripts) |
3 | Copyright (C) 2002 Thomas Stephens | 3 | Copyright (C) 2002 Thomas Stephens |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public | 5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public |
6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later | 6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later |
7 | version. | 7 | version. |
8 | 8 | ||
9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the | 9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the |
10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | 10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
11 | Public License for more details. | 11 | Public License for more details. |
12 | 12 | ||
13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free | 13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free |
14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include "mbox.h" | 17 | #include "mbox.h" |
18 | 18 | ||
19 | MBox::MBox(int w, int h, int type, QString title, QString message, QString *btext0 = 0, QString *btext1= 0, QString *btext2 = 0, QWidget *parent=0, const char*name=0, bool modal=true, WFlags f=0):QDialog(parent, name, modal, f) | 19 | MBox::MBox(int w, int h, int type, QString title, QString message, QString *btext0, QString *btext1, QString *btext2, QWidget *parent, const char*name, bool modal, WFlags f):QDialog(parent, name, modal, f) |
20 | { | 20 | { |
21 | QVBoxLayout *layout = new QVBoxLayout(this); | 21 | QVBoxLayout *layout = new QVBoxLayout(this); |
22 | 22 | ||
23 | QHBoxLayout *hlayout1 = new QHBoxLayout(this); | 23 | QHBoxLayout *hlayout1 = new QHBoxLayout(this); |
24 | QHBoxLayout *hlayout2 = new QHBoxLayout(this); | 24 | QHBoxLayout *hlayout2 = new QHBoxLayout(this); |
25 | 25 | ||
26 | int x, y; | 26 | int x, y; |
27 | 27 | ||
28 | layout->addLayout(hlayout1); | 28 | layout->addLayout(hlayout1); |
29 | layout->addLayout(hlayout2); | 29 | layout->addLayout(hlayout2); |
30 | 30 | ||
31 | setCaption(title); | 31 | setCaption(title); |
32 | 32 | ||
33 | QLabel *image = new QLabel(this, "image"); | 33 | QLabel *image = new QLabel(this, "image"); |
34 | QLabel *text = new QLabel(message, this, "text"); | 34 | QLabel *text = new QLabel(message, this, "text"); |
35 | 35 | ||
36 | switch (type) | 36 | switch (type) |
37 | { | 37 | { |
38 | case 0: | 38 | case 0: |
39 | image->setPixmap(Resource::loadPixmap("opie-sh/info")); | 39 | image->setPixmap(Resource::loadPixmap("opie-sh/info")); |
40 | break; | 40 | break; |
41 | case 1: | 41 | case 1: |
42 | image->setPixmap(Resource::loadPixmap("opie-sh/warning")); | 42 | image->setPixmap(Resource::loadPixmap("opie-sh/warning")); |
43 | break; | 43 | break; |
diff --git a/noncore/tools/opie-sh/opie-sh.cpp b/noncore/tools/opie-sh/opie-sh.cpp index e898cb1..96b4b93 100644 --- a/noncore/tools/opie-sh/opie-sh.cpp +++ b/noncore/tools/opie-sh/opie-sh.cpp | |||
@@ -78,78 +78,79 @@ int myMessageBox(int wi, int h, QWidget *w, int argc, QStringList args) | |||
78 | { | 78 | { |
79 | full = false; | 79 | full = false; |
80 | } | 80 | } |
81 | } | 81 | } |
82 | 82 | ||
83 | MBox *mbox = new MBox(wi, h, (int)type, title, string, &button0Text, &button1Text, &button2Text, w, (QString)"messagebox"); | 83 | MBox *mbox = new MBox(wi, h, (int)type, title, string, &button0Text, &button1Text, &button2Text, w, (QString)"messagebox"); |
84 | if(full) | 84 | if(full) |
85 | { | 85 | { |
86 | w->setCaption(title); | 86 | w->setCaption(title); |
87 | w->showMaximized(); | 87 | w->showMaximized(); |
88 | } | 88 | } |
89 | //mbox->show(); | 89 | //mbox->show(); |
90 | switch(mbox->exec() ) | 90 | switch(mbox->exec() ) |
91 | { | 91 | { |
92 | case 0: | 92 | case 0: |
93 | return -1; | 93 | return -1; |
94 | case 1: | 94 | case 1: |
95 | return -1; | 95 | return -1; |
96 | case 2: | 96 | case 2: |
97 | return 0; | 97 | return 0; |
98 | case 3: | 98 | case 3: |
99 | return 1; | 99 | return 1; |
100 | case 4: | 100 | case 4: |
101 | return 2; | 101 | return 2; |
102 | default: return -1; | ||
102 | } | 103 | } |
103 | } | 104 | } |
104 | 105 | ||
105 | void printusage() | 106 | void printusage() |
106 | { | 107 | { |
107 | printf("Usage instructions for Opie-sh\n"); | 108 | printf("Usage instructions for Opie-sh\n"); |
108 | printf("Usage: opie-sh [dialog type] [type specific options]\n"); | 109 | printf("Usage: opie-sh [dialog type] [type specific options]\n"); |
109 | printf("Types:\n"); | 110 | printf("Types:\n"); |
110 | printf(" -m Message Box\n"); | 111 | printf(" -m Message Box\n"); |
111 | printf(" -f [filename] View file [Default = stdin]\n"); | 112 | printf(" -f [filename] View file [Default = stdin]\n"); |
112 | printf(" -i Input dialog\n"); | 113 | printf(" -i Input dialog\n"); |
113 | printf(" -h --help These instructions\n"); | 114 | printf(" -h --help These instructions\n"); |
114 | printf(" -t [title] The window/dialog title\n"); | 115 | printf(" -t [title] The window/dialog title\n"); |
115 | printf("Message box options:\n"); | 116 | printf("Message box options:\n"); |
116 | printf(" -M [message] The message to display\n"); | 117 | printf(" -M [message] The message to display\n"); |
117 | printf(" -I Use information icon\n"); | 118 | printf(" -I Use information icon\n"); |
118 | printf(" -w Use the warning icon\n"); | 119 | printf(" -w Use the warning icon\n"); |
119 | printf(" -e Use the error icon\n"); | 120 | printf(" -e Use the error icon\n"); |
120 | printf(" -0 [text] First button text [Default = OK]\n"); | 121 | printf(" -0 [text] First button text [Default = OK]\n"); |
121 | printf(" -1 [text] Second button text\n"); | 122 | printf(" -1 [text] Second button text\n"); |
122 | printf(" -2 [text] Third button text\n"); | 123 | printf(" -2 [text] Third button text\n"); |
123 | printf(" -g Disable fullscreen\n"); | 124 | printf(" -g Disable fullscreen\n"); |
124 | printf("Input Dialog options:\n"); | 125 | printf("Input Dialog options:\n"); |
125 | printf(" -s A single line of input (output to console)\n"); | 126 | printf(" -s A single line of input (output to console)\n"); |
126 | printf(" -l List input (newline separated list read in from file)\n"); | 127 | printf(" -l List input (newline separated list read in from file)\n"); |
127 | printf(" -b A list box, enabling multiple selections (input same as -l)\n"); | 128 | printf(" -b A list box, enabling multiple selections (input same as -l)\n"); |
128 | printf(" -L [label] The label for the input field\n"); | 129 | printf(" -L [label] The label for the input field\n"); |
129 | printf(" -F [filename] An input file (for when it makes sense) [Default = stdin]\n"); | 130 | printf(" -F [filename] An input file (for when it makes sense) [Default = stdin]\n"); |
130 | printf(" -E Makes list input editable\n"); | 131 | printf(" -E Makes list input editable\n"); |
131 | printf(" -g Disable fullscreen\n\0"); | 132 | printf(" -g Disable fullscreen\n"); |
132 | } | 133 | } |
133 | 134 | ||
134 | int fileviewer(QPEApplication *a, int argc, QStringList args) | 135 | int fileviewer(QPEApplication *a, int argc, QStringList args) |
135 | { | 136 | { |
136 | int i; | 137 | int i; |
137 | QString filename, title, icon; | 138 | QString filename, title, icon; |
138 | bool update=false; | 139 | bool update=false; |
139 | 140 | ||
140 | for(i=0; i < argc; i++) | 141 | for(i=0; i < argc; i++) |
141 | { | 142 | { |
142 | if(args[i] == "-f") | 143 | if(args[i] == "-f") |
143 | { | 144 | { |
144 | if(args[i+1][0] != '-') | 145 | if(args[i+1][0] != '-') |
145 | { | 146 | { |
146 | filename = args[i+1]; | 147 | filename = args[i+1]; |
147 | } | 148 | } |
148 | } | 149 | } |
149 | 150 | ||
150 | if(args[i] == "-I") | 151 | if(args[i] == "-I") |
151 | { | 152 | { |
152 | icon=args[i+1]; | 153 | icon=args[i+1]; |
153 | } | 154 | } |
154 | 155 | ||
155 | if(args[i] == "-t") | 156 | if(args[i] == "-t") |
diff --git a/noncore/tools/remote/buttondialog.cpp b/noncore/tools/remote/buttondialog.cpp index 7479e85..6ea4801 100644 --- a/noncore/tools/remote/buttondialog.cpp +++ b/noncore/tools/remote/buttondialog.cpp | |||
@@ -1,43 +1,43 @@ | |||
1 | /* | 1 | /* |
2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. | 2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. |
3 | Copyright (C) 2002 Thomas Stephens | 3 | Copyright (C) 2002 Thomas Stephens |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public | 5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public |
6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later | 6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later |
7 | version. | 7 | version. |
8 | 8 | ||
9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the | 9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the |
10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | 10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
11 | Public License for more details. | 11 | Public License for more details. |
12 | 12 | ||
13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free | 13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free |
14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include "buttondialog.h" | 17 | #include "buttondialog.h" |
18 | 18 | ||
19 | ButtonDialog::ButtonDialog(QString buttonName, QWidget *parent=0, const char*name=0, bool modal=FALSE, WFlags f=0):QDialog(parent, name, modal, f) | 19 | ButtonDialog::ButtonDialog(QString buttonName, QWidget *parent, const char*name, bool modal, WFlags f):QDialog(parent, name, modal, f) |
20 | { | 20 | { |
21 | setCaption(tr(buttonName)); | 21 | setCaption(tr(buttonName)); |
22 | 22 | ||
23 | QVBoxLayout *layout = new QVBoxLayout(this); | 23 | QVBoxLayout *layout = new QVBoxLayout(this); |
24 | 24 | ||
25 | QHBoxLayout *hlayout1 = new QHBoxLayout(this); | 25 | QHBoxLayout *hlayout1 = new QHBoxLayout(this); |
26 | QHBoxLayout *hlayout2 = new QHBoxLayout(this); | 26 | QHBoxLayout *hlayout2 = new QHBoxLayout(this); |
27 | QHBoxLayout *hlayout3 = new QHBoxLayout(this); | 27 | QHBoxLayout *hlayout3 = new QHBoxLayout(this); |
28 | 28 | ||
29 | layout->addSpacing(5); | 29 | layout->addSpacing(5); |
30 | layout->addLayout(hlayout1); | 30 | layout->addLayout(hlayout1); |
31 | layout->addSpacing(5); | 31 | layout->addSpacing(5); |
32 | layout->addLayout(hlayout2); | 32 | layout->addLayout(hlayout2); |
33 | layout->addSpacing(5); | 33 | layout->addSpacing(5); |
34 | layout->addLayout(hlayout3); | 34 | layout->addLayout(hlayout3); |
35 | layout->addSpacing(5); | 35 | layout->addSpacing(5); |
36 | 36 | ||
37 | remote = new QComboBox(false, this, "remote"); | 37 | remote = new QComboBox(false, this, "remote"); |
38 | QLabel *remoteLabel = new QLabel(remote, "Remote: ", this, "remoteLabel"); | 38 | QLabel *remoteLabel = new QLabel(remote, "Remote: ", this, "remoteLabel"); |
39 | hlayout1->addSpacing(5); | 39 | hlayout1->addSpacing(5); |
40 | hlayout1->addWidget(remoteLabel); | 40 | hlayout1->addWidget(remoteLabel); |
41 | hlayout1->addSpacing(5); | 41 | hlayout1->addSpacing(5); |
42 | hlayout1->addWidget(remote); | 42 | hlayout1->addWidget(remote); |
43 | hlayout1->addSpacing(5); | 43 | hlayout1->addSpacing(5); |
@@ -90,168 +90,168 @@ QString ButtonDialog::getLabel() | |||
90 | QStringList ButtonDialog::getRemotes() | 90 | QStringList ButtonDialog::getRemotes() |
91 | { | 91 | { |
92 | const char write_buffer[] = "LIST\n"; | 92 | const char write_buffer[] = "LIST\n"; |
93 | const char *readbuffer; | 93 | const char *readbuffer; |
94 | int i, numlines; | 94 | int i, numlines; |
95 | QStringList list; | 95 | QStringList list; |
96 | 96 | ||
97 | addr.sun_family=AF_UNIX; | 97 | addr.sun_family=AF_UNIX; |
98 | strcpy(addr.sun_path,"/dev/lircd"); | 98 | strcpy(addr.sun_path,"/dev/lircd"); |
99 | 99 | ||
100 | fd = socket(AF_UNIX, SOCK_STREAM, 0); | 100 | fd = socket(AF_UNIX, SOCK_STREAM, 0); |
101 | if(fd == -1) | 101 | if(fd == -1) |
102 | { | 102 | { |
103 | QMessageBox *mb = new QMessageBox("Error!", | 103 | QMessageBox *mb = new QMessageBox("Error!", |
104 | "couldnt connect to socket", | 104 | "couldnt connect to socket", |
105 | QMessageBox::NoIcon, | 105 | QMessageBox::NoIcon, |
106 | QMessageBox::Ok, | 106 | QMessageBox::Ok, |
107 | QMessageBox::NoButton, | 107 | QMessageBox::NoButton, |
108 | QMessageBox::NoButton); | 108 | QMessageBox::NoButton); |
109 | mb->exec(); | 109 | mb->exec(); |
110 | perror("ButtonDialog::GetRemotes"); | 110 | perror("ButtonDialog::GetRemotes"); |
111 | return NULL; | 111 | return NULL; |
112 | } | 112 | } |
113 | 113 | ||
114 | if(std::connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1) | 114 | if(::connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1) |
115 | { | 115 | { |
116 | QMessageBox *mb = new QMessageBox("Error!", | 116 | QMessageBox *mb = new QMessageBox("Error!", |
117 | "couldnt connect to socket", | 117 | "couldnt connect to socket", |
118 | QMessageBox::NoIcon, | 118 | QMessageBox::NoIcon, |
119 | QMessageBox::Ok, | 119 | QMessageBox::Ok, |
120 | QMessageBox::NoButton, | 120 | QMessageBox::NoButton, |
121 | QMessageBox::NoButton); | 121 | QMessageBox::NoButton); |
122 | mb->exec(); | 122 | mb->exec(); |
123 | perror("ButtonDialog::GetRemotes"); | 123 | perror("ButtonDialog::GetRemotes"); |
124 | return NULL; | 124 | return NULL; |
125 | } | 125 | } |
126 | 126 | ||
127 | write(fd, write_buffer, strlen(write_buffer)); | 127 | write(fd, write_buffer, strlen(write_buffer)); |
128 | 128 | ||
129 | for(i=0; i<5; i++) | 129 | for(i=0; i<5; i++) |
130 | { | 130 | { |
131 | printf("%d\n", i); | 131 | printf("%d\n", i); |
132 | readbuffer = readPacket(); | 132 | readbuffer = readPacket(); |
133 | printf("%s", readbuffer); | 133 | printf("%s", readbuffer); |
134 | printf("%d\n", i); | 134 | printf("%d\n", i); |
135 | } | 135 | } |
136 | 136 | ||
137 | numlines = atoi(readbuffer); | 137 | numlines = atoi(readbuffer); |
138 | 138 | ||
139 | for(i=0; i<numlines; i++) | 139 | for(i=0; i<numlines; i++) |
140 | { | 140 | { |
141 | list+=readPacket(); | 141 | list+=readPacket(); |
142 | } | 142 | } |
143 | 143 | ||
144 | if(strcasecmp(readPacket(), "END") != 0) | 144 | if(strcasecmp(readPacket(), "END") != 0) |
145 | { | 145 | { |
146 | QMessageBox *mb = new QMessageBox("Error!", | 146 | QMessageBox *mb = new QMessageBox("Error!", |
147 | "bad packet", | 147 | "bad packet", |
148 | QMessageBox::NoIcon, | 148 | QMessageBox::NoIcon, |
149 | QMessageBox::Ok, | 149 | QMessageBox::Ok, |
150 | QMessageBox::NoButton, | 150 | QMessageBox::NoButton, |
151 | QMessageBox::NoButton); | 151 | QMessageBox::NoButton); |
152 | mb->exec(); | 152 | mb->exec(); |
153 | perror("ButtonDialog::GetRemotes"); | 153 | perror("ButtonDialog::GetRemotes"); |
154 | return NULL; | 154 | return NULL; |
155 | } | 155 | } |
156 | 156 | ||
157 | std::close(fd); | 157 | ::close(fd); |
158 | return list; | 158 | return list; |
159 | } | 159 | } |
160 | 160 | ||
161 | QStringList ButtonDialog::getButtons(const char *remoteName) | 161 | QStringList ButtonDialog::getButtons(const char *remoteName) |
162 | { | 162 | { |
163 | QString write_buffer = "LIST "; | 163 | QString write_buffer = "LIST "; |
164 | const char *readbuffer; | 164 | const char *readbuffer; |
165 | int i, j, numlines; | 165 | int i, j, numlines; |
166 | QStringList list; | 166 | QStringList list; |
167 | QString string; | 167 | QString string; |
168 | 168 | ||
169 | write_buffer += remoteName; | 169 | write_buffer += remoteName; |
170 | write_buffer += '\n'; | 170 | write_buffer += '\n'; |
171 | 171 | ||
172 | fd = socket(AF_UNIX, SOCK_STREAM, 0); | 172 | fd = socket(AF_UNIX, SOCK_STREAM, 0); |
173 | if(fd == -1) | 173 | if(fd == -1) |
174 | { | 174 | { |
175 | QMessageBox *mb = new QMessageBox("Error!", | 175 | QMessageBox *mb = new QMessageBox("Error!", |
176 | "couldnt connect to socket", | 176 | "couldnt connect to socket", |
177 | QMessageBox::NoIcon, | 177 | QMessageBox::NoIcon, |
178 | QMessageBox::Ok, | 178 | QMessageBox::Ok, |
179 | QMessageBox::NoButton, | 179 | QMessageBox::NoButton, |
180 | QMessageBox::NoButton); | 180 | QMessageBox::NoButton); |
181 | mb->exec(); | 181 | mb->exec(); |
182 | perror("ButtonDialog::GetButtons"); | 182 | perror("ButtonDialog::GetButtons"); |
183 | return NULL; | 183 | return NULL; |
184 | } | 184 | } |
185 | 185 | ||
186 | 186 | ||
187 | if(std::connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1) | 187 | if(::connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1) |
188 | { | 188 | { |
189 | QMessageBox *mb = new QMessageBox("Error!", | 189 | QMessageBox *mb = new QMessageBox("Error!", |
190 | "couldnt connect to socket", | 190 | "couldnt connect to socket", |
191 | QMessageBox::NoIcon, | 191 | QMessageBox::NoIcon, |
192 | QMessageBox::Ok, | 192 | QMessageBox::Ok, |
193 | QMessageBox::NoButton, | 193 | QMessageBox::NoButton, |
194 | QMessageBox::NoButton); | 194 | QMessageBox::NoButton); |
195 | mb->exec(); | 195 | mb->exec(); |
196 | perror("ButtonDialog::GetButtons"); | 196 | perror("ButtonDialog::GetButtons"); |
197 | return NULL; | 197 | return NULL; |
198 | } | 198 | } |
199 | 199 | ||
200 | write(fd, write_buffer.latin1(), strlen(write_buffer) ); | 200 | write(fd, write_buffer.latin1(), strlen(write_buffer) ); |
201 | 201 | ||
202 | for(i=0; i<5; i++) | 202 | for(i=0; i<5; i++) |
203 | { | 203 | { |
204 | readbuffer = readPacket(); | 204 | readbuffer = readPacket(); |
205 | } | 205 | } |
206 | 206 | ||
207 | numlines = atoi(readbuffer); | 207 | numlines = atoi(readbuffer); |
208 | 208 | ||
209 | for(i=0; i<numlines; i++) | 209 | for(i=0; i<numlines; i++) |
210 | { | 210 | { |
211 | list+=readPacket(); | 211 | list+=readPacket(); |
212 | for(j=0; j<list[i].length(); j++) | 212 | for(j=0; j<list[i].length(); j++) |
213 | { | 213 | { |
214 | if(list[i][j] == ' ') | 214 | if(list[i][j] == ' ') |
215 | break; | 215 | break; |
216 | } | 216 | } |
217 | list[i].remove(0, j+1); | 217 | list[i].remove(0, j+1); |
218 | } | 218 | } |
219 | 219 | ||
220 | if(strcasecmp(readPacket(), "END") != 0) | 220 | if(strcasecmp(readPacket(), "END") != 0) |
221 | { | 221 | { |
222 | QMessageBox *mb = new QMessageBox("Error!", | 222 | QMessageBox *mb = new QMessageBox("Error!", |
223 | "bad packet", | 223 | "bad packet", |
224 | QMessageBox::NoIcon, | 224 | QMessageBox::NoIcon, |
225 | QMessageBox::Ok, | 225 | QMessageBox::Ok, |
226 | QMessageBox::NoButton, | 226 | QMessageBox::NoButton, |
227 | QMessageBox::NoButton); | 227 | QMessageBox::NoButton); |
228 | mb->exec(); | 228 | mb->exec(); |
229 | perror("ButtonDialog::GetButtons"); | 229 | perror("ButtonDialog::GetButtons"); |
230 | return NULL; | 230 | return NULL; |
231 | } | 231 | } |
232 | 232 | ||
233 | std::close(fd); | 233 | ::close(fd); |
234 | return list; | 234 | return list; |
235 | } | 235 | } |
236 | 236 | ||
237 | 237 | ||
238 | //this function was ripped for rc.c in xrc, it is available here: http://www.lirc.org/software.html | 238 | //this function was ripped for rc.c in xrc, it is available here: http://www.lirc.org/software.html |
239 | const char *ButtonDialog::readPacket() | 239 | const char *ButtonDialog::readPacket() |
240 | { | 240 | { |
241 | static char buffer[PACKET_SIZE+1]=""; | 241 | static char buffer[PACKET_SIZE+1]=""; |
242 | char *end; | 242 | char *end; |
243 | static int ptr=0,end_len=0; | 243 | static int ptr=0,end_len=0; |
244 | ssize_t ret; | 244 | ssize_t ret; |
245 | timeout = 0; | 245 | timeout = 0; |
246 | 246 | ||
247 | if(ptr>0) | 247 | if(ptr>0) |
248 | { | 248 | { |
249 | memmove(buffer,buffer+ptr,strlen(buffer+ptr)+1); | 249 | memmove(buffer,buffer+ptr,strlen(buffer+ptr)+1); |
250 | ptr=strlen(buffer); | 250 | ptr=strlen(buffer); |
251 | end=strchr(buffer,'\n'); | 251 | end=strchr(buffer,'\n'); |
252 | } | 252 | } |
253 | else | 253 | else |
254 | { | 254 | { |
255 | end=NULL; | 255 | end=NULL; |
256 | } | 256 | } |
257 | alarm(TIMEOUT); | 257 | alarm(TIMEOUT); |
diff --git a/noncore/tools/remote/channelgroup.cpp b/noncore/tools/remote/channelgroup.cpp index 9f90284..7c33674 100644 --- a/noncore/tools/remote/channelgroup.cpp +++ b/noncore/tools/remote/channelgroup.cpp | |||
@@ -1,43 +1,43 @@ | |||
1 | /* | 1 | /* |
2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. | 2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. |
3 | Copyright (C) 2002 Thomas Stephens | 3 | Copyright (C) 2002 Thomas Stephens |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public | 5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public |
6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later | 6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later |
7 | version. | 7 | version. |
8 | 8 | ||
9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the | 9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the |
10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | 10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
11 | Public License for more details. | 11 | Public License for more details. |
12 | 12 | ||
13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free | 13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free |
14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include "channelgroup.h" | 17 | #include "channelgroup.h" |
18 | 18 | ||
19 | ChannelGroup::ChannelGroup(QWidget *parent=0, const char *name=0):QWidget(parent,name) | 19 | ChannelGroup::ChannelGroup(QWidget *parent, const char *name):QWidget(parent,name) |
20 | { | 20 | { |
21 | QGridLayout *layout = new QGridLayout(this); | 21 | QGridLayout *layout = new QGridLayout(this); |
22 | QVBoxLayout *volLayout = new QVBoxLayout(this); | 22 | QVBoxLayout *volLayout = new QVBoxLayout(this); |
23 | QVBoxLayout *chanLayout = new QVBoxLayout(this); | 23 | QVBoxLayout *chanLayout = new QVBoxLayout(this); |
24 | 24 | ||
25 | layout->addRowSpacing(1,1); | 25 | layout->addRowSpacing(1,1); |
26 | layout->addRowSpacing(3,1); | 26 | layout->addRowSpacing(3,1); |
27 | layout->addRowSpacing(5,1); | 27 | layout->addRowSpacing(5,1); |
28 | 28 | ||
29 | layout->addColSpacing(1,1); | 29 | layout->addColSpacing(1,1); |
30 | layout->addColSpacing(3,1); | 30 | layout->addColSpacing(3,1); |
31 | layout->addColSpacing(5,1); | 31 | layout->addColSpacing(5,1); |
32 | layout->addColSpacing(7,1); | 32 | layout->addColSpacing(7,1); |
33 | 33 | ||
34 | QPushButton *one = new QPushButton("1", this, "one"); | 34 | QPushButton *one = new QPushButton("1", this, "one"); |
35 | layout->addWidget(one, 0, 2, 0); | 35 | layout->addWidget(one, 0, 2, 0); |
36 | connect(one, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); | 36 | connect(one, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); |
37 | 37 | ||
38 | QPushButton *two = new QPushButton("2", this, "two"); | 38 | QPushButton *two = new QPushButton("2", this, "two"); |
39 | layout->addWidget(two, 0, 4, 0); | 39 | layout->addWidget(two, 0, 4, 0); |
40 | connect(two, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); | 40 | connect(two, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); |
41 | 41 | ||
42 | QPushButton *three = new QPushButton("3", this, "three"); | 42 | QPushButton *three = new QPushButton("3", this, "three"); |
43 | layout->addWidget(three, 0, 6, 0); | 43 | layout->addWidget(three, 0, 6, 0); |
diff --git a/noncore/tools/remote/channelgroupconf.cpp b/noncore/tools/remote/channelgroupconf.cpp index 2d98115..e39121e 100644 --- a/noncore/tools/remote/channelgroupconf.cpp +++ b/noncore/tools/remote/channelgroupconf.cpp | |||
@@ -1,43 +1,43 @@ | |||
1 | /* | 1 | /* |
2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. | 2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. |
3 | Copyright (C) 2002 Thomas Stephens | 3 | Copyright (C) 2002 Thomas Stephens |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public | 5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public |
6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later | 6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later |
7 | version. | 7 | version. |
8 | 8 | ||
9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the | 9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the |
10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | 10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
11 | Public License for more details. | 11 | Public License for more details. |
12 | 12 | ||
13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free | 13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free |
14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include "channelgroupconf.h" | 17 | #include "channelgroupconf.h" |
18 | 18 | ||
19 | ChannelGroupConf::ChannelGroupConf(QWidget *parent=0, const char *name=0):QWidget(parent,name) | 19 | ChannelGroupConf::ChannelGroupConf(QWidget *parent, const char *name):QWidget(parent,name) |
20 | { | 20 | { |
21 | QGridLayout *layout = new QGridLayout(this); | 21 | QGridLayout *layout = new QGridLayout(this); |
22 | QVBoxLayout *volLayout = new QVBoxLayout(this); | 22 | QVBoxLayout *volLayout = new QVBoxLayout(this); |
23 | QVBoxLayout *chanLayout = new QVBoxLayout(this); | 23 | QVBoxLayout *chanLayout = new QVBoxLayout(this); |
24 | 24 | ||
25 | layout->addRowSpacing(1,5); | 25 | layout->addRowSpacing(1,5); |
26 | layout->addRowSpacing(3,5); | 26 | layout->addRowSpacing(3,5); |
27 | layout->addRowSpacing(5,5); | 27 | layout->addRowSpacing(5,5); |
28 | 28 | ||
29 | layout->addColSpacing(1,1); | 29 | layout->addColSpacing(1,1); |
30 | layout->addColSpacing(3,1); | 30 | layout->addColSpacing(3,1); |
31 | layout->addColSpacing(5,1); | 31 | layout->addColSpacing(5,1); |
32 | layout->addColSpacing(7,1); | 32 | layout->addColSpacing(7,1); |
33 | 33 | ||
34 | QPushButton *one = new QPushButton("1", this, "one"); | 34 | QPushButton *one = new QPushButton("1", this, "one"); |
35 | layout->addWidget(one, 0, 2, 0); | 35 | layout->addWidget(one, 0, 2, 0); |
36 | connect(one, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); | 36 | connect(one, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); |
37 | 37 | ||
38 | QPushButton *two = new QPushButton("2", this, "two"); | 38 | QPushButton *two = new QPushButton("2", this, "two"); |
39 | layout->addWidget(two, 0, 4, 0); | 39 | layout->addWidget(two, 0, 4, 0); |
40 | connect(two, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); | 40 | connect(two, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); |
41 | 41 | ||
42 | QPushButton *three = new QPushButton("3", this, "three"); | 42 | QPushButton *three = new QPushButton("3", this, "three"); |
43 | layout->addWidget(three, 0, 6, 0); | 43 | layout->addWidget(three, 0, 6, 0); |
diff --git a/noncore/tools/remote/configtab.cpp b/noncore/tools/remote/configtab.cpp index f5896a9..17cdc6a 100644 --- a/noncore/tools/remote/configtab.cpp +++ b/noncore/tools/remote/configtab.cpp | |||
@@ -1,43 +1,43 @@ | |||
1 | /* | 1 | /* |
2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. | 2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. |
3 | Copyright (C) 2002 Thomas Stephens | 3 | Copyright (C) 2002 Thomas Stephens |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public | 5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public |
6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later | 6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later |
7 | version. | 7 | version. |
8 | 8 | ||
9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the | 9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the |
10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | 10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
11 | Public License for more details. | 11 | Public License for more details. |
12 | 12 | ||
13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free | 13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free |
14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include "configtab.h" | 17 | #include "configtab.h" |
18 | 18 | ||
19 | ConfigTab::ConfigTab(QWidget *parent=0, const char *name=0):QWidget(parent,name) | 19 | ConfigTab::ConfigTab(QWidget *parent, const char *name):QWidget(parent,name) |
20 | { | 20 | { |
21 | 21 | ||
22 | QVBoxLayout *layout = new QVBoxLayout(this); | 22 | QVBoxLayout *layout = new QVBoxLayout(this); |
23 | 23 | ||
24 | topGroupConf = new TopGroupConf(this, "topGroupConf"); | 24 | topGroupConf = new TopGroupConf(this, "topGroupConf"); |
25 | layout->addWidget(topGroupConf, 1); | 25 | layout->addWidget(topGroupConf, 1); |
26 | layout->addSpacing(1); | 26 | layout->addSpacing(1); |
27 | 27 | ||
28 | dvdGroupConf = new DVDGroupConf(this, "dvdGroupConf"); | 28 | dvdGroupConf = new DVDGroupConf(this, "dvdGroupConf"); |
29 | layout->addWidget(dvdGroupConf, 1); | 29 | layout->addWidget(dvdGroupConf, 1); |
30 | layout->addSpacing(1); | 30 | layout->addSpacing(1); |
31 | 31 | ||
32 | vcrGroupConf = new VCRGroupConf(this, "vcrGroupConf"); | 32 | vcrGroupConf = new VCRGroupConf(this, "vcrGroupConf"); |
33 | layout->addWidget(vcrGroupConf, 1); | 33 | layout->addWidget(vcrGroupConf, 1); |
34 | layout->addSpacing(1); | 34 | layout->addSpacing(1); |
35 | 35 | ||
36 | channelGroupConf = new ChannelGroupConf(this, "channelGroupConf"); | 36 | channelGroupConf = new ChannelGroupConf(this, "channelGroupConf"); |
37 | layout->addWidget(channelGroupConf, 1); | 37 | layout->addWidget(channelGroupConf, 1); |
38 | 38 | ||
39 | 39 | ||
40 | } | 40 | } |
41 | 41 | ||
42 | void ConfigTab::setConfig(Config *newCfg) | 42 | void ConfigTab::setConfig(Config *newCfg) |
43 | { | 43 | { |
diff --git a/noncore/tools/remote/dvdgroup.cpp b/noncore/tools/remote/dvdgroup.cpp index a75c48a..d7ff515 100644 --- a/noncore/tools/remote/dvdgroup.cpp +++ b/noncore/tools/remote/dvdgroup.cpp | |||
@@ -1,49 +1,49 @@ | |||
1 | /* | 1 | /* |
2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. | 2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. |
3 | Copyright (C) 2002 Thomas Stephens | 3 | Copyright (C) 2002 Thomas Stephens |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify it under | 5 | This program is free software; you can redistribute it and/or modify it under |
6 | the terms of the GNU General Public | 6 | the terms of the GNU General Public |
7 | License as published by the Free Software Foundation; either version 2 of the | 7 | License as published by the Free Software Foundation; either version 2 of the |
8 | License, or (at your option) any later | 8 | License, or (at your option) any later |
9 | version. | 9 | version. |
10 | 10 | ||
11 | This program is distributed in the hope that it will be useful, but WITHOUT ANY | 11 | This program is distributed in the hope that it will be useful, but WITHOUT ANY |
12 | WARRANTY; without even the | 12 | WARRANTY; without even the |
13 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | 14 | ||
15 | GNU General | 15 | GNU General |
16 | Public License for more details. | 16 | Public License for more details. |
17 | 17 | ||
18 | You should have received a copy of the GNU General Public License along with | 18 | You should have received a copy of the GNU General Public License along with |
19 | this program; if not, write to the Free | 19 | this program; if not, write to the Free |
20 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 20 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include "dvdgroup.h" | 23 | #include "dvdgroup.h" |
24 | 24 | ||
25 | DVDGroup::DVDGroup(QWidget *parent=0, const char *name=0):QWidget(parent,name) | 25 | DVDGroup::DVDGroup(QWidget *parent, const char *name):QWidget(parent,name) |
26 | { | 26 | { |
27 | QGridLayout *layout = new QGridLayout(this); | 27 | QGridLayout *layout = new QGridLayout(this); |
28 | 28 | ||
29 | //put rows between the buttons of size 1 | 29 | //put rows between the buttons of size 1 |
30 | layout->addRowSpacing(1,1); | 30 | layout->addRowSpacing(1,1); |
31 | layout->addRowSpacing(3,1); | 31 | layout->addRowSpacing(3,1); |
32 | 32 | ||
33 | //put collumns between the buttons of size 5 | 33 | //put collumns between the buttons of size 5 |
34 | layout->addColSpacing(1,5); | 34 | layout->addColSpacing(1,5); |
35 | layout->addColSpacing(3,5); | 35 | layout->addColSpacing(3,5); |
36 | layout->addColSpacing(5,5); | 36 | layout->addColSpacing(5,5); |
37 | layout->addColSpacing(7,5); | 37 | layout->addColSpacing(7,5); |
38 | 38 | ||
39 | //make sure that the collumns with the buttons in them stretch before the filler collumns do | 39 | //make sure that the collumns with the buttons in them stretch before the filler collumns do |
40 | //since there is so little room, there is no need to do this for the rows | 40 | //since there is so little room, there is no need to do this for the rows |
41 | layout->setColStretch(4,1); | 41 | layout->setColStretch(4,1); |
42 | layout->setColStretch(2,1); | 42 | layout->setColStretch(2,1); |
43 | layout->setColStretch(6,1); | 43 | layout->setColStretch(6,1); |
44 | layout->setColStretch(8,1); | 44 | layout->setColStretch(8,1); |
45 | layout->setColStretch(0,1); | 45 | layout->setColStretch(0,1); |
46 | 46 | ||
47 | //add the menu navigation buttons, and connect them to the RemoteTab slots... | 47 | //add the menu navigation buttons, and connect them to the RemoteTab slots... |
48 | QPushButton *up = new QPushButton("Up", this,"up"); | 48 | QPushButton *up = new QPushButton("Up", this,"up"); |
49 | layout->addWidget(up, 0, 4, 0); | 49 | layout->addWidget(up, 0, 4, 0); |
diff --git a/noncore/tools/remote/dvdgroupconf.cpp b/noncore/tools/remote/dvdgroupconf.cpp index 5bfe393..2a08ab6 100644 --- a/noncore/tools/remote/dvdgroupconf.cpp +++ b/noncore/tools/remote/dvdgroupconf.cpp | |||
@@ -1,43 +1,43 @@ | |||
1 | /* | 1 | /* |
2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. | 2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. |
3 | Copyright (C) 2002 Thomas Stephens | 3 | Copyright (C) 2002 Thomas Stephens |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public | 5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public |
6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later | 6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later |
7 | version. | 7 | version. |
8 | 8 | ||
9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the | 9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the |
10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | 10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
11 | Public License for more details. | 11 | Public License for more details. |
12 | 12 | ||
13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free | 13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free |
14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include "dvdgroupconf.h" | 17 | #include "dvdgroupconf.h" |
18 | 18 | ||
19 | DVDGroupConf::DVDGroupConf(QWidget *parent=0, const char *name=0):QWidget(parent,name) | 19 | DVDGroupConf::DVDGroupConf(QWidget *parent, const char *name):QWidget(parent,name) |
20 | { | 20 | { |
21 | QGridLayout *layout = new QGridLayout(this); | 21 | QGridLayout *layout = new QGridLayout(this); |
22 | 22 | ||
23 | //put rows between the buttons of size 1 | 23 | //put rows between the buttons of size 1 |
24 | layout->addRowSpacing(1,1); | 24 | layout->addRowSpacing(1,1); |
25 | layout->addRowSpacing(3,1); | 25 | layout->addRowSpacing(3,1); |
26 | 26 | ||
27 | //put collumns between the buttons of size 5 | 27 | //put collumns between the buttons of size 5 |
28 | layout->addColSpacing(1,5); | 28 | layout->addColSpacing(1,5); |
29 | layout->addColSpacing(3,5); | 29 | layout->addColSpacing(3,5); |
30 | layout->addColSpacing(5,5); | 30 | layout->addColSpacing(5,5); |
31 | layout->addColSpacing(7,5); | 31 | layout->addColSpacing(7,5); |
32 | 32 | ||
33 | //make sure that the collumns with the buttons in them stretch before the filler collumns do | 33 | //make sure that the collumns with the buttons in them stretch before the filler collumns do |
34 | //since there is so little room, there is no need to do this for the rows | 34 | //since there is so little room, there is no need to do this for the rows |
35 | layout->setColStretch(4,1); | 35 | layout->setColStretch(4,1); |
36 | layout->setColStretch(2,1); | 36 | layout->setColStretch(2,1); |
37 | layout->setColStretch(6,1); | 37 | layout->setColStretch(6,1); |
38 | layout->setColStretch(8,1); | 38 | layout->setColStretch(8,1); |
39 | layout->setColStretch(0,1); | 39 | layout->setColStretch(0,1); |
40 | 40 | ||
41 | //add the menu navigation buttons, and connect them to the RemoteTab slots... | 41 | //add the menu navigation buttons, and connect them to the RemoteTab slots... |
42 | QPushButton *up = new QPushButton("Up",this,"up"); | 42 | QPushButton *up = new QPushButton("Up",this,"up"); |
43 | layout->addWidget(up, 0, 4, 0); | 43 | layout->addWidget(up, 0, 4, 0); |
diff --git a/noncore/tools/remote/learntab.cpp b/noncore/tools/remote/learntab.cpp index 054bc7b..998f449 100644 --- a/noncore/tools/remote/learntab.cpp +++ b/noncore/tools/remote/learntab.cpp | |||
@@ -1,26 +1,26 @@ | |||
1 | /* | 1 | /* |
2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. | 2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. |
3 | Copyright (C) 2002 Thomas Stephens | 3 | Copyright (C) 2002 Thomas Stephens |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public | 5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public |
6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later | 6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later |
7 | version. | 7 | version. |
8 | 8 | ||
9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the | 9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the |
10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | 10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
11 | Public License for more details. | 11 | Public License for more details. |
12 | 12 | ||
13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free | 13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free |
14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include "learntab.h" | 17 | #include "learntab.h" |
18 | 18 | ||
19 | LearnTab::LearnTab(QWidget *parent=0, const char *name=0):QWidget(parent,name) | 19 | LearnTab::LearnTab(QWidget *parent, const char *name):QWidget(parent,name) |
20 | { | 20 | { |
21 | QVBoxLayout *layout = new QVBoxLayout(this); | 21 | QVBoxLayout *layout = new QVBoxLayout(this); |
22 | QString *string = new QString("<qt><h1>Opie-Remote Usage Instructions</h1><p>First, some definitions. A Remote is a remote entry in an lircd.conf file, it represents one remote you want to emulate. A Remote Layout is one entry in your ~/Settings/Remote.conf file. It represents the buttons that you see on your screen. Each button on a Remote Layout can be mapped to any button in a Remote. This way you can have, for example, a vcr remote layout, in which all the play/pause/etc buttons are mapped to the buttons on your vcr's remote. However, most VCR's don't have volume controls, so the volume buttons can be mapped to the volume buttons on your TV.</p><p>The first things you need the lirc and lirc-modules ipkgs. If you installed this from an ipkg, they should already be there, thanks to the wonderful world of dependencies. If not, get them. The next thing you need is an lircd.conf file. you can get these at <a href=http://www.lirc.org/>http://www.lirc.org/</a>. Read the documentation there to figure out how to make your own, if one for your remote doesn't exist, or how to have multiple remotes in one lircd.conf file. Once you have a good lircd.conf file, put it in /etc, kill the lircd daemon (if its running) and do a modprobe lirc_sir. Then, run lircd again.</p><p>The next thing you want to do is to create a remote layout. Go to the config tab, and enter a name for your remote layout in the pulldown menu. Dont use the name Remotes, as that could confuse the app. Hopefully, that will be fixed soon. after entering the name you want to use, press New, and then select the name again from the pulldown menu (another oddity that i hope to fix). Then, press each button that you want to map, and a dialog should appear. Select the remote and button that you want to use, and click OK. Once you are done, go to the Remote tab, and select the new remote from the dropdown menu. It should works fine. If at any time you want to change a remote layout, go to the Config tab, select the layout from the dropdown menu, and change the buttons you want to change.</p><p>This is program is written and maintaned by Thomas (spiralman) Stephens. <a href=mailto:spiralman@softhome.net>spiralman@softhome.net</a>. Or, look for me on #opie or #handhelds.org on irc.openprojects.net.</p></qt>"); | 22 | QString *string = new QString("<qt><h1>Opie-Remote Usage Instructions</h1><p>First, some definitions. A Remote is a remote entry in an lircd.conf file, it represents one remote you want to emulate. A Remote Layout is one entry in your ~/Settings/Remote.conf file. It represents the buttons that you see on your screen. Each button on a Remote Layout can be mapped to any button in a Remote. This way you can have, for example, a vcr remote layout, in which all the play/pause/etc buttons are mapped to the buttons on your vcr's remote. However, most VCR's don't have volume controls, so the volume buttons can be mapped to the volume buttons on your TV.</p><p>The first things you need the lirc and lirc-modules ipkgs. If you installed this from an ipkg, they should already be there, thanks to the wonderful world of dependencies. If not, get them. The next thing you need is an lircd.conf file. you can get these at <a href=http://www.lirc.org/>http://www.lirc.org/</a>. Read the documentation there to figure out how to make your own, if one for your remote doesn't exist, or how to have multiple remotes in one lircd.conf file. Once you have a good lircd.conf file, put it in /etc, kill the lircd daemon (if its running) and do a modprobe lirc_sir. Then, run lircd again.</p><p>The next thing you want to do is to create a remote layout. Go to the config tab, and enter a name for your remote layout in the pulldown menu. Dont use the name Remotes, as that could confuse the app. Hopefully, that will be fixed soon. after entering the name you want to use, press New, and then select the name again from the pulldown menu (another oddity that i hope to fix). Then, press each button that you want to map, and a dialog should appear. Select the remote and button that you want to use, and click OK. Once you are done, go to the Remote tab, and select the new remote from the dropdown menu. It should works fine. If at any time you want to change a remote layout, go to the Config tab, select the layout from the dropdown menu, and change the buttons you want to change.</p><p>This is program is written and maintaned by Thomas (spiralman) Stephens. <a href=mailto:spiralman@softhome.net>spiralman@softhome.net</a>. Or, look for me on #opie or #handhelds.org on irc.openprojects.net.</p></qt>"); |
23 | 23 | ||
24 | QTextView *textView = new QTextView(*string, 0, this); | 24 | QTextView *textView = new QTextView(*string, 0, this); |
25 | layout->addWidget(textView); | 25 | layout->addWidget(textView); |
26 | } | 26 | } |
diff --git a/noncore/tools/remote/mainview.cpp b/noncore/tools/remote/mainview.cpp index 47027fb..a7be9e3 100644 --- a/noncore/tools/remote/mainview.cpp +++ b/noncore/tools/remote/mainview.cpp | |||
@@ -1,43 +1,43 @@ | |||
1 | /* | 1 | /* |
2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. | 2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. |
3 | Copyright (C) 2002 Thomas Stephens | 3 | Copyright (C) 2002 Thomas Stephens |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public | 5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public |
6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later | 6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later |
7 | version. | 7 | version. |
8 | 8 | ||
9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the | 9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the |
10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | 10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
11 | Public License for more details. | 11 | Public License for more details. |
12 | 12 | ||
13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free | 13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free |
14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include "mainview.h" | 17 | #include "mainview.h" |
18 | 18 | ||
19 | MainView::MainView(QWidget *parent, const char *name=0) : QWidget(parent, name) | 19 | MainView::MainView(QWidget *parent, const char *name) : QWidget(parent, name) |
20 | { | 20 | { |
21 | setIcon( Resource::loadPixmap( "remote" ) ); | 21 | setIcon( Resource::loadPixmap( "remote" ) ); |
22 | setCaption(tr("Remote") ); | 22 | setCaption(tr("Remote") ); |
23 | 23 | ||
24 | QVBoxLayout *layout = new QVBoxLayout(this); | 24 | QVBoxLayout *layout = new QVBoxLayout(this); |
25 | QTabWidget *tabs = new QTabWidget(this); | 25 | QTabWidget *tabs = new QTabWidget(this); |
26 | 26 | ||
27 | layout->addWidget(tabs); | 27 | layout->addWidget(tabs); |
28 | 28 | ||
29 | printf("MainView: 1\n"); | 29 | printf("MainView: 1\n"); |
30 | remote = new RemoteTab(tabs); | 30 | remote = new RemoteTab(tabs); |
31 | printf("MainView: 2\n"); | 31 | printf("MainView: 2\n"); |
32 | learn = new LearnTab(tabs); | 32 | learn = new LearnTab(tabs); |
33 | printf("MainView: 3\n"); | 33 | printf("MainView: 3\n"); |
34 | config = new ConfigTab(tabs); | 34 | config = new ConfigTab(tabs); |
35 | printf("MainView: 4\n"); | 35 | printf("MainView: 4\n"); |
36 | connect(config, SIGNAL(remotesChanged()), this, SLOT(updateRemotesList()) ); | 36 | connect(config, SIGNAL(remotesChanged()), this, SLOT(updateRemotesList()) ); |
37 | printf("MainView: 5\n"); | 37 | printf("MainView: 5\n"); |
38 | 38 | ||
39 | remote->setIRSocket(fd); | 39 | remote->setIRSocket(fd); |
40 | 40 | ||
41 | tabs->addTab(remote, tr("Remote") ); | 41 | tabs->addTab(remote, tr("Remote") ); |
42 | tabs->addTab(learn,tr("Learn") ); | 42 | tabs->addTab(learn,tr("Learn") ); |
43 | tabs->addTab(config,tr("Config") ); | 43 | tabs->addTab(config,tr("Config") ); |
diff --git a/noncore/tools/remote/remotetab.cpp b/noncore/tools/remote/remotetab.cpp index 64b8ee4..5b02e94 100644 --- a/noncore/tools/remote/remotetab.cpp +++ b/noncore/tools/remote/remotetab.cpp | |||
@@ -1,43 +1,43 @@ | |||
1 | /* | 1 | /* |
2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. | 2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. |
3 | Copyright (C) 2002 Thomas Stephens | 3 | Copyright (C) 2002 Thomas Stephens |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public | 5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public |
6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later | 6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later |
7 | version. | 7 | version. |
8 | 8 | ||
9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the | 9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the |
10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | 10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
11 | Public License for more details. | 11 | Public License for more details. |
12 | 12 | ||
13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free | 13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free |
14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include "remotetab.h" | 17 | #include "remotetab.h" |
18 | 18 | ||
19 | RemoteTab::RemoteTab(QWidget *parent=0, const char *name=0):QWidget(parent,name) | 19 | RemoteTab::RemoteTab(QWidget *parent, const char *name):QWidget(parent,name) |
20 | { | 20 | { |
21 | QVBoxLayout *layout = new QVBoxLayout(this); | 21 | QVBoxLayout *layout = new QVBoxLayout(this); |
22 | 22 | ||
23 | topGroup = new TopGroup(this); | 23 | topGroup = new TopGroup(this); |
24 | //topGroup->setMaximumHeight(22); | 24 | //topGroup->setMaximumHeight(22); |
25 | layout->addWidget(topGroup, 0, 0); | 25 | layout->addWidget(topGroup, 0, 0); |
26 | printf("%d %d", topGroup->width(), topGroup->height()); | 26 | printf("%d %d", topGroup->width(), topGroup->height()); |
27 | 27 | ||
28 | layout->addSpacing(1); | 28 | layout->addSpacing(1); |
29 | 29 | ||
30 | dvdGroup = new DVDGroup(this); | 30 | dvdGroup = new DVDGroup(this); |
31 | //dvdGroup->setMaximumHeight(68); | 31 | //dvdGroup->setMaximumHeight(68); |
32 | layout->addWidget(dvdGroup, 0, 0); | 32 | layout->addWidget(dvdGroup, 0, 0); |
33 | 33 | ||
34 | layout->addSpacing(1); | 34 | layout->addSpacing(1); |
35 | 35 | ||
36 | vcrGroup = new VCRGroup(this); | 36 | vcrGroup = new VCRGroup(this); |
37 | layout->addWidget(vcrGroup, 0, 0); | 37 | layout->addWidget(vcrGroup, 0, 0); |
38 | //vcrGroup->setMaximumHeight(45); | 38 | //vcrGroup->setMaximumHeight(45); |
39 | 39 | ||
40 | layout->addSpacing(1); | 40 | layout->addSpacing(1); |
41 | 41 | ||
42 | channelGroup = new ChannelGroup(this); | 42 | channelGroup = new ChannelGroup(this); |
43 | //channelGroup->setMaximumHeight(91); | 43 | //channelGroup->setMaximumHeight(91); |
@@ -50,81 +50,81 @@ RemoteTab::RemoteTab(QWidget *parent=0, const char *name=0):QWidget(parent,name) | |||
50 | addr.sun_family=AF_UNIX; | 50 | addr.sun_family=AF_UNIX; |
51 | strcpy(addr.sun_path,"/dev/lircd"); | 51 | strcpy(addr.sun_path,"/dev/lircd"); |
52 | } | 52 | } |
53 | 53 | ||
54 | int RemoteTab::sendIR() | 54 | int RemoteTab::sendIR() |
55 | { | 55 | { |
56 | const QObject *button = sender(); | 56 | const QObject *button = sender(); |
57 | QString string = cfg->readEntry(button->name()); | 57 | QString string = cfg->readEntry(button->name()); |
58 | string+='\n'; | 58 | string+='\n'; |
59 | const char *write_buffer = string.latin1(); | 59 | const char *write_buffer = string.latin1(); |
60 | const char *read_buffer; | 60 | const char *read_buffer; |
61 | bool done=false; | 61 | bool done=false; |
62 | 62 | ||
63 | fd = socket(AF_UNIX, SOCK_STREAM, 0); | 63 | fd = socket(AF_UNIX, SOCK_STREAM, 0); |
64 | if(fd == -1) | 64 | if(fd == -1) |
65 | { | 65 | { |
66 | QMessageBox *mb = new QMessageBox("Error!", | 66 | QMessageBox *mb = new QMessageBox("Error!", |
67 | "couldnt connect to socket", | 67 | "couldnt connect to socket", |
68 | QMessageBox::NoIcon, | 68 | QMessageBox::NoIcon, |
69 | QMessageBox::Ok, | 69 | QMessageBox::Ok, |
70 | QMessageBox::NoButton, | 70 | QMessageBox::NoButton, |
71 | QMessageBox::NoButton); | 71 | QMessageBox::NoButton); |
72 | mb->exec(); | 72 | mb->exec(); |
73 | perror("RemoteTab::SendIR"); | 73 | perror("RemoteTab::SendIR"); |
74 | return NULL; | 74 | return 0; |
75 | } | 75 | } |
76 | 76 | ||
77 | 77 | ||
78 | if(std::connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1) | 78 | if(::connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1) |
79 | { | 79 | { |
80 | QMessageBox *mb = new QMessageBox("Error!", | 80 | QMessageBox *mb = new QMessageBox("Error!", |
81 | "couldnt connect to socket", | 81 | "couldnt connect to socket", |
82 | QMessageBox::NoIcon, | 82 | QMessageBox::NoIcon, |
83 | QMessageBox::Ok, | 83 | QMessageBox::Ok, |
84 | QMessageBox::NoButton, | 84 | QMessageBox::NoButton, |
85 | QMessageBox::NoButton); | 85 | QMessageBox::NoButton); |
86 | mb->exec(); | 86 | mb->exec(); |
87 | perror("RemoteTab::SendIR"); | 87 | perror("RemoteTab::SendIR"); |
88 | } | 88 | } |
89 | 89 | ||
90 | printf("fd2: %d\n", fd); | 90 | printf("fd2: %d\n", fd); |
91 | printf("%s", write_buffer); | 91 | printf("%s", write_buffer); |
92 | 92 | ||
93 | printf("1\n"); | 93 | printf("1\n"); |
94 | printf("%d\n", write(fd, write_buffer, strlen(write_buffer) ) ); | 94 | printf("%d\n", write(fd, write_buffer, strlen(write_buffer) ) ); |
95 | printf("2\n"); | 95 | printf("2\n"); |
96 | while(!done) | 96 | while(!done) |
97 | { | 97 | { |
98 | read_buffer=readPacket(); | 98 | read_buffer=readPacket(); |
99 | printf("%s\n", read_buffer); | 99 | printf("%s\n", read_buffer); |
100 | if(strcasecmp(read_buffer, "END") == 0) | 100 | if(strcasecmp(read_buffer, "END") == 0) |
101 | { | 101 | { |
102 | printf("done reading packet\n"); | 102 | printf("done reading packet\n"); |
103 | done=true; | 103 | done=true; |
104 | } | 104 | } |
105 | } | 105 | } |
106 | std::close(fd); | 106 | ::close(fd); |
107 | } | 107 | } |
108 | 108 | ||
109 | // printf("%s\n", readPacket()); | 109 | // printf("%s\n", readPacket()); |
110 | // printf("%d\n", read(fd, read_buffer,sizeof(read_buffer)) ); | 110 | // printf("%d\n", read(fd, read_buffer,sizeof(read_buffer)) ); |
111 | // printf("%s", read_buffer); | 111 | // printf("%s", read_buffer); |
112 | 112 | ||
113 | //this function was ripped for rc.c in xrc, it is available here: http://www.lirc.org/software.html | 113 | //this function was ripped for rc.c in xrc, it is available here: http://www.lirc.org/software.html |
114 | const char *RemoteTab::readPacket() | 114 | const char *RemoteTab::readPacket() |
115 | { | 115 | { |
116 | static char buffer[PACKET_SIZE+1]=""; | 116 | static char buffer[PACKET_SIZE+1]=""; |
117 | char *end; | 117 | char *end; |
118 | static int ptr=0,end_len=0; | 118 | static int ptr=0,end_len=0; |
119 | ssize_t ret; | 119 | ssize_t ret; |
120 | 120 | ||
121 | if(ptr>0) | 121 | if(ptr>0) |
122 | { | 122 | { |
123 | memmove(buffer,buffer+ptr,strlen(buffer+ptr)+1); | 123 | memmove(buffer,buffer+ptr,strlen(buffer+ptr)+1); |
124 | ptr=strlen(buffer); | 124 | ptr=strlen(buffer); |
125 | end=strchr(buffer,'\n'); | 125 | end=strchr(buffer,'\n'); |
126 | } | 126 | } |
127 | else | 127 | else |
128 | { | 128 | { |
129 | end=NULL; | 129 | end=NULL; |
130 | } | 130 | } |
diff --git a/noncore/tools/remote/topgroup.cpp b/noncore/tools/remote/topgroup.cpp index 94ea622..93cffbb 100644 --- a/noncore/tools/remote/topgroup.cpp +++ b/noncore/tools/remote/topgroup.cpp | |||
@@ -1,43 +1,43 @@ | |||
1 | /* | 1 | /* |
2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. | 2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. |
3 | Copyright (C) 2002 Thomas Stephens | 3 | Copyright (C) 2002 Thomas Stephens |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public | 5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public |
6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later | 6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later |
7 | version. | 7 | version. |
8 | 8 | ||
9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the | 9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the |
10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | 10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
11 | Public License for more details. | 11 | Public License for more details. |
12 | 12 | ||
13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free | 13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free |
14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include "topgroup.h" | 17 | #include "topgroup.h" |
18 | 18 | ||
19 | TopGroup::TopGroup(QWidget *parent=0, const char *name=0):QWidget(parent,name) | 19 | TopGroup::TopGroup(QWidget *parent, const char *name):QWidget(parent,name) |
20 | { | 20 | { |
21 | QHBoxLayout *layout = new QHBoxLayout(this, 0, -1, 0); | 21 | QHBoxLayout *layout = new QHBoxLayout(this, 0, -1, 0); |
22 | 22 | ||
23 | QPushButton *power = new QPushButton("Power",this,"power"); | 23 | QPushButton *power = new QPushButton("Power",this,"power"); |
24 | layout->addWidget(power); | 24 | layout->addWidget(power); |
25 | connect(power, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); | 25 | connect(power, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); |
26 | //power->setGeometry(5, 5,40, 20); | 26 | //power->setGeometry(5, 5,40, 20); |
27 | 27 | ||
28 | layout->addSpacing(5); | 28 | layout->addSpacing(5); |
29 | 29 | ||
30 | QPushButton *source = new QPushButton("Source",this,"source"); | 30 | QPushButton *source = new QPushButton("Source",this,"source"); |
31 | layout->addWidget(source); | 31 | layout->addWidget(source); |
32 | connect(source, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); | 32 | connect(source, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); |
33 | //source->setGeometry(50,5,40,20); | 33 | //source->setGeometry(50,5,40,20); |
34 | 34 | ||
35 | remotes = new QComboBox(false, this, "remotes"); | 35 | remotes = new QComboBox(false, this, "remotes"); |
36 | connect(remotes, SIGNAL(activated(const QString &)), this->parentWidget(), SLOT(remoteSelected(const QString &)) ); | 36 | connect(remotes, SIGNAL(activated(const QString &)), this->parentWidget(), SLOT(remoteSelected(const QString &)) ); |
37 | remotes->insertItem("Select Remote"); | 37 | remotes->insertItem("Select Remote"); |
38 | //remotes->setGeometry(135,5,95,20); | 38 | //remotes->setGeometry(135,5,95,20); |
39 | 39 | ||
40 | QLabel *remoteLabel = new QLabel(remotes, "Remote: ",this,"remoteLabel"); | 40 | QLabel *remoteLabel = new QLabel(remotes, "Remote: ",this,"remoteLabel"); |
41 | //remoteLabel->setGeometry(90,5,40,20); | 41 | //remoteLabel->setGeometry(90,5,40,20); |
42 | remoteLabel->setAlignment(AlignRight | AlignVCenter); | 42 | remoteLabel->setAlignment(AlignRight | AlignVCenter); |
43 | 43 | ||
diff --git a/noncore/tools/remote/topgroupconf.cpp b/noncore/tools/remote/topgroupconf.cpp index eb071fb..d763a3a 100644 --- a/noncore/tools/remote/topgroupconf.cpp +++ b/noncore/tools/remote/topgroupconf.cpp | |||
@@ -1,43 +1,43 @@ | |||
1 | /* | 1 | /* |
2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. | 2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. |
3 | Copyright (C) 2002 Thomas Stephens | 3 | Copyright (C) 2002 Thomas Stephens |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public | 5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public |
6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later | 6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later |
7 | version. | 7 | version. |
8 | 8 | ||
9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the | 9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the |
10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | 10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
11 | Public License for more details. | 11 | Public License for more details. |
12 | 12 | ||
13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free | 13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free |
14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include "topgroupconf.h" | 17 | #include "topgroupconf.h" |
18 | 18 | ||
19 | TopGroupConf::TopGroupConf(QWidget *parent=0, const char *name=0):QWidget(parent,name) | 19 | TopGroupConf::TopGroupConf(QWidget *parent, const char *name):QWidget(parent,name) |
20 | { | 20 | { |
21 | QHBoxLayout *layout = new QHBoxLayout(this); | 21 | QHBoxLayout *layout = new QHBoxLayout(this); |
22 | 22 | ||
23 | QPushButton *power = new QPushButton("Power",this,"power"); | 23 | QPushButton *power = new QPushButton("Power",this,"power"); |
24 | layout->addWidget(power); | 24 | layout->addWidget(power); |
25 | connect(power, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); | 25 | connect(power, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); |
26 | //power->setGeometry(5, 5,40, 20); | 26 | //power->setGeometry(5, 5,40, 20); |
27 | 27 | ||
28 | layout->addSpacing(5); | 28 | layout->addSpacing(5); |
29 | 29 | ||
30 | QPushButton *source = new QPushButton("Source",this,"source"); | 30 | QPushButton *source = new QPushButton("Source",this,"source"); |
31 | layout->addWidget(source); | 31 | layout->addWidget(source); |
32 | connect(source, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); | 32 | connect(source, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); |
33 | //source->setGeometry(50,5,40,20); | 33 | //source->setGeometry(50,5,40,20); |
34 | 34 | ||
35 | remotes = new QComboBox(true, this, "remotes"); | 35 | remotes = new QComboBox(true, this, "remotes"); |
36 | remotes->insertItem(QString("Remotes")); | 36 | remotes->insertItem(QString("Remotes")); |
37 | layout->addWidget(remotes); | 37 | layout->addWidget(remotes); |
38 | layout->setStretchFactor(remotes, 1); | 38 | layout->setStretchFactor(remotes, 1); |
39 | connect(remotes, SIGNAL(activated(const QString &)), this->parentWidget(), SLOT(remoteSelected(const QString &)) ); | 39 | connect(remotes, SIGNAL(activated(const QString &)), this->parentWidget(), SLOT(remoteSelected(const QString &)) ); |
40 | 40 | ||
41 | 41 | ||
42 | QPushButton *newrem = new QPushButton("New", this, "new"); | 42 | QPushButton *newrem = new QPushButton("New", this, "new"); |
43 | layout->addWidget(newrem); | 43 | layout->addWidget(newrem); |
diff --git a/noncore/tools/remote/vcrgroup.cpp b/noncore/tools/remote/vcrgroup.cpp index 4f07ca3..10ebe5d 100644 --- a/noncore/tools/remote/vcrgroup.cpp +++ b/noncore/tools/remote/vcrgroup.cpp | |||
@@ -1,49 +1,49 @@ | |||
1 | /* | 1 | /* |
2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. | 2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. |
3 | Copyright (C) 2002 Thomas Stephens | 3 | Copyright (C) 2002 Thomas Stephens |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify it under | 5 | This program is free software; you can redistribute it and/or modify it under |
6 | the terms of the GNU General Public | 6 | the terms of the GNU General Public |
7 | License as published by the Free Software Foundation; either version 2 of the | 7 | License as published by the Free Software Foundation; either version 2 of the |
8 | License, or (at your option) any later | 8 | License, or (at your option) any later |
9 | version. | 9 | version. |
10 | 10 | ||
11 | This program is distributed in the hope that it will be useful, but WITHOUT ANY | 11 | This program is distributed in the hope that it will be useful, but WITHOUT ANY |
12 | WARRANTY; without even the | 12 | WARRANTY; without even the |
13 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 13 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
14 | 14 | ||
15 | GNU General | 15 | GNU General |
16 | Public License for more details. | 16 | Public License for more details. |
17 | 17 | ||
18 | You should have received a copy of the GNU General Public License along with | 18 | You should have received a copy of the GNU General Public License along with |
19 | this program; if not, write to the Free | 19 | this program; if not, write to the Free |
20 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 20 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 | */ | 21 | */ |
22 | 22 | ||
23 | #include "vcrgroup.h" | 23 | #include "vcrgroup.h" |
24 | 24 | ||
25 | VCRGroup::VCRGroup(QWidget *parent=0, const char *name=0) : QWidget(parent, | 25 | VCRGroup::VCRGroup(QWidget *parent, const char *name) : QWidget(parent, |
26 | name) | 26 | name) |
27 | { | 27 | { |
28 | QVBoxLayout *vlayout = new QVBoxLayout(this); | 28 | QVBoxLayout *vlayout = new QVBoxLayout(this); |
29 | 29 | ||
30 | QHBoxLayout *hlayout1 = new QHBoxLayout(this); | 30 | QHBoxLayout *hlayout1 = new QHBoxLayout(this); |
31 | QHBoxLayout *hlayout2 = new QHBoxLayout(this); | 31 | QHBoxLayout *hlayout2 = new QHBoxLayout(this); |
32 | 32 | ||
33 | vlayout->addLayout(hlayout1); | 33 | vlayout->addLayout(hlayout1); |
34 | vlayout->addSpacing(1); | 34 | vlayout->addSpacing(1); |
35 | vlayout->addLayout(hlayout2); | 35 | vlayout->addLayout(hlayout2); |
36 | 36 | ||
37 | QPushButton *play = new | 37 | QPushButton *play = new |
38 | QPushButton("Play",this, "play"); | 38 | QPushButton("Play",this, "play"); |
39 | hlayout1->addWidget(play); | 39 | hlayout1->addWidget(play); |
40 | connect(play, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); | 40 | connect(play, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); |
41 | 41 | ||
42 | hlayout1->addSpacing(5); | 42 | hlayout1->addSpacing(5); |
43 | 43 | ||
44 | QPushButton *pause = new | 44 | QPushButton *pause = new |
45 | QPushButton("Pause",this, "pause"); | 45 | QPushButton("Pause",this, "pause"); |
46 | hlayout1->addWidget(pause); | 46 | hlayout1->addWidget(pause); |
47 | connect(pause, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); | 47 | connect(pause, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); |
48 | 48 | ||
49 | hlayout1->addSpacing(5); | 49 | hlayout1->addSpacing(5); |
diff --git a/noncore/tools/remote/vcrgroupconf.cpp b/noncore/tools/remote/vcrgroupconf.cpp index a50ed0a..2158d43 100644 --- a/noncore/tools/remote/vcrgroupconf.cpp +++ b/noncore/tools/remote/vcrgroupconf.cpp | |||
@@ -1,43 +1,43 @@ | |||
1 | /* | 1 | /* |
2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. | 2 | Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. |
3 | Copyright (C) 2002 Thomas Stephens | 3 | Copyright (C) 2002 Thomas Stephens |
4 | 4 | ||
5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public | 5 | This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public |
6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later | 6 | License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later |
7 | version. | 7 | version. |
8 | 8 | ||
9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the | 9 | This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the |
10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General | 10 | implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General |
11 | Public License for more details. | 11 | Public License for more details. |
12 | 12 | ||
13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free | 13 | You should have received a copy of the GNU General Public License along with this program; if not, write to the Free |
14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 14 | Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
15 | */ | 15 | */ |
16 | 16 | ||
17 | #include "vcrgroupconf.h" | 17 | #include "vcrgroupconf.h" |
18 | 18 | ||
19 | VCRGroupConf::VCRGroupConf(QWidget *parent=0, const char *name=0) : QWidget(parent, name) | 19 | VCRGroupConf::VCRGroupConf(QWidget *parent, const char *name) : QWidget(parent, name) |
20 | { | 20 | { |
21 | QVBoxLayout *vlayout = new QVBoxLayout(this); | 21 | QVBoxLayout *vlayout = new QVBoxLayout(this); |
22 | 22 | ||
23 | QHBoxLayout *hlayout1 = new QHBoxLayout(this); | 23 | QHBoxLayout *hlayout1 = new QHBoxLayout(this); |
24 | QHBoxLayout *hlayout2 = new QHBoxLayout(this); | 24 | QHBoxLayout *hlayout2 = new QHBoxLayout(this); |
25 | 25 | ||
26 | vlayout->addLayout(hlayout1); | 26 | vlayout->addLayout(hlayout1); |
27 | vlayout->addSpacing(1); | 27 | vlayout->addSpacing(1); |
28 | vlayout->addLayout(hlayout2); | 28 | vlayout->addLayout(hlayout2); |
29 | 29 | ||
30 | QPushButton *play = new QPushButton("Play",this, "play"); | 30 | QPushButton *play = new QPushButton("Play",this, "play"); |
31 | hlayout1->addWidget(play); | 31 | hlayout1->addWidget(play); |
32 | connect(play, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); | 32 | connect(play, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); |
33 | 33 | ||
34 | hlayout1->addSpacing(5); | 34 | hlayout1->addSpacing(5); |
35 | 35 | ||
36 | QPushButton *pause = new QPushButton("Pause",this, "pause"); | 36 | QPushButton *pause = new QPushButton("Pause",this, "pause"); |
37 | hlayout1->addWidget(pause); | 37 | hlayout1->addWidget(pause); |
38 | connect(pause, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); | 38 | connect(pause, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); |
39 | 39 | ||
40 | hlayout1->addSpacing(5); | 40 | hlayout1->addSpacing(5); |
41 | 41 | ||
42 | QPushButton *stop = new QPushButton("Stop",this, "stop"); | 42 | QPushButton *stop = new QPushButton("Stop",this, "stop"); |
43 | hlayout1->addWidget(stop); | 43 | hlayout1->addWidget(stop); |
diff --git a/noncore/unsupported/mail2/libmail/imaphandler.cpp b/noncore/unsupported/mail2/libmail/imaphandler.cpp index 730a004..7493240 100644 --- a/noncore/unsupported/mail2/libmail/imaphandler.cpp +++ b/noncore/unsupported/mail2/libmail/imaphandler.cpp | |||
@@ -149,49 +149,49 @@ QString IMAPHandler::iList(const QString &reference, const QString &mailbox) | |||
149 | } | 149 | } |
150 | 150 | ||
151 | QString IMAPHandler::iLsub(const QString &reference, const QString &mailbox) | 151 | QString IMAPHandler::iLsub(const QString &reference, const QString &mailbox) |
152 | { | 152 | { |
153 | doLogin(); | 153 | doLogin(); |
154 | 154 | ||
155 | _ibase->sendCommand(QString("%1 LSUB \"%2\" \"%3\"\r\n") | 155 | _ibase->sendCommand(QString("%1 LSUB \"%2\" \"%3\"\r\n") |
156 | .arg(tag()) | 156 | .arg(tag()) |
157 | .arg(escape(reference)) | 157 | .arg(escape(reference)) |
158 | .arg(escape(mailbox))); | 158 | .arg(escape(mailbox))); |
159 | return tag(false); | 159 | return tag(false); |
160 | } | 160 | } |
161 | 161 | ||
162 | QString IMAPHandler::iStatus(const QString &mailbox, const QString &items) | 162 | QString IMAPHandler::iStatus(const QString &mailbox, const QString &items) |
163 | { | 163 | { |
164 | doLogin(); | 164 | doLogin(); |
165 | 165 | ||
166 | _ibase->sendCommand(QString("%1 STATUS \"%2\" (%3)\r\n") | 166 | _ibase->sendCommand(QString("%1 STATUS \"%2\" (%3)\r\n") |
167 | .arg(tag()) | 167 | .arg(tag()) |
168 | .arg(escape(mailbox)) | 168 | .arg(escape(mailbox)) |
169 | .arg(escape(items))); | 169 | .arg(escape(items))); |
170 | return tag(false); | 170 | return tag(false); |
171 | } | 171 | } |
172 | 172 | ||
173 | QString IMAPHandler::iAppend(const QString &mailbox, const QString &literal, const QString &flags, const QString &datetime = 0) | 173 | QString IMAPHandler::iAppend(const QString &mailbox, const QString &literal, const QString &flags, const QString &datetime) |
174 | { | 174 | { |
175 | doLogin(); | 175 | doLogin(); |
176 | 176 | ||
177 | _ibase->sendCommand(QString("%1 APPEND \"%2\" (%3) \"%4\" {%5}\r\n%6\r\n") | 177 | _ibase->sendCommand(QString("%1 APPEND \"%2\" (%3) \"%4\" {%5}\r\n%6\r\n") |
178 | .arg(tag()) | 178 | .arg(tag()) |
179 | .arg(escape(mailbox)) | 179 | .arg(escape(mailbox)) |
180 | .arg(flags) | 180 | .arg(flags) |
181 | .arg(escape(datetime)) | 181 | .arg(escape(datetime)) |
182 | .arg(literal.length()) | 182 | .arg(literal.length()) |
183 | .arg(literal)); | 183 | .arg(literal)); |
184 | return tag(false); | 184 | return tag(false); |
185 | } | 185 | } |
186 | 186 | ||
187 | QString IMAPHandler::iCheck() | 187 | QString IMAPHandler::iCheck() |
188 | { | 188 | { |
189 | doLogin(); | 189 | doLogin(); |
190 | 190 | ||
191 | _ibase->sendCommand(QString("%1 CHECK\r\n") | 191 | _ibase->sendCommand(QString("%1 CHECK\r\n") |
192 | .arg(tag())); | 192 | .arg(tag())); |
193 | return tag(false); | 193 | return tag(false); |
194 | } | 194 | } |
195 | 195 | ||
196 | QString IMAPHandler::iClose() | 196 | QString IMAPHandler::iClose() |
197 | { | 197 | { |
diff --git a/noncore/unsupported/oipkg/mainwindow.cpp b/noncore/unsupported/oipkg/mainwindow.cpp index 7df1d6b..05f2f06 100644 --- a/noncore/unsupported/oipkg/mainwindow.cpp +++ b/noncore/unsupported/oipkg/mainwindow.cpp | |||
@@ -10,49 +10,49 @@ | |||
10 | #include <qpe/qpetoolbar.h> | 10 | #include <qpe/qpetoolbar.h> |
11 | #include <qpe/qcopenvelope_qws.h> | 11 | #include <qpe/qcopenvelope_qws.h> |
12 | #include <qaction.h> | 12 | #include <qaction.h> |
13 | #include <qmessagebox.h> | 13 | #include <qmessagebox.h> |
14 | #include <qpopupmenu.h> | 14 | #include <qpopupmenu.h> |
15 | #include <qtoolbutton.h> | 15 | #include <qtoolbutton.h> |
16 | #include <qstring.h> | 16 | #include <qstring.h> |
17 | #include <qlabel.h> | 17 | #include <qlabel.h> |
18 | #include <qfile.h> | 18 | #include <qfile.h> |
19 | #include <qlistview.h> | 19 | #include <qlistview.h> |
20 | #include <qtextview.h> | 20 | #include <qtextview.h> |
21 | #include <qcheckbox.h> | 21 | #include <qcheckbox.h> |
22 | #include <qlineedit.h> | 22 | #include <qlineedit.h> |
23 | #include <qtabwidget.h> | 23 | #include <qtabwidget.h> |
24 | #include <qcombobox.h> | 24 | #include <qcombobox.h> |
25 | #include <qmessagebox.h> | 25 | #include <qmessagebox.h> |
26 | #include <qpushbutton.h> | 26 | #include <qpushbutton.h> |
27 | #include <qlayout.h> | 27 | #include <qlayout.h> |
28 | 28 | ||
29 | #include "pksettingsbase.h" | 29 | #include "pksettingsbase.h" |
30 | #include "utils.h" | 30 | #include "utils.h" |
31 | #include "packagelistitem.h" | 31 | #include "packagelistitem.h" |
32 | 32 | ||
33 | 33 | ||
34 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f = 0 ) : | 34 | MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) : |
35 | QMainWindow( parent, name, f ) | 35 | QMainWindow( parent, name, f ) |
36 | // packageListServers( QObject(parent), name ), | 36 | // packageListServers( QObject(parent), name ), |
37 | // packageListSearch( parent, name ), | 37 | // packageListSearch( parent, name ), |
38 | // packageListDocLnk( parent, name ) | 38 | // packageListDocLnk( parent, name ) |
39 | { | 39 | { |
40 | setCaption( tr("Package Manager") ); | 40 | setCaption( tr("Package Manager") ); |
41 | settings = new PackageManagerSettings(this,0,TRUE); | 41 | settings = new PackageManagerSettings(this,0,TRUE); |
42 | listViewPackages = new PackageListView( this,"listViewPackages",settings ); | 42 | listViewPackages = new PackageListView( this,"listViewPackages",settings ); |
43 | setCentralWidget( listViewPackages ); | 43 | setCentralWidget( listViewPackages ); |
44 | listViewPackages->addList( tr("feeds"), &packageListServers ); | 44 | listViewPackages->addList( tr("feeds"), &packageListServers ); |
45 | listViewPackages->addList( tr("ipkgfind"), &packageListSearch ); | 45 | listViewPackages->addList( tr("ipkgfind"), &packageListSearch ); |
46 | //listViewPackages->addList( tr("documents"), &packageListDocLnk ); | 46 | //listViewPackages->addList( tr("documents"), &packageListDocLnk ); |
47 | ipkg = new PmIpkg( settings, this ); | 47 | ipkg = new PmIpkg( settings, this ); |
48 | packageListServers.setSettings( settings ); | 48 | packageListServers.setSettings( settings ); |
49 | packageListSearch.setSettings( settings ); | 49 | packageListSearch.setSettings( settings ); |
50 | packageListDocLnk.setSettings( settings ); | 50 | packageListDocLnk.setSettings( settings ); |
51 | pvDebug(9,"packageListServers.update"); | 51 | pvDebug(9,"packageListServers.update"); |
52 | packageListServers.update(); | 52 | packageListServers.update(); |
53 | pvDebug(9,"packageListDocLnk.update"); | 53 | pvDebug(9,"packageListDocLnk.update"); |
54 | pvDebug(0,"no UPDATE of DocLnk"); | 54 | pvDebug(0,"no UPDATE of DocLnk"); |
55 | // packageListDocLnk.update(); | 55 | // packageListDocLnk.update(); |
56 | pvDebug(9,"makeMenu"); | 56 | pvDebug(9,"makeMenu"); |
57 | makeMenu(); | 57 | makeMenu(); |
58 | makeChannel(); | 58 | makeChannel(); |
diff --git a/noncore/unsupported/oipkg/package.cpp b/noncore/unsupported/oipkg/package.cpp index 97f7813..517b37a 100644 --- a/noncore/unsupported/oipkg/package.cpp +++ b/noncore/unsupported/oipkg/package.cpp | |||
@@ -1,93 +1,93 @@ | |||
1 | #include "package.h" | 1 | #include "package.h" |
2 | 2 | ||
3 | #include <qpe/process.h> | 3 | #include <qpe/process.h> |
4 | #include <qpe/stringutil.h> | 4 | #include <qpe/stringutil.h> |
5 | #include <qfile.h> | 5 | #include <qfile.h> |
6 | #include <qtextstream.h> | 6 | #include <qtextstream.h> |
7 | #include <stdlib.h> | 7 | #include <stdlib.h> |
8 | #include <unistd.h> | 8 | #include <unistd.h> |
9 | 9 | ||
10 | #include "debug.h" | 10 | #include "debug.h" |
11 | 11 | ||
12 | Package::Package( QObject *parent=0, const char *name=0 ) | 12 | Package::Package( QObject *parent, const char *name ) |
13 | : QObject(parent,name) | 13 | : QObject(parent,name) |
14 | { | 14 | { |
15 | 15 | ||
16 | } | 16 | } |
17 | 17 | ||
18 | Package::~Package() | 18 | Package::~Package() |
19 | { | 19 | { |
20 | } | 20 | } |
21 | 21 | ||
22 | Package::Package( PackageManagerSettings *s, QObject *parent=0, const char *name=0 ) | 22 | Package::Package( PackageManagerSettings *s, QObject *parent, const char *name ) |
23 | : QObject(parent,name) | 23 | : QObject(parent,name) |
24 | { | 24 | { |
25 | Package(parent,name); | 25 | Package(parent,name); |
26 | init(s); | 26 | init(s); |
27 | } | 27 | } |
28 | 28 | ||
29 | void Package::init( PackageManagerSettings *s ) | 29 | void Package::init( PackageManagerSettings *s ) |
30 | { | 30 | { |
31 | settings = s; | 31 | settings = s; |
32 | _size = ""; | 32 | _size = ""; |
33 | _section = ""; | 33 | _section = ""; |
34 | _subsection = ""; | 34 | _subsection = ""; |
35 | _shortDesc = ""; | 35 | _shortDesc = ""; |
36 | _desc = ""; | 36 | _desc = ""; |
37 | _name = ""; | 37 | _name = ""; |
38 | _toProcess = false; | 38 | _toProcess = false; |
39 | _useFileName = false; | 39 | _useFileName = false; |
40 | _old = false; | 40 | _old = false; |
41 | _status = ""; | 41 | _status = ""; |
42 | _dest = settings->getDestinationName(); | 42 | _dest = settings->getDestinationName(); |
43 | _link = settings->createLinks(); | 43 | _link = settings->createLinks(); |
44 | _versions=0; | 44 | _versions=0; |
45 | _version=""; | 45 | _version=""; |
46 | } | 46 | } |
47 | 47 | ||
48 | Package::Package( QStringList pack, PackageManagerSettings *s , QObject *parent=0, const char *name=0 ) | 48 | Package::Package( QStringList pack, PackageManagerSettings *s , QObject *parent, const char *name ) |
49 | : QObject(parent,name) | 49 | : QObject(parent,name) |
50 | { | 50 | { |
51 | init(s); | 51 | init(s); |
52 | parsePackage( pack ); | 52 | parsePackage( pack ); |
53 | } | 53 | } |
54 | 54 | ||
55 | Package::Package( QString n, PackageManagerSettings *s, QObject *parent=0, const char *name=0 ) | 55 | Package::Package( QString n, PackageManagerSettings *s, QObject *parent, const char *name ) |
56 | { | 56 | { |
57 | init(s); | 57 | init(s); |
58 | if ( !QFile::exists( n ) ) | 58 | if ( !QFile::exists( n ) ) |
59 | { | 59 | { |
60 | _name = QString( n ); | 60 | _name = QString( n ); |
61 | }else{ | 61 | }else{ |
62 | pvDebug(4,"remote file: "+n); | 62 | pvDebug(4,"remote file: "+n); |
63 | parseIpkgFile( n ); | 63 | parseIpkgFile( n ); |
64 | _useFileName = true; | 64 | _useFileName = true; |
65 | _fileName = QString( n ); | 65 | _fileName = QString( n ); |
66 | } | 66 | } |
67 | } | 67 | } |
68 | 68 | ||
69 | Package::Package( Package *pi, QObject *parent=0, const char *name=0 ) | 69 | Package::Package( Package *pi, QObject *parent, const char *name ) |
70 | { | 70 | { |
71 | init(pi->settings); | 71 | init(pi->settings); |
72 | copyValues( pi ); | 72 | copyValues( pi ); |
73 | } | 73 | } |
74 | 74 | ||
75 | 75 | ||
76 | void Package::setValue( QString n, QString t ) | 76 | void Package::setValue( QString n, QString t ) |
77 | { | 77 | { |
78 | if ( n == "Package" ) | 78 | if ( n == "Package" ) |
79 | { | 79 | { |
80 | _name = QString( t ); | 80 | _name = QString( t ); |
81 | }else if ( n == "Installed-Size" ) | 81 | }else if ( n == "Installed-Size" ) |
82 | { | 82 | { |
83 | _size = t; | 83 | _size = t; |
84 | // }else if ( n == "Priority") | 84 | // }else if ( n == "Priority") |
85 | // { | 85 | // { |
86 | 86 | ||
87 | }else if ( n == "Section") | 87 | }else if ( n == "Section") |
88 | { | 88 | { |
89 | setSection( t ); | 89 | setSection( t ); |
90 | // }else if ( n == "Maintainer") | 90 | // }else if ( n == "Maintainer") |
91 | // { | 91 | // { |
92 | // | 92 | // |
93 | // }else if ( n == "Architecture") | 93 | // }else if ( n == "Architecture") |
diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp index 3cc0443..e445570 100644 --- a/noncore/unsupported/oipkg/packagelist.cpp +++ b/noncore/unsupported/oipkg/packagelist.cpp | |||
@@ -1,37 +1,37 @@ | |||
1 | #include "packagelist.h" | 1 | #include "packagelist.h" |
2 | 2 | ||
3 | #include <assert.h> | 3 | #include <assert.h> |
4 | #include <qfile.h> | 4 | #include <qfile.h> |
5 | #include <qfileinfo.h> | 5 | #include <qfileinfo.h> |
6 | #include <qtextstream.h> | 6 | #include <qtextstream.h> |
7 | 7 | ||
8 | #include "debug.h" | 8 | #include "debug.h" |
9 | 9 | ||
10 | static QDict<Package> *packageListAll; | 10 | static QDict<Package> *packageListAll; |
11 | static int packageListAllRefCount = 0; | 11 | static int packageListAllRefCount = 0; |
12 | 12 | ||
13 | PackageList::PackageList(QObject *parent=0, const char *name=0) | 13 | PackageList::PackageList(QObject *parent, const char *name) |
14 | : QObject(parent,name), packageIter( packageList ) | 14 | : QObject(parent,name), packageIter( packageList ) |
15 | { | 15 | { |
16 | empty=true; | 16 | empty=true; |
17 | if (!packageListAll) packageListAll = new QDict<Package>(); | 17 | if (!packageListAll) packageListAll = new QDict<Package>(); |
18 | packageListAllRefCount++; | 18 | packageListAllRefCount++; |
19 | sections << "All"; | 19 | sections << "All"; |
20 | subSections.insert("All", new QStringList() ); | 20 | subSections.insert("All", new QStringList() ); |
21 | QStringList *ss = subSections["All"]; | 21 | QStringList *ss = subSections["All"]; |
22 | *ss << "All"; | 22 | *ss << "All"; |
23 | aktSection = "All"; | 23 | aktSection = "All"; |
24 | aktSubSection = "All"; | 24 | aktSubSection = "All"; |
25 | } | 25 | } |
26 | 26 | ||
27 | PackageList::PackageList( PackageManagerSettings* s, QObject *parent, const char *name) | 27 | PackageList::PackageList( PackageManagerSettings* s, QObject *parent, const char *name) |
28 | : QObject(parent,name), packageIter( packageList ) | 28 | : QObject(parent,name), packageIter( packageList ) |
29 | { | 29 | { |
30 | settings = s; | 30 | settings = s; |
31 | PackageList(parent, name); | 31 | PackageList(parent, name); |
32 | } | 32 | } |
33 | 33 | ||
34 | PackageList::~PackageList() | 34 | PackageList::~PackageList() |
35 | { | 35 | { |
36 | if (--packageListAllRefCount < 1 ) delete packageListAll; | 36 | if (--packageListAllRefCount < 1 ) delete packageListAll; |
37 | } | 37 | } |
@@ -176,46 +176,46 @@ void PackageList::readFileEntries( QString filename, QString dest ) | |||
176 | { | 176 | { |
177 | Package *p = new Package( packEntry, settings ); | 177 | Package *p = new Package( packEntry, settings ); |
178 | if ( p ) | 178 | if ( p ) |
179 | { | 179 | { |
180 | p->setDest( dest ); | 180 | p->setDest( dest ); |
181 | insertPackage( p ); | 181 | insertPackage( p ); |
182 | packEntry.clear(); | 182 | packEntry.clear(); |
183 | } | 183 | } |
184 | } | 184 | } |
185 | }else{ | 185 | }else{ |
186 | packEntry << line; | 186 | packEntry << line; |
187 | }; | 187 | }; |
188 | } | 188 | } |
189 | delete statusStream; | 189 | delete statusStream; |
190 | return; | 190 | return; |
191 | } | 191 | } |
192 | 192 | ||
193 | void PackageList::setSettings( PackageManagerSettings *s ) | 193 | void PackageList::setSettings( PackageManagerSettings *s ) |
194 | { | 194 | { |
195 | settings = s; | 195 | settings = s; |
196 | } | 196 | } |
197 | 197 | ||
198 | Package* PackageList::getByName( QString n ) | 198 | Package* PackageList::getByName( QString n ) |
199 | { | 199 | { |
200 | origPackageList[n]; | 200 | return origPackageList[n]; |
201 | } | 201 | } |
202 | 202 | ||
203 | void PackageList::clear() | 203 | void PackageList::clear() |
204 | { | 204 | { |
205 | origPackageList.clear(); | 205 | origPackageList.clear(); |
206 | packageList.clear(); | 206 | packageList.clear(); |
207 | } | 207 | } |
208 | 208 | ||
209 | void PackageList::allPackages() | 209 | void PackageList::allPackages() |
210 | { | 210 | { |
211 | packageList.clear(); | 211 | packageList.clear(); |
212 | QDictIterator<Package> filterIter( origPackageList ); | 212 | QDictIterator<Package> filterIter( origPackageList ); |
213 | filterIter.toFirst(); | 213 | filterIter.toFirst(); |
214 | Package *pack= filterIter.current() ; | 214 | Package *pack= filterIter.current() ; |
215 | while ( pack ) | 215 | while ( pack ) |
216 | { | 216 | { |
217 | packageList.insert( pack->name(), pack ); | 217 | packageList.insert( pack->name(), pack ); |
218 | ++filterIter; | 218 | ++filterIter; |
219 | pack = filterIter.current(); | 219 | pack = filterIter.current(); |
220 | } | 220 | } |
221 | } | 221 | } |
diff --git a/noncore/unsupported/oipkg/packagelistdoclnk.cpp b/noncore/unsupported/oipkg/packagelistdoclnk.cpp index b42cfdd..deb8a6d 100644 --- a/noncore/unsupported/oipkg/packagelistdoclnk.cpp +++ b/noncore/unsupported/oipkg/packagelistdoclnk.cpp | |||
@@ -1,41 +1,41 @@ | |||
1 | 1 | ||
2 | #include "packagelistdoclnk.h" | 2 | #include "packagelistdoclnk.h" |
3 | 3 | ||
4 | #include <qpe/applnk.h> | 4 | #include <qpe/applnk.h> |
5 | #include <qpe/config.h> | 5 | #include <qpe/config.h> |
6 | #include <qlist.h> | 6 | #include <qlist.h> |
7 | 7 | ||
8 | #include "package.h" | 8 | #include "package.h" |
9 | #include "pksettings.h" | 9 | #include "pksettings.h" |
10 | 10 | ||
11 | PackageListDocLnk::PackageListDocLnk(PackageManagerSettings* s, QObject *parent=0, const char *name=0) | 11 | PackageListDocLnk::PackageListDocLnk(PackageManagerSettings* s, QObject *parent, const char *name) |
12 | : PackageList(s) | 12 | : PackageList(s) |
13 | { | 13 | { |
14 | PackageListDocLnk(parent, name); | 14 | PackageListDocLnk(parent, name); |
15 | } | 15 | } |
16 | 16 | ||
17 | PackageListDocLnk::PackageListDocLnk(QObject *parent=0, const char *name=0) | 17 | PackageListDocLnk::PackageListDocLnk(QObject *parent, const char *name) |
18 | : PackageList(parent, name) | 18 | : PackageList(parent, name) |
19 | { | 19 | { |
20 | Config cfg( "oipkg", Config::User ); | 20 | Config cfg( "oipkg", Config::User ); |
21 | cfg.setGroup( "Common" ); | 21 | cfg.setGroup( "Common" ); |
22 | docLnkDir = cfg.readEntry( "docLnkDir", "/root/" ); | 22 | docLnkDir = cfg.readEntry( "docLnkDir", "/root/" ); |
23 | pvDebug(2,"opening DocLnkSet "+docLnkDir); | 23 | pvDebug(2,"opening DocLnkSet "+docLnkDir); |
24 | doclnkset = new DocLnkSet(docLnkDir,"application/ipkg"); | 24 | doclnkset = new DocLnkSet(docLnkDir,"application/ipkg"); |
25 | } | 25 | } |
26 | 26 | ||
27 | PackageListDocLnk::~PackageListDocLnk() | 27 | PackageListDocLnk::~PackageListDocLnk() |
28 | { | 28 | { |
29 | Config cfg( "oipkg", Config::User ); | 29 | Config cfg( "oipkg", Config::User ); |
30 | cfg.setGroup( "Common" ); | 30 | cfg.setGroup( "Common" ); |
31 | cfg.writeEntry( "docLnkDir", docLnkDir ); | 31 | cfg.writeEntry( "docLnkDir", docLnkDir ); |
32 | delete doclnkset; | 32 | delete doclnkset; |
33 | } | 33 | } |
34 | 34 | ||
35 | 35 | ||
36 | 36 | ||
37 | void PackageListDocLnk::update() | 37 | void PackageListDocLnk::update() |
38 | { | 38 | { |
39 | pvDebug(2,"PackageListDocLnk::update "); | 39 | pvDebug(2,"PackageListDocLnk::update "); |
40 | QList<DocLnk> packlist = doclnkset->children(); | 40 | QList<DocLnk> packlist = doclnkset->children(); |
41 | for (DocLnk *pack =packlist.first(); pack != 0; pack=packlist.next() ) | 41 | for (DocLnk *pack =packlist.first(); pack != 0; pack=packlist.next() ) |
diff --git a/noncore/unsupported/oipkg/packagelistitem.cpp b/noncore/unsupported/oipkg/packagelistitem.cpp index 0c9c676..7c54441 100644 --- a/noncore/unsupported/oipkg/packagelistitem.cpp +++ b/noncore/unsupported/oipkg/packagelistitem.cpp | |||
@@ -138,29 +138,29 @@ QString PackageListItem::key( int column, bool ascending ) const | |||
138 | if ( !ascending ) bytes=999999999-bytes; | 138 | if ( !ascending ) bytes=999999999-bytes; |
139 | return QString().sprintf("%09d",(int)bytes); | 139 | return QString().sprintf("%09d",(int)bytes); |
140 | } else { | 140 | } else { |
141 | return QListViewItem::key(column,ascending); | 141 | return QListViewItem::key(column,ascending); |
142 | } | 142 | } |
143 | } | 143 | } |
144 | 144 | ||
145 | void PackageListItem::setOn( bool b ) | 145 | void PackageListItem::setOn( bool b ) |
146 | { | 146 | { |
147 | QCheckListItem::setOn( b ); | 147 | QCheckListItem::setOn( b ); |
148 | package->toggleProcess(); | 148 | package->toggleProcess(); |
149 | package->setLink( settings->createLinks() ); | 149 | package->setLink( settings->createLinks() ); |
150 | displayDetails(); | 150 | displayDetails(); |
151 | } | 151 | } |
152 | 152 | ||
153 | void PackageListItem::displayDetails() | 153 | void PackageListItem::displayDetails() |
154 | { | 154 | { |
155 | QString sod; | 155 | QString sod; |
156 | sod += package->sizeUnits().isEmpty()?QString(""):QString(package->sizeUnits()); | 156 | sod += package->sizeUnits().isEmpty()?QString(""):QString(package->sizeUnits()); |
157 | //sod += QString(package->dest().isEmpty()?"":QObject::tr(" on ")+package->dest()); | 157 | //sod += QString(package->dest().isEmpty()?"":QObject::tr(" on ")+package->dest()); |
158 | sod += package->dest().isEmpty()?QString(""):QString(QObject::tr(" on ")+package->dest()); | 158 | sod += package->dest().isEmpty()?QString(""):QString(QObject::tr(" on ")+package->dest()); |
159 | sod = sod.isEmpty()?QString(""):QString(" ("+sod+")"); | 159 | sod = sod.isEmpty()?QString(""):QString(" ("+sod+")"); |
160 | setText(0, package->name()+sod ); | 160 | setText(0, package->name()+sod ); |
161 | nameItem->setText( 0, QObject::tr("Name: ")+package->name()); | 161 | nameItem->setText( 0, QObject::tr("Name: ")+package->name()); |
162 | linkItem->setText( 0, QObject::tr("Link: ")+package->link()?QObject::tr("Yes"):QObject::tr("No")); | 162 | linkItem->setText( 0, QObject::tr("Link: ")+(package->link()?QObject::tr("Yes"):QObject::tr("No"))); |
163 | destItem->setText( 0, QObject::tr("Destination: ")+package->dest() ); | 163 | destItem->setText( 0, QObject::tr("Destination: ")+package->dest() ); |
164 | statusItem->setText( 0, QObject::tr("Status: ")+package->status() ); | 164 | statusItem->setText( 0, QObject::tr("Status: ")+package->status() ); |
165 | repaint(); | 165 | repaint(); |
166 | } | 166 | } |
diff --git a/noncore/unsupported/qpdf/fixed.h b/noncore/unsupported/qpdf/fixed.h index d073421..ec0e696 100644 --- a/noncore/unsupported/qpdf/fixed.h +++ b/noncore/unsupported/qpdf/fixed.h | |||
@@ -148,44 +148,44 @@ template <unsigned int SH> inline bool operator != ( double d, const fixed<SH> & | |||
148 | 148 | ||
149 | template <unsigned int SH> inline bool operator < ( int i, const fixed<SH> &f ) { return fixed<SH>::i2f( i ) < f. m_f; } | 149 | template <unsigned int SH> inline bool operator < ( int i, const fixed<SH> &f ) { return fixed<SH>::i2f( i ) < f. m_f; } |
150 | template <unsigned int SH> inline bool operator > ( int i, const fixed<SH> &f ) { return fixed<SH>::i2f( i ) > f. m_f; } | 150 | template <unsigned int SH> inline bool operator > ( int i, const fixed<SH> &f ) { return fixed<SH>::i2f( i ) > f. m_f; } |
151 | template <unsigned int SH> inline bool operator <= ( int i, const fixed<SH> &f ) { return fixed<SH>::i2f( i ) <= f. m_f; } | 151 | template <unsigned int SH> inline bool operator <= ( int i, const fixed<SH> &f ) { return fixed<SH>::i2f( i ) <= f. m_f; } |
152 | template <unsigned int SH> inline bool operator >= ( int i, const fixed<SH> &f ) { return fixed<SH>::i2f( i ) >= f. m_f; } | 152 | template <unsigned int SH> inline bool operator >= ( int i, const fixed<SH> &f ) { return fixed<SH>::i2f( i ) >= f. m_f; } |
153 | template <unsigned int SH> inline bool operator == ( int i, const fixed<SH> &f ) { return fixed<SH>::i2f( i ) == f. m_f; } | 153 | template <unsigned int SH> inline bool operator == ( int i, const fixed<SH> &f ) { return fixed<SH>::i2f( i ) == f. m_f; } |
154 | template <unsigned int SH> inline bool operator != ( int i, const fixed<SH> &f ) { return fixed<SH>::i2f( i ) != f. m_f; } | 154 | template <unsigned int SH> inline bool operator != ( int i, const fixed<SH> &f ) { return fixed<SH>::i2f( i ) != f. m_f; } |
155 | 155 | ||
156 | template <unsigned int SH> inline long int lrint ( const fixed<SH> &f ) | 156 | template <unsigned int SH> inline long int lrint ( const fixed<SH> &f ) |
157 | { | 157 | { |
158 | return fixed<SH>::f2i (( f. m_f < 0 ) ? f. m_f - ( 1 << ( SH - 1 )) : f. m_f + ( 1 << ( SH - 1 ))); | 158 | return fixed<SH>::f2i (( f. m_f < 0 ) ? f. m_f - ( 1 << ( SH - 1 )) : f. m_f + ( 1 << ( SH - 1 ))); |
159 | } | 159 | } |
160 | 160 | ||
161 | template <unsigned int SH> inline fixed<SH> fabs ( const fixed<SH> &f ) | 161 | template <unsigned int SH> inline fixed<SH> fabs ( const fixed<SH> &f ) |
162 | { | 162 | { |
163 | return ( f. m_f < 0 ) ? fixed<SH> ( -f. m_f, true ) : f; | 163 | return ( f. m_f < 0 ) ? fixed<SH> ( -f. m_f, true ) : f; |
164 | } | 164 | } |
165 | 165 | ||
166 | // roughly from QPE / qmath.h | 166 | // roughly from QPE / qmath.h |
167 | template <unsigned int SH> inline fixed<SH> sqrt ( const fixed<SH> &f ) | 167 | template <unsigned int SH> inline fixed<SH> sqrt ( const fixed<SH> &f ) |
168 | { | 168 | { |
169 | if ( f. m_f <= 0 ) | 169 | if ( f. m_f <= 0 ) |
170 | return fixed<SH> ( 0, true ); | 170 | return fixed<SH> ( 0, true ); |
171 | 171 | ||
172 | fixed<SH>::fix_t a0 = 0; | 172 | typename fixed<SH>::fix_t a0 = 0; |
173 | fixed<SH>::fix_t a1 = f. m_f; // take value as first approximation | 173 | typename fixed<SH>::fix_t a1 = f. m_f; // take value as first approximation |
174 | 174 | ||
175 | do { | 175 | do { |
176 | a0 = a1; | 176 | a0 = a1; |
177 | a1 = ( a0 + fixed<SH>::div ( f. m_f, a0 )) >> 1; | 177 | a1 = ( a0 + fixed<SH>::div ( f. m_f, a0 )) >> 1; |
178 | } while ( abs ( fixed<SH>::div ( a1 - a0, a1 )) > 1 ); | 178 | } while ( abs ( fixed<SH>::div ( a1 - a0, a1 )) > 1 ); |
179 | 179 | ||
180 | return fixed<SH> ( a1, true ); | 180 | return fixed<SH> ( a1, true ); |
181 | } | 181 | } |
182 | 182 | ||
183 | #if 0 // no std::ostream needed in OPIE | 183 | #if 0 // no std::ostream needed in OPIE |
184 | template <unsigned int SH> inline std::ostream &operator << ( std::ostream &o, const fixed<SH> &f ) | 184 | template <unsigned int SH> inline std::ostream &operator << ( std::ostream &o, const fixed<SH> &f ) |
185 | { | 185 | { |
186 | o << double( f ); | 186 | o << double( f ); |
187 | return o; | 187 | return o; |
188 | } | 188 | } |
189 | #endif | 189 | #endif |
190 | 190 | ||
191 | #endif | 191 | #endif |