70 lines
1.4 KiB
C++
Executable File
70 lines
1.4 KiB
C++
Executable File
/*
|
|
* @RDE_HEADER@
|
|
* <short description>
|
|
* $Id$
|
|
* $HeadURL$
|
|
* $Author$
|
|
* Created by Malte Schröder, SLSE, 2016-06-08
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <QMainWindow>
|
|
#include <QMap>
|
|
#include <QStandardItemModel>
|
|
|
|
#include <LtsLicence/lts_licence.h>
|
|
#include "licenceedit.h"
|
|
|
|
|
|
namespace Ui
|
|
{
|
|
class MainWindow;
|
|
}
|
|
|
|
class QSortFilterProxyModel;
|
|
|
|
class MainWindow : public QMainWindow
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit MainWindow(QWidget *parent = nullptr);
|
|
~MainWindow();
|
|
|
|
bool init();
|
|
void closeEvent(QCloseEvent *event) override;
|
|
|
|
private slots:
|
|
void onNewLicence(const LtsLicence::Licence &licence);
|
|
void onActionOpen();
|
|
void onActionSave();
|
|
void onActionSaveAs();
|
|
|
|
void onActionAdd();
|
|
void onActionEdit();
|
|
void onActionRemove();
|
|
bool onActionReset();
|
|
|
|
private:
|
|
enum class CryptState
|
|
{
|
|
Unknown = 0,
|
|
Decrypted,
|
|
Encrypted
|
|
} ;
|
|
|
|
void insertRow(const LtsLicence::Licence &licence, int currentRowLicModel);
|
|
void enableDisableButtons();
|
|
void setCurrentIndex();
|
|
void setTVHeaders();
|
|
private:
|
|
Ui::MainWindow *m_ui;
|
|
QMap<QString, LtsLicence::Licence> m_licences;
|
|
QString m_fileName;
|
|
LicenceEdit *m_licenceEdit;
|
|
QStandardItemModel *m_licencesModel;
|
|
QSortFilterProxyModel *m_filterProxyModel;
|
|
CryptState m_cryptState;
|
|
};
|