Deselect All doesn't show always anymore when checkboxes are visible

This commit is contained in:
Rafael 2016-10-27 10:35:20 +02:00
parent 48c9507aeb
commit 569b192fe6
6 changed files with 22 additions and 4 deletions

View File

@ -117,7 +117,7 @@ void ProfileInterface::savegameLoaded(SavegameData *savegame, QString savegamePa
void ProfileInterface::savegameLoaded_f(SavegameData *savegame, QString savegamePath, bool inserted)
{
SavegameWidget *sgdWidget = new SavegameWidget();
SavegameWidget *sgdWidget = new SavegameWidget(this);
sgdWidget->setSavegameData(savegame, savegamePath);
sgdWidget->setContentMode(contentMode);
widgets[sgdWidget] = "SGD" + QFileInfo(savegamePath).fileName();
@ -138,7 +138,7 @@ void ProfileInterface::pictureLoaded(SnapmaticPicture *picture, QString pictureP
void ProfileInterface::pictureLoaded_f(SnapmaticPicture *picture, QString picturePath, bool inserted)
{
SnapmaticWidget *picWidget = new SnapmaticWidget(profileDB, crewDB, threadDB);
SnapmaticWidget *picWidget = new SnapmaticWidget(profileDB, crewDB, threadDB, this);
picWidget->setSnapmaticPicture(picture, picturePath);
picWidget->setContentMode(contentMode);
widgets[picWidget] = "PIC" + picture->getPictureSortStr();
@ -832,3 +832,8 @@ void ProfileInterface::settingsApplied(int _contentMode, QString language)
}
}
}
int ProfileInterface::selectedWidgets()
{
return selectedWidgts;
}

View File

@ -47,6 +47,7 @@ public:
void setProfileFolder(QString folder, QString profile);
void settingsApplied(int contentMode, QString language);
void setupProfileInterface();
int selectedWidgets();
~ProfileInterface();
public slots:

View File

@ -56,6 +56,7 @@ SavegameWidget::SavegameWidget(QWidget *parent) :
labelAutosaveStr = tr("AUTOSAVE - %1\n%2");
labelSaveStr = tr("SAVE %3 - %1\n%2");
snwgt = parent;
sgdPath = "";
sgdStr = "";
sgdata = 0;
@ -214,7 +215,11 @@ void SavegameWidget::contextMenuEvent(QContextMenuEvent *ev)
if (!ui->cbSelected->isChecked()) { contextMenu.addAction(tr("&Select"), this, SLOT(savegameSelected())); }
if (ui->cbSelected->isChecked()) { contextMenu.addAction(tr("&Deselect"), this, SLOT(savegameSelected())); }
contextMenu.addAction(tr("Select &All"), this, SLOT(selectAllWidgets()), QKeySequence::fromString("Ctrl+A"));
contextMenu.addAction(tr("&Deselect All"), this, SLOT(deselectAllWidgets()), QKeySequence::fromString("Ctrl+D"));
ProfileInterface *profileInterface = (ProfileInterface*)snwgt;
if (profileInterface->selectedWidgets() != 0)
{
contextMenu.addAction(tr("&Deselect All"), this, SLOT(deselectAllWidgets()), QKeySequence::fromString("Ctrl+D"));
}
}
else
{

View File

@ -70,6 +70,7 @@ private:
QString labelSaveStr;
QString sgdPath;
QString sgdStr;
QWidget *snwgt;
signals:
void savegameDeleted();

View File

@ -47,6 +47,7 @@ SnapmaticWidget::SnapmaticWidget(ProfileDatabase *profileDB, CrewDatabase *crewD
palette.setCurrentColorGroup(QPalette::Disabled);
highlightHiddenColor = palette.text().color();
snwgt = parent;
picPath = "";
picStr = "";
smpic = 0;
@ -216,7 +217,11 @@ void SnapmaticWidget::contextMenuEvent(QContextMenuEvent *ev)
if (!ui->cbSelected->isChecked()) { contextMenu.addAction(tr("&Select"), this, SLOT(pictureSelected())); }
if (ui->cbSelected->isChecked()) { contextMenu.addAction(tr("&Deselect"), this, SLOT(pictureSelected())); }
contextMenu.addAction(tr("Select &All"), this, SLOT(selectAllWidgets()), QKeySequence::fromString("Ctrl+A"));
contextMenu.addAction(tr("&Deselect All"), this, SLOT(deselectAllWidgets()), QKeySequence::fromString("Ctrl+D"));
ProfileInterface *profileInterface = (ProfileInterface*)snwgt;
if (profileInterface->selectedWidgets() != 0)
{
contextMenu.addAction(tr("&Deselect All"), this, SLOT(deselectAllWidgets()), QKeySequence::fromString("Ctrl+D"));
}
}
else
{

View File

@ -87,6 +87,7 @@ private:
QString picPath;
QString picTitl;
QString picStr;
QWidget *snwgt;
signals:
void pictureDeleted();