subsurface/desktop-widgets/tab-widgets/TabDivePhotos.h
Berthold Stoeger 8cd191c271 desktop: store pointer to parent in tab-widgets
Make it possible for the individual tab-widgets to access the
parent widget. In principle this could have been done by
downcasting the pointer returned by parent(), but this makes
it explicit.

The goal here is to store information on the selection,
current dive, etc. without repeating it in every subwidget.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2023-04-16 20:23:59 +02:00

40 lines
862 B
C++

// SPDX-License-Identifier: GPL-2.0
#ifndef TAB_DIVE_PHOTOS_H
#define TAB_DIVE_PHOTOS_H
#include "TabBase.h"
namespace Ui {
class TabDivePhotos;
};
class DivePictureModel;
class TabDivePhotos : public TabBase {
Q_OBJECT
public:
TabDivePhotos(MainTab *parent);
~TabDivePhotos();
void updateData(const std::vector<dive *> &selection, dive *currentDive, int currentDC) override;
void clear() override;
protected:
void contextMenuEvent(QContextMenuEvent *ev) override;
private slots:
void addPhotosFromFile();
void addPhotosFromURL();
void removeAllPhotos();
void removeSelectedPhotos();
void recalculateSelectedThumbnails();
void openFolderOfSelectedFiles();
void changeZoomLevel(int delta);
void saveSubtitles();
private:
Ui::TabDivePhotos *ui;
DivePictureModel *divePictureModel;
QVector<QString> getSelectedFilenames() const;
};
#endif