Skip to content

Commit

Permalink
Merge branch 'iss978_flip_new' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
chchwy committed Feb 5, 2019
2 parents 5674865 + cb73e92 commit b554aa1
Show file tree
Hide file tree
Showing 12 changed files with 641 additions and 302 deletions.
4 changes: 4 additions & 0 deletions app/src/mainwindow2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,8 @@ void MainWindow2::createMenus()
connect(pPlaybackManager, &PlaybackManager::playStateChanged, mTimeLine, &TimeLine::setPlaying);
connect(pPlaybackManager, &PlaybackManager::playStateChanged, this, &MainWindow2::changePlayState);
connect(pPlaybackManager, &PlaybackManager::playStateChanged, mEditor, &Editor::updateCurrentFrame);
connect(ui->actionFlip_inbetween, &QAction::triggered, pPlaybackManager, &PlaybackManager::playFlipBtwn);
connect(ui->actionFlip_rolling, &QAction::triggered, pPlaybackManager, &PlaybackManager::playFlipRoll);

connect(ui->actionAdd_Frame, &QAction::triggered, mCommands, &ActionCommands::addNewKey);
connect(ui->actionRemove_Frame, &QAction::triggered, mCommands, &ActionCommands::removeKey);
Expand Down Expand Up @@ -1152,6 +1154,8 @@ void MainWindow2::setupKeyboardShortcuts()
ui->actionRemove_Frame->setShortcut(cmdKeySeq(CMD_REMOVE_FRAME));
ui->actionMove_Frame_Backward->setShortcut(cmdKeySeq(CMD_MOVE_FRAME_BACKWARD));
ui->actionMove_Frame_Forward->setShortcut(cmdKeySeq(CMD_MOVE_FRAME_FORWARD));
ui->actionFlip_inbetween->setShortcut(cmdKeySeq(CMD_FLIP_INBETWEEN));
ui->actionFlip_rolling->setShortcut(cmdKeySeq(CMD_FLIP_ROLLING));

ShortcutFilter* shortcutfilter = new ShortcutFilter(ui->scribbleArea, this);
ui->actionMove->setShortcut(cmdKeySeq(CMD_TOOL_MOVE));
Expand Down
53 changes: 53 additions & 0 deletions app/src/preferencesdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ GNU General Public License for more details.

#include <QComboBox>
#include <QMessageBox>
#include <QSlider>
#include "ui_preferencesdialog.h"
#include "ui_generalpage.h"
#include "ui_timelinepage.h"
Expand Down Expand Up @@ -293,12 +294,19 @@ TimelinePage::TimelinePage()
ui->setupUi(this);

auto spinBoxValueChange = static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged);
auto sliderChanged = static_cast<void(QSlider::*)(int)>(&QSlider::valueChanged);
connect(ui->timelineLength, spinBoxValueChange, this, &TimelinePage::timelineLengthChanged);
connect(ui->scrubBox, &QCheckBox::stateChanged, this, &TimelinePage::scrubChanged);
connect(ui->radioButtonAddNewKey, &QRadioButton::toggled, this, &TimelinePage::drawEmptyKeyRadioButtonToggled);
connect(ui->radioButtonDuplicate, &QRadioButton::toggled, this, &TimelinePage::drawEmptyKeyRadioButtonToggled);
connect(ui->radioButtonDrawOnPrev, &QRadioButton::toggled, this, &TimelinePage::drawEmptyKeyRadioButtonToggled);
connect(ui->onionWhilePlayback, &QCheckBox::stateChanged, this, &TimelinePage::playbackStateChanged);
connect(ui->flipRollMsecsSlider, sliderChanged, this, &TimelinePage::flipRollMsecSliderChanged);
connect(ui->flipRollMsecsSpinBox, spinBoxValueChange, this, &TimelinePage::flipRollMsecSpinboxChanged);
connect(ui->flipRollNumDrawingsSlider, sliderChanged, this, &TimelinePage::flipRollNumDrawingdSliderChanged);
connect(ui->flipRollNumDrawingsSpinBox, spinBoxValueChange, this, &TimelinePage::flipRollNumDrawingdSpinboxChanged);
connect(ui->flipInBtwnMsecSlider, sliderChanged, this, &TimelinePage::flipInbetweenMsecSliderChanged);
connect(ui->flipInBtwnMsecSpinBox, spinBoxValueChange, this, &TimelinePage::flipInbetweenMsecSpinboxChanged);
}

TimelinePage::~TimelinePage()
Expand Down Expand Up @@ -337,6 +345,12 @@ void TimelinePage::updateValues()

SignalBlocker b7(ui->onionWhilePlayback);
ui->onionWhilePlayback->setChecked(mManager->getInt(SETTING::ONION_WHILE_PLAYBACK));
ui->flipRollMsecsSlider->setValue(mManager->getInt(SETTING::FLIP_ROLL_MSEC));
ui->flipRollNumDrawingsSlider->setValue(mManager->getInt(SETTING::FLIP_ROLL_DRAWINGS));
ui->flipInBtwnMsecSlider->setValue(mManager->getInt(SETTING::FLIP_INBETWEEN_MSEC));
ui->flipRollMsecsSpinBox->setValue(mManager->getInt(SETTING::FLIP_ROLL_MSEC));
ui->flipRollNumDrawingsSpinBox->setValue(mManager->getInt(SETTING::FLIP_ROLL_DRAWINGS));
ui->flipInBtwnMsecSpinBox->setValue(mManager->getInt(SETTING::FLIP_INBETWEEN_MSEC));
}

void TimelinePage::timelineLengthChanged(int value)
Expand Down Expand Up @@ -375,6 +389,43 @@ void TimelinePage::drawEmptyKeyRadioButtonToggled(bool)
}
}

void TimelinePage::flipRollMsecSliderChanged(int value)
{
ui->flipRollMsecsSpinBox->setValue(value);
mManager->set(SETTING::FLIP_ROLL_MSEC, value);
}

void TimelinePage::flipRollMsecSpinboxChanged(int value)
{
ui->flipRollMsecsSlider->setValue(value);
mManager->set(SETTING::FLIP_ROLL_MSEC, value);
}

void TimelinePage::flipRollNumDrawingdSliderChanged(int value)
{
ui->flipRollNumDrawingsSpinBox->setValue(value);
mManager->set(SETTING::FLIP_ROLL_DRAWINGS, value);
}

void TimelinePage::flipRollNumDrawingdSpinboxChanged(int value)
{
ui->flipRollNumDrawingsSlider->setValue(value);
mManager->set(SETTING::FLIP_ROLL_DRAWINGS, value);
}

void TimelinePage::flipInbetweenMsecSliderChanged(int value)
{
ui->flipInBtwnMsecSpinBox->setValue(value);
mManager->set(SETTING::FLIP_INBETWEEN_MSEC, value);
}

void TimelinePage::flipInbetweenMsecSpinboxChanged(int value)
{
ui->flipInBtwnMsecSlider->setValue(value);
mManager->set(SETTING::FLIP_INBETWEEN_MSEC, value);
}


FilesPage::FilesPage()
: ui(new Ui::FilesPage)
{
Expand Down Expand Up @@ -457,3 +508,5 @@ void ToolsPage::onionNextFramesNumChange(int value)
{
mManager->set(SETTING::ONION_NEXT_FRAMES_NUM, value);
}


6 changes: 6 additions & 0 deletions app/src/preferencesdialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ public slots:
void scrubChanged(int);
void playbackStateChanged(int);
void drawEmptyKeyRadioButtonToggled(bool);
void flipRollMsecSliderChanged(int value);
void flipRollMsecSpinboxChanged(int value);
void flipRollNumDrawingdSliderChanged(int value);
void flipRollNumDrawingdSpinboxChanged(int value);
void flipInbetweenMsecSliderChanged(int value);
void flipInbetweenMsecSpinboxChanged(int value);

private:
Ui::TimelinePage* ui = nullptr;
Expand Down
13 changes: 13 additions & 0 deletions app/ui/mainwindow2.ui
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@
<addaction name="separator"/>
<addaction name="actionMove_Frame_Forward"/>
<addaction name="actionMove_Frame_Backward"/>
<addaction name="separator"/>
<addaction name="actionFlip_inbetween"/>
<addaction name="actionFlip_rolling"/>
</widget>
<widget class="QMenu" name="menuTools">
<property name="title">
Expand Down Expand Up @@ -961,6 +964,16 @@
<string>100%</string>
</property>
</action>
<action name="actionFlip_inbetween">
<property name="text">
<string>Flip inbetween</string>
</property>
</action>
<action name="actionFlip_rolling">
<property name="text">
<string>Flip rolling</string>
</property>
</action>
</widget>
<customwidgets>
<customwidget>
Expand Down
Loading

0 comments on commit b554aa1

Please sign in to comment.