From 7e208e33021b40a47732140662450cbb1b390c7e Mon Sep 17 00:00:00 2001 From: Bill Winslow Date: Wed, 23 Jul 2014 05:00:55 -0500 Subject: [PATCH] updated bootstrap.sh so I don't have to not-add it and other minutiae --- bootstrap.sh | 67 ++++++++++++++++++++++++++-------- widget/filetransfertwidget.cpp | 4 +- 2 files changed, 54 insertions(+), 17 deletions(-) diff --git a/bootstrap.sh b/bootstrap.sh index cc25129f8..4114f26db 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -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 diff --git a/widget/filetransfertwidget.cpp b/widget/filetransfertwidget.cpp index 568ce93a2..e90d8b2d0 100644 --- a/widget/filetransfertwidget.cpp +++ b/widget/filetransfertwidget.cpp @@ -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")); } }