diff --git a/ProfileInterface.cpp b/ProfileInterface.cpp index 6dfc291..cbc7cff 100755 --- a/ProfileInterface.cpp +++ b/ProfileInterface.cpp @@ -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() { return selectedWidgts; diff --git a/ProfileInterface.h b/ProfileInterface.h index 9d9a9d1..692d888 100755 --- a/ProfileInterface.h +++ b/ProfileInterface.h @@ -47,6 +47,8 @@ public: void setProfileFolder(QString folder, QString profile); void settingsApplied(int contentMode, QString language); void setupProfileInterface(); + void disableSelected(); + void enableSelected(); int selectedWidgets(); ~ProfileInterface(); diff --git a/SnapmaticWidget.cpp b/SnapmaticWidget.cpp index 4dfcbb4..8539b8f 100755 --- a/SnapmaticWidget.cpp +++ b/SnapmaticWidget.cpp @@ -266,36 +266,38 @@ void SnapmaticWidget::adjustTextColor() } } -void 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() +bool SnapmaticWidget::makePictureHidden() { SnapmaticPicture *picture = (SnapmaticPicture*)smpic; if (picture->setPictureHidden()) { - makePictureHidden(); + picPath = picture->getPictureFileName(); adjustTextColor(); + return true; } + return false; } -void SnapmaticWidget::makePictureVisibleSlot() +bool SnapmaticWidget::makePictureVisible() { SnapmaticPicture *picture = (SnapmaticPicture*)smpic; if (picture->setPictureVisible()) { - makePictureVisible(); + picPath = picture->getPictureFileName(); adjustTextColor(); + return true; } + return false; +} + +void SnapmaticWidget::makePictureHiddenSlot() +{ + makePictureHidden(); +} + +void SnapmaticWidget::makePictureVisibleSlot() +{ + makePictureVisible(); } bool SnapmaticWidget::isSelected() diff --git a/SnapmaticWidget.h b/SnapmaticWidget.h index 00baf49..a890bef 100755 --- a/SnapmaticWidget.h +++ b/SnapmaticWidget.h @@ -44,6 +44,8 @@ public: void setSnapmaticPicture(SnapmaticPicture *picture); void setSelectionMode(bool selectionMode); void setSelected(bool isSelected); + bool makePictureVisible(); + bool makePictureHidden(); SnapmaticPicture *getPicture(); QString getPicturePath(); QString getWidgetType(); @@ -61,10 +63,10 @@ private slots: void pictureSelected(); void selectAllWidgets(); void deselectAllWidgets(); - void makePictureHiddenSlot(); - void makePictureVisibleSlot(); void dialogNextPictureRequested(); void dialogPreviousPictureRequested(); + void makePictureVisibleSlot(); + void makePictureHiddenSlot(); protected: bool eventFilter(QObject *obj, QEvent *ev); @@ -72,8 +74,6 @@ protected: void mouseReleaseEvent(QMouseEvent *ev); void mousePressEvent(QMouseEvent *ev); void contextMenuEvent(QContextMenuEvent *ev); - void makePictureVisible(); - void makePictureHidden(); private: ProfileDatabase *profileDB; diff --git a/UserInterface.cpp b/UserInterface.cpp index 92d3c80..682afb7 100755 --- a/UserInterface.cpp +++ b/UserInterface.cpp @@ -453,3 +453,19 @@ void UserInterface::on_actionSelect_GTA_Folder_triggered() 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(); + } +} diff --git a/UserInterface.h b/UserInterface.h index b2dd941..9f9a74a 100755 --- a/UserInterface.h +++ b/UserInterface.h @@ -58,6 +58,8 @@ private slots: void on_action_Import_triggered(); void on_actionOpen_File_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); private: diff --git a/res/gta5sync_de.qm b/res/gta5sync_de.qm index 30a8382..bc887ee 100755 Binary files a/res/gta5sync_de.qm and b/res/gta5sync_de.qm differ diff --git a/res/gta5sync_de.ts b/res/gta5sync_de.ts index db76498..f25ea97 100755 --- a/res/gta5sync_de.ts +++ b/res/gta5sync_de.ts @@ -1268,12 +1268,14 @@ Exportieren als:</translation> <translation>Bearbei&ten</translation> </message> <message> + <location filename="../SnapmaticWidget.cpp" line="201"/> <source>Enable &In-game</source> - <translation type="vanished">&Im Spiel aktivieren</translation> + <translation>&Im Spiel aktivieren</translation> </message> <message> + <location filename="../SnapmaticWidget.cpp" line="205"/> <source>Disable &In-game</source> - <translation type="vanished">&Im Spiel deaktivieren</translation> + <translation>&Im Spiel deaktivieren</translation> </message> <message> <location filename="../SnapmaticWidget.cpp" line="207"/> @@ -1288,16 +1290,6 @@ Exportieren als:</translation> <source>Export as &GTA Snapmatic</source> <translation type="obsolete">Exportiere als &GTA Snapmatic</translation> </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> <location filename="../SnapmaticWidget.cpp" line="208"/> <source>Export as &JPG picture...</source> @@ -1565,17 +1557,8 @@ Exportieren als:</translation> </message> <message> <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> - <translation type="vanished">Im Spiel aktivier&en</translation> + <translation>Im Spiel aktivier&en</translation> </message> <message> <location filename="../UserInterface.ui" line="333"/> @@ -1583,8 +1566,9 @@ Exportieren als:</translation> <translation>Umschalt+E</translation> </message> <message> + <location filename="../UserInterface.ui" line="338"/> <source>&Disable In-game</source> - <translation type="vanished">Im Spiel &deaktivieren</translation> + <translation>Im Spiel &deaktivieren</translation> </message> <message> <location filename="../UserInterface.ui" line="341"/>