2013-11-07 16:45:03 -07:00
|
|
|
/******************************************************************************
|
2023-05-18 17:37:26 -07:00
|
|
|
Copyright (C) 2023 by Lain Bailey <lain@obsproject.com>
|
|
|
|
|
Zachary Lund <admin@computerquip.com>
|
|
|
|
|
Philippe Groarke <philippe.groarke@gmail.com>
|
2013-11-07 16:45:03 -07:00
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
2013-12-02 22:24:38 -07:00
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
2013-11-07 16:45:03 -07:00
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
2013-11-09 00:19:38 -07:00
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2013-11-07 16:45:03 -07:00
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
******************************************************************************/
|
|
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
#include "OBSBasic.hpp"
|
2023-03-13 03:09:52 +01:00
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
#include <qt-wrappers.hpp>
|
2018-06-01 22:42:11 -07:00
|
|
|
|
2019-02-06 13:30:02 -08:00
|
|
|
void assignDockToggle(QDockWidget *dock, QAction *action)
|
|
|
|
|
{
|
|
|
|
|
auto handleWindowToggle = [action](bool vis) {
|
|
|
|
|
action->blockSignals(true);
|
|
|
|
|
action->setChecked(vis);
|
|
|
|
|
action->blockSignals(false);
|
|
|
|
|
};
|
|
|
|
|
auto handleMenuToggle = [dock](bool check) {
|
|
|
|
|
dock->blockSignals(true);
|
|
|
|
|
dock->setVisible(check);
|
|
|
|
|
dock->blockSignals(false);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
dock->connect(dock->toggleViewAction(), &QAction::toggled, handleWindowToggle);
|
|
|
|
|
dock->connect(action, &QAction::toggled, handleMenuToggle);
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-21 16:35:56 +02:00
|
|
|
void setupDockAction(QDockWidget *dock)
|
|
|
|
|
{
|
|
|
|
|
QAction *action = dock->toggleViewAction();
|
|
|
|
|
|
|
|
|
|
auto neverDisable = [action]() {
|
|
|
|
|
QSignalBlocker block(action);
|
|
|
|
|
action->setEnabled(true);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
auto newToggleView = [dock](bool check) {
|
|
|
|
|
QSignalBlocker block(dock);
|
|
|
|
|
dock->setVisible(check);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Replace the slot connected by default
|
2023-03-28 22:04:34 +02:00
|
|
|
QObject::disconnect(action, &QAction::triggered, nullptr, 0);
|
2022-10-21 16:35:56 +02:00
|
|
|
dock->connect(action, &QAction::triggered, newToggleView);
|
|
|
|
|
|
|
|
|
|
// Make the action unable to be disabled
|
|
|
|
|
action->connect(action, &QAction::enabledChanged, neverDisable);
|
|
|
|
|
}
|
|
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
void OBSBasic::on_resetDocks_triggered(bool force)
|
2014-02-02 15:23:38 -07:00
|
|
|
{
|
2024-12-11 17:43:35 +01:00
|
|
|
/* prune deleted extra docks */
|
|
|
|
|
for (int i = oldExtraDocks.size() - 1; i >= 0; i--) {
|
|
|
|
|
if (!oldExtraDocks[i]) {
|
|
|
|
|
oldExtraDocks.removeAt(i);
|
|
|
|
|
oldExtraDockNames.removeAt(i);
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-07-21 03:06:02 +02:00
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
#ifdef BROWSER_AVAILABLE
|
|
|
|
|
if ((oldExtraDocks.size() || extraDocks.size() || extraCustomDocks.size() || extraBrowserDocks.size()) &&
|
|
|
|
|
!force)
|
2018-08-31 21:42:44 -03:00
|
|
|
#else
|
2024-12-11 17:43:35 +01:00
|
|
|
if ((oldExtraDocks.size() || extraDocks.size() || extraCustomDocks.size()) && !force)
|
2020-10-01 11:45:46 -04:00
|
|
|
#endif
|
2024-12-11 17:43:35 +01:00
|
|
|
{
|
|
|
|
|
QMessageBox::StandardButton button =
|
|
|
|
|
OBSMessageBox::question(this, QTStr("ResetUIWarning.Title"), QTStr("ResetUIWarning.Text"));
|
2020-10-01 11:45:46 -04:00
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
if (button == QMessageBox::No)
|
|
|
|
|
return;
|
|
|
|
|
}
|
2017-08-12 19:45:25 +02:00
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
/* undock/hide/center extra docks */
|
|
|
|
|
for (int i = oldExtraDocks.size() - 1; i >= 0; i--) {
|
|
|
|
|
if (oldExtraDocks[i]) {
|
|
|
|
|
oldExtraDocks[i]->setVisible(true);
|
|
|
|
|
oldExtraDocks[i]->setFloating(true);
|
|
|
|
|
oldExtraDocks[i]->move(frameGeometry().topLeft() + rect().center() -
|
|
|
|
|
oldExtraDocks[i]->rect().center());
|
|
|
|
|
oldExtraDocks[i]->setVisible(false);
|
2017-08-12 19:45:25 +02:00
|
|
|
}
|
|
|
|
|
}
|
2018-09-16 10:02:43 -07:00
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
#define RESET_DOCKLIST(dockList) \
|
|
|
|
|
for (int i = dockList.size() - 1; i >= 0; i--) { \
|
|
|
|
|
dockList[i]->setVisible(true); \
|
|
|
|
|
dockList[i]->setFloating(true); \
|
|
|
|
|
dockList[i]->move(frameGeometry().topLeft() + rect().center() - dockList[i]->rect().center()); \
|
|
|
|
|
dockList[i]->setVisible(false); \
|
|
|
|
|
}
|
2019-02-28 15:29:41 -06:00
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
RESET_DOCKLIST(extraDocks)
|
|
|
|
|
RESET_DOCKLIST(extraCustomDocks)
|
|
|
|
|
#ifdef BROWSER_AVAILABLE
|
|
|
|
|
RESET_DOCKLIST(extraBrowserDocks)
|
2020-03-22 11:32:01 +11:00
|
|
|
#endif
|
2024-12-11 17:43:35 +01:00
|
|
|
#undef RESET_DOCKLIST
|
2020-03-22 11:32:01 +11:00
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
restoreState(startingDockLayout);
|
2015-12-05 05:58:05 -08:00
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
int cx = width();
|
|
|
|
|
int cy = height();
|
2015-12-05 05:58:05 -08:00
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
int cx22_5 = cx * 225 / 1000;
|
|
|
|
|
int cx5 = cx * 5 / 100;
|
|
|
|
|
int cx21 = cx * 21 / 100;
|
2018-07-15 18:50:33 -07:00
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
cy = cy * 225 / 1000;
|
2018-07-15 18:50:33 -07:00
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
int mixerSize = cx - (cx22_5 * 2 + cx5 + cx21);
|
2018-07-15 18:50:33 -07:00
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
QList<QDockWidget *> docks{ui->scenesDock, ui->sourcesDock, ui->mixerDock, ui->transitionsDock, controlsDock};
|
2014-04-26 23:47:50 -07:00
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
QList<int> sizes{cx22_5, cx22_5, mixerSize, cx5, cx21};
|
2015-06-23 19:29:07 -07:00
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
ui->scenesDock->setVisible(true);
|
|
|
|
|
ui->sourcesDock->setVisible(true);
|
|
|
|
|
ui->mixerDock->setVisible(true);
|
|
|
|
|
ui->transitionsDock->setVisible(true);
|
|
|
|
|
controlsDock->setVisible(true);
|
|
|
|
|
statsDock->setVisible(false);
|
|
|
|
|
statsDock->setFloating(true);
|
UI: Implement transitions and preview/program mode
Implements transitions, and introduces "Studio Mode" which allows live
editing of the same or different scenes while preserving what's
currently being displayed.
Studio Mode offers a number of new features:
- The ability to edit different scenes or the same scene without
modifying what's currently being displayed (of course)
- The ability to set up "quick transitions" with a desired transition
and duration that can be assigned hotkeys
- The option to create full copies of all sources in the program scene
to allow editing of source properties of the same scene live without
modifying the output, or (by default) just use references. (Note
however that certain sources cannot be duplicated, such as capture
sources, media sources, and device sources)
- Swap Mode (enabled by default) which swaps the program scene with
the preview scene when a transition completes
Currently, only non-configurable transitions (transitions without
properties) are listed, and the only transitions available as of this
writing are fade and cut. In future versions more transitions will be
added, such as swipe, stingers, and many other various sort of
transitions, and the UI will support being able to add/configure/remove
those sort of configurable transitions.
2016-01-23 11:19:29 -08:00
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
resizeDocks(docks, {cy, cy, cy, cy, cy}, Qt::Vertical);
|
|
|
|
|
resizeDocks(docks, sizes, Qt::Horizontal);
|
2014-04-26 23:47:50 -07:00
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
activateWindow();
|
2014-04-26 23:47:50 -07:00
|
|
|
}
|
|
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
void OBSBasic::on_lockDocks_toggled(bool lock)
|
2015-02-17 02:45:34 -05:00
|
|
|
{
|
2024-12-11 17:43:35 +01:00
|
|
|
QDockWidget::DockWidgetFeatures features =
|
|
|
|
|
lock ? QDockWidget::NoDockWidgetFeatures
|
|
|
|
|
: (QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable |
|
|
|
|
|
QDockWidget::DockWidgetFloatable);
|
2015-02-17 02:45:34 -05:00
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
QDockWidget::DockWidgetFeatures mainFeatures = features;
|
|
|
|
|
mainFeatures &= ~QDockWidget::QDockWidget::DockWidgetClosable;
|
2015-02-17 02:45:34 -05:00
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
ui->scenesDock->setFeatures(mainFeatures);
|
|
|
|
|
ui->sourcesDock->setFeatures(mainFeatures);
|
|
|
|
|
ui->mixerDock->setFeatures(mainFeatures);
|
|
|
|
|
ui->transitionsDock->setFeatures(mainFeatures);
|
|
|
|
|
controlsDock->setFeatures(mainFeatures);
|
|
|
|
|
statsDock->setFeatures(features);
|
2023-02-10 14:52:15 +03:00
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
for (int i = extraDocks.size() - 1; i >= 0; i--)
|
|
|
|
|
extraDocks[i]->setFeatures(features);
|
2022-07-25 07:22:24 -05:00
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
for (int i = extraCustomDocks.size() - 1; i >= 0; i--)
|
|
|
|
|
extraCustomDocks[i]->setFeatures(features);
|
2022-07-25 07:22:24 -05:00
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
#ifdef BROWSER_AVAILABLE
|
|
|
|
|
for (int i = extraBrowserDocks.size() - 1; i >= 0; i--)
|
|
|
|
|
extraBrowserDocks[i]->setFeatures(features);
|
|
|
|
|
#endif
|
2023-02-10 14:52:15 +03:00
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
for (int i = oldExtraDocks.size() - 1; i >= 0; i--) {
|
|
|
|
|
if (!oldExtraDocks[i]) {
|
|
|
|
|
oldExtraDocks.removeAt(i);
|
|
|
|
|
oldExtraDockNames.removeAt(i);
|
|
|
|
|
} else {
|
|
|
|
|
oldExtraDocks[i]->setFeatures(features);
|
2022-07-25 07:22:24 -05:00
|
|
|
}
|
2024-12-11 17:43:35 +01:00
|
|
|
}
|
2018-08-18 01:13:20 -05:00
|
|
|
}
|
|
|
|
|
|
2024-12-11 17:43:35 +01:00
|
|
|
void OBSBasic::on_sideDocks_toggled(bool side)
|
2022-09-02 22:52:35 +02:00
|
|
|
{
|
2024-12-11 17:43:35 +01:00
|
|
|
if (side) {
|
|
|
|
|
setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea);
|
|
|
|
|
setCorner(Qt::TopRightCorner, Qt::RightDockWidgetArea);
|
|
|
|
|
setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea);
|
|
|
|
|
setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea);
|
|
|
|
|
} else {
|
|
|
|
|
setCorner(Qt::TopLeftCorner, Qt::TopDockWidgetArea);
|
|
|
|
|
setCorner(Qt::TopRightCorner, Qt::TopDockWidgetArea);
|
|
|
|
|
setCorner(Qt::BottomLeftCorner, Qt::BottomDockWidgetArea);
|
|
|
|
|
setCorner(Qt::BottomRightCorner, Qt::BottomDockWidgetArea);
|
|
|
|
|
}
|
2022-09-02 22:52:35 +02:00
|
|
|
}
|
|
|
|
|
|
2019-02-06 13:57:59 -08:00
|
|
|
QAction *OBSBasic::AddDockWidget(QDockWidget *dock)
|
|
|
|
|
{
|
2022-10-22 09:49:27 +02:00
|
|
|
// Prevent the object name from being changed
|
|
|
|
|
connect(dock, &QObject::objectNameChanged, this, &OBSBasic::RepairOldExtraDockName);
|
|
|
|
|
|
2022-10-21 16:53:06 +02:00
|
|
|
#ifdef BROWSER_AVAILABLE
|
|
|
|
|
QAction *action = new QAction(dock->windowTitle(), ui->menuDocks);
|
|
|
|
|
|
|
|
|
|
if (!extraBrowserMenuDocksSeparator.isNull())
|
|
|
|
|
ui->menuDocks->insertAction(extraBrowserMenuDocksSeparator, action);
|
|
|
|
|
else
|
|
|
|
|
ui->menuDocks->addAction(action);
|
|
|
|
|
#else
|
2021-11-18 22:06:14 -05:00
|
|
|
QAction *action = ui->menuDocks->addAction(dock->windowTitle());
|
2022-10-21 16:53:06 +02:00
|
|
|
#endif
|
2019-02-06 13:57:59 -08:00
|
|
|
action->setCheckable(true);
|
|
|
|
|
assignDockToggle(dock, action);
|
2022-10-21 16:53:06 +02:00
|
|
|
oldExtraDocks.push_back(dock);
|
2022-10-22 09:49:27 +02:00
|
|
|
oldExtraDockNames.push_back(dock->objectName());
|
2019-02-06 13:57:59 -08:00
|
|
|
|
2022-01-29 01:55:03 -06:00
|
|
|
bool lock = ui->lockDocks->isChecked();
|
2019-02-06 13:57:59 -08:00
|
|
|
QDockWidget::DockWidgetFeatures features =
|
|
|
|
|
lock ? QDockWidget::NoDockWidgetFeatures
|
2020-06-07 15:31:13 -07:00
|
|
|
: (QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable |
|
|
|
|
|
QDockWidget::DockWidgetFloatable);
|
2019-02-06 13:57:59 -08:00
|
|
|
|
|
|
|
|
dock->setFeatures(features);
|
|
|
|
|
|
|
|
|
|
/* prune deleted docks */
|
2022-10-21 16:53:06 +02:00
|
|
|
for (int i = oldExtraDocks.size() - 1; i >= 0; i--) {
|
|
|
|
|
if (!oldExtraDocks[i]) {
|
|
|
|
|
oldExtraDocks.removeAt(i);
|
2022-10-22 09:49:27 +02:00
|
|
|
oldExtraDockNames.removeAt(i);
|
2019-02-06 13:57:59 -08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return action;
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-22 09:49:27 +02:00
|
|
|
void OBSBasic::RepairOldExtraDockName()
|
|
|
|
|
{
|
|
|
|
|
QDockWidget *dock = reinterpret_cast<QDockWidget *>(sender());
|
|
|
|
|
int idx = oldExtraDocks.indexOf(dock);
|
|
|
|
|
QSignalBlocker block(dock);
|
|
|
|
|
|
|
|
|
|
if (idx == -1) {
|
|
|
|
|
blog(LOG_WARNING, "A dock got its object name changed");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
blog(LOG_WARNING, "The dock '%s' got its object name restored", QT_TO_UTF8(oldExtraDockNames[idx]));
|
|
|
|
|
|
|
|
|
|
dock->setObjectName(oldExtraDockNames[idx]);
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-21 16:53:06 +02:00
|
|
|
void OBSBasic::AddDockWidget(QDockWidget *dock, Qt::DockWidgetArea area, bool extraBrowser)
|
|
|
|
|
{
|
|
|
|
|
if (dock->objectName().isEmpty())
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
bool lock = ui->lockDocks->isChecked();
|
|
|
|
|
QDockWidget::DockWidgetFeatures features =
|
|
|
|
|
lock ? QDockWidget::NoDockWidgetFeatures
|
|
|
|
|
: (QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable |
|
|
|
|
|
QDockWidget::DockWidgetFloatable);
|
|
|
|
|
|
|
|
|
|
setupDockAction(dock);
|
|
|
|
|
dock->setFeatures(features);
|
|
|
|
|
addDockWidget(area, dock);
|
|
|
|
|
|
|
|
|
|
#ifdef BROWSER_AVAILABLE
|
|
|
|
|
if (extraBrowser && extraBrowserMenuDocksSeparator.isNull())
|
|
|
|
|
extraBrowserMenuDocksSeparator = ui->menuDocks->addSeparator();
|
|
|
|
|
|
|
|
|
|
if (!extraBrowser && !extraBrowserMenuDocksSeparator.isNull())
|
|
|
|
|
ui->menuDocks->insertAction(extraBrowserMenuDocksSeparator, dock->toggleViewAction());
|
|
|
|
|
else
|
|
|
|
|
ui->menuDocks->addAction(dock->toggleViewAction());
|
|
|
|
|
|
|
|
|
|
if (extraBrowser)
|
|
|
|
|
return;
|
|
|
|
|
#else
|
|
|
|
|
UNUSED_PARAMETER(extraBrowser);
|
|
|
|
|
|
|
|
|
|
ui->menuDocks->addAction(dock->toggleViewAction());
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
extraDockNames.push_back(dock->objectName());
|
2023-10-03 18:13:56 -04:00
|
|
|
extraDocks.push_back(std::shared_ptr<QDockWidget>(dock));
|
2022-10-21 16:53:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OBSBasic::RemoveDockWidget(const QString &name)
|
|
|
|
|
{
|
2022-10-22 11:51:30 +02:00
|
|
|
if (extraDockNames.contains(name)) {
|
|
|
|
|
int idx = extraDockNames.indexOf(name);
|
|
|
|
|
extraDockNames.removeAt(idx);
|
2023-10-03 18:13:56 -04:00
|
|
|
extraDocks[idx].reset();
|
2022-10-22 11:51:30 +02:00
|
|
|
extraDocks.removeAt(idx);
|
|
|
|
|
} else if (extraCustomDockNames.contains(name)) {
|
|
|
|
|
int idx = extraCustomDockNames.indexOf(name);
|
|
|
|
|
extraCustomDockNames.removeAt(idx);
|
|
|
|
|
removeDockWidget(extraCustomDocks[idx]);
|
|
|
|
|
extraCustomDocks.removeAt(idx);
|
|
|
|
|
}
|
2022-10-21 16:53:06 +02:00
|
|
|
}
|
|
|
|
|
|
2022-10-22 09:49:27 +02:00
|
|
|
bool OBSBasic::IsDockObjectNameUsed(const QString &name)
|
|
|
|
|
{
|
|
|
|
|
QStringList list;
|
|
|
|
|
list << "scenesDock"
|
|
|
|
|
<< "sourcesDock"
|
|
|
|
|
<< "mixerDock"
|
|
|
|
|
<< "transitionsDock"
|
|
|
|
|
<< "controlsDock"
|
|
|
|
|
<< "statsDock";
|
|
|
|
|
list << oldExtraDockNames;
|
|
|
|
|
list << extraDockNames;
|
2022-10-22 11:51:30 +02:00
|
|
|
list << extraCustomDockNames;
|
2022-10-22 09:49:27 +02:00
|
|
|
|
|
|
|
|
return list.contains(name);
|
|
|
|
|
}
|
|
|
|
|
|
2022-10-22 11:51:30 +02:00
|
|
|
void OBSBasic::AddCustomDockWidget(QDockWidget *dock)
|
|
|
|
|
{
|
|
|
|
|
// Prevent the object name from being changed
|
|
|
|
|
connect(dock, &QObject::objectNameChanged, this, &OBSBasic::RepairCustomExtraDockName);
|
|
|
|
|
|
|
|
|
|
bool lock = ui->lockDocks->isChecked();
|
|
|
|
|
QDockWidget::DockWidgetFeatures features =
|
|
|
|
|
lock ? QDockWidget::NoDockWidgetFeatures
|
|
|
|
|
: (QDockWidget::DockWidgetClosable | QDockWidget::DockWidgetMovable |
|
|
|
|
|
QDockWidget::DockWidgetFloatable);
|
|
|
|
|
|
|
|
|
|
dock->setFeatures(features);
|
|
|
|
|
addDockWidget(Qt::RightDockWidgetArea, dock);
|
|
|
|
|
|
|
|
|
|
extraCustomDockNames.push_back(dock->objectName());
|
|
|
|
|
extraCustomDocks.push_back(dock);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void OBSBasic::RepairCustomExtraDockName()
|
|
|
|
|
{
|
|
|
|
|
QDockWidget *dock = reinterpret_cast<QDockWidget *>(sender());
|
|
|
|
|
int idx = extraCustomDocks.indexOf(dock);
|
|
|
|
|
QSignalBlocker block(dock);
|
|
|
|
|
|
|
|
|
|
if (idx == -1) {
|
|
|
|
|
blog(LOG_WARNING, "A custom dock got its object name changed");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
blog(LOG_WARNING, "The custom dock '%s' got its object name restored", QT_TO_UTF8(extraCustomDockNames[idx]));
|
|
|
|
|
|
|
|
|
|
dock->setObjectName(extraCustomDockNames[idx]);
|
|
|
|
|
}
|