#pragma once

#include "settings_dialog.hh"
#include "chart_scene.hh"
#include "database.hh"
#include <QMainWindow>

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget* parent = nullptr);
    ~MainWindow();

private:
    void fillSearchCombos();

private slots:
    void onSettingsDialog();
    void connectDatabase();
    void disconnectDatabase();
    void onSearchPressed();
    void onOrderSelected(int row, int = 0, int = 0, int = 0);
    void onZoomIn();
    void onZoomOut();
    void onResetZoom();
    void onCandleChanged(const ChartCandle& candle);
    void onShowLine(bool checked);

private:
    Ui::MainWindow* ui_;
    SettingsDialog settings_;
    Database db_;
    ChartScene scene_;
};
