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: Bearbei&ten + Enable &In-game - &Im Spiel aktivieren + &Im Spiel aktivieren + Disable &In-game - &Im Spiel deaktivieren + &Im Spiel deaktivieren @@ -1288,16 +1290,6 @@ Exportieren als: Export as &GTA Snapmatic Exportiere als &GTA Snapmatic - - - Show &In-game - &Im Spiel anzeigen - - - - Hide &In-game - &Im Spiel ausblenden - Export as &JPG picture... @@ -1565,17 +1557,8 @@ Exportieren als: - Show In-gam&e - Im Spiel anzeig&en - - - - Hid&e In-game - Im Spiel ausblen&den - - &Enable In-game - Im Spiel aktivier&en + Im Spiel aktivier&en @@ -1583,8 +1566,9 @@ Exportieren als: Umschalt+E + &Disable In-game - Im Spiel &deaktivieren + Im Spiel &deaktivieren