feat(color): New label based Model Selector (#1374)

* Model Labels Selector

* Portrait Layout

* Receiver ID Check

* Fix Labels .yml format

* Companion Initial Commit

commit 967ddf3979b4954402fe62c858faba4b7a416bba
Author: dlktdr <cblackburn320@gmail.com>
Date:   Mon Aug 29 01:49:15 2022 -0700

    Fix Labels .yml format

commit 534221cad9e01146c47a9ac1080a655e04f1f6c8
Author: dlktdr <cblackburn320@gmail.com>
Date:   Mon Aug 29 01:20:57 2022 -0700

    Receiver ID Check

commit f32c0939d44e9ae60bc0705a9176354c23fec198
Author: dlktdr <cblackburn320@gmail.com>
Date:   Sun Aug 28 23:13:25 2022 -0700

    Portrait Layout

commit 961181217c7841ff3f21299ac6aa419b810f80e9
Author: dlktdr <cblackburn320@gmail.com>
Date:   Sat Dec 11 16:56:13 2021 -0800

    Model Labels Selector

commit dc99dd40d2
Author: David PHAM-VAN <1387855+DavBfr@users.noreply.github.com>
Date:   Fri Aug 26 03:04:34 2022 -0300

    feat: Allow Lua widget to override built-in widget with same name (#2208)

    * Allow CPP Widgets Override with LUA

    * Reset a widget option it the type differs

commit 4b747caff9
Author: eshifri <46511024+eshifri@users.noreply.github.com>
Date:   Thu Aug 25 19:47:53 2022 -0700

    fix: Write model name into models.yml when duplicating model (#2224)

    * Update model name in the models.yml file (#2214)

    * Fix the length of the name.

commit e97f23a305
Author: eshifri <46511024+eshifri@users.noreply.github.com>
Date:   Wed Aug 24 21:19:52 2022 -0700

    fix(cpn): Fix full path to model notes for Simulator (#2223)

* Correct Highlighted Column

* labels .yml indentation

* Update da.h

New defines translated to Danish

* Update dataconstants.h

Omit warnings due to difference of LEN_MODEL_FILENAME and LEN_MODEL_NAME in modellist.cpp

* Update modelslist.cpp

Wonder if this are the right file in PR #1374 (?), seems a lot are changed to the better in #1374

* Update dataconstants.h

Restore #define for LEN_MODEL_FILENAME to 16

* Rebase, Correct Issues

Delete now deletes instead of select
New model stores correct information
Duplicate save all information in cell
Rework items to use cell over button
Reword function variables

* CMPN: Add context menu

Fix output not functional. Removed Yaml::null at some point :)
Fix some compiler warnings

* CMPN: Compiler warning, replace ,->_ in list

* FW: Various Changes

Change view to a grid
Don't allow comma in label name
Add scroll indicators
Save sort order

Co-authored-by: HThuren <99370924+HThuren@users.noreply.github.com>
This commit is contained in:
Cliff
2022-09-03 09:01:19 +10:00
committed by GitHub
co-authored by HThuren
parent 20dc9c4d26
commit c8693569b0
85 changed files with 4006 additions and 2067 deletions
+18 -19
View File
@@ -23,12 +23,15 @@
#include "eeprominterface.h"
#include "modelslist.h"
#include "labels.h"
#include <QActionGroup>
#include <QtGui>
#include <QMessageBox>
#include <QProxyStyle>
#include <QWidget>
#include <QStyledItemDelegate>
#include <QListWidget>
class QToolBar;
@@ -36,6 +39,9 @@ namespace Ui {
class MdiChild;
}
class LabelsDelegate;
class LabelsProxy;
class MdiChild : public QWidget
{
Q_OBJECT
@@ -48,10 +54,8 @@ class MdiChild : public QWidget
ACT_GEN_SIM,
ACT_ITM_EDT, // edit model/rename category
ACT_ITM_DEL, // delete model or cat
ACT_CAT_ADD, // category actions...
//ACT_CAT_EDT, // not sure these are needed...
//ACT_CAT_DEL, // the ACT_ITM_* actions do the same thing
ACT_CAT_SEP, // convenience separator shown/hidden with category actions
ACT_LBL_ADD,
ACT_LBL_DEL,
ACT_MDL_ADD, // model actions...
ACT_MDL_CPY,
ACT_MDL_CUT,
@@ -76,9 +80,9 @@ class MdiChild : public QWidget
QVector<int> getSelectedCategories() const;
QVector<int> getSelectedModels() const;
QList<QAction *> getGeneralActions();
QList<QAction *> getEditActions(bool incCatNew = true);
QList<QAction *> getEditActions();
QList<QAction *> getModelActions();
//QList<QAction *> getCategoryActions();
QList<QAction *> getLabelsActions();
QAction * getAction(const Actions type);
public slots:
@@ -109,6 +113,7 @@ class MdiChild : public QWidget
void setModified();
void retranslateUi();
void showModelsListContextMenu(const QPoint & pos);
void showLabelsContextMenu(const QPoint & pos);
void showContextMenu(const QPoint & pos);
void adjustToolbarLayout();
@@ -130,13 +135,13 @@ class MdiChild : public QWidget
void insert();
void edit();
void confirmDelete();
void categoryAdd();
void modelAdd();
void modelEdit();
void modelSave();
void labelAdd();
void labelDelete();
void wizardEdit();
void modelDuplicate();
void onModelMoveToCategory();
void openModelWizard(int row = -1);
void openModelEditWindow(int row = -1);
@@ -159,12 +164,6 @@ class MdiChild : public QWidget
int countSelectedModels() const;
bool hasSelectedModel();
bool setSelectedModel(const int modelIndex);
int getCurrentCategory() const;
int countSelectedCats() const;
bool hasSelectedCat();
bool deleteCategory(int categoryIndex = -1, QString * error = NULL);
void deleteSelectedCats();
void checkAndInitModel(int row);
void findNewDefaultModel(const unsigned startAt = 0);
@@ -174,8 +173,6 @@ class MdiChild : public QWidget
unsigned deleteModels(const QVector<int> modelIndices);
bool deleteModel(const int modelIndex);
void deleteSelectedModels();
void moveModelsToCategory(const QVector<int> models, const int toCategoryId);
void moveSelectedModelsToCat(const int toCategoryId);
unsigned countUsedModels(const int categoryId = -1);
unsigned saveModels(const QVector<int> modelIndices);
bool saveModel(const int modelIndex);
@@ -197,22 +194,24 @@ class MdiChild : public QWidget
QList<QDialog *> * getModelEditDialogsList();
Ui::MdiChild * ui;
TreeModel * modelsListModel;
ModelsListModel * modelsListModel;
LabelsModel * labelsListModel;
QWidget * parentWindow;
QString curFile;
QVector<int> cutModels;
QVector<QAction *> action;
QToolBar * radioToolbar;
QToolBar * categoriesToolbar;
QToolBar * modelsToolbar;
QToolBar * labelsToolbar;
QLabel *lblLabels;
Firmware * firmware;
RadioData radioData;
int lastSelectedModel;
bool isUntitled;
bool showCatToolbar;
bool showLabelToolbar;
bool forceCloseFlag;
const quint16 stateDataVersion;
};