Commit bfd28a97 authored by Samuel GAIST's avatar Samuel GAIST Committed by Flavio TARSETTI
Browse files

[widgets][assetwidget] Add name of currently edited asset

This allows the user to know what they are modifying while
they browse other assets.
parent 6281109c
Pipeline #31511 passed with stage
in 25 minutes and 17 seconds
......@@ -31,6 +31,7 @@ from PyQt5.QtCore import pyqtSlot
from PyQt5.QtCore import QFileSystemWatcher
from PyQt5.QtCore import QTimer
from PyQt5.QtWidgets import QLabel
from PyQt5.QtWidgets import QMenu
from PyQt5.QtWidgets import QPushButton
from PyQt5.QtWidgets import QTabWidget
......@@ -150,7 +151,9 @@ class AssetWidget(QWidget):
self.tab_widget.addTab(self.editors, self.tr("Editor"))
self.tab_widget.addTab(self.json_widget, self.tr("Raw JSON"))
self.asset_name_label = QLabel(self.tr("Unknown"))
layout = QVBoxLayout(self)
layout.addWidget(self.asset_name_label)
layout.addWidget(self.tab_widget)
edit_menu = QMenu()
......@@ -215,6 +218,7 @@ class AssetWidget(QWidget):
editor.dataChanged.connect(self.update_timer.start)
self.set_current_editor(self.current_asset.type)
self.asset_name_label.setText(self.current_asset.name)
self.save_button.setEnabled(False)
def __clear_watcher(self):
......@@ -330,6 +334,7 @@ class AssetWidget(QWidget):
if answer == QMessageBox.No:
return
self.set_current_editor(AssetType.UNKNOWN)
self.asset_name_label.setText(self.tr("Unknown"))
self.json_widget.clear()
self.__clear_watcher()
self.current_asset.delete()
......
Supports Markdown
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