created new sequence dialog
This commit is contained in:
@@ -24,7 +24,7 @@ add_subdirectory(viewer)
|
||||
|
||||
set(OLIVE_SOURCES
|
||||
${OLIVE_SOURCES}
|
||||
panel/panelfocusmanager.h
|
||||
panel/panelfocusmanager.cpp
|
||||
panel/panelmanager.h
|
||||
panel/panelmanager.cpp
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
@@ -38,8 +38,6 @@ NodePanel::NodePanel(QWidget *parent) :
|
||||
|
||||
void NodePanel::SetGraph(NodeGraph *graph)
|
||||
{
|
||||
SetSubtitle(graph->name());
|
||||
|
||||
node_view_->SetGraph(graph);
|
||||
}
|
||||
|
||||
@@ -54,5 +52,4 @@ void NodePanel::changeEvent(QEvent *e)
|
||||
void NodePanel::Retranslate()
|
||||
{
|
||||
SetTitle(tr("Node Editor"));
|
||||
SetSubtitle(tr("(none)"));
|
||||
}
|
||||
|
||||
@@ -18,17 +18,17 @@
|
||||
|
||||
***/
|
||||
|
||||
#include "panelfocusmanager.h"
|
||||
#include "panelmanager.h"
|
||||
|
||||
PanelFocusManager* olive::panel_focus_manager = nullptr;
|
||||
PanelManager* olive::panel_focus_manager = nullptr;
|
||||
|
||||
PanelFocusManager::PanelFocusManager(QObject *parent) :
|
||||
PanelManager::PanelManager(QObject *parent) :
|
||||
QObject(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
PanelWidget *PanelFocusManager::CurrentlyFocused() const
|
||||
PanelWidget *PanelManager::CurrentlyFocused() const
|
||||
{
|
||||
if (focus_history_.isEmpty()) {
|
||||
return nullptr;
|
||||
@@ -37,7 +37,7 @@ PanelWidget *PanelFocusManager::CurrentlyFocused() const
|
||||
return focus_history_.first();
|
||||
}
|
||||
|
||||
void PanelFocusManager::FocusChanged(QWidget *old, QWidget *now)
|
||||
void PanelManager::FocusChanged(QWidget *old, QWidget *now)
|
||||
{
|
||||
Q_UNUSED(old)
|
||||
|
||||
@@ -41,17 +41,18 @@
|
||||
* PanelFocusManager's SLOT(FocusChanged()) connects to the QApplication instance's SIGNAL(focusChanged()) so that
|
||||
* it always knows when focus has changed within the application.
|
||||
*/
|
||||
class PanelFocusManager : public QObject
|
||||
class PanelManager : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
PanelFocusManager(QObject* parent);
|
||||
PanelManager(QObject* parent);
|
||||
|
||||
/**
|
||||
* @brief Return the currently focused widget, or nullptr if nothing is focused
|
||||
*/
|
||||
PanelWidget* CurrentlyFocused() const;
|
||||
|
||||
template<class T>
|
||||
/**
|
||||
* @brief Get most recently focused panel of a certain type
|
||||
*
|
||||
@@ -59,9 +60,16 @@ public:
|
||||
*
|
||||
* The most recently focused panel of the specified type, or nullptr if none exists
|
||||
*/
|
||||
template<class T>
|
||||
T* MostRecentlyFocused();
|
||||
|
||||
template<class T>
|
||||
/**
|
||||
* @brief Create a panel
|
||||
* @param parent
|
||||
* @return
|
||||
*/
|
||||
T* CreatePanel(QWidget* parent);
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* @brief Connect this to a QApplication's SIGNAL(focusChanged())
|
||||
@@ -78,7 +86,18 @@ private:
|
||||
};
|
||||
|
||||
template<class T>
|
||||
T* PanelFocusManager::MostRecentlyFocused()
|
||||
T *PanelManager::CreatePanel(QWidget *parent)
|
||||
{
|
||||
T* panel = new T(parent);
|
||||
|
||||
// Add panel to the bottom of the focus history
|
||||
focus_history_.append(panel);
|
||||
|
||||
return panel;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
T* PanelManager::MostRecentlyFocused()
|
||||
{
|
||||
T* cast_test;
|
||||
|
||||
@@ -94,7 +113,7 @@ T* PanelFocusManager::MostRecentlyFocused()
|
||||
}
|
||||
|
||||
namespace olive {
|
||||
extern PanelFocusManager* panel_focus_manager;
|
||||
extern PanelManager* panel_focus_manager;
|
||||
}
|
||||
|
||||
#endif // PANELFOCUSMANAGER_H
|
||||
Reference in New Issue
Block a user