various small code cleanups and improvements

Largely refactoring work to make the code somewhat nicer to work with.
This commit is contained in:
itsmattkc
2019-12-26 19:00:08 +11:00
parent 83077c939e
commit 61c60e00d6
87 changed files with 596 additions and 567 deletions
+18 -7
View File
@@ -24,18 +24,14 @@
#include "panel/panelmanager.h"
#include "panel/timeline/timeline.h"
MenuShared olive::menu_shared;
MenuShared* MenuShared::instance_ = nullptr;
MenuShared::MenuShared()
{
}
void MenuShared::Initialize()
{
// "New" menu shared items
new_project_item_ = Menu::CreateItem(this, "newproj", nullptr, nullptr, "Ctrl+N");
new_sequence_item_ = Menu::CreateItem(this, "newseq", &olive::core, SLOT(CreateNewSequence()), "Ctrl+Shift+N");
new_folder_item_ = Menu::CreateItem(this, "newfolder", &olive::core, SLOT(CreateNewFolder()));
new_sequence_item_ = Menu::CreateItem(this, "newseq", Core::instance(), SLOT(CreateNewSequence()), "Ctrl+Shift+N");
new_folder_item_ = Menu::CreateItem(this, "newfolder", Core::instance(), SLOT(CreateNewFolder()));
// "Edit" menu shared items
edit_cut_item_ = Menu::CreateItem(this, "cut", nullptr, nullptr, "Ctrl+X");
@@ -63,6 +59,16 @@ void MenuShared::Initialize()
Retranslate();
}
void MenuShared::CreateInstance()
{
instance_ = new MenuShared();
}
void MenuShared::DestroyInstance()
{
delete instance_;
}
void MenuShared::AddItemsForNewMenu(Menu *m)
{
m->addAction(new_project_item_);
@@ -101,6 +107,11 @@ void MenuShared::AddItemsForClipEditMenu(Menu *m)
m->addAction(clip_nest_item_);
}
MenuShared *MenuShared::instance()
{
return instance_;
}
void MenuShared::SplitAtPlayhead()
{
TimelinePanel* timeline = PanelManager::instance()->MostRecentlyFocused<TimelinePanel>();