Skip to content

Commit 792adc1

Browse files
committed
fix: action button behavior in uploads panel
1 parent d440633 commit 792adc1

4 files changed

Lines changed: 16 additions & 29 deletions

File tree

CHANGELOG

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- fix: create a new group if when no group available to add datasets to
55
- fix: cache download resource file size
66
- fix: action button behavior in downloads panel (#94)
7+
- fix: action button behavior in uploads panel
78
- enh: allow sharing individual datasets instead of collections (#32)
89
- enh: add preview option for dataset description in upload dialog (#52)
910
- enh: introduce write lock for eternal job updates

dcoraid/gui/panel_uploads/widget_tablecell_actions.py renamed to dcoraid/gui/panel_uploads/widget_actions_upload.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from PyQt6 import uic, QtCore, QtWidgets
55

66

7-
class TableCellActions(QtWidgets.QWidget):
7+
class TableCellActionsUpload(QtWidgets.QWidget):
88
abort_job = QtCore.pyqtSignal(str)
99
delete_job = QtCore.pyqtSignal(str)
1010

@@ -13,9 +13,9 @@ def __init__(self, job, *args, **kwargs):
1313
1414
Used for the "Running Uploads" table in the "Uploads" tab.
1515
"""
16-
super(TableCellActions, self).__init__(*args, **kwargs)
16+
super(TableCellActionsUpload, self).__init__(*args, **kwargs)
1717
ref_ui = resources.files(
18-
"dcoraid.gui.panel_uploads") / "widget_tablecell_actions.ui"
18+
"dcoraid.gui.panel_uploads") / "widget_actions_upload.ui"
1919
with resources.as_file(ref_ui) as path_ui:
2020
uic.loadUi(path_ui, self)
2121

dcoraid/gui/panel_uploads/widget_tablecell_actions.ui renamed to dcoraid/gui/panel_uploads/widget_actions_upload.ui

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@
3838
<string>d</string>
3939
</property>
4040
<property name="icon">
41-
<iconset theme="trash">
42-
<normaloff>.</normaloff>.</iconset>
41+
<iconset theme="trash"/>
4342
</property>
4443
</widget>
4544
</item>
@@ -52,8 +51,7 @@
5251
<string>a</string>
5352
</property>
5453
<property name="icon">
55-
<iconset theme="ban">
56-
<normaloff>.</normaloff>.</iconset>
54+
<iconset theme="ban"/>
5755
</property>
5856
</widget>
5957
</item>
@@ -66,8 +64,7 @@
6664
<string>e</string>
6765
</property>
6866
<property name="icon">
69-
<iconset theme="exclamation-triangle">
70-
<normaloff>.</normaloff>.</iconset>
67+
<iconset theme="exclamation-triangle"/>
7168
</property>
7269
</widget>
7370
</item>
@@ -80,8 +77,7 @@
8077
<string>r</string>
8178
</property>
8279
<property name="icon">
83-
<iconset theme="redo">
84-
<normaloff>.</normaloff>.</iconset>
80+
<iconset theme="redo"/>
8581
</property>
8682
</widget>
8783
</item>
@@ -94,24 +90,10 @@
9490
<string>v</string>
9591
</property>
9692
<property name="icon">
97-
<iconset theme="eye">
98-
<normaloff>.</normaloff>.</iconset>
93+
<iconset theme="eye"/>
9994
</property>
10095
</widget>
10196
</item>
102-
<item>
103-
<spacer name="horizontalSpacer">
104-
<property name="orientation">
105-
<enum>Qt::Horizontal</enum>
106-
</property>
107-
<property name="sizeHint" stdset="0">
108-
<size>
109-
<width>0</width>
110-
<height>0</height>
111-
</size>
112-
</property>
113-
</spacer>
114-
</item>
11597
</layout>
11698
</widget>
11799
<resources/>

dcoraid/gui/panel_uploads/widget_upload.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
from . import circle_mgr
2323
from .dlg_upload import NoCircleSelectedError, UploadDialog
24-
from .widget_tablecell_actions import TableCellActions
24+
from .widget_actions_upload import TableCellActionsUpload
2525

2626

2727
class UploadWidget(QtWidgets.QWidget):
@@ -404,6 +404,8 @@ def __init__(self, *args, **kwargs):
404404
0, QtWidgets.QHeaderView.ResizeMode.ResizeToContents)
405405
header.setSectionResizeMode(
406406
1, QtWidgets.QHeaderView.ResizeMode.Stretch)
407+
header.setSectionResizeMode(
408+
5, QtWidgets.QHeaderView.ResizeMode.ResizeToContents)
407409

408410
@property
409411
def jobs(self):
@@ -526,16 +528,18 @@ def set_label_item(self, row, col, label):
526528
item.setToolTip(label)
527529

528530
def set_actions_item(self, row, col, job):
529-
"""Set/Create a TableCellActions widget in the table
531+
"""Set/Create a TableCellActionsUpload widget in the table
530532
531533
Refreshes the widget and also connects signals.
532534
"""
533535
wid = self.cellWidget(row, col)
534536
if wid is None:
535-
wid = TableCellActions(job, parent=self)
537+
wid = TableCellActionsUpload(job, parent=self)
536538
wid.delete_job.connect(self.on_job_delete)
537539
wid.abort_job.connect(self.on_job_abort)
538540
self.setCellWidget(row, col, wid)
541+
else:
542+
wid.job = job
539543
wid.refresh_visibility(job)
540544

541545

0 commit comments

Comments
 (0)