[DbManager] give materialized views their own icon

This commit is contained in:
Sebastian Dietrich 2016-01-22 22:42:01 +01:00 committed by Giuseppe Sucameli
parent 50878114a7
commit 990261331d
3 changed files with 6 additions and 1 deletions

View File

@ -227,6 +227,7 @@ class TableItem(TreeItem):
if not hasattr(TableItem, 'tableIcon'): if not hasattr(TableItem, 'tableIcon'):
TableItem.tableIcon = QIcon(":/db_manager/icons/table.png") TableItem.tableIcon = QIcon(":/db_manager/icons/table.png")
TableItem.viewIcon = QIcon(":/db_manager/icons/view.png") TableItem.viewIcon = QIcon(":/db_manager/icons/view.png")
TableItem.viewMaterializedIcon = QIcon(":/db_manager/icons/view_materialized.png")
TableItem.layerPointIcon = QIcon(":/db_manager/icons/layer_point.png") TableItem.layerPointIcon = QIcon(":/db_manager/icons/layer_point.png")
TableItem.layerLineIcon = QIcon(":/db_manager/icons/layer_line.png") TableItem.layerLineIcon = QIcon(":/db_manager/icons/layer_line.png")
TableItem.layerPolygonIcon = QIcon(":/db_manager/icons/layer_polygon.png") TableItem.layerPolygonIcon = QIcon(":/db_manager/icons/layer_polygon.png")
@ -257,7 +258,10 @@ class TableItem(TreeItem):
return self.layerRasterIcon return self.layerRasterIcon
if self.getItemData().isView: if self.getItemData().isView:
return self.viewIcon if hasattr(self.getItemData(), '_relationType') and self.getItemData()._relationType == 'm':
return self.viewMaterializedIcon
else:
return self.viewIcon
return self.tableIcon return self.tableIcon
def path(self): def path(self):

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 B

View File

@ -13,6 +13,7 @@
<file>icons/user.xpm</file> <file>icons/user.xpm</file>
<file>icons/users.xpm</file> <file>icons/users.xpm</file>
<file>icons/view.png</file> <file>icons/view.png</file>
<file>icons/view_materialized.png</file>
<file alias="warning">icons/warning-20px.png</file> <file alias="warning">icons/warning-20px.png</file>
<file>icons/plugged.png</file> <file>icons/plugged.png</file>
<file>icons/unplugged.png</file> <file>icons/unplugged.png</file>