Skip to content

Commit

Permalink
Merge branch 'mdmayfield-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmattkc committed Mar 8, 2019
2 parents d4df411 + d294fef commit 456ae63
Show file tree
Hide file tree
Showing 6 changed files with 753 additions and 678 deletions.
7 changes: 6 additions & 1 deletion io/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ Config::Config()
center_timeline_timecodes(true),
waveform_resolution(64),
thumbnail_resolution(120),
add_default_effects_to_clips(true)
add_default_effects_to_clips(true),
invert_timeline_scroll_axes(true)
{}

void Config::load(QString path) {
Expand All @@ -87,6 +88,9 @@ void Config::load(QString path) {
} else if (stream.name() == "ScrollZooms") {
stream.readNext();
scroll_zooms = (stream.text() == "1");
} else if (stream.name() == "InvertTimelineScrollAxes") {
stream.readNext();
invert_timeline_scroll_axes = (stream.text() == "1");
} else if (stream.name() == "EditToolSelectsLinks") {
stream.readNext();
edit_tool_selects_links = (stream.text() == "1");
Expand Down Expand Up @@ -233,6 +237,7 @@ void Config::save(QString path) {
stream.writeTextElement("Version", QString::number(olive::kSaveVersion));
stream.writeTextElement("ShowTrackLines", QString::number(show_track_lines));
stream.writeTextElement("ScrollZooms", QString::number(scroll_zooms));
stream.writeTextElement("InvertTimelineScrollAxes", QString::number(invert_timeline_scroll_axes));
stream.writeTextElement("EditToolSelectsLinks", QString::number(edit_tool_selects_links));
stream.writeTextElement("EditToolAlsoSeeks", QString::number(edit_tool_also_seeks));
stream.writeTextElement("SelectAlsoSeeks", QString::number(select_also_seeks));
Expand Down
8 changes: 8 additions & 0 deletions io/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ struct Config {
* @brief The scroll wheel zooms rather than scrolls
*
* **TRUE** if the scroll wheel should zoom in and out rather than scroll up and down.
* The Control key temporarily toggles this setting.
*/
bool scroll_zooms;

Expand Down Expand Up @@ -509,6 +510,13 @@ struct Config {
*/
bool add_default_effects_to_clips;

/**
* @brief Invert Timeline scroll axes
*
* **TRUE** if scrolling vertically on the Timeline should scroll it horizontally
*/
bool invert_timeline_scroll_axes;

/**
* @brief Load config from file
*
Expand Down
10 changes: 9 additions & 1 deletion mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ MainWindow* olive::MainWindow;

#define DEFAULT_CSS "QPushButton::checked { background: rgb(25, 25, 25); }"

void MainWindow::setup_layout(bool reset) {
void MainWindow::setup_layout(bool reset) {
// load panels from file
if (!reset) {
QFile panel_config(get_config_dir().filePath("layout"));
Expand Down Expand Up @@ -652,6 +652,7 @@ void MainWindow::setup_menus() {
// INITIALIZE TOOLS MENU

tools_menu = MenuHelper::create_submenu(menuBar, this, SLOT(toolMenu_About_To_Be_Shown()));
tools_menu->setToolTipsVisible(true);

pointer_tool_action = MenuHelper::create_menu_action(tools_menu, "pointertool", &olive::MenuHelper, SLOT(menu_click_button()), QKeySequence("V"));
pointer_tool_action->setCheckable(true);
Expand Down Expand Up @@ -717,6 +718,10 @@ void MainWindow::setup_menus() {
scroll_wheel_zooms->setCheckable(true);
scroll_wheel_zooms->setData(reinterpret_cast<quintptr>(&olive::CurrentConfig.scroll_zooms));

invert_timeline_scroll_axes = MenuHelper::create_menu_action(tools_menu, "inverttimelinescrollaxes", &olive::MenuHelper, SLOT(toggle_bool_action()));
invert_timeline_scroll_axes->setCheckable(true);
invert_timeline_scroll_axes->setData(reinterpret_cast<quintptr>(&olive::CurrentConfig.invert_timeline_scroll_axes));

enable_drag_files_to_timeline = MenuHelper::create_menu_action(tools_menu, "enabledragfilestotimeline", &olive::MenuHelper, SLOT(toggle_bool_action()));
enable_drag_files_to_timeline->setCheckable(true);
enable_drag_files_to_timeline->setData(reinterpret_cast<quintptr>(&olive::CurrentConfig.enable_drag_files_to_timeline));
Expand Down Expand Up @@ -882,6 +887,8 @@ void MainWindow::Retranslate()
seek_also_selects->setText(tr("Seek Also Selects"));
seek_to_end_of_pastes->setText(tr("Seek to the End of Pastes"));
scroll_wheel_zooms->setText(tr("Scroll Wheel Zooms"));
scroll_wheel_zooms->setToolTip(tr("Hold CTRL to toggle this setting"));
invert_timeline_scroll_axes->setText(tr("Invert Timeline Scroll Axes"));
enable_drag_files_to_timeline->setText(tr("Enable Drag Files to Timeline"));
autoscale_by_default->setText(tr("Auto-Scale By Default"));
enable_seek_to_import->setText(tr("Enable Seek to Import"));
Expand Down Expand Up @@ -1134,6 +1141,7 @@ void MainWindow::toolMenu_About_To_Be_Shown() {
olive::MenuHelper.set_bool_action_checked(edit_tool_selects_links);
olive::MenuHelper.set_bool_action_checked(seek_to_end_of_pastes);
olive::MenuHelper.set_bool_action_checked(scroll_wheel_zooms);
olive::MenuHelper.set_bool_action_checked(invert_timeline_scroll_axes);
olive::MenuHelper.set_bool_action_checked(rectified_waveforms);
olive::MenuHelper.set_bool_action_checked(enable_drag_files_to_timeline);
olive::MenuHelper.set_bool_action_checked(autoscale_by_default);
Expand Down
1 change: 1 addition & 0 deletions mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ private slots:
QAction* edit_tool_selects_links;
QAction* seek_to_end_of_pastes;
QAction* scroll_wheel_zooms;
QAction* invert_timeline_scroll_axes;
QAction* rectified_waveforms;
QAction* enable_drag_files_to_timeline;
QAction* autoscale_by_default;
Expand Down
Loading

0 comments on commit 456ae63

Please sign in to comment.