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'
# if this script gets the parameter -t or --tox
TOX_ONLY=false
GLOBAL=false
KEEP=false
if [ -z "$BASE_DIR" ]; then
echo "internal error detected!"
@ -41,9 +43,16 @@ fi
########## check input parameters ##########
if [ $# -ge 1 ] ; then
while [ $# -ge 1 ] ; do
if [ ${1} = "-t" -o ${1} = "--tox" ] ; then
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
if [ ${1} != "-h" -a ${1} != "--help" ] ; then
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 ""
echo "usage:"
echo " ${0} [-t|--tox|-h|--help]"
echo " ${0} [-t|--tox|-h|--help|-g|--global|-k|--keep]"
echo ""
echo "parameters:"
echo " -h|--help: displays this help"
echo " -t|--tox : only install/update libtoxcore"
echo " requires an already installed libsodium"
echo " -h|--help : displays this help"
echo " -t|--tox : only install/update libtoxcore"
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 "example usages:"
echo " ${0} -- to install libsodium and libtoxcore"
echo " ${0} -t -- to update already installed libtoxcore"
exit 1
fi
fi
done
echo "Tox only: $TOX_ONLY"
echo "Global : $GLOBAL"
echo "Keep : $KEEP"
############### prepare step ###############
# create BASE_DIR directory if necessary
@ -91,9 +105,21 @@ if [[ $TOX_ONLY = "false" ]]; then
pushd ${BASE_DIR}/${SODIUM_DIR}
git checkout tags/0.5.0
./autogen.sh
./configure --prefix=${BASE_DIR}/
if [[ $GLOBAL = "false" ]]; then
./configure --prefix=${BASE_DIR}/
else
./configure
fi
make -j2 check
make install
if [[ $GLOBAL = "false" ]]; then
make install
else
sudo make install
fi
popd
fi
@ -103,14 +129,25 @@ fi
git clone https://github.com/irungentoo/toxcore.git ${BASE_DIR}/${TOX_CORE_DIR}
pushd ${BASE_DIR}/${TOX_CORE_DIR}
./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 install
if [[ $GLOBAL = "false" ]]; then
make install
else
sudo make install
fi
popd
############### cleanup step ###############
# remove cloned repositories
rm -rf ${BASE_DIR}/${SODIUM_DIR}
rm -rf ${BASE_DIR}/${TOX_CORE_DIR}
if [[ $KEEP = "false" ]]; then
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;
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())
return;
else
@ -297,7 +297,7 @@ void FileTransfertWidget::acceptRecvRequest()
if (isWritable(path))
break;
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"));
}
}