Breakout frame creation options from Autocreate preference
This commit is contained in:
parent
588c760e8a
commit
77c9ef559e
3 changed files with 27 additions and 6 deletions
|
@ -301,7 +301,8 @@ TImage *TTool::touchImage() {
|
||||||
bool animationSheetEnabled = pref->isAnimationSheetEnabled();
|
bool animationSheetEnabled = pref->isAnimationSheetEnabled();
|
||||||
bool isAutoStretchEnabled = pref->isAutoStretchEnabled();
|
bool isAutoStretchEnabled = pref->isAutoStretchEnabled();
|
||||||
bool isAutoRenumberEnabled = pref->isAutorenumberEnabled();
|
bool isAutoRenumberEnabled = pref->isAutorenumberEnabled();
|
||||||
bool isCreateInHoldCellsEnabled = pref->isCreationInHoldCellsEnabled();
|
bool isCreateInHoldCellsEnabled =
|
||||||
|
isAutoCreateEnabled && pref->isCreationInHoldCellsEnabled();
|
||||||
|
|
||||||
TFrameHandle *currentFrame = m_application->getCurrentFrame();
|
TFrameHandle *currentFrame = m_application->getCurrentFrame();
|
||||||
TXshLevelHandle *currentLevel = m_application->getCurrentLevel();
|
TXshLevelHandle *currentLevel = m_application->getCurrentLevel();
|
||||||
|
|
|
@ -2613,6 +2613,8 @@ void TCellSelection::createBlankDrawing(int row, int col, bool multiple) {
|
||||||
|
|
||||||
ToolHandle *toolHandle = TApp::instance()->getCurrentTool();
|
ToolHandle *toolHandle = TApp::instance()->getCurrentTool();
|
||||||
|
|
||||||
|
//----- Going to cheat a little. Use autocreate rules to help create what we
|
||||||
|
// need
|
||||||
// If autocreate disabled, let's turn it on temporarily
|
// If autocreate disabled, let's turn it on temporarily
|
||||||
bool isAutoCreateEnabled = Preferences::instance()->isAutoCreateEnabled();
|
bool isAutoCreateEnabled = Preferences::instance()->isAutoCreateEnabled();
|
||||||
if (!isAutoCreateEnabled)
|
if (!isAutoCreateEnabled)
|
||||||
|
@ -2622,6 +2624,7 @@ void TCellSelection::createBlankDrawing(int row, int col, bool multiple) {
|
||||||
Preferences::instance()->isCreationInHoldCellsEnabled();
|
Preferences::instance()->isCreationInHoldCellsEnabled();
|
||||||
if (!isCreationInHoldCellsEnabled)
|
if (!isCreationInHoldCellsEnabled)
|
||||||
Preferences::instance()->setValue(EnableCreationInHoldCells, true, false);
|
Preferences::instance()->setValue(EnableCreationInHoldCells, true, false);
|
||||||
|
//------------------
|
||||||
|
|
||||||
TImage *img = toolHandle->getTool()->touchImage();
|
TImage *img = toolHandle->getTool()->touchImage();
|
||||||
|
|
||||||
|
@ -2629,11 +2632,13 @@ void TCellSelection::createBlankDrawing(int row, int col, bool multiple) {
|
||||||
TXshSimpleLevel *sl = cell.getSimpleLevel();
|
TXshSimpleLevel *sl = cell.getSimpleLevel();
|
||||||
|
|
||||||
if (!img || !sl) {
|
if (!img || !sl) {
|
||||||
|
//----- Restore previous states of autocreation
|
||||||
if (!isAutoCreateEnabled)
|
if (!isAutoCreateEnabled)
|
||||||
Preferences::instance()->setValue(EnableAutocreation, false, false);
|
Preferences::instance()->setValue(EnableAutocreation, false, false);
|
||||||
if (!isCreationInHoldCellsEnabled)
|
if (!isCreationInHoldCellsEnabled)
|
||||||
Preferences::instance()->setValue(EnableCreationInHoldCells, false,
|
Preferences::instance()->setValue(EnableCreationInHoldCells, false,
|
||||||
false);
|
false);
|
||||||
|
//------------------
|
||||||
if (!multiple)
|
if (!multiple)
|
||||||
DVGui::warning(QObject::tr(
|
DVGui::warning(QObject::tr(
|
||||||
"Unable to create a blank drawing on the current column"));
|
"Unable to create a blank drawing on the current column"));
|
||||||
|
@ -2641,11 +2646,13 @@ void TCellSelection::createBlankDrawing(int row, int col, bool multiple) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!toolHandle->getTool()->m_isFrameCreated) {
|
if (!toolHandle->getTool()->m_isFrameCreated) {
|
||||||
|
//----- Restore previous states of autocreation
|
||||||
if (!isAutoCreateEnabled)
|
if (!isAutoCreateEnabled)
|
||||||
Preferences::instance()->setValue(EnableAutocreation, false, false);
|
Preferences::instance()->setValue(EnableAutocreation, false, false);
|
||||||
if (!isCreationInHoldCellsEnabled)
|
if (!isCreationInHoldCellsEnabled)
|
||||||
Preferences::instance()->setValue(EnableCreationInHoldCells, false,
|
Preferences::instance()->setValue(EnableCreationInHoldCells, false,
|
||||||
false);
|
false);
|
||||||
|
//------------------
|
||||||
if (!multiple)
|
if (!multiple)
|
||||||
DVGui::warning(QObject::tr(
|
DVGui::warning(QObject::tr(
|
||||||
"Unable to replace the current drawing with a blank drawing"));
|
"Unable to replace the current drawing with a blank drawing"));
|
||||||
|
@ -2663,11 +2670,12 @@ void TCellSelection::createBlankDrawing(int row, int col, bool multiple) {
|
||||||
|
|
||||||
IconGenerator::instance()->invalidate(sl, frame);
|
IconGenerator::instance()->invalidate(sl, frame);
|
||||||
|
|
||||||
// Reset back to what these were
|
//----- Restore previous states of autocreation
|
||||||
if (!isAutoCreateEnabled)
|
if (!isAutoCreateEnabled)
|
||||||
Preferences::instance()->setValue(EnableAutocreation, false, false);
|
Preferences::instance()->setValue(EnableAutocreation, false, false);
|
||||||
if (!isCreationInHoldCellsEnabled)
|
if (!isCreationInHoldCellsEnabled)
|
||||||
Preferences::instance()->setValue(EnableCreationInHoldCells, false, false);
|
Preferences::instance()->setValue(EnableCreationInHoldCells, false, false);
|
||||||
|
//------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
@ -2764,6 +2772,8 @@ void TCellSelection::duplicateFrame(int row, int col, bool multiple) {
|
||||||
|
|
||||||
ToolHandle *toolHandle = TApp::instance()->getCurrentTool();
|
ToolHandle *toolHandle = TApp::instance()->getCurrentTool();
|
||||||
|
|
||||||
|
//----- Going to cheat a little. Use autocreate rules to help create what we
|
||||||
|
// need
|
||||||
// If autocreate disabled, let's turn it on temporarily
|
// If autocreate disabled, let's turn it on temporarily
|
||||||
bool isAutoCreateEnabled = Preferences::instance()->isAutoCreateEnabled();
|
bool isAutoCreateEnabled = Preferences::instance()->isAutoCreateEnabled();
|
||||||
if (!isAutoCreateEnabled)
|
if (!isAutoCreateEnabled)
|
||||||
|
@ -2773,14 +2783,17 @@ void TCellSelection::duplicateFrame(int row, int col, bool multiple) {
|
||||||
Preferences::instance()->isCreationInHoldCellsEnabled();
|
Preferences::instance()->isCreationInHoldCellsEnabled();
|
||||||
if (!isCreationInHoldCellsEnabled)
|
if (!isCreationInHoldCellsEnabled)
|
||||||
Preferences::instance()->setValue(EnableCreationInHoldCells, true, false);
|
Preferences::instance()->setValue(EnableCreationInHoldCells, true, false);
|
||||||
|
//------------------
|
||||||
|
|
||||||
TImage *img = toolHandle->getTool()->touchImage();
|
TImage *img = toolHandle->getTool()->touchImage();
|
||||||
if (!img) {
|
if (!img) {
|
||||||
|
//----- Restore previous states of autocreation
|
||||||
if (!isAutoCreateEnabled)
|
if (!isAutoCreateEnabled)
|
||||||
Preferences::instance()->setValue(EnableAutocreation, false, false);
|
Preferences::instance()->setValue(EnableAutocreation, false, false);
|
||||||
if (!isCreationInHoldCellsEnabled)
|
if (!isCreationInHoldCellsEnabled)
|
||||||
Preferences::instance()->setValue(EnableCreationInHoldCells, false,
|
Preferences::instance()->setValue(EnableCreationInHoldCells, false,
|
||||||
false);
|
false);
|
||||||
|
//------------------
|
||||||
if (!multiple)
|
if (!multiple)
|
||||||
DVGui::warning(
|
DVGui::warning(
|
||||||
QObject::tr("Unable to duplicate a drawing on the current column"));
|
QObject::tr("Unable to duplicate a drawing on the current column"));
|
||||||
|
@ -2789,11 +2802,13 @@ void TCellSelection::duplicateFrame(int row, int col, bool multiple) {
|
||||||
|
|
||||||
bool frameCreated = toolHandle->getTool()->m_isFrameCreated;
|
bool frameCreated = toolHandle->getTool()->m_isFrameCreated;
|
||||||
if (!frameCreated) {
|
if (!frameCreated) {
|
||||||
|
//----- Restore previous states of autocreation
|
||||||
if (!isAutoCreateEnabled)
|
if (!isAutoCreateEnabled)
|
||||||
Preferences::instance()->setValue(EnableAutocreation, false, false);
|
Preferences::instance()->setValue(EnableAutocreation, false, false);
|
||||||
if (!isCreationInHoldCellsEnabled)
|
if (!isCreationInHoldCellsEnabled)
|
||||||
Preferences::instance()->setValue(EnableCreationInHoldCells, false,
|
Preferences::instance()->setValue(EnableCreationInHoldCells, false,
|
||||||
false);
|
false);
|
||||||
|
//------------------
|
||||||
if (!multiple)
|
if (!multiple)
|
||||||
DVGui::warning(
|
DVGui::warning(
|
||||||
QObject::tr("Unable to replace the current or next drawing with a "
|
QObject::tr("Unable to replace the current or next drawing with a "
|
||||||
|
@ -2815,10 +2830,12 @@ void TCellSelection::duplicateFrame(int row, int col, bool multiple) {
|
||||||
new DuplicateDrawingUndo(sl, srcFrame, targetFrame);
|
new DuplicateDrawingUndo(sl, srcFrame, targetFrame);
|
||||||
TUndoManager::manager()->add(undo);
|
TUndoManager::manager()->add(undo);
|
||||||
|
|
||||||
|
//----- Restore previous states of autocreation
|
||||||
if (!isAutoCreateEnabled)
|
if (!isAutoCreateEnabled)
|
||||||
Preferences::instance()->setValue(EnableAutocreation, false, false);
|
Preferences::instance()->setValue(EnableAutocreation, false, false);
|
||||||
if (!isCreationInHoldCellsEnabled)
|
if (!isCreationInHoldCellsEnabled)
|
||||||
Preferences::instance()->setValue(EnableCreationInHoldCells, false, false);
|
Preferences::instance()->setValue(EnableCreationInHoldCells, false, false);
|
||||||
|
//------------------
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
|
@ -1656,13 +1656,16 @@ QWidget* PreferencesPopup::createDrawingPage() {
|
||||||
insertUI(newLevelSizeToCameraSizeEnabled, lay);
|
insertUI(newLevelSizeToCameraSizeEnabled, lay);
|
||||||
insertDualUIs(DefLevelWidth, DefLevelHeight, lay);
|
insertDualUIs(DefLevelWidth, DefLevelHeight, lay);
|
||||||
// insertUI(DefLevelDpi, lay);
|
// insertUI(DefLevelDpi, lay);
|
||||||
|
QGridLayout* creationLay = insertGroupBox(
|
||||||
|
tr("Frame Creation Options"), lay);
|
||||||
|
{
|
||||||
|
insertUI(NumberingSystem, creationLay, getComboItemList(NumberingSystem));
|
||||||
|
insertUI(EnableAutoStretch, creationLay);
|
||||||
|
insertUI(EnableAutoRenumber, creationLay);
|
||||||
|
}
|
||||||
QGridLayout* autoCreationLay = insertGroupBoxUI(EnableAutocreation, lay);
|
QGridLayout* autoCreationLay = insertGroupBoxUI(EnableAutocreation, lay);
|
||||||
{
|
{
|
||||||
insertUI(NumberingSystem, autoCreationLay,
|
|
||||||
getComboItemList(NumberingSystem));
|
|
||||||
insertUI(EnableAutoStretch, autoCreationLay);
|
|
||||||
insertUI(EnableCreationInHoldCells, autoCreationLay);
|
insertUI(EnableCreationInHoldCells, autoCreationLay);
|
||||||
insertUI(EnableAutoRenumber, autoCreationLay);
|
|
||||||
}
|
}
|
||||||
insertUI(vectorSnappingTarget, lay, getComboItemList(vectorSnappingTarget));
|
insertUI(vectorSnappingTarget, lay, getComboItemList(vectorSnappingTarget));
|
||||||
insertUI(saveUnpaintedInCleanup, lay);
|
insertUI(saveUnpaintedInCleanup, lay);
|
||||||
|
|
Loading…
Reference in a new issue