mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-05-04 00:45:46 +08:00
Ref T345, in view added acceptRowSelection
This commit is contained in:
@@ -25,7 +25,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
const CApplicationInfoList others = CApplicationInfoList::fromOtherSwiftVersionsFromDataDirectories();
|
const CApplicationInfoList others = CApplicationInfoList::fromOtherSwiftVersionsFromDataDirectories();
|
||||||
this->updateContainer(others);
|
this->updateContainer(others);
|
||||||
m_acceptRowSelected = others.size() > 0;
|
m_acceptRowSelection = others.size() > 0;
|
||||||
return others.size();
|
return others.size();
|
||||||
}
|
}
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ namespace BlackGui
|
|||||||
{
|
{
|
||||||
m_menus |= MenuClear;
|
m_menus |= MenuClear;
|
||||||
this->menuRemoveItems(MenuRefresh | MenuBackend | MenuToggleSelectionMode);
|
this->menuRemoveItems(MenuRefresh | MenuBackend | MenuToggleSelectionMode);
|
||||||
m_acceptRowSelected = true;
|
m_acceptRowSelection = true;
|
||||||
this->standardInit(new CStatusMessageListModel(this));
|
this->standardInit(new CStatusMessageListModel(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1712,7 +1712,7 @@ namespace BlackGui
|
|||||||
template <class ModelClass, class ContainerType, class ObjectType>
|
template <class ModelClass, class ContainerType, class ObjectType>
|
||||||
void CViewBase<ModelClass, ContainerType, ObjectType>::ps_rowSelected(const QModelIndex &index)
|
void CViewBase<ModelClass, ContainerType, ObjectType>::ps_rowSelected(const QModelIndex &index)
|
||||||
{
|
{
|
||||||
if (!m_acceptRowSelected) { return; }
|
if (!m_acceptRowSelection) { return; }
|
||||||
if (!index.isValid()) { return; }
|
if (!index.isValid()) { return; }
|
||||||
emit objectSelected(CVariant::fromValue(at(index)));
|
emit objectSelected(CVariant::fromValue(at(index)));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -250,6 +250,9 @@ namespace BlackGui
|
|||||||
//! Accept double click selection
|
//! Accept double click selection
|
||||||
void acceptDoubleClickSelection(bool accept) { m_acceptDoubleClickSelection = accept; }
|
void acceptDoubleClickSelection(bool accept) { m_acceptDoubleClickSelection = accept; }
|
||||||
|
|
||||||
|
//! Accept row selection
|
||||||
|
void acceptRowSelection(bool accept) { m_acceptRowSelection = accept; }
|
||||||
|
|
||||||
//! Remove given menu items
|
//! Remove given menu items
|
||||||
void menuRemoveItems(Menu menusToRemove);
|
void menuRemoveItems(Menu menusToRemove);
|
||||||
|
|
||||||
@@ -487,7 +490,7 @@ namespace BlackGui
|
|||||||
bool m_showingLoadIndicator = false; //!< showing loading indicator
|
bool m_showingLoadIndicator = false; //!< showing loading indicator
|
||||||
bool m_enabledLoadIndicator = true; //!< loading indicator enabled/disabled
|
bool m_enabledLoadIndicator = true; //!< loading indicator enabled/disabled
|
||||||
bool m_acceptClickSelection = false; //!< clicked
|
bool m_acceptClickSelection = false; //!< clicked
|
||||||
bool m_acceptRowSelected = false; //!< selection changed
|
bool m_acceptRowSelection = false; //!< selection changed
|
||||||
bool m_acceptDoubleClickSelection = false; //!< double clicked
|
bool m_acceptDoubleClickSelection = false; //!< double clicked
|
||||||
bool m_displayAutomatically = true; //!< display directly when loaded
|
bool m_displayAutomatically = true; //!< display directly when loaded
|
||||||
bool m_enableDeleteSelectedRows = false; //!< selected rows can be deleted
|
bool m_enableDeleteSelectedRows = false; //!< selected rows can be deleted
|
||||||
|
|||||||
Reference in New Issue
Block a user