#include "daemon.h"
#include "settings.h"
#include "db.h"
+#include "source.h"
+#include "sourcecoreconfig.h"
namespace
{
}
else
{
- QMaemo5InformationBox::information(this, readyText);
+ QMaemo5InformationBox::information(this, readyText, 800);
toggleButton_->setText(buttonText);
toggleButton_->setIcon(QIcon(running_ ? START_ICON : CLOSE_ICON));
running_ = !running_;
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;
}