Skip to content

Commit

Permalink
DisplaySettings: Rename from DisplayProperties
Browse files Browse the repository at this point in the history
  • Loading branch information
awesomekling committed Apr 29, 2020
1 parent c710738 commit 51df4bd
Show file tree
Hide file tree
Showing 13 changed files with 30 additions and 30 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "DisplayProperties.h"
#include "DisplaySettings.h"
#include "ItemListModel.h"
#include <AK/StringBuilder.h>
#include <LibCore/ConfigFile.h>
Expand All @@ -41,7 +41,7 @@
#include <LibGfx/Palette.h>
#include <LibGfx/SystemTheme.h>

DisplayPropertiesWidget::DisplayPropertiesWidget()
DisplaySettingsWidget::DisplaySettingsWidget()
{
create_resolution_list();
create_wallpaper_list();
Expand All @@ -51,7 +51,7 @@ DisplayPropertiesWidget::DisplayPropertiesWidget()
load_current_settings();
}

void DisplayPropertiesWidget::create_resolution_list()
void DisplaySettingsWidget::create_resolution_list()
{
// TODO: Find a better way to get the default resolution
m_resolutions.append({ 640, 480 });
Expand All @@ -68,7 +68,7 @@ void DisplayPropertiesWidget::create_resolution_list()
m_resolutions.append({ 2560, 1080 });
}

void DisplayPropertiesWidget::create_wallpaper_list()
void DisplaySettingsWidget::create_wallpaper_list()
{
Core::DirIterator iterator("/res/wallpapers/", Core::DirIterator::Flags::SkipDots);

Expand All @@ -84,7 +84,7 @@ void DisplayPropertiesWidget::create_wallpaper_list()
m_modes.append("scaled");
}

void DisplayPropertiesWidget::create_frame()
void DisplaySettingsWidget::create_frame()
{
m_root_widget = GUI::Widget::construct();
m_root_widget->set_layout<GUI::VerticalBoxLayout>();
Expand Down Expand Up @@ -261,7 +261,7 @@ void DisplayPropertiesWidget::create_frame()
};
}

void DisplayPropertiesWidget::load_current_settings()
void DisplaySettingsWidget::load_current_settings()
{
auto ws_config(Core::ConfigFile::open("/etc/WindowServer/WindowServer.ini"));
auto wm_config = Core::ConfigFile::get_for_app("WindowManager");
Expand Down Expand Up @@ -306,13 +306,13 @@ void DisplayPropertiesWidget::load_current_settings()
// Let's attempt to find the current resolution and select it!
find_size.set_width(ws_config->read_entry("Screen", "Width", "1024").to_int(okay));
if (!okay) {
fprintf(stderr, "DisplayProperties: failed to convert width to int!");
fprintf(stderr, "DisplaySettings: failed to convert width to int!");
ASSERT_NOT_REACHED();
}

find_size.set_height(ws_config->read_entry("Screen", "Height", "768").to_int(okay));
if (!okay) {
fprintf(stderr, "DisplayProperties: failed to convert height to int!");
fprintf(stderr, "DisplaySettings: failed to convert height to int!");
ASSERT_NOT_REACHED();
}

Expand All @@ -338,7 +338,7 @@ void DisplayPropertiesWidget::load_current_settings()
m_monitor_widget->update();
}

