Skip to content

Commit

Permalink
Userland: Rename QuickShow => Image Viewer
Browse files Browse the repository at this point in the history
The old name was a bit too ambiguous. This one is crystal clear. :^)
  • Loading branch information
awesomekling committed May 14, 2021
1 parent d039542 commit 58d73ea
Show file tree
Hide file tree
Showing 11 changed files with 50 additions and 50 deletions.
2 changes: 1 addition & 1 deletion Base/etc/shellrc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ alias wg=WidgetGallery
alias te=TextEditor
alias he=HexEditor
alias pp=PixelPaint
alias qs=QuickShow
alias iv=ImageViewer
alias pi=Piano
alias calc=Calculator
alias calendar=Calendar
Expand Down
16 changes: 8 additions & 8 deletions Base/home/anon/.config/LaunchServer.ini
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[FileType]
pbm=/bin/QuickShow
pgm=/bin/QuickShow
png=/bin/QuickShow
ppm=/bin/QuickShow
gif=/bin/QuickShow
bmp=/bin/QuickShow
jpg=/bin/QuickShow
jpeg=/bin/QuickShow
pbm=/bin/ImageViewer
pgm=/bin/ImageViewer
png=/bin/ImageViewer
ppm=/bin/ImageViewer
gif=/bin/ImageViewer
bmp=/bin/ImageViewer
jpg=/bin/ImageViewer
jpeg=/bin/ImageViewer
html=/bin/Browser
wav=/bin/SoundPlayer
m3u=/bin/SoundPlayer
Expand Down
4 changes: 2 additions & 2 deletions Base/res/apps/QuickShow.af → Base/res/apps/ImageViewer.af
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[App]
Name=QuickShow
Executable=/bin/QuickShow
Name=Image Viewer
Executable=/bin/ImageViewer
Category=Graphics

[Launcher]
Expand Down
23 changes: 23 additions & 0 deletions Base/usr/share/man/man1/ImageViewer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Name

Image Viewer - SerenityOS image viewer

## Synopsis

```**sh
$ ImageViewer [file]
```

## Description

ImageViewer is an image viewing application for SerenityOS.

## Arguments

* `file`: The image file to be displayed.

## Examples

```sh
$ ImageViewer /res/graphics/buggie.png
```
23 changes: 0 additions & 23 deletions Base/usr/share/man/man1/QuickShow.md

This file was deleted.

2 changes: 1 addition & 1 deletion Userland/Applications/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ add_subdirectory(FontEditor)
add_subdirectory(Help)
add_subdirectory(HexEditor)
add_subdirectory(IRCClient)
add_subdirectory(ImageViewer)
add_subdirectory(KeyboardMapper)
add_subdirectory(KeyboardSettings)
add_subdirectory(Magnifier)
add_subdirectory(MouseSettings)
add_subdirectory(Piano)
add_subdirectory(PixelPaint)
add_subdirectory(QuickShow)
add_subdirectory(Run)
add_subdirectory(SoundPlayer)
add_subdirectory(SpaceAnalyzer)
Expand Down
7 changes: 7 additions & 0 deletions Userland/Applications/ImageViewer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
set(SOURCES
main.cpp
QSWidget.cpp
)

serenity_app(ImageViewer ICON filetype-image)
target_link_libraries(ImageViewer LibDesktop LibGUI LibGfx)
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ int main(int argc, char** argv)

auto app = GUI::Application::construct(argc, argv);

if (!Desktop::Launcher::add_allowed_handler_with_any_url("/bin/QuickShow")) {
if (!Desktop::Launcher::add_allowed_handler_with_any_url("/bin/ImageViewer")) {
warnln("Failed to set up allowed launch URLs");
return 1;
}

if (!Desktop::Launcher::add_allowed_handler_with_only_specific_urls(
"/bin/Help", { URL::create_with_file_protocol("/usr/share/man/man1/QuickShow.md") })) {
"/bin/Help", { URL::create_with_file_protocol("/usr/share/man/man1/ImageViewer.md") })) {
warnln("Failed to set up allowed launch URLs");
return 1;
}
Expand All @@ -65,7 +65,7 @@ int main(int argc, char** argv)
window->set_double_buffering_enabled(true);
window->resize(300, 200);
window->set_icon(app_icon.bitmap_for_size(16));
window->set_title("QuickShow");
window->set_title("Image Viewer");

auto& root_widget = window->set_main_widget<GUI::Widget>();
root_widget.set_fill_with_background_color(true);
Expand All @@ -78,11 +78,11 @@ int main(int argc, char** argv)
auto& widget = root_widget.add<QSWidget>();
widget.on_scale_change = [&](int scale, Gfx::IntRect rect) {
if (!widget.bitmap()) {
window->set_title("QuickShow");
window->set_title("Image Viewer");
return;
}

window->set_title(String::formatted("{} {} {}% - QuickShow", widget.path(), widget.bitmap()->size().to_string(), scale));
window->set_title(String::formatted("{} {} {}% - Image Viewer", widget.path(), widget.bitmap()->size().to_string(), scale));

if (window->is_fullscreen())
return;
Expand All @@ -108,7 +108,7 @@ int main(int argc, char** argv)
widget.load_from_file(urls.first().path());

for (size_t i = 1; i < urls.size(); ++i) {
Desktop::Launcher::open(URL::create_with_file_protocol(urls[i].path().characters()), "/bin/QuickShow");
Desktop::Launcher::open(URL::create_with_file_protocol(urls[i].path().characters()), "/bin/ImageViewer");
}
};
widget.on_doubleclick = [&] {
Expand Down Expand Up @@ -278,9 +278,9 @@ int main(int argc, char** argv)

auto& help_menu = menubar->add_menu("&Help");
help_menu.add_action(GUI::CommonActions::make_help_action([](auto&) {
Desktop::Launcher::open(URL::create_with_file_protocol("/usr/share/man/man1/QuickShow.md"), "/bin/Help");
Desktop::Launcher::open(URL::create_with_file_protocol("/usr/share/man/man1/ImageViewer.md"), "/bin/Help");
}));
help_menu.add_action(GUI::CommonActions::make_about_action("QuickShow", app_icon, window));
help_menu.add_action(GUI::CommonActions::make_about_action("Image Viewer", app_icon, window));

window->set_menubar(move(menubar));

Expand Down
7 changes: 0 additions & 7 deletions Userland/Applications/QuickShow/CMakeLists.txt

This file was deleted.

0 comments on commit 58d73ea

Please sign in to comment.