Skip to content

Commit e20562c

Browse files
committed
Add notifications
1 parent fa9efe5 commit e20562c

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

src/GeneralAction.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,27 @@ void GeneralAction::initialize(Layer* layer)
8585
updateDatasetNameAction();
8686

8787
connect(_layer->getImagesDataset().get(), &DatasetImpl::locationChanged, this, updateDatasetNameAction);
88+
89+
const auto showNotificationFlipX = [this]() -> void {
90+
static bool notificationShownFlipX = false;
91+
92+
if (!notificationShownFlipX) {
93+
notificationShownFlipX = true;
94+
_layer->getImageViewerPlugin().addNotification("Image is flipped horizontally for display purposes; the underlying data structure is not altered.");
95+
}
96+
};
97+
98+
const auto showNotificationFlipY = [this]() -> void {
99+
static bool notificationShownFlipY = false;
100+
101+
if (!notificationShownFlipY) {
102+
notificationShownFlipY = true;
103+
_layer->getImageViewerPlugin().addNotification("Image is flipped vertically for display purposes; the underlying data structure is not altered.");
104+
}
105+
};
106+
107+
connect(&_flipHorizontalAction, &ToggleAction::toggled, this, showNotificationFlipX);
108+
connect(&_flipVerticalAction, &ToggleAction::toggled, this, showNotificationFlipY);
88109
}
89110

90111
void GeneralAction::connectToPublicAction(WidgetAction* publicAction, bool recursive)

0 commit comments

Comments
 (0)