mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 15:57:45 +00:00
DisplaySettings: Rename from DisplayProperties
This commit is contained in:
parent
c7107385ee
commit
51df4bdbfc
13 changed files with 30 additions and 30 deletions
|
@ -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>
|
||||
|
@ -41,7 +41,7 @@
|
|||
#include <LibGfx/Palette.h>
|
||||
#include <LibGfx/SystemTheme.h>
|
||||
|
||||
DisplayPropertiesWidget::DisplayPropertiesWidget()
|
||||
DisplaySettingsWidget::DisplaySettingsWidget()
|
||||
{
|
||||
create_resolution_list();
|
||||
create_wallpaper_list();
|
||||
|
@ -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 });
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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>();
|
||||
|
@ -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");
|
||||
|
@ -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();
|
||||
}
|
||||
|
||||
|
@ -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()) {
|
|
@ -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; }
|
||||
|
|
@ -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
|
||||
|
|
@ -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>
|
||||
|
@ -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));
|
|
@ -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);
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
[App]
|
||||
Name=Display Properties
|
||||
Executable=/bin/DisplayProperties
|
||||
Category=Graphics
|
||||
|
||||
[Icons]
|
||||
16x16=/res/icons/16x16/app-display-properties.png
|
||||
32x32=/res/icons/32x32/app-display-properties.png
|
8
Base/res/apps/DisplaySettings.af
Normal file
8
Base/res/apps/DisplaySettings.af
Normal file
|
@ -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
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue