Merge pull request #1071 from shun-iwasawa/fix_flipconsole_connection
Fix the Flipbook's console to be updated when the "Blank Frame" option is changed in the Preferences
This commit is contained in:
commit
9bc9a3315a
5 changed files with 16 additions and 16 deletions
|
@ -393,7 +393,7 @@ protected slots:
|
|||
void onFPSEdited();
|
||||
|
||||
public slots:
|
||||
void onPreferenceChanged();
|
||||
void onPreferenceChanged(const QString &);
|
||||
|
||||
private:
|
||||
friend class PlaybackExecutor;
|
||||
|
|
|
@ -807,11 +807,7 @@ bool ComboViewerPanel::isFrameAlreadyCached(int frame) {
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
void ComboViewerPanel::onPreferenceChanged(const QString &prefName) {
|
||||
// if no name specified (on showEvent), then process all updates
|
||||
if (prefName == "BlankCount" || prefName == "BlankColor" ||
|
||||
prefName.isEmpty())
|
||||
m_flipConsole->onPreferenceChanged();
|
||||
|
||||
m_flipConsole->onPreferenceChanged(prefName);
|
||||
StyleShortcutSwitchablePanel::onPreferenceChanged(prefName);
|
||||
}
|
||||
|
||||
|
|
|
@ -1872,9 +1872,9 @@ void FlipBook::showEvent(QShowEvent *e) {
|
|||
connect(sceneHandle, SIGNAL(sceneChanged()), m_imageViewer, SLOT(update()));
|
||||
// for updating the blank frame button
|
||||
if (!m_imageViewer->isColorModel()) {
|
||||
connect(sceneHandle, SIGNAL(preferenceChanged()), m_flipConsole,
|
||||
SLOT(onPreferenceChanged()));
|
||||
m_flipConsole->onPreferenceChanged();
|
||||
connect(sceneHandle, SIGNAL(preferenceChanged(const QString &)),
|
||||
m_flipConsole, SLOT(onPreferenceChanged(const QString &)));
|
||||
m_flipConsole->onPreferenceChanged("");
|
||||
}
|
||||
m_flipConsole->setActive(true);
|
||||
m_imageViewer->update();
|
||||
|
@ -1886,6 +1886,10 @@ void FlipBook::hideEvent(QHideEvent *e) {
|
|||
TSceneHandle *sceneHandle = TApp::instance()->getCurrentScene();
|
||||
disconnect(sceneHandle, SIGNAL(sceneChanged()), m_imageViewer,
|
||||
SLOT(update()));
|
||||
if (!m_imageViewer->isColorModel()) {
|
||||
disconnect(sceneHandle, SIGNAL(preferenceChanged(const QString &)),
|
||||
m_flipConsole, SLOT(onPreferenceChanged(const QString &)));
|
||||
}
|
||||
m_flipConsole->setActive(false);
|
||||
}
|
||||
|
||||
|
|
|
@ -657,12 +657,7 @@ void SceneViewerPanel::onFrameTypeChanged() {
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
void SceneViewerPanel::onPreferenceChanged(const QString &prefName) {
|
||||
// if no name specified (on StyleShortcutSelectivePanel::showEvent),
|
||||
// then process all updates
|
||||
if (prefName == "BlankCount" || prefName == "BlankColor" ||
|
||||
prefName.isEmpty())
|
||||
m_flipConsole->onPreferenceChanged();
|
||||
|
||||
m_flipConsole->onPreferenceChanged(prefName);
|
||||
StyleShortcutSwitchablePanel::onPreferenceChanged(prefName);
|
||||
}
|
||||
|
||||
|
|
|
@ -1847,7 +1847,12 @@ const std::vector<UCHAR> *FlipConsole::getProgressBarStatus() const {
|
|||
|
||||
//--------------------------------------------------------------------
|
||||
|
||||
void FlipConsole::onPreferenceChanged() {
|
||||
void FlipConsole::onPreferenceChanged(const QString &prefName) {
|
||||
// react only when related properties are changed
|
||||
if (prefName != "BlankCount" && prefName != "BlankColor" &&
|
||||
!prefName.isEmpty())
|
||||
return;
|
||||
|
||||
if (m_drawBlanksEnabled) {
|
||||
Preferences::instance()->getBlankValues(m_blanksCount, m_blankColor);
|
||||
if (m_blanksCount == 0) {
|
||||
|
|
Loading…
Reference in a new issue