mainwindow: set unique object name on all panels that are in a "series"
This commit is contained in:
@@ -180,6 +180,11 @@ void MainWindow::FolderOpen(Project *p, Item *i, bool floating)
|
||||
{
|
||||
ProjectPanel* panel = PanelManager::instance()->CreatePanel<ProjectPanel>(this);
|
||||
|
||||
// Set custom name to distinguish it from regular ProjectPanels
|
||||
panel->setObjectName(QStringLiteral("FolderPanel"));
|
||||
|
||||
SetUniquePanelID<ProjectPanel>(panel, folder_panels_);
|
||||
|
||||
panel->set_project(p);
|
||||
panel->set_root(i);
|
||||
|
||||
@@ -508,6 +513,8 @@ T *MainWindow::AppendPanelInternal(QList<T*>& list)
|
||||
{
|
||||
T* panel = PanelManager::instance()->CreatePanel<T>(this);
|
||||
|
||||
SetUniquePanelID(panel, list);
|
||||
|
||||
if (!list.isEmpty()) {
|
||||
tabifyDockWidget(list.last(), panel);
|
||||
}
|
||||
@@ -524,4 +531,11 @@ T *MainWindow::AppendPanelInternal(QList<T*>& list)
|
||||
return panel;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
void MainWindow::SetUniquePanelID(T *panel, const QList<T *> &list)
|
||||
{
|
||||
// Set unique object name so it can be identified by QMainWindow's save and restore state functions
|
||||
panel->setObjectName(panel->objectName().append(QString::number(list.size())));
|
||||
}
|
||||
|
||||
OLIVE_NAMESPACE_EXIT
|
||||
|
||||
@@ -93,6 +93,9 @@ private:
|
||||
template <typename T>
|
||||
T* AppendPanelInternal(QList<T*>& list);
|
||||
|
||||
template<typename T>
|
||||
void SetUniquePanelID(T* panel, const QList<T*>& list);
|
||||
|
||||
void RemoveTimelinePanel(TimelinePanel *panel);
|
||||
|
||||
void RemoveProjectPanel(ProjectPanel* panel);
|
||||
|
||||
Reference in New Issue
Block a user