mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
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:
parent
0f4fa43541
commit
6dde2c7f47
Notes:
sideshowbarker
2024-07-19 07:19:15 +09:00
Author: https://github.com/bcoles Commit: https://github.com/SerenityOS/serenity/commit/6dde2c7f479 Pull-request: https://github.com/SerenityOS/serenity/pull/1936 Reviewed-by: https://github.com/bugaevc
2 changed files with 6 additions and 2 deletions
|
@ -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"));
|
||||
|
|
2
Base/home/anon/Browser.ini
Normal file
2
Base/home/anon/Browser.ini
Normal file
|
@ -0,0 +1,2 @@
|
|||
[Preferences]
|
||||
Home=file:///home/anon/www/welcome.html
|
Loading…
Reference in a new issue