Add docs for UI views
This commit is contained in:
parent
9306786beb
commit
bc591244c4
9 changed files with 342 additions and 3 deletions
|
|
@ -17,42 +17,108 @@
|
|||
#include "entities/dpoint_entity.h"
|
||||
|
||||
|
||||
/**
|
||||
* @brief Namespace for UI layout MOC to be generated
|
||||
*
|
||||
*/
|
||||
namespace Ui { class AdminPanel; }
|
||||
|
||||
/**
|
||||
* @brief Administration window
|
||||
*
|
||||
*/
|
||||
class AdminPanel : public QMainWindow {
|
||||
private:
|
||||
Q_OBJECT
|
||||
|
||||
//! Layout object
|
||||
Ui::AdminPanel *ui;
|
||||
|
||||
//! Current user object
|
||||
user_entity user;
|
||||
|
||||
//! Users ViewModel
|
||||
UsersViewModel *uvm;
|
||||
//! Vessels ViewModel
|
||||
VesselsViewModel *vvm;
|
||||
//! Delivery points ViewModel
|
||||
DeliveryPointsViewModel *dpvm;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Admin Panel
|
||||
*
|
||||
* @param parent [ignored]
|
||||
*/
|
||||
explicit AdminPanel(QWidget *parent = nullptr);
|
||||
/**
|
||||
* @brief Destroy the Admin Panel
|
||||
*
|
||||
*/
|
||||
~AdminPanel();
|
||||
|
||||
/**
|
||||
* @brief Builder-like function, to set current user
|
||||
*
|
||||
* @param user new current user reference
|
||||
* @return AdminPanel&
|
||||
*/
|
||||
AdminPanel& set_user(const user_entity &user);
|
||||
|
||||
signals:
|
||||
/**
|
||||
* @brief Then user set signal
|
||||
*
|
||||
*/
|
||||
void user_set();
|
||||
|
||||
private slots:
|
||||
/**
|
||||
* @brief On user set slot
|
||||
*
|
||||
*/
|
||||
void on_user_set();
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief Action to be called, then user pressed logout button
|
||||
*
|
||||
*/
|
||||
void on_logout_requested();
|
||||
|
||||
/**
|
||||
* @brief Action to be called, whenever user wants to edit or add new vessel
|
||||
*
|
||||
* @param edit is it creation or edit intent
|
||||
*/
|
||||
void on_vessel_add_edit(bool edit);
|
||||
/**
|
||||
* @brief Action to be called, whenever user wants to remove vessel
|
||||
*
|
||||
*/
|
||||
void on_vessel_remove();
|
||||
|
||||
/**
|
||||
* @brief Action to be called, whenever user wants to edit or add new user
|
||||
*
|
||||
* @param edit is it creation or edit intent
|
||||
*/
|
||||
void on_user_add_edit(bool edit);
|
||||
/**
|
||||
* @brief Action to be called, whenever user wants to remove user
|
||||
*
|
||||
*/
|
||||
void on_user_remove();
|
||||
|
||||
/**
|
||||
* @brief Action to be called, whenever user wants to edit or add new delivery point
|
||||
*
|
||||
* @param edit is it creation or edit intent
|
||||
*/
|
||||
void on_delivery_point_add_edit(bool edit);
|
||||
/**
|
||||
* @brief Action to be called, whenever user wants to remove delivery point
|
||||
*
|
||||
*/
|
||||
void on_delivery_point_remove();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -10,19 +10,40 @@
|
|||
#include <QMessageBox>
|
||||
|
||||
|
||||
/**
|
||||
* @brief Namespace for UI layout MOC to be generated
|
||||
*
|
||||
*/
|
||||
namespace Ui { class AuthWindow; }
|
||||
|
||||
/**
|
||||
* @brief Auth window
|
||||
*
|
||||
*/
|
||||
class AuthWindow : public QMainWindow {
|
||||
private:
|
||||
Q_OBJECT
|
||||
|
||||
//! Layout object
|
||||
Ui::AuthWindow *ui;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Auth window
|
||||
*
|
||||
* @param parent [ignored]
|
||||
*/
|
||||
explicit AuthWindow(QWidget *parent = nullptr);
|
||||
/**
|
||||
* @brief Destroy the Auth window
|
||||
*
|
||||
*/
|
||||
~AuthWindow();
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief Action to be called, then user pressed login button
|
||||
*
|
||||
*/
|
||||
void on_auth_requested();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -7,22 +7,50 @@
|
|||
#include "entities/cargo_entity.h"
|
||||
|
||||
|
||||
/**
|
||||
* @brief Namespace for UI layout MOC to be generated
|
||||
*
|
||||
*/
|
||||
namespace Ui { class CargoEditDialog; }
|
||||
|
||||
/**
|
||||
* @brief Cargo edit Dialog
|
||||
*
|
||||
*/
|
||||
class CargoEditDialog : public QDialog {
|
||||
private:
|
||||
Q_OBJECT
|
||||
//! Layout object
|
||||
Ui::CargoEditDialog *ui;
|
||||
|
||||
//! Cargo entity object
|
||||
cargo_entity *_cargo;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Cargo Edit Dialog
|
||||
*
|
||||
* @param parent [ignored]
|
||||
*/
|
||||
explicit CargoEditDialog(QWidget *parent = nullptr);
|
||||
/**
|
||||
* @brief Destroy the Cargo Edit Dialog
|
||||
*
|
||||
*/
|
||||
~CargoEditDialog();
|
||||
|
||||
/**
|
||||
* @brief Returns cargo object pointer
|
||||
*
|
||||
* @return cargo_entity*
|
||||
*/
|
||||
cargo_entity* cargo();
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* @brief Dialog accept slot
|
||||
*
|
||||
*/
|
||||
void accept() Q_DECL_OVERRIDE;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -13,29 +13,73 @@
|
|||
#include "storageeditdialog.h"
|
||||
|
||||
|
||||
/**
|
||||
* @brief Namespace for UI layout MOC to be generated
|
||||
*
|
||||
*/
|
||||
namespace Ui { class DeliveryPointEditDialog; }
|
||||
|
||||
/**
|
||||
* @brief Delivery point edit Dialog
|
||||
*
|
||||
*/
|
||||
class DeliveryPointEditDialog : public QDialog {
|
||||
private:
|
||||
Q_OBJECT
|
||||
//! Layout object
|
||||
Ui::DeliveryPointEditDialog *ui;
|
||||
|
||||
//! ViewModel for DP's storages
|
||||
QStringListModel *svm;
|
||||
//! Delivery point object
|
||||
dpoint_entity *_dp;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Delivery Point Edit Dialog
|
||||
*
|
||||
* @param parent [ignored]
|
||||
*/
|
||||
explicit DeliveryPointEditDialog(QWidget *parent = nullptr);
|
||||
/**
|
||||
* @brief Destroy the Delivery Point Edit Dialog
|
||||
*
|
||||
*/
|
||||
~DeliveryPointEditDialog();
|
||||
|
||||
/**
|
||||
* @brief Returns delivery point object pointer
|
||||
*
|
||||
* @return dpoint_entity*
|
||||
*/
|
||||
dpoint_entity* dpoint() const;
|
||||
/**
|
||||
* @brief Set delivery point object
|
||||
*
|
||||
* @param dpoint
|
||||
* @param edit
|
||||
*/
|
||||
void set_dpoint(dpoint_entity* dpoint, bool edit);
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* @brief On new storage add slot
|
||||
*
|
||||
* @param edit
|
||||
*/
|
||||
void on_storage_edit_add(bool edit);
|
||||
|
||||
/**
|
||||
* @brief Dialog accept slot
|
||||
*
|
||||
*/
|
||||
void accept() Q_DECL_OVERRIDE;
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief Updates storages list
|
||||
*
|
||||
*/
|
||||
void update_list();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,13 @@
|
|||
#include <QApplication>
|
||||
|
||||
|
||||
/**
|
||||
* @brief Main entry point for application
|
||||
*
|
||||
* @param argc command line args count
|
||||
* @param argv command line args
|
||||
* @return int exit code
|
||||
*/
|
||||
int main(int argc, char *argv[]) {
|
||||
QApplication a(argc, argv);
|
||||
|
||||
|
|
|
|||
|
|
@ -11,30 +11,67 @@
|
|||
#include "entities/vessel_entity.h"
|
||||
|
||||
|
||||
/**
|
||||
* @brief Namespace for UI layout MOC to be generated
|
||||
*
|
||||
*/
|
||||
namespace Ui { class SkipperPanel; }
|
||||
|
||||
/**
|
||||
* @brief Skipper info panel
|
||||
*
|
||||
*/
|
||||
class SkipperPanel : public QMainWindow {
|
||||
private:
|
||||
Q_OBJECT
|
||||
|
||||
//! Layout object
|
||||
Ui::SkipperPanel *ui;
|
||||
|
||||
//! User entity object
|
||||
user_entity user;
|
||||
//! Cargo ViewModel
|
||||
CargoViewModel *cvm;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Skipper Panel
|
||||
*
|
||||
* @param parent [ignored]
|
||||
*/
|
||||
explicit SkipperPanel(QWidget *parent = nullptr);
|
||||
/**
|
||||
* @brief Destroy the Skipper Panel
|
||||
*
|
||||
*/
|
||||
~SkipperPanel();
|
||||
|
||||
/**
|
||||
* @brief Set user object
|
||||
*
|
||||
* @param user
|
||||
* @return SkipperPanel&
|
||||
*/
|
||||
SkipperPanel& set_user(const user_entity &user);
|
||||
|
||||
signals:
|
||||
/**
|
||||
* @brief Then user set signal
|
||||
*
|
||||
*/
|
||||
void user_set();
|
||||
|
||||
private slots:
|
||||
/**
|
||||
* @brief On user set slot
|
||||
*
|
||||
*/
|
||||
void on_user_set();
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief Action to be called, then user pressed logout button
|
||||
*
|
||||
*/
|
||||
void on_logout_requested();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -10,25 +10,64 @@
|
|||
#include "cargoeditdialog.h"
|
||||
|
||||
|
||||
/**
|
||||
* @brief Namespace for UI layout MOC to be generated
|
||||
*
|
||||
*/
|
||||
namespace Ui { class StorageEditDialog; }
|
||||
|
||||
/**
|
||||
* @brief Storage edit Dialog
|
||||
*
|
||||
*/
|
||||
class StorageEditDialog : public QDialog {
|
||||
private:
|
||||
Q_OBJECT
|
||||
//! Layout object
|
||||
Ui::StorageEditDialog *ui;
|
||||
|
||||
//! Cargo ViewModel
|
||||
CargoViewModel *cvm;
|
||||
//! Storage object
|
||||
storage_entity *_storage;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Storage Edit Dialog
|
||||
*
|
||||
* @param parent [ignored]
|
||||
*/
|
||||
explicit StorageEditDialog(QWidget *parent = nullptr);
|
||||
/**
|
||||
* @brief Destroy the Storage Edit Dialog
|
||||
*
|
||||
*/
|
||||
~StorageEditDialog();
|
||||
|
||||
/**
|
||||
* @brief Returns storage object pointer
|
||||
*
|
||||
* @return storage_entity*
|
||||
*/
|
||||
storage_entity* storage();
|
||||
/**
|
||||
* @brief Set storage object
|
||||
*
|
||||
* @param ent
|
||||
* @param edit
|
||||
*/
|
||||
void set_storage(storage_entity *ent, bool edit);
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* @brief On new cargo add slot
|
||||
*
|
||||
*/
|
||||
void on_cargo_add();
|
||||
/**
|
||||
* @brief Dialog accept slot
|
||||
*
|
||||
*/
|
||||
void accept() Q_DECL_OVERRIDE;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -7,30 +7,72 @@
|
|||
#include "entities/user_entity.h"
|
||||
|
||||
|
||||
/**
|
||||
* @brief Namespace for UI layout MOC to be generated
|
||||
*
|
||||
*/
|
||||
namespace Ui { class UserEditDialog; }
|
||||
|
||||
/**
|
||||
* @brief User data struct for new user's data to be moved
|
||||
*
|
||||
*/
|
||||
struct user_data_struct {
|
||||
//! User's login
|
||||
QString login;
|
||||
//! User's password
|
||||
QString password;
|
||||
//! User's account role
|
||||
UserRole role;
|
||||
//! Are we editing user?
|
||||
bool edit;
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief User edit Dialog
|
||||
*
|
||||
*/
|
||||
class UserEditDialog : public QDialog {
|
||||
private:
|
||||
Q_OBJECT
|
||||
//! Layout object
|
||||
Ui::UserEditDialog *ui;
|
||||
|
||||
//! User data structure pointer
|
||||
user_data_struct *_user_data;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new User Edit Dialog
|
||||
*
|
||||
* @param parent [ignored]
|
||||
*/
|
||||
explicit UserEditDialog(QWidget *parent = nullptr);
|
||||
/**
|
||||
* @brief Destroy the User Edit Dialog
|
||||
*
|
||||
*/
|
||||
~UserEditDialog();
|
||||
|
||||
/**
|
||||
* @brief Returns user data pointer
|
||||
*
|
||||
* @return user_data_struct*
|
||||
*/
|
||||
user_data_struct* user_data() const;
|
||||
/**
|
||||
* @brief Set user object
|
||||
*
|
||||
* @param user
|
||||
* @param edit
|
||||
*/
|
||||
void set_user(user_entity* user, bool edit);
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* @brief Dialog accept slot
|
||||
*
|
||||
*/
|
||||
void accept() Q_DECL_OVERRIDE;
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -11,31 +11,86 @@
|
|||
#include "cargoeditdialog.h"
|
||||
|
||||
|
||||
/**
|
||||
* @brief Namespace for UI layout MOC to be generated
|
||||
*
|
||||
*/
|
||||
namespace Ui { class VesselEditDialog; }
|
||||
|
||||
/**
|
||||
* @brief Vessel edit Dialog
|
||||
*
|
||||
*/
|
||||
class VesselEditDialog : public QDialog {
|
||||
private:
|
||||
Q_OBJECT
|
||||
//! Layout object
|
||||
Ui::VesselEditDialog *ui;
|
||||
|
||||
//! Cargo ViewModel
|
||||
CargoViewModel *cvm;
|
||||
//! Vessel entity pointer
|
||||
vessel_entity *_vessel;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new Vessel Edit Dialog
|
||||
*
|
||||
* @param parent [ignored]
|
||||
*/
|
||||
explicit VesselEditDialog(QWidget *parent = nullptr);
|
||||
/**
|
||||
* @brief Destroy the Vessel Edit Dialog
|
||||
*
|
||||
*/
|
||||
~VesselEditDialog();
|
||||
|
||||
/**
|
||||
* @brief Get dialog's vessel
|
||||
*
|
||||
* @return vessel_entity*
|
||||
*/
|
||||
vessel_entity* vessel();
|
||||
/**
|
||||
* @brief Set dialog vessel object
|
||||
*
|
||||
* @param ves vessel object
|
||||
* @param edit is it edit intent
|
||||
*/
|
||||
void set_vessel(vessel_entity *ves, bool edit);
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* @brief Cargo add slot
|
||||
*
|
||||
*/
|
||||
void on_cargo_add();
|
||||
/**
|
||||
* @brief Move cargo from harbor to vessel slot
|
||||
*
|
||||
*/
|
||||
void on_withdraw_from_harbor();
|
||||
/**
|
||||
* @brief Move cargo from vessel to harbor slot
|
||||
*
|
||||
*/
|
||||
void on_withdraw_from_vessel();
|
||||
/**
|
||||
* @brief Dialog accept slot
|
||||
*
|
||||
*/
|
||||
void accept() Q_DECL_OVERRIDE;
|
||||
|
||||
private:
|
||||
/**
|
||||
* @brief Correctly selects vessel's skipper
|
||||
*
|
||||
*/
|
||||
void select_proper_skipper();
|
||||
/**
|
||||
* @brief Correctly selects vessel's harbor
|
||||
*
|
||||
*/
|
||||
void select_proper_port();
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue