core: add debugging "magic" function
Just a UI way of turning on debug functionality
This commit is contained in:
+2
-1
@@ -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
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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"));
|
||||
|
||||
@@ -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_;
|
||||
|
||||
Reference in New Issue
Block a user