From 715623e7905e5f64f5b331f4523642aab1aedd34 Mon Sep 17 00:00:00 2001 From: Tannin Date: Sun, 27 Jul 2014 18:34:32 +0200 Subject: - browser dialog now has a hidden url-field (for testing only) - loot_cli is no longer part of this project. I will probably create a fork of loot that allows command-line usage instead - loot integration now works with such a modified loot version - integrated loot will now also integrate incompatibility messages in the MO UI - overwrite-markers are now updated as the list order is changed - fnis checker will now always allow the user to ignore fnis errors - plugin interface now has a function to wait for handles returned from startApplication (which can be job or process handles) - bugfix: non-mo mods sharing the name with regular mods now have a different internal name - bugfix: using hotkeys the vanilla game-plugins could be moved --- src/browserdialog.cpp | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'src/browserdialog.cpp') diff --git a/src/browserdialog.cpp b/src/browserdialog.cpp index 4897ea4f..521459d0 100644 --- a/src/browserdialog.cpp +++ b/src/browserdialog.cpp @@ -37,6 +37,7 @@ along with Mod Organizer. If not, see . #include #include #include +#include @@ -57,9 +58,12 @@ BrowserDialog::BrowserDialog(QWidget *parent) m_Tabs = this->findChild("browserTabWidget"); + installEventFilter(this); + connect(m_Tabs, SIGNAL(tabCloseRequested(int)), this, SLOT(tabCloseRequested(int))); -} + ui->urlEdit->setVisible(false); +} BrowserDialog::~BrowserDialog() { @@ -108,13 +112,14 @@ BrowserView *BrowserDialog::getCurrentView() } -void BrowserDialog::urlChanged(const QUrl&) +void BrowserDialog::urlChanged(const QUrl &url) { BrowserView *currentView = getCurrentView(); if (currentView != NULL) { ui->backBtn->setEnabled(currentView->history()->canGoBack()); ui->fwdBtn->setEnabled(currentView->history()->canGoForward()); } + ui->urlEdit->setText(url.toString()); } @@ -268,3 +273,24 @@ void BrowserDialog::on_browserTabWidget_currentChanged(int index) ui->fwdBtn->setEnabled(currentView->history()->canGoForward()); } } + +void BrowserDialog::on_urlEdit_returnPressed() +{ + QWebView *currentView = getCurrentView(); + if (currentView != NULL) { + currentView->setUrl(QUrl(ui->urlEdit->text())); + } +} + +bool BrowserDialog::eventFilter(QObject *object, QEvent *event) +{ + if (event->type() == QEvent::KeyPress) { + QKeyEvent *keyEvent = reinterpret_cast(event); + if ((keyEvent->modifiers() & Qt::ControlModifier) + && (keyEvent->key() == Qt::Key_U)) { + ui->urlEdit->setVisible(!ui->urlEdit->isVisible()); + return true; + } + } + return QDialog::eventFilter(object, event); +} -- cgit v1.3.1