diff --git a/app/core.cpp b/app/core.cpp index 78d9b1721..2523c00e0 100644 --- a/app/core.cpp +++ b/app/core.cpp @@ -88,7 +88,8 @@ Core::Core(const CoreParams& params) : snapping_(true), core_params_(params), pixel_sampling_users_(0), - shown_cache_full_warning_(false) + shown_cache_full_warning_(false), + magic_(false) { // Store reference to this object, making the assumption that Core will only ever be made in // main(). This will obviously break if not. diff --git a/app/core.h b/app/core.h index 19ffb07dc..cc161d87f 100644 --- a/app/core.h +++ b/app/core.h @@ -319,6 +319,8 @@ public: void OpenExportDialogForViewer(ViewerOutput *viewer, bool start_still_image); + bool IsMagicEnabled() const { return magic_; } + public slots: /** * @brief Starts an open file dialog to load a project from file @@ -449,6 +451,11 @@ public slots: void WarnCacheFull(); + void SetMagic(bool e) + { + magic_ = e; + } + signals: /** * @brief Signal emitted when a project is opened @@ -626,6 +633,11 @@ private: */ QVector autorecovered_projects_; + /** + * @brief Do something debug related + */ + bool magic_; + /** * @brief How many widgets currently need pixel sampling access */ diff --git a/app/window/mainwindow/mainmenu.cpp b/app/window/mainwindow/mainmenu.cpp index 873c746d7..6d5daa527 100644 --- a/app/window/mainwindow/mainmenu.cpp +++ b/app/window/mainwindow/mainmenu.cpp @@ -282,6 +282,11 @@ MainMenu::MainMenu(MainWindow *parent) : tools_preferences_item_ = tools_menu_->AddItem("prefs", Core::instance(), &Core::DialogPreferencesShow, tr("Ctrl+,")); +#ifndef NDEBUG + tools_magic_item_ = tools_menu_->AddItem("magic", Core::instance(), &Core::SetMagic); + tools_magic_item_->setCheckable(true); +#endif + // // HELP MENU // @@ -787,6 +792,9 @@ void MainMenu::Retranslate() tools_record_item_->setText(tr("Record Tool")); tools_snapping_item_->setText(tr("Enable Snapping")); tools_preferences_item_->setText(tr("Preferences")); +#ifndef NDEBUG + tools_magic_item_->setText("Magic"); +#endif // Help menu help_menu_->setTitle(tr("&Help")); diff --git a/app/window/mainwindow/mainmenu.h b/app/window/mainwindow/mainmenu.h index a4dc36b81..8b88927e0 100644 --- a/app/window/mainwindow/mainmenu.h +++ b/app/window/mainwindow/mainmenu.h @@ -287,6 +287,10 @@ private: QAction* tools_snapping_item_; QAction* tools_preferences_item_; +#ifndef NDEBUG + QAction* tools_magic_item_; +#endif + Menu* help_menu_; QAction* help_action_search_item_; QAction* help_feedback_item_;