47 lines
1.0 KiB
C++
47 lines
1.0 KiB
C++
#ifndef ORBITHUB_PROFILES_WINDOW_H
|
|
#define ORBITHUB_PROFILES_WINDOW_H
|
|
|
|
#include <QMainWindow>
|
|
#include <QString>
|
|
#include <QtGlobal>
|
|
|
|
#include <memory>
|
|
#include <optional>
|
|
#include <QPointer>
|
|
#include <vector>
|
|
|
|
class QListWidget;
|
|
class QListWidgetItem;
|
|
class QLineEdit;
|
|
class QPushButton;
|
|
class SessionWindow;
|
|
class ProfileRepository;
|
|
|
|
class ProfilesWindow : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit ProfilesWindow(QWidget* parent = nullptr);
|
|
~ProfilesWindow() override;
|
|
|
|
private:
|
|
QLineEdit* m_searchBox;
|
|
QListWidget* m_profilesList;
|
|
QPushButton* m_newButton;
|
|
QPushButton* m_editButton;
|
|
QPushButton* m_deleteButton;
|
|
std::vector<QPointer<SessionWindow>> m_sessionWindows;
|
|
std::unique_ptr<ProfileRepository> m_repository;
|
|
|
|
void setupUi();
|
|
void loadProfiles(const QString& query = QString());
|
|
std::optional<qint64> selectedProfileId() const;
|
|
void createProfile();
|
|
void editSelectedProfile();
|
|
void deleteSelectedProfile();
|
|
void openSessionForItem(QListWidgetItem* item);
|
|
};
|
|
|
|
#endif
|