#include <QtGui/QMessageBox>
#include <QtGui/QDialogButtonBox>
#include <QtGui/QTextEdit>
+#include <QtCore/QDebug>
#include <QMaemo5InformationBox>
-#include <QDebug>
#include "mainwindow.h"
#include "settingsdialog.h"
#include "searchdialog.h"
#include "daemon.h"
#include "settings.h"
#include "db.h"
+#include "source.h"
+#include "sourcecoreconfig.h"
namespace
{
void MainWindow::openSearch()
{
- DB::connect();
+ Source::SourceId sourceId = Source::stringToId(Settings::instance()->get("source"));
+ SourceCoreConfig* config = SourceCoreConfig::getCoreConfig(sourceId);
- QString username = Settings::instance()->get("eniro_username");
- QString password = Settings::instance()->get("eniro_password");
+ Q_ASSERT(config != 0);
- DB::disconnect();
+ bool readyToSearch = config->readyToSearch();
+ delete config;
- if(username.isEmpty() || password.isEmpty())
+ if(!readyToSearch)
{
- QMessageBox::information(this, tr("Info"), tr("You need to set Eniro login details in settings before using this feature."));
+ QMessageBox::information(this, tr("Info"), tr("You need to set login details or other options in settings before using this feature."));
return;
}