Removed file types from sound selector and poi selector.
[jspeed] / src / poisettings.cpp
index 5adfa6e..2388d5f 100644 (file)
@@ -35,7 +35,6 @@
 #include "fileselector.h"
 #include "poialerts.h"
 #include "settings.h"
-#include "mediaplayer.h"
 #include "poireader.h"
 #include "buttonbox.h"
 #include "soundselector.h"
@@ -63,7 +62,7 @@ PoiSettings::PoiSettings(QWidget* parent): QDialog(parent)
     QHBoxLayout* distance = new QHBoxLayout;
     distance->addWidget(distanceLabel_);
     distance->addWidget(distance_);
-    onlyOnRoute_ = new QCheckBox(tr("Alert only if poi is in route"));
+    onlyOnRoute_ = new QCheckBox(tr("Alert only if poi is on route"));
     onlyOnRoute_->setChecked(Settings::instance().value("alert_only_on_route", true).toBool());
 
     ButtonBox* buttons = new ButtonBox;
@@ -110,7 +109,7 @@ void PoiSettings::loadFiles()
 
     poiFileSelector_->clear();
     QString selectedPoi = Settings::instance().value("alert_poi_file", "").toString();
-    poiFileSelector_->loadFiles(PoiAlerts::getPoiDir(), PoiReader::getFormatPattern());
+    poiFileSelector_->loadFiles(PoiAlerts::getPoiDir(), PoiReader::getFormatPattern(), true);
     poiFileSelector_->selectByValue(selectedPoi);
 
 }
@@ -141,11 +140,13 @@ void PoiSettings::saveSettings()
     Settings::instance().setValue("alert_sound", soundSelector_->value());
     Settings::instance().setValue("alert_poi_file", poiFileSelector_->value());
 
-    hide();
-
     if(!PoiAlerts::instance().loadConfig())
     {
-        QMaemo5InformationBox::information(0, tr("Unable to load poi file: %1.").arg(PoiAlerts::instance().error()),
+        QMaemo5InformationBox::information(this, tr("Unable to load poi file: %1.").arg(PoiAlerts::instance().error()),
                                            QMaemo5InformationBox::NoTimeout);
     }
+    else
+    {
+        hide();
+    }
 }