group Product/App specific resources

* only install icons relevant to product
 * use program-name (as-is) as prefix
 * keep icons/* for all products
This commit is contained in:
Robin Gareus 2016-05-17 13:12:05 +02:00
parent b7965a660d
commit 026f8dd80f
14 changed files with 26 additions and 23 deletions

View File

@ -5309,16 +5309,16 @@ ARDOUR_UI::setup_toplevel_window (Gtk::Window& window, const string& name, void*
if (window_icons.empty()) {
Glib::RefPtr<Gdk::Pixbuf> icon;
if ((icon = ::get_icon ("ardour_icon_16px")) != 0) {
if ((icon = ::get_icon (PROGRAM_NAME "-icon_16px")) != 0) {
window_icons.push_back (icon);
}
if ((icon = ::get_icon ("ardour_icon_22px")) != 0) {
if ((icon = ::get_icon (PROGRAM_NAME "-icon_22px")) != 0) {
window_icons.push_back (icon);
}
if ((icon = ::get_icon ("ardour_icon_32px")) != 0) {
if ((icon = ::get_icon (PROGRAM_NAME "-icon_32px")) != 0) {
window_icons.push_back (icon);
}
if ((icon = ::get_icon ("ardour_icon_48px")) != 0) {
if ((icon = ::get_icon (PROGRAM_NAME "-icon_48px")) != 0) {
window_icons.push_back (icon);
}
}

View File

Before

Width:  |  Height:  |  Size: 705 B

After

Width:  |  Height:  |  Size: 705 B

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

Before

Width:  |  Height:  |  Size: 86 KiB

After

Width:  |  Height:  |  Size: 86 KiB

View File

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 9.4 KiB

View File

Before

Width:  |  Height:  |  Size: 48 KiB

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -348,7 +348,10 @@ SessionDialog::setup_initial_choice_box ()
string image_path;
if (find_file (ardour_data_search_path(), "small-splash.png", image_path)) {
Searchpath rc (ARDOUR::ardour_data_search_path());
rc.add_subdirectory_to_paths ("resources");
if (find_file (rc, PROGRAM_NAME "-small-splash.png", image_path)) {
Gtk::Image* image;
if ((image = manage (new Gtk::Image (image_path))) != 0) {
hbox->pack_start (*image, false, false);

View File

@ -50,7 +50,10 @@ Splash::Splash ()
std::string splash_file;
if (!find_file (ardour_data_search_path(), "splash.png", splash_file)) {
Searchpath rc (ARDOUR::ardour_data_search_path());
rc.add_subdirectory_to_paths ("resources");
if (!find_file (rc, PROGRAM_NAME "-splash.png", splash_file)) {
cerr << "Cannot find splash screen image file\n";
throw failed_constructor();
}

View File

@ -79,23 +79,23 @@ ArdourStartup::ArdourStartup ()
set_position (WIN_POS_CENTER);
set_border_width (12);
if ((icon_pixbuf = ::get_icon ("ardour_icon_48px")) == 0) {
if ((icon_pixbuf = ::get_icon (PROGRAM_NAME "-icon_48px")) == 0) {
throw failed_constructor();
}
list<Glib::RefPtr<Gdk::Pixbuf> > window_icons;
Glib::RefPtr<Gdk::Pixbuf> icon;
if ((icon = ::get_icon ("ardour_icon_16px")) != 0) {
if ((icon = ::get_icon (PROGRAM_NAME "-icon_16px")) != 0) {
window_icons.push_back (icon);
}
if ((icon = ::get_icon ("ardour_icon_22px")) != 0) {
if ((icon = ::get_icon (PROGRAM_NAME "-icon_22px")) != 0) {
window_icons.push_back (icon);
}
if ((icon = ::get_icon ("ardour_icon_32px")) != 0) {
if ((icon = ::get_icon (PROGRAM_NAME "-icon_32px")) != 0) {
window_icons.push_back (icon);
}
if ((icon = ::get_icon ("ardour_icon_48px")) != 0) {
if ((icon = ::get_icon (PROGRAM_NAME "-icon_48px")) != 0) {
window_icons.push_back (icon);
}
if (!window_icons.empty ()) {

View File

@ -465,6 +465,12 @@ ARDOUR_UI_UTILS::get_icon_path (const char* cname, string icon_set, bool is_imag
find_file (spath, name, data_file_path);
}
if (data_file_path.empty()) {
Searchpath rc (ARDOUR::ardour_data_search_path());
rc.add_subdirectory_to_paths ("resources");
find_file (rc, name, data_file_path);
}
if (is_image && data_file_path.empty()) {
if (!icon_set.empty() && icon_set != _("default")) {

View File

@ -796,18 +796,9 @@ def build(bld):
bld.install_files(os.path.join (bld.env['DATADIR'], 'pixmaps'), bld.path.ant_glob('pixmaps/*.xpm'))
bld.install_files(bld.env['DATADIR'], 'ArdourMono.ttf')
# Splash (copy to build-dir to run from src and rename+install)
lowercase_appname = Options.options.program_name.lower();
obj = bld(features = 'copy')
obj.source = 'icons/' + lowercase_appname + '-splash.png'
obj.target = 'splash.png'
bld.install_as(os.path.join(os.path.normpath(bld.env['DATADIR']), 'splash.png'), 'icons/' + lowercase_appname + '-splash.png')
obj = bld(features = 'copy')
obj.source = 'icons/' + lowercase_appname + '-small-splash.png'
obj.target = 'small-splash.png'
bld.install_as(os.path.join(os.path.normpath(bld.env['DATADIR']), 'small-splash.png'), 'icons/' + lowercase_appname + '-small-splash.png')
# Application/Product specific resources (icon, splash)
pgmname = Options.options.program_name;
bld.install_files(os.path.join(bld.env['DATADIR'], 'resources'), bld.path.ant_glob('resources/' + pgmname + '*'))
if bld.env['build_target'] == 'mingw':
# These icons need to overwrite the files already installed in the icons