Skip to content

Commit

Permalink
[DbManager] give materialized views their own icon
Browse files Browse the repository at this point in the history
  • Loading branch information
SebDieBln authored and brushtyler committed Jan 26, 2016
1 parent 5087811 commit 9902613
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion python/plugins/db_manager/db_model.py
Expand Up @@ -227,6 +227,7 @@ def __init__(self, table, parent):
if not hasattr(TableItem, 'tableIcon'):
TableItem.tableIcon = QIcon(":/db_manager/icons/table.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.layerLineIcon = QIcon(":/db_manager/icons/layer_line.png")
TableItem.layerPolygonIcon = QIcon(":/db_manager/icons/layer_polygon.png")
Expand Down Expand Up @@ -257,7 +258,10 @@ def icon(self):
return self.layerRasterIcon

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

def path(self):
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions python/plugins/db_manager/resources.qrc
Expand Up @@ -13,6 +13,7 @@
<file>icons/user.xpm</file>
<file>icons/users.xpm</file>
<file>icons/view.png</file>
<file>icons/view_materialized.png</file>
<file alias="warning">icons/warning-20px.png</file>
<file>icons/plugged.png</file>
<file>icons/unplugged.png</file>
Expand Down

0 comments on commit 9902613

Please sign in to comment.