Skip to content

Commit

Permalink
Update date and title display
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSAMPERE committed Oct 22, 2019
1 parent 523c802 commit dbce819
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions modules/results/display.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def show_results(self, api_results, pg_connections=dict()):
hheader.setSectionResizeMode(2, 3)

vheader = tbl_result.verticalHeader()

# Looping inside the table lines. For each of them, showing the title,
# abstract, geometry type, and a button that allow to add the data
# to the canvas.
Expand All @@ -150,11 +151,14 @@ def show_results(self, api_results, pg_connections=dict()):
btn_md_title.setToolTip(i.get("abstract", "")[:300])
# Insert it in column 1
tbl_result.setCellWidget(count, 0, btn_md_title)


# COLUMN 2 - Data last update
date_item = QTableWidgetItem(plg_tools.handle_date(i.get("_modified")))
date_item.setTextAlignment(Qt.AlignCenter)
tbl_result.setItem(count, 1, date_item)
lbl_date = QLabel(tbl_result)
lbl_date.setText(plg_tools.handle_date(i.get("_modified")))
lbl_date.setMargin(5)
lbl_date.setAlignment(Qt.AlignCenter)
tbl_result.setCellWidget(count, 1, lbl_date)

# COLUMN 3 - Geometry type
lbl_geom = QLabel(tbl_result)
Expand Down Expand Up @@ -464,6 +468,7 @@ def show_results(self, api_results, pg_connections=dict()):

# dimensions bis
hheader.setSectionResizeMode(3, 3)

vheader.setMinimumSectionSize(30)
vheader.setSectionResizeMode(3)
# method ending
Expand Down

0 comments on commit dbce819

Please sign in to comment.