various: implemented multiple project support
This required various changes to various parts of the infrastructure (mostly using paths to finding the "root project" of any given object throughout). Now theoretically infinite projects can be opened and accounted for at any given time.
This commit is contained in:
@@ -20,6 +20,8 @@
|
||||
|
||||
#include "panel.h"
|
||||
|
||||
#include <QCloseEvent>
|
||||
#include <QDebug>
|
||||
#include <QPainter>
|
||||
#include <QStyle>
|
||||
#include <QStyleOption>
|
||||
@@ -29,9 +31,12 @@ OLIVE_NAMESPACE_ENTER
|
||||
|
||||
PanelWidget::PanelWidget(QWidget *parent) :
|
||||
QDockWidget(parent),
|
||||
border_visible_(false)
|
||||
border_visible_(false),
|
||||
signal_instead_of_close_(false)
|
||||
{
|
||||
setFocusPolicy(Qt::ClickFocus);
|
||||
|
||||
connect(this, &PanelWidget::visibilityChanged, this, &PanelWidget::PanelVisibilityChanged);
|
||||
}
|
||||
|
||||
void PanelWidget::SetMovementLocked(bool locked)
|
||||
@@ -104,6 +109,28 @@ void PanelWidget::UpdateTitle()
|
||||
}
|
||||
}
|
||||
|
||||
void PanelWidget::PanelVisibilityChanged(bool e)
|
||||
{
|
||||
if (e) {
|
||||
setFocus();
|
||||
}
|
||||
}
|
||||
|
||||
void PanelWidget::SetSignalInsteadOfClose(bool e)
|
||||
{
|
||||
signal_instead_of_close_ = e;
|
||||
}
|
||||
|
||||
void PanelWidget::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
if (signal_instead_of_close_) {
|
||||
event->ignore();
|
||||
emit CloseRequested();
|
||||
} else {
|
||||
QDockWidget::closeEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
void PanelWidget::changeEvent(QEvent *e)
|
||||
{
|
||||
if (e->type() == QEvent::LanguageChange) {
|
||||
|
||||
Reference in New Issue
Block a user