switched global to unique ptr and renamed olive namespace
This commit is contained in:
+24
-24
@@ -33,22 +33,22 @@
|
||||
#include <QMessageBox>
|
||||
#include <QInputDialog>
|
||||
|
||||
MenuHelper Olive::MenuHelper;
|
||||
MenuHelper olive::MenuHelper;
|
||||
|
||||
void MenuHelper::make_new_menu(QMenu *parent) {
|
||||
parent->addAction(tr("&Project"), Olive::Global.data(), SLOT(new_project()), QKeySequence("Ctrl+N"))->setProperty("id", "newproj");
|
||||
parent->addAction(tr("&Project"), olive::Global.get(), SLOT(new_project()), QKeySequence("Ctrl+N"))->setProperty("id", "newproj");
|
||||
parent->addSeparator();
|
||||
parent->addAction(tr("&Sequence"), panel_project, SLOT(new_sequence()), QKeySequence("Ctrl+Shift+N"))->setProperty("id", "newseq");
|
||||
parent->addAction(tr("&Folder"), panel_project, SLOT(new_folder()))->setProperty("id", "newfolder");
|
||||
}
|
||||
|
||||
void MenuHelper::make_inout_menu(QMenu *parent) {
|
||||
parent->addAction(tr("Set In Point"), &Olive::FocusFilter, SLOT(set_in_point()), QKeySequence("I"))->setProperty("id", "setinpoint");
|
||||
parent->addAction(tr("Set Out Point"), &Olive::FocusFilter, SLOT(set_out_point()), QKeySequence("O"))->setProperty("id", "setoutpoint");
|
||||
parent->addAction(tr("Set In Point"), &olive::FocusFilter, SLOT(set_in_point()), QKeySequence("I"))->setProperty("id", "setinpoint");
|
||||
parent->addAction(tr("Set Out Point"), &olive::FocusFilter, SLOT(set_out_point()), QKeySequence("O"))->setProperty("id", "setoutpoint");
|
||||
parent->addSeparator();
|
||||
parent->addAction(tr("Reset In Point"), &Olive::FocusFilter, SLOT(clear_in()))->setProperty("id", "resetin");
|
||||
parent->addAction(tr("Reset Out Point"), &Olive::FocusFilter, SLOT(clear_out()))->setProperty("id", "resetout");
|
||||
parent->addAction(tr("Clear In/Out Point"), &Olive::FocusFilter, SLOT(clear_inout()), QKeySequence("G"))->setProperty("id", "clearinout");
|
||||
parent->addAction(tr("Reset In Point"), &olive::FocusFilter, SLOT(clear_in()))->setProperty("id", "resetin");
|
||||
parent->addAction(tr("Reset Out Point"), &olive::FocusFilter, SLOT(clear_out()))->setProperty("id", "resetout");
|
||||
parent->addAction(tr("Clear In/Out Point"), &olive::FocusFilter, SLOT(clear_inout()), QKeySequence("G"))->setProperty("id", "clearinout");
|
||||
}
|
||||
|
||||
void MenuHelper::make_clip_functions_menu(QMenu *parent) {
|
||||
@@ -59,12 +59,12 @@ void MenuHelper::make_clip_functions_menu(QMenu *parent) {
|
||||
}
|
||||
|
||||
void MenuHelper::make_edit_functions_menu(QMenu *parent) {
|
||||
parent->addAction(tr("Cu&t"), &Olive::FocusFilter, SLOT(cut()), QKeySequence("Ctrl+X"))->setProperty("id", "cut");
|
||||
parent->addAction(tr("Cop&y"), &Olive::FocusFilter, SLOT(copy()), QKeySequence("Ctrl+C"))->setProperty("id", "copy");
|
||||
parent->addAction(tr("&Paste"), Olive::Global.data(), SLOT(paste()), QKeySequence("Ctrl+V"))->setProperty("id", "paste");
|
||||
parent->addAction(tr("Paste Insert"), Olive::Global.data(), SLOT(paste_insert()), QKeySequence("Ctrl+Shift+V"))->setProperty("id", "pasteinsert");
|
||||
parent->addAction(tr("Duplicate"), &Olive::FocusFilter, SLOT(duplicate()), QKeySequence("Ctrl+D"))->setProperty("id", "duplicate");
|
||||
parent->addAction(tr("Delete"), &Olive::FocusFilter, SLOT(delete_function()), QKeySequence("Del"))->setProperty("id", "delete");
|
||||
parent->addAction(tr("Cu&t"), &olive::FocusFilter, SLOT(cut()), QKeySequence("Ctrl+X"))->setProperty("id", "cut");
|
||||
parent->addAction(tr("Cop&y"), &olive::FocusFilter, SLOT(copy()), QKeySequence("Ctrl+C"))->setProperty("id", "copy");
|
||||
parent->addAction(tr("&Paste"), olive::Global.get(), SLOT(paste()), QKeySequence("Ctrl+V"))->setProperty("id", "paste");
|
||||
parent->addAction(tr("Paste Insert"), olive::Global.get(), SLOT(paste_insert()), QKeySequence("Ctrl+Shift+V"))->setProperty("id", "pasteinsert");
|
||||
parent->addAction(tr("Duplicate"), &olive::FocusFilter, SLOT(duplicate()), QKeySequence("Ctrl+D"))->setProperty("id", "duplicate");
|
||||
parent->addAction(tr("Delete"), &olive::FocusFilter, SLOT(delete_function()), QKeySequence("Del"))->setProperty("id", "delete");
|
||||
parent->addAction(tr("Ripple Delete"), panel_timeline, SLOT(ripple_delete()), QKeySequence("Shift+Del"))->setProperty("id", "rippledelete");
|
||||
parent->addAction(tr("Split"), panel_timeline, SLOT(split_at_playhead()), QKeySequence("Ctrl+K"))->setProperty("id", "split");
|
||||
}
|
||||
@@ -100,23 +100,23 @@ void MenuHelper::set_titlesafe_from_menu() {
|
||||
if (qIsNaN(tsa)) {
|
||||
|
||||
// disable title safe area
|
||||
Olive::CurrentConfig.show_title_safe_area = false;
|
||||
olive::CurrentConfig.show_title_safe_area = false;
|
||||
|
||||
} else {
|
||||
|
||||
// using title safe area
|
||||
Olive::CurrentConfig.show_title_safe_area = true;
|
||||
olive::CurrentConfig.show_title_safe_area = true;
|
||||
|
||||
// are we using the default area aspect ratio, or a specific one
|
||||
if (qIsNull(tsa)) {
|
||||
|
||||
// default title safe area
|
||||
Olive::CurrentConfig.use_custom_title_safe_ratio = false;
|
||||
olive::CurrentConfig.use_custom_title_safe_ratio = false;
|
||||
|
||||
} else {
|
||||
|
||||
// using a specific aspect ratio
|
||||
Olive::CurrentConfig.use_custom_title_safe_ratio = true;
|
||||
olive::CurrentConfig.use_custom_title_safe_ratio = true;
|
||||
|
||||
if (tsa < 0.0) {
|
||||
|
||||
@@ -127,22 +127,22 @@ void MenuHelper::set_titlesafe_from_menu() {
|
||||
|
||||
do {
|
||||
if (invalid) {
|
||||
QMessageBox::critical(Olive::MainWindow, tr("Invalid aspect ratio"), tr("The aspect ratio '%1' is invalid. Please try again.").arg(input));
|
||||
QMessageBox::critical(olive::MainWindow, tr("Invalid aspect ratio"), tr("The aspect ratio '%1' is invalid. Please try again.").arg(input));
|
||||
}
|
||||
|
||||
input = QInputDialog::getText(Olive::MainWindow, tr("Enter custom aspect ratio"), tr("Enter the aspect ratio to use for the title/action safe area (e.g. 16:9):"));
|
||||
input = QInputDialog::getText(olive::MainWindow, tr("Enter custom aspect ratio"), tr("Enter the aspect ratio to use for the title/action safe area (e.g. 16:9):"));
|
||||
invalid = !arTest.exactMatch(input) && !input.isEmpty();
|
||||
} while (invalid);
|
||||
|
||||
if (!input.isEmpty()) {
|
||||
QStringList inputList = input.split(':');
|
||||
Olive::CurrentConfig.custom_title_safe_ratio = inputList.at(0).toDouble()/inputList.at(1).toDouble();
|
||||
olive::CurrentConfig.custom_title_safe_ratio = inputList.at(0).toDouble()/inputList.at(1).toDouble();
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
// specified tsa is a specific custom aspect ratio
|
||||
Olive::CurrentConfig.custom_title_safe_ratio = tsa;
|
||||
olive::CurrentConfig.custom_title_safe_ratio = tsa;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -154,7 +154,7 @@ void MenuHelper::set_titlesafe_from_menu() {
|
||||
|
||||
void MenuHelper::set_autoscroll() {
|
||||
QAction* action = static_cast<QAction*>(sender());
|
||||
Olive::CurrentConfig.autoscroll = action->data().toInt();
|
||||
olive::CurrentConfig.autoscroll = action->data().toInt();
|
||||
}
|
||||
|
||||
void MenuHelper::menu_click_button() {
|
||||
@@ -163,11 +163,11 @@ void MenuHelper::menu_click_button() {
|
||||
|
||||
void MenuHelper::set_timecode_view() {
|
||||
QAction* action = static_cast<QAction*>(sender());
|
||||
Olive::CurrentConfig.timecode_view = action->data().toInt();
|
||||
olive::CurrentConfig.timecode_view = action->data().toInt();
|
||||
update_ui(false);
|
||||
}
|
||||
|
||||
void MenuHelper::open_recent_from_menu() {
|
||||
int index = static_cast<QAction*>(sender())->data().toInt();
|
||||
Olive::Global.data()->open_recent(index);
|
||||
olive::Global.get()->open_recent(index);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user