|
|
|
@ -1,8 +1,75 @@
|
|
|
|
|
Index: mimeedit.sh
|
|
|
|
|
===================================================================
|
|
|
|
|
--- mimeedit.sh (revision 1958)
|
|
|
|
|
--- mimeedit.sh (revision 1962)
|
|
|
|
|
+++ mimeedit.sh (working copy)
|
|
|
|
|
@@ -342,6 +342,7 @@
|
|
|
|
|
@@ -63,11 +63,13 @@
|
|
|
|
|
# Build a list with registered apps for this mimetype.
|
|
|
|
|
#
|
|
|
|
|
function deflist (){
|
|
|
|
|
- if [ -e "$UTMP.avail" ]; then cleanup;fi
|
|
|
|
|
+ TMP_AVAIL="`mktemp /tmp/gnome-commander.XXXXXX`"
|
|
|
|
|
+ TMP_CHOSEN="`mktemp /tmp/gnome-commander.XXXXXX`"
|
|
|
|
|
+ # if [ -e "$UTMP.avail" ]; then cleanup;fi
|
|
|
|
|
# Create the list in "$UTMP.avail" to be used by the zenity list-box
|
|
|
|
|
if [ "$NONEW" == 1 ]
|
|
|
|
|
then
|
|
|
|
|
- echo "FALSE Add_New_App New" > "$UTMP.avail"
|
|
|
|
|
+ echo "FALSE Add_New_App New" > $TMP_AVAIL
|
|
|
|
|
fi
|
|
|
|
|
# Get all sub-mimetypes, one per row.
|
|
|
|
|
SUB="$(grep -hs "^$MTPE" $SUBC $G_CACHE $U_CACHE | awk -F= '{print $1}' | sed 's/ /\n/g')"
|
|
|
|
|
@@ -77,14 +79,14 @@
|
|
|
|
|
then
|
|
|
|
|
for i in $(echo "$MTPEs" | sort -u); do
|
|
|
|
|
echo "FALSE $i $(grep -hs "^Name=" $GDATA_DIR/$i $DATA_DIR/$i | \
|
|
|
|
|
- sed 's/Name=//;s/ /_/g')" >> "$UTMP.avail"
|
|
|
|
|
+ sed 's/Name=//;s/ /_/g')" >> $TMP_AVAIL
|
|
|
|
|
done
|
|
|
|
|
fi
|
|
|
|
|
# Change FALSE to TRUE for the default app.
|
|
|
|
|
- if grep -q "desktop" "$UTMP.avail"
|
|
|
|
|
+ if grep -q "desktop" $TMP_AVAIL
|
|
|
|
|
then
|
|
|
|
|
DEF_APP=$(gnomevfs-info -s "$ARGU" | grep "Default app" | sed 's/.*: //')
|
|
|
|
|
- sed -i "s|FALSE $DEF_APP|TRUE $DEF_APP|" "$UTMP.avail"
|
|
|
|
|
+ sed -i "s|FALSE $DEF_APP|TRUE $DEF_APP|" $TMP_AVAIL
|
|
|
|
|
fi
|
|
|
|
|
# Show the list
|
|
|
|
|
zenity --height="350" --width="550" --list --radiolist --text \
|
|
|
|
|
@@ -99,17 +101,17 @@
|
|
|
|
|
|
|
|
|
|
Please select" \
|
|
|
|
|
--column "Pick" --column ".desktop file" --column "Application" \
|
|
|
|
|
- $(cat "$UTMP.avail") > "$UTMP.chosen"
|
|
|
|
|
+ $(cat $TMP_AVAIL ) > $TMP_CHOSEN
|
|
|
|
|
retval=$?
|
|
|
|
|
- choice=$(cat "$UTMP.chosen")
|
|
|
|
|
+ choice=$(cat $TMP_CHOSEN )
|
|
|
|
|
if grep -q "$MTPE=$choice" $U_DEF
|
|
|
|
|
then
|
|
|
|
|
retval=2
|
|
|
|
|
fi
|
|
|
|
|
case $retval in
|
|
|
|
|
0)
|
|
|
|
|
- DEF_CH=$(grep -s "$choice" "$UTMP.avail" | awk '{print $2}')
|
|
|
|
|
- DEF_NME=$(grep -s "$choice" "$UTMP.avail" | awk '{print $3}')
|
|
|
|
|
+ DEF_CH=$(grep -s "$choice" $TMP_AVAIL | awk '{print $2}')
|
|
|
|
|
+ DEF_NME=$(grep -s "$choice" $TMP_AVAIL | awk '{print $3}')
|
|
|
|
|
if [ "$DEF_CH" = Add_New_App ]
|
|
|
|
|
then
|
|
|
|
|
newmime
|
|
|
|
|
@@ -305,8 +307,8 @@
|
|
|
|
|
# Remove tempfiles.
|
|
|
|
|
#
|
|
|
|
|
function cleanup (){
|
|
|
|
|
- rm -f "$UTMP.avail"
|
|
|
|
|
- rm -f "$UTMP.chosen"
|
|
|
|
|
+ rm -f $TMP_AVAIL
|
|
|
|
|
+ rm -f $TMP_CHOSEN
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
@@ -342,6 +344,7 @@
|
|
|
|
|
# The .desktop file editor
|
|
|
|
|
#
|
|
|
|
|
function dtfedit (){
|
|
|
|
@ -10,7 +77,7 @@ Index: mimeedit.sh
|
|
|
|
|
USER_DTF="$DT_FILE-$EXT"
|
|
|
|
|
if [ -n "$DT_FILE" ]
|
|
|
|
|
then
|
|
|
|
|
@@ -350,15 +351,22 @@
|
|
|
|
|
@@ -350,15 +353,22 @@
|
|
|
|
|
then
|
|
|
|
|
TO_EDIT="$DATA_DIR/$USER_DTF"
|
|
|
|
|
else
|
|
|
|
|