From 62db9f6ba76c91f2dcafea8662acfcc72c57acca Mon Sep 17 00:00:00 2001 From: Mnikolenko ProductEngine Date: Fri, 3 Apr 2015 12:48:20 +0300 Subject: [PATCH] MAINT-5041 FIXED Current Window snapshot option is restored. Hide height/width spinners when selecting this option. --- indra/newview/llpanelsnapshotinventory.cpp | 12 ++++++++++++ .../default/xui/en/panel_snapshot_inventory.xml | 4 ++++ 2 files changed, 16 insertions(+) diff --git a/indra/newview/llpanelsnapshotinventory.cpp b/indra/newview/llpanelsnapshotinventory.cpp index fee9e45424..a99e4c29ef 100755 --- a/indra/newview/llpanelsnapshotinventory.cpp +++ b/indra/newview/llpanelsnapshotinventory.cpp @@ -55,6 +55,8 @@ public: /*virtual*/ BOOL postBuild(); /*virtual*/ void onOpen(const LLSD& key); + void onResolutionCommit(LLUICtrl* ctrl); + private: /*virtual*/ std::string getWidthSpinnerName() const { return "inventory_snapshot_width"; } /*virtual*/ std::string getHeightSpinnerName() const { return "inventory_snapshot_height"; } @@ -80,6 +82,9 @@ BOOL LLPanelSnapshotInventory::postBuild() getChild(getWidthSpinnerName())->setAllowEdit(FALSE); getChild(getHeightSpinnerName())->setAllowEdit(FALSE); + getChild(getImageSizeComboName())->setCommitCallback(boost::bind(&LLPanelSnapshotInventory::onResolutionCommit, this, _1)); + + // Store settings at logout getImageSizeComboBox()->setCurrentByIndex(gSavedSettings.getS32("LastSnapshotToInventoryResolution")); getWidthSpinner()->setValue(gSavedSettings.getS32("LastSnapshotToInventoryWidth")); @@ -111,6 +116,13 @@ void LLPanelSnapshotInventory::updateControls(const LLSD& info) getChild("save_btn")->setEnabled(have_snapshot); } +void LLPanelSnapshotInventory::onResolutionCommit(LLUICtrl* ctrl) +{ + BOOL current_window_selected = (getChild(getImageSizeComboName())->getCurrentIndex() == 3); + getChild(getWidthSpinnerName())->setVisible(!current_window_selected); + getChild(getHeightSpinnerName())->setVisible(!current_window_selected); +} + void LLPanelSnapshotInventory::onSend() { LLFloaterSnapshot::saveTexture(); diff --git a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml index 20477a2652..5ed42f4c2a 100755 --- a/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml +++ b/indra/newview/skins/default/xui/en/panel_snapshot_inventory.xml @@ -59,6 +59,10 @@ label="Large (512x512)" name="Large(512x512)" value="[i512,i512]" /> +