mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
UI restructure: always display pictures for displayed dive
The only time this is ever wrong is in print mode, so let's never show pictures in print mode. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
635a7ab771
commit
ce47683de8
3 changed files with 8 additions and 6 deletions
|
@ -32,7 +32,7 @@ SPixmap scaleImages(const QString &s)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DivePictureModel::updateDivePictures(int divenr)
|
void DivePictureModel::updateDivePictures()
|
||||||
{
|
{
|
||||||
if (numberOfPictures != 0) {
|
if (numberOfPictures != 0) {
|
||||||
beginRemoveRows(QModelIndex(), 0, numberOfPictures - 1);
|
beginRemoveRows(QModelIndex(), 0, numberOfPictures - 1);
|
||||||
|
@ -40,15 +40,14 @@ void DivePictureModel::updateDivePictures(int divenr)
|
||||||
endRemoveRows();
|
endRemoveRows();
|
||||||
}
|
}
|
||||||
|
|
||||||
struct dive *d = get_dive(divenr);
|
numberOfPictures = dive_get_picture_count(&displayed_dive);
|
||||||
numberOfPictures = dive_get_picture_count(d);
|
if (numberOfPictures == 0) {
|
||||||
if (!d || numberOfPictures == 0) {
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
stringPixmapCache.clear();
|
stringPixmapCache.clear();
|
||||||
QStringList pictures;
|
QStringList pictures;
|
||||||
FOR_EACH_PICTURE (d) {
|
FOR_EACH_PICTURE (&displayed_dive) {
|
||||||
stringPixmapCache[QString(picture->filename)].picture = picture;
|
stringPixmapCache[QString(picture->filename)].picture = picture;
|
||||||
pictures.push_back(QString(picture->filename));
|
pictures.push_back(QString(picture->filename));
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,7 +18,7 @@ public:
|
||||||
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||||
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
virtual QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
||||||
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||||
void updateDivePictures(int divenr);
|
void updateDivePictures();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DivePictureModel();
|
DivePictureModel();
|
||||||
|
|
|
@ -1343,6 +1343,9 @@ void ProfileWidget2::keyEscAction()
|
||||||
|
|
||||||
void ProfileWidget2::plotPictures()
|
void ProfileWidget2::plotPictures()
|
||||||
{
|
{
|
||||||
|
if (printMode)
|
||||||
|
return;
|
||||||
|
|
||||||
qDeleteAll(pictures);
|
qDeleteAll(pictures);
|
||||||
pictures.clear();
|
pictures.clear();
|
||||||
double x, y, lastX = -1.0, lastY = -1.0;
|
double x, y, lastX = -1.0, lastY = -1.0;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue