예제 #1
0
파일: Window.cpp 프로젝트: GioMac/otter
void Window::setUserAgent(const QString &identifier)
{
	WebContentsWidget *webWidget = NULL;

	if (m_contentsWidget && m_contentsWidget->getType() == QLatin1String("web"))
	{
		webWidget = qobject_cast<WebContentsWidget*>(m_contentsWidget);

		if (!webWidget)
		{
			return;
		}
	}

	QString value;

	if (identifier == QLatin1String("custom"))
	{
		value = QInputDialog::getText(this, tr("Select User Agent"), tr("Input User Agent:"), QLineEdit::Normal, webWidget->getUserAgent().second);
	}
	else
	{
		value = NetworkManagerFactory::getUserAgent(identifier).value;
	}

	webWidget->setUserAgent(identifier, value);
}
예제 #2
0
파일: Window.cpp 프로젝트: GioMac/otter
void Window::setDefaultTextEncoding(const QString &encoding)
{
	if (m_contentsWidget->getType() == QLatin1String("web"))
	{
		WebContentsWidget *webWidget = qobject_cast<WebContentsWidget*>(m_contentsWidget);

		if (webWidget)
		{
			return webWidget->setDefaultTextEncoding(encoding);
		}
	}
}
예제 #3
0
파일: Window.cpp 프로젝트: Decme/otter
void Window::search(const QString &query, const QString &engine)
{
	WebContentsWidget *widget = qobject_cast<WebContentsWidget*>(m_contentsWidget);

	if (!widget)
	{
		widget = new WebContentsWidget(isPrivate(), NULL, this);

		setContentsWidget(widget);
	}

	widget->search(query, engine);
}
예제 #4
0
파일: Window.cpp 프로젝트: GioMac/otter
void Window::search(const QString &query, const QString &engine)
{
	WebContentsWidget *widget = qobject_cast<WebContentsWidget*>(m_contentsWidget);

	if (!widget)
	{
		widget = new WebContentsWidget(isPrivate(), NULL, this);

		setContentsWidget(widget);
	}

	m_ui->addressWidget->clearFocus();

	widget->search(query, engine);

	m_ui->addressWidget->setUrl(getUrl());
}