Merge pull request #3182 from shun-iwasawa/g/modify_save_image_command
Modify "Save Images" Command
This commit is contained in:
commit
788dc6b759
2 changed files with 50 additions and 43 deletions
|
@ -163,34 +163,33 @@ inline TRectD getImageBoundsD(const TImageP &img) {
|
|||
FlipBook::FlipBook(QWidget *parent, QString viewerTitle,
|
||||
std::vector<int> flipConsoleButtonMask, UCHAR flags,
|
||||
bool isColorModel) //, bool showOnlyPlayBackgroundButton)
|
||||
: QWidget(parent),
|
||||
m_viewerTitle(viewerTitle),
|
||||
m_levelNames(),
|
||||
m_levels(),
|
||||
m_playSound(false),
|
||||
m_snd(0),
|
||||
m_player(0)
|
||||
: QWidget(parent)
|
||||
, m_viewerTitle(viewerTitle)
|
||||
, m_levelNames()
|
||||
, m_levels()
|
||||
, m_playSound(false)
|
||||
, m_snd(0)
|
||||
, m_player(0)
|
||||
//, m_doCompare(false)
|
||||
,
|
||||
m_currentFrameToSave(0),
|
||||
m_lw(),
|
||||
m_lr(),
|
||||
m_loadPopup(0),
|
||||
m_savePopup(0),
|
||||
m_shrink(1),
|
||||
m_isPreviewFx(false),
|
||||
m_previewedFx(0),
|
||||
m_previewXsh(0),
|
||||
m_previewUpdateTimer(this),
|
||||
m_xl(0),
|
||||
m_title1(),
|
||||
m_poolIndex(-1),
|
||||
m_freezed(false),
|
||||
m_loadbox(),
|
||||
m_dim(),
|
||||
m_loadboxes(),
|
||||
m_freezeButton(0),
|
||||
m_flags(flags) {
|
||||
, m_currentFrameToSave(0)
|
||||
, m_lw()
|
||||
, m_lr()
|
||||
, m_loadPopup(0)
|
||||
, m_savePopup(0)
|
||||
, m_shrink(1)
|
||||
, m_isPreviewFx(false)
|
||||
, m_previewedFx(0)
|
||||
, m_previewXsh(0)
|
||||
, m_previewUpdateTimer(this)
|
||||
, m_xl(0)
|
||||
, m_title1()
|
||||
, m_poolIndex(-1)
|
||||
, m_freezed(false)
|
||||
, m_loadbox()
|
||||
, m_dim()
|
||||
, m_loadboxes()
|
||||
, m_freezeButton(0)
|
||||
, m_flags(flags) {
|
||||
setAcceptDrops(true);
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
|
||||
|
@ -465,7 +464,7 @@ bool LoadImagesPopup::execute() { return doLoad(false); }
|
|||
|
||||
//-----------------------------------------------------------------------------
|
||||
/*! Append images with apply button
|
||||
*/
|
||||
*/
|
||||
bool LoadImagesPopup::executeApply() { return doLoad(true); }
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -575,7 +574,11 @@ void FlipBook::saveImages() {
|
|||
->getScene()
|
||||
->getProperties()
|
||||
->getOutputProperties();
|
||||
m_savePopup->setFolder(op->getPath().getParentDir());
|
||||
m_savePopup->setFolder(TApp::instance()
|
||||
->getCurrentScene()
|
||||
->getScene()
|
||||
->decodeFilePath(op->getPath())
|
||||
.getParentDir());
|
||||
m_savePopup->setFilename(op->getPath().withFrame().withoutParentDir());
|
||||
|
||||
m_savePopup->show();
|
||||
|
@ -1136,8 +1139,7 @@ void FlipBook::setLevel(const TFilePath &fp, TPalette *palette, int from,
|
|||
levelToPush.m_incrementalIndexing = incrementalIndexing;
|
||||
|
||||
int formatIdx = Preferences::instance()->matchLevelFormat(fp);
|
||||
if (formatIdx >= 0 &&
|
||||
Preferences::instance()
|
||||
if (formatIdx >= 0 && Preferences::instance()
|
||||
->levelFormat(formatIdx)
|
||||
.m_options.m_premultiply) {
|
||||
levelToPush.m_premultiply = true;
|
||||
|
@ -1655,7 +1657,7 @@ else*/
|
|||
//-----------------------------------------------------------------------------
|
||||
|
||||
/*! Set current level frame to image viewer. Add the view image in cache.
|
||||
*/
|
||||
*/
|
||||
void FlipBook::onDrawFrame(int frame, const ImagePainter::VisualSettings &vs) {
|
||||
try {
|
||||
m_imageViewer->setVisual(vs);
|
||||
|
|
|
@ -301,10 +301,6 @@ void ImageViewer::contextMenuEvent(QContextMenuEvent *event) {
|
|||
menu->addAction(action);
|
||||
action->setParent(m_flipbook);
|
||||
|
||||
if (m_flipbook->isSavable()) {
|
||||
action = menu->addAction(tr("Save Images"));
|
||||
connect(action, SIGNAL(triggered()), m_flipbook, SLOT(saveImages()));
|
||||
}
|
||||
menu->addSeparator();
|
||||
}
|
||||
|
||||
|
@ -345,10 +341,19 @@ void ImageViewer::contextMenuEvent(QContextMenuEvent *event) {
|
|||
}
|
||||
|
||||
if (m_visualSettings.m_doCompare) {
|
||||
if (!addedSep) menu->addSeparator();
|
||||
if (!addedSep) {
|
||||
menu->addSeparator();
|
||||
addedSep = true;
|
||||
}
|
||||
action = menu->addAction(tr("Swap Compared Images"));
|
||||
connect(action, SIGNAL(triggered()), SLOT(swapCompared()));
|
||||
}
|
||||
|
||||
if (m_flipbook->isSavable()) {
|
||||
if (!addedSep) menu->addSeparator();
|
||||
action = menu->addAction(tr("Save Images"));
|
||||
connect(action, SIGNAL(triggered()), m_flipbook, SLOT(saveImages()));
|
||||
}
|
||||
}
|
||||
|
||||
menu->exec(event->globalPos());
|
||||
|
|
Loading…
Reference in a new issue