From 8362e586d0fd9a0ad6cea3f26d624a05196a60f8 Mon Sep 17 00:00:00 2001 From: harlekin Date: Sun, 12 May 2002 08:39:15 +0000 Subject: opie remote control --- diff --git a/noncore/tools/remote/INSTALL b/noncore/tools/remote/INSTALL new file mode 100644 index 0000000..02f9d6c --- a/dev/null +++ b/noncore/tools/remote/INSTALL @@ -0,0 +1,12 @@ +requires cross compiler, qt/e, and opie sources or qtopia sdk to compile + +1. extract into opie source directory +2. add LOCALAPPS=remote to top of opie makefile (or, just add "remote" to the LOCALAPPS variable, if it already exists +3. run ./configure -platform ipaq in opie directory +4. cd remote +5. make +6. binary is ../bin/remote, you might want to run arm-linux-strip before you use it. +7. executable and remote.desktop to ipaq. +8. chmod a+x remote on ipaq +9. copy binary to /opt/QtPalmtop/bin +10. copy remote.desktop to /opt/QtPalmtop/apps/Applications diff --git a/noncore/tools/remote/LICENSE b/noncore/tools/remote/LICENSE new file mode 100644 index 0000000..30ffb17 --- a/dev/null +++ b/noncore/tools/remote/LICENSE @@ -0,0 +1,258 @@ +Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +Preamble + +The licenses for most software are designed to take away your freedom to share + and change it. By contrast, the GNU General Public License is intended to + guarantee your freedom to share and change free software--to make sure the + software is free for all its users. This General Public License applies to most + of the Free Software Foundation's software and to any other program whose + authors commit to using it. (Some other Free Software Foundation software is + covered by the GNU Library General Public License instead.) You can apply it to + your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our + General Public Licenses are designed to make sure that you have the freedom to + distribute copies of free software (and charge for this service if you wish), + that you receive source code or can get it if you want it, that you can change + the software or use pieces of it in new free programs; and that you know you + can do these things. + + To protect your rights, we need to make restrictions that forbid anyone to deny + you these rights or to ask you to surrender the rights. These restrictions + translate to certain responsibilities for you if you distribute copies of the + software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis or for a + fee, you must give the recipients all the rights that you have. You must make + sure that they, too, receive or can get the source code. And you must show them + these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and (2) offer + you this license which gives you legal permission to copy, distribute and/or + modify the software. + +Also, for each author's protection and ours, we want to make certain that + everyone understands that there is no warranty for this free software. If the + software is modified by someone else and passed on, we want its recipients to + know that what they have is not the original, so that any problems introduced + by others will not reflect on the original authors' reputations. + +Finally, any free program is threatened constantly by software patents. We wish + to avoid the danger that redistributors of a free program will individually + obtain patent licenses, in effect making the program proprietary. To prevent + this, we have made it clear that any patent must be licensed for everyone's + free use or not licensed at all. + +The precise terms and conditions for copying, distribution and modification + follow. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains a notice + placed by the copyright holder saying it may be distributed under the terms of + this General Public License. The "Program", below, refers to any such program + or work, and a "work based on the Program" means either the Program or any + derivative work under copyright law: that is to say, a work containing the + Program or a portion of it, either verbatim or with modifications and/or + translated into another language. (Hereinafter, translation is included without + limitation in the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not covered by + this License; they are outside its scope. The act of running the Program is not + restricted, and the output from the Program is covered only if its contents + constitute a work based on the Program (independent of having been made by + running the Program). Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's source code as + you receive it, in any medium, provided that you conspicuously and + appropriately publish on each copy an appropriate copyright notice and + disclaimer of warranty; keep intact all the notices that refer to this License + and to the absence of any warranty; and give any other recipients of the + Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and you may at + your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of it, thus + forming a work based on the Program, and copy and distribute such modifications + or work under the terms of Section 1 above, provided that you also meet all of + these conditions: + + +a) You must cause the modified files to carry prominent notices stating that you + changed the files and the date of any change. + +b) You must cause any work that you distribute or publish, that in whole or in + part contains or is derived from the Program or any part thereof, to be + licensed as a whole at no charge to all third parties under the terms of this + License. + +c) If the modified program normally reads commands interactively when run, you + must cause it, when started running for such interactive use in the most + ordinary way, to print or display an announcement including an appropriate + copyright notice and a notice that there is no warranty (or else, saying that + you provide a warranty) and that users may redistribute the program under these + conditions, and telling the user how to view a copy of this License. + (Exception: if the Program itself is interactive but does not normally print + such an announcement, your work based on the Program is not required to print + an announcement.) + +These requirements apply to the modified work as a whole. If identifiable + sections of that work are not derived from the Program, and can be reasonably + considered independent and separate works in themselves, then this License, and + its terms, do not apply to those sections when you distribute them as separate + works. But when you distribute the same sections as part of a whole which is a + work based on the Program, the distribution of the whole must be on the terms + of this License, whose permissions for other licensees extend to the entire + whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your + rights to work written entirely by you; rather, the intent is to exercise the + right to control the distribution of derivative or collective works based on + the Program. + +In addition, mere aggregation of another work not based on the Program with the + Program (or with a work based on the Program) on a volume of a storage or + distribution medium does not bring the other work under the scope of this + License. + +3. You may copy and distribute the Program (or a work based on it, under Section + 2) in object code or executable form under the terms of Sections 1 and 2 above + provided that you also do one of the following: + + +a) Accompany it with the complete corresponding machine-readable source code, + which must be distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three years, to give + any third party, for a charge no more than your cost of physically performing + source distribution, a complete machine-readable copy of the corresponding + source code, to be distributed under the terms of Sections 1 and 2 above on a + medium customarily used for software interchange; or, + +c) Accompany it with the information you received as to the offer to distribute + corresponding source code. (This alternative is allowed only for noncommercial + distribution and only if you received the program in object code or executable + form with such an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for making + modifications to it. For an executable work, complete source code means all the + source code for all modules it contains, plus any associated interface + definition files, plus the scripts used to control compilation and installation + of the executable. However, as a special exception, the source code distributed + need not include anything that is normally distributed (in either source or + binary form) with the major components (compiler, kernel, and so on) of the + operating system on which the executable runs, unless that component itself + accompanies the executable. + +If distribution of executable or object code is made by offering access to copy + from a designated place, then offering equivalent access to copy the source + code from the same place counts as distribution of the source code, even though + third parties are not compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program except as + expressly provided under this License. Any attempt otherwise to copy, modify, + sublicense or distribute the Program is void, and will automatically terminate + your rights under this License. However, parties who have received copies, or + rights, from you under this License will not have their licenses terminated so + long as such parties remain in full compliance. + +5. You are not required to accept this License, since you have not signed it. + However, nothing else grants you permission to modify or distribute the Program + or its derivative works. These actions are prohibited by law if you do not + accept this License. Therefore, by modifying or distributing the Program (or + any work based on the Program), you indicate your acceptance of this License to + do so, and all its terms and conditions for copying, distributing or modifying + the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the Program), + the recipient automatically receives a license from the original licensor to + copy, distribute or modify the Program subject to these terms and conditions. + You may not impose any further restrictions on the recipients' exercise of the + rights granted herein. You are not responsible for enforcing compliance by + third parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent infringement + or for any other reason (not limited to patent issues), conditions are imposed + on you (whether by court order, agreement or otherwise) that contradict the + conditions of this License, they do not excuse you from the conditions of this + License. If you cannot distribute so as to satisfy simultaneously your + obligations under this License and any other pertinent obligations, then as a + consequence you may not distribute the Program at all. For example, if a patent + license would not permit royalty-free redistribution of the Program by all + those who receive copies directly or indirectly through you, then the only way + you could satisfy both it and this License would be to refrain entirely from + distribution of the Program. + +If any portion of this section is held invalid or unenforceable under any + particular circumstance, the balance of the section is intended to apply and + the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or + other property right claims or to contest validity of any such claims; this + section has the sole purpose of protecting the integrity of the free software + distribution system, which is implemented by public license practices. Many + people have made generous contributions to the wide range of software + distributed through that system in reliance on consistent application of that + system; it is up to the author/donor to decide if he or she is willing to + distribute software through any other system and a licensee cannot impose that + choice. + + This section is intended to make thoroughly clear what is believed to be a + consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in certain + countries either by patents or by copyrighted interfaces, the original + copyright holder who places the Program under this License may add an explicit + geographical distribution limitation excluding those countries, so that + distribution is permitted only in or among countries not thus excluded. In such + case, this License incorporates the limitation as if written in the body of + this License. + +9. The Free Software Foundation may publish revised and/or new versions of the + General Public License from time to time. Such new versions will be similar in + spirit to the present version, but may differ in detail to address new problems + or concerns. + +Each version is given a distinguishing version number. If the Program specifies + a version number of this License which applies to it and "any later version", + you have the option of following the terms and conditions either of that + version or of any later version published by the Free Software Foundation. If + the Program does not specify a version number of this License, you may choose + any version ever published by the Free Software Foundation. + +10. If you wish to incorporate parts of the Program into other free programs + whose distribution conditions are different, write to the author to ask for + permission. For software which is copyrighted by the Free Software Foundation, + write to the Free Software Foundation; we sometimes make exceptions for this. + Our decision will be guided by the two goals of preserving the free status of + all derivatives of our free software and of promoting the sharing and reuse of + software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE + PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE + STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE + PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, + INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND + PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU + ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL + ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE + PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY + GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR + INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA + BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A + FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER + OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS \ No newline at end of file diff --git a/noncore/tools/remote/README b/noncore/tools/remote/README new file mode 100644 index 0000000..6f8a0c2 --- a/dev/null +++ b/noncore/tools/remote/README @@ -0,0 +1,24 @@ +opie-remote + +Opie-remote is a remote control emulator for the Compaq iPaq and the Sharp +Zaurus. It requires lirc (http://www.lirc.org) to run. There are lirc ipkgs +for the iPaq in the Handhelds.org feed. You must first install the +lirc-modules-[kernel version] ipkg, and then the lirc ipkg with the +-force-depends option. The Zaurus is supported, but requires you to compile +from lirc's CVS. Zaurus support should be in lirc 0.6.6 and up. Check the learn +tab in opie-remote for more detailed configuration and usage instructions. + +I will talk to the Open Zaurus people about providing an lirc ipkg for the +Zaurus, but i cant make one, as i dont have a Zaurus, and cannot test it. + +todo: +add a frontend for irrecord (to make it a true learning remote) +make the UI completely user configurable (button layout, position, etc) +ButtonDialog needs to support default remote and button settings, so what the +button is already set to shows up. +fix any bugs + +contact info: +thomas: spiralman@softhome.net (currently the only developer) +im also on #opie and #handhelds.org on irc.openprojects.net a lot, so look for +me there. diff --git a/noncore/tools/remote/buttondialog.cpp b/noncore/tools/remote/buttondialog.cpp new file mode 100644 index 0000000..e7ff4b4 --- a/dev/null +++ b/noncore/tools/remote/buttondialog.cpp @@ -0,0 +1,268 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "buttondialog.h" + +ButtonDialog::ButtonDialog(QString buttonName, QWidget *parent=0, const char*name=0, bool modal=FALSE, WFlags f=0):QDialog(parent, name, modal, f) +{ + setCaption(tr(buttonName)); + + QVBoxLayout *layout = new QVBoxLayout(this); + + QHBoxLayout *hlayout1 = new QHBoxLayout(this); + QHBoxLayout *hlayout2 = new QHBoxLayout(this); + QHBoxLayout *hlayout3 = new QHBoxLayout(this); + + layout->addSpacing(5); + layout->addLayout(hlayout1); + layout->addSpacing(5); + layout->addLayout(hlayout2); + layout->addSpacing(5); + layout->addLayout(hlayout3); + layout->addSpacing(5); + + remote = new QComboBox(false, this, "remote"); + QLabel *remoteLabel = new QLabel(remote, "Remote: ", this, "remoteLabel"); + hlayout1->addSpacing(5); + hlayout1->addWidget(remoteLabel); + hlayout1->addSpacing(5); + hlayout1->addWidget(remote); + hlayout1->addSpacing(5); + remote->insertItem("Remote "); + remote->insertStringList(getRemotes()); + connect(remote, SIGNAL(activated(const QString &)), this, SLOT(remoteSelected(const QString&)) ); + + button = new QComboBox(false, this, "button"); + QLabel *buttonLabel = new QLabel(remote, "Button: ", this, "buttonLabel"); + hlayout2->addSpacing(5); + hlayout2->addWidget(buttonLabel); + hlayout2->addSpacing(5); + hlayout2->addWidget(button); + hlayout2->addSpacing(5); + button->insertItem("Button "); + connect(button, SIGNAL(activated(const QString &)), this, SLOT(buttonSelected(const QString&)) ); + + label = new QLineEdit(this, "label"); + label->setText(buttonName); + QLabel *labelLabel = new QLabel(label, "Label: ", this, "labelLabel"); + hlayout3->addSpacing(5); + hlayout3->addWidget(labelLabel); + hlayout3->addSpacing(5); + hlayout3->addWidget(label); + hlayout3->addSpacing(5); +} + +void ButtonDialog::remoteSelected(const QString &string) +{ + button->insertStringList(getButtons(string.latin1()) ); + list="SEND_ONCE"; + list+=string; +} + +void ButtonDialog::buttonSelected(const QString &string) +{ + list+=string; +} + +QStringList ButtonDialog::getList() +{ + return list; +} + +QString ButtonDialog::getLabel() +{ + return label->text(); +} + +QStringList ButtonDialog::getRemotes() +{ + const char write_buffer[] = "LIST\n"; + const char *readbuffer; + int i, numlines; + QStringList list; + + addr.sun_family=AF_UNIX; + strcpy(addr.sun_path,"/dev/lircd"); + + fd = socket(AF_UNIX, SOCK_STREAM, 0); + + if(std::connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1) + { + QMessageBox *mb = new QMessageBox("Error!", + "couldnt connect to socket", + QMessageBox::NoIcon, + QMessageBox::Ok, + QMessageBox::NoButton, + QMessageBox::NoButton); + mb->exec(); + perror("ButtonDialog::GetRemotes"); + return NULL; + } + + write(fd, write_buffer, strlen(write_buffer)); + + for(i=0; i<5; i++) + { + printf("%d\n", i); + readbuffer = readPacket(); + printf("%s", readbuffer); + printf("%d\n", i); + } + + numlines = atoi(readbuffer); + + for(i=0; iexec(); + perror("ButtonDialog::GetRemotes"); + return NULL; + } + + std::close(fd); + return list; +} + +QStringList ButtonDialog::getButtons(const char *remoteName) +{ + QString write_buffer = "LIST "; + const char *readbuffer; + int i, j, numlines; + QStringList list; + QString string; + + write_buffer += remoteName; + write_buffer += '\n'; + + fd = socket(AF_UNIX, SOCK_STREAM, 0); + + if(std::connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1) + { + QMessageBox *mb = new QMessageBox("Error!", + "couldnt connect to socket", + QMessageBox::NoIcon, + QMessageBox::Ok, + QMessageBox::NoButton, + QMessageBox::NoButton); + mb->exec(); + perror("ButtonDialog::GetButtons"); + return NULL; + } + + write(fd, write_buffer.latin1(), strlen(write_buffer) ); + + for(i=0; i<5; i++) + { + readbuffer = readPacket(); + } + + numlines = atoi(readbuffer); + + for(i=0; iexec(); + perror("ButtonDialog::GetButtons"); + return NULL; + } + + std::close(fd); + return list; +} + + +//this function was ripped for rc.c in xrc, it is available here: http://www.lirc.org/software.html +const char *ButtonDialog::readPacket() +{ + static char buffer[PACKET_SIZE+1]=""; + char *end; + static int ptr=0,end_len=0; + ssize_t ret; + timeout = 0; + + if(ptr>0) + { + memmove(buffer,buffer+ptr,strlen(buffer+ptr)+1); + ptr=strlen(buffer); + end=strchr(buffer,'\n'); + } + else + { + end=NULL; + } + alarm(TIMEOUT); + while(end==NULL) + { + if(PACKET_SIZE<=ptr) + { + fprintf(stderr,"bad packet\n"); + ptr=0; + return(NULL); + } + ret=read(fd,buffer+ptr,PACKET_SIZE-ptr); + + if(ret<=0 || timeout) + { + if(timeout) + { + fprintf(stderr,"timeout\n"); + } + else + { + alarm(0); + } + ptr=0; + return(NULL); + } + buffer[ptr+ret]=0; + ptr=strlen(buffer); + end=strchr(buffer,'\n'); + } + alarm(0);timeout=0; + + end[0]=0; + ptr=strlen(buffer)+1; +//# ifdef DEBUG +// printf("buffer: -%s-\n",buffer); +//# endif + return(buffer); +} diff --git a/noncore/tools/remote/buttondialog.h b/noncore/tools/remote/buttondialog.h new file mode 100644 index 0000000..33dc4ef --- a/dev/null +++ b/noncore/tools/remote/buttondialog.h @@ -0,0 +1,59 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define PACKET_SIZE 256 +#define TIMEOUT 3 + +class ButtonDialog : public QDialog +{ + Q_OBJECT +public: + ButtonDialog(QString buttonName, QWidget *parent=0, const char*name=0, bool modal=FALSE, WFlags f=0); + void setIRSocket(int newfd); + const char *readPacket(); + QStringList getRemotes(); + QStringList getButtons(const char *remoteName); + QStringList getList(); + QString getLabel(); +public slots: + void remoteSelected(const QString &string); + void buttonSelected(const QString &string); +private: + QComboBox *remote; + QComboBox *button; + QStringList list; + QLineEdit *label; + int fd; + int timeout; + struct sockaddr_un addr; +}; diff --git a/noncore/tools/remote/buttonlist b/noncore/tools/remote/buttonlist new file mode 100644 index 0000000..543c361 --- a/dev/null +++ b/noncore/tools/remote/buttonlist @@ -0,0 +1,35 @@ +power +source +eject +menu +top +left +enter +right +up +down +audio +sub +angle +play +pause +stop +record +back +rewind +ff +next +vol+ +vol- +chan+ +chan- +1 +2 +3 +4 +5 +6 +7 +8 +9 +0 \ No newline at end of file diff --git a/noncore/tools/remote/channelgroup.cpp b/noncore/tools/remote/channelgroup.cpp new file mode 100644 index 0000000..9f90284 --- a/dev/null +++ b/noncore/tools/remote/channelgroup.cpp @@ -0,0 +1,100 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "channelgroup.h" + +ChannelGroup::ChannelGroup(QWidget *parent=0, const char *name=0):QWidget(parent,name) +{ + QGridLayout *layout = new QGridLayout(this); + QVBoxLayout *volLayout = new QVBoxLayout(this); + QVBoxLayout *chanLayout = new QVBoxLayout(this); + + layout->addRowSpacing(1,1); + layout->addRowSpacing(3,1); + layout->addRowSpacing(5,1); + + layout->addColSpacing(1,1); + layout->addColSpacing(3,1); + layout->addColSpacing(5,1); + layout->addColSpacing(7,1); + + QPushButton *one = new QPushButton("1", this, "one"); + layout->addWidget(one, 0, 2, 0); + connect(one, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + QPushButton *two = new QPushButton("2", this, "two"); + layout->addWidget(two, 0, 4, 0); + connect(two, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + QPushButton *three = new QPushButton("3", this, "three"); + layout->addWidget(three, 0, 6, 0); + connect(three, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + QPushButton *four = new QPushButton("4", this, "four"); + layout->addWidget(four, 2, 2, 0); + connect(four, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + QPushButton *five = new QPushButton("5", this, "five"); + layout->addWidget(five, 2, 4, 0); + connect(five, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + QPushButton *six = new QPushButton("6", this, "six"); + layout->addWidget(six, 2, 6, 0); + connect(six, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + QPushButton *seven = new QPushButton("7", this, "seven"); + layout->addWidget(seven, 4, 2, 0); + connect(seven, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + QPushButton *eight = new QPushButton("8", this, "eight"); + layout->addWidget(eight, 4, 4, 0); + connect(eight, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + QPushButton *nine = new QPushButton("9", this, "nine"); + layout->addWidget(nine, 4, 6, 0); + connect(nine, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + QPushButton *zero = new QPushButton("0", this, "zero"); + layout->addWidget(zero, 6, 4, 0); + connect(zero, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + layout->addMultiCellLayout(volLayout, 0, 6, 0, 0, 0); + layout->addMultiCellLayout(chanLayout, 0, 6, 8, 8, 0); + + QPushButton *volUp = new QPushButton("+", this, "volUp"); + volLayout->addWidget(volUp, 1, 0); + connect(volUp, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + QLabel *volLabel = new QLabel("Volume ", this, "volLabel"); + volLayout->addWidget(volLabel, 0, 0); + + QPushButton *volDown = new QPushButton("-", this, "volDown"); + volLayout->addWidget(volDown, 1, 0); + connect(volDown, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + + QPushButton *chanUp = new QPushButton("+", this, "chanUp"); + chanLayout->addWidget(chanUp, 1, 0); + connect(chanUp, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + QLabel *chanLabel = new QLabel("Channel", this, "chanLabel"); + chanLayout->addWidget(chanLabel, 0, 0); + + QPushButton *chanDown = new QPushButton("-", this, "chanDown"); + chanLayout->addWidget(chanDown, 1, 0); + connect(chanDown, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + +} diff --git a/noncore/tools/remote/channelgroup.h b/noncore/tools/remote/channelgroup.h new file mode 100644 index 0000000..0b7b114 --- a/dev/null +++ b/noncore/tools/remote/channelgroup.h @@ -0,0 +1,26 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include +#include + +class ChannelGroup : public QWidget +{ +public: + ChannelGroup(QWidget *parent=0, const char *name=0); +}; diff --git a/noncore/tools/remote/channelgroupconf.cpp b/noncore/tools/remote/channelgroupconf.cpp new file mode 100644 index 0000000..2d98115 --- a/dev/null +++ b/noncore/tools/remote/channelgroupconf.cpp @@ -0,0 +1,100 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "channelgroupconf.h" + +ChannelGroupConf::ChannelGroupConf(QWidget *parent=0, const char *name=0):QWidget(parent,name) +{ + QGridLayout *layout = new QGridLayout(this); + QVBoxLayout *volLayout = new QVBoxLayout(this); + QVBoxLayout *chanLayout = new QVBoxLayout(this); + + layout->addRowSpacing(1,5); + layout->addRowSpacing(3,5); + layout->addRowSpacing(5,5); + + layout->addColSpacing(1,1); + layout->addColSpacing(3,1); + layout->addColSpacing(5,1); + layout->addColSpacing(7,1); + + QPushButton *one = new QPushButton("1", this, "one"); + layout->addWidget(one, 0, 2, 0); + connect(one, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + QPushButton *two = new QPushButton("2", this, "two"); + layout->addWidget(two, 0, 4, 0); + connect(two, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + QPushButton *three = new QPushButton("3", this, "three"); + layout->addWidget(three, 0, 6, 0); + connect(three, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + QPushButton *four = new QPushButton("4", this, "four"); + layout->addWidget(four, 2, 2, 0); + connect(four, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + QPushButton *five = new QPushButton("5", this, "five"); + layout->addWidget(five, 2, 4, 0); + connect(five, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + QPushButton *six = new QPushButton("6", this, "six"); + layout->addWidget(six, 2, 6, 0); + connect(six, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + QPushButton *seven = new QPushButton("7", this, "seven"); + layout->addWidget(seven, 4, 2, 0); + connect(seven, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + QPushButton *eight = new QPushButton("8", this, "eight"); + layout->addWidget(eight, 4, 4, 0); + connect(eight, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + QPushButton *nine = new QPushButton("9", this, "nine"); + layout->addWidget(nine, 4, 6, 0); + connect(nine, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + QPushButton *zero = new QPushButton("0", this, "zero"); + layout->addWidget(zero, 6, 4, 0); + connect(zero, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + layout->addMultiCellLayout(volLayout, 0, 6, 0, 0, 0); + layout->addMultiCellLayout(chanLayout, 0, 6, 8, 8, 0); + + QPushButton *volUp = new QPushButton("+", this, "volUp"); + volLayout->addWidget(volUp, 1, 0); + connect(volUp, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + QLabel *volLabel = new QLabel("Volume ", this, "volLabel"); + volLayout->addWidget(volLabel, 0, 0); + + QPushButton *volDown = new QPushButton("-", this, "volDown"); + volLayout->addWidget(volDown, 1, 0); + connect(volDown, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + + QPushButton *chanUp = new QPushButton("+", this, "chanUp"); + chanLayout->addWidget(chanUp, 1, 0); + connect(chanUp, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + QLabel *chanLabel = new QLabel("Channel", this, "chanLabel"); + chanLayout->addWidget(chanLabel, 0, 0); + + QPushButton *chanDown = new QPushButton("-", this, "chanDown"); + chanLayout->addWidget(chanDown, 1, 0); + connect(chanDown, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + +} diff --git a/noncore/tools/remote/channelgroupconf.h b/noncore/tools/remote/channelgroupconf.h new file mode 100644 index 0000000..b5f2392 --- a/dev/null +++ b/noncore/tools/remote/channelgroupconf.h @@ -0,0 +1,26 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include +#include + +class ChannelGroupConf : public QWidget +{ +public: + ChannelGroupConf(QWidget *parent=0, const char *name=0); +}; diff --git a/noncore/tools/remote/configtab.cpp b/noncore/tools/remote/configtab.cpp new file mode 100644 index 0000000..f5896a9 --- a/dev/null +++ b/noncore/tools/remote/configtab.cpp @@ -0,0 +1,218 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "configtab.h" + +ConfigTab::ConfigTab(QWidget *parent=0, const char *name=0):QWidget(parent,name) +{ + + QVBoxLayout *layout = new QVBoxLayout(this); + + topGroupConf = new TopGroupConf(this, "topGroupConf"); + layout->addWidget(topGroupConf, 1); + layout->addSpacing(1); + + dvdGroupConf = new DVDGroupConf(this, "dvdGroupConf"); + layout->addWidget(dvdGroupConf, 1); + layout->addSpacing(1); + + vcrGroupConf = new VCRGroupConf(this, "vcrGroupConf"); + layout->addWidget(vcrGroupConf, 1); + layout->addSpacing(1); + + channelGroupConf = new ChannelGroupConf(this, "channelGroupConf"); + layout->addWidget(channelGroupConf, 1); + + +} + +void ConfigTab::setConfig(Config *newCfg) +{ + cfg = newCfg; + cfg->setGroup("Remotes"); + topGroupConf->updateRemotes(cfg->readListEntry("remoteList", ',') ); + cfg->setGroup("Default"); + const QObject *obj; + + const QObjectList *objList = topGroupConf->children(); + for(obj = ((QObjectList *)objList)->first(); obj != 0; obj=((QObjectList *)objList)->next()) + { + if(obj->inherits("QPushButton")) + { + if(!cfg->hasKey((QString)obj->name()+"Label")) + { + cfg->writeEntry((QString)obj->name()+"Label", ((QPushButton *)obj)->text()); + } + } + } + + objList = dvdGroupConf->children(); + for(obj = ((QObjectList *)objList)->first(); obj != 0; obj=((QObjectList *)objList)->next()) + { + if(obj->inherits("QPushButton")) + { + if(!cfg->hasKey((QString)obj->name()+"Label")) + { + cfg->writeEntry((QString)obj->name()+"Label", ((QPushButton *)obj)->text()); + } + } + } + + objList = vcrGroupConf->children(); + for(obj = ((QObjectList *)objList)->first(); obj != 0; obj=((QObjectList *)objList)->next()) + { + if(obj->inherits("QPushButton")) + { + if(!cfg->hasKey((QString)obj->name()+"Label")) + { + cfg->writeEntry((QString)obj->name()+"Label", ((QPushButton *)obj)->text()); + } + } + } + + objList = channelGroupConf->children(); + for(obj = ((QObjectList *)objList)->first(); obj != 0; obj=((QObjectList *)objList)->next()) + { + if(obj->inherits("QPushButton")) + { + if(!cfg->hasKey((QString)obj->name()+"Label")) + { + cfg->writeEntry((QString)obj->name()+"Label", ((QPushButton *)obj)->text()); + } + } + } + cfg->write(); + + cfg->setGroup("Remotes"); +} +/* +void ConfigTab::savePressed() +{ + cfg->setGroup(remotes->currentText()); + ButtonDialog *bd = new ButtonDialog(this, "BD", true, 0); + if( bd->exec() == 1) + { + printf("%s\n", bd->getList().join(" ").latin1()); + } +} +*/ + +void ConfigTab::newPressed() +{ + QStringList list; + cfg->setGroup("Remotes"); + list=cfg->readListEntry("remoteList", ','); + list+=topGroupConf->getRemotesText(); + cfg->writeEntry("remoteList", list, ','); + cfg->setGroup(topGroupConf->getRemotesText()); + topGroupConf->updateRemotes(QStringList(topGroupConf->getRemotesText()) ); + cfg->write(); + emit remotesChanged(); + remoteSelected(topGroupConf->getRemotesText()); +} + +void ConfigTab::remoteSelected(const QString &string) +{ + cfg->setGroup(string); + const QObject *obj; + + const QObjectList *objList = topGroupConf->children(); + for(obj = ((QObjectList *)objList)->first(); obj != 0; obj=((QObjectList *)objList)->next()) + { + if(obj->inherits("QPushButton")) + { + if(cfg->hasKey((QString)obj->name()+"Label")) + { + ((QPushButton *)obj)->setText(cfg->readEntry((QString)obj->name()+"Label") ); + } + else + { + cfg->setGroup("Default"); + ((QPushButton *)obj)->setText(cfg->readEntry((QString)obj->name()+"Label") ); + cfg->setGroup(string); + } + } + } + + objList = dvdGroupConf->children(); + for(obj = ((QObjectList *)objList)->first(); obj != 0; obj=((QObjectList *)objList)->next()) + { + if(obj->inherits("QPushButton")) + { + if(cfg->hasKey((QString)obj->name()+"Label")) + { + ((QPushButton *)obj)->setText(cfg->readEntry((QString)obj->name()+"Label") ); + } + else + { + cfg->setGroup("Default"); + ((QPushButton *)obj)->setText(cfg->readEntry((QString)obj->name()+"Label") ); + cfg->setGroup(string); + } + } + } + + objList = vcrGroupConf->children(); + for(obj = ((QObjectList *)objList)->first(); obj != 0; obj=((QObjectList *)objList)->next()) + { + if(obj->inherits("QPushButton")) + { + if(cfg->hasKey((QString)obj->name()+"Label")) + { + ((QPushButton *)obj)->setText(cfg->readEntry((QString)obj->name()+"Label") ); + } + else + { + cfg->setGroup("Default"); + ((QPushButton *)obj)->setText(cfg->readEntry((QString)obj->name()+"Label") ); + cfg->setGroup(string); + } + } + } + + objList = channelGroupConf->children(); + for(obj = ((QObjectList *)objList)->first(); obj != 0; obj=((QObjectList *)objList)->next()) + { + if(obj->inherits("QPushButton")) + { + if(cfg->hasKey((QString)obj->name()+"Label")) + { + ((QPushButton *)obj)->setText(cfg->readEntry((QString)obj->name()+"Label") ); + } + else + { + cfg->setGroup("Default"); + ((QPushButton *)obj)->setText(cfg->readEntry((QString)obj->name()+"Label") ); + cfg->setGroup(string); + } + } + } +} + +void ConfigTab::buttonPressed() +{ + const QObject *button = sender(); + QString string = button->name(); + + ButtonDialog *bd = new ButtonDialog(((QPushButton *)button)->text(), this, "BD", true, 0); + if( bd->exec() == 1) + { + cfg->writeEntry(string, bd->getList().join(" ").latin1()); + cfg->writeEntry(string+"Label", bd->getLabel().latin1()); + } + cfg->write(); + ((QPushButton *)button)->setText(bd->getLabel()); +} diff --git a/noncore/tools/remote/configtab.h b/noncore/tools/remote/configtab.h new file mode 100644 index 0000000..a04a84f --- a/dev/null +++ b/noncore/tools/remote/configtab.h @@ -0,0 +1,55 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +//#include +//#include +//#include + +#include "buttondialog.h" +#include "channelgroupconf.h" +#include "dvdgroupconf.h" +#include "topgroupconf.h" +#include "vcrgroupconf.h" + +class ConfigTab : public QWidget +{ + Q_OBJECT +public: + ConfigTab(QWidget *parent=0, const char *name=0); + void setConfig(Config *newCfg); +public slots: + void newPressed(); + void remoteSelected(const QString &string); + void buttonPressed(); +signals: + void remotesChanged(); +private: + Config *cfg; + TopGroupConf *topGroupConf; + DVDGroupConf *dvdGroupConf; + VCRGroupConf *vcrGroupConf; + ChannelGroupConf *channelGroupConf; +}; diff --git a/noncore/tools/remote/dvdgroup.cpp b/noncore/tools/remote/dvdgroup.cpp new file mode 100644 index 0000000..a75c48a --- a/dev/null +++ b/noncore/tools/remote/dvdgroup.cpp @@ -0,0 +1,93 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + +GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "dvdgroup.h" + +DVDGroup::DVDGroup(QWidget *parent=0, const char *name=0):QWidget(parent,name) +{ + QGridLayout *layout = new QGridLayout(this); + +//put rows between the buttons of size 1 + layout->addRowSpacing(1,1); + layout->addRowSpacing(3,1); + +//put collumns between the buttons of size 5 + layout->addColSpacing(1,5); + layout->addColSpacing(3,5); + layout->addColSpacing(5,5); + layout->addColSpacing(7,5); + +//make sure that the collumns with the buttons in them stretch before the filler collumns do +//since there is so little room, there is no need to do this for the rows + layout->setColStretch(4,1); + layout->setColStretch(2,1); + layout->setColStretch(6,1); + layout->setColStretch(8,1); + layout->setColStretch(0,1); + +//add the menu navigation buttons, and connect them to the RemoteTab slots... + QPushButton *up = new QPushButton("Up", this,"up"); + layout->addWidget(up, 0, 4, 0); + connect(up, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + QPushButton *down = new QPushButton("Down",this,"down"); + layout->addWidget(down, 4, 4, 0); + connect(down, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + QPushButton *left = new QPushButton("Left",this,"left"); + layout->addWidget(left, 2, 2, 0); + connect(left, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + QPushButton *right = new QPushButton("Right", this, "right"); + layout->addWidget(right, 2, 6, 0); + connect(right, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + QPushButton *enter = new QPushButton("Enter",this,"enter"); + layout->addWidget(enter, 2, 4, 0); + connect(enter, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + +//add some other buttons + + QPushButton *eject = new QPushButton("Eject", this, "eject"); + layout->addWidget(eject, 0, 0, 0); + connect(eject, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + QPushButton *menu = new QPushButton("Menu", this, "menu"); + layout->addWidget(menu, 2, 0, 0); + connect(menu, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + QPushButton *topMenu = new QPushButton("Top", this, "topMenu"); + layout->addWidget(topMenu, 4, 0, 0); + connect(topMenu, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + QPushButton *audio = new QPushButton("Audio", this, "audio"); + layout->addWidget(audio, 0, 8, 0); + connect(audio, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + QPushButton *sub = new QPushButton("Sub", this, "sub"); + layout->addWidget(sub, 2, 8, 0); + connect(sub, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + QPushButton *angle = new QPushButton("Angle", this, "angle"); + layout->addWidget(angle, 4, 8, 0); + connect(angle, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); +} diff --git a/noncore/tools/remote/dvdgroup.h b/noncore/tools/remote/dvdgroup.h new file mode 100644 index 0000000..04c301b --- a/dev/null +++ b/noncore/tools/remote/dvdgroup.h @@ -0,0 +1,27 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include +#include +#include + +class DVDGroup : public QWidget +{ +public: + DVDGroup(QWidget *parent=0, const char *name=0); +}; diff --git a/noncore/tools/remote/dvdgroupconf.cpp b/noncore/tools/remote/dvdgroupconf.cpp new file mode 100644 index 0000000..5bfe393 --- a/dev/null +++ b/noncore/tools/remote/dvdgroupconf.cpp @@ -0,0 +1,87 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "dvdgroupconf.h" + +DVDGroupConf::DVDGroupConf(QWidget *parent=0, const char *name=0):QWidget(parent,name) +{ + QGridLayout *layout = new QGridLayout(this); + +//put rows between the buttons of size 1 + layout->addRowSpacing(1,1); + layout->addRowSpacing(3,1); + +//put collumns between the buttons of size 5 + layout->addColSpacing(1,5); + layout->addColSpacing(3,5); + layout->addColSpacing(5,5); + layout->addColSpacing(7,5); + +//make sure that the collumns with the buttons in them stretch before the filler collumns do +//since there is so little room, there is no need to do this for the rows + layout->setColStretch(4,1); + layout->setColStretch(2,1); + layout->setColStretch(6,1); + layout->setColStretch(8,1); + layout->setColStretch(0,1); + +//add the menu navigation buttons, and connect them to the RemoteTab slots... + QPushButton *up = new QPushButton("Up",this,"up"); + layout->addWidget(up, 0, 4, 0); + connect(up, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + QPushButton *down = new QPushButton("Down",this,"down"); + layout->addWidget(down, 4, 4, 0); + connect(down, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + QPushButton *left = new QPushButton("Left",this,"left"); + layout->addWidget(left, 2, 2, 0); + connect(left, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + QPushButton *right = new QPushButton("Right", this, "right"); + layout->addWidget(right, 2, 6, 0); + connect(right, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + QPushButton *enter = new QPushButton("Enter",this,"enter"); + layout->addWidget(enter, 2, 4, 0); + connect(enter, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + +//add some other buttons + + QPushButton *eject = new QPushButton("Eject", this, "eject"); + layout->addWidget(eject, 0, 0, 0); + connect(eject, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + QPushButton *menu = new QPushButton("Menu", this, "menu"); + layout->addWidget(menu, 2, 0, 0); + connect(menu, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + QPushButton *topMenu = new QPushButton("Top", this, "topMenu"); + layout->addWidget(topMenu, 4, 0, 0); + connect(topMenu, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + QPushButton *audio = new QPushButton("Audio", this, "audio"); + layout->addWidget(audio, 0, 8, 0); + connect(audio, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + QPushButton *sub = new QPushButton("Sub", this, "sub"); + layout->addWidget(sub, 2, 8, 0); + connect(sub, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + QPushButton *angle = new QPushButton("Angle", this, "angle"); + layout->addWidget(angle, 4, 8, 0); + connect(angle, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); +} diff --git a/noncore/tools/remote/dvdgroupconf.h b/noncore/tools/remote/dvdgroupconf.h new file mode 100644 index 0000000..67ee231 --- a/dev/null +++ b/noncore/tools/remote/dvdgroupconf.h @@ -0,0 +1,25 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include + +class DVDGroupConf : public QWidget +{ +public: + DVDGroupConf(QWidget *parent=0, const char *name=0); +}; diff --git a/noncore/tools/remote/learntab.cpp b/noncore/tools/remote/learntab.cpp new file mode 100644 index 0000000..054bc7b --- a/dev/null +++ b/noncore/tools/remote/learntab.cpp @@ -0,0 +1,26 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "learntab.h" + +LearnTab::LearnTab(QWidget *parent=0, const char *name=0):QWidget(parent,name) +{ + QVBoxLayout *layout = new QVBoxLayout(this); + QString *string = new QString("

Opie-Remote Usage Instructions

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.

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 http://www.lirc.org/. 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.

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.

This is program is written and maintaned by Thomas (spiralman) Stephens. spiralman@softhome.net. Or, look for me on #opie or #handhelds.org on irc.openprojects.net.

"); + + QTextView *textView = new QTextView(*string, 0, this); + layout->addWidget(textView); +} diff --git a/noncore/tools/remote/learntab.h b/noncore/tools/remote/learntab.h new file mode 100644 index 0000000..c03f605 --- a/dev/null +++ b/noncore/tools/remote/learntab.h @@ -0,0 +1,26 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include +#include + +class LearnTab : public QWidget +{ +public: + LearnTab(QWidget *parent=0, const char *name=0); +}; diff --git a/noncore/tools/remote/mainconfig.cpp b/noncore/tools/remote/mainconfig.cpp new file mode 100644 index 0000000..d0476e9 --- a/dev/null +++ b/noncore/tools/remote/mainconfig.cpp @@ -0,0 +1,22 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "mainconfig.h" + +RemoteConfig *MainConfig::getRemote(const char *name) +{ + +} diff --git a/noncore/tools/remote/mainconfig.h b/noncore/tools/remote/mainconfig.h new file mode 100644 index 0000000..5c53137 --- a/dev/null +++ b/noncore/tools/remote/mainconfig.h @@ -0,0 +1,31 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include + +class MainConfig +{ +public: + RemoteConfig *getRemote(const char *name); + QStringList *getRemoteList(); + Config *getConfig(); + void update(); +private: + RemoteConfig *remotes; + Config cfg; + QStringList *remoteList; +}; diff --git a/noncore/tools/remote/mainview.cpp b/noncore/tools/remote/mainview.cpp new file mode 100644 index 0000000..47027fb --- a/dev/null +++ b/noncore/tools/remote/mainview.cpp @@ -0,0 +1,68 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "mainview.h" + +MainView::MainView(QWidget *parent, const char *name=0) : QWidget(parent, name) +{ + setIcon( Resource::loadPixmap( "remote" ) ); + setCaption(tr("Remote") ); + + QVBoxLayout *layout = new QVBoxLayout(this); + QTabWidget *tabs = new QTabWidget(this); + + layout->addWidget(tabs); + + printf("MainView: 1\n"); + remote = new RemoteTab(tabs); + printf("MainView: 2\n"); + learn = new LearnTab(tabs); + printf("MainView: 3\n"); + config = new ConfigTab(tabs); + printf("MainView: 4\n"); + connect(config, SIGNAL(remotesChanged()), this, SLOT(updateRemotesList()) ); + printf("MainView: 5\n"); + + remote->setIRSocket(fd); + + tabs->addTab(remote, tr("Remote") ); + tabs->addTab(learn,tr("Learn") ); + tabs->addTab(config,tr("Config") ); + + printf("1\n"); + cfg = new Config("Remote"); + printf("2\n"); + + remote->setConfig(cfg); + config->setConfig(cfg); +} + +int MainView::getIRSocket() +{ + return fd; +} + +void MainView::setIRSocket(int newfd) +{ + fd = newfd; + remote->setIRSocket(fd); +} + +void MainView::updateRemotesList() +{ + remote->updateRemotesList(); + printf("MainView: got remotes changed signal\n"); +} diff --git a/noncore/tools/remote/mainview.h b/noncore/tools/remote/mainview.h new file mode 100644 index 0000000..2434064 --- a/dev/null +++ b/noncore/tools/remote/mainview.h @@ -0,0 +1,54 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "remotetab.h" +#include "learntab.h" +#include "configtab.h" + +#define BUFFERSIZE 256 + +class MainView : public QWidget +{ + Q_OBJECT +public: + MainView(QWidget *parent=0, const char *name=0); + int getIRSocket(); + void setIRSocket(int newfd); +public slots: + void updateRemotesList(); +private: + int fd; + RemoteTab *remote; + ConfigTab *config; + LearnTab *learn; + Config *cfg; +}; diff --git a/noncore/tools/remote/opie-remote.control b/noncore/tools/remote/opie-remote.control new file mode 100644 index 0000000..191a197 --- a/dev/null +++ b/noncore/tools/remote/opie-remote.control @@ -0,0 +1,10 @@ +Files: bin/remote apps/Applications/remote.desktop pics/remote/*.png +Priority: optional +Section: opie/applications +Maintainer: Thomas Stephens +Architecture: arm +Version: 0.3-$SUB_VERSION +Depends: opie-base ($QPE_VERSION), lirc +License: GPL +Description: a remote control + A remote control using irda. A frontend to lirc. \ No newline at end of file diff --git a/noncore/tools/remote/packetread.h b/noncore/tools/remote/packetread.h new file mode 100644 index 0000000..5dc1ad4 --- a/dev/null +++ b/noncore/tools/remote/packetread.h @@ -0,0 +1,200 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +file not used +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define PACKET_SIZE 256 +#define TIMEOUT 3 + +//this function was ripped for rc.c in xrc, it is available here: http://www.lirc.org/software.html +const char *readPacket(int fd) +{ + static char buffer[PACKET_SIZE+1]=""; + char *end; + static int ptr=0,end_len=0; + ssize_t ret; + + if(ptr>0) + { + memmove(buffer,buffer+ptr,strlen(buffer+ptr)+1); + ptr=strlen(buffer); + end=strchr(buffer,'\n'); + } + else + { + end=NULL; + } + alarm(TIMEOUT); + while(end==NULL) + { + if(PACKET_SIZE<=ptr) + { +// fprintf(stderr,"%s: bad packet\n",progname); + ptr=0; + return(NULL); + } + ret=read(fd,buffer+ptr,PACKET_SIZE-ptr); + + if(ret<=0 || timeout) + { + if(timeout) + { +// fprintf(stderr,"%s: timeout\n",progname); + } + else + { + alarm(0); + } + ptr=0; + return(NULL); + } + buffer[ptr+ret]=0; + ptr=strlen(buffer); + end=strchr(buffer,'\n'); + } + alarm(0);timeout=0; + + end[0]=0; + ptr=strlen(buffer)+1; +//# ifdef DEBUG +// printf("buffer: -%s-\n",buffer); +//# endif + return(buffer); +} +QStringList getRemotes(int fd) +{ + const char write_buffer[] = "LIST\n"; + const char *readbuffer; + int i, numlines; + QStringList list; + + fd = socket(AF_UNIX, SOCK_STREAM, 0); + + if(std::connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1) + { + QMessageBox *mb = new QMessageBox("Error!", + "couldnt connect to socket", + QMessageBox::NoIcon, + QMessageBox::Ok, + QMessageBox::NoButton, + QMessageBox::NoButton); + mb->exec(); + perror("ConfigTab::GetRemotes"); + return NULL; + } + + write(fd, write_buffer, strlen(write_buffer) ); + + for(i=0; i<5; i++) + { + readbuffer = readPacket(int fd); + } + + numlines = atoi(readbuffer); + + for(i=0; iexec(); + perror("ConfigTab::GetRemotes"); + return NULL; + } + + std::close(fd); + return list; +} + +QStringList getButtons(int fd, const char *remoteName) +{ + QString write_buffer = "LIST "; + const char *readbuffer; + int i, j, numlines; + QStringList list; + QString string; + + write_buffer += remoteName; + write_buffer += '\n'; + + fd = socket(AF_UNIX, SOCK_STREAM, 0); + + if(std::connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1) + { + QMessageBox *mb = new QMessageBox("Error!", + "couldnt connect to socket", + QMessageBox::NoIcon, + QMessageBox::Ok, + QMessageBox::NoButton, + QMessageBox::NoButton); + mb->exec(); + perror("ConfigTab::GetRemotes"); + return NULL; + } + + write(fd, write_buffer.latin1(), strlen(write_buffer) ); + + for(i=0; i<5; i++) + { + readbuffer = readPacket(); + } + + numlines = atoi(readbuffer); + + for(i=0; iexec(); + perror("ConfigTab::GetRemotes"); + return NULL; + } + + std::close(fd); + return list; +} diff --git a/noncore/tools/remote/remote.cpp b/noncore/tools/remote/remote.cpp new file mode 100644 index 0000000..7972def --- a/dev/null +++ b/noncore/tools/remote/remote.cpp @@ -0,0 +1,100 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "mainview.h" + +/*void reconnect(int &fd) +{ +// struct sockaddr_un addr; + + addr.sun_family=AF_UNIX; + strcpy(addr.sun_path,"/dev/lircd"); + fd = socket(AF_UNIX, SOCK_STREAM, 0); + + if(connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1) + { + QMessageBox *mb = new QMessageBox("error", + "couldnt connect to socket", + QMessageBox::NoIcon, + QMessageBox::Ok, + QMessageBox::NoButton, + QMessageBox::NoButton); + mb->exec(); + } +} +*/ + +int main( int argc, char **argv ) +{ + QPEApplication a( argc, argv ); + MainView w; + + int fd; +// struct sockaddr_un addr; +// char read_buffer[BUFFERSIZE+1]; +// char write_buffer[] = "LIST\n"; + +// addr.sun_family=AF_UNIX; +// strcpy(addr.sun_path,"/dev/lircd"); +// fd = socket(AF_UNIX, SOCK_STREAM, 0); + +// printf("fd1: %d\n", fd); +/* + if(connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1) + { + QMessageBox *mb = new QMessageBox("error", + "couldnt connect to socket", + QMessageBox::NoIcon, + QMessageBox::Ok, + QMessageBox::NoButton, + QMessageBox::NoButton); + mb->exec(); + } +*/ + +// printf("%d\n", write(fd, write_buffer, sizeof(write_buffer) ) ); + +// printf("%d\n", read(fd, read_buffer, BUFFERSIZE ) ); + +// QMessageBox *mbtest = new QMessageBox("lirc test", +// *new QString((const char *) read_buffer), +// QMessageBox::NoIcon, +// QMessageBox::Ok, +// QMessageBox::NoButton, +// QMessageBox::NoButton); +// mbtest->exec(); + + a.setMainWidget( &w ); + w.setIRSocket(fd); + w.showMaximized(); + return a.exec(); +} diff --git a/noncore/tools/remote/remote.pro b/noncore/tools/remote/remote.pro new file mode 100644 index 0000000..cab9d70 --- a/dev/null +++ b/noncore/tools/remote/remote.pro @@ -0,0 +1,9 @@ +TEMPLATE =app +CONFIG +=qt warn_on release +DESTDIR =$(OPIEDIR)/bin +HEADERS = remotetab.h learntab.h configtab.h topgroup.h dvdgroup.h channelgroup.h vcrgroup.h buttondialog.h topgroupconf.h dvdgroupconf.h channelgroupconf.h vcrgroupconf.h mainview.h +SOURCES =remote.cpp remotetab.cpp learntab.cpp configtab.cpp topgroup.cpp dvdgroup.cpp channelgroup.cpp vcrgroup.cpp buttondialog.cpp topgroupconf.cpp dvdgroupconf.cpp channelgroupconf.cpp vcrgroupconf.cpp mainview.cpp +INCLUDEPATH +=$(OPIEDIR)/include +DEPENDPATH +=$(OPIEDIR)/include +LIBS +=-lqpe +TARGET = remote diff --git a/noncore/tools/remote/remotetab.cpp b/noncore/tools/remote/remotetab.cpp new file mode 100644 index 0000000..f3a8945 --- a/dev/null +++ b/noncore/tools/remote/remotetab.cpp @@ -0,0 +1,250 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "remotetab.h" + +RemoteTab::RemoteTab(QWidget *parent=0, const char *name=0):QWidget(parent,name) +{ + QVBoxLayout *layout = new QVBoxLayout(this); + + topGroup = new TopGroup(this); +// topGroup->setMaximumHeight(22); + layout->addWidget(topGroup, 0, 0); + printf("%d %d", topGroup->width(), topGroup->height()); + + layout->addSpacing(1); + + dvdGroup = new DVDGroup(this); +// dvdGroup->setMaximumHeight(68); + layout->addWidget(dvdGroup, 0, 0); + + layout->addSpacing(1); + + vcrGroup = new VCRGroup(this); + layout->addWidget(vcrGroup, 0, 0); +// vcrGroup->setMaximumHeight(45); + + layout->addSpacing(1); + + channelGroup = new ChannelGroup(this); +// channelGroup->setMaximumHeight(91); + layout->addWidget(channelGroup, 0, 0); + + this->setMaximumWidth(240); + + timeout = 0; + + addr.sun_family=AF_UNIX; + strcpy(addr.sun_path,"/dev/lircd"); +} + +void RemoteTab::sendIR() +{ + const QObject *button = sender(); + QString string = cfg->readEntry(button->name()); + string+='\n'; + const char *write_buffer = string.latin1(); + const char *read_buffer; + bool done=false; + + fd = socket(AF_UNIX, SOCK_STREAM, 0); + + if(std::connect(fd,(struct sockaddr *) &addr, sizeof(addr) ) == -1) + { + QMessageBox *mb = new QMessageBox("Error!", + "couldnt connect to socket", + QMessageBox::NoIcon, + QMessageBox::Ok, + QMessageBox::NoButton, + QMessageBox::NoButton); + mb->exec(); + perror("RemoteTab::SendIR"); + } + + printf("fd2: %d\n", fd); + printf("%s", write_buffer); + + printf("1\n"); + printf("%d\n", write(fd, write_buffer, strlen(write_buffer) ) ); + printf("2\n"); + while(!done) + { + read_buffer=readPacket(); + printf("%s\n", read_buffer); + if(strcasecmp(read_buffer, "END") == 0) + { + printf("done reading packet\n"); + done=true; + } + } + std::close(fd); +} + +// printf("%s\n", readPacket()); +// printf("%d\n", read(fd, read_buffer,sizeof(read_buffer)) ); +// printf("%s", read_buffer); + +//this function was ripped for rc.c in xrc, it is available here: http://www.lirc.org/software.html +const char *RemoteTab::readPacket() +{ + static char buffer[PACKET_SIZE+1]=""; + char *end; + static int ptr=0,end_len=0; + ssize_t ret; + + if(ptr>0) + { + memmove(buffer,buffer+ptr,strlen(buffer+ptr)+1); + ptr=strlen(buffer); + end=strchr(buffer,'\n'); + } + else + { + end=NULL; + } + alarm(TIMEOUT); + while(end==NULL) + { + if(PACKET_SIZE<=ptr) + { +// fprintf(stderr,"%s: bad packet\n",progname); + ptr=0; + return(NULL); + } + ret=read(fd,buffer+ptr,PACKET_SIZE-ptr); + + if(ret<=0 || timeout) + { + if(timeout) + { +// fprintf(stderr,"%s: timeout\n",progname); + } + else + { + alarm(0); + } + ptr=0; + return(NULL); + } + buffer[ptr+ret]=0; + ptr=strlen(buffer); + end=strchr(buffer,'\n'); + } + alarm(0);timeout=0; + + end[0]=0; + ptr=strlen(buffer)+1; +//# ifdef DEBUG +// printf("buffer: -%s-\n",buffer); +//# endif + return(buffer); +} + +void RemoteTab::setIRSocket(int newfd) +{ + fd = newfd; +} + +void RemoteTab::setConfig(Config *newCfg) +{ + cfg = newCfg; + cfg->setGroup("Remotes"); + topGroup->updateRemotes(cfg); +} + +void RemoteTab::remoteSelected(const QString &string) +{ + printf("1%s\n", string.latin1() ); + cfg->setGroup(string); + const QObject *obj; + + const QObjectList *objList = topGroup->children(); + for(obj = ((QObjectList *)objList)->first(); obj != 0; obj=((QObjectList *)objList)->next()) + { + if(obj->inherits("QPushButton")) + { + if(cfg->hasKey((QString)obj->name()+"Label")) + { + ((QPushButton *)obj)->setText(cfg->readEntry((QString)obj->name()+"Label") ); + } + else + { + cfg->setGroup("Default"); + ((QPushButton *)obj)->setText(cfg->readEntry((QString)obj->name()+"Label") ); + cfg->setGroup(string); + } + } + } + + objList = dvdGroup->children(); + for(obj = ((QObjectList *)objList)->first(); obj != 0; obj=((QObjectList *)objList)->next()) + { + if(obj->inherits("QPushButton")) + { + if(cfg->hasKey((QString)obj->name()+"Label")) + { + ((QPushButton *)obj)->setText(cfg->readEntry((QString)obj->name()+"Label") ); + } + else + { + cfg->setGroup("Default"); + ((QPushButton *)obj)->setText(cfg->readEntry((QString)obj->name()+"Label") ); + cfg->setGroup(string); + } + } + } + + objList = vcrGroup->children(); + for(obj = ((QObjectList *)objList)->first(); obj != 0; obj=((QObjectList *)objList)->next()) + { + if(obj->inherits("QPushButton")) + { + if(cfg->hasKey((QString)obj->name()+"Label")) + { + ((QPushButton *)obj)->setText(cfg->readEntry((QString)obj->name()+"Label") ); + } + else + { + cfg->setGroup("Default"); + ((QPushButton *)obj)->setText(cfg->readEntry((QString)obj->name()+"Label") ); + cfg->setGroup(string); + } + } + } + + objList = channelGroup->children(); + for(obj = ((QObjectList *)objList)->first(); obj != 0; obj=((QObjectList *)objList)->next()) + { + if(obj->inherits("QPushButton")) + { + if(cfg->hasKey((QString)obj->name()+"Label")) + { + ((QPushButton *)obj)->setText(cfg->readEntry((QString)obj->name()+"Label") ); + } + else + { + cfg->setGroup("Default"); + ((QPushButton *)obj)->setText(cfg->readEntry((QString)obj->name()+"Label") ); + cfg->setGroup(string); + } + } + } +} + +void RemoteTab::updateRemotesList() +{ + topGroup->updateRemotes(cfg); +} diff --git a/noncore/tools/remote/remotetab.h b/noncore/tools/remote/remotetab.h new file mode 100644 index 0000000..77a7318 --- a/dev/null +++ b/noncore/tools/remote/remotetab.h @@ -0,0 +1,64 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "topgroup.h" +#include "dvdgroup.h" +#include "channelgroup.h" +#include "vcrgroup.h" + +#define PACKET_SIZE 256 +#define TIMEOUT 3 + +class RemoteTab : public QWidget +{ + Q_OBJECT +public: + RemoteTab(QWidget *parent=0, const char *name=0); + void setIRSocket(int newfd); + const char *readPacket(); + void setConfig(Config *newCfg); + void updateRemotesList(); +public slots: + void sendIR(); + void remoteSelected(const QString &string); +private: + int fd; + int timeout; + struct sockaddr_un addr; + Config *cfg; + TopGroup *topGroup; + DVDGroup *dvdGroup; + VCRGroup *vcrGroup; + ChannelGroup *channelGroup; +}; diff --git a/noncore/tools/remote/topgroup.cpp b/noncore/tools/remote/topgroup.cpp new file mode 100644 index 0000000..94ea622 --- a/dev/null +++ b/noncore/tools/remote/topgroup.cpp @@ -0,0 +1,54 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "topgroup.h" + +TopGroup::TopGroup(QWidget *parent=0, const char *name=0):QWidget(parent,name) +{ + QHBoxLayout *layout = new QHBoxLayout(this, 0, -1, 0); + + QPushButton *power = new QPushButton("Power",this,"power"); + layout->addWidget(power); + connect(power, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); +// power->setGeometry(5, 5,40, 20); + + layout->addSpacing(5); + + QPushButton *source = new QPushButton("Source",this,"source"); + layout->addWidget(source); + connect(source, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + // source->setGeometry(50,5,40,20); + + remotes = new QComboBox(false, this, "remotes"); + connect(remotes, SIGNAL(activated(const QString &)), this->parentWidget(), SLOT(remoteSelected(const QString &)) ); + remotes->insertItem("Select Remote"); +// remotes->setGeometry(135,5,95,20); + + QLabel *remoteLabel = new QLabel(remotes, "Remote: ",this,"remoteLabel"); +// remoteLabel->setGeometry(90,5,40,20); + remoteLabel->setAlignment(AlignRight | AlignVCenter); + + layout->addWidget(remoteLabel); + layout->addWidget(remotes); +} + +void TopGroup::updateRemotes(Config *cfg) +{ + remotes->clear(); + remotes->insertItem(QString("SelectRemote")); + cfg->setGroup("Remotes"); + remotes->insertStringList(cfg->readListEntry("remoteList", ',') ); +} diff --git a/noncore/tools/remote/topgroup.h b/noncore/tools/remote/topgroup.h new file mode 100644 index 0000000..215292d --- a/dev/null +++ b/noncore/tools/remote/topgroup.h @@ -0,0 +1,31 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include +#include +#include +#include + +class TopGroup : public QWidget +{ +public: + TopGroup(QWidget *parent=0, const char *name=0); + void updateRemotes(Config *cfg); +private: + QComboBox *remotes; +}; diff --git a/noncore/tools/remote/topgroupconf.cpp b/noncore/tools/remote/topgroupconf.cpp new file mode 100644 index 0000000..eb071fb --- a/dev/null +++ b/noncore/tools/remote/topgroupconf.cpp @@ -0,0 +1,70 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "topgroupconf.h" + +TopGroupConf::TopGroupConf(QWidget *parent=0, const char *name=0):QWidget(parent,name) +{ + QHBoxLayout *layout = new QHBoxLayout(this); + + QPushButton *power = new QPushButton("Power",this,"power"); + layout->addWidget(power); + connect(power, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); +// power->setGeometry(5, 5,40, 20); + + layout->addSpacing(5); + + QPushButton *source = new QPushButton("Source",this,"source"); + layout->addWidget(source); + connect(source, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + // source->setGeometry(50,5,40,20); + + remotes = new QComboBox(true, this, "remotes"); + remotes->insertItem(QString("Remotes")); + layout->addWidget(remotes); + layout->setStretchFactor(remotes, 1); + connect(remotes, SIGNAL(activated(const QString &)), this->parentWidget(), SLOT(remoteSelected(const QString &)) ); + + + QPushButton *newrem = new QPushButton("New", this, "new"); + layout->addWidget(newrem); + connect(newrem, SIGNAL(pressed()), this->parentWidget(), SLOT(newPressed()) ); + + +/* remotes = new QComboBox(false, this, "remotes"); + connect(remotes, SIGNAL(activated(const QString &)), this->parentWidget(), SLOT(remoteSelected(const QString &)) ); + remotes->insertItem("Select Remote"); +// remotes->setGeometry(135,5,95,20); + + QLabel *remoteLabel = new QLabel(remotes, "Remote: ",this,"remoteLabel"); +// remoteLabel->setGeometry(90,5,40,20); + remoteLabel->setAlignment(AlignRight | AlignVCenter); + + layout->addWidget(remoteLabel); + layout->addWidget(remotes); +*/ +} + +void TopGroupConf::updateRemotes(QStringList list) +{ + remotes->insertStringList(list); +} + +QString TopGroupConf::getRemotesText() +{ + return remotes->currentText(); +} + diff --git a/noncore/tools/remote/topgroupconf.h b/noncore/tools/remote/topgroupconf.h new file mode 100644 index 0000000..0142b69 --- a/dev/null +++ b/noncore/tools/remote/topgroupconf.h @@ -0,0 +1,34 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +class TopGroupConf : public QWidget +{ +public: + TopGroupConf(QWidget *parent=0, const char *name=0); + void updateRemotes(QStringList list); + QString getRemotesText(); +private: + QComboBox *remotes; +}; diff --git a/noncore/tools/remote/vcrgroup.cpp b/noncore/tools/remote/vcrgroup.cpp new file mode 100644 index 0000000..4f07ca3 --- a/dev/null +++ b/noncore/tools/remote/vcrgroup.cpp @@ -0,0 +1,88 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the +License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + +GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with +this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "vcrgroup.h" + +VCRGroup::VCRGroup(QWidget *parent=0, const char *name=0) : QWidget(parent, +name) +{ + QVBoxLayout *vlayout = new QVBoxLayout(this); + + QHBoxLayout *hlayout1 = new QHBoxLayout(this); + QHBoxLayout *hlayout2 = new QHBoxLayout(this); + + vlayout->addLayout(hlayout1); + vlayout->addSpacing(1); + vlayout->addLayout(hlayout2); + + QPushButton *play = new +QPushButton("Play",this, "play"); + hlayout1->addWidget(play); + connect(play, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + hlayout1->addSpacing(5); + + QPushButton *pause = new +QPushButton("Pause",this, "pause"); + hlayout1->addWidget(pause); + connect(pause, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + hlayout1->addSpacing(5); + + QPushButton *stop = new +QPushButton("Stop",this, "stop"); + hlayout1->addWidget(stop); + connect(stop, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + hlayout1->addSpacing(5); + + QPushButton *record = new +QPushButton("Record",this, "record"); + hlayout1->addWidget(record); + connect(record, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + QPushButton *back = new +QPushButton("Back",this, "back"); + hlayout2->addWidget(back); + connect(back, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + hlayout2->addSpacing(5); + + QPushButton *rewind = new +QPushButton("Rewind",this, "rewind"); + hlayout2->addWidget(rewind); + connect(rewind, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + hlayout2->addSpacing(5); + + QPushButton *ff = new +QPushButton("FF",this, "ff"); + hlayout2->addWidget(ff); + connect(ff, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); + + hlayout2->addSpacing(5); + + QPushButton *next = new +QPushButton("Next",this, "next"); + hlayout2->addWidget(next); + connect(next, SIGNAL(pressed()), this->parentWidget(), SLOT(sendIR()) ); +} diff --git a/noncore/tools/remote/vcrgroup.h b/noncore/tools/remote/vcrgroup.h new file mode 100644 index 0000000..fe40e42 --- a/dev/null +++ b/noncore/tools/remote/vcrgroup.h @@ -0,0 +1,27 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include +#include +#include + +class VCRGroup : public QWidget +{ +public: + VCRGroup(QWidget *parent=0, const char *name=0); +}; diff --git a/noncore/tools/remote/vcrgroupconf.cpp b/noncore/tools/remote/vcrgroupconf.cpp new file mode 100644 index 0000000..a50ed0a --- a/dev/null +++ b/noncore/tools/remote/vcrgroupconf.cpp @@ -0,0 +1,73 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "vcrgroupconf.h" + +VCRGroupConf::VCRGroupConf(QWidget *parent=0, const char *name=0) : QWidget(parent, name) +{ + QVBoxLayout *vlayout = new QVBoxLayout(this); + + QHBoxLayout *hlayout1 = new QHBoxLayout(this); + QHBoxLayout *hlayout2 = new QHBoxLayout(this); + + vlayout->addLayout(hlayout1); + vlayout->addSpacing(1); + vlayout->addLayout(hlayout2); + + QPushButton *play = new QPushButton("Play",this, "play"); + hlayout1->addWidget(play); + connect(play, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + hlayout1->addSpacing(5); + + QPushButton *pause = new QPushButton("Pause",this, "pause"); + hlayout1->addWidget(pause); + connect(pause, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + hlayout1->addSpacing(5); + + QPushButton *stop = new QPushButton("Stop",this, "stop"); + hlayout1->addWidget(stop); + connect(stop, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + hlayout1->addSpacing(5); + + QPushButton *record = new QPushButton("Record",this, "record"); + hlayout1->addWidget(record); + connect(record, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + QPushButton *back = new QPushButton("Back",this, "back"); + hlayout2->addWidget(back); + connect(back, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + hlayout2->addSpacing(5); + + QPushButton *rewind = new QPushButton("Rewind",this, "rewind"); + hlayout2->addWidget(rewind); + connect(rewind, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + hlayout2->addSpacing(5); + + QPushButton *ff = new QPushButton("FF",this, "ff"); + hlayout2->addWidget(ff); + connect(ff, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); + + hlayout2->addSpacing(5); + + QPushButton *next = new QPushButton("Next",this, "next"); + hlayout2->addWidget(next); + connect(next, SIGNAL(pressed()), this->parentWidget(), SLOT(buttonPressed()) ); +} diff --git a/noncore/tools/remote/vcrgroupconf.h b/noncore/tools/remote/vcrgroupconf.h new file mode 100644 index 0000000..2fdce02 --- a/dev/null +++ b/noncore/tools/remote/vcrgroupconf.h @@ -0,0 +1,25 @@ +/* +Opie-Remote. emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie. +Copyright (C) 2002 Thomas Stephens + +This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public +License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later +version. + +This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the +implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +Public License for more details. + +You should have received a copy of the GNU General Public License along with this program; if not, write to the Free +Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include +#include +#include + +class VCRGroupConf : public QWidget +{ +public: + VCRGroupConf(QWidget *parent=0, const char *name=0); +}; -- cgit v0.9.0.2