1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Merge pull request #161 from dubslow/master

two minutiae, one of which is an updated bootstrap that's more useful to me
This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2014-07-24 02:28:54 +02:00
commit fdfe799886
2 changed files with 54 additions and 17 deletions

View File

@ -19,6 +19,8 @@ TOX_CORE_DIR=libtoxcore-latest
# the default value is 'false' and will be set to 'true' # the default value is 'false' and will be set to 'true'
# if this script gets the parameter -t or --tox # if this script gets the parameter -t or --tox
TOX_ONLY=false TOX_ONLY=false
GLOBAL=false
KEEP=false
if [ -z "$BASE_DIR" ]; then if [ -z "$BASE_DIR" ]; then
echo "internal error detected!" echo "internal error detected!"
@ -41,9 +43,16 @@ fi
########## check input parameters ########## ########## check input parameters ##########
if [ $# -ge 1 ] ; then while [ $# -ge 1 ] ; do
if [ ${1} = "-t" -o ${1} = "--tox" ] ; then if [ ${1} = "-t" -o ${1} = "--tox" ] ; then
TOX_ONLY=true TOX_ONLY=true
shift
elif [ ${1} = "-g" -o ${1} = "--global" ] ; then
GLOBAL=true
shift
elif [ ${1} = "-k" -o ${1} = "--keep" ]; then
KEEP=true
shift
else else
if [ ${1} != "-h" -a ${1} != "--help" ] ; then if [ ${1} != "-h" -a ${1} != "--help" ] ; then
echo "[ERROR] Unknown parameter \"${1}\"" echo "[ERROR] Unknown parameter \"${1}\""
@ -54,21 +63,26 @@ if [ $# -ge 1 ] ; then
echo "Use this script to install/update libsodium and libtoxcore in ${INSTALL_DIR}" echo "Use this script to install/update libsodium and libtoxcore in ${INSTALL_DIR}"
echo "" echo ""
echo "usage:" echo "usage:"
echo " ${0} [-t|--tox|-h|--help]" echo " ${0} [-t|--tox|-h|--help|-g|--global|-k|--keep]"
echo "" echo ""
echo "parameters:" echo "parameters:"
echo " -h|--help: displays this help" echo " -h|--help : displays this help"
echo " -t|--tox : only install/update libtoxcore" echo " -t|--tox : only install/update libtoxcore"
echo " requires an already installed libsodium" echo " requires an already installed libsodium"
echo " -g|--global: installs libtox* and libsodium globally"
echo " (also disables local configure prefixes)"
echo " -k|--keep : does not delete the build directories afterwards"
echo "" echo ""
echo "example usages:" echo "example usages:"
echo " ${0} -- to install libsodium and libtoxcore" echo " ${0} -- to install libsodium and libtoxcore"
echo " ${0} -t -- to update already installed libtoxcore" echo " ${0} -t -- to update already installed libtoxcore"
exit 1 exit 1
fi fi
fi done
echo "Tox only: $TOX_ONLY"
echo "Global : $GLOBAL"
echo "Keep : $KEEP"
############### prepare step ############### ############### prepare step ###############
# create BASE_DIR directory if necessary # create BASE_DIR directory if necessary
@ -91,9 +105,21 @@ if [[ $TOX_ONLY = "false" ]]; then
pushd ${BASE_DIR}/${SODIUM_DIR} pushd ${BASE_DIR}/${SODIUM_DIR}
git checkout tags/0.5.0 git checkout tags/0.5.0
./autogen.sh ./autogen.sh
if [[ $GLOBAL = "false" ]]; then
./configure --prefix=${BASE_DIR}/ ./configure --prefix=${BASE_DIR}/
else
./configure
fi
make -j2 check make -j2 check
if [[ $GLOBAL = "false" ]]; then
make install make install
else
sudo make install
fi
popd popd
fi fi
@ -103,14 +129,25 @@ fi
git clone https://github.com/irungentoo/toxcore.git ${BASE_DIR}/${TOX_CORE_DIR} git clone https://github.com/irungentoo/toxcore.git ${BASE_DIR}/${TOX_CORE_DIR}
pushd ${BASE_DIR}/${TOX_CORE_DIR} pushd ${BASE_DIR}/${TOX_CORE_DIR}
./autogen.sh ./autogen.sh
./configure --prefix=${BASE_DIR}/ --with-libsodium-headers=${BASE_DIR}/include --with-libsodium-libs=${BASE_DIR}/lib if [[ $GLOBAL = "false" ]]; then
./configure --prefix=${BASE_DIR}/ --with-libsodium-headers=${BASE_DIR}/include --with-libsodium-libs=${BASE_DIR}/lib
else
./configure
fi
make -j2 make -j2
make install
if [[ $GLOBAL = "false" ]]; then
make install
else
sudo make install
fi
popd popd
############### cleanup step ############### ############### cleanup step ###############
# remove cloned repositories # remove cloned repositories
rm -rf ${BASE_DIR}/${SODIUM_DIR} if [[ $KEEP = "false" ]]; then
rm -rf ${BASE_DIR}/${TOX_CORE_DIR} rm -rf ${BASE_DIR}/${SODIUM_DIR}
rm -rf ${BASE_DIR}/${TOX_CORE_DIR}
fi

View File

@ -286,7 +286,7 @@ void FileTransfertWidget::acceptRecvRequest()
QString path; QString path;
while (true) while (true)
{ {
path = QFileDialog::getSaveFileName(0,tr("Save a file","Title of the file saving dialog"),QDir::currentPath()+'/'+filename->text()); path = QFileDialog::getSaveFileName(this,tr("Save a file","Title of the file saving dialog"),QDir::currentPath()+'/'+filename->text());
if (path.isEmpty()) if (path.isEmpty())
return; return;
else else
@ -297,7 +297,7 @@ void FileTransfertWidget::acceptRecvRequest()
if (isWritable(path)) if (isWritable(path))
break; break;
else else
QMessageBox::warning(0, tr("Location not writable","Title of permissions popup"), tr("You do not have permission to write that location. Choose another, or cancel the save dialog.", "text of permissions popup")); QMessageBox::warning(this, tr("Location not writable","Title of permissions popup"), tr("You do not have permission to write that location. Choose another, or cancel the save dialog.", "text of permissions popup"));
} }
} }