Skip to content

Commit b4c0047

Browse files
committed
Selection of a column automatically activate the right tab on the right. this refs #337
1 parent bc5bcbc commit b4c0047

File tree

3 files changed

+65
-35
lines changed

3 files changed

+65
-35
lines changed

notebooks/__code/metadata_overlapping_images/metadata_overlapping_images.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,11 @@ def table_widget_cell_clicked(self, row, column):
207207
o_metadata_table = MetadataTableHandler(parent=self)
208208
o_metadata_table.cell_clicked(row, column)
209209

210+
def table_widget_selection_changed(self):
211+
column = self.ui.tableWidget.currentColumn()
212+
o_metadata_table = MetadataTableHandler(parent=self)
213+
o_metadata_table.cell_clicked(-1, column)
214+
210215
def previous_image_button_clicked(self):
211216
self.change_slider(offset=-1)
212217
self.update_metadata_pyqt_ui()

notebooks/metadata_overlapping_images.ipynb

Lines changed: 41 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,49 @@
3838
},
3939
{
4040
"cell_type": "code",
41-
"execution_count": 9,
41+
"execution_count": 1,
4242
"metadata": {
4343
"run_control": {
4444
"frozen": false,
4545
"read_only": false
4646
}
4747
},
4848
"outputs": [
49+
{
50+
"data": {
51+
"text/html": [
52+
"\n",
53+
"<style type=\"text/css\">\n",
54+
".jupyter-widgets select option {font-family: \"Lucida Console\", Monaco, monospace;}\n",
55+
".jupyter-widgets select {width: 98%;}\n",
56+
"div.output_subarea {padding: 0px;}\n",
57+
"div.output_subarea > div {margin: 0.4em;}\n",
58+
"</style>\n"
59+
],
60+
"text/plain": [
61+
"<IPython.core.display.HTML object>"
62+
]
63+
},
64+
"metadata": {},
65+
"output_type": "display_data"
66+
},
67+
{
68+
"data": {
69+
"text/html": [
70+
"\n",
71+
"<style type=\"text/css\">\n",
72+
".jupyter-widgets select option {font-family: \"Lucida Console\", Monaco, monospace;}\n",
73+
"div.output_subarea {padding: 0px;}\n",
74+
"div.output_subarea > div {margin: 0.4em;}\n",
75+
"</style>\n"
76+
],
77+
"text/plain": [
78+
"<IPython.core.display.HTML object>"
79+
]
80+
},
81+
"metadata": {},
82+
"output_type": "display_data"
83+
},
4984
{
5085
"data": {
5186
"text/html": [
@@ -213,7 +248,7 @@
213248
"<IPython.core.display.HTML object>"
214249
]
215250
},
216-
"execution_count": 9,
251+
"execution_count": 1,
217252
"metadata": {},
218253
"output_type": "execute_result"
219254
}
@@ -242,7 +277,7 @@
242277
},
243278
{
244279
"cell_type": "code",
245-
"execution_count": 10,
280+
"execution_count": null,
246281
"metadata": {
247282
"run_control": {
248283
"frozen": false,
@@ -268,7 +303,7 @@
268303
},
269304
{
270305
"cell_type": "code",
271-
"execution_count": 11,
306+
"execution_count": null,
272307
"metadata": {
273308
"run_control": {
274309
"frozen": false,
@@ -295,41 +330,14 @@
295330
},
296331
{
297332
"cell_type": "code",
298-
"execution_count": 12,
333+
"execution_count": null,
299334
"metadata": {
300335
"run_control": {
301336
"frozen": false,
302337
"read_only": false
303338
}
304339
},
305-
"outputs": [
306-
{
307-
"data": {
308-
"text/html": [
309-
"<span style=\"font-size: 20px; color:blue\">Check UI that popped up (maybe hidden behind this browser!)</span>"
310-
],
311-
"text/plain": [
312-
"<IPython.core.display.HTML object>"
313-
]
314-
},
315-
"metadata": {},
316-
"output_type": "display_data"
317-
},
318-
{
319-
"data": {
320-
"application/vnd.jupyter.widget-view+json": {
321-
"model_id": "0c3af3f0892d4d61851f045f50528954",
322-
"version_major": 2,
323-
"version_minor": 0
324-
},
325-
"text/plain": [
326-
"Output()"
327-
]
328-
},
329-
"metadata": {},
330-
"output_type": "display_data"
331-
}
332-
],
340+
"outputs": [],
333341
"source": [
334342
"# o_profile = MetadataOverlappingImagesUi(working_dir=system.System.get_working_dir(),\n",
335343
"# data_dict=o_selection.data_dict['sample'],\n",

notebooks/ui/ui_metadata_overlapping_images.ui

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@
667667
<bool>true</bool>
668668
</property>
669669
<property name="currentIndex">
670-
<number>2</number>
670+
<number>0</number>
671671
</property>
672672
<widget class="QWidget" name="page">
673673
<property name="geometry">
@@ -688,7 +688,7 @@
688688
<string>Enable</string>
689689
</property>
690690
<property name="checked">
691-
<bool>true</bool>
691+
<bool>false</bool>
692692
</property>
693693
</widget>
694694
</item>
@@ -3495,6 +3495,22 @@
34953495
</hint>
34963496
</hints>
34973497
</connection>
3498+
<connection>
3499+
<sender>tableWidget</sender>
3500+
<signal>itemSelectionChanged()</signal>
3501+
<receiver>MainWindow</receiver>
3502+
<slot>table_widget_selection_changed()</slot>
3503+
<hints>
3504+
<hint type="sourcelabel">
3505+
<x>1099</x>
3506+
<y>539</y>
3507+
</hint>
3508+
<hint type="destinationlabel">
3509+
<x>1112</x>
3510+
<y>605</y>
3511+
</hint>
3512+
</hints>
3513+
</connection>
34983514
</connections>
34993515
<slots>
35003516
<slot>help_button_clicked()</slot>
@@ -3552,5 +3568,6 @@
35523568
<slot>metadata_3_suffix_prefix_changed()</slot>
35533569
<slot>metadata_4_suffix_prefix_changed()</slot>
35543570
<slot>table_widget_cell_clicked()</slot>
3571+
<slot>table_widget_selection_changed()</slot>
35553572
</slots>
35563573
</ui>

0 commit comments

Comments
 (0)