Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

mainview.cpp

Go to the documentation of this file.
00001 /*
00002 Opie-Remote.  emulates remote controlls on an iPaq (and maybe a Zaurus) in Opie.
00003 Copyright (C) 2002 Thomas Stephens
00004 
00005 This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public
00006 License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later
00007 version.
00008 
00009 This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
00010 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
00011 Public License for more details.
00012 
00013 You should have received a copy of the GNU General Public License along with this program; if not, write to the Free
00014 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00015 */
00016 
00017 #include "mainview.h"
00018 
00019 #include <opie2/oresource.h>
00020 
00021 MainView::MainView(QWidget *parent, const char *name) : QWidget(parent, name)
00022 {
00023         setIcon( Opie::Core::OResource::loadPixmap( "remote", Opie::Core::OResource::SmallIcon ) );
00024         setCaption(tr("Remote") );
00025 
00026         QVBoxLayout *layout = new QVBoxLayout(this);
00027         QTabWidget *tabs = new QTabWidget(this);
00028 
00029         layout->addWidget(tabs);
00030 
00031         remote = new RemoteTab(tabs);
00032         learn = new LearnTab(tabs);
00033         config = new ConfigTab(tabs);
00034         help = new HelpTab(tabs);
00035         connect(config, SIGNAL(remotesChanged()), this, SLOT(updateRemotesList()) );
00036 
00037         remote->setIRSocket(fd);
00038 
00039         tabs->addTab(remote, tr("Remote") );
00040         tabs->addTab(learn,tr("Learn") );
00041         tabs->addTab(config,tr("Config") );
00042         tabs->addTab(help, tr("Help") );
00043 
00044         printf("1\n");
00045         cfg = new Config("Remote");
00046         printf("2\n");
00047 
00048         remote->setConfig(cfg);
00049         config->setConfig(cfg);
00050 }
00051 
00052 int MainView::getIRSocket()
00053 {
00054         return fd;
00055 }
00056 
00057 void MainView::setIRSocket(int newfd)
00058 {
00059         fd = newfd;
00060         remote->setIRSocket(fd);
00061 }
00062 
00063 void MainView::updateRemotesList()
00064 {
00065         remote->updateRemotesList();
00066         printf("MainView: got remotes changed signal\n");
00067 }

Generated on Sat Nov 5 16:18:02 2005 for OPIE by  doxygen 1.4.2