summaryrefslogtreecommitdiffstats
path: root/BrowserWindow.cpp
blob: 2939864ae0487db0b36c5aea5a7bfc56684e85ba (plain) (blame)
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
#include "BrowserWindow.h"
#include "DVDPluginWebPage.h"
#include <QWebSettings>
#include <QWebView>
#include <QVBoxLayout>
#include <QLineEdit>

BrowserWindow::BrowserWindow(QWidget *parent) :
		QWidget(parent)
{
	QVBoxLayout *layout = new QVBoxLayout;
	setLayout(layout);
	m_urlBox = new QLineEdit;
	layout->addWidget(m_urlBox);
	m_browser = new QWebView;
	layout->addWidget(m_browser);
	connect(m_browser, SIGNAL(urlChanged(QUrl)), this, SLOT(updateUrlBox(QUrl)));
	connect(m_urlBox, SIGNAL(returnPressed()), this, SLOT(navigateToPage()));
	m_browser->setPage(new DVDPluginWebPage(m_browser));
	m_browser->load(QString("http://www.anyclip.com"));
}
void BrowserWindow::updateUrlBox(const QUrl &url)
{
	m_urlBox->setText(url.toString());
}
void BrowserWindow::navigateToPage()
{
	m_browser->load(m_urlBox->text());
}