Audacity 3.2.0
Enumerations | Functions
ThemePrefs.cpp File Reference
#include "ThemePrefs.h"
#include <wx/app.h>
#include <wx/wxprec.h>
#include "Prefs.h"
#include "Theme.h"
#include "ShuttleGui.h"
#include "AColor.h"
#include "BasicUI.h"
Include dependency graph for ThemePrefs.cpp:

Go to the source code of this file.

Enumerations

enum  eThemePrefsIds {
  idLoadThemeCache =7000 , idSaveThemeCache , idLoadThemeComponents , idSaveThemeComponents ,
  idReadThemeInternal , idSaveThemeAsCode
}
 

Functions

static bool ConfirmSave ()
 

Enumeration Type Documentation

◆ eThemePrefsIds

Enumerator
idLoadThemeCache 
idSaveThemeCache 
idLoadThemeComponents 
idSaveThemeComponents 
idReadThemeInternal 
idSaveThemeAsCode 

Definition at line 42 of file ThemePrefs.cpp.

42 {
49};
@ idLoadThemeComponents
Definition: ThemePrefs.cpp:45
@ idSaveThemeAsCode
Definition: ThemePrefs.cpp:48
@ idSaveThemeCache
Definition: ThemePrefs.cpp:44
@ idReadThemeInternal
Definition: ThemePrefs.cpp:47
@ idSaveThemeComponents
Definition: ThemePrefs.cpp:46
@ idLoadThemeCache
Definition: ThemePrefs.cpp:43

Function Documentation

◆ ConfirmSave()

static bool ConfirmSave ( )
static

Definition at line 60 of file ThemePrefs.cpp.

61{
62 if (!GUIBlendThemes.Read())
63 return true;
64
65 using namespace BasicUI;
66 const auto message = Verbatim(
67"\"Blend system and Audacity theme\" in Interface Preferences was on.\n"
68"This may cause images to to be re-saved with slight changes of color."
69 );
70
71 return MessageBoxResult::Cancel != ShowMessageBox(message,
72 MessageBoxOptions{}.CancelButton().IconStyle(Icon::Warning));
73}
THEME_API BoolSetting GUIBlendThemes
TranslatableString Verbatim(wxString str)
Require calls to the one-argument constructor to go through this distinct global function name.
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined *‍/
Definition: Prefs.h:200
MessageBoxResult ShowMessageBox(const TranslatableString &message, MessageBoxOptions options={})
Show a modal message box with either Ok or Yes and No, and optionally Cancel.
Definition: BasicUI.h:274
MessageBoxOptions && CancelButton() &&
Definition: BasicUI.h:113

References BasicUI::MessageBoxOptions::CancelButton(), GUIBlendThemes, Setting< T >::Read(), BasicUI::ShowMessageBox(), and Verbatim().

Referenced by ThemePrefs::OnSaveThemeAsCode(), ThemePrefs::OnSaveThemeCache(), and ThemePrefs::OnSaveThemeComponents().

Here is the call graph for this function:
Here is the caller graph for this function: