Browser: Add Browser.ini configuration file

The Browser can now load a home page URL from the user's Browser.ini
configuration file rather than using a hard-coded URL.
This commit is contained in:
Brendan Coles 2020-04-25 03:25:11 +00:00 committed by Andreas Kling
parent 0f4fa43541
commit 6dde2c7f47
Notes: sideshowbarker 2024-07-19 07:19:15 +09:00
2 changed files with 6 additions and 2 deletions

View file

@ -27,6 +27,7 @@
#include "InspectorWidget.h"
#include "Tab.h"
#include "WindowActions.h"
#include <LibCore/ConfigFile.h>
#include <LibCore/File.h>
#include <LibGUI/AboutDialog.h>
#include <LibGUI/Application.h>
@ -38,8 +39,6 @@
#include <stdio.h>
#include <stdlib.h>
static const char* home_url = "file:///home/anon/www/welcome.html";
int main(int argc, char** argv)
{
if (getuid() == 0) {
@ -74,6 +73,9 @@ int main(int argc, char** argv)
unveil(nullptr, nullptr);
auto m_config = Core::ConfigFile::get_for_app("Browser");
auto home_url = m_config->read_entry("Preferences", "Home", "file:///home/anon/www/welcome.html");
auto window = GUI::Window::construct();
window->set_rect(100, 100, 640, 480);
window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-html.png"));

View file

@ -0,0 +1,2 @@
[Preferences]
Home=file:///home/anon/www/welcome.html