Welcome to mirror list, hosted at ThFree Co, Russian Federation.

routing_settings_dialog.hpp « qt - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 71e8d8dad0cbbd18c8629cd5f1bbb1a116f0a78a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#pragma once

#include "geometry/latlon.hpp"

#include <QtWidgets/QApplication>
#include <QtWidgets/QCheckBox>
#include <QtWidgets/QComboBox>
#include <QtWidgets/QDialog>
#include <QtWidgets/QFormLayout>
#include <QtWidgets/QLineEdit>

#include <string>

#include "boost/optional.hpp"

class Framework;

namespace qt
{
class RoutingSettings : public QDialog
{
public:
  static bool IsCacheEnabled();
  static boost::optional<ms::LatLon> GetCoords(bool start);
  static void LoadSettings(Framework & framework);
  static void ResetSettings();

  RoutingSettings(QWidget * parent, Framework & framework);

  void ShowModal();

private:
  static std::string const kUseCachedRoutingSettings;
  static std::string const kStartCoordsCachedSettings;
  static std::string const kFinishCoordsCachedSettings;
  static std::string const kRouterTypeCachedSettings;

  static boost::optional<ms::LatLon> GetCoordsFromString(std::string const & input);

  void AddLineEdit(std::string const & title, QLineEdit * lineEdit);
  void AddCheckBox();
  void AddButtonBox();
  void AddListWidgetWithRoutingTypes();

  void ShowMessage(std::string const & message);
  bool ValidateAndSaveCoordsFromInput();
  void SaveSettings();
  void LoadSettings();

  Framework & m_framework;
  QDialog m_dialog;
  QFormLayout m_form;

  QLineEdit * m_startInput;
  QLineEdit * m_finishInput;

  QComboBox * m_routerType;
  QCheckBox * m_alwaysCheckbox;
};
}  // namespace qt