| 1 | #pragma once |
| 2 | #include <gtkmm.h> |
| 3 | #include "util/sqlite.hpp" |
| 4 | |
| 5 | namespace horizon { |
| 6 | |
| 7 | class DigiKeyApiPreferencesEditor : public Gtk::Box { |
| 8 | public: |
| 9 | DigiKeyApiPreferencesEditor(BaseObjectType *cobject, const Glib::RefPtr<Gtk::Builder> &x, class Preferences &prefs); |
| 10 | static DigiKeyApiPreferencesEditor *create(Preferences &prefs); |
| 11 | |
| 12 | private: |
| 13 | Preferences &preferences; |
| 14 | class DigiKeyApiPreferences &digikey_preferences; |
| 15 | Gtk::Entry *digikey_client_id_entry = nullptr; |
| 16 | Gtk::Entry *digikey_client_secret_entry = nullptr; |
| 17 | Gtk::SpinButton *digikey_max_price_breaks_sp = nullptr; |
| 18 | Gtk::ComboBoxText *digikey_site_combo = nullptr; |
| 19 | Gtk::ComboBoxText *digikey_currency_combo = nullptr; |
| 20 | Gtk::Label *digikey_token_label = nullptr; |
| 21 | |
| 22 | void populate_and_bind_combo(Gtk::ComboBoxText &combo, |
| 23 | const std::vector<std::pair<std::string, std::string>> &items, std::string &value); |
| 24 | |
| 25 | void update_warnings(); |
| 26 | void update_token(); |
| 27 | SQLite::Database db; |
| 28 | }; |
| 29 | |
| 30 | } // namespace horizon |