Skip to content

Commit 3d18cf4

Browse files
authored
Qtfred quick action bars (#7375)
* Add quick action bars to qtfred FredView * always use trimmed * make sure the layer list stays updated
1 parent 7e09961 commit 3d18cf4

7 files changed

Lines changed: 843 additions & 36 deletions

File tree

qtfred/src/mission/Editor.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,9 @@ class Editor : public QObject {
120120
/*! Emit layerStructureChanged — called by EditorViewport when layers are added/removed or objects move between layers. */
121121
void notifyLayerStructureChanged() { layerStructureChanged(); }
122122

123+
/*! Emit layerListChanged — called by EditorViewport when layer names are added/removed/reloaded. */
124+
void notifyLayerListChanged() { layerListChanged(); }
125+
123126
signals:
124127
/**
125128
* @brief Signal for when a new mission has been loaded
@@ -155,6 +158,11 @@ class Editor : public QObject {
155158
*/
156159
void layerStructureChanged();
157160

161+
/**
162+
* @brief A signal emitted when the layer name list itself changes (add/remove/reload)
163+
*/
164+
void layerListChanged();
165+
158166
public:
159167
// --- Undo / autosave state ---
160168
int undoAvailable = 0; ///< Whether an undo state (Backup.002) is available
@@ -236,6 +244,9 @@ class Editor : public QObject {
236244

237245
bool rename_wing(int wing, const SCP_string& new_name, bool rename_members = true);
238246

247+
// DA 1/7/99 These ship names are not variables
248+
int rename_ship(int ship, const char* name);
249+
239250
/**
240251
* @brief Delete a whole wing, leaving ships intact but wingless.
241252
*
@@ -319,9 +330,6 @@ class Editor : public QObject {
319330

320331
int invalidate_references(const char* name, sexp_ref_type type);
321332

322-
// DA 1/7/99 These ship names are not variables
323-
int rename_ship(int ship, const char* name);
324-
325333
void delete_reinforcement(int num);
326334

327335
// changes the currently selected wing. It is assumed that cur_wing == cur_ship's wing

qtfred/src/mission/EditorViewport.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1011,6 +1011,7 @@ bool EditorViewport::addLayer(const SCP_string& name, SCP_string* errorMessage)
10111011
_layerVisibility.push_back(true);
10121012
syncMissionLayerNames();
10131013
editor->notifyLayerStructureChanged();
1014+
editor->notifyLayerListChanged();
10141015
return true;
10151016
}
10161017

@@ -1045,6 +1046,7 @@ bool EditorViewport::deleteLayer(const SCP_string& name, SCP_string* errorMessag
10451046
}
10461047
syncMissionLayerNames();
10471048
editor->notifyLayerStructureChanged();
1049+
editor->notifyLayerListChanged();
10481050
return true;
10491051
}
10501052

@@ -1112,6 +1114,7 @@ void EditorViewport::reloadLayersFromMission() {
11121114

11131115
_layerVisibility.resize(_layerNames.size(), true);
11141116
syncMissionLayerNames();
1117+
editor->notifyLayerListChanged();
11151118

11161119
for (int objectIndex = 0; objectIndex < MAX_OBJECTS; ++objectIndex) {
11171120
auto* objp = &Objects[objectIndex];

0 commit comments

Comments
 (0)