Skip to content
Snippets Groups Projects
Commit 0994ef19 authored by Ivo Peterek's avatar Ivo Peterek
Browse files

FIX: combobox changing from xLabel to funcLabel in one combobox #2

parent 41f4969c
No related branches found
No related tags found
No related merge requests found
# -*- coding: utf-8 -*-
import csv
# Form implementation generated from reading ui file 'navrh.ui'
#
# Created by: PyQt5 UI code generator 5.7
......@@ -7,9 +8,10 @@
# WARNING! All changes made in this file will be lost!
import glob
import os
import csv
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_TabWidget(object):
def __init__(self):
self.current_labels_dic = {'xLabel': None, 'funcLabel': None}
......@@ -542,19 +544,25 @@ class Ui_TabWidget(object):
if current_combo_box.currentText() in ['xLabel', 'funcLabel']:
if self.current_labels_dic[current_combo_box.currentText()] != current_combo_box:
tmp_key = None
if current_combo_box in self.current_labels_dic.values():
tmp_key = [k for k, v in self.current_labels_dic.items() if v == current_combo_box][0]
self.current_labels_dic[tmp_key] = None
self.current_labels_dic[current_combo_box.currentText()] = current_combo_box
for key, val in self.combobox_items_dic.items():
if key == current_combo_box:
continue
act_label = key.currentText()
if tmp_key is not None:
self.combobox_items_dic[key].append(tmp_key)
self.combobox_items_dic[key].remove(current_combo_box.currentText())
key.clear()
key.addItems(self.combobox_items_dic[key])
key.setCurrentIndex(key.findText(act_label))
#TODO: change from xLabel to funcLabel in one combobox
else:
if current_combo_box in self.current_labels_dic.values():
add_item = None
for key, val in self.current_labels_dic.items():
if val == current_combo_box:
add_item = key
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment