Revision 1908

tmp/org.txm.rcp.feature/win/TXM.bat (revision 1908)
25 25

  
26 26
:USERHOMEOK
27 27

  
28
set TXMHOME=%USERHOME%TXM-%VERSION%\
29
set DOTTXM=%TXMHOME%.txm\
28
set TXMHOME="%USERHOME%TXM-%VERSION%\"
29
set DOTTXM="%USERHOME%.TXM-%VERSION%\"
30 30

  
31 31
mkdir "%TXMHOME%" 
32 32

  
33 33
mkdir "%DOTTXM%" 
34
attrib +h "%DOTTXM%" /s /d
34 35

  
35 36
echo "TXM: getting install date from %installdir%STAMP and %DOTTXM%STAMP files" 
36 37
Fc "%installdir%STAMP" "%DOTTXM%STAMP" 
......
59 60
mkdir "%DOTTXM%user" 
60 61
IF errorlevel 1 (echo "TXM: failed to create %DOTTXM%user directory.")
61 62

  
63
mkdir "%DOTTXM%configuration" 
64
IF errorlevel 1 (echo "TXM: failed to create %DOTTXM%user directory.")
65

  
62 66
mkdir "%DOTTXM%data" 
63 67
IF errorlevel 1 (echo "TXM: failed to create %DOTTXM%data directory.")
64 68

  
65
rmdir /s /q "%TXMHOME%corpora\.metadata"
69
rmdir /s /q "%TXMHOME%\.metadata"
66 70
IF errorlevel 1 (echo "TXM: failed to delete the %TXMHOME%corpora\.metadata directory.")
67 71

  
68 72
copy "%installdir%STAMP" "%DOTTXM%STAMP" 
......
72 76

  
73 77
set _JAVA_OPTIONS=-Duser.home="%USERHOME%"
74 78
echo running "%installdir%TXM.exe" -run --launcher.ini "%DOTTXM%TXM.ini" %ARGS% -data "%DOTTXM%data" -user "%DOTTXM%user" -install "%installdir%"
75
REM "%installdir%TXM.exe" -run --launcher.ini "%DOTTXM%TXM.ini" %ARGS% -data "%DOTTXM%corpora" -user "%DOTTXM%user" -install "%installdir%"
76
"%installdir%TXM.exe" -run --launcher.ini "%DOTTXM%TXM.ini" %ARGS% -data "%TXMHOME%corpora" -user "%DOTTXM%user" -install "%installdir%\"
79
REM "%installdir%TXM.exe" -run --launcher.ini "%DOTTXM%TXM.ini" %ARGS% -user "%DOTTXM%user" -install "%installdir%"
80
"%installdir%TXM.exe" -run --launcher.ini "%DOTTXM%TXM.ini" %ARGS% -configuration "%DOTTXM%configuration" -user "%DOTTXM%user" -install "%installdir%\"
tmp/org.txm.core/src/java/org/txm/objects/Workspace.java (revision 1908)
426 426
			}
