X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fgui%2Fmainwindow.cpp;h=8a5c71d31ce6c3e582dca0d17ca768245d966c47;hb=9f12310c5e8648fa0f2f80a85a5f068892afb971;hp=7c0221aaa6690d13295ddec956b8a65458479360;hpb=9127dc5e47aee7fa6659f45ae60a9394612f27b1;p=jenirok diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 7c0221a..8a5c71d 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -32,6 +32,8 @@ #include "daemon.h" #include "settings.h" #include "db.h" +#include "source.h" +#include "sourcecoreconfig.h" namespace { @@ -156,7 +158,7 @@ void MainWindow::toggleDaemon() } else { - QMaemo5InformationBox::information(this, readyText); + QMaemo5InformationBox::information(this, readyText, 800); toggleButton_->setText(buttonText); toggleButton_->setIcon(QIcon(running_ ? START_ICON : CLOSE_ICON)); running_ = !running_; @@ -166,16 +168,17 @@ void MainWindow::toggleDaemon() 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; }