diff --git a/application/Makefile b/application/Makefile index 360b47e..4a0a3de 100644 --- a/application/Makefile +++ b/application/Makefile @@ -75,7 +75,6 @@ SRCS = \ application/views/UserItem.cpp \ application/views/UserListView.cpp \ application/views/UserPopUp.cpp \ - application/windows/AboutWindow.cpp \ application/windows/AccountsWindow.cpp \ application/windows/ConversationInfoWindow.cpp \ application/windows/MainWindow.cpp \ diff --git a/application/TheApp.cpp b/application/TheApp.cpp index 953cafb..b548d21 100644 --- a/application/TheApp.cpp +++ b/application/TheApp.cpp @@ -14,6 +14,7 @@ #include +#include #include #include #include @@ -21,7 +22,6 @@ #include -#include "AboutWindow.h" #include "ChatOMatic.h" #include "AppMessages.h" #include "FilePanel.h" @@ -109,28 +109,21 @@ TheApp::AboutRequested() "2009-2010 Andrea Anzani", "2010-2015 Dario Casalinuovo", "2009-2010 Pier Luigi Fiorini", - "2021 Jaidyn Levesque", - NULL - }; - - const char* authors[] = { - "Andrea Anzani", - "Dario Casalinuovo", - "Pier Luigi Fiorini", - "Jaidyn Levesque", NULL }; BString extraInfo(B_TRANSLATE("%app% is released under the MIT License.\n" "Add-on and library licenses may vary.\n" "Built: %buildDate%")); - extraInfo.ReplaceAll("%buildDate", BUILD_DATE); + extraInfo.ReplaceAll("%buildDate%", BUILD_DATE); extraInfo.ReplaceAll("%app%", B_TRANSLATE_SYSTEM_NAME(APP_NAME)); - AboutWindow* about = new AboutWindow(B_TRANSLATE_SYSTEM_NAME(APP_NAME), - holders, authors, extraInfo.String()); + BAboutWindow* about = new BAboutWindow(B_TRANSLATE_SYSTEM_NAME(APP_NAME), + APP_SIGNATURE); + about->AddDescription(B_TRANSLATE("A multi-protocol chat program.")); + about->AddCopyright(2021, "Jaidyn Levesque", holders); + about->AddExtraInfo(extraInfo); about->Show(); - delete about; } diff --git a/application/windows/AboutWindow.cpp b/application/windows/AboutWindow.cpp deleted file mode 100644 index 1e6335d..0000000 --- a/application/windows/AboutWindow.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright 2010-2011, Pier Luigi Fiorini. All rights reserved. - * Copyright 2007-2009, Haiku, Inc. All rights reserved. - * Distributed under the terms of the MIT License. - * - * Authors: - * Pier Luigi Fiorini, pierluigi.fiorini@gmail.com - * Ryan Leavengood, leavengood@gmail.com - */ - -#include -#include -#include -#include -#include - -#include "AboutWindow.h" - - -#undef B_TRANSLATION_CONTEXT -#define B_TRANSLATION_CONTEXT "About window" - - -AboutWindow::AboutWindow(const char* appName, const char** holders, - const char** authors, const char* extraInfo) -{ - fAppName = new BString(appName); - - // Build the text to display - int32 i; - BString text(appName); - text << "\n\n"; - for (i = 0; holders[i]; i++) - text << B_TRANSLATE("Copyright " B_UTF8_COPYRIGHT " ") << holders[i] - << "\n"; - - text << B_TRANSLATE("\nWritten by:\n"); - for (int32 i = 0; authors[i]; i++) { - text << " " << authors[i] << "\n"; - } - // The extra information is optional - if (extraInfo != NULL) - text << "\n" << extraInfo << "\n"; - - fText = new BString(text); -} - - -AboutWindow::~AboutWindow() -{ - delete fText; - delete fAppName; -} - - -void -AboutWindow::Show() -{ - BAlert* alert = new BAlert(B_TRANSLATE("About" B_UTF8_ELLIPSIS), - fText->String(), B_TRANSLATE("Close")); - BTextView* view = alert->TextView(); - BFont font; - view->SetStylable(true); - view->GetFont(&font); - font.SetFace(B_BOLD_FACE); - font.SetSize(font.Size() * 1.7f); - view->SetFontAndColor(0, fAppName->Length(), &font); - alert->Go(); -} diff --git a/application/windows/AboutWindow.h b/application/windows/AboutWindow.h deleted file mode 100644 index 03df2a6..0000000 --- a/application/windows/AboutWindow.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright 2010-2011, Pier Luigi Fiorini. All rights reserved. - * Copyright 2007-2009, Haiku, Inc. All rights reserved. - * Distributed under the terms of the MIT License. - */ -#ifndef _ABOUT_WINDOW_H -#define _ABOUT_WINDOW_H - -#include - -class AboutWindow { -public: - AboutWindow(const char* appName, const char** holders, - const char** authors, const char* extraInfo = NULL); - virtual ~AboutWindow(); - - void Show(); - -private: - BString* fAppName; - BString* fText; -}; - -#endif // _ABOUT_WINDOW_H