mirror of
https://github.com/cookiengineer/audacity
synced 2026-03-18 12:16:40 +01:00
Add `locale/en.po` file. Add English to `locale/LINGUAS` list. Partially duplicate `msgid`s to `msgstr`s in English locale enable eventual key `msgid` changes Replace former project name with Tenacity in English locale. Replace former project website with Tenacity compatible usages in English locale. Modify `AboutDialog.h` by renaming variables. Modify `AboutDialog.cpp` by replacing usage of pre-fork name in Strings. Modify AddBuildInfoRow methods to be static in About dialog. Make License text const in About dialog. Make pre-fork credits different in About dialog. Begin adding Tenacity specific credits Macros starting with `__` are reserved, so I removed the `__` on the About Dialog guard macro. Remove `AboutDialog::` from usage of `Role` in `AboutDialog.h` Refactor overly long generator method into separate methods in `AboutDialog.(h|cpp)` Begin adding Tenacity developer information Cleanup layout of `AboutDialog.h` and `AboutDialog.cpp` Add `safedelete` macro to compliment odd `safenew` macro Add `enum` to `ShuttleGui.cpp` to make it more clear what `Prop` method is doing. Remove a ton of pointless and/or redunant `#ifdef` usage Remove pointless singleton in AboutDialog Make AboutDialog modal on MacOS Fix reference type use of `auto` in `AudacityApp` b/c it makes unintentional copy. Update XPM and PNG images using Tenacity assets Update ICO images using Tenacity assets. Fix Windows resource script that improperly used `winuser.h` import. Add `*.aps` to gitignore to prevent IDE RC pre-load file from being committed. Add default values for pre-processor constants in `tenacity.rc`. Make changes needed for `Tenacity.exe` binary Add 8x8 PNG to Windows ICO files Replace project name in various CMake and CPack file. Replace project name in various directory structures. Replace project name in various OS-specific build files. Replace project name in various documentation files. Update the PO and POT files using the script. Fix places where a `.desktop` file was used on Linux. Replace title of project windows. Make splash screen click through to `tenacityaudio.org`. Remove ® from `AboutDialog.cpp` Modify copyright message in `AboutDialog.cpp` Signed-off-by: Emily Mabrey <emilymabrey93@gmail.com>
182 lines
4.9 KiB
C++
182 lines
4.9 KiB
C++
/**********************************************************************
|
|
|
|
Tenacity
|
|
|
|
SplashDialog.cpp
|
|
|
|
James Crook
|
|
|
|
********************************************************************//**
|
|
|
|
\class SplashDialog
|
|
\brief The SplashDialog shows help information for Audacity when
|
|
Audacity starts up.
|
|
|
|
It was written for the benefit of NEW users who do not want to
|
|
read the manual. The text of the dialog is kept short to increase the
|
|
chance of it being read. The content is designed to reduce the
|
|
most commonly asked questions about Audacity.
|
|
|
|
*//********************************************************************/
|
|
|
|
|
|
|
|
#include "SplashDialog.h"
|
|
|
|
|
|
|
|
#include <wx/dialog.h>
|
|
#include <wx/frame.h>
|
|
#include <wx/html/htmlwin.h>
|
|
#include <wx/button.h>
|
|
#include <wx/sizer.h>
|
|
#include <wx/statbmp.h>
|
|
#include <wx/intl.h>
|
|
#include <wx/image.h>
|
|
|
|
#include "FileNames.h"
|
|
#include "Project.h"
|
|
#include "ShuttleGui.h"
|
|
#include "widgets/AudacityMessageBox.h"
|
|
#include "widgets/HelpSystem.h"
|
|
|
|
#include "AllThemeResources.h"
|
|
#include "Prefs.h"
|
|
#include "HelpText.h"
|
|
|
|
// DA: Logo for Splash Dialog (welcome dialog)
|
|
#ifdef EXPERIMENTAL_DA
|
|
#include "../images/DarkAudacityLogoWithName.xpm"
|
|
#else
|
|
#include "../images/AudacityLogoWithName.xpm"
|
|
#endif
|
|
|
|
SplashDialog * SplashDialog::pSelf=NULL;
|
|
|
|
enum
|
|
{
|
|
DontShowID=1000,
|
|
};
|
|
|
|
BEGIN_EVENT_TABLE(SplashDialog, wxDialogWrapper)
|
|
EVT_BUTTON(wxID_OK, SplashDialog::OnOK)
|
|
EVT_CHECKBOX( DontShowID, SplashDialog::OnDontShow )
|
|
END_EVENT_TABLE()
|
|
|
|
IMPLEMENT_CLASS(SplashDialog, wxDialogWrapper)
|
|
|
|
void SplashDialog::DoHelpWelcome( AudacityProject &project )
|
|
{
|
|
Show2( &GetProjectFrame( project ) );
|
|
}
|
|
|
|
SplashDialog::SplashDialog(wxWindow * parent)
|
|
: wxDialogWrapper(parent, -1, XO("Welcome to Audacity!"),
|
|
wxPoint( -1, 60 ), // default x position, y position 60 pixels from top of screen.
|
|
wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER)
|
|
{
|
|
SetName();
|
|
m_pLogo = NULL; //v
|
|
ShuttleGui S( this, eIsCreating );
|
|
Populate( S );
|
|
Fit();
|
|
this->Centre();
|
|
int x,y;
|
|
GetPosition( &x, &y );
|
|
Move( x, 60 );
|
|
}
|
|
|
|
void SplashDialog::OnChar(wxMouseEvent &event)
|
|
{
|
|
if ( event.ShiftDown() && event.ControlDown() )
|
|
wxLaunchDefaultBrowser("https://www.tenacityaudio.org");
|
|
}
|
|
|
|
void SplashDialog::Populate( ShuttleGui & S )
|
|
{
|
|
bool bShow;
|
|
gPrefs->Read(wxT("/GUI/ShowSplashScreen"), &bShow, true );
|
|
S.StartVerticalLay(1);
|
|
|
|
//v For now, change to AudacityLogoWithName via old-fashioned ways, not Theme.
|
|
m_pLogo = std::make_unique<wxBitmap>((const char **) AudacityLogoWithName_xpm); //v
|
|
|
|
|
|
// JKC: Resize to 50% of size. Later we may use a smaller xpm as
|
|
// our source, but this allows us to tweak the size - if we want to.
|
|
// It also makes it easier to revert to full size if we decide to.
|
|
const float fScale=0.5f;// smaller size.
|
|
wxImage RescaledImage( m_pLogo->ConvertToImage() );
|
|
wxColour MainColour(
|
|
RescaledImage.GetRed(1,1),
|
|
RescaledImage.GetGreen(1,1),
|
|
RescaledImage.GetBlue(1,1));
|
|
this->SetBackgroundColour(MainColour);
|
|
|
|
// wxIMAGE_QUALITY_HIGH not supported by wxWidgets 2.6.1, or we would use it here.
|
|
RescaledImage.Rescale( (int)(LOGOWITHNAME_WIDTH * fScale), (int)(LOGOWITHNAME_HEIGHT *fScale) );
|
|
wxBitmap RescaledBitmap( RescaledImage );
|
|
wxStaticBitmap *const icon =
|
|
safenew wxStaticBitmap(S.GetParent(), -1,
|
|
//*m_pLogo, //v theTheme.Bitmap(bmpAudacityLogoWithName),
|
|
RescaledBitmap,
|
|
wxDefaultPosition,
|
|
wxSize((int)(LOGOWITHNAME_WIDTH*fScale), (int)(LOGOWITHNAME_HEIGHT*fScale)));
|
|
|
|
S.Prop(0)
|
|
#if (0)
|
|
.ConnectRoot( wxEVT_LEFT_DOWN, &SplashDialog::OnChar)
|
|
#endif
|
|
.AddWindow( icon );
|
|
|
|
mpHtml = safenew LinkingHtmlWindow(S.GetParent(), -1,
|
|
wxDefaultPosition,
|
|
wxSize(506, 280),
|
|
wxHW_SCROLLBAR_AUTO | wxSUNKEN_BORDER );
|
|
mpHtml->SetPage(HelpText( wxT("welcome") ));
|
|
S.Prop(1)
|
|
.Position( wxEXPAND )
|
|
.AddWindow( mpHtml );
|
|
S.Prop(0).StartMultiColumn(2, wxEXPAND);
|
|
S.SetStretchyCol( 1 );// Column 1 is stretchy...
|
|
{
|
|
S.SetBorder( 5 );
|
|
S.Id( DontShowID).AddCheckBox( XXO("Don't show this again at start up"), !bShow );
|
|
S.SetBorder( 5 );
|
|
|
|
S.Id(wxID_OK)
|
|
.Prop(0)
|
|
.AddButton(XXO("OK"), wxALIGN_RIGHT| wxALL, true);
|
|
}
|
|
S.EndVerticalLay();
|
|
}
|
|
|
|
SplashDialog::~SplashDialog()
|
|
{
|
|
}
|
|
|
|
void SplashDialog::OnDontShow( wxCommandEvent & Evt )
|
|
{
|
|
bool bShow = !Evt.IsChecked();
|
|
gPrefs->Write(wxT("/GUI/ShowSplashScreen"), bShow );
|
|
gPrefs->Flush();
|
|
}
|
|
|
|
void SplashDialog::OnOK(wxCommandEvent & WXUNUSED(event))
|
|
{
|
|
Show( false );
|
|
|
|
}
|
|
|
|
void SplashDialog::Show2( wxWindow * pParent )
|
|
{
|
|
if( pSelf == NULL )
|
|
{
|
|
// pParent owns it
|
|
wxASSERT(pParent);
|
|
pSelf = safenew SplashDialog( pParent );
|
|
}
|
|
pSelf->mpHtml->SetPage(HelpText( wxT("welcome") ));
|
|
pSelf->Show( true );
|
|
}
|