diff --git "a/stuff/config/loc/\346\227\245\346\234\254\350\252\236/toonz.qm" "b/stuff/config/loc/\346\227\245\346\234\254\350\252\236/toonz.qm" index 7ee97e2..62cf13f 100644 Binary files "a/stuff/config/loc/\346\227\245\346\234\254\350\252\236/toonz.qm" and "b/stuff/config/loc/\346\227\245\346\234\254\350\252\236/toonz.qm" differ diff --git "a/stuff/config/loc/\346\227\245\346\234\254\350\252\236/toonzqt.qm" "b/stuff/config/loc/\346\227\245\346\234\254\350\252\236/toonzqt.qm" index 2c04e32..951f7ff 100644 Binary files "a/stuff/config/loc/\346\227\245\346\234\254\350\252\236/toonzqt.qm" and "b/stuff/config/loc/\346\227\245\346\234\254\350\252\236/toonzqt.qm" differ diff --git a/stuff/config/qss/gray_048/gray_048.less b/stuff/config/qss/gray_048/gray_048.less index 4ac2735..2772ec8 100644 --- a/stuff/config/qss/gray_048/gray_048.less +++ b/stuff/config/qss/gray_048/gray_048.less @@ -91,7 +91,10 @@ QWidget { color: @m_baseTxtColor; - .baseBG; + .baseBG; + &:disabled{ + color: @m_disabledTxtColor; + } } QFrame { @@ -359,6 +362,10 @@ QGroupBox { &::indicator { &:extend(QCheckBox::indicator all); } + &:disabled{ + color: @m_base_darkH; + border-color: @m_disabledTxtColor; + } } QSplitter::handle @@ -1382,6 +1389,10 @@ QDialog #dialogButtonFrame { qproperty-icon: url("@{image_url}/gear.png"); } +#SubfolderButton { + qproperty-icon: url("@{image_url}/subfolder.png"); +} + #StartupLabel { padding: 3px; &:hover { diff --git a/stuff/config/qss/gray_048/gray_048.qss b/stuff/config/qss/gray_048/gray_048.qss index 931a685..f2d76cf 100644 --- a/stuff/config/qss/gray_048/gray_048.qss +++ b/stuff/config/qss/gray_048/gray_048.qss @@ -12,6 +12,9 @@ QWidget { color: #e6e6e6; background-color: #303030; } +QWidget:disabled { + color: #808080; +} QFrame { margin: 0px; border: 0px; @@ -363,6 +366,10 @@ QGroupBox::title { margin: -2px 0 0 0; padding: 0 3px; } +QGroupBox:disabled { + color: #0c0c0c; + border-color: #808080; +} QSplitter::handle { background-color: #707070; } @@ -1371,6 +1378,9 @@ QDialog #dialogButtonFrame { #GearButton { qproperty-icon: url("../gray_072/imgs/gear.png"); } +#SubfolderButton { + qproperty-icon: url("../gray_072/imgs/subfolder.png"); +} #StartupLabel { padding: 3px; } diff --git a/stuff/config/qss/gray_048/gray_048_mac.qss b/stuff/config/qss/gray_048/gray_048_mac.qss index 931a685..f2d76cf 100644 --- a/stuff/config/qss/gray_048/gray_048_mac.qss +++ b/stuff/config/qss/gray_048/gray_048_mac.qss @@ -12,6 +12,9 @@ QWidget { color: #e6e6e6; background-color: #303030; } +QWidget:disabled { + color: #808080; +} QFrame { margin: 0px; border: 0px; @@ -363,6 +366,10 @@ QGroupBox::title { margin: -2px 0 0 0; padding: 0 3px; } +QGroupBox:disabled { + color: #0c0c0c; + border-color: #808080; +} QSplitter::handle { background-color: #707070; } @@ -1371,6 +1378,9 @@ QDialog #dialogButtonFrame { #GearButton { qproperty-icon: url("../gray_072/imgs/gear.png"); } +#SubfolderButton { + qproperty-icon: url("../gray_072/imgs/subfolder.png"); +} #StartupLabel { padding: 3px; } diff --git a/stuff/config/qss/gray_072/gray_072.less b/stuff/config/qss/gray_072/gray_072.less index 56e0525..20a0e95 100644 --- a/stuff/config/qss/gray_072/gray_072.less +++ b/stuff/config/qss/gray_072/gray_072.less @@ -90,6 +90,9 @@ QWidget { color: @m_baseTxtColor; .baseBG; + &:disabled{ + color: @m_disabledTxtColor; + } } QFrame { @@ -357,6 +360,10 @@ QGroupBox { &::indicator { &:extend(QCheckBox::indicator all); } + &:disabled{ + color: @m_base_darkH; + border-color: @m_disabledTxtColor; + } } QSplitter::handle @@ -1381,6 +1388,10 @@ QDialog #dialogButtonFrame { qproperty-icon: url("@{image_url}/gear.png"); } +#SubfolderButton { + qproperty-icon: url("@{image_url}/subfolder.png"); +} + #StartupLabel { padding: 3px; &:hover { diff --git a/stuff/config/qss/gray_072/gray_072.qss b/stuff/config/qss/gray_072/gray_072.qss index 55c5137..7ed7c34 100644 --- a/stuff/config/qss/gray_072/gray_072.qss +++ b/stuff/config/qss/gray_072/gray_072.qss @@ -12,6 +12,9 @@ QWidget { color: #e6e6e6; background-color: #484848; } +QWidget:disabled { + color: #808080; +} QFrame { margin: 0px; border: 0px; @@ -363,6 +366,10 @@ QGroupBox::title { margin: -2px 0 0 0; padding: 0 3px; } +QGroupBox:disabled { + color: #202020; + border-color: #808080; +} QSplitter::handle { background-color: #888888; } @@ -1371,6 +1378,9 @@ QDialog #dialogButtonFrame { #GearButton { qproperty-icon: url("imgs/gear.png"); } +#SubfolderButton { + qproperty-icon: url("imgs/subfolder.png"); +} #StartupLabel { padding: 3px; } diff --git a/stuff/config/qss/gray_072/gray_072_mac.qss b/stuff/config/qss/gray_072/gray_072_mac.qss index 55c5137..7ed7c34 100644 --- a/stuff/config/qss/gray_072/gray_072_mac.qss +++ b/stuff/config/qss/gray_072/gray_072_mac.qss @@ -12,6 +12,9 @@ QWidget { color: #e6e6e6; background-color: #484848; } +QWidget:disabled { + color: #808080; +} QFrame { margin: 0px; border: 0px; @@ -363,6 +366,10 @@ QGroupBox::title { margin: -2px 0 0 0; padding: 0 3px; } +QGroupBox:disabled { + color: #202020; + border-color: #808080; +} QSplitter::handle { background-color: #888888; } @@ -1371,6 +1378,9 @@ QDialog #dialogButtonFrame { #GearButton { qproperty-icon: url("imgs/gear.png"); } +#SubfolderButton { + qproperty-icon: url("imgs/subfolder.png"); +} #StartupLabel { padding: 3px; } diff --git a/stuff/config/qss/gray_072/imgs/subfolder.png b/stuff/config/qss/gray_072/imgs/subfolder.png new file mode 100644 index 0000000..6c95142 Binary files /dev/null and b/stuff/config/qss/gray_072/imgs/subfolder.png differ diff --git a/stuff/config/qss/gray_128/gray_128.less b/stuff/config/qss/gray_128/gray_128.less index d2cc3e9..2254f17 100644 --- a/stuff/config/qss/gray_128/gray_128.less +++ b/stuff/config/qss/gray_128/gray_128.less @@ -1203,6 +1203,10 @@ QDialog #dialogButtonFrame { qproperty-icon: url("@{image_url}/gear.png"); } +#SubfolderButton { + qproperty-icon: url("@{image_url}/subfolder.png"); +} + #StartupLabel { padding: 3px; &:hover { diff --git a/stuff/config/qss/gray_128/gray_128.qss b/stuff/config/qss/gray_128/gray_128.qss index 4044761..2d04549 100644 --- a/stuff/config/qss/gray_128/gray_128.qss +++ b/stuff/config/qss/gray_128/gray_128.qss @@ -1106,6 +1106,9 @@ QDialog #dialogButtonFrame { #GearButton { qproperty-icon: url("imgs/gear.png"); } +#SubfolderButton { + qproperty-icon: url("imgs/subfolder.png"); +} #StartupLabel { padding: 3px; } diff --git a/stuff/config/qss/gray_128/gray_128_mac.qss b/stuff/config/qss/gray_128/gray_128_mac.qss index 4044761..2d04549 100644 --- a/stuff/config/qss/gray_128/gray_128_mac.qss +++ b/stuff/config/qss/gray_128/gray_128_mac.qss @@ -1106,6 +1106,9 @@ QDialog #dialogButtonFrame { #GearButton { qproperty-icon: url("imgs/gear.png"); } +#SubfolderButton { + qproperty-icon: url("imgs/subfolder.png"); +} #StartupLabel { padding: 3px; } diff --git a/stuff/config/qss/gray_128/imgs/subfolder.png b/stuff/config/qss/gray_128/imgs/subfolder.png new file mode 100644 index 0000000..1cb9607 Binary files /dev/null and b/stuff/config/qss/gray_128/imgs/subfolder.png differ diff --git a/toonz/sources/toonz/penciltestpopup.cpp b/toonz/sources/toonz/penciltestpopup.cpp index 3a8a4b1..5eb46a8 100644 --- a/toonz/sources/toonz/penciltestpopup.cpp +++ b/toonz/sources/toonz/penciltestpopup.cpp @@ -76,6 +76,17 @@ using namespace DVGui; // Connected camera TEnv::StringVar CamCapCameraName("CamCapCameraName", ""); +// Camera resolution +TEnv::StringVar CamCapCameraResolution("CamCapCameraResolution", ""); +// Whether to open save-in popup on launch +TEnv::IntVar CamCapOpenSaveInPopupOnLaunch("CamCapOpenSaveInPopupOnLaunch", 0); +// SaveInFolderPopup settings +TEnv::IntVar CamCapSaveInPopupSubFolder("CamCapSaveInPopupSubFolder", 0); +TEnv::StringVar CamCapSaveInPopupProject("CamCapSaveInPopupProject", ""); +TEnv::StringVar CamCapSaveInPopupEpisode("CamCapSaveInPopupEpisode", "1"); +TEnv::StringVar CamCapSaveInPopupSequence("CamCapSaveInPopupSequence", "1"); +TEnv::StringVar CamCapSaveInPopupScene("CamCapSaveInPopupScene", "1"); +TEnv::IntVar CamCapSaveInPopupAutoSubName("CamCapSaveInPopupAutoSubName", 1); namespace { @@ -569,6 +580,292 @@ void LevelNameLineEdit::onEditingFinished() { //============================================================================= +PencilTestSaveInFolderPopup::PencilTestSaveInFolderPopup(QWidget* parent) + : Dialog(parent, true, false, "PencilTestSaveInFolder") { + setWindowTitle("Create the Destination Subfolder to Save"); + + m_parentFolderField = new FileField( + this, QString("+%1").arg(QString::fromStdString(TProject::Extras))); + + m_subFolderCB = new QCheckBox(tr("Create Subfolder"), this); + + QFrame* subFolderFrame = new QFrame(this); + + QGroupBox* infoGroupBox = new QGroupBox(tr("Infomation"), this); + QGroupBox* subNameGroupBox = new QGroupBox(tr("Subfolder Name"), this); + + m_projectField = new QLineEdit(this); + m_episodeField = new QLineEdit(this); + m_sequenceField = new QLineEdit(this); + m_sceneField = new QLineEdit(this); + + m_autoSubNameCB = new QCheckBox(tr("Auto Format:"), this); + m_subNameFormatCombo = new QComboBox(this); + m_subFolderNameField = new QLineEdit(this); + + QCheckBox* showPopupOnLaunchCB = + new QCheckBox(tr("Show This on Launch of the Camera Capture"), this); + + QPushButton* okBtn = new QPushButton(tr("OK"), this); + QPushButton* cancelBtn = new QPushButton(tr("Cancel"), this); + + //---- properties + + m_subFolderCB->setChecked(CamCapSaveInPopupSubFolder != 0); + subFolderFrame->setEnabled(CamCapSaveInPopupSubFolder != 0); + + // project name + QString prjName = QString::fromStdString(CamCapSaveInPopupProject.getValue()); + if (prjName.isEmpty()) { + prjName = TProjectManager::instance() + ->getCurrentProject() + ->getName() + .getQString(); + } + m_projectField->setText(prjName); + + m_episodeField->setText( + QString::fromStdString(CamCapSaveInPopupEpisode.getValue())); + m_sequenceField->setText( + QString::fromStdString(CamCapSaveInPopupSequence.getValue())); + m_sceneField->setText( + QString::fromStdString(CamCapSaveInPopupScene.getValue())); + + m_autoSubNameCB->setChecked(CamCapSaveInPopupAutoSubName != 0); + m_subNameFormatCombo->setEnabled(CamCapSaveInPopupAutoSubName != 0); + QStringList items; + items << tr("C- + Sequence + Scene") << tr("Sequence + Scene") + << tr("Episode + Sequence + Scene") + << tr("Project + Episode + Sequence + Scene"); + m_subNameFormatCombo->addItems(items); + + showPopupOnLaunchCB->setChecked(CamCapOpenSaveInPopupOnLaunch != 0); + + addButtonBarWidget(okBtn, cancelBtn); + + //---- layout + m_topLayout->setMargin(10); + m_topLayout->setSpacing(10); + { + QHBoxLayout* saveInLay = new QHBoxLayout(); + saveInLay->setMargin(0); + saveInLay->setSpacing(3); + { + saveInLay->addWidget(new QLabel(tr("Save In:"), this), 0); + saveInLay->addWidget(m_parentFolderField, 1); + } + m_topLayout->addLayout(saveInLay); + + m_topLayout->addWidget(m_subFolderCB, 0, Qt::AlignLeft); + + QVBoxLayout* subFolderLay = new QVBoxLayout(); + subFolderLay->setMargin(0); + subFolderLay->setSpacing(10); + { + QGridLayout* infoLay = new QGridLayout(); + infoLay->setMargin(10); + infoLay->setHorizontalSpacing(3); + infoLay->setVerticalSpacing(10); + { + infoLay->addWidget(new QLabel(tr("Project:"), this), 0, 0); + infoLay->addWidget(m_projectField, 0, 1); + + infoLay->addWidget(new QLabel(tr("Episode:"), this), 1, 0); + infoLay->addWidget(m_episodeField, 1, 1); + + infoLay->addWidget(new QLabel(tr("Sequence:"), this), 2, 0); + infoLay->addWidget(m_sequenceField, 2, 1); + + infoLay->addWidget(new QLabel(tr("Scene:"), this), 3, 0); + infoLay->addWidget(m_sceneField, 3, 1); + } + infoLay->setColumnStretch(0, 0); + infoLay->setColumnStretch(1, 1); + infoGroupBox->setLayout(infoLay); + subFolderLay->addWidget(infoGroupBox, 0); + + QGridLayout* subNameLay = new QGridLayout(); + subNameLay->setMargin(10); + subNameLay->setHorizontalSpacing(3); + subNameLay->setVerticalSpacing(10); + { + subNameLay->addWidget(m_autoSubNameCB, 0, 0); + subNameLay->addWidget(m_subNameFormatCombo, 0, 1); + + subNameLay->addWidget(new QLabel(tr("Subfolder Name:"), this), 1, 0); + subNameLay->addWidget(m_subFolderNameField, 1, 1); + } + subNameLay->setColumnStretch(0, 0); + subNameLay->setColumnStretch(1, 1); + subNameGroupBox->setLayout(subNameLay); + subFolderLay->addWidget(subNameGroupBox, 0); + } + subFolderFrame->setLayout(subFolderLay); + m_topLayout->addWidget(subFolderFrame); + + m_topLayout->addWidget(showPopupOnLaunchCB, 0, Qt::AlignLeft); + + m_topLayout->addStretch(1); + } + + resize(300, 400); + + //---- signal-slot connection + bool ret = true; + + ret = ret && connect(m_subFolderCB, SIGNAL(clicked(bool)), subFolderFrame, + SLOT(setEnabled(bool))); + ret = ret && connect(m_projectField, SIGNAL(textEdited(const QString&)), this, + SLOT(updateSubFolderName())); + ret = ret && connect(m_episodeField, SIGNAL(textEdited(const QString&)), this, + SLOT(updateSubFolderName())); + ret = ret && connect(m_sequenceField, SIGNAL(textEdited(const QString&)), + this, SLOT(updateSubFolderName())); + ret = ret && connect(m_sceneField, SIGNAL(textEdited(const QString&)), this, + SLOT(updateSubFolderName())); + ret = ret && connect(m_autoSubNameCB, SIGNAL(clicked(bool)), this, + SLOT(onAutoSubNameCBClicked(bool))); + + ret = ret && connect(showPopupOnLaunchCB, SIGNAL(clicked(bool)), this, + SLOT(onShowPopupOnLaunchCBClicked(bool))); + + ret = ret && connect(okBtn, SIGNAL(clicked(bool)), this, SLOT(onOkPressed())); + ret = ret && connect(cancelBtn, SIGNAL(clicked(bool)), this, SLOT(reject())); + + assert(ret); + + updateSubFolderName(); +} + +//----------------------------------------------------------------------------- + +QString PencilTestSaveInFolderPopup::getPath() { + if (!m_subFolderCB->isChecked()) return m_parentFolderField->getPath(); + + return m_parentFolderField->getPath() + "\\" + m_subFolderNameField->text(); +} + +//----------------------------------------------------------------------------- +namespace { +QString formatString(QString inStr, int charNum) { + if (inStr.isEmpty()) return QString("0").rightJustified(charNum, '0'); + + QString numStr, postStr; + // find the first non-digit character + int index = inStr.indexOf(QRegExp("[^0-9]"), 0); + + if (index == -1) // only digits + numStr = inStr; + else if (index == 0) // only post strings + return inStr; + else { // contains both + numStr = inStr.left(index); + postStr = inStr.right(inStr.length() - index); + } + return numStr.rightJustified(charNum, '0') + postStr; +} +}; + +void PencilTestSaveInFolderPopup::updateSubFolderName() { + if (!m_autoSubNameCB->isChecked()) return; + + QString episodeStr = formatString(m_episodeField->text(), 3); + QString sequenceStr = formatString(m_sequenceField->text(), 3); + QString sceneStr = formatString(m_sceneField->text(), 4); + + QString str; + + switch (m_subNameFormatCombo->currentIndex()) { + case 0: // C- + Sequence + Scene + str = QString("C-%1-%2").arg(sequenceStr).arg(sceneStr); + break; + case 1: // Sequence + Scene + str = QString("%1-%2").arg(sequenceStr).arg(sceneStr); + break; + case 2: // Episode + Sequence + Scene + str = QString("%1-%2-%3").arg(episodeStr).arg(sequenceStr).arg(sceneStr); + break; + case 3: // Project + Episode + Sequence + Scene + str = QString("%1-%2-%3-%4") + .arg(m_projectField->text()) + .arg(episodeStr) + .arg(sequenceStr) + .arg(sceneStr); + break; + default: + return; + } + m_subFolderNameField->setText(str); +} + +//----------------------------------------------------------------------------- + +void PencilTestSaveInFolderPopup::onAutoSubNameCBClicked(bool on) { + m_subNameFormatCombo->setEnabled(on); + updateSubFolderName(); +} + +//----------------------------------------------------------------------------- + +void PencilTestSaveInFolderPopup::onShowPopupOnLaunchCBClicked(bool on) { + CamCapOpenSaveInPopupOnLaunch = (on) ? 1 : 0; +} + +//----------------------------------------------------------------------------- + +void PencilTestSaveInFolderPopup::onOkPressed() { + if (!m_subFolderCB->isChecked()) { + accept(); + return; + } + + // check the subFolder value + QString subFolderName = m_subFolderNameField->text(); + if (subFolderName.isEmpty()) { + DVGui::MsgBox(WARNING, tr("Subfolder name should not be empty.")); + return; + } + + int index = subFolderName.indexOf(QRegExp("[\\]:;|=,\\[\\*\\.\"/\\\\]"), 0); + if (index >= 0) { + DVGui::MsgBox(WARNING, tr("Subfolder name should not contain following " + "characters: * . \" / \\ [ ] : ; | = , ")); + return; + } + + TFilePath fp(m_parentFolderField->getPath()); + fp += TFilePath(subFolderName); + TFilePath actualFp = + TApp::instance()->getCurrentScene()->getScene()->decodeFilePath(fp); + + if (QFileInfo::exists(actualFp.getQString())) { + DVGui::MsgBox(WARNING, + tr("Folder %1 already exists.").arg(actualFp.getQString())); + return; + } + + // save the current properties to env data + CamCapSaveInPopupSubFolder = (m_subFolderCB->isChecked()) ? 1 : 0; + CamCapSaveInPopupProject = m_projectField->text().toStdString(); + CamCapSaveInPopupEpisode = m_episodeField->text().toStdString(); + CamCapSaveInPopupSequence = m_sequenceField->text().toStdString(); + CamCapSaveInPopupScene = m_sceneField->text().toStdString(); + CamCapSaveInPopupAutoSubName = (m_autoSubNameCB->isChecked()) ? 1 : 0; + + // create folder + try { + TSystem::mkDir(actualFp); + } catch (...) { + MsgBox(CRITICAL, tr("It is not possible to create the %1 folder.") + .arg(toQString(actualFp))); + return; + } + + accept(); +} + +//============================================================================= + PencilTestPopup::PencilTestPopup() // set the parent 0 in order to enable the popup behind the main window : Dialog(0, false, false, "PencilTest"), @@ -643,6 +940,11 @@ PencilTestPopup::PencilTestPopup() #else m_captureFilterSettingsBtn = 0; #endif + + QPushButton* subfolderButton = new QPushButton(tr("Subfolder"), this); + + m_saveInFolderPopup = new PencilTestSaveInFolderPopup(this); + //---- m_resolutionCombo->setMaximumWidth(fontMetrics().width("0000 x 0000") + 25); @@ -702,168 +1004,171 @@ PencilTestPopup::PencilTestPopup() tr("Video Capture Filter Settings...")); } + subfolderButton->setObjectName("SubfolderButton"); + subfolderButton->setIconSize(QSize(15, 15)); + m_saveInFileFld->setMaximumWidth(380); + + m_saveInFolderPopup->hide(); + //---- layout ---- - QHBoxLayout* mainLay = new QHBoxLayout(); - mainLay->setMargin(0); - mainLay->setSpacing(10); + m_topLayout->setMargin(10); + m_topLayout->setSpacing(10); { - QVBoxLayout* leftLay = new QVBoxLayout(); - leftLay->setMargin(5); - leftLay->setSpacing(10); + QHBoxLayout* camLay = new QHBoxLayout(); + camLay->setMargin(0); + camLay->setSpacing(3); { - QHBoxLayout* camLay = new QHBoxLayout(); - camLay->setMargin(0); - camLay->setSpacing(3); - { - camLay->addWidget(new QLabel(tr("Camera:"), this), 0); - camLay->addWidget(m_cameraListCombo, 1); - camLay->addWidget(refreshCamListButton, 0); + camLay->addWidget(new QLabel(tr("Camera:"), this), 0); + camLay->addWidget(m_cameraListCombo, 1); + camLay->addWidget(refreshCamListButton, 0); + camLay->addSpacing(10); + camLay->addWidget(new QLabel(tr("Resolution:"), this), 0); + camLay->addWidget(m_resolutionCombo, 1); + + if (m_captureFilterSettingsBtn) { camLay->addSpacing(10); - camLay->addWidget(new QLabel(tr("Resolution:"), this), 0); - camLay->addWidget(m_resolutionCombo, 1); + camLay->addWidget(m_captureFilterSettingsBtn); + } - if (m_captureFilterSettingsBtn) { - camLay->addSpacing(10); - camLay->addWidget(m_captureFilterSettingsBtn); - } + camLay->addStretch(0); + camLay->addSpacing(15); + camLay->addWidget(new QLabel(tr("Save In:"), this), 0); + camLay->addWidget(m_saveInFileFld, 1); - camLay->addStretch(0); - } - leftLay->addLayout(camLay, 0); - leftLay->addWidget(m_cameraViewfinder, 1); + camLay->addSpacing(10); + camLay->addWidget(subfolderButton, 0); } - mainLay->addLayout(leftLay, 1); + m_topLayout->addLayout(camLay, 0); - QVBoxLayout* rightLay = new QVBoxLayout(); - rightLay->setMargin(0); - rightLay->setSpacing(5); + QHBoxLayout* bottomLay = new QHBoxLayout(); + bottomLay->setMargin(0); + bottomLay->setSpacing(10); { - QVBoxLayout* fileLay = new QVBoxLayout(); - fileLay->setMargin(10); - fileLay->setSpacing(10); - { - QGridLayout* levelLay = new QGridLayout(); - levelLay->setMargin(0); - levelLay->setHorizontalSpacing(3); - levelLay->setVerticalSpacing(10); - { - levelLay->addWidget(new QLabel(tr("Name:"), this), 0, 0, - Qt::AlignRight); - levelLay->addWidget(m_levelNameEdit, 0, 1); - levelLay->addWidget(nextLevelButton, 0, 2); + bottomLay->addWidget(m_cameraViewfinder, 1); - levelLay->addWidget(new QLabel(tr("Frame:"), this), 1, 0, - Qt::AlignRight); - levelLay->addWidget(m_frameNumberEdit, 1, 1); - } - levelLay->setColumnStretch(0, 0); - levelLay->setColumnStretch(1, 1); - levelLay->setColumnStretch(2, 0); - fileLay->addLayout(levelLay, 0); - - QHBoxLayout* fileTypeLay = new QHBoxLayout(); - fileTypeLay->setMargin(0); - fileTypeLay->setSpacing(3); + QVBoxLayout* rightLay = new QVBoxLayout(); + rightLay->setMargin(0); + rightLay->setSpacing(5); + { + QVBoxLayout* fileLay = new QVBoxLayout(); + fileLay->setMargin(10); + fileLay->setSpacing(10); { - fileTypeLay->addWidget(new QLabel(tr("File Type:"), this), 0); - fileTypeLay->addWidget(m_fileTypeCombo, 1); - fileTypeLay->addSpacing(10); - fileTypeLay->addWidget(m_fileFormatOptionButton); + QGridLayout* levelLay = new QGridLayout(); + levelLay->setMargin(0); + levelLay->setHorizontalSpacing(3); + levelLay->setVerticalSpacing(10); + { + levelLay->addWidget(new QLabel(tr("Name:"), this), 0, 0, + Qt::AlignRight); + levelLay->addWidget(m_levelNameEdit, 0, 1); + levelLay->addWidget(nextLevelButton, 0, 2); + + levelLay->addWidget(new QLabel(tr("Frame:"), this), 1, 0, + Qt::AlignRight); + levelLay->addWidget(m_frameNumberEdit, 1, 1); + } + levelLay->setColumnStretch(0, 0); + levelLay->setColumnStretch(1, 1); + levelLay->setColumnStretch(2, 0); + fileLay->addLayout(levelLay, 0); + + QHBoxLayout* fileTypeLay = new QHBoxLayout(); + fileTypeLay->setMargin(0); + fileTypeLay->setSpacing(3); + { + fileTypeLay->addWidget(new QLabel(tr("File Type:"), this), 0); + fileTypeLay->addWidget(m_fileTypeCombo, 1); + fileTypeLay->addSpacing(10); + fileTypeLay->addWidget(m_fileFormatOptionButton); + } + fileLay->addLayout(fileTypeLay, 0); + + fileLay->addWidget(m_saveOnCaptureCB, 0); } - fileLay->addLayout(fileTypeLay, 0); + fileFrame->setLayout(fileLay); + rightLay->addWidget(fileFrame, 0); - QHBoxLayout* saveInLay = new QHBoxLayout(); - saveInLay->setMargin(0); - saveInLay->setSpacing(3); + QGridLayout* imageLay = new QGridLayout(); + imageLay->setMargin(10); + imageLay->setHorizontalSpacing(3); + imageLay->setVerticalSpacing(10); { - saveInLay->addWidget(new QLabel(tr("Save In:"), this), 0); - saveInLay->addWidget(m_saveInFileFld, 1); - } - fileLay->addLayout(saveInLay, 0); - - fileLay->addWidget(m_saveOnCaptureCB, 0); - } - fileFrame->setLayout(fileLay); - rightLay->addWidget(fileFrame, 0); + imageLay->addWidget(new QLabel(tr("Color type:"), this), 0, 0, + Qt::AlignRight); + imageLay->addWidget(m_colorTypeCombo, 0, 1); - QGridLayout* imageLay = new QGridLayout(); - imageLay->setMargin(10); - imageLay->setHorizontalSpacing(3); - imageLay->setVerticalSpacing(10); - { - imageLay->addWidget(new QLabel(tr("Color type:"), this), 0, 0, - Qt::AlignRight); - imageLay->addWidget(m_colorTypeCombo, 0, 1); + imageLay->addWidget(new QLabel(tr("Threshold:"), this), 1, 0, + Qt::AlignRight); + imageLay->addWidget(m_thresholdFld, 1, 1, 1, 2); - imageLay->addWidget(new QLabel(tr("Threshold:"), this), 1, 0, - Qt::AlignRight); - imageLay->addWidget(m_thresholdFld, 1, 1, 1, 2); + imageLay->addWidget(new QLabel(tr("Contrast:"), this), 2, 0, + Qt::AlignRight); + imageLay->addWidget(m_contrastFld, 2, 1, 1, 2); - imageLay->addWidget(new QLabel(tr("Contrast:"), this), 2, 0, - Qt::AlignRight); - imageLay->addWidget(m_contrastFld, 2, 1, 1, 2); + imageLay->addWidget(new QLabel(tr("Brightness:"), this), 3, 0, + Qt::AlignRight); + imageLay->addWidget(m_brightnessFld, 3, 1, 1, 2); - imageLay->addWidget(new QLabel(tr("Brightness:"), this), 3, 0, - Qt::AlignRight); - imageLay->addWidget(m_brightnessFld, 3, 1, 1, 2); + imageLay->addWidget(m_upsideDownCB, 4, 0, 1, 3, Qt::AlignLeft); - imageLay->addWidget(m_upsideDownCB, 4, 0, 1, 3, Qt::AlignLeft); + imageLay->addWidget(new QLabel(tr("BG reduction:"), this), 5, 0, + Qt::AlignRight); + imageLay->addWidget(m_bgReductionFld, 5, 1, 1, 2); - imageLay->addWidget(new QLabel(tr("BG reduction:"), this), 5, 0, - Qt::AlignRight); - imageLay->addWidget(m_bgReductionFld, 5, 1, 1, 2); + imageLay->addWidget(m_captureWhiteBGButton, 6, 0, 1, 3); + } + imageLay->setColumnStretch(0, 0); + imageLay->setColumnStretch(1, 0); + imageLay->setColumnStretch(2, 1); + imageFrame->setLayout(imageLay); + rightLay->addWidget(imageFrame, 0); + + QGridLayout* displayLay = new QGridLayout(); + displayLay->setMargin(10); + displayLay->setHorizontalSpacing(3); + displayLay->setVerticalSpacing(10); + { + displayLay->addWidget(m_onionSkinCB, 0, 0, 1, 2); - imageLay->addWidget(m_captureWhiteBGButton, 6, 0, 1, 3); - } - imageLay->setColumnStretch(0, 0); - imageLay->setColumnStretch(1, 0); - imageLay->setColumnStretch(2, 1); - imageFrame->setLayout(imageLay); - rightLay->addWidget(imageFrame, 0); - - QGridLayout* displayLay = new QGridLayout(); - displayLay->setMargin(10); - displayLay->setHorizontalSpacing(3); - displayLay->setVerticalSpacing(10); - { - displayLay->addWidget(m_onionSkinCB, 0, 0, 1, 2); + displayLay->addWidget(new QLabel(tr("Opacity(%):"), this), 1, 0, + Qt::AlignRight); + displayLay->addWidget(m_onionOpacityFld, 1, 1); + displayLay->addWidget(m_loadImageButton, 2, 0, 1, 2); + } + displayLay->setColumnStretch(0, 0); + displayLay->setColumnStretch(1, 1); + // displayLay->setColumnStretch(2, 1); + displayFrame->setLayout(displayLay); + rightLay->addWidget(displayFrame); + + QGridLayout* timerLay = new QGridLayout(); + timerLay->setMargin(10); + timerLay->setHorizontalSpacing(3); + timerLay->setVerticalSpacing(10); + { + timerLay->addWidget(m_timerCB, 0, 0, 1, 2); - displayLay->addWidget(new QLabel(tr("Opacity(%):"), this), 1, 0, + timerLay->addWidget(new QLabel(tr("Interval(sec):"), this), 1, 0, Qt::AlignRight); - displayLay->addWidget(m_onionOpacityFld, 1, 1); - displayLay->addWidget(m_loadImageButton, 2, 0, 1, 2); - } - displayLay->setColumnStretch(0, 0); - displayLay->setColumnStretch(1, 1); - // displayLay->setColumnStretch(2, 1); - displayFrame->setLayout(displayLay); - rightLay->addWidget(displayFrame); - - QGridLayout* timerLay = new QGridLayout(); - timerLay->setMargin(10); - timerLay->setHorizontalSpacing(3); - timerLay->setVerticalSpacing(10); - { - timerLay->addWidget(m_timerCB, 0, 0, 1, 2); - - timerLay->addWidget(new QLabel(tr("Interval(sec):"), this), 1, 0, - Qt::AlignRight); - timerLay->addWidget(m_timerIntervalFld, 1, 1); - } - timerLay->setColumnStretch(0, 0); - timerLay->setColumnStretch(1, 1); - timerFrame->setLayout(timerLay); - rightLay->addWidget(timerFrame); + timerLay->addWidget(m_timerIntervalFld, 1, 1); + } + timerLay->setColumnStretch(0, 0); + timerLay->setColumnStretch(1, 1); + timerFrame->setLayout(timerLay); + rightLay->addWidget(timerFrame); - rightLay->addStretch(1); + rightLay->addStretch(1); - rightLay->addWidget(m_captureButton, 0); - rightLay->addSpacing(20); - rightLay->addWidget(closeButton, 0); + rightLay->addWidget(m_captureButton, 0); + rightLay->addSpacing(20); + rightLay->addWidget(closeButton, 0); + rightLay->addSpacing(10); + } + bottomLay->addLayout(rightLay, 0); } - mainLay->addLayout(rightLay, 0); + m_topLayout->addLayout(bottomLay, 1); } - m_topLayout->addLayout(mainLay); //---- signal-slot connections ---- bool ret = true; @@ -904,6 +1209,8 @@ PencilTestPopup::PencilTestPopup() if (m_captureFilterSettingsBtn) ret = ret && connect(m_captureFilterSettingsBtn, SIGNAL(pressed()), this, SLOT(onCaptureFilterSettingsBtnPressed())); + ret = ret && connect(subfolderButton, SIGNAL(clicked(bool)), this, + SLOT(openSaveInFolderPopup())); assert(ret); refreshCameraList(); @@ -915,6 +1222,15 @@ PencilTestPopup::PencilTestPopup() onCameraListComboActivated(startupCamIndex); } + QString resStr = QString::fromStdString(CamCapCameraResolution.getValue()); + if (m_currentCamera && !resStr.isEmpty()) { + int startupResolutionIndex = m_resolutionCombo->findText(resStr); + if (startupResolutionIndex > 0) { + m_resolutionCombo->setCurrentIndex(startupResolutionIndex); + onResolutionComboActivated(resStr); + } + } + onNextName(); } @@ -1076,6 +1392,9 @@ void PencilTestPopup::onResolutionComboActivated(const QString& itemText) { m_currentCamera->start(); m_cameraViewfinder->setImage(QImage()); + + // update env + CamCapCameraResolution = itemText.toStdString(); } //----------------------------------------------------------------------------- @@ -1606,4 +1925,24 @@ void PencilTestPopup::onCaptureFilterSettingsBtnPressed() { //----------------------------------------------------------------------------- -OpenPopupCommandHandler openPencilTestPopup(MI_PencilTest); \ No newline at end of file +void PencilTestPopup::openSaveInFolderPopup() { + if (m_saveInFolderPopup->exec()) { + QString oldPath = m_saveInFileFld->getPath(); + m_saveInFileFld->setPath(m_saveInFolderPopup->getPath()); + if (oldPath == m_saveInFileFld->getPath()) onNextName(); + } +} + +//----------------------------------------------------------------------------- + +OpenPopupCommandHandler openPencilTestPopup(MI_PencilTest); + +// specialized in order to call openSaveInFolderPopup() +template <> +void OpenPopupCommandHandler::execute() { + if (!m_popup) m_popup = new PencilTestPopup(); + m_popup->show(); + m_popup->raise(); + m_popup->activateWindow(); + if (CamCapOpenSaveInPopupOnLaunch != 0) m_popup->openSaveInFolderPopup(); +} \ No newline at end of file diff --git a/toonz/sources/toonz/penciltestpopup.h b/toonz/sources/toonz/penciltestpopup.h index d8724ed..6697fc8 100644 --- a/toonz/sources/toonz/penciltestpopup.h +++ b/toonz/sources/toonz/penciltestpopup.h @@ -122,6 +122,31 @@ signals: }; //============================================================================= +// PencilTestSaveInFolderPopup +//----------------------------------------------------------------------------- + +class PencilTestSaveInFolderPopup : public DVGui::Dialog { + Q_OBJECT + + DVGui::FileField* m_parentFolderField; + QLineEdit *m_projectField, *m_episodeField, *m_sequenceField, *m_sceneField, + *m_subFolderNameField; + + QCheckBox *m_subFolderCB, *m_autoSubNameCB; + QComboBox* m_subNameFormatCombo; + +public: + PencilTestSaveInFolderPopup(QWidget* parent = 0); + QString getPath(); + +protected slots: + void updateSubFolderName(); + void onAutoSubNameCBClicked(bool); + void onShowPopupOnLaunchCBClicked(bool); + void onOkPressed(); +}; + +//============================================================================= // PencilTestPopup //----------------------------------------------------------------------------- @@ -151,6 +176,8 @@ class PencilTestPopup : public DVGui::Dialog { // used only for Windows QPushButton* m_captureFilterSettingsBtn; + PencilTestSaveInFolderPopup* m_saveInFolderPopup; + int m_timerId; QString m_cacheImagePath; bool m_captureWhiteBGCue; @@ -189,6 +216,9 @@ protected slots: void onCaptureButtonClicked(bool); void onCaptureFilterSettingsBtnPressed(); + +public slots: + void openSaveInFolderPopup(); }; #endif \ No newline at end of file diff --git a/toonz/sources/translations/japanese/toonz.ts b/toonz/sources/translations/japanese/toonz.ts index d6f3aa4..f3cb3c8 100644 --- a/toonz/sources/translations/japanese/toonz.ts +++ b/toonz/sources/translations/japanese/toonz.ts @@ -118,6 +118,31 @@ + AudioRecordingPopup + + Audio Recording + 録音 + + + Save and Insert + 保存して挿入 + + + Sync with XSheet + タイムシートと同期する + + + + + + + The microphone is not available: +Please select a different device or check the microphone. + マイクが使用できません: +別のデバイスを選択するか、マイクを確認して下さい。 + + + AutocenterPopup Autocenter @@ -4480,6 +4505,14 @@ Do you want to create it? &Startup Popup... スタートアップウィンドウ(&S) ... + + &Fast Render to MP4 + MP4ムービーをレンダリング (&F) + + + Record Audio + 録音する + MatchlinesDialog @@ -5043,6 +5076,10 @@ What do you want to do? Warning 警告 + + Render + レンダリング + OverwriteDialog @@ -5302,6 +5339,113 @@ Do you want to overwrite it? Video Capture Filter Settings... ビデオキャプチャ設定 ... + + Load Selected Image + 選択した画像を読み込み + + + Subfolder + カットフォルダ + + + No image selected. Please select an image in the Xsheet. + 画像が選択されていません。タイムシート内から選択して下さい。 + + + The selected image is not in a raster level. + 選択された画像はラスターレベルではありません。 + + + The selected image size does not match the current camera settings. + 選択された画像のサイズが、現在のカメラサイズと一致しません。 + + + + PencilTestSaveInFolderPopup + + Create Subfolder + カットフォルダを作成する + + + Infomation + 基本情報 + + + Subfolder Name + フォルダ名 + + + Auto Format: + 自動生成: + + + Show This on Launch of the Camera Capture + ”カメラから取り込む”起動時にこのポップアップを表示する + + + OK + OK + + + Cancel + キャンセル + + + C- + Sequence + Scene + C- + シーン + カット + + + Sequence + Scene + シーン + カット + + + Episode + Sequence + Scene + 話数 + シーン + カット + + + Project + Episode + Sequence + Scene + 作品名 + 話数 + シーン + カット + + + Save In: + 作成場所: + + + Project: + 作品名: + + + Episode: + 話数: + + + Sequence: + シーン: + + + Scene: + カット番号: + + + Subfolder Name: + フォルダ名: + + + Subfolder name should not be empty. + フォルダ名を入力してください。 + + + Subfolder name should not contain following characters: * . " / \ [ ] : ; | = , + フォルダ名に次のいずれかを含む事はできません: * . " / \ [ ] : ; | = , + + + Folder %1 already exists. + フォルダ %1 は既に存在します。 + + + It is not possible to create the %1 folder. + %1 フォルダを作成できません。 + PltGizmoPopup @@ -6009,6 +6153,40 @@ Do you want to overwrite it? Show Startup Window when OpenToonz Starts OpenToonzの起動時にスタートアップウィンドウを表示する + + Numpad keys are assigned to the following commands. +Is it OK to release these shortcuts? + 数字キーは既に以下のコマンドのショートカットに割り当てられています。 +これらのショートカットを解除してもよろしいですか? + + + OK + OK + + + Cancel + キャンセル + + + Use Numpad and Tab keys for Switching Styles + 数字キーとTabキーでスタイルを選択する + + + Use Arrow Key to Shift Cell Selection + 矢印キーでコマ選択を移動する + + + Enable to Input Cells without Double Clicking + ダブルクリックなしでシートのコマを入力できるようにする + + + Please indicate where you would like exports from Fast Render(MP4) to go. + ”MP4ムービーのレンダリング”コマンドの出力先を指定してください。 + + + Fast Render Path: + 保存先のパス: + PreferencesPopup::FormatProperties @@ -7690,6 +7868,14 @@ Do you want to overwrite it? Are you sure? %1 を削除します。よろしいですか? + + FFmpeg not found, please set the location in the Preferences and restart. + FFmpegが見つかりません。環境設定でパスを指定し、OpenToonzを再起動してください。 + + + Skipping frame. + フレームをスキップしています。 + RenameAsToonzPopup @@ -10197,6 +10383,45 @@ Please refer to the user guide for details. + XsheetGUI::ColumnTransparencyPopup + + None + なし + + + Red + + + + Green + + + + Blue + + + + DarkYellow + 暗い黄色 + + + DarkCyan + 暗いシアン + + + DarkMagenta + 暗いマゼンタ + + + N.B. Filter doesn't affect vector levels + ※ カラーフィルタはベクターレベルには適用されません + + + Filter: + フィルタ: + + + XsheetGUI::NoteArea Frame diff --git a/toonz/sources/translations/japanese/toonzqt.ts b/toonz/sources/translations/japanese/toonzqt.ts index c87a5f0..7e9a302 100644 --- a/toonz/sources/translations/japanese/toonzqt.ts +++ b/toonz/sources/translations/japanese/toonzqt.ts @@ -29,6 +29,29 @@ + AddWordButton + + Character + キャラクター + + + Part + 部位 + + + Suffix + 接尾辞 + + + New + 新規作成 + + + Add New Word for %1 + %1 に新しい単語を追加する + + + AdjustPaletteDialog Adjust Current Level to This Palette @@ -386,6 +409,17 @@ Possibly the preset file has been corrupted + EasyInputArea + + Warning + 警告 + + + %1 is already registered + %1 は既に登録されています + + + FileField ... @@ -1179,6 +1213,21 @@ Select FX nodes and related links before copying or cutting the selection you wa + NewWordDialog + + OK + OK + + + Cancel + キャンセル + + + Enter new word + 単語を入力してください + + + PageViewer Toggle Link to Studio Palette @@ -2204,7 +2253,7 @@ Apply Apply - 適用 + 適用 Style Name @@ -2214,6 +2263,14 @@ Apply Name Editor: # %1 スタイル名を編集: # %1 + + Apply and Next + 適用して次へ + + + Easy Inputs + 簡易入力 + TMessageViewer @@ -2255,4 +2312,11 @@ Apply 通常の色 + + WordButton + + Remove %1 + %1 を削除 + +