Commit e954a7da authored by d_beck26's avatar d_beck26

Merge branch 'develop' into 356 for testing

parents b549cb93 febc77b4
......@@ -941,6 +941,9 @@ class InputManager(QtWidgets.QWidget):
# create all resources
ico_rename = QIcon("resources/pencil.png")
pix_loc = QtWidgets.qApp.style().standardPixmap(QtWidgets.QStyle.SP_DialogOpenButton)
ico_loc = QIcon(pix_loc)
pix_reload = QtWidgets.qApp.style().standardPixmap(QtWidgets.QStyle.SP_BrowserReload)
ico_reload = QIcon(pix_reload)
......@@ -966,6 +969,11 @@ class InputManager(QtWidgets.QWidget):
self.pb_remove.setToolTip("Remove")
self.hbox2.addWidget(self.pb_remove)
self.pb_loc = QtWidgets.QPushButton(ico_loc, "")
self.pb_loc.setFixedSize(30, 30)
self.pb_loc.setToolTip("Change Location")
self.hbox2.addWidget(self.pb_loc)
self.pb_reload = QtWidgets.QPushButton(ico_reload, "")
self.pb_reload.setFixedSize(30, 30)
self.pb_reload.setToolTip("Reload")
......@@ -1034,6 +1042,7 @@ class InputManager(QtWidgets.QWidget):
# connect the buttons
self.pb_rename.clicked.connect(self.onRename, Qt.QueuedConnection)
self.pb_loc.clicked.connect(self.changeLocation, Qt.QueuedConnection)
self.pb_reload.clicked.connect(self.reload, Qt.QueuedConnection)
self.pb_up.clicked.connect(lambda: self.manager.moveUp(self.id), Qt.QueuedConnection)
self.pb_down.clicked.connect(lambda: self.manager.moveDown(self.id), Qt.QueuedConnection)
......@@ -1092,6 +1101,27 @@ class InputManager(QtWidgets.QWidget):
else:
self.setUsage(usedBy[:-2])
def changeLocation(self):
type = self.getType()
if type == "LMDB":
filter = "LMDB (*.mdb)"
elif type == "LEVELDB":
filter = "LEVELDB (CURRENT *.ldb)"
elif type == "HDF5TXT":
filter = "HDF5TXT (*.txt)"
else:
filter = "ALL"
path = QtWidgets.QFileDialog.getOpenFileName(self, "Select the new location", QDir.homePath(), filter)[0]
if len(path) == 0:
return
if type == "LMDB" or type == "LEVELDB":
path = os.path.dirname(path) + os.path.sep
self.manager.dict["dblist"][self.id]["path"] = path
self.dbo.setDB(path, type)
self.manager.updateListWidget()
"""
Reload this database widget by opening it again and in case of a HDF5TXT rehashing it. If the file was
changed outside of Barista, a warning is shown.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment