diff --git a/.codecov.yml b/.codecov.yml index 628a7617868..aa664c10245 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -17,7 +17,7 @@ comment: require_changes: yes # if true: only post the comment if coverage changes require_base: no # [yes :: must have a base report to post] require_head: yes # [yes :: must have a head report to post] - branches: + branches: - master after_n_builds: 3 diff --git a/.github/workflows/snap.yml b/.github/workflows/snap.yml index c70ccd00001..b3d1d135dfe 100644 --- a/.github/workflows/snap.yml +++ b/.github/workflows/snap.yml @@ -9,7 +9,7 @@ on: schedule: - cron: '10 12 * * 0' -concurrency: +concurrency: group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} cancel-in-progress: true @@ -47,7 +47,7 @@ jobs: if: ${{ success() && (env.AWS_ACCESS_KEY_ID == 0 || env.AWS_SECRET_ACCESS_KEY == 0) }} run: | echo "VCPKG_BINARY_SOURCES=clear;x-aws-config,no-sign-request;x-aws,s3://vcpkg.cache.boinc/,read" >> $GITHUB_ENV - + - name: Configure docker qemu if: success() uses: docker/setup-qemu-action@v2 @@ -105,7 +105,7 @@ jobs: path: deploy/logs.7z - name: Prepare artifacts for deploy - if: success() + if: success() run: python ./deploy/prepare_deployment.py linux_snap - name: Upload artifacts diff --git a/.github/workflows/source-code-check.yml b/.github/workflows/source-code-check.yml index 5f1277f6d69..b04f9f02a85 100644 --- a/.github/workflows/source-code-check.yml +++ b/.github/workflows/source-code-check.yml @@ -27,3 +27,7 @@ jobs: if: ${{ success() }} run: | python ./ci_tools/source_code_check.py . + - name: Check source code for trailing whitespaces + if: ${{ success() }} + run: | + python ./ci_tools/trailing_whitespaces_check.py . diff --git a/3rdParty/vcpkg_ports/configs/client/vcpkg.json b/3rdParty/vcpkg_ports/configs/client/vcpkg.json index a7827dfbb20..cd0ce00ddb6 100644 --- a/3rdParty/vcpkg_ports/configs/client/vcpkg.json +++ b/3rdParty/vcpkg_ports/configs/client/vcpkg.json @@ -7,5 +7,5 @@ "features": ["openssl"], "default-features": false } - ] + ] } diff --git a/3rdParty/vcpkg_ports/configs/client/wasm/vcpkg.json b/3rdParty/vcpkg_ports/configs/client/wasm/vcpkg.json index 8e96173cdea..c101fb1fa7e 100644 --- a/3rdParty/vcpkg_ports/configs/client/wasm/vcpkg.json +++ b/3rdParty/vcpkg_ports/configs/client/wasm/vcpkg.json @@ -8,5 +8,5 @@ "default-features": false }, "rappture" - ] + ] } diff --git a/3rdParty/vcpkg_ports/configs/libs/vcpkg.json b/3rdParty/vcpkg_ports/configs/libs/vcpkg.json index d4a2f4423e8..28dbe2ed8ed 100644 --- a/3rdParty/vcpkg_ports/configs/libs/vcpkg.json +++ b/3rdParty/vcpkg_ports/configs/libs/vcpkg.json @@ -7,5 +7,5 @@ "features": ["openssl"], "default-features": false } - ] + ] } diff --git a/3rdParty/vcpkg_ports/configs/libs/windows/vcpkg.json b/3rdParty/vcpkg_ports/configs/libs/windows/vcpkg.json index 820d665e302..ce7a4afe9f6 100644 --- a/3rdParty/vcpkg_ports/configs/libs/windows/vcpkg.json +++ b/3rdParty/vcpkg_ports/configs/libs/windows/vcpkg.json @@ -8,5 +8,5 @@ "default-features": false }, "openssl" - ] + ] } diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index be5bd941644..8371ba06bc6 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -27,5 +27,5 @@ Social and technical disagreements should not be left to fester, leaving others Don't forget that it is human to err and that blaming each other isn't productive. Instead, focus on helping to resolve issues and learning from mistakes. Participants in the project should try to resolve disagreements constructively. When it is impossible to reach an agreement, follow the [process outlined in the Governance document](https://github.com/BOINC/boinc-policy/blob/master/Governance.md#5-decision-processes) to come to a solution. -We also adhere to the Github community guidelines, please see https://help.github.com/articles/github-community-guidelines/ +We also adhere to the Github community guidelines, please see https://help.github.com/articles/github-community-guidelines/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 86ef3e8b41d..d5b2d7dda6d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -16,13 +16,13 @@ Want to connect with contributors? * The BOINC Contributor call occurs every other week and is announced on the [BOINC Development email list](https://groups.google.com/a/ssl.berkeley.edu/forum/#!forum/boinc_dev) ### Promote Volunteer Computing -Want to help promote volunteer computing and work on ways to attract new users? Join the #communications channel on [Slack](https://join.slack.com/t/boincworkspace/shared_invite/enQtNzA3MTQ4NDA0Njc4LTM4NTEyZTY1MWEwZjAyNTVmOTg3NDA2NjVjZDQzMWQ3NmFjYTc4MTNkNTEyNjRkOTQ4MWU5Nzk3NzRhNTg0NDI) +Want to help promote volunteer computing and work on ways to attract new users? Join the #communications channel on [Slack](https://join.slack.com/t/boincworkspace/shared_invite/enQtNzA3MTQ4NDA0Njc4LTM4NTEyZTY1MWEwZjAyNTVmOTg3NDA2NjVjZDQzMWQ3NmFjYTc4MTNkNTEyNjRkOTQ4MWU5Nzk3NzRhNTg0NDI) ### Help Translate See: https://boinc.berkeley.edu/trac/wiki/TranslateIntro ### Help Test -You can help new versions of the client. +You can help new versions of the client. * Become an [Alpha Tester](https://boinc.berkeley.edu/trac/wiki/AlphaInstructions) * Signup to be a [BOINC Android Tester](https://groups.google.com/forum/#!forum/boinc-android-testing) diff --git a/COPYING.LESSER b/COPYING.LESSER index fc8a5de7edf..cca7fc278f5 100644 --- a/COPYING.LESSER +++ b/COPYING.LESSER @@ -10,7 +10,7 @@ the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. - 0. Additional Definitions. + 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU @@ -111,7 +111,7 @@ the following: a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked - Version. + Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the diff --git a/Makefile.incl b/Makefile.incl index 0b593708ac3..7ac132ba6c6 100644 --- a/Makefile.incl +++ b/Makefile.incl @@ -31,7 +31,7 @@ AM_CPPFLAGS = \ -I$(top_srcdir)/vda \ $(PTHREAD_CFLAGS) -AM_CFLAGS = -Wall -Wextra -Wshadow -Wredundant-decls -Wdisabled-optimization -Wpointer-arith -Wstrict-aliasing -Wcast-align +AM_CFLAGS = -Wall -Wextra -Wshadow -Wredundant-decls -Wdisabled-optimization -Wpointer-arith -Wstrict-aliasing -Wcast-align AM_CXXFLAGS = $(AM_CFLAGS) diff --git a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/AccountIn.aidl b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/AccountIn.aidl index 47ff85901f2..a76cf1875ca 100644 --- a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/AccountIn.aidl +++ b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/AccountIn.aidl @@ -2,20 +2,20 @@ * This file is part of BOINC. * http://boinc.berkeley.edu * Copyright (C) 2012 University of California - * + * * BOINC is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. - * + * * BOINC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with BOINC. If not, see . ******************************************************************************/ package edu.berkeley.boinc.rpc; -parcelable AccountIn; \ No newline at end of file +parcelable AccountIn; diff --git a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/AccountManager.aidl b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/AccountManager.aidl index 30bc43ee95f..20ebfe7648e 100644 --- a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/AccountManager.aidl +++ b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/AccountManager.aidl @@ -2,20 +2,20 @@ * This file is part of BOINC. * http://boinc.berkeley.edu * Copyright (C) 2012 University of California - * + * * BOINC is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. - * + * * BOINC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with BOINC. If not, see . ******************************************************************************/ package edu.berkeley.boinc.rpc; -parcelable AccountManager; \ No newline at end of file +parcelable AccountManager; diff --git a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/AccountOut.aidl b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/AccountOut.aidl index 0d0a8efa1dd..f440afd5a26 100644 --- a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/AccountOut.aidl +++ b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/AccountOut.aidl @@ -2,20 +2,20 @@ * This file is part of BOINC. * http://boinc.berkeley.edu * Copyright (C) 2012 University of California - * + * * BOINC is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. - * + * * BOINC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with BOINC. If not, see . ******************************************************************************/ package edu.berkeley.boinc.rpc; -parcelable AccountOut; \ No newline at end of file +parcelable AccountOut; diff --git a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/AcctMgrInfo.aidl b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/AcctMgrInfo.aidl index c80631f750d..ac7edd93a13 100644 --- a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/AcctMgrInfo.aidl +++ b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/AcctMgrInfo.aidl @@ -2,20 +2,20 @@ * This file is part of BOINC. * http://boinc.berkeley.edu * Copyright (C) 2012 University of California - * + * * BOINC is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. - * + * * BOINC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with BOINC. If not, see . ******************************************************************************/ package edu.berkeley.boinc.rpc; -parcelable AcctMgrInfo; \ No newline at end of file +parcelable AcctMgrInfo; diff --git a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/GlobalPreferences.aidl b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/GlobalPreferences.aidl index 4d95e4c10ad..aa8961797b4 100644 --- a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/GlobalPreferences.aidl +++ b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/GlobalPreferences.aidl @@ -2,20 +2,20 @@ * This file is part of BOINC. * http://boinc.berkeley.edu * Copyright (C) 2012 University of California - * + * * BOINC is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. - * + * * BOINC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with BOINC. If not, see . ******************************************************************************/ package edu.berkeley.boinc.rpc; -parcelable GlobalPreferences; \ No newline at end of file +parcelable GlobalPreferences; diff --git a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/HostInfo.aidl b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/HostInfo.aidl index b5504247a2b..67ba1a86ec0 100644 --- a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/HostInfo.aidl +++ b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/HostInfo.aidl @@ -2,20 +2,20 @@ * This file is part of BOINC. * http://boinc.berkeley.edu * Copyright (C) 2012 University of California - * + * * BOINC is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. - * + * * BOINC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with BOINC. If not, see . ******************************************************************************/ package edu.berkeley.boinc.rpc; -parcelable HostInfo; \ No newline at end of file +parcelable HostInfo; diff --git a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/ImageWrapper.aidl b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/ImageWrapper.aidl index 71e52b353d8..31451fda06c 100644 --- a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/ImageWrapper.aidl +++ b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/ImageWrapper.aidl @@ -2,20 +2,20 @@ * This file is part of BOINC. * http://boinc.berkeley.edu * Copyright (C) 2012 University of California - * + * * BOINC is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. - * + * * BOINC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with BOINC. If not, see . ******************************************************************************/ package edu.berkeley.boinc.rpc; -parcelable ImageWrapper; \ No newline at end of file +parcelable ImageWrapper; diff --git a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/Message.aidl b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/Message.aidl index d643b00ad37..8f28509f768 100644 --- a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/Message.aidl +++ b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/Message.aidl @@ -2,20 +2,20 @@ * This file is part of BOINC. * http://boinc.berkeley.edu * Copyright (C) 2012 University of California - * + * * BOINC is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. - * + * * BOINC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with BOINC. If not, see . ******************************************************************************/ package edu.berkeley.boinc.rpc; -parcelable Message; \ No newline at end of file +parcelable Message; diff --git a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/Notice.aidl b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/Notice.aidl index 76435d87b97..a5e12c4a209 100644 --- a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/Notice.aidl +++ b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/Notice.aidl @@ -2,20 +2,20 @@ * This file is part of BOINC. * http://boinc.berkeley.edu * Copyright (C) 2012 University of California - * + * * BOINC is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. - * + * * BOINC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with BOINC. If not, see . ******************************************************************************/ package edu.berkeley.boinc.rpc; -parcelable Notice; \ No newline at end of file +parcelable Notice; diff --git a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/Project.aidl b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/Project.aidl index 3daf21f3900..8509d5afb68 100644 --- a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/Project.aidl +++ b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/Project.aidl @@ -2,20 +2,20 @@ * This file is part of BOINC. * http://boinc.berkeley.edu * Copyright (C) 2012 University of California - * + * * BOINC is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. - * + * * BOINC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with BOINC. If not, see . ******************************************************************************/ package edu.berkeley.boinc.rpc; -parcelable Project; \ No newline at end of file +parcelable Project; diff --git a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/ProjectConfig.aidl b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/ProjectConfig.aidl index 454111307cb..b7d9ab44b06 100644 --- a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/ProjectConfig.aidl +++ b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/ProjectConfig.aidl @@ -2,20 +2,20 @@ * This file is part of BOINC. * http://boinc.berkeley.edu * Copyright (C) 2012 University of California - * + * * BOINC is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. - * + * * BOINC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with BOINC. If not, see . ******************************************************************************/ package edu.berkeley.boinc.rpc; -parcelable ProjectConfig; \ No newline at end of file +parcelable ProjectConfig; diff --git a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/ProjectInfo.aidl b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/ProjectInfo.aidl index cf6b95a0078..1171f36e1e6 100644 --- a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/ProjectInfo.aidl +++ b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/ProjectInfo.aidl @@ -2,20 +2,20 @@ * This file is part of BOINC. * http://boinc.berkeley.edu * Copyright (C) 2012 University of California - * + * * BOINC is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. - * + * * BOINC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with BOINC. If not, see . ******************************************************************************/ package edu.berkeley.boinc.rpc; -parcelable ProjectInfo; \ No newline at end of file +parcelable ProjectInfo; diff --git a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/Result.aidl b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/Result.aidl index b729566d54e..a2d9cdb175c 100644 --- a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/Result.aidl +++ b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/Result.aidl @@ -2,20 +2,20 @@ * This file is part of BOINC. * http://boinc.berkeley.edu * Copyright (C) 2012 University of California - * + * * BOINC is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. - * + * * BOINC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with BOINC. If not, see . ******************************************************************************/ package edu.berkeley.boinc.rpc; -parcelable Result; \ No newline at end of file +parcelable Result; diff --git a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/Transfer.aidl b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/Transfer.aidl index 4654e41853d..8eee7cb2d23 100644 --- a/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/Transfer.aidl +++ b/android/BOINC/app/src/main/aidl/edu/berkeley/boinc/rpc/Transfer.aidl @@ -2,20 +2,20 @@ * This file is part of BOINC. * http://boinc.berkeley.edu * Copyright (C) 2012 University of California - * + * * BOINC is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. - * + * * BOINC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with BOINC. If not, see . ******************************************************************************/ package edu.berkeley.boinc.rpc; -parcelable Transfer; \ No newline at end of file +parcelable Transfer; diff --git a/android/BOINC/app/src/main/java/edu/berkeley/boinc/attach/AttachAccountManagerActivity.kt b/android/BOINC/app/src/main/java/edu/berkeley/boinc/attach/AttachAccountManagerActivity.kt index a63d76ba561..aa76e377734 100644 --- a/android/BOINC/app/src/main/java/edu/berkeley/boinc/attach/AttachAccountManagerActivity.kt +++ b/android/BOINC/app/src/main/java/edu/berkeley/boinc/attach/AttachAccountManagerActivity.kt @@ -234,7 +234,7 @@ class AttachAccountManagerActivity : AppCompatActivity() { // This should not happen monitor = null mIsBound = false - + Logging.logError(Logging.Category.GUI_ACTIVITY, "AttachAccountManagerActivity onServiceDisconnected") } } diff --git a/android/BOINC/app/src/main/java/edu/berkeley/boinc/attach/ManualUrlInputFragment.java b/android/BOINC/app/src/main/java/edu/berkeley/boinc/attach/ManualUrlInputFragment.java index 3b059a606ce..57da19389fa 100644 --- a/android/BOINC/app/src/main/java/edu/berkeley/boinc/attach/ManualUrlInputFragment.java +++ b/android/BOINC/app/src/main/java/edu/berkeley/boinc/attach/ManualUrlInputFragment.java @@ -95,7 +95,7 @@ private boolean checkDeviceOnline() { if(!online) { Toast toast = Toast.makeText(getActivity(), R.string.attachproject_list_no_internet, Toast.LENGTH_SHORT); toast.show(); - + Logging.logDebug(Logging.Category.GUI_ACTIVITY, "ManualUrlInputFragment not online, stop!"); } return online; diff --git a/android/BOINC/app/src/main/java/edu/berkeley/boinc/client/ClientInterfaceImplementation.java b/android/BOINC/app/src/main/java/edu/berkeley/boinc/client/ClientInterfaceImplementation.java index 429d5337a34..20fc5e953f9 100644 --- a/android/BOINC/app/src/main/java/edu/berkeley/boinc/client/ClientInterfaceImplementation.java +++ b/android/BOINC/app/src/main/java/edu/berkeley/boinc/client/ClientInterfaceImplementation.java @@ -560,7 +560,7 @@ boolean setDomainName(String deviceName) { boolean success = setDomainNameRpc(deviceName); Logging.logDebug(Logging.Category.CLIENT, "setDomainName: success " + success); - + return success; } diff --git a/android/BOINC/app/src/main/java/edu/berkeley/boinc/client/NoticeNotification.kt b/android/BOINC/app/src/main/java/edu/berkeley/boinc/client/NoticeNotification.kt index 719b0da0827..f74e831c18c 100644 --- a/android/BOINC/app/src/main/java/edu/berkeley/boinc/client/NoticeNotification.kt +++ b/android/BOINC/app/src/main/java/edu/berkeley/boinc/client/NoticeNotification.kt @@ -2,17 +2,17 @@ This file is part of BOINC. https://boinc.berkeley.edu Copyright (C) 2022 University of California - + BOINC is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + BOINC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with BOINC. If not, see . **/ diff --git a/android/BOINC/app/src/main/java/edu/berkeley/boinc/rpc/AccountManagerParser.kt b/android/BOINC/app/src/main/java/edu/berkeley/boinc/rpc/AccountManagerParser.kt index 475dd404676..795c3a2aa04 100644 --- a/android/BOINC/app/src/main/java/edu/berkeley/boinc/rpc/AccountManagerParser.kt +++ b/android/BOINC/app/src/main/java/edu/berkeley/boinc/rpc/AccountManagerParser.kt @@ -2,17 +2,17 @@ * This file is part of BOINC. * http://boinc.berkeley.edu * Copyright (C) 2021 University of California - * + * * BOINC is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. - * + * * BOINC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with BOINC. If not, see . */ diff --git a/android/BOINC/app/src/main/java/edu/berkeley/boinc/rpc/AccountOutParser.kt b/android/BOINC/app/src/main/java/edu/berkeley/boinc/rpc/AccountOutParser.kt index ebe271b3067..ce79c3cc557 100644 --- a/android/BOINC/app/src/main/java/edu/berkeley/boinc/rpc/AccountOutParser.kt +++ b/android/BOINC/app/src/main/java/edu/berkeley/boinc/rpc/AccountOutParser.kt @@ -81,7 +81,7 @@ class AccountOutParser : BaseParser() { } catch (e: SAXException) { Logging.logException(Logging.Category.RPC, "AccountOutParser: malformed XML ", e) Logging.logDebug(Logging.Category.XML, "AccountOutParser: $rpcResult") - + null } } diff --git a/android/BOINC/app/src/main/java/edu/berkeley/boinc/rpc/SimpleReplyParser.kt b/android/BOINC/app/src/main/java/edu/berkeley/boinc/rpc/SimpleReplyParser.kt index 2991f4a911f..38192a04196 100644 --- a/android/BOINC/app/src/main/java/edu/berkeley/boinc/rpc/SimpleReplyParser.kt +++ b/android/BOINC/app/src/main/java/edu/berkeley/boinc/rpc/SimpleReplyParser.kt @@ -81,7 +81,7 @@ class SimpleReplyParser : BaseParser() { } catch (e: SAXException) { Logging.logException(Logging.Category.RPC, "SimpleReplyParser: malformed XML ", e) Logging.logDebug(Logging.Category.XML, "SimpleReplyParser: $reply") - + null } } diff --git a/android/BOINC/app/src/main/java/edu/berkeley/boinc/ui/eventlog/EventLogClientFragment.kt b/android/BOINC/app/src/main/java/edu/berkeley/boinc/ui/eventlog/EventLogClientFragment.kt index f69a1af2f26..830e59fb5e0 100644 --- a/android/BOINC/app/src/main/java/edu/berkeley/boinc/ui/eventlog/EventLogClientFragment.kt +++ b/android/BOINC/app/src/main/java/edu/berkeley/boinc/ui/eventlog/EventLogClientFragment.kt @@ -112,7 +112,7 @@ class EventLogClientFragment : Fragment() { // message retrieval // amount messages loaded when end of list is reached val pastMsgsLoadingRange = 50 - + Logging.logDebug(Logging.Category.CLIENT, "calling monitor with: " + pastSeqNo + " / " + pastMsgsLoadingRange) diff --git a/android/BOINC/app/src/test/java/edu/berkeley/boinc/adapter/ProjectListEntryTest.kt b/android/BOINC/app/src/test/java/edu/berkeley/boinc/adapter/ProjectListEntryTest.kt index 7c7ef27863f..949ef5d720d 100644 --- a/android/BOINC/app/src/test/java/edu/berkeley/boinc/adapter/ProjectListEntryTest.kt +++ b/android/BOINC/app/src/test/java/edu/berkeley/boinc/adapter/ProjectListEntryTest.kt @@ -26,11 +26,11 @@ class ProjectListEntryTest { @Test fun `Check that ProjectInfo is saved when passed to constructor`() { - val projectInfo = ProjectInfo("ProjectName", "https://testproject.com", - "Mathematics", "Combinatorics", - "Test Project Description", + val projectInfo = ProjectInfo("ProjectName", "https://testproject.com", + "Mathematics", "Combinatorics", + "Test Project Description", "Home Sweet Home", listOf("windows"), - "https://testproject.com/favicon.png", + "https://testproject.com/favicon.png", "Test Summary of the Project") val projectListEntry = ProjectListEntry(projectInfo) diff --git a/android/ProjectApp/AndroidManifest.xml b/android/ProjectApp/AndroidManifest.xml index 1719a5f89cc..0c6211462f8 100644 --- a/android/ProjectApp/AndroidManifest.xml +++ b/android/ProjectApp/AndroidManifest.xml @@ -3,17 +3,17 @@ This file is part of BOINC. http://boinc.berkeley.edu Copyright (C) 2012 University of California - + BOINC is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + BOINC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with BOINC. If not, see . --> @@ -49,4 +49,4 @@ - \ No newline at end of file + diff --git a/android/ProjectApp/res/values/client_configuration.xml b/android/ProjectApp/res/values/client_configuration.xml index 22dd5e0243a..6ebd911f4e0 100644 --- a/android/ProjectApp/res/values/client_configuration.xml +++ b/android/ProjectApp/res/values/client_configuration.xml @@ -3,17 +3,17 @@ This file is part of BOINC. http://boinc.berkeley.edu Copyright (C) 2012 University of California - + BOINC is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + BOINC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with BOINC. If not, see . --> @@ -25,4 +25,4 @@ edu.berkeley.boinc.client.ClientRemoteService edu.berkeley.boinc.BOINCActivity - \ No newline at end of file + diff --git a/android/ProjectApp/res/values/configuration.xml b/android/ProjectApp/res/values/configuration.xml index c2bd072249a..1903ba976a3 100644 --- a/android/ProjectApp/res/values/configuration.xml +++ b/android/ProjectApp/res/values/configuration.xml @@ -3,17 +3,17 @@ This file is part of BOINC. http://boinc.berkeley.edu Copyright (C) 2012 University of California - + BOINC is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - + BOINC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. - + You should have received a copy of the GNU Lesser General Public License along with BOINC. If not, see . --> @@ -21,12 +21,12 @@ BOINC Test Project http://isaac.ssl.berkeley.edu/test/ - + BOINC Project App com.example.project.serviceupdate 5000 - + com.example.project.serviceupdate - \ No newline at end of file + diff --git a/android/ProjectApp/src/com/example/projectapp/BoincInteractionService.java b/android/ProjectApp/src/com/example/projectapp/BoincInteractionService.java index d9d69a27f59..0efd0da7ae9 100644 --- a/android/ProjectApp/src/com/example/projectapp/BoincInteractionService.java +++ b/android/ProjectApp/src/com/example/projectapp/BoincInteractionService.java @@ -2,17 +2,17 @@ * This file is part of BOINC. * http://boinc.berkeley.edu * Copyright (C) 2012 University of California - * + * * BOINC is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. - * + * * BOINC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with BOINC. If not, see . ******************************************************************************/ @@ -45,9 +45,9 @@ public class BoincInteractionService extends Service { private final String TAG = "BoincInteractionService"; - + public Integer boincStatus = BoincStatus.INITIALIZING; //TODO could be replaced by sticky broadcasts??! - + //IClientRemoteService attributes private IClientRemoteService mIClientRemoteService; private Boolean mClientRemoteServiceIsBound = false; @@ -80,16 +80,16 @@ public BoincInteractionService getService() { return BoincInteractionService.this; } } - + // service lifecycle methods @Override public void onCreate() { Log.d(TAG,"onCreate()"); - + //start of setup routine checkBoincClientAvailable(); } - + @Override public void onDestroy() { Log.d(TAG, "onDestroy"); @@ -103,14 +103,14 @@ public void onDestroy() { public IBinder onBind(Intent intent) { return mBinder; } - + private void bindClientRemoteService () { publishAndDispatch(BoincStatus.BINDING_BOINC_CLIENT_REMOTE_SERVICE); Intent i = new Intent(); - i.setClassName(getResources().getString(R.string.client_android_package_name), getResources().getString(R.string.client_remote_service_name)); + i.setClassName(getResources().getString(R.string.client_android_package_name), getResources().getString(R.string.client_remote_service_name)); bindService(i, mClientRemoteServiceConnection, BIND_AUTO_CREATE); } - + private void unbindClientRemoteService() { if(mClientRemoteServiceIsBound) { unbindService(mClientRemoteServiceConnection); @@ -118,15 +118,15 @@ private void unbindClientRemoteService() { mIClientRemoteService = null; } } - + private void checkBoincClientAvailable() { - (new CheckBoincClientAvailable()).execute(); //asynchronous call. + (new CheckBoincClientAvailable()).execute(); //asynchronous call. } - + public void downloadAndInstallClient() { - (new DownloadAndInstallClientApp()).execute(); //asynchronous call. + (new DownloadAndInstallClientApp()).execute(); //asynchronous call. } - + private void tryClientRemoteServiceInterface() { publishAndDispatch(BoincStatus.TRYING_CRS_INTERFACE); //busy waiting until interface returns true @@ -150,7 +150,7 @@ private void tryClientRemoteServiceInterface() { publishAndDispatch(BoincStatus.CRS_INTERFACE_TIMEOUT); } } - + private void checkProjectAttached() { //TODO publishAndDispatch(BoincStatus.PROJECT_ATTACHED); @@ -166,7 +166,7 @@ private void checkProjectAttached() { publishAndDispatch(BoincStatus.PROJECT_NOT_ATTACHED); }*/ } - + private void openBoincApp() { Intent i = new Intent(); i.setClassName(getResources().getString(R.string.client_android_package_name),getResources().getString(R.string.client_main_activity_name)); @@ -175,7 +175,7 @@ private void openBoincApp() { i.putExtra("project_name", getResources().getString(R.string.project_name)); startActivity(i); } - + private final class CheckBoincClientAvailable extends AsyncTask { private final String TAG = "CheckBoincClientAvailable"; @@ -184,11 +184,11 @@ private final class CheckBoincClientAvailable extends AsyncTask { //TODO download official Client app from PlayStore //TODO remove write external storage permission if not needed anymore private final String TAG = "DownloadAndInstallClientApp"; - + @Override protected void onPreExecute() { publishAndDispatch(BoincStatus.INSTALLING_BOINC); } - + @Override protected Boolean doInBackground(Void... params) { Log.d(TAG+"-doInBackground", "installing Client..."); try{ if(Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) { //checking whether SD card is present - + //downloading apk URL url = new URL(getResources().getString(R.string.client_download_url)); HttpURLConnection c = (HttpURLConnection) url.openConnection(); c.setRequestMethod("GET"); c.setDoOutput(true); c.connect(); - File tmpDir = new File(Environment.getExternalStorageDirectory(),"/boinc_download/"); + File tmpDir = new File(Environment.getExternalStorageDirectory(),"/boinc_download/"); tmpDir.mkdirs(); File app = new File(tmpDir,"boinc_client.apk"); FileOutputStream fos = new FileOutputStream(app); @@ -251,18 +251,18 @@ protected Boolean doInBackground(Void... params) { } fos.close(); is.close(); - + //register receiver for successful install IntentFilter mIntentFilter = new IntentFilter(); mIntentFilter.addAction(Intent.ACTION_PACKAGE_ADDED); mIntentFilter.addDataScheme("package"); registerReceiver(clientInstalledReceiver, mIntentFilter); - + //installation in new activity Intent intent = new Intent(Intent.ACTION_VIEW); intent.setDataAndType(Uri.fromFile(app), "application/vnd.android.package-archive"); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - startActivity(intent); + startActivity(intent); } else{ Log.d(TAG, "getExternalStorageState() does not return MEDIA_MOUNTED"); return false; @@ -273,9 +273,9 @@ protected Boolean doInBackground(Void... params) { } BroadcastReceiver clientInstalledReceiver = new BroadcastReceiver() { - + private final String TAG = "clientInstalledReceiver"; - + @Override public void onReceive(Context context, Intent intent) { Log.d(TAG,"onReceive"); @@ -288,20 +288,20 @@ public void onReceive(Context context, Intent intent) { publishAndDispatch(BoincStatus.BOINC_INSTALLED); } } - } + } }; - + private void publishAndDispatch(Integer status) { Log.d(TAG,"publishAndDispatch with status: " + status); - + //write in variable, to allow status pulling boincStatus = status; - + //send broadcast for activities to update layout Intent i = new Intent(getResources().getString(R.string.bis_broadcast_name)); i.putExtra("status", status); sendBroadcast(i); - + //dispatch next task: switch(status) { case BoincStatus.CHECKING_BOINC_AVAILABLILITY: diff --git a/android/ProjectApp/src/com/example/projectapp/BoincStatus.java b/android/ProjectApp/src/com/example/projectapp/BoincStatus.java index d8f1bb76039..687d0bded38 100644 --- a/android/ProjectApp/src/com/example/projectapp/BoincStatus.java +++ b/android/ProjectApp/src/com/example/projectapp/BoincStatus.java @@ -2,22 +2,22 @@ public class BoincStatus { public static final int INITIALIZING = 0; //default - + public static final int CHECKING_BOINC_AVAILABLILITY = 1; public static final int BOINC_AVAILABLE = 11; public static final int BOINC_NOT_AVAILABLE = 12; - + public static final int INSTALLING_BOINC = 2; public static final int BOINC_INSTALLED = 21; - + public static final int BINDING_BOINC_CLIENT_REMOTE_SERVICE = 3; public static final int CRS_BOUND = 31; public static final int CRS_BINDING_FAILED = 32; - + public static final int TRYING_CRS_INTERFACE = 4; public static final int CRS_INTERFACE_READY = 41; public static final int CRS_INTERFACE_TIMEOUT = 42; - + public static final int ATTACHING_PROJECT = 5; public static final int CHECKING_PROJECT_ATTACHED = 50; public static final int PROJECT_ATTACHED = 51; diff --git a/android/ProjectApp/src/com/example/projectapp/ProjectExampleMainActivity.java b/android/ProjectApp/src/com/example/projectapp/ProjectExampleMainActivity.java index f09f32d9a11..4778722db8a 100644 --- a/android/ProjectApp/src/com/example/projectapp/ProjectExampleMainActivity.java +++ b/android/ProjectApp/src/com/example/projectapp/ProjectExampleMainActivity.java @@ -2,17 +2,17 @@ * This file is part of BOINC. * http://boinc.berkeley.edu * Copyright (C) 2012 University of California - * + * * BOINC is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. - * + * * BOINC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with BOINC. If not, see . ******************************************************************************/ @@ -38,16 +38,16 @@ public class ProjectExampleMainActivity extends Activity implements OnClickListener{ private final String TAG = "MainActivity"; - + private BoincInteractionService bis; private Boolean mIsBound; - + private BroadcastReceiver bisUpdateReceiver; @Override protected void onCreate(Bundle savedInstanceState) { Log.d(TAG, "onCreate"); - + bisUpdateReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { @@ -55,11 +55,11 @@ public void onReceive(Context context, Intent intent) { } }; registerReceiver(bisUpdateReceiver, new IntentFilter(getResources().getString(R.string.bis_broadcast_name))); - + super.onCreate(savedInstanceState); - + layout(BoincStatus.INITIALIZING); //default - + bindBoincInteractionService(); } @@ -69,7 +69,7 @@ public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.activity_main, menu); return true; } - + @Override protected void onDestroy() { Log.d(TAG, "onDestroy"); @@ -94,13 +94,13 @@ public void onServiceDisconnected(ComponentName className) { Toast.makeText(getApplicationContext(), "service disconnected", Toast.LENGTH_SHORT).show(); } }; - + private void bindBoincInteractionService() { // Establish a connection with the service, onServiceConnected gets called when finished. Intent i = new Intent(this,BoincInteractionService.class); bindService(i, mBoincInteractionServiceConnection, Context.BIND_AUTO_CREATE); } - + private void unbindBoincInteractionService() { if (mIsBound) { // Detach existing connection. @@ -109,7 +109,7 @@ private void unbindBoincInteractionService() { mIsBound = false; } } - + private void layout(Integer boincStatus) { Log.d(TAG,"layout boincStatus: " + boincStatus); switch(boincStatus){ @@ -155,7 +155,7 @@ public void onClick(View v) { bis.downloadAndInstallClient(); } } - + } } diff --git a/android/ProjectApp/src/edu/berkeley/boinc/client/IClientRemoteService.aidl b/android/ProjectApp/src/edu/berkeley/boinc/client/IClientRemoteService.aidl index 50ab5a0c008..d83f8f79f92 100644 --- a/android/ProjectApp/src/edu/berkeley/boinc/client/IClientRemoteService.aidl +++ b/android/ProjectApp/src/edu/berkeley/boinc/client/IClientRemoteService.aidl @@ -2,17 +2,17 @@ * This file is part of BOINC. * http://boinc.berkeley.edu * Copyright (C) 2012 University of California - * + * * BOINC is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. - * + * * BOINC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with BOINC. If not, see . ******************************************************************************/ @@ -33,7 +33,7 @@ interface IClientRemoteService { /* Checks whether interface recipient is ready to serve commands. * returns success*/ boolean isReady(); - + /* Returns the version code specified in AndroidManifest.xml. * can be used to detect new AIDL versions. * returns version code as Integer*/ @@ -47,12 +47,12 @@ interface IClientRemoteService { * pwd: project login password in plain text. Password gets encrypted by BOINC before transmitted over the internet. * returns success*/ boolean attachProject(in String packageName, in String url, in String id, in String authenticator); - + /* Check whether given project URL is attached to BOINC * url: project URL * returns success*/ boolean checkProjectAttached(in String url); - + /* Verifies given credentials to project account * url: project URL * id: project login identifier, i.e. email address @@ -61,13 +61,13 @@ interface IClientRemoteService { * returns AccountOut object including status code (0:verified, -206:pwd incorrect, -136:id unknown, * -113:internet connection error) status message and authenticator required by attachProject*/ AccountOut verifyCredentials(in String url, in String id, in String pwd); - + /* Detaches given project from BOINC application. * packageName: package name of Android application causing this detach * url: project URL * returns success*/ boolean detachProject(in String packageName, in String url); - + /* Creates new account at specified project URL * url: project URL * email: email address @@ -77,10 +77,10 @@ interface IClientRemoteService { * * returns AccountOut object including status code, status message and authenticator required by attachProject*/ AccountOut createAccount(in String url, in String email, in String userName, in String pwd, in String teamName); - + //== authentication == /* Retrieval the web-RPC authentication token, required to open a socket connection to the BOINC Client directly. - * please make sure, you attached all required projects using this interface! + * please make sure, you attached all required projects using this interface! * returns token, null if error*/ String getRpcAuthToken(); } diff --git a/android/ProjectApp/src/edu/berkeley/boinc/rpc/AccountOut.java b/android/ProjectApp/src/edu/berkeley/boinc/rpc/AccountOut.java index 9193d2a64b5..99a3681c753 100644 --- a/android/ProjectApp/src/edu/berkeley/boinc/rpc/AccountOut.java +++ b/android/ProjectApp/src/edu/berkeley/boinc/rpc/AccountOut.java @@ -2,17 +2,17 @@ * This file is part of BOINC. * http://boinc.berkeley.edu * Copyright (C) 2012 University of California - * + * * BOINC is free software; you can redistribute it and/or modify it * under the terms of the GNU Lesser General Public License * as published by the Free Software Foundation, * either version 3 of the License, or (at your option) any later version. - * + * * BOINC is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. * See the GNU Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public License * along with BOINC. If not, see . ******************************************************************************/ @@ -25,7 +25,7 @@ public class AccountOut implements Parcelable { public int error_num = 0; public String error_msg = ""; public String authenticator = ""; - + public static final Parcelable.Creator CREATOR = new Parcelable.Creator() { public AccountOut createFromParcel(Parcel in) { return new AccountOut(in); diff --git a/android/Vagrantfile b/android/Vagrantfile index 1e162d7eae4..aa0d729f3fe 100644 --- a/android/Vagrantfile +++ b/android/Vagrantfile @@ -39,7 +39,7 @@ Vagrant.configure("2") do |config| # argument is a set of non-required options. # config.vm.synced_folder "../data", "/vagrant_data" config.vm.synced_folder ".", "/vagrant_data", disabled: true - + # Provider-specific configuration so you can fine-tune various # backing providers for Vagrant. These expose provider-specific options. # Example for VirtualBox: @@ -80,8 +80,8 @@ Vagrant.configure("2") do |config| # Customize the amount of memory on the VM: hv.memory = "4096" - - # Enable virtualization extensions for the virtual CPUs. + + # Enable virtualization extensions for the virtual CPUs. hv.enable_virtualization_extensions = true hv.vm_integration_services = { diff --git a/android/WSL.README.md b/android/WSL.README.md index 113fddc07de..2cc200afa9e 100644 --- a/android/WSL.README.md +++ b/android/WSL.README.md @@ -46,7 +46,7 @@ We are going to use Ubuntu 20.04 as an example, other versions should be similar ===== BOINC for all platforms build done ===== If you ever had problem at this point, try `git clean -fxd ..` and run again - + While waiting please do another repository cloning at Android Studio. ## Android Studio diff --git a/android/build_boinc_arm.sh b/android/build_boinc_arm.sh index a6490befb52..9e41cc7ac77 100755 --- a/android/build_boinc_arm.sh +++ b/android/build_boinc_arm.sh @@ -60,7 +60,7 @@ fi if [ -n "$COMPILEBOINC" ]; then cd "$BOINC" - echo "===== building BOINC for arm from $PWD =====" + echo "===== building BOINC for arm from $PWD =====" if [ -n "$MAKECLEAN" ] && [ -f "Makefile" ]; then if [ "$VERBOSE" = "no" ]; then make distclean 1>$STDOUT_TARGET 2>&1 diff --git a/android/build_boinc_arm64.sh b/android/build_boinc_arm64.sh index b47a5f8b04f..9327e26be7f 100755 --- a/android/build_boinc_arm64.sh +++ b/android/build_boinc_arm64.sh @@ -58,7 +58,7 @@ fi if [ -n "$COMPILEBOINC" ]; then cd "$BOINC" - echo "===== building BOINC for arm64 from $PWD =====" + echo "===== building BOINC for arm64 from $PWD =====" if [ -n "$MAKECLEAN" ] && [ -f "Makefile" ]; then if [ "$VERBOSE" = "no" ]; then make distclean 1>$STDOUT_TARGET 2>&1 diff --git a/android/build_boinc_x86.sh b/android/build_boinc_x86.sh index 094f7292579..2613da7ed1b 100755 --- a/android/build_boinc_x86.sh +++ b/android/build_boinc_x86.sh @@ -57,7 +57,7 @@ fi if [ -n "$COMPILEBOINC" ]; then cd "$BOINC" - echo "===== building BOINC for x86 from $PWD =====" + echo "===== building BOINC for x86 from $PWD =====" if [ -n "$MAKECLEAN" ] && [ -f "Makefile" ]; then if [ "$VERBOSE" = "no" ]; then make distclean 1>$STDOUT_TARGET 2>&1 diff --git a/android/build_boinc_x86_64.sh b/android/build_boinc_x86_64.sh index 34811351a9a..529eb757d0a 100755 --- a/android/build_boinc_x86_64.sh +++ b/android/build_boinc_x86_64.sh @@ -58,7 +58,7 @@ fi if [ -n "$COMPILEBOINC" ]; then cd "$BOINC" - echo "===== building BOINC for x86-64 from $PWD =====" + echo "===== building BOINC for x86-64 from $PWD =====" if [ -n "$MAKECLEAN" ] && [ -f "Makefile" ]; then if [ "$VERBOSE" = "no" ]; then make distclean 1>$STDOUT_TARGET 2>&1 diff --git a/android/build_example_arm64.sh b/android/build_example_arm64.sh index b3981d94816..82543af6afe 100755 --- a/android/build_example_arm64.sh +++ b/android/build_example_arm64.sh @@ -61,7 +61,7 @@ else fi if [ -n "$COMPILEBOINC" ]; then - cd $BOINC + cd $BOINC echo "===== building example for arm64 from $PWD =====" if [ -n "$MAKECLEAN" ] && [ -f "Makefile" ]; then echo "=== building example clean ===" diff --git a/android/build_libraries_arm64.sh b/android/build_libraries_arm64.sh index 72a1fd20550..362e2e9f20e 100755 --- a/android/build_libraries_arm64.sh +++ b/android/build_libraries_arm64.sh @@ -76,7 +76,7 @@ if [ -n "$COMPILEBOINC" ]; then make $MAKE_FLAGS make stage $MAKE_FLAGS make install $MAKE_FLAGS - + echo "\e[1;32m===== building BOINC Libraries for arm64 done =====\e[0m" fi diff --git a/android/build_libraries_armv6.sh b/android/build_libraries_armv6.sh index d7d3695a71a..bc8d1a780c0 100755 --- a/android/build_libraries_armv6.sh +++ b/android/build_libraries_armv6.sh @@ -77,7 +77,7 @@ if [ -n "$COMPILEBOINC" ]; then make $MAKE_FLAGS make stage $MAKE_FLAGS make install $MAKE_FLAGS - + echo "\e[1;32m===== building BOINC Libraries for armv6 done =====\e[0m" fi diff --git a/android/build_libraries_x86.sh b/android/build_libraries_x86.sh index c8241b7ea5e..2ba05e8e385 100755 --- a/android/build_libraries_x86.sh +++ b/android/build_libraries_x86.sh @@ -76,7 +76,7 @@ if [ -n "$COMPILEBOINC" ]; then make $MAKE_FLAGS make stage $MAKE_FLAGS make install $MAKE_FLAGS - + echo "\e[1;32m===== building BOINC Libraries for x86 done =====\e[0m" fi diff --git a/android/build_libraries_x86_64.sh b/android/build_libraries_x86_64.sh index 5899e76555d..063fd18e184 100755 --- a/android/build_libraries_x86_64.sh +++ b/android/build_libraries_x86_64.sh @@ -76,7 +76,7 @@ if [ -n "$COMPILEBOINC" ]; then make $MAKE_FLAGS make stage $MAKE_FLAGS make install $MAKE_FLAGS - + echo "\e[1;32m===== building BOINC Libraries for x86-64 done =====\e[0m" fi diff --git a/android/ci_build_libs_cmake.sh b/android/ci_build_libs_cmake.sh index 8c1df7f3ae7..ed498c1bfb1 100755 --- a/android/ci_build_libs_cmake.sh +++ b/android/ci_build_libs_cmake.sh @@ -28,7 +28,7 @@ TRIPLETS_LIST="armv6-android arm-android arm-neon-android arm64-android x86-andr for TRIPLET in $TRIPLETS_LIST ; do echo "\e[0;35m building $TRIPLET ... \e[0m" - + if [ "$TRIPLET" = "armv6-android" ]; then export ANDROID_NDK_HOME=$NDK_ARMV6_ROOT else diff --git a/android/ci_build_vcpkg_manager.sh b/android/ci_build_vcpkg_manager.sh index 16c3cdb03dc..dbc55277d48 100755 --- a/android/ci_build_vcpkg_manager.sh +++ b/android/ci_build_vcpkg_manager.sh @@ -15,7 +15,7 @@ fi android/ci_build_vcpkg_client.sh -cd android/BOINC +cd android/BOINC echo '===== BOINC Manager build start =====' diff --git a/api/Makefile.am b/api/Makefile.am index 342e034343d..6d13d3dc396 100644 --- a/api/Makefile.am +++ b/api/Makefile.am @@ -16,14 +16,14 @@ graphics2_files = \ gutil.cpp \ gutil_text.cpp \ reduce_lib.cpp \ - graphics2.cpp + graphics2.cpp if OS_WIN32 graphics2_files += graphics2_win.cpp \ $(top_srcdir)/samples/image_libs/bmplib.cpp \ $(top_srcdir)/samples/image_libs/tgalib.cpp else - graphics2_files += graphics2_unix.cpp + graphics2_files += graphics2_unix.cpp endif if OS_DARWIN diff --git a/api/boinc_api.h b/api/boinc_api.h index c4387d6e5cb..3924bad1bfc 100644 --- a/api/boinc_api.h +++ b/api/boinc_api.h @@ -123,7 +123,7 @@ extern int setMacIcon(char *filename, char *iconData, long iconSize); } // extern "C" { #endif -// C++ API follows +// C++ API follows #ifdef __cplusplus #include diff --git a/api/boinc_api_fortran.cpp b/api/boinc_api_fortran.cpp index 44284e4bdee..3cd58726185 100644 --- a/api/boinc_api_fortran.cpp +++ b/api/boinc_api_fortran.cpp @@ -138,7 +138,7 @@ void boinc_zip_(int* zipmode, const char* zipfile, zipfileff.strip_whitespace(); pathff.strip_whitespace(); boinc_zip(*zipmode,zipfileff.c_str(),pathff.c_str()); -} +} #endif } // extern "C" diff --git a/api/boinc_opencl.cpp b/api/boinc_opencl.cpp index f31b73d0948..8ce90476b76 100644 --- a/api/boinc_opencl.cpp +++ b/api/boinc_opencl.cpp @@ -17,7 +17,7 @@ // BOINC API for OpenCL // -// To get the cl_device_id and cl_platform_id for the OpenCL GPU +// To get the cl_device_id and cl_platform_id for the OpenCL GPU // assigned to your application call this function: // int boinc_get_opencl_ids(int argc, char** argv, char *type, cl_device_id* device, cl_platform_id* platform); // @@ -48,8 +48,8 @@ static int compareBOINCVersionTo(int toMajor, int toMinor, int toRelease); // In all systems, opencl_device_indexes start at 0 for each platform // and device_nums start at 0 for each vendor. // -// On Macs, OpenCL does not always recognize all GPU models detected by -// CUDA, so a device_num may not correspond to its opencl_device_index +// On Macs, OpenCL does not always recognize all GPU models detected by +// CUDA, so a device_num may not correspond to its opencl_device_index // even if all GPUs are from NVIDIA. // int get_vendor(cl_device_id device_id, char* vendor, int len) { @@ -60,13 +60,13 @@ int get_vendor(cl_device_id device_id, char* vendor, int len) { ); if (retval != CL_SUCCESS) return retval; if (!strlen(vendor)) return CL_INVALID_DEVICE_TYPE; - + if ((strstr(vendor, "AMD")) || (strstr(vendor, "Advanced Micro Devices, Inc.")) ) { strlcpy(vendor, GPU_TYPE_ATI, len); // "ATI" } - + if (strcasestr(vendor, "nvidia")) { strlcpy(vendor, GPU_TYPE_NVIDIA, len); // "NVIDIA" } @@ -99,7 +99,7 @@ int boinc_get_opencl_ids_aux( retval = clGetPlatformIDs(MAX_OPENCL_PLATFORMS, platforms, &num_platforms); if (num_platforms == 0) return CL_DEVICE_NOT_FOUND; if (retval != CL_SUCCESS) return retval; - + for (platform_index=0; platform_index= 0) { // gpu_opencl_dev_index was added in BOINC version 7.0.12. @@ -212,7 +212,7 @@ int boinc_get_opencl_ids( aid.gpu_opencl_dev_index, aid.major_version, aid.minor_version, aid.release); return CL_INVALID_DEVICE; } - + // Older versions of init_data.xml don't have the gpu_opencl_dev_index // field so use the value of gpu_device_num if available. gpu_device_num = aid.gpu_device_num; @@ -228,7 +228,7 @@ int boinc_get_opencl_ids( } } } - + if (gpu_device_num < 0) { // BOINC client apparently did not assign a GPU to this task. fprintf(stderr, "Illegal value for gpu_device_num: %d in BOINC Client %d.%d.%d\n", @@ -264,12 +264,12 @@ int boinc_get_opencl_ids(cl_device_id* device, cl_platform_id* platform) { retval = boinc_parse_init_data_file(); if (retval) return retval; boinc_get_init_data(aid); - + if (!strlen(aid.gpu_type)) { fprintf(stderr, "GPU type not found in %s\n", INIT_DATA_FILE); return CL_INVALID_DEVICE_TYPE; } - + if (aid.gpu_opencl_dev_index < 0) { if (compareBOINCVersionTo(7,0,12) >= 0) { // gpu_opencl_dev_index was added in BOINC version 7.0.12. @@ -279,7 +279,7 @@ int boinc_get_opencl_ids(cl_device_id* device, cl_platform_id* platform) { aid.gpu_opencl_dev_index, aid.major_version, aid.minor_version, aid.release); return CL_INVALID_DEVICE; } - + if (aid.gpu_device_num < 0) { if (compareBOINCVersionTo(6,13,3) >= 0) { // gpu_device_num and gpu_type fields were added in BOINC version 6.13.3. @@ -301,7 +301,7 @@ int boinc_get_opencl_ids(cl_device_id* device, cl_platform_id* platform) { static int compareBOINCVersionTo(int toMajor, int toMinor, int toRelease) { APP_INIT_DATA aid; - + boinc_get_init_data(aid); if (aid.major_version < toMajor) return -1; diff --git a/api/boinc_opencl.h b/api/boinc_opencl.h index 7f744614b68..57d74c6a1f0 100644 --- a/api/boinc_opencl.h +++ b/api/boinc_opencl.h @@ -17,7 +17,7 @@ // BOINC API for OpenCL apps -// Get the cl_device_id and cl_platform_id for the OpenCL GPU +// Get the cl_device_id and cl_platform_id for the OpenCL GPU // assigned to your job. // // NOTE: Compile and link this function with your application; diff --git a/api/graphics2.cpp b/api/graphics2.cpp index 13d78eb82f9..965d963207c 100644 --- a/api/graphics2.cpp +++ b/api/graphics2.cpp @@ -83,7 +83,7 @@ bool throttled_app_render(int x, int y, double t) { if (boinc_max_gfx_cpu_frac) { boinc_calling_thread_cpu_time(t0); } - + app_graphics_render(x, y, t); #ifdef __APPLE__ diff --git a/api/graphics2_unix.cpp b/api/graphics2_unix.cpp index 4d60585834d..e500bad3940 100644 --- a/api/graphics2_unix.cpp +++ b/api/graphics2_unix.cpp @@ -19,10 +19,10 @@ // #include "config.h" #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include #include "x_opengl.h" @@ -112,7 +112,7 @@ void mouse_click_move(int x, int y){ static void maybe_render() { int new_xpos, new_ypos, new_width, new_height; static int size_changed = 0; - + new_xpos = glutGet(GLUT_WINDOW_X); new_ypos = glutGet(GLUT_WINDOW_Y); new_width = glutGet(GLUT_WINDOW_WIDTH); @@ -127,9 +127,9 @@ static void maybe_render() { #endif glutSwapBuffers(); if (! fullscreen) { - // If user has changed window size, wait until it stops + // If user has changed window size, wait until it stops // changing and then write the new dimensions to file - if ((new_xpos != xpos) || (new_ypos != ypos) || + if ((new_xpos != xpos) || (new_ypos != ypos) || (new_width != width) || (new_height != height) ) { size_changed = 1; @@ -151,7 +151,7 @@ static void maybe_render() { fclose(f); } } - } // End if (new size != previous size) else + } // End if (new size != previous size) else } // End if (! fullscreen) #ifdef __APPLE__ MacGLUTFix(fullscreen); @@ -171,22 +171,22 @@ static void make_window(const char* title) { get_window_title(window_title, 256); } - win = glutCreateWindow(window_title); + win = glutCreateWindow(window_title); glutReshapeFunc(app_graphics_resize); glutKeyboardFunc(keyboardD); glutKeyboardUpFunc(keyboardU); glutMouseFunc(mouse_click); glutMotionFunc(mouse_click_move); - glutDisplayFunc(maybe_render); + glutDisplayFunc(maybe_render); glEnable(GL_DEPTH_TEST); app_graphics_init(); - + #ifdef __APPLE__ glutWMCloseFunc(boinc_close_window_and_quit_aux); // Enable the window's close box BringAppToFront(); // Show window only after a successful call to throttled_app_render(); - // this avoids momentary display of old image when screensaver restarts + // this avoids momentary display of old image when screensaver restarts // which made image appear to "jump." need_show = true; #endif @@ -210,9 +210,9 @@ static void boinc_glut_init(int *argc, char** argv) { } glutInit (argc, argv); - glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_ALPHA); + glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH | GLUT_ALPHA); glutInitWindowPosition(xpos, ypos); - glutInitWindowSize(width, height); + glutInitWindowSize(width, height); } static void timer_handler(int) { @@ -248,7 +248,7 @@ void boinc_graphics_loop(int argc, char** argv, const char* title) { } boinc_glut_init(&argc, argv); make_window(title); - glutTimerFunc(TIMER_INTERVAL_MSEC, timer_handler, 0); + glutTimerFunc(TIMER_INTERVAL_MSEC, timer_handler, 0); #ifdef __APPLE__ // Apparently glut changed our working directory in OS 10.3.9 chdir(dir); diff --git a/api/graphics2_win.cpp b/api/graphics2_win.cpp index 2c748b0a137..63f29898e81 100644 --- a/api/graphics2_win.cpp +++ b/api/graphics2_win.cpp @@ -250,19 +250,19 @@ LRESULT CALLBACK WndProc( case WM_ERASEBKGND: return 0; case WM_KEYDOWN: - if(!window_ready) return 0; + if(!window_ready) return 0; if (fullscreen) { boinc_close_window_and_quit("key down"); - } else { + } else { boinc_app_key_press((int)wParam, (int)lParam); } return 0; case WM_KEYUP: - if(!window_ready) return 0; + if(!window_ready) return 0; if (fullscreen) { boinc_close_window_and_quit("key up"); } else { - boinc_app_key_release((int)wParam, (int)lParam); + boinc_app_key_release((int)wParam, (int)lParam); } return 0; case WM_LBUTTONDOWN: @@ -271,7 +271,7 @@ LRESULT CALLBACK WndProc( case WM_LBUTTONUP: case WM_MBUTTONUP: case WM_RBUTTONUP: - if(!window_ready) return 0; + if(!window_ready) return 0; if (fullscreen) { boinc_close_window_and_quit("button up"); @@ -286,8 +286,8 @@ LRESULT CALLBACK WndProc( } return 0; case WM_MOUSEMOVE: - if(!window_ready) return 0; - if (fullscreen) { + if(!window_ready) return 0; + if (fullscreen) { if((int)(short)LOWORD(lParam) != mousePos.x || (int)(short)HIWORD(lParam) != mousePos.y) { boinc_close_window_and_quit("mouse move"); } @@ -323,8 +323,8 @@ LRESULT CALLBACK WndProc( visible = FALSE; } else { visible = TRUE; - } - if(!window_ready) return 0; + } + if(!window_ready) return 0; app_graphics_resize(LOWORD(lParam), HIWORD(lParam)); return 0; } @@ -381,10 +381,10 @@ static VOID CALLBACK timer_handler(HWND, UINT, UINT, DWORD) { if (throttled_app_render(width, height, dtime())) { SwapBuffers(win_dc); if (!fullscreen) { - // If user has changed window size, wait until it stops + // If user has changed window size, wait until it stops // changing and then write the new dimensions to file // - if ((rt.left != rect.left) || (rt.top != rect.top) || + if ((rt.left != rect.left) || (rt.top != rect.top) || (rt.right != rect.right) || (rt.bottom != rect.bottom) ) { if (IsZoomed(window)) return; @@ -407,7 +407,7 @@ static VOID CALLBACK timer_handler(HWND, UINT, UINT, DWORD) { fclose(f); } } - } // End if (new size != previous size) else + } // End if (new size != previous size) else } } } @@ -436,7 +436,7 @@ void boinc_graphics_loop(int argc, char** argv, const char* title) { // reg_win_class(); - wglMakeCurrent(NULL,NULL); + wglMakeCurrent(NULL,NULL); make_window(title); // Create a timer thread to do rendering diff --git a/api/graphics_api.h b/api/graphics_api.h index 314bbea57fc..bcc886902fd 100644 --- a/api/graphics_api.h +++ b/api/graphics_api.h @@ -31,7 +31,7 @@ extern int boinc_init_graphics(WORKER_FUNC_PTR); extern void app_graphics_render(int xs, int ys, double time_of_day); extern void app_graphics_init(void); // called each time a window is opened; - // called in the graphics thread + // called in the graphics thread extern void app_graphics_reread_prefs(void); // called when get REREAD_PREFS message from core client. // called in the graphics thread @@ -43,7 +43,7 @@ extern void boinc_app_key_release(int, int); extern void boinc_suspend_graphics_thread(void); extern void boinc_resume_graphics_thread(void); -// C++ API follows here +// C++ API follows here #ifdef __cplusplus } // end extern "C" diff --git a/api/graphics_impl.cpp b/api/graphics_impl.cpp index af6236f0780..905250c043d 100644 --- a/api/graphics_impl.cpp +++ b/api/graphics_impl.cpp @@ -117,27 +117,27 @@ static int start_worker_thread( // retval = pthread_attr_init(&worker_thread_attr); if (retval) return ERR_THREAD; - + retval = pthread_attr_getschedparam(&worker_thread_attr, ¶m); if (retval) return ERR_THREAD; - + // Note: this sets the scheduling policy for the worker thread to // be the same as the scheduling policy of the main thread. // This may not be a wise choice. // retval = pthread_attr_getschedpolicy(&worker_thread_attr, ¤tpolicy); if (retval) return ERR_THREAD; - + minpriority = sched_get_priority_min(currentpolicy); if (minpriority == -1) return ERR_THREAD; - + param.sched_priority = minpriority; retval = pthread_attr_setschedparam(&worker_thread_attr, ¶m); if (retval) return ERR_THREAD; // initialize ID of calling thread (the graphics-thread!) graphics_thread = pthread_self(); - + // set worker stack size if specified // if (options.worker_thread_stack_size) { diff --git a/api/graphics_lib.cpp b/api/graphics_lib.cpp index 15b1eb86f3c..00be328f196 100644 --- a/api/graphics_lib.cpp +++ b/api/graphics_lib.cpp @@ -32,7 +32,7 @@ #include #include -#include "boinc_api.h" +#include "boinc_api.h" #include "graphics_api.h" #include "graphics_impl.h" #include "graphics_lib.h" @@ -84,7 +84,7 @@ int boinc_init_options_graphics_lib( } strlcpy(graphics_lib, ptr, sizeof(graphics_lib)); strlcat(graphics_lib, ".so", sizeof(graphics_lib)); - + // boinc-resolve library name: it could be a XML symlink // if (boinc_resolve_filename(graphics_lib, resolved_name, MAXPATHLEN)) { @@ -100,7 +100,7 @@ int boinc_init_options_graphics_lib( if (!strcmp(graphics_lib, resolved_name)) { snprintf(resolved_name, sizeof(resolved_name), "./%s", graphics_lib); } - + // get handle for shared library. // This handle is a global variable, so it can be declared 'extern' // in worker() and thus worker() has access to functions @@ -114,7 +114,7 @@ int boinc_init_options_graphics_lib( ); goto no_graphics; } - + // use handle from shared library to resolve the 'initialize // graphics' routine from shared library // @@ -137,18 +137,18 @@ int boinc_init_options_graphics_lib( retval = boinc_init_options_graphics_impl_hook( opt, worker, &boinc_main_state ); - + if (retval) { fprintf(stderr, "boinc_init_options_graphics_impl() returned %d: unable to create worker thread\n", retval ); } - + boinc_finish(retval); // never get here... return 1; - + no_graphics: // unable to resolve the shared object file, or unable to resolve // library dependencies on machine (eg, no X11, no GL libraries, @@ -156,7 +156,7 @@ int boinc_init_options_graphics_lib( // boinc_init_options(&opt); worker(); - + // worker() should call boinc_finish so we should NEVER get here! // boinc_finish(1); diff --git a/api/gutil_text.cpp b/api/gutil_text.cpp index a6483ed593b..ff4407ddd30 100644 --- a/api/gutil_text.cpp +++ b/api/gutil_text.cpp @@ -232,8 +232,8 @@ void draw_text_right( } -MOVING_TEXT_PANEL::MOVING_TEXT_PANEL() : - theta(0), dtheta(0), color(0), char_height(0), line_width(0), line_spacing(0), margin(0) +MOVING_TEXT_PANEL::MOVING_TEXT_PANEL() : + theta(0), dtheta(0), color(0), char_height(0), line_width(0), line_spacing(0), margin(0) { int i; for (i=0;i<3;i++) { diff --git a/api/macglutfix.m b/api/macglutfix.m index d237cf5a770..2953b10c1b9 100644 --- a/api/macglutfix.m +++ b/api/macglutfix.m @@ -39,7 +39,7 @@ extern bool fullscreen; // set in graphics2_unix.cpp -// For unknown reason, "boinc_api.h" gets a compile +// For unknown reason, "boinc_api.h" gets a compile // error here so just declare boinc_is_standalone() //#include "boinc_api.h" extern int boinc_is_standalone(void); @@ -49,8 +49,8 @@ void BringAppToFront(void); int compareOSVersionTo(int toMajor, int toMinor); -// The standard ScreenSaverView class actually sets the window -// level to 2002, not the 1000 defined by NSScreenSaverWindowLevel +// The standard ScreenSaverView class actually sets the window +// level to 2002, not the 1000 defined by NSScreenSaverWindowLevel // and kCGScreenSaverWindowLevel #define RealSaverLevel 2002 // Glut sets the window level to 100 when it sets full screen mode @@ -76,7 +76,7 @@ void MacGLUTFix(bool isScreenSaver) { if (count == 2) ClearDocumentEditedDot(); if (count++ > 2) return; // Do the code below only twice - + if (! boinc_is_standalone()) { if (emptyMenu == nil) { emptyMenu = [ NSMenu alloc ]; @@ -91,20 +91,20 @@ void MacGLUTFix(bool isScreenSaver) { myWindow = [ myView window ]; if (myWindow == nil) return; - - // Retina displays have 2X2 pixels per point. When OpenGL / GLUT apps built - // using Xcode 11 are run on a Retina display under OS 10.15, they fail to - // adjust their pixel dimesions to double the window size, and so fill only - // 1/4 of the window (display at half width and height) until they are - // resized by calls to glutReshapeWindow(), glutFullScreen(). etc. + + // Retina displays have 2X2 pixels per point. When OpenGL / GLUT apps built + // using Xcode 11 are run on a Retina display under OS 10.15, they fail to + // adjust their pixel dimesions to double the window size, and so fill only + // 1/4 of the window (display at half width and height) until they are + // resized by calls to glutReshapeWindow(), glutFullScreen(). etc. // However, they work correctly when run on earlier versions of OS X. // - // OpenGL / GLUT apps built using earlier versions of Xcode do not have this - // problem on OS 10.15, but glutReshapeWindow(). + // OpenGL / GLUT apps built using earlier versions of Xcode do not have this + // problem on OS 10.15, but glutReshapeWindow(). // - // We work around this by calling glutReshapeWindow() twice, restoring the - // window's original size. This transparently fixes the problem when necessary - // without actually changing the window's size, and does no harm when not + // We work around this by calling glutReshapeWindow() twice, restoring the + // window's original size. This transparently fixes the problem when necessary + // without actually changing the window's size, and does no harm when not // necessary. if (!isScreenSaver) { @@ -115,9 +115,9 @@ void MacGLUTFix(bool isScreenSaver) { } else { glutReshapeWindow(requestedWidth, requestedHeight); } - + [myWindow setStyleMask:[myWindow styleMask] | NSWindowStyleMaskClosable]; - + return; } @@ -148,10 +148,10 @@ void ClearDocumentEditedDot(void) { int set_realtime(int period, int computation, int constraint) { mach_timebase_info_data_t timebase_info; mach_timebase_info(&timebase_info); - + const uint64_t NANOS_PER_MSEC = 1000000ULL; double clock2abs = ((double)timebase_info.denom / (double)timebase_info.numer) * NANOS_PER_MSEC; - + thread_time_constraint_policy_data_t policy; policy.period = period; policy.computation = (uint32_t)(computation * clock2abs); // computation ms of work @@ -191,10 +191,10 @@ @interface ServerController : NSObject { NSMachPort *serverPort; NSMachPort *localPort; - + uint32_t serverPortName; uint32_t localPortName; - + NSMachPort *clientPort[16]; uint32_t clientPortNames[16]; uint32_t clientPortCount; @@ -222,11 +222,11 @@ - (ServerController *)init { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(portDied:) name:NSPortDidBecomeInvalidNotification object:nil]; - + mach_port_t servicePortNum = MACH_PORT_NULL; kern_return_t machErr; char *portName = "edu.berkeley.boincsaver"; - + // NSMachBootstrapServer is deprecated in OS 10.13, so use bootstrap_look_up // serverPort = [(NSMachPort *)([[NSMachBootstrapServer sharedInstance] servicePortWithName:@"edu.berkeley.boincsaver"]) retain]; machErr = bootstrap_check_in(bootstrap_port, portName, &servicePortNum); @@ -234,10 +234,10 @@ - (ServerController *)init [NSApp terminate:self]; } serverPort = (NSMachPort*)[NSMachPort portWithMachPort:servicePortNum]; - + // Create a local dummy reply port to use with the mig reply stuff localPort = [[NSMachPort alloc] init]; - + // Retrieve raw mach port names. serverPortName = [serverPort machPort]; localPortName = [localPort machPort]; @@ -267,7 +267,7 @@ - (void)portDied:(NSNotification *)notification [NSApp terminate:self]; } else - { + { int i; for(i = 0; i < clientPortCount+1; i++) { @@ -284,10 +284,10 @@ - (void)portDied:(NSNotification *)notification - (void)handleMachMessage:(void *)msg { union __ReplyUnion___MGCMGSServer_subsystem reply; - + mach_msg_header_t *reply_header = (void *)&reply; kern_return_t kr; - + if(MGSServer_server(msg, reply_header) && reply_header->msgh_remote_port != MACH_PORT_NULL) { kr = mach_msg(reply_header, MACH_SEND_MSG, reply_header->msgh_size, 0, MACH_PORT_NULL, @@ -298,11 +298,11 @@ - (void)handleMachMessage:(void *)msg } - (kern_return_t)checkInClient:(mach_port_t)client_port index:(int32_t *)client_index -{ +{ clientPortCount++; // clients always start at index 1 clientPortNames[clientPortCount] = client_port; clientPort[clientPortCount] = [[NSMachPort alloc] initWithMachPort:client_port]; - + *client_index = clientPortCount; return 0; } @@ -333,16 +333,16 @@ - (void)sendIOSurfaceMachPortToClients:(uint32_t)index withMachPort:(mach_port_t @end -// OpenGL / GLUT apps which call glutFullScreen() and are built using -// Xcode 11 apparently use window dimensions based on the number of -// backing store pixels. That is, they double the window dimensions -// for Retina displays (which have 2X2 pixels per point.) But OpenGL +// OpenGL / GLUT apps which call glutFullScreen() and are built using +// Xcode 11 apparently use window dimensions based on the number of +// backing store pixels. That is, they double the window dimensions +// for Retina displays (which have 2X2 pixels per point.) But OpenGL // apps built under earlier versions of Xcode don't. // -// OS 10.15 Catalina assumes OpenGL / GLUT apps work as built under -// Xcode 11, so it displays older builds at half width and height, -// unless we compensate in our code. To ensure that BOINC graphics apps -// built on all versions of Xcode work properly on all versions of OS X, +// OS 10.15 Catalina assumes OpenGL / GLUT apps work as built under +// Xcode 11, so it displays older builds at half width and height, +// unless we compensate in our code. To ensure that BOINC graphics apps +// built on all versions of Xcode work properly on all versions of OS X, // we set the IOSurface dimensions in this module to the viewportRect // dimensions. // @@ -377,13 +377,13 @@ void MacPassOffscreenBufferToScreenSaver() { ioSurfaceMachPorts[i] = IOSurfaceCreateMachPort(ioSurfaceBuffers[i]); } } - + if(!textureNames[currentFrameIndex]) { CGLContextObj cgl_ctx = (CGLContextObj)[myContext CGLContextObj]; - + glGenTextures(1, &name); - + glBindTexture(GL_TEXTURE_RECTANGLE, name); // At the moment, CGLTexImageIOSurface2D requires the GL_TEXTURE_RECTANGLE target CGLTexImageIOSurface2D(cgl_ctx, GL_TEXTURE_RECTANGLE, GL_RGBA, w, h, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, @@ -392,10 +392,10 @@ void MacPassOffscreenBufferToScreenSaver() { glTexParameteri(GL_TEXTURE_RECTANGLE, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_RECTANGLE, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_RECTANGLE, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); - + // Generate an FBO and bind the texture to it as a render target. glBindTexture(GL_TEXTURE_RECTANGLE, 0); - + glGenFramebuffers(1, &namef); glBindFramebuffer(GL_FRAMEBUFFER, namef); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_RECTANGLE, name, 0); @@ -468,7 +468,7 @@ int compareOSVersionTo(int toMajor, int toMinor) { p1 = strchr(vers, '.'); minor = atoi(p1+1); } - + if (major < toMajor) return -1; if (major > toMajor) return 1; // if (major == toMajor) compare minor version numbers @@ -520,7 +520,7 @@ void print_to_log_file(const char *format, ...) { va_start(args, format); vfprintf(f, format, args); va_end(args); - + fputs("\n", f); fflush(f); fclose(f); diff --git a/api/make_app_icon_h.cpp b/api/make_app_icon_h.cpp index cb91968556a..62a9c0bceb7 100644 --- a/api/make_app_icon_h.cpp +++ b/api/make_app_icon_h.cpp @@ -16,7 +16,7 @@ // along with BOINC. If not, see . // make_app_icon_h.C -// Utility to convert *.icns file into app_icon.h file for use +// Utility to convert *.icns file into app_icon.h file for use // with api/setMacIcon() in science applications. // THIS CODE IS OBSOLETE! A better way to add an icon to science applications @@ -43,20 +43,20 @@ int main(int argc, char** argv) { puts ("usage: make_app_icon_h source_path dest_path\n"); return 0; } - + inFile = fopen(argv[1], "rb"); if (inFile == NULL) { printf ("Couldn't open input file %s\n", argv[1]); return 0; } - + outFile = fopen(argv[2], "w"); if (outFile == NULL) { printf ("Couldn't create output file %s\n", argv[2]); fclose(inFile); return 0; } - + fputs("char MacAppIconData[] = {\n\t", outFile); count = 16; c = getc(inFile); @@ -66,9 +66,9 @@ int main(int argc, char** argv) { fclose(outFile); return 0; } - + fprintf(outFile, "0X%02X", c); - + while ((c = getc(inFile)) != EOF) { if (--count) fputs(",", outFile); @@ -76,14 +76,14 @@ int main(int argc, char** argv) { fputs(",\n\t", outFile); count = 16; } - + fprintf(outFile, "0X%02X", c); } - + fputs("\n};\n", outFile); fclose(inFile); fclose(outFile); - + return retval; } - + diff --git a/api/reduce.h b/api/reduce.h index f75403ad73e..94f59e6cf59 100644 --- a/api/reduce.h +++ b/api/reduce.h @@ -116,7 +116,7 @@ struct REDUCED_ARRAY_RENDER: REDUCED_ARRAY_DATA { void draw_part(double frac); void draw_axes(); void draw_axis_labels(); - void draw_labels(); + void draw_labels(); }; #endif diff --git a/api/reduce_lib.cpp b/api/reduce_lib.cpp index ca4494e5634..6dfe9c02540 100644 --- a/api/reduce_lib.cpp +++ b/api/reduce_lib.cpp @@ -147,7 +147,7 @@ void REDUCED_ARRAY_RENDER::draw_row_rect_x(int row) { glVertex3f(x1, y0, z0); glVertex3f(x1, y1, z0); glVertex3f(x0, y1, z0); - + //back glVertex3f(x0, y0, z1); glVertex3f(x1, y0, z1); diff --git a/api/ttfont.cpp b/api/ttfont.cpp index 3a310bc0c2f..2fc049c0478 100644 --- a/api/ttfont.cpp +++ b/api/ttfont.cpp @@ -43,17 +43,17 @@ // I put in it's own namespace so call TTFont::ttf_load_fonts() etc // -namespace TTFont { +namespace TTFont { -// The Liberation version 2.00.0 fonts referenced below are free -// fonts under the SIL Open Font License version 1.1. You can +// The Liberation version 2.00.0 fonts referenced below are free +// fonts under the SIL Open Font License version 1.1. You can // download the license and fonts from // https://fedorahosted.org/liberation-fonts // -// Another source of free fonts is the GNU FreeFont project +// Another source of free fonts is the GNU FreeFont project // at http://www.gnu.org/software/freefont -// you'll want to define a 2-d array of char as appropriate for your +// you'll want to define a 2-d array of char as appropriate for your // truetype font filenames (path is set in the call to ttf_load_fonts) // static const char *g_cstrFont[] = { @@ -70,7 +70,7 @@ static const char *g_cstrFont[] = { "LiberationMono-Italic.ttf", // 10 "LiberationMono-BoldItalic.ttf" // 11 }; - + // define the number of fonts supported #define NUM_FONT (sizeof(g_cstrFont) / sizeof(char*)) @@ -127,7 +127,7 @@ void ttf_load_fonts( } #endif } - } + } } // remove our objects diff --git a/api/windows_opengl.cpp b/api/windows_opengl.cpp index cd1b16da2d5..1aed36d2774 100644 --- a/api/windows_opengl.cpp +++ b/api/windows_opengl.cpp @@ -181,7 +181,7 @@ static void make_new_window() { SetFocus(hWnd); app_graphics_init(); - app_graphics_resize(width, height); + app_graphics_resize(width, height); window_ready=true; } @@ -215,15 +215,15 @@ static void set_mode(int mode) { if (!is_windows_9x) { GetUserObjectInformation( - GetProcessWindowStation(), - UOI_NAME, + GetProcessWindowStation(), + UOI_NAME, current_desktop.window_station, (sizeof(current_desktop.window_station) / sizeof(char)), NULL ); GetUserObjectInformation( - GetThreadDesktop(GetCurrentThreadId()), - UOI_NAME, + GetThreadDesktop(GetCurrentThreadId()), + UOI_NAME, current_desktop.desktop, (sizeof(current_desktop.desktop) / sizeof(char)), NULL @@ -231,7 +231,7 @@ static void set_mode(int mode) { } if (!is_windows_9x && - !boinc_is_standalone() && + !boinc_is_standalone() && strlen(graphics_msg.window_station) > 0 && strlen(graphics_msg.desktop) > 0 && (strcmp(current_desktop.window_station, graphics_msg.window_station) || @@ -278,7 +278,7 @@ static void set_mode(int mode) { } } } - + current_graphics_mode = new_mode; if (new_mode != MODE_HIDE_GRAPHICS && new_mode != MODE_UNSUPPORTED) { make_new_window(); @@ -309,19 +309,19 @@ LRESULT CALLBACK WndProc( case WM_ERASEBKGND: // Check To See If Windows Is Trying To Erase The Background return 0; case WM_KEYDOWN: - if(!window_ready) return 0; + if(!window_ready) return 0; if (current_graphics_mode == MODE_FULLSCREEN) { set_mode(MODE_HIDE_GRAPHICS); - } else { + } else { boinc_app_key_press((int)wParam, (int)lParam); } return 0; case WM_KEYUP: - if(!window_ready) return 0; + if(!window_ready) return 0; if (current_graphics_mode == MODE_FULLSCREEN) { set_mode(MODE_HIDE_GRAPHICS); } else { - boinc_app_key_release((int)wParam, (int)lParam); + boinc_app_key_release((int)wParam, (int)lParam); } return 0; case WM_LBUTTONDOWN: @@ -330,7 +330,7 @@ LRESULT CALLBACK WndProc( case WM_LBUTTONUP: case WM_MBUTTONUP: case WM_RBUTTONUP: - if(!window_ready) return 0; + if(!window_ready) return 0; if (current_graphics_mode == MODE_FULLSCREEN) { set_mode(MODE_HIDE_GRAPHICS); @@ -344,10 +344,10 @@ LRESULT CALLBACK WndProc( } return 0; case WM_MOUSEMOVE: - if(!window_ready) return 0; + if(!window_ready) return 0; POINT cPos; GetCursorPos(&cPos); - if (current_graphics_mode == MODE_FULLSCREEN) { + if (current_graphics_mode == MODE_FULLSCREEN) { if(cPos.x != mousePos.x || cPos.y != mousePos.y) { set_mode(MODE_HIDE_GRAPHICS); } @@ -374,7 +374,7 @@ LRESULT CALLBACK WndProc( set_mode(MODE_HIDE_GRAPHICS); suspend_activities(); return TRUE; - } + } if (PBT_APMQUERYSUSPENDFAILED == wParam || PBT_APMRESUMESUSPEND == wParam) { set_mode(acked_graphics_mode); restore_activities(); @@ -388,7 +388,7 @@ LRESULT CALLBACK WndProc( PAINTSTRUCT ps; RECT winRect; HDC pdc; - if (!graphics_threadh) graphics_threadh=(HANDLE)GetCurrentThreadId(); + if (!graphics_threadh) graphics_threadh=(HANDLE)GetCurrentThreadId(); pdc = BeginPaint(hWnd, &ps); GetClientRect(hWnd, &winRect); FillRect(pdc, &winRect, (HBRUSH)GetStockObject(BLACK_BRUSH)); @@ -399,8 +399,8 @@ LRESULT CALLBACK WndProc( visible = FALSE; } else { visible = TRUE; - } - if(!window_ready) return 0; + } + if(!window_ready) return 0; app_graphics_resize(LOWORD(lParam), HIWORD(lParam)); return 0; case WM_SHUTDOWNGFX: @@ -510,7 +510,7 @@ void win_graphics_event_loop() { // Get platform information // - OSVERSIONINFO osvi; + OSVERSIONINFO osvi; osvi.dwOSVersionInfoSize = sizeof(osvi); GetVersionEx(&osvi); is_windows_9x = (osvi.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS); diff --git a/api/x_opengl.cpp b/api/x_opengl.cpp index d818813d93f..1d9ef50dcae 100644 --- a/api/x_opengl.cpp +++ b/api/x_opengl.cpp @@ -19,9 +19,9 @@ #include "config.h" #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -106,7 +106,7 @@ static bool suspend_render = false; // If running freeglut, also get the version. // #ifdef __APPLE__ -static bool glut_is_freeglut = false; // Avoid warning message to stderr from glutGet(GLUT_VERSION) +static bool glut_is_freeglut = false; // Avoid warning message to stderr from glutGet(GLUT_VERSION) static bool need_show = false; #else static bool glut_is_freeglut = true; @@ -119,7 +119,7 @@ static int glut_version = 0; // hide/show it as necessary. // static int fg_window_state; // values same as mode -static bool fg_window_is_fullscreen; +static bool fg_window_is_fullscreen; static jmp_buf jbuf; // longjump/setjump for exit/signal handler static struct sigaction original_signal_handler; // store previous ABRT signal-handler @@ -134,14 +134,14 @@ extern pthread_t worker_thread; // possible longjmp-values to signal from where we jumped: // -enum { +enum { JUMP_NONE = 0, JUMP_EXIT, JUMP_ABORT, JUMP_LAST }; // 1= exit caught by atexit, 2 = signal caught by handler - + int xwin_glut_is_initialized() { return glut_is_initialized; } @@ -193,7 +193,7 @@ void mouse_click_move(int x, int y){ } } -// maybe_render() can be called directly by GLUT when a window is +// maybe_render() can be called directly by GLUT when a window is // uncovered, so we let that happen even if suspend_render is true. static void maybe_render() { int width, height; @@ -273,14 +273,14 @@ static void make_new_window(int mode) { } fg_window_state = MODE_WINDOW; } - + #ifdef __APPLE__ if (win) have_window = true; #endif if (!have_window) { - win = glutCreateWindow(window_title); + win = glutCreateWindow(window_title); if (debug) fprintf(stderr, "glutCreateWindow() succeeded. win = %d\n", win); glutReshapeFunc(app_graphics_resize); @@ -288,17 +288,17 @@ static void make_new_window(int mode) { glutKeyboardUpFunc(keyboardU); glutMouseFunc(mouse_click); glutMotionFunc(mouse_click_move); - glutDisplayFunc(maybe_render); + glutDisplayFunc(maybe_render); glEnable(GL_DEPTH_TEST); - + app_graphics_init(); } - + #ifdef __APPLE__ glutWMCloseFunc(CloseWindow); // Enable the window's close box BringAppToFront(); - // Show window only after a successful call to throttled_app_render(); - // this avoids momentary display of old image when screensaver restarts + // Show window only after a successful call to throttled_app_render(); + // this avoids momentary display of old image when screensaver restarts // which made image appear to "jump." need_show = true; #endif @@ -324,17 +324,17 @@ static void boinc_glut_init() { const char* args[2] = {"screensaver", NULL}; int one=1; static bool first = true; - + win = 0; if (debug) fprintf(stderr, "Calling glutInit()... \n"); glutInit (&one, (char**)args); if (debug) fprintf(stderr, "survived glutInit(). \n"); // figure out whether we're running GLUT or freeglut. - // + // // note - glutGet(GLUT_VERSION) is supported in freeglut, // other GLUT returns -1 and outputs a warning - // message to stderr. + // message to stderr. // - must be after glutInit or will get SIGABRT // if (first) { @@ -353,9 +353,9 @@ static void boinc_glut_init() { } } - glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); + glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH); glutInitWindowPosition(xpos, ypos); - glutInitWindowSize(600, 400); + glutInitWindowSize(600, 400); g_bmsp->boinc_get_init_data_hook(aid); if (!strlen(aid.app_name)) { strlcpy(aid.app_name, "BOINC Application", sizeof(aid.app_name)); @@ -386,18 +386,18 @@ void KillWindow() { xpos = glutGet(GLUT_WINDOW_X); ypos = glutGet(GLUT_WINDOW_Y); } else { - // If fullscreen, resize now to avoid ugly flash if we subsequently + // If fullscreen, resize now to avoid ugly flash if we subsequently // redisplay as MODE_WINDOW. glutPositionWindow(xpos, ypos); glutReshapeWindow(win_width, win_height); } - - // On Intel Macs (but not on PowerPC Macs) GLUT's destructors often crash when + + // On Intel Macs (but not on PowerPC Macs) GLUT's destructors often crash when // glutDestroyWindow() is called. So far, this has only been reported for - // SETI@home. Since it doesn't occur on PowerPC Macs, we suspect a bug in GLUT. - // To work around this, we just hide the window instead. Though this does not - // free up RAM and VM used by the graphics, glutDestroyWindow() doesn't free - // them either (surprisingly), so there is no additional penalty for doing it + // SETI@home. Since it doesn't occur on PowerPC Macs, we suspect a bug in GLUT. + // To work around this, we just hide the window instead. Though this does not + // free up RAM and VM used by the graphics, glutDestroyWindow() doesn't free + // them either (surprisingly), so there is no additional penalty for doing it // this way. glutHideWindow(); #else @@ -409,7 +409,7 @@ void KillWindow() { glutDestroyWindow(oldwin); } #endif - } + } } void set_mode(int mode) { @@ -423,7 +423,7 @@ void set_mode(int mode) { // glutPopWindow(); glutShowWindow(); } -#endif +#endif } return; } @@ -434,9 +434,9 @@ void set_mode(int mode) { KillWindow(); if (debug) fprintf(stderr, "KillWindow() survived.\n"); } - + if (mode != MODE_HIDE_GRAPHICS) { - if (debug) fprintf(stderr, "set_mode(): Calling make_new_window(%d)\n", mode); + if (debug) fprintf(stderr, "set_mode(): Calling make_new_window(%d)\n", mode); make_new_window(mode); if (debug) fprintf(stderr, "make_new_window() survived.\n"); } @@ -527,7 +527,7 @@ void restart() { // if we are standalone and glut was initialized, // we assume user pressed 'close', and we exit the app // - // + // if (glut_is_initialized ) { if (boinc_is_standalone()) { if (debug) fprintf(stderr, @@ -629,7 +629,7 @@ void xwin_graphics_event_loop() { if (glut_is_initialized && glut_is_freeglut) { if (1 == (glut_is_initialized = FREEGLUT_IS_INITIALIZED)) { if (!GLUT_HAVE_WINDOW) { - win = 0; + win = 0; } } } @@ -642,7 +642,7 @@ void xwin_graphics_event_loop() { } else { // open the graphics-window set_mode(MODE_WINDOW); - glutTimerFunc(TIMER_INTERVAL_MSEC, timer_handler, 0); + glutTimerFunc(TIMER_INTERVAL_MSEC, timer_handler, 0); } } else { if (!glut_is_initialized) { diff --git a/api/x_opengl.h b/api/x_opengl.h index 18cc7f9d51f..eecbf05fff5 100644 --- a/api/x_opengl.h +++ b/api/x_opengl.h @@ -22,7 +22,7 @@ extern "C" { #endif -extern int xwin_glut_is_initialized(); +extern int xwin_glut_is_initialized(); #ifdef __APPLE__ extern void MacGLUTFix(bool isScreenSaver); diff --git a/ci_tools/source_code_check.py b/ci_tools/source_code_check.py index 4a1c9e53527..03833465023 100644 --- a/ci_tools/source_code_check.py +++ b/ci_tools/source_code_check.py @@ -39,40 +39,40 @@ def check(directory, bytes_to_check, exclude_dirs, exclude_extensions, exclude_f exclude_dirs = [ os.path.join(directory, ".git"), - os.path.join(directory, "3rdParty/android"), - os.path.join(directory, "3rdParty/buildCache"), - os.path.join(directory, "3rdParty/linux"), - os.path.join(directory, "3rdParty/Windows"), - os.path.join(directory, "android/BOINC/.gradle"), - os.path.join(directory, "android/BOINC/app/build"), - os.path.join(directory, "android/BOINC/app/src/main/assets"), - os.path.join(directory, "android/BOINC/app/src/main/res"), - os.path.join(directory, "doc/manpages"), - os.path.join(directory, "drupal/sites/all/libraries"), - os.path.join(directory, "drupal/sites/all/themes"), - os.path.join(directory, "drupal/sites/default/boinc/modules/contrib"), - os.path.join(directory, "drupal/sites/default/boinc/themes"), + os.path.join(directory, "3rdParty", "android"), + os.path.join(directory, "3rdParty", "buildCache"), + os.path.join(directory, "3rdParty", "linux"), + os.path.join(directory, "3rdParty", "Windows"), + os.path.join(directory, "android", "BOINC", ".gradle"), + os.path.join(directory, "android", "BOINC", "app", "build"), + os.path.join(directory, "android", "BOINC", "app", "src", "main", "assets"), + os.path.join(directory, "android", "BOINC", "app", "src", "main", "res"), + os.path.join(directory, "doc", "manpages"), + os.path.join(directory, "drupal", "sites", "all", "libraries"), + os.path.join(directory, "drupal", "sites", "all", "themes"), + os.path.join(directory, "drupal", "sites", "default", "boinc", "modules", "contrib"), + os.path.join(directory, "drupal", "sites", "default", "boinc", "themes"), os.path.join(directory, "fastlane"), - os.path.join(directory, "samples/example_app/bin"), + os.path.join(directory, "samples", "example_app", "bin"), ] exclude_files = [ os.path.join(directory, "aclocal.m4"), - os.path.join(directory, "client/boinc_client"), - os.path.join(directory, "client/boinccmd"), - os.path.join(directory, "client/boinc"), - os.path.join(directory, "client/switcher"), - os.path.join(directory, "clientgui/BOINCBaseView.cpp"), - os.path.join(directory, "clientscr/progress/simt"), - os.path.join(directory, "drupal/sites/default/boinc/modules/boinc_solr_search/boinc_solr_comments/README.txt"), - os.path.join(directory, "drupal/sites/default/boinc/modules/boinc_solr_search/boinc_solr_comments/INSTALL.txt"), - os.path.join(directory, "html/inc/GeoIP.dat"), - os.path.join(directory, "mac_installer/BOINC.pmproj"), - os.path.join(directory, "mac_build/boinc.xcodeproj/project.pbxproj"), - os.path.join(directory, "stage/usr/local/bin/boinc_client"), - os.path.join(directory, "stage/usr/local/bin/boinccmd"), - os.path.join(directory, "stage/usr/local/bin/boinc"), - os.path.join(directory, "stage/usr/local/bin/switcher"), + os.path.join(directory, "client", "boinc_client"), + os.path.join(directory, "client", "boinccmd"), + os.path.join(directory, "client", "boinc"), + os.path.join(directory, "client", "switcher"), + os.path.join(directory, "clientgui", "BOINCBaseView.cpp"), + os.path.join(directory, "clientscr", "progress", "simt"), + os.path.join(directory, "drupal", "sites", "default", "boinc", "modules", "boinc_solr_search", "boinc_solr_comments", "README.txt"), + os.path.join(directory, "drupal", "sites", "default", "boinc", "modules", "boinc_solr_search", "boinc_solr_comments", "INSTALL.txt"), + os.path.join(directory, "html", "inc", "GeoIP.dat"), + os.path.join(directory, "mac_installer", "BOINC.pmproj"), + os.path.join(directory, "mac_build", "boinc.xcodeproj", "project.pbxproj"), + os.path.join(directory, "stage", "usr", "local", "bin", "boinc_client"), + os.path.join(directory, "stage", "usr", "local", "bin", "boinccmd"), + os.path.join(directory, "stage", "usr", "local", "bin", "boinc"), + os.path.join(directory, "stage", "usr", "local", "bin", "switcher"), ] exclude_extensions = [ diff --git a/ci_tools/trailing_whitespaces_check.py b/ci_tools/trailing_whitespaces_check.py new file mode 100644 index 00000000000..a90cbdb41bf --- /dev/null +++ b/ci_tools/trailing_whitespaces_check.py @@ -0,0 +1,179 @@ +import os +import pathlib +import sys + +def help(): + print('Usage:') + print('python trailing_whitespaces_check.py ') + +def check(directory, exclude_dirs, exclude_extensions, exclude_files, fix_errors=False): + if not os.path.isdir(directory): + return None + + files_with_errors = [] + + for root, dirs, files in os.walk(directory, topdown=True): + dirs[:] = [d for d in dirs if os.path.join(root, d) not in exclude_dirs] + for filename in files: + if (pathlib.Path(filename).suffix in exclude_extensions): + continue + src_file = os.path.join(root, filename) + if (os.path.islink(src_file) or src_file in exclude_files): + continue + with open(src_file, "rb") as f: + if verbose: + print('Checking file: ' + src_file) + lines = f.read().splitlines() + count = 0 + changed = False + for line in lines: + count += 1 + if line.rstrip() != line: + if fix_errors: + lines[count - 1] = line.rstrip() + changed = True + else: + files_with_errors.append("{}:{}".format(src_file, count)) + if changed: + print('Fixing file: ' + src_file + '...') + with open(src_file, "wb") as f: + f.write(str.encode(os.linesep).join(lines)) + f.write(str.encode(os.linesep)) + return files_with_errors + + +if (len(sys.argv) < 2): + help() + sys.exit(1) + +verbose = False +fix = False +directory = sys.argv[1] + +for arg in sys.argv: + if arg == "--verbose": + verbose = True + continue + if arg == "--fix": + fix = True + continue + +exclude_dirs = [ + os.path.join(directory, ".git"), + os.path.join(directory, ".github", "ISSUE_TEMPLATE"), + os.path.join(directory, "3rdParty", "android"), + os.path.join(directory, "3rdParty", "buildCache"), + os.path.join(directory, "3rdParty", "linux"), + os.path.join(directory, "3rdParty", "Windows"), + os.path.join(directory, "android", "BOINC", ".gradle"), + os.path.join(directory, "android", "BOINC", ".idea"), + os.path.join(directory, "android", "BOINC", "app", "build"), + os.path.join(directory, "android", "BOINC", "app", "src", "main", "assets"), + os.path.join(directory, "android", "BOINC", "app", "src", "main", "res"), + os.path.join(directory, "api", "ttf"), + os.path.join(directory, "coprocs", "NVIDIA", "include"), + os.path.join(directory, "doc", "manpages"), + os.path.join(directory, "drupal", "sites", "all", "libraries"), + os.path.join(directory, "drupal", "sites", "all", "themes"), + os.path.join(directory, "drupal", "sites", "default", "boinc", "modules", "contrib"), + os.path.join(directory, "drupal", "sites", "default", "boinc", "modules", "boincstats", "includes", "pchart"), + os.path.join(directory, "drupal", "sites", "default", "boinc", "themes", "boinc", "webfonts"), + os.path.join(directory, "html", "inc", "password_compat"), + os.path.join(directory, "html", "inc", "random_compat"), + os.path.join(directory, "html", "inc", "ReCaptcha"), + os.path.join(directory, "locale"), + os.path.join(directory, "samples", "example_app", "bin"), + os.path.join(directory, "samples", "gfx_html"), + os.path.join(directory, "samples", "glut"), + os.path.join(directory, "samples", "image_libs"), + os.path.join(directory, "samples", "jpeglib"), + os.path.join(directory, "tests", "old"), + os.path.join(directory, "win_build", "Build"), + os.path.join(directory, "win_build", ".vs"), + os.path.join(directory, "win_build", "ipch"), + os.path.join(directory, "win_build", "installerv2", "redist"), + os.path.join(directory, "zip", "unzip"), + os.path.join(directory, "zip", "zip"), +] + +exclude_files = [ + os.path.join(directory, "bolt_checkin_notes.txt"), + os.path.join(directory, "checkin_notes"), + os.path.join(directory, "checkin_notes_2004"), + os.path.join(directory, "checkin_notes_2005"), + os.path.join(directory, "checkin_notes_2006"), + os.path.join(directory, "checkin_notes_2007"), + os.path.join(directory, "checkin_notes_2008"), + os.path.join(directory, "checkin_notes_2009"), + os.path.join(directory, "checkin_notes_2010"), + os.path.join(directory, "checkin_notes_2011"), + os.path.join(directory, "checkin_notes_2012"), + os.path.join(directory, "checkin_notes_samples"), + os.path.join(directory, "checkin_notes_samples"), + os.path.join(directory, "todo"), + os.path.join(directory, "TODO_OLD"), + os.path.join(directory, "aclocal.m4"), + os.path.join(directory, "client", "boinc_client"), + os.path.join(directory, "client", "boinccmd"), + os.path.join(directory, "client", "boinc"), + os.path.join(directory, "client", "switcher"), + os.path.join(directory, "clientscr", "progress", "simt"), + os.path.join(directory, "html", "inc", "GeoIP.dat"), + os.path.join(directory, "html", "inc", "geoip.inc"), + os.path.join(directory, "html", "inc", "htmLawed.php"), + os.path.join(directory, "html", "inc", "recaptcha_loader.php"), + os.path.join(directory, "samples", "wrapper", "regerror.c"), + os.path.join(directory, "samples", "wrapper", "regexp_custom.h"), + os.path.join(directory, "samples", "wrapper", "regexp_int.h"), + os.path.join(directory, "samples", "wrapper", "regexp_memory.c"), + os.path.join(directory, "samples", "wrapper", "regexp_report.c"), + os.path.join(directory, "samples", "wrapper", "regexp.c"), + os.path.join(directory, "samples", "wrapper", "regexp.h"), + os.path.join(directory, "samples", "wrapper", "regmagic.h"), + os.path.join(directory, "samples", "wrapper", "regsub.c"), + os.path.join(directory, "stage", "usr", "local", "bin", "boinc_client"), + os.path.join(directory, "stage", "usr", "local", "bin", "boinccmd"), + os.path.join(directory, "stage", "usr", "local", "bin", "boinc"), + os.path.join(directory, "stage", "usr", "local", "bin", "switcher"), +] + +exclude_extensions = [ + ".a", + ".bmp", + ".dll", + ".exe", + ".gif", + ".icns", + ".ico", + ".jar", + ".jpg", + ".lib", + ".mo", + ".nib", + ".o", + ".pdb", + ".pdf", + ".pdn", + ".png", + ".po", + ".psd", + ".rgb", + ".rtf", + ".so", + ".tif", + ".tiff", + ".tlb", + ".ttf", + ".zip", +] + +files_with_errors = check(directory, exclude_dirs, exclude_extensions, exclude_files, fix) + +if files_with_errors: + print('Found files with errors:') + for file in files_with_errors: + print(file) + print('To fix errors run locally:\n\tpython3 ci_tools/trailing_whitespaces_check.py . --fix') + sys.exit(1) + +sys.exit(0) diff --git a/client/acct_mgr.cpp b/client/acct_mgr.cpp index 6edf4d50bc2..04a084618d8 100644 --- a/client/acct_mgr.cpp +++ b/client/acct_mgr.cpp @@ -185,7 +185,7 @@ int ACCT_MGR_OP::do_rpc(ACCT_MGR_INFO& _ami, bool _via_gui) { p->disk_usage, p->disk_share ); - + // send work and starvation-related info // if (ami.dynamic) { diff --git a/client/app.cpp b/client/app.cpp index 1b700f13cff..cdfaaf886bb 100644 --- a/client/app.cpp +++ b/client/app.cpp @@ -1190,7 +1190,7 @@ void ACTIVE_TASK_SET::network_available() { void ACTIVE_TASK::upload_notify_app(const FILE_INFO* fip, const FILE_REF* frp) { char path[MAXPATHLEN]; - snprintf(path, sizeof(path), + snprintf(path, sizeof(path), "%s/%s%s", slot_dir, UPLOAD_FILE_STATUS_PREFIX, frp->open_name ); diff --git a/client/app_graphics.cpp b/client/app_graphics.cpp index b85e52c457c..23dc87f6b86 100644 --- a/client/app_graphics.cpp +++ b/client/app_graphics.cpp @@ -55,7 +55,7 @@ void ACTIVE_TASK::request_graphics_mode(GRAPHICS_MSG& m) { // Restore mode from before screensaver m.mode = graphics_mode_before_ss; } - + graphics_msg = m; // save graphics_station, desktop, display safe_strcpy(buf, xml_graphics_modes[m.mode]); diff --git a/client/app_start.cpp b/client/app_start.cpp index e6d1da393c5..6144ba0b70d 100644 --- a/client/app_start.cpp +++ b/client/app_start.cpp @@ -835,7 +835,7 @@ int ACTIVE_TASK::start(bool test) { // see which one was used for this job, and show it // if (log_flags.task_debug && gstate.host_info.n_processor_groups > 0) { - msg_printf(wup->project, MSG_INFO, + msg_printf(wup->project, MSG_INFO, "[task_debug] task is running in processor group %d", get_processor_group(process_handle) ); @@ -1096,7 +1096,7 @@ int ACTIVE_TASK::start(bool test) { } if (g_use_sandbox) { char switcher_path[MAXPATHLEN]; - snprintf(switcher_path, sizeof(switcher_path), + snprintf(switcher_path, sizeof(switcher_path), "../../%s/%s", SWITCHER_DIR, SWITCHER_FILE_NAME ); diff --git a/client/async_file.cpp b/client/async_file.cpp index 9b036f6a2b9..55b23c0a644 100644 --- a/client/async_file.cpp +++ b/client/async_file.cpp @@ -128,7 +128,7 @@ int ASYNC_COPY::copy_chunk() { "[async] async copy of %s finished", to_path ); } - + atp->async_copy = NULL; fip->set_permissions(to_path); diff --git a/client/boinc.xml b/client/boinc.xml index 1612f666334..b1f5d94a419 100644 --- a/client/boinc.xml +++ b/client/boinc.xml @@ -1,5 +1,5 @@ - + BOINC Client diff --git a/client/boinc_cmd.cpp b/client/boinc_cmd.cpp index ffb70052595..30250725ab5 100644 --- a/client/boinc_cmd.cpp +++ b/client/boinc_cmd.cpp @@ -222,7 +222,7 @@ void show_str_lists(vector &lines, size_t ncols) { } } -// given +// given // show list of tasks, 1 line per task, // similar to the Manager's Tasks pane // fields per task: diff --git a/client/boinc_log.cpp b/client/boinc_log.cpp index 2fef7343cc0..62d0e06296a 100644 --- a/client/boinc_log.cpp +++ b/client/boinc_log.cpp @@ -17,7 +17,7 @@ // boinc_log: show stream of event-log messages from a client // -// usage: boinc_log [--host hostname] [--passwd passwd] +// usage: boinc_log [--host hostname] [--passwd passwd] #ifdef _WIN32 #include "boinc_win.h" diff --git a/client/check_security.cpp b/client/check_security.cpp index c377999bc63..e5d548467c1 100644 --- a/client/check_security.cpp +++ b/client/check_security.cpp @@ -40,8 +40,8 @@ bool IsUserInGroup(char* groupName); #endif static int CheckNestedDirectories( - char * basepath, int depth, - int use_sandbox, int isManager, + char * basepath, int depth, + int use_sandbox, int isManager, bool isSlotDir, char * path_to_error, int len ); @@ -93,7 +93,7 @@ int use_sandbox, int isManager, char* path_to_error, int len // or LLDB on sandbox-specific code, as long as the code is run as the // current user (i.e., not as boinc_master or boinc_project), and the // current user is a member of both groups boinc_master and boinc_project. - // Note that this newer approach supersedes the old one described and + // Note that this newer approach supersedes the old one described and // implemented below. But since it has not been thoroughly tested, I have // not removed the old code. if (IsUserInGroup(REAL_BOINC_MASTER_NAME) && IsUserInGroup(REAL_BOINC_PROJECT_NAME)) { @@ -107,7 +107,7 @@ int use_sandbox, int isManager, char* path_to_error, int len // GDB can't attach to applications which are running as a different user or group so // it ignores the S_ISUID and S_ISGID permission bits when launching an application. // To work around this, and to allow testing the uninstalled Deployment version, we -// assume that the BOINC Client has the correct user and group. +// assume that the BOINC Client has the correct user and group. // We must get the BOINC Client's user and group differently depending on whether we // were called from the Manager or from the Client @@ -217,12 +217,12 @@ int use_sandbox, int isManager, char* path_to_error, int len strlcat(full_path, p+1, sizeof(full_path)); p = strrchr(full_path, '.'); // Strip off bundle extension (".app") if (p) - *p = '\0'; + *p = '\0'; retval = lstat(full_path, &sbuf); if (retval) return -1013; // Should never happen - + if (sbuf.st_gid != boinc_master_gid) return -1014; @@ -245,7 +245,7 @@ int use_sandbox, int isManager, char* path_to_error, int len retval = stat(full_path, &sbuf); if (retval) return -1016; // Should never happen - + if (sbuf.st_gid != boinc_master_gid) return -1017; @@ -255,9 +255,9 @@ int use_sandbox, int isManager, char* path_to_error, int len #if (defined(__WXMAC__) || defined(_MAC_INSTALLER)) // If Mac BOINC Manager or installer // Version 6 screensaver has its own embedded switcher application, but older versions don't. - // We don't allow unauthorized users to run the standard switcher application in the BOINC - // Data directory because they could use it to run as user & group boinc_project and damage - // project files. The screensaver's gfx_switcher application has very limited functionality + // We don't allow unauthorized users to run the standard switcher application in the BOINC + // Data directory because they could use it to run as user & group boinc_project and damage + // project files. The screensaver's gfx_switcher application has very limited functionality // to avoid this risk. if (use_sandbox) { @@ -317,15 +317,15 @@ int use_sandbox, int isManager, char* path_to_error, int len if (use_sandbox) { - // The top-level BOINC Data directory can have a different user if created by the Manager, + // The top-level BOINC Data directory can have a different user if created by the Manager, // but it should always have group boinc_master. if (sbuf.st_gid != boinc_master_gid) return -1022; - + // The top-level BOINC Data directory should have permission 771 or 571 if ((sbuf.st_mode & 0577) != 0571) return -1023; - + } else { if (sbuf.st_uid != boinc_master_uid) @@ -336,7 +336,7 @@ int use_sandbox, int isManager, char* path_to_error, int len snprintf(full_path, sizeof(full_path), "%s/%s", dir_path, PROJECTS_DIR); retval = stat(full_path, &sbuf); if (!retval) { - // Client can create projects directory if it does not yet exist. + // Client can create projects directory if it does not yet exist. // if (use_sandbox) { if (sbuf.st_gid != boinc_project_gid) @@ -345,7 +345,7 @@ int use_sandbox, int isManager, char* path_to_error, int len if ((sbuf.st_mode & 0777) != 0770) return -1025; } - + if (sbuf.st_uid != boinc_master_uid) return -1026; @@ -357,7 +357,7 @@ int use_sandbox, int isManager, char* path_to_error, int len snprintf(full_path, sizeof(full_path), "%s/%s", dir_path, SLOTS_DIR); retval = stat(full_path, &sbuf); - if (! retval) { // Client can create slots directory if it does not yet exist. + if (! retval) { // Client can create slots directory if it does not yet exist. if (use_sandbox) { if (sbuf.st_gid != boinc_project_gid) return -1027; @@ -365,7 +365,7 @@ int use_sandbox, int isManager, char* path_to_error, int len if ((sbuf.st_mode & 0777) != 0770) return -1028; } - + if (sbuf.st_uid != boinc_master_uid) return -1029; @@ -379,7 +379,7 @@ int use_sandbox, int isManager, char* path_to_error, int len "%s/%s", dir_path, GUI_RPC_PASSWD_FILE ); retval = stat(full_path, &sbuf); - if (! retval) { // Client can create RPC password file if it does not yet exist. + if (! retval) { // Client can create RPC password file if it does not yet exist. if (use_sandbox) { if (sbuf.st_gid != boinc_master_gid) return -1030; @@ -390,7 +390,7 @@ int use_sandbox, int isManager, char* path_to_error, int len if ((sbuf.st_mode & 0717) != 0600) return -1032; } - + if (sbuf.st_uid != boinc_master_uid) return -1031; } @@ -400,7 +400,7 @@ int use_sandbox, int isManager, char* path_to_error, int len retval = stat(full_path, &sbuf); if (retval) return -1033; - + if (sbuf.st_gid != boinc_master_gid) return -1034; @@ -415,7 +415,7 @@ int use_sandbox, int isManager, char* path_to_error, int len retval = stat(full_path, &sbuf); if (retval) return -1037; - + if (sbuf.st_gid != boinc_master_gid) return -1038; @@ -431,7 +431,7 @@ int use_sandbox, int isManager, char* path_to_error, int len retval = stat(full_path, &sbuf); if (retval) return -1041; - + if (sbuf.st_gid != boinc_master_gid) return -1042; @@ -448,7 +448,7 @@ int use_sandbox, int isManager, char* path_to_error, int len retval = stat(full_path, &sbuf); if (retval) return -1045; - + if (sbuf.st_gid != boinc_master_gid) return -1046; @@ -475,17 +475,17 @@ int use_sandbox, int isManager, char* path_to_error, int len if ((sbuf.st_mode & 0777) != 0664) return -1053; } // Screensaver config file ss_config.xml exists - + } // if (use_sandbox) - + return 0; } static int CheckNestedDirectories( char * basepath, int depth, - int use_sandbox, int isManager, - bool isSlotDir, + int use_sandbox, int isManager, + bool isSlotDir, char * path_to_error, int len ) { int isDirectory; @@ -498,10 +498,10 @@ static int CheckNestedDirectories( dirp = opendir(basepath); if (dirp == NULL) { - // Ideally, all project-created subdirectories under project or slot - // directoriesshould have read-by-group and execute-by-group permission - // bits set, but some don't. If these permission bits are missing, the - // project applications will run OK but we can't access the contents of + // Ideally, all project-created subdirectories under project or slot + // directoriesshould have read-by-group and execute-by-group permission + // bits set, but some don't. If these permission bits are missing, the + // project applications will run OK but we can't access the contents of // the subdirectory to check them. strlcpy(full_path, basepath, sizeof(full_path)); if ((depth > 1) && (errno == EACCES)) { @@ -515,7 +515,7 @@ static int CheckNestedDirectories( dp = readdir(dirp); if (dp == NULL) break; // End of list - + if (dp->d_name[0] == '.') continue; // Ignore names beginning with '.' @@ -534,12 +534,12 @@ static int CheckNestedDirectories( retval = -1202; break; } else { // Slots - // Graphics apps called by screensaver or Manager (via Show + // Graphics apps called by screensaver or Manager (via Show // Graphics button) now write files in their slot directory // as the logged in user, not boinc_master. In most cases, // the manager or screensaver will tell the client to fix - // all ownerships in that slot directory, but a crash can - // prevent that. As a backup strategy, we ignore ownership + // all ownerships in that slot directory, but a crash can + // prevent that. As a backup strategy, we ignore ownership // of files in slot directories under the Manager, and fix // them in the client. #if (! defined(__WXMAC__) && ! defined(_MAC_INSTALLER)) @@ -559,23 +559,23 @@ static int CheckNestedDirectories( } // isSlotDir } // bad uid } else { // depth == 1 - // project & slot directories (projects/setiathome.berkeley.edu, slots/0 etc.) + // project & slot directories (projects/setiathome.berkeley.edu, slots/0 etc.) // must have owner boinc_master if (sbuf.st_uid != boinc_master_uid) { retval = -1202; break; } } - + if (use_sandbox) { if (sbuf.st_gid != boinc_project_gid) { retval = -1201; break; } - + if (isDirectory) { if (depth == 1) { - // project & slot directories (projects/setiathome.berkeley.edu, slots/0 etc.) + // project & slot directories (projects/setiathome.berkeley.edu, slots/0 etc.) // must be readable & executable by other if ((sbuf.st_mode & 0777) != 0775) { retval = -1203; @@ -600,10 +600,10 @@ static int CheckNestedDirectories( } } // if (use_sandbox) } // if (!S_ISLNK(sbuf.st_mode)) - + if (isDirectory && !S_ISLNK(sbuf.st_mode)) { if (use_sandbox && (depth > 1)) { -#if 0 // No longer check project-created subdirectories under project or slot directories +#if 0 // No longer check project-created subdirectories under project or slot directories // because we have not told projects these must be readable and executable by group if ((! isManager) && (sbuf.st_uid != boinc_master_uid)) #endif @@ -619,7 +619,7 @@ static int CheckNestedDirectories( if (dirp) { closedir(dirp); } - + if (retval && !errShown) { fprintf(stderr, "Permissions error %d at %s\n", retval, full_path); if (path_to_error) { @@ -658,12 +658,12 @@ static void GetPathToThisProcess(char* outbuf, size_t maxLen) { pid_t aPID = getpid(); *outbuf = '\0'; - + snprintf(buf, sizeof(buf), "ps -xwo command -p %d", (int)aPID); f = popen(buf, "r"); if (f == NULL) return; - + PersistentFGets (outbuf, maxLen, f); // Discard header line PersistentFGets (outbuf, maxLen, f); pclose(f); @@ -672,7 +672,7 @@ static void GetPathToThisProcess(char* outbuf, size_t maxLen) { p = strchr(outbuf, '\n'); if (p) *p = '\0'; - + // Strip off any arguments p = strstr(outbuf, " -"); q = p; @@ -683,7 +683,7 @@ static void GetPathToThisProcess(char* outbuf, size_t maxLen) { break; } } - + if (q) *q = '\0'; } @@ -704,7 +704,7 @@ bool IsUserInGroup(char* groupName) { return true; // User's primary group is boinc_master } - // On some systems with Automatic Login set, getlogin() returns "root" for a + // On some systems with Automatic Login set, getlogin() returns "root" for a // time after the system is first booted, so we check "USER" environment variable. userName = getenv("USER"); if (userName) { diff --git a/client/client_msgs.cpp b/client/client_msgs.cpp index 4115d876f4a..669e70e217c 100644 --- a/client/client_msgs.cpp +++ b/client/client_msgs.cpp @@ -130,7 +130,7 @@ void show_message( #endif // print message to the debugger view port - diagnostics_trace_to_debugger(evt_message); + diagnostics_trace_to_debugger(evt_message); } #endif diff --git a/client/client_state.cpp b/client/client_state.cpp index c5309a17cc4..3d27daf8016 100644 --- a/client/client_state.cpp +++ b/client/client_state.cpp @@ -363,7 +363,7 @@ void CLIENT_STATE::set_now() { #ifdef _WIN32 // On Win, check for evidence that we're awake after a suspension // (in case we missed the event announcing this) - // + // if (os_requested_suspend) { if (x > now+10) { msg_printf(0, MSG_INFO, "Resuming after OS suspension"); @@ -584,9 +584,9 @@ int CLIENT_STATE::init() { } } coprocs.add_other_coproc_types(); - + host_info.coprocs = coprocs; - + if (coprocs.none() ) { msg_printf(NULL, MSG_INFO, "No usable GPUs found"); } @@ -812,7 +812,7 @@ int CLIENT_STATE::init() { #endif http_ops->cleanup_temp_files(); - + // must parse env vars after parsing state file // otherwise items will get overwritten with state file info // diff --git a/client/client_types.cpp b/client/client_types.cpp index 7d78aa587f5..afe9aa9d143 100644 --- a/client/client_types.cpp +++ b/client/client_types.cpp @@ -685,7 +685,7 @@ bool FILE_INFO::had_failure(int& failnum) { void FILE_INFO::failure_message(string& s) { char buf[1024]; - snprintf(buf, sizeof(buf), + snprintf(buf, sizeof(buf), "\n" " %s\n" " %d (%s)\n", @@ -1432,7 +1432,7 @@ void USER_CPIDS::init_from_projects() { strcpy(uc.cpid, p->cross_project_id); uc.time = p->user_create_time; cpids.push_back(uc); - + } } } diff --git a/client/cpu_benchmark.h b/client/cpu_benchmark.h index f20c182bed6..5e6c082efcd 100644 --- a/client/cpu_benchmark.h +++ b/client/cpu_benchmark.h @@ -18,7 +18,7 @@ #define MAX_CPU_BENCHMARKS_SECONDS 300 #define CPU_BENCHMARKS_RUNNING 0 #define CPU_BENCHMARKS_COMPLETE 1 -#define CPU_BENCHMARKS_NOT_RUNNING 2 +#define CPU_BENCHMARKS_NOT_RUNNING 2 #define CPU_BENCHMARKS_ERROR 3 #define BM_TYPE_FP 0 diff --git a/client/cpu_sched.cpp b/client/cpu_sched.cpp index ecf55b78d4f..ca1cf379999 100644 --- a/client/cpu_sched.cpp +++ b/client/cpu_sched.cpp @@ -204,7 +204,7 @@ struct PROC_RESOURCES { if (log_flags.cpu_sched_debug) { msg_printf(rp->project, MSG_INFO, "[cpu_sched_debug] add to run list: %s (%s, %s) (prio %f)", - rp->name, + rp->name, rsc_name_long(rt), is_edf?"EDF":"FIFO", rp->project->sched_priority diff --git a/client/cs_account.cpp b/client/cs_account.cpp index 6174437782f..5fbabc61dc3 100644 --- a/client/cs_account.cpp +++ b/client/cs_account.cpp @@ -466,7 +466,7 @@ int PROJECT::write_statistics_file() { get_statistics_filename(master_url, path, sizeof(path)); f = boinc_fopen(TEMP_STATS_FILE_NAME, "w"); if (!f) return ERR_FOPEN; - fprintf(f, + fprintf(f, "\n" " %s\n", master_url @@ -475,7 +475,7 @@ int PROJECT::write_statistics_file() { for (std::vector::iterator i=statistics.begin(); i!=statistics.end(); ++i ) { - fprintf(f, + fprintf(f, " \n" " %f\n" " %f\n" @@ -491,7 +491,7 @@ int PROJECT::write_statistics_file() { ); } - fprintf(f, + fprintf(f, "\n" ); diff --git a/client/cs_apps.cpp b/client/cs_apps.cpp index 768acf9fe4f..ae24a110340 100644 --- a/client/cs_apps.cpp +++ b/client/cs_apps.cpp @@ -235,7 +235,7 @@ int CLIENT_STATE::task_files_present( WORKUNIT* wup = rp->wup; FILE_INFO* fip; unsigned int i; - APP_VERSION* avp = rp->avp; + APP_VERSION* avp = rp->avp; int retval, ret = 0; for (i=0; iapp_files.size(); i++) { @@ -278,7 +278,7 @@ int CLIENT_STATE::verify_app_version_files(RESULT* rp) { PROJECT* project = rp->project; if (project->anonymous_platform) return 0; - APP_VERSION* avp = rp->avp; + APP_VERSION* avp = rp->avp; for (unsigned int i=0; iapp_files.size(); i++) { fip = avp->app_files[i].file_info; int retval = fip->verify_file(true, true, false); diff --git a/client/cs_benchmark.cpp b/client/cs_benchmark.cpp index 3483419333f..e215e37738d 100644 --- a/client/cs_benchmark.cpp +++ b/client/cs_benchmark.cpp @@ -175,21 +175,21 @@ int cpu_benchmarks(BENCHMARK_DESC* bdp) { #if defined(ANDROID) && defined(__arm__) #if defined(ARMV6) retval = whetstone(host_info.p_fpops, fp_time, MIN_CPU_TIME); -#else +#else // check for FP accelerator: VFP, Neon, or none; // run the appropriate version of Whetstone // (separated using namespaces) // - if (strstr(gstate.host_info.p_features, " neon ")) { + if (strstr(gstate.host_info.p_features, " neon ")) { // have ARM neon FP capabilities retval = android_neon::whetstone(host_info.p_fpops, fp_time, MIN_CPU_TIME); - } else if (strstr(gstate.host_info.p_features, " vfp ")) { + } else if (strstr(gstate.host_info.p_features, " vfp ")) { // have ARM vfp FP capabilities retval = android_vfp::whetstone(host_info.p_fpops, fp_time, MIN_CPU_TIME); } else { // just run normal test retval = whetstone(host_info.p_fpops, fp_time, MIN_CPU_TIME); } -#endif +#endif #else retval = whetstone(host_info.p_fpops, fp_time, MIN_CPU_TIME); #endif diff --git a/client/cs_cmdline.cpp b/client/cs_cmdline.cpp index 9d26181a3b7..1d14ec7b8b7 100644 --- a/client/cs_cmdline.cpp +++ b/client/cs_cmdline.cpp @@ -249,10 +249,10 @@ void CLIENT_STATE::parse_cmdline(int argc, char** argv) { printf(BOINC_VERSION_STRING " " HOSTTYPE "\n"); exit(0); #ifdef __APPLE__ - // workaround for bug in XCode 4.2: accept but ignore - // argument -NSDocumentRevisionsDebugMode=YES + // workaround for bug in XCode 4.2: accept but ignore + // argument -NSDocumentRevisionsDebugMode=YES } else if (ARG(NSDocumentRevisionsDebugMode)) { - ++i; + ++i; #endif // detect_gpus is for internal use only - do not // add it to show_options() or doc/client.php diff --git a/client/cs_notice.cpp b/client/cs_notice.cpp index 6790a3f0bfc..d6c23acd459 100644 --- a/client/cs_notice.cpp +++ b/client/cs_notice.cpp @@ -417,7 +417,7 @@ bool NOTICES::remove_dups(NOTICE& n) { } // add a notice. -// +// bool NOTICES::append(NOTICE& n) { if (log_flags.notice_debug) { msg_printf(0, MSG_INFO, diff --git a/client/cs_prefs.cpp b/client/cs_prefs.cpp index 9ac10c217ee..dedbe47eee9 100644 --- a/client/cs_prefs.cpp +++ b/client/cs_prefs.cpp @@ -119,7 +119,7 @@ int CLIENT_STATE::get_disk_usages() { // - each project has a "disk_resource_share" (DRS) // This is the resource share plus .1*(max resource share). // This ensures that backup projects get some disk. -// - each project has a "desired_disk_usage (DDU)", +// - each project has a "desired_disk_usage (DDU)", // which is either its current usage // or an amount sent from the scheduler. // - each project has a "quota": (available space)*(drs/total_drs). @@ -289,7 +289,7 @@ int CLIENT_STATE::check_suspend_processing() { return SUSPEND_REASON_BATTERY_CHARGING; } } - + // user active. // Do this check after checks that user can not influence on Android. // E.g. @@ -417,7 +417,7 @@ void CLIENT_STATE::check_suspend_network() { ); switch(network_run_mode.get_current()) { - case RUN_MODE_ALWAYS: + case RUN_MODE_ALWAYS: goto done; case RUN_MODE_NEVER: file_xfers_suspended = true; @@ -463,7 +463,7 @@ void CLIENT_STATE::check_suspend_network() { if (!recent_rpc) network_suspended = true; network_suspend_reason = SUSPEND_REASON_USER_ACTIVE; } -#endif +#endif if (global_prefs.net_times.suspended(now)) { file_xfers_suspended = true; if (!recent_rpc) network_suspended = true; diff --git a/client/cs_statefile.cpp b/client/cs_statefile.cpp index eea7d819461..323728bc6d6 100644 --- a/client/cs_statefile.cpp +++ b/client/cs_statefile.cpp @@ -273,7 +273,7 @@ int CLIENT_STATE::parse_state_file_aux(const char* fname) { ); delete avp; continue; - } + } if (strlen(avp->platform) == 0) { safe_strcpy(avp->platform, get_primary_platform()); } else { @@ -540,7 +540,7 @@ int CLIENT_STATE::parse_state_file_aux(const char* fname) { } sort_results(); fclose(f); - + // if total resource share is zero, set all shares to 1 // if (projects.size()) { @@ -620,7 +620,7 @@ int CLIENT_STATE::write_state_file() { for (attempt=1; attempt<=MAX_STATE_FILE_WRITE_ATTEMPTS; attempt++) { if (attempt > 1) boinc_sleep(1.0); - + if (log_flags.statefile_debug) { msg_printf(0, MSG_INFO, "[statefile] Writing state file" @@ -681,7 +681,7 @@ int CLIENT_STATE::write_state_file() { if (attempt < MAX_STATE_FILE_WRITE_ATTEMPTS) continue; } } - + retval = boinc_rename(STATE_FILE_NAME, STATE_FILE_PREV); if (retval) { if ((attempt == MAX_STATE_FILE_WRITE_ATTEMPTS) || log_flags.statefile_debug) { @@ -691,8 +691,8 @@ int CLIENT_STATE::write_state_file() { windows_format_error_string(GetLastError(), win_error_msg, sizeof(win_error_msg)) ); #else - msg_printf(0, MSG_INFO, - "Can't rename current state file to previous state file: %s", + msg_printf(0, MSG_INFO, + "Can't rename current state file to previous state file: %s", strerror(errno) ); #endif @@ -708,7 +708,7 @@ int CLIENT_STATE::write_state_file() { ); } if (!retval) break; // Success! - + if ((attempt == MAX_STATE_FILE_WRITE_ATTEMPTS) || log_flags.statefile_debug) { #ifdef _WIN32 msg_printf(0, MSG_INFO, diff --git a/client/current_version.cpp b/client/current_version.cpp index 48a1338c017..24b6a11ab10 100644 --- a/client/current_version.cpp +++ b/client/current_version.cpp @@ -28,15 +28,15 @@ #include "current_version.h" -// NVC_CONFIG allows branded installers to have the client check for a new +// NVC_CONFIG allows branded installers to have the client check for a new // branded client on their serve instead of checking the Berkeley server for // a new standard (unbranded) BOINC client. // -// If the nvc_config.xml file is absent from the BOINC Data folder, use +// If the nvc_config.xml file is absent from the BOINC Data folder, use // default values (Berkeley server.) -// Unbranded BOINC should not have an nvc_config.xml file. +// Unbranded BOINC should not have an nvc_config.xml file. // Branded installers can create or replace this file to customize these values. -// Standard (unbranded) BOINC installers should either delete the file or +// Standard (unbranded) BOINC installers should either delete the file or // create or replace it with one containing default values. NVC_CONFIG nvc_config; @@ -167,7 +167,7 @@ static int get_current_macos_version() { if (buf[0] == '\0') { return 0; } - + // Extract the major system version number vers = atoi(buf) * 10000; // Extract the minor system version number @@ -201,7 +201,7 @@ static bool parse_version(FILE* f, char* new_version, int len) { while (!xp.get_tag()) { if (xp.match_tag("/version")) { #ifdef __APPLE__ - return (same_platform + return (same_platform && newer_version_exists && min_macos_OK && max_macos_OK @@ -215,9 +215,9 @@ static bool parse_version(FILE* f, char* new_version, int len) { } if (xp.parse_str("version_num", buf2, sizeof(buf2))) { newer_version_exists = is_version_newer( - buf2, - gstate.core_client_version.major, - gstate.core_client_version.minor, + buf2, + gstate.core_client_version.major, + gstate.core_client_version.minor, gstate.core_client_version.release ); strlcpy(new_version, buf2, len); @@ -247,7 +247,7 @@ static void show_newer_version_msg(const char* new_vers) { _("Download") ); } else { - snprintf(buf, sizeof(buf), _("A new version of %s is available"), + snprintf(buf, sizeof(buf), _("A new version of %s is available"), nvc_config.client_new_version_name.c_str() ); msg_printf_notice(0, true, NULL, @@ -282,11 +282,11 @@ void GET_CURRENT_VERSION_OP::handle_reply(int http_op_retval) { } } fclose(f); - + if (newest_version[0]) { show_newer_version_msg(newest_version); } - + // Cache neweer version number. Empty string if no newer version gstate.newer_version = string(newest_version); } @@ -306,9 +306,9 @@ void newer_version_startup_check() { } if (!gstate.newer_version.empty()) { - if (is_version_newer(gstate.newer_version.c_str(), - gstate.core_client_version.major, - gstate.core_client_version.minor, + if (is_version_newer(gstate.newer_version.c_str(), + gstate.core_client_version.major, + gstate.core_client_version.minor, gstate.core_client_version.release) ) { show_newer_version_msg(gstate.newer_version.c_str()); diff --git a/client/file_xfer.cpp b/client/file_xfer.cpp index ef5c0a618c2..012d53ce856 100644 --- a/client/file_xfer.cpp +++ b/client/file_xfer.cpp @@ -112,7 +112,7 @@ int FILE_XFER::init_upload(FILE_INFO& file_info) { } if (file_info.upload_offset < 0) { bytes_xferred = 0; - snprintf(header, sizeof(header), + snprintf(header, sizeof(header), "\n" " %d\n" " %d\n" @@ -130,7 +130,7 @@ int FILE_XFER::init_upload(FILE_INFO& file_info) { ); } else { bytes_xferred = file_info.upload_offset; - snprintf(header, sizeof(header), + snprintf(header, sizeof(header), "\n" " %d\n" " %d\n" diff --git a/client/file_xfer.h b/client/file_xfer.h index 0f4dfaf7b1f..2f380c2e5b0 100644 --- a/client/file_xfer.h +++ b/client/file_xfer.h @@ -21,7 +21,7 @@ // A FILE_XFER object represents a file transfer "episode" // (see pers_file_xfer.h), i.e. an HTTP transaction with a // particular data server. -// +// #include "client_types.h" #include "http_curl.h" diff --git a/client/gpu_amd.cpp b/client/gpu_amd.cpp index 2e5444a19cd..abab0b9100d 100644 --- a/client/gpu_amd.cpp +++ b/client/gpu_amd.cpp @@ -448,9 +448,9 @@ void COPROC_ATI::correlate( // * It must be called from a separate child process on // dual-GPU laptops (e.g., Macbook Pros) with the results // communicated to the main client process via IPC or a -// temp file. See the comments about dual-GPU laptops +// temp file. See the comments about dual-GPU laptops // in gpu_detect.cpp and main.cpp for more details. -// * The CAL library must be loaded and calInit() called +// * The CAL library must be loaded and calInit() called // first. // * See client/coproc_detect.cpp and cpu_sched.cpp in // BOINC 6.12.36 for an earlier attempt to call this diff --git a/client/gpu_detect.cpp b/client/gpu_detect.cpp index 10bb864b91d..37c963db0ac 100644 --- a/client/gpu_detect.cpp +++ b/client/gpu_detect.cpp @@ -155,13 +155,13 @@ void COPROCS::detect_gpus(vector &warnings) { #endif try { ati.get(warnings); - } + } catch (...) { gpu_warning(warnings, "Caught SIGSEGV in ATI GPU detection"); } try { intel_gpu.get(warnings); - } + } catch (...) { gpu_warning(warnings, "Caught SIGSEGV in INTEL GPU detection"); } @@ -179,7 +179,7 @@ void COPROCS::detect_gpus(vector &warnings) { } else { nvidia.get(warnings); } - + #ifndef __APPLE__ // ATI does not yet support CAL on Macs if (setjmp(resume)) { @@ -224,7 +224,7 @@ void COPROCS::correlate_gpus( intel_gpu.correlate(use_all, ignore_gpu_instance[PROC_TYPE_INTEL_GPU]); correlate_opencl(use_all, ignore_gpu_instance); - // NOTE: OpenCL can report a max of only 4GB. + // NOTE: OpenCL can report a max of only 4GB. // for (i=0; i= MAX_RSC) { retval = ERR_BUFFER_OVERFLOW; break; } - + COPROC c; // For device types other than NVIDIA, ATI or Intel GPU. // we put each instance into a separate other_opencls element, @@ -391,9 +391,9 @@ int COPROCS::add_other_coproc_types() { // Don't call COPROCS::add() because duplicate type is legal here coprocs[n_rsc++] = c; - + } - + other_opencls.clear(); return retval; } @@ -408,18 +408,18 @@ int COPROCS::write_coproc_info_file(vector &warnings) { MIOFILE mf; unsigned int i, temp; FILE* f; - + f = boinc_fopen(COPROC_INFO_FILENAME, "wb"); if (!f) return ERR_FOPEN; mf.init_file(f); - + mf.printf(" \n"); if (nvidia.have_cuda) { mf.printf(" 1\n"); mf.printf(" %d\n", nvidia.cuda_version); } - + for (i=0; i &warnings) { fclose(f); return ERR_XML_PARSE; } - + while (!xp.get_tag()) { if (xp.match_tag("/coprocs")) { fclose(f); @@ -536,7 +536,7 @@ int COPROCS::read_coproc_info_file(vector &warnings) { } continue; } - + if (xp.match_tag("ati_opencl")) { ati_opencl.clear(); retval = ati_opencl.parse(xp, "/ati_opencl"); @@ -596,7 +596,7 @@ int COPROCS::read_coproc_info_file(vector &warnings) { } continue; } - + if (xp.parse_string("warning", s)) { warnings.push_back(s); continue; @@ -606,7 +606,7 @@ int COPROCS::read_coproc_info_file(vector &warnings) { // gstate.host_info.have_cpu_opencl // gstate.host_info.cpu_opencl_prop } - + fclose(f); return ERR_XML_PARSE; } @@ -620,7 +620,7 @@ int COPROCS::launch_child_process_to_detect_gpus() { char quoted_data_dir[MAXPATHLEN+2]; char data_dir[MAXPATHLEN]; int retval = 0; - + retval = boinc_delete_file(COPROC_INFO_FILENAME); if (retval) { msg_printf(0, MSG_INFO, @@ -633,7 +633,7 @@ int COPROCS::launch_child_process_to_detect_gpus() { boinc_sleep(0.01); } } - + // use full path to exe if possible, otherwise keep using argv[0] char execpath[MAXPATHLEN]; if (!get_real_executable_path(execpath, sizeof(execpath))) { @@ -666,15 +666,15 @@ int COPROCS::launch_child_process_to_detect_gpus() { quoted_data_dir ); } - + int argc = 4; char* const argv[5] = { const_cast(client_path), - const_cast("--detect_gpus"), - const_cast("--dir"), + const_cast("--detect_gpus"), + const_cast("--dir"), const_cast(quoted_data_dir), NULL - }; + }; retval = run_program( client_dir, diff --git a/client/gpu_nvidia.cpp b/client/gpu_nvidia.cpp index b89f3e4fa2e..d8b4985e098 100644 --- a/client/gpu_nvidia.cpp +++ b/client/gpu_nvidia.cpp @@ -24,7 +24,7 @@ #include "sal.h" /* These are just an annotations. They don't do anything */ #ifndef __success -#define __success(x) +#define __success(x) #endif #ifndef __in #define __in @@ -58,13 +58,13 @@ #endif #ifndef __inout_ecount_part_opt #define __inout_ecount_part_opt(x,y) -#endif +#endif #ifndef __inout_ecount_full_opt #define __inout_ecount_full_opt(x,y) -#endif +#endif #ifndef __out_ecount_full_opt #define __out_ecount_full_opt(x) -#endif +#endif #include "nvapi.h" @@ -132,7 +132,7 @@ static int nvidia_driver_version() { return dri_ver; } -#endif +#endif #endif // SIM // return 1/-1/0 if device 1 is more/less/same capable than device 2. @@ -376,7 +376,7 @@ void* cudalib = NULL; } } #endif - + if (retval) { snprintf(buf, sizeof(buf), "NVIDIA drivers present but no GPUs found"); gpu_warning(warnings, buf); @@ -470,7 +470,7 @@ void* cudalib = NULL; if (!nvidia_gpus.size()) { gpu_warning(warnings, "No CUDA-capable NVIDIA GPUs found"); } - + leave: #ifdef _WIN32 if (cudalib) FreeLibrary(cudalib); @@ -490,7 +490,7 @@ void COPROC_NVIDIA::correlate( unsigned int i; if (!nvidia_gpus.size()) return; - + // identify the most capable non-ignored instance // bool first = true; @@ -542,14 +542,14 @@ void COPROC_NVIDIA::correlate( // See how much RAM is available on this GPU. // // CAUTION: as currently written, this method should be -// called only from COPROC_NVIDIA::get(). If in the +// called only from COPROC_NVIDIA::get(). If in the // future you wish to call it from additional places: // * It must be called from a separate child process on // dual-GPU laptops (e.g., Macbook Pros) with the results // communicated to the main client process via IPC or a -// temp file. See the comments about dual-GPU laptops +// temp file. See the comments about dual-GPU laptops // in gpu_detect.cpp and main.cpp for more details. -// * The CUDA library must be loaded and cuInit() called +// * The CUDA library must be loaded and cuInit() called // first. // * See client/coproc_detect.cpp and cpu_sched.cpp in // BOINC 6.12.36 for an earlier attempt to call this @@ -562,7 +562,7 @@ static void get_available_nvidia_ram(COPROC_NVIDIA &cc, vector& warnings int device; void* ctx; char buf[256]; - + cc.available_ram = cc.prop.totalGlobalMem; if (!p_cuDeviceGet) { gpu_warning(warnings, "cuDeviceGet() missing from NVIDIA library"); @@ -623,9 +623,9 @@ static void get_available_nvidia_ram(COPROC_NVIDIA &cc, vector& warnings // * It must be called from a separate child process on // dual-GPU laptops (e.g., Macbook Pros) with the results // communicated to the main client process via IPC or a -// temp file. See the comments about dual-GPU laptops +// temp file. See the comments about dual-GPU laptops // in gpu_detect.cpp and main.cpp for more details. -// * The CUDA library must be loaded and cuInit() called +// * The CUDA library must be loaded and cuInit() called // first. // #if 0 diff --git a/client/gpu_opencl.cpp b/client/gpu_opencl.cpp index 2d207417962..5f0c48a5b11 100644 --- a/client/gpu_opencl.cpp +++ b/client/gpu_opencl.cpp @@ -166,7 +166,7 @@ int compareOSVersionTo(int toMajor, int toMinor) { p1 = strchr(vers, '.'); minor = atoi(p1+1); } - + if (major < toMajor) return -1; if (major > toMajor) return 1; // if (major == toMajor) compare minor version numbers @@ -337,7 +337,7 @@ void COPROCS::get_opencl( } //////////// GPUs and Accelerators ////////////// - + ciErrNum = (*p_clGetDeviceIDs)( platforms[platform_index], (CL_DEVICE_TYPE_GPU | CL_DEVICE_TYPE_ACCELERATOR), @@ -432,15 +432,15 @@ void COPROCS::get_opencl( bool cuda_match_found = false; if (nvidia.have_cuda) { // Mac OpenCL does not recognize all NVIDIA GPUs returned by - // CUDA but we assume that OpenCL and CUDA return devices + // CUDA but we assume that OpenCL and CUDA return devices // with identical model name strings and that OpenCL returns // devices in order of ascending PCI slot. // - // On other systems, assume OpenCL and CUDA return devices + // On other systems, assume OpenCL and CUDA return devices // in the same order. // int saved_CUDA_index = current_CUDA_index; - + while (1) { if (current_CUDA_index >= (int)(nvidia_gpus.size())) { snprintf(buf, sizeof(buf), @@ -494,16 +494,16 @@ void COPROCS::get_opencl( } else { prop.opencl_available_ram = prop.global_mem_size; } - + // Build nvidia_opencls vector in device_num order for (it=nvidia_opencls.begin(); it != nvidia_opencls.end(); ++it) { if (it->device_num > prop.device_num) break; } nvidia_opencls.insert(it, prop); - + if (cuda_match_found) ++current_CUDA_index; } - + //////////// AMD / ATI ////////////// else if (is_AMD(prop.vendor)) { prop.opencl_device_index = device_index; @@ -605,7 +605,7 @@ void COPROCS::get_opencl( opencl_device_index++; // Another OpenCL device from same vendor } } - + prop.device_num = 0; // Each vector entry has only one device prop.opencl_device_index = opencl_device_index; prop.opencl_available_ram = prop.global_mem_size; @@ -632,8 +632,8 @@ void COPROCS::get_opencl( } } } - - // Neither nvidia.count, ati.count nor intel_gpu.count have been set yet, + + // Neither nvidia.count, ati.count nor intel_gpu.count have been set yet, // so we can't test have_nvidia(), have_ati() or have_intel_gpu() here. // if ((nvidia_opencls.size() > 0) || nvidia.have_cuda) max_other_coprocs--; @@ -693,7 +693,7 @@ void COPROCS::correlate_opencl( safe_strcpy(nvidia.prop.name, nvidia.opencl_prop.name); } } - + if (ati_opencls.size() > 0) { if (ati.have_cal) { // If CAL already found the "best" CAL GPU ati.merge_opencl(ati_opencls, ignore_gpu_instance[PROC_TYPE_AMD_GPU]); @@ -705,7 +705,7 @@ void COPROCS::correlate_opencl( safe_strcpy(ati.name, ati.opencl_prop.name); } } - + if (intel_gpu_opencls.size() > 0) { intel_gpu.find_best_opencls(use_all, intel_gpu_opencls, ignore_gpu_instance[PROC_TYPE_INTEL_GPU]); intel_gpu.available_ram = intel_gpu.opencl_prop.global_mem_size; @@ -958,7 +958,7 @@ cl_int COPROCS::get_opencl_info( gpu_warning(warnings, buf); return ciErrNum; } - + ciErrNum = (*p_clGetDeviceInfo)(prop.device_id, CL_DEVICE_SIMD_PER_COMPUTE_UNIT_AMD, sizeof(prop.amd_simd_per_compute_unit), &prop.amd_simd_per_compute_unit, NULL); if (ciErrNum != CL_SUCCESS) { snprintf(buf, sizeof(buf), @@ -1007,7 +1007,7 @@ void COPROC::merge_opencl( for (i=0; imaster_url, gstate.project_init.url)) { - gstate.project_init.remove(); - break; + for (unsigned i=0; imaster_url, gstate.project_init.url)) { + gstate.project_init.remove(); + break; } } @@ -835,10 +835,10 @@ void handle_lookup_account_poll(GUI_RPC_CONN& grc) { ); } else { const char *p = grc.lookup_account_op.reply.c_str(); - const char *q = strstr(p, "(SWITCHER_FILE_NAME); @@ -1343,27 +1343,27 @@ static void stop_graphics_app(pid_t thePID, argv[2] = "-kill_gfx"; argv[3] = pidString; argc = 4; -#else +#else argv[0] = const_cast(SWITCHER_FILE_NAME); argv[1] = "/bin/kill"; argv[2] = "-kill"; argv[3] = (char *)pidString; argc = 4; #endif - // Graphics apps called by screensaver or Manager (via Show + // Graphics apps called by screensaver or Manager (via Show // Graphics button) now write files in their slot directory - // as the logged in user, not boinc_master. This ugly hack + // as the logged in user, not boinc_master. This ugly hack // uses setprojectgrp to fix all ownerships in this slot // directory. - // To fix all ownerships in the slot directory, invoke the - // run_graphics_app RPC with operation "stop", slot number + // To fix all ownerships in the slot directory, invoke the + // run_graphics_app RPC with operation "stop", slot number // for the operand and empty string for screensaverLoginUser // after the graphics app stops. if (theScreensaverLoginUser.empty()) { fix_slot_owners(thePID); // Manager passes slot # instead of PID return; } - + argv[argc++] = "--ScreensaverLoginUser"; safe_strcpy(screensaverLoginUser, theScreensaverLoginUser.c_str()); argv[argc++] = screensaverLoginUser; @@ -1417,7 +1417,7 @@ static void handle_run_graphics_app(GUI_RPC_CONN& grc) { int newPID = 0; ACTIVE_TASK* atp = NULL; char cmd[256]; - + while (!grc.xp.get_tag()) { if (grc.xp.match_tag("/run_graphics_app")) break; if (grc.xp.parse_int("slot", slot)) continue; @@ -1428,7 +1428,7 @@ static void handle_run_graphics_app(GUI_RPC_CONN& grc) { if (grc.xp.parse_int("graphics_pid", thePID)) continue; if (grc.xp.parse_string("ScreensaverLoginUser", theScreensaverLoginUser)) continue; } - + if (stop) { if (theScreensaverLoginUser.empty() ){ if (thePID < 0) { @@ -1485,14 +1485,14 @@ static void handle_run_graphics_app(GUI_RPC_CONN& grc) { getcwd(current_dir, sizeof(current_dir)); if (g_use_sandbox) { - snprintf(switcher_path, sizeof(switcher_path), + snprintf(switcher_path, sizeof(switcher_path), "%s/%s/%s", current_dir, SWITCHER_DIR, SWITCHER_FILE_NAME ); } if (stop) { - stop_graphics_app(thePID, iBrandID, current_dir, switcher_path, + stop_graphics_app(thePID, iBrandID, current_dir, switcher_path, theScreensaverLoginUser, grc); grc.mfout.printf("\n"); return; @@ -1520,7 +1520,7 @@ static void handle_run_graphics_app(GUI_RPC_CONN& grc) { grc.mfout.printf("job has no graphics app\n"); return; } - + execPath = atp->app_version->graphics_exec_path; execName = atp->app_version->graphics_exec_file; execDir = atp->slot_path; @@ -1544,7 +1544,7 @@ static void handle_run_graphics_app(GUI_RPC_CONN& grc) { argv[4] = (char *)theSlot; argc = 5; } - + if (runfullscreen) { argv[argc++] = "--fullscreen"; } @@ -1571,10 +1571,10 @@ static void handle_run_graphics_app(GUI_RPC_CONN& grc) { argv[argc] = 0; retval = run_program(execDir, execPath, argc, argv, newPID); } - + if (retval) { grc.mfout.printf("couldn't run graphics app\n"); - stop_graphics_app(thePID, iBrandID, current_dir, switcher_path, + stop_graphics_app(thePID, iBrandID, current_dir, switcher_path, theScreensaverLoginUser, grc); } else { grc.mfout.printf("\n"); diff --git a/client/hostinfo_network.cpp b/client/hostinfo_network.cpp index d6f0d97e722..cbbdabfbc65 100644 --- a/client/hostinfo_network.cpp +++ b/client/hostinfo_network.cpp @@ -19,7 +19,7 @@ #ifdef _WIN32 #include "boinc_win.h" -#else +#else #include "config.h" #include #include @@ -94,7 +94,7 @@ int HOST_INFO::get_local_network_info() { #endif struct sockaddr_storage s; - + safe_strcpy(domain_name, ""); // it seems like we should use getdomainname() instead of gethostname(), diff --git a/client/hostinfo_unix.cpp b/client/hostinfo_unix.cpp index 35b7b3f6dbd..cec9401f5f7 100644 --- a/client/hostinfo_unix.cpp +++ b/client/hostinfo_unix.cpp @@ -2151,29 +2151,29 @@ union headeru { }; // Get the architecture of this computer's CPU: x86_64 or arm64. -// Read the executable file's mach-o headers to determine the +// Read the executable file's mach-o headers to determine the // architecture(s) of its code. // Returns 1 if application can run natively on this computer, // else returns 0. // -// ToDo: determine whether x86_64 graphics apps emulated on arm64 Macs -// properly run under Rosetta 2. Note: years ago, PowerPC apps emulated +// ToDo: determine whether x86_64 graphics apps emulated on arm64 Macs +// properly run under Rosetta 2. Note: years ago, PowerPC apps emulated // by Rosetta on i386 Macs crashed when running graphics. // bool can_run_on_this_CPU(char* exec_path) { FILE *f; int retval = false; - + headeru myHeader; fat_arch fatHeader; - + static bool x86_64_CPU = false; static bool arm64_cpu = false; static bool need_CPU_architecture = true; uint32_t n, i, len; uint32_t theMagic; integer_t file_architecture; - + if (need_CPU_architecture) { // Determine the architecture of the CPU we are running on // ToDo: adjust this code accordingly. @@ -2181,21 +2181,21 @@ bool can_run_on_this_CPU(char* exec_path) { size_t size = sizeof (cputype); int res = sysctlbyname ("hw.cputype", &cputype, &size, NULL, 0); if (res) return false; // Should never happen - // Since we require MacOS >= 10.7, the CPU must be x86_64 or arm64 + // Since we require MacOS >= 10.7, the CPU must be x86_64 or arm64 x86_64_CPU = ((cputype &0xff) == CPU_TYPE_X86); arm64_cpu = ((cputype &0xff) == CPU_TYPE_ARM); need_CPU_architecture = false; } - + f = boinc_fopen(exec_path, "rb"); if (!f) { return retval; // Should never happen } - + myHeader.fat.magic = 0; myHeader.fat.nfat_arch = 0; - + fread(&myHeader, 1, sizeof(fat_header), f); theMagic = myHeader.mach.magic; switch (theMagic) { diff --git a/client/hostinfo_win.cpp b/client/hostinfo_win.cpp index 7e5daa20b4a..b895ee9fca8 100644 --- a/client/hostinfo_win.cpp +++ b/client/hostinfo_win.cpp @@ -213,7 +213,7 @@ static unsigned long long _xgetbv(unsigned int index){ unsigned int A=0, D=0; #ifdef __GNUC__ - #ifdef ASM_SUPPORTS_XGETBV + #ifdef ASM_SUPPORTS_XGETBV __asm__ __volatile__("xgetbv" : "=a"(A), "=d"(D) : "c"(index)); #else __asm__ __volatile__(".byte 0x0f, 0x01, 0xd0": "=a"(A), "=d"(D) : "c"(index)); @@ -248,14 +248,14 @@ static unsigned long long _xgetbv(unsigned int index){ #else static void __cpuid(unsigned int cpuinfo[4], unsigned int type) { #ifdef __GNUC__ - #ifdef ASM_SUPPORTS_CPUID - __asm__ __volatile__("cpuid" - : "=a" (cpuinfo[0]), "=b" (cpuinfo[1]), - "=c" (cpuinfo[2]), "=d" (cpuinfo[3]) + #ifdef ASM_SUPPORTS_CPUID + __asm__ __volatile__("cpuid" + : "=a" (cpuinfo[0]), "=b" (cpuinfo[1]), + "=c" (cpuinfo[2]), "=d" (cpuinfo[3]) : "a" (type)); #else __asm__ __volatile__(".byte 0x0f, 0xa2" - : "=a" (cpuinfo[0]), "=b" (cpuinfo[1]), + : "=a" (cpuinfo[0]), "=b" (cpuinfo[1]), "=c" (cpuinfo[2]), "=d" (cpuinfo[3]) : "a" (type)); #endif @@ -1202,10 +1202,10 @@ bool is_avx_supported() { // the instruction needs to be conditionally run. unsigned int a,b,c,d; get_cpuid(1, a, b, c, d); - + bool osUsesXSAVE_XRSTORE = c & (1 << 27) || false; bool cpuAVXSuport = c & (1 << 28) || false; - + if (osUsesXSAVE_XRSTORE && cpuAVXSuport) { // Check if the OS will save the YMM registers @@ -1276,7 +1276,7 @@ int get_processor_features(char* vendor, char* features, int features_size) { struc_ext_supported = 1; get_cpuid(0x00000007, struc_eax, struc_ebx, struc_ecx, struc_edx); } - + FEATURE_TEST(std_supported, (std_edx & (1 << 0)), "fpu "); FEATURE_TEST(std_supported, (std_edx & (1 << 1)), "vme "); FEATURE_TEST(std_supported, (std_edx & (1 << 2)), "de "); @@ -1425,7 +1425,7 @@ int get_processor_info( ); #else int family = 0, model = 0, stepping = 0; - get_processor_version(family, model, stepping); + get_processor_version(family, model, stepping); snprintf(p_model, p_model_size, "%s [Family %d Model %d Stepping %d]", processor_name, family, model, stepping diff --git a/client/hostinfo_wsl.cpp b/client/hostinfo_wsl.cpp index 6ab80600f09..211c45fbb0a 100644 --- a/client/hostinfo_wsl.cpp +++ b/client/hostinfo_wsl.cpp @@ -27,7 +27,7 @@ bool get_available_wsls(std::vector& wsls, std::string& default_wsl const std::string lxss_path = "Software\\Microsoft\\Windows\\CurrentVersion\\Lxss"; HKEY hKey; - + default_wsl.clear(); LONG lRet = RegOpenKeyEx(HKEY_CURRENT_USER, @@ -44,7 +44,7 @@ bool get_available_wsls(std::vector& wsls, std::string& default_wsl (LPBYTE)default_wsl_guid, &default_wsl_guid_len); if ((lRet != ERROR_SUCCESS) || (default_wsl_guid_len > buf_len)) return false; - + int i = 0; while(true) { char wsl_guid[buf_len]; @@ -84,7 +84,7 @@ bool get_available_wsls(std::vector& wsls, std::string& default_wsl } RegCloseKey(hSubKey); - } + } } RegCloseKey(hKey); diff --git a/client/http_curl.cpp b/client/http_curl.cpp index 4d754f3b5b4..e3bc770d8e5 100644 --- a/client/http_curl.cpp +++ b/client/http_curl.cpp @@ -680,9 +680,9 @@ int HTTP_OP::libcurl_exec( } #ifdef __APPLE__ - // cURL 7.19.7 with c-ares 1.7.0 did not fall back to IPv4 when IPv6 - // DNS lookup failed on Macs with certain default settings if connected - // to the Internet by an AT&T U-Verse 2-Wire Gateway. This work-around + // cURL 7.19.7 with c-ares 1.7.0 did not fall back to IPv4 when IPv6 + // DNS lookup failed on Macs with certain default settings if connected + // to the Internet by an AT&T U-Verse 2-Wire Gateway. This work-around // may not be needed any more for cURL 7.21.7, but keep it to be safe. curl_easy_setopt(curlEasy, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4); #endif @@ -796,7 +796,7 @@ void HTTP_OP::setup_proxy_session(bool no_proxy) { } else { curl_easy_setopt(curlEasy, CURLOPT_PROXYAUTH, CURLAUTH_ANY); } - snprintf(m_curl_user_credentials, sizeof(m_curl_user_credentials), + snprintf(m_curl_user_credentials, sizeof(m_curl_user_credentials), "%s:%s", pi.http_user_name, pi.http_user_passwd ); @@ -817,7 +817,7 @@ void HTTP_OP::setup_proxy_session(bool no_proxy) { if ( strlen(pi.socks5_user_passwd) || strlen(pi.socks5_user_name) ) { - snprintf(m_curl_user_credentials, sizeof(m_curl_user_credentials), + snprintf(m_curl_user_credentials, sizeof(m_curl_user_credentials), "%s:%s", pi.socks5_user_name, pi.socks5_user_passwd ); diff --git a/client/http_curl.h b/client/http_curl.h index 8c47cba3158..03e9c6e2325 100644 --- a/client/http_curl.h +++ b/client/http_curl.h @@ -57,7 +57,7 @@ class HTTP_OP { PROXY_INFO pi; PROJECT* project; // associated project, if any - char m_url[1024]; + char m_url[1024]; char m_curl_user_credentials[1024]; // string needed for proxy username/password @@ -90,7 +90,7 @@ class HTTP_OP { // // reply is always written to a file char outfile[256]; - // if specified, it's written to this file w/ optional offset + // if specified, it's written to this file w/ optional offset // otherwise it's written to a temp file // if type POST2, copy output to req1 buffer int req1_len; @@ -176,7 +176,7 @@ class HTTP_OP { private: // take an init_get/post/post2 and turns it into a libcurl request // - int libcurl_exec(const char* url, const char* in, const char* out, + int libcurl_exec(const char* url, const char* in, const char* out, double offset, double size, bool is_post ); }; diff --git a/client/install-sh b/client/install-sh index e9de23842dc..594a4edbffd 100644 --- a/client/install-sh +++ b/client/install-sh @@ -115,7 +115,7 @@ fi if [ x"$dir_arg" != x ]; then dst=$src src="" - + if [ -d $dst ]; then instcmd=: chmodcmd="" @@ -125,7 +125,7 @@ if [ x"$dir_arg" != x ]; then else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command -# might cause directories to be created, which would be especially bad +# might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] @@ -135,7 +135,7 @@ else echo "install: $src does not exist" exit 1 fi - + if [ x"$dst" = x ] then echo "install: no destination specified" @@ -163,7 +163,7 @@ dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then -defaultIFS=' +defaultIFS=' ' IFS="${IFS-${defaultIFS}}" @@ -202,17 +202,17 @@ else # If we're going to rename the final executable, determine the name now. - if [ x"$transformarg" = x ] + if [ x"$transformarg" = x ] then dstfile=`basename $dst` else - dstfile=`basename $dst $transformbasename | + dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename - if [ x"$dstfile" = x ] + if [ x"$dstfile" = x ] then dstfile=`basename $dst` else @@ -243,7 +243,7 @@ else # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && - $doit $mvcmd $dsttmp $dstdir/$dstfile + $doit $mvcmd $dsttmp $dstdir/$dstfile fi && diff --git a/client/log_flags.cpp b/client/log_flags.cpp index 1e585ba2334..842d6a4f283 100644 --- a/client/log_flags.cpp +++ b/client/log_flags.cpp @@ -469,8 +469,8 @@ int CC_CONFIG::parse_options_client(XML_PARSER& xp) { if (xp.parse_string("device_name", device_name)) continue; // The following tags have been moved to nvc_config and NVC_CONFIG_FILE, - // but CC_CONFIG::write() in older clients - // may have written their default values to CONFIG_FILE. + // but CC_CONFIG::write() in older clients + // may have written their default values to CONFIG_FILE. // Silently skip them if present. // if (xp.parse_string("client_download_url", s)) continue; diff --git a/client/mac_address.cpp b/client/mac_address.cpp index 03de5281b6e..9cd1c5aa8f6 100644 --- a/client/mac_address.cpp +++ b/client/mac_address.cpp @@ -70,7 +70,7 @@ #if defined(__FreeBSD__) #include #include -#endif +#endif #include "mac_address.h" @@ -164,7 +164,7 @@ int get_mac_address(char* address) { PIP_ADAPTER_INFO pAdapterInfo = AdapterInfo; // Contains pointer to current adapter info while (pAdapterInfo) { snprintf(address, sizeof(address), "%02x:%02x:%02x:%02x:%02x:%02x", - pAdapterInfo->Address[0], pAdapterInfo->Address[1], pAdapterInfo->Address[2], + pAdapterInfo->Address[0], pAdapterInfo->Address[1], pAdapterInfo->Address[2], pAdapterInfo->Address[3], pAdapterInfo->Address[4], pAdapterInfo->Address[5] ); if (pAdapterInfo->Type == MIB_IF_TYPE_ETHERNET) break; @@ -250,7 +250,7 @@ int get_mac_address(char* address) { #else struct ifreq *item = &ifr[i]; #endif - struct ether_addr *hw_addr; + struct ether_addr *hw_addr; /* Get the MAC address */ #ifdef SIOCGIFHWADDR if(ioctl(sck, SIOCGIFHWADDR, item) < 0) { @@ -265,7 +265,7 @@ int get_mac_address(char* address) { close(sck); return -1; } - hw_addr = (struct ether_addr *)&(item->lifr_lifru.lifru_enaddr); + hw_addr = (struct ether_addr *)&(item->lifr_lifru.lifru_enaddr); #elif defined(__FreeBSD__) struct ifaddrs *ifap, *ifaptr; unsigned char *ptr; diff --git a/client/main.cpp b/client/main.cpp index 0c10f5827e5..75f376a0282 100644 --- a/client/main.cpp +++ b/client/main.cpp @@ -231,7 +231,7 @@ static void init_core_client(int argc, char** argv) { #endif read_config_file(true); - + // NOTE: this must be called BEFORE newer_version_startup_check() // Only branded builds of BOINC should have an nvc_config.xml file // in the BOINC Data directory. See comments in current_version.cpp. @@ -239,7 +239,7 @@ static void init_core_client(int argc, char** argv) { if (read_nvc_config_file()) { // msg_printf(NULL, MSG_INFO, "nvc_config.xml not found - using defaults"); } - + // Win32 - detach from console if requested #ifdef _WIN32 if (gstate.detach_console) { @@ -271,7 +271,7 @@ static void init_core_client(int argc, char** argv) { // static void do_gpu_detection(int argc, char** argv) { vector warnings; - + boinc_install_signal_handlers(); gstate.parse_cmdline(argc, argv); gstate.now = dtime(); diff --git a/client/net_stats.cpp b/client/net_stats.cpp index 558df99ff27..bd90bd0ecd8 100644 --- a/client/net_stats.cpp +++ b/client/net_stats.cpp @@ -271,10 +271,10 @@ void NET_STATUS::poll() { // otherwise might show spurious "need connection" message // if (gstate.now < gstate.last_wakeup_time + 30) return; - // wait until after a round of automatic proxy detection + // wait until after a round of automatic proxy detection // before attempting to contact the reference site // - if (working_proxy_info.autodetect_proxy_supported && + if (working_proxy_info.autodetect_proxy_supported && working_proxy_info.need_autodetect_proxy_settings && !working_proxy_info.have_autodetect_proxy_settings) return; diff --git a/client/os2/boinc_attach.cmd b/client/os2/boinc_attach.cmd index 6321e710806..9c6a2c34a92 100644 --- a/client/os2/boinc_attach.cmd +++ b/client/os2/boinc_attach.cmd @@ -1,4 +1,4 @@ -/* +/* * Boinc Attach - (c) 2005 Yuri Dario * * Attach a new project to boinc client diff --git a/client/project.h b/client/project.h index d7c06da34d3..56b6d0ca427 100644 --- a/client/project.h +++ b/client/project.h @@ -188,7 +188,7 @@ struct PROJECT : PROJ_AM { bool dont_use_dcf; bool suspended_via_gui; - bool dont_request_more_work; + bool dont_request_more_work; // Return work, but don't request more // Used for a clean exit to a project, // or if a user wants to pause doing work for the project @@ -219,7 +219,7 @@ struct PROJECT : PROJ_AM { // If it's the last one, set project_files_downloaded_time to now void update_duration_correction_factor(ACTIVE_TASK*); - + // fields used by CPU scheduler and work fetch // everything from here on applies only to CPU intensive projects diff --git a/client/result.cpp b/client/result.cpp index 20d707b0354..c5f4bd57291 100644 --- a/client/result.cpp +++ b/client/result.cpp @@ -440,7 +440,7 @@ int RESULT::write_gui(MIOFILE& out, bool check_resources) { } } // update app version resources - if (strlen(resources)>1) { + if (strlen(resources)>1) { char buf[256]; safe_strcpy(buf, ""); if (atp && atp->scheduler_state == CPU_SCHED_SCHEDULED) { diff --git a/client/result.h b/client/result.h index 40743d50908..38cf2a8a1a0 100644 --- a/client/result.h +++ b/client/result.h @@ -129,7 +129,7 @@ struct RESULT { } inline bool computing_done() { - if (state() >= RESULT_COMPUTE_ERROR) return true; + if (state() >= RESULT_COMPUTE_ERROR) return true; if (ready_to_report) return true; return false; } diff --git a/client/rrsim_test.cpp b/client/rrsim_test.cpp index 46f989cf90c..602c5bd7532 100644 --- a/client/rrsim_test.cpp +++ b/client/rrsim_test.cpp @@ -366,7 +366,7 @@ bool CLIENT_STATE::rr_simulation() { if (end_time < buf_end) { d_time = buf_end - end_time; // if this is the last result for this project, account for the tail - if (!pbest->active.size()) { + if (!pbest->active.size()) { pbest->cpu_shortfall += d_time * proj_cpu_share; if (log_flags.rr_simulation) { msg_printf(pbest, MSG_INFO, "rr_sim proj out of work; shortfall %f d %f pcs %f", @@ -379,7 +379,7 @@ bool CLIENT_STATE::rr_simulation() { msg_printf(0, MSG_INFO, "rr_sim total: idle cpus %d, last active %d, active %d, shortfall %f", nidle_cpus, last_active_size, (int)active.size(), cpu_shortfall - + ); msg_printf(0, MSG_INFO, "rr_sim proj %s: last active %d, active %d, shortfall %f", diff --git a/client/sandbox.cpp b/client/sandbox.cpp index 4ca8e928422..86255be6c8a 100644 --- a/client/sandbox.cpp +++ b/client/sandbox.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include @@ -48,10 +48,10 @@ bool g_use_sandbox = false; #ifndef _WIN32 -// POSIX requires that shells run from an application will use the -// real UID and GID if different from the effective UID and GID. -// Mac OS 10.4 did not enforce this, but OS 10.5 does. Since -// system() invokes a shell, we can't use it to run the switcher +// POSIX requires that shells run from an application will use the +// real UID and GID if different from the effective UID and GID. +// Mac OS 10.4 did not enforce this, but OS 10.5 does. Since +// system() invokes a shell, we can't use it to run the switcher // or setprojectgrp utilities, so we must do a fork() and execv(). // int switcher_exec(const char *util_filename, const char* cmdline) { @@ -75,7 +75,7 @@ int switcher_exec(const char *util_filename, const char* cmdline) { perror("pipe() for fds_out failed in switcher_exec"); return ERR_PIPE; } - + if (pipe(fds_err) == -1) { perror("pipe() for fds_err failed in switcher_exec"); return ERR_PIPE; @@ -104,7 +104,7 @@ int switcher_exec(const char *util_filename, const char* cmdline) { // Parent only needs one-way (read) pipes so close write pipes close(fds_out[1]); close(fds_err[1]); - + // Capture stdout output while (1) { ssize_t count = read(fds_out[0], buffer, sizeof(buffer)); @@ -167,10 +167,10 @@ int switcher_exec(const char *util_filename, const char* cmdline) { int kill_via_switcher(int pid) { char cmd[1024]; - + if (!g_use_sandbox) return 0; - // if project application is running as user boinc_project and + // if project application is running as user boinc_project and // client is running as user boinc_master, // we cannot send a signal directly, so use switcher. // @@ -202,7 +202,7 @@ int remove_project_owned_file_or_dir(const char* path) { int get_project_gid() { if (g_use_sandbox) { #ifdef _DEBUG - // GDB can't attach to applications which are running as a different user + // GDB can't attach to applications which are running as a different user // or group, so fix up data with current user and group during debugging gstate.boinc_project_gid = getegid(); #else @@ -214,15 +214,15 @@ int get_project_gid() { return 0; } -// Graphics apps called by screensaver or Manager (via Show +// Graphics apps called by screensaver or Manager (via Show // Graphics button) now write files in their slot directory as -// the logged in user, not boinc_master. This ugly hack uses +// the logged in user, not boinc_master. This ugly hack uses // setprojectgrp to fix all ownerships in this slot directory. #ifdef __APPLE__ int fix_slot_owners(const int slot){ char relative_path[100]; char full_path[MAXPATHLEN]; - + if (g_use_sandbox) { snprintf(relative_path, sizeof(relative_path), "slots/%d", slot); realpath(relative_path, full_path); @@ -247,7 +247,7 @@ int fix_owners_in_directory(char* dir_path) { uid_t boinc_master_uid = -1; uid_t boinc_project_uid = -1; gid_t boinc_project_gid = -1; - + pw = getpwnam(BOINC_MASTER_USER_NAME); if (pw == NULL) return -1; boinc_master_uid = pw->pw_uid; @@ -255,7 +255,7 @@ int fix_owners_in_directory(char* dir_path) { pw = getpwnam(BOINC_PROJECT_USER_NAME); if (pw == NULL) return -1; boinc_project_uid = pw->pw_uid; - + lookup_group(BOINC_PROJECT_GROUP_NAME, boinc_project_gid); dirp = opendir(dir_path); diff --git a/client/scheduler_op.h b/client/scheduler_op.h index 576a556b821..583de64e91b 100644 --- a/client/scheduler_op.h +++ b/client/scheduler_op.h @@ -38,7 +38,7 @@ #define RETRY_CAP 10 // cap on nrpc_failures #define MASTER_FETCH_RETRY_CAP 3 - // after this many master-fetch failures, + // after this many master-fetch failures, // move into a state in which we retry master fetch // at the frequency below #define MASTER_FETCH_INTERVAL (86400) // 1 day @@ -121,9 +121,9 @@ struct SCHEDULER_REPLY { char* code_sign_key_signature; bool message_ack; bool project_is_down; - bool send_file_list; - bool send_full_workload; - bool dont_use_dcf; + bool send_file_list; + bool send_full_workload; + bool dont_use_dcf; int send_time_stats_log; int send_job_log; int scheduler_version; diff --git a/client/scripts/boinc-client.conf b/client/scripts/boinc-client.conf index 10ca6cc73e9..6c87c759ac7 100644 --- a/client/scripts/boinc-client.conf +++ b/client/scripts/boinc-client.conf @@ -24,18 +24,18 @@ #LOCKFILE=/var/run/${BOINCEXE_NAME}.lock -# BOINC options: for the command line when running the client. +# BOINC options: for the command line when running the client. # Be aware that --allow_remote_gui_rpc opens up your machine to the world! # # Add this option if you want to allow boinc manager connections from remote # machines -#BOINCOPTS="--allow_remote_gui_rpc" +#BOINCOPTS="--allow_remote_gui_rpc" # Add this option if you want to turn off all logging #BOINCOPTS="--daemon" # Add this option if you want to redirect logging to the files stderrdae.txt # and stdoutdae.txt in BOINCDIR rather than LOGFILE and ERRORLOG #BOINCOPTS="--redirectio" -# Add this option if you want to run only when no logins from anywhere are +# Add this option if you want to run only when no logins from anywhere are # active #BOINCOPTS="--check_all_logins" # The default is no options. diff --git a/client/scripts/boinc-client.in b/client/scripts/boinc-client.in index 4fb2ed04e6e..9efd7f028e4 100755 --- a/client/scripts/boinc-client.in +++ b/client/scripts/boinc-client.in @@ -1,18 +1,18 @@ -#!/bin/sh +#!/bin/sh # # BOINC - start and stop the BOINC client daemon on Unix # # Unix start/stop script to run the BOINC client as a daemon at # system startup, as the 'boinc' user (not root!). # -# This version should work on unixes that have bash, zsh, or ksh. If -# started with another Bourne compatible shell, it will attempt to restart +# This version should work on unixes that have bash, zsh, or ksh. If +# started with another Bourne compatible shell, it will attempt to restart # in bash, zsh, or ksh. # # Metadata for chkconfig and the SUSE equivalent INIT info are included below. # # Usage: boinc { start | stop | status | reload | restart } -# +# ### # chkconfig: 345 98 02 # description: This script starts the local BOINC client as a daemon @@ -25,7 +25,7 @@ # Provides: boinc # Required-Start: $network # Required-Stop: $network -# Default-Start: 3 4 5 +# Default-Start: 3 4 5 # Default-Stop: 0 1 2 6 # Short-Description: This script monitors the BOINC client. # Description: This script starts the local BOINC client as a daemon @@ -35,15 +35,15 @@ # # Eric Myers - 27 July 2004 # Department of Physics and Astronomy, Vassar College, Poughkeepsie NY -# Eric Myers +# Eric Myers # Spy Hill Research, Poughkeepsie, New York # @(#) $Id: boinc,v 1.10 2007/12/27 20:09:09 myers Exp $ # # Modified by Eric Korpela - 11 Apr 2008 ######################################################################## -# Defaults, which can be overridden by putting new NAME=value lines -# in /etc/sysconfig/boinc-client, /etc/default/boinc-client, +# Defaults, which can be overridden by putting new NAME=value lines +# in /etc/sysconfig/boinc-client, /etc/default/boinc-client, # /etc/boinc-client.conf, or the same files under ${sysconfdir} ## These 4 installation dirs set by autoconf. ########################## @@ -67,7 +67,7 @@ fi ######################################################################## # -# Figure out if we are running under an acceptable shell +# Figure out if we are running under an acceptable shell # (bash, ksh, zsh) which supports functions. # ######################################################################## @@ -86,7 +86,7 @@ if [ -z "$BASH_VERSION" -a -z "$ZSH_VERSION" ] ; then # as far as I can tell we aren't in an approved shell TRIES=`expr $TRIES + 1` # have we tried too many times? - if [ $TRIES -gt 4 ] ; then + if [ $TRIES -gt 4 ] ; then echo "ERROR: endless loop discovered in $0 [ERROR]" exit 1 fi @@ -118,12 +118,12 @@ fi BOINCUSER=boinc # Working directory. Could be /home/boinc, /var/lib/boinc, etc.. -# The reason I prefer /var/lib/boinc is that this works best for a +# The reason I prefer /var/lib/boinc is that this works best for a # cluster of computers where /home/anything might be shared between machines # BOINCDIR=/var/lib/boinc -# Name of the client executable. This is the file "boinc" if you +# Name of the client executable. This is the file "boinc" if you # unpacked the download file boinc_M.mm.rr_i686-pc-linux-gnu.sh, # but I like to rename it and put it in a public place. # (Hint: move boincmgr to /usr/local/bin too so anyone can easily use it). @@ -141,18 +141,18 @@ ERRORLOG=/var/log/${BOINCEXE_NAME}_err.log # PID file PIDFILE=/var/run/${BOINCEXE_NAME}.pid -# BOINC options: for the command line when running the client. +# BOINC options: for the command line when running the client. # Be aware that --allow_remote_gui_rpc opens up your machine to the world! # # Add this option if you want to allow boinc manager connections from remote # machines -#BOINCOPTS="--allow_remote_gui_rpc" +#BOINCOPTS="--allow_remote_gui_rpc" # Add this option if you want to turn off all logging #BOINCOPTS="--daemon" # Add this option if you want to redirect logging to the files stderrdae.txt # and stdoutdae.txt in BOINCDIR rather than LOGFILE and ERRORLOG #BOINCOPTS="--redirectio" -# Add this option if you want to run only when no logins from anywhere are +# Add this option if you want to run only when no logins from anywhere are # active #BOINCOPTS="--check_all_logins" # The default is no options. @@ -196,15 +196,15 @@ else function echo_warning () { $printcol "[WARNING]" ; } function killproc() { PID=`local_pidof $1` - [ $PID ] && kill $PID + [ $PID ] && kill $PID } fi # check if we have pidof. If not use ps and grep for the same job. -if [ -x /sbin/pidof ] ; then - function local_pidof() { - pidof -s -x -o $$ -o $PPID -o %PPID $1 - } +if [ -x /sbin/pidof ] ; then + function local_pidof() { + pidof -s -x -o $$ -o $PPID -o %PPID $1 + } else function local_pidof() { ${PS} xaugww | sed 's/$/ /' | grep "[ /]$1 " | grep -v $$ | grep -v $PPID | grep -v %PPID | grep -v grep | awk '{print $2}' | head -1 @@ -212,12 +212,12 @@ else fi # -# Check if we have runuser, since it will never hang waiting for a password. +# Check if we have runuser, since it will never hang waiting for a password. # If we don't have it, use su for the same job. -# +# if [ ! -x /sbin/runuser ] ; then RUNUSER="su -s /bin/sh" -else +else RUNUSER=runuser fi @@ -248,8 +248,8 @@ none ## find the correct config file for config_file in $config_files ; do - if [ -f ${config_file} ] ; then - break; + if [ -f ${config_file} ] ; then + break; fi done @@ -303,8 +303,8 @@ fi ## Check that BOINCUSER actually exists if [ -z "`grep ^${BOINCUSER}: /etc/passwd`" ] ; then - if [ -z "`ypcat passwd 2>/dev/null | grep ^${BOINCUSER}:`" ] ; then - if [ -z "`nidump passwd / 2>/dev/null | grep ^${BOINCUSER}:`" ] ; then + if [ -z "`ypcat passwd 2>/dev/null | grep ^${BOINCUSER}:`" ] ; then + if [ -z "`nidump passwd / 2>/dev/null | grep ^${BOINCUSER}:`" ] ; then echo -n ERROR: user ${BOINCUSER} does not exist. echo_failure echo @@ -339,7 +339,7 @@ elif [ "${USERNOW}" = "root" ] ; then fi -## Locate the executable, either boinc_client, boinc, +## Locate the executable, either boinc_client, boinc, ## or boinc_M.mm_.... with highest version number ## We only do this if BOINCEXE set above isn't found or is not executable. if [ ! -x $BOINCEXE ]; then @@ -352,7 +352,7 @@ fi if [ ! -x "$BOINCEXE" ]; then echo -n "Cannot find an executable for the BOINC client." echo_failure - echo + echo exit 2 fi @@ -384,10 +384,10 @@ case "$1" in if [ -z "$PID" ] ; then # a lockfile exists, but boinc_client isn't running /bin/rm -f lockfile $LOCKFILE $PIDFILE 2>&1 > /dev/null - else + else echo -n "Another instance of BOINC is running (PID=${PID})." echo_failure - echo + echo exit 1 fi fi @@ -395,24 +395,24 @@ case "$1" in if [ ! -d projects ] ; then echo -n "The BOINC client requires initialization." echo_warning - echo + echo fi touch ${LOGFILE} ${ERRORLOG} NOCORE="ulimit -c 0 2>&1 >/dev/null" echo -n "Starting BOINC client as a daemon: " - if [ "${BOINCUSER}" = "${USERNOW}" ] ; then + if [ "${BOINCUSER}" = "${USERNOW}" ] ; then # I am BOINCUSER. Just start client as me. $NOCORE $BOINCEXE $BOINCOPTS >>$LOGFILE 2>>$ERRORLOG & else chown ${BOINCUSER} ${LOGFILE} ${ERRORLOG} if [ -f gui_rpc_auth.cfg ] ; then - chmod g+r gui_rpc_auth.cfg + chmod g+r gui_rpc_auth.cfg fi ${RUNUSER} - $BOINCUSER -c "$NOCORE ; $BOINCEXE $BOINCOPTS >>$LOGFILE 2>>$ERRORLOG" 2>/dev/null > /dev/null & fi - sleep 3 + sleep 3 PID=`local_pidof $BOINCEXE_NAME` if [ $PID ]; then echo $PID > $PIDFILE @@ -426,7 +426,7 @@ case "$1" in echo -n "BOINC is not running (no lockfiles found)." echo_success else - echo -n "Stopping BOINC client daemon: " + echo -n "Stopping BOINC client daemon: " if [ -f $PIDFILE ] ; then PID=`cat $PIDFILE` if [ -n "`${PS} $PID | grep $PID`" ] ; then @@ -440,7 +440,7 @@ case "$1" in echo fi else - killproc $BOINCEXE_NAME && echo_success || echo_failure + killproc $BOINCEXE_NAME && echo_success || echo_failure fi # clean up in any case rm -f lockfile 2>/dev/null >/dev/null @@ -480,10 +480,10 @@ case "$1" in if [ "$PID" != "" ]; then echo "BOINC client is running (pid $PID)." else - if [ -f $BOINCDIR/lockfile -o -f $LOCKFILE ]; then + if [ -f $BOINCDIR/lockfile -o -f $LOCKFILE ]; then echo "BOINC is stopped but lockfile(s) exist." exit 2 - else + else echo "BOINC client is stopped." exit 3 fi diff --git a/client/setprojectgrp.cpp b/client/setprojectgrp.cpp index e06c35ce39d..7939ef17ca5 100644 --- a/client/setprojectgrp.cpp +++ b/client/setprojectgrp.cpp @@ -69,13 +69,13 @@ int main(int argc, char** argv) { print_to_log_file("setprojectgrp: argc=%d, arg[1]= %s, boinc_project gid = %d\n", argc, argv[1], project_gid); #endif - // chown() doesn't change ownership of symbolic links; it follows the link and + // chown() doesn't change ownership of symbolic links; it follows the link and // changes the file is not available in OS 10.3.9. // - // But we don't really need to worry about this, because the system ignores + // But we don't really need to worry about this, because the system ignores // ownership & permissions of symbolic links anyway. // - // Also, the target of a symbolic link may not be present if the slot containing + // Also, the target of a symbolic link may not be present if the slot containing // the link is no longer in use. // if (lstat(argv[1], &sbuf) == 0) { @@ -101,7 +101,7 @@ static void print_to_log_file(const char *format, ...) { va_list args; char buf[256]; time_t t; - + f = fopen("/Users/Shared/test_log_gfx_switcher.txt", "a"); if (!f) return; @@ -118,7 +118,7 @@ static void print_to_log_file(const char *format, ...) { va_start(args, format); vfprintf(f, format, args); va_end(args); - + fputs("\n", f); fflush(f); fclose(f); diff --git a/client/sim.cpp b/client/sim.cpp index d4955aaadf0..4698b8989c3 100644 --- a/client/sim.cpp +++ b/client/sim.cpp @@ -514,7 +514,7 @@ bool CLIENT_STATE::scheduler_rpc_poll() { break; } #endif - + p = find_project_with_overdue_results(false); if (p) { msg_printf(p, MSG_INFO, "doing RPC to report results"); diff --git a/client/switcher.cpp b/client/switcher.cpp index 95066a92772..2d20acabbf7 100644 --- a/client/switcher.cpp +++ b/client/switcher.cpp @@ -81,11 +81,11 @@ int main(int /*argc*/, char** argv) { strcpy(boinc_master_user_name, "boinc_master"); #if VERBOSE // For debugging only - print_to_log_file("\n\nEntered switcher with euid %d, egid %d, uid %d and gid %d\n", geteuid(), getegid(), getuid(), getgid()); + print_to_log_file("\n\nEntered switcher with euid %d, egid %d, uid %d and gid %d\n", geteuid(), getegid(), getuid(), getgid()); getcwd( current_dir, sizeof(current_dir)); print_to_log_file("current directory = %s\n", current_dir); fflush(stderr); - + i = 0; while(argv[i]) { print_to_log_file("switcher arg %d: %s\n", i, argv[i]); @@ -110,7 +110,7 @@ int main(int /*argc*/, char** argv) { #ifdef __APPLE__ // Under fast user switching, the BOINC client may be running under a - // different login than the screensaver + // different login than the screensaver // // If we need to join a different process group, it must be the last argument. // This is currently used for OS 10.15+ @@ -123,7 +123,7 @@ int main(int /*argc*/, char** argv) { ++i; } #endif - + if (!screensaverLoginUser) { // Satisfy an error / warning from rpmlint: ensure that // we drop any supplementary groups associated with root @@ -192,29 +192,29 @@ int main(int /*argc*/, char** argv) { // Used under OS 10.15 Catalina and later to launch screensaver graphics apps // // BOINC screensaver plugin BOINCSaver.saver (BOINC Screensaver Coordinator) - // sends a run_graphics_app RPC to the BOINC client. The BOINC client then + // sends a run_graphics_app RPC to the BOINC client. The BOINC client then // launches switcher, which submits a script to launchd as a LaunchAgent // for the user that invoked the screensaver (the currently logged in user.) // - // We must go through launchd to establish a connection to the windowserver + // We must go through launchd to establish a connection to the windowserver // in the currently logged in user's space for use by the project graphics - // app. This script then launches gfx_switcher, which uses fork and execv to - // launch the project graphics app. gfx_switcher writes the graphics app's - // process ID to shared memory, to be read by the Screensaver Coordinator. - // gfx_switcher waits for the graphics app to exit and notifies then notifies + // app. This script then launches gfx_switcher, which uses fork and execv to + // launch the project graphics app. gfx_switcher writes the graphics app's + // process ID to shared memory, to be read by the Screensaver Coordinator. + // gfx_switcher waits for the graphics app to exit and notifies then notifies // the Screensaver Coordinator by writing 0 to the shared memory. // // This Rube Goldberg process is necessary due to limitations on screensavers // introduced in OS 10.15 Catalina. char cmd[1024]; - // We are running setuid root, so setuid() sets real user ID, + // We are running setuid root, so setuid() sets real user ID, // effective user ID and saved set_user-ID for this process setuid(geteuid()); - // We are running setuid root, so setgid() sets real group ID, + // We are running setuid root, so setgid() sets real group ID, // effective group ID and saved set_group-ID for this process setgid(getegid()); - + getcwd(current_dir, sizeof(current_dir)); i = 0; @@ -231,7 +231,7 @@ int main(int /*argc*/, char** argv) { retval = callPosixSpawn(cmd); return retval; } else { - // A new submit of edu.berkeley.boinc-ss_helper will be ignored if for some reason + // A new submit of edu.berkeley.boinc-ss_helper will be ignored if for some reason // edu.berkeley.boinc-ss_helper is still loaded, so ensure it is removed. snprintf(cmd, sizeof(cmd), "su -l \"%s\" -c 'launchctl remove edu.berkeley.boinc-ss_helper'", screensaverLoginUser); retval = callPosixSpawn(cmd); @@ -277,7 +277,7 @@ static void print_to_log_file(const char *format, ...) { va_list args; char buf[256]; time_t t; - + f = fopen("/Users/Shared/test_log_gfx_switcher.txt", "a"); if (!f) return; @@ -294,7 +294,7 @@ static void print_to_log_file(const char *format, ...) { va_start(args, format); vfprintf(f, format, args); va_end(args); - + fputs("\n", f); fflush(f); fclose(f); diff --git a/client/sysmon_win.h b/client/sysmon_win.h index a961d3e1e1a..8aa0d03cde4 100644 --- a/client/sysmon_win.h +++ b/client/sysmon_win.h @@ -41,7 +41,7 @@ extern int cleanup_system_monitor(); #define SERVICE_ACCEPTED_ACTIONS ( \ SERVICE_ACCEPT_STOP | \ SERVICE_ACCEPT_PAUSE_CONTINUE | \ - SERVICE_ACCEPT_SHUTDOWN ) + SERVICE_ACCEPT_SHUTDOWN ) // Service Control Manager Routines extern VOID WINAPI BOINCServiceMain(DWORD dwArgc, LPTSTR *lpszArgv); diff --git a/client/win/boinc_cli.h b/client/win/boinc_cli.h index feddfe408d5..9f2a30b6bff 100644 --- a/client/win/boinc_cli.h +++ b/client/win/boinc_cli.h @@ -4,7 +4,7 @@ // // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 diff --git a/client/win/boinc_cli.rc b/client/win/boinc_cli.rc index 9edd8253cdf..0e80e4e0e96 100644 --- a/client/win/boinc_cli.rc +++ b/client/win/boinc_cli.rc @@ -62,19 +62,19 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // TEXTINCLUDE // -1 TEXTINCLUDE +1 TEXTINCLUDE BEGIN "boinc_cli.h\0" END -2 TEXTINCLUDE +2 TEXTINCLUDE BEGIN "#include ""winresrc.h""\r\n" "#include ""version.h""\r\n" "\0" END -3 TEXTINCLUDE +3 TEXTINCLUDE BEGIN "\r\n" "\0" diff --git a/client/win/boinc_cmd.h b/client/win/boinc_cmd.h index 71f85b38a46..4d6c70a4eae 100644 --- a/client/win/boinc_cmd.h +++ b/client/win/boinc_cmd.h @@ -4,7 +4,7 @@ // // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 diff --git a/client/win/boinc_cmd.rc b/client/win/boinc_cmd.rc index bfb09cb5bbd..cde9b897f91 100644 --- a/client/win/boinc_cmd.rc +++ b/client/win/boinc_cmd.rc @@ -61,19 +61,19 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // TEXTINCLUDE // -1 TEXTINCLUDE +1 TEXTINCLUDE BEGIN "boinc_cmd.h\0" END -2 TEXTINCLUDE +2 TEXTINCLUDE BEGIN "#include ""winresrc.h""\r\n" "#include ""version.h""\r\n" "\0" END -3 TEXTINCLUDE +3 TEXTINCLUDE BEGIN "\r\n" "\0" diff --git a/client/win/boinc_log.h b/client/win/boinc_log.h index 71f85b38a46..4d6c70a4eae 100644 --- a/client/win/boinc_log.h +++ b/client/win/boinc_log.h @@ -4,7 +4,7 @@ // // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 diff --git a/client/win/boinc_log.rc b/client/win/boinc_log.rc index 6587808bf5a..aeab5c5632c 100644 --- a/client/win/boinc_log.rc +++ b/client/win/boinc_log.rc @@ -59,19 +59,19 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // TEXTINCLUDE // -1 TEXTINCLUDE +1 TEXTINCLUDE BEGIN "boinc_log.h\0" END -2 TEXTINCLUDE +2 TEXTINCLUDE BEGIN "#include ""winresrc.h""\r\n" "#include ""version.h""\r\n" "\0" END -3 TEXTINCLUDE +3 TEXTINCLUDE BEGIN "\r\n" "\0" diff --git a/clientctrl/boincsvcctrl.h b/clientctrl/boincsvcctrl.h index 72668211c8f..0e1b7d498fa 100644 --- a/clientctrl/boincsvcctrl.h +++ b/clientctrl/boincsvcctrl.h @@ -4,7 +4,7 @@ // // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_3D_CONTROLS 1 diff --git a/clientctrl/boincsvcctrl.rc b/clientctrl/boincsvcctrl.rc index 7e282e60513..72cb118a2ed 100644 --- a/clientctrl/boincsvcctrl.rc +++ b/clientctrl/boincsvcctrl.rc @@ -43,19 +43,19 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // TEXTINCLUDE // -1 TEXTINCLUDE +1 TEXTINCLUDE BEGIN "boincsvcctrl.h\0" END -2 TEXTINCLUDE +2 TEXTINCLUDE BEGIN "#include ""winresrc.h""\r\n" "#include ""version.h""\r\n" "\0" END -3 TEXTINCLUDE +3 TEXTINCLUDE BEGIN "\r\n" "\0" diff --git a/clientgui/AccountInfoPage.cpp b/clientgui/AccountInfoPage.cpp index 9720490eed3..140f965bdf9 100644 --- a/clientgui/AccountInfoPage.cpp +++ b/clientgui/AccountInfoPage.cpp @@ -44,15 +44,15 @@ /*! * CAccountInfoPage type definition */ - + IMPLEMENT_DYNAMIC_CLASS( CAccountInfoPage, wxWizardPageEx ) - + /*! * CAccountInfoPage event table definition */ - + BEGIN_EVENT_TABLE( CAccountInfoPage, wxWizardPageEx ) - + ////@begin CAccountInfoPage event table entries EVT_WIZARDEX_PAGE_CHANGED( wxID_ANY, CAccountInfoPage::OnPageChanged ) EVT_WIZARDEX_PAGE_CHANGING( wxID_ANY, CAccountInfoPage::OnPageChanging ) @@ -60,26 +60,26 @@ BEGIN_EVENT_TABLE( CAccountInfoPage, wxWizardPageEx ) EVT_RADIOBUTTON( ID_ACCOUNTCREATECTRL, CAccountInfoPage::OnAccountCreateCtrlSelected ) EVT_RADIOBUTTON( ID_ACCOUNTUSEEXISTINGCTRL, CAccountInfoPage::OnAccountUseExistingCtrlSelected ) ////@end CAccountInfoPage event table entries - + END_EVENT_TABLE() - + /*! * CAccountInfoPage constructors */ - + CAccountInfoPage::CAccountInfoPage( ) { } - + CAccountInfoPage::CAccountInfoPage( CBOINCBaseWizard* parent ) { Create( parent ); } - + /*! * AccountInfoPage creator */ - + bool CAccountInfoPage::Create( CBOINCBaseWizard* parent ) { @@ -99,7 +99,7 @@ bool CAccountInfoPage::Create( CBOINCBaseWizard* parent ) m_pAccountManagerLinkLabelStaticCtrl = NULL; m_pAccountForgotPasswordCtrl = NULL; ////@end CAccountInfoPage member initialisation - + ////@begin CAccountInfoPage creation wxWizardPageEx::Create( parent, ID_ACCOUNTINFOPAGE ); @@ -109,13 +109,13 @@ bool CAccountInfoPage::Create( CBOINCBaseWizard* parent ) return TRUE; } - + /*! * Control creation for AccountInfoPage */ - + void CAccountInfoPage::CreateControls() -{ +{ ////@begin CAccountInfoPage content construction CAccountInfoPage* itemWizardPage56 = this; @@ -216,7 +216,7 @@ wxWizardPageEx* CAccountInfoPage::GetPrev() const /*! * Gets the next page. */ - + wxWizardPageEx* CAccountInfoPage::GetNext() const { if (CHECK_CLOSINGINPROGRESS()) { @@ -229,20 +229,20 @@ wxWizardPageEx* CAccountInfoPage::GetNext() const } return NULL; } - + /*! * Should we show tooltips? */ - + bool CAccountInfoPage::ShowToolTips() { return TRUE; } - + /*! * Get bitmap resources */ - + wxBitmap CAccountInfoPage::GetBitmapResource( const wxString& WXUNUSED(name) ) { // Bitmap retrieval @@ -250,11 +250,11 @@ wxBitmap CAccountInfoPage::GetBitmapResource( const wxString& WXUNUSED(name) ) return wxNullBitmap; ////@end CAccountInfoPage bitmap retrieval } - + /*! * Get icon resources */ - + wxIcon CAccountInfoPage::GetIconResource( const wxString& WXUNUSED(name) ) { // Icon retrieval @@ -262,11 +262,11 @@ wxIcon CAccountInfoPage::GetIconResource( const wxString& WXUNUSED(name) ) return wxNullIcon; ////@end CAccountInfoPage icon retrieval } - + /*! * wxEVT_WIZARD_PAGE_CHANGED event handler for ID_ACCOUNTINFOPAGE */ - + void CAccountInfoPage::OnPageChanged( wxWizardExEvent& /* event */ ) { CWizardAttach* pWA = ((CWizardAttach*)GetParent()); CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced(); @@ -274,7 +274,7 @@ void CAccountInfoPage::OnPageChanged( wxWizardExEvent& /* event */ ) { PROJECT_CONFIG& pc = pWA->project_config; wxString strBaseConfigLocation = wxString(wxT("/Wizards")); wxConfigBase* pConfig = wxConfigBase::Get(FALSE); - + wxASSERT(pSkinAdvanced); wxASSERT(pSkinWizardATAM); wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced)); @@ -350,7 +350,7 @@ void CAccountInfoPage::OnPageChanged( wxWizardExEvent& /* event */ ) { _("&Yes, existing user") ); } else { - if (pSkinAdvanced->IsBranded() && + if (pSkinAdvanced->IsBranded() && !pSkinWizardATAM->GetAccountInfoMessage().IsEmpty()) { m_pAccountInformationStaticCtrl->SetLabel( pSkinWizardATAM->GetAccountInfoMessage() @@ -388,7 +388,7 @@ void CAccountInfoPage::OnPageChanged( wxWizardExEvent& /* event */ ) { if (pc.uses_username) { if (IS_ACCOUNTMANAGERWIZARD()) { - if (pSkinAdvanced->IsBranded() && + if (pSkinAdvanced->IsBranded() && !pSkinWizardATAM->GetAccountInfoMessage().IsEmpty()) { m_pAccountInformationStaticCtrl->SetLabel( pSkinWizardATAM->GetAccountInfoMessage() @@ -396,7 +396,7 @@ void CAccountInfoPage::OnPageChanged( wxWizardExEvent& /* event */ ) { } } - m_pAccountEmailAddressCtrl->SetValidator( + m_pAccountEmailAddressCtrl->SetValidator( wxTextValidator(wxFILTER_NONE, &m_strAccountEmailAddress) ); m_pAccountUsernameCtrl->SetValidator( @@ -414,7 +414,7 @@ void CAccountInfoPage::OnPageChanged( wxWizardExEvent& /* event */ ) { m_pAccountUsernameCtrl->SetValue(m_strAccountUsername); } else { if (IS_ACCOUNTMANAGERWIZARD()) { - if (pSkinAdvanced->IsBranded() && + if (pSkinAdvanced->IsBranded() && !pSkinWizardATAM->GetAccountInfoMessage().IsEmpty()) { m_pAccountInformationStaticCtrl->SetLabel( pSkinWizardATAM->GetAccountInfoMessage() @@ -482,11 +482,11 @@ void CAccountInfoPage::OnPageChanged( wxWizardExEvent& /* event */ ) { Fit(); } - + /*! * wxEVT_WIZARD_PAGE_CHANGING event handler for ID_ACCOUNTINFOPAGE */ - + void CAccountInfoPage::OnPageChanging( wxWizardExEvent& event ) { if (event.GetDirection() == false) return; @@ -506,7 +506,7 @@ void CAccountInfoPage::OnPageChanging( wxWizardExEvent& event ) { pConfig->Write(wxT("DefaultUsername"), m_strAccountUsername); pConfig->Flush(); - + // Construct potential dialog title if (IS_ATTACHTOPROJECTWIZARD()) { strTitle = _("Add project"); @@ -515,7 +515,7 @@ void CAccountInfoPage::OnPageChanging( wxWizardExEvent& event ) { } else if (IS_ACCOUNTMANAGERWIZARD()) { strTitle = _("Use account manager"); } - + // Verify minimum username length if (!m_pAccountUseExistingCtrl->GetValue()) { if (!(m_pAccountPasswordCtrl->GetValue().Length() > 0)) { @@ -546,7 +546,7 @@ void CAccountInfoPage::OnPageChanging( wxWizardExEvent& event ) { bDisplayError = true; } } - + if (bDisplayError) { wxGetApp().SafeMessageBox( @@ -567,19 +567,19 @@ void CAccountInfoPage::OnPageChanging( wxWizardExEvent& event ) { } } } - + /*! * wxEVT_WIZARD_CANCEL event handler for ID_ACCOUNTINFOPAGE */ - + void CAccountInfoPage::OnCancel( wxWizardExEvent& event ) { PROCESS_CANCELEVENT(event); } - + /*! * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_ACCOUNTUSEXISTINGBUTTON */ - + void CAccountInfoPage::OnAccountUseExistingCtrlSelected( wxCommandEvent& WXUNUSED(event) ) { CWizardAttach* pWA = ((CWizardAttach*)GetParent()); PROJECT_CONFIG& pc = pWA->project_config; @@ -599,11 +599,11 @@ void CAccountInfoPage::OnAccountUseExistingCtrlSelected( wxCommandEvent& WXUNUSE Fit(); } - + /*! * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_ACCOUNTCREATEBUTTON */ - + void CAccountInfoPage::OnAccountCreateCtrlSelected( wxCommandEvent& WXUNUSED(event) ) { CWizardAttach* pWA = ((CWizardAttach*)GetParent()); PROJECT_CONFIG& pc = pWA->project_config; diff --git a/clientgui/AccountInfoPage.h b/clientgui/AccountInfoPage.h index cb4d2cd6cc6..22d96a7c2c1 100644 --- a/clientgui/AccountInfoPage.h +++ b/clientgui/AccountInfoPage.h @@ -28,7 +28,7 @@ */ class CAccountInfoPage: public wxWizardPageEx -{ +{ DECLARE_DYNAMIC_CLASS( CAccountInfoPage ) DECLARE_EVENT_TABLE() diff --git a/clientgui/AccountManagerInfoPage.h b/clientgui/AccountManagerInfoPage.h index 7d94714736a..0e52ea51572 100644 --- a/clientgui/AccountManagerInfoPage.h +++ b/clientgui/AccountManagerInfoPage.h @@ -27,7 +27,7 @@ */ class CAcctMgrListItem: public wxObject -{ +{ DECLARE_DYNAMIC_CLASS( CAcctMgrListItem ) public: @@ -56,7 +56,7 @@ class CAcctMgrListItem: public wxObject */ class CAccountManagerInfoPage: public wxWizardPageEx -{ +{ DECLARE_DYNAMIC_CLASS( CAccountManagerInfoPage ) DECLARE_EVENT_TABLE() @@ -85,7 +85,7 @@ class CAccountManagerInfoPage: public wxWizardPageEx /// wxEVT_TEXT event handler for ID_PROJECTURLCTRL void OnURLChanged( wxCommandEvent& event ); - + /// wxEVT_BUTTON event handler for ID_PROJECTWEBPAGECTRL void OnProjectItemDisplay( wxCommandEvent& event ); diff --git a/clientgui/AccountManagerProcessingPage.h b/clientgui/AccountManagerProcessingPage.h index 7299f98d532..0a8d0cd39cc 100644 --- a/clientgui/AccountManagerProcessingPage.h +++ b/clientgui/AccountManagerProcessingPage.h @@ -61,7 +61,7 @@ END_DECLARE_EVENT_TYPES() */ class CAccountManagerProcessingPage: public wxWizardPageEx -{ +{ DECLARE_DYNAMIC_CLASS( CAccountManagerProcessingPage ) DECLARE_EVENT_TABLE() diff --git a/clientgui/AccountManagerPropertiesPage.h b/clientgui/AccountManagerPropertiesPage.h index b4f69c1fd14..b6445a8174e 100644 --- a/clientgui/AccountManagerPropertiesPage.h +++ b/clientgui/AccountManagerPropertiesPage.h @@ -65,7 +65,7 @@ END_DECLARE_EVENT_TYPES() */ class CAccountManagerPropertiesPage: public wxWizardPageEx -{ +{ DECLARE_DYNAMIC_CLASS( CAccountManagerPropertiesPage ) DECLARE_EVENT_TABLE() diff --git a/clientgui/AlreadyExistsPage.cpp b/clientgui/AlreadyExistsPage.cpp index 3924b3e36fd..042ab7b6e9c 100644 --- a/clientgui/AlreadyExistsPage.cpp +++ b/clientgui/AlreadyExistsPage.cpp @@ -39,47 +39,47 @@ /*! * CErrAlreadyExistsPage type definition */ - + IMPLEMENT_DYNAMIC_CLASS( CErrAlreadyExistsPage, wxWizardPageEx ) - + /*! * CErrAlreadyExistsPage event table definition */ - + BEGIN_EVENT_TABLE( CErrAlreadyExistsPage, wxWizardPageEx ) - + ////@begin CErrAlreadyExistsPage event table entries EVT_WIZARDEX_PAGE_CHANGED( -1, CErrAlreadyExistsPage::OnPageChanged ) EVT_WIZARDEX_CANCEL( -1, CErrAlreadyExistsPage::OnCancel ) ////@end CErrAlreadyExistsPage event table entries - + END_EVENT_TABLE() - + /*! * CErrAlreadyExistsPage constructors */ - + CErrAlreadyExistsPage::CErrAlreadyExistsPage( ) { } - + CErrAlreadyExistsPage::CErrAlreadyExistsPage( CBOINCBaseWizard* parent ) { Create( parent ); } - + /*! * CErrAccountAlreadyExists creator */ - + bool CErrAlreadyExistsPage::Create( CBOINCBaseWizard* parent ) { ////@begin CErrAlreadyExistsPage member initialisation m_pTitleStaticCtrl = NULL; m_pDirectionsStaticCtrl = NULL; ////@end CErrAlreadyExistsPage member initialisation - + ////@begin CErrAlreadyExistsPage creation wxWizardPageEx::Create( parent, ID_ERRALREADYEXISTSPAGE ); @@ -89,13 +89,13 @@ bool CErrAlreadyExistsPage::Create( CBOINCBaseWizard* parent ) return TRUE; } - + /*! * Control creation for CErrAccountAlreadyExists */ - + void CErrAlreadyExistsPage::CreateControls() -{ +{ ////@begin CErrAlreadyExistsPage content construction CErrAlreadyExistsPage* itemWizardPage96 = this; @@ -114,38 +114,38 @@ void CErrAlreadyExistsPage::CreateControls() itemBoxSizer97->Add(m_pDirectionsStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5); ////@end CErrAlreadyExistsPage content construction } - + /*! * Gets the previous page. */ - + wxWizardPageEx* CErrAlreadyExistsPage::GetPrev() const { return PAGE_TRANSITION_BACK; } - + /*! * Gets the next page. */ - + wxWizardPageEx* CErrAlreadyExistsPage::GetNext() const { return NULL; } - + /*! * Should we show tooltips? */ - + bool CErrAlreadyExistsPage::ShowToolTips() { return TRUE; } - + /*! * Get bitmap resources */ - + wxBitmap CErrAlreadyExistsPage::GetBitmapResource( const wxString& WXUNUSED(name) ) { // Bitmap retrieval @@ -153,11 +153,11 @@ wxBitmap CErrAlreadyExistsPage::GetBitmapResource( const wxString& WXUNUSED(name return wxNullBitmap; ////@end CErrAlreadyExistsPage bitmap retrieval } - + /*! * Get icon resources */ - + wxIcon CErrAlreadyExistsPage::GetIconResource( const wxString& WXUNUSED(name) ) { // Icon retrieval @@ -166,11 +166,11 @@ wxIcon CErrAlreadyExistsPage::GetIconResource( const wxString& WXUNUSED(name) ) return wxNullIcon; ////@end CErrAlreadyExistsPage icon retrieval } - + /*! * wxEVT_WIZARD_PAGE_CHANGED event handler for ID_ERRACCOUNTALREADYEXISTSPAGE */ - + void CErrAlreadyExistsPage::OnPageChanged( wxWizardExEvent& event ) { if (event.GetDirection() == false) return; @@ -197,11 +197,11 @@ void CErrAlreadyExistsPage::OnPageChanged( wxWizardExEvent& event ) { Fit(); } - + /*! * wxEVT_WIZARD_CANCEL event handler for ID_ERRACCOUNTALREADYEXISTSPAGE */ - + void CErrAlreadyExistsPage::OnCancel( wxWizardExEvent& event ) { PROCESS_CANCELEVENT(event); } diff --git a/clientgui/AlreadyExistsPage.h b/clientgui/AlreadyExistsPage.h index 02539538969..326b17fefde 100644 --- a/clientgui/AlreadyExistsPage.h +++ b/clientgui/AlreadyExistsPage.h @@ -27,7 +27,7 @@ */ class CErrAlreadyExistsPage: public wxWizardPageEx -{ +{ DECLARE_DYNAMIC_CLASS( CErrAlreadyExistsPage ) DECLARE_EVENT_TABLE() diff --git a/clientgui/AsyncRPC.cpp b/clientgui/AsyncRPC.cpp index 1f8831638f3..c34fc5c8f4a 100644 --- a/clientgui/AsyncRPC.cpp +++ b/clientgui/AsyncRPC.cpp @@ -99,7 +99,7 @@ AsyncRPC::AsyncRPC(CMainDocument *pDoc) { AsyncRPC::~AsyncRPC() {} -int AsyncRPC::RPC_Wait(RPC_SELECTOR which_rpc, void *arg1, void *arg2, +int AsyncRPC::RPC_Wait(RPC_SELECTOR which_rpc, void *arg1, void *arg2, void *arg3, void *arg4, bool hasPriority ) { ASYNC_RPC_REQUEST request; @@ -121,10 +121,10 @@ int AsyncRPC::RPC_Wait(RPC_SELECTOR which_rpc, void *arg1, void *arg2, } -RPCThread::RPCThread(CMainDocument *pDoc, - BOINC_Mutex* pRPC_Thread_Mutex, - BOINC_Condition* pRPC_Thread_Condition, - BOINC_Mutex* pRPC_Request_Mutex, +RPCThread::RPCThread(CMainDocument *pDoc, + BOINC_Mutex* pRPC_Thread_Mutex, + BOINC_Condition* pRPC_Thread_Condition, + BOINC_Mutex* pRPC_Request_Mutex, BOINC_Condition* pRPC_Request_Condition) : wxThread() { m_pDoc = pDoc; @@ -151,7 +151,7 @@ void *RPCThread::Entry() { locale_t RPC_Thread_Locale = newlocale(LC_ALL_MASK, "C", (locale_t) 0); uselocale(RPC_Thread_Locale); #endif - + m_pRPC_Thread_Mutex->Lock(); @@ -166,23 +166,23 @@ void *RPCThread::Entry() { #endif m_pRPC_Thread_Condition->Wait(); wxASSERT(condErr == wxCOND_NO_ERROR); - + if (m_pDoc->m_bShutDownRPCThread) { #ifdef HAVE_USELOCALE uselocale(LC_GLOBAL_LOCALE); freelocale(RPC_Thread_Locale); #endif m_pRPC_Thread_Mutex->Unlock(); // Just for safety - not really needed - // Tell CMainDocument that thread has gracefully ended + // Tell CMainDocument that thread has gracefully ended // We do this here because OnExit() is not called on Windows m_pDoc->m_RPCThread = NULL; return 0; } - + current_request = m_pDoc->GetCurrentRPCRequest(); if (!current_request->isActive) continue; // Should never happen - + if (current_request->RPCExecutionTime) { startTime = dtime(); } @@ -190,7 +190,7 @@ void *RPCThread::Entry() { if (current_request->RPCExecutionTime) { *(current_request->RPCExecutionTime) = dtime() - startTime; } - + current_request->retval = retval; #if wxDEBUG_LEVEL @@ -201,10 +201,10 @@ void *RPCThread::Entry() { current_request->isActive = false; wxPostEvent( wxTheApp, RPC_done_event ); - // Signal() is ignored / discarded unless the main thread is + // Signal() is ignored / discarded unless the main thread is // currently blocked by m_pRPC_Request_Condition->Wait[Timeout]() m_pRPC_Request_Condition->Signal(); - + #if wxDEBUG_LEVEL mutexErr = #endif @@ -219,7 +219,7 @@ void *RPCThread::Entry() { int RPCThread::ProcessRPCRequest() { int retval = 0; ASYNC_RPC_REQUEST *current_request = m_pDoc->GetCurrentRPCRequest(); - + switch (current_request->which_rpc) { // RPC_SELECTORS with no arguments case RPC_RUN_BENCHMARKS: @@ -257,7 +257,7 @@ int RPCThread::ProcessRPCRequest() { retval = (m_pDoc->rpcClient).get_simple_gui_info(*(SIMPLE_GUI_INFO*)(current_request->arg1)); break; case RPC_GET_SIMPLE_GUI_INFO2: - // RPC_GET_SIMPLE_GUI_INFO2 is equivalent to doing both + // RPC_GET_SIMPLE_GUI_INFO2 is equivalent to doing both // RPC_GET_PROJECT_STATUS1 and RPC_GET_RESULTS retval = (m_pDoc->rpcClient).get_results(*(RESULTS*)(current_request->arg3), *(bool*)(current_request->arg4)); if (!retval) { @@ -278,19 +278,19 @@ int RPCThread::ProcessRPCRequest() { break; case RPC_PROJECT_OP: retval = (m_pDoc->rpcClient).project_op( - *(PROJECT*)(current_request->arg1), + *(PROJECT*)(current_request->arg1), (const char*)(current_request->arg2) ); break; case RPC_SET_RUN_MODE: retval = (m_pDoc->rpcClient).set_run_mode( - *(int*)(current_request->arg1), + *(int*)(current_request->arg1), *(double*)(current_request->arg2) ); break; case RPC_SET_GPU_MODE: retval = (m_pDoc->rpcClient).set_gpu_mode( - *(int*)(current_request->arg1), + *(int*)(current_request->arg1), *(double*)(current_request->arg2) ); break; @@ -317,20 +317,20 @@ int RPCThread::ProcessRPCRequest() { break; case RPC_GET_NOTICES: retval = (m_pDoc->rpcClient).get_notices( - *(int*)(current_request->arg1), + *(int*)(current_request->arg1), *(NOTICES*)(current_request->arg2) ); break; case RPC_GET_MESSAGES: retval = (m_pDoc->rpcClient).get_messages( - *(int*)(current_request->arg1), + *(int*)(current_request->arg1), *(MESSAGES*)(current_request->arg2), *(bool*)(current_request->arg3) ); break; case RPC_FILE_TRANSFER_OP: retval = (m_pDoc->rpcClient).file_transfer_op( - *(FILE_TRANSFER*)(current_request->arg1), + *(FILE_TRANSFER*)(current_request->arg1), (const char*)(current_request->arg2) ); break; @@ -378,8 +378,8 @@ int RPCThread::ProcessRPCRequest() { break; case RPC_PROJECT_ATTACH: retval = (m_pDoc->rpcClient).project_attach( - (const char*)(current_request->arg1), - (const char*)(current_request->arg2), + (const char*)(current_request->arg1), + (const char*)(current_request->arg2), (const char*)(current_request->arg3), (const char*)(current_request->arg4) ); @@ -392,8 +392,8 @@ int RPCThread::ProcessRPCRequest() { break; case RPC_ACCT_MGR_RPC: retval = (m_pDoc->rpcClient).acct_mgr_rpc( - (const char*)(current_request->arg1), - (const char*)(current_request->arg2), + (const char*)(current_request->arg1), + (const char*)(current_request->arg2), (const char*)(current_request->arg3), (bool)(current_request->arg4 != NULL) ); @@ -424,7 +424,7 @@ int RPCThread::ProcessRPCRequest() { break; case RPC_GET_GLOBAL_PREFS_WORKING_STRUCT: retval = (m_pDoc->rpcClient).get_global_prefs_working_struct( - *(GLOBAL_PREFS*)(current_request->arg1), + *(GLOBAL_PREFS*)(current_request->arg1), *(GLOBAL_PREFS_MASK*)(current_request->arg2) ); break; @@ -436,13 +436,13 @@ int RPCThread::ProcessRPCRequest() { break; case RPC_GET_GLOBAL_PREFS_OVERRIDE_STRUCT: retval = (m_pDoc->rpcClient).get_global_prefs_override_struct( - *(GLOBAL_PREFS*)(current_request->arg1), + *(GLOBAL_PREFS*)(current_request->arg1), *(GLOBAL_PREFS_MASK*)(current_request->arg2) ); break; case RPC_SET_GLOBAL_PREFS_OVERRIDE_STRUCT: retval = (m_pDoc->rpcClient).set_global_prefs_override_struct( - *(GLOBAL_PREFS*)(current_request->arg1), + *(GLOBAL_PREFS*)(current_request->arg1), *(GLOBAL_PREFS_MASK*)(current_request->arg2) ); break; @@ -482,15 +482,15 @@ int CMainDocument::RequestRPC(ASYNC_RPC_REQUEST& request, bool hasPriority) { #endif long timeToDelay, delayTimeRemaining, timeToSleep; bool shown = false; - + if (!m_RPCThread) return -1; - if ( (request.rpcType < RPC_TYPE_WAIT_FOR_COMPLETION) || + if ( (request.rpcType < RPC_TYPE_WAIT_FOR_COMPLETION) || (request.rpcType >= NUM_RPC_TYPES) ) { wxASSERT(false); return -1; } - + // If we are quitting, cancel any pending RPCs if (request.which_rpc == RPC_QUIT) { if (current_rpc_request.isActive) { @@ -500,7 +500,7 @@ int CMainDocument::RequestRPC(ASYNC_RPC_REQUEST& request, bool hasPriority) { RPC_requests.clear(); } } - + // Check if a duplicate request is already on the queue for (iter=RPC_requests.begin(); iter!=RPC_requests.end(); ++iter) { if (iter->isSameAs(request)) { @@ -511,16 +511,16 @@ int CMainDocument::RequestRPC(ASYNC_RPC_REQUEST& request, bool hasPriority) { if ((request.rpcType == RPC_TYPE_WAIT_FOR_COMPLETION) && (request.resultPtr == NULL)) { request.resultPtr = &retval; } - + if (hasPriority) { - // We may want to set hasPriority for some user-initiated events. + // We may want to set hasPriority for some user-initiated events. // Since the user is waiting, insert this at head of request queue. // As of 8/14/08, hasPriority is never set true, so hasn't been tested. iter = RPC_requests.insert(RPC_requests.begin(), request); } else { RPC_requests.push_back(request); } - + // Start this RPC if no other RPC is already in progress. if (RPC_requests.size() == 1) { // Wait for thread to unlock mutex with m_pRPC_Thread_Condition->Wait() @@ -537,7 +537,7 @@ int CMainDocument::RequestRPC(ASYNC_RPC_REQUEST& request, bool hasPriority) { m_pRPC_Thread_Condition->Signal(); // Unblock the thread - // m_pRPC_Thread_Condition->Wait() will Lock() the mutex upon receiving Signal(), + // m_pRPC_Thread_Condition->Wait() will Lock() the mutex upon receiving Signal(), // causing it to block again if we still have our lock on the mutex. #if wxDEBUG_LEVEL mutexErr = @@ -546,7 +546,7 @@ int CMainDocument::RequestRPC(ASYNC_RPC_REQUEST& request, bool hasPriority) { wxASSERT(mutexErr == wxMUTEX_NO_ERROR); } - // If this is a user-initiated event wait for completion but show + // If this is a user-initiated event wait for completion but show // a dialog allowing the user to cancel. if (request.rpcType == RPC_TYPE_WAIT_FOR_COMPLETION) { // TODO: proper handling if a second user request is received while first is pending ?? @@ -558,7 +558,7 @@ int CMainDocument::RequestRPC(ASYNC_RPC_REQUEST& request, bool hasPriority) { // Don't show dialog if RPC completes before RPC_WAIT_DLG_DELAY // or while BOINC is minimized or during auto-attach to project CBOINCBaseFrame* pFrame = wxGetApp().GetFrame(); - wxStopWatch Dlgdelay = wxStopWatch(); + wxStopWatch Dlgdelay = wxStopWatch(); m_RPCWaitDlg = new AsyncRPCDlg(); m_bWaitingForRPC = true; if (m_bAutoAttaching) { @@ -566,60 +566,60 @@ int CMainDocument::RequestRPC(ASYNC_RPC_REQUEST& request, bool hasPriority) { // so don't keep checking once it is false m_bAutoAttaching = autoattach_in_progress(); } - - // Allow RPC_WAIT_DLG_DELAY seconds for Demand RPC to complete before + + // Allow RPC_WAIT_DLG_DELAY seconds for Demand RPC to complete before // displaying "Please Wait" dialog, but keep checking for completion. if (m_bAutoAttaching) { timeToDelay = RPC_WAIT_DLG_DELAY_DURING_AUTOATTACH; } else { timeToDelay = RPC_WAIT_DLG_DELAY; } - + delayTimeRemaining = timeToDelay; while (true) { if (delayTimeRemaining >= 0) { // Prevent overflow if minimized for a very long time delayTimeRemaining = timeToDelay - Dlgdelay.Time(); } - + if (pFrame) { shown = pFrame->IsShown(); } else { shown = false; } - + if (shown) { if (delayTimeRemaining <= 0) break; // Display the Please Wait dialog timeToSleep = delayTimeRemaining; } else { - // Don't show dialog while Manager is minimized, but do - // process events so user can maximize the manager. + // Don't show dialog while Manager is minimized, but do + // process events so user can maximize the manager. // - // NOTE: CBOINCGUIApp::FilterEvent() discards those events - // which might cause posting of more RPC requests while + // NOTE: CBOINCGUIApp::FilterEvent() discards those events + // which might cause posting of more RPC requests while // we are in this loop, to prevent undesirable recursion. - // Since the manager is minimized, we don't have to worry about - // discarding crucial drawing or command events. - // The filter does allow the the Open Manager menu item from - // the system tray icon and wxEVT_RPC_FINISHED event. + // Since the manager is minimized, we don't have to worry about + // discarding crucial drawing or command events. + // The filter does allow the the Open Manager menu item from + // the system tray icon and wxEVT_RPC_FINISHED event. // timeToSleep = DELAY_WHEN_MINIMIZED; // Allow user to maximize Manager wxSafeYield(NULL, true); } - + // OnRPCComplete() clears m_bWaitingForRPC and deletes m_RPCWaitDlg if RPC completed if (! m_bWaitingForRPC) { return retval; } - + #if wxDEBUG_LEVEL mutexErr = #endif m_pRPC_Request_Mutex->Lock(); wxASSERT(mutexErr == wxMUTEX_NO_ERROR); - // Simulate handling of CRPCFinishedEvent but don't allow any other + // Simulate handling of CRPCFinishedEvent but don't allow any other // events (so no user activity) to prevent undesirable recursion. - // Since we don't need to filter and discard events, they remain on + // Since we don't need to filter and discard events, they remain on // the queue until it is safe to process them. // Allow RPC thread to run while we wait for it. if (!current_rpc_request.isActive) { @@ -628,7 +628,7 @@ int CMainDocument::RequestRPC(ASYNC_RPC_REQUEST& request, bool hasPriority) { #endif m_pRPC_Request_Mutex->Unlock(); wxASSERT(mutexErr == wxMUTEX_NO_ERROR); - + HandleCompletedRPC(); continue; } @@ -645,15 +645,15 @@ int CMainDocument::RequestRPC(ASYNC_RPC_REQUEST& request, bool hasPriority) { m_pRPC_Request_Mutex->Unlock(); wxASSERT(mutexErr == wxMUTEX_NO_ERROR); } - - // Demand RPC has taken longer than RPC_WAIT_DLG_DELAY seconds and - // Manager is not minimized, so display the "Please Wait" dialog - // with a Cancel button. If the RPC does complete while the dialog + + // Demand RPC has taken longer than RPC_WAIT_DLG_DELAY seconds and + // Manager is not minimized, so display the "Please Wait" dialog + // with a Cancel button. If the RPC does complete while the dialog // is up, HandleCompletedRPC() will call EndModal with wxID_OK. // - // NOTE: the Modal dialog permits processing of all events, but - // CBOINCGUIApp::FilterEvent() blocks those events which might cause - // posting of more RPC requests while in this dialog, to prevent + // NOTE: the Modal dialog permits processing of all events, but + // CBOINCGUIApp::FilterEvent() blocks those events which might cause + // posting of more RPC requests while in this dialog, to prevent // undesirable recursion. // if (m_RPCWaitDlg) { @@ -661,17 +661,17 @@ int CMainDocument::RequestRPC(ASYNC_RPC_REQUEST& request, bool hasPriority) { // Remember time the dialog was closed for use by RunPeriodicRPCs() m_dtLasAsyncRPCDlgTime = wxDateTime::Now(); if (response != wxID_OK) { - // TODO: If user presses Cancel in Please Wait dialog but request - // has not yet been started, should we just remove it from queue? - // If we make that change, should we also add a separate menu item + // TODO: If user presses Cancel in Please Wait dialog but request + // has not yet been started, should we just remove it from queue? + // If we make that change, should we also add a separate menu item // to reset the RPC connection (or does one already exist)? retval = -1; - // If the RPC continues to get data after we return to + // If the RPC continues to get data after we return to // our caller, it may try to write into a buffer or struct - // which the caller has already deleted. To prevent this, + // which the caller has already deleted. To prevent this, // we close the socket (disconnect) and kill the RPC thread. - // This is ugly but necessary. We must then reconnect and + // This is ugly but necessary. We must then reconnect and // start a new RPC thread. if (current_rpc_request.isActive) { current_rpc_request.isActive = false; @@ -681,7 +681,7 @@ int CMainDocument::RequestRPC(ASYNC_RPC_REQUEST& request, bool hasPriority) { m_bNeedRefresh = false; m_bNeedTaskBarRefresh = false; - // We will be reconnected to the same client (if possible) by + // We will be reconnected to the same client (if possible) by // CBOINCDialUpManager::OnPoll() and CNetworkConnection::Poll(). m_pNetworkConnection->SetStateDisconnected(); } @@ -715,9 +715,9 @@ void CMainDocument::KillRPCThread() { m_bNeedRefresh = false; m_bNeedTaskBarRefresh = false; - + rpcClient.close(); // Abort any async RPC in progress (in case hung) - + // On some platforms, Delete() takes effect only when thread calls TestDestroy() // Wait for thread to unlock mutex with m_pRPC_Thread_Condition->Wait() #if wxDEBUG_LEVEL @@ -752,7 +752,7 @@ void CMainDocument::KillRPCThread() { void CMainDocument::OnRPCComplete(CRPCFinishedEvent&) { HandleCompletedRPC(); -} +} void CMainDocument::HandleCompletedRPC() { @@ -762,14 +762,14 @@ void CMainDocument::HandleCompletedRPC() { #endif int i, n, requestIndex = -1; bool stillWaitingForPendingRequests = false; - + if (!m_RPCThread) return; - + if (current_rpc_request.isActive) return; - - // We can get here either via a CRPCFinishedEvent event posted - // by the RPC thread or by a call from RequestRPC. If we were - // called from RequestRPC, the CRPCFinishedEvent will still be + + // We can get here either via a CRPCFinishedEvent event posted + // by the RPC thread or by a call from RequestRPC. If we were + // called from RequestRPC, the CRPCFinishedEvent will still be // on the event queue, so we get called twice. Check for this here. if (current_rpc_request.which_rpc == 0) return; // already handled by a call from RequestRPC @@ -784,7 +784,7 @@ void CMainDocument::HandleCompletedRPC() { } } } - + if (! stillWaitingForPendingRequests) { if (m_RPCWaitDlg) { if (m_RPCWaitDlg->IsShown()) { @@ -800,18 +800,18 @@ void CMainDocument::HandleCompletedRPC() { // Remove completed request from the queue RPC_requests.erase(RPC_requests.begin()+requestIndex); } - + retval = current_rpc_request.retval; - + if (current_rpc_request.completionTime) { *(current_rpc_request.completionTime) = wxDateTime::Now(); } - + if (current_rpc_request.resultPtr) { *(current_rpc_request.resultPtr) = retval; } - + // Post-processing if (! retval) { if (current_rpc_request.rpcType == RPC_TYPE_ASYNC_WITH_REFRESH_AFTER) { @@ -819,13 +819,13 @@ void CMainDocument::HandleCompletedRPC() { m_bNeedRefresh = true; } } - + if (current_rpc_request.rpcType == RPC_TYPE_ASYNC_WITH_UPDATE_TASKBAR_ICON_AFTER) { if (!retval) { m_bNeedTaskBarRefresh = true; } } - + switch (current_rpc_request.which_rpc) { case RPC_GET_STATE: if (current_rpc_request.exchangeBuf && !retval) { @@ -927,7 +927,7 @@ void CMainDocument::HandleCompletedRPC() { arg1->projects.swap(exchangeBuf->projects); } break; - + case RPC_GET_CC_STATUS: if (current_rpc_request.exchangeBuf && !retval) { CC_STATUS* arg1 = (CC_STATUS*)current_rpc_request.arg1; @@ -943,35 +943,35 @@ void CMainDocument::HandleCompletedRPC() { } break; default: - // We don't support double buffering for other RPC calls + // We don't support double buffering for other RPC calls wxASSERT(current_rpc_request.exchangeBuf == NULL); break; } } - + if (current_rpc_request.resultPtr) { // In case post-processing changed retval *(current_rpc_request.resultPtr) = retval; } - // We must call ProcessEvent() rather than AddPendingEvent() here to - // guarantee integrity of data when other events are handled (such as - // Abort, Suspend/Resume, Show Graphics, Update, Detach, Reset, No - // New Work, etc.) Otherwise, if one of those events is pending it - // might be processed first, and the data in the selected rows may not - // match the data which the user selected if any rows were added or - // deleted due to the RPC. - // The refresh event called here adjusts the selections to fix any - // such mismatch before other pending events are processed. + // We must call ProcessEvent() rather than AddPendingEvent() here to + // guarantee integrity of data when other events are handled (such as + // Abort, Suspend/Resume, Show Graphics, Update, Detach, Reset, No + // New Work, etc.) Otherwise, if one of those events is pending it + // might be processed first, and the data in the selected rows may not + // match the data which the user selected if any rows were added or + // deleted due to the RPC. + // The refresh event called here adjusts the selections to fix any + // such mismatch before other pending events are processed. // - // However, the refresh code may itself request a Demand RPC, which - // would cause undesirable recursion if we are already waiting for - // another Demand RPC to complete. In that case, we defer the refresh + // However, the refresh code may itself request a Demand RPC, which + // would cause undesirable recursion if we are already waiting for + // another Demand RPC to complete. In that case, we defer the refresh // until all pending Demand RPCs have been done. // if (m_bNeedRefresh && !m_bWaitingForRPC) { m_bNeedRefresh = false; - // We must get the frame immediately before using it, + // We must get the frame immediately before using it, // since it may have been changed by SetActiveGUI(). CBOINCBaseFrame* pFrame = wxGetApp().GetFrame(); if (pFrame) { @@ -997,11 +997,11 @@ void CMainDocument::HandleCompletedRPC() { eventLog->OnRefresh(); } } - + current_rpc_request.clear(); - // Start the next RPC request. - // We can't start this until finished processing the previous RPC's + // Start the next RPC request. + // We can't start this until finished processing the previous RPC's // event because the two requests may write into the same buffer. if (RPC_requests.size() > 0) { // Wait for thread to unlock mutex with m_pRPC_Thread_Condition->Wait() @@ -1018,7 +1018,7 @@ void CMainDocument::HandleCompletedRPC() { m_pRPC_Thread_Condition->Signal(); // Unblock the thread - // m_pRPC_Thread_Condition->Wait() will Lock() the mutex upon receiving Signal(), + // m_pRPC_Thread_Condition->Wait() will Lock() the mutex upon receiving Signal(), // causing it to block again if we still have our lock on the mutex. #if wxDEBUG_LEVEL mutexErr = @@ -1043,7 +1043,7 @@ int CMainDocument::CopyProjectsToStateBuffer(PROJECTS& p, CC_STATE& ccstate) { for (i=0; imaster_url); if (state_project && (!strcmp(p.projects[i]->master_url, state_project->master_url))) { - // Because the CC_STATE contains several pointers to each element of the + // Because the CC_STATE contains several pointers to each element of the // CC_STATE::projects vector, we must update these elements in place. *state_project = *(p.projects[i]); state_project->flag_for_delete = false; @@ -1062,7 +1062,7 @@ int CMainDocument::CopyProjectsToStateBuffer(PROJECTS& p, CC_STATE& ccstate) { } } } - + return retval; } @@ -1079,7 +1079,7 @@ AsyncRPCDlg::AsyncRPCDlg() : wxDialog( NULL, wxID_ANY, wxT(""), wxDefaultPositio wxASSERT(pSkinAdvanced); wxString message = wxString(_("Communicating with BOINC client. Please wait ...")); - + #ifdef __WXMAC__ exit_label.Printf(_("&Quit %s"), pSkinAdvanced->GetApplicationName().c_str()); #else @@ -1095,9 +1095,9 @@ AsyncRPCDlg::AsyncRPCDlg() : wxDialog( NULL, wxID_ANY, wxT(""), wxDefaultPositio icon_text->Add( CreateTextSizer( message ), 0, wxALIGN_CENTER | wxLEFT, 10 ); topsizer->Add( icon_text, 1, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 ); - + wxStdDialogButtonSizer *sizerBtn = CreateStdDialogButtonSizer(0); - + wxButton* exitbutton = new wxButton; exitbutton->Create( this, wxID_EXIT, exit_label, wxDefaultPosition, wxDefaultSize, 0 ); sizerBtn->Add(exitbutton, 0, wxLEFT|wxRIGHT|wxALL, 5); @@ -1105,7 +1105,7 @@ AsyncRPCDlg::AsyncRPCDlg() : wxDialog( NULL, wxID_ANY, wxT(""), wxDefaultPositio wxButton* cancelbutton = new wxButton; cancelbutton->Create( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 ); sizerBtn->Add(cancelbutton, 0, wxLEFT|wxRIGHT|wxALL, 5); - + if ( sizerBtn ) topsizer->Add(sizerBtn, 0, wxEXPAND | wxALL, 10 ); @@ -1152,7 +1152,7 @@ void CMainDocument::TestAsyncRPC() { // request.result = NULL; request.resultPtr = &rpc_result; // For testing async RPCs request.isActive = false; - + //retval = rpcClient.get_all_projects_list(pl); req_retval = RequestRPC(request, true); diff --git a/clientgui/AsyncRPC.h b/clientgui/AsyncRPC.h index 16bf842d1df..b61e809b387 100644 --- a/clientgui/AsyncRPC.h +++ b/clientgui/AsyncRPC.h @@ -144,19 +144,19 @@ enum RPC_SELECTOR { enum ASYNC_RPC_TYPE { - // Demand RPC: wait for completion before returning (usually + // Demand RPC: wait for completion before returning (usually // a user-initiated request.) RPC_TYPE_WAIT_FOR_COMPLETION = 1, - // Periodic RPC: post request on queue and return immediately + // Periodic RPC: post request on queue and return immediately // (requested due to a timer interrupt.) RPC_TYPE_ASYNC_NO_REFRESH, - // Periodic RPC as above, but on completion also process a + // Periodic RPC as above, but on completion also process a // wxEVT_FRAME_REFRESHVIEW event to refresh the display. RPC_TYPE_ASYNC_WITH_REFRESH_AFTER, - // Periodic RPC as above, but on completion also process a + // Periodic RPC as above, but on completion also process a // wxEVT_FRAME_REFRESHVIEW event to refresh the display. RPC_TYPE_ASYNC_WITH_REFRESH_EVENT_LOG_AFTER, - // Periodic RPC as above, but on completion also process a + // Periodic RPC as above, but on completion also process a // wxEVT_TASKBAR_REFRESH event to refresh the taskbar icon. RPC_TYPE_ASYNC_WITH_UPDATE_TASKBAR_ICON_AFTER, NUM_RPC_TYPES @@ -167,19 +167,19 @@ enum ASYNC_RPC_TYPE { // // arg1 is usually the buffer to read into // -// exchangeBuf is the (optional) buffer to exchange with after +// exchangeBuf is the (optional) buffer to exchange with after // completing the RPC, the buffer used by the Manager code. // Pass NULL if you don't want the buffer exchanged. // -// arg2, arg3, arg4 are additional arguments when needed by the +// arg2, arg3, arg4 are additional arguments when needed by the // RPC call; their usage varies for different RPC requests. // -// rpcType is as described above +// rpcType is as described above // -// completionTime is a pointer to a wxDateTime variable into which +// completionTime is a pointer to a wxDateTime variable into which // to write the completion time of the RPC. It may be NULL. // -// resultPtr is a pointer to an int into which to write the result +// resultPtr is a pointer to an int into which to write the result // returned by the RPC call. It may be NULL. // // retval is for internal use by the async RPC logic; do not use. @@ -216,13 +216,13 @@ class AsyncRPC ~AsyncRPC(); int RPC_Wait( - RPC_SELECTOR which_rpc, void* arg1 = NULL, void* - arg2 = NULL, void* arg3 = NULL, void* arg4 = NULL, + RPC_SELECTOR which_rpc, void* arg1 = NULL, void* + arg2 = NULL, void* arg3 = NULL, void* arg4 = NULL, bool hasPriority = false ); - // Manager must do all RPC data transfers through AsyncRPC calls, so - // this class must have methods corresponding to all RPC_CLIENT data + // Manager must do all RPC data transfers through AsyncRPC calls, so + // this class must have methods corresponding to all RPC_CLIENT data // transfer operations, but NOT init(), init_async(), close(), etc. int authorize(const char* passwd) { return RPC_Wait(RPC_AUTHORIZE, (void*)passwd); } @@ -355,14 +355,14 @@ class AsyncRPC class RPCThread : public wxThread { public: - RPCThread(CMainDocument *pDoc, - BOINC_Mutex* pRPC_Thread_Mutex, - BOINC_Condition* pRPC_Thread_Condition, - BOINC_Mutex* pRPC_Request_Mutex, + RPCThread(CMainDocument *pDoc, + BOINC_Mutex* pRPC_Thread_Mutex, + BOINC_Condition* pRPC_Thread_Condition, + BOINC_Mutex* pRPC_Request_Mutex, BOINC_Condition* RPC_Request_Condition ); virtual void *Entry(); - + private: int ProcessRPCRequest(); CMainDocument* m_pDoc; diff --git a/clientgui/BOINCBaseFrame.cpp b/clientgui/BOINCBaseFrame.cpp index dac079d4a84..07c00ab5c95 100644 --- a/clientgui/BOINCBaseFrame.cpp +++ b/clientgui/BOINCBaseFrame.cpp @@ -73,7 +73,7 @@ CBOINCBaseFrame::CBOINCBaseFrame() CBOINCBaseFrame::CBOINCBaseFrame(wxWindow* parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long style) : - wxFrame(parent, id, title, pos, size, style) + wxFrame(parent, id, title, pos, size, style) { wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseFrame::CBOINCBaseFrame - Function Begin")); @@ -110,7 +110,7 @@ CBOINCBaseFrame::CBOINCBaseFrame(wxWindow* parent, const wxWindowID id, const wx wxUpdateUIEvent::SetUpdateInterval(500); m_ptFramePos = wxPoint(0, 0); - + // The second half of the initialization process picks up in the OnFrameRender() // routine since the menus' and status bars' are drawn in the frameworks // on idle routines, on idle events are sent in between the end of the @@ -165,7 +165,7 @@ void CBOINCBaseFrame::OnPeriodicRPC(wxTimerEvent& WXUNUSED(event)) { first = false; wxGetApp().OnFinishInit(); } - + wxGetApp().CheckPartialActivation(); #endif @@ -173,7 +173,7 @@ void CBOINCBaseFrame::OnPeriodicRPC(wxTimerEvent& WXUNUSED(event)) { bAlreadyRunningLoop = true; pDoc->RunPeriodicRPCs(m_iFrameRefreshRate); - + bAlreadyRunningLoop = false; } } @@ -186,11 +186,11 @@ void CBOINCBaseFrame::OnDocumentPoll(wxTimerEvent& WXUNUSED(event)) { wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); - // Timer events are handled while the RPC Wait dialog is shown - // which may cause unintended recursion and repeatedly posting + // Timer events are handled while the RPC Wait dialog is shown + // which may cause unintended recursion and repeatedly posting // the same RPC requests from timer routines. if (pDoc->WaitingForRPC()) return; - + if (!bAlreadyRunOnce && m_pDocumentPollTimer->IsRunning()) { // Complete any remaining initialization that has to happen after we are up // and running @@ -215,8 +215,8 @@ void CBOINCBaseFrame::OnAlertPoll(wxTimerEvent& WXUNUSED(event)) { // Check to see if there is anything that we need to do from the // dial up user perspective. if (pDoc && m_pDialupManager) { - // Timer events are handled while the RPC Wait dialog is shown - // which may cause unintended recursion and repeatedly posting + // Timer events are handled while the RPC Wait dialog is shown + // which may cause unintended recursion and repeatedly posting // the same RPC requests from timer routines. if (pDoc->IsConnected() && !pDoc->WaitingForRPC()) { m_pDialupManager->OnPoll(); @@ -227,7 +227,7 @@ void CBOINCBaseFrame::OnAlertPoll(wxTimerEvent& WXUNUSED(event)) { m_bShowConnectionFailedAlert = false; ShowConnectionFailedAlert(); } - + bAlreadyRunningLoop = false; } } @@ -296,9 +296,9 @@ void CBOINCBaseFrame::OnAlert(CFrameAlertEvent& event) { // Currently, the only non-notification-only alert is Connection Failed, // which is now has logic to be displayed when Manager is maximized. - // Notification only events on platforms other than Windows are - // currently discarded. Otherwise the application would be restored - // and input focus set on the notification which interrupts whatever + // Notification only events on platforms other than Windows are + // currently discarded. Otherwise the application would be restored + // and input focus set on the notification which interrupts whatever // the user was doing. if (IsShown() && !event.m_notification_only) { int retval = 0; @@ -393,7 +393,7 @@ void CBOINCBaseFrame::FireRefreshView() { wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); - + pDoc->RefreshRPCs(); pDoc->RunPeriodicRPCs(0); } @@ -424,7 +424,7 @@ bool CBOINCBaseFrame::SelectComputer(wxString& hostName, int& portNum, wxString& size_t lIndex = 0; wxArrayString aComputerNames; bool bResult = false; - + // Lets copy the template store in the system state aComputerNames = m_aSelectedComputerMRU; @@ -443,13 +443,13 @@ bool CBOINCBaseFrame::SelectComputer(wxString& hostName, int& portNum, wxString& password = wxEmptyString; } else { // Parse the remote machine info - wxString sHost = dlg.m_ComputerNameCtrl->GetValue(); - long lPort = GUI_RPC_PORT; - int iPos = sHost.Find(wxT(":")); - if (iPos != wxNOT_FOUND) { - wxString sPort = sHost.substr(iPos + 1); - if (!sPort.ToLong(&lPort)) lPort = GUI_RPC_PORT; - sHost.erase(iPos); + wxString sHost = dlg.m_ComputerNameCtrl->GetValue(); + long lPort = GUI_RPC_PORT; + int iPos = sHost.Find(wxT(":")); + if (iPos != wxNOT_FOUND) { + wxString sPort = sHost.substr(iPos + 1); + if (!sPort.ToLong(&lPort)) lPort = GUI_RPC_PORT; + sHost.erase(iPos); } hostName = sHost; portNum = (int)lPort; @@ -475,7 +475,7 @@ bool CBOINCBaseFrame::SelectComputer(wxString& hostName, int& portNum, wxString& } else { bResult = false; // User cancelled } - + wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseFrame::SelectComputer - Function End")); return bResult; } @@ -534,7 +534,7 @@ void CBOINCBaseFrame::ShowConnectionFailedAlert() { if (pDoc->m_pClientManager->AutoRestart()) { boinc_sleep(0.5); // Allow time for Client to restart if (pDoc->m_pClientManager->IsBOINCCoreRunning()) { - pDoc->Reconnect(); + pDoc->Reconnect(); return; } } else { @@ -576,7 +576,7 @@ void CBOINCBaseFrame::ShowConnectionFailedAlert() { // If we are minimized, set flag to show alert when maximized m_bShowConnectionFailedAlert = !IsShown(); - + wxLogTrace(wxT("Function Start/End"), wxT("CBOINCBaseFrame::ShowConnectionFailedAlert - Function End")); } @@ -645,7 +645,7 @@ void CBOINCBaseFrame::ShowNotCurrentlyConnectedAlert() { if (pDoc->m_pClientManager->AutoRestart()) { boinc_sleep(0.5); // Allow time for Client to restart if (pDoc->m_pClientManager->IsBOINCCoreRunning()) { - pDoc->Reconnect(); + pDoc->Reconnect(); return; } } else { @@ -655,7 +655,7 @@ void CBOINCBaseFrame::ShowNotCurrentlyConnectedAlert() { } } } - + // %s is the application name // i.e. 'BOINC Manager', 'GridRepublic Manager' strDialogTitle.Printf( @@ -837,7 +837,7 @@ bool CBOINCBaseFrame::Show(bool bShow) { } } } - + CDlgEventLog* pEventLog = wxGetApp().GetEventLog(); if (pEventLog) { #ifdef __WXMAC__ @@ -870,7 +870,7 @@ int CBOINCBaseFrame::_GetCurrentViewPage() { void CFrameAlertEvent::ProcessResponse(const int response) const { CMainDocument* pDoc = wxGetApp().GetDocument(); - + wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); @@ -967,7 +967,7 @@ void CBOINCBaseFrame::OnWizardDetach(wxCommandEvent& WXUNUSED(event)) { CMainDocument* pDoc = wxGetApp().GetDocument(); CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced(); - wxInt32 iAnswer = 0; + wxInt32 iAnswer = 0; wxString strTitle = wxEmptyString; wxString strMessage = wxEmptyString; ACCT_MGR_INFO ami; @@ -990,7 +990,7 @@ void CBOINCBaseFrame::OnWizardDetach(wxCommandEvent& WXUNUSED(event)) { wxString(ami.acct_mgr_name.c_str(), wxConvUTF8).c_str() ); strMessage.Printf( - _("If you stop using %s,\nyou'll keep all your current projects,\nbut you'll have to manage projects manually.\n\nDo you want to stop using %s?"), + _("If you stop using %s,\nyou'll keep all your current projects,\nbut you'll have to manage projects manually.\n\nDo you want to stop using %s?"), wxString(ami.acct_mgr_name.c_str(), wxConvUTF8).c_str(), wxString(ami.acct_mgr_name.c_str(), wxConvUTF8).c_str() ); diff --git a/clientgui/BOINCBaseFrame.h b/clientgui/BOINCBaseFrame.h index cc45da22eed..d7eab32e18b 100644 --- a/clientgui/BOINCBaseFrame.h +++ b/clientgui/BOINCBaseFrame.h @@ -94,7 +94,7 @@ class CBOINCBaseFrame : public wxFrame { virtual void StopTimers() {} virtual void UpdateRefreshTimerInterval(); - void ShowAlert( + void ShowAlert( const wxString title, const wxString message, const int style, @@ -103,7 +103,7 @@ class CBOINCBaseFrame : public wxFrame { ); bool Show( bool bShow = true ); - + virtual bool RestoreState(); virtual bool SaveState(); virtual bool CreateMenus(){return true;} diff --git a/clientgui/BOINCBaseView.cpp b/clientgui/BOINCBaseView.cpp index eb2e3df6eb3..2d2b4049d0e 100644 --- a/clientgui/BOINCBaseView.cpp +++ b/clientgui/BOINCBaseView.cpp @@ -57,11 +57,11 @@ CBOINCBaseView::CBOINCBaseView(wxNotebook* pNotebook) : m_iProgressColumn = -1; m_iSortColumnID = -1; m_SortArrows = NULL; - + m_aStdColNameOrder = NULL; m_iDefaultShownColumns = NULL; m_iNumDefaultShownColumns = 0; - + SetName(GetViewName()); SetAutoLayout(TRUE); } @@ -99,7 +99,7 @@ CBOINCBaseView::CBOINCBaseView(wxNotebook* pNotebook, wxWindowID iTaskWindowID, m_pListPane = new CBOINCListCtrl(this, iListWindowID, iListWindowFlags); wxASSERT(m_pListPane); - + itemFlexGridSizer->Add(m_pTaskPane, 1, wxGROW|wxALL, 1); itemFlexGridSizer->Add(m_pListPane, 1, wxGROW|wxALL, 1); @@ -115,7 +115,7 @@ CBOINCBaseView::CBOINCBaseView(wxNotebook* pNotebook, wxWindowID iTaskWindowID, m_SortArrows->Add( wxIcon( sortascending_xpm ) ); m_SortArrows->Add( wxIcon( sortdescending_xpm ) ); m_pListPane->SetImageList(m_SortArrows, wxIMAGE_LIST_SMALL); - + m_aStdColNameOrder = NULL; m_iDefaultShownColumns = NULL; m_iNumDefaultShownColumns = 0; @@ -241,7 +241,7 @@ void CBOINCBaseView::OnListRender(wxTimerEvent& event) { // Remember the key values of currently selected items SaveSelections(); - + int iDocCount = GetDocCount(); int iCacheCount = GetCacheCount(); if (iDocCount != iCacheCount) { @@ -268,7 +268,7 @@ void CBOINCBaseView::OnListRender(wxTimerEvent& event) { m_pListPane->SetItemCount(iDocCount); m_bNeedSort = true; } else { - // The virtual ListCtrl keeps a separate its list of selected rows; + // The virtual ListCtrl keeps a separate its list of selected rows; // make sure it does not reference any rows beyond the new last row. // We can ClearSelections() because we called SaveSelections() above. ClearSelections(); @@ -306,7 +306,7 @@ void CBOINCBaseView::OnListRender(wxTimerEvent& event) { } } } - + // Find the previously selected items by their key values and reselect them RestoreSelections(); @@ -353,7 +353,7 @@ bool CBOINCBaseView::OnRestoreState(wxConfigBase* pConfig) { } -// We don't use this because multiple selection virtual +// We don't use this because multiple selection virtual // wxListCtrl does not generate selection events for // shift-click; see OnCheckSelectionChanged() below. void CBOINCBaseView::OnListSelected(wxListEvent& event) { @@ -369,7 +369,7 @@ void CBOINCBaseView::OnListSelected(wxListEvent& event) { } -// We don't use this because multiple selection virtual +// We don't use this because multiple selection virtual // wxListCtrl does generates deselection events only for // control-click; see OnCheckSelectionChanged() below. void CBOINCBaseView::OnListDeselected(wxListEvent& event) { @@ -406,7 +406,7 @@ void CBOINCBaseView::OnCacheHint(wxListEvent& ) { void CBOINCBaseView::CheckSelectionChanged() { int newSelectionCount = m_pListPane->GetSelectedItemCount(); long currentSelection = m_pListPane->GetFirstSelected(); - + if ((newSelectionCount != m_iPreviousSelectionCount) || (currentSelection != m_lPreviousFirstSelection) ) { @@ -450,7 +450,7 @@ int CBOINCBaseView::AddCacheElement() { return -1; } - + int CBOINCBaseView::EmptyCache() { return -1; } @@ -505,7 +505,7 @@ int CBOINCBaseView::SynchronizeCache() { sortData(); // Will mark moved items as needing refresh m_bNeedSort = false; } - + return 0; } @@ -519,13 +519,13 @@ void CBOINCBaseView::OnColClick(wxListEvent& event) { wxListItem item; int newSortColIndex = event.GetColumn(); int oldSortColIndex = -1; - + if (newSortColIndex < 0) return; // Clicked past last column - + if (m_iSortColumnID >= 0) { oldSortColIndex = m_iColumnIDToColumnIndex[m_iSortColumnID]; } - + item.SetMask(wxLIST_MASK_IMAGE); if (newSortColIndex == oldSortColIndex) { m_bReverseSort = !m_bReverseSort; @@ -542,7 +542,7 @@ void CBOINCBaseView::OnColClick(wxListEvent& event) { SetSortColumn(newSortColIndex); } - + // Write the change to the registry // Do this here because SetListColumnOrder() can call SetSortColumn() // even when neither m_iSortColumnID nor m_bReverseSort changes @@ -550,7 +550,7 @@ void CBOINCBaseView::OnColClick(wxListEvent& event) { pConfig->SetPath(wxT("/") + GetViewName()); m_pListPane->OnSaveState(pConfig); } - + void CBOINCBaseView::SetSortColumn(int newSortColIndex) { wxListItem item; int i, j, m; @@ -558,7 +558,7 @@ void CBOINCBaseView::SetSortColumn(int newSortColIndex) { item.SetImage(m_bReverseSort ? 0 : 1); m_pListPane->SetColumn(newSortColIndex, item); - + Freeze(); // To reduce flicker // Remember which cache elements are selected and deselect them m_bIgnoreUIEvents = true; @@ -569,10 +569,10 @@ void CBOINCBaseView::SetSortColumn(int newSortColIndex) { selections.Add(m_iSortedIndexes[i]); m_pListPane->SelectRow(i, false); } - + sortData(); - // Reselect previously selected cache elements in the sorted list + // Reselect previously selected cache elements in the sorted list m = (int)selections.GetCount(); for (i=0; i= 0) { @@ -592,7 +592,7 @@ void CBOINCBaseView::InitSort() { if (m_iSortColumnID < 0) return; int newSortColIndex = m_iColumnIDToColumnIndex[m_iSortColumnID]; if (newSortColIndex < 0) return; - + item.SetMask(wxLIST_MASK_IMAGE); item.SetImage(m_bReverseSort ? 0 : 1); m_pListPane->SetColumn(newSortColIndex, item); @@ -605,12 +605,12 @@ void CBOINCBaseView::InitSort() { void CBOINCBaseView::sortData() { if (m_iSortColumnID < 0) return; if (m_iColumnIDToColumnIndex[m_iSortColumnID] < 0) return; - + wxArrayInt oldSortedIndexes(m_iSortedIndexes); int i, n = (int)m_iSortedIndexes.GetCount(); - + std::stable_sort(m_iSortedIndexes.begin(), m_iSortedIndexes.end(), m_funcSortCompare); - + // Refresh rows which have moved for (i=0; iSelectRow(i, false); // This row should no longer be selected } } - + // Now select those rows which were not previously selected but should now be m = (int)arrSelRows.GetCount(); for (j=0; jSelectRow(arrSelRows[j], true); } m_bIgnoreUIEvents = false; - + if (oldCount != newCount) { m_bForceUpdateSelection = true; // OnListRender() will call UpdateSelection() } @@ -722,7 +722,7 @@ void CBOINCBaseView::RestoreSelections() { void CBOINCBaseView::ClearSelections() { if (!m_pListPane) return; - + m_bIgnoreUIEvents = true; int i = -1; while (1) { @@ -745,7 +745,7 @@ void CBOINCBaseView::UpdateSelection(){ void CBOINCBaseView::PostUpdateSelection(){ wxASSERT(m_pTaskPane); if (m_pTaskPane->UpdateControls()) { - // Under wxWidgets 2.9.4, Layout() causes ListCtrl + // Under wxWidgets 2.9.4, Layout() causes ListCtrl // to repaint, so call only when actually needed. Layout(); } @@ -791,8 +791,8 @@ void CBOINCBaseView::UpdateWebsiteSelection(long lControlGroup, PROJECT* project // Default project url pItem = new CTaskItem( - wxString("Home page", wxConvUTF8), - wxString(project->project_name.c_str(), wxConvUTF8) + wxT(" web site"), + wxString("Home page", wxConvUTF8), + wxString(project->project_name.c_str(), wxConvUTF8) + wxT(" web site"), wxString(project->master_url, wxConvUTF8), ID_TASK_PROJECT_WEB_PROJDEF_MIN ); @@ -843,7 +843,7 @@ void CBOINCBaseView::OnKeyPressed(wxKeyEvent &event) { if (m_pTaskPane) { int keyCode = event.GetKeyCode(); wxUint32 keyFlags = event.GetRawKeyFlags(); - + if (keyCode == WXK_TAB) { wxWindow* focused = wxWindow::FindFocus(); if (!m_pTaskPane->IsDescendant(focused)) { diff --git a/clientgui/BOINCBaseView.h b/clientgui/BOINCBaseView.h index 8bef7d1dfdc..b89a966dbe9 100644 --- a/clientgui/BOINCBaseView.h +++ b/clientgui/BOINCBaseView.h @@ -39,7 +39,7 @@ class CTaskItem : wxObject { m_strName(strName), m_strDescription(strDescription), m_iEventID(iEventID), m_pButton(NULL), m_strWebSiteLink(wxT("")) {}; CTaskItem( wxString strName, wxString strDescription, wxString strWebSiteLink, wxInt32 iEventID ) : - m_strName(strName), m_strDescription(strDescription), m_iEventID(iEventID), + m_strName(strName), m_strDescription(strDescription), m_iEventID(iEventID), m_pButton(NULL), m_strWebSiteLink(strWebSiteLink) {}; ~CTaskItem() {}; @@ -118,7 +118,7 @@ class CBOINCBaseView : public wxPanel { virtual double GetProgressValue(long item); virtual wxString GetProgressText( long item); virtual void AppendColumn(int columnID); - + void InitSort(); void SetSortColumn(int newSortColIndex); void SaveSelections(); @@ -126,13 +126,13 @@ class CBOINCBaseView : public wxPanel { void ClearSavedSelections(); void ClearSelections(); void RefreshTaskPane(); - + CBOINCListCtrl* GetListCtrl() { return m_pListPane; } - + #ifdef __WXMAC__ void OnKeyPressed(wxKeyEvent &event); -#endif - +#endif + std::vector m_TaskGroups; int m_iSortColumnID; // ColumnID of sort column @@ -144,7 +144,7 @@ class CBOINCBaseView : public wxPanel { int* m_iDefaultShownColumns; int m_iNumDefaultShownColumns; - + private: wxArrayString m_arrSelectedKeys1; //array for remembering the current selected rows by primary key column value @@ -165,7 +165,7 @@ class CBOINCBaseView : public wxPanel { virtual int OnListGetItemImage( long item ) const; void OnColClick(wxListEvent& event); - + virtual int GetDocCount(); virtual wxString OnDocGetItemImage( long item ) const; virtual wxString OnDocGetItemAttr( long item ) const; @@ -203,7 +203,7 @@ class CBOINCBaseView : public wxPanel { bool m_bForceUpdateSelection; bool m_bIgnoreUIEvents; bool m_bNeedSort; - + int m_iPreviousSelectionCount; long m_lPreviousFirstSelection; int m_iProgressColumn; diff --git a/clientgui/BOINCBaseWizard.cpp b/clientgui/BOINCBaseWizard.cpp index 60bf6e192fb..ff2e941e4f7 100644 --- a/clientgui/BOINCBaseWizard.cpp +++ b/clientgui/BOINCBaseWizard.cpp @@ -37,13 +37,13 @@ /*! * CBOINCBaseWizard type definition */ - + IMPLEMENT_DYNAMIC_CLASS( CBOINCBaseWizard, wxWizardEx ) - + /*! * CBOINCBaseWizard constructors */ - + CBOINCBaseWizard::CBOINCBaseWizard() : wxWizardEx() { @@ -60,7 +60,7 @@ CBOINCBaseWizard::CBOINCBaseWizard(wxWindow *parent, int id, const wxString& tit * Process Cancel Event */ bool CBOINCBaseWizard::IsCancelInProgress() const -{ +{ return m_bCancelInProgress; } @@ -78,7 +78,7 @@ void CBOINCBaseWizard::_ProcessCancelEvent( wxWizardExEvent& WXUNUSED(event) ) * Button Controls */ -wxButton* CBOINCBaseWizard::GetNextButton() const { +wxButton* CBOINCBaseWizard::GetNextButton() const { return m_btnNext; } @@ -105,7 +105,7 @@ void CBOINCBaseWizard::SimulateBackButton() { event.SetEventObject(GetNextButton()); AddPendingEvent(event); } - + void CBOINCBaseWizard::EnableBackButton() { m_btnPrev->Enable(); } @@ -123,7 +123,7 @@ void CBOINCBaseWizard::SimulateCancelButton() { event.SetEventObject(GetCancelButton()); AddPendingEvent(event); } - + void CBOINCBaseWizard::EnableCancelButton() { m_btnCancel->Enable(); } diff --git a/clientgui/BOINCBaseWizard.h b/clientgui/BOINCBaseWizard.h index 3327b288123..2eb801dcc2a 100644 --- a/clientgui/BOINCBaseWizard.h +++ b/clientgui/BOINCBaseWizard.h @@ -26,7 +26,7 @@ * CBOINCBaseWizard class declaration */ -class CBOINCBaseWizard: public wxWizardEx { +class CBOINCBaseWizard: public wxWizardEx { DECLARE_DYNAMIC_CLASS( CBOINCBaseWizard ) public: diff --git a/clientgui/BOINCClientManager.cpp b/clientgui/BOINCClientManager.cpp index 8eb10dc53e4..a5d80cd6aa2 100644 --- a/clientgui/BOINCClientManager.cpp +++ b/clientgui/BOINCClientManager.cpp @@ -87,8 +87,8 @@ CBOINCClientManager::~CBOINCClientManager() { bool CBOINCClientManager::AutoRestart() { double timeNow, timeDiff; if (IsBOINCCoreRunning()) return true; -#if ! (defined(__WXMAC__) || defined(__WXMSW__)) -// Mac and Windows can restart Client as a daemon, but +#if ! (defined(__WXMAC__) || defined(__WXMSW__)) +// Mac and Windows can restart Client as a daemon, but // Linux may not know Client's location if it didn't start the Client if (!m_bBOINCStartedByManager) return false; #endif @@ -122,7 +122,7 @@ bool CBOINCClientManager::AutoRestart() { bool CBOINCClientManager::IsSystemBooting() { bool bReturnValue = false; #if defined(__WXMSW__) - if (GetTickCount() < (1000*60*5)) bReturnValue = true; // If system has been up for less than 5 minutes + if (GetTickCount() < (1000*60*5)) bReturnValue = true; // If system has been up for less than 5 minutes #elif defined(__WXMAC__) if (getTimeSinceBoot() < (120)) bReturnValue = true; // If system has been up for less than 2 minutes #endif @@ -165,7 +165,7 @@ bool CBOINCClientManager::IsBOINCCoreRunning() { // Look for BOINC Client in list of all running processes retval = procinfo_setup(pm); if (retval) return false; // Should never happen - + PROC_MAP::iterator i; for (i=pm.begin(); i!=pm.end(); ++i) { PROCINFO& pi = i->second; @@ -274,11 +274,11 @@ bool CBOINCClientManager::StartupBOINCCore() { } } } else { - + // Get the full path to core client inside this application's bundle getPathToThisApp(buf, sizeof(buf)); #if 0 // The Mac version of wxExecute(wxString& ...) crashes if there is a space in the path - strExecute = wxT("\""); + strExecute = wxT("\""); strExecute += wxT(buf); strExecute += wxT("/Contents/Resources/boinc\" --redirectio --launched_by_manager"); m_lBOINCCoreProcessId = ::wxExecute(strExecute); @@ -308,9 +308,9 @@ bool CBOINCClientManager::StartupBOINCCore() { #else // Unix based systems wxString savedWD = ::wxGetCwd(); - + wxSetWorkingDirectory(wxGetApp().GetDataDirectory()); - + // Append boinc.exe to the end of the strExecute string and get ready to rock strExecute = wxGetApp().GetRootDirectory() + wxT("boinc --redirectio --launched_by_manager"); #ifdef SANDBOX @@ -323,7 +323,7 @@ bool CBOINCClientManager::StartupBOINCCore() { wxLogTrace(wxT("Function Status"), wxT("CMainDocument::StartupBOINCCore - szDataDirectory '%s'\n"), wxGetApp().GetDataDirectory().c_str()); m_lBOINCCoreProcessId = ::wxExecute(strExecute); - + wxSetWorkingDirectory(savedWD); #endif @@ -394,7 +394,7 @@ void CBOINCClientManager::KillClient() { void CBOINCClientManager::KillClient() { PROC_MAP pm; int retval; - + if (m_lBOINCCoreProcessId) { kill_process(m_lBOINCCoreProcessId); return; @@ -402,7 +402,7 @@ void CBOINCClientManager::KillClient() { retval = procinfo_setup(pm); if (retval) return; // Should never happen - + PROC_MAP::iterator i; for (i=pm.begin(); i!=pm.end(); ++i) { PROCINFO& procinfo = i->second; @@ -469,7 +469,7 @@ void CBOINCClientManager::ShutdownBOINCCore(bool ShuttingDownManager) { } else { if (IsBOINCCoreRunning()) { if (ShuttingDownManager) { - // Set event filtering to allow RPC completion + // Set event filtering to allow RPC completion // events but not events which start new RPCs wxGetApp().SetEventFiltering(true); } @@ -525,7 +525,7 @@ ClientCrashDlg::ClientCrashDlg(double timeDiff) : wxDialog( NULL, wxID_ANY, wxT( int minutes = wxMax((int)((timeDiff + 59.) / 60.), 2); CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced(); wxASSERT(pSkinAdvanced); - + // %s is the application name // i.e. 'BOINC Manager', 'GridRepublic Manager' strDialogTitle.Printf( @@ -541,18 +541,18 @@ ClientCrashDlg::ClientCrashDlg(double timeDiff) : wxDialog( NULL, wxID_ANY, wxT( strDialogMessage.Printf( _("The %s client has exited unexpectedly 3 times within the last %d minutes.\nWould you like to restart it again?"), pSkinAdvanced->GetApplicationShortName().c_str(), - minutes + minutes ); - + wxBoxSizer *topsizer = new wxBoxSizer( wxVERTICAL ); wxBoxSizer *icon_text = new wxBoxSizer( wxHORIZONTAL ); icon_text->Add( CreateTextSizer( strDialogMessage ), 0, wxALIGN_CENTER | wxLEFT, 10 ); topsizer->Add( icon_text, 1, wxCENTER | wxLEFT|wxRIGHT|wxTOP, 10 ); - + wxStdDialogButtonSizer *sizerBtn = CreateStdDialogButtonSizer(wxYES | wxNO | wxHELP); SetEscapeId(wxID_NO); // Changes return value of NO button to wxID_CANCEL - + if ( sizerBtn ) topsizer->Add(sizerBtn, 0, wxEXPAND | wxALL, 10 ); diff --git a/clientgui/BOINCDialupManager.cpp b/clientgui/BOINCDialupManager.cpp index 37d15d8f8c0..5fcdbe10568 100644 --- a/clientgui/BOINCDialupManager.cpp +++ b/clientgui/BOINCDialupManager.cpp @@ -127,7 +127,7 @@ void CBOINCDialUpManager::OnPoll() { // Log out the trace information for debugging purposes. /* wxLogTrace(wxT("Function Status"), wxT("CBOINCDialUpManager::poll - Dialup Flags")); - wxLogTrace(wxT("Function Status"), + wxLogTrace(wxT("Function Status"), wxT("CBOINCDialUpManager::poll - -- bIsOnline = '%d', bIsDialing = '%d', m_bWasDialing = '%d', iNetworkStatus = '%d', bWantConnection = '%d'"), bIsOnline, bIsDialing, m_bWasDialing, iNetworkStatus, bWantConnection ); diff --git a/clientgui/BOINCGUIApp.cpp b/clientgui/BOINCGUIApp.cpp index 313a133d072..d7fe6832371 100644 --- a/clientgui/BOINCGUIApp.cpp +++ b/clientgui/BOINCGUIApp.cpp @@ -204,7 +204,7 @@ bool CBOINCGUIApp::OnInit() { // Detect if the daemon should be launched m_bNeedRunDaemon = m_bNeedRunDaemon && m_bRunDaemon; - + // Should we abort the BOINC Manager startup process? if (m_bBOINCMGRAutoStarted && m_iBOINCMGRDisableAutoStart) { return false; @@ -242,7 +242,7 @@ bool CBOINCGUIApp::OnInit() { BOINC_DIAG_HEAPCHECKENABLED | BOINC_DIAG_MEMORYLEAKCHECKENABLED | #endif - BOINC_DIAG_DUMPCALLSTACKENABLED | + BOINC_DIAG_DUMPCALLSTACKENABLED | BOINC_DIAG_PERUSERLOGFILES | BOINC_DIAG_REDIRECTSTDERR | BOINC_DIAG_REDIRECTSTDOUT | @@ -320,7 +320,7 @@ bool CBOINCGUIApp::OnInit() { // char path_to_error[MAXPATHLEN]; path_to_error[0] = '\0'; - + if (!iErrorCode) { iErrorCode = check_security( g_use_sandbox, true, path_to_error, sizeof(path_to_error) @@ -365,14 +365,14 @@ bool CBOINCGUIApp::OnInit() { strDialogMessage += wxString::FromUTF8(path_to_error); } strDialogMessage += _(")"); - + fprintf(stderr, "%s\n", (const char*)strDialogMessage.utf8_str()); } wxMessageDialog* pDlg = new wxMessageDialog( - NULL, - strDialogMessage, - m_pSkinManager->GetAdvanced()->GetApplicationName(), + NULL, + strDialogMessage, + m_pSkinManager->GetAdvanced()->GetApplicationName(), wxOK ); @@ -388,9 +388,9 @@ bool CBOINCGUIApp::OnInit() { #ifdef __WXMSW__ // Perform any last minute checks that should keep the manager // from starting up. - wxString strRebootPendingFile = + wxString strRebootPendingFile = GetRootDirectory() + wxFileName::GetPathSeparator() + wxT("RebootPending.txt"); - + if (wxFile::Exists(strRebootPendingFile)) { wxMessageDialog dialog( NULL, @@ -443,7 +443,7 @@ bool CBOINCGUIApp::OnInit() { #ifndef __WXGTK__ // Initialize the task bar icon m_pTaskBarIcon = new CTaskBarIcon( - m_pSkinManager->GetAdvanced()->GetApplicationName(), + m_pSkinManager->GetAdvanced()->GetApplicationName(), m_pSkinManager->GetAdvanced()->GetApplicationIcon(), m_pSkinManager->GetAdvanced()->GetApplicationDisconnectedIcon(), m_pSkinManager->GetAdvanced()->GetApplicationSnoozeIcon() @@ -455,7 +455,7 @@ bool CBOINCGUIApp::OnInit() { #endif // __WXGTK__ #ifdef __WXMAC__ m_pMacDockIcon = new CTaskBarIcon( - m_pSkinManager->GetAdvanced()->GetApplicationName(), + m_pSkinManager->GetAdvanced()->GetApplicationName(), m_pSkinManager->GetAdvanced()->GetApplicationIcon(), m_pSkinManager->GetAdvanced()->GetApplicationDisconnectedIcon(), m_pSkinManager->GetAdvanced()->GetApplicationSnoozeIcon() @@ -466,7 +466,7 @@ bool CBOINCGUIApp::OnInit() { // Startup the System Idle Detection code IdleTrackerAttach(); - + // Show the UI SetActiveGUI(m_iGUISelected, m_bGUIVisible); @@ -480,14 +480,14 @@ bool CBOINCGUIApp::OnInit() { m_pFrame->Raise(); } } - + return true; } #ifdef __WXMAC__ // We can "show" (unhide) the main window when the // application is hidden and it won't be visible. -// If we don't do this under wxCocoa 3.0, the Dock +// If we don't do this under wxCocoa 3.0, the Dock // icon will bounce (as in notification) when we // click on our menu bar icon. // But wxFrame::Show(true) makes the application @@ -498,13 +498,13 @@ bool CBOINCGUIApp::OnInit() { // loop is running, so this is called from // CBOINCBaseFrame::OnPeriodicRPC() at the first // firing of ID_PERIODICRPCTIMER. -// +// void CBOINCGUIApp::OnFinishInit() { if (!m_bGUIVisible) { HideThisApp(); - + m_pFrame->wxWindow::Show(); - + if (m_pEventLog) { m_pEventLog->wxWindow::Show(); } @@ -679,7 +679,7 @@ bool CBOINCGUIApp::OnCmdLineParsed(wxCmdLineParser &parser) { if (m_strBOINCMGRDataDirectory.Last() != '/') { m_strBOINCMGRDataDirectory.Append('/'); } -#endif +#endif if (parser.Found(wxT("namehost"), &m_strHostNameArg)) { hostNameSpecified = true; @@ -696,7 +696,7 @@ bool CBOINCGUIApp::OnCmdLineParsed(wxCmdLineParser &parser) { } else { m_iRPCPortArg = GUI_RPC_PORT; } - + if (parser.Found(wxT("password"), &m_strPasswordArg)) { passwordSpecified = true; } else { @@ -751,7 +751,7 @@ void CBOINCGUIApp::DetectExecutableName() { // change the current directory to the boinc install directory GetModuleFileName(NULL, szPath, (sizeof(szPath)/sizeof(TCHAR))); - + TCHAR *pszProg = _tcsrchr(szPath, '\\'); if (pszProg) { pszProg++; @@ -782,7 +782,7 @@ void CBOINCGUIApp::DetectRootDirectory() { // change the current directory to the boinc install directory GetModuleFileName(NULL, szPath, (sizeof(szPath)/sizeof(TCHAR))); - + TCHAR *pszProg = _tcsrchr(szPath, '\\'); if (pszProg) { szPath[pszProg - szPath + 1] = 0; @@ -823,9 +823,9 @@ void CBOINCGUIApp::DetectDataDirectory() { // change the current directory to the boinc data directory if it exists lReturnValue = RegOpenKeyEx( - HKEY_LOCAL_MACHINE, + HKEY_LOCAL_MACHINE, _T("SOFTWARE\\Space Sciences Laboratory, U.C. Berkeley\\BOINC Setup"), - 0, + 0, KEY_READ, &hkSetupHive ); @@ -845,7 +845,7 @@ void CBOINCGUIApp::DetectDataDirectory() { (*lpszValue) = NULL; // Now get the data - lReturnValue = RegQueryValueEx( + lReturnValue = RegQueryValueEx( hkSetupHive, _T("DATADIR"), NULL, @@ -858,13 +858,13 @@ void CBOINCGUIApp::DetectDataDirectory() { // We need to get the size of the buffer needed dwSize = 0; lReturnValue = ExpandEnvironmentStrings(lpszValue, NULL, dwSize); - + if (lReturnValue) { // Make the buffer big enough for the expanded string lpszExpandedValue = (LPTSTR) malloc(lReturnValue*sizeof(TCHAR)); (*lpszExpandedValue) = NULL; dwSize = lReturnValue; - + ExpandEnvironmentStrings(lpszValue, lpszExpandedValue, dwSize); // Store the root directory for later use. @@ -945,7 +945,7 @@ void CBOINCGUIApp::OnActivateApp(wxActivateEvent& event) { #endif { bool keepEventLogInFront = m_bEventLogWasActive; - + if (m_pEventLog && !m_pEventLog->IsIconized() && !keepEventLogInFront) { m_pEventLog->Raise(); } @@ -960,17 +960,17 @@ void CBOINCGUIApp::OnActivateApp(wxActivateEvent& event) { } event.Skip(); - + m_bProcessingActivateAppEvent = false; } void CBOINCGUIApp::OnRPCFinished( CRPCFinishedEvent& event ) { CMainDocument* pDoc = wxGetApp().GetDocument(); - + wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); - + pDoc->OnRPCComplete(event); } @@ -1049,7 +1049,7 @@ void CBOINCGUIApp::OnEventLogClose() { } } - + // The skin has changed and all UI elements need to reload their bitmaps. // void CBOINCGUIApp::FireReloadSkin() { @@ -1097,7 +1097,7 @@ bool CBOINCGUIApp::SetActiveGUI(int iGUISelection, bool bShowWindow) { m_pConfig->Read(wxT("YPos"), &iTop, 30); m_pConfig->Read(wxT("XPos"), &iLeft, 30); - // We don't save Simple View's width & height since it's + // We don't save Simple View's width & height since it's // window is not resizable, so don't try to read them #ifdef __WXMAC__ // m_pConfig->Read(wxT("Width"), &iWidth, 409); @@ -1139,7 +1139,7 @@ bool CBOINCGUIApp::SetActiveGUI(int iGUISelection, bool bShowWindow) { if (BOINC_ADVANCEDGUI == iGUISelection) { // Initialize the advanced gui window pNewFrame = new CAdvancedFrame( - m_pSkinManager->GetAdvanced()->GetApplicationName(), + m_pSkinManager->GetAdvanced()->GetApplicationName(), m_pSkinManager->GetAdvanced()->GetApplicationIcon(), wxPoint(iLeft, iTop), wxSize(iWidth, iHeight) @@ -1147,7 +1147,7 @@ bool CBOINCGUIApp::SetActiveGUI(int iGUISelection, bool bShowWindow) { } else { // Initialize the simple gui window pNewFrame = new CSimpleFrame( - m_pSkinManager->GetAdvanced()->GetApplicationName(), + m_pSkinManager->GetAdvanced()->GetApplicationName(), m_pSkinManager->GetAdvanced()->GetApplicationIcon(), wxPoint(iLeft, iTop), wxSize(iWidth, iHeight) @@ -1162,7 +1162,7 @@ bool CBOINCGUIApp::SetActiveGUI(int iGUISelection, bool bShowWindow) { // Store the new frame for future use m_pFrame = pNewFrame; - // Hide the old one if it exists. We must do this + // Hide the old one if it exists. We must do this // after updating m_pFrame to prevent Mac OSX from // hiding the application if (pOldFrame) pOldFrame->Hide(); @@ -1179,7 +1179,7 @@ bool CBOINCGUIApp::SetActiveGUI(int iGUISelection, bool bShowWindow) { } } - // Show the new frame if needed + // Show the new frame if needed if (!m_bProcessingActivateAppEvent) { if (m_pFrame && bShowWindow) { if (m_pEventLog && !m_pEventLog->IsIconized()) { @@ -1223,18 +1223,18 @@ int CBOINCGUIApp::ConfirmExit() { wxASSERT(pSkinAdvanced); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced)); - + pDoc->GetConnectedComputerName(strConnectedCompter); if (!pDoc->IsComputerNameLocal(strConnectedCompter)) { // Don't shut down remote clients on Manager exit return 1; } - // Don't run confirmation dialog if logging out or shutting down Mac, + // Don't run confirmation dialog if logging out or shutting down Mac, // or if emergency exit from AsyncRPCDlg if (s_bSkipExitConfirmation) return 1; - // Don't run confirmation dialog if second instance of Manager + // Don't run confirmation dialog if second instance of Manager if (IsMgrMultipleInstance()) return 1; if (!m_iDisplayExitDialog) { @@ -1284,16 +1284,16 @@ int CBOINCGUIApp::ConfirmExit() { } -// Use this instead of wxMessageBox from all tab Views to suppress +// Use this instead of wxMessageBox from all tab Views to suppress // Periodic RPCs. See comment in CMainDocument::RunPeriodicRPCs() // for a fuller explanation. int CBOINCGUIApp::SafeMessageBox(const wxString& message, const wxString& caption, long style, wxWindow *parent, int x, int y ) { int retval; - + m_bSafeMessageBoxDisplayed++; - + retval = wxMessageBox(message, caption, style, parent, x, y); m_bSafeMessageBoxDisplayed--; @@ -1309,7 +1309,7 @@ int CBOINCGUIApp::SafeMessageBox(const wxString& message, const wxString& captio /// /// @return /// true if the current process is visible, otherwise false. -/// +/// bool CBOINCGUIApp::IsApplicationVisible() { return false; } @@ -1346,13 +1346,13 @@ bool CBOINCGUIApp::ShowNotifications() { bool CBOINCGUIApp::IsModalDialogDisplayed() { if (m_bSafeMessageBoxDisplayed) return true; - - // Search for the dialog by ID since all of BOINC Manager's + + // Search for the dialog by ID since all of BOINC Manager's // dialog IDs are 10000. if (wxDynamicCast(wxWindow::FindWindowById(ID_ANYDIALOG), wxDialog)) { return true; } - + if (m_pDocument) { if (m_pDocument->WaitingForRPC()) { return true; @@ -1372,14 +1372,14 @@ int CBOINCGUIApp::FilterEvent(wxEvent &event) { theEventType = event.GetEventType(); if (m_pDocument->WaitingForRPC()) { - // If in RPC Please Wait dialog, reject all command - // and timer events except: + // If in RPC Please Wait dialog, reject all command + // and timer events except: // - RPC Finished // - those for that dialog or its children // - Open Manager menu item from system tray icon if ((theEventType == wxEVT_COMMAND_MENU_SELECTED) && (event.GetId() == wxID_OPEN)) { - return -1; + return -1; } theRPCWaitDialog = m_pDocument->GetRPCWaitDialog(); @@ -1391,7 +1391,7 @@ int CBOINCGUIApp::FilterEvent(wxEvent &event) { } // Continue with rest of filtering below } else { - // Do limited filtering if shutting down to allow RPC + // Do limited filtering if shutting down to allow RPC // completion events but not events which start new RPCs if (!m_bFilterEvents) return -1; } @@ -1400,17 +1400,17 @@ int CBOINCGUIApp::FilterEvent(wxEvent &event) { if (event.IsCommandEvent()) { return false; } - + if (theEventType == wxEVT_TIMER) { return false; } - + #ifdef __WXMSW__ if (theEventType == wxEVT_TASKBAR_MOVE) { return false; } #endif - + return -1; } diff --git a/clientgui/BOINCGUIApp.h b/clientgui/BOINCGUIApp.h index 057c601ac71..5cc91220dfa 100644 --- a/clientgui/BOINCGUIApp.h +++ b/clientgui/BOINCGUIApp.h @@ -58,7 +58,7 @@ class CBOINCGUIApp : public wxApp { #ifndef __WXMAC__ void OnEndSession(wxCloseEvent& event); #endif - + void OnInitCmdLine(wxCmdLineParser &parser); bool OnCmdLineParsed(wxCmdLineParser &parser); @@ -107,21 +107,21 @@ class CBOINCGUIApp : public wxApp { #endif bool m_bGUIVisible; - + int m_iGUISelected; bool m_bDebugSkins; bool m_bMultipleInstancesOK; bool m_bHostnamePasswordSet; bool m_bFilterEvents; bool m_bAboutDialogIsOpen; - bool m_bRunDaemon; - bool m_bNeedRunDaemon; + bool m_bRunDaemon; + bool m_bNeedRunDaemon; // The last value defined in the wxLanguage enum is wxLANGUAGE_USER_DEFINED. // defined in: wx/intl.h wxArrayString m_astrLanguages; wxString m_strISOLanguageCode; - + int m_bSafeMessageBoxDisplayed; public: @@ -136,8 +136,8 @@ class CBOINCGUIApp : public wxApp { wxString GetExecutableName() { return m_strBOINCMGRExecutableName; } wxString GetRootDirectory() { return m_strBOINCMGRRootDirectory; } wxString GetDataDirectory() { return m_strBOINCMGRDataDirectory; } - wxString GetClientHostNameArg() { return m_strHostNameArg; } - wxString GetClientPasswordArg() { return m_strPasswordArg; } + wxString GetClientHostNameArg() { return m_strHostNameArg; } + wxString GetClientPasswordArg() { return m_strPasswordArg; } wxString GetArguments() { return m_strBOINCArguments; } int GetClientRPCPortArg() { return m_iRPCPortArg; } CDlgEventLog* GetEventLog() { return m_pEventLog; } @@ -180,18 +180,18 @@ class CBOINCGUIApp : public wxApp { #endif bool GetRunDaemon() - { return m_bRunDaemon; } - void SetRunDaemon(bool bRunDaemon) - { m_bRunDaemon = bRunDaemon; } - - bool GetNeedRunDaemon() - { return m_bNeedRunDaemon; } + { return m_bRunDaemon; } + void SetRunDaemon(bool bRunDaemon) + { m_bRunDaemon = bRunDaemon; } + + bool GetNeedRunDaemon() + { return m_bNeedRunDaemon; } wxArrayString& GetSupportedLanguages() { return m_astrLanguages; } wxString GetISOLanguageCode() { return m_strISOLanguageCode; } void SetISOLanguageCode(wxString strISOLanguageCode) { m_strISOLanguageCode = strISOLanguageCode; } - + void SetEventLogWasActive(bool wasActive) { m_bEventLogWasActive = wasActive; } void DisplayEventLog(bool bShowWindow = true); void OnEventLogClose(); @@ -203,10 +203,10 @@ class CBOINCGUIApp : public wxApp { int StartBOINCDefaultScreensaverTest(); bool SetActiveGUI(int iGUISelection, bool bShowWindow = true); - + void OnActivateApp( wxActivateEvent& event ); void OnRPCFinished( CRPCFinishedEvent& event ); - + int ConfirmExit(); int SafeMessageBox( @@ -230,9 +230,9 @@ class CBOINCGUIApp : public wxApp { int UpdateSystemIdleDetection(); - + void SetEventFiltering(bool set) { m_bFilterEvents = set; } - + void SetAboutDialogIsOpen(bool set) { m_bAboutDialogIsOpen = set; } bool GetAboutDialogIsOpen() { return m_bAboutDialogIsOpen; } @@ -242,13 +242,13 @@ class CBOINCGUIApp : public wxApp { bool WasFileModifiedBeforeSystemBoot(char * filePath); void HideThisApp(void); void getDisplayNameForThisApp(char* pathBuf, size_t bufSize); - + #if !wxCHECK_VERSION(3,0,1) // This should be fixed after wxCocoa 3.0.0: // http://trac.wxwidgets.org/ticket/16156 // Override standard wxCocoa wxApp::CallOnInit() to allow Manager - // to run properly when launched hidden on login via Login Item. + // to run properly when launched hidden on login via Login Item. bool CallOnInit(); #endif diff --git a/clientgui/BOINCGUIApp.rc b/clientgui/BOINCGUIApp.rc index af0c53693d3..11b6906c809 100644 --- a/clientgui/BOINCGUIApp.rc +++ b/clientgui/BOINCGUIApp.rc @@ -80,14 +80,14 @@ boincsnooze ICON "res\\boincsnooze.ico" // TEXTINCLUDE // -1 TEXTINCLUDE +1 TEXTINCLUDE BEGIN "#include \r\n" "#include ""win_config.h""\r\n" "\0" END -2 TEXTINCLUDE +2 TEXTINCLUDE BEGIN "\0" END diff --git a/clientgui/BOINCListCtrl.cpp b/clientgui/BOINCListCtrl.cpp index 5b830c20250..8c867eba9a7 100644 --- a/clientgui/BOINCListCtrl.cpp +++ b/clientgui/BOINCListCtrl.cpp @@ -237,13 +237,13 @@ bool CBOINCListCtrl::OnRestoreState(wxConfigBase* pConfig) { // If the user installed a new version of BOINC, new columns may have // been added that didn't exist in the older version. Check for this. // - // This will also be triggered if the locale is changed, which will cause - // SetListColumnOrder() to be called again so the wxListCtrl will be set + // This will also be triggered if the locale is changed, which will cause + // SetListColumnOrder() to be called again so the wxListCtrl will be set // up with the correctly labeled columns. // bool foundNewColumns = false; bool foundNewDefaultColumns = false; - + if (pConfig->Read(wxT("HiddenColumns"), &strHiddenColumns)) { wxArrayString hiddenArray; wxArrayString defaultArray; @@ -695,7 +695,7 @@ void CBOINCListCtrl::OnMouseDown(wxMouseEvent& event) { #endif -// To reduce flicker, refresh only changed columns (except +// To reduce flicker, refresh only changed columns (except // on Mac, which is double-buffered to eliminate flicker.) void CBOINCListCtrl::RefreshCell(int row, int col) { wxRect r; diff --git a/clientgui/BOINCListCtrl.h b/clientgui/BOINCListCtrl.h index d0589d5bd63..ac206b8b643 100644 --- a/clientgui/BOINCListCtrl.h +++ b/clientgui/BOINCListCtrl.h @@ -31,14 +31,14 @@ // Virtual wxListCtrl does not reliably generate selection and // deselection events, so we must check for these differently. -// We get more events than we need using EVT_LIST_CACHE_HINT, +// We get more events than we need using EVT_LIST_CACHE_HINT, // so testing on mouse events is more efficient, but it doesn't // work on Windows. #ifdef __WXMSW__ -// On Windows, check for selection / deselection on EVT_LIST_CACHE_HINT. +// On Windows, check for selection / deselection on EVT_LIST_CACHE_HINT. #define USE_LIST_CACHE_HINT 1 #else -// On Mac & Linux, check for selection / deselection on EVT_LEFT_DOWN. +// On Mac & Linux, check for selection / deselection on EVT_LEFT_DOWN. #define USE_LIST_CACHE_HINT 0 #endif @@ -87,7 +87,7 @@ class CBOINCListCtrl : public LISTCTRL_BASE { void SelectRow(int row, bool setSelected); void AddPendingProgressBar(int row); void RefreshCell(int row, int col); - + private: virtual wxString OnGetItemText(long item, long column) const; virtual int OnGetItemImage(long item) const; @@ -108,7 +108,7 @@ class CBOINCListCtrl : public LISTCTRL_BASE { private: void OnDrawProgressBar(CDrawProgressBarEvent& event); void DrawProgressBars(void); - + bool m_bProgressBarEventPending; #else public: @@ -176,7 +176,7 @@ class MyEvtHandler : public wxEvtHandler private: CBOINCListCtrl * m_listCtrl; - + #if !USE_NATIVE_LISTCONTROL #ifdef __WXGTK__ int m_view_startX; diff --git a/clientgui/BOINCTaskBar.cpp b/clientgui/BOINCTaskBar.cpp index 3a706372a67..428833d0fe0 100644 --- a/clientgui/BOINCTaskBar.cpp +++ b/clientgui/BOINCTaskBar.cpp @@ -425,7 +425,7 @@ bool CTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& ) #if wxCHECK_VERSION(3,1,6) wxIcon icon = newIcon.GetIcon(wxDefaultSize); #endif - + if (m_iconType != wxTBI_DOCK) { if (wxGetApp().GetBOINCMGRHideMenuBarIcon()) { RemoveIcon(); @@ -445,7 +445,7 @@ bool CTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& ) macIcon = wxImage(macsnoozebadge); else { #if wxDEBUG_LEVEL - err = + err = #endif SetDockBadge(NULL); return true; @@ -481,7 +481,7 @@ bool CTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& ) // Actually set the dock image #if wxDEBUG_LEVEL - err = + err = #endif SetDockBadge(&bmp); diff --git a/clientgui/BOINCTaskBar.h b/clientgui/BOINCTaskBar.h index a1f459bd9fe..c3419b6c987 100644 --- a/clientgui/BOINCTaskBar.h +++ b/clientgui/BOINCTaskBar.h @@ -91,7 +91,7 @@ class CTaskBarIcon : public wxTaskBarIconEx { bool IsBalloonsSupported(); bool QueueBalloon( - const wxIcon& icon, + const wxIcon& icon, const wxString title = wxEmptyString, const wxString message = wxEmptyString, unsigned int iconballoon = BALLOONTYPE_INFO @@ -101,7 +101,7 @@ class CTaskBarIcon : public wxTaskBarIconEx { wxIcon m_iconTaskBarNormal; wxIcon m_iconTaskBarDisconnected; wxIcon m_iconTaskBarSnooze; - + wxIcon m_iconCurrentIcon; bool m_bTaskbarInitiatedShutdown; diff --git a/clientgui/CompletionErrorPage.cpp b/clientgui/CompletionErrorPage.cpp index a9f4875ea5b..3f961b01293 100644 --- a/clientgui/CompletionErrorPage.cpp +++ b/clientgui/CompletionErrorPage.cpp @@ -39,40 +39,40 @@ /*! * CCompletionErrorPage type definition */ - + IMPLEMENT_DYNAMIC_CLASS( CCompletionErrorPage, wxWizardPageEx ) - + /*! * CCompletionErrorPage event table definition */ - + BEGIN_EVENT_TABLE( CCompletionErrorPage, wxWizardPageEx ) - + ////@begin CCompletionErrorPage event table entries EVT_WIZARDEX_PAGE_CHANGED( -1, CCompletionErrorPage::OnPageChanged ) EVT_WIZARDEX_CANCEL( -1, CCompletionErrorPage::OnCancel ) ////@end CCompletionErrorPage event table entries - + END_EVENT_TABLE() - + /*! * CCompletionErrorPage constructors */ - + CCompletionErrorPage::CCompletionErrorPage( ) { } - + CCompletionErrorPage::CCompletionErrorPage( CBOINCBaseWizard* parent ) { Create( parent ); } - + /*! * CAccountResultPage creator */ - + bool CCompletionErrorPage::Create( CBOINCBaseWizard* parent ) { ////@begin CCompletionErrorPage member initialisation @@ -82,7 +82,7 @@ bool CCompletionErrorPage::Create( CBOINCBaseWizard* parent ) m_pServerMessagesStaticBoxSizerCtrl = NULL; m_pServerMessagesCtrl = NULL; ////@end CCompletionErrorPage member initialisation - + ////@begin CCompletionErrorPage creation wxWizardPageEx::Create( parent, ID_COMPLETIONERRORPAGE ); @@ -92,13 +92,13 @@ bool CCompletionErrorPage::Create( CBOINCBaseWizard* parent ) return TRUE; } - + /*! * Control creation for CAccountResultPage */ - + void CCompletionErrorPage::CreateControls() -{ +{ ////@begin CCompletionErrorPage content construction CCompletionErrorPage* itemWizardPage85 = this; @@ -127,38 +127,38 @@ void CCompletionErrorPage::CreateControls() m_pServerMessagesStaticBoxSizerCtrl->Add(m_pServerMessagesCtrl, 0, wxGROW|wxALL, 5); ////@end CCompletionErrorPage content construction } - + /*! * Gets the previous page. */ - + wxWizardPageEx* CCompletionErrorPage::GetPrev() const { return NULL; } - + /*! * Gets the next page. */ - + wxWizardPageEx* CCompletionErrorPage::GetNext() const { return NULL; } - + /*! * Should we show tooltips? */ - + bool CCompletionErrorPage::ShowToolTips() { return TRUE; } - + /*! * Get bitmap resources */ - + wxBitmap CCompletionErrorPage::GetBitmapResource( const wxString& WXUNUSED(name) ) { // Bitmap retrieval @@ -167,11 +167,11 @@ wxBitmap CCompletionErrorPage::GetBitmapResource( const wxString& WXUNUSED(name) return wxNullBitmap; ////@end CCompletionErrorPage bitmap retrieval } - + /*! * Get icon resources */ - + wxIcon CCompletionErrorPage::GetIconResource( const wxString& WXUNUSED(name) ) { // Icon retrieval @@ -180,11 +180,11 @@ wxIcon CCompletionErrorPage::GetIconResource( const wxString& WXUNUSED(name) ) return wxNullIcon; ////@end CCompletionErrorPage icon retrieval } - + /*! * wxEVT_WIZARD_PAGE_CHANGED event handler for ID_COMPLETIONERRORPAGE */ - + void CCompletionErrorPage::OnPageChanged( wxWizardExEvent& event ) { if (event.GetDirection() == false) return; @@ -239,11 +239,11 @@ void CCompletionErrorPage::OnPageChanged( wxWizardExEvent& event ) { Fit(); } - + /*! * wxEVT_WIZARD_CANCEL event handler for ID_COMPLETIONERRORPAGE */ - + void CCompletionErrorPage::OnCancel( wxWizardExEvent& event ) { PROCESS_CANCELEVENT(event); } diff --git a/clientgui/CompletionErrorPage.h b/clientgui/CompletionErrorPage.h index cfad043f6a2..910034837c4 100644 --- a/clientgui/CompletionErrorPage.h +++ b/clientgui/CompletionErrorPage.h @@ -27,7 +27,7 @@ */ class CCompletionErrorPage: public wxWizardPageEx -{ +{ DECLARE_DYNAMIC_CLASS( CCompletionErrorPage ) DECLARE_EVENT_TABLE() diff --git a/clientgui/CompletionPage.cpp b/clientgui/CompletionPage.cpp index ebb18c3e1d9..0c20f83f51e 100644 --- a/clientgui/CompletionPage.cpp +++ b/clientgui/CompletionPage.cpp @@ -40,40 +40,40 @@ /*! * CCompletionPage type definition */ - + IMPLEMENT_DYNAMIC_CLASS( CCompletionPage, wxWizardPageEx ) - + /*! * CCompletionPage event table definition */ - + BEGIN_EVENT_TABLE( CCompletionPage, wxWizardPageEx ) - + ////@begin CCompletionPage event table entries EVT_WIZARDEX_PAGE_CHANGED( -1, CCompletionPage::OnPageChanged ) EVT_WIZARDEX_CANCEL( -1, CCompletionPage::OnCancel ) EVT_WIZARDEX_FINISHED( ID_COMPLETIONPAGE, CCompletionPage::OnFinished ) ////@end CCompletionPage event table entries - + END_EVENT_TABLE() - + /*! * CCompletionPage constructors */ - + CCompletionPage::CCompletionPage( ) { } - + CCompletionPage::CCompletionPage( CBOINCBaseWizard* parent ) { Create( parent ); } - + /*! * CCompletionPage creator */ - + bool CCompletionPage::Create( CBOINCBaseWizard* parent ) { ////@begin CCompletionPage member initialisation @@ -82,23 +82,23 @@ bool CCompletionPage::Create( CBOINCBaseWizard* parent ) m_pCompletionBrandedMessage = NULL; m_pCompletionMessage = NULL; ////@end CCompletionPage member initialisation - + ////@begin CCompletionPage creation wxWizardPageEx::Create( parent, ID_COMPLETIONPAGE ); CreateControls(); GetSizer()->Fit(this); ////@end CCompletionPage creation - + return TRUE; } - + /*! * Control creation for CCompletionPage */ - + void CCompletionPage::CreateControls() -{ +{ ////@begin CCompletionPage content construction CCompletionPage* itemWizardPage79 = this; @@ -124,38 +124,38 @@ void CCompletionPage::CreateControls() itemBoxSizer80->Add(m_pCompletionMessage, 0, wxALIGN_LEFT|wxALL, 5); ////@end CCompletionPage content construction } - + /*! * Gets the previous page. */ - + wxWizardPageEx* CCompletionPage::GetPrev() const { return NULL; } - + /*! * Gets the next page. */ - + wxWizardPageEx* CCompletionPage::GetNext() const { return NULL; } - + /*! * Should we show tooltips? */ - + bool CCompletionPage::ShowToolTips() { return TRUE; } - + /*! * Get bitmap resources */ - + wxBitmap CCompletionPage::GetBitmapResource( const wxString& WXUNUSED(name) ) { // Bitmap retrieval @@ -163,11 +163,11 @@ wxBitmap CCompletionPage::GetBitmapResource( const wxString& WXUNUSED(name) ) return wxNullBitmap; ////@end CCompletionPage bitmap retrieval } - + /*! * Get icon resources */ - + wxIcon CCompletionPage::GetIconResource( const wxString& WXUNUSED(name) ) { // Icon retrieval @@ -175,11 +175,11 @@ wxIcon CCompletionPage::GetIconResource( const wxString& WXUNUSED(name) ) return wxNullIcon; ////@end CCompletionPage icon retrieval } - + /*! * wxEVT_WIZARD_PAGE_CHANGED event handler for ID_COMPLETIONPAGE */ - + void CCompletionPage::OnPageChanged( wxWizardExEvent& event ) { if (event.GetDirection() == false) return; @@ -275,26 +275,26 @@ void CCompletionPage::OnPageChanged( wxWizardExEvent& event ) { pWAP->GetSize(&w, &h); m_pCompletionBrandedMessage->Wrap(w - x - x1 - 5); Fit(); - + // Is this supposed to be completely automated? // If so, then go ahead and close the wizard down now. if (pWAP->IsCloseWhenCompleted()) { pWAP->SimulateNextButton(); } } - + /*! * wxEVT_WIZARD_CANCEL event handler for ID_COMPLETIONPAGE */ - + void CCompletionPage::OnCancel( wxWizardExEvent& event ) { PROCESS_CANCELEVENT(event); } - + /*! * wxEVT_WIZARD_FINISHED event handler for ID_COMPLETIONPAGE */ - + void CCompletionPage::OnFinished( wxWizardExEvent& event ) { event.Skip(); } diff --git a/clientgui/CompletionPage.h b/clientgui/CompletionPage.h index a4c0dee4c2e..f179a101bb6 100644 --- a/clientgui/CompletionPage.h +++ b/clientgui/CompletionPage.h @@ -27,7 +27,7 @@ */ class CCompletionPage: public wxWizardPageEx -{ +{ DECLARE_DYNAMIC_CLASS( CCompletionPage ) DECLARE_EVENT_TABLE() diff --git a/clientgui/DlgAbout.cpp b/clientgui/DlgAbout.cpp index 0be0ec7b7d0..7374b0986e4 100644 --- a/clientgui/DlgAbout.cpp +++ b/clientgui/DlgAbout.cpp @@ -98,7 +98,7 @@ bool CDlgAbout::Create(wxWindow* parent, wxWindowID id, const wxString& caption, #endif m_strWidgetsVersion.Printf(wxT("%d.%d.%d"), wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER); ////@end CDlgAbout member initialisation - + CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced(); wxASSERT(pSkinAdvanced); wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced)); @@ -143,7 +143,7 @@ bool CDlgAbout::Create(wxWindow* parent, wxWindowID id, const wxString& caption, * Control creation for CDlgHelpAbout */ -void CDlgAbout::CreateControls() { +void CDlgAbout::CreateControls() { ////@begin CDlgAbout content construction CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced(); wxASSERT(pSkinAdvanced); diff --git a/clientgui/DlgAbout.h b/clientgui/DlgAbout.h index e42b9b7b2e6..3a0b39790e8 100644 --- a/clientgui/DlgAbout.h +++ b/clientgui/DlgAbout.h @@ -68,7 +68,7 @@ */ class CDlgAbout: public wxDialog -{ +{ DECLARE_DYNAMIC_CLASS( CDlgAbout ) DECLARE_EVENT_TABLE() diff --git a/clientgui/DlgAdvPreferences.cpp b/clientgui/DlgAdvPreferences.cpp index 8f68829a154..1ed9ce99c89 100644 --- a/clientgui/DlgAdvPreferences.cpp +++ b/clientgui/DlgAdvPreferences.cpp @@ -478,7 +478,7 @@ bool CDlgAdvPreferences::SavePreferencesSettings() { m_txtProcUseProcessorsNotInUse->GetValue().ToDouble(&td); prefs.niu_max_ncpus_pct = RoundToHundredths(td); mask.niu_max_ncpus_pct=true; - + m_txtProcUseCPUTime->GetValue().ToDouble(&td); prefs.cpu_usage_limit=RoundToHundredths(td); mask.cpu_usage_limit=true; diff --git a/clientgui/DlgDiagnosticLogFlags.h b/clientgui/DlgDiagnosticLogFlags.h index bbf1b23feae..78809a8256b 100644 --- a/clientgui/DlgDiagnosticLogFlags.h +++ b/clientgui/DlgDiagnosticLogFlags.h @@ -55,13 +55,13 @@ class CDlgDiagnosticLogFlags : public wxDialog { //generic layout methods bool SaveState(); bool RestoreState(); - + void CreateCheckboxes(); void SaveFlags(); - + LOG_FLAGS log_flags; CC_CONFIG m_cc_config; - + wxGridSizer* m_headingSizer; std::vector m_checkbox_list; wxButton* m_btnApply; diff --git a/clientgui/DlgEventLogListCtrl.cpp b/clientgui/DlgEventLogListCtrl.cpp index e49cd030570..60f4728f98a 100644 --- a/clientgui/DlgEventLogListCtrl.cpp +++ b/clientgui/DlgEventLogListCtrl.cpp @@ -85,12 +85,12 @@ END_EVENT_TABLE() CDlgEventLogListCtrl::CDlgEventLogListCtrl() {} CDlgEventLogListCtrl::CDlgEventLogListCtrl(CDlgEventLog* pView, wxWindowID iListWindowID, wxInt32 iListWindowFlags) - : DLG_LISTCTRL_BASE(pView, iListWindowID, wxDefaultPosition, wxDefaultSize, iListWindowFlags) + : DLG_LISTCTRL_BASE(pView, iListWindowID, wxDefaultPosition, wxDefaultSize, iListWindowFlags) { m_pParentView = pView; m_bIsSingleSelection = (iListWindowFlags & wxLC_SINGLE_SEL) ? true : false ; - + #ifdef __WXGTK__ savedHandler = GetMainWin()->GetEventHandler(); GetMainWin()->PushEventHandler(new MyEvtLogEvtHandler(this)); diff --git a/clientgui/DlgEventLogListCtrl.h b/clientgui/DlgEventLogListCtrl.h index 175c97414cb..bdc1641b8c9 100644 --- a/clientgui/DlgEventLogListCtrl.h +++ b/clientgui/DlgEventLogListCtrl.h @@ -48,7 +48,7 @@ class CDlgEventLogListCtrl : public DLG_LISTCTRL_BASE #endif private: - + virtual wxString OnGetItemText(long item, long column) const; virtual int OnGetItemImage(long item) const; virtual wxListItemAttr* OnGetItemAttr(long item) const; diff --git a/clientgui/DlgExclusiveApps.cpp b/clientgui/DlgExclusiveApps.cpp index cd2b8093556..e146089f53e 100644 --- a/clientgui/DlgExclusiveApps.cpp +++ b/clientgui/DlgExclusiveApps.cpp @@ -80,9 +80,9 @@ CDlgExclusiveApps::CDlgExclusiveApps(wxWindow* parent) : m_addExclusiveAppButton = new wxButton( exclusiveAppsListStaticBox, ID_ADDEXCLUSIVEAPPBUTTON, _("Add..."), wxDefaultPosition, wxDefaultSize, 0 ); m_addExclusiveAppButton->SetToolTip( _("Add an application to this list")); exclusiveAppsButtonSizer->Add( m_addExclusiveAppButton, 0, wxRIGHT, 5 ); - + exclusiveAppsButtonSizer->AddStretchSpacer(); - + m_removeExclusiveAppButton = new wxButton( exclusiveAppsListStaticBox, ID_REMOVEEXCLUSIVEAPPBUTTON, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); m_removeExclusiveAppButton->SetToolTip( _("Remove an application from this list")); exclusiveAppsButtonSizer->Add( m_removeExclusiveAppButton, 0, wxLEFT, 5 ); @@ -104,9 +104,9 @@ CDlgExclusiveApps::CDlgExclusiveApps(wxWindow* parent) : m_addExclusiveGPUAppButton = new wxButton( exclusiveGPUAppsListStaticBox, ID_ADDEXCLUSIVEGPUAPPBUTTON, _("Add..."), wxDefaultPosition, wxDefaultSize, 0 ); m_addExclusiveGPUAppButton->SetToolTip( _("Add an application to this list")); exclusiveGPUAppsButtonSizer->Add( m_addExclusiveGPUAppButton, 0, wxRIGHT, 5 ); - + exclusiveGPUAppsButtonSizer->AddStretchSpacer(); - + m_removeExclusiveGPUAppButton = new wxButton( exclusiveGPUAppsListStaticBox, ID_REMOVEEXCLUSIVEGPUAPPBUTTON, _("Remove"), wxDefaultPosition, wxDefaultSize, 0 ); m_removeExclusiveGPUAppButton->SetToolTip( _("Remove an application from this list")); exclusiveGPUAppsButtonSizer->Add( m_removeExclusiveGPUAppButton, 0, wxLEFT, 5 ); @@ -128,7 +128,7 @@ CDlgExclusiveApps::CDlgExclusiveApps(wxWindow* parent) : moreOptionsLinkSizer->Add( new wxHyperlinkCtrl( this, wxID_ANY, wxT("https://boinc.berkeley.edu/wiki/Client_configuration"), - wxT("https://boinc.berkeley.edu/wiki/Client_configuration"), + wxT("https://boinc.berkeley.edu/wiki/Client_configuration"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ), #ifdef __WXMAC__ diff --git a/clientgui/DlgExclusiveApps.h b/clientgui/DlgExclusiveApps.h index c7f4ec466dc..63d0503df3d 100644 --- a/clientgui/DlgExclusiveApps.h +++ b/clientgui/DlgExclusiveApps.h @@ -54,7 +54,7 @@ class CDlgExclusiveApps : public wxDialog { CC_CONFIG config; bool m_bExclusiveAppsDataChanged; bool m_bInInit; - + wxListBox* m_exclusiveApsListBox; wxListBox* m_exclusiveGPUApsListBox; wxButton* m_addExclusiveAppButton; diff --git a/clientgui/DlgExitMessage.cpp b/clientgui/DlgExitMessage.cpp index ea1d7706403..56cd36edf74 100644 --- a/clientgui/DlgExitMessage.cpp +++ b/clientgui/DlgExitMessage.cpp @@ -107,14 +107,14 @@ bool CDlgExitMessage::Create( wxWindow* parent, wxWindowID id, const wxString& c */ void CDlgExitMessage::CreateControls() -{ +{ CSkinAdvanced* pSkinAdvanced = wxGetApp().GetSkinManager()->GetAdvanced(); wxString strExitMessage = wxEmptyString; wxString strAlwaysExitMessage = wxEmptyString; wxASSERT(pSkinAdvanced); wxASSERT(wxDynamicCast(pSkinAdvanced, CSkinAdvanced)); - + ////@begin CDlgExitMessage content construction CDlgExitMessage* itemDialog1 = this; diff --git a/clientgui/DlgExitMessage.h b/clientgui/DlgExitMessage.h index e334b2de7e2..4fb288e2ba3 100644 --- a/clientgui/DlgExitMessage.h +++ b/clientgui/DlgExitMessage.h @@ -72,7 +72,7 @@ */ class CDlgExitMessage: public wxDialog -{ +{ DECLARE_DYNAMIC_CLASS( CDlgExitMessage ) DECLARE_EVENT_TABLE() diff --git a/clientgui/DlgGenericMessage.cpp b/clientgui/DlgGenericMessage.cpp index 372feb2cb1a..a9d29bb96af 100644 --- a/clientgui/DlgGenericMessage.cpp +++ b/clientgui/DlgGenericMessage.cpp @@ -89,7 +89,7 @@ bool CDlgGenericMessage::Create( wxWindow* parent, wxWindowID id, const wxString */ void CDlgGenericMessage::CreateControls() -{ +{ ////@begin CDlgGenericMessage content construction CDlgGenericMessage* itemDialog1 = this; diff --git a/clientgui/DlgGenericMessage.h b/clientgui/DlgGenericMessage.h index a3786df47fd..49347abae60 100644 --- a/clientgui/DlgGenericMessage.h +++ b/clientgui/DlgGenericMessage.h @@ -71,7 +71,7 @@ */ class CDlgGenericMessage: public wxDialog -{ +{ DECLARE_DYNAMIC_CLASS( CDlgGenericMessage ) DECLARE_EVENT_TABLE() diff --git a/clientgui/DlgHiddenColumns.h b/clientgui/DlgHiddenColumns.h index bdf706a5d43..fffa31ffa25 100644 --- a/clientgui/DlgHiddenColumns.h +++ b/clientgui/DlgHiddenColumns.h @@ -37,14 +37,14 @@ class CDlgHiddenColumns : public wxDialog { void OnOK(wxCommandEvent& event); void OnSetDefaults(wxCommandEvent& event); void OnCheckboxClick(wxCommandEvent& event); - + private: //generic layout methods bool SaveState(); bool RestoreState(); - + void CreateCheckboxes(); - + wxButton* m_btnOK; wxGridSizer* m_headingSizer; std::vector *> m_checkbox_list; diff --git a/clientgui/DlgItemProperties.cpp b/clientgui/DlgItemProperties.cpp index fa59730daf7..ec2e9e9790c 100644 --- a/clientgui/DlgItemProperties.cpp +++ b/clientgui/DlgItemProperties.cpp @@ -49,8 +49,8 @@ struct ITEM { }; /* Constructor */ -CDlgItemProperties::CDlgItemProperties(wxWindow* parent) : - wxDialog( parent, ID_ANYDIALOG, wxEmptyString, wxDefaultPosition, +CDlgItemProperties::CDlgItemProperties(wxWindow* parent) : + wxDialog( parent, ID_ANYDIALOG, wxEmptyString, wxDefaultPosition, wxSize( 503,480 ), wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ) { CBOINCBaseFrame* pFrame = wxGetApp().GetFrame(); wxASSERT(pFrame); @@ -58,16 +58,16 @@ CDlgItemProperties::CDlgItemProperties(wxWindow* parent) : SetSizeHints( wxDefaultSize, wxDefaultSize ); SetExtraStyle( GetExtraStyle() | wxWS_EX_VALIDATE_RECURSIVELY ); - + m_bSizer1 = new wxBoxSizer( wxVERTICAL ); - + const long style = wxBORDER_NONE; m_txtInformation = new wxHtmlWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, style, wxEmptyString ); m_txtInformation->Bind(wxEVT_LEFT_DOWN, &CDlgItemProperties::OnMouseButtonEvent, this); m_txtInformation->Bind(wxEVT_LEFT_UP, &CDlgItemProperties::OnMouseButtonEvent, this); - + m_bSizer1->Add( m_txtInformation, 1, wxEXPAND | wxALL, 5 ); - + wxBoxSizer *bSizer2 = new wxBoxSizer(wxHORIZONTAL); m_bSizer1->Add(bSizer2, 0, wxALIGN_RIGHT | wxALL, 12); @@ -79,12 +79,12 @@ CDlgItemProperties::CDlgItemProperties(wxWindow* parent) : m_pCopySelectedButton->Enable(false); m_btnClose = new wxButton( this, wxID_OK, _("&Close"), wxDefaultPosition, wxDefaultSize, 0 ); - m_btnClose->SetDefault(); + m_btnClose->SetDefault(); bSizer2->Add( m_btnClose, 0, wxALIGN_BOTTOM|wxALL, 5 ); - + SetSizer( m_bSizer1 ); Layout(); - + int currentTabView = pFrame->GetCurrentViewPage(); switch(currentTabView) { case VW_PROJ: @@ -120,7 +120,7 @@ bool CDlgItemProperties::SaveState() { pConfig->Write(wxT("YPos"), GetPosition().y); pConfig->Flush(); - + return true; } @@ -171,7 +171,7 @@ bool CDlgItemProperties::RestoreState() { if ( oTempSize.GetWidth() > rDisplay.width ) oTempSize.SetWidth(rDisplay.width); if ( oTempSize.GetHeight() > rDisplay.height ) oTempSize.SetHeight(rDisplay.height); - // Check if part of the display was going to be off the screen, if so, center the + // Check if part of the display was going to be off the screen, if so, center the // display on that axis if ( oTempPoint.x < rDisplay.x ) { oTempPoint.x = rDisplay.x; @@ -188,7 +188,7 @@ bool CDlgItemProperties::RestoreState() { delete display; #endif #ifdef __WXMAC__ - // If the user has changed the arrangement of multiple + // If the user has changed the arrangement of multiple // displays, make sure the window title bar is still on-screen. if (!IsWindowOnScreen(oTempPoint.x, oTempPoint.y, oTempSize.GetWidth(), oTempSize.GetHeight())) { oTempPoint.y = oTempPoint.x = 30; @@ -237,17 +237,17 @@ void CDlgItemProperties::renderInfos(PROJECT* project_in) { //disk usage needs additional lookups CMainDocument* pDoc = wxGetApp().GetDocument(); pDoc->CachedDiskUsageUpdate(); - - // CachedDiskUsageUpdate() may have invalidated our project + + // CachedDiskUsageUpdate() may have invalidated our project // pointer, so get an updated pointer to this project PROJECT* project = pDoc->project(project_in->master_url); if (!project) return; // TODO: display some sort of error alert? std::vector dp = pDoc->disk_usage.projects; - double diskusage=0.0; + double diskusage=0.0; for (unsigned int i=0; i< dp.size(); i++) { - PROJECT* tp = dp[i]; - std::string tname; + PROJECT* tp = dp[i]; + std::string tname; tp->get_name(tname); wxString t1(wxString(tname.c_str(), wxConvUTF8)); if(t1.IsSameAs(wxString(projectname.c_str(), wxConvUTF8)) || t1.IsSameAs(wxString(project->master_url, wxConvUTF8))) { @@ -322,7 +322,7 @@ void CDlgItemProperties::renderInfos(PROJECT* project_in) { format_number(project->host_expavg_credit, 2).c_str() ) ); - + if (!project->non_cpu_intensive) { addSection(_("Scheduling")); addProperty(_("Scheduling priority"), format_number(project->sched_priority, 2)); @@ -379,7 +379,7 @@ void CDlgItemProperties::renderInfos(RESULT* result) { avp = r->avp; wup = r->wup; } - + addProperty(_("Application"), FormatApplicationName(result)); addProperty(_("Name"), wxString(result->wu_name, wxConvUTF8)); addProperty(_("State"), result_description(result, false)); @@ -451,7 +451,7 @@ void CDlgItemProperties::renderInfos(RESULT* result) { } // -wxString CDlgItemProperties::FormatDiskSpace(double bytes) { +wxString CDlgItemProperties::FormatDiskSpace(double bytes) { wxString strBuffer= wxEmptyString; if (bytes >= TERA) { @@ -553,7 +553,7 @@ void CDlgItemProperties::renderInfos() { content += m_items[i].value; content += ""; content += ""; - } + } } content += ""; content += ""; @@ -563,12 +563,12 @@ void CDlgItemProperties::renderInfos() { } -// adds a title section label to the dialog +// adds a title section label to the dialog void CDlgItemProperties::addSection(const wxString& title) { m_items.push_back(ITEM(ItemTypeSection, title)); } -// adds a property row to the dialog +// adds a property row to the dialog void CDlgItemProperties::addProperty(const wxString& name, const wxString& value) { m_items.push_back(ITEM(ItemTypeProperty, name, value)); } diff --git a/clientgui/DlgOptions.cpp b/clientgui/DlgOptions.cpp index 92d7bc2bf8b..3e9c48e6e6e 100644 --- a/clientgui/DlgOptions.cpp +++ b/clientgui/DlgOptions.cpp @@ -82,10 +82,10 @@ CDlgOptions::~CDlgOptions() { wxASSERT(pFrame); wxASSERT(wxDynamicCast(pFrame, CBOINCBaseFrame)); - + wxGetApp().SaveState(); pFrame->SaveState(); - + wxConfigBase::Get(FALSE)->Flush(); } @@ -159,10 +159,10 @@ bool CDlgOptions::Create(wxWindow* parent, wxWindowID id, const wxString& captio * Control creation for CDlgToolsOptions */ -// NOTE: On MS Windows with wxWidgets 3.0, controls inside a wxStaticBox +// NOTE: On MS Windows with wxWidgets 3.0, controls inside a wxStaticBox // don't refresh properly unless they are children of the wxStaticBox! // -void CDlgOptions::CreateControls() { +void CDlgOptions::CreateControls() { ////@begin CDlgOptions content construction CDlgOptions* itemDialog1 = this; @@ -242,7 +242,7 @@ void CDlgOptions::CreateControls() { if (ShowToolTips()) m_EnableBOINCClientShutdownMessageCtrl->SetToolTip(_("Display confirmation dialog when shutting down the connected client.")); itemFlexGridSizer6->Add(m_EnableBOINCClientShutdownMessageCtrl, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5); - + #ifdef __WXMAC__ wxStaticText* itemStaticText14 = new wxStaticText; itemStaticText14->Create( itemPanel4, wxID_STATIC, _("Show status in menu bar?"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -596,7 +596,7 @@ wxIcon CDlgOptions::GetIconResource( const wxString& WXUNUSED(name) ) { #ifdef __WXMSW__ wxString CDlgOptions::GetDefaultDialupConnection() const { - return m_DialupDefaultConnectionCtrl->GetLabel(); + return m_DialupDefaultConnectionCtrl->GetLabel(); } void CDlgOptions::SetDefaultDialupConnection(wxString value) { diff --git a/clientgui/DlgOptions.h b/clientgui/DlgOptions.h index 7f16c4186b0..34c94cf5406 100644 --- a/clientgui/DlgOptions.h +++ b/clientgui/DlgOptions.h @@ -100,7 +100,7 @@ */ class CDlgOptions: public wxDialog -{ +{ DECLARE_DYNAMIC_CLASS( CDlgOptions ) DECLARE_EVENT_TABLE() @@ -111,7 +111,7 @@ class CDlgOptions: public wxDialog /// Destructor ~CDlgOptions( ); - + /// Creation bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CDLGOPTIONS_IDNAME, const wxString& caption = SYMBOL_CDLGOPTIONS_TITLE, const wxPoint& pos = SYMBOL_CDLGOPTIONS_POSITION, const wxSize& size = SYMBOL_CDLGOPTIONS_SIZE, long style = SYMBOL_CDLGOPTIONS_STYLE ); diff --git a/clientgui/DlgSelectComputer.cpp b/clientgui/DlgSelectComputer.cpp index 42a4049d40f..1371930ed17 100644 --- a/clientgui/DlgSelectComputer.cpp +++ b/clientgui/DlgSelectComputer.cpp @@ -108,7 +108,7 @@ bool CDlgSelectComputer::Create( wxWindow* parent, bool required, wxWindowID id, */ void CDlgSelectComputer::CreateControls(bool required) -{ +{ ////@begin CDlgSelectComputer content construction CDlgSelectComputer* itemDialog1 = this; @@ -122,14 +122,14 @@ void CDlgSelectComputer::CreateControls(bool required) wxString strInfo = wxEmptyString; strInfo.Printf( - _("Another instance of %s is already running \non this computer. Please select a client to monitor."), + _("Another instance of %s is already running \non this computer. Please select a client to monitor."), pSkinAdvanced->GetApplicationName().c_str() ); wxStaticText* itemStaticText1 = new wxStaticText; itemStaticText1->Create( itemDialog1, wxID_STATIC, strInfo, wxDefaultPosition, wxDefaultSize, 0); itemBoxSizer2->Add(itemStaticText1, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5); } - + wxFlexGridSizer* itemFlexGridSizer3 = new wxFlexGridSizer(1, 2, 0, 0); itemBoxSizer2->Add(itemFlexGridSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5); diff --git a/clientgui/DlgSelectComputer.h b/clientgui/DlgSelectComputer.h index b7a4a509a3f..0bfd453d24e 100644 --- a/clientgui/DlgSelectComputer.h +++ b/clientgui/DlgSelectComputer.h @@ -68,7 +68,7 @@ */ class CDlgSelectComputer: public wxDialog -{ +{ DECLARE_DYNAMIC_CLASS( CDlgSelectComputer ) DECLARE_EVENT_TABLE() diff --git a/clientgui/Localization.cpp b/clientgui/Localization.cpp index 328caac7865..bdacc0a7deb 100644 --- a/clientgui/Localization.cpp +++ b/clientgui/Localization.cpp @@ -35,7 +35,7 @@ CLocalization::CLocalization() { _("Help"); m_strSAHHelpDescription = _("Ask questions and report problems"); - m_strSAHYourAccountName = + m_strSAHYourAccountName = _("Your account"); m_strSAHYourAccountDescription = _("View your account information and credit totals"); diff --git a/clientgui/MainDocument.cpp b/clientgui/MainDocument.cpp index 54fbe6c6ea4..1597ce36c79 100644 --- a/clientgui/MainDocument.cpp +++ b/clientgui/MainDocument.cpp @@ -1632,7 +1632,7 @@ RUNNING_GFX_APP* CMainDocument::GetRunningGraphicsApp(RESULT* rp) { // our forked process and its child graphics app, or the other will remain. A // race condition can occur because of the time it takes for our forked process // to launch the graphics app, so we periodically poll for the child's PID until - // it is available. If we don't have it yet, we defer killing our forked process. + // it is available. If we don't have it yet, we defer killing our forked process. if (g_use_sandbox) { if (!GetGFXPIDFromForkedPID(&(*gfx_app_iter))) { return 0; // Ignore "Stop graphics" button until we have graphics app's pid @@ -1691,14 +1691,14 @@ void CMainDocument::KillInactiveGraphicsApps() { // our forked process and its child graphics app, or the other will remain. A // race condition can occur because of the time it takes for our forked process // to launch the graphics app, so we periodically poll for the child's PID until - // it is available. If we don't have it yet, we defer killing our forked process. + // it is available. If we don't have it yet, we defer killing our forked process. if (g_use_sandbox) { if (!GetGFXPIDFromForkedPID(&(*gfx_app_iter))) { return; // Ignore "Stop graphics" button until we have graphics app's pid } KillGraphicsApp((*gfx_app_iter).gfx_pid); KillGraphicsApp((*gfx_app_iter).pid); - + // Graphics app wrote files in slot directory as logged in user, not boinc_master fix_slot_file_owners((*gfx_app_iter).slot); } @@ -1728,7 +1728,7 @@ void CMainDocument::KillAllRunningGraphicsApps() // our forked process and its child graphics app, or the other will remain. A // race condition can occur because of the time it takes for our forked process // to launch the graphics app, so we periodically poll for the child's PID until - // it is available. If we don't have it yet, we defer killing our forked process. + // it is available. If we don't have it yet, we defer killing our forked process. if (g_use_sandbox) { for (int j=0; j<100; ++j) { // Wait 1 second max for gfx app's pid if (GetGFXPIDFromForkedPID(&(*gfx_app_iter))) { @@ -1773,18 +1773,18 @@ void CMainDocument::KillGraphicsApp(int pid) { // our forked process and its child graphics app, or the other will remain. A // race condition can occur because of the time it takes for our forked process // to launch the graphics app, so we periodically call this method to poll for -// the child's PID until it is available.. +// the child's PID until it is available.. // int CMainDocument::GetGFXPIDFromForkedPID(RUNNING_GFX_APP* gfx_app) { char buf[256]; if (gfx_app->gfx_pid) return gfx_app->gfx_pid; // We already found it - + // The graphics app is the child of our forked process. Get its PID FILE *fp = (FILE*)popen("ps -xoppid,pid","r"); fgets(buf, sizeof(buf), fp); // Skip the header line int parent, child; - + // Find the process whose parent is our forked process while (fscanf(fp, "%d %d\n", &parent, &child) == 2) { if (parent == gfx_app->pid) { @@ -1800,7 +1800,7 @@ int CMainDocument::GetGFXPIDFromForkedPID(RUNNING_GFX_APP* gfx_app) { int CMainDocument::fix_slot_file_owners(int slot) { if (g_use_sandbox) { // Graphics apps run by Manager write files in slot directory - // as logged in user, not boinc_master. This ugly hack tells + // as logged in user, not boinc_master. This ugly hack tells // BOINC client to fix all ownerships in this slot directory rpcClient.run_graphics_app("stop", slot, ""); } @@ -1842,16 +1842,16 @@ int CMainDocument::WorkShowGraphics(RESULT* rp) { // our forked process and its child graphics app, or the other will remain. A // race condition can occur because of the time it takes for our forked process // to launch the graphics app, so we periodically poll for the child's PID until - // it is available. If we don't have it yet, then defer responding to the "Stop + // it is available. If we don't have it yet, then defer responding to the "Stop // graphics" button. if (!GetGFXPIDFromForkedPID(previous_gfx_app)) { return 0; // Ignore "Stop graphics" button until we have graphics app's pid } KillGraphicsApp(previous_gfx_app->gfx_pid); } -#endif +#endif KillGraphicsApp(previous_gfx_app->pid); // User clicked on "Stop graphics" button - GetRunningGraphicsApp(rp); // Let GetRunningGraphicsApp() do necessary clean up + GetRunningGraphicsApp(rp); // Let GetRunningGraphicsApp() do necessary clean up return 0; } @@ -1866,7 +1866,7 @@ int CMainDocument::WorkShowGraphics(RESULT* rp) { int pid = fork(); char path[MAXPATHLEN]; char cmd[2048]; - + // As of MacOS 13.0 Ventura IOSurface cannot be used to share graphics // between apps unless they are running as the same user, so we no // longer run the graphics apps as user boinc_master. To replace the @@ -1877,8 +1877,8 @@ int CMainDocument::WorkShowGraphics(RESULT* rp) { // But it is used widely in Apple's software, and the security profile // elements we use are very unlikely to change. if (pid == 0) { - // For unknown reasons, the graphics application exits with - // "RegisterProcess failed (error = -50)" unless we pass its + // For unknown reasons, the graphics application exits with + // "RegisterProcess failed (error = -50)" unless we pass its // full path twice in the argument list to execv. strlcpy(cmd, "sandbox-exec -f \"", sizeof(cmd)); getPathToThisApp(path, sizeof(path)); @@ -1888,7 +1888,7 @@ int CMainDocument::WorkShowGraphics(RESULT* rp) { strlcat(cmd, "\"", sizeof(cmd)); // path to sandboxing profile chdir(rp->slot_path); iRetVal = callPosixSpawn(cmd); - + exit(0); } id = pid; @@ -2775,7 +2775,7 @@ wxString FormatTime(double secs) { if (secs <= 0) { return wxT("---"); } - + wxTimeSpan ts = convert_to_timespan(secs); return ts.Format((secs>=86400)?"%Dd %H:%M:%S":"%H:%M:%S"); } diff --git a/clientgui/NoInternetConnectionPage.cpp b/clientgui/NoInternetConnectionPage.cpp index bf42b63bf5e..67f8d41d4f6 100644 --- a/clientgui/NoInternetConnectionPage.cpp +++ b/clientgui/NoInternetConnectionPage.cpp @@ -94,7 +94,7 @@ bool CErrNoInternetConnectionPage::Create( CBOINCBaseWizard* parent ) */ void CErrNoInternetConnectionPage::CreateControls() -{ +{ ////@begin CErrNoInternetConnectionPage content construction CErrNoInternetConnectionPage* itemWizardPage96 = this; @@ -184,11 +184,11 @@ void CErrNoInternetConnectionPage::OnPageChanged( wxWizardExEvent& event ) { Fit(); } - + /*! * wxEVT_WIZARD_CANCEL event handler for ID_ERRNOINTERNETCONNECTIONPAGE */ - + void CErrNoInternetConnectionPage::OnCancel( wxWizardExEvent& event ) { PROCESS_CANCELEVENT(event); } diff --git a/clientgui/NoInternetConnectionPage.h b/clientgui/NoInternetConnectionPage.h index 967fd23f2b7..d7df4fafb26 100644 --- a/clientgui/NoInternetConnectionPage.h +++ b/clientgui/NoInternetConnectionPage.h @@ -27,7 +27,7 @@ */ class CErrNoInternetConnectionPage: public wxWizardPageEx -{ +{ DECLARE_DYNAMIC_CLASS( CErrNoInternetConnectionPage ) DECLARE_EVENT_TABLE() diff --git a/clientgui/NotDetectedPage.cpp b/clientgui/NotDetectedPage.cpp index 85fa738f9f4..92cb73f95aa 100644 --- a/clientgui/NotDetectedPage.cpp +++ b/clientgui/NotDetectedPage.cpp @@ -39,47 +39,47 @@ /*! * CErrNotDetectedPage type definition */ - + IMPLEMENT_DYNAMIC_CLASS( CErrNotDetectedPage, wxWizardPageEx ) - + /*! * CErrNotDetectedPage event table definition */ - + BEGIN_EVENT_TABLE( CErrNotDetectedPage, wxWizardPageEx ) - + ////@begin CErrNotDetectedPage event table entries EVT_WIZARDEX_PAGE_CHANGED( -1, CErrNotDetectedPage::OnPageChanged ) EVT_WIZARDEX_CANCEL( -1, CErrNotDetectedPage::OnCancel ) ////@end CErrNotDetectedPage event table entries - + END_EVENT_TABLE() - + /*! * CErrNotDetectedPage constructors */ - + CErrNotDetectedPage::CErrNotDetectedPage( ) { } - + CErrNotDetectedPage::CErrNotDetectedPage( CBOINCBaseWizard* parent ) { Create( parent ); } - + /*! * CErrProjectUnavailable creator */ - + bool CErrNotDetectedPage::Create( CBOINCBaseWizard* parent ) { ////@begin CErrNotDetectedPage member initialisation m_pTitleStaticCtrl = NULL; m_pDirectionsStaticCtrl = NULL; ////@end CErrNotDetectedPage member initialisation - + ////@begin CErrNotDetectedPage creation wxWizardPageEx::Create( parent, ID_ERRNOTDETECTEDPAGE ); @@ -89,13 +89,13 @@ bool CErrNotDetectedPage::Create( CBOINCBaseWizard* parent ) return TRUE; } - + /*! * Control creation for CErrProjectUnavailable */ - + void CErrNotDetectedPage::CreateControls() -{ +{ ////@begin CErrNotDetectedPage content construction CErrNotDetectedPage* itemWizardPage96 = this; @@ -114,38 +114,38 @@ void CErrNotDetectedPage::CreateControls() itemBoxSizer97->Add(m_pDirectionsStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5); ////@end CErrNotDetectedPage content construction } - + /*! * Gets the previous page. */ - + wxWizardPageEx* CErrNotDetectedPage::GetPrev() const { return PAGE_TRANSITION_BACK; } - + /*! * Gets the next page. */ - + wxWizardPageEx* CErrNotDetectedPage::GetNext() const { return NULL; } - + /*! * Should we show tooltips? */ - + bool CErrNotDetectedPage::ShowToolTips() { return TRUE; } - + /*! * Get bitmap resources */ - + wxBitmap CErrNotDetectedPage::GetBitmapResource( const wxString& WXUNUSED(name) ) { // Bitmap retrieval @@ -153,11 +153,11 @@ wxBitmap CErrNotDetectedPage::GetBitmapResource( const wxString& WXUNUSED(name) return wxNullBitmap; ////@end CErrNotDetectedPage bitmap retrieval } - + /*! * Get icon resources */ - + wxIcon CErrNotDetectedPage::GetIconResource( const wxString& WXUNUSED(name) ) { // Icon retrieval @@ -165,11 +165,11 @@ wxIcon CErrNotDetectedPage::GetIconResource( const wxString& WXUNUSED(name) ) return wxNullIcon; ////@end CErrNotDetectedPage icon retrieval } - + /*! * wxEVT_WIZARD_PAGE_CHANGED event handler for ID_ERRPROJECTNOTDETECTEDPAGE */ - + void CErrNotDetectedPage::OnPageChanged( wxWizardExEvent& event ) { if (event.GetDirection() == false) return; @@ -196,11 +196,11 @@ void CErrNotDetectedPage::OnPageChanged( wxWizardExEvent& event ) { Fit(); } - + /*! * wxEVT_WIZARD_CANCEL event handler for ID_ERRPROJECTNOTDETECTEDPAGE */ - + void CErrNotDetectedPage::OnCancel( wxWizardExEvent& event ) { PROCESS_CANCELEVENT(event); } diff --git a/clientgui/NotDetectedPage.h b/clientgui/NotDetectedPage.h index 8fd1df80c6c..2e7e7515f5d 100644 --- a/clientgui/NotDetectedPage.h +++ b/clientgui/NotDetectedPage.h @@ -27,7 +27,7 @@ */ class CErrNotDetectedPage: public wxWizardPageEx -{ +{ DECLARE_DYNAMIC_CLASS( CErrNotDetectedPage ) DECLARE_EVENT_TABLE() diff --git a/clientgui/NotFoundPage.cpp b/clientgui/NotFoundPage.cpp index 7b4d05b8100..632b191b482 100644 --- a/clientgui/NotFoundPage.cpp +++ b/clientgui/NotFoundPage.cpp @@ -39,13 +39,13 @@ /*! * CErrNotFoundPage type definition */ - + IMPLEMENT_DYNAMIC_CLASS( CErrNotFoundPage, wxWizardPageEx ) - + /*! * CErrNotFoundPage event table definition */ - + BEGIN_EVENT_TABLE( CErrNotFoundPage, wxWizardPageEx ) ////@begin CErrNotFoundPage event table entries @@ -53,33 +53,33 @@ BEGIN_EVENT_TABLE( CErrNotFoundPage, wxWizardPageEx ) EVT_WIZARDEX_CANCEL( -1, CErrNotFoundPage::OnCancel ) ////@end CErrNotFoundPage event table entries - + END_EVENT_TABLE() - + /*! * CErrNotFoundPage constructors */ - + CErrNotFoundPage::CErrNotFoundPage( ) { } - + CErrNotFoundPage::CErrNotFoundPage( CBOINCBaseWizard* parent ) { Create( parent ); } - + /*! * CErrNoInternetConnection creator */ - + bool CErrNotFoundPage::Create( CBOINCBaseWizard* parent ) { ////@begin CErrNotFoundPage member initialisation m_pTitleStaticCtrl = NULL; m_pDirectionsStaticCtrl = NULL; ////@end CErrNotFoundPage member initialisation - + ////@begin CErrNotFoundPage creation wxWizardPageEx::Create( parent, ID_ERRNOTFOUNDPAGE ); @@ -89,13 +89,13 @@ bool CErrNotFoundPage::Create( CBOINCBaseWizard* parent ) return TRUE; } - + /*! * Control creation for CErrNoInternetConnection */ - + void CErrNotFoundPage::CreateControls() -{ +{ ////@begin CErrNotFoundPage content construction CErrNotFoundPage* itemWizardPage96 = this; @@ -114,16 +114,16 @@ void CErrNotFoundPage::CreateControls() itemBoxSizer97->Add(m_pDirectionsStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5); ////@end CErrNotFoundPage content construction } - + /*! * Gets the previous page. */ - + wxWizardPageEx* CErrNotFoundPage::GetPrev() const { return PAGE_TRANSITION_BACK; } - + /*! * Gets the next page. */ @@ -132,20 +132,20 @@ wxWizardPageEx* CErrNotFoundPage::GetNext() const { return PAGE_TRANSITION_NEXT(ID_ACCOUNTINFOPAGE); } - + /*! * Should we show tooltips? */ - + bool CErrNotFoundPage::ShowToolTips() { return TRUE; } - + /*! * Get bitmap resources */ - + wxBitmap CErrNotFoundPage::GetBitmapResource( const wxString& WXUNUSED(name) ) { // Bitmap retrieval @@ -153,7 +153,7 @@ wxBitmap CErrNotFoundPage::GetBitmapResource( const wxString& WXUNUSED(name) ) return wxNullBitmap; ////@end CErrNotFoundPage bitmap retrieval } - + /*! * Get icon resources */ @@ -165,7 +165,7 @@ wxIcon CErrNotFoundPage::GetIconResource( const wxString& WXUNUSED(name) ) return wxNullIcon; ////@end CErrNotFoundPage icon retrieval } - + /*! * wxEVT_WIZARD_PAGE_CHANGED event handler for ID_ERRNACCOUNTDOESNOTEXISTPAGE */ diff --git a/clientgui/NotFoundPage.h b/clientgui/NotFoundPage.h index 7c3fe2f7f64..34ad2a65718 100644 --- a/clientgui/NotFoundPage.h +++ b/clientgui/NotFoundPage.h @@ -27,7 +27,7 @@ */ class CErrNotFoundPage: public wxWizardPageEx -{ +{ DECLARE_DYNAMIC_CLASS( CErrNotFoundPage ) DECLARE_EVENT_TABLE() diff --git a/clientgui/ProjectInfoPage.h b/clientgui/ProjectInfoPage.h index 9c39f2b8dd6..4fc77cbc966 100644 --- a/clientgui/ProjectInfoPage.h +++ b/clientgui/ProjectInfoPage.h @@ -31,7 +31,7 @@ class CProjectInfo; */ class CProjectInfoPage: public wxWizardPageEx -{ +{ DECLARE_DYNAMIC_CLASS( CProjectInfoPage ) DECLARE_EVENT_TABLE() diff --git a/clientgui/ProjectProcessingPage.h b/clientgui/ProjectProcessingPage.h index 265e028e483..52fc85756bd 100644 --- a/clientgui/ProjectProcessingPage.h +++ b/clientgui/ProjectProcessingPage.h @@ -63,7 +63,7 @@ END_DECLARE_EVENT_TYPES() */ class CProjectProcessingPage: public wxWizardPageEx -{ +{ DECLARE_DYNAMIC_CLASS( CProjectProcessingPage ) DECLARE_EVENT_TABLE() diff --git a/clientgui/ProjectPropertiesPage.h b/clientgui/ProjectPropertiesPage.h index d7b5e790983..1e2f037e6f2 100644 --- a/clientgui/ProjectPropertiesPage.h +++ b/clientgui/ProjectPropertiesPage.h @@ -65,7 +65,7 @@ END_DECLARE_EVENT_TYPES() */ class CProjectPropertiesPage: public wxWizardPageEx -{ +{ DECLARE_DYNAMIC_CLASS( CProjectPropertiesPage ) DECLARE_EVENT_TABLE() diff --git a/clientgui/ProjectWelcomePage.cpp b/clientgui/ProjectWelcomePage.cpp index 92e167a5118..8ad80b421ab 100644 --- a/clientgui/ProjectWelcomePage.cpp +++ b/clientgui/ProjectWelcomePage.cpp @@ -48,39 +48,39 @@ /*! * CProjectWelcomePage type definition */ - + IMPLEMENT_DYNAMIC_CLASS( CProjectWelcomePage, wxWizardPageEx ) - + /*! * CProjectWelcomePage event table definition */ - + BEGIN_EVENT_TABLE( CProjectWelcomePage, wxWizardPageEx ) - + ////@begin CProjectWelcomePage event table entries EVT_WIZARDEX_PAGE_CHANGED( -1, CProjectWelcomePage::OnPageChanged ) EVT_WIZARDEX_CANCEL( -1, CProjectWelcomePage::OnCancel ) ////@end CProjectWelcomePage event table entries - + END_EVENT_TABLE() /*! * CProjectWelcomePage constructors */ - + CProjectWelcomePage::CProjectWelcomePage( ) { } - + CProjectWelcomePage::CProjectWelcomePage( CBOINCBaseWizard* parent ) { Create( parent ); } - + /*! * WizardPage creator */ - + bool CProjectWelcomePage::Create( CBOINCBaseWizard* parent ) { ////@begin CProjectWelcomePage member initialisation @@ -88,7 +88,7 @@ bool CProjectWelcomePage::Create( CBOINCBaseWizard* parent ) ////@end CProjectWelcomePage member initialisation ((CWizardAttach*)parent)->IsFirstPass = false; - + ////@begin CProjectWelcomePage creation wxWizardPageEx::Create( parent, ID_PROJECTWELCOMEPAGE ); @@ -98,13 +98,13 @@ bool CProjectWelcomePage::Create( CBOINCBaseWizard* parent ) return TRUE; } - + /*! * Control creation for WizardPage */ - + void CProjectWelcomePage::CreateControls() -{ +{ ////@begin CWelcomePage content construction CProjectWelcomePage* itemWizardPage2 = this; @@ -155,16 +155,16 @@ void CProjectWelcomePage::CreateControls() /* * Gets the previous page. */ - + wxWizardPageEx* CProjectWelcomePage::GetPrev() const { return NULL; } - + /*! * Gets the next page. */ - + wxWizardPageEx* CProjectWelcomePage::GetNext() const { CWizardAttach* pWA = ((CWizardAttach*)GetParent()); @@ -180,20 +180,20 @@ wxWizardPageEx* CProjectWelcomePage::GetNext() const return PAGE_TRANSITION_NEXT(ID_PROJECTPROPERTIESPAGE); } } - + /*! * Should we show tooltips? */ - + bool CProjectWelcomePage::ShowToolTips() { return TRUE; } - + /*! * Get bitmap resources */ - + wxBitmap CProjectWelcomePage::GetBitmapResource( const wxString& WXUNUSED(name) ) { // Bitmap retrieval @@ -201,11 +201,11 @@ wxBitmap CProjectWelcomePage::GetBitmapResource( const wxString& WXUNUSED(name) return wxNullBitmap; ////@end CWelcomePage bitmap retrieval } - + /*! * Get icon resources */ - + wxIcon CProjectWelcomePage::GetIconResource( const wxString& WXUNUSED(name) ) { // Icon retrieval @@ -217,7 +217,7 @@ wxIcon CProjectWelcomePage::GetIconResource( const wxString& WXUNUSED(name) ) /*! * wxEVT_WIZARD_PAGE_CHANGED event handler for ID_PROJECTWELCOMEPAGE */ - + void CProjectWelcomePage::OnPageChanged( wxWizardExEvent& event ) { if (event.GetDirection() == false) return; wxLogTrace(wxT("Function Start/End"), wxT("CProjectWelcomePage::OnPageChanged - Function Begin")); @@ -246,7 +246,7 @@ void CProjectWelcomePage::OnPageChanged( wxWizardExEvent& event ) { /*! * wxEVT_WIZARD_CANCEL event handler for ID_PROJECTWELCOMEPAGE */ - + void CProjectWelcomePage::OnCancel( wxWizardExEvent& event ) { PROCESS_CANCELEVENT(event); } diff --git a/clientgui/ProjectWelcomePage.h b/clientgui/ProjectWelcomePage.h index df3f7078cf7..ffc8fd529b8 100644 --- a/clientgui/ProjectWelcomePage.h +++ b/clientgui/ProjectWelcomePage.h @@ -28,7 +28,7 @@ */ class CProjectWelcomePage: public wxWizardPageEx -{ +{ DECLARE_DYNAMIC_CLASS( CProjectWelcomePage ) DECLARE_EVENT_TABLE() diff --git a/clientgui/ProxyInfoPage.cpp b/clientgui/ProxyInfoPage.cpp index fe804fe7311..54e4f19db1c 100644 --- a/clientgui/ProxyInfoPage.cpp +++ b/clientgui/ProxyInfoPage.cpp @@ -39,40 +39,40 @@ /*! * CErrProxyInfoPage type definition */ - + IMPLEMENT_DYNAMIC_CLASS( CErrProxyInfoPage, wxWizardPageEx ) - + /*! * CErrProxyInfoPage event table definition */ - + BEGIN_EVENT_TABLE( CErrProxyInfoPage, wxWizardPageEx ) - + ////@begin CErrProxyInfoPage event table entries EVT_WIZARDEX_PAGE_CHANGED( -1, CErrProxyInfoPage::OnPageChanged ) EVT_WIZARDEX_CANCEL( -1, CErrProxyInfoPage::OnCancel ) ////@end CErrProxyInfoPage event table entries - + END_EVENT_TABLE() - + /*! * CErrProxyInfoPage constructors */ - + CErrProxyInfoPage::CErrProxyInfoPage( ) { } - + CErrProxyInfoPage::CErrProxyInfoPage( CBOINCBaseWizard* parent ) { Create( parent ); } - + /*! * CErrProxyInfoPage creator */ - + bool CErrProxyInfoPage::Create( CBOINCBaseWizard* parent ) { ////@begin CErrProxyInfoPage member initialisation @@ -80,23 +80,23 @@ bool CErrProxyInfoPage::Create( CBOINCBaseWizard* parent ) m_pDescriptionStaticCtrl = NULL; m_pDirectionsStaticCtrl = NULL; ////@end CErrProxyInfoPage member initialisation - + ////@begin CErrProxyInfoPage creation wxWizardPageEx::Create( parent, ID_ERRPROXYINFOPAGE ); CreateControls(); GetSizer()->Fit(this); ////@end CErrProxyInfoPage creation - + return TRUE; } - + /*! * Control creation for CErrProxyInfoPage */ - + void CErrProxyInfoPage::CreateControls() -{ +{ ////@begin CErrProxyInfoPage content construction CErrProxyInfoPage* itemWizardPage126 = this; @@ -121,7 +121,7 @@ void CErrProxyInfoPage::CreateControls() itemBoxSizer127->Add(m_pDirectionsStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5); ////@end CErrProxyInfoPage content construction } - + /*! * Gets the previous page. */ @@ -130,11 +130,11 @@ wxWizardPageEx* CErrProxyInfoPage::GetPrev() const { return PAGE_TRANSITION_BACK; } - + /*! * Gets the next page. */ - + wxWizardPageEx* CErrProxyInfoPage::GetNext() const { if (CHECK_CLOSINGINPROGRESS()) { @@ -144,20 +144,20 @@ wxWizardPageEx* CErrProxyInfoPage::GetNext() const return PAGE_TRANSITION_NEXT(ID_ERRPROXYPAGE); } } - + /*! * Should we show tooltips? */ - + bool CErrProxyInfoPage::ShowToolTips() { return TRUE; } - + /*! * Get bitmap resources */ - + wxBitmap CErrProxyInfoPage::GetBitmapResource( const wxString& WXUNUSED(name) ) { // Bitmap retrieval @@ -165,20 +165,20 @@ wxBitmap CErrProxyInfoPage::GetBitmapResource( const wxString& WXUNUSED(name) ) return wxNullBitmap; ////@end CErrProxyInfoPage bitmap retrieval } - + /*! * Get icon resources */ - + wxIcon CErrProxyInfoPage::GetIconResource( const wxString& WXUNUSED(name) ) { // Icon retrieval - + ////@begin CErrProxyInfoPage icon retrieval return wxNullIcon; ////@end CErrProxyInfoPage icon retrieval } - + /*! * wxEVT_WIZARD_PAGE_CHANGED event handler for ID_ERRPROXYINFOPAGE */ @@ -205,11 +205,11 @@ void CErrProxyInfoPage::OnPageChanged( wxWizardExEvent& event ) { Fit(); } - + /*! * wxEVT_WIZARD_CANCEL event handler for ID_ERRPROXYINFOPAGE */ - + void CErrProxyInfoPage::OnCancel( wxWizardExEvent& event ) { PROCESS_CANCELEVENT(event); } diff --git a/clientgui/ProxyInfoPage.h b/clientgui/ProxyInfoPage.h index 1ad38a472c5..35a3e7f1c2f 100644 --- a/clientgui/ProxyInfoPage.h +++ b/clientgui/ProxyInfoPage.h @@ -28,7 +28,7 @@ */ class CErrProxyInfoPage: public wxWizardPageEx -{ +{ DECLARE_DYNAMIC_CLASS( CErrProxyInfoPage ) DECLARE_EVENT_TABLE() diff --git a/clientgui/ProxyPage.cpp b/clientgui/ProxyPage.cpp index f95c65eeea3..b3e421d3928 100644 --- a/clientgui/ProxyPage.cpp +++ b/clientgui/ProxyPage.cpp @@ -39,46 +39,46 @@ /*! * CErrProxyPage type definition */ - + IMPLEMENT_DYNAMIC_CLASS( CErrProxyPage, wxWizardPageEx ) - + /*! * CErrProxyPage event table definition */ - + BEGIN_EVENT_TABLE( CErrProxyPage, wxWizardPageEx ) - + ////@begin CErrProxyPage event table entries EVT_WIZARDEX_PAGE_CHANGED( -1, CErrProxyPage::OnPageChanged ) EVT_WIZARDEX_PAGE_CHANGING( -1, CErrProxyPage::OnPageChanging ) EVT_WIZARDEX_CANCEL( -1, CErrProxyPage::OnCancel ) ////@end CErrProxyPage event table entries - + END_EVENT_TABLE() - + /*! * CErrProxyPage constructors */ - + CErrProxyPage::CErrProxyPage( ) { } - + CErrProxyPage::CErrProxyPage( CBOINCBaseWizard* parent ) { Create( parent ); } - + /*! * CErrProxyComplationPage creator */ - + bool CErrProxyPage::Create( CBOINCBaseWizard* parent ) { ////@begin CErrProxyPage member initialisation m_pTitleStaticCtrl = NULL; - m_pProxyHTTPDescriptionCtrl = NULL; + m_pProxyHTTPDescriptionCtrl = NULL; m_pProxyHTTPServerStaticCtrl = NULL; m_pProxyHTTPServerCtrl = NULL; m_pProxyHTTPPortStaticCtrl = NULL; @@ -90,7 +90,7 @@ bool CErrProxyPage::Create( CBOINCBaseWizard* parent ) #if 0 m_pProxyHTTPAutodetectCtrl = NULL; #endif - m_pProxySOCKSDescriptionCtrl = NULL; + m_pProxySOCKSDescriptionCtrl = NULL; m_pProxySOCKSServerStaticCtrl = NULL; m_pProxySOCKSServerCtrl = NULL; m_pProxySOCKSPortStaticCtrl = NULL; @@ -100,23 +100,23 @@ bool CErrProxyPage::Create( CBOINCBaseWizard* parent ) m_pProxySOCKSPasswordStaticCtrl = NULL; m_pProxySOCKSPasswordCtrl = NULL; ////@end CErrProxyPage member initialisation - + ////@begin CErrProxyPage creation wxWizardPageEx::Create( parent, ID_ERRPROXYPAGE ); CreateControls(); GetSizer()->Fit(this); ////@end CErrProxyPage creation - + return TRUE; } - + /*! * Control creation for CErrProxyComplationPage */ - + void CErrProxyPage::CreateControls() -{ +{ ////@begin CErrProxyPage content construction CErrProxyPage* itemWizardPage121 = this; @@ -235,20 +235,20 @@ void CErrProxyPage::CreateControls() m_pProxySOCKSPasswordCtrl->SetValidator( wxTextValidator(wxFILTER_NONE, & m_strProxySOCKSPassword) ); ////@end CErrProxyPage content construction } - + /*! * Gets the previous page. */ - + wxWizardPageEx* CErrProxyPage::GetPrev() const { return PAGE_TRANSITION_BACK; } - + /*! * Gets the next page. */ - + wxWizardPageEx* CErrProxyPage::GetNext() const { if (CHECK_CLOSINGINPROGRESS()) { @@ -261,20 +261,20 @@ wxWizardPageEx* CErrProxyPage::GetNext() const } return NULL; } - + /*! * Should we show tooltips? */ - + bool CErrProxyPage::ShowToolTips() { return TRUE; } - + /*! * Get bitmap resources */ - + wxBitmap CErrProxyPage::GetBitmapResource( const wxString& WXUNUSED(name) ) { // Bitmap retrieval @@ -282,11 +282,11 @@ wxBitmap CErrProxyPage::GetBitmapResource( const wxString& WXUNUSED(name) ) return wxNullBitmap; ////@end CErrProxyPage bitmap retrieval } - + /*! * Get icon resources */ - + wxIcon CErrProxyPage::GetIconResource( const wxString& WXUNUSED(name) ) { // Icon retrieval @@ -294,11 +294,11 @@ wxIcon CErrProxyPage::GetIconResource( const wxString& WXUNUSED(name) ) return wxNullIcon; ////@end CErrProxyPage icon retrieval } - + /*! * wxEVT_WIZARD_PAGE_CHANGED event handler for ID_ERRPROXYCOMPLETIONPAGE */ - + void CErrProxyPage::OnPageChanged( wxWizardExEvent& WXUNUSED(event) ) { CMainDocument* pDoc = wxGetApp().GetDocument(); wxString strBuffer = wxEmptyString; @@ -384,7 +384,7 @@ void CErrProxyPage::OnPageChanged( wxWizardExEvent& WXUNUSED(event) ) { Fit(); m_pProxyHTTPServerCtrl->SetFocus(); } - + /*! * wxEVT_WIZARD_PAGE_CHANGING event handler for ID_ERRPROXYPAGE */ @@ -424,7 +424,7 @@ void CErrProxyPage::OnPageChanging( wxWizardExEvent& event ) { /*! * wxEVT_WIZARD_CANCEL event handler for ID_ERRPROXYCOMPLETIONPAGE */ - + void CErrProxyPage::OnCancel( wxWizardExEvent& event ) { PROCESS_CANCELEVENT(event); } diff --git a/clientgui/ProxyPage.h b/clientgui/ProxyPage.h index 6a2396e3204..17c7cae9926 100644 --- a/clientgui/ProxyPage.h +++ b/clientgui/ProxyPage.h @@ -28,7 +28,7 @@ */ class CErrProxyPage: public wxWizardPageEx -{ +{ DECLARE_DYNAMIC_CLASS( CErrProxyPage ) DECLARE_EVENT_TABLE() @@ -101,7 +101,7 @@ class CErrProxyPage: public wxWizardPageEx ////@begin CErrProxyPage member variables wxStaticText* m_pTitleStaticCtrl; - wxStaticBox* m_pProxyHTTPDescriptionCtrl; + wxStaticBox* m_pProxyHTTPDescriptionCtrl; wxStaticText* m_pProxyHTTPServerStaticCtrl; wxTextCtrl* m_pProxyHTTPServerCtrl; wxStaticText* m_pProxyHTTPPortStaticCtrl; @@ -113,7 +113,7 @@ class CErrProxyPage: public wxWizardPageEx #if 0 wxButton* m_pProxyHTTPAutodetectCtrl; #endif - wxStaticBox* m_pProxySOCKSDescriptionCtrl; + wxStaticBox* m_pProxySOCKSDescriptionCtrl; wxStaticText* m_pProxySOCKSServerStaticCtrl; wxTextCtrl* m_pProxySOCKSServerCtrl; wxStaticText* m_pProxySOCKSPortStaticCtrl; diff --git a/clientgui/SkinManager.h b/clientgui/SkinManager.h index 362803d313e..5a877185d4c 100644 --- a/clientgui/SkinManager.h +++ b/clientgui/SkinManager.h @@ -65,7 +65,7 @@ class CSkinImage : public CSkinItem int GetVerticalAnchor() { return m_iAnchorVertical; } bool SetDefaults( - wxString strComponentName, + wxString strComponentName, const char** ppDefaultImage ); @@ -132,7 +132,7 @@ class CSkinIcon : public CSkinItem }; -// Default opacity for Simple View white panels +// Default opacity for Simple View white panels // is 60% (153 on a scale of 0 - 255). #define MAX_OPACITY 255 #define DEFAULT_OPACITY 153 diff --git a/clientgui/TermsOfUsePage.h b/clientgui/TermsOfUsePage.h index 614d2c175cf..eb4b59f4c54 100644 --- a/clientgui/TermsOfUsePage.h +++ b/clientgui/TermsOfUsePage.h @@ -27,7 +27,7 @@ */ class CTermsOfUsePage: public wxWizardPageEx -{ +{ DECLARE_DYNAMIC_CLASS( CTermsOfUsePage ) DECLARE_EVENT_TABLE() @@ -42,7 +42,7 @@ class CTermsOfUsePage: public wxWizardPageEx /// Creates the controls and sizers void CreateControls(); - + /// Handles clicks on links void OnLinkClicked( wxHtmlLinkEvent & event ); diff --git a/clientgui/UnavailablePage.cpp b/clientgui/UnavailablePage.cpp index 7332332ddeb..4ecc12030db 100644 --- a/clientgui/UnavailablePage.cpp +++ b/clientgui/UnavailablePage.cpp @@ -39,63 +39,63 @@ /*! * CErrUnavailablePage type definition */ - + IMPLEMENT_DYNAMIC_CLASS( CErrUnavailablePage, wxWizardPageEx ) - + /*! * CErrUnavailablePage event table definition */ - + BEGIN_EVENT_TABLE( CErrUnavailablePage, wxWizardPageEx ) - + ////@begin CErrUnavailablePage event table entries EVT_WIZARDEX_PAGE_CHANGED( -1, CErrUnavailablePage::OnPageChanged ) EVT_WIZARDEX_CANCEL( -1, CErrUnavailablePage::OnCancel ) ////@end CErrUnavailablePage event table entries - + END_EVENT_TABLE() - + /*! * CErrUnavailablePage constructors */ - + CErrUnavailablePage::CErrUnavailablePage( ) { } - + CErrUnavailablePage::CErrUnavailablePage( CBOINCBaseWizard* parent ) { Create( parent ); } - + /*! * CErrUnavailablePage creator */ - + bool CErrUnavailablePage::Create( CBOINCBaseWizard* parent ) { ////@begin CErrUnavailablePage member initialisation m_pTitleStaticCtrl = NULL; m_pDirectionsStaticCtrl = NULL; ////@end CErrUnavailablePage member initialisation - + ////@begin CErrUnavailablePage creation wxWizardPageEx::Create( parent, ID_ERRUNAVAILABLEPAGE ); CreateControls(); GetSizer()->Fit(this); ////@end CErrUnavailablePage creation - + return TRUE; } - + /*! * Control creation for CErrUnavailablePage */ - + void CErrUnavailablePage::CreateControls() -{ +{ ////@begin CErrUnavailablePage content construction CErrUnavailablePage* itemWizardPage96 = this; @@ -114,25 +114,25 @@ void CErrUnavailablePage::CreateControls() itemBoxSizer97->Add(m_pDirectionsStaticCtrl, 0, wxALIGN_LEFT|wxALL, 5); ////@end CErrUnavailablePage content construction } - + /*! * Gets the previous page. */ - + wxWizardPageEx* CErrUnavailablePage::GetPrev() const { return PAGE_TRANSITION_BACK; } - + /*! * Gets the next page. */ - + wxWizardPageEx* CErrUnavailablePage::GetNext() const { return NULL; } - + /*! * Should we show tooltips? */ @@ -141,20 +141,20 @@ bool CErrUnavailablePage::ShowToolTips() { return TRUE; } - + /*! * Get bitmap resources */ - + wxBitmap CErrUnavailablePage::GetBitmapResource( const wxString& WXUNUSED(name) ) { // Bitmap retrieval - + ////@begin CErrUnavailablePage bitmap retrieval return wxNullBitmap; ////@end CErrUnavailablePage bitmap retrieval } - + /*! * Get icon resources */ @@ -167,7 +167,7 @@ wxIcon CErrUnavailablePage::GetIconResource( const wxString& WXUNUSED(name) ) return wxNullIcon; ////@end CErrUnavailablePage icon retrieval } - + /*! * wxEVT_WIZARD_PAGE_CHANGED event handler for ID_ERRPROJECTUNAVAILABLEPAGE */ @@ -198,7 +198,7 @@ void CErrUnavailablePage::OnPageChanged( wxWizardExEvent& event ) { Fit(); } - + /*! * wxEVT_WIZARD_CANCEL event handler for ID_ERRPROJECTUNAVAILABLEPAGE */ diff --git a/clientgui/UnavailablePage.h b/clientgui/UnavailablePage.h index 768f215c521..c7deb18416c 100644 --- a/clientgui/UnavailablePage.h +++ b/clientgui/UnavailablePage.h @@ -27,7 +27,7 @@ */ class CErrUnavailablePage: public wxWizardPageEx -{ +{ DECLARE_DYNAMIC_CLASS( CErrUnavailablePage ) DECLARE_EVENT_TABLE() diff --git a/clientgui/ValidateAccountKey.cpp b/clientgui/ValidateAccountKey.cpp index aa8f5f92679..cf1c1563e5c 100644 --- a/clientgui/ValidateAccountKey.cpp +++ b/clientgui/ValidateAccountKey.cpp @@ -91,7 +91,7 @@ bool CValidateAccountKey::Validate(wxWindow *parent) { bool CValidateAccountKey::TransferToWindow(void) { if(!CheckValidator()) return FALSE; - + if (!m_stringValue) return TRUE; diff --git a/clientgui/ValidateEmailAddress.cpp b/clientgui/ValidateEmailAddress.cpp index 70504716e68..ec6902673ae 100644 --- a/clientgui/ValidateEmailAddress.cpp +++ b/clientgui/ValidateEmailAddress.cpp @@ -95,7 +95,7 @@ bool CValidateEmailAddress::Validate(wxWindow *parent) { bool CValidateEmailAddress::TransferToWindow(void) { if(!CheckValidator()) return FALSE; - + if (!m_stringValue) return TRUE; diff --git a/clientgui/ValidateURL.cpp b/clientgui/ValidateURL.cpp index 05a758e3b73..2ee1e747314 100644 --- a/clientgui/ValidateURL.cpp +++ b/clientgui/ValidateURL.cpp @@ -138,7 +138,7 @@ bool CValidateURL::Validate(wxWindow *parent) { bool CValidateURL::TransferToWindow() { if(!CheckValidator()) return FALSE; - + if (!m_stringValue) return TRUE; diff --git a/clientgui/ViewMessages.cpp b/clientgui/ViewMessages.cpp index c8034b68e92..6dddffbc2a8 100644 --- a/clientgui/ViewMessages.cpp +++ b/clientgui/ViewMessages.cpp @@ -87,7 +87,7 @@ CViewMessages::CViewMessages(wxNotebook* pNotebook) : pItem = new CTaskItem( _("Copy all messages"), _("Copy all the messages to the clipboard."), - ID_TASK_MESSAGES_COPYALL + ID_TASK_MESSAGES_COPYALL ); pGroup->m_Tasks.push_back( pItem ); @@ -98,14 +98,14 @@ CViewMessages::CViewMessages(wxNotebook* pNotebook) : #else _("Copy the selected messages to the clipboard. You can select multiple messages by holding down the shift or control key while clicking on messages."), #endif - ID_TASK_MESSAGES_COPYSELECTED + ID_TASK_MESSAGES_COPYSELECTED ); pGroup->m_Tasks.push_back( pItem ); pItem = new CTaskItem( _("Show only this project"), _("Show only the messages for the selected project."), - ID_TASK_MESSAGES_FILTERBYPROJECT + ID_TASK_MESSAGES_FILTERBYPROJECT ); pGroup->m_Tasks.push_back( pItem ); @@ -191,7 +191,7 @@ void CViewMessages::OnMessagesCopyAll( wxCommandEvent& WXUNUSED(event) ) { OpenClipboard( iRowCount * 1024 ); for (iIndex = 0; iIndex < iRowCount; iIndex++) { - CopyToClipboard(iIndex); + CopyToClipboard(iIndex); } CloseClipboard(); @@ -230,7 +230,7 @@ void CViewMessages::OnMessagesCopySelected( wxCommandEvent& WXUNUSED(event) ) { ); if (iIndex == -1) break; - iRowCount++; + iRowCount++; } OpenClipboard( iRowCount * 1024 ); @@ -246,7 +246,7 @@ void CViewMessages::OnMessagesCopySelected( wxCommandEvent& WXUNUSED(event) ) { ); if (iIndex == -1) break; - CopyToClipboard(iIndex); + CopyToClipboard(iIndex); } CloseClipboard(); @@ -267,7 +267,7 @@ void CViewMessages::OnMessagesFilter( wxCommandEvent& WXUNUSED(event) ) { wxInt32 iIndex = -1; CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame); MESSAGE* message; - + wxASSERT(pFrame); wxASSERT(wxDynamicCast(pFrame, CAdvancedFrame)); wxASSERT(m_pListPane); @@ -297,7 +297,7 @@ void CViewMessages::OnMessagesFilter( wxCommandEvent& WXUNUSED(event) ) { } } } - + // Force a complete update m_iPreviousRowCount = 0; m_pListPane->DeleteAllItems(); @@ -319,7 +319,7 @@ wxInt32 CViewMessages::GetFilteredMessageIndex( wxInt32 iRow) const { // Get the (possibly filtered) item count (i.e., the Row count) wxInt32 CViewMessages::GetDocCount() { int i; - + m_iTotalDocCount = wxGetApp().GetDocument()->GetMessageCount(); if (m_iTotalDocCount < m_iPreviousTotalDocCount) { // Usually due to a disconnect from client @@ -328,7 +328,7 @@ wxInt32 CViewMessages::GetDocCount() { m_iFilteredIndexes.Clear(); UpdateSelection(); } - + if (m_bIsFiltered) { for (i = m_iPreviousTotalDocCount; i < m_iTotalDocCount; i++) { MESSAGE* message = wxGetApp().GetDocument()->message(i); @@ -355,7 +355,7 @@ void CViewMessages::OnListRender (wxTimerEvent& event) { CMainDocument* pDoc = wxGetApp().GetDocument(); wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); - + if (!m_bProcessingListRenderEvent) { m_bProcessingListRenderEvent = true; @@ -421,7 +421,7 @@ void CViewMessages::OnListRender (wxTimerEvent& event) { wxString CViewMessages::OnListGetItemText(long item, long column) const { wxString strBuffer = wxEmptyString; wxInt32 index = GetFilteredMessageIndex(item); - + switch(column) { case COLUMN_PROJECT: FormatProjectName(index, strBuffer); @@ -463,11 +463,11 @@ bool CViewMessages::EnsureLastItemVisible() { // Auto-scroll only if already at bottom of list if ((m_iPreviousRowCount > numVisible) - && ((m_pListPane->GetTopItem() + numVisible) < (m_iPreviousRowCount-1)) + && ((m_pListPane->GetTopItem() + numVisible) < (m_iPreviousRowCount-1)) ) { return false; } - + return true; } @@ -487,18 +487,18 @@ void CViewMessages::UpdateSelection() { } else { m_pTaskPane->DisableTask(pGroup->m_Tasks[BTN_COPYSELECTED]); } - + if (m_bIsFiltered) { m_pTaskPane->UpdateTask( - pGroup->m_Tasks[BTN_FILTERMSGS], - _("Show all messages"), + pGroup->m_Tasks[BTN_FILTERMSGS], + _("Show all messages"), _("Show messages for all projects.") ); m_pTaskPane->EnableTask(pGroup->m_Tasks[BTN_FILTERMSGS]); - + } else { m_pTaskPane->UpdateTask( - pGroup->m_Tasks[BTN_FILTERMSGS], + pGroup->m_Tasks[BTN_FILTERMSGS], _("Show only this project"), _("Show only the messages for the selected project.") ); @@ -511,7 +511,7 @@ void CViewMessages::UpdateSelection() { } } } - + CBOINCBaseView::PostUpdateSelection(); } diff --git a/clientgui/ViewNotices.cpp b/clientgui/ViewNotices.cpp index 349cf69cd8d..fc5b185bd1f 100644 --- a/clientgui/ViewNotices.cpp +++ b/clientgui/ViewNotices.cpp @@ -54,15 +54,15 @@ CViewNotices::CViewNotices(wxNotebook* pNotebook) : itemFlexGridSizer->AddGrowableCol(0); m_FetchingNoticesText = new wxStaticText( - this, wxID_ANY, - _("Fetching notices; please wait..."), + this, wxID_ANY, + _("Fetching notices; please wait..."), wxPoint(20, 20), wxDefaultSize, 0 ); itemFlexGridSizer->Add(m_FetchingNoticesText, 0, wxALL, 1); m_NoNoticesText = new wxStaticText( - this, wxID_ANY, - _("There are no notices at this time."), + this, wxID_ANY, + _("There are no notices at this time."), wxPoint(20, 20), wxDefaultSize, 0 ); itemFlexGridSizer->Add(m_NoNoticesText, 0, wxALL, 1); @@ -73,7 +73,7 @@ CViewNotices::CViewNotices(wxNotebook* pNotebook) : itemFlexGridSizer->Add(m_pHtmlListPane, 1, wxGROW|wxALL, 1); SetSizer(itemFlexGridSizer); - + m_FetchingNoticesText->Hide(); m_bFetchingNoticesTextWasDisplayed = false; @@ -133,11 +133,11 @@ void CViewNotices::OnListRender(wxTimerEvent& WXUNUSED(event)) { wxString strNewMachineName = wxEmptyString; CC_STATUS status; CMainDocument* pDoc = wxGetApp().GetDocument(); - + wxASSERT(pDoc); wxASSERT(m_pHtmlListPane); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); - + if (s_bInProgress) return; s_bInProgress = true; @@ -160,7 +160,7 @@ void CViewNotices::OnListRender(wxTimerEvent& WXUNUSED(event)) { // Don't call Freeze() / Thaw() here because it causes an unnecessary redraw m_pHtmlListPane->UpdateUI(); - + if (m_bFetchingNoticesTextWasDisplayed != m_pHtmlListPane->m_bDisplayFetchingNotices) { m_bFetchingNoticesTextWasDisplayed = m_pHtmlListPane->m_bDisplayFetchingNotices; m_FetchingNoticesText->Show(m_bFetchingNoticesTextWasDisplayed); diff --git a/clientgui/ViewProjects.cpp b/clientgui/ViewProjects.cpp index d80d2377a53..5f8adfc4b39 100644 --- a/clientgui/ViewProjects.cpp +++ b/clientgui/ViewProjects.cpp @@ -105,7 +105,7 @@ BEGIN_EVENT_TABLE (CViewProjects, CBOINCBaseView) EVT_BUTTON(ID_TASK_PROJECT_DETACH, CViewProjects::OnProjectDetach) EVT_BUTTON(ID_TASK_PROJECT_SHOW_PROPERTIES, CViewProjects::OnShowItemProperties) EVT_CUSTOM_RANGE(wxEVT_COMMAND_BUTTON_CLICKED, ID_TASK_PROJECT_WEB_PROJDEF_MIN, ID_TASK_PROJECT_WEB_PROJDEF_MAX, CViewProjects::OnProjectWebsiteClicked) -// We currently handle EVT_LIST_CACHE_HINT on Windows or +// We currently handle EVT_LIST_CACHE_HINT on Windows or // EVT_CHECK_SELECTION_CHANGED on Mac & Linux instead of EVT_LIST_ITEM_SELECTED // or EVT_LIST_ITEM_DESELECTED. See CBOINCBaseView::OnCacheHint() for info. #if USE_LIST_CACHE_HINT @@ -124,7 +124,7 @@ static bool CompareViewProjectsItems(int iRowIndex1, int iRowIndex2) { CProject* project1; CProject* project2; int result = 0; - + try { project1 = myCViewProjects->m_ProjectCache.at(iRowIndex1); } catch ( std::out_of_range ) { @@ -201,42 +201,42 @@ CViewProjects::CViewProjects(wxNotebook* pNotebook) : pItem = new CTaskItem( _("Update"), _("Report all completed tasks, get latest credit, get latest preferences, and possibly get more tasks."), - ID_TASK_PROJECT_UPDATE + ID_TASK_PROJECT_UPDATE ); pGroup->m_Tasks.push_back( pItem ); pItem = new CTaskItem( _("Suspend"), _("Suspend tasks for this project."), - ID_TASK_PROJECT_SUSPEND + ID_TASK_PROJECT_SUSPEND ); pGroup->m_Tasks.push_back( pItem ); pItem = new CTaskItem( _("No new tasks"), _("Don't get new tasks for this project."), - ID_TASK_PROJECT_NONEWWORK + ID_TASK_PROJECT_NONEWWORK ); pGroup->m_Tasks.push_back( pItem ); pItem = new CTaskItem( _("Reset project"), _("Delete all files and tasks associated with this project, and get new tasks. You can update the project first to report any completed tasks."), - ID_TASK_PROJECT_RESET + ID_TASK_PROJECT_RESET ); pGroup->m_Tasks.push_back( pItem ); pItem = new CTaskItem( _("Remove"), _("Remove this project. Tasks in progress will be lost (use 'Update' first to report any completed tasks)."), - ID_TASK_PROJECT_DETACH + ID_TASK_PROJECT_DETACH ); pGroup->m_Tasks.push_back( pItem ); pItem = new CTaskItem( _("Properties"), _("Show project details."), - ID_TASK_PROJECT_SHOW_PROPERTIES + ID_TASK_PROJECT_SHOW_PROPERTIES ); pGroup->m_Tasks.push_back( pItem ); @@ -276,11 +276,11 @@ CViewProjects::CViewProjects(wxNotebook* pNotebook) : m_iDefaultShownColumns = DefaultShownColumns; m_iNumDefaultShownColumns = sizeof(DefaultShownColumns) / sizeof(int); m_iProgressColumn = COLUMN_RESOURCESHARE; - + // Needed by static sort routine; myCViewProjects = this; m_funcSortCompare = CompareViewProjectsItems; - + UpdateSelection(); } @@ -350,7 +350,7 @@ int CViewProjects::GetViewCurrentViewPage() { wxString CViewProjects::GetKeyValue1(int iRowIndex) { CProject* project; - + if (GetProjectCacheAtIndex(project, m_iSortedIndexes[iRowIndex])) { return wxEmptyString; } @@ -395,7 +395,7 @@ void CViewProjects::OnProjectUpdate( wxCommandEvent& WXUNUSED(event) ) { // Step through all selected items row = m_pListPane->GetNextItem(row, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (row < 0) break; - + pDoc->ProjectUpdate(m_iSortedIndexes[row]); } @@ -426,7 +426,7 @@ void CViewProjects::OnProjectSuspend( wxCommandEvent& WXUNUSED(event) ) { // Step through all selected items row = m_pListPane->GetNextItem(row, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (row < 0) break; - + PROJECT* project = pDoc->project(m_iSortedIndexes[row]); if (project) { if (project->suspended_via_gui) { @@ -436,7 +436,7 @@ void CViewProjects::OnProjectSuspend( wxCommandEvent& WXUNUSED(event) ) { } } } - + m_bForceUpdateSelection = true; UpdateSelection(); pFrame->FireRefreshView(); @@ -463,7 +463,7 @@ void CViewProjects::OnProjectNoNewWork( wxCommandEvent& WXUNUSED(event) ) { // Step through all selected items row = m_pListPane->GetNextItem(row, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (row < 0) break; - + PROJECT* project = pDoc->project(m_iSortedIndexes[row]); if (project) { if (project->dont_request_more_work) { @@ -473,7 +473,7 @@ void CViewProjects::OnProjectNoNewWork( wxCommandEvent& WXUNUSED(event) ) { } } } - + m_bForceUpdateSelection = true; UpdateSelection(); pFrame->FireRefreshView(); @@ -487,7 +487,7 @@ void CViewProjects::OnProjectNoNewWork( wxCommandEvent& WXUNUSED(event) ) { void CViewProjects::OnProjectReset( wxCommandEvent& WXUNUSED(event) ) { wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectReset - Function Begin")); - wxInt32 iAnswer = 0; + wxInt32 iAnswer = 0; wxString strMessage = wxEmptyString; CMainDocument* pDoc = wxGetApp().GetDocument(); CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame); @@ -508,13 +508,13 @@ void CViewProjects::OnProjectReset( wxCommandEvent& WXUNUSED(event) ) { // Step through all selected items row = m_pListPane->GetNextItem(row, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (row < 0) break; - + if (GetProjectCacheAtIndex(pProject, m_iSortedIndexes[row])) { return; } strMessage.Printf( - _("Are you sure you want to reset project '%s'?"), + _("Are you sure you want to reset project '%s'?"), pProject->m_strProjectName.c_str() ); @@ -529,7 +529,7 @@ void CViewProjects::OnProjectReset( wxCommandEvent& WXUNUSED(event) ) { pDoc->ProjectReset(m_iSortedIndexes[row]); } } - + m_bForceUpdateSelection = true; UpdateSelection(); pFrame->FireRefreshView(); @@ -541,7 +541,7 @@ void CViewProjects::OnProjectReset( wxCommandEvent& WXUNUSED(event) ) { void CViewProjects::OnProjectDetach( wxCommandEvent& WXUNUSED(event) ) { wxLogTrace(wxT("Function Start/End"), wxT("CViewProjects::OnProjectDetach - Function Begin")); - wxInt32 iAnswer = 0; + wxInt32 iAnswer = 0; wxString strMessage = wxEmptyString; CMainDocument* pDoc = wxGetApp().GetDocument(); CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame); @@ -562,13 +562,13 @@ void CViewProjects::OnProjectDetach( wxCommandEvent& WXUNUSED(event) ) { // Step through all selected items row = m_pListPane->GetNextItem(row, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (row < 0) break; - + if (GetProjectCacheAtIndex(pProject, m_iSortedIndexes[row])) { return; } strMessage.Printf( - _("Are you sure you want to remove project '%s'?"), + _("Are you sure you want to remove project '%s'?"), pProject->m_strProjectName.c_str() ); @@ -674,8 +674,8 @@ wxString CViewProjects::OnListGetItemText(long item, long column) const { strBuffer = project->m_strAVGCredit; break; case COLUMN_RESOURCESHARE: - // CBOINCListCtrl::DrawProgressBars() will draw this using - // data provided by GetProgressText() and GetProgressValue(), + // CBOINCListCtrl::DrawProgressBars() will draw this using + // data provided by GetProgressText() and GetProgressValue(), // but we need it here for accessibility programs. strBuffer = project->m_strResourceShare; break; @@ -765,13 +765,13 @@ void CViewProjects::UpdateSelection() { enableReset = true; enableDetach = true; } - + row = -1; for (i=0; iGetNextItem(row, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (row < 0) break; // Should never happen - + project = pDoc->project(m_iSortedIndexes[row]); if (!project) { m_pTaskPane->DisableTaskGroupTasks(pGroup); @@ -813,20 +813,20 @@ void CViewProjects::UpdateSelection() { } } else { if (wasNoNewWork != project->dont_request_more_work) { - // Disable Allow New Work / No New Work button if the multiple + // Disable Allow New Work / No New Work button if the multiple // selection has a mix of Allow New Work and No New Work projects enableNoNewTasks = false; } } - + if (project->attached_via_acct_mgr) { enableDetach = false; } } - + if (n == 1) { enableProperties = true; - + UpdateWebsiteSelection(GRP_WEBSITES, project); if(m_TaskGroups.size()>1) { m_pTaskPane->EnableTaskGroupTasks(m_TaskGroups[1]); @@ -857,7 +857,7 @@ bool CViewProjects::SynchronizeCacheItem(wxInt32 iRowIndex, wxInt32 iColumnIndex double fDocumentPercent = 0.0; CProject* project; bool dirty = false; - + if (GetProjectCacheAtIndex(project, m_iSortedIndexes[iRowIndex])) { return false; } @@ -939,7 +939,7 @@ void CViewProjects::GetDocProjectName(wxInt32 item, wxString& strBuffer) const { PROJECT* project = NULL; CMainDocument* pDoc = wxGetApp().GetDocument(); std::string project_name; - + if (pDoc) { project = pDoc->project(item); } @@ -955,7 +955,7 @@ void CViewProjects::GetDocProjectName(wxInt32 item, wxString& strBuffer) const { wxInt32 CViewProjects::FormatProjectName(wxInt32 item, wxString& strBuffer) const { CProject* project; - + try { project = m_ProjectCache.at(m_iSortedIndexes[item]); } catch ( std::out_of_range ) { @@ -975,7 +975,7 @@ wxInt32 CViewProjects::FormatProjectName(wxInt32 item, wxString& strBuffer) cons void CViewProjects::GetDocAccountName(wxInt32 item, wxString& strBuffer) const { PROJECT* project = NULL; CMainDocument* pDoc = wxGetApp().GetDocument(); - + if (pDoc) { project = pDoc->project(item); } @@ -990,7 +990,7 @@ void CViewProjects::GetDocAccountName(wxInt32 item, wxString& strBuffer) const { wxInt32 CViewProjects::FormatAccountName(wxInt32 item, wxString& strBuffer) const { CProject* project; - + try { project = m_ProjectCache.at(m_iSortedIndexes[item]); } catch ( std::out_of_range ) { @@ -1009,7 +1009,7 @@ wxInt32 CViewProjects::FormatAccountName(wxInt32 item, wxString& strBuffer) cons void CViewProjects::GetDocTeamName(wxInt32 item, wxString& strBuffer) const { PROJECT* project = NULL; CMainDocument* pDoc = wxGetApp().GetDocument(); - + if (pDoc) { project = pDoc->project(item); } @@ -1024,7 +1024,7 @@ void CViewProjects::GetDocTeamName(wxInt32 item, wxString& strBuffer) const { wxInt32 CViewProjects::FormatTeamName(wxInt32 item, wxString& strBuffer) const { CProject* project; - + try { project = m_ProjectCache.at(m_iSortedIndexes[item]); } catch ( std::out_of_range ) { @@ -1044,7 +1044,7 @@ wxInt32 CViewProjects::FormatTeamName(wxInt32 item, wxString& strBuffer) const { void CViewProjects::GetDocTotalCredit(wxInt32 item, double& fBuffer) const { PROJECT* project = NULL; CMainDocument* pDoc = wxGetApp().GetDocument(); - + if (pDoc) { project = pDoc->project(item); } @@ -1060,7 +1060,7 @@ void CViewProjects::GetDocTotalCredit(wxInt32 item, double& fBuffer) const { void CViewProjects::GetDocAVGCredit(wxInt32 item, double& fBuffer) const { PROJECT* project = NULL; CMainDocument* pDoc = wxGetApp().GetDocument(); - + if (pDoc) { project = pDoc->project(item); } @@ -1075,7 +1075,7 @@ void CViewProjects::GetDocAVGCredit(wxInt32 item, double& fBuffer) const { void CViewProjects::GetDocResourceShare(wxInt32 item, double& fBuffer) const { PROJECT* project = NULL; CMainDocument* pDoc = wxGetApp().GetDocument(); - + if (pDoc) { project = pDoc->project(item); } @@ -1091,11 +1091,11 @@ void CViewProjects::GetDocResourceShare(wxInt32 item, double& fBuffer) const { void CViewProjects::GetDocResourcePercent(wxInt32 item, double& fBuffer) const { PROJECT* project = NULL; CMainDocument* pDoc = wxGetApp().GetDocument(); - + if (pDoc) { project = pDoc->project(item); } - + if (project && pDoc) { fBuffer = (project->resource_share / pDoc->m_fProjectTotalResourceShare) * 100; } else { @@ -1106,7 +1106,7 @@ void CViewProjects::GetDocResourcePercent(wxInt32 item, double& fBuffer) const { wxInt32 CViewProjects::FormatResourceShare(double share, double share_pct, wxString& strBuffer) const { strBuffer.Printf(wxT("%s (%s%%)"), format_number(share, 0), format_number(share_pct, 2)); - + return 0; } @@ -1126,7 +1126,7 @@ wxString rpc_reason_string_translated(int reason) { void CViewProjects::GetDocStatus(wxInt32 item, wxString& strBuffer) const { PROJECT* project = NULL; CMainDocument* pDoc = wxGetApp().GetDocument(); - + if (pDoc) { project = pDoc->project(item); } @@ -1168,7 +1168,7 @@ void CViewProjects::GetDocStatus(wxInt32 item, wxString& strBuffer) const { wxInt32 CViewProjects::FormatStatus(wxInt32 item, wxString& strBuffer) const { CProject* project; - + try { project = m_ProjectCache.at(m_iSortedIndexes[item]); } catch ( std::out_of_range ) { @@ -1188,7 +1188,7 @@ wxInt32 CViewProjects::FormatStatus(wxInt32 item, wxString& strBuffer) const { void CViewProjects::GetDocProjectURL(wxInt32 item, wxString& strBuffer) const { PROJECT* project = NULL; CMainDocument* pDoc = wxGetApp().GetDocument(); - + if (pDoc) { project = pDoc->project(item); } @@ -1279,7 +1279,7 @@ int CViewProjects::GetProjectCacheAtIndex(CProject*& projectPtr, int index) { projectPtr = NULL; return -1; } - + return 0; } diff --git a/clientgui/ViewResources.cpp b/clientgui/ViewResources.cpp index f1def5ddc30..aae67599795 100644 --- a/clientgui/ViewResources.cpp +++ b/clientgui/ViewResources.cpp @@ -70,7 +70,7 @@ CViewResources::CViewResources(wxNotebook* pNotebook) : m_pieCtrlTotal->m_Series.Add(CtrlTotalPart); m_pieCtrlTotal->Refresh(); - + // create pie chart ctrl for BOINC disk usage m_pieCtrlBOINC = new wxPieCtrl(this, ID_PIECTRL_RESOURCEUTILIZATIONVIEW, wxDefaultPosition, wxDefaultSize); wxASSERT(m_pieCtrlBOINC); diff --git a/clientgui/ViewStatistics.cpp b/clientgui/ViewStatistics.cpp index 3640f80e7bb..895c121d04d 100644 --- a/clientgui/ViewStatistics.cpp +++ b/clientgui/ViewStatistics.cpp @@ -166,21 +166,21 @@ CPaintStatistics::CPaintStatistics(wxWindow* parent, wxWindowID id, const wxPoin m_pen_AxisXColour = wxColour(64, 128, 192); m_pen_AxisYColour = wxColour(64, 128, 192); m_pen_AxisXTextColour = wxColour(0, 0, 0); - m_pen_AxisYTextColour = wxColour(0, 0, 0); - + m_pen_AxisYTextColour = wxColour(0, 0, 0); + m_brush_LegendColour = wxColour(235, 255, 255);//wxColour(220, 240, 255); m_brush_LegendSelectColour = wxColour(192, 224, 255); m_pen_LegendSelectColour = wxColour(64, 128, 192); m_pen_LegendSelectTextColour = wxColour(0, 0, 0); m_pen_LegendColour = wxColour(64, 128, 192); m_pen_LegendTextColour = wxColour(0, 0, 0); - + m_brush_MainColour = wxColour(255, 255, 255); m_pen_MainColour = wxColour(64, 128, 192); - + m_pen_HeadTextColour = wxColour(0, 0, 0); m_pen_ProjectHeadTextColour = wxColour(0, 0, 0); - + m_pen_GraphTotalColour = wxColour(255, 0, 0); m_pen_GraphRACColour = wxColour(0, 160, 0); m_pen_GraphTotalHostColour = wxColour(0, 0, 255); @@ -189,7 +189,7 @@ CPaintStatistics::CPaintStatistics(wxWindow* parent, wxWindowID id, const wxPoin m_dc_bmp.Create(1, 1); m_full_repaint = true; m_bmp_OK = false; - + #ifdef __WXMAC__ m_fauxStatisticsView = NULL; SetupMacAccessibilitySupport(); @@ -208,8 +208,8 @@ CPaintStatistics::~CPaintStatistics() { static void getTypePoint(int &typePoint, int number) {typePoint = number / 10;} -static bool CrossTwoLine(const double X1_1, const double Y1_1, const double X1_2, const double Y1_2, - const double X2_1, const double Y2_1, const double X2_2, const double Y2_2, +static bool CrossTwoLine(const double X1_1, const double Y1_1, const double X1_2, const double Y1_2, + const double X2_1, const double Y2_1, const double X2_2, const double Y2_2, double &Xcross, double &Ycross) { double A1 = Y1_1 - Y1_2; double B1 = X1_2 - X1_1; @@ -248,7 +248,7 @@ static void myDrawPoint(wxDC &dc,int X, int Y, wxColour graphColour,int numberTy delete[] points; break;} case 3: dc.DrawRectangle(wxCoord(X - (PointWidth / 2)),wxCoord(Y - (PointWidth / 2)),wxCoord(PointWidth + 1),wxCoord(PointWidth + 1)); - break; + break; case 4: {wxPoint* points = new wxPoint[4]; points[0] = wxPoint(X, Y - 1 - (PointWidth / 2)); points[1] = wxPoint(X + 1 + (PointWidth / 2), Y); @@ -265,7 +265,7 @@ static void MinMaxDayCredit(std::vector::const_iterator &i, double &mi for (std::vector::const_iterator j = (*i)->statistics.begin(); j != (*i)->statistics.end(); ++j) { if (first){ max_day = j->day; - switch (m_SelectedStatistic){ + switch (m_SelectedStatistic){ case show_user_total: max_credit = j->user_total_credit; break; case show_user_average: max_credit = j->user_expavg_credit; break; case show_host_total: max_credit = j->host_total_credit; break; @@ -279,7 +279,7 @@ static void MinMaxDayCredit(std::vector::const_iterator &i, double &mi if (j->day < min_day) min_day = j->day; if (j->day > max_day) max_day = j->day; - switch (m_SelectedStatistic){ + switch (m_SelectedStatistic){ case show_user_total: if (j->user_total_credit > max_credit) max_credit = j->user_total_credit; if (j->user_total_credit < min_credit) min_credit = j->user_total_credit; @@ -483,7 +483,7 @@ void CPaintStatistics::DrawLegend(wxDC &dc, PROJECTS* proj, CMainDocument* pDoc, wxCoord h0 = 0; wxCoord w0 = 0; wxCoord totalTextAreaHeight = 0; - + dc.SetFont(m_font_bold); dc.GetTextExtent(head_name, &w_temp, &h_temp, &des_temp, &lead_temp); m_Legend_dY = (double)(h_temp) + 4.0; @@ -511,7 +511,7 @@ void CPaintStatistics::DrawLegend(wxDC &dc, PROJECTS* proj, CMainDocument* pDoc, if (w0 < 0) w0 = 0; h0 = wxCoord(m_WorkSpace_Y_end - m_WorkSpace_Y_start) - buffer_y1 - buffer_y1; if (h0 < 0) h0 = 0; - + m_Space_for_scrollbar = 0; if (h0 < (totalTextAreaHeight + (2 * radius1))) m_Space_for_scrollbar = m_Scrollbar_width; int numVisible = (h0 - (2 * radius1)) / m_Legend_dY; @@ -523,12 +523,12 @@ void CPaintStatistics::DrawLegend(wxDC &dc, PROJECTS* proj, CMainDocument* pDoc, m_scrollBar->SetScrollbar(m_scrollBar->GetThumbPosition(), 1, numSteps, 1); m_scrollBar->Show(); } - + x0 = wxCoord(m_WorkSpace_X_end) - project_name_max_width + buffer_x1 - m_Space_for_scrollbar; if (x0 > wxCoord(m_WorkSpace_X_end)) x0 = wxCoord(m_WorkSpace_X_end); if (x0 < wxCoord(m_WorkSpace_X_start)) x0 = wxCoord(m_WorkSpace_X_start); if (x0 < 0) x0 = 0; - + dc.DrawRoundedRectangle(x0, y0, w0, h0, radius1); m_Legend_X_start = double(x0); @@ -551,7 +551,7 @@ void CPaintStatistics::DrawLegend(wxDC &dc, PROJECTS* proj, CMainDocument* pDoc, // Legend Shift (start) int Legend_count_temp = 0; if (m_Legend_dY > 0) Legend_count_temp = int(floor((m_Legend_select_Y_end - m_Legend_select_Y_start) / m_Legend_dY)); - + if (numSteps > 1) { m_Legend_Shift = m_scrollBar->GetThumbPosition(); } else { @@ -622,7 +622,7 @@ void CPaintStatistics::DrawLegend(wxDC &dc, PROJECTS* proj, CMainDocument* pDoc, if (y0 < 0) y0 = 0; if ((SelProj >= 0) || (!(m_HideProjectStatistic.count( wxString( (*i)->master_url, wxConvUTF8 ) )))){ myDrawPoint(dc, int(x0), int(y0), graphColour, typePoint ,m_GraphPointWidth); - dc.SetFont(m_font_bold); + dc.SetFont(m_font_bold); }else { dc.SetFont(m_font_standart_italic); graphColour = wxColour(0, 0, 0); @@ -642,7 +642,7 @@ void CPaintStatistics::DrawLegend(wxDC &dc, PROJECTS* proj, CMainDocument* pDoc, dc.SetFont(m_font_standart); } //----Draw background, axis(lines), text(01-Jan-1980)---- -void CPaintStatistics::DrawAxis(wxDC &dc, const double max_val_y, const double min_val_y, const double max_val_x, const double min_val_x, +void CPaintStatistics::DrawAxis(wxDC &dc, const double max_val_y, const double min_val_y, const double max_val_x, const double min_val_x, wxColour pen_AxisColour, const double max_val_y_all, const double min_val_y_all) { wxCoord x0 = wxCoord(m_WorkSpace_X_start); wxCoord y0 = wxCoord(m_WorkSpace_Y_start); @@ -661,7 +661,7 @@ void CPaintStatistics::DrawAxis(wxDC &dc, const double max_val_y, const double m wxCoord w_temp, h_temp, des_temp, lead_temp; wxCoord w_temp2; - + dc.GetTextExtent(wxString::Format(wxT(" %s"), format_number(max_val_y_all, 2)), &w_temp, &h_temp, &des_temp, &lead_temp); dc.GetTextExtent(wxString::Format(wxT(" %s"), format_number(min_val_y_all, 2)), &w_temp2, &h_temp, &des_temp, &lead_temp); @@ -669,20 +669,20 @@ void CPaintStatistics::DrawAxis(wxDC &dc, const double max_val_y, const double m m_WorkSpace_X_start += double(w_temp) + 3.0; m_WorkSpace_Y_end -= double(h_temp) + 3.0; - + dc.GetTextExtent(wxT("0"), &w_temp, &h_temp, &des_temp, &lead_temp); m_WorkSpace_X_end -= 3.0;//w_temp; const double radius1 = 5.0;//(double)(h_temp/2.0); double d_y = (double)(h_temp) / 2.0; if (d_y < 5.0) d_y = 5.0; - + wxDateTime dtTemp1; wxString strBuffer1; dtTemp1.Set((time_t)max_val_x); strBuffer1 = dtTemp1.Format(wxT("%d.%b.%y"), wxDateTime::GMT0); dc.GetTextExtent(strBuffer1, &w_temp, &h_temp, &des_temp, &lead_temp); - + double d_x = (double)(w_temp) / 2.0; // Draw background graph @@ -714,7 +714,7 @@ void CPaintStatistics::DrawAxis(wxDC &dc, const double max_val_y, const double m m_Graph_draw_Y_start = m_WorkSpace_Y_start; m_Graph_draw_Y_end = m_WorkSpace_Y_end; // A B - AB(m_WorkSpace_X_start, m_WorkSpace_Y_end, m_WorkSpace_X_end, m_WorkSpace_Y_start, + AB(m_WorkSpace_X_start, m_WorkSpace_Y_end, m_WorkSpace_X_end, m_WorkSpace_Y_start, min_val_x, min_val_y, max_val_x, max_val_y); //Draw val and lines dc.SetPen(wxPen(m_pen_AxisYColour , 1 , wxDOT)); @@ -728,7 +728,7 @@ void CPaintStatistics::DrawAxis(wxDC &dc, const double max_val_y, const double m if (d2 >= d_oy_val){ d_oy_val = 1.0 * d2; - } else if (2.0 * d2 >= d_oy_val){ + } else if (2.0 * d2 >= d_oy_val){ d_oy_val = 2.0 * d2; } else if (5.0 * d2 >= d_oy_val){ d_oy_val = 5.0 * d2; @@ -771,7 +771,7 @@ void CPaintStatistics::DrawAxis(wxDC &dc, const double max_val_y, const double m int d_ox_count = 1; if (w_temp > 0) d_ox_count = (int)((m_WorkSpace_X_end - m_WorkSpace_X_start) / (1.2 * double(w_temp))); if (d_ox_count <= 0) d_ox_count = 1; - + double d_ox_val = ceil(((double)(max_val_x - min_val_x) / double(d_ox_count)) / 86400.0) * 86400.0; if (0 == d_ox_val) d_ox_val = 1; @@ -866,7 +866,7 @@ void CPaintStatistics::DrawGraph2(wxDC &dc, std::vector stats, cons } if (first_point) { - if ((d_xpos < m_Graph_X_start) || (d_xpos > m_Graph_X_end) || + if ((d_xpos < m_Graph_X_start) || (d_xpos > m_Graph_X_end) || (d_ypos < m_Graph_Y_start) || (d_ypos > m_Graph_Y_end)){ point_in = false; b_point2 = false; @@ -884,13 +884,13 @@ void CPaintStatistics::DrawGraph2(wxDC &dc, std::vector stats, cons }else { dc.SetPen(wxPen(graphColour , m_GraphLineWidth , wxSOLID)); // ïðîâåðêà ïîïàäàíèÿ ïåðâîé òî÷êè ëèíèè â îáëàñòü ðèñîâàíèÿ - if (last_point_in){ + if (last_point_in){ d_x1 = d_last_x; d_y1 = d_last_y; b_point1 = true; }else b_point1 = false; // ïðîâåðêà ïîïàäàíèÿ âòîðîé òî÷êè ëèíèè â îáëàñòü ðèñîâàíèÿ - if ((d_xpos < m_Graph_X_start) || (d_xpos > m_Graph_X_end) || + if ((d_xpos < m_Graph_X_start) || (d_xpos > m_Graph_X_end) || (d_ypos < m_Graph_Y_start) || (d_ypos > m_Graph_Y_end)){ point_in = false; b_point2 = false; @@ -902,7 +902,7 @@ void CPaintStatistics::DrawGraph2(wxDC &dc, std::vector stats, cons } // Èùåì òî÷êó âõîäà ëèíèè â îáëàñòü ðèñîâàíèÿ (1) x=const if (!b_point1 || !b_point2){ - if (CrossTwoLine(d_last_x, d_last_y, d_xpos, d_ypos, + if (CrossTwoLine(d_last_x, d_last_y, d_xpos, d_ypos, m_Graph_X_start, m_Graph_Y_end, m_Graph_X_start, m_Graph_Y_start, d_cross_x1, d_cross_y1)){ if (d_last_x > d_xpos){ @@ -919,7 +919,7 @@ void CPaintStatistics::DrawGraph2(wxDC &dc, std::vector stats, cons d_max2 = m_Graph_Y_end; d_min2 = m_Graph_Y_start; } - if ((d_cross_x1 <= d_max1) && (d_cross_x1 >= d_min1) && + if ((d_cross_x1 <= d_max1) && (d_cross_x1 >= d_min1) && (d_cross_y1 <= d_max2) && (d_cross_y1 >= d_min2)){ if (!b_point1){ d_x1 = d_cross_x1; @@ -935,7 +935,7 @@ void CPaintStatistics::DrawGraph2(wxDC &dc, std::vector stats, cons } // Èùåì òî÷êó âõîäà ëèíèè â îáëàñòü ðèñîâàíèÿ (2) x=const if (!b_point1 || !b_point2){ - if (CrossTwoLine(d_last_x, d_last_y, d_xpos, d_ypos, + if (CrossTwoLine(d_last_x, d_last_y, d_xpos, d_ypos, m_Graph_X_end, m_Graph_Y_end, m_Graph_X_end, m_Graph_Y_start, d_cross_x1, d_cross_y1)){ if (d_last_x > d_xpos){ @@ -952,7 +952,7 @@ void CPaintStatistics::DrawGraph2(wxDC &dc, std::vector stats, cons d_max2 = m_Graph_Y_end; d_min2 = m_Graph_Y_start; } - if ((d_cross_x1 <= d_max1) && (d_cross_x1 >= d_min1) && + if ((d_cross_x1 <= d_max1) && (d_cross_x1 >= d_min1) && (d_cross_y1 <= d_max2) && (d_cross_y1 >= d_min2)){ if (!b_point1){ d_x1 = d_cross_x1; @@ -968,7 +968,7 @@ void CPaintStatistics::DrawGraph2(wxDC &dc, std::vector stats, cons } // Èùåì òî÷êó âõîäà ëèíèè â îáëàñòü ðèñîâàíèÿ (3) y=const if (!b_point1 || !b_point2){ - if (CrossTwoLine(d_last_x, d_last_y, d_xpos, d_ypos, + if (CrossTwoLine(d_last_x, d_last_y, d_xpos, d_ypos, m_Graph_X_start, m_Graph_Y_start, m_Graph_X_end, m_Graph_Y_start, d_cross_x1, d_cross_y1)){ if (d_last_y > d_ypos){ @@ -985,7 +985,7 @@ void CPaintStatistics::DrawGraph2(wxDC &dc, std::vector stats, cons d_max2 = m_Graph_X_end; d_min2 = m_Graph_X_start; } - if ((d_cross_y1 <= d_max1) && (d_cross_y1 >= d_min1) && + if ((d_cross_y1 <= d_max1) && (d_cross_y1 >= d_min1) && (d_cross_x1 <= d_max2) && (d_cross_x1 >= d_min2)){ if (!b_point1){ d_x1 = d_cross_x1; @@ -1001,7 +1001,7 @@ void CPaintStatistics::DrawGraph2(wxDC &dc, std::vector stats, cons } // Èùåì òî÷êó âõîäà ëèíèè â îáëàñòü ðèñîâàíèÿ (4) y=const if (!b_point1 || !b_point2){ - if (CrossTwoLine(d_last_x, d_last_y, d_xpos, d_ypos, + if (CrossTwoLine(d_last_x, d_last_y, d_xpos, d_ypos, m_Graph_X_start, m_Graph_Y_end, m_Graph_X_end, m_Graph_Y_end, d_cross_x1, d_cross_y1)){ if (d_last_y > d_ypos){ @@ -1018,7 +1018,7 @@ void CPaintStatistics::DrawGraph2(wxDC &dc, std::vector stats, cons d_max2 = m_Graph_X_end; d_min2 = m_Graph_X_start; } - if ((d_cross_y1 <= d_max1) && (d_cross_y1 >= d_min1) && + if ((d_cross_y1 <= d_max1) && (d_cross_y1 >= d_min1) && (d_cross_x1 <= d_max2) && (d_cross_x1 >= d_min2)){ if (!b_point1){ d_x1 = d_cross_x1; @@ -1146,7 +1146,7 @@ void CPaintStatistics::DrawAll(wxDC &dc) { // m_font_standart = dc.GetFont(); // m_font_bold = dc.GetFont(); // m_font_standart_italic = dc.GetFont(); - + m_font_standart.SetWeight(wxNORMAL); m_font_bold.SetWeight(wxBOLD); // m_font_standart_italic.SetFaceName(_T("Verdana")); @@ -1192,7 +1192,7 @@ void CPaintStatistics::DrawAll(wxDC &dc) { m_scrollBar->Hide(); m_Space_for_scrollbar = 0; } - + switch (m_ModeViewStatistic){ case mode_all_separate: { @@ -1238,7 +1238,7 @@ void CPaintStatistics::DrawAll(wxDC &dc) { } int col = 1, row = 1; //Used to identify the actual row/col - + double rectangle_x_start = m_WorkSpace_X_start; double rectangle_x_end = m_WorkSpace_X_end; double rectangle_y_start = m_WorkSpace_Y_start; @@ -1248,10 +1248,10 @@ void CPaintStatistics::DrawAll(wxDC &dc) { if (0 == nb_proj_row) nb_proj_row = 1; const double x_fac = (rectangle_x_end - rectangle_x_start) / double(nb_proj_col); const double y_fac = (rectangle_y_end - rectangle_y_start) / double(nb_proj_row); - + double min_val_y_all = 10e32, max_val_y_all = 0; double min_val_x_all = 10e32, max_val_x_all = 0; - + for (std::vector::const_iterator i = proj->projects.begin(); i != proj->projects.end(); ++i) { if (!(m_HideProjectStatistic.count( wxString((*i)->master_url, wxConvUTF8) ))){ MinMaxDayCredit(i, min_val_y_all, max_val_y_all, min_val_x_all, max_val_x_all, m_SelectedStatistic, false); @@ -1278,7 +1278,7 @@ void CPaintStatistics::DrawAll(wxDC &dc) { if (m_main_X_start > m_main_X_end) m_main_X_end = m_main_X_start; if (m_main_Y_start < 0) m_main_Y_start = 0; if (m_main_Y_start > m_main_Y_end) m_main_Y_end = m_main_Y_start; - + m_WorkSpace_X_start = m_main_X_start; m_WorkSpace_X_end = m_main_X_end; m_WorkSpace_Y_start = m_main_Y_start; @@ -1332,7 +1332,7 @@ void CPaintStatistics::DrawAll(wxDC &dc) { double t_d1 = floor((t_n1 - max_val_x) / 86400.0); wxString head_name=wxString::Format(_("Last update: %.0f days ago"), t_d1); - + wxColour pen_AxisColour1 = m_pen_AxisColourAutoZoom; if (m_Zoom_Auto){ @@ -1398,7 +1398,7 @@ void CPaintStatistics::DrawAll(wxDC &dc) { //Find minimum/maximum value double min_val_y = 10e32, max_val_y = 0; double min_val_x = 10e32, max_val_x = 0; - + wxColour pen_AxisColour1 = m_pen_AxisColourAutoZoom; if (m_Zoom_Auto){ @@ -1470,7 +1470,7 @@ void CPaintStatistics::DrawAll(wxDC &dc) { double min_val_x = 10e32, max_val_x = 0; double min_total_y = 0; double max_total_y = 0; - + wxColour pen_AxisColour1 = m_pen_AxisColourAutoZoom; if (m_Zoom_Auto){ @@ -1539,19 +1539,19 @@ void CPaintStatistics::DrawAll(wxDC &dc) { } else { saved_sum_stat = *sum_iter; } - + if ((*proj_iter).day > (*sum_iter).day) { AddToStats(prev_proj_stat, *sum_iter); } else { AddToStats(*proj_iter, *sum_iter); } - + ++sum_iter; if (sum_iter == sumstats.end()) { break; } } - + if ((*proj_iter).day <= (*sum_iter).day) { prev_proj_stat = *proj_iter; ++proj_iter; @@ -1565,7 +1565,7 @@ void CPaintStatistics::DrawAll(wxDC &dc) { } } } - + //Draw graph wxColour graphColour = wxColour(0,0,0); int typePoint = 0; @@ -1671,7 +1671,7 @@ void CPaintStatistics::OnPaint(wxPaintEvent& WXUNUSED(event)) { } #if USE_MEMORYDC if (m_bmp_OK && (width == m_dc_bmp.GetWidth()) &&(height == m_dc_bmp.GetHeight())){ - pdc.Blit(0, 0, width - m_Space_for_scrollbar, height,& mdc, 0, 0); + pdc.Blit(0, 0, width - m_Space_for_scrollbar, height,& mdc, 0, 0); } mdc.SelectObject(wxNullBitmap); #endif @@ -1685,15 +1685,15 @@ void CPaintStatistics::OnLeftMouseDown(wxMouseEvent& event) { if((double(pt.y) > m_Legend_select_Y_start) && (double(pt.y) < m_Legend_select_Y_end) && (double(pt.x) > m_Legend_select_X_start) && (double(pt.x) < m_Legend_select_X_end)){ int i1 = (int)floor((double(pt.y) - m_Legend_select_Y_start) / m_Legend_dY); switch (m_ModeViewStatistic){ - case mode_one_project: - m_NextProjectStatistic = i1 + m_Legend_Shift_Mode1; + case mode_one_project: + m_NextProjectStatistic = i1 + m_Legend_Shift_Mode1; m_Zoom_Auto = true; m_GraphMarker1 = false; break; case mode_all_separate: case mode_all_together: case mode_sum: - m_ViewHideProjectStatistic = i1 + m_Legend_Shift_Mode2; + m_ViewHideProjectStatistic = i1 + m_Legend_Shift_Mode2; break; } m_full_repaint = true; @@ -1769,7 +1769,7 @@ void CPaintStatistics::OnMouseMotion(wxMouseEvent& event) { if ( (X1 != 0) || (Y1 != 0)){ m_GraphMove_X1 = m_GraphMove_X2; m_GraphMove_Y1 = m_GraphMove_Y2; - + m_Zoom_min_val_X = m_Zoom_min_val_X + X1; m_Zoom_max_val_X = m_Zoom_max_val_X + X1; m_Zoom_min_val_Y = m_Zoom_min_val_Y + Y1; @@ -1925,7 +1925,7 @@ CViewStatistics::CViewStatistics() {} CViewStatistics::CViewStatistics(wxNotebook* pNotebook) : - CBOINCBaseView(pNotebook) + CBOINCBaseView(pNotebook) { CTaskItemGroup* pGroup = NULL; CTaskItem* pItem = NULL; @@ -1938,7 +1938,7 @@ CViewStatistics::CViewStatistics(wxNotebook* pNotebook) : itemFlexGridSizer->AddGrowableRow(0); itemFlexGridSizer->AddGrowableCol(1); - + m_pTaskPane = new CBOINCTaskCtrl(this, ID_TASK_STATISTICSVIEW, DEFAULT_TASK_FLAGS); wxASSERT(m_pTaskPane); @@ -1960,28 +1960,28 @@ CViewStatistics::CViewStatistics(wxNotebook* pNotebook) : pItem = new CTaskItem( _("Show user total"), _("Show total credit for user"), - ID_TASK_STATISTICS_USERTOTAL + ID_TASK_STATISTICS_USERTOTAL ); pGroup->m_Tasks.push_back( pItem ); pItem = new CTaskItem( _("Show user average"), _("Show average credit for user"), - ID_TASK_STATISTICS_USERAVERAGE + ID_TASK_STATISTICS_USERAVERAGE ); pGroup->m_Tasks.push_back( pItem ); pItem = new CTaskItem( _("Show host total"), _("Show total credit for host"), - ID_TASK_STATISTICS_HOSTTOTAL + ID_TASK_STATISTICS_HOSTTOTAL ); pGroup->m_Tasks.push_back( pItem ); pItem = new CTaskItem( _("Show host average"), _("Show average credit for host"), - ID_TASK_STATISTICS_HOSTAVERAGE + ID_TASK_STATISTICS_HOSTAVERAGE ); pGroup->m_Tasks.push_back( pItem ); @@ -1991,20 +1991,20 @@ CViewStatistics::CViewStatistics(wxNotebook* pNotebook) : pItem = new CTaskItem( _("< &Previous project"), _("Show chart for previous project"), - ID_TASK_STATISTICS_PREVPROJECT + ID_TASK_STATISTICS_PREVPROJECT ); pGroup->m_Tasks.push_back( pItem ); pItem = new CTaskItem( _("&Next project >"), _("Show chart for next project"), - ID_TASK_STATISTICS_NEXTPROJECT + ID_TASK_STATISTICS_NEXTPROJECT ); pGroup->m_Tasks.push_back( pItem ); pItem = new CTaskItem( _("Hide project list"), _("Use entire area for graphs"), - ID_TASK_STATISTICS_HIDEPROJLIST + ID_TASK_STATISTICS_HIDEPROJLIST ); pGroup->m_Tasks.push_back( pItem ); @@ -2014,28 +2014,28 @@ CViewStatistics::CViewStatistics(wxNotebook* pNotebook) : pItem = new CTaskItem( _("One project"), _("Show one chart with selected project"), - ID_TASK_STATISTICS_MODEVIEWONEPROJECT + ID_TASK_STATISTICS_MODEVIEWONEPROJECT ); pGroup->m_Tasks.push_back( pItem ); - + pItem = new CTaskItem( _("All projects (separate)"), _("Show all projects, one chart per project"), - ID_TASK_STATISTICS_MODEVIEWALLSEPARATE + ID_TASK_STATISTICS_MODEVIEWALLSEPARATE ); pGroup->m_Tasks.push_back( pItem ); pItem = new CTaskItem( _("All projects (together)"), _("Show one chart with all projects"), - ID_TASK_STATISTICS_MODEVIEWALLTOGETHER + ID_TASK_STATISTICS_MODEVIEWALLTOGETHER ); pGroup->m_Tasks.push_back( pItem ); - + pItem = new CTaskItem( _("All projects (sum)"), _("Show one chart with sum of projects"), - ID_TASK_STATISTICS_MODEVIEWSUM + ID_TASK_STATISTICS_MODEVIEWSUM ); pGroup->m_Tasks.push_back( pItem ); @@ -2275,7 +2275,7 @@ void CViewStatistics::OnShowHideProjectList( wxCommandEvent& WXUNUSED(event) ) { m_PaintStatistics->m_full_repaint = true; m_PaintStatistics->Refresh(false); UpdateSelection(); - + wxLogTrace(wxT("Function Start/End"), wxT("CViewStatistics::OnShowHideProjectList - Function End")); } @@ -2338,13 +2338,13 @@ bool CViewStatistics::OnRestoreState(wxConfigBase* pConfig) { if (!(m_PaintStatistics->m_HideProjectStatistic.empty())) m_PaintStatistics->m_HideProjectStatistic.clear(); for (int count = 0; count < 1000; ++count) { pConfig->Read(wxString::Format(wxT("%d"), count), &tmpstr1, wxT("")); - if (tmpstr1 == wxEmptyString){ + if (tmpstr1 == wxEmptyString){ break; }else{ m_PaintStatistics->m_HideProjectStatistic.insert(tmpstr1); } } - + UpdateSelection(); return true; } @@ -2379,7 +2379,7 @@ void CViewStatistics::UpdateSelection() { pGroup->m_Tasks[show_hide_project_list], _("Show project list"), _("Uses smaller area for graphs") ); } - + pGroup = m_TaskGroups[2]; pGroup->m_Tasks[mode_one_project]->m_pButton->Enable(m_PaintStatistics->m_ModeViewStatistic != mode_one_project); pGroup->m_Tasks[mode_all_separate]->m_pButton->Enable(m_PaintStatistics->m_ModeViewStatistic != mode_all_separate); diff --git a/clientgui/ViewStatistics.h b/clientgui/ViewStatistics.h index a82f024229d..2606425b735 100644 --- a/clientgui/ViewStatistics.h +++ b/clientgui/ViewStatistics.h @@ -30,31 +30,31 @@ class CPaintStatistics : public wxWindow public: CPaintStatistics(); CPaintStatistics(wxWindow* parent, wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL, const wxString& name = wxT("panel")); - + ~CPaintStatistics(); - + void DrawMainHead(wxDC &dc, const wxString head_name); - + void DrawProjectHead(wxDC &dc, PROJECT* project1, const wxString head_name_last); void DrawLegend(wxDC &dc, PROJECTS* proj, CMainDocument* pDoc, int SelProj, bool bColour, int &m_Legend_Shift); - + void DrawAxis(wxDC &dc, const double max_val_y, const double min_val_y, const double max_val_x, const double min_val_x, wxColour pen_AxisColour, const double max_val_y_all, const double min_val_y_all); - + void DrawGraph(wxDC &dc, std::vector::const_iterator &i, const wxColour graphColour, const int typePoint, const int m_SelectedStatistic); void DrawGraph2(wxDC &dc, std::vector stats, const wxColour graphColour, const int typePoint, const int m_SelectedStatistic); - + void DrawMarker(wxDC &dc); void ClearXY(); void ClearLegendXY(); - + void AB(const double x_coord1, const double y_coord1, const double x_coord2, const double y_coord2, const double x_val1, const double y_val1, const double x_val2, const double y_val2); void AddToStats(const DAILY_STATS &src, DAILY_STATS &dst); - + //-------------------------- void DrawAll(wxDC &dc); //-------------------------- @@ -199,7 +199,7 @@ class CPaintStatistics : public wxWindow void SetupMacAccessibilitySupport(); void ResizeMacAccessibilitySupport(); void RemoveMacAccessibilitySupport(); - + void* m_fauxStatisticsView; #endif diff --git a/clientgui/ViewTransfers.cpp b/clientgui/ViewTransfers.cpp index f13551b5824..e22fa80b422 100644 --- a/clientgui/ViewTransfers.cpp +++ b/clientgui/ViewTransfers.cpp @@ -57,7 +57,7 @@ // all columns. // // For now, show all columns by default -static int DefaultShownColumns[] = { COLUMN_PROJECT, COLUMN_FILE, COLUMN_PROGRESS, +static int DefaultShownColumns[] = { COLUMN_PROJECT, COLUMN_FILE, COLUMN_PROGRESS, COLUMN_SIZE, COLUMN_TIME, COLUMN_TOCOMPLETION, COLUMN_SPEED, COLUMN_STATUS}; @@ -94,7 +94,7 @@ IMPLEMENT_DYNAMIC_CLASS(CViewTransfers, CBOINCBaseView) BEGIN_EVENT_TABLE (CViewTransfers, CBOINCBaseView) EVT_BUTTON(ID_TASK_TRANSFERS_RETRYNOW, CViewTransfers::OnTransfersRetryNow) EVT_BUTTON(ID_TASK_TRANSFERS_ABORT, CViewTransfers::OnTransfersAbort) -// We currently handle EVT_LIST_CACHE_HINT on Windows or +// We currently handle EVT_LIST_CACHE_HINT on Windows or // EVT_CHECK_SELECTION_CHANGED on Mac & Linux instead of EVT_LIST_ITEM_SELECTED // or EVT_LIST_ITEM_DESELECTED. See CBOINCBaseView::OnCacheHint() for info. #if USE_LIST_CACHE_HINT @@ -202,14 +202,14 @@ CViewTransfers::CViewTransfers(wxNotebook* pNotebook) : pItem = new CTaskItem( _("Retry Now"), _("Retry the file transfer now"), - ID_TASK_TRANSFERS_RETRYNOW + ID_TASK_TRANSFERS_RETRYNOW ); pGroup->m_Tasks.push_back( pItem ); pItem = new CTaskItem( _("Abort Transfer"), _("Abort this file transfer. You won't get credit for the task."), - ID_TASK_TRANSFERS_ABORT + ID_TASK_TRANSFERS_ABORT ); pGroup->m_Tasks.push_back( pItem ); @@ -331,7 +331,7 @@ int CViewTransfers::GetViewCurrentViewPage() { wxString CViewTransfers::GetKeyValue1(int iRowIndex) { CTransfer* transfer; - + if (GetTransferCacheAtIndex(transfer, m_iSortedIndexes[iRowIndex])) { return wxEmptyString; } @@ -347,11 +347,11 @@ wxString CViewTransfers::GetKeyValue1(int iRowIndex) { wxString CViewTransfers::GetKeyValue2(int iRowIndex) { CTransfer* transfer; - + if (GetTransferCacheAtIndex(transfer, m_iSortedIndexes[iRowIndex])) { return wxEmptyString; } - + if (m_iColumnIDToColumnIndex[COLUMN_PROJECT] < 0) { // Column is hidden, so SynchronizeCacheItem() did not set its value GetDocProjectURL(m_iSortedIndexes[iRowIndex], transfer->m_strProjectURL); @@ -408,7 +408,7 @@ void CViewTransfers::OnTransfersRetryNow( wxCommandEvent& WXUNUSED(event) ) { // Step through all selected items row = m_pListPane->GetNextItem(row, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (row < 0) break; - + pDoc->TransferRetryNow(m_iSortedIndexes[row]); } @@ -423,7 +423,7 @@ void CViewTransfers::OnTransfersRetryNow( wxCommandEvent& WXUNUSED(event) ) { void CViewTransfers::OnTransfersAbort( wxCommandEvent& WXUNUSED(event) ) { wxLogTrace(wxT("Function Start/End"), wxT("CViewTransfers::OnTransfersAbort - Function Begin")); - wxInt32 iAnswer = 0; + wxInt32 iAnswer = 0; wxString strMessage = wxEmptyString; CMainDocument* pDoc = wxGetApp().GetDocument(); CAdvancedFrame* pFrame = wxDynamicCast(GetParent()->GetParent()->GetParent(), CAdvancedFrame); @@ -444,13 +444,13 @@ void CViewTransfers::OnTransfersAbort( wxCommandEvent& WXUNUSED(event) ) { // Step through all selected items row = m_pListPane->GetNextItem(row, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (row < 0) break; - + if (GetTransferCacheAtIndex(pTransfer, m_iSortedIndexes[row])) { return; } strMessage.Printf( - _("Are you sure you want to abort this file transfer '%s'?\nNOTE: Aborting a transfer will invalidate a task and you\nwill not receive credit for it."), + _("Are you sure you want to abort this file transfer '%s'?\nNOTE: Aborting a transfer will invalidate a task and you\nwill not receive credit for it."), pTransfer->m_strFileName.c_str() ); @@ -465,7 +465,7 @@ void CViewTransfers::OnTransfersAbort( wxCommandEvent& WXUNUSED(event) ) { pDoc->TransferAbort(m_iSortedIndexes[row]); } } - + UpdateSelection(); pFrame->FireRefreshView(); @@ -509,8 +509,8 @@ wxString CViewTransfers::OnListGetItemText(long item, long column) const { strBuffer = transfer->m_strFileName; break; case COLUMN_PROGRESS: - // CBOINCListCtrl::DrawProgressBars() will draw this using - // data provided by GetProgressText() and GetProgressValue(), + // CBOINCListCtrl::DrawProgressBars() will draw this using + // data provided by GetProgressText() and GetProgressValue(), // but we need it here for accessibility programs. strBuffer = transfer->m_strProgress; break; @@ -640,7 +640,7 @@ bool CViewTransfers::SynchronizeCacheItem(wxInt32 iRowIndex, wxInt32 iColumnInde case COLUMN_SIZE: GetDocBytesXferred(m_iSortedIndexes[iRowIndex], fDocumentDouble); GetDocTotalBytes(m_iSortedIndexes[iRowIndex], fDocumentDouble2); - if (( fDocumentDouble != transfer->m_fBytesXferred) || + if (( fDocumentDouble != transfer->m_fBytesXferred) || (fDocumentDouble2 != transfer->m_fTotalBytes) ) { transfer->m_fBytesXferred = fDocumentDouble; @@ -689,7 +689,7 @@ bool CViewTransfers::SynchronizeCacheItem(wxInt32 iRowIndex, wxInt32 iColumnInde void CViewTransfers::GetDocProjectName(wxInt32 item, wxString& strBuffer) const { FILE_TRANSFER* transfer = NULL; CMainDocument* pDoc = wxGetApp().GetDocument(); - + if (pDoc) { transfer = pDoc->file_transfer(item); } @@ -705,7 +705,7 @@ void CViewTransfers::GetDocProjectName(wxInt32 item, wxString& strBuffer) const void CViewTransfers::GetDocFileName(wxInt32 item, wxString& strBuffer) const { FILE_TRANSFER* transfer = NULL; CMainDocument* pDoc = wxGetApp().GetDocument(); - + if (pDoc) { transfer = pDoc->file_transfer(item); } @@ -723,7 +723,7 @@ void CViewTransfers::GetDocProgress(wxInt32 item, double& fBuffer) const { double fFileSize = 0; FILE_TRANSFER* transfer = NULL; CMainDocument* pDoc = wxGetApp().GetDocument(); - + if (pDoc) { transfer = pDoc->file_transfer(item); } @@ -756,7 +756,7 @@ wxInt32 CViewTransfers::FormatProgress(double fBuffer, wxString& strBuffer) cons void CViewTransfers::GetDocBytesXferred(wxInt32 item, double& fBuffer) const { FILE_TRANSFER* transfer = NULL; CMainDocument* pDoc = wxGetApp().GetDocument(); - + if (pDoc) { transfer = pDoc->file_transfer(item); } @@ -772,7 +772,7 @@ void CViewTransfers::GetDocBytesXferred(wxInt32 item, double& fBuffer) const { void CViewTransfers::GetDocTotalBytes(wxInt32 item, double& fBuffer) const { FILE_TRANSFER* transfer = NULL; CMainDocument* pDoc = wxGetApp().GetDocument(); - + if (pDoc) { transfer = pDoc->file_transfer(item); } @@ -824,7 +824,7 @@ wxInt32 CViewTransfers::FormatSize(double fBytesSent, double fFileSize, wxString void CViewTransfers::GetDocTime(wxInt32 item, double& fBuffer) const { FILE_TRANSFER* transfer = NULL; CMainDocument* pDoc = wxGetApp().GetDocument(); - + if (pDoc) { transfer = pDoc->file_transfer(item); } @@ -855,7 +855,7 @@ void CViewTransfers::GetDocTimeToCompletion(wxInt32 item, double& fBuffer) const void CViewTransfers::GetDocSpeed(wxInt32 item, double& fBuffer) const { FILE_TRANSFER* transfer = NULL; CMainDocument* pDoc = wxGetApp().GetDocument(); - + if (pDoc) { transfer = pDoc->file_transfer(item); } @@ -881,7 +881,7 @@ void CViewTransfers::GetDocStatus(wxInt32 item, wxString& strBuffer) const { CMainDocument* pDoc = wxGetApp().GetDocument(); int retval; strBuffer = wxString("", wxConvUTF8); - + transfer = pDoc->file_transfer(item); if (!transfer) return; CC_STATUS status; @@ -925,7 +925,7 @@ void CViewTransfers::GetDocStatus(wxInt32 item, wxString& strBuffer) const { void CViewTransfers::GetDocProjectURL(wxInt32 item, wxString& strBuffer) const { FILE_TRANSFER* transfer = NULL; CMainDocument* pDoc = wxGetApp().GetDocument(); - + if (pDoc) { transfer = pDoc->file_transfer(item); } @@ -943,7 +943,7 @@ double CViewTransfers::GetProgressValue(long item) { double fFileSize = 0; FILE_TRANSFER* transfer = NULL; CMainDocument* pDoc = wxGetApp().GetDocument(); - + if (pDoc) { transfer = pDoc->file_transfer(m_iSortedIndexes[item]); } @@ -961,7 +961,7 @@ double CViewTransfers::GetProgressValue(long item) { } if ( 0.0 == fFileSize ) return 0.0; - + return (fBytesSent / fFileSize); } @@ -985,7 +985,7 @@ int CViewTransfers::GetTransferCacheAtIndex(CTransfer*& transferPtr, int index) transferPtr = NULL; return -1; } - + return 0; } diff --git a/clientgui/ViewTransfers.h b/clientgui/ViewTransfers.h index 914048288a2..4019fcb4539 100644 --- a/clientgui/ViewTransfers.h +++ b/clientgui/ViewTransfers.h @@ -105,7 +105,7 @@ class CViewTransfers : public CBOINCBaseView { virtual double GetProgressValue(long item); virtual wxString GetProgressText( long item); - + int GetTransferCacheAtIndex(CTransfer*& transferPtr, int index); DECLARE_EVENT_TABLE() diff --git a/clientgui/ViewWork.cpp b/clientgui/ViewWork.cpp index 4467097508a..18cad738b5b 100644 --- a/clientgui/ViewWork.cpp +++ b/clientgui/ViewWork.cpp @@ -63,9 +63,9 @@ // Columns ESTIMATEDCOMPLETION and DEADLINEDIFF are hidden by default. // Not all users may want to see those columns. // -static int DefaultShownColumns[] = { COLUMN_PROJECT, COLUMN_PROGRESS, COLUMN_STATUS, +static int DefaultShownColumns[] = { COLUMN_PROJECT, COLUMN_PROGRESS, COLUMN_STATUS, COLUMN_CPUTIME, COLUMN_TOCOMPLETION, - COLUMN_REPORTDEADLINE, COLUMN_APPLICATION, + COLUMN_REPORTDEADLINE, COLUMN_APPLICATION, COLUMN_NAME }; // groups that contain buttons @@ -116,7 +116,7 @@ BEGIN_EVENT_TABLE (CViewWork, CBOINCBaseView) EVT_BUTTON(ID_TASK_SHOW_PROPERTIES, CViewWork::OnShowItemProperties) EVT_BUTTON(ID_TASK_ACTIVE_ONLY, CViewWork::OnActiveTasksOnly) EVT_CUSTOM_RANGE(wxEVT_COMMAND_BUTTON_CLICKED, ID_TASK_PROJECT_WEB_PROJDEF_MIN, ID_TASK_PROJECT_WEB_PROJDEF_MAX, CViewWork::OnProjectWebsiteClicked) -// We currently handle EVT_LIST_CACHE_HINT on Windows or +// We currently handle EVT_LIST_CACHE_HINT on Windows or // EVT_CHECK_SELECTION_CHANGED on Mac & Linux instead of EVT_LIST_ITEM_SELECTED // or EVT_LIST_ITEM_DESELECTED. See CBOINCBaseView::OnCacheHint() for info. #if USE_LIST_CACHE_HINT @@ -232,42 +232,42 @@ CViewWork::CViewWork(wxNotebook* pNotebook) : pItem = new CTaskItem( _("Show active tasks"), _("Show only active tasks."), - ID_TASK_ACTIVE_ONLY + ID_TASK_ACTIVE_ONLY ); pGroup->m_Tasks.push_back( pItem ); pItem = new CTaskItem( _("Show graphics"), _("Show application graphics in a window."), - ID_TASK_WORK_SHOWGRAPHICS + ID_TASK_WORK_SHOWGRAPHICS ); pGroup->m_Tasks.push_back( pItem ); pItem = new CTaskItem( _("Show VM Console"), _("Show VM Console in a window."), - ID_TASK_WORK_VMCONSOLE + ID_TASK_WORK_VMCONSOLE ); pGroup->m_Tasks.push_back( pItem ); pItem = new CTaskItem( _("Suspend"), _("Suspend work for this result."), - ID_TASK_WORK_SUSPEND + ID_TASK_WORK_SUSPEND ); pGroup->m_Tasks.push_back( pItem ); pItem = new CTaskItem( _("Abort"), _("Abandon work on the result. You will get no credit for it."), - ID_TASK_WORK_ABORT + ID_TASK_WORK_ABORT ); pGroup->m_Tasks.push_back( pItem ); pItem = new CTaskItem( _("Properties"), _("Show task details."), - ID_TASK_SHOW_PROPERTIES + ID_TASK_SHOW_PROPERTIES ); pGroup->m_Tasks.push_back( pItem ); @@ -424,7 +424,7 @@ wxString CViewWork::GetKeyValue2(int iRowIndex) { // Column is hidden, so SynchronizeCacheItem() did not set its value GetDocProjectURL(m_iSortedIndexes[iRowIndex], work->m_strProjectURL); } - + return work->m_strProjectURL; } @@ -639,7 +639,7 @@ void CViewWork::OnWorkAbort( wxCommandEvent& WXUNUSED(event) ) { return; } strMessage.Printf( - _("Are you sure you want to abort this task '%s'?\n(Progress: %s, Status: %s)"), + _("Are you sure you want to abort this task '%s'?\n(Progress: %s, Status: %s)"), (work->m_strName).c_str(), (work->m_strProgress).c_str(), (work->m_strStatus).c_str() @@ -666,7 +666,7 @@ void CViewWork::OnWorkAbort( wxCommandEvent& WXUNUSED(event) ) { // Step through all selected items row = m_pListPane->GetNextItem(row, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED); if (row < 0) break; - + RESULT* result = pDoc->result(m_iSortedIndexes[row]); if (result) { results_to_abort.push_back(result); @@ -826,8 +826,8 @@ wxString CViewWork::OnListGetItemText(long item, long column) const { strBuffer = work->m_strCPUTime; break; case COLUMN_PROGRESS: - // CBOINCListCtrl::DrawProgressBars() will draw this using - // data provided by GetProgressText() and GetProgressValue(), + // CBOINCListCtrl::DrawProgressBars() will draw this using + // data provided by GetProgressText() and GetProgressValue(), // but we need it here for accessibility programs. strBuffer = work->m_strProgress; break; @@ -1028,7 +1028,7 @@ void CViewWork::UpdateSelection() { } if (result->suspended_via_gui || - result->project_suspended_via_gui || + result->project_suspended_via_gui || (result->scheduler_state != CPU_SCHED_SCHEDULED) ) { if (!isGFXRunning) { @@ -1040,7 +1040,7 @@ void CViewWork::UpdateSelection() { if ( result->active_task_state == PROCESS_ABORT_PENDING || result->active_task_state == PROCESS_ABORTED || - result->state == RESULT_ABORTED + result->state == RESULT_ABORTED ) { enableAbort = false; } @@ -1459,7 +1459,7 @@ double CViewWork::GetProgressValue(long item) { wxString CViewWork::GetProgressText( long item) { CWork* work = NULL; wxString strBuffer = wxEmptyString; - + if (GetWorkCacheAtIndex(work, m_iSortedIndexes[item])) { strBuffer = wxEmptyString; } else { diff --git a/clientgui/WizardAttach.cpp b/clientgui/WizardAttach.cpp index 8866a920552..a3184ce89c0 100644 --- a/clientgui/WizardAttach.cpp +++ b/clientgui/WizardAttach.cpp @@ -57,36 +57,36 @@ /*! * CWizardAttach type definition */ - + IMPLEMENT_DYNAMIC_CLASS( CWizardAttach, CBOINCBaseWizard ) - + /*! * CWizardAttach event table definition */ - + BEGIN_EVENT_TABLE( CWizardAttach, CBOINCBaseWizard ) ////@begin CWizardAttach event table entries EVT_WIZARDEX_FINISHED( ID_ATTACHWIZARD, CWizardAttach::OnFinished ) ////@end CWizardAttach event table entries END_EVENT_TABLE() - + /*! * CWizardAttach constructors */ - + CWizardAttach::CWizardAttach() { } - -CWizardAttach::CWizardAttach( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, long style ) + +CWizardAttach::CWizardAttach( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, long style ) { Create(parent, id, title, pos, style); } - + /*! * CWizardAttach creator */ - + bool CWizardAttach::Create( wxWindow* parent, wxWindowID id, const wxString& /* title */, const wxPoint& pos, long style ) { @@ -111,10 +111,10 @@ bool CWizardAttach::Create( wxWindow* parent, wxWindowID id, const wxString& /* m_ErrProxyPage = NULL; m_ErrUserDisagreesPage = NULL; ////@end CWizardAttach member initialisation - + // Cancel Checking m_bCancelInProgress = false; - + // Wizard Detection IsAttachToProjectWizard = true; @@ -169,9 +169,9 @@ bool CWizardAttach::Create( wxWindow* parent, wxWindowID id, const wxString& /* */ void CWizardAttach::CreateControls() -{ +{ wxLogTrace(wxT("Function Start/End"), wxT("CWizardAttach::CreateControls - Function Begin")); - + ////@begin CWizardAttach content construction CWizardAttach* itemWizard1 = this; @@ -251,14 +251,14 @@ void CWizardAttach::CreateControls() wxLogTrace(wxT("Function Start/End"), wxT("CWizardAttach::CreateControls - Function End")); } - + /*! * Runs the wizard. */ bool CWizardAttach::Run( wxString strProjectName, wxString strProjectURL, - wxString strProjectAuthenticator, + wxString strProjectAuthenticator, wxString strProjectInstitution, wxString strProjectDescription, wxString strProjectKnown, @@ -318,10 +318,10 @@ bool CWizardAttach::SyncToAccountManager() { } else { SetTitle(pSkinAdvanced->GetApplicationName()); } - + IsAttachToProjectWizard = false; IsAccountManagerWizard = true; - + pDoc->rpc.acct_mgr_info(ami); @@ -351,16 +351,16 @@ bool CWizardAttach::SyncToAccountManager() { /*! * Should we show tooltips? */ - + bool CWizardAttach::ShowToolTips() { return TRUE; } - + /*! * Get bitmap resources */ - + wxBitmap CWizardAttach::GetBitmapResource( const wxString& WXUNUSED(name) ) { // Bitmap retrieval @@ -368,11 +368,11 @@ wxBitmap CWizardAttach::GetBitmapResource( const wxString& WXUNUSED(name) ) return wxNullBitmap; ////@end CWizardAttach bitmap retrieval } - + /*! * Get icon resources */ - + wxIcon CWizardAttach::GetIconResource( const wxString& WXUNUSED(name) ) { // Icon retrieval @@ -380,7 +380,7 @@ wxIcon CWizardAttach::GetIconResource( const wxString& WXUNUSED(name) ) return wxNullIcon; ////@end CWizardAttach icon retrieval } - + /*! * Determine if the wizard page has a next page */ @@ -395,16 +395,16 @@ bool CWizardAttach::HasNextPage( wxWizardPageEx* page ) bNoNextPageDetected |= (page == m_ErrUnavailablePage); bNoNextPageDetected |= (page == m_ErrNoInternetConnectionPage); bNoNextPageDetected |= (page == m_ErrAlreadyExistsPage); - + if (bNoNextPageDetected) return false; return true; } - + /*! * Determine if the wizard page has a previous page */ - + bool CWizardAttach::HasPrevPage( wxWizardPageEx* page ) { bool bNoPrevPageDetected = false; @@ -429,55 +429,55 @@ wxWizardPageEx* CWizardAttach::TranslatePage(unsigned long ulPageID) { if (ID_PROJECTINFOPAGE == ulPageID) pPage = m_ProjectInfoPage; - + if (ID_PROJECTPROPERTIESPAGE == ulPageID) pPage = m_ProjectPropertiesPage; - + if (ID_PROJECTPROCESSINGPAGE == ulPageID) pPage = m_ProjectProcessingPage; - + if (ID_PROJECTWELCOMEPAGE == ulPageID) pPage = m_ProjectWelcomePage; - + if (ID_ACCOUNTMANAGERINFOPAGE == ulPageID) pPage = m_AccountManagerInfoPage; - + if (ID_ACCOUNTMANAGERPROPERTIESPAGE == ulPageID) pPage = m_AccountManagerPropertiesPage; - + if (ID_ACCOUNTMANAGERPROCESSINGPAGE == ulPageID) pPage = m_AccountManagerProcessingPage; - + if (ID_TERMSOFUSEPAGE == ulPageID) pPage = m_TermsOfUsePage; - + if (ID_ACCOUNTINFOPAGE == ulPageID) pPage = m_AccountInfoPage; - + if (ID_COMPLETIONPAGE == ulPageID) pPage = m_CompletionPage; - + if (ID_COMPLETIONERRORPAGE == ulPageID) pPage = m_CompletionErrorPage; - + if (ID_ERRNOTDETECTEDPAGE == ulPageID) pPage = m_ErrNotDetectedPage; - + if (ID_ERRUNAVAILABLEPAGE == ulPageID) pPage = m_ErrUnavailablePage; - + if (ID_ERRNOINTERNETCONNECTIONPAGE == ulPageID) pPage = m_ErrNoInternetConnectionPage; - + if (ID_ERRNOTFOUNDPAGE == ulPageID) pPage = m_ErrNotFoundPage; - + if (ID_ERRALREADYEXISTSPAGE == ulPageID) pPage = m_ErrAlreadyExistsPage; - + if (ID_ERRPROXYINFOPAGE == ulPageID) pPage = m_ErrProxyInfoPage; - + if (ID_ERRPROXYPAGE == ulPageID) pPage = m_ErrProxyPage; @@ -569,7 +569,7 @@ void CWizardAttach::_ProcessCancelEvent( wxWizardExEvent& event ) { m_bCancelInProgress = true; int iRetVal = wxGetApp().SafeMessageBox( - _("Do you really want to cancel?"), + _("Do you really want to cancel?"), _("Question"), wxICON_QUESTION | wxYES_NO, this diff --git a/clientgui/WizardAttach.h b/clientgui/WizardAttach.h index 3c69ceef217..ca63ad3e9a2 100644 --- a/clientgui/WizardAttach.h +++ b/clientgui/WizardAttach.h @@ -176,10 +176,10 @@ struct PROJECT_INIT_STATUS; // #define PAGE_TRANSITION_NEXT(id) \ ((CWizardAttach*)GetParent())->PushPageTransition((wxWizardPageEx*)this, id) - + #define PAGE_TRANSITION_BACK \ ((CWizardAttach*)GetParent())->PopPageTransition() - + #define PROCESS_CANCELEVENT(event) \ ((CWizardAttach*)GetParent())->ProcessCancelEvent(event) @@ -192,7 +192,7 @@ struct PROJECT_INIT_STATUS; */ class CWizardAttach: public CBOINCBaseWizard -{ +{ DECLARE_DYNAMIC_CLASS( CWizardAttach ) DECLARE_EVENT_TABLE() @@ -225,14 +225,14 @@ class CWizardAttach: public CBOINCBaseWizard bool Run( wxString strProjectName, wxString strProjectURL, - wxString strProjectAuthenticator, + wxString strProjectAuthenticator, wxString strProjectInstitution, wxString strProjectDescription, wxString strProjectKnown, bool bAccountKeyDetected, bool bEmbedded ); - + /// Synchronize to Account Manager bool SyncToAccountManager(); diff --git a/clientgui/_wx_intellisense.h b/clientgui/_wx_intellisense.h index 1913071f192..1eb1682e710 100644 --- a/clientgui/_wx_intellisense.h +++ b/clientgui/_wx_intellisense.h @@ -4,7 +4,7 @@ * * It needs to be opened once to create the *.ncb file. * You can close this file now. - * + * * NOTE: To enable intellisense for your other projects, copy this file to the project * and include it in your workspace. Then open the file and close it again to give * Visual Studio the opportunity to parse the file and add its contents to intellisense. diff --git a/clientgui/common/wxPieCtrl.cpp b/clientgui/common/wxPieCtrl.cpp index 46d9bad8213..70379257ce7 100644 --- a/clientgui/common/wxPieCtrl.cpp +++ b/clientgui/common/wxPieCtrl.cpp @@ -122,14 +122,14 @@ wxColour wxPieCtrl::GetBackColour() { } /* event handlers */ -/* handles mouse motion events to show tooltips +/* handles mouse motion events to show tooltips for some (unkown) reason under X no tooltips are displayed */ void wxPieCtrl::OnMouseMove(wxMouseEvent& ev) { //get the pie part, over which the mouse pointer is int piepart = GetCoveredPiePart(ev.GetX(),ev.GetY()); //part identified - if(piepart >=0) { + if(piepart >=0) { //prevent tooltip flicker if(piepart != m_lastCoveredPart) { wxString tooltip = this->m_Series[piepart].GetLabel(); @@ -140,8 +140,8 @@ void wxPieCtrl::OnMouseMove(wxMouseEvent& ev) { else { this->SetToolTip(wxEmptyString); m_lastCoveredPart=-1; - } - ev.Skip(); + } + ev.Skip(); } void wxPieCtrl::OnSize(wxSizeEvent & /*event*/) @@ -213,7 +213,7 @@ void wxPieCtrl::GetPartAngles(wxArrayDouble & angles) { current += m_Series[i].GetValue(); angles.Add(360 * (double)current / (double)total); - } + } } #define MINANGLE 2 @@ -227,9 +227,9 @@ void wxPieCtrl::DrawParts(wxRect& pieRect) if(m_ShowEdges) { m_CanvasDC.SetPen(*wxBLACK_PEN); } - + intAngles.clear(); - + if(m_Series.Count() == 1) { m_CanvasDC.SetBrush(wxBrush(m_Series[0].GetColour())); @@ -241,7 +241,7 @@ void wxPieCtrl::DrawParts(wxRect& pieRect) } else { GetPartAngles(angles); - + if (angles.Count() > 1) { // Try to adjust angles so each segment is visible for(i = 0; i < angles.Count(); i++) { @@ -254,7 +254,7 @@ void wxPieCtrl::DrawParts(wxRect& pieRect) } } } - + // If we expanded last segment past 360, go back and fix it if (intAngles[angles.Count()-1] > 360) { intAngles[angles.Count()-1] = 360; @@ -268,7 +268,7 @@ void wxPieCtrl::DrawParts(wxRect& pieRect) } } } - + for(i = 0; i < angles.Count(); i++) { if(i > 0) @@ -288,7 +288,7 @@ void wxPieCtrl::DrawParts(wxRect& pieRect) #else t1 = intAngles[i-1]; t2 = intAngles[i]; -#endif +#endif if(t1 != t2) { m_CanvasDC.DrawEllipticArc(pieRect.GetLeft(), pieRect.GetTop(), @@ -308,7 +308,7 @@ void wxPieCtrl::DrawLegend(int left, int top) int dy(m_LegendVerBorder),tw,th=0,titlew,titleh; int totalNumLabels = (int)m_Series.Count(); int vertSpaceForLabels,maxVisibleLabels,lastLabelToDraw,numSteps; - + // First determine the size of the legend box m_CanvasDC.SetFont(m_TitleFont); m_CanvasDC.GetTextExtent(m_szTitle,&titlew,&titleh); @@ -352,11 +352,11 @@ void wxPieCtrl::DrawLegend(int left, int top) lastLabelToDraw = totalNumLabels - 1; m_firstlabelToDraw = totalNumLabels - maxVisibleLabels; } - + m_scrollBar->SetScrollbar(m_firstlabelToDraw, 1, numSteps, 1); m_scrollBar->Show((maxVisibleLabels > 0)); } - + // Now draw the legend title dy = m_LegendVerBorder+titleh+5; m_CanvasDC.SetFont(m_TitleFont); @@ -365,7 +365,7 @@ void wxPieCtrl::DrawLegend(int left, int top) dy += 5; // Draw the legend items m_CanvasDC.SetFont(m_LabelFont); - + m_CanvasDC.SetTextForeground(m_LabelColour); for(i = m_firstlabelToDraw; i <= lastLabelToDraw; i++) { diff --git a/clientgui/common/wxPieCtrl.h b/clientgui/common/wxPieCtrl.h index 78fcb3071be..c42a61e25da 100644 --- a/clientgui/common/wxPieCtrl.h +++ b/clientgui/common/wxPieCtrl.h @@ -87,9 +87,9 @@ using wxWindow::SetTransparent; wxScrollBar* m_scrollBar; int m_Scrollbar_width; int m_firstlabelToDraw; - + //internal methods - void GetPartAngles(wxArrayDouble & angles); + void GetPartAngles(wxArrayDouble & angles); void RecreateCanvas(); int GetCoveredPiePart(int x,int y); void DrawParts(wxRect& pieRect); @@ -103,7 +103,7 @@ using wxWindow::SetTransparent; wxSize sz = wxDefaultSize, long style = 0, wxString name = wxT("wxPieCtrl")); ~wxPieCtrl(); - + wxColour GetBackColour(); void SetBackColour(wxColour colour); @@ -140,7 +140,7 @@ using wxWindow::SetTransparent; void SetLegendBackColour(wxColour colour); void SetLabel(const wxString& label); - + DECLARE_EVENT_TABLE() void OnPaint(wxPaintEvent & event); @@ -148,13 +148,13 @@ using wxWindow::SetTransparent; void OnMouseMove(wxMouseEvent& ev); void OnEraseBackground(wxEraseEvent & /*event*/); void OnLegendScroll(wxScrollEvent& event); - + #ifdef __WXMAC__ private: void SetupMacAccessibilitySupport(); void ResizeMacAccessibilitySupport(); void RemoveMacAccessibilitySupport(); - + void* m_fauxResourcesView; #endif diff --git a/clientgui/gtk/taskbarex.h b/clientgui/gtk/taskbarex.h index dc8189db70f..0dbf6a35947 100644 --- a/clientgui/gtk/taskbarex.h +++ b/clientgui/gtk/taskbarex.h @@ -17,7 +17,7 @@ #define _TASKBAREX_H_ // ---------------------------------------------------------------------------- -// wxTaskBarIconEx Balloon Types +// wxTaskBarIconEx Balloon Types // ---------------------------------------------------------------------------- #define BALLOONTYPE_INFO 0x00000001 @@ -25,7 +25,7 @@ #define BALLOONTYPE_ERROR 0x00000003 // ---------------------------------------------------------------------------- -// wxTaskBarIconEx +// wxTaskBarIconEx // ---------------------------------------------------------------------------- class wxTaskBarIconExEvent; @@ -58,14 +58,14 @@ class wxTaskBarIconEx: public wxEvtHandler ); virtual bool SetBalloon( - const wxIcon& icon, + const wxIcon& icon, const wxString title = wxEmptyString, const wxString message = wxEmptyString, unsigned int iconballoon = BALLOONTYPE_INFO ); virtual bool QueueBalloon( - const wxIcon& icon, + const wxIcon& icon, const wxString title = wxEmptyString, const wxString message = wxEmptyString, unsigned int iconballoon = BALLOONTYPE_INFO diff --git a/clientgui/mac/BOINCGUIApp.mm b/clientgui/mac/BOINCGUIApp.mm index 9656811679c..160f59772f6 100644 --- a/clientgui/mac/BOINCGUIApp.mm +++ b/clientgui/mac/BOINCGUIApp.mm @@ -32,17 +32,17 @@ // Cocoa routines which are part of CBOINCGUIApp // Override standard wxCocoa wxApp::CallOnInit() to allow Manager -// to run properly when launched hidden on login via Login Item. +// to run properly when launched hidden on login via Login Item. bool CBOINCGUIApp::CallOnInit() { NSAutoreleasePool *mypool = [[NSAutoreleasePool alloc] init]; NSEvent *event = [NSEvent otherEventWithType:NSEventTypeApplicationDefined - location:NSMakePoint(0.0, 0.0) - modifierFlags:0 - timestamp:0 - windowNumber:0 + location:NSMakePoint(0.0, 0.0) + modifierFlags:0 + timestamp:0 + windowNumber:0 context:nil - subtype:0 data1:0 data2:0]; + subtype:0 data1:0 data2:0]; [NSApp postEvent:event atStart:FALSE]; bool retVal = wxApp::CallOnInit(); @@ -53,14 +53,14 @@ #endif -// Our application can get into a strange state +// Our application can get into a strange state // if our login item launched it hidden and the // first time the user "opens" it he either // double-clicks on our Finder icon or uses // command-tab. It becomes the frontmost // application (with its menu in the menubar) // but the windows remain hidden, and it does -// not receive an activate event, so we must +// not receive an activate event, so we must // handle this case by polling. // // We can stop the polling after the windows @@ -72,13 +72,13 @@ // void CBOINCGUIApp::CheckPartialActivation() { // This code is not needed and has bad effects on OS 10.5. - // Initializing wasHidden this way avoids the problem + // Initializing wasHidden this way avoids the problem // because we are briefly shown at login on OS 10.5. static bool wasHidden = [ NSApp isHidden ]; - + if (wasHidden) { if (m_bAboutDialogIsOpen) return; - + if (! [ NSApp isHidden ]) { wasHidden = false; ShowInterface(); @@ -99,7 +99,7 @@ NSTimeInterval ageOfFile = -[fileLastModifiedDate timeIntervalSinceNow]; return (ageOfFile > upTime); } - + return false; } @@ -116,7 +116,7 @@ /// /// @return /// true if the current process is visible, otherwise false. -/// +/// bool CBOINCGUIApp::IsApplicationVisible() { return (! [ NSApp isHidden ]); } @@ -156,7 +156,7 @@ #define NSWindowStyleMaskTitled NSTitledWindowMask #endif -// Returns true if at least a 5 X 5 pixel area of the +// Returns true if at least a 5 X 5 pixel area of the // window's title bar is entirely on the displays // Note: Arguments are wxWidgets / Quickdraw-style coordinates // (y=0 at top) but NSScreen coordinates have y=0 at bottom @@ -202,7 +202,7 @@ OSErr QuitAppleEventHandler( const AppleEvent *appleEvt, AppleEvent* reply, UInt pid_t senderPid; OSStatus anErr; - // Refuse to quit if a modal dialog is open. + // Refuse to quit if a modal dialog is open. // Unfortunately, I know of no way to disable the Quit item in our Dock menu if (wxGetApp().IsModalDialogDisplayed()) { NSBeep(); @@ -223,7 +223,7 @@ OSErr QuitAppleEventHandler( const AppleEvent *appleEvt, AppleEvent* reply, UInt } } } - + wxCommandEvent evt(wxEVT_COMMAND_MENU_SELECTED, wxID_EXIT); wxGetApp().GetFrame()->GetEventHandler()->AddPendingEvent(evt); return noErr; diff --git a/clientgui/mac/MacAccessiblity.h b/clientgui/mac/MacAccessiblity.h index d835d49f7d7..7594941e605 100644 --- a/clientgui/mac/MacAccessiblity.h +++ b/clientgui/mac/MacAccessiblity.h @@ -17,8 +17,8 @@ // macAccessiblity.h -#ifndef _MACACCESSIBILITY_H_ -#define _MACACCESSIBILITY_H_ +#ifndef _MACACCESSIBILITY_H_ +#define _MACACCESSIBILITY_H_ #include "BOINCBaseView.h" #include "DlgEventLog.h" @@ -35,4 +35,4 @@ typedef struct { void AccessibilityIgnoreAllChildren(HIViewRef parent, int recursionLevel); -#endif \ No newline at end of file +#endif diff --git a/clientgui/mac/MacAccessiblity.mm b/clientgui/mac/MacAccessiblity.mm index b83cc3ea630..e18252ce55a 100644 --- a/clientgui/mac/MacAccessiblity.mm +++ b/clientgui/mac/MacAccessiblity.mm @@ -229,10 +229,10 @@ - (id)accessibilityAttributeValue:(NSString *)attribute { } else if ([attribute isEqualToString:NSAccessibilityWindowAttribute]) { return [listControlView window]; - + } else if ([attribute isEqualToString:NSAccessibilityTopLevelUIElementAttribute]) { return [listControlView window]; - + } else if ([attribute isEqualToString:NSAccessibilityDescriptionAttribute]) { NSString *desc; wxString s; @@ -283,7 +283,7 @@ - (id)accessibilityAttributeValue:(NSString *)attribute { sz.height = r.height; } return [NSValue valueWithSize:sz]; - + } else if ([attribute isEqualToString:NSAccessibilityPositionAttribute]) { int i, xoff, yoff; NSPoint pt; @@ -306,9 +306,9 @@ - (id)accessibilityAttributeValue:(NSString *)attribute { //Convert the point to global (screen) coordinates NSPoint windowPoint = [listControlView convertPoint:pt toView: nil]; pt = [[listControlView window] convertBaseToScreen:windowPoint]; - + return [NSValue valueWithPoint:pt]; - + } else if ([attribute isEqualToString:NSAccessibilityTitleAttribute]) { wxString str; if (isHeader) { @@ -340,7 +340,7 @@ - (id)accessibilityAttributeValue:(NSString *)attribute { } else if ([attribute isEqualToString:NSAccessibilitySubroleAttribute]) { return NSAccessibilitySortButtonSubrole; - + } else if ([attribute isEqualToString:NSAccessibilitySortDirectionAttribute]) { if (col == BOINCView->m_iColumnIDToColumnIndex[BOINCView->m_iSortColumnID]) { return BOINCView->m_bReverseSort ? @@ -481,7 +481,7 @@ - (id)accessibilityHitTest:(NSPoint)point { int col, numCols, x = 0, yoff; pList->CalcScrolledPosition(0, 0, &x, &yoff); - + numCols = pList->GetColumnCount(); for (col=0; colCalcUnscrolledPosition(0, 0, &xoff, &yoff); int leftVisiblePos = xoff; // Horizontal scrolled offset in pixels int rightVisiblePos = leftVisiblePos + w; - + NSInteger i, cellLeftEdge = 0, cellRightEdge; NSMutableArray *visibleChildren = [NSMutableArray array]; @@ -673,7 +673,7 @@ - (id)accessibilityAttributeValue:(NSString *)attribute { } else if ((leftVisiblePos > cellLeftEdge) && (rightVisiblePos < cellRightEdge)) { isVisible = YES; // Visible area of row is totally within cell } - + if (isVisible) { #if RETAIN_KIDS_OF_ROWS [visibleChildren addObject:[kids objectAtIndex:i] ]; @@ -683,10 +683,10 @@ - (id)accessibilityAttributeValue:(NSString *)attribute { [visibleChildren addObject:cell]; #endif } - + cellLeftEdge = cellRightEdge; } - + return visibleChildren; } else if ([attribute isEqualToString:NSAccessibilityWindowAttribute]) { @@ -694,7 +694,7 @@ - (id)accessibilityAttributeValue:(NSString *)attribute { } else if ([attribute isEqualToString:NSAccessibilityIndexAttribute]) { return [NSNumber numberWithInt:row]; - + } else if ([attribute isEqualToString:NSAccessibilitySelectedAttribute]) { BOOL isSelected = pList->GetItemState(row, wxLIST_STATE_SELECTED) & wxLIST_STATE_SELECTED; return [NSNumber numberWithBool:isSelected]; @@ -779,7 +779,7 @@ - (id)accessibilityHitTest:(NSPoint)point { id item; [self adjustKidsIfNeeded]; - + NSPoint windowPoint; #if __MAC_OS_X_VERSION_MIN_REQUIRED < 1070 //convertRectFromScreen is not available before OS 10.7 @@ -825,19 +825,19 @@ - (id)accessibilityHitTest:(NSPoint)point { if (numkids <= (firstVisibleRow + numVisibleRows)) { numVisibleRows = numkids - firstVisibleRow; } - // This allows for an additional partially visible row + // This allows for an additional partially visible row NSInteger lastVisibleRow = firstVisibleRow + numVisibleRows; if (lastVisibleRow > (numkids - 1)) { lastVisibleRow = (numkids - 1); } - + for (rowNumber = firstVisibleRow; rowNumber <= lastVisibleRow; ++rowNumber) { NSRect r; r = [parent bounds]; r.origin.x = 0; r.size.width = wxcr.width; r.size.height = wxcr.height; - + wxRect wxr; pList->GetItemRect(rowNumber, wxr); r.origin.y = wxr.y; @@ -861,7 +861,7 @@ - (id)accessibilityHitTest:(NSPoint)point { - (void)adjustKidsIfNeeded { NSInteger i, newNumKids; newNumKids = pList->GetItemCount(); // Number of rows - + if (kids == nil) { kids = [[NSMutableArray arrayWithCapacity:newNumKids] retain]; } @@ -927,19 +927,19 @@ - (id)accessibilityAttributeValue:(NSString *)attribute { } else if ([attribute isEqualToString:NSAccessibilityFocusedAttribute]) { return [NSNumber numberWithBool:NO]; - + } else if ([attribute isEqualToString:NSAccessibilityParentAttribute]) { return NSAccessibilityUnignoredAncestor(parent); } else if ([attribute isEqualToString:NSAccessibilityWindowAttribute]) { // We're in the same window as our parent. return [parent window]; - + } else if ([attribute isEqualToString:NSAccessibilityTopLevelUIElementAttribute]) { return [parent window]; - + } else if ([attribute isEqualToString:NSAccessibilityDescriptionAttribute]) { - // To allow localization, we can't just append string + // To allow localization, we can't just append string // " is empty" because that assumes English word order. wxString s; if (isEventLog) { @@ -961,16 +961,16 @@ - (id)accessibilityAttributeValue:(NSString *)attribute { } else if ([attribute isEqualToString:NSAccessibilitySizeAttribute]) { return [NSValue valueWithSize:[parent frame].size]; - + } else if ([attribute isEqualToString:NSAccessibilityPositionAttribute]) { NSPoint pt = [parent bounds].origin; pt.y += [parent bounds].size.height; // We need the bottom left corner //Convert the point to global (screen) coordinates NSPoint windowPoint = [parent convertPoint:pt toView: nil]; pt = [[parent window] convertBaseToScreen:windowPoint]; - + return [NSValue valueWithPoint:pt]; - + } else if ([attribute isEqualToString:NSAccessibilityChildrenAttribute]) { [self adjustKidsIfNeeded]; return kids; @@ -991,7 +991,7 @@ - (id)accessibilityAttributeValue:(NSString *)attribute { for (i = 0; i < numVisibleKids; ++i) { [visibleChildren addObject:[kids objectAtIndex:i+firstVisibleKid] ]; } - + return visibleChildren; } else if ([attribute isEqualToString:NSAccessibilitySelectedChildrenAttribute] || @@ -1005,10 +1005,10 @@ - (id)accessibilityAttributeValue:(NSString *)attribute { [selectedChildren addObject:[kids objectAtIndex:i] ]; } return selectedChildren; - + } else if ([attribute isEqualToString:NSAccessibilityOrientationAttribute]) { return NSAccessibilityVerticalOrientationValue; - + } else { return [super accessibilityAttributeValue:attribute]; } @@ -1095,23 +1095,23 @@ - (BOOL)isFlipped { static BOOL AccessibilityEnabled = false; - (NSView *)hitTest:(NSPoint)aPoint { - // [NSThread callStackSymbols] is not available in OS 10.5, so + // [NSThread callStackSymbols] is not available in OS 10.5, so // BOINC does not fully implement accessibility under OS 10.5. // - // Weak linking of objective-C classes and methods is not + // Weak linking of objective-C classes and methods is not // supported before OS 10.6.8 so to be compatible with // OS 10.5 we must test availability at run time. // static BOOL firstTime = true; static BOOL haveMethod = false; - + if (AccessibilityEnabled) { if (firstTime) { IMP callStackSyms = class_getMethodImplementation(objc_getClass("NSThread"), @selector(callStackSymbols)); haveMethod = (callStackSyms != nil); firstTime = false; } - + if (!haveMethod) { return [super hitTest:aPoint]; } @@ -1124,7 +1124,7 @@ - (NSView *)hitTest:(NSPoint)aPoint { // NSArray *theStack = [NSThread callStackSymbols]; NSArray *theStack = [ NSThread performSelector:@selector(callStackSymbols) ]; - + int limit = [ theStack count ]; int i = 0; do { @@ -1144,7 +1144,7 @@ - (NSView *)hitTest:(NSPoint)aPoint { ++i; } while (i < 15); } - + return [super hitTest:aPoint]; // Not an accessibility call } @@ -1172,7 +1172,7 @@ - (id)accessibilityHitTest:(NSPoint)point { } NSPoint localPoint = [parent convertPoint:windowPoint fromView:nil]; - + // The scroll bars are among the list control's subviews. // If we are outside the list control's client area, determine // which scroll bar we are over and return the info for it. @@ -1195,7 +1195,7 @@ - (id)accessibilityHitTest:(NSPoint)point { if (kids) { int col, numCols, x = 0, yoff; pList->CalcScrolledPosition(0, 0, &x, &yoff); - + numCols = pList->GetColumnCount(); for (col=0; colGetColumnCount(); @@ -1298,7 +1298,7 @@ - (id)accessibilityAttributeValue:(NSString *)attribute { [kids addObject:cell]; } } - + return kids; // return NSAccessibilityUnignoredChildren(kids); // No children are ignored @@ -1345,7 +1345,7 @@ - (void)dealloc { rb.size.height -= ((wxWindow *)m_headerWin)->GetSize().y; [fauxBodyView initWithFrame:rb listCtrl:this listFlags:(isEventLogFlag) parent:listControlView BOINCView:nil]; [listControlView addSubview:fauxBodyView ]; - + m_fauxHeaderView = fauxHeaderView; m_fauxBodyView = fauxBodyView; } @@ -1362,7 +1362,7 @@ - (void)dealloc { rh.size.height = ((wxWindow *)m_headerWin)->GetSize().y; [fauxHeaderView setFrame:rh]; } - + if (fauxBodyView) { NSRect rb = r; rb.origin.y += ((wxWindow *)m_headerWin)->GetSize().y; @@ -1370,7 +1370,7 @@ - (void)dealloc { wxString s = wxEmptyString; [fauxBodyView setFrame:rb]; } - + event.Skip(); } @@ -1410,7 +1410,7 @@ - (void)dealloc { rb.size.height -= ((wxWindow *)m_headerWin)->GetSize().y; [fauxBodyView initWithFrame:rb listCtrl:this listFlags:0 parent:listControlView BOINCView:m_pParentView]; [listControlView addSubview:fauxBodyView ]; - + m_fauxHeaderView = fauxHeaderView; m_fauxBodyView = fauxBodyView; } @@ -1427,7 +1427,7 @@ - (void)dealloc { rh.size.height = ((wxWindow *)m_headerWin)->GetSize().y; [fauxHeaderView setFrame:rh]; } - + if (fauxBodyView) { NSRect rb = r; rb.origin.y += ((wxWindow *)m_headerWin)->GetSize().y; @@ -1435,7 +1435,7 @@ - (void)dealloc { wxString s = wxEmptyString; [fauxBodyView setFrame:rb]; } - + event.Skip(); } @@ -1486,7 +1486,7 @@ - (BOOL)accessibilityIsIgnored { - (NSString*) getValue { wxString s; - + switch (viewPage) { case statisticsPage: s = _("This panel contains graphs showing user totals for projects"); @@ -1496,7 +1496,7 @@ - (NSString*) getValue { wxPieCtrl* pPieCtrl = (wxPieCtrl*)theClass; s = pPieCtrl->GetLabel(); unsigned int i; - + for(i=0; im_Series.Count(); i++) { s += wxT("; "); s += pPieCtrl->m_Series[i].GetLabel(); @@ -1557,12 +1557,12 @@ - (id)accessibilityAttributeValue:(NSString *)attribute { // NSPoint windowPoint = [self convertPoint:pt toView: nil]; NSPoint windowPoint = [parent convertPoint:pt toView: nil]; pt = [[parent window] convertBaseToScreen:windowPoint]; - + return [NSValue valueWithPoint:pt]; } else if ([attribute isEqualToString:NSAccessibilityRoleAttribute]) { return NSAccessibilityStaticTextRole; - + } else if ([attribute isEqualToString:NSAccessibilityRoleDescriptionAttribute]) { return NSAccessibilityRoleDescription(NSAccessibilityStaticTextRole, nil); @@ -1584,14 +1584,14 @@ - (id)accessibilityAttributeValue:(NSString *)attribute { } else if ([attribute isEqualToString:NSAccessibilitySizeAttribute]) { return [NSValue valueWithSize:[self frame].size]; - + } else if ([attribute isEqualToString:NSAccessibilityTopLevelUIElementAttribute]) { return [parent window]; - + } else if ([attribute isEqualToString:NSAccessibilityWindowAttribute]) { // We're in the same window as our parent. return [parent window]; - + } else { return [super accessibilityAttributeValue:attribute]; } diff --git a/clientgui/mac/MacBitmapComboBox.cpp b/clientgui/mac/MacBitmapComboBox.cpp index bbf5bd44659..defd6383d15 100644 --- a/clientgui/mac/MacBitmapComboBox.cpp +++ b/clientgui/mac/MacBitmapComboBox.cpp @@ -18,7 +18,7 @@ // On Macintosh we use only native controls in Simple View so the macOS // automatically provides accessibility support. Though wxBitmapComboBox -// does not use MacOS native controls, wxChoice uses NSPopUpButton, so +// does not use MacOS native controls, wxChoice uses NSPopUpButton, so // we create our own BitmapComboBox on Macintosh based on wxChoice, which // we have hacked to allow adding bitmaps. // @@ -41,7 +41,7 @@ END_EVENT_TABLE() CBOINCBitmapChoice::CBOINCBitmapChoice() {} CBOINCBitmapChoice::CBOINCBitmapChoice(wxWindow *parent, wxWindowID id, - const wxString& value, + const wxString& value, const wxPoint& pos, const wxSize& size, int n, const wxString choices[], @@ -84,7 +84,7 @@ END_EVENT_TABLE() CBOINCBitmapComboBox::CBOINCBitmapComboBox() {} CBOINCBitmapComboBox::CBOINCBitmapComboBox(wxWindow *parent, wxWindowID id, - const wxString& value, + const wxString& value, const wxPoint& pos, const wxSize& size, int n, const wxString choices[], @@ -138,7 +138,7 @@ void CBOINCBitmapComboBox::SetItemBitmap(unsigned int n, const wxBitmap& bitmap) m_BitmapCache.at(n) = *bm; delete bm; } - + m_ChoiceControl->SetItemBitmap(n, bitmap); if (n == (unsigned int)m_ChoiceControl->GetSelection()) { Refresh(); @@ -162,7 +162,7 @@ int CBOINCBitmapComboBox::Append(const wxString& item, const wxBitmap& bitmap) { if (m_bHaveLargeBitmaps) { m_BitmapCache.push_back(bitmap); } - + int n = m_ChoiceControl->Append(item); SetItemBitmap(n, bitmap); return n; @@ -200,7 +200,7 @@ int CBOINCBitmapComboBox::Insert(const wxString& item, const wxBitmap& bitmap, u m_BitmapCache.insert(insertionPoint + pos, *bm); delete bm; } - + int n = m_ChoiceControl->Insert(item, pos, clientData); SetItemBitmap(n, bitmap); return n; @@ -213,7 +213,7 @@ void CBOINCBitmapComboBox::Delete(unsigned int n) { std::vector::iterator deletionPoint = m_BitmapCache.begin(); m_BitmapCache.erase(deletionPoint + n); } - + m_ChoiceControl->Delete(n); Refresh(); } @@ -248,7 +248,7 @@ void CBOINCBitmapComboBox::DrawLargeBitmap(CDrawLargeBitmapEvent&) { wxPen oldPen = myDC.GetPen(); wxBrush oldBrush = myDC.GetBrush(); int oldMode = myDC.GetBackgroundMode(); - + myDC.SetPen(*wxTRANSPARENT_PEN); myDC.SetBrush(*wxWHITE_BRUSH); myDC.SetBackgroundMode(wxSOLID); @@ -284,8 +284,8 @@ void CBOINCBitmapComboBox::OnPaint(wxPaintEvent& event) { GetSize(&x, &y); myDC.DrawRectangle(7, 0, y+1, y); - - // Restore Mode, Pen and Brush + + // Restore Mode, Pen and Brush myDC.SetBackgroundMode(oldMode); myDC.SetPen(oldPen); myDC.SetBrush(oldBrush); @@ -300,7 +300,7 @@ void CBOINCBitmapComboBox::OnPaint(wxPaintEvent& event) { void CBOINCBitmapComboBox::EmptyBitmapCache() { #if 0 unsigned int i, cacheSize; - + cacheSize = m_BitmapCache.size(); for (i=0; i #import -// Weak linking of objective-C classes is not supported before +// Weak linking of objective-C classes is not supported before // OS 10.6.8 so to be compatible with OS 10.5 we must use the // objective-C equivalent of dlopen() and dlsym(). static Class NSUserNotificationClass = nil; @@ -70,16 +70,16 @@ - (void) userNotificationCenter:(NSUserNotificationCenter *)center didActivateNo bool CTaskBarIcon::IsBalloonsSupported() { if ((NSUserNotificationClass != nil) && (NSUserNotificationCenterClass != nil)) return true; - + NSBundle *bundle = [NSBundle bundleWithPath:@"/System/Library/Frameworks/Foundation.framework"]; NSError *err = nil; bool loaded = [bundle loadAndReturnError:&err]; if (!loaded) return false; - + NSUserNotificationClass = NSClassFromString(@"NSUserNotification"); if (NSUserNotificationClass == nil) return false; - + NSUserNotificationCenterClass = NSClassFromString(@"NSUserNotificationCenter"); return (NSUserNotificationCenterClass != nil); } @@ -94,11 +94,11 @@ - (void) userNotificationCenter:(NSUserNotificationCenter *)center didActivateNo ) { if (!IsBalloonsSupported())return false; - + if (MacNotificationClass == nil) { MacNotificationClass = [MacNotification alloc]; } - + if (MacNotificationClass) { char *utf8Title = (char *)(title.utf8_str().data()); NSString *theTitle = [[NSString alloc] initWithUTF8String:utf8Title]; @@ -108,13 +108,13 @@ - (void) userNotificationCenter:(NSUserNotificationCenter *)center didActivateNo [MacNotificationClass showNewNoticesNotification:theTitle withMessage:theMessage]; } - + return false; } -// wxTopLevel::RequestUserAttention() doesn't have an API to cancel +// wxTopLevel::RequestUserAttention() doesn't have an API to cancel // after a timeout, so we must call Notification Manager directly on Mac void CTaskBarIcon::MacRequestUserAttention() { m_pNotificationRequest = [NSApp requestUserAttention:NSInformationalRequest]; @@ -131,7 +131,7 @@ - (void) userNotificationCenter:(NSUserNotificationCenter *)center didActivateNo int CTaskBarIcon::SetDockBadge(wxBitmap* bmp) { // Reset to standard Dock tile (no badge) [NSApp setApplicationIconImage:nil]; - + if (bmp == NULL) { return 0; } diff --git a/clientgui/mac/Mac_GUI.cpp b/clientgui/mac/Mac_GUI.cpp index f8e671bc4e6..dfaa7480f5c 100644 --- a/clientgui/mac/Mac_GUI.cpp +++ b/clientgui/mac/Mac_GUI.cpp @@ -41,12 +41,12 @@ void ThisDummyRoutineIsNeverCalled() { /* End items to include "BOINC Manager" Mac menu items in localization templates */ -// Determine if the currently logged-in user is authorized to -// perform operations which have potential security risks. +// Determine if the currently logged-in user is authorized to +// perform operations which have potential security risks. // An example is "Attach to Project", where a dishonest user might -// attach to a rogue project which could then read private files -// belonging to the user who owns the BOINC application. This -// would be possible because the BOINC Manager runs with the +// attach to a rogue project which could then read private files +// belonging to the user who owns the BOINC application. This +// would be possible because the BOINC Manager runs with the // effective user ID of its owner on the Mac. Boolean Mac_Authorize() @@ -57,10 +57,10 @@ Boolean Mac_Authorize() AuthorizationFlags ourAuthFlags; AuthorizationItem ourAuthItem[1]; OSStatus err = noErr; - + if (sIsAuthorized) return true; - + // User is not the owner, so require admin authentication ourAuthItem[0].name = kAuthorizationRightExecute; ourAuthItem[0].value = NULL; @@ -69,17 +69,17 @@ Boolean Mac_Authorize() ourAuthRights.count = 1; ourAuthRights.items = ourAuthItem; - + ourAuthFlags = kAuthorizationFlagInteractionAllowed | kAuthorizationFlagExtendRights; err = AuthorizationCreate (&ourAuthRights, kAuthorizationEmptyEnvironment, ourAuthFlags, &ourAuthRef); if (err == noErr) { sIsAuthorized = true; - // We have authenticated user's credentials; we won't actually use the + // We have authenticated user's credentials; we won't actually use the // privileges / rights so destroy / discard them. err = AuthorizationFree(ourAuthRef, kAuthorizationFlagDestroyRights); } - + return sIsAuthorized; } diff --git a/clientgui/mac/SecurityUtility.cpp b/clientgui/mac/SecurityUtility.cpp index 3d74a496b02..d9e38065f40 100644 --- a/clientgui/mac/SecurityUtility.cpp +++ b/clientgui/mac/SecurityUtility.cpp @@ -39,7 +39,7 @@ int main(int argc, char *argv[]) { printf("Branding array has too few entries: %s\n", boincPath); return -1; } - + err = CreateBOINCUsersAndGroups(); if (err != noErr) return err; @@ -47,7 +47,7 @@ int main(int argc, char *argv[]) { err = AddAdminUserToGroups(getenv("USER")); if (err != noErr) return err; - + boincPath[0] = 0; getwd(boincPath); //ShowSecurityError("Current Working Directory is %s", wd); diff --git a/clientgui/mac/SetupSecurity.cpp b/clientgui/mac/SetupSecurity.cpp index b3095029029..bb81329dd5a 100644 --- a/clientgui/mac/SetupSecurity.cpp +++ b/clientgui/mac/SetupSecurity.cpp @@ -62,7 +62,7 @@ extern void print_to_log_file(const char *format, ...); // it ignores the S_ISUID and S_ISGID permission bits when launching an application. // To work around this, the _DEBUG version uses the current user and group. // -// NOTE: The Manager and Client call these routines only "#ifdef _DEBUG" (i.e., +// NOTE: The Manager and Client call these routines only "#ifdef _DEBUG" (i.e., // only from the DEVELOPMENT BUILD), never from the Deployment build. // // As of January, 2017: In the past, the client and BOINC Manager used to call @@ -98,7 +98,7 @@ int CreateBOINCUsersAndGroups() { if (geteuid() != 0) { ShowSecurityError("CreateBOINCUsersAndGroups must be called as root"); } - + err = CreateUserAndGroup(REAL_BOINC_MASTER_NAME, REAL_BOINC_MASTER_NAME); if (err != noErr) return err; @@ -106,11 +106,11 @@ int CreateBOINCUsersAndGroups() { err = CreateUserAndGroup(REAL_BOINC_PROJECT_NAME, REAL_BOINC_PROJECT_NAME); if (err != noErr) return err; - + err = ResynchDSSystem(); if (err != noErr) return err; - + return noErr; } @@ -124,7 +124,7 @@ int SetBOINCAppOwnersGroupsAndPermissions(char *path) { struct stat sbuf; Boolean isDirectory; OSStatus err = noErr; - + if (geteuid() != 0) { ShowSecurityError("SetBOINCAppOwnersGroupsAndPermissions must be called as root"); } @@ -145,7 +145,7 @@ int SetBOINCAppOwnersGroupsAndPermissions(char *path) { ShowSecurityError("Couldn't get path to self."); return -1; } - + // To allow for branding, assume name of executable inside bundle is same as name of bundle p = strrchr(dir_path, '/'); // Assume name of executable inside bundle is same as name of bundle if (p == NULL) @@ -153,7 +153,7 @@ int SetBOINCAppOwnersGroupsAndPermissions(char *path) { strlcpy(fullpath, p+1, sizeof(fullpath)); p = strrchr(fullpath, '.'); // Strip off bundle extension (".app") if (p) - *p = '\0'; + *p = '\0'; strlcat(dir_path, "/Contents/MacOS/", sizeof(dir_path)); strlcat(dir_path, fullpath, sizeof(dir_path)); @@ -165,7 +165,7 @@ int SetBOINCAppOwnersGroupsAndPermissions(char *path) { strlcpy(dir_path, path, MAXPATHLEN); // Path to BOINC Manager's bundle was passed as argument } - + strlcpy(fullpath, dir_path, sizeof(fullpath)); #ifdef _DEBUG @@ -191,7 +191,7 @@ int SetBOINCAppOwnersGroupsAndPermissions(char *path) { strlcat(fullpath, p+1, sizeof(fullpath)); p = strrchr(fullpath, '.'); // Strip off bundle extension (".app") if (p) - *p = '\0'; + *p = '\0'; sprintf(buf1, "%s:%s", boinc_master_user_name, boinc_master_group_name); // chown boinc_master:boinc_master path/BOINCManager.app/Contents/MacOS/BOINCManager @@ -220,7 +220,7 @@ int SetBOINCAppOwnersGroupsAndPermissions(char *path) { ShowSecurityError("SetBOINCAppOwnersGroupsAndPermissions: path to client is too long"); return -1; } - + sprintf(buf1, "%s:%s", boinc_master_user_name, boinc_master_group_name); // chown boinc_master:boinc_master path/BOINCManager.app/Contents/Resources/boinc err = DoSudoPosixSpawn(chownPath, buf1, fullpath, NULL, NULL, NULL, NULL); @@ -243,7 +243,7 @@ int SetBOINCAppOwnersGroupsAndPermissions(char *path) { for (int i=0; id_name[0] == '.') continue; // Ignore names beginning with '.' - + len = strlen(dp->d_name); if (len < 5) continue; - + if (strcmp(dp->d_name+len-4, ".xml")) continue; @@ -672,7 +672,7 @@ static OSStatus MakeXMLFilesPrivate(char * basepath) { if (retval) break; } // End while (true) - + closedir(dirp); return retval; @@ -690,12 +690,12 @@ static OSStatus UpdateNestedDirectories(char * basepath) { dirp = opendir(basepath); if (dirp == NULL) // Should never happen return -1; - + while (true) { dp = readdir(dirp); if (dp == NULL) break; // End of list - + if (dp->d_name[0] == '.') continue; // Ignore names beginning with '.' @@ -728,15 +728,15 @@ static OSStatus UpdateNestedDirectories(char * basepath) { if (retval) break; } else { - // Since we are changing ownership from boinc_project to boinc_master, - // make sure executable-by-group bit is set if executable-by-owner is set + // Since we are changing ownership from boinc_project to boinc_master, + // make sure executable-by-group bit is set if executable-by-owner is set if ((sbuf.st_mode & 0110) == 0100) { // If executable by owner but not by group retval = DoSudoPosixSpawn(chmodPath, "g+x", fullpath, NULL, NULL, NULL, NULL); } } - + } // End while (true) - + closedir(dirp); return retval; @@ -758,7 +758,7 @@ static OSStatus CreateUserAndGroup(char * user_name, char * group_name) { char buf2[80]; char buf3[80]; char buf4[80]; - + // OS 10.4 has problems with Accounts pane if we create uid or gid > 501 pw = getpwnam(user_name); if (pw) { @@ -771,7 +771,7 @@ static OSStatus CreateUserAndGroup(char * user_name, char * group_name) { groupid = grp->gr_gid; groupExists = true; } - + sprintf(buf1, "/groups/%s", group_name); sprintf(buf2, "/users/%s", user_name); @@ -798,8 +798,8 @@ static OSStatus CreateUserAndGroup(char * user_name, char * group_name) { userid = groupid; } } - - // We need to find an available user ID, group ID, or both. Find a value that is currently + + // We need to find an available user ID, group ID, or both. Find a value that is currently // neither a user ID or a group ID. // If we need both a new user ID and a new group ID, finds a value that can be used for both. if ( (userid == 0) || (groupid == 0) ) { @@ -809,24 +809,24 @@ static OSStatus CreateUserAndGroup(char * user_name, char * group_name) { if (pw) continue; // Already exists as a user ID of a different user } - + if ((gid_t)i != groupid) { grp = getgrgid((gid_t)i); if (grp) continue; // Already exists as a group ID of a different group } - + if (! userExists) userid = (uid_t)i; if (! groupExists) groupid = (gid_t)i; start_id = i + 1; // Start with next higher value next time - + break; // Success! } } - + sprintf(buf3, "%d", groupid); sprintf(buf4, "%d", userid); @@ -835,13 +835,13 @@ static OSStatus CreateUserAndGroup(char * user_name, char * group_name) { err = DoSudoPosixSpawn(dsclPath, ".", "-create", buf1, NULL, NULL, NULL); if (err) return err; - + // Something like "dscl . -create /groups/boinc_master gid 33" err = DoSudoPosixSpawn(dsclPath, ".", "-create", buf1, "gid", buf3, NULL); if (err) return err; } // if (! groupExists) - + if (! userExists) { // If we need to create user // Something like "dscl . -create /users/boinc_master" err = DoSudoPosixSpawn(dsclPath, ".", "-create", buf2, NULL, NULL, NULL); @@ -873,7 +873,7 @@ static OSStatus CreateUserAndGroup(char * user_name, char * group_name) { setRealName: // Always set the RealName field to an empty string - // Note: create RealName with empty string fails under OS 10.7, but + // Note: create RealName with empty string fails under OS 10.7, but // creating it with non-empty string and changing to empty string does work. // // Something like "dscl . -create /users/boinc_master RealName tempName" @@ -896,7 +896,7 @@ static OSStatus CreateUserAndGroup(char * user_name, char * group_name) { } -int AddAdminUserToGroups(char *user_name, bool add_to_boinc_project) { +int AddAdminUserToGroups(char *user_name, bool add_to_boinc_project) { #ifndef _DEBUG char buf1[80]; OSStatus err = noErr; @@ -916,19 +916,19 @@ int AddAdminUserToGroups(char *user_name, bool add_to_boinc_project) { if (err) return err; } - + err = ResynchDSSystem(); if (err != noErr) return err; -#endif // ! _DEBUG +#endif // ! _DEBUG return noErr; } OSStatus ResynchDSSystem() { OSStatus err __attribute__((unused)) = noErr; - + err = DoSudoPosixSpawn("/usr/bin/dscacheutil", "-flushcache", NULL, NULL, NULL, NULL, NULL); err = DoSudoPosixSpawn("/usr/bin/dsmemberutil", "flushcache", NULL, NULL, NULL, NULL, NULL); return noErr; @@ -936,7 +936,7 @@ OSStatus ResynchDSSystem() { #ifdef _DEBUG -// GDB can't attach to applications which are running as a different user or group so +// GDB can't attach to applications which are running as a different user or group so // it ignores the S_ISUID and S_ISGID permission bits when launching an application. // To work around this, the _DEBUG version uses the current user and group. static OSStatus SetFakeMasterNames() { @@ -956,7 +956,7 @@ static OSStatus SetFakeMasterNames() { if (grp == NULL) return -1; strlcpy(boinc_master_group_name, grp->gr_name, sizeof(boinc_master_group_name)); - + #ifndef DEBUG_WITH_FAKE_PROJECT_USER_AND_GROUP // For better debugging of SANDBOX permissions logic strlcpy(boinc_project_user_name, REAL_BOINC_PROJECT_NAME, sizeof(boinc_project_user_name)); @@ -966,7 +966,7 @@ static OSStatus SetFakeMasterNames() { strlcpy(boinc_project_user_name, pw->pw_name, sizeof(boinc_project_user_name)); strlcpy(boinc_project_group_name, grp->gr_name, sizeof(boinc_project_group_name)); #endif - + return noErr; } #endif @@ -1001,7 +1001,7 @@ static OSStatus DoSudoPosixSpawn(const char *pathToTool, char *arg1, char *arg2, } print_to_log_file("***********\n"); #endif - + errno = 0; result = posix_spawnp(&thePid, "/usr/bin/sudo", NULL, NULL, args, environ); @@ -1035,7 +1035,7 @@ static OSStatus DoSudoPosixSpawn(const char *pathToTool, char *arg1, char *arg2, #endif } // end if (WIFEXITED(status)) else } // end if waitpid returned 0 sstaus else - + #if 0 if (strcmp(arg2, "-R") == 0) SleepSeconds(DELAY_SECONDS_R); @@ -1046,8 +1046,8 @@ static OSStatus DoSudoPosixSpawn(const char *pathToTool, char *arg1, char *arg2, break; } if (result != 0) - ShowSecurityError("\"%s %s %s %s %s %s\" returned error %d", pathToTool, - arg1 ? arg1 : "", arg2 ? arg2 : "", arg3 ? arg3 : "", + ShowSecurityError("\"%s %s %s %s %s %s\" returned error %d", pathToTool, + arg1 ? arg1 : "", arg2 ? arg2 : "", arg3 ? arg3 : "", arg4 ? arg4 : "", arg5 ? arg5 : "", result); return result; diff --git a/clientgui/msw/taskbarex.h b/clientgui/msw/taskbarex.h index f8b127f03c2..0b9a294bb79 100644 --- a/clientgui/msw/taskbarex.h +++ b/clientgui/msw/taskbarex.h @@ -18,7 +18,7 @@ #define _TASKBAREX_H_ // ---------------------------------------------------------------------------- -// wxTaskBarIconEx Balloon Types +// wxTaskBarIconEx Balloon Types // ---------------------------------------------------------------------------- #define BALLOONTYPE_INFO NIIF_INFO @@ -26,7 +26,7 @@ #define BALLOONTYPE_ERROR NIIF_ERROR // ---------------------------------------------------------------------------- -// wxTaskBarIconEx +// wxTaskBarIconEx // ---------------------------------------------------------------------------- class wxTaskBarIconExEvent; @@ -59,14 +59,14 @@ class wxTaskBarIconEx: public wxEvtHandler ); virtual bool SetBalloon( - const wxIcon& icon, + const wxIcon& icon, const wxString title = wxEmptyString, const wxString message = wxEmptyString, unsigned int iconballoon = BALLOONTYPE_INFO ); virtual bool QueueBalloon( - const wxIcon& icon, + const wxIcon& icon, const wxString title = wxEmptyString, const wxString message = wxEmptyString, unsigned int iconballoon = BALLOONTYPE_INFO diff --git a/clientgui/resource.h b/clientgui/resource.h index ecc55ad0ded..998bf7de3f7 100644 --- a/clientgui/resource.h +++ b/clientgui/resource.h @@ -5,7 +5,7 @@ #define ICON_BOINCGUIAPP 0 // Next default values for new objects -// +// #ifdef APSTUDIO_INVOKED #ifndef APSTUDIO_READONLY_SYMBOLS #define _APS_NO_MFC 1 diff --git a/clientgui/sg_BoincSimpleFrame.h b/clientgui/sg_BoincSimpleFrame.h index ef151e68a29..034898d0e84 100644 --- a/clientgui/sg_BoincSimpleFrame.h +++ b/clientgui/sg_BoincSimpleFrame.h @@ -123,7 +123,7 @@ class CSimpleFrame : public CBOINCBaseFrame void OnRefreshView( CFrameEvent& event ); void OnNotification( CFrameEvent& event ); void OnEventLog(wxCommandEvent& event); - + void SetMsgsDlgOpen(CDlgMessages* newDlgPtr) { dlgMsgsPtr = newDlgPtr; } bool isMessagesDlgOpen() { return (dlgMsgsPtr != NULL); } diff --git a/clientgui/sg_CustomControls.cpp b/clientgui/sg_CustomControls.cpp index 6d583438c3b..f0cdda956f7 100644 --- a/clientgui/sg_CustomControls.cpp +++ b/clientgui/sg_CustomControls.cpp @@ -20,7 +20,7 @@ #endif #include "stdwx.h" -#include "sg_CustomControls.h" +#include "sg_CustomControls.h" IMPLEMENT_DYNAMIC_CLASS (CTransparentStaticLine, wxPanel) @@ -37,7 +37,7 @@ CTransparentStaticLine::CTransparentStaticLine(wxWindow* parent, wxWindowID id, } -bool CTransparentStaticLine::Create(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) { +bool CTransparentStaticLine::Create(wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) { bool bRetVal = wxPanel::Create(parent, id, pos, size, style|wxTRANSPARENT_WINDOW, name); SetBackgroundColour(parent->GetBackgroundColour()); @@ -52,7 +52,7 @@ void CTransparentStaticLine::OnPaint(wxPaintEvent& /*event*/) { wxPaintDC dc(this); wxPen pen = wxPen(GetLineColor(), 1); dc.SetPen(pen); - dc.DrawLine(0, 0, GetSize().GetWidth(), 0); + dc.DrawLine(0, 0, GetSize().GetWidth(), 0); } @@ -74,7 +74,7 @@ CTransparentStaticText::CTransparentStaticText(wxWindow* parent, wxWindowID id, } -bool CTransparentStaticText::Create(wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) { +bool CTransparentStaticText::Create(wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) { bool bRetVal = wxStaticText::Create(parent, id, label, pos, size, style|wxTRANSPARENT_WINDOW, name); SetBackgroundColour(parent->GetBackgroundColour()); @@ -198,7 +198,7 @@ void CTransparentHyperlinkCtrl::OnEraseBackground(wxEraseEvent& event) } else { event.Skip(); } -} +} #endif @@ -218,7 +218,7 @@ CTransparentStaticTextAssociate::CTransparentStaticTextAssociate(wxWindow* paren } -bool CTransparentStaticTextAssociate::Create(wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) { +bool CTransparentStaticTextAssociate::Create(wxWindow* parent, wxWindowID id, const wxString& label, const wxPoint& pos, const wxSize& size, long style, const wxString& name ) { bool bRetVal = wxPanel::Create(parent, id, pos, size, style|wxTRANSPARENT_WINDOW, name); m_pWnd = NULL; @@ -317,7 +317,7 @@ bool CTransparentStaticBitmap::Create(wxWindow* parent, wxWindowID id, const wxB SetBackgroundColour(parent->GetBackgroundColour()); SetForegroundColour(parent->GetForegroundColour()); - + m_bitMap = wxBitmap(bitmap); return bRetVal; @@ -409,7 +409,7 @@ CLinkButton::CLinkButton(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap } -bool CLinkButton::Create(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name ) { +bool CLinkButton::Create(wxWindow* parent, wxWindowID id, const wxBitmap& bitmap, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name ) { bool bRetVal = wxBitmapButton::Create(parent, id, bitmap, pos, size, style, validator, name); m_HandCursor = wxCursor(wxCURSOR_HAND); diff --git a/clientgui/sg_CustomControls.h b/clientgui/sg_CustomControls.h index e2c7a3c8147..9821fa7c772 100644 --- a/clientgui/sg_CustomControls.h +++ b/clientgui/sg_CustomControls.h @@ -23,27 +23,27 @@ #endif -class CTransparentStaticLine : public wxPanel -{ +class CTransparentStaticLine : public wxPanel +{ DECLARE_DYNAMIC_CLASS (CTransparentStaticLine) -public: +public: CTransparentStaticLine(); CTransparentStaticLine( - wxWindow* parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, + wxWindow* parent, + wxWindowID id, + const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = 0, + long style = 0, const wxString& name= wxStaticTextNameStr ); bool Create( - wxWindow* parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, + wxWindow* parent, + wxWindowID id, + const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = 0, + long style = 0, const wxString& name= wxStaticTextNameStr ); @@ -58,32 +58,32 @@ class CTransparentStaticLine : public wxPanel private: wxColour m_LineColor; -}; +}; class CTransparentStaticText : public wxStaticText -{ +{ DECLARE_DYNAMIC_CLASS (CTransparentStaticText) public: CTransparentStaticText(); CTransparentStaticText( - wxWindow* parent, - wxWindowID id, - const wxString& label, - const wxPoint& pos = wxDefaultPosition, + wxWindow* parent, + wxWindowID id, + const wxString& label, + const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = 0, + long style = 0, const wxString& name= wxStaticTextNameStr ); bool Create( - wxWindow* parent, - wxWindowID id, - const wxString& label, - const wxPoint& pos = wxDefaultPosition, + wxWindow* parent, + wxWindowID id, + const wxString& label, + const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = 0, + long style = 0, const wxString& name= wxStaticTextNameStr ); @@ -95,7 +95,7 @@ class CTransparentStaticText : public wxStaticText #endif DECLARE_EVENT_TABLE() -}; +}; class CTransparentButton : public wxButton @@ -174,28 +174,28 @@ class CTransparentHyperlinkCtrl : public wxHyperlinkCtrl class CTransparentStaticTextAssociate : public wxPanel -{ +{ DECLARE_DYNAMIC_CLASS (CTransparentStaticTextAssociate) public: CTransparentStaticTextAssociate(); CTransparentStaticTextAssociate( - wxWindow* parent, - wxWindowID id, - const wxString& label, - const wxPoint& pos = wxDefaultPosition, + wxWindow* parent, + wxWindowID id, + const wxString& label, + const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = 0, + long style = 0, const wxString& name= wxStaticTextNameStr ); bool Create( - wxWindow* parent, - wxWindowID id, - const wxString& label, - const wxPoint& pos = wxDefaultPosition, + wxWindow* parent, + wxWindowID id, + const wxString& label, + const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = 0, + long style = 0, const wxString& name= wxStaticTextNameStr ); @@ -211,35 +211,35 @@ class CTransparentStaticTextAssociate : public wxPanel DECLARE_EVENT_TABLE() private: wxWindow* m_pWnd; -}; +}; #ifndef __WXMSW__ #define CTransparentStaticBitmap wxStaticBitmap #else class CTransparentStaticBitmap : public wxPanel -{ +{ DECLARE_DYNAMIC_CLASS (CTransparentStaticBitmap) public: CTransparentStaticBitmap(); CTransparentStaticBitmap( - wxWindow* parent, - wxWindowID id, + wxWindow* parent, + wxWindowID id, const wxBitmap& bitmap, - const wxPoint& pos = wxDefaultPosition, + const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = 0, + long style = 0, const wxString& name= wxStaticBitmapNameStr ); bool Create( - wxWindow* parent, - wxWindowID id, + wxWindow* parent, + wxWindowID id, const wxBitmap& bitmap, - const wxPoint& pos = wxDefaultPosition, + const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = 0, + long style = 0, const wxString& name= wxStaticBitmapNameStr ); @@ -256,7 +256,7 @@ class CTransparentStaticBitmap : public wxPanel class CTransparentCheckBox : public wxCheckBox -{ +{ DECLARE_DYNAMIC_CLASS (CTransparentCheckBox) public: @@ -290,29 +290,29 @@ class CTransparentCheckBox : public wxCheckBox class CLinkButton : public wxBitmapButton -{ +{ DECLARE_DYNAMIC_CLASS (CLinkButton) public: CLinkButton(); CLinkButton( - wxWindow* parent, - wxWindowID id, + wxWindow* parent, + wxWindowID id, const wxBitmap& bitmap, - const wxPoint& pos = wxDefaultPosition, + const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = 0, + long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name= wxButtonNameStr ); bool Create( - wxWindow* parent, - wxWindowID id, + wxWindow* parent, + wxWindowID id, const wxBitmap& bitmap, - const wxPoint& pos = wxDefaultPosition, + const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = 0, + long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name= wxButtonNameStr ); @@ -322,6 +322,6 @@ class CLinkButton : public wxBitmapButton DECLARE_EVENT_TABLE() private: wxCursor m_HandCursor; -}; +}; -#endif +#endif diff --git a/clientgui/sg_DlgMessages.h b/clientgui/sg_DlgMessages.h index 6c914c49ccc..db0e19d0790 100644 --- a/clientgui/sg_DlgMessages.h +++ b/clientgui/sg_DlgMessages.h @@ -133,7 +133,7 @@ class CDlgMessages : public wxDialog CDlgMessages( wxWindow* parent, wxWindowID id = SYMBOL_CDLGMESSAGES_IDNAME, const wxString& caption = SYMBOL_CDLGMESSAGES_TITLE, const wxPoint& pos = SYMBOL_CDLGMESSAGES_POSITION, const wxSize& size = SYMBOL_CDLGMESSAGES_SIZE, long style = SYMBOL_CDLGMESSAGES_STYLE ); ~CDlgMessages(); - + /// Creation bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CDLGMESSAGES_IDNAME, const wxString& caption = SYMBOL_CDLGMESSAGES_TITLE, const wxPoint& pos = SYMBOL_CDLGMESSAGES_POSITION, const wxSize& size = SYMBOL_CDLGMESSAGES_SIZE, long style = SYMBOL_CDLGMESSAGES_STYLE ); @@ -148,9 +148,9 @@ class CDlgMessages : public wxDialog /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK void OnOK( wxCommandEvent& event ); - + void OnRefresh() { m_pBackgroundPanel->OnRefresh(); } - + private: bool SaveState(); diff --git a/clientgui/sg_DlgPreferences.h b/clientgui/sg_DlgPreferences.h index c893235269e..10806e10855 100644 --- a/clientgui/sg_DlgPreferences.h +++ b/clientgui/sg_DlgPreferences.h @@ -88,7 +88,7 @@ enum { */ class CPanelPreferences: public wxPanel -{ +{ DECLARE_DYNAMIC_CLASS( CPanelPreferences ) DECLARE_EVENT_TABLE() @@ -116,10 +116,10 @@ class CPanelPreferences: public wxPanel /// wxEVT_COMMAND_COMBOBOX_SELECTED event handler for ID_CONNECTBETWEENBEGIN void OnConnectBetweenBeginSelected( wxCommandEvent& event ); - + /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_SIMPLE_HELP void OnButtonHelp( wxCommandEvent& event ); - + ////@end CPanelPreferences event handler declarations void OnButtonClear(); @@ -144,7 +144,7 @@ class CPanelPreferences: public wxPanel bool IsValidTimeChar(const wxChar& ch); bool IsValidTimeValue(const wxString& value); void OnHandleCheckboxEvent(wxCommandEvent& ev); - + void addNewRowToSizer(wxSizer* toSizer, wxString& toolTipText, wxWindow* first, wxWindow* second, wxWindow* third, wxWindow* fourth=NULL, wxWindow* fifth=NULL); @@ -172,14 +172,14 @@ class CPanelPreferences: public wxPanel wxTextValidator* m_vTimeValidator; wxButton* m_btnClear; wxString *web_prefs_url; - + wxBitmap* m_backgroundBitmap; - + bool m_bOKToShow; wxColour stdTextBkgdColor; wxTextCtrl* lastErrorCtrl; - + ////@end CPanelPreferences member variables GLOBAL_PREFS global_preferences_working; GLOBAL_PREFS_MASK global_preferences_mask; @@ -194,7 +194,7 @@ class CPanelPreferences: public wxPanel */ class CDlgPreferences: public wxDialog -{ +{ DECLARE_DYNAMIC_CLASS( CDlgPreferences ) DECLARE_EVENT_TABLE() diff --git a/clientgui/sg_ProjectCommandPopup.cpp b/clientgui/sg_ProjectCommandPopup.cpp index 82225ff830e..0ead489b1df 100644 --- a/clientgui/sg_ProjectCommandPopup.cpp +++ b/clientgui/sg_ProjectCommandPopup.cpp @@ -38,9 +38,9 @@ END_EVENT_TABLE() CSimpleProjectCommandPopupButton::CSimpleProjectCommandPopupButton() { } - -CSimpleProjectCommandPopupButton::CSimpleProjectCommandPopupButton(wxWindow* parent, wxWindowID id, - const wxString& label, const wxPoint& pos, const wxSize& size, + +CSimpleProjectCommandPopupButton::CSimpleProjectCommandPopupButton(wxWindow* parent, wxWindowID id, + const wxString& label, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name) : CTransparentButton(parent, id, label, pos, size, style, validator, name) { @@ -48,12 +48,12 @@ CSimpleProjectCommandPopupButton::CSimpleProjectCommandPopupButton(wxWindow* par m_ProjectCommandsPopUpMenu = new wxMenu(); AddMenuItems(); Connect( - id, + id, wxEVT_BUTTON, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &CSimpleProjectCommandPopupButton::OnProjectCommandsKeyboardNav ); } - + CSimpleProjectCommandPopupButton::~CSimpleProjectCommandPopupButton() { delete m_ProjectCommandsPopUpMenu; @@ -62,13 +62,13 @@ CSimpleProjectCommandPopupButton::~CSimpleProjectCommandPopupButton() { void CSimpleProjectCommandPopupButton::AddMenuItems() { m_UpdateProjectMenuItem = m_ProjectCommandsPopUpMenu->Append( - ID_TASK_PROJECT_UPDATE, + ID_TASK_PROJECT_UPDATE, _("Update"), _("Report all completed tasks, get latest credit, get latest preferences, and possibly get more tasks.") ); m_SuspendResumeMenuItem = m_ProjectCommandsPopUpMenu->Append( - ID_TASK_PROJECT_SUSPEND, + ID_TASK_PROJECT_SUSPEND, _("Suspend"), _("Suspend tasks for this project.") ); @@ -111,10 +111,10 @@ void CSimpleProjectCommandPopupButton::OnProjectCommandsKeyboardNav(wxCommandEve void CSimpleProjectCommandPopupButton::ShowProjectCommandsMenu(wxPoint pos) { CMainDocument* pDoc = wxGetApp().GetDocument(); - + wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); - + ProjectSelectionData* selData = ((CSimpleProjectPanel*)GetParent())->GetProjectSelectionData(); if (selData == NULL) return; char* ctrl_url = selData->project_url; @@ -136,7 +136,7 @@ void CSimpleProjectCommandPopupButton::ShowProjectCommandsMenu(wxPoint pos) { m_NoNewTasksMenuItem->SetItemLabel(_("No new tasks")); m_NoNewTasksMenuItem->SetHelp(_("Don't fetch new tasks for this project.")); } - + m_RemoveProjectMenuItem->Enable(!project->attached_via_acct_mgr); #ifdef __WXMAC__ @@ -208,7 +208,7 @@ void CSimpleProjectCommandPopupButton::OnProjectNoNewWork(wxCommandEvent& WXUNUS void CSimpleProjectCommandPopupButton::OnResetProject(wxCommandEvent& WXUNUSED(event)) { int projectIndex; - wxInt32 iAnswer = 0; + wxInt32 iAnswer = 0; wxString strMessage = wxEmptyString; CMainDocument* pDoc = wxGetApp().GetDocument(); @@ -226,7 +226,7 @@ void CSimpleProjectCommandPopupButton::OnResetProject(wxCommandEvent& WXUNUSED(e wxString projname(project->project_name.c_str(), wxConvUTF8); strMessage.Printf( - _("Are you sure you want to reset project '%s'?"), + _("Are you sure you want to reset project '%s'?"), projname.c_str() ); @@ -245,7 +245,7 @@ void CSimpleProjectCommandPopupButton::OnResetProject(wxCommandEvent& WXUNUSED(e void CSimpleProjectCommandPopupButton::OnProjectDetach(wxCommandEvent& WXUNUSED(event)) { int projectIndex; - wxInt32 iAnswer = 0; + wxInt32 iAnswer = 0; wxString strMessage = wxEmptyString; CMainDocument* pDoc = wxGetApp().GetDocument(); @@ -263,7 +263,7 @@ void CSimpleProjectCommandPopupButton::OnProjectDetach(wxCommandEvent& WXUNUSED( wxString projname(project->project_name.c_str(), wxConvUTF8); strMessage.Printf( - _("Are you sure you want to remove project '%s'?"), + _("Are you sure you want to remove project '%s'?"), projname.c_str() ); @@ -291,7 +291,7 @@ void CSimpleProjectCommandPopupButton::OnProjectShowProperties(wxCommandEvent& W char* ctrl_url = selData->project_url; PROJECT* project = pDoc->state.lookup_project(ctrl_url); if (!project) return; - + CDlgItemProperties dlg(this); dlg.renderInfos(project); dlg.ShowModal(); diff --git a/clientgui/sg_ProjectCommandPopup.h b/clientgui/sg_ProjectCommandPopup.h index 79147a725d2..ee42ffadff6 100644 --- a/clientgui/sg_ProjectCommandPopup.h +++ b/clientgui/sg_ProjectCommandPopup.h @@ -20,22 +20,22 @@ #include "sg_CustomControls.h" -class CSimpleProjectCommandPopupButton : public CTransparentButton +class CSimpleProjectCommandPopupButton : public CTransparentButton { DECLARE_DYNAMIC_CLASS( CSimpleProjectCommandPopupButton ) DECLARE_EVENT_TABLE() public: CSimpleProjectCommandPopupButton(); - - CSimpleProjectCommandPopupButton(wxWindow* parent, wxWindowID id, - const wxString& label = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& validator = wxDefaultValidator, + + CSimpleProjectCommandPopupButton(wxWindow* parent, wxWindowID id, + const wxString& label = wxEmptyString, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxValidator& validator = wxDefaultValidator, const wxString& name = wxT("ProjectCommandsPopupMenu")); - + ~CSimpleProjectCommandPopupButton(); private: diff --git a/clientgui/sg_ProjectPanel.h b/clientgui/sg_ProjectPanel.h index 8a40144a3cc..b07ec7b561d 100644 --- a/clientgui/sg_ProjectPanel.h +++ b/clientgui/sg_ProjectPanel.h @@ -34,7 +34,7 @@ typedef struct { class CBOINCBitmapComboBox; -class CSimpleProjectPanel : public CSimplePanelBase +class CSimpleProjectPanel : public CSimplePanelBase { DECLARE_DYNAMIC_CLASS( CSimpleProjectPanel ) DECLARE_EVENT_TABLE() @@ -43,11 +43,11 @@ class CSimpleProjectPanel : public CSimplePanelBase CSimpleProjectPanel(); CSimpleProjectPanel( wxWindow* parent); ~CSimpleProjectPanel(); - + ProjectSelectionData* GetProjectSelectionData(); void UpdateInterface(); void ReskinInterface(); - + private: void OnProjectSelection(wxCommandEvent &event); void OnProjectCommandButton(wxCommandEvent& /*event*/); diff --git a/clientgui/sg_ProjectWebSitesPopup.cpp b/clientgui/sg_ProjectWebSitesPopup.cpp index a6943af4d71..5c815ee38f5 100644 --- a/clientgui/sg_ProjectWebSitesPopup.cpp +++ b/clientgui/sg_ProjectWebSitesPopup.cpp @@ -33,29 +33,29 @@ END_EVENT_TABLE() CSimpleProjectWebSitesPopupButton::CSimpleProjectWebSitesPopupButton() { } - -CSimpleProjectWebSitesPopupButton::CSimpleProjectWebSitesPopupButton(wxWindow* parent, wxWindowID id, - const wxString& label, const wxPoint& pos, const wxSize& size, + +CSimpleProjectWebSitesPopupButton::CSimpleProjectWebSitesPopupButton(wxWindow* parent, wxWindowID id, + const wxString& label, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name) : CTransparentButton(parent, id, label, pos, size, style, validator, name) { m_ProjectWebSitesPopUpMenu = new wxMenu(); Connect( - id, + id, wxEVT_BUTTON, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &CSimpleProjectWebSitesPopupButton::OnProjectWebSitesKeyboardNav ); } - + CSimpleProjectWebSitesPopupButton::~CSimpleProjectWebSitesPopupButton() { delete m_ProjectWebSitesPopUpMenu; } -void CSimpleProjectWebSitesPopupButton::AddMenuItems() -{ +void CSimpleProjectWebSitesPopupButton::AddMenuItems() +{ CMainDocument* pDoc = wxGetApp().GetDocument(); wxASSERT(pDoc); wxASSERT(wxDynamicCast(pDoc, CMainDocument)); @@ -78,7 +78,7 @@ void CSimpleProjectWebSitesPopupButton::AddMenuItems() for(unsigned int i = 0; i < urlCount; i++){ urlItem = new wxMenuItem(m_ProjectWebSitesPopUpMenu, WEBSITE_URL_MENU_ID + i, wxGetTranslation(wxString(project->gui_urls[i].name.c_str(), wxConvUTF8))); Connect( WEBSITE_URL_MENU_ID + i, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(CSimpleProjectWebSitesPopupButton::OnMenuLinkClicked) ); - + m_ProjectWebSitesPopUpMenu->Append(urlItem); } } @@ -127,7 +127,7 @@ void CSimpleProjectWebSitesPopupButton::OnMenuLinkClicked(wxCommandEvent& event) } else{ int menuId = menuIDevt - WEBSITE_URL_MENU_ID; PROJECT* project = pDoc->state.lookup_project(ctrl_url); - + wxLaunchDefaultBrowser(wxString(project->gui_urls[menuId].url.c_str(),wxConvUTF8)); } } diff --git a/clientgui/sg_ProjectWebSitesPopup.h b/clientgui/sg_ProjectWebSitesPopup.h index 992295c2393..c261cafd0e3 100644 --- a/clientgui/sg_ProjectWebSitesPopup.h +++ b/clientgui/sg_ProjectWebSitesPopup.h @@ -20,24 +20,24 @@ #include "sg_CustomControls.h" -class CSimpleProjectWebSitesPopupButton : public CTransparentButton +class CSimpleProjectWebSitesPopupButton : public CTransparentButton { DECLARE_DYNAMIC_CLASS( CSimpleProjectWebSitesPopupButton ) DECLARE_EVENT_TABLE() public: CSimpleProjectWebSitesPopupButton(); - - CSimpleProjectWebSitesPopupButton(wxWindow* parent, wxWindowID id, - const wxString& label = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& validator = wxDefaultValidator, + + CSimpleProjectWebSitesPopupButton(wxWindow* parent, wxWindowID id, + const wxString& label = wxEmptyString, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxValidator& validator = wxDefaultValidator, const wxString& name = wxT("ProjectWebsitesPopupMenu")); - + ~CSimpleProjectWebSitesPopupButton(); - + void RebuildMenu(); private: diff --git a/clientgui/sg_TaskCommandPopup.cpp b/clientgui/sg_TaskCommandPopup.cpp index 3493303b32b..2fc9a9b6717 100644 --- a/clientgui/sg_TaskCommandPopup.cpp +++ b/clientgui/sg_TaskCommandPopup.cpp @@ -36,9 +36,9 @@ END_EVENT_TABLE() CSimpleTaskPopupButton::CSimpleTaskPopupButton() { } - -CSimpleTaskPopupButton::CSimpleTaskPopupButton(wxWindow* parent, wxWindowID id, - const wxString& label, const wxPoint& pos, const wxSize& size, + +CSimpleTaskPopupButton::CSimpleTaskPopupButton(wxWindow* parent, wxWindowID id, + const wxString& label, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name) : CTransparentButton(parent, id, label, pos, size, style, validator, name) { @@ -47,13 +47,13 @@ CSimpleTaskPopupButton::CSimpleTaskPopupButton(wxWindow* parent, wxWindowID id, m_TaskCommandPopUpMenu = new wxMenu(); AddMenuItems(); Connect( - id, + id, wxEVT_BUTTON, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &CSimpleTaskPopupButton::OnTaskCommandsKeyboardNav ); } - + CSimpleTaskPopupButton::~CSimpleTaskPopupButton() { delete m_TaskCommandPopUpMenu; @@ -62,13 +62,13 @@ CSimpleTaskPopupButton::~CSimpleTaskPopupButton() { void CSimpleTaskPopupButton::AddMenuItems() { m_ShowGraphicsMenuItem = m_TaskCommandPopUpMenu->Append( - ID_TASK_WORK_SHOWGRAPHICS, + ID_TASK_WORK_SHOWGRAPHICS, _("Show graphics"), _("Show application graphics in a window.") ); m_SuspendResumeMenuItem = m_TaskCommandPopUpMenu->Append( - ID_TASK_WORK_SUSPEND, + ID_TASK_WORK_SUSPEND, _("Suspend"), _("Suspend this task.") ); @@ -103,16 +103,16 @@ void CSimpleTaskPopupButton::ShowTaskCommandsMenu(wxPoint pos) { bool enableAbort = true; CC_STATUS status; wxString strMachineName; - + wxASSERT(pDoc); - + TaskSelectionData* selData = ((CSimpleTaskPanel*)GetParent())->GetTaskSelectionData(); if (selData == NULL) return; RESULT* result = lookup_result(selData->project_url, selData->result_name); if (!result) return; - + if (result->suspended_via_gui) { m_TaskSuspendedViaGUI = true; m_SuspendResumeMenuItem->SetItemLabel(_("Resume")); @@ -139,30 +139,30 @@ void CSimpleTaskPopupButton::ShowTaskCommandsMenu(wxPoint pos) { } if (result->suspended_via_gui || - result->project_suspended_via_gui || + result->project_suspended_via_gui || (result->scheduler_state != CPU_SCHED_SCHEDULED) ) { enableShowGraphics = false; } - + if (pDoc->GetRunningGraphicsApp(result) != NULL) { m_ShowGraphicsMenuItem->SetItemLabel(_("Stop graphics")); m_ShowGraphicsMenuItem->SetHelp(_("Close application graphics window.")); // Graphics might still be running even if task is suspended enableShowGraphics = true; - + } else { m_ShowGraphicsMenuItem->SetItemLabel(_("Show graphics")); m_ShowGraphicsMenuItem->SetHelp(_("Show application graphics in a window.")); } m_ShowGraphicsMenuItem->Enable(enableShowGraphics); - + // Disable Abort button if any selected task already aborted if ( result->active_task_state == PROCESS_ABORT_PENDING || result->active_task_state == PROCESS_ABORTED || - result->state == RESULT_ABORTED + result->state == RESULT_ABORTED ) { enableAbort = false; } @@ -181,14 +181,14 @@ void CSimpleTaskPopupButton::ShowTaskCommandsMenu(wxPoint pos) { /*** CAF *** FOR TESTING ONLY ***/ static int i; wxString s; - + if (i > 9) i = 0; if ( i < 5) { s = (wxT("This is a very very very and extremely long label.")); } else { s = (wxT("short.")); } - + switch (i++) { case 0: case 5: @@ -212,7 +212,7 @@ void CSimpleTaskPopupButton::ShowTaskCommandsMenu(wxPoint pos) { break; } - m_ProgressBar->SetValue( i * 10 ); + m_ProgressBar->SetValue( i * 10 ); int sel = i % 3; // m_TaskSelectionCtrl->SetStringSelection(tempArray[sel]); m_TaskSelectionCtrl->SetSelection(sel); @@ -228,7 +228,7 @@ void CSimpleTaskPopupButton::OnTaskShowGraphics(wxCommandEvent& WXUNUSED(event)) TaskSelectionData* selData = ((CSimpleTaskPanel*)GetParent())->GetTaskSelectionData(); if (selData == NULL) return; - + RESULT* result = lookup_result(selData->project_url, selData->result_name); if (result) { pDoc->WorkShowGraphics(result); @@ -275,7 +275,7 @@ void CSimpleTaskPopupButton::OnTaskAbort(wxCommandEvent& WXUNUSED(event)) { wxString name = ((CSimpleTaskPanel*)GetParent())->GetSelectedTaskString(); #endif strMessage.Printf( - _("Are you sure you want to abort this task '%s'?\n(Progress: %.1lf%%, Status: %s)"), + _("Are you sure you want to abort this task '%s'?\n(Progress: %.1lf%%, Status: %s)"), name.c_str(), result->fraction_done * 100.0, result_description(result, false).c_str()); iAnswer = wxGetApp().SafeMessageBox( @@ -288,7 +288,7 @@ void CSimpleTaskPopupButton::OnTaskAbort(wxCommandEvent& WXUNUSED(event)) { if (wxYES != iAnswer) { return; } - + pDoc->WorkAbort(result->project_url, result->name); } } @@ -297,7 +297,7 @@ void CSimpleTaskPopupButton::OnTaskAbort(wxCommandEvent& WXUNUSED(event)) { void CSimpleTaskPopupButton::OnTaskShowProperties(wxCommandEvent& WXUNUSED(event)) { TaskSelectionData* selData = ((CSimpleTaskPanel*)GetParent())->GetTaskSelectionData(); if (selData == NULL) return; - + RESULT* result = lookup_result(selData->project_url, selData->result_name); if (result) { CDlgItemProperties dlg(this); @@ -307,7 +307,7 @@ void CSimpleTaskPopupButton::OnTaskShowProperties(wxCommandEvent& WXUNUSED(event } -// CMainDocument::state.lookup_result() does not yield current scheduler_state; +// CMainDocument::state.lookup_result() does not yield current scheduler_state; // we must use CMainDocument::result() for that. RESULT* CSimpleTaskPopupButton::lookup_result(char* url, char* name) { CMainDocument* pDoc = wxGetApp().GetDocument(); diff --git a/clientgui/sg_TaskCommandPopup.h b/clientgui/sg_TaskCommandPopup.h index 0d8396f28e3..5eee3435467 100644 --- a/clientgui/sg_TaskCommandPopup.h +++ b/clientgui/sg_TaskCommandPopup.h @@ -21,22 +21,22 @@ #include "sg_CustomControls.h" -class CSimpleTaskPopupButton : public CTransparentButton +class CSimpleTaskPopupButton : public CTransparentButton { DECLARE_DYNAMIC_CLASS( CSimpleTaskPopupButton ) DECLARE_EVENT_TABLE() public: CSimpleTaskPopupButton(); - - CSimpleTaskPopupButton(wxWindow* parent, wxWindowID id, - const wxString& label = wxEmptyString, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = 0, - const wxValidator& validator = wxDefaultValidator, + + CSimpleTaskPopupButton(wxWindow* parent, wxWindowID id, + const wxString& label = wxEmptyString, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = 0, + const wxValidator& validator = wxDefaultValidator, const wxString& name = wxT("TaskCommandsPopupMenu")); - + ~CSimpleTaskPopupButton(); private: @@ -49,7 +49,7 @@ class CSimpleTaskPopupButton : public CTransparentButton void OnTaskAbort(wxCommandEvent& event); void OnTaskShowProperties(wxCommandEvent& event); RESULT* lookup_result(char* url, char* name); - + protected: wxMenu* m_TaskCommandPopUpMenu; wxMenuItem* m_ShowGraphicsMenuItem; diff --git a/clientgui/sg_TaskPanel.h b/clientgui/sg_TaskPanel.h index cb6e122f593..43e90fbc2ff 100644 --- a/clientgui/sg_TaskPanel.h +++ b/clientgui/sg_TaskPanel.h @@ -40,7 +40,7 @@ typedef struct { /////////////////////////////////////////////////////////////////////////// /// Class CScrolledTextBox /////////////////////////////////////////////////////////////////////////////// -class CScrolledTextBox : public wxScrolledWindow +class CScrolledTextBox : public wxScrolledWindow { DECLARE_DYNAMIC_CLASS( CScrolledTextBox ) DECLARE_EVENT_TABLE() @@ -48,10 +48,10 @@ class CScrolledTextBox : public wxScrolledWindow CScrolledTextBox(); CScrolledTextBox( wxWindow* parent); ~CScrolledTextBox(); - + void SetValue(const wxString& s); virtual void OnEraseBackground(wxEraseEvent& event); - + private: int Wrap(const wxString& text, int widthMax, int *lineHeight); bool IsStartOfNewLine(); @@ -69,7 +69,7 @@ class CScrolledTextBox : public wxScrolledWindow /// Class CSlideShowPanel /////////////////////////////////////////////////////////////////////////////// -class CSlideShowPanel : public wxPanel +class CSlideShowPanel : public wxPanel { DECLARE_DYNAMIC_CLASS( CSlideShowPanel ) DECLARE_EVENT_TABLE() @@ -84,7 +84,7 @@ class CSlideShowPanel : public wxPanel void AdvanceSlideShow(bool changeSlide, bool reload); void OnPaint(wxPaintEvent& WXUNUSED(event)); void OnEraseBackground(wxEraseEvent& event); - + private: CScrolledTextBox* m_description; wxTimer* m_ChangeSlideTimer; @@ -106,7 +106,7 @@ class CSlideShowPanel : public wxPanel #define CBOINCBitmapComboBox wxBitmapComboBox #endif -class CSimpleTaskPanel : public CSimplePanelBase +class CSimpleTaskPanel : public CSimplePanelBase { DECLARE_DYNAMIC_CLASS( CSimpleTaskPanel ) DECLARE_EVENT_TABLE() diff --git a/clientgui/skins/Charity Engine/skin.xml b/clientgui/skins/Charity Engine/skin.xml index f4b9bd28e0e..f7ecf59f9e1 100644 --- a/clientgui/skins/Charity Engine/skin.xml +++ b/clientgui/skins/Charity Engine/skin.xml @@ -33,13 +33,13 @@ workunit_suspended_image.png - + dialog_background_image.png - + project_image.png @@ -79,16 +79,16 @@ 255:0:255 - + 1 Charity Engine https://www.charityengine.com - https://www.charityengine.com/manager_menu.php + https://www.charityengine.com/manager_menu.php - - + + Charity Engine Desktop - Attach to Project @@ -97,9 +97,9 @@ - + - + diff --git a/clientgui/skins/GridRepublic/skin.xml b/clientgui/skins/GridRepublic/skin.xml index 2c6b9f046a1..278f2257f14 100644 --- a/clientgui/skins/GridRepublic/skin.xml +++ b/clientgui/skins/GridRepublic/skin.xml @@ -33,13 +33,13 @@ workunit_suspended_image.png - + dialog_background_image.png - + project_image.png @@ -79,16 +79,16 @@ 255:0:255 - + 1 GridRepublic https://www.gridrepublic.org - https://www.gridrepublic.org/manager_menu.php + https://www.gridrepublic.org/manager_menu.php - - + + GridRepublic Desktop - Attach to Project @@ -100,6 +100,6 @@ - + diff --git a/clientgui/skins/People for a Smarter Planet/skin.xml b/clientgui/skins/People for a Smarter Planet/skin.xml index 41cbda40d8f..91b781ec232 100644 --- a/clientgui/skins/People for a Smarter Planet/skin.xml +++ b/clientgui/skins/People for a Smarter Planet/skin.xml @@ -87,11 +87,11 @@ graphic/project_image.png - - - - - + + + + +