various small code cleanups and improvements
Largely refactoring work to make the code somewhat nicer to work with.
This commit is contained in:
@@ -57,9 +57,9 @@ ProjectPanel::ProjectPanel(QWidget *parent) :
|
||||
|
||||
// Connect toolbar's view change signal to the explorer's view change slot
|
||||
connect(toolbar,
|
||||
SIGNAL(ViewChanged(olive::ProjectViewType)),
|
||||
&ProjectToolbar::ViewChanged,
|
||||
explorer_,
|
||||
SLOT(set_view_type(olive::ProjectViewType)));
|
||||
&ProjectExplorer::set_view_type);
|
||||
|
||||
// Set strings
|
||||
Retranslate();
|
||||
@@ -120,7 +120,7 @@ void ProjectPanel::ItemDoubleClickSlot(Item *item)
|
||||
{
|
||||
if (item == nullptr) {
|
||||
// If the user double clicks on empty space, show the import dialog
|
||||
olive::core.DialogImportShow();
|
||||
Core::instance()->DialogImportShow();
|
||||
}
|
||||
|
||||
// FIXME: Double click Item should do something
|
||||
@@ -130,7 +130,7 @@ void ProjectPanel::ShowNewMenu()
|
||||
{
|
||||
Menu new_menu(this);
|
||||
|
||||
olive::menu_shared.AddItemsForNewMenu(&new_menu);
|
||||
MenuShared::instance()->AddItemsForNewMenu(&new_menu);
|
||||
|
||||
new_menu.exec(QCursor::pos());
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ TaskManagerPanel::TaskManagerPanel(QWidget* parent) :
|
||||
setWidget(view_);
|
||||
|
||||
// Connect task view to the task manager
|
||||
connect(&olive::task_manager, SIGNAL(TaskAdded(Task*)), view_, SLOT(AddTask(Task*)));
|
||||
connect(TaskManager::instance(), &TaskManager::TaskAdded, view_, &TaskView::AddTask);
|
||||
|
||||
// Set strings
|
||||
Retranslate();
|
||||
|
||||
@@ -31,16 +31,16 @@ ToolPanel::ToolPanel(QWidget *parent) :
|
||||
|
||||
Toolbar* t = new Toolbar(this);
|
||||
|
||||
t->SetTool(olive::core.tool());
|
||||
t->SetSnapping(olive::core.snapping());
|
||||
t->SetTool(Core::instance()->tool());
|
||||
t->SetSnapping(Core::instance()->snapping());
|
||||
|
||||
setWidget(t);
|
||||
|
||||
connect(t, SIGNAL(ToolChanged(const olive::tool::Tool&)), &olive::core, SLOT(SetTool(const olive::tool::Tool&)));
|
||||
connect(&olive::core, SIGNAL(ToolChanged(const olive::tool::Tool&)), t, SLOT(SetTool(const olive::tool::Tool&)));
|
||||
connect(t, SIGNAL(ToolChanged(const Tool::Item&)), Core::instance(), SLOT(SetTool(const Tool::Item&)));
|
||||
connect(Core::instance(), SIGNAL(ToolChanged(const Tool::Item&)), t, SLOT(SetTool(const Tool::Item&)));
|
||||
|
||||
connect(t, SIGNAL(SnappingChanged(const bool&)), &olive::core, SLOT(SetSnapping(const bool&)));
|
||||
connect(&olive::core, SIGNAL(SnappingChanged(const bool&)), t, SLOT(SetSnapping(const bool&)));
|
||||
connect(t, SIGNAL(SnappingChanged(const bool&)), Core::instance(), SLOT(SetSnapping(const bool&)));
|
||||
connect(Core::instance(), SIGNAL(SnappingChanged(const bool&)), t, SLOT(SetSnapping(const bool&)));
|
||||
|
||||
Retranslate();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user