427 427
			try {
428 428
				project.open(monitor);
429
				String[] natures = project.getDescription().getNatureIds();
430
				if (Arrays.binarySearch(natures, Project.TXMCORPUSNATURE) < 0) continue;
429
				//String[] natures = project.getDescription().getNatureIds();
430
				//if (Arrays.binarySearch(natures, Project.TXMCORPUSNATURE) < 0) continue;
431 431

  
432 432
				Project.loadProjectFromProjectScope(project);
433 433
			} catch (CoreException e) {
tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java (revision 1908)
669 669
		vBarLeft.addListener(SWT.Selection, new Listener() {
670 670
			@Override
671 671
			public void handleEvent(Event event) {
672
				if (Util.isWindows()) {
672
				if (Util.isLinux()) {
673
					vBarRight.setSelection(vBarLeft.getSelection());
674
				} else {
673 675
					viewerRight.getTable().setTopIndex(viewerLeft.getTable().getTopIndex());
674
				} else {
675
					vBarRight.setSelection(vBarLeft.getSelection());
676 676
				}
677 677
			}
678 678
		});
......
689 689
		vBarRight.addListener(SWT.Selection, new Listener() {
690 690
			@Override
691 691
			public void handleEvent(Event event) {
692
				if (Util.isWindows()) {
693
					viewerLeft.getTable().setTopIndex(viewerRight.getTable().getTopIndex());
692
				if (Util.isLinux()) {
693
					vBarLeft.setSelection(vBarRight.getSelection());
694 694
				} else {
695
					vBarLeft.setSelection(vBarRight.getSelection());
695
					viewerLeft.getTable().setTopIndex(viewerRight.getTable().getTopIndex());					
696 696
				}
697 697
			}
698 698
		});
tmp/org.txm.setups/BuildLinux64bit.sh (revision 1908)
15 15

  
16 16
# ensure postinst preinst ... rights
17 17
chmod 644 shared/debian/DEBIAN/templates &&
18
chmod 755 shared/debian/DEBIAN/config &&
19 18
chmod 755 shared/debian/DEBIAN/postinst &&
20 19
chmod 755 shared/debian/DEBIAN/postrm &&
21 20
chmod 755 shared/debian/DEBIAN/preinst &&
tmp/org.txm.setups/SUBVERSION (revision 1908)
1
b3
1
b4
tmp/org.txm.setups/shared/mac/Applications/TXM.app/Contents/MacOS/TXM (revision 1908)
18 18
echo "Creating all necessary directories"
19 19

  
20 20
TXMHOME="$HOME/TXM-$VERSION"
21
DOTTXMHOME="$HOME/.TXM-$VERSION"
21 22
echo "TXMHOME='$TXMHOME'"
22 23
if [ ! -d "$TXMHOME" ]; then
23 24
	mkdir "$TXMHOME"
......
28 29
	exit 1
29 30
fi
30 31

  
31
DIR="$TXMHOME/.txm"
32
echo "DIR='$DIR'"
33
if [ ! -d "$DIR" ]; then
34
	mkdir "$DIR"
32

  
33
echo "DOTTXMHOME='$DOTTXMHOME'"
34
if [ ! -d "$DOTTXMHOME" ]; then
35
	mkdir "$DOTTXMHOME"
35 36
fi
36
if [ ! -d "$DIR" ]; then
37
	zenity --info --text="TXM: Impossible to access '$DIR' directory. Aborting$LOGFILESMSG"
38
	echo "TXM: Impossible to access '$DIR' directory. Aborting$LOGFILESMSG"
37
if [ ! -d "$DOTTXMHOME" ]; then
38
	zenity --info --text="TXM: Impossible to access '$DOTTXMHOME' directory. Aborting$LOGFILESMSG"
39
	echo "TXM: Impossible to access '$DOTTXMHOME' directory. Aborting$LOGFILESMSG"
39 40
	exit 1
40 41
fi
41 42
LOGFILES=", see log files $HOME/TXMPostInstallLogs.txt and $HOME/TXMPostInstallErrorLogs.txt."
42 43

  
43
vercomp () {
44
    echo "test $1 $2"
45
    if [[ $1 == $2 ]]
46
    then
47
        return 0
48
    fi
49
    local IFS=.
50
    local i ver1=($1) ver2=($2)
51
    # fill empty fields in ver1 with zeros
52
    for ((i=${#ver1[@]}; i<${#ver2[@]}; i++))
53
    do
54
        ver1[i]=0
55
    done
56
    for ((i=0; i<${#ver1[@]}; i++))
57
    do
58
        if [[ -z ${ver2[i]} ]]
59
        then
60
            ver2[i]=0
61
        fi
62
        if ((10#${ver1[i]} > 10#${ver2[i]}))
63
        then
64
            return 0
65
        fi
66
        if ((10#${ver1[i]} < 10#${ver2[i]}))
67
        then
68
            return 1
69
        fi
70
    done
71
    return 0
72
}
44
echo "TXM: looking at the last TXM install date from the /Applications/TXM-TXMVERSION.app/STAMP file"
73 45

  
74

  
75
echo "TXM: looking at the last TXM install date from the /usr/lib/TXM/STAMP file"
76

  
77 46
if [ ! -f "/Applications/TXM-TXMVERSION.app/STAMP" ]; then
78 47
	echo "TXM: Impossible to access '/Applications/TXM-TXMVERSION.app/STAMP' file. Aborting$LOGFILESMSG"
79 48
	exit 1
......
87 56
fi
88 57

  
89 58
echo "TXM: if .txm folder does not contain the STAMP file, its a new install."
90
if [ ! -e "$TXMHOME/.txm/$STAMP" ]; then
59
if [ ! -e "$DOTTXMHOME/$STAMP" ]; then
91 60

  
92 61
	echo "New TXM install: it's the first launch after the installation"
93 62
	if [ -f "/tmp/org.txm.rcpapplication.prefs" ]; then
......
113 82
	fi
114 83

  
115 84
	echo "TXM: Installing up to date TXM directories."
116
	rm -rf "$TXMHOME/.txm"
117
	if [ -d "$TXMHOME/.txm" ]; then
118
	    echo "TXM: Failed to remove $TXMHOME/.txm directory$LOGFILESMSG"
85
	rm -rf "$DOTTXMHOME"
86
	if [ -d "$DOTTXMHOME" ]; then
87
	    echo "TXM: Failed to remove $DOTTXMHOME directory$LOGFILESMSG"
119 88
	    exit 1 ;
120 89
	fi
121 90

  
122
    mkdir "$TXMHOME/.txm"
123
	mkdir "$TXMHOME/.txm/user"
124
	mkdir "$TXMHOME/.txm/data"
91
    mkdir "$DOTTXMHOME"
92
	mkdir "$DOTTXMHOME/user"
93
	mkdir "$DOTTXMHOME/data"
125 94

  
126
    if [ ! -d "$TXMHOME/.txm" ]; then
127
		echo "TXM: Impossible to access '$TXMHOME/.txm' directory. Aborting$LOGFILESMSG"
95
    if [ ! -d "$DOTTXMHOME" ]; then
96
		echo "TXM: Impossible to access '$DOTTXMHOME' directory. Aborting$LOGFILESMSG"
128 97
		exit 1
129 98
    fi
130 99
    
......
135 104
	    exit 1 ;
136 105
	fi
137 106

  
138
    echo "TXM: getting '/Applications/TXM-TXMVERSION.app/TXM.ini' and set write permission of '$TXMHOME/.txm/TXM.ini'"
139
    cp "/Applications/TXM-TXMVERSION.app/Contents/TXM/TXM.ini" "$TXMHOME/.txm/TXM.ini" &&
140
    chmod +w "$TXMHOME/.txm/TXM.ini";
107
    echo "TXM: getting '/Applications/TXM-TXMVERSION.app/TXM.ini' and set write permission of '$DOTTXMHOME/TXM.ini'"
108
    cp "/Applications/TXM-TXMVERSION.app/Contents/TXM/TXM.ini" "$DOTTXMHOME/TXM.ini" &&
109
    chmod +w "$DOTTXMHOME/TXM.ini";
141 110
    
142 111
    if [ $? != 0 ]; then
143
       	echo "TXM: Can't launch TXM: failed to set TXM.ini file$LOGFILESMSG"
112
       	echo "TXM: Can't launch TXM: failed to copy TXM.ini file$LOGFILESMSG"
144 113
        exit 1
145 114
    fi
146 115

  
147
    echo "TXM: creating the $TXMHOME/.txm/$STAMP install STAMP file."
148
    touch "$TXMHOME/.txm/$STAMP"
116
    echo "TXM: creating the $DOTTXMHOME/$STAMP install STAMP file."
117
    touch "$DOTTXMHOME/$STAMP"
149 118

  
150 119
    if [ $? != 0 ]; then
151
		echo "TXM: Can't launch TXM: failed to create the $TXMHOME/.txm/$STAMP install STAMP file$LOGFILESMSG"
120
		echo "TXM: Can't launch TXM: failed to create the $DOTTXMHOME/$STAMP install STAMP file$LOGFILESMSG"
152 121
        exit 1
153 122
    fi
154 123
fi
......
174 143
	if [ $i == "-vmargs" ]; then
175 144
 	   STARTVMARGS=1
176 145
	fi
177
done < "$TXMHOME/.txm/TXM.ini"; 
146
done < "$DOTTXMHOME/TXM.ini"; 
178 147

  
179 148
echo "TXM INI ARGS = $TXMINIARGS"
180 149
echo "TXM INI VM ARGS = $TXMINIARGSVM"
181 150

  
182 151
OSVERSION=`sw_vers -productVersion`
183 152

  
184
vercomp $OSVERSION "10.7"
185

  
186
#if [ $? != 0 ];then
187
#	echo "TXM: Running TXM for Mac OS X $OSVERSION with the binary launcher..."
188
#	open "/Applications/TXM-TXMVERSION.app" --args -run --launcher.ini "$TXMHOME/.txm/TXM.ini" -data "$TXMHOME/.txm/data" -user "$TXMHOME/.txm/user" -install "/Applications/TXM-TXMVERSION.app" &
189
#else
190
	echo "TXM: Running TXM for Mac OS X $OSVERSION with the JAR launcher..."
191
	/Applications/TXM-TXMVERSION.app/Contents/TXM/jre/Contents/Home/bin/java -Djava.library.path="$(echo  /Applications/TXM-TXMVERSION.app/Contents/TXM/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_*/eclipse_*.so)" -XX:MaxPermSize=256m -XstartOnFirstThread $TXMINIARGSVM -jar "$(echo /Applications/TXM-TXMVERSION.app/Contents/TXM/plugins/org.eclipse.equinox.launcher_*.jar)" -os macosx -ws cocoa -arch x86_64 -consoleLog -showsplash -run -data "$TXMHOME/corpora" -user "$TXMHOME/.txm/user" -install "/Applications/TXM-TXMVERSION.app/Contents/TXM"
192
#fi
153
echo "TXM: Running TXM for Mac OS X $OSVERSION with the JAR launcher..."
154
/Applications/TXM-TXMVERSION.app/Contents/TXM/jre/Contents/Home/bin/java -Djava.library.path="$(echo  /Applications/TXM-TXMVERSION.app/Contents/TXM/plugins/org.eclipse.equinox.launcher.cocoa.macosx.x86_64_*/eclipse_*.so)" -XX:MaxPermSize=256m -XstartOnFirstThread $TXMINIARGSVM -jar "$(echo /Applications/TXM-TXMVERSION.app/Contents/TXM/plugins/org.eclipse.equinox.launcher_*.jar)" -os macosx -ws cocoa -arch x86_64 -consoleLog -showsplash -run --launcher.ini "$DOTTXMHOME/TXM.ini" -configuration "$DOTTXMHOME/configuration" -user "$DOTTXMHOME/user" -install "/Applications/TXM-TXMVERSION.app/Contents/TXM"
tmp/org.txm.setups/shared/debian/DEBIAN/config (revision 1908)
1
#!/bin/sh -e
2
# Source debconf library.
3
. /usr/share/debconf/confmodule
4

  
5
echo "START CONFIG 0:$0 1:$1 2:$2" >&2
6

  
7
db_title "TXM 0.8.0 installer"
8
db_input critical TXM/showinfos || true
9
db_go # shows questions
10
db_input critical TXM/showwelcome || true
11
db_go # shows questions
12
#db_input critical TXM/askr || true
13
#db_go # shows questions
14

  
15
db_stop
16
echo "END CONFIG" >&2
tmp/org.txm.setups/shared/debian/DEBIAN/postrm (revision 1908)
1 1
# Source debconf library.
2
. /usr/share/debconf/confmodule
2
#. /usr/share/debconf/confmodule
3 3

  
4 4
# Remove my changes to the db.
5
db_purge
5
#db_purge
tmp/org.txm.setups/shared/debian/usr/bin/TXM (revision 1908)
12 12

  
13 13
TXMINSTALL="/usr/lib/TXM${VERSION}"
14 14
TXMHOME="$HOME/TXM${VERSIONWITHOUTSUB}"
15
DOTTXMHOME="$TXMHOME/.txm"
15
DOTTXMHOME="$HOME/.TXM${VERSIONWITHOUTSUB}"
16 16

  
17 17
(
18 18
echo "TXM: $HOME is '$HOME'"
......
97 97
	fi
98 98
	
99 99
	echo "TXM: resetting RCP workspace."
100
	rm -rf "$TXMHOME/corpora/.metadata"
101
	if [ -d "$TXMHOME/corpora/.metadata" ]; then
102
	    zenity --info --text="TXM: Failed to remove $TXMHOME/corpora/.metadata"
103
	    echo "TXM: Failed to remove $TXMHOME/corpora/.metadata"
100
	rm -rf "$TXMHOME/.metadata"
101
	if [ -d "$TXMHOME/.metadata" ]; then
102
	    zenity --info --text="TXM: Failed to remove $TXMHOME/.metadata"
103
	    echo "TXM: Failed to remove $TXMHOME/.metadata"
104 104
	    exit 1 ;
105 105
	fi
106 106

  
107 107
    mkdir "$DOTTXMHOME"
108 108
    if [ ! -d "$DOTTXMHOME" ]; then
109
		echo "TXM: Impossible to access '$HOME/TXM/.txm' directory. Aborting$LOGFILESMSG"
109
		echo "TXM: Impossible to access '$DOTTXMHOME' directory. Aborting$LOGFILESMSG"
110 110
		exit 1
111 111
    fi
112 112
    
......
152 152
    exit 1 ;
153 153
fi
154 154

  
155
## uncomment next lien to enable full debug
155
## uncomment next line to enable full debug
156 156
#DEBUGOPTIONS="-log -clean -debug -console -noexit"
157 157

  
158
SWT_GTK3=0 UBUNTU_MENUPROXY=0 exec "${TXMINSTALL}/TXM" -consoleLog "$@" -run --launcher.ini "$DOTTXMHOME/TXM.ini" $DEBUGOPTIONS -data "$TXMHOME/corpora" -user "$DOTTXMHOME/user" -install "$TXMINSTALL"
158
SWT_GTK3=0 UBUNTU_MENUPROXY=0 exec "${TXMINSTALL}/TXM" -consoleLog "$@" -run --launcher.ini "$DOTTXMHOME/TXM.ini" $DEBUGOPTIONS -configuration "$DOTTXMHOME/configuration" -user "$DOTTXMHOME/user" -install "$TXMINSTALL"
tmp/org.txm.rcp/src/main/java/org/txm/rcp/ApplicationWorkbenchAdvisor.java (revision 1908)
236 236
							return Status.CANCEL_STATUS;
237 237
						}
238 238

  
239
						Log.info(TXMUIMessages.ready);
239 240
						monitor.done();
240 241
					} catch (Exception e) {
241 242
						System.out.println(TXMCoreMessages.bind(TXMUIMessages.errorWhileLoadingTXMColon, e));
......
751 752
		corporaDirs.add(V079);
752 753
		corporaDirs.add(OTHER);
753 754

  
755
		final ArrayList<Object> initialCorporaDirs = new ArrayList<Object>();
756
		corporaDirs.add(SAMPLES);
757
		corporaDirs.add(V080);
758
		corporaDirs.add(V079);
759

  
760
		
754 761
		Display.getDefault().syncExec(new Runnable() {
755 762
			@Override
756 763
			public void run() {
......
759 766
				ListSelectionDialog dialog = new ListSelectionDialog(shell, corporaDirs, 
760 767
						new ArrayContentProvider(), new LabelProvider(), TXMUIMessages.corporaWillBeRestoredInTheFollowingOrderCorporaAlreadyRestoredWillNotBeReplaced);
761 768
				dialog.setTitle(TXMUIMessages.selectThecorporaSetsToRestore);
762
				dialog.setInitialElementSelections(corporaDirs);
769
				dialog.setInitialElementSelections(initialCorporaDirs);
763 770
				if (dialog.open() == ListSelectionDialog.OK) {
764 771
					corporaDirs.clear();
765 772
					List<Object> selection = Arrays.asList(dialog.getResult());
......
938 945

  
939 946
									monitor.setTaskName("Initializing Toolbox (engines and corpora)...");
940 947
									if (Toolbox.initialize(TBXPreferences.class, monitor)) {
941
										StatusLine.setMessage(TXMUIMessages.ready);
948
										//StatusLine.setMessage(TXMUIMessages.ready);
942 949
									}
943 950
									else {
944 951
										StatusLine.setMessage(TXMUIMessages.startupFailedPleaseCheckTXMPreferencesInTheFileSupPreferencesMenuOrContactTxmusersMailingListMenuColonHelpSup);
......
979 986
					// remove some preference pages
980 987
					setPreferencesConfiguration(); 
981 988

  
989
					
990
					
982 991
				}
983 992
				catch(Exception e) {
984 993
					Log.severe(TXMCoreMessages.bind("Error during UI initialization: {0}.", e.getLocalizedMessage()));
tmp/org.txm.rcp/src/main/java/org/txm/rcp/Application.java (revision 1908)
281 281
					//TBXPreferences.getInstance().put(RCPPreferences.CGU, true);
282 282

  
283 283
					// check choosen path
284
					String path = launchData.getSelection();
285
					if (path != null) { // reset the letadata file
286
						File metadataFile = new File(path, ".metadata");
287
						File metadataFilePrevious = new File(path, ".metadata-previous");
288
						metadataFilePrevious.delete();
289
						metadataFile.renameTo(metadataFilePrevious);
290
					}
284 291
					Integer ret2 = setInstanceLocation(launchData);
285 292
					if (ret2 != -1) {
286 293
						return ret2;

Also available in: Unified diff