void DisplayPropertiesWidget::send_settings_to_window_server()
void DisplaySettingsWidget::send_settings_to_window_server()
{
auto result = GUI::WindowServerConnection::the().send_sync<Messages::WindowServer::SetResolution>(m_monitor_widget->desktop_resolution());
if (!result->success()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
#include <LibGUI/ColorInput.h>
#include <LibGUI/ComboBox.h>

class DisplayPropertiesWidget : public GUI::Widget {
class DisplaySettingsWidget : public GUI::Widget {
C_OBJECT(MonitorWidget);

public:
DisplayPropertiesWidget();
DisplaySettingsWidget();

GUI::Widget* root_widget() { return m_root_widget; }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
OBJS = \
MonitorWidget.o \
DisplayProperties.o \
DisplaySettings.o \
main.o \

PROGRAM = DisplayProperties
PROGRAM = DisplaySettings

LIB_DEPS = GUI Gfx IPC Thread Pthread Core

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#include "DisplayProperties.h"
#include "DisplaySettings.h"
#include <LibGUI/AboutDialog.h>
#include <LibGUI/Action.h>
#include <LibGUI/Application.h>
Expand All @@ -50,26 +50,26 @@ int main(int argc, char** argv)
return 1;
}

DisplayPropertiesWidget instance;
DisplaySettingsWidget instance;

auto window = GUI::Window::construct();
window->set_title("Display Properties");
window->set_title("Display settings");
window->move_to(100, 100);
window->resize(360, 390);
window->set_resizable(false);
window->set_main_widget(instance.root_widget());
window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-display-properties.png"));
window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-display-settings.png"));

auto menubar = GUI::MenuBar::construct();

auto& app_menu = menubar->add_menu("Display Properties");
auto& app_menu = menubar->add_menu("Display settings");
app_menu.add_action(GUI::CommonActions::make_quit_action([&](const GUI::Action&) {
app.quit();
}));

auto& help_menu = menubar->add_menu("Help");
help_menu.add_action(GUI::Action::create("About", [&](const GUI::Action&) {
GUI::AboutDialog::show("Display Properties", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-display-properties.png"), window);
GUI::AboutDialog::show("Display settings", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-display-settings.png"), window);
}));

app.set_menubar(move(menubar));
Expand Down
4 changes: 2 additions & 2 deletions Applications/FileManager/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,8 @@ int run_in_desktop_mode(RefPtr<Core::ConfigFile> config, String initial_location
Core::DesktopServices::open(URL::create_with_file_protocol(model->root_path()));
});

auto display_properties_action = GUI::Action::create("Display properties...", {}, Gfx::Bitmap::load_from_file("/res/icons/16x16/app-display-properties.png"), [&](const GUI::Action&) {
Core::DesktopServices::open(URL::create_with_file_protocol("/bin/DisplayProperties"));
auto display_properties_action = GUI::Action::create("Display settings...", {}, Gfx::Bitmap::load_from_file("/res/icons/16x16/app-display-settings.png"), [&](const GUI::Action&) {
Core::DesktopServices::open(URL::create_with_file_protocol("/bin/DisplaySettings"));
});

desktop_view_context_menu->add_action(mkdir_action);
Expand Down
8 changes: 0 additions & 8 deletions Base/res/apps/DisplayProperties.af

This file was deleted.

8 changes: 8 additions & 0 deletions Base/res/apps/DisplaySettings.af
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[App]
Name=Display settings
Executable=/bin/DisplaySettings
Category=Graphics

[Icons]
16x16=/res/icons/16x16/app-display-settings.png
32x32=/res/icons/32x32/app-display-settings.png
2 changes: 1 addition & 1 deletion Kernel/build-root-filesystem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ cp ../Applications/SystemMenu/SystemMenu mnt/bin/SystemMenu
cp ../Applications/Calculator/Calculator mnt/bin/Calculator
cp ../Applications/Calendar/Calendar mnt/bin/Calendar
cp ../Applications/SoundPlayer/SoundPlayer mnt/bin/SoundPlayer
cp ../Applications/DisplayProperties/DisplayProperties mnt/bin/DisplayProperties
cp ../Applications/DisplaySettings/DisplaySettings mnt/bin/DisplaySettings
cp ../Applications/Welcome/Welcome mnt/bin/Welcome
cp ../Applications/Help/Help mnt/bin/Help
cp ../Applications/Browser/Browser mnt/bin/Browser
Expand Down

0 comments on commit 51df4bd

Please sign in to comment.