Reloads actions on actions changed.
This commit is contained in:
@@ -36,7 +36,7 @@ namespace Cryville.Crtr.Browsing.UI {
|
||||
UnregisterManager();
|
||||
}
|
||||
void UnregisterManager() {
|
||||
Master.Actions.Unregister(_importAction);
|
||||
if (_importAction != null) Master.Actions.Unregister(_importAction);
|
||||
_manager.ItemChanged -= OnItemChanged;
|
||||
_manager.DirectoryChanged -= OnDirectoryChanged;
|
||||
}
|
||||
@@ -111,9 +111,19 @@ namespace Cryville.Crtr.Browsing.UI {
|
||||
_selectedItems.Add(id);
|
||||
var res = _manager[id];
|
||||
m_detailPanel.Load(res);
|
||||
m_actionBar.Load(this, Master.Actions.GetActions(res.GetType()).Except(_importActionArray));
|
||||
if (_selectedItems.Count == 1) {
|
||||
LoadActions(res);
|
||||
}
|
||||
}
|
||||
}
|
||||
internal override void OnActionsChanged() {
|
||||
if (_selectedItems.Count == 1) {
|
||||
LoadActions(_manager[_selectedItems.Single()]);
|
||||
}
|
||||
}
|
||||
void LoadActions(IResourceMeta res) {
|
||||
m_actionBar.Load(this, Master.Actions.GetActions(res.GetType()).Except(_importActionArray));
|
||||
}
|
||||
|
||||
public void OnPathClicked(int index) {
|
||||
_manager.ReturnToDirectory(index);
|
||||
|
Reference in New Issue
Block a user