From 8b9d90df012b9561fda5142c48a5e26946401fa3 Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Thu, 9 May 2019 17:04:06 +0100 Subject: [PATCH] JAL-3247 JAL-3254 Ensure .jvp and .jvl appear first in File Associations list (visible in Windows installer) --- utils/install4j/auto_file_associations.pl | 15 ++- .../file_associations_auto-Info_plist.xml | 76 +++++++------- .../install4j/file_associations_auto-install4j.xml | 108 ++++++++++---------- 3 files changed, 103 insertions(+), 96 deletions(-) diff --git a/utils/install4j/auto_file_associations.pl b/utils/install4j/auto_file_associations.pl index ad08a92..e59044f 100755 --- a/utils/install4j/auto_file_associations.pl +++ b/utils/install4j/auto_file_associations.pl @@ -3,7 +3,7 @@ use strict; my $fileformats = $ARGV[0]; -$fileformats = "../../src/jalview/io/FileFormats.java" unless $fileformats; +$fileformats = "../../src/jalview/io/FileFormat.java" unless $fileformats; # default mimetype will be text/x-$shortname # TODO: find an actual extension for mat, see JAL-Xxxxx for outstanding issues too @@ -38,6 +38,7 @@ my $add_associations = { my $add_extensions = { blc => ["blc"], }; +my @put_first = qw(jalview jvl); my $mactemplatefile = "file_associations_template-Info_plist.xml"; my $i4jtemplatefile = "file_associations_template-install4j.xml"; @@ -94,15 +95,19 @@ while(my $line = ) { name => $name, extensions => \@extensions }; + warn("Adding file association for $shortname\n"); } } close(IN); my %all_associations = (%$file_associations, %$add_associations); -for my $fa (sort keys %all_associations) { - my $shortname = $fa; - my $a = $all_associations{$fa}; +for my $shortname (@put_first, sort keys %all_associations) { + my $a = $all_associations{$shortname}; + if (ref($a) ne "HASH") { + next; + } + my $name = $a->{name}; my $extensions = $a->{extensions}; my $mimetype = $mimetypes->{$shortname}; @@ -146,6 +151,8 @@ for my $fa (sort keys %all_associations) { print IA $i4jextentry; } + + delete $all_associations{$shortname}; } close(IA); diff --git a/utils/install4j/file_associations_auto-Info_plist.xml b/utils/install4j/file_associations_auto-Info_plist.xml index 8be95e6..da2633b 100644 --- a/utils/install4j/file_associations_auto-Info_plist.xml +++ b/utils/install4j/file_associations_auto-Info_plist.xml @@ -4,6 +4,44 @@ CFBundleTypeExtensions +jvp + +CFBundleTypeName +Jalview File +CFBundleTypeIconFile +Jalview-File.icns +CFBundleTypeRole +Editor +CFBundleTypeMIMETypes + +application/x-jalview+xml+zip + +LSIsAppleDefaultForType + + + + +CFBundleTypeExtensions + +jvl + +CFBundleTypeName +Jalview Version Locator File +CFBundleTypeIconFile +Jalview-Version-Locator.icns +CFBundleTypeRole +Editor +CFBundleTypeMIMETypes + +application/x-jalview-jvl+text + +LSIsAppleDefaultForType + + + + +CFBundleTypeExtensions + amsa CFBundleTypeName @@ -179,25 +217,6 @@ CFBundleTypeExtensions -jvp - -CFBundleTypeName -Jalview File -CFBundleTypeIconFile -Jalview-File.icns -CFBundleTypeRole -Editor -CFBundleTypeMIMETypes - -application/x-jalview+xml+zip - -LSIsAppleDefaultForType - - - - -CFBundleTypeExtensions - concise jnet @@ -218,25 +237,6 @@ CFBundleTypeExtensions -jvl - -CFBundleTypeName -Jalview Version Locator File -CFBundleTypeIconFile -Jalview-Version-Locator.icns -CFBundleTypeRole -Editor -CFBundleTypeMIMETypes - -application/x-jalview-jvl+text - -LSIsAppleDefaultForType - - - - -CFBundleTypeExtensions - cif CFBundleTypeName diff --git a/utils/install4j/file_associations_auto-install4j.xml b/utils/install4j/file_associations_auto-install4j.xml index c7b07ee..192b5d2 100644 --- a/utils/install4j/file_associations_auto-install4j.xml +++ b/utils/install4j/file_associations_auto-install4j.xml @@ -1,12 +1,12 @@ - + - AMSA File + Jalview File - amsa + jvp 737 @@ -33,22 +33,22 @@ - + - Jalview Annotations File + Jalview Version Locator File - annotations + jvl 737 - Jalview-File.icns + Jalview-Version-Locator.icns @@ -59,7 +59,7 @@ - Jalview-File.ico + Jalview-Version-Locator.ico @@ -68,15 +68,15 @@ - + - Jalview Annotations File + AMSA File - jvannotations + amsa 737 @@ -103,15 +103,15 @@ - + - BioJSON File + Jalview Annotations File - biojson + annotations 737 @@ -138,15 +138,15 @@ - + - BLC File + Jalview Annotations File - BLC + jvannotations 737 @@ -173,15 +173,15 @@ - + - BLC File + BioJSON File - blc + biojson 737 @@ -208,15 +208,15 @@ - + - Clustal File + BLC File - aln + BLC 737 @@ -243,15 +243,15 @@ - + - Fasta File + BLC File - fa + blc 737 @@ -278,15 +278,15 @@ - + - Fasta File + Clustal File - fasta + aln 737 @@ -313,15 +313,15 @@ - + - Jalview Features File + Fasta File - features + fa 737 @@ -348,15 +348,15 @@ - + - Jalview Features File + Fasta File - jvfeatures + fasta 737 @@ -383,15 +383,15 @@ - + - Generic Features Format v2 File + Jalview Features File - gff2 + features 737 @@ -418,15 +418,15 @@ - + - Generic Features Format v3 File + Jalview Features File - gff3 + jvfeatures 737 @@ -453,15 +453,15 @@ - + - Jalview File + Generic Features Format v2 File - jvp + gff2 737 @@ -488,15 +488,15 @@ - + - JnetFile File + Generic Features Format v3 File - concise + gff3 737 @@ -523,7 +523,7 @@ - + @@ -531,7 +531,7 @@ JnetFile File - jnet + concise 737 @@ -558,22 +558,22 @@ - + - Jalview Version Locator File + JnetFile File - jvl + jnet 737 - Jalview-Version-Locator.icns + Jalview-File.icns @@ -584,7 +584,7 @@ - Jalview-Version-Locator.ico + Jalview-File.ico -- 1.7.10.2