From 45f6cd21a2c730b9dea322b0dba30120cdc40521 Mon Sep 17 00:00:00 2001 From: Tannin Date: Fri, 17 May 2013 20:44:40 +0200 Subject: - extended plugin interface to allow plugins access to download manager - extended plugin interface to allow installation of mods from files - improved detection of online state - download tab now also displays files supported through plugins - batch installer now has basic functionality (downloads and installes files) --- src/mainwindow.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index e7e9f856..89dc9904 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -106,10 +106,17 @@ static bool isOnline() QList interfaces = QNetworkInterface::allInterfaces(); bool connected = false; - for (auto iter = interfaces.begin(); iter != interfaces.end(); ++iter) { + for (auto iter = interfaces.begin(); iter != interfaces.end() && !connected; ++iter) { if ( (iter->flags() & QNetworkInterface::IsUp) && (iter->flags() & QNetworkInterface::IsRunning) && !(iter->flags() & QNetworkInterface::IsLoopBack)) { + auto addresses = iter->addressEntries(); + if (addresses.count() == 0) { + continue; + } + qDebug("interface %s seems to be up (address: %s)", + qPrintable(iter->humanReadableName()), + qPrintable(addresses[0].ip().toString())); connected = true; } } @@ -996,6 +1003,8 @@ void MainWindow::loadPlugins() } } } + + m_DownloadManager.setSupportedExtensions(m_InstallationManager.getSupportedExtensions()); } IGameInfo &MainWindow::gameInfo() const @@ -1818,6 +1827,7 @@ void MainWindow::on_tabWidget_currentChanged(int index) void MainWindow::installMod(const QString &fileName) { +qDebug("install %s", qPrintable(fileName)); bool hasIniTweaks = false; GuessedValue modName; m_CurrentProfile->writeModlistNow(); @@ -1847,6 +1857,11 @@ void MainWindow::installMod(const QString &fileName) } } +IDownloadManager *MainWindow::downloadManager() +{ + return &m_DownloadManager; +} + void MainWindow::installMod() { @@ -3020,6 +3035,7 @@ void MainWindow::exportModListCSV() fields.push_back(std::make_pair(QString("mod_installed_name"), CSVBuilder::TYPE_STRING)); fields.push_back(std::make_pair(QString("mod_version"), CSVBuilder::TYPE_STRING)); fields.push_back(std::make_pair(QString("file_installed_name"), CSVBuilder::TYPE_STRING)); +// fields.push_back(std::make_pair(QString("file_category"), CSVBuilder::TYPE_INTEGER)); builder.setFields(fields); builder.writeHeader(); -- cgit v1.3.1