Applications: Rename Serendipity => Welcome

Let's stick to the theme of "the most obvious name possible"
This commit is contained in:
Andreas Kling 2021-04-15 17:00:22 +02:00
parent ff312d8aa6
commit 9f4e37e342
10 changed files with 30 additions and 31 deletions

View file

@ -25,7 +25,6 @@ alias pv=Profiler
alias ws=WebServer
alias sl=Solitaire
alias ue=UserspaceEmulator
alias welcome=Serendipity
alias rgrep="grep -r"
alias egrep="grep -E"

View file

Before

Width:  |  Height:  |  Size: 229 B

After

Width:  |  Height:  |  Size: 229 B

View file

Before

Width:  |  Height:  |  Size: 678 B

After

Width:  |  Height:  |  Size: 678 B

View file

@ -17,7 +17,6 @@ add_subdirectory(Piano)
add_subdirectory(PixelPaint)
add_subdirectory(QuickShow)
add_subdirectory(Run)
add_subdirectory(Serendipity)
add_subdirectory(SoundPlayer)
add_subdirectory(SpaceAnalyzer)
add_subdirectory(Spreadsheet)
@ -25,3 +24,4 @@ add_subdirectory(SystemMonitor)
add_subdirectory(ThemeEditor)
add_subdirectory(Terminal)
add_subdirectory(TextEditor)
add_subdirectory(Welcome)

View file

@ -1,11 +0,0 @@
compile_gml(SerendipityWindow.gml SerendipityWindowGML.h serendipity_window_gml)
set(SOURCES
SerendipityWindowGML.h
SerendipityWidget.cpp
SerendipityWidget.h
main.cpp
)
serenity_app(Serendipity ICON app-serendipity)
target_link_libraries(Serendipity LibGUI LibWeb)

View file

@ -0,0 +1,11 @@
compile_gml(WelcomeWindow.gml WelcomeWindowGML.h welcome_window_gml)
set(SOURCES
WelcomeWindowGML.h
WelcomeWidget.cpp
WelcomeWidget.h
main.cpp
)
serenity_app(Welcome ICON app-welcome)
target_link_libraries(Welcome LibGUI LibWeb)

View file

@ -24,12 +24,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "SerendipityWidget.h"
#include <Applications/Serendipity/SerendipityWindowGML.h>
#include "WelcomeWidget.h"
#include <Applications/Tips/TipsWindowGML.h>
#include <LibCore/File.h>
#include <LibGUI/Application.h>
#include <LibGUI/Button.h>
#include <LibGUI/CheckBox.h>
#include <LibGUI/Label.h>
#include <LibGUI/Painter.h>
#include <LibGfx/BitmapFont.h>
@ -40,16 +39,16 @@
#include <spawn.h>
#include <time.h>
SerendipityWidget::SerendipityWidget()
WelcomeWidget::WelcomeWidget()
{
load_from_gml(serendipity_window_gml);
load_from_gml(tips_window_gml);
auto& tip_frame = *find_descendant_of_type_named<GUI::Frame>("tip_frame");
tip_frame.set_background_role(Gfx::ColorRole::Base);
tip_frame.set_fill_with_background_color(true);
auto& light_bulb_label = *find_descendant_of_type_named<GUI::Label>("light_bulb_label");
light_bulb_label.set_icon(Gfx::Bitmap::load_from_file("/res/icons/32x32/app-serendipity.png"));
light_bulb_label.set_icon(Gfx::Bitmap::load_from_file("/res/icons/32x32/app-welcome.png"));
m_web_view = *find_descendant_of_type_named<Web::OutOfProcessWebView>("web_view");
@ -100,11 +99,11 @@ SerendipityWidget::SerendipityWidget()
set_random_tip();
}
SerendipityWidget::~SerendipityWidget()
WelcomeWidget::~WelcomeWidget()
{
}
void SerendipityWidget::open_and_parse_tips_file()
void WelcomeWidget::open_and_parse_tips_file()
{
auto file = Core::File::construct("/home/anon/Documents/tips.txt");
if (!file->open(Core::IODevice::ReadOnly)) {
@ -126,7 +125,7 @@ void SerendipityWidget::open_and_parse_tips_file()
}
}
void SerendipityWidget::open_and_parse_readme_file()
void WelcomeWidget::open_and_parse_readme_file()
{
auto file = Core::File::construct("/home/anon/README.md");
if (!file->open(Core::IODevice::ReadOnly))
@ -139,7 +138,7 @@ void SerendipityWidget::open_and_parse_readme_file()
}
}
void SerendipityWidget::set_random_tip()
void WelcomeWidget::set_random_tip()
{
if (m_tips.is_empty())
return;
@ -152,7 +151,7 @@ void SerendipityWidget::set_random_tip()
m_tip_label->set_text(m_tips[n]);
}
void SerendipityWidget::paint_event(GUI::PaintEvent& event)
void WelcomeWidget::paint_event(GUI::PaintEvent& event)
{
GUI::Painter painter(*this);
painter.add_clip_rect(event.rect());

View file

@ -29,13 +29,14 @@
#include <LibGUI/Widget.h>
#include <LibWeb/OutOfProcessWebView.h>
class SerendipityWidget final : public GUI::Widget {
C_OBJECT(SerendipityWidget)
class WelcomeWidget final : public GUI::Widget {
C_OBJECT(WelcomeWidget);
public:
virtual ~SerendipityWidget() override;
virtual ~WelcomeWidget() override;
private:
SerendipityWidget();
WelcomeWidget();
virtual void paint_event(GUI::PaintEvent&) override;

View file

@ -24,7 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "SerendipityWidget.h"
#include "WelcomeWidget.h"
#include <LibGUI/Application.h>
#include <LibGUI/Icon.h>
#include <LibGUI/Window.h>
@ -69,7 +69,7 @@ int main(int argc, char** argv)
return 1;
}
auto app_icon = GUI::Icon::default_icon("app-serendipity");
auto app_icon = GUI::Icon::default_icon("app-welcome");
auto window = GUI::Window::construct();
window->resize(480, 250);
@ -78,7 +78,7 @@ int main(int argc, char** argv)
window->set_title("Welcome");
window->set_minimum_size(480, 250);
window->set_icon(app_icon.bitmap_for_size(16));
window->set_main_widget<SerendipityWidget>();
window->set_main_widget<WelcomeWidget>();
window->show();