diff options
author | Armin Weatherwax | 2010-08-26 18:03:11 +0200 |
---|---|---|
committer | McCabe Maxsted | 2010-08-29 01:26:44 -0700 |
commit | 643ef4072a2387c8f8f5e2f3d6a801e5471bce18 (patch) | |
tree | 5fda5c8fba1ddd696a4cc2b031ea5acd29918d25 /linden | |
parent | Katharine Berry: Added an icon for WindLight settings. (diff) | |
download | meta-impy-643ef4072a2387c8f8f5e2f3d6a801e5471bce18.zip meta-impy-643ef4072a2387c8f8f5e2f3d6a801e5471bce18.tar.gz meta-impy-643ef4072a2387c8f8f5e2f3d6a801e5471bce18.tar.bz2 meta-impy-643ef4072a2387c8f8f5e2f3d6a801e5471bce18.tar.xz |
Katharine Berry:Double-clicking a WindLight notecard immediately applies the setting.
Diffstat (limited to 'linden')
-rw-r--r-- | linden/indra/newview/llinventorybridge.cpp | 59 | ||||
-rw-r--r-- | linden/indra/newview/llinventorybridge.h | 1 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/menu_inventory.xml | 8 |
3 files changed, 34 insertions, 34 deletions
diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp index efa0d20..db7a955 100644 --- a/linden/indra/newview/llinventorybridge.cpp +++ b/linden/indra/newview/llinventorybridge.cpp | |||
@@ -813,12 +813,6 @@ void LLItemBridge::performAction(LLFolderView* folder, LLInventoryModel* model, | |||
813 | folder_view_itemp->getListener()->pasteFromClipboard(); | 813 | folder_view_itemp->getListener()->pasteFromClipboard(); |
814 | return; | 814 | return; |
815 | } | 815 | } |
816 | else if ("load_windlight" == action) | ||
817 | { | ||
818 | LLInventoryItem* itemp = model->getItem(mUUID); | ||
819 | if(!itemp) return; | ||
820 | LLWLParamManager::instance()->loadPresetNotecard(itemp->getName(), itemp->getAssetUUID(), mUUID); | ||
821 | } | ||
822 | } | 816 | } |
823 | 817 | ||
824 | void LLItemBridge::selectItem() | 818 | void LLItemBridge::selectItem() |
@@ -828,6 +822,16 @@ void LLItemBridge::selectItem() | |||
828 | { | 822 | { |
829 | item->fetchFromServer(); | 823 | item->fetchFromServer(); |
830 | } | 824 | } |
825 | |||
826 | if (item && item->isComplete()) | ||
827 | { | ||
828 | bool is_windlight = (getName().length() > 2 && getName().compare(getName().length() - 3, 3, ".wl") == 0); | ||
829 | if(is_windlight) | ||
830 | { | ||
831 | LLWLParamManager::instance()->loadPresetNotecard(item->getName(), item->getAssetUUID(), mUUID); | ||
832 | } | ||
833 | } | ||
834 | |||
831 | } | 835 | } |
832 | 836 | ||
833 | void LLItemBridge::restoreItem() | 837 | void LLItemBridge::restoreItem() |
@@ -3060,7 +3064,9 @@ void LLNotecardBridge::openItem() | |||
3060 | LLViewerInventoryItem* item = getItem(); | 3064 | LLViewerInventoryItem* item = getItem(); |
3061 | if (item) | 3065 | if (item) |
3062 | { | 3066 | { |
3063 | open_notecard(item, getPrefix() + item->getName(), LLUUID::null, FALSE); | 3067 | bool is_windlight = (getName().length() > 2 && getName().compare(getName().length() - 3, 3, ".wl") == 0); |
3068 | if(!is_windlight) | ||
3069 | open_notecard(item, getPrefix() + item->getName(), LLUUID::null, FALSE); | ||
3064 | } | 3070 | } |
3065 | } | 3071 | } |
3066 | 3072 | ||
@@ -3087,43 +3093,32 @@ void LLNotecardBridge::buildContextMenu(LLMenuGL& menu, U32 flags) | |||
3087 | 3093 | ||
3088 | if(is_windlight) | 3094 | if(is_windlight) |
3089 | { | 3095 | { |
3090 | items.push_back(std::string("Use Windlight Settings")); | 3096 | items.push_back(std::string("Use WindLight Settings")); |
3097 | items.push_back(std::string("Edit WindLight Settings")); | ||
3091 | } | 3098 | } |
3092 | items.push_back(std::string("Properties")); | 3099 | items.push_back(std::string("Properties")); |
3093 | getClipboardEntries(true, items, disabled_items, flags); | 3100 | getClipboardEntries(true, items, disabled_items, flags); |
3094 | } | 3101 | } |
3095 | hideContextEntries(menu, items, disabled_items); | 3102 | hideContextEntries(menu, items, disabled_items); |
3096 | /* | 3103 | } |
3097 | -- | ||
3098 | |||
3099 | 3104 | ||
3105 | void LLNotecardBridge::performAction(LLFolderView* folder, LLInventoryModel* model, std::string action) | ||
3106 | { | ||
3107 | LLViewerInventoryItem* itemp = model->getItem(mUUID); | ||
3108 | if(!itemp) return; | ||
3100 | 3109 | ||
3101 | menuentry_vec_t items; | 3110 | if ("load_windlight" == action) |
3102 | menuentry_vec_t disabled_items; | ||
3103 | if(isItemInTrash()) | ||
3104 | { | 3111 | { |
3105 | addTrashContextMenuOptions(items, disabled_items); | 3112 | LLWLParamManager::instance()->loadPresetNotecard(itemp->getName(), itemp->getAssetUUID(), mUUID); |
3113 | } | ||
3114 | else if ("edit_windlight" == action) | ||
3115 | { | ||
3116 | open_notecard(itemp, getPrefix() + itemp->getName(), LLUUID::null, FALSE); | ||
3106 | } | 3117 | } |
3107 | else | 3118 | else |
3108 | { | 3119 | { |
3109 | bool is_windlight = (getName().length() > 2 && getName().compare(getName().length() - 3, 3, ".wl") == 0); | 3120 | LLItemBridge::performAction(folder, model, action); |
3110 | items.push_back(std::string("Share")); | ||
3111 | if (!canShare()) | ||
3112 | { | ||
3113 | disabled_items.push_back(std::string("Share")); | ||
3114 | } | ||
3115 | |||
3116 | addOpenRightClickMenuOption(items); | ||
3117 | if(is_windlight) | ||
3118 | { | ||
3119 | items.push_back(std::string("Use Windlight Settings")); | ||
3120 | } | ||
3121 | items.push_back(std::string("Properties")); | ||
3122 | |||
3123 | getClipboardEntries(true, items, disabled_items, flags); | ||
3124 | } | 3121 | } |
3125 | hide_context_entries(menu, items, disabled_items); | ||
3126 | */ | ||
3127 | } | 3122 | } |
3128 | 3123 | ||
3129 | LLUIImagePtr LLNotecardBridge::getIcon() const | 3124 | LLUIImagePtr LLNotecardBridge::getIcon() const |
diff --git a/linden/indra/newview/llinventorybridge.h b/linden/indra/newview/llinventorybridge.h index 2ad4b3a..b703d07 100644 --- a/linden/indra/newview/llinventorybridge.h +++ b/linden/indra/newview/llinventorybridge.h | |||
@@ -477,6 +477,7 @@ public: | |||
477 | virtual LLUIImagePtr getIcon() const; | 477 | virtual LLUIImagePtr getIcon() const; |
478 | virtual void openItem(); | 478 | virtual void openItem(); |
479 | virtual void buildContextMenu(LLMenuGL& menu, U32 flags); | 479 | virtual void buildContextMenu(LLMenuGL& menu, U32 flags); |
480 | virtual void performAction(LLFolderView* folder, LLInventoryModel* model, std::string action); | ||
480 | 481 | ||
481 | protected: | 482 | protected: |
482 | LLNotecardBridge(LLInventoryPanel* inventory, const LLUUID& uuid) : | 483 | LLNotecardBridge(LLInventoryPanel* inventory, const LLUUID& uuid) : |
diff --git a/linden/indra/newview/skins/default/xui/en-us/menu_inventory.xml b/linden/indra/newview/skins/default/xui/en-us/menu_inventory.xml index 8d5f1fe..2c837a2 100644 --- a/linden/indra/newview/skins/default/xui/en-us/menu_inventory.xml +++ b/linden/indra/newview/skins/default/xui/en-us/menu_inventory.xml | |||
@@ -141,10 +141,14 @@ | |||
141 | name="Open" width="128"> | 141 | name="Open" width="128"> |
142 | <on_click filter="" function="Inventory.DoToSelected" userdata="open" /> | 142 | <on_click filter="" function="Inventory.DoToSelected" userdata="open" /> |
143 | </menu_item_call> | 143 | </menu_item_call> |
144 | <menu_item_call bottom_delta="-18" height="18" label="Use Windlight Settings" left="0" mouse_opaque="true" | 144 | <menu_item_call bottom_delta="-18" height="18" label="Use WindLight Settings" left="0" mouse_opaque="true" |
145 | name="Use Windlight Settings" width="128"> | 145 | name="Use WindLight Settings" width="128"> |
146 | <on_click filter="" function="Inventory.DoToSelected" userdata="load_windlight" /> | 146 | <on_click filter="" function="Inventory.DoToSelected" userdata="load_windlight" /> |
147 | </menu_item_call> | 147 | </menu_item_call> |
148 | <menu_item_call bottom_delta="-18" height="18" label="Edit WindLight Settings" left="0" mouse_opaque="true" | ||
149 | name="Edit WindLight Settings" width="128"> | ||
150 | <on_click filter="" function="Inventory.DoToSelected" userdata="edit_windlight" /> | ||
151 | </menu_item_call> | ||
148 | <menu_item_call bottom_delta="-18" height="18" label="Properties" left="0" mouse_opaque="true" | 152 | <menu_item_call bottom_delta="-18" height="18" label="Properties" left="0" mouse_opaque="true" |
149 | name="Properties" width="128"> | 153 | name="Properties" width="128"> |
150 | <on_click filter="" function="Inventory.DoToSelected" userdata="properties" /> | 154 | <on_click filter="" function="Inventory.DoToSelected" userdata="properties" /> |