summaryrefslogtreecommitdiff
path: root/noncore/tools/remote/mainview.cpp
blob: a00a75a63df289dac1e3655aac68e8a4d11beac5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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 "mainview.h"

#include <opie2/oresource.h>

MainView::MainView(QWidget *parent, const char *name) : QWidget(parent, name)
{
	setIcon( Opie::Core::OResource::loadPixmap( "remote", Opie::Core::OResource::SmallIcon ) );
	setCaption(tr("Remote") );

	QVBoxLayout *layout = new QVBoxLayout(this);
	QTabWidget *tabs = new QTabWidget(this);

	layout->addWidget(tabs);

	remote = new RemoteTab(tabs);
	learn = new LearnTab(tabs);
	config = new ConfigTab(tabs);
	help = new HelpTab(tabs);
	connect(config, SIGNAL(remotesChanged()), this, SLOT(updateRemotesList()) );

	tabs->addTab(remote, tr("Remote") );
	tabs->addTab(learn,tr("Learn") );
	tabs->addTab(config,tr("Config") );
	tabs->addTab(help, tr("Help") );

	printf("1\n");
	cfg = new Config("Remote");
	printf("2\n");

	remote->setConfig(cfg);
	config->setConfig(cfg);
}

void MainView::updateRemotesList()
{
	remote->updateRemotesList();
	printf("MainView: got remotes changed signal\n");
}

void MainView::updateLearnTab()
{
	learn->updateRemotesList();
}