diff --git a/toonz/sources/colorfx/colorfx.cpp b/toonz/sources/colorfx/colorfx.cpp index b91763d..89ba15e 100644 --- a/toonz/sources/colorfx/colorfx.cpp +++ b/toonz/sources/colorfx/colorfx.cpp @@ -97,9 +97,7 @@ void initColorFx() add(new TCircleStripeFillStyle(TPixel32::Green)); add(new TMosaicFillStyle(TPixel32::Red)); add(new TPatchFillStyle(TPixel32::Blue)); -#ifndef BRAVO add(new TAirbrushRasterStyle(TPixel32::Black, 10)); add(new TBlendRasterStyle(TPixel32::Black, 10)); add(new TNoColorRasterStyle()); -#endif } diff --git a/toonz/sources/image/pli/pli_io.cpp b/toonz/sources/image/pli/pli_io.cpp index 073245d..af4cbb4 100644 --- a/toonz/sources/image/pli/pli_io.cpp +++ b/toonz/sources/image/pli/pli_io.cpp @@ -1,7 +1,5 @@ #include -#ifndef XPRESS - #include "tmachine.h" #include "pli_io.h" #include "tcommon.h" @@ -2787,5 +2785,3 @@ int &ParsedPli::precisionScale() { return imp->m_precisionScale; } - -#endif diff --git a/toonz/sources/image/pli/tiio_pli.cpp b/toonz/sources/image/pli/tiio_pli.cpp index fdbd406..83e2abf 100644 --- a/toonz/sources/image/pli/tiio_pli.cpp +++ b/toonz/sources/image/pli/tiio_pli.cpp @@ -1,7 +1,5 @@ -#ifndef XPRESS - #include "tiio_pli.h" //#include "tstrokeoutline.h" #include "tsystem.h" @@ -829,5 +827,3 @@ GroupTag *makeGroup(TVectorImageP &vi, int &currStyleId, int &index, int currDep } //============================================================================= - -#endif diff --git a/toonz/sources/image/tiio.cpp b/toonz/sources/image/tiio.cpp index 9d97084..1a52271 100644 --- a/toonz/sources/image/tiio.cpp +++ b/toonz/sources/image/tiio.cpp @@ -1,5 +1,4 @@ - #include "tnzimage.h" #include "tiio.h" #include "tfiletype.h" @@ -68,9 +67,6 @@ void initImageIo(bool lightVersion) { if (!lightVersion) { - -#ifndef XPRESS - TLevelWriter::define("pli", TLevelWriterPli::create, false); TLevelReader::define("pli", TLevelReaderPli::create); TFileType::declare("pli", TFileType::VECTOR_LEVEL); @@ -80,10 +76,6 @@ void initImageIo(bool lightVersion) TLevelWriter::define("svg", TLevelWriterSvg::create, false); Tiio::defineWriterProperties("svg", new Tiio::SvgWriterProperties()); -#endif // !XPRESS - -#ifndef BRAVO - TLevelWriter::define("tzl", TLevelWriterTzl::create, false); TLevelReader::define("tzl", TLevelReaderTzl::create); TFileType::declare("tzl", TFileType::RASTER_LEVEL); @@ -107,8 +99,6 @@ void initImageIo(bool lightVersion) Tiio::defineWriterMaker("plt", Tiio::makePltWriter, false); TFileType::declare("plt", TFileType::RASTER_IMAGE); -#endif // !BRAVO - Tiio::defineReaderMaker("nol", Tiio::makePngReader); Tiio::defineWriterMaker("nol", Tiio::makePngWriter, true); TFileType::declare("nol", TFileType::RASTER_IMAGE); diff --git a/toonz/sources/image/tzl/tiio_tzl.cpp b/toonz/sources/image/tzl/tiio_tzl.cpp index 7d577ff..e99330d 100644 --- a/toonz/sources/image/tzl/tiio_tzl.cpp +++ b/toonz/sources/image/tzl/tiio_tzl.cpp @@ -1,7 +1,5 @@ -#ifndef BRAVO - #include "tiio_tzl.h" #include "tmachine.h" #include "tsystem.h" @@ -2519,4 +2517,3 @@ TRect TImageReaderTzl::getBBox() const return TRect(getSize()); } -#endif diff --git a/toonz/sources/include/toonzqt/dvdialog.h b/toonz/sources/include/toonzqt/dvdialog.h index 40f794c..5061c61 100644 --- a/toonz/sources/include/toonzqt/dvdialog.h +++ b/toonz/sources/include/toonzqt/dvdialog.h @@ -315,10 +315,6 @@ int eraseStylesInDemand(TPalette *palette, std::vector styleIds, const TXsh //----------------------------------------------------------------------------- -void DVAPI featureNotAvelaible(QString applicationName = QString("Toonz Bravo Web"), QString url = QString("http://www.bravo.toonz.com")); - -void DVAPI requestTrialLicense(QString url = QString("http://www.toonz.com"), QString mail = QString("license@toonz.com")); - //----------------------------------------------------------------------------- } //namespace DVGui //----------------------------------------------------------------------------- diff --git a/toonz/sources/include/toonzqt/licensechecker.h b/toonz/sources/include/toonzqt/licensechecker.h deleted file mode 100644 index d28ea28..0000000 --- a/toonz/sources/include/toonzqt/licensechecker.h +++ /dev/null @@ -1,71 +0,0 @@ - - -#ifndef LICENSE_CHECKER_H -#define LICENSE_CHECKER_H - -#include - -//#if QT_VERSION >= 0x050000 -#include -//#else -//#include -//#endif -#include - -#include "tcommon.h" - -#undef DVAPI -#undef DVVAR -#ifdef TOONZQT_EXPORTS -#define DVAPI DV_EXPORT_API -#define DVVAR DV_EXPORT_VAR -#else -#define DVAPI DV_IMPORT_API -#define DVVAR DV_IMPORT_VAR -#endif - -/* moc tool が preprocessor directive を無視するので QT_VERSION で分岐するのは諦める */ -class DVAPI LicenseChecker - //#if QT_VERSION < 0x050000 - //: public QHttp - //#else - : public QObject -//#endif -{ - Q_OBJECT - -public: - enum LicenseMode { TAB, - TOONZ }; - -private: - bool m_httpRequestAborted; - int m_httpGetId; - - LicenseMode m_licenseMode; - - bool m_isValid; - -public: - LicenseChecker(const QString &requestUrl, LicenseMode licenseMode, std::string license, - std::string applicationName, const QString &version); - - bool isLicenseValid() const { return m_isValid; } - -private: - QString buildRequest(const QString &requestUrl, std::string license, std::string applicationName, const QString &version); - -protected slots: - //#if QT_VERSION >= 0x050000 - void httpRequestFinished(QNetworkReply *); - //#else - // void httpRequestFinished(int requestId, bool error); - // void readyReadExec(const QHttpResponseHeader &head){} - // void readResponseHeader(const QHttpResponseHeader &responseHeader); - //#endif - void httpRequestStarted(int requestId) {} - void slotAuthenticationRequired(const QString &hostName, quint16, QAuthenticator *authenticator); - void httpStateChanged(int state); -}; - -#endif // LICENSE_CHECKER_H diff --git a/toonz/sources/include/toonzqt/styleeditor.h b/toonz/sources/include/toonzqt/styleeditor.h index a47981a..06a416e 100644 --- a/toonz/sources/include/toonzqt/styleeditor.h +++ b/toonz/sources/include/toonzqt/styleeditor.h @@ -595,10 +595,8 @@ class DVAPI StyleEditor : public QWidget DVGui::StyleSample *m_newColor; //!< New style viewer (lower-right panel side). DVGui::StyleSample *m_oldColor; //!< Old style viewer (lower-right panel side). -#ifndef STUDENT QPushButton *m_autoButton; //!< "Auto Apply" checkbox on the right panel side. QPushButton *m_applyButton; //!< "Apply" button on the right panel side. -#endif QToolBar *m_toolBar; //!< Lower toolbar. ColorParameterSelector *m_colorParameterSelector; //!< Secondary color parameter selector in the lower toolbar. diff --git a/toonz/sources/tcleanupper/tcleanupper.cpp b/toonz/sources/tcleanupper/tcleanupper.cpp index 6239076..88b0a6b 100644 --- a/toonz/sources/tcleanupper/tcleanupper.cpp +++ b/toonz/sources/tcleanupper/tcleanupper.cpp @@ -529,11 +529,7 @@ int main(int argc, char *argv[]) TEnv::setStuffDir(stuffDirPath); /* - #ifdef BRAVO - TFilePath stuffDir("/Applications/Toonz 7.1 Bravo/Toonz 7.1 Bravo stuff"); - #else TFilePath stuffDir("/Applications/Toonz 7.1/Toonz 7.1 stuff"); - #endif TEnv::setStuffDir(stuffDir); */ @@ -838,15 +834,7 @@ int main(int argc, char *argv[]) namespace { -#ifdef BRAVO -#ifdef BRAVODEMO -const char *toonzVersion = "Bravo 7.1 (demo)"; -#else -const char *toonzVersion = "Bravo 7.1"; -#endif -#else const char *toonzVersion = "Toonz 7.1"; -#endif } // namespace string getToonzVersion() diff --git a/toonz/sources/tcomposer/tcomposer.cpp b/toonz/sources/tcomposer/tcomposer.cpp index e8946e0..899413a 100644 --- a/toonz/sources/tcomposer/tcomposer.cpp +++ b/toonz/sources/tcomposer/tcomposer.cpp @@ -108,40 +108,12 @@ namespace // (es PROJECTS etc.) // -#if defined TAB - -const char *applicationName = "The Tab"; -const char *applicationVersion = "3.0"; -const char *applicationFullName = "the Tab 3.0"; -const char *rootVarName = "TABROOT"; -const char *systemVarPrefix = "TAB"; - -#elif defined BRAVODEMO - -const char *applicationName = "Toonz Bravo"; -const char *applicationVersion = "7.1"; -const char *applicationFullName = "Bravo 7.1 (demo)"; -const char *rootVarName = "BRAVOROOT"; -const char *systemVarPrefix = "BRAVO"; - -#elif defined BRAVO - -const char *applicationName = "Toonz Bravo"; -const char *applicationVersion = "7.1"; -const char *applicationFullName = "Bravo 7.1"; -const char *rootVarName = "BRAVOROOT"; -const char *systemVarPrefix = "BRAVO"; - -#else - const char *applicationName = "OpenToonz"; const char *applicationVersion = "1.0"; const char *applicationFullName = "OpenToonz 1.0"; const char *rootVarName = "TOONZROOT"; const char *systemVarPrefix = "TOONZ"; -#endif - // TODO: forse anche questo andrebbe in tnzbase // ci possono essere altri programmi offline oltre al tcomposer @@ -651,20 +623,12 @@ int main(int argc, char *argv[]) // delle TEnv:: precedenti. Discutiamone #ifdef MACOSX // StuffDir -#ifdef BRAVO - QFileInfo infoStuff(QString("Toonz 7.1 Bravo stuff")); -#else QFileInfo infoStuff(QString("Toonz 7.1 stuff")); -#endif TFilePath stuffDirPath(infoStuff.absoluteFilePath().toStdString()); TEnv::setStuffDir(stuffDirPath); /* - #ifdef BRAVO - TFilePath stuffDir("/Applications/Toonz 7.1 Bravo/Toonz 7.1 Bravo stuff"); - #else TFilePath stuffDir("/Applications/Toonz 7.1/Toonz 7.1 stuff"); - #endif TEnv::setStuffDir(stuffDir); */ @@ -709,13 +673,8 @@ int main(int argc, char *argv[]) } */ /* - #ifdef BRAVO - TFilePath libraryFolder("/Applications/Toonz 5.0 Bravo/Toonz 5.0 Bravo stuff/projects/library"); - TFilePath cacheRoot("/Applications/Toonz 5.0 Bravo/Toonz 5.0 Bravo stuff/cache"); - #else TFilePath libraryFolder("/Applications/Toonz 5.0/Toonz 5.0 stuff/projects/library"); TFilePath cacheRoot("/Applications/Toonz 5.0/Toonz 5.0 stuff/cache"); - #endif */ /* TRasterImagePatternStrokeStyle::setRootDir(libraryFolder); @@ -808,9 +767,6 @@ int main(int argc, char *argv[]) try { Tiio::defineStd(); -#ifdef BRAVO - TPluginManager::instance()->setIgnored("tnzimage"); -#endif //#ifdef MACOSX // LoadStandardPlugins ha bisogno di BINROOT definita diff --git a/toonz/sources/tnztools/brushtool.cpp b/toonz/sources/tnztools/brushtool.cpp index 2894375..3fed6a6 100644 --- a/toonz/sources/tnztools/brushtool.cpp +++ b/toonz/sources/tnztools/brushtool.cpp @@ -570,11 +570,9 @@ BrushTool::BrushTool(std::string name, int targetType) } m_prop[0].bind(m_pressure); -#ifndef STUDENT m_prop[0].bind(m_preset); m_preset.setId("BrushPreset"); m_preset.addValue(CUSTOM_WSTR); -#endif m_pressure.setId("PressureSensibility"); m_capStyle.addValue(BUTT_WSTR); diff --git a/toonz/sources/tnztools/edittool.cpp b/toonz/sources/tnztools/edittool.cpp index 4d58d38..5e17f1a 100644 --- a/toonz/sources/tnztools/edittool.cpp +++ b/toonz/sources/tnztools/edittool.cpp @@ -775,11 +775,7 @@ EditTool::EditTool() { bind(TTool::AllTargets); m_prop.bind(m_scaleConstraint); - //#ifdef STUDENT - // m_autoSelect.setValue(true); - //#else m_prop.bind(m_autoSelect); - //#endif m_prop.bind(m_globalKeyframes); m_prop.bind(m_lockCenterX); diff --git a/toonz/sources/tnztools/filltool.cpp b/toonz/sources/tnztools/filltool.cpp index 7b58b64..bb36a7e 100644 --- a/toonz/sources/tnztools/filltool.cpp +++ b/toonz/sources/tnztools/filltool.cpp @@ -1857,15 +1857,11 @@ FillTool::FillTool(int targetType) m_normalLineFillTool = new NormalLineFillTool(this); bind(targetType); -#ifndef STUDENT m_prop.bind(m_fillType); m_fillType.addValue(NORMALFILL); m_fillType.addValue(RECTFILL); m_fillType.addValue(FREEHANDFILL); m_fillType.addValue(POLYLINEFILL); -#else - m_fillType.addValue(NORMALFILL); -#endif m_prop.bind(m_colorType); m_colorType.addValue(LINES); diff --git a/toonz/sources/tnztools/fullcolorbrushtool.cpp b/toonz/sources/tnztools/fullcolorbrushtool.cpp index 3da83b3..8033985 100644 --- a/toonz/sources/tnztools/fullcolorbrushtool.cpp +++ b/toonz/sources/tnztools/fullcolorbrushtool.cpp @@ -151,10 +151,8 @@ FullColorBrushTool::FullColorBrushTool(std::string name) m_prop.bind(m_hardness); m_prop.bind(m_opacity); m_prop.bind(m_pressure); -#ifndef STUDENT m_prop.bind(m_preset); m_preset.setId("BrushPreset"); -#endif } //--------------------------------------------------------------------------------------------------- diff --git a/toonz/sources/tnztools/selectiontool.cpp b/toonz/sources/tnztools/selectiontool.cpp index d8a8a3b..9fffa49 100644 --- a/toonz/sources/tnztools/selectiontool.cpp +++ b/toonz/sources/tnztools/selectiontool.cpp @@ -846,10 +846,8 @@ void DragSelectionTool::Scale::leftButtonDrag(const TPointD &pos, const TMouseEv SelectionTool::SelectionTool(int targetType) : TTool("T_Selection"), m_firstTime(true), m_dragTool(0), m_what(Outside), m_leftButtonMousePressed(false), m_shiftPressed(false), m_selecting(false), m_mousePosition(TPointD()), m_stroke(0), m_justSelected(false), m_strokeSelectionType("Type:"), m_deformValues(), m_cursorId(ToolCursor::CURSOR_ARROW) { -#ifndef STUDENT bind(targetType); m_prop.bind(m_strokeSelectionType); -#endif m_strokeSelectionType.addValue(RECT_SELECTION); m_strokeSelectionType.addValue(FREEHAND_SELECTION); diff --git a/toonz/sources/tnztools/vectorselectiontool.cpp b/toonz/sources/tnztools/vectorselectiontool.cpp index 9ad9a6d..ab9a31e 100644 --- a/toonz/sources/tnztools/vectorselectiontool.cpp +++ b/toonz/sources/tnztools/vectorselectiontool.cpp @@ -1196,10 +1196,8 @@ VectorSelectionTool::VectorSelectionTool(int targetType) : SelectionTool(targetType), m_selectionTarget("Mode:"), m_constantThickness("Preserve Thickness", false), m_levelSelection(m_strokeSelection), m_capStyle("Cap"), m_joinStyle("Join"), m_miterJoinLimit("Miter:", 0, 100, 4), m_selectionCount(0), m_canEnterGroup(true) { if (targetType == TTool::Vectors) { -#ifndef STUDENT m_prop.bind(m_selectionTarget); m_prop.bind(m_constantThickness); -#endif m_selectionTarget.addValue(NORMAL_TYPE); m_selectionTarget.addValue(SELECTED_FRAMES_TYPE); diff --git a/toonz/sources/toonz/Resources/info.txt b/toonz/sources/toonz/Resources/info.txt index b9343be..d4e30dc 100644 --- a/toonz/sources/toonz/Resources/info.txt +++ b/toonz/sources/toonz/Resources/info.txt @@ -1,11 +1 @@ -To request your license contact us: -E-mail tablicense@the-tab.com -Fax +39 06.43.25.15.88 -Web www.the-tab.com/box/box.htm - -Please provide us with the following information: -- the following Computer Code: 1733-2734-7300-0833-3928-2703 -- the PIN code you can find on the License Card -- Company name (if available) - Phone number -- First and last name - Fax number -- Complete address - E-mail address +Web: https://opentoonz.github.io/ diff --git a/toonz/sources/toonz/cellselection.cpp b/toonz/sources/toonz/cellselection.cpp index a770a5e..7de8bdc 100644 --- a/toonz/sources/toonz/cellselection.cpp +++ b/toonz/sources/toonz/cellselection.cpp @@ -1212,16 +1212,13 @@ void TCellSelection::enableCommands() enableCommand(this, MI_Reverse, &TCellSelection::reverseCells); enableCommand(this, MI_Swing, &TCellSelection::swingCells); enableCommand(this, MI_Random, &TCellSelection::randomCells); -#ifndef STUDENT enableCommand(this, MI_Increment, &TCellSelection::incrementCells); -#endif enableCommand(this, MI_ResetStep, &TCellSelection::resetStepCells); enableCommand(this, MI_IncreaseStep, &TCellSelection::increaseStepCells); enableCommand(this, MI_DecreaseStep, &TCellSelection::decreaseStepCells); enableCommand(this, MI_Step2, &TCellSelection::step2Cells); enableCommand(this, MI_Step3, &TCellSelection::step3Cells); enableCommand(this, MI_Step4, &TCellSelection::step4Cells); -#ifndef STUDENT enableCommand(this, MI_Each2, &TCellSelection::each2Cells); enableCommand(this, MI_Each3, &TCellSelection::each3Cells); enableCommand(this, MI_Each4, &TCellSelection::each4Cells); @@ -1230,7 +1227,6 @@ void TCellSelection::enableCommands() enableCommand(this, MI_Rolldown, &TCellSelection::rolldownCells); enableCommand(this, MI_TimeStretch, &TCellSelection::openTimeStretchPopup); -#endif enableCommand(this, MI_CloneLevel, &TCellSelection::cloneLevel); enableCommand(this, MI_SetKeyframes, &TCellSelection::setKeyframes); @@ -1496,11 +1492,7 @@ void TCellSelection::pasteCells() //Se la selezione e' vuota e l'objectId e' quello della camera sono nella // colonna di camera quindi devo selezionare la row corrente e -1. { -#ifdef LINETESTAA - (Daniele)L'else sotto e' cambiato - controllare che il copy / paste delle chiavi funzioni correttamente verso la colonna di camera ! -#endif - - int row = TApp::instance()->getCurrentFrame()->getFrame(); + int row = TApp::instance()->getCurrentFrame()->getFrame(); selection.select(row, -1); } else { //Retrieves all keyframe positions from mime data and translates them by (r0,c0) @@ -1692,11 +1684,7 @@ void TCellSelection::pasteKeyframesInto() //Se la selezione e' vuota e l'objectId e' quello della camera sono nella // colonna di camera quindi devo selezionare la row corrente e -1. { -#ifdef LINETESTAA - (Daniele)L'else sotto e' cambiato - controllare che il copy / paste delle chiavi funzioni correttamente verso la colonna di camera ! -#endif - - int row = TApp::instance()->getCurrentFrame()->getFrame(); + int row = TApp::instance()->getCurrentFrame()->getFrame(); selection.select(row, -1); } else { //Retrieves all keyframe positions from mime data and translates them by (r0,c0) diff --git a/toonz/sources/toonz/convertpopup.cpp b/toonz/sources/toonz/convertpopup.cpp index a248911..f429626 100644 --- a/toonz/sources/toonz/convertpopup.cpp +++ b/toonz/sources/toonz/convertpopup.cpp @@ -655,8 +655,6 @@ void ConvertPopup::setFiles(const std::vector &fps) } } -#ifndef BRAVO - int currIndex = m_fileFormat->currentIndex(); int tlvIndex = m_fileFormat->findText(TlvExtension); @@ -679,16 +677,6 @@ void ConvertPopup::setFiles(const std::vector &fps) m_fileFormat->removeItem(tlvIndex); } } -#else - if (areVector) { - int svgIndex = m_fileFormat->findText("svg"); - if (svgIndex < 0) - m_fileFormat->addItem("svg"); - m_fileFormat->setCurrentIndex(m_fileFormat->findText("svg")); - m_fileFormat->setEnabled(false); - onFormatSelected("svg"); - } -#endif m_srcFilePaths = fps; if (m_srcFilePaths.size() == 1) { diff --git a/toonz/sources/toonz/curveio.cpp b/toonz/sources/toonz/curveio.cpp index 55f3402..d5b1691 100644 --- a/toonz/sources/toonz/curveio.cpp +++ b/toonz/sources/toonz/curveio.cpp @@ -238,10 +238,6 @@ bool ExportCurvePopup::execute() void saveCurve(TDoubleParam *curve) { -#ifdef BRAVODEMO - DVGui::featureNotAvelaible(); - return false; -#endif TFilePath folderPath = TProjectManager::instance()->getCurrentProject()->getScenesPath(); SaveCurvePopup popup(folderPath, curve); popup.exec(); @@ -251,10 +247,6 @@ void saveCurve(TDoubleParam *curve) void loadCurve(TDoubleParam *curve) { -#ifdef BRAVODEMO - DVGui::featureNotAvelaible(); - return false; -#endif TFilePath folderPath = TProjectManager::instance()->getCurrentProject()->getScenesPath(); LoadCurvePopup popup(folderPath, curve); popup.exec(); @@ -264,10 +256,6 @@ void loadCurve(TDoubleParam *curve) void exportCurve(TDoubleParam *curve, const std::string &name) { -#ifdef BRAVODEMO - DVGui::featureNotAvelaible(); - return false; -#endif TFilePath folderPath = TProjectManager::instance()->getCurrentProject()->getScenesPath(); ExportCurvePopup popup(folderPath, curve, name); popup.exec(); diff --git a/toonz/sources/toonz/dvitemview.cpp b/toonz/sources/toonz/dvitemview.cpp index e87c21d..b569643 100644 --- a/toonz/sources/toonz/dvitemview.cpp +++ b/toonz/sources/toonz/dvitemview.cpp @@ -1851,7 +1851,6 @@ DvItemViewerButtonBar::DvItemViewerButtonBar(DvItemViewer *itemViewer, QWidget * QAction *newFolder = new QAction(newFolderIcon, tr("New Folder"), this); newFolder->setIconText("New"); addAction(newFolder); -#ifndef STUDENT addSeparator(); //view mode @@ -1881,7 +1880,6 @@ DvItemViewerButtonBar::DvItemViewerButtonBar(DvItemViewer *itemViewer, QWidget * // tableView->setCheckable(true); // actions->addAction(tableView); // addAction(tableView); -#endif addSeparator(); // button to export file list to csv @@ -1892,12 +1890,10 @@ DvItemViewerButtonBar::DvItemViewerButtonBar(DvItemViewer *itemViewer, QWidget * connect(folderUp, SIGNAL(triggered()), SIGNAL(folderUp())); connect(newFolder, SIGNAL(triggered()), SIGNAL(newFolder())); -#ifndef STUDENT connect(thumbView, SIGNAL(triggered()), itemViewer->getPanel(), SLOT(setThumbnailsView())); connect(listView, SIGNAL(triggered()), itemViewer->getPanel(), SLOT(setTableView())); // connect(listView , SIGNAL(triggered()), itemViewer->getPanel(), SLOT(setListView())); // connect(tableView , SIGNAL(triggered()), itemViewer->getPanel(), SLOT(setTableView())); -#endif connect(m_folderBack, SIGNAL(triggered()), SIGNAL(folderBack())); connect(m_folderFwd, SIGNAL(triggered()), SIGNAL(folderFwd())); diff --git a/toonz/sources/toonz/exportlevelpopup.cpp b/toonz/sources/toonz/exportlevelpopup.cpp index 44391ce..f4b5431 100644 --- a/toonz/sources/toonz/exportlevelpopup.cpp +++ b/toonz/sources/toonz/exportlevelpopup.cpp @@ -538,8 +538,6 @@ void ExportLevelPopup::updateOnSelection() TColumnSelection *colSelection = dynamic_cast(sel); m_nameField->setEnabled(!colSelection || colSelection->getIndices().size() <= 1); -#ifndef BRAVO - // Enable tlv output in case all inputs are pli TApp *app = TApp::instance(); @@ -577,8 +575,6 @@ void ExportLevelPopup::updateOnSelection() m_format->removeItem(tlvIdx); } -#endif // !BRAVO - m_exportOptions->updateOnSelection(); } diff --git a/toonz/sources/toonz/exportpanel.cpp b/toonz/sources/toonz/exportpanel.cpp index ecafe63..dba53e9 100644 --- a/toonz/sources/toonz/exportpanel.cpp +++ b/toonz/sources/toonz/exportpanel.cpp @@ -10,7 +10,6 @@ #include "menubarcommandids.h" #include "fileselection.h" #include "iocommand.h" -#include "licensecontroller.h" #include "filebrowser.h" #include "flipbook.h" #include "formatsettingspopups.h" @@ -66,6 +65,7 @@ #include #include #include +#include //============================================================================= // RenderLocker @@ -241,10 +241,7 @@ void RenderController::generateMovie(TFilePath outPath, bool emitSignal) } } catch (TException &e) { QString msg; - if (e.getMessage() == L"File: " + fp.getWideString() + L":1\nCannot Load Toonz Scene in LineTest") - msg = QObject::tr("The scene %1 was created with Toonz and cannot be loaded in LineTest.").arg(QString::fromStdWString(fp.getWideString())); - else - msg = QObject::tr("There were problems loading the scene %1.\n Some files may be missing.").arg(QString::fromStdWString(fp.getWideString())); + msg = QObject::tr("There were problems loading the scene %1.\n Some files may be missing.").arg(QString::fromStdWString(fp.getWideString())); DVGui::warning(msg); return; @@ -756,12 +753,8 @@ ExportPanel::ExportPanel(QWidget *parent, Qt::WFlags flags) mainLayout->setSpacing(0); mainLayout->setAlignment(Qt::AlignTop); //ClipList -#ifdef STUDENT - m_clipListViewer = 0; -#else m_clipListViewer = new ClipListViewer(box); m_clipListViewer->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Expanding); -#endif TSceneHandle *sceneHandle = TApp::instance()->getCurrentScene(); @@ -813,13 +806,13 @@ ExportPanel::ExportPanel(QWidget *parent, Qt::WFlags flags) formats.sort(); m_fileFormat->addItems(formats); - m_fileFormat->setMaximumHeight(WidgetHeight); + m_fileFormat->setMaximumHeight(DVGui::WidgetHeight); connect(m_fileFormat, SIGNAL(currentIndexChanged(const QString &)), SLOT(onFormatChanged(const QString &))); m_fileFormat->setCurrentIndex(formats.indexOf("mov")); QPushButton *fileFormatButton = new QPushButton(QString(tr("Options"))); - fileFormatButton->setFixedSize(60, WidgetHeight); + fileFormatButton->setFixedSize(60, DVGui::WidgetHeight); connect(fileFormatButton, SIGNAL(pressed()), this, SLOT(openSettingsPopup())); QLabel *fileFormat = new QLabel(tr("File Format:")); fileFormat->setAlignment(Qt::AlignRight | Qt::AlignVCenter); @@ -830,12 +823,10 @@ ExportPanel::ExportPanel(QWidget *parent, Qt::WFlags flags) fileFormatLayout->addWidget(fileFormatButton); // Use Marker checkbox -#ifndef STUDENT m_useMarker = new QCheckBox(tr("Use Markers"), settingsBox); m_useMarker->setMinimumHeight(30); m_useMarker->setChecked(false); connect(m_useMarker, SIGNAL(toggled(bool)), this, SLOT(onUseMarkerToggled(bool))); -#endif // Export button QFrame *exportBox = new QFrame(box); @@ -844,7 +835,7 @@ ExportPanel::ExportPanel(QWidget *parent, Qt::WFlags flags) QVBoxLayout *exportLayout = new QVBoxLayout(); QPushButton *exportButton = new QPushButton(tr("Export"), exportBox); - exportButton->setFixedSize(65, WidgetHeight); + exportButton->setFixedSize(65, DVGui::WidgetHeight); connect(exportButton, SIGNAL(pressed()), this, SLOT(generateMovie())); exportLayout->addWidget(exportButton, 0, Qt::AlignCenter); exportBox->setLayout(exportLayout); @@ -852,9 +843,7 @@ ExportPanel::ExportPanel(QWidget *parent, Qt::WFlags flags) settingsLayout->addLayout(saveIn); settingsLayout->addLayout(fileNname); settingsLayout->addLayout(fileFormatLayout); -#ifndef STUDENT settingsLayout->addWidget(m_useMarker); -#endif settingsBox->setLayout(settingsLayout); if (m_clipListViewer) @@ -954,11 +943,7 @@ void ExportPanel::generateMovie() void ExportPanel::onUseMarkerToggled(bool toggled) { -#ifdef STUDENT - RenderController::instance()->setUseMarkers(false); -#else RenderController::instance()->setUseMarkers(toggled); -#endif } //----------------------------------------------------------------------------- diff --git a/toonz/sources/toonz/filebrowser.cpp b/toonz/sources/toonz/filebrowser.cpp index de8a133..899b112 100644 --- a/toonz/sources/toonz/filebrowser.cpp +++ b/toonz/sources/toonz/filebrowser.cpp @@ -184,10 +184,8 @@ FileBrowser::FileBrowser(QWidget *parent, Qt::WFlags flags, bool noContextMenu, viewerPanel->addColumn(DvItemListModel::FileSize, 50); viewerPanel->addColumn(DvItemListModel::CreationDate, 130); viewerPanel->addColumn(DvItemListModel::ModifiedDate, 130); -#ifndef LINETEST if (Preferences::instance()->isSVNEnabled()) viewerPanel->addColumn(DvItemListModel::VersionControlStatus, 120); -#endif viewerPanel->setSelection(new FileSelection()); DVItemViewPlayDelegate *itemViewPlayDelegate = new DVItemViewPlayDelegate(viewerPanel); @@ -571,14 +569,6 @@ void FileBrowser::setFolder(const TFilePath &fp, bool expandNode) if (it->getType() == "plt") continue; -#if defined(LINETEST) || defined(BRAVO) - if (it->getType() == "tlv" || it->getType() == "tpl") - continue; -#endif -#ifdef LINETEST - if (it->getType() == "pli") - continue; -#endif //filter the file else if (m_filter.isEmpty()) { if (it->getType() != "tnz" && @@ -1183,7 +1173,6 @@ QMenu *FileBrowser::getContextMenu(QWidget *parent, int index) } #ifdef LEVO -#ifndef BRAVO if (files.size() == 2 && (files[0].getType() == "tif" || files[0].getType() == "tiff" || files[0].getType() == "png" || files[0].getType() == "TIF" || files[0].getType() == "TIFF" || files[0].getType() == "PNG") && (files[1].getType() == "tif" || files[1].getType() == "tiff" || files[1].getType() == "png" || @@ -1199,7 +1188,6 @@ QMenu *FileBrowser::getContextMenu(QWidget *parent, int index) menu->addSeparator(); } #endif -#endif if (!clickedFile.isEmpty() && (clickedFile.getType() == "tnz")) { menu->addSeparator(); diff --git a/toonz/sources/toonz/filebrowserpopup.cpp b/toonz/sources/toonz/filebrowserpopup.cpp index 5549c01..4febe2f 100644 --- a/toonz/sources/toonz/filebrowserpopup.cpp +++ b/toonz/sources/toonz/filebrowserpopup.cpp @@ -577,14 +577,6 @@ void SaveSceneAsPopup::initFolder() setFolder(TProjectManager::instance()->getCurrentProject()->getScenesPath()); } -#ifdef BRAVODEMO -void SaveSceneAsPopup::show() -{ - DVGui::featureNotAvelaible(); - return; -} -#endif - //============================================================================= // SaveSubSceneAsPopup @@ -609,13 +601,6 @@ void SaveSubSceneAsPopup::initFolder() else setFolder(TProjectManager::instance()->getCurrentProject()->getScenesPath()); } -#ifdef BRAVODEMO -void SaveSubSceneAsPopup::show() -{ - DVGui::featureNotAvelaible(); - return; -} -#endif //============================================================================= // LoadLevelPopup @@ -1487,13 +1472,6 @@ void SaveLevelAsPopup::initFolder() fp = scene->decodeFilePath(project->getFolder(TProject::Drawings)); setFolder(fp); } -#ifdef BRAVODEMO -void SaveLevelAsPopup::show() -{ - DVGui::featureNotAvelaible(); - return; -} -#endif //============================================================================= // ReplaceLevelPopup @@ -1664,14 +1642,6 @@ bool SavePaletteAsPopup::execute() return true; } -#ifdef BRAVODEMO -void SavePaletteAsPopup::show() -{ - DVGui::featureNotAvelaible(); - return; -} -#endif - void SavePaletteAsPopup::initFolder() { setFolder(TProjectManager::instance()->getCurrentProjectPath().getParentDir()); @@ -1710,16 +1680,8 @@ LoadColorModelPopup::LoadColorModelPopup() addFilterType("tga"); addFilterType("tif"); addFilterType("tiff"); -#ifndef BRAVO -#ifndef BRAVODEMO -#ifndef LINETEST addFilterType("tlv"); -#endif -#endif -#endif -#ifndef LINETEST addFilterType("pli"); -#endif addFilterType("psd"); } diff --git a/toonz/sources/toonz/filebrowserpopup.h b/toonz/sources/toonz/filebrowserpopup.h index 8c09abf..4f86ce5 100644 --- a/toonz/sources/toonz/filebrowserpopup.h +++ b/toonz/sources/toonz/filebrowserpopup.h @@ -246,9 +246,6 @@ public: bool execute(); void initFolder(); -#ifdef BRAVODEMO - void show(); -#endif }; //----------------------------------------------------------------------------- @@ -262,10 +259,6 @@ public: bool execute(); void initFolder(); - -#ifdef BRAVODEMO - void show(); -#endif }; //----------------------------------------------------------------------------- @@ -334,9 +327,6 @@ public: bool execute(); void initFolder(); -#ifdef BRAVODEMO - void show(); -#endif }; //----------------------------------------------------------------------------- @@ -371,10 +361,6 @@ public: SavePaletteAsPopup(); bool execute(); - -#ifdef BRAVODEMO - void show(); -#endif void initFolder(); }; diff --git a/toonz/sources/toonz/fileselection.cpp b/toonz/sources/toonz/fileselection.cpp index c4ee83a..f4696fc 100644 --- a/toonz/sources/toonz/fileselection.cpp +++ b/toonz/sources/toonz/fileselection.cpp @@ -13,9 +13,7 @@ #include "exportscenepopup.h" #include "tapp.h" -#ifndef LINETEST #include "batches.h" -#endif // TnzQt includes #include "toonzqt/imageutils.h" @@ -279,10 +277,6 @@ void FileSelection::enableCommands() void FileSelection::addToBatchRenderList() { -#ifndef LINETEST -#ifdef BRAVODEMO - DVGui::featureNotAvelaible(); -#else std::vector files; getSelectedFiles(files); int i; @@ -290,15 +284,12 @@ void FileSelection::addToBatchRenderList() BatchesController::instance()->addComposerTask(files[i]); DVGui::info(QObject::tr(" Task added to the Batch Render List.")); -#endif -#endif } //------------------------------------------------------------------------ void FileSelection::addToBatchCleanupList() { -#ifndef LINETEST std::vector files; getSelectedFiles(files); int i; @@ -306,7 +297,6 @@ void FileSelection::addToBatchCleanupList() BatchesController::instance()->addCleanupTask(files[i]); DVGui::info(QObject::tr(" Task added to the Batch Cleanup List.")); -#endif } //------------------------------------------------------------------------ @@ -587,10 +577,6 @@ int importScene(TFilePath scenePath) void FileSelection::importScenes() { -#ifdef BRAVODEMO - DVGui::featureNotAvelaible(); - -#else std::vector files; getSelectedFiles(files); if (files.empty()) @@ -623,7 +609,6 @@ void FileSelection::importScenes() DVGui::info(QObject::tr("One scene imported")); else DVGui::info(QString::number(importedSceneCount) + QObject::tr("%1 scenes imported").arg(importedSceneCount)); -#endif } //------------------------------------------------------------------------ diff --git a/toonz/sources/toonz/filmstrip.cpp b/toonz/sources/toonz/filmstrip.cpp index bcb84b2..0a96674 100644 --- a/toonz/sources/toonz/filmstrip.cpp +++ b/toonz/sources/toonz/filmstrip.cpp @@ -912,9 +912,7 @@ void FilmstripFrames::contextMenuEvent(QContextMenuEvent *event) } menu->addAction(cm->getAction(MI_ExposeResource)); if (!isSubsequenceLevel && !isReadOnly) { -#ifndef STUDENT menu->addAction(cm->getAction(MI_AddFrames)); -#endif menu->addAction(cm->getAction(MI_Renumber)); if (sl && sl->getType() == TZP_XSHLEVEL) menu->addAction(cm->getAction(MI_RevertToCleanedUp)); diff --git a/toonz/sources/toonz/filmstripselection.cpp b/toonz/sources/toonz/filmstripselection.cpp index b9f9edf..6b79bb2 100644 --- a/toonz/sources/toonz/filmstripselection.cpp +++ b/toonz/sources/toonz/filmstripselection.cpp @@ -89,9 +89,7 @@ void TFilmstripSelection::enableCommands() enableCommand(this, MI_Insert, &TFilmstripSelection::insertEmptyFrames); enableCommand(this, MI_MergeFrames, &TFilmstripSelection::mergeFrames); -#ifndef STUDENT enableCommand(this, MI_AddFrames, &TFilmstripSelection::addFrames); -#endif } } else if (isNotEditableFullColorLevel) enableCommand(this, MI_Copy, &TFilmstripSelection::copyFrames); diff --git a/toonz/sources/toonz/frameheadgadget.cpp b/toonz/sources/toonz/frameheadgadget.cpp index e65a617..75b5acf 100644 --- a/toonz/sources/toonz/frameheadgadget.cpp +++ b/toonz/sources/toonz/frameheadgadget.cpp @@ -184,11 +184,7 @@ bool FrameHeadGadget::eventFilter(QObject *obj, QEvent *e) if (x > 24 || x > 12 && frame != currentFrame) return false; if (y < 12) { -#ifdef STUDENT - bool isMosArea = false; -#else bool isMosArea = x < 6; -#endif // click nel quadratino bianco. if (isMosArea) { // Mos @@ -220,12 +216,10 @@ bool FrameHeadGadget::eventFilter(QObject *obj, QEvent *e) return false; if (mouseEvent->button() == Qt::RightButton) return false; -#ifndef STUDENT if (x < 12 && y < 12 && frame == currentFrame && m_buttonPressCellIndex == frame) { enableOnionSkin(!isOnionSkinEnabled()); viewer->update(); } -#endif } else if (e->type() == QEvent::MouseMove) { QMouseEvent *mouseEvent = dynamic_cast(e); int frame = y2index(mouseEvent->pos().y()); @@ -241,11 +235,7 @@ bool FrameHeadGadget::eventFilter(QObject *obj, QEvent *e) if (getCurrentFrame() == frame) viewer->setToolTip(tr("Current Frame")); else if (x < 7) { -#ifdef STUDENT - viewer->setToolTip(tr("Relative Onion Skin Toggle")); -#else viewer->setToolTip(""); -#endif } else if (x < 13) viewer->setToolTip(tr("Fixed Onion Skin Toggle")); else @@ -256,11 +246,9 @@ bool FrameHeadGadget::eventFilter(QObject *obj, QEvent *e) case MoveHead: setCurrentFrame(frame); break; -#ifndef STUDENT case ActivateMos: setMos(frame, true); break; -#endif case DeactivateMos: setMos(frame, false); break; @@ -690,8 +678,6 @@ public: if (!action) return; bool checked = action->isChecked(); -#ifndef STUDENT enableOnionSkin(checked); -#endif } } onionSkinToggle; diff --git a/toonz/sources/toonz/iocommand.cpp b/toonz/sources/toonz/iocommand.cpp index c4bb86d..e8d55f9 100644 --- a/toonz/sources/toonz/iocommand.cpp +++ b/toonz/sources/toonz/iocommand.cpp @@ -1223,7 +1223,6 @@ bool IoCmd::saveSceneIfNeeded(QString msg) bool isLevelOrSceneIsDirty = false; if (app->getCurrentScene()->getDirtyFlag()) { -#ifndef BRAVODEMO QString question; question = QObject::tr("%1: the current scene has been modified.\n" "Do you want to save your changes?") @@ -1237,7 +1236,6 @@ bool IoCmd::saveSceneIfNeeded(QString msg) if (!IoCmd::saveScene()) return false; } else if (ret == 2) -#endif { } @@ -1329,11 +1327,7 @@ void IoCmd::newScene() TDimension res(768, 576); camera->setRes(res); camera->setSize(TDimensionD((double)res.lx / cameraDpi, (double)res.ly / cameraDpi)); -#ifndef STUDENT scene->getProperties()->setBgColor(TPixel32::White); -#else - scene->getProperties()->setBgColor(TPixel32(255, 255, 255, 0)); -#endif TProjectManager::instance()->initializeScene(scene); //Must set current scene after initializeScene!! app->getCurrentScene()->setScene(scene); @@ -1394,10 +1388,6 @@ bool IoCmd::saveScene(const TFilePath &path, int flags) bool saveSubxsheet = (flags & SAVE_SUBXSHEET) != 0; TApp *app = TApp::instance(); -#ifdef STUDENT - CommandManager::instance()->execute("MI_RemoveUnused"); -#endif - assert(!path.isEmpty()); TFilePath scenePath = path; if (scenePath.getType() == "") @@ -1486,9 +1476,6 @@ bool IoCmd::saveScene(const TFilePath &path, int flags) bool IoCmd::saveScene() { -#ifdef BRAVODEMO - return false; -#else TSelection *oldSelection = TApp::instance()->getCurrentSelection()->getSelection(); ToonzScene *scene = TApp::instance()->getCurrentScene()->getScene(); if (scene->isUntitled()) { @@ -1508,7 +1495,6 @@ bool IoCmd::saveScene() // salva la scena con il nome fp. se fp esiste gia' lo sovrascrive return saveScene(fp, SILENTLY_OVERWRITE); } -#endif } //=========================================================================== @@ -1517,9 +1503,6 @@ bool IoCmd::saveScene() bool IoCmd::saveLevel(const TFilePath &path) { -#ifdef BRAVODEMO - return false; -#else assert(!path.isEmpty()); TApp *app = TApp::instance(); @@ -1538,7 +1521,6 @@ bool IoCmd::saveLevel(const TFilePath &path) TApp::instance()->getPaletteController()->getCurrentLevelPalette()->notifyPaletteSwitched(); return true; -#endif } //=========================================================================== @@ -1547,9 +1529,6 @@ bool IoCmd::saveLevel(const TFilePath &path) bool IoCmd::saveLevel() { -#ifdef BRAVODEMO - return false; -#else TApp *app = TApp::instance(); TXshSimpleLevel *sl = dynamic_cast(app->getCurrentLevel()->getLevel()); @@ -1572,7 +1551,6 @@ bool IoCmd::saveLevel() //for update title bar app->getCurrentLevel()->notifyLevelChange(); return true; -#endif } //=========================================================================== @@ -1581,9 +1559,6 @@ bool IoCmd::saveLevel() bool IoCmd::saveLevel(const TFilePath &fp, TXshSimpleLevel *sl, bool overwrite) { -#ifdef BRAVODEMO - return false; -#else assert(sl); bool fileDoesExist = TSystem::doesExistFileOrLevel(fp); if (!overwrite && fileDoesExist) { @@ -1645,7 +1620,6 @@ bool IoCmd::saveLevel(const TFilePath &fp, TXshSimpleLevel *sl, bool overwrite) TApp::instance()->getCurrentLevel()->notifyLevelTitleChange(); TApp::instance()->getPaletteController()->getCurrentLevelPalette()->notifyPaletteTitleChanged(); return true; -#endif } //=========================================================================== @@ -1654,11 +1628,7 @@ bool IoCmd::saveLevel(const TFilePath &fp, TXshSimpleLevel *sl, bool overwrite) bool IoCmd::saveLevel(TXshSimpleLevel *sl) { -#ifdef BRAVODEMO - return false; -#else return saveLevel(sl->getPath(), sl, true); -#endif } //=========================================================================== @@ -1905,17 +1875,6 @@ bool IoCmd::loadScene(const TFilePath &path, bool updateRecentFile, bool checkSa } VersionControlManager::instance()->setFrameRange(scene->getLevelSet()); } -#ifdef LINETEST - catch (TException &e) { - printf("%s:%s Exception:\n", __FILE__, __FUNCTION__); - QString msg; - if (e.getMessage() == L"File: " + scenePath.getWideString() + L":1\nCannot Load Toonz Scene in LineTest") - msg = QObject::tr("The scene %1 was created with Toonz and cannot be loaded in LineTest.").arg(QString::fromStdWString(scenePath.getWideString())); - else - msg = QObject::tr("There were problems loading the scene %1.\n Some files may be missing.").arg(QString::fromStdWString(scenePath.getWideString())); - DVGui::warning(msg); - } -#endif catch (...) { printf("%s:%s Exception ...:\n", __FILE__, __FUNCTION__); QString msg; @@ -2360,7 +2319,6 @@ int IoCmd::loadResources(LoadResourceArguments &args, // for the scene file TXshLevel *xl = 0; if (isScene) { -#ifndef STUDENT TFilePath oldDstFolder = importDialog.getDstFolder(); TFilePath dstFolder = (Preferences::instance()->isSubsceneFolderEnabled()) ? TFilePath(path.getName()) @@ -2389,7 +2347,6 @@ int IoCmd::loadResources(LoadResourceArguments &args, app->getCurrentColumn()->setColumnIndex(col0); -#endif continue; } // for other level files @@ -2607,11 +2564,7 @@ public: SaveSceneCommandHandler() : MenuItemHandler(MI_SaveScene) {} void execute() { -#ifdef BRAVODEMO - DVGui::featureNotAvelaible(); -#else IoCmd::saveScene(); -#endif } } saveSceneCommandHandler; @@ -2623,9 +2576,6 @@ public: SaveLevelCommandHandler() : MenuItemHandler(MI_SaveLevel) {} void execute() { -#ifdef BRAVODEMO - DVGui::featureNotAvelaible(); -#else TXshSimpleLevel *sl = TApp::instance()->getCurrentLevel()->getSimpleLevel(); if (!sl) { DVGui::warning(QObject::tr("No Current Level")); @@ -2651,7 +2601,6 @@ public: if (!IoCmd::saveLevel()) error(QObject::tr("Save level Failed")); -#endif } } saveLevelCommandHandler; diff --git a/toonz/sources/toonz/levelsettingspopup.cpp b/toonz/sources/toonz/levelsettingspopup.cpp index ad96649..fc69701 100644 --- a/toonz/sources/toonz/levelsettingspopup.cpp +++ b/toonz/sources/toonz/levelsettingspopup.cpp @@ -138,9 +138,7 @@ LevelSettingsPopup::LevelSettingsPopup() m_doPremultiply = new CheckBox(tr("Premultiply"), this); -#ifndef LINETEST m_whiteTransp = new CheckBox(tr("White As Transparent"), this); -#endif m_doAntialias = new CheckBox(tr("Add Antialiasing"), this); m_antialiasSoftness = new DVGui::IntLineEdit(0, 10, 0, 100); @@ -165,9 +163,7 @@ LevelSettingsPopup::LevelSettingsPopup() m_doAntialias->setChecked(false); m_antialiasSoftness->setEnabled(false); -#ifndef LINETEST m_whiteTransp->setChecked(false); -#endif //----layout @@ -226,9 +222,7 @@ LevelSettingsPopup::LevelSettingsPopup() m_topLayout->addWidget(m_doPremultiply); -#ifndef LINETEST m_topLayout->addWidget(m_whiteTransp); -#endif m_topLayout->addWidget(m_doAntialias); @@ -269,9 +263,7 @@ LevelSettingsPopup::LevelSettingsPopup() connect(m_doAntialias, SIGNAL(stateChanged(int)), SLOT(onDoAntialiasChanged(int))); connect(m_antialiasSoftness, SIGNAL(editingFinished()), SLOT(onAntialiasSoftnessChanged())); -#ifndef LINETEST connect(m_whiteTransp, SIGNAL(stateChanged(int)), SLOT(onWhiteTranspChanged(int))); -#endif updateLevelSettings(); } diff --git a/toonz/sources/toonz/licensecontroller.cpp b/toonz/sources/toonz/licensecontroller.cpp deleted file mode 100644 index 125c43f..0000000 --- a/toonz/sources/toonz/licensecontroller.cpp +++ /dev/null @@ -1,1124 +0,0 @@ - - -#if _MSC_VER >= 1400 -#define _CRT_SECURE_NO_DEPRECATE 1 -#endif -#include -#include -#include -#include -#include -#include -#include -#include "toonzqt/dvdialog.h" -#include "licensecontroller.h" -#include "licensegui.h" - -// Anti-hacker -#define decrypt update0 - -#ifdef WIN32 -#include -#include -#pragma comment(lib, "iphlpapi.lib") -#endif - -//Cryptopp -#include "pubkey.h" -#include "dh.h" -#include "sha.h" -#include "cryptlib.h" -#include "osrng.h" // Random Numbeer Generator -#include "eccrypto.h" // Elliptic Curve -#include "ecp.h" // F(p) EC -#include "integer.h" // Integer Operations -#include "base32.h" // Encodeing-Decoding -#include "nbtheory.h" // ModularSquareRoot(...) - -// Formattazione licenza TYPE 1: -// Licenze che contano 4 separatori (2prodotto e 2versione): -// Licenza non codificata: mmmmmmPPVVyyMMdd -// MacAddress(6 caratteri) Prodotto(2 caratteri) Versione(2 caratteri) Data (6 caratteri) -// NOTA: Per questo tipo di licenza la data è crittata in formato esadecimale, -// quindi nella decrittazione deve essere riconvertita in formato decimale. - -// Formattazione licenza TYPE 2: -// Licenze che contano 2 separatori: -// Licenza non codificata: mmmmmmmSSSyyMMdd -// MACAddress(7 caratteri) Separatore(2 caratteri) Data (6 caratteri) - -// Formattazione licenza TYPE 3: -// Licenze che contano 1 solo separatore: -// Licenza non codificata: mmmmmmmmSyyMMdd -// MACAddress(8 caratteri) Separatore(1 carattere) Data (6 caratteri) - -#define LICENSE_FORMAT_TYPE 1 //vedi sopra - -// Il separatore sta ad indicare il tipo di licenza: standard, pro, student, ecc.. e viene indicato -// nella licenza con lettere tipo "N", "S", "P" ecc. oppure con tre lettere... - -// La licenza codificata è lunga 40 caratteri. - -const std::string INFINITY_LICENSE = "999999"; //licenze a scadenza infinita - -// Definisco la lunghezza del machincode a seconda del tipo di licenza. -// Per i prodotti che hanno 3 separatori nella licenza la lunghezza del machine code è 7. -// Per i prodotti che hanno un solo separatore nella licenza la lunghezza del machine code è 8 - -#if LICENSE_FORMAT_TYPE == 1 -const int MACHINE_CODE_LENGTH = 6; //prendo solo gli ultimi 6 caratteri del macAddress(che ha 12 caratteri) -const int SEPARATOR_LENGTH = 4; // Numero di caratteri che indicano il numero di separatori. - // Per questo tipo di licenza i primi due sono il license type e gli altri due indicano la versione -const int DATE_LENGTH = 6; // Numero di caratteri che indicano la data nella licenza decrittata -const int DECRYPTED_TOTAL_LENGTH = 16; //lunghezza della licenza decrittata -const char *CODECHAR = "D"; //Ultimo carattere della licenza che identifica il formato -#elif LICENSE_FORMAT_TYPE == 2 -const int MACHINE_CODE_LENGTH = 7; //prendo solo gli ultimi 6 caratteri del macAddress(che ha 12 caratteri) -const int SEPARATOR_LENGTH = 2; // Numero di caratteri che indicano il prodotto nella licenza decrittata -const int DATE_LENGTH = 6; // Numero di caratteri che indicano la data nella licenza decrittata -const int DECRYPTED_TOTAL_LENGTH = 15; //lunghezza della licenza decrittata -const char *CODECHAR = "A"; //Ultimo carattere della licenza che identifica il formato -#elif LICENSE_FORMAT_TYPE == 3 -const int MACHINE_CODE_LENGTH = 8; //prendo solo gli ultimi 6 caratteri del macAddress(che ha 12 caratteri) -const int SEPARATOR_LENGTH = 1; // Numero di caratteri che indicano il prodotto nella licenza decrittata -const int DATE_LENGTH = 6; // Numero di caratteri che indicano la data nella licenza decrittata -const int DECRYPTED_TOTAL_LENGTH = 15; //lunghezza della licenza decrittata -const char *CODECHAR = "A"; //Ultimo carattere della licenza che identifica il formato -#endif - -const int ACTIVATION_CODE_LENGTH = 25; -const int LICENSE_CODE_LENGTH = 40; - -extern const char *applicationVersion; -const char *wincls = "CLSID"; -const char *sentinelfileRootPathMac = "/Library/Receipts/"; -using namespace License; - -QString m_lastErrorMessage = "No error"; - -std::string decrypt(std::string code); - -//le seguenti due classi sono valide solo per la crittografia -class TRUEHash : public CryptoPP::IteratedHashWithStaticTransform -{ -public: - static void InitState(HashWordType *state) - { - state[0] = 0x01; - return; - } - static void Transform(CryptoPP::word32 *digest, const CryptoPP::word32 *data) { return; } - static const char *StaticAlgorithmName() { return "TRUE HASH"; } -}; - -template -struct ECIESNullT - : public CryptoPP::DL_ES< - CryptoPP::DL_Keys_EC, - CryptoPP::DL_KeyAgreementAlgorithm_DH, - CryptoPP::DL_KeyDerivationAlgorithm_P1363>, - CryptoPP::DL_EncryptionAlgorithm_Xor, DHAES_MODE>, - CryptoPP::ECIES> { - static std::string StaticAlgorithmName() { return "ECIES with NULL T"; } -}; - -// Nella versione attuale (debug) i codici di attivazione sono lunghi 6 lettere, cominciano -// per 'P' e finiscono per 'E'. L'unico codice attivo e' PLEASE -// il codice POVERE provoca la simulazione di un errore di connessione -// Le licenze valide sono Thorin, Balin, Dwalin (permanenti), Gilgamesh (a tempo, scaduta) e -// Spiderman (a tempo, ancora valida). Topolino e' una licenza valida, ma su un'altra macchina - -//----------------------------------------------------------------------------- -namespace -{ -// e' il nome con cui viene salvata la licenza nei registry (oppure nei file di configurazione) -const char *licenseKeyName = "LicenseCode"; -} // namespace -//----------------------------------------------------------------------------- - -std::string License::addDefaultChars(std::string code) -{ - return "ASA" + code + "AAAAB"; -} - -#ifdef WIN32 -// Restituisce i MacAddress di tutte le interfacce di rete -std::vector getAllMacAddressWin() -{ - std::vector allMacAddress; - allMacAddress.clear(); - IP_ADAPTER_INFO AdapterInfo[16]; // Allocate information for up to 16 NICs - DWORD dwBufLen = sizeof(AdapterInfo); // Save the memory size of buffer - - DWORD dwStatus = GetAdaptersInfo( // Call GetAdapterInfo - AdapterInfo, // [out] buffer to receive data - &dwBufLen); // [in] size of receive data buffer - assert(dwStatus == ERROR_SUCCESS); // Verify return value is valid, no buffer overflow - if (dwStatus != ERROR_SUCCESS) { - MsgBox(CRITICAL, QObject::tr("Can't find Adapter Info")); - return allMacAddress; - } - PIP_ADAPTER_INFO pAdapterInfo = AdapterInfo; // Contains pointer to current adapter info - string MacAddresStr = ""; - do { - char acMAC[18]; - int type = (int)pAdapterInfo->Type; - sprintf(acMAC, "%02X%02X%02X%02X%02X%02X", - int(pAdapterInfo->Address[0]), - int(pAdapterInfo->Address[1]), - int(pAdapterInfo->Address[2]), - int(pAdapterInfo->Address[3]), - int(pAdapterInfo->Address[4]), - int(pAdapterInfo->Address[5])); - string MacAddresStr = toUpper(acMAC); - pAdapterInfo = pAdapterInfo->Next; // Progress through linked list - //se type è == 6 allora si tratta di un Ethernet adapter - if (type == 6) - allMacAddress.push_back(MacAddresStr); - } while (pAdapterInfo); // Terminate if last adapter - return allMacAddress; -} -// Restituisce il Mac Address della prima interfaccia di rete -std::string getMacAddressWin() -{ - std::vector allMacAddress = getAllMacAddressWin(); - std::string MacAddressStr = ""; - for (int i = 0; i < (int)allMacAddress.size(); i++) { - MacAddressStr = allMacAddress[i]; - if ((int)MacAddressStr.size() == 12) - break; - } - return MacAddressStr; -} - -// Restituisce i Machine Code (ultimi MACHINE_CODE_LENGTH caratteri del MAc Address della prima interfaccia di Rete.) di -// tutt le interfacce di rete -// Funzione per Windows. -std::vector getAllMachineCodeWin() -{ - std::vector allMachineCode; - allMachineCode.clear(); - allMachineCode = getAllMacAddressWin(); - for (int i = 0; i < (int)allMachineCode.size(); i++) - allMachineCode[i] = allMachineCode[i].substr(12 - MACHINE_CODE_LENGTH, MACHINE_CODE_LENGTH); - return allMachineCode; -} -// ritorna il machine code per Windows. Se nn c'è nessun machine code valido ritorna ""; -std::string getMachineCodeWin(int index) -{ - std::vector allMachineCode = getAllMachineCodeWin(); - assert(index < (int)allMachineCode.size() && index >= -1); - std::string MacAddressStr = ""; - if ((int)allMachineCode.size() > 0) { - if (index == -1) - MacAddressStr = allMachineCode[0]; - else - MacAddressStr = allMachineCode[index]; - } - return MacAddressStr; -} -#endif - -// Resitituisce tutti gli indici delle interfacce di rete (vale per macOS) -std::vector getValidMachineCodesIndex() -{ - std::vector machineCodesIndex; - QList allInterface = QNetworkInterface::allInterfaces(); - bool valid = false; - int i = 0; - - for (i = 0; i < allInterface.size(); i++) { - QNetworkInterface netInterface; - netInterface = QNetworkInterface::interfaceFromIndex(i); - if (!netInterface.isValid()) - continue; - QString mac = netInterface.hardwareAddress(); - - //Se la lunghezza dell'indirizzo e' 17 (caratteri piu' i : separatori) - //allora e' considerato valido - if (mac.size() == 17) - machineCodesIndex.push_back(i); - } - if (machineCodesIndex.size() == 0) { - MsgBox(CRITICAL, QObject::tr("No Network Interface found.")); - } - return machineCodesIndex; -} - -//restituisce il MacAddress per intero -std::string License::getFirstValidMacAddress() -{ - std::string macAddressString = ""; -#ifdef WIN32 - macAddressString = getMacAddressWin(); -#else - std::vector validMachineCodesIndex = getValidMachineCodesIndex(); - if ((int)validMachineCodesIndex.size() > 0) { - //prendo la prima interfaccia di rete valida - QNetworkInterface netInterface = QNetworkInterface::interfaceFromIndex(validMachineCodesIndex[0]); - QString macAddress = netInterface.hardwareAddress(); - macAddress.remove(QChar(':'), Qt::CaseInsensitive); - macAddress = macAddress.toUpper(); - macAddressString = macAddress.toStdString(); - } -#endif - if (macAddressString == "" || macAddressString.size() != 12) - MsgBox(CRITICAL, QObject::tr("Cannot find a valid computer code.")); - return macAddressString; -} -std::string License::getCodeFromMacAddress(string macAddress) -{ - macAddress = macAddress.substr(12 - MACHINE_CODE_LENGTH, MACHINE_CODE_LENGTH); - return macAddress; -} - -//----------------------------------------------------------------------------- - -std::string License::getInstalledLicense() -{ - TFilePath fp(getLicenseFilePath()); - if (TFileStatus(fp).doesExist() == false) { - m_lastErrorMessage = "Can't find License!"; - return ""; - } - Tifstream is(fp); - char buffer[1024]; - is.getline(buffer, sizeof buffer); - std::string license = buffer; - return license; -} - -void License::getAllValidMacAddresses(std::vector &addresses) -{ -#ifdef WIN32 - addresses = getAllMacAddressWin(); -#else - std::vector macAddressIndex; - macAddressIndex = getValidMachineCodesIndex(); - - for (int i = 0; i < (int)macAddressIndex.size(); i++) { - QNetworkInterface netInterface = QNetworkInterface::interfaceFromIndex(macAddressIndex[i]); - QString macAddress = netInterface.hardwareAddress(); - macAddress.remove(QChar(':'), Qt::CaseInsensitive); - macAddress = macAddress.toUpper(); - std::string macAddressString = macAddress.toStdString(); - addresses.push_back(macAddressString); - } -#endif -} - -bool getMachineCodeFromDecryptedCode(string decryptedCode, string &macAddress) -{ - if (decryptedCode.size() != DECRYPTED_TOTAL_LENGTH) { - m_lastErrorMessage = "Invalid License length"; - return false; - } - macAddress = decryptedCode.substr(0, MACHINE_CODE_LENGTH); - return true; -} - -bool getDateFromDecryptedCode(string decryptedCode, string &date) -{ - if (decryptedCode.size() != DECRYPTED_TOTAL_LENGTH) { - m_lastErrorMessage = "Invalid License length"; - return false; - } - date = decryptedCode.substr(MACHINE_CODE_LENGTH + SEPARATOR_LENGTH, DATE_LENGTH); - return true; -} - -bool getSeparatorFromDecryptedCode(string decryptedCode, string &separator) -{ - if (decryptedCode.size() != DECRYPTED_TOTAL_LENGTH) { - m_lastErrorMessage = "Invalid License length"; - return false; - } - separator = decryptedCode.substr(MACHINE_CODE_LENGTH, SEPARATOR_LENGTH); - return true; -} - -bool checkSeparatorFromDecryptedCode(string decryptedCode, LicenseType &licenseType) -{ - string separator = ""; - if (!getSeparatorFromDecryptedCode(decryptedCode, separator)) - return false; - - if (separator.compare("LT64") == 0) { - licenseType = LINETEST_LICENSE; - } else - licenseType = INVALID_LICENSE; - return true; -} -/* -// data la licenza decriptata resituisce il tipo di licenza -void checkSeparatorFromDecryptedCode(string decryptedCode, string &separator, int &licenseType) -{ -QString QdecryptedLicense = QString::fromStdString(decryptedCode); - if(QdecryptedLicense.contains("LT")) - { - licenseType = LINETEST_LICENSE; - separator = "LT"; - } - else - licenseType = INVALID_LICENSE; -} - -// ritorna il tipo di licenza, il machine code e la data di scadenza della licenza -// se non c'è un separatre valido ritorna INVALID_LICENSE -int getMachineCodeAndExpDateFromDecryptedCode(std::string decryptedCode, string &machineCode, string &expDate) -{ - if(decryptedCode.length()!=LICENSE_CODE_LENGTH) return INVALID_LICENSE; - machineCode = decryptedCode.substr(0,MACHINE_CODE_LENGTH); - expDate = decryptedCode.substr(decryptedCode.size()-6,6); - - QStringList QdecryptedLicenseList; - int licenseType = 0; - string separator ; - checkSeparatorFromDecryptedCode(decryptedCode,separator,licenseType); - QdecryptedLicenseList = codeQString.split(QString::fromStdString(separator)); - //se manca il separatore ritorna "". - if(licenseType == INVALID_LICENSE) return licenseType; - if(QdecryptedLicenseList.size()<2) return licenseType; - machineCode = QdecryptedLicenseList.at(0).toStdString(); - expDate = QdecryptedLicenseList.at(1).toStdString(); - return licenseType; -}*/ - -LicenseType License::checkLicense(std::string code) -{ - if (code == "") - code = getInstalledLicense(); - // decodifca code; controlla il MAC; se c'e' una data di scadenza - // la confronta con oggi. - QString codeQString = QString::fromStdString(code); - // Elimino i trattini dalla licenza - codeQString = codeQString.remove(QChar('-'), Qt::CaseInsensitive); - code = codeQString.toStdString(); - - if (code.size() != LICENSE_CODE_LENGTH) - return INVALID_LICENSE; - - // decodifca code; controlla il MAC; se c'e' una data di scadenza - // la confronta con oggi. - std::string decryptedLicense = decryptLicense(code); - - if (decryptedLicense == "") - return INVALID_LICENSE; //throw std::string("CryptoPP::DecodingResult: Invalid Coding"); } - - string machineCodeFromDecryptedLecense = ""; - bool ret = getMachineCodeFromDecryptedCode(decryptedLicense, machineCodeFromDecryptedLecense); - if (!ret) - return INVALID_LICENSE; - string expDate = ""; - ret = getDateFromDecryptedCode(decryptedLicense, expDate); - if (!ret) - return INVALID_LICENSE; - - LicenseType licenseType = INVALID_LICENSE; - ret = checkSeparatorFromDecryptedCode(decryptedLicense, licenseType); - if (!ret) - return INVALID_LICENSE; - if (licenseType == INVALID_LICENSE) - return INVALID_LICENSE; - - std::vector allMacAddresses; - // Recupero tutti i mac address validi presenti sulla macchina corrente. - getAllValidMacAddresses(allMacAddresses); - - bool validMac = false; - int t = 0; - for (t = 0; t < (int)allMacAddresses.size(); t++) { - std::string machineCode = getCodeFromMacAddress(allMacAddresses[t]); - if (machineCodeFromDecryptedLecense == machineCode) { - validMac = true; - break; - } - } - if (validMac == false) - return INVALID_LICENSE; - - if (expDate != INFINITY_LICENSE) { - QString expirationDateString = "20" + QString::fromStdString(expDate); - QDate expirationDate = expirationDate.fromString(expirationDateString, "yyyyMMdd"); - QDate currentDate = QDate::currentDate(); - - if (!expirationDate.isValid() || expirationDate <= currentDate) - licenseType = INVALID_LICENSE; - } - return (licenseType); -} -/* - int *License::checkLicense() - { - static int globalSave; - std::string license = getInstalledLicense(); - if(isValidLicense(license)) - return &globalSave; - else - return 0; - } - */ -//----------------------------------------------------------------------------- - -bool License::isTemporaryLicense(std::string code) -{ - //if(checkLicense(code)==INVALID_LICENSE) return false; - QString codeQString = QString::fromStdString(code); - codeQString = codeQString.remove(QChar('-'), Qt::CaseInsensitive); - code = codeQString.toStdString(); - // decodificazione di code - std::string decryptedLicense = decryptLicense(code); - QString QdecryptedLicense = QString::fromStdString(decryptedLicense); - LicenseType licenseType = INVALID_LICENSE; - bool ret = checkSeparatorFromDecryptedCode(decryptedLicense, licenseType); - if (licenseType == INVALID_LICENSE || !ret) - return false; - - std::vector allMacAddresses; - getAllValidMacAddresses(allMacAddresses); - std::string machineCodeFromDecryptedLecense = ""; - ret = getMachineCodeFromDecryptedCode(decryptedLicense, machineCodeFromDecryptedLecense); - if (!ret) - return false; - int t = 0; - bool validMac = false; - for (t = 0; t < (int)allMacAddresses.size(); t++) { - std::string machineCode = getCodeFromMacAddress(allMacAddresses[t]); - if (machineCodeFromDecryptedLecense == machineCode) { - validMac = true; - break; - } - } - if (validMac == false) - return false; - string expDate = ""; - ret = getDateFromDecryptedCode(decryptedLicense, expDate); - if (!ret) - return false; - if (expDate != INFINITY_LICENSE) { - QString expirationDateString = "20" + QString::fromStdString(expDate); - QDate expirationDate = expirationDate.fromString(expirationDateString, "yyyyMMdd"); - return (expirationDate.isValid()); - } else - return false; - return false; -} - -//----------------------------------------------------------------------------- - -int License::getDaysLeft(std::string code) -{ - // Elimino i segni "-" dal code - QString codeQString = QString::fromStdString(code); - codeQString = codeQString.remove(QChar('-'), Qt::CaseInsensitive); - code = codeQString.toStdString(); - // decodificazione di code - std::string decryptedLicense = decryptLicense(code); - QString QdecryptedLicense = QString::fromStdString(decryptedLicense); - QStringList QdecryptedLicenseList; // = QdecryptedLicense.split("%"); - string separator; - LicenseType licenseType = INVALID_LICENSE; - bool ret = checkSeparatorFromDecryptedCode(decryptedLicense, licenseType); - if (licenseType == INVALID_LICENSE || !ret) - return 0; - - string expDate = ""; - ret = getDateFromDecryptedCode(decryptedLicense, expDate); - if (!ret) - return 0; - - QString expirationDateString = "20" + QString::fromStdString(expDate); - - QDate expirationDate = expirationDate.fromString(expirationDateString, "yyyyMMdd"); - - bool validExpirationDate = expirationDate.isValid(); - assert(validExpirationDate == true); - QDate currentDate = QDate::currentDate(); - int day = currentDate.daysTo(expirationDate); - return currentDate.daysTo(expirationDate); -} - -//----------------------------------------------------------------------------- - -bool License::isActivationCode(std::string code) -{ - // Elimino i segni "-" dal code - QString codeQString = QString::fromStdString(code); - codeQString = codeQString.remove(QChar('-'), Qt::CaseInsensitive); - code = codeQString.toStdString(); - int length = code.length(); - if (length != ACTIVATION_CODE_LENGTH) - return 0; - int tot = 0; - for (int i = 0; i < length - 1; i++) { - int chrAscii = code[i]; - tot += chrAscii; //std::cout << chrAscii; - } - tot = tot % 26; - return ((tot + 65) == (int)code[length - 1]); - //return code.length() == 6 && code[0]=='P' && code[5]=='E'; -} -//--------------------------------------------------------------------- -//Controllo della sentinella. Lo facciamo per controllare che la data della -//prima installazione sia minore della data corrente. -//--------------------------------------------------------------------- -#ifdef MACOSX - -void strreverse(char *begin, char *end) -{ - char aux; - while (end > begin) - aux = *end, *end-- = *begin, *begin++ = aux; -} - -void itoa(int value, char *str, int base) -{ - - static char num[] = "0123456789abcdefghijklmnopqrstuvwxyz"; - char *wstr = str; - int sign; - - // Validate base - if (base < 2 || base > 35) { - *wstr = '\0'; - return; - } - - // Take care of sign - if ((sign = value) < 0) - value = -value; - - // Conversion. Number is reversed. - do - *wstr++ = num[value % base]; - while (value /= base); - if (sign < 0) - *wstr++ = '-'; - *wstr = '\0'; - - // Reverse string - strreverse(str, wstr - 1); -} - -TFilePath getSentileFilePath(string regKey) -{ - string filenameString = "." + regKey.substr(1, regKey.size() - 2); - return TFilePath(sentinelfileRootPathMac) + TFilePath(filenameString); -} -#endif - -char *getC(char *c) -{ - int num = (int)c[0]; - num = (num % 16); - char *ch = new char; - *ch = '0'; -#ifdef MACOSX - itoa(num, ch, 16); -#else - _itoa(num, ch, 16); -#endif - return ch; -} -std::string License::createClsid(string fullMacAddress, char *licenseType) -{ - string RFullMacAddress = fullMacAddress; - reverse(RFullMacAddress.begin(), RFullMacAddress.end()); - int i; - - //std::cout << "applicationVersion=" << applicationVersion << std::endl; - string applicationVersionString = string(applicationVersion); - //std::cout << "applicationVersionString=" << applicationVersionString << std::endl; - - string fullString = ""; - if (LICENSE_FORMAT_TYPE == 3) - fullString = licenseType + RFullMacAddress + - applicationVersionString.substr(0, 1) + applicationVersionString.substr(2, 1) + - fullMacAddress + "0" + applicationVersionString.substr(2, 1) + applicationVersionString.substr(0, 1) + "00"; - else - fullString = licenseType + RFullMacAddress + - applicationVersionString.substr(0, 1) + applicationVersionString.substr(2, 1) + - fullMacAddress + applicationVersionString.substr(2, 1) + applicationVersionString.substr(0, 1) + "00"; - assert(fullString.length() == 32); - string clsid = "{"; - for (i = 0; i < 32; i++) { - if (i == 8 || i == 12 || i == 16 || i == 20) - clsid += "-"; - char c0 = fullString[i]; - clsid += getC(&c0); - } - //sostituiamo due elementi affinche cambino al cambiare di applicationVersion per - //garantire nuove licenze demo al cambio di versione - - //std::cout << "applicationVersion[0]=" << applicationVersion[0] << std::endl; - //std::cout << "applicationVersion[2]=" << applicationVersion[2] << std::endl; - - //clsid[8]=applicationVersion[0]; - //clsid[13]=applicationVersion[2]; - clsid[1] = toupper(clsid[1]); - clsid += "}"; - return clsid; -} -//Se la sentinella non esiste ritorna la stringa "noExists" -std::string License::readSentinelDate(string regKey) -{ -#ifdef WIN32 - //string wincls="CLSID"; - TCHAR buffer[1024]; - unsigned long bufferSize = sizeof(buffer); - wstring value; - string regKeyF = string(wincls) + "\\" + regKey + "\\InProcServer32"; - HKEY hcplF; - if (RegOpenKeyEx(HKEY_CLASSES_ROOT, - toWideString(regKeyF).c_str(), - 0, - KEY_READ, - &hcplF) == ERROR_SUCCESS) { - RegQueryValueEx(hcplF, L"Version", 0, 0, (BYTE *)buffer, &bufferSize); - } else - return "noExists"; - RegCloseKey(hcplF); - return toString(wstring(buffer)); -#else - TFilePath fp = getSentileFilePath(regKey); - if (TFileStatus(fp).doesExist() == false) - return "noExists"; - Tifstream is(fp); - char buffer[1024]; - is.getline(buffer, sizeof buffer); - std::string cdate = buffer; - return cdate; -#endif -} - -bool License::isValidSentinel(string license) -{ - string decryptedLicense = decryptLicense(license); - LicenseType licenseType = INVALID_LICENSE; - bool ret = checkSeparatorFromDecryptedCode(decryptedLicense, licenseType); - if (!ret) - return false; - string separator = ""; - ret = getSeparatorFromDecryptedCode(decryptedLicense, separator); - if (!ret) - return false; - std::vector allMacAddress; - getAllValidMacAddresses(allMacAddress); - string cryptedSentinelDateString; - for (int i = 0; i < (int)allMacAddress.size(); i++) { - std::string fullMacAddress = allMacAddress[i]; - string licenseType = ""; - if (LICENSE_FORMAT_TYPE == 1) - licenseType = separator.substr(0, 2); - else - licenseType = separator; - char *licType = new char; - strcpy(licType, licenseType.c_str()); - string regKey = createClsid(fullMacAddress, licType); - cryptedSentinelDateString = readSentinelDate(regKey); - if (cryptedSentinelDateString != "noExists") - break; - } - //Se la sentinella non esiste vuol dire che il software non - //è stato istallato e quindi non viene fatto alcun controllo sulla sentinella. - if (cryptedSentinelDateString == "noExists") - return true; - string sentinelDateString = decrypt(cryptedSentinelDateString).substr(0, 8); - QDate sentinelDate = sentinelDate.fromString(QString::fromStdString(sentinelDateString), "yyyyMMdd"); - if (!sentinelDate.isValid()) - return false; - QDate currentDate = QDate::currentDate(); - return (sentinelDate <= currentDate); -} - -//----------------------------------------------------------------------------- -myHttp::myHttp(const QString &requestToServer, LicenseWizard *licenseWizard) -#if QT_VERSION < 0x050000 - : QHttp() -#endif -{ - m_licenseWizard = licenseWizard; - //m_licenseWizard = new LicenseWizard(((QWidget*)TApp::instance()->getMainWindow())); - - m_licenseWizard->setPage(2); - - QUrl url(requestToServer); - -#if QT_VERSION >= 0x050000 - - QString urlTemp = requestToServer; - QStringList urlList = urlTemp.split('?'); - QStringList paramList = urlList.at(1).split('&'); - if (!url.userName().isEmpty()) - setUser(url.userName(), url.password()); - - m_httpRequestAborted = false; - - QString param; - param = QString("?") + paramList.at(0) + QString("&") + paramList.at(1) + QString("&") + paramList.at(2) + QString("&") + paramList.at(3); - - QNetworkAccessManager manager; - QNetworkReply *reply = manager.get(QNetworkRequest(url.path() + param)); - - QEventLoop loop; - - //connect(reply, SIGNAL(readyRead(const QHttpResponseHeader &)), &loop, SLOT(readyReadexec(const QHttpResponseHeader &))); - //connect(reply, SIGNAL(requestFinished(int, bool)), &loop, SLOT(httpRequestFinished(int, bool))); - connect(reply, SIGNAL(requestStarted(int)), &loop, SLOT(httpRequestStarted(int))); - //connect(reply, SIGNAL(responseHeaderReceived(const QHttpResponseHeader &)), &loop, SLOT(readResponseHeader(const QHttpResponseHeader &))); - connect(reply, SIGNAL(authenticationRequired(const QString &, quint16, QAuthenticator *)), &loop, SLOT(slotAuthenticationRequired(const QString &, quint16, QAuthenticator *))); - connect(reply, SIGNAL(stateChanged(int)), &loop, SLOT(httpStateChanged(int))); - - connect(&manager, SIGNAL(finished(QNetworkReply *)), this, SLOT(httpRequestFinished(QNetworkReply *))); - - loop.exec(); -#else - - connect(this, SIGNAL(readyRead(const QHttpResponseHeader &)), this, - SLOT(readyReadexec(const QHttpResponseHeader &))); - connect(this, SIGNAL(requestFinished(int, bool)), this, - SLOT(httpRequestFinished(int, bool))); - connect(this, SIGNAL(requestStarted(int)), this, - SLOT(httpRequestStarted(int))); - connect(this, SIGNAL(responseHeaderReceived(const QHttpResponseHeader &)), this, - SLOT(readResponseHeader(const QHttpResponseHeader &))); - connect(this, SIGNAL(authenticationRequired(const QString &, quint16, QAuthenticator *)), this, - SLOT(slotAuthenticationRequired(const QString &, quint16, QAuthenticator *))); - connect(this, SIGNAL(stateChanged(int)), this, - SLOT(httpStateChanged(int))); - QHttp::ConnectionMode mode = url.scheme().toLower() == "https" ? QHttp::ConnectionModeHttps : QHttp::ConnectionModeHttp; - - setHost(url.host(), mode, url.port() == -1 ? 0 : url.port()); - QString urlTemp = requestToServer; - QStringList urlList = urlTemp.split('?'); - QStringList paramList = urlList.at(1).split('&'); - if (!url.userName().isEmpty()) - setUser(url.userName(), url.password()); - - m_httpRequestAborted = false; - - QString param; - param = QString("?") + paramList.at(0) + QString("&") + paramList.at(1) + QString("&") + paramList.at(2) + QString("&") + paramList.at(3); - m_httpGetId = get(url.path() + param); //, file); -#endif -} - -#if QT_VERSION < 0x050000 -void myHttp::readResponseHeader(const QHttpResponseHeader &responseHeader) -{ - int err = responseHeader.statusCode(); - if (err != 200 && err != 502) { - //MsgBox(INFORMATION,tr("Download failed: %1.").arg(responseHeader.reasonPhrase())); - /*QMessageBox::information(0, tr("HTTP"), - tr("Download failed: %1.") - .arg(responseHeader.reasonPhrase()));*/ - m_httpRequestAborted = true; - abort(); - } -} -#endif - -//----------------------------------------------------------------------------- -void myHttp::httpStateChanged(int status) -{ - QString stateStr; - switch (status) { - case 1: - stateStr = "A host name lookup is in progress..."; - break; - case 2: - stateStr = "Connecting..."; - break; - case 3: - stateStr = "Sending informations..."; - break; - case 4: - stateStr = "Reading informations..."; - break; - case 5: - stateStr = "Connected."; - break; - case 6: - stateStr = "The connection is closing down, but is not yet closed. (The state will be Unconnected when the connection is closed.)"; - default: - stateStr = "There is no connection to the host."; - } - status = state(); - qDebug("Status: %d", status); - m_licenseWizard->m_stateConnectionLbl->setText(stateStr); -} - -#if QT_VERSION >= 0x050000 -void myHttp::httpRequestFinished(QNetworkReply *reply) -#else -void myHttp::httpRequestFinished(int requestId, bool error) -#endif -{ - - QByteArray arr; - string license; - std::string newLicense; - QString qstr; -#if QT_VERSION < 0x050000) - if (requestId != m_httpGetId) - return; - if (error || m_httpRequestAborted) - goto errore; - - arr = readAll(); -#else - if (reply->error() != QNetworkReply::NoError) - goto errore; - arr = reply->readAll(); -#endif - qstr = QString(arr); - int startIndex = qstr.indexOf("Startcode"); - int endIndex = qstr.indexOf("Endcode"); - - if ((endIndex - startIndex - 9) <= 0) - goto errore; - license = qstr.toStdString(); - license = license.substr(startIndex + 9, endIndex - startIndex - 9); - - if (checkLicense(license) == INVALID_LICENSE) { - MsgBox(WARNING, tr("Activation error: ") + QString::fromStdString(license)); - //QMessageBox::information(0, QString("Invalid License"), QString::fromStdString(license)); - goto errore; - } - - bool ok = setLicense(license); - if (!ok) { - MsgBox(CRITICAL, tr("Cannot write the license code to disk.")); - return; - } - - //Verifico che tutto sia andato bene - newLicense = getInstalledLicense(); - if (license != newLicense) { - MsgBox(CRITICAL, tr("Can't write license on disk!")); - //QMessageBox::information(0, QString("Error"), "Non e' possibile scrivere la licenza su disco!"); - m_licenseWizard->setPage(1); - return; - } else { - m_licenseWizard->accept(); - //MsgBox(INFORMATION,tr("Activation successfully!")); - return; - } - -errore: - QString errore = errorString(); - //MsgBox(WARNING,errorString()); -} - -void myHttp::slotAuthenticationRequired(const QString &hostName, quint16, QAuthenticator *authenticator) -{ - assert(false); -} - -//----------------------------------------------------------------------------------- -extern const char *applicationVersion; -extern const char *applicationName; -ActivateStatus License::activate(string activationCode, LicenseWizard *licenseWizard) -{ - //licenseWizard->hide();//lose();//accept(); - string MacAddress = getFirstValidMacAddress(); - string tabversion = string(applicationVersion); - string appname = string(applicationName); - QString requestToServer = "http://www.the-tab.com/cgi-shl/tab30/activate/run.asp"; - requestToServer = requestToServer + QString("?Activation_Code=") + QString::fromStdString(activationCode); - requestToServer = requestToServer + QString("&MAC_Address=") + QString::fromStdString(MacAddress); - requestToServer = requestToServer + QString("&AppName=") + QString::fromStdString(appname); - requestToServer = requestToServer + QString("&Version=") + QString::fromStdString(tabversion); - requestToServer.remove(" "); - - myHttp *http = new myHttp(requestToServer, licenseWizard); - return OK; -} - -//----------------------------------------------------------------------------------- - -TFilePath License::getMacAddressFilePath() -{ - return TFilePath(TEnv::getStuffDir() + "config" + "computercode.txt"); -} - -TFilePath License::getLicenseFilePath() -{ - return TFilePath(TEnv::getStuffDir() + "config" + "license.dat"); -} -//----------------------------------------------------------------------------- - -bool License::setLicense(std::string license) -{ - if (checkLicense(license) == INVALID_LICENSE) - return false; - TFilePath licenseFilePath = getLicenseFilePath(); - Tofstream os(licenseFilePath); - os << license; - - return true; - /* - QSettings settings( - "license.dat"); - settings.setPath(QSettings::IniFormat, - QSettings::SystemScope, - QString::fromStdWString(configDir.getWideString())); - QSettings settings( - QSettings::SystemScope, - QCoreApplication::organizationName(), - QCoreApplication::applicationName()); - settings.setValue(licenseKeyName, QString::fromStdString(license)); - settings.sync(); */ - // non voglio rischiare che un crash mi faccia perdere la licenza - // con sync mi assicuro che venga scritta subito (su disco o nei registry) - //return true; -} -// Se c'è installata una licenza allora la decripta e legge il machine code. -// Se questo è uguale al mac Address di una delle interfacce di rete presenti -// sulla macchina corrente allora scrive questo MAC su file. -// In caso contrario scrive su file il mac address della prima interfaccia di rete valida. -bool License::writeMacAddress() -{ - std::string macAddress = ""; - std::string decryptedLicense = ""; - string encryptedLicense = getInstalledLicense(); - if (encryptedLicense != "") { - // Elimino i trattini dalla licenza - QString qlicense = QString::fromStdString(encryptedLicense).remove(QChar('-'), Qt::CaseInsensitive); - string code = qlicense.toStdString(); - // decripto la licenza installata - decryptedLicense = decryptLicense(code); - } - if (decryptedLicense != "") { - string macAddressFromDecryptedLecense = ""; - bool ret = getMachineCodeFromDecryptedCode(decryptedLicense, macAddressFromDecryptedLecense); - std::vector allMacAddresses; - // Recupero tutti i mac address validi presenti sulla macchina corrente. - getAllValidMacAddresses(allMacAddresses); - int t = 0; - for (t = 0; t < (int)allMacAddresses.size(); t++) { - std::string machineCode = getCodeFromMacAddress(allMacAddresses[t]); - if (macAddressFromDecryptedLecense == machineCode) { - macAddress = allMacAddresses[t]; - break; - } - } - } - if (macAddress == "") - macAddress = getFirstValidMacAddress(); - TFilePath macAddressFilePath = getMacAddressFilePath(); - Tofstream os(macAddressFilePath); - os << macAddress; - return true; -} -//----------------------------------------------------------------------------- - -//Restituisce la stringa decriptata. -//Se il code non è un codice valido restituisce "". -std::string decrypt(std::string code) -{ - CryptoPP::Integer p("5860230647"); - CryptoPP::Integer a("-3"); - CryptoPP::Integer b("-2814718968"); - CryptoPP::Integer n("158380489"); // R from ECB - CryptoPP::Integer h("37"); // S from ECB - - CryptoPP::Integer x("0"); - CryptoPP::Integer y("0"); - - CryptoPP::AutoSeededRandomPool rng; - CryptoPP::ECP ec(p, a, b); - - ECIESNullT::PrivateKey PrivateKey; - - // Inizializzazione Chiave - PrivateKey.Initialize(ec, CryptoPP::ECP::Point(x, y), n, h); - - CryptoPP::Base32Decoder Decoder; - - Decoder.Put(reinterpret_cast(code.c_str()), - code.length()); - Decoder.MessageEnd(); - - // Scratch forBase 32 Encoded Ciphertext - unsigned int DecodedTextLength = Decoder.MaxRetrievable(); - byte *DecodedText = new byte[DecodedTextLength + 1]; - - if (NULL == DecodedText) - return false; //DecodedText Allocation Failure } - DecodedText[DecodedTextLength] = '\0'; - Decoder.Get(DecodedText, DecodedTextLength); - - // Decryption - ECIESNullT::Decryptor Decryptor(PrivateKey); - - int plainTextLength = Decryptor.MaxPlaintextLength(DecodedTextLength); - - // Scratch for Decryption - unsigned int RecoveredTextLength = Decryptor.MaxPlaintextLength(DecodedTextLength); - if (0 == RecoveredTextLength) { - return ""; - } //throw std::string("codeLength non valida (too long or too short)"); } - - byte *RecoveredText = new byte[4 * plainTextLength]; - if (NULL == RecoveredText) { - return ""; - } //throw std::string( "RecoveredText CipherText Allocation Failure" ); } - - // Decryption - CryptoPP::DecodingResult Result = Decryptor.Decrypt(rng, DecodedText, DecodedTextLength, RecoveredText); - - if (false == Result.isValidCoding) - return ""; //throw std::string("CryptoPP::DecodingResult: Invalid Coding"); } - std::string license = reinterpret_cast(RecoveredText); - - string decripetedLicense = license.substr(0, plainTextLength); - return decripetedLicense; -} -//----------------------------------------------------------------------------- - -std::string License::decryptLicense(std::string code) -{ - if (code == "") - return ""; - //Sostituisco l'ultima lettera della licenza, che serve ad identificare il tipo di formattazione della licenza - //Rimetto il carattere "A" per permettere la corretta decrittazione. - //Per maggiorni info vedere il generatore di licenze - int codesize = code.size(); - code = code.substr(0, codesize - 1) + "A"; - code = addDefaultChars(code); - - std::string decripetedLicense = decrypt(code); - - if (LICENSE_FORMAT_TYPE == 1) { - if (decripetedLicense.size() < 5) - return ""; - //La data nella licenza è in formato esadecimale, la converto in decimale. - QString datastring = "0x" + QString::fromStdString(decripetedLicense.substr(decripetedLicense.size() - 5, 5)); - bool ok = false; - int date = datastring.toInt(&ok, 16); - // sostituisco la data mettendola in formato esadecimale - decripetedLicense = decripetedLicense.substr(0, decripetedLicense.size() - 5) + QString::number(date).toStdString(); - } - return decripetedLicense; -} -//----------------------------------------------------------------------------- - -bool License::isStoryPlannerPro() -{ - string license = getInstalledLicense(); - string decryptedLicense = decryptLicense(license); - LicenseType licenseType = INVALID_LICENSE; - bool ret = checkSeparatorFromDecryptedCode(decryptedLicense, licenseType); - if (!ret) - return false; - if (licenseType == STORYPLANNERPRO_LICENSE) - return true; - else - return false; -} - -QString License::getLastError() -{ - return m_lastErrorMessage; -} diff --git a/toonz/sources/toonz/licensegui.cpp b/toonz/sources/toonz/licensegui.cpp deleted file mode 100644 index 4a2a538..0000000 --- a/toonz/sources/toonz/licensegui.cpp +++ /dev/null @@ -1,590 +0,0 @@ - - -#include -#include -#include -#include -#include -#include -#include -#include "licensegui.h" -#include "licensecontroller.h" -#include "tconvert.h" -#include "tapp.h" - -using namespace DVGui; - -const int LICENSE_CODE_LENGTH = 40; - -QString LicenseWizard::getDaysLeftString(int dayLeft) const -{ - if (dayLeft == 0) - return tr("Your license has just expired today."); - else if (dayLeft == -1) - return tr("Your license has expired yesterday."); - else if (dayLeft < -1) - return tr("Your license has expired %n days ago.", "", -dayLeft); - else if (dayLeft == 1) - return tr("You have one day left."); - else - return tr("You have %n days left.", "", dayLeft); -} - -QString LicenseWizard::getLicenseStatusString() const -{ - std::string license = License::getInstalledLicense(); - if (license == "") - return tr("No license installed."); - if (License::isTemporaryLicense(license)) { - int daysLeft = License::getDaysLeft(license); - return getDaysLeftString(daysLeft); - } else if (License::checkLicense(license) == License::INVALID_LICENSE) { - return tr("Corrupted license."); - } else { - // non dovrebbe succedere (se la licenza e' valida e non temporanea non si dovrebbe - // aprire il LicenseWizard - return tr("Valid license."); - } -} -LicenseWizardPage::LicenseWizardPage(QWidget *parent) - : QWidget(parent) -{ - m_layout = new QVBoxLayout; - m_layout->setAlignment(Qt::AlignCenter); - m_layout->setMargin(0); - m_layout->setSpacing(0); - QWidget *emptyWidget = new QWidget(); - emptyWidget->setFixedHeight(290); - m_layout->addWidget(emptyWidget); - this->setFixedSize(542, 358); -} -void LicenseWizardPage::changeSplashScreen(int id) -{ - m_screenPath = ":Resources/splashLT_trial_activate.png"; - update(); -} -void LicenseWizardPage::addWidget(QWidget *widget) -{ - m_layout->addWidget(widget); - this->setLayout(m_layout); -} -void LicenseWizardPage::paintEvent(QPaintEvent *) -{ - QPixmap pixmap(m_screenPath); - QPainter painter(this); - // Disegno lo sfondo - painter.drawPixmap(1, 1, pixmap); -} - -QWidget *LicenseWizard::createConnectionPage() -{ - LicenseWizard *parent = this; - QWidget *page = new QWidget(); - m_stateConnectionLbl = new QLabel(""); - m_stateConnectionLbl->setStyleSheet("background-color: rgb(255,255,255,0);"); - - setStyleSheet("LicenseWizard { border: 0px; }"); - createConnectionButtonBox(); - LicenseWizardPage *splashScreen = new LicenseWizardPage(); - splashScreen->changeSplashScreen(2); - splashScreen->addWidget(m_stateConnectionLbl); - QVBoxLayout *layout = new QVBoxLayout; - layout->setMargin(0); - layout->setSpacing(0); - layout->addWidget(splashScreen); - //layout->addWidget(m_stateConnectionLbl); - page->setLayout(layout); - - return page; -} -void LicenseWizard::paintEvent(QPaintEvent *) -{ - //disegno il bordo - QPainter painter(this); - QPen pen; // = new QPen; - pen.setColor(1); - pen.setWidth(3); - painter.setPen(pen); - int height = this->height(); - int width = this->width(); - painter.drawRect(0, 0, width - 1, height - 1); -} -QWidget *LicenseWizard::createTryBuyActivatePage() -{ - LicenseWizard *parent = this; - QWidget *page = new QWidget(); - - createTryBuyActivateButtonBox(); - QLabel *label = new QLabel(getLicenseStatusString()); - label->setStyleSheet("background-color: rgb(255,255,255,0);"); - - LicenseWizardPage *splashScreen = new LicenseWizardPage(); - splashScreen->changeSplashScreen(0); - - splashScreen->addWidget(label); - QVBoxLayout *layout = new QVBoxLayout; - layout->setMargin(0); - layout->setSpacing(0); - layout->addWidget(splashScreen); - //layout->addWidget(label); - page->setLayout(layout); - return page; -} - -QWidget *LicenseWizard::createActivatePage() -{ - LicenseWizard *parent = this; - QWidget *page = new QWidget(); - setTopMargin(0); - createActivateButtonBox(); - - LicenseWizardPage *splashScreen = new LicenseWizardPage(); - splashScreen->changeSplashScreen(1); - - // info - QLabel *info1 = new QLabel(tr("Enter your Activation Code, or your License Code, here:")); //QString::fromStdString(License::getMachineCode())); - info1->setStyleSheet("background-color: rgb(255,255,255,0);"); - m_info = new QLabel; - m_info->setStyleSheet("background-color: rgb(255,255,255,0);"); - m_info->setTextFormat(Qt::RichText); - m_info->setText(QString(tr("The Activation Code requires an active Internet connection."))); - m_checkFld = new QLabel(""); - m_checkFld->setStyleSheet("background-color: rgb(255,255,255,0);"); - m_checkFld->setFixedSize(22, 22); - m_checkFld->setAlignment(Qt::AlignLeft); - // code - QLineEdit *codeFld = new QLineEdit(); - codeFld->setFixedWidth(320); - codeFld->setInputMask(QString(">NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN")); - //m_codeFormat = ">NNNNNN"; - m_markCount = 0; - m_codeFld = codeFld; - connect(codeFld, SIGNAL(textChanged(const QString &)), this, SLOT(codeChanged(const QString &))); - connect(codeFld, SIGNAL(cursorPositionChanged(int, int)), this, SLOT(slotCursorPositionChanged())); - QVBoxLayout *layout = new QVBoxLayout; - - QWidget *centerWidget = new QWidget; - QGridLayout *gridLayout = new QGridLayout; - gridLayout->addWidget(info1, 0, 0); - gridLayout->addWidget(m_codeFld, 1, 0); - gridLayout->addWidget(m_checkFld, 1, 1, Qt::AlignLeft); - gridLayout->addWidget(m_info, 2, 0); - centerWidget->setFixedWidth(350); - centerWidget->setLayout(gridLayout); - - gridLayout->setMargin(0); - gridLayout->setSpacing(2); - layout->setMargin(0); - layout->setSpacing(0); - - splashScreen->addWidget(centerWidget); - layout->addWidget(splashScreen); - page->setLayout(layout); - return page; -} -void LicenseWizard::slotCursorPositionChanged() -{ - QString currentCode = m_codeFld->text(); - if (currentCode == "") - m_codeFld->setCursorPosition(0); -} -void LicenseWizard::createConnectionButtonBox() -{ - LicenseWizard *parent = this; - // bottoni - m_connectionButtonBox = new QDialogButtonBox(QDialogButtonBox::Cancel); - QPushButton *cancelButton = m_connectionButtonBox->button(QDialogButtonBox::Cancel); - cancelButton->setMinimumSize(65, 25); - cancelButton->setText(tr("Cancel")); - m_connectionButtonBox->setCenterButtons(true); - connect(m_connectionButtonBox, SIGNAL(rejected()), parent, SLOT(gotoActivatePage())); -} - -void LicenseWizard::createTryBuyActivateButtonBox() -{ - LicenseWizard *parent = this; - // bottoni: Try, Buy, Activate, Cancel - m_TryBuyActivationPageButtonBox = new QDialogButtonBox(QDialogButtonBox::Cancel); - QPushButton *cancelButton = m_TryBuyActivationPageButtonBox->button(QDialogButtonBox::Cancel); - cancelButton->setText(tr("Cancel")); - cancelButton->setMinimumSize(65, 25); - m_TryBuyActivationPageButtonBox->setCenterButtons(true); - connect(m_TryBuyActivationPageButtonBox, SIGNAL(accepted()), parent, SLOT(accept())); - connect(m_TryBuyActivationPageButtonBox, SIGNAL(rejected()), parent, SLOT(reject())); - - // activate - QPushButton *activateButton = new QPushButton(tr("&Activate")); - activateButton->setMinimumSize(65, 25); - m_TryBuyActivationPageButtonBox->addButton(activateButton, QDialogButtonBox::ActionRole); - connect(activateButton, SIGNAL(pressed()), parent, SLOT(gotoActivatePage())); - - // buy - QPushButton *buyButton = new QPushButton(tr("&Buy")); - buyButton->setMinimumSize(65, 25); - m_TryBuyActivationPageButtonBox->addButton(buyButton, QDialogButtonBox::ActionRole); - connect(buyButton, SIGNAL(pressed()), parent, SLOT(buy())); - - // try - QPushButton *tryButton = new QPushButton(tr("&Try")); - tryButton->setMinimumSize(65, 25); - tryButton->setDefault(true); -#ifdef LINETEST - m_TryBuyActivationPageButtonBox->addButton(tryButton, QDialogButtonBox::ActionRole); - connect(tryButton, SIGNAL(pressed()), parent, SLOT(tryAct())); -#else - m_TryBuyActivationPageButtonBox->addButton(tryButton, QDialogButtonBox::AcceptRole); - tryButton->setDisabled(License::checkLicense() == License::INVALID_LICENSE); -#endif - return; -} - -void LicenseWizard::createActivateButtonBox() -{ - LicenseWizard *parent = this; - // bottoni: Ok, Back - m_activationPageButtonBox = new QDialogButtonBox(); - m_activationPageButtonBox->setCenterButtons(true); - - // back - QPushButton *backButton = new QPushButton(tr("&Back")); - backButton->setMinimumSize(65, 25); - m_activationPageButtonBox->addButton(backButton, QDialogButtonBox::ActionRole); - connect(backButton, SIGNAL(pressed()), parent, SLOT(gotoFirstPage())); - - // activate - QPushButton *activateButton = new QPushButton(tr("&Activate")); - activateButton->setMinimumSize(65, 25); - m_activationPageButtonBox->addButton(activateButton, QDialogButtonBox::ActionRole); - connect(activateButton, SIGNAL(pressed()), this, SLOT(activate())); - m_activateBtn = activateButton; - m_activateBtn->setEnabled(false); - - //parent->addButtonBarWidget(m_activationPageButtonBox); - return; -} - -void LicenseWizard::codeChanged(const QString &text) -{ - if (text.size() > 47 || text.size() == 0) - return; - int cursorPosition = m_codeFld->cursorPosition(); - bool enabled = false; - - //formattazione - int i = 0; - QString codeFormat; - codeFormat = ">NNNNN"; - m_markCount = (text.size() - m_markCount) / 5; - QString dim = text; - dim = dim.remove("-", Qt::CaseInsensitive); - - if (m_markCount == 0) - codeFormat = ">NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN"; - if (dim.size() % 5 == 0) - m_markCount -= 1; - for (i = 0; i < m_markCount; i++) { - codeFormat += "-NNNNN"; - } - if (dim.size() % 5 == 0 && dim.size() < 40) - codeFormat += "N"; - m_codeFld->setInputMask(codeFormat); - - if (cursorPosition >= text.size()) - cursorPosition = dim.size() + m_markCount; - m_codeFld->setCursorPosition(cursorPosition); - std::string code = text.toStdString(); - if (License::checkLicense(code) != License::INVALID_LICENSE) { - enabled = true; - m_info->setTextFormat(Qt::RichText); - m_info->setText(QString(tr("Click the Activate button to license the software."))); - QPixmap pixmap(":Resources/check.png"); - QPainter painter(this); - painter.drawPixmap(0, 0, pixmap); - m_checkFld->setPixmap(pixmap); - //m_checkFld->setText("OK(L)"); - } else if (License::isActivationCode(code)) { - enabled = true; - m_info->setTextFormat(Qt::RichText); - m_info->setText(QString(tr("Click the Activate button to connect and license the software."))); - QPixmap pixmap(":Resources/check.png"); - QPainter painter(this); - painter.drawPixmap(0, 0, pixmap); - m_checkFld->setPixmap(pixmap); - //m_checkFld->setText("OK(A)"); - } else - m_checkFld->setText(" "); - m_activateBtn->setEnabled(enabled); - if (!enabled) { - m_info->setTextFormat(Qt::RichText); - m_info->setText(QString("The Activation Code requires an active Internet connection.")); - } -} - -void LicenseWizard::activate() -{ - std::string code = m_codeFld->text().toStdString(); - if (License::isActivationCode(code)) { - gotoConnectionPage(); - License::ActivateStatus status = License::activate(code, this); - /* - if(status==License::OK) - { - QMessageBox::information(0, QString("Congratulations"), "Activation successfully!"); - m_licenseWizard->accept(); - } - else if(status==License::ACTIVATION_REFUSED) - { - QMessageBox::information(0, QString("Activation failed"), "Activation refused"); - } - */ - } else if (License::checkLicense(code) != License::INVALID_LICENSE) { - bool ok = License::setLicense(code); - if (ok) { - this->accept(); - //DvMsgBox(INFORMATION,tr("Activation successfully!")); - } - } else { - MsgBox(CRITICAL, "Activation failed: the code is invalid."); - return; - } -} - -MyWidget::MyWidget(QWidget *parent) - : QWidget(parent) -{ - QString screenPath = ":Resources/splashLT_trial_activate.png"; - m_pixmap = new QPixmap(screenPath); - QSize sizePixmap = m_pixmap->size(); - this->setFixedSize(sizePixmap); -} -void MyWidget::paintEvent(QPaintEvent *) -{ - QPainter painter(this); - painter.drawPixmap(1, 1, *(m_pixmap)); -} -UpgradeLicense::UpgradeLicense(QWidget *parent) - : Dialog(TApp::instance()->getMainWindow(), true) -{ - setStyleSheet("margin: 1px;"); - setTopMargin(0); - setTopSpacing(0); - setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint); - QLabel *info = new QLabel("Enter StoryPlanner 3.3 license code:"); - info->setStyleSheet("background-color: rgb(255,255,255,0);"); - info->setAlignment(Qt::AlignLeft); - // code - m_codeFld = new QLineEdit(); - m_codeFld->setFixedWidth(320); - m_codeFld->setInputMask(QString(">NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN")); - m_markCount = 0; - connect(m_codeFld, SIGNAL(textChanged(const QString &)), this, SLOT(codeChanged(const QString &))); - connect(m_codeFld, SIGNAL(cursorPositionChanged(int, int)), this, SLOT(slotCursorPositionChanged())); - m_checkFld = new QLabel(""); - m_checkFld->setStyleSheet("background-color: rgb(255,255,255,0);"); - m_checkFld->setFixedSize(22, 22); - m_checkFld->setAlignment(Qt::AlignLeft); - m_info = new QLabel(""); - m_info->setStyleSheet("background-color: rgb(255,255,255,0);"); - MyWidget *widget = new MyWidget(); - QGridLayout *gridLayout = new QGridLayout; - - QWidget *emptyWidget = new QWidget(); - emptyWidget->setFixedHeight(290); - gridLayout->addWidget(emptyWidget, 0, 0); - gridLayout->addWidget(info, 1, 0); - - gridLayout->addWidget(m_codeFld, 2, 0); - gridLayout->addWidget(m_checkFld, 2, 1, Qt::AlignLeft); - gridLayout->addWidget(m_info, 3, 0); - - gridLayout->setMargin(0); - gridLayout->setSpacing(0); - widget->setLayout(gridLayout); - - addWidget(widget); - - QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Cancel); - QPushButton *cancelButton = buttonBox->button(QDialogButtonBox::Cancel); - cancelButton->setMinimumSize(65, 25); - cancelButton->setText(tr("Cancel")); - connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject())); - buttonBox->setCenterButtons(true); - - // back - m_upgradeButton = new QPushButton(tr("&Upgrade")); - m_upgradeButton->setMinimumSize(65, 25); - m_upgradeButton->setEnabled(false); - buttonBox->addButton(m_upgradeButton, QDialogButtonBox::ActionRole); - connect(m_upgradeButton, SIGNAL(pressed()), this, SLOT(upgrade())); - m_buttonFrame->setObjectName("LicenseDialogButtonFrame"); - m_buttonFrame->setStyleSheet("LicenseDialogButtonFrame: {border: 0px; background-color: rgb(225,225,225);}"); - addButtonBarWidget(buttonBox); -} -void UpgradeLicense::upgrade() -{ - std::string code = m_codeFld->text().toStdString(); - if (License::checkLicense(code) == License::PRO_LICENSE) { - bool ok = License::setLicense(code); - if (ok) { - this->accept(); - } - } -} -void UpgradeLicense::codeChanged(const QString &text) -{ - if (text.size() > 47 || text.size() == 0) - return; - int cursorPosition = m_codeFld->cursorPosition(); - bool enabled = false; - - //formattazione - int i = 0; - QString codeFormat; - codeFormat = ">NNNNN"; - m_markCount = (text.size() - m_markCount) / 5; - QString dim = text; - dim = dim.remove("-", Qt::CaseInsensitive); - - if (m_markCount == 0) - codeFormat = ">NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN"; - if (dim.size() % 5 == 0) - m_markCount -= 1; - for (i = 0; i < m_markCount; i++) { - codeFormat += "-NNNNN"; - } - if (dim.size() % 5 == 0 && dim.size() < 40) - codeFormat += "N"; - m_codeFld->setInputMask(codeFormat); - - if (cursorPosition >= text.size()) - cursorPosition = dim.size() + m_markCount; - m_codeFld->setCursorPosition(cursorPosition); - - QString qcode = text; - qcode = qcode.remove("-", Qt::CaseInsensitive); - std::string code = qcode.toStdString(); - bool enable = false; - m_checkFld->setText(" "); - m_info->setText(" "); - if (License::checkLicense(code) == License::PRO_LICENSE) { - enable = true; - m_info->setTextFormat(Qt::RichText); - m_info->setText(QString(tr("Click the Upgrade button."))); - QPixmap pixmap(":Resources/check.png"); - m_checkFld->setPixmap(pixmap); - } - m_upgradeButton->setEnabled(enable); -} -void UpgradeLicense::slotCursorPositionChanged() -{ - QString currentCode = m_codeFld->text(); - if (currentCode == "") - m_codeFld->setCursorPosition(0); -} -void UpgradeLicense::paintEvent(QPaintEvent *) -{ - //disegno il bordo - QPainter painter(this); - QPen pen; // = new QPen; - pen.setColor(1); - pen.setWidth(3); - painter.setPen(pen); - int height = this->height(); - int width = this->width(); - painter.drawRect(0, 0, width - 1, height - 1); -} -LicenseWizard::LicenseWizard(QWidget *parent) - : Dialog(TApp::instance()->getMainWindow(), true) -{ - setStyleSheet("margin: 1px;"); - setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint); - //setWindowTitle(tr("Try, Buy or Activate?")); - setTopMargin(0); - QStackedWidget *stackedWidget = new QStackedWidget(this); - stackedWidget->addWidget(createTryBuyActivatePage()); - stackedWidget->addWidget(createActivatePage()); - stackedWidget->addWidget(createConnectionPage()); - m_pages = stackedWidget; - addWidget(stackedWidget); - m_buttonFrame->setObjectName("LicenseDialogButtonFrame"); - m_buttonFrame->setStyleSheet("LicenseDialogButtonFrame: {border: 0px; background-color: rgb(225,225,225);}"); - createTryBuyActivateButtonBox(); - gotoFirstPage(); -} - -void LicenseWizard::buy() -{ - extern const char *applicationVersion; - extern const char *applicationName; - // string MacAddress=getValidMacAddress(); - QString qtabversion, qappname; - string spacedtabversion = string(applicationVersion); - string spacedappname = string(applicationName); - - qtabversion = QString::fromStdString(spacedtabversion); - qtabversion.remove(" "); - - qappname = QString::fromStdString(spacedappname); - qappname.remove(" "); - - std::wstring tabversion = qtabversion.toStdWString(); - std::wstring appname = qappname.toStdWString(); - -#ifdef WIN32 - std::wstring url(L"http://www.the-tab.com/cgi-shl/buy.asp?Version=" + tabversion + L"&Name=" + appname + L"&MAC_Address=" + toWideString(License::getFirstValidMacAddress())); - int ret = (int) - - ShellExecute(0, L"open", url.c_str(), - 0, 0, SW_SHOWNORMAL); - if (ret <= 32) { - throw TException(url + L" : can't open"); - } -#else - std::wstring url(L"http://www.the-tab.com/cgi-shl/buy.asp?Version=" + tabversion + L"\\&Name=" + appname + L"\\&MAC_Address=" + toWideString(License::getFirstValidMacAddress())); - - string cmd = "open "; - cmd = cmd + toString(url); - system(cmd.c_str()); -#endif -} - -#ifdef LINETEST -void LicenseWizard::tryAct() -{ - if (License::checkLicense() == License::INVALID_LICENSE) { - DVGui::requestTrialLicense(); - return; - } else - accept(); -} -#endif - -void LicenseWizard::gotoConnectionPage() -{ - clearButtonBar(); - m_activationPageButtonBox->hide(); - m_TryBuyActivationPageButtonBox->hide(); - addButtonBarWidget(m_connectionButtonBox); - m_connectionButtonBox->show(); - m_pages->setCurrentIndex(2); -} - -void LicenseWizard::gotoActivatePage() -{ - clearButtonBar(); - m_connectionButtonBox->hide(); - m_TryBuyActivationPageButtonBox->hide(); - addButtonBarWidget(m_activationPageButtonBox); - m_activationPageButtonBox->show(); - m_pages->setCurrentIndex(1); -} - -void LicenseWizard::gotoFirstPage() -{ - clearButtonBar(); - m_activationPageButtonBox->hide(); - m_connectionButtonBox->hide(); - addButtonBarWidget(m_TryBuyActivationPageButtonBox); - m_TryBuyActivationPageButtonBox->show(); - m_pages->setCurrentIndex(0); -} diff --git a/toonz/sources/toonz/licensegui.h b/toonz/sources/toonz/licensegui.h deleted file mode 100644 index 5c1975a..0000000 --- a/toonz/sources/toonz/licensegui.h +++ /dev/null @@ -1,115 +0,0 @@ - - -#ifndef LICENSEGUI_INCLUDED -#define LICENSEGUI_INCLUDED - -#include "toonzqt/dvdialog.h" - -#include -#include -#include - -class QStackedWidget; -class QLineEdit; -class QLabel; -class QPushButton; - -using namespace DVGui; - -class LicenseWizardPage : public QWidget -{ - Q_OBJECT - QString m_screenPath; - QVBoxLayout *m_layout; - -public: - LicenseWizardPage(QWidget *parent = 0); - void changeSplashScreen(int id); - void addWidget(QWidget *widget); - -protected: - void paintEvent(QPaintEvent *event); -}; - -class LicenseWizard : public Dialog -{ - Q_OBJECT - QStackedWidget *m_pages; - LicenseWizard *m_licenseWizard; - QDialogButtonBox *m_activationPageButtonBox; - QDialogButtonBox *m_TryBuyActivationPageButtonBox; - QDialogButtonBox *m_connectionButtonBox; - - QLineEdit *m_codeFld; - QLabel *m_checkFld; - QLabel *m_info; - QPushButton *m_activateBtn; - QString m_codeFormat; //gestisce la formattazione(i trattini) di attivationCode e License. - int m_markCount; - - QWidget *createTryBuyActivatePage(); - QWidget *createActivatePage(); - QWidget *createConnectionPage(); - -public: - LicenseWizard(QWidget *parent = 0); - QLabel *m_stateConnectionLbl; - QString getDaysLeftString(int dayLeft) const; - QString getLicenseStatusString() const; - void setPage(int pageIndex) { m_pages->setCurrentIndex(pageIndex); } -protected: - void paintEvent(QPaintEvent *); - -protected slots: - void buy(); -#ifdef LINETEST - void tryAct(); -#endif - void gotoActivatePage(); - void gotoConnectionPage(); - void gotoFirstPage(); - void codeChanged(const QString &text); - void slotCursorPositionChanged(); - void activate(); - -private: - LicenseWizard(const LicenseWizard &); - void createActivateButtonBox(); - void createConnectionButtonBox(); - void createTryBuyActivateButtonBox(); - void operator=(const LicenseWizard &); -}; - -class UpgradeLicense : public Dialog -{ - Q_OBJECT - QPushButton *m_upgradeButton; - QLabel *m_checkFld; - QLabel *m_info; - QLineEdit *m_codeFld; - int m_markCount; - -public: - UpgradeLicense(QWidget *parent = 0); -protected slots: - void upgrade(); - void codeChanged(const QString &text); - void slotCursorPositionChanged(); - -protected: - void paintEvent(QPaintEvent *event); -}; - -class MyWidget : public QWidget -{ - Q_OBJECT - QPixmap *m_pixmap; - -public: - MyWidget(QWidget *parent = 0); - -protected: - void paintEvent(QPaintEvent *event); -}; - -#endif diff --git a/toonz/sources/toonz/main.cpp b/toonz/sources/toonz/main.cpp index 83da2db..1e93d96 100644 --- a/toonz/sources/toonz/main.cpp +++ b/toonz/sources/toonz/main.cpp @@ -87,51 +87,12 @@ TEnv::IntVar EnvSoftwareCurrentFontSize("SoftwareCurrentFontSize", 12); const char *applicationFullName = "LineTest 6.4 Beta"; const char *rootVarName = "LINETESTROOT"; const char *systemVarPrefix = "LINETEST"; -#elif defined BRAVODEMO -const char *applicationName = "Toonz Bravo"; -const char *applicationVersion = "6.5"; -const char *dllRelativePath = "./bravo6.app/Contents/Frameworks"; -TEnv::StringVar EnvSoftwareCurrentFont("SoftwareCurrentFont", "MS Sans Serif"); -TEnv::IntVar EnvSoftwareCurrentFontSize("SoftwareCurrentFontSize", 12); -const char *applicationFullName = "Bravo 6.5 (Demo) Aperta"; -const char *rootVarName = "BRAVOROOT"; -const char *systemVarPrefix = "BRAVO"; -#elif defined BRAVO -#ifdef BRAVOEXPRESS -const char *applicationName = "Toonz Bravo Express"; -const char *applicationVersion = "7.1"; -const char *dllRelativePath = "./bravo6.app/Contents/Frameworks"; -TEnv::StringVar EnvSoftwareCurrentFont("SoftwareCurrentFont", "MS Sans Serif"); -TEnv::IntVar EnvSoftwareCurrentFontSize("SoftwareCurrentFontSize", 12); -const char *applicationFullName = "Bravo Express 7.1"; -const char *rootVarName = "BRAVOEXPRESSROOT"; -const char *systemVarPrefix = "BRAVOEXPRESS"; #else -const char *applicationName = "Toonz Bravo"; -const char *applicationVersion = "7.1"; -const char *dllRelativePath = "./bravo6.app/Contents/Frameworks"; -TEnv::StringVar EnvSoftwareCurrentFont("SoftwareCurrentFont", "MS Sans Serif"); -TEnv::IntVar EnvSoftwareCurrentFontSize("SoftwareCurrentFontSize", 12); -const char *applicationFullName = "Bravo 7.1"; -const char *rootVarName = "BRAVOROOT"; -const char *systemVarPrefix = "BRAVO"; -#endif -#elif defined XPRESS -const char *applicationName = "Toonz Xpress"; -const char *applicationVersion = "6.5"; -const char *dllRelativePath = "./xpress.app/Contents/Frameworks"; -TEnv::StringVar EnvSoftwareCurrentFont("SoftwareCurrentFont", "MS Sans Serif"); -TEnv::IntVar EnvSoftwareCurrentFontSize("SoftwareCurrentFontSize", 12); -const char *applicationFullName = "Express 6.5 Aperta"; -const char *rootVarName = "XPRESSROOT"; -const char *systemVarPrefix = "XPRESS"; - -#else - const char *applicationName = "OpenToonz"; const char *applicationVersion = "1.0"; const char *applicationRevision = "2"; const char *dllRelativePath = "./toonz6.app/Contents/Frameworks"; +#endif #ifdef _WIN32 TEnv::StringVar EnvSoftwareCurrentFont("SoftwareCurrentFont", "Arial"); @@ -144,8 +105,6 @@ TEnv::StringVar EnvSoftwareCurrentFontWeight("SoftwareCurrentFontWeightIsBold", const char *applicationFullName = "OpenToonz 1.0.2"; const char *rootVarName = "TOONZROOT"; const char *systemVarPrefix = "TOONZ"; -#endif -TCli::StringQualifier selectedFeature("-license", ""); #ifdef MACOSX #include "tthread.h" @@ -173,33 +132,6 @@ void lastWarningError(QString msg) } //----------------------------------------------------------------------------- -class LicenseMsg : public TThread::Message -{ - QString m_msg; - -public: - LicenseMsg(char *msg) : m_msg(msg) {} - void onDeliver() - { - lastWarningError(m_msg); - } - - TThread::Message *clone() const - { - return new LicenseMsg(*this); - } -}; - -extern "C" void licenseObserverCB(char *msg) -{ - std::cout << __FUNCTION__ << " Begin message>" << std::endl; - std::cout << msg << std::endl - << "enableSimpleProject(true); - - //! Inizializzazione Librerie di Toonz. - /*! Inizializza le plugins di toonz, imposta la rootDir per - ImagePatternStrokeStyle e per ImageCache, setta i folder del progetto, - imposta lo Stencil Buffer Context (QT), e l'offlineGL da utilizzare -*/ - Tiio::defineStd(); initImageIo(); initSoundIo(); -#ifndef LINETEST initStdFx(); -#endif initColorFx(); // TPluginManager::instance()->loadStandardPlugins(); @@ -451,8 +349,6 @@ int main(int argc, char *argv[]) // Initialize thread components TThread::init(); - std::string feature = selectedFeature.getValue(); - TProjectManager *projectManager = TProjectManager::instance(); if (Preferences::instance()->isSVNEnabled()) { // Read Version Control repositories and add it to project manager as "special" svn project root @@ -510,6 +406,7 @@ int main(int argc, char *argv[]) #else translator.load("toonz", languagePathString); #endif + // La installo a.installTranslator(&translator); @@ -634,32 +531,6 @@ int main(int argc, char *argv[]) a.setQuitOnLastWindowClosed(false); // a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit())); -/* - int *check; - check = License::checkLicense(); - *check = 3;*/ - -#ifdef LINETEST - std::string license = License::getInstalledLicense(); - License::writeMacAddress(); - //Controllo che la data della prima installazione contenuta nella sentinella sia minore della data corrente. - if (License::isTemporaryLicense(license) && !License::isValidSentinel(license)) { - DVGui::error(QObject::tr("System date tampered.")); - return -1; - } - if (License::checkLicense(license) == License::INVALID_LICENSE || - (License::isTemporaryLicense(license) && License::getDaysLeft(license) < 31)) { - LicenseWizard licenseWizard(0); - licenseWizard.setGeometry(splashGeometry); - //UpgradeLicense upgradeLicense(&w); - //int upgraded = upgradeLicense.exec(); - int ret = licenseWizard.exec(); - if (ret == QDialog::Rejected) - return -1; - } - - w.checkForLicense(); -#endif w.checkForUpdates(); w.show(); diff --git a/toonz/sources/toonz/mainwindow.cpp b/toonz/sources/toonz/mainwindow.cpp index 72bc35b..7004213 100644 --- a/toonz/sources/toonz/mainwindow.cpp +++ b/toonz/sources/toonz/mainwindow.cpp @@ -10,7 +10,6 @@ #include "flipbook.h" #include "messagepanel.h" #include "iocommand.h" -#include "licensecontroller.h" #include "tapp.h" #include "comboviewerpane.h" @@ -25,10 +24,6 @@ #include "toonzqt/updatechecker.h" #include "toonzqt/paletteviewer.h" -#ifdef LINETEST -#include "toonzqt/licensechecker.h" -#endif - // TnzLib includes #include "toonz/toonzfolders.h" #include "toonz/stage2.h" @@ -58,6 +53,7 @@ #include #include #include +#include extern const char *applicationFullName; @@ -1012,7 +1008,7 @@ void MainWindow::onUndo() { bool ret = TUndoManager::manager()->undo(); if (!ret) - error(QObject::tr("No more Undo operations available.")); + DVGui::error(QObject::tr("No more Undo operations available.")); } //----------------------------------------------------------------------------- @@ -1021,7 +1017,7 @@ void MainWindow::onRedo() { bool ret = TUndoManager::manager()->redo(); if (!ret) - error(QObject::tr("No more Redo operations available.")); + DVGui::error(QObject::tr("No more Redo operations available.")); } //----------------------------------------------------------------------------- @@ -1061,7 +1057,7 @@ void MainWindow::onAbout() QLabel *label = new QLabel(); label->setPixmap(QPixmap(":Resources/splash.png")); - Dialog *dialog = new Dialog(this, true); + DVGui::Dialog *dialog = new DVGui::Dialog(this, true); dialog->setWindowTitle(tr("About OpenToonz")); dialog->setTopMargin(0); dialog->addWidget(label); @@ -1290,20 +1286,6 @@ void MainWindow::checkForUpdates() this, SLOT(onUpdateCheckerDone(bool))); } //----------------------------------------------------------------------------- -#ifdef LINETEST -void MainWindow::checkForLicense() -{ - std::string license = License::getInstalledLicense(); - // If the license is not temporary I will perform the check - if (!License::isTemporaryLicense(license)) { - QString requestUrl = "http://www.the-tab.com/cgi-shl/check/check.asp"; - - m_licenseChecker = new LicenseChecker(requestUrl, LicenseChecker::TAB, License::getInstalledLicense(), applicationName, "6.5"); - connect(m_licenseChecker, SIGNAL(done(bool)), this, SLOT(onLicenseCheckerDone(bool))); - } -} -#endif -//----------------------------------------------------------------------------- void MainWindow::onUpdateCheckerDone(bool error) { @@ -1318,7 +1300,7 @@ void MainWindow::onUpdateCheckerDone(bool error) std::vector buttons; buttons.push_back(QObject::tr("Visit Web Site")); buttons.push_back(QObject::tr("Cancel")); - int ret = MsgBox(INFORMATION, QObject::tr("An update is available for this software.\nVisit the Web site for more information."), buttons); + int ret = DVGui::MsgBox(DVGui::INFORMATION, QObject::tr("An update is available for this software.\nVisit the Web site for more information."), buttons); if (ret == 1) { // This URL can be "translated" to give a localised version to non-English users QDesktopServices::openUrl(QObject::tr("https://opentoonz.github.io/e/")); @@ -1329,21 +1311,6 @@ void MainWindow::onUpdateCheckerDone(bool error) m_updateChecker->deleteLater(); } //----------------------------------------------------------------------------- -#ifdef LINETEST -void MainWindow::onLicenseCheckerDone(bool error) -{ - if (!error) { - if (!m_licenseChecker->isLicenseValid()) { - DVGui::error(QObject::tr("The license validation process was not able to confirm the right to use this software on this computer.\n Please contact [ support@toonz.com ] for assistance.")); - qApp->exit(0); - } - } - - disconnect(m_licenseChecker); - m_licenseChecker->deleteLater(); -} -#endif -//----------------------------------------------------------------------------- void MainWindow::closeEvent(QCloseEvent *event) { @@ -1356,20 +1323,10 @@ void MainWindow::closeEvent(QCloseEvent *event) return; } -#ifdef BRAVODEMO - QString question; - question = "Quit: are you sure you want to quit?"; - int ret = DVGui::MsgBox(question, QObject::tr("Quit"), QObject::tr("Cancel"), 0); - if (ret == 0 || ret == 2) { - event->ignore(); - return; - } -#else if (!IoCmd::saveSceneIfNeeded(QApplication::tr("Quit"))) { event->ignore(); return; } -#endif // sto facendo quit. interrompo (il prima possibile) le threads IconGenerator::instance()->clearRequests(); @@ -1395,7 +1352,6 @@ void MainWindow::closeEvent(QCloseEvent *event) } TImageCache::instance()->clear(true); - #ifdef LINETEST if (TnzCamera::instance()->isCameraConnected()) TnzCamera::instance()->cameraDisconnect(); @@ -1621,16 +1577,12 @@ void MainWindow::defineActions() createMenuFileAction(MI_PreviewSettings, tr("&Preview Settings..."), ""); createMenuFileAction(MI_Render, tr("&Render"), ""); createMenuFileAction(MI_Preview, tr("&Preview"), "Ctrl+R"); -#ifndef BRAVODEMO createRightClickMenuAction(MI_SavePreviewedFrames, tr("&Save Previewed Frames"), ""); -#endif createRightClickMenuAction(MI_RegeneratePreview, tr("&Regenerate Preview"), ""); createRightClickMenuAction(MI_RegenerateFramePr, tr("&Regenerate Frame Preview"), ""); createRightClickMenuAction(MI_ClonePreview, tr("&Clone Preview"), ""); -#ifndef LINETEST createRightClickMenuAction(MI_FreezePreview, tr("&Freeze//Unfreeze Preview"), ""); CommandManager::instance()->setToggleTexts(MI_FreezePreview, tr("Freeze Preview"), tr("Unfreeze Preview")); -#endif //createAction(MI_SavePreview, "&Save Preview", ""); createRightClickMenuAction(MI_SavePreset, tr("&Save As Preset"), ""); createMenuFileAction(MI_Preferences, tr("&Preferences..."), ""); @@ -1708,22 +1660,18 @@ void MainWindow::defineActions() createMenuLevelAction(MI_ExposeResource, tr("&Expose in Xsheet"), ""); createMenuLevelAction(MI_EditLevel, tr("&Display in Level Strip"), ""); createMenuLevelAction(MI_LevelSettings, tr("&Level Settings..."), ""); -#ifndef BRAVOEXPRESS createMenuLevelAction(MI_AdjustLevels, tr("Adjust Levels..."), ""); createMenuLevelAction(MI_AdjustThickness, tr("Adjust Thickness..."), ""); createMenuLevelAction(MI_Antialias, tr("&Antialias..."), ""); createMenuLevelAction(MI_Binarize, tr("&Binarize..."), ""); createMenuLevelAction(MI_BrightnessAndContrast, tr("&Brightness and Contrast..."), ""); createMenuLevelAction(MI_LinesFade, tr("&Color Fade..."), ""); -#endif #ifdef LINETEST createMenuLevelAction(MI_Capture, tr("&Capture"), "Space"); #endif -#ifndef BRAVOEXPRESS QAction *action = createMenuLevelAction(MI_CanvasSize, tr("&Canvas Size..."), ""); if (action) action->setDisabled(true); -#endif createMenuLevelAction(MI_FileInfo, tr("&Info..."), ""); createRightClickMenuAction(MI_ViewFile, tr("&View..."), ""); createMenuLevelAction(MI_RemoveUnused, tr("&Remove All Unused Levels"), ""); @@ -1806,12 +1754,10 @@ void MainWindow::defineActions() createToggle(MI_GCheck, tr("&Fill Check"), "", GCheckToggleAction ? 1 : 0, MenuViewCommandType); createToggle(MI_BCheck, tr("&Black BG Check"), "", BCheckToggleAction ? 1 : 0, MenuViewCommandType); createToggle(MI_ACheck, tr("&Gap Check"), "", ACheckToggleAction ? 1 : 0, MenuViewCommandType); -#ifndef LINETEST createToggle(MI_ShiftTrace, tr("Shift and Trace"), "", false, MenuViewCommandType); createToggle(MI_EditShift, tr("Edit Shift"), "", false, MenuViewCommandType); createToggle(MI_NoShift, tr("No Shift"), "", false, MenuViewCommandType); createAction(MI_ResetShift, tr("Reset Shift"), "", MenuViewCommandType); -#endif if (QGLPixelBuffer::hasOpenGLPbuffers()) createToggle(MI_RasterizePli, tr("&Visualize Vector As Raster"), "", RasterizePliToggleAction ? 1 : 0, MenuViewCommandType); @@ -1905,9 +1851,7 @@ void MainWindow::defineActions() //createRightClickMenuAction(MI_PremultiplyFile, tr("Premultiply"), ""); createMenuLevelAction(MI_ConvertToVectors, tr("Convert to Vectors..."), ""); -#ifndef BRAVOEXPRESS createMenuLevelAction(MI_Tracking, tr("Tracking..."), ""); -#endif createRightClickMenuAction(MI_RemoveLevel, tr("Remove Level"), ""); createRightClickMenuAction(MI_AddToBatchRenderList, tr("Add As Render Task"), ""); createRightClickMenuAction(MI_AddToBatchCleanupList, tr("Add As Cleanup Task"), ""); @@ -1989,7 +1933,6 @@ void MainWindow::defineActions() createMiscAction(MI_RefreshTree, "Refresh Folder Tree", ""); -#ifndef LINETEST createToolOptionsAction("A_ToolOption_GlobalKey", tr("Global Key"), ""); createToolOptionsAction("A_IncreaseMaxBrushThickness", tr("Brush size - Increase max"), ""); @@ -2051,7 +1994,6 @@ void MainWindow::defineActions() createToolOptionsAction("A_ToolOption_AutoSelect:Pegbar", tr("Pegbar Pick Mode"), ""); createToolOptionsAction("A_ToolOption_PickScreen", tr("Pick Screen"), ""); createToolOptionsAction("A_ToolOption_Meshify", tr("Create Mesh"), ""); -#endif /*-- FillAreas, FillLinesにキー1つで切り替えるためのコマンド --*/ createAction(MI_FillAreas, "Fill Tool - Areas", "", ToolCommandType); diff --git a/toonz/sources/toonz/mainwindow.h b/toonz/sources/toonz/mainwindow.h index d029720..37ec81c 100644 --- a/toonz/sources/toonz/mainwindow.h +++ b/toonz/sources/toonz/mainwindow.h @@ -20,9 +20,6 @@ class QStackedWidget; class TPanel; class UpdateChecker; -#ifdef LINETEST -class LicenseChecker; -#endif class ComboViewerPanel; class TopBar; //----------------------------------------------------------------------------- @@ -75,9 +72,6 @@ class MainWindow : public QMainWindow bool m_saveSettingsOnQuit; int m_oldRoomIndex; UpdateChecker *m_updateChecker; -#ifdef LINETEST - LicenseChecker *m_licenseChecker; -#endif TopBar *m_topBar; @@ -109,9 +103,6 @@ public: void onUpgradeTabPro(); void onAbout(); void checkForUpdates(); -#ifdef LINETEST - void checkForLicense(); -#endif int getRoomCount() const; Room *getRoom(int index) const; Room *getRoomByName(QString &roomName); @@ -136,11 +127,7 @@ private: /*!Must be call before readSettings().*/ void defineActions(); /* -#ifdef LINETEST -Room *createLinetestRoom(); -#else Room *createPaintRoom(); -#endif Room *createAnimationRoom(); Room *createBrowserRoom(); Room *createPltEditRoom(); @@ -187,9 +174,6 @@ protected slots: void onInk1CheckTriggered(bool on); void onUpdateCheckerDone(bool); -#ifdef LINETEST - void onLicenseCheckerDone(bool); -#endif public slots: /*--- タイトルにシーン名を入れる ---*/ diff --git a/toonz/sources/toonz/menubar.cpp b/toonz/sources/toonz/menubar.cpp index f21a7a3..d31e833 100644 --- a/toonz/sources/toonz/menubar.cpp +++ b/toonz/sources/toonz/menubar.cpp @@ -1183,7 +1183,6 @@ QMenuBar* StackedMenuBar::createFullMenuBar() addMenuItem(editMenu, MI_SelectAll); addMenuItem(editMenu, MI_InvertSelection); editMenu->addSeparator(); -#ifndef XPRESS addMenuItem(editMenu, MI_RemoveEndpoints); editMenu->addSeparator(); addMenuItem(editMenu, MI_Group); @@ -1196,9 +1195,7 @@ QMenuBar* StackedMenuBar::createFullMenuBar() addMenuItem(editMenu, MI_BringForward); addMenuItem(editMenu, MI_SendBack); addMenuItem(editMenu, MI_SendBackward); -#endif //Menu' SCAN CLEANUP -#ifndef BRAVO #ifdef LINETEST QMenu *scanCleanupMenu = addMenu(tr("Scan")); #else @@ -1213,8 +1210,7 @@ QMenuBar* StackedMenuBar::createFullMenuBar() #ifdef LINETEST scanCleanupMenu->addSeparator(); addMenuItem(scanCleanupMenu, MI_Autocenter); -#endif -#ifndef LINETEST +#else scanCleanupMenu->addSeparator(); addMenuItem(scanCleanupMenu, MI_CleanupSettings); addMenuItem(scanCleanupMenu, MI_CleanupPreview); @@ -1222,19 +1218,15 @@ QMenuBar* StackedMenuBar::createFullMenuBar() addMenuItem(scanCleanupMenu, MI_Cleanup); scanCleanupMenu->addSeparator(); #endif -#endif + //Menu' LEVEL QMenu *levelMenu = addMenu(tr("Level"), fullMenuBar); addMenuItem(levelMenu, MI_AddFrames); addMenuItem(levelMenu, MI_Renumber); addMenuItem(levelMenu, MI_ReplaceLevel); -#ifndef BRAVO addMenuItem(levelMenu, MI_RevertToCleanedUp); -#endif addMenuItem(levelMenu, MI_RevertToLastSaved); -#ifndef XPRESS addMenuItem(levelMenu, MI_ConvertToVectors); -#endif addMenuItem(levelMenu, MI_Tracking); levelMenu->addSeparator(); addMenuItem(levelMenu, MI_ExposeResource); @@ -1350,9 +1342,7 @@ QMenuBar* StackedMenuBar::createFullMenuBar() QMenu *windowsMenu = addMenu(tr("Windows"), fullMenuBar); addMenuItem(windowsMenu, MI_DockingCheck); windowsMenu->addSeparator(); -#ifndef BRAVO addMenuItem(windowsMenu, MI_OpenBatchServers); -#endif addMenuItem(windowsMenu, MI_OpenCleanupSettings); addMenuItem(windowsMenu, MI_OpenColorModel); #ifdef LINETEST diff --git a/toonz/sources/toonz/outputsettingspopup.cpp b/toonz/sources/toonz/outputsettingspopup.cpp index 8380845..3d7d9f0 100644 --- a/toonz/sources/toonz/outputsettingspopup.cpp +++ b/toonz/sources/toonz/outputsettingspopup.cpp @@ -135,16 +135,12 @@ OutputSettingsPopup::OutputSettingsPopup(bool isPreview) m_cameraSettings = new CameraSettingsPopup(); cameraParametersBox = new QFrame(this); } -#ifndef LINETEST //Output Camera m_outputCameraOm = new QComboBox(); //m_outputCameraOm->hide(); -#endif if (isPreview) { -#ifndef LINETEST //Subcamera checkbox m_subcameraChk = new DVGui::CheckBox(tr("Use Sub-Camera")); -#endif } //Frame Start-End @@ -270,11 +266,7 @@ OutputSettingsPopup::OutputSettingsPopup(bool isPreview) //Multimedia rendering enum QStringList multimediaTypes; -#ifndef LINETEST multimediaTypes << tr("None") << tr("Fx Schematic Flows") << tr("Fx Schematic Terminal Nodes"); -#else - multimediaTypes << tr("None") << tr("Columns"); -#endif m_multimediaOm->addItems(multimediaTypes); showCameraSettingsButton->setObjectName("OutputSettingsShowButton"); @@ -520,10 +512,8 @@ OutputSettingsPopup::OutputSettingsPopup(bool isPreview) SLOT(onFormatChanged(const QString &))); ret = ret && connect(m_fileFormatButton, SIGNAL(pressed()), this, SLOT(openSettingsPopup())); } -#ifndef LINETEST ret = ret && connect(m_outputCameraOm, SIGNAL(currentIndexChanged(const QString &)), SLOT(onCameraChanged(const QString &))); -#endif ret = ret && connect(m_startFld, SIGNAL(editingFinished()), SLOT(onFrameFldEditFinished())); ret = ret && connect(m_endFld, SIGNAL(editingFinished()), SLOT(onFrameFldEditFinished())); ret = ret && connect(m_stepFld, SIGNAL(editingFinished()), SLOT(onFrameFldEditFinished())); @@ -812,11 +802,9 @@ void OutputSettingsPopup::updateField() if (m_isPreviewSettings) return; -#ifndef BRAVOEXPRESS m_doStereoscopy->setChecked(renderSettings.m_stereoscopic); m_stereoShift->setValue(renderSettings.m_stereoscopicShift); m_stereoShift->setEnabled(renderSettings.m_stereoscopic); -#endif // gamma m_gammaFld->setValue(renderSettings.m_gamma); @@ -1195,10 +1183,8 @@ void OutputSettingsPopup::onDominantFieldChanged(int type) rs.m_fieldPrevalence = TRenderSettings::EvenField; else rs.m_fieldPrevalence = TRenderSettings::NoField; -#ifndef BRAVOEXPRESS m_doStereoscopy->setEnabled(rs.m_fieldPrevalence == TRenderSettings::NoField); m_stereoShift->setEnabled(rs.m_fieldPrevalence == TRenderSettings::NoField); -#endif prop->setRenderSettings(rs); TApp::instance()->getCurrentScene()->setDirtyFlag(true); } diff --git a/toonz/sources/toonz/preferencespopup.cpp b/toonz/sources/toonz/preferencespopup.cpp index 6238c61..f4aa12f 100644 --- a/toonz/sources/toonz/preferencespopup.cpp +++ b/toonz/sources/toonz/preferencespopup.cpp @@ -929,9 +929,7 @@ PreferencesPopup::PreferencesPopup() //--- Drawing ------------------------------ categoryList->addItem(tr("Drawing")); -#ifndef BRAVO m_defScanLevelType = new QComboBox(this); -#endif m_defLevelType = new QComboBox(this); m_defLevelWidth = new MeasuredDoubleLineEdit(0); m_defLevelHeight = new MeasuredDoubleLineEdit(0); @@ -1094,13 +1092,11 @@ PreferencesPopup::PreferencesPopup() minimizeSaveboxAfterEditingCB->setChecked(m_pref->isMinimizeSaveboxAfterEditing()); useSaveboxToLimitFillingOpCB->setChecked(m_pref->getFillOnlySavebox()); -#ifndef BRAVO QStringList scanLevelTypes; scanLevelTypes << "tif" << "png"; m_defScanLevelType->addItems(scanLevelTypes); m_defScanLevelType->setCurrentIndex(m_defScanLevelType->findText(m_pref->getScanLevelType())); -#endif QStringList levelTypes; m_defLevelType->addItem(("Toonz Vector Level"), PLI_XSHLEVEL); m_defLevelType->addItem(("Toonz Raster Level"), TZP_XSHLEVEL); @@ -1379,10 +1375,8 @@ PreferencesPopup::PreferencesPopup() drawingTopLay->setHorizontalSpacing(15); drawingTopLay->setMargin(0); { -#ifndef BRAVO drawingTopLay->addWidget(new QLabel(tr("Scan File Format:")), 0, 0, Qt::AlignRight); drawingTopLay->addWidget(m_defScanLevelType, 0, 1, 1, 3); -#endif drawingTopLay->addWidget(new QLabel(tr("Default Level Type:")), 1, 0, Qt::AlignRight); drawingTopLay->addWidget(m_defLevelType, 1, 1, 1, 3); @@ -1623,9 +1617,7 @@ PreferencesPopup::PreferencesPopup() ret = ret && connect(keepOriginalCleanedUpCB, SIGNAL(stateChanged(int)), this, SLOT(onSaveUnpaintedInCleanupChanged(int))); ret = ret && connect(multiLayerStylePickerCB, SIGNAL(stateChanged(int)), this, SLOT(onMultiLayerStylePickerChanged(int))); ret = ret && connect(useSaveboxToLimitFillingOpCB, SIGNAL(stateChanged(int)), this, SLOT(onGetFillOnlySavebox(int))); -#ifndef BRAVO ret = ret && connect(m_defScanLevelType, SIGNAL(currentIndexChanged(const QString &)), SLOT(onScanLevelTypeChanged(const QString &))); -#endif ret = ret && connect(minimizeSaveboxAfterEditingCB, SIGNAL(stateChanged(int)), this, SLOT(onMinimizeSaveboxAfterEditing(int))); ret = ret && connect(m_defLevelType, SIGNAL(currentIndexChanged(int)), SLOT(onDefLevelTypeChanged(int))); ret = ret && connect(m_autocreationType, SIGNAL(currentIndexChanged(int)), SLOT(onAutocreationTypeChanged(int))); diff --git a/toonz/sources/toonz/previewfxmanager.cpp b/toonz/sources/toonz/previewfxmanager.cpp index af143ba..25cea53 100644 --- a/toonz/sources/toonz/previewfxmanager.cpp +++ b/toonz/sources/toonz/previewfxmanager.cpp @@ -1173,11 +1173,6 @@ PreviewFxManager *PreviewFxManager::instance() FlipBook *PreviewFxManager::showNewPreview(TFxP fx, bool forceFlipbook) { -#ifdef BRAVODEMO - DVGui::featureNotAvelaible(); - return 0; -#else - if (!fx) return 0; @@ -1218,8 +1213,6 @@ FlipBook *PreviewFxManager::showNewPreview(TFxP fx, bool forceFlipbook) previewInstance->refreshViewRects(); return result; - -#endif } //----------------------------------------------------------------------------- diff --git a/toonz/sources/toonz/rendercommand.cpp b/toonz/sources/toonz/rendercommand.cpp index 627fecd..51e09b3 100644 --- a/toonz/sources/toonz/rendercommand.cpp +++ b/toonz/sources/toonz/rendercommand.cpp @@ -96,86 +96,6 @@ TRaster32P loadLight() return ras; } -#ifdef BRAVODEMO - -//--------------------------------------------------------- - -TRaster32P loadBravo(const TDimension &res) -{ - static TRaster32P ras(160, 60); - static TDimension Res; - static TRaster32P rasOut; - static bool filled = false; - - if (!filled) { - filled = true; - ras->lock(); - UINT *pix = (UINT *)ras->getRawData(); - - for (UINT i = 0; i < 5216; i += 2) - for (UINT j = 0; j < bravoMark160x60[i]; j++) - *pix++ = bravoMark160x60[i + 1]; - - ras->unlock(); - } - - if (Res != res) { - rasOut = TRaster32P(); - int outLx, outLy; - - if (res.ly < res.lx) { - outLy = troundp(res.ly * 60.0 / 576.0); - outLx = troundp(outLy * 160. / 60.0); - } else { - outLx = troundp(res.lx * 160.0 / 768.0); - outLy = troundp(outLx * 60.0 / 160.0); - } - - if (outLx == 160 && outLy == 60) - rasOut = ras; - else { - rasOut = TRaster32P(outLx, outLy); - TRop::resample(rasOut, ras, TScale(outLx / 160.0, outLy / 60.0).place(ras->getCenterD(), rasOut->getCenterD())); - } - Res = res; - } - - return rasOut; - -#ifdef CREA_MARK - TRasterP ras1; - TImageReader::load(TFilePath("C:\\bravo52\\watermark.tif"), ras1); - UINT *pix1 = (UINT *)ras1->getRawData(); - UINT *pixm = pix1; - int counter = 0; - int totcount = 0; - int tmpcount = 0; - int tt = 0; - Tofstream os(TFilePath("c:\\test.txt")); - for (UINT i = 0; i < ras1->getLx(); i++) - for (UINT j = 0; j < ras1->getLy(); j++) { - if (*pix1 == *pixm) - counter++; - else { - - os << counter << ", " << *pixm << ", "; - *pixm = *pix1; - tmpcount += counter; - counter = 1; - tt++; - int azz = tt % 10; - if (!(tt % 10)) - os << "\n"; - } - *pix1++; - totcount++; - } - tmpcount += counter; - os << counter << ", " << *pixm << ", "; -#endif - return ras; -} -#endif } //namespace //--------------------------------------------------------- @@ -416,17 +336,6 @@ void RenderCommand::flashRender() TRasterFxP rfx = buildSceneFx(scene, m_r, 0, false); assert(rfx); rfx->compute(flash, tround(m_r)); // WARNING: This should accept a DOUBLE... -#ifdef BRAVODEMO - TRasterImageP ri(loadBravo(scene->getCurrentCamera()->getRes())); - int lx = ri->getRaster()->getLx(); - int ly = ri->getRaster()->getLx(); - flash.pushMatrix(); - int dx = tround(0.1 * (cameraSize.lx - lx)); - int dy = tround(0.1 * (cameraSize.ly - ly)); - flash.multMatrix(TTranslation((cameraSize.lx - lx) / 2 - (dx > 0 ? dx : 0), -(cameraSize.ly - ly) / 2 + (dy > 0 ? dy : 0))); - flash.draw(ri, 0); - flash.popMatrix(); -#endif flash.endFrame(i == m_numFrames - 1, 0, true); if (pb.wasCanceled()) break; @@ -572,9 +481,6 @@ void RenderCommand::rasterRender(bool isPreview) //Build -#ifdef BRAVODEMO - rs.m_mark = loadBravo(scene->getCurrentCamera()->getRes()); -#endif /*-- RenderSettingsをセット --*/ movieRenderer.setRenderSettings(rs); /*-- カメラDPIの取得、セット --*/ @@ -778,10 +684,6 @@ void RenderCommand::multimediaRender() MultimediaRenderer multimediaRenderer(scene, m_fp, prop->getMultimediaRendering(), threadCount); multimediaRenderer.setRenderSettings(rs); -#ifdef BRAVODEMO - rs.m_mark = loadBravo(scene->getCurrentCamera()->getRes()); -#endif - TPointD cameraDpi = scene->getCurrentCamera()->getDpi(); multimediaRenderer.setDpi(cameraDpi.x, cameraDpi.y); multimediaRenderer.enablePrecomputing(true); diff --git a/toonz/sources/toonz/sceneviewercontextmenu.cpp b/toonz/sources/toonz/sceneviewercontextmenu.cpp index b6d752c..b4a02ed 100644 --- a/toonz/sources/toonz/sceneviewercontextmenu.cpp +++ b/toonz/sources/toonz/sceneviewercontextmenu.cpp @@ -125,8 +125,6 @@ SceneViewerContextMenu::SceneViewerContextMenu(SceneViewer *parent) if (tool && tool->isEnabled()) tool->addContextMenuItems(this); -#ifndef LINETEST - // fullscreen if (ImageUtils::FullScreenWidget *fsWidget = dynamic_cast(m_viewer->parentWidget())) { @@ -137,8 +135,6 @@ SceneViewerContextMenu::SceneViewerContextMenu(SceneViewer *parent) ret = ret && parent->connect(action, SIGNAL(triggered()), fsWidget, SLOT(toggleFullScreen())); } -#endif - // swap compared if (parent->canSwapCompared()) { action = addAction(tr("Swap Compared Images")); @@ -163,10 +159,8 @@ SceneViewerContextMenu::SceneViewerContextMenu(SceneViewer *parent) ret = ret && parent->connect(action, SIGNAL(triggered()), SLOT(setActualPixelSize())); // onion skin -#ifndef STUDENT if (Preferences::instance()->isOnionSkinEnabled() && !parent->isPreviewEnabled()) OnioniSkinMaskGUI::addOnionSkinCommand(this); -#endif // preview if (parent->isPreviewEnabled()) { @@ -288,7 +282,6 @@ void SceneViewerContextMenu::addLevelCommands(std::vector &indices) } else */ -#ifndef LINETEST /*-- Scene内の全Objectを選択可能にする --*/ TStageObjectId id; @@ -320,7 +313,6 @@ void SceneViewerContextMenu::addLevelCommands(std::vector &indices) if (!flag) columnMenu->setEnabled(false); -#endif } //----------------------------------------------------------------------------- diff --git a/toonz/sources/toonz/shortcutpopup.cpp b/toonz/sources/toonz/shortcutpopup.cpp index 7331eba..7acb27f 100644 --- a/toonz/sources/toonz/shortcutpopup.cpp +++ b/toonz/sources/toonz/shortcutpopup.cpp @@ -199,9 +199,7 @@ ShortcutTree::ShortcutTree(QWidget *parent) addFolder(tr("Fill"), FillCommandType); addFolder(tr("File"), MenuFileCommandType, menuCommandFolder); addFolder(tr("Edit"), MenuEditCommandType, menuCommandFolder); -#ifndef LINETEST addFolder(tr("Scan & Cleanup"), MenuScanCleanupCommandType, menuCommandFolder); -#endif addFolder(tr("Level"), MenuLevelCommandType, menuCommandFolder); addFolder(tr("Xsheet"), MenuXsheetCommandType, menuCommandFolder); addFolder(tr("Cells"), MenuCellsCommandType, menuCommandFolder); @@ -211,9 +209,7 @@ ShortcutTree::ShortcutTree(QWidget *parent) addFolder(tr("Right-click Menu Commands"), RightClickMenuCommandType); addFolder(tr("Tools"), ToolCommandType); -#ifndef LINETEST addFolder(tr("Tool Modifiers"), ToolModifierCommandType); -#endif addFolder(tr("Visualization"), ZoomCommandType); addFolder(tr("Misc"), MiscCommandType); addFolder(tr("Playback Controls"), PlaybackCommandType); diff --git a/toonz/sources/toonz/tab30qt.pri b/toonz/sources/toonz/tab30qt.pri index 4c140f4..646d256 100644 --- a/toonz/sources/toonz/tab30qt.pri +++ b/toonz/sources/toonz/tab30qt.pri @@ -44,8 +44,6 @@ HEADERS += ../../sources/tab30qt/actioncommand.h \ ../../sources/tab30qt/keyframedata.h \ ../../sources/tab30qt/keyframenavigator.h \ ../../sources/tab30qt/keyframeselection.h \ - ../../sources/tab30qt/license.h \ - ../../sources/tab30qt/licensecontroller.h \ ../../sources/tab30qt/menubar.h \ ../../sources/tab30qt/menubarcommand.h \ ../../sources/tab30qt/menubarcommandids.h \ @@ -107,8 +105,6 @@ SOURCES += ../../sources/tab30qt/browsermodel.cpp \ ../../sources/tab30qt/imagedata.cpp \ ../../sources/tab30qt/imageutils.cpp \ ../../sources/tab30qt/keyframenavigator.cpp \ - ../../sources/tab30qt/license.cpp \ - ../../sources/tab30qt/licensecontroller.cpp \ ../../sources/tab30qt/main.cpp \ ../../sources/tab30qt/menubar.cpp \ ../../sources/tab30qt/menubarcommand.cpp \ diff --git a/toonz/sources/toonz/tapp.cpp b/toonz/sources/toonz/tapp.cpp index cfc5c00..35c8f48 100644 --- a/toonz/sources/toonz/tapp.cpp +++ b/toonz/sources/toonz/tapp.cpp @@ -276,8 +276,6 @@ int TApp::getCurrentImageType() if (col < 0) #ifdef LINETEST return TImage::RASTER; -#elif defined BRAVO - return TImage::VECTOR; #else { int levelType = Preferences::instance()->getDefLevelType(); @@ -298,8 +296,6 @@ int TApp::getCurrentImageType() { #ifdef LINETEST return TImage::RASTER; -#elif defined BRAVO - return TImage::VECTOR; #else int levelType = Preferences::instance()->getDefLevelType(); return (levelType == PLI_XSHLEVEL) ? TImage::VECTOR : (levelType == TZP_XSHLEVEL) ? TImage::TOONZ_RASTER : TImage::RASTER; diff --git a/toonz/sources/toonz/toonz.rc b/toonz/sources/toonz/toonz.rc index 4ed7560..c105c01 100644 --- a/toonz/sources/toonz/toonz.rc +++ b/toonz/sources/toonz/toonz.rc @@ -1,18 +1,5 @@ -///////////////////////////////////////////////////////////////////////////// -// // Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -#if defined(APSTUDIO_INVOKED) || defined(STUDENT) #if defined(APSTUDIO_INVOKED) -IDI_ICON1$(STUDENT) ICON "toonz.ico" -#else -IDI_ICON1 ICON "toonz.ico" -#endif -#endif -#if defined(APSTUDIO_INVOKED) || !defined(STUDENT) - IDI_ICON1 ICON "toonz.ico" #endif +IDI_ICON1 ICON "toonz.ico" diff --git a/toonz/sources/toonz/tpanels.cpp b/toonz/sources/toonz/tpanels.cpp index 85921ed..f9b8cee 100644 --- a/toonz/sources/toonz/tpanels.cpp +++ b/toonz/sources/toonz/tpanels.cpp @@ -809,9 +809,6 @@ StyleEditorPanel::StyleEditorPanel(QWidget *parent) : TPanel(parent) { m_styleEditor = new StyleEditor(TApp::instance()->getPaletteController(), this); -#ifdef BRAVO - m_styleEditor->enableAutopaintToggle(false); -#endif setWidget(m_styleEditor); m_styleEditor->setLevelHandle(TApp::instance()->getCurrentLevel()); @@ -1203,8 +1200,6 @@ public: OpenFloatingPanel openTMessageCommand(MI_OpenTMessage, "TMessage", QObject::tr("Message Center")); -#ifndef BRAVO - //============================================================================= // ScriptConsolePanelFactory //----------------------------------------------------------------------------- @@ -1231,7 +1226,6 @@ public: } scriptConsolePanelFactory; OpenFloatingPanel openTScriptConsoleCommand("MI_OpenScriptConsole", "ScriptConsole", QObject::tr("Script Console")); -#endif //------------------------------------------------------------------------------ #ifdef LINETEST diff --git a/toonz/sources/toonz/xshcellviewer.cpp b/toonz/sources/toonz/xshcellviewer.cpp index 4e57b35..32645ff 100644 --- a/toonz/sources/toonz/xshcellviewer.cpp +++ b/toonz/sources/toonz/xshcellviewer.cpp @@ -1299,7 +1299,7 @@ void CellArea::drawPaletteCell(QPainter &p, int row, int col, bool isReference) void CellArea::drawKeyframe(QPainter &p, const QRect toBeUpdated) { - int r0, r1, c0, c1; // range of visible rows and columns + int r0, r1, c0, c1; // range of visible rows and columns r0 = m_viewer->yToRow(toBeUpdated.top()); r1 = m_viewer->yToRow(toBeUpdated.bottom()); c0 = m_viewer->xToColumn(toBeUpdated.left()); @@ -1377,7 +1377,7 @@ void CellArea::drawKeyframe(QPainter &p, const QRect toBeUpdated) p.drawPixmap(x1, y + keyPixOffset, key); } } - } + } int y1 = m_viewer->rowToY(row1 + 1); if (!emptyKeyframeRange && row0 <= row1 + 1) { diff --git a/toonz/sources/toonz/xshrowviewer.cpp b/toonz/sources/toonz/xshrowviewer.cpp index c211e45..ed39ff7 100644 --- a/toonz/sources/toonz/xshrowviewer.cpp +++ b/toonz/sources/toonz/xshrowviewer.cpp @@ -263,7 +263,7 @@ void RowArea::drawOnionSkinSelection(QPainter &p) } // Draw onion skin extender handles. - QRectF handleRect(3, m_viewer->rowToY(currentRow) + 1, onionHandleDiam, onionHandleDiam ); + QRectF handleRect(3, m_viewer->rowToY(currentRow) + 1, onionHandleDiam, onionHandleDiam); int angle180 = 16 * 180; p.setBrush(QBrush(backColor)); p.drawChord(handleRect, 0, angle180); @@ -315,7 +315,7 @@ void RowArea::drawOnionSkinSelection(QPainter &p) } //-- draw fixed onions - for (int i = 0; i < osMask.getFosCount(); i++) + for (int i = 0; i < osMask.getFosCount(); i++) { int fos = osMask.getFos(i); if (fos == currentRow) continue; @@ -323,14 +323,14 @@ void RowArea::drawOnionSkinSelection(QPainter &p) if (m_showOnionToSet == Fos && fos == m_row) continue; int y = m_viewer->rowToY(fos) + onionDotYPos; - + if (osMask.isEnabled()) p.setBrush(QBrush(QColor(0, 255, 255, 128))); else p.setBrush(Qt::NoBrush); p.drawEllipse(0, y, onionDotDiam, onionDotDiam); } - + //-- draw highlighted onion if (m_showOnionToSet != None) { @@ -402,28 +402,28 @@ void RowArea::mousePressEvent(QMouseEvent *event) } else { - int playR0, playR1, step; - XsheetGUI::getPlayRange(playR0, playR1, step); - - bool playRangeEnabled = playR0 <= playR1; - if (!playRangeEnabled) { - TXsheet *xsh = m_viewer->getXsheet(); - playR1 = xsh->getFrameCount() - 1; - playR0 = 0; - } + int playR0, playR1, step; + XsheetGUI::getPlayRange(playR0, playR1, step); + + bool playRangeEnabled = playR0 <= playR1; + if (!playRangeEnabled) { + TXsheet *xsh = m_viewer->getXsheet(); + playR1 = xsh->getFrameCount() - 1; + playR0 = 0; + } - if (playR1 == -1) { //getFrameCount = 0 i.e. xsheet is empty - setDragTool(XsheetGUI::DragTool::makeCurrentFrameModifierTool(m_viewer)); + if (playR1 == -1) { //getFrameCount = 0 i.e. xsheet is empty + setDragTool(XsheetGUI::DragTool::makeCurrentFrameModifierTool(m_viewer)); frameAreaIsClicked = true; } else if (m_xa <= pos.x && pos.x <= m_xa + 10 && (row == playR0 || row == playR1)) { - if (!playRangeEnabled) - XsheetGUI::setPlayRange(playR0, playR1, step); - setDragTool(XsheetGUI::DragTool::makePlayRangeModifierTool(m_viewer)); + if (!playRangeEnabled) + XsheetGUI::setPlayRange(playR0, playR1, step); + setDragTool(XsheetGUI::DragTool::makePlayRangeModifierTool(m_viewer)); } else { - setDragTool(XsheetGUI::DragTool::makeCurrentFrameModifierTool(m_viewer)); + setDragTool(XsheetGUI::DragTool::makeCurrentFrameModifierTool(m_viewer)); frameAreaIsClicked = true; } } @@ -510,7 +510,7 @@ void RowArea::mouseMoveEvent(QMouseEvent *event) if (Preferences::instance()->isOnionSkinEnabled() && x < RowHeight + 2) m_tooltip = tr("Double Click to Toggle Onion Skin"); else - m_tooltip = tr("Curren Frame"); + m_tooltip = tr("Curren Frame"); } else if (m_showOnionToSet == Fos) m_tooltip = tr("Fixed Onion Skin Toggle"); @@ -541,8 +541,6 @@ void RowArea::mouseReleaseEvent(QMouseEvent *event) void RowArea::contextMenuEvent(QContextMenuEvent *event) { -#ifndef STUDENT - OnionSkinMask osMask = TApp::instance()->getCurrentOnionSkin()->getOnionSkinMask(); QMenu *menu = new QMenu(this); @@ -571,16 +569,13 @@ void RowArea::contextMenuEvent(QContextMenuEvent *event) menu->addAction(cmdManager->getAction(MI_InsertGlobalKeyframe)); menu->addAction(cmdManager->getAction(MI_RemoveGlobalKeyframe)); -#ifndef LINETEST menu->addSeparator(); menu->addAction(cmdManager->getAction(MI_ShiftTrace)); menu->addAction(cmdManager->getAction(MI_EditShift)); menu->addAction(cmdManager->getAction(MI_NoShift)); menu->addAction(cmdManager->getAction(MI_ResetShift)); -#endif menu->exec(event->globalPos()); -#endif } //----------------------------------------------------------------------------- diff --git a/toonz/sources/toonzqt/CMakeLists.txt b/toonz/sources/toonzqt/CMakeLists.txt index 702aabf..fb80b0d 100644 --- a/toonz/sources/toonzqt/CMakeLists.txt +++ b/toonz/sources/toonzqt/CMakeLists.txt @@ -37,7 +37,6 @@ set(MOC_HEADERS ../include/toonzqt/intpairfield.h ../include/toonzqt/keyframenavigator.h ../include/toonzqt/lineedit.h - ../include/toonzqt/licensechecker.h ../include/toonzqt/menubarcommand.h ../include/toonzqt/multipleselection.h palettedata.h @@ -124,7 +123,6 @@ set(SOURCES intpairfield.cpp keyframenavigator.cpp lineedit.cpp - licensechecker.cpp menubarcommand.cpp palettesscanpopup.cpp paletteviewer.cpp diff --git a/toonz/sources/toonzqt/dvdialog.cpp b/toonz/sources/toonzqt/dvdialog.cpp index bd984a3..b0a53dc 100644 --- a/toonz/sources/toonzqt/dvdialog.cpp +++ b/toonz/sources/toonzqt/dvdialog.cpp @@ -1281,114 +1281,3 @@ void DVGui::setDialogTitle(const QString &dialogTitle) //----------------------------------------------------------------------------- -void DVGui::featureNotAvelaible(QString webSiteName, QString url) -{ - Dialog dialog(0, true); - dialog.setWindowFlags(dialog.windowFlags() | Qt::WindowStaysOnTopHint); - dialog.setAlignment(Qt::AlignLeft); - QString msgBoxTitle = getMsgBoxTitle(DVGui::WARNING); - dialog.setWindowTitle(msgBoxTitle); - - QVBoxLayout *mainLayout = new QVBoxLayout; - mainLayout->setSpacing(0); - - QHBoxLayout *msgLayout = new QHBoxLayout; - QString msg = QObject::tr("This feature is not available in the demo version.\nFor more information visit the %1 site:").arg(webSiteName); - - QLabel *mainTextLabel = new QLabel(msg, &dialog); - QPixmap iconPixmap = getMsgBoxPixmap(DVGui::WARNING); - if (!iconPixmap.isNull()) { - QLabel *iconLabel = new QLabel(&dialog); - iconLabel->setPixmap(iconPixmap); - msgLayout->addWidget(iconLabel); - msgLayout->addSpacing(10); - } - msgLayout->addWidget(mainTextLabel); - - mainLayout->addLayout(msgLayout); - mainLayout->addSpacing(5); - - QLabel *linkTextLabel = new QLabel("" + url + "", &dialog); - linkTextLabel->setAlignment(Qt::AlignCenter); - linkTextLabel->setTextFormat(Qt::RichText); - linkTextLabel->setOpenExternalLinks(true); - mainLayout->addWidget(linkTextLabel, Qt::AlignHCenter); - - dialog.addLayout(mainLayout); - - // ButtonGroup: is used only to retrieve the clicked button - QButtonGroup *buttonGroup = new QButtonGroup(&dialog); - - QPushButton *button = new QPushButton(QPushButton::tr("OK"), &dialog); - button->setDefault(true); - dialog.addButtonBarWidget(button); - - buttonGroup->addButton(button, 1); - - QObject::connect(buttonGroup, SIGNAL(buttonPressed(int)), &dialog, SLOT(done(int))); - - dialog.raise(); - dialog.exec(); -} - -//----------------------------------------------------------------------------- - -void DVGui::requestTrialLicense(QString url, QString mail) -{ - Dialog dialog(0, true); - dialog.setWindowFlags(dialog.windowFlags() | Qt::WindowStaysOnTopHint); - dialog.setAlignment(Qt::AlignLeft); - QString msgBoxTitle = getMsgBoxTitle(DVGui::WARNING); - dialog.setWindowTitle(msgBoxTitle); - - QVBoxLayout *mainLayout = new QVBoxLayout; - mainLayout->setSpacing(0); - - //Request Licence - QHBoxLayout *requestLicenseLayout = new QHBoxLayout; - QString msg = QObject::tr("To request a trial license please contact "); - QLabel *requestLicenseTextLabel = new QLabel(msg, &dialog); - requestLicenseTextLabel->setAlignment(Qt::AlignRight); - requestLicenseLayout->addWidget(requestLicenseTextLabel, Qt::AlignHCenter); - - QLabel *mailTextLabel = new QLabel("" + mail + "", &dialog); - mailTextLabel->setAlignment(Qt::AlignLeft); - mailTextLabel->setTextFormat(Qt::RichText); - mailTextLabel->setOpenExternalLinks(true); - requestLicenseLayout->addWidget(mailTextLabel, Qt::AlignHCenter); - - mainLayout->addLayout(requestLicenseLayout); - mainLayout->addSpacing(5); - - //Request info - QHBoxLayout *infoLayout = new QHBoxLayout; - QString infoMsg = QObject::tr("For further information visit "); - QLabel *infoMsgLabel = new QLabel(infoMsg, &dialog); - infoMsgLabel->setAlignment(Qt::AlignRight); - infoLayout->addWidget(infoMsgLabel, Qt::AlignHCenter); - - QLabel *linkTextLabel = new QLabel("" + url + "", &dialog); - linkTextLabel->setAlignment(Qt::AlignLeft); - linkTextLabel->setTextFormat(Qt::RichText); - linkTextLabel->setOpenExternalLinks(true); - infoLayout->addWidget(linkTextLabel, Qt::AlignHCenter); - - mainLayout->addLayout(infoLayout); - mainLayout->addSpacing(5); - - dialog.addLayout(mainLayout); - - // ButtonGroup: is used only to retrieve the clicked button - QButtonGroup *buttonGroup = new QButtonGroup(&dialog); - - QPushButton *button = new QPushButton(QPushButton::tr("OK"), &dialog); - button->setDefault(true); - dialog.addButtonBarWidget(button); - - buttonGroup->addButton(button, 1); - - QObject::connect(buttonGroup, SIGNAL(buttonPressed(int)), &dialog, SLOT(done(int))); - - dialog.raise(); - dialog.exec(); -} diff --git a/toonz/sources/toonzqt/licensechecker.cpp b/toonz/sources/toonzqt/licensechecker.cpp deleted file mode 100644 index 533d08f..0000000 --- a/toonz/sources/toonzqt/licensechecker.cpp +++ /dev/null @@ -1,236 +0,0 @@ - - -#include "toonzqt/licensechecker.h" -//#include "licensecontroller.h" -#include - -#include "tsystem.h" -#include "tfilepath_io.h" -#include "tenv.h" - -#include -#include -#include -#if QT_VERSION >= 0x050000 -#include -#include -#include -#include -#endif - -namespace -{ -QString getMacAddressFromFile() -{ - TFilePath fp(TEnv::getStuffDir() + "config" + "computercode.txt"); - if (TFileStatus(fp).doesExist() == false) - return QString(); - Tifstream is(fp); - char buffer[1024]; - is.getline(buffer, sizeof buffer); - std::string macAddr = buffer; - return QString::fromStdString(macAddr); -} - -} // namespace - -//============================================================================= -// LicenseChecker -//----------------------------------------------------------------------------- - -LicenseChecker::LicenseChecker(const QString &requestUrl, LicenseMode licenseMode, std::string license, - std::string applicationName, const QString &version) -#if QT_VERSION < 0x050000 - : QHttp(), -#else - : -#endif - m_licenseMode(licenseMode), m_isValid(true) -{ - QString requestToServer = buildRequest(requestUrl, license, applicationName, version); - - QUrl url(requestToServer); - -#if QT_VERSION >= 0x050000 - - QString urlTemp = requestToServer; - - QStringList urlList = urlTemp.split('?'); - if (urlList.count() <= 1) { - abort(); - return; - } - - QStringList paramList = urlList.at(1).split('&'); - - m_httpRequestAborted = false; - - QString param; - param = QString("?") + paramList.at(0) + QString("&") + paramList.at(1) + QString("&") + paramList.at(2) + QString("&") + paramList.at(3) + QString("&") + paramList.at(4); - - QNetworkAccessManager manager; - QNetworkReply *reply = manager.get(QNetworkRequest(url.path() + param)); - - QEventLoop loop; - - connect(&manager, SIGNAL(requestFinished(int, bool)), this, SLOT(httpRequestFinished(reply))); - connect(reply, SIGNAL(requestStarted(int)), &loop, SLOT(httpRequestStarted(int))); - connect(reply, SIGNAL(authenticationRequired(const QString &, quint16, QAuthenticator *)), &loop, SLOT(slotAuthenticationRequired(const QString &, quint16, QAuthenticator *))); - connect(reply, SIGNAL(stateChanged(int)), &loop, SLOT(httpStateChanged(int))); - - loop.exec(); - -#else - connect(this, SIGNAL(requestFinished(int, bool)), this, - SLOT(httpRequestFinished(int, bool))); - connect(this, SIGNAL(requestStarted(int)), this, - SLOT(httpRequestStarted(int))); - connect(this, SIGNAL(responseHeaderReceived(const QHttpResponseHeader &)), this, - SLOT(readResponseHeader(const QHttpResponseHeader &))); - connect(this, SIGNAL(authenticationRequired(const QString &, quint16, QAuthenticator *)), this, - SLOT(slotAuthenticationRequired(const QString &, quint16, QAuthenticator *))); - connect(this, SIGNAL(stateChanged(int)), this, - SLOT(httpStateChanged(int))); - QHttp::ConnectionMode mode = url.scheme().toLower() == "https" ? QHttp::ConnectionModeHttps : QHttp::ConnectionModeHttp; - - setHost(url.host(), mode, url.port() == -1 ? 0 : url.port()); - QString urlTemp = requestToServer; - - QStringList urlList = urlTemp.split('?'); - if (urlList.count() <= 1) { - abort(); - return; - } - - QStringList paramList = urlList.at(1).split('&'); - if (!url.userName().isEmpty()) - setUser(url.userName(), url.password()); - - m_httpRequestAborted = false; - - QString param; - param = QString("?") + paramList.at(0) + QString("&") + paramList.at(1) + QString("&") + paramList.at(2) + QString("&") + paramList.at(3) + QString("&") + paramList.at(4); - m_httpGetId = get(url.path() + param); //, file); -#endif -} - -//----------------------------------------------------------------------------- - -#if QT_VERSION < 0x050000 -void LicenseChecker::readResponseHeader(const QHttpResponseHeader &responseHeader) -{ - int err = responseHeader.statusCode(); - if (err != 200 && err != 502) { - m_httpRequestAborted = true; - abort(); - } -} -#endif - -//----------------------------------------------------------------------------- - -void LicenseChecker::httpStateChanged(int status) -{ - std::string stateStr; - switch (status) { - case 1: - stateStr = "A host name lookup is in progress..."; - break; - case 2: - stateStr = "Connecting..."; - break; - case 3: - stateStr = "Sending informations..."; - break; - case 4: - stateStr = "Reading informations..."; - break; - case 5: - stateStr = "Connected."; - break; - case 6: - stateStr = "The connection is closing down, but is not yet closed. (The state will be Unconnected when the connection is closed.)"; - default: - stateStr = "There is no connection to the host."; - } -#if QT_VERSION < 0x050000 - status = state(); - qDebug("Status: %d : %s", status, stateStr.c_str()); -#endif -} - -//----------------------------------------------------------------------------- - -#if QT_VERSION < 0x050000 -void LicenseChecker::httpRequestFinished(int requestId, bool error) -#else -void LicenseChecker::httpRequestFinished(QNetworkReply *reply) -#endif -{ - QByteArray arr; - std::string responseString; - QString qstr; -#if QT_VERSION < 0x050000 - if (requestId != m_httpGetId) { - return; - } - if (error || m_httpRequestAborted) { - abort(); - return; - } - - arr = readAll(); -#else - if (reply->error() != QNetworkReply::NoError) - return; - arr = reply->readAll(); -#endif - qstr = QString(arr); - - int startIndex = qstr.indexOf("startblock"); - int endIndex = qstr.indexOf("endblock"); - - if ((endIndex - startIndex - 9) <= 0) { - abort(); - return; - } - - responseString = qstr.toStdString(); - responseString = responseString.substr(startIndex + 12, endIndex - startIndex - 13); - - if (responseString == "YES") - m_isValid = false; -} - -//----------------------------------------------------------------------------- - -void LicenseChecker::slotAuthenticationRequired(const QString &hostName, quint16, QAuthenticator *authenticator) -{ - assert(false); -} - -//----------------------------------------------------------------------------- - -QString LicenseChecker::buildRequest(const QString &requestUrl, std::string license, - std::string applicationName, const QString &version) -{ - QString licenseCode = QString::fromStdString(license); - - QString MacAddress = getMacAddressFromFile(); - - QHostInfo info = QHostInfo::fromName(QHostInfo::localHostName()); - - QString ipAddress = info.addresses().first().toString(); - - QString retString = requestUrl; - retString = retString + QString("?Application_Name=") + QString::fromStdString(applicationName); - retString = retString + QString("&MAC_Address=") + MacAddress; - retString = retString + QString("&IP_Address=") + ipAddress; - retString = retString + QString("&License_Code=") + licenseCode; - retString = retString + QString("&Version=") + version; - retString.remove(" "); - - return retString; -} - -//----------------------------------------------------------------------------- diff --git a/toonz/sources/toonzqt/paletteviewer.cpp b/toonz/sources/toonzqt/paletteviewer.cpp index 861e4b2..d8fa0e5 100644 --- a/toonz/sources/toonzqt/paletteviewer.cpp +++ b/toonz/sources/toonzqt/paletteviewer.cpp @@ -860,9 +860,6 @@ void PaletteViewer::deletePage() */ void PaletteViewer::saveStudioPalette() { -#ifdef BRAVODEMO - DVGui::featureNotAvelaible(); -#else StudioPalette *sp = StudioPalette::instance(); TPalette *palette = getPalette(); if (!palette) { @@ -910,7 +907,6 @@ void PaletteViewer::saveStudioPalette() } m_paletteHandle->notifyPaletteChanged(); -#endif } //----------------------------------------------------------------------------- diff --git a/toonz/sources/toonzqt/stageschematicscene.cpp b/toonz/sources/toonzqt/stageschematicscene.cpp index 50a10d8..a217b49 100644 --- a/toonz/sources/toonzqt/stageschematicscene.cpp +++ b/toonz/sources/toonzqt/stageschematicscene.cpp @@ -988,9 +988,6 @@ void StageSchematicScene::onRemoveSpline() void StageSchematicScene::onSaveSpline() { -#ifdef BRAVODEMO - DVGui::featureNotAvelaible(); -#else TFilePath projectFolder = m_sceneHandle->getScene()->getProject()->getProjectFolder(); QString fileNameStr = QFileDialog::getSaveFileName(this->views()[0], QObject::tr("Save Motion Path"), QString::fromStdWString(projectFolder.getWideString()), @@ -1023,7 +1020,6 @@ void StageSchematicScene::onSaveSpline() } catch (...) { DVGui::warning(QObject::tr("It is not possible to save the motion path.")); } -#endif } //------------------------------------------------------------------ diff --git a/toonz/sources/toonzqt/studiopaletteviewer.cpp b/toonz/sources/toonzqt/studiopaletteviewer.cpp index e29dbb1..fe134c0 100644 --- a/toonz/sources/toonzqt/studiopaletteviewer.cpp +++ b/toonz/sources/toonzqt/studiopaletteviewer.cpp @@ -1066,9 +1066,6 @@ void StudioPaletteTreeViewer::dragMoveEvent(QDragMoveEvent *event) void StudioPaletteTreeViewer::dropEvent(QDropEvent *event) { -#ifdef BRAVODEMO - DVGui::featureNotAvelaible(); -#else TFilePath newPath = getItemPath(m_dropItem); resetDropItem(); @@ -1120,7 +1117,6 @@ void StudioPaletteTreeViewer::dropEvent(QDropEvent *event) TUndoManager::manager()->endBlock(); event->setDropAction(Qt::CopyAction); event->accept(); -#endif } //----------------------------------------------------------------------------- diff --git a/toonz/sources/toonzqt/styleeditor.cpp b/toonz/sources/toonzqt/styleeditor.cpp index 62cdcba..21a0063 100644 --- a/toonz/sources/toonzqt/styleeditor.cpp +++ b/toonz/sources/toonzqt/styleeditor.cpp @@ -3302,9 +3302,7 @@ void StyleEditor::onColorChanged(const ColorModel &color, bool isDragging) m_newColor->setStyle(*m_editedStyle); m_colorParameterSelector->setStyle(*m_editedStyle); -#ifndef STUDENT if (m_autoButton->isChecked()) -#endif { copyEditedStyleToPalette(isDragging); } @@ -3389,7 +3387,6 @@ void StyleEditor::applyButtonClicked() void StyleEditor::autoCheckChanged(bool value) { -#ifndef STUDENT m_paletteController->enableColorAutoApply(!!value); if (!m_enabled) @@ -3399,7 +3396,6 @@ void StyleEditor::autoCheckChanged(bool value) m_applyButton->setDisabled(true); else m_applyButton->setDisabled(false); -#endif } //----------------------------------------------------------------------------- @@ -3495,9 +3491,7 @@ void StyleEditor::selectStyle(const TColorStyle &newStyle) m_editedStyle && m_editedStyle->hasMainColor()) m_editedStyle->setMainColor(m_oldStyle->getMainColor()); -#ifndef STUDENT if (m_autoButton->isChecked()) -#endif { // If the adited style is linked to the studio palette, then activate the edited flag if (m_editedStyle->getGlobalName() != L"" && m_editedStyle->getOriginalName() != L"") diff --git a/toonz/sources/translations/french/toonz.ts b/toonz/sources/translations/french/toonz.ts index 187dfda..c67741e 100644 --- a/toonz/sources/translations/french/toonz.ts +++ b/toonz/sources/translations/french/toonz.ts @@ -6015,12 +6015,6 @@ Are you sure you want to revert to previous version? L'espace de travail sera remis lors de la prochaine exécution de Toonz. - The license validation process was not able to confirm the right to use this software on this computer. - Please contact [ support@toonz.com ] for assistance. - La procédure de validation de la licence n'a pas été capable de confirmer le droit d'utiliser ce logiciel sur cet ordinateur. -S'il vous plaît contactez [support@toonz.com] pour avoir de l'assistance. - - Saving previewed frames.... Enrestrement des images de preview en cours diff --git a/toonz/sources/translations/french/toonzqt.ts b/toonz/sources/translations/french/toonzqt.ts index 691399f..de65529 100644 --- a/toonz/sources/translations/french/toonzqt.ts +++ b/toonz/sources/translations/french/toonzqt.ts @@ -1474,16 +1474,6 @@ Sélectionnez les nœuds FX et les liens connexes avant de copier ou couper la s Appliquer - This feature is not available in the demo version. -For more information visit the %1 site: - Cette fonctionnalité n'est pas disponible dans la version de démonstration. -Pour plus d'informations visitez le site %1: - - - To request a trial license please contact - Pour demander une licence temporaire s'il vous plaît contactez - - For further information visit Pour plus d'informations visitez diff --git a/toonz/sources/translations/italian/toonz.ts b/toonz/sources/translations/italian/toonz.ts index 4e246d6..a8da10a 100644 --- a/toonz/sources/translations/italian/toonz.ts +++ b/toonz/sources/translations/italian/toonz.ts @@ -6016,13 +6016,6 @@ Sei sicuro di voler tornare alla versione precedente? Le stanze saranno ripristinate la prossima volta che Toonz sarà avviato. - The license validation process was not able to confirm the right to use this software on this computer. - Please contact [ support@toonz.com ] for assistance. - Il processo di validazione della licenza non è in grado di verificare il diritto d'uso di questo software su questo computer. -Contattare [ support@toonz.com ] per avere assistenza. - - - Saving previewed frames.... Salvataggio dei fotogrammi mostrati in anteprima in corso diff --git a/toonz/sources/translations/italian/toonzqt.ts b/toonz/sources/translations/italian/toonzqt.ts index dce22ae..31b3e0d 100644 --- a/toonz/sources/translations/italian/toonzqt.ts +++ b/toonz/sources/translations/italian/toonzqt.ts @@ -1473,16 +1473,6 @@ Seleziona i nodi Effetto ed i relativi collegamenti prima di copiare o tagliare Applica - This feature is not available in the demo version. -For more information visit the %1 site: - Questa funzionalità non è disponibile nella versione demo. -Per maggiori informazioni visita il sito %1. - - - To request a trial license please contact - Per richiedere una licenza demo contatta - - For further information visit Per ulteriori informazioni visita diff --git a/toonz/sources/translations/japanese/toonz.ts b/toonz/sources/translations/japanese/toonz.ts index 4d9ef48..052e259 100644 --- a/toonz/sources/translations/japanese/toonz.ts +++ b/toonz/sources/translations/japanese/toonz.ts @@ -6084,12 +6084,6 @@ What do you want to do? Toonzを次回起動するとき、ワークスペースが初期化されます。 - The license validation process was not able to confirm the right to use this software on this computer. - Please contact [ support@toonz.com ] for assistance. - ライセンス確認プロセスは、このコンピュータ上で本ソフトウェアを使用する権利を確認できませんでした。 -support@toonz.com に連絡してください。 - - Saving previewed frames.... プレビューしたフレームを保存中... diff --git a/toonz/sources/translations/japanese/toonzqt.ts b/toonz/sources/translations/japanese/toonzqt.ts index 63d8079..b4abf09 100644 --- a/toonz/sources/translations/japanese/toonzqt.ts +++ b/toonz/sources/translations/japanese/toonzqt.ts @@ -1491,15 +1491,6 @@ Select FX nodes and related links before copying or cutting the selection you wa 適用 - This feature is not available in the demo version. -For more information visit the %1 site: - この機能はデモ版での利用ができません。詳しい情報に関しては、こちらへ: %1 - - - To request a trial license please contact - 体験版を試用はこちらへ: - - For further information visit 詳しい情報に関しては、こちらへ: