core: add debugging "magic" function

Just a UI way of turning on debug functionality
This commit is contained in:
itsmattkc
2022-11-05 11:56:39 -07:00
parent c357b04e82
commit 1575b82fd2
4 changed files with 26 additions and 1 deletions
+2 -1
View File
@@ -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.
+12
View File
@@ -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<QUuid> autorecovered_projects_;
/**
* @brief Do something debug related
*/
bool magic_;
/**
* @brief How many widgets currently need pixel sampling access
*/
+8
View File
@@ -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"));
+4
View File
@@ -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_;