Make it possible for show and hide multiple pictures at once
This commit is contained in:
parent
a86eab43ff
commit
cc5813b273
8 changed files with 87 additions and 43 deletions
|
@ -833,6 +833,44 @@ void ProfileInterface::settingsApplied(int _contentMode, QString language)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ProfileInterface::enableSelected()
|
||||||
|
{
|
||||||
|
int fails = 0;
|
||||||
|
foreach (ProfileWidget *widget, widgets.keys())
|
||||||
|
{
|
||||||
|
if (widget->isSelected())
|
||||||
|
{
|
||||||
|
if (widget->getWidgetType() == "SnapmaticWidget")
|
||||||
|
{
|
||||||
|
SnapmaticWidget *snapmaticWidget = (SnapmaticWidget*)widget;
|
||||||
|
if (!snapmaticWidget->makePictureVisible())
|
||||||
|
{
|
||||||
|
fails++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void ProfileInterface::disableSelected()
|
||||||
|
{
|
||||||
|
int fails = 0;
|
||||||
|
foreach (ProfileWidget *widget, widgets.keys())
|
||||||
|
{
|
||||||
|
if (widget->isSelected())
|
||||||
|
{
|
||||||
|
if (widget->getWidgetType() == "SnapmaticWidget")
|
||||||
|
{
|
||||||
|
SnapmaticWidget *snapmaticWidget = (SnapmaticWidget*)widget;
|
||||||
|
if (!snapmaticWidget->makePictureHidden())
|
||||||
|
{
|
||||||
|
fails++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int ProfileInterface::selectedWidgets()
|
int ProfileInterface::selectedWidgets()
|
||||||
{
|
{
|
||||||
return selectedWidgts;
|
return selectedWidgts;
|
||||||
|
|
|
@ -47,6 +47,8 @@ public:
|
||||||
void setProfileFolder(QString folder, QString profile);
|
void setProfileFolder(QString folder, QString profile);
|
||||||
void settingsApplied(int contentMode, QString language);
|
void settingsApplied(int contentMode, QString language);
|
||||||
void setupProfileInterface();
|
void setupProfileInterface();
|
||||||
|
void disableSelected();
|
||||||
|
void enableSelected();
|
||||||
int selectedWidgets();
|
int selectedWidgets();
|
||||||
~ProfileInterface();
|
~ProfileInterface();
|
||||||
|
|
||||||
|
|
|
@ -266,36 +266,38 @@ void SnapmaticWidget::adjustTextColor()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SnapmaticWidget::makePictureHidden()
|
bool SnapmaticWidget::makePictureHidden()
|
||||||
{
|
|
||||||
QString newPicPath = QString(picPath + ".hidden");
|
|
||||||
picPath = newPicPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SnapmaticWidget::makePictureVisible()
|
|
||||||
{
|
|
||||||
QString newPicPath = QString(picPath).remove(picPath.length() - 7, 7);
|
|
||||||
picPath = newPicPath;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SnapmaticWidget::makePictureHiddenSlot()
|
|
||||||
{
|
{
|
||||||
SnapmaticPicture *picture = (SnapmaticPicture*)smpic;
|
SnapmaticPicture *picture = (SnapmaticPicture*)smpic;
|
||||||
if (picture->setPictureHidden())
|
if (picture->setPictureHidden())
|
||||||
{
|
{
|
||||||
makePictureHidden();
|
picPath = picture->getPictureFileName();
|
||||||
adjustTextColor();
|
adjustTextColor();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SnapmaticWidget::makePictureVisibleSlot()
|
bool SnapmaticWidget::makePictureVisible()
|
||||||
{
|
{
|
||||||
SnapmaticPicture *picture = (SnapmaticPicture*)smpic;
|
SnapmaticPicture *picture = (SnapmaticPicture*)smpic;
|
||||||
if (picture->setPictureVisible())
|
if (picture->setPictureVisible())
|
||||||
{
|
{
|
||||||
makePictureVisible();
|
picPath = picture->getPictureFileName();
|
||||||
adjustTextColor();
|
adjustTextColor();
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void SnapmaticWidget::makePictureHiddenSlot()
|
||||||
|
{
|
||||||
|
makePictureHidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
void SnapmaticWidget::makePictureVisibleSlot()
|
||||||
|
{
|
||||||
|
makePictureVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SnapmaticWidget::isSelected()
|
bool SnapmaticWidget::isSelected()
|
||||||
|
|
|
@ -44,6 +44,8 @@ public:
|
||||||
void setSnapmaticPicture(SnapmaticPicture *picture);
|
void setSnapmaticPicture(SnapmaticPicture *picture);
|
||||||
void setSelectionMode(bool selectionMode);
|
void setSelectionMode(bool selectionMode);
|
||||||
void setSelected(bool isSelected);
|
void setSelected(bool isSelected);
|
||||||
|
bool makePictureVisible();
|
||||||
|
bool makePictureHidden();
|
||||||
SnapmaticPicture *getPicture();
|
SnapmaticPicture *getPicture();
|
||||||
QString getPicturePath();
|
QString getPicturePath();
|
||||||
QString getWidgetType();
|
QString getWidgetType();
|
||||||
|
@ -61,10 +63,10 @@ private slots:
|
||||||
void pictureSelected();
|
void pictureSelected();
|
||||||
void selectAllWidgets();
|
void selectAllWidgets();
|
||||||
void deselectAllWidgets();
|
void deselectAllWidgets();
|
||||||
void makePictureHiddenSlot();
|
|
||||||
void makePictureVisibleSlot();
|
|
||||||
void dialogNextPictureRequested();
|
void dialogNextPictureRequested();
|
||||||
void dialogPreviousPictureRequested();
|
void dialogPreviousPictureRequested();
|
||||||
|
void makePictureVisibleSlot();
|
||||||
|
void makePictureHiddenSlot();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool eventFilter(QObject *obj, QEvent *ev);
|
bool eventFilter(QObject *obj, QEvent *ev);
|
||||||
|
@ -72,8 +74,6 @@ protected:
|
||||||
void mouseReleaseEvent(QMouseEvent *ev);
|
void mouseReleaseEvent(QMouseEvent *ev);
|
||||||
void mousePressEvent(QMouseEvent *ev);
|
void mousePressEvent(QMouseEvent *ev);
|
||||||
void contextMenuEvent(QContextMenuEvent *ev);
|
void contextMenuEvent(QContextMenuEvent *ev);
|
||||||
void makePictureVisible();
|
|
||||||
void makePictureHidden();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ProfileDatabase *profileDB;
|
ProfileDatabase *profileDB;
|
||||||
|
|
|
@ -453,3 +453,19 @@ void UserInterface::on_actionSelect_GTA_Folder_triggered()
|
||||||
on_cmdReload_clicked();
|
on_cmdReload_clicked();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UserInterface::on_action_Enable_In_game_triggered()
|
||||||
|
{
|
||||||
|
if (profileOpen)
|
||||||
|
{
|
||||||
|
profileUI->enableSelected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void UserInterface::on_action_Disable_In_game_triggered()
|
||||||
|
{
|
||||||
|
if (profileOpen)
|
||||||
|
{
|
||||||
|
profileUI->disableSelected();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -58,6 +58,8 @@ private slots:
|
||||||
void on_action_Import_triggered();
|
void on_action_Import_triggered();
|
||||||
void on_actionOpen_File_triggered();
|
void on_actionOpen_File_triggered();
|
||||||
void on_actionSelect_GTA_Folder_triggered();
|
void on_actionSelect_GTA_Folder_triggered();
|
||||||
|
void on_action_Enable_In_game_triggered();
|
||||||
|
void on_action_Disable_In_game_triggered();
|
||||||
void settingsApplied(int contentMode, QString language);
|
void settingsApplied(int contentMode, QString language);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
Binary file not shown.
|
@ -1268,12 +1268,14 @@ Exportieren als:</translation>
|
||||||
<translation>Bearbei&ten</translation>
|
<translation>Bearbei&ten</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
|
<location filename="../SnapmaticWidget.cpp" line="201"/>
|
||||||
<source>Enable &In-game</source>
|
<source>Enable &In-game</source>
|
||||||
<translation type="vanished">&Im Spiel aktivieren</translation>
|
<translation>&Im Spiel aktivieren</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
|
<location filename="../SnapmaticWidget.cpp" line="205"/>
|
||||||
<source>Disable &In-game</source>
|
<source>Disable &In-game</source>
|
||||||
<translation type="vanished">&Im Spiel deaktivieren</translation>
|
<translation>&Im Spiel deaktivieren</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../SnapmaticWidget.cpp" line="207"/>
|
<location filename="../SnapmaticWidget.cpp" line="207"/>
|
||||||
|
@ -1288,16 +1290,6 @@ Exportieren als:</translation>
|
||||||
<source>Export as &GTA Snapmatic</source>
|
<source>Export as &GTA Snapmatic</source>
|
||||||
<translation type="obsolete">Exportiere als &GTA Snapmatic</translation>
|
<translation type="obsolete">Exportiere als &GTA Snapmatic</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<location filename="../SnapmaticWidget.cpp" line="201"/>
|
|
||||||
<source>Show &In-game</source>
|
|
||||||
<translation>&Im Spiel anzeigen</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../SnapmaticWidget.cpp" line="205"/>
|
|
||||||
<source>Hide &In-game</source>
|
|
||||||
<translation>&Im Spiel ausblenden</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<location filename="../SnapmaticWidget.cpp" line="208"/>
|
<location filename="../SnapmaticWidget.cpp" line="208"/>
|
||||||
<source>Export as &JPG picture...</source>
|
<source>Export as &JPG picture...</source>
|
||||||
|
@ -1565,17 +1557,8 @@ Exportieren als:</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../UserInterface.ui" line="330"/>
|
<location filename="../UserInterface.ui" line="330"/>
|
||||||
<source>Show In-gam&e</source>
|
|
||||||
<translation>Im Spiel anzeig&en</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<location filename="../UserInterface.ui" line="338"/>
|
|
||||||
<source>Hid&e In-game</source>
|
|
||||||
<translation>Im Spiel ausblen&den</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
|
||||||
<source>&Enable In-game</source>
|
<source>&Enable In-game</source>
|
||||||
<translation type="vanished">Im Spiel aktivier&en</translation>
|
<translation>Im Spiel aktivier&en</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../UserInterface.ui" line="333"/>
|
<location filename="../UserInterface.ui" line="333"/>
|
||||||
|
@ -1583,8 +1566,9 @@ Exportieren als:</translation>
|
||||||
<translation>Umschalt+E</translation>
|
<translation>Umschalt+E</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
|
<location filename="../UserInterface.ui" line="338"/>
|
||||||
<source>&Disable In-game</source>
|
<source>&Disable In-game</source>
|
||||||
<translation type="vanished">Im Spiel &deaktivieren</translation>
|
<translation>Im Spiel &deaktivieren</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<location filename="../UserInterface.ui" line="341"/>
|
<location filename="../UserInterface.ui" line="341"/>
|
||||||
|
|
Loading…
Reference in a new issue