Compare commits

...

70 Commits

Author SHA1 Message Date
dependabot[bot]
4045938bb7
Bump actions/cache from 2.1.7 to 3 (#19) 2022-03-22 15:34:37 +00:00
dependabot[bot]
26c10b8ccc
Bump actions/checkout from 2.4.0 to 3 (#18) 2022-03-22 15:33:15 +00:00
4c18fa3944 👷 Fixed installing build tools 2022-03-22 16:26:08 +01:00
8e2ff6c116 ⬆️ Update qtkeychain to 0.13.2 2021-12-05 16:24:28 +01:00
2408dc32ea 👷 Install qtkeychain from artifactory 2021-12-05 16:24:28 +01:00
dependabot[bot]
0a6c764ce3
Bump actions/cache from 2.1.6 to 2.1.7 (#16) 2021-11-29 15:57:32 +00:00
dependabot[bot]
dc38809146
Bump actions/checkout from 2.3.5 to 2.4.0 (#15) 2021-11-08 15:31:19 +00:00
f308c6845e 📦 Switch to makedeb for packaging deb 2021-10-19 11:07:42 +02:00
bfbb45d5cc 📦 Use NSIS for packaging instead of WiX 2021-10-18 18:24:40 +02:00
7503db9059 🚨 Fixed some clang warnings 2021-10-18 18:24:40 +02:00
dependabot[bot]
25b78bd8d8
Bump actions/checkout from 2.3.4 to 2.3.5 (#12) 2021-10-18 15:10:08 +00:00
dependabot[bot]
f3f98450e8
Bump ilammy/msvc-dev-cmd from 1.9.0 to 1.10.0 (#11) 2021-10-11 16:52:23 +00:00
1417d62374
🌐 Updated translations 2021-09-23 19:36:18 +02:00
081576912e 🎉 Added addremove button 2021-09-23 18:59:55 +02:00
5dc8db6919 🎨 Added clang-format 2021-09-23 16:18:57 +02:00
d6eaf13e78 🌐 Improved translations handling 2021-09-23 14:41:43 +02:00
4564a16841 🔧 Cleanup dist folder 2021-09-23 14:41:43 +02:00
96ac4edc3d 🐛 Fixed PKGBUILD 2021-09-23 10:50:40 +02:00
2fe89789bc 🐛 Fixed missing translations 2021-09-23 10:50:40 +02:00
f34ec61276 🔨 Use system qtkeychain instead of vendoring it 2021-09-23 10:50:40 +02:00
4b91df5f81 📝 Updated Building.md 2021-09-22 10:04:47 +02:00
04ca8bbc7f 📝 Added readme 2021-09-22 10:04:47 +02:00
Weblate
4277cbc700 🌐 Translated using Weblate
Co-authored-by: Edgar <Edgar@AnotherFoxGuy.com>
Co-authored-by: Weblate <noreply@weblate.org>
Translate-URL: https://weblate.anotherfoxguy.com/projects/fuel-scm/fuel-scm/nl/
Translation: fuel-scm/fuel-scm
2021-09-08 13:54:28 +02:00
9983baafa7
🎉 Added Cpack 2021-09-08 10:56:27 +02:00
dependabot[bot]
85bba37e4f
Bump ilammy/msvc-dev-cmd from 1.8.0 to 1.9.0 (#3) 2021-05-30 12:05:47 +00:00
dependabot[bot]
ecbbdd6c0d
Bump actions/cache from 1 to 2.1.6 (#2) 2021-05-30 12:04:28 +00:00
078164838e ⬆️ Update qtkeychain 2021-05-30 14:01:05 +02:00
a1b4487b1e
⬆️ Upgrade QT to 5.13 2019-10-21 15:39:33 +02:00
900746a3e1 🌐 Update translations 2019-07-30 15:10:19 +02:00
124d4feb95 👷 Add translations to deploy 2019-07-30 14:53:08 +02:00
5c17f23f96 👷 Added appveyor 2019-07-30 14:50:32 +02:00
91c8a262d2 🐛 Fixed travis build 2019-07-30 14:28:01 +02:00
26d71d1d50 🐛 Fixed building with QT 5.13 2019-07-27 16:38:53 +02:00
Kostas
a9efcb4c92 Updated travis.yml
FossilOrigin-Name: 6b21c5057dad0036c043e4d57effd5cceb6d2a10
2018-06-10 03:53:32 +00:00
Kostas
e50b97174c Switched to QWebEngineView, so Fuel now requires at least Qt 5.4
FossilOrigin-Name: a4e2ab66866278039d31a13f7ef0ca774bea9cfb
2018-06-09 17:18:50 +00:00
Kostas
d1ed874cdb Updated ChangeLog
FossilOrigin-Name: b8a962d79a02e8488e38f9d1109356f3e67f3440
2015-10-16 09:43:15 +00:00
Kostas
eb150f950b Support for force closing a workspace
FossilOrigin-Name: 16b4d25fe14b5d8a9398db1a31e683382b532473
2015-10-16 09:41:21 +00:00
Kostas
214a2f8deb Refactored Workspace common types into WorkspaceCommon.h
FossilOrigin-Name: f31360bcda14a4137f5aee56ed916c161bcee18d
2015-09-16 14:28:38 +00:00
Kostas
2c50fb54c6 Merged into trunk
FossilOrigin-Name: d3b7048058577931d592aae6c0d9f5949c6f835e
2015-09-16 12:11:53 +00:00
Kostas
a435227232 Minor localization build fixes
FossilOrigin-Name: 2bf7ce4ecb34c22232c7e7db37bb82372093e8b1
2015-09-16 07:59:23 +00:00
Kostas
45740da630 Fixed another QUrl weirdness were urls with empty credentials contained an unnecessary @ before the hostname
FossilOrigin-Name: 9f7b11b9ab0c210395f8aade55e8de0a3d212ae6
2015-09-15 10:39:11 +00:00
Kostas
a71355cbec Renamed Settings.h/.cpp to AppSettings.h/.cpp
FossilOrigin-Name: 96924d1d0700cae5f848c9acf40d2775e2f48db1
2015-09-15 10:10:14 +00:00
Kostas
9c74c3774f Simplified Workspace interface
Removed Workspace::setDefaultRemoteUrl since Fossil::setRemoteUrl is Fossil specific

FossilOrigin-Name: 3a62c3b4808b76d14fd48839f7aba68e4502c6ad
2015-09-14 15:56:27 +00:00
Kostas
9d750f0135 All generic Fossil operations are now encapsulated in Workspace
FossilOrigin-Name: b29c19caa92280f7378e78f0febb56fc4fec7b03
2015-09-14 15:46:16 +00:00
Kostas
1330b2b97a Fixed issue where the RemoteDialog was displaying local paths as Urls when editing existing remotes
FossilOrigin-Name: 96e4a4d8642ec96578155bb8762a1772b9351e3c
2015-09-12 18:34:26 +00:00
Kostas
bf1fc5732a Fixed issue where setting a default remote occasionally fails
FossilOrigin-Name: 6850f2915d4dfb3760de45d7bdb3f8d1c5658dc6
2015-09-12 18:13:03 +00:00
Kostas
1960def1dc Windows: Shift-Right-Click invokes the Explorer folder context menu on Workspace folders
FossilOrigin-Name: ca5602f8b3e7a0eba8e0a8afc1e60f3b4e2d8646
2015-08-28 09:28:04 +00:00
Kostas
be1381e9c7 Also Include "Latest Revision" to the version list of updateRevision
FossilOrigin-Name: e4ee91a2c5ca3e29c020cc31e2e018e69ff76b16
2015-08-27 14:43:06 +00:00
Kostas
be6b875dc6 Added long operation termination button on status bar
More robust process termination
Folded the Abort shortcut into a QAction


FossilOrigin-Name: ea4b656b8237af73b81e6b22fd4c451a51450d2d
2015-08-27 14:30:44 +00:00
Kostas
765aa9a6d8 Fossil::Init now requires a path to the fossil executable
FossilOrigin-Name: ee09b7f597c4ab4b81a24c281ab33893f3c20ed6
2015-08-27 12:00:28 +00:00
Kostas
2541fc79f8 Moved Fossil operation abortion logic to UICallback
FossilOrigin-Name: eaec54a0320c199d5e1133b38acfafa3da82228e
2015-08-27 11:26:04 +00:00
Kostas
89b2db4277 Fossil internal API cleanup
FossilOrigin-Name: ef3e63fb4f82a4a6224f6616f0f70e5546a39243
2015-08-27 11:05:58 +00:00
Kostas
37ba449083 Removed fossil() convenience function
FossilOrigin-Name: 203cc502bcde134935f524fe2dd44a89e228bc62
2015-08-27 09:33:10 +00:00
Kostas
48034e7557 Also address QUrl local-file weirdness in Fossil::setRemoteUrl
FossilOrigin-Name: 7f22404a2284727f7d41d9f00eac2992b6d848f0
2015-08-27 09:22:36 +00:00
Kostas
c7c51a7809 Prevent translation conversion script being called multiple times on Windows
FossilOrigin-Name: b82bb671d80df48d001b639dcf58f6016cc3ab84
2015-08-27 09:11:23 +00:00
Kostas
5a4ed73777 RemoteDialog: Fixed incorrect parsing for local repositories
RemoteDialog/CloneDialog: UI Tweaks



FossilOrigin-Name: 9dd99f7de54ad40a15d80f9bf9af82a367c24302
2015-08-26 21:02:25 +00:00
Kostas
73731923d3 Fixed issue with incosistent UI state when closing a workspace
Simplified workspace refresh logic

FossilOrigin-Name: 2e0cbf44fd99ae2c1155857c79d0c09be9897483
2015-08-26 20:28:00 +00:00
Kostas
dc072a8219 CloneDialog: Fixed incorrect parsing for local repositories
CloneDialog: Fixed incorrect missing suffix detection
We now pass local repository urls as local paths to fossil, in order to overcome buggy behavior of QUrl for Windows paths

FossilOrigin-Name: afa9b2538a0bfa258104a979eadce28c099e9848
2015-08-26 19:56:14 +00:00
Kostas
3d73fa7137 Translation conversion is now automatically called from the project file
Improved the translation converion script on Windows


FossilOrigin-Name: e574454625a7701da9d1959fa72e54036d5ab7c3
2015-08-26 19:45:48 +00:00
Kostas
66695b38bc Added build revision information and clickable links to about box
FossilOrigin-Name: 6c585dffad9f240a390a241dd71f5f2f95f46d49
2015-08-26 09:58:28 +00:00
kostas
a296b622ef Updated Changes.md
FossilOrigin-Name: 3490f7140197453a7a45fea01b93281cf0c8ca3d
2015-08-25 13:07:48 +00:00
kostas
0e902177d4 Updated the Changes.md
FossilOrigin-Name: 8a83bfb691fc72a4208c24b547c9c38fc668ec97
2015-08-23 13:59:15 +00:00
kostas
f60fbc2545 Support for the versionable .fossil-settings/ignore-glob file
FossilOrigin-Name: 511954d6d9c5a74454ffe3bc3e552b93e1cbf985
2015-08-23 13:59:07 +00:00
kostas
b148b86311 OSX: Guess actual executable from the app bundle directory
FossilOrigin-Name: 7988e53166771ea71d916a1ab714eb671d07dea8
2015-08-22 17:32:24 +00:00
kostas
521e0e7d7b Disabled automatically adding Fossil's remote-url to the list of remotes.
FossilOrigin-Name: cb27c4e2a0777b5c3fa64a07d19cd6b89e05c76f
2015-08-22 17:05:26 +00:00
kostas
0200f4b7b4 Somewhat better Log/Browser TabBar on OSX
FossilOrigin-Name: aea2b8b8985d6b40aff4b53eeaa485702c674658
2015-08-22 16:35:10 +00:00
kostas
cf66ce260e Added space to the right side of the searchbox
FossilOrigin-Name: 39572229e93c1a8b63a0e7ed48a1bbe14e67c53c
2015-08-22 14:52:43 +00:00
kostas
6c3ad4001c Improved the look of the UI on OSX
FossilOrigin-Name: 08496c56dbe49392c45a50d4bac5621d61b96e84
2015-08-22 14:13:47 +00:00
kostas
abd223076c Fixed OSX linker errors
FossilOrigin-Name: d9a15280f162ca92b6d65c41033d43890d306779
2015-08-22 11:40:53 +00:00
kostas
1efc307718 Fixed incorrect command splitting for custom actions
FossilOrigin-Name: 29c6a41585bad0bf9f506ea3ba148bb3ad3a2dca
2015-08-22 11:04:16 +00:00
114 changed files with 17684 additions and 14161 deletions

25
.clang-format Normal file
View File

@ -0,0 +1,25 @@
Language: Cpp
AccessModifierOffset: -4
AllowShortFunctionsOnASingleLine: Inline
AllowShortIfStatementsOnASingleLine: false
AllowShortLambdasOnASingleLine: Empty
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakBeforeMultilineStrings: false
BasedOnStyle: Microsoft
BreakBeforeBraces: Allman
BreakConstructorInitializers: AfterColon
BreakInheritanceList: AfterColon
ColumnLimit: 200
ConstructorInitializerAllOnOneLineOrOnePerLine: false
FixNamespaceComments: true
IndentCaseLabels: true
IndentWidth: 4
IndentWrappedFunctionNames: true
IndentPPDirectives: AfterHash
IncludeBlocks: Preserve
NamespaceIndentation: Inner
SpacesBeforeTrailingComments: 2
Standard: Auto
ReflowComments: false

View File

@ -0,0 +1 @@
on

8
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,8 @@
# Set update schedule for GitHub Actions
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every weekday
interval: "weekly"

92
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,92 @@
---
name: Build
on: [push, pull_request]
jobs:
build-msvc:
name: Build Windows
runs-on: windows-latest
env:
BUILD_TOOLS_PATH: C:\apps\build-tools\
steps:
- run: echo $env:BUILD_TOOLS_PATH | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- uses: actions/checkout@v3
with:
submodules: true
- name: Install Build tools
shell: cmake -P {0}
run: |
file(MAKE_DIRECTORY $ENV{BUILD_TOOLS_PATH})
file(DOWNLOAD https://cdn.anotherfoxguy.com/build-tools.zip "$ENV{TMP}/build-tools.zip" SHOW_PROGRESS)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf "$ENV{TMP}/build-tools.zip" WORKING_DIRECTORY "$ENV{BUILD_TOOLS_PATH}")
- name: Enable Developer Command Prompt
uses: ilammy/msvc-dev-cmd@v1.10.0
- name: Cache conan packages
uses: actions/cache@v3
with:
key: win-conan-${{ hashFiles('**/conanfile.txt') }}
path: ~/.conan/
- name: Cache Qt
id: cache-qt
uses: actions/cache@v3
with:
path: "${{ github.workspace }}/qt/"
key: ${{ runner.os }}-QtCache
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
cached: ${{ steps.cache-qt.outputs.cache-hit }}
modules: qtwebengine
dir: "${{ github.workspace }}/qt/"
- name: Add conan remote
run: conan remote add fuel-scm https://artifactory.anotherfoxguy.com/artifactory/api/conan/fuel-scm -f
- name: Build
run: |
mkdir build
cd build
conan install .. --build=missing
cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=redist ..
ninja
shell: cmd
- name: Install
run: |
cd build
ninja install
shell: cmd
- name: Upload redist folder
uses: actions/upload-artifact@v2
with:
name: fuel-win
path: build/redist
build-gcc:
name: Build Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: true
- name: Install qt
run: |
sudo apt-get update
sudo apt-get install qt5keychain-dev qtwebengine5-dev qttools5-dev -y
- name: Build
run: |
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j4
shell: bash

48
.gitignore vendored Normal file
View File

@ -0,0 +1,48 @@
# C++ objects and libs
*.slo
*.lo
*.o
*.a
*.la
*.lai
*.so
*.dll
*.dylib
# Qt-es
object_script.*.Release
object_script.*.Debug
*_plugin_import.cpp
/.qmake.cache
/.qmake.stash
*.pro.user
*.pro.user.*
*.qbs.user
*.qbs.user.*
*.moc
moc_*.cpp
moc_*.h
qrc_*.cpp
ui_*.h
*.qmlc
*.jsc
Makefile*
*build-*
# Qt unit tests
target_wrapper.*
# QtCreator
*.autosave
# QtCreator Qml
*.qmlproject.user
*.qmlproject.user.*
# QtCreator CMake
CMakeLists.txt.user*
*.qm
/build*
.idea/
test-pr

View File

@ -1,10 +0,0 @@
before_install:
- sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa
- sudo apt-get update -qq
- sudo apt-get install qtbase5-dev qtdeclarative5-dev libqt5webkit5-dev libsqlite3-dev qt5-default qttools5-dev-tools
script:
- intl/convert.sh
- qmake -project
- qmake fuel.pro
- make

244
CMakeLists.txt Normal file
View File

@ -0,0 +1,244 @@
cmake_minimum_required(VERSION 3.10)
if (${CMAKE_VERSION} VERSION_GREATER "3.14")
cmake_policy(SET CMP0087 NEW)
endif ()
set(CMAKE_MODULE_PATH "${CMAKE_BINARY_DIR}" ${CMAKE_MODULE_PATH})
include(FeatureSummary)
# Setup paths
SET(RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin/")
SET(LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/")
SET(ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/")
SET(EXECUTABLE_OUTPUT_PATH ${RUNTIME_OUTPUT_DIRECTORY})
SET(LIBRARY_OUTPUT_PATH ${RUNTIME_OUTPUT_DIRECTORY})
# Fix executable paths for windows
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${RUNTIME_OUTPUT_DIRECTORY})
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${RUNTIME_OUTPUT_DIRECTORY})
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${RUNTIME_OUTPUT_DIRECTORY})
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${RUNTIME_OUTPUT_DIRECTORY})
project(Fuel VERSION "2.0.0")
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOUIC_SEARCH_PATHS "${CMAKE_SOURCE_DIR}/ui")
find_package(Qt5 COMPONENTS Core Gui WebEngineWidgets REQUIRED)
find_package(Qt5Keychain REQUIRED)
set(FORMS
ui/MainWindow.ui
ui/CommitDialog.ui
ui/FileActionDialog.ui
ui/SettingsDialog.ui
ui/FslSettingsDialog.ui
ui/CloneDialog.ui
ui/BrowserWidget.ui
ui/RevisionDialog.ui
ui/RemoteDialog.ui
ui/AboutDialog.ui)
set(SOURCES
src/main.cpp
src/MainWindow.cpp
src/CommitDialog.cpp
src/FileActionDialog.cpp
src/SettingsDialog.cpp
src/FslSettingsDialog.cpp
src/CloneDialog.cpp
src/RevisionDialog.cpp
src/Utils.cpp
src/FileTableView.cpp
src/LoggedProcess.cpp
src/BrowserWidget.cpp
src/CustomWebView.cpp
src/Fossil.cpp
src/Workspace.cpp
src/SearchBox.cpp
src/AppSettings.cpp
src/RemoteDialog.cpp
src/AboutDialog.cpp)
set(HEADERS
src/MainWindow.h
src/CommitDialog.h
src/FileActionDialog.h
src/SettingsDialog.h
src/FslSettingsDialog.h
src/CloneDialog.h
src/RevisionDialog.h
src/Utils.h
src/FileTableView.h
src/LoggedProcess.h
src/BrowserWidget.h
src/CustomWebView.h
src/Fossil.h
src/Workspace.h
src/SearchBox.h
src/AppSettings.h
src/RemoteDialog.h
src/AboutDialog.h
src/WorkspaceCommon.h)
set(RESOURCES
rsrc/resources.qrc)
set(TRANSLATIONS
intl/en_US.ts
intl/el_GR.ts
intl/de_DE.ts
intl/es_ES.ts
intl/fr_FR.ts
intl/ru_RU.ts
intl/pt_PT.ts
intl/it_IT.ts
intl/nl_NL.ts
intl/ko_KR.ts)
find_package(Qt5LinguistTools)
if (Qt5LinguistTools_FOUND)
set_source_files_properties(${TRANSLATIONS} PROPERTIES OUTPUT_LOCATION "intl")
qt5_create_translation(QM_MESSAGES ${CMAKE_SOURCE_DIR}/ui ${CMAKE_SOURCE_DIR}/src ${TRANSLATIONS})
qt5_add_translation(QM_FILES ${TRANSLATIONS})
add_custom_target(messages DEPENDS ${QM_MESSAGES})
add_custom_target(translations DEPENDS ${QM_FILES} messages)
file(COPY rsrc/languages.qrc DESTINATION ${CMAKE_BINARY_DIR}/intl)
list(APPEND RESOURCES "${CMAKE_BINARY_DIR}/intl/languages.qrc")
else ()
message("Qt5LinguistTools not found")
endif ()
if (WIN32)
# clang-cl doesn't support resource files
if (NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
list(APPEND SOURCES "${CMAKE_SOURCE_DIR}/rsrc/fuel.rc")
endif ()
elseif (APPLE)
list(APPEND SOURCES "${CMAKE_SOURCE_DIR}/rsrc/icons/fuel.icns")
endif ()
add_executable(
${PROJECT_NAME}
${FORMS}
${HEADERS}
${SOURCES}
${QM_FILES}
${RESOURCES}
)
target_include_directories(
${PROJECT_NAME} PUBLIC ${CMAKE_SOURCE_DIR}
${CMAKE_SOURCE_DIR}/ui/
${CMAKE_SOURCE_DIR}/src/
)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5::Widgets Qt5::WebEngineCore Qt5::WebEngineWidgets)
if (TARGET Qt5Keychain::Qt5Keychain)
target_link_libraries(${PROJECT_NAME} PRIVATE Qt5Keychain::Qt5Keychain)
else ()
target_link_libraries(${PROJECT_NAME} PRIVATE qt5keychain)
endif ()
target_compile_definitions(${PROJECT_NAME} PRIVATE FUEL_VERSION="${PROJECT_VERSION}")
if (Qt5LinguistTools_FOUND)
add_dependencies(${PROJECT_NAME} translations)
endif ()
# ------------------------------------------------------------------------------------------------#
# Cpack
# ------------------------------------------------------------------------------------------------#
include(GNUInstallDirs)
include(FetchContent)
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "${PROJECT_NAME}")
set(CPACK_PACKAGE_NAME "${PROJECT_NAME}")
set(CPACK_PACKAGE_VENDOR "${PROJECT_NAME}")
set(CPACK_PACKAGE_DESCRIPTION "A GUI front-end for the Fossil SCM")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "A GUI front-end for the Fossil SCM")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/rsrc/license.rtf")
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
set(CPACK_PACKAGE_EXECUTABLES "${PROJECT_NAME}" "${PROJECT_NAME}")
set(CPACK_GENERATOR ZIP)
if (WIN32)
set_target_properties(${PROJECT_NAME} PROPERTIES WIN32_EXECUTABLE TRUE)
get_target_property(Qt5_Core_Location Qt5::Core LOCATION)
get_filename_component(QT_BIN_DIR ${Qt5_Core_Location} DIRECTORY)
# Fix for windeployqt not being able to find qt5keychain
if (EXISTS ${RUNTIME_OUTPUT_DIRECTORY}/qt5keychain.dll AND NOT EXISTS ${QT_BIN_DIR}/qt5keychain.dll)
message("Copying ${RUNTIME_OUTPUT_DIRECTORY}/qt5keychain.dll to ${QT_BIN_DIR}")
file(COPY ${RUNTIME_OUTPUT_DIRECTORY}/qt5keychain.dll DESTINATION ${QT_BIN_DIR})
endif ()
add_custom_target(
copy_dll
COMMAND ${QT_BIN_DIR}/windeployqt.exe $<TARGET_FILE:${PROJECT_NAME}> --release --no-compiler-runtime --no-opengl-sw
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
)
install(
TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION .
)
install(CODE "execute_process(COMMAND ${QT_BIN_DIR}/windeployqt.exe $<TARGET_FILE:${PROJECT_NAME}> --release --no-opengl-sw --dir \${CMAKE_INSTALL_PREFIX})")
FetchContent_Declare(
fossil
URL https://fossil-scm.org/home/uv/fossil-w64-2.17.zip
URL_MD5 f62b6e28846871741e057cfd09acdfc8
)
FetchContent_MakeAvailable(fossil)
install(
PROGRAMS ${fossil_SOURCE_DIR}/fossil.exe
DESTINATION .
COMPONENT Fossil
EXCLUDE_FROM_ALL
)
# For Windows Desktop shortcuts
set(CPACK_CREATE_DESKTOP_LINKS "${PROJECT_NAME}" "${PROJECT_NAME}")
set(CPACK_NSIS_EXECUTABLES_DIRECTORY ".")
set(CPACK_NSIS_MODIFY_PATH "ON")
set(CPACK_NSIS_HELP_LINK "https://fuel-scm.org")
set(CPACK_NSIS_URL_INFO_ABOUT "https://fuel-scm.org")
SET(CPACK_NSIS_INSTALLED_ICON_NAME "Fuel.exe")
SET(CPACK_NSIS_MUI_ICON "${CMAKE_SOURCE_DIR}/rsrc/icons/fuel.ico")
SET(CPACK_NSIS_MUI_UNIICON "${CMAKE_SOURCE_DIR}/rsrc/icons/fuel.ico")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}")
set(CPACK_GENERATOR ${CPACK_GENERATOR} NSIS)
set(CPACK_MODULE_PATH "")
endif ()
if (UNIX)
install(
TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
install(
FILES ${CMAKE_SOURCE_DIR}/rsrc/fuel.desktop
DESTINATION ${CMAKE_INSTALL_DATADIR}/applications/
)
install(
FILES ${CMAKE_SOURCE_DIR}/rsrc/icons/fuel.png
DESTINATION ${CMAKE_INSTALL_DATADIR}/pixmaps/
)
endif ()
include(CPack)
feature_summary(WHAT ALL)

42
README.md Normal file
View File

@ -0,0 +1,42 @@
Fuel
---------
Fuel is cross-platform GUI front-end for the excellent <a href="http://fossil-scm.org">Fossil</a> SCM tool written in Qt. Fuel runs on Windows, OSX as well as various flavors of Unix including Linux and FreeBSD.
### What does it look like? (V2.0.0 Beta)
![Fuel-2.0.0-Beta-Win](/doc/Fuel-2.0.0-Beta-Win.jpg)
## Status
Currently the following Fossil operations are supported
#### Repositories
* Create
* Clone
* Push/Pull
* Timeline View (via fossil ui)
* Multiple Remotes (Version 2)
* Branches (Version 2)
* Tags (Version 2)
* Stashes
#### Files
* Commit
* Add
* Remove
* Rename, including folders
* Revert
* Diff
* Stash
* History (via fossil ui)
## Translation Project
Do you use Fuel a lot but would prefer if it spoke your language? Help by submitting a translation for your language.
Click <a href="https://weblate.anotherfoxguy.com/engage/fuel-scm/">here</a>
and help make Fuel better.
### Realtime Translation Stats
<a href="https://weblate.anotherfoxguy.com/engage/fuel-scm/">
<img src="https://weblate.anotherfoxguy.com/widgets/fuel-scm/-/fuel-scm/multi-auto.svg" alt="Translation status" />
</a>

11
conanfile.txt Normal file
View File

@ -0,0 +1,11 @@
[requires]
qtkeychain/0.13.2
[generators]
qmake
cmake_find_package
[imports]
bin, *.dll -> ./bin @ keep_path=False
share, *.qm -> ./bin/translations @ keep_path=False
lib, *.so* -> ./bin @ keep_path=False

8
debian/changelog vendored
View File

@ -1,8 +0,0 @@
fuel (1.0.0-1) unstable; urgency=low
* Feature: Long Operations can now be aborted by pressing the Escape key
* Improvement: Better support for commit messages with international characters
* Improvement: Fossil queries about CR/NL inconsistencies are now handled better
* Improvement: Files in Conflicted state are now shown
* Added localisations: Russia, Portuguese
-- Kostas <karanikolas@gmail.com> Sat, 28 Mar 2015 12:00:00 +0200

1
debian/compat vendored
View File

@ -1 +0,0 @@
9

17
debian/control vendored
View File

@ -1,17 +0,0 @@
Source: fuel
Section: x11
Priority: optional
Maintainer: Kostas Karanikolas <karanikolas@gmail.com>
Build-Depends: cdbs, debhelper (>= 8.0.0), qtbase5-dev, qttools5-dev-tools,
libqt5webkit5-dev
Standards-Version: 3.9.4
Homepage: http://fuelscm.org
#Vcs-Git: git://git.debian.org/collab-maint/fuel.git
#Vcs-Browser: http://git.debian.org/?p=collab-maint/fuel.git;a=summary
Package: fuel
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Recommends: fossil
Description: Fossil SCM GUI
Fuel is cross-platform GUI front-end for the Fossil SCM tool written in Qt.

38
debian/copyright vendored
View File

@ -1,38 +0,0 @@
Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: fuel
Source: <url://example.com>
Files: *
Copyright: <years> <put author's name and email here>
<years> <likewise for another author>
License: <special license>
<Put the license of the package here indented by 1 space>
<This follows the format of Description: lines in control file>
.
<Including paragraphs>
# If you want to use GPL v2 or later for the /debian/* files use
# the following clauses, or change it to suit. Delete these two lines
Files: debian/*
Copyright: 2014 Kostas <kostas@unknown>
License: GPL-2+
This package is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.
This package 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 General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
# Please also look if there are files or directories which have a
# different copyright/license attached and list them here.
# Please avoid to pick license terms that are more restrictive than the
# packaged work, as it may make Debian's contributions unacceptable upstream.

1
debian/fuel.install vendored
View File

@ -1 +0,0 @@
rsrc/icons/fuel.png usr/share/pixmaps

6
debian/menu vendored
View File

@ -1,6 +0,0 @@
?package(fuel):\
needs="X11"\
section="Applications/File Management"\
title="Fuel"\
icon32x32="/usr/share/pixmaps/fuel.png"\
command="/usr/bin/fuel"

6
debian/rules vendored
View File

@ -1,6 +0,0 @@
#!/usr/bin/make -f
# -*- makefile -*-
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/qmake.mk

View File

@ -1 +0,0 @@
3.0 (quilt)

24
debian/watch vendored
View File

@ -1,24 +0,0 @@
# Example watch control file for uscan
# Rename this file to "watch" and then you can run the "uscan" command
# to check for upstream updates and more.
# See uscan(1) for format
# Compulsory line, this is a version 3 file
version=3
# Uncomment to examine a Webpage
# <Webpage URL> <string match>
#http://www.example.com/downloads.php fuel-(.*)\.tar\.gz
http://fuelscm.org/files/releases fuel-(.*)\.tar\.gz
# Uncomment to examine a Webserver directory
#http://www.example.com/pub/fuel-(.*)\.tar\.gz
# Uncommment to examine a FTP server
#ftp://ftp.example.com/pub/fuel-(.*)\.tar\.gz debian uupdate
# Uncomment to find new files on sourceforge, for devscripts >= 2.9
# http://sf.net/fuel/fuel-(.*)\.tar\.gz
# Uncomment to find new files on GooglePages
# http://example.googlepages.com/foo.html fuel-(.*)\.tar\.gz

27
dist/arch-git/PKGBUILD vendored Normal file
View File

@ -0,0 +1,27 @@
# Maintainer: Edgar <Edgar{at}AnotherFoxGuy.com>
pkgname=fuel-git
pkgver=2.0.0
pkgrel=1
pkgdesc="A GUI front-end to Fossil SCM"
arch=(i686 x86_64)
url="https://fuel-scm.org/"
license=('GPL2')
depends=('qt5-base>=5.4.0' 'qt5-webengine>=5.4.0' 'fossil' 'qtkeychain-qt5')
makedepends=('git' 'cmake')
source=("git://github.com/AnotherFoxGuy/fuel-scm")
md5sums=('SKIP')
build() {
cd "$srcdir/fuel-scm"
[ -d build ] && rm -r build
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ..
make
}
package() {
cd "$srcdir/fuel-scm/build"
make DESTDIR="${pkgdir}" install
}

17
dist/arch/PKGBUILD vendored
View File

@ -1,27 +1,26 @@
# Maintainer: Kostas Karanikolas <lastname[at]gmail[dot]com>
# Maintainer: Edgar <Edgar{at}AnotherFoxGuy.com>
pkgname=fuel
pkgver=1.0.0
pkgrel=3
pkgver=2.0.0
pkgrel=1
pkgdesc="A GUI front-end to Fossil SCM"
arch=(i686 x86_64)
url="https://fuel-scm.org/"
license=('GPL2')
depends=('qt5-base>=5.4.0', 'qt5-webkit>=5.4.0' 'fossil')
depends=('qt5-base>=5.4.0', 'qt5-webkit>=5.4.0', 'fossil', 'qtkeychain-qt5')
source=("https://fuel-scm.org/files/releases/${pkgname}-${pkgver}.tar.gz")
sha256sums=('034593d16eba9e30a73d1b40bfd4f1a7f9ba438a04dc07cc7bb2cd2202da40fc') # Generate with 'makepkg -g'
build() {
cd "${srcdir}"
cd "$srcdir"
[ -d build ] && rm -r build
mkdir build
cd build
qmake-qt5 "${srcdir}/${pkgname}-${pkgver}/fuel.pro"
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ..
make
}
package() {
cd "${srcdir}/build"
make INSTALL_ROOT="${pkgdir}" install
cd "$srcdir/build"
make DESTDIR="${pkgdir}" install
}

27
dist/makedeb/PKGBUILD vendored Normal file
View File

@ -0,0 +1,27 @@
# Maintainer: Edgar <Edgar{at}AnotherFoxGuy.com>
pkgname=fuel-git
pkgver=2.0.0
pkgrel=1
pkgdesc="A GUI front-end to Fossil SCM"
arch=(i686 x86_64)
url="https://fuel-scm.org/"
license=('GPL2')
depends=('qtbase5-dev' 'qtwebengine5-dev' 'qttools5-dev' 'fossil' 'qt5keychain-dev')
makedepends=('git' 'cmake')
source=("git://github.com/AnotherFoxGuy/fuel-scm")
md5sums=('SKIP')
build() {
cd "$srcdir/fuel-scm"
[ -d build ] && rm -r build
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr ..
make -j$(nproc)
}
package() {
cd "$srcdir/fuel-scm/build"
make DESTDIR="${pkgdir}" install
}

53
dist/win/fuel.iss vendored
View File

@ -1,53 +0,0 @@
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Fuel"
#define MyAppVersion "0.9.6"
#define MyAppPublisher "Kostas Karanikolas"
#define MyAppURL "http://fuel-scm.org/"
#define MyAppExeName "Fuel.exe"
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{2B36FB79-7AD8-4864-AE6B-61D1E7A0D2FD}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
DisableProgramGroupPage=yes
LicenseFile=..\..\doc\License.txt
OutputDir=build
OutputBaseFilename={#MyAppName}-{#MyAppVersion}
Compression=lzma
SolidCompression=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "..\..\..\fuel-build-desktop\release\Fuel.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\..\fuel-build-desktop\release\fossil.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\..\fuel-build-desktop\release\libgcc_s_dw2-1.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\..\fuel-build-desktop\release\mingwm10.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\..\fuel-build-desktop\release\QtCore4.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "..\..\..\fuel-build-desktop\release\QtGui4.dll"; DestDir: "{app}"; Flags: ignoreversion
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, "&", "&&")}}"; Flags: nowait postinstall skipifsilent

View File

@ -3,7 +3,7 @@ Building from Source
Prerequisites
-------------------------------------------------------------------------------
Building Fuel from source requires Qt version 4 or 5. Qt is available at:
Building Fuel from source requires Qt version 5. Qt is available at:
http://www.qt.io/download-open-source/
To run Fuel a compiled binary of Fossil must be available either in the system
@ -25,7 +25,7 @@ Additionally you can clone the source code directly from our site using fossil
fossil open fuel.fossil
Windows (Qt4 / MinGW)
Windows (Qt5 / MinGW)
-------------------------------------------------------------------------------
1. Open a Command Prompt and cd into the folder containing the Fuel source code
@ -36,26 +36,20 @@ Windows (Qt4 / MinGW)
md build
cd build
3. Generate the makefile with qmake
3. Generate the makefile with cmake
C:\QtSDK\Desktop\Qt\4.8.1\mingw\bin\qmake ..\fuel.pro -r -spec win32-g++ CONFIG+=release
cmake -DCMAKE_BUILD_TYPE=Release ..
4. Build the project
c:\QtSDK\mingw\bin\mingw32-make
make -j6
5. Copy the Qt DLLs
copy C:\QtSDK\Desktop\Qt\4.8.1\mingw\bin\QtCore4.dll release
copy C:\QtSDK\Desktop\Qt\4.8.1\mingw\bin\QtGui4.dll release
6. Copy the MinGW DLLs
copy C:\QtSDK\mingw\bin\libgcc_s_dw2-1.dll release
copy C:\QtSDK\mingw\bin\mingwm10.dll release
make copy_dll
Windows (Qt4 / MSVC)
Windows (Qt5 / MSVC)
-------------------------------------------------------------------------------
1. Open a Command Prompt and cd into the folder containing the Fuel source code
@ -66,9 +60,9 @@ Windows (Qt4 / MSVC)
md build
cd build
3. Generate the Visual Studio project makefile with qmake
3. Generate the Visual Studio project makefile with cmake
C:\QtSDK\Desktop\Qt\4.8.1\msvc2010\bin\qmake ..\fuel.pro -tp vc -spec win32-msvc2010
cmake ..
4. Open the generated project
@ -77,16 +71,16 @@ Windows (Qt4 / MSVC)
5. Build the project
Use the IDE to build the project or alternatively you can use via MSBuild
c:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild Fuel.vcxproj /t:build /p:Configuration=Release
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
msbuild /p:Configuration=Release /m Fuel.vcxproj
6. Copy the Qt DLLs
copy C:\QtSDK\Desktop\Qt\4.8.1\msvc2010\bin\QtCore4.dll release
copy C:\QtSDK\Desktop\Qt\4.8.1\msvc2010\bin\QtGui4.dll release
msbuild /p:Configuration=Release copy_dll.vcxproj
4. Enjoy
release\Fuel.exe
bin\Fuel.exe
Mac OS X
@ -101,17 +95,13 @@ Build Steps:
cd fuel
3. Generate localization files
3. Generate the makefile with cmake
intl/convert.sh
4. Generate the makefile with qmake
qmake fuel.pro -spec macx-clang CONFIG+=release
cmake -DCMAKE_BUILD_TYPE=Release ..
5. Build the project
make
make -j6
6. (Optional) Include the Fossil executable within the Fuel application bundle
@ -134,19 +124,20 @@ Build Steps:
cd fuel
2. Generate localization files
2. Make a build folder and cd into it
intl/convert.sh
md build
cd build
3. Generate the makefile with qmake
3. Generate the makefile with cmake
qmake fuel.pro
cmake -DCMAKE_BUILD_TYPE=Release ..
4. Build the project
make
make -j6
5. Enjoy
./Fuel
bin/Fuel

View File

@ -21,19 +21,26 @@ Fuel V2.0.0 (2015-XX-XX)
status of their contents, including missing folders
- Feature: Support for multiple file user-actions
- Feature: Double-Click action also allows user actions
- Feature: Support for the versionable .fossil-settings/ignore-glob
- Feature: OSX: UI improvements
- Feature: OSX: Improved external application selection for application bundles
- Feature: Long operations can now be aborted via a button on the status bar
- Feature: Windows: Shift-Right-Click invokes the Explorer folder context menu on
Workspace folders
- Feature: Support for force closing a workspace
- Misc: Reorganised menu structure.
- Misc: Separated Fuel and Fossil settings
- Bug Fix: Retain the folder tree state when refreshing the workspace
- Bug Fix: Fixed issue with the expanding width of the commit dialog
- Major internal refactoring
Fuel V1.0.1 (2015-08-XX)
Fuel V1.0.1 (2015-08-23)
--------------------------------------------------------------------------------
- Reformated Docs into Markdown
- Added Localisations:
- Italian (Thanks maxxlupi and Zangune)
- Dutch (Thanks Rick Van Lieshout and Fly Man)
- Korean (Thanks ardiefox)
- Reformated Docs into Markdown
Fuel V1.0.0 (2015-03-28)
--------------------------------------------------------------------------------

BIN
doc/Fuel-2.0.0-Beta-Win.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

View File

@ -1,195 +0,0 @@
cmake_minimum_required(VERSION 2.8)
project(qtkeychain)
###
set(QTKEYCHAIN_VERSION 0.5.90)
set(QTKEYCHAIN_SOVERSION 0)
###
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${PROJECT_SOURCE_DIR}/cmake/Modules")
include(GNUInstallDirs)
option(BUILD_WITH_QT4 "Build qtkeychain with Qt4 no matter if Qt5 was found" OFF)
if( NOT BUILD_WITH_QT4 )
# try Qt5 first, and prefer that if found
find_package(Qt5Core QUIET)
endif()
if (Qt5Core_FOUND)
set(QTKEYCHAIN_VERSION_INFIX 5)
if(UNIX AND NOT APPLE)
find_package(Qt5DBus REQUIRED)
include_directories(${Qt5DBus_INCLUDE_DIRS})
set(QTDBUS_LIBRARIES ${Qt5DBus_LIBRARIES})
macro(qt_add_dbus_interface)
qt5_add_dbus_interface(${ARGN})
endmacro()
endif()
find_package(Qt5LinguistTools REQUIRED)
macro(qt_add_translation)
qt5_add_translation(${ARGN})
endmacro(qt_add_translation)
macro(qt_create_translation)
qt5_create_translation(${ARGN})
endmacro(qt_create_translation)
macro(qt_wrap_cpp)
qt5_wrap_cpp(${ARGN})
endmacro()
set(QTCORE_LIBRARIES ${Qt5Core_LIBRARIES})
include_directories(${Qt5Core_INCLUDE_DIRS})
if (Qt5_POSITION_INDEPENDENT_CODE)
if (CMAKE_VERSION VERSION_LESS 2.8.9) # TODO remove once we increase the cmake requirement
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
else()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
endif()
else()
set(QTKEYCHAIN_VERSION_INFIX "")
if(UNIX AND NOT APPLE)
find_package(Qt4 COMPONENTS QtCore QtDBus REQUIRED)
set(QTDBUS_LIBRARIES ${QT_QTDBUS_LIBRARY})
macro(qt_add_dbus_interface)
qt4_add_dbus_interface(${ARGN})
endmacro()
else()
find_package(Qt4 COMPONENTS QtCore REQUIRED)
endif()
include_directories(${QT_INCLUDES})
set(QTCORE_LIBRARIES ${QT_QTCORE_LIBRARY})
macro(qt_add_translation)
qt4_add_translation(${ARGN})
endmacro(qt_add_translation)
macro(qt_create_translation)
qt4_create_translation(${ARGN})
endmacro(qt_create_translation)
macro(qt_wrap_cpp)
qt4_wrap_cpp(${ARGN})
endmacro()
endif()
include_directories(${CMAKE_CURRENT_BINARY_DIR})
list(APPEND qtkeychain_LIBRARIES ${QTCORE_LIBRARIES})
set(qtkeychain_SOURCES
keychain.cpp
)
ADD_DEFINITIONS( -Wall )
if(WIN32)
list(APPEND qtkeychain_SOURCES keychain_win.cpp)
list(APPEND qtkeychain_LIBRARIES crypt32)
#FIXME: mingw bug; otherwise getting undefined refs to RtlSecureZeroMemory there
if(MINGW)
add_definitions( -O2 )
endif()
endif()
if(APPLE)
list(APPEND qtkeychain_SOURCES keychain_mac.cpp)
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
list(APPEND qtkeychain_LIBRARIES ${COREFOUNDATION_LIBRARY})
find_library(SECURITY_LIBRARY Security)
list(APPEND qtkeychain_LIBRARIES ${SECURITY_LIBRARY})
endif()
if(UNIX AND NOT APPLE)
list(APPEND qtkeychain_SOURCES keychain_unix.cpp gnomekeyring.cpp)
qt_add_dbus_interface(qtkeychain_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/org.kde.KWallet.xml kwallet_interface KWalletInterface)
list(APPEND qtkeychain_LIBRARIES ${QTDBUS_LIBRARIES})
endif()
QT_WRAP_CPP(qtkeychain_MOC_OUTFILES keychain.h keychain_p.h)
set(qtkeychain_TR_FILES
translations/qtkeychain_de.ts
translations/qtkeychain_ro.ts
)
file(GLOB qtkeychain_TR_SOURCES *.cpp *.h *.ui)
qt_create_translation(qtkeychain_MESSAGES ${qtkeychain_TR_SOURCES} ${qtkeychain_TR_FILES})
qt_add_translation(qtkeychain_QM_FILES ${qtkeychain_TR_FILES})
add_custom_target(messages DEPENDS ${qtkeychain_MESSAGES})
add_custom_target(translations DEPENDS ${qtkeychain_QM_FILES})
if(NOT QT_TRANSLATIONS_DIR)
# If this directory is missing, we are in a Qt5 environment.
# Extract the qmake executable location
get_target_property(QT5_QMAKE_EXECUTABLE Qt5::qmake IMPORTED_LOCATION)
# Ask Qt5 where to put the translations
execute_process( COMMAND ${QT5_QMAKE_EXECUTABLE} -query QT_INSTALL_TRANSLATIONS
OUTPUT_VARIABLE qt_translations_dir OUTPUT_STRIP_TRAILING_WHITESPACE )
# make sure we have / and not \ as qmake gives on windows
FILE(TO_CMAKE_PATH "${qt_translations_dir}" qt_translations_dir)
SET(QT_TRANSLATIONS_DIR ${qt_translations_dir} CACHE PATH "The
location of the Qt translations" FORCE)
endif()
install(FILES ${qtkeychain_QM_FILES}
DESTINATION ${QT_TRANSLATIONS_DIR})
set(QTKEYCHAIN_TARGET_NAME qt${QTKEYCHAIN_VERSION_INFIX}keychain)
if(NOT QTKEYCHAIN_STATIC)
add_library(${QTKEYCHAIN_TARGET_NAME} SHARED ${qtkeychain_SOURCES} ${qtkeychain_MOC_OUTFILES} ${qtkeychain_QM_FILES})
set_target_properties(${QTKEYCHAIN_TARGET_NAME} PROPERTIES COMPILE_DEFINITIONS QKEYCHAIN_BUILD_QKEYCHAIN_LIB)
target_link_libraries(${QTKEYCHAIN_TARGET_NAME} ${qtkeychain_LIBRARIES})
else()
add_library(${QTKEYCHAIN_TARGET_NAME} STATIC ${qtkeychain_SOURCES} ${qtkeychain_MOC_OUTFILES} ${qtkeychain_QM_FILES})
set_target_properties(${QTKEYCHAIN_TARGET_NAME} PROPERTIES COMPILE_DEFINITIONS QKEYCHAIN_STATICLIB)
endif()
set_target_properties(${QTKEYCHAIN_TARGET_NAME} PROPERTIES
VERSION ${QTKEYCHAIN_VERSION}
SOVERSION ${QTKEYCHAIN_SOVERSION}
MACOSX_RPATH 1
INSTALL_NAME_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}"
)
install(FILES keychain.h qkeychain_export.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/qt${QTKEYCHAIN_VERSION_INFIX}keychain/
)
install(TARGETS ${QTKEYCHAIN_TARGET_NAME}
EXPORT Qt${QTKEYCHAIN_VERSION_INFIX}KeychainLibraryDepends
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
add_executable( testclient testclient.cpp )
target_link_libraries( testclient ${QTKEYCHAIN_TARGET_NAME})
###
### CMake config file
###
export(TARGETS ${QTKEYCHAIN_TARGET_NAME} FILE "${PROJECT_BINARY_DIR}/Qt${QTKEYCHAIN_VERSION_INFIX}KeychainLibraryDepends.cmake")
export(PACKAGE Qt${QTKEYCHAIN_VERSION_INFIX}Keychain)
configure_file(QtKeychainBuildTreeSettings.cmake.in
"${PROJECT_BINARY_DIR}/Qt${QTKEYCHAIN_VERSION_INFIX}KeychainBuildTreeSettings.cmake" @ONLY)
configure_file(QtKeychainConfig.cmake.in
"${PROJECT_BINARY_DIR}/Qt${QTKEYCHAIN_VERSION_INFIX}KeychainConfig.cmake" @ONLY)
configure_file(QtKeychainConfigVersion.cmake.in
"${PROJECT_BINARY_DIR}/Qt${QTKEYCHAIN_VERSION_INFIX}KeychainConfigVersion.cmake" @ONLY)
install(EXPORT Qt${QTKEYCHAIN_VERSION_INFIX}KeychainLibraryDepends
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Qt${QTKEYCHAIN_VERSION_INFIX}Keychain"
)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Qt${QTKEYCHAIN_VERSION_INFIX}KeychainConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/Qt${QTKEYCHAIN_VERSION_INFIX}KeychainConfigVersion.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Qt${QTKEYCHAIN_VERSION_INFIX}Keychain
)

View File

@ -1,20 +0,0 @@
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

View File

@ -1,23 +0,0 @@
ChangeLog
=========
version 0.5.0 (release 2015-05-04)
* Added support for KWallet5 (KDE5/KF)
version 0.4.0 (release 2014-09-01)
* KWallet: Handle case where no wallet exists yet (Liviu Cristian Mirea Ghiban <contact@liviucmg.com>)
* Improved desktop environment detection at runtime (Daniel Molkentin <daniel@molkentin.de>)
version 0.3.0 (release 2014-03-13)
* Gnome Keyring supported added (Francois Ferrand <thetypz@gmail.com>)
* Improved Qt 5 support
* KWallet: Distinguish empty passwords from non-existing entries
* KWallet: Do not use hardcoded wallet name
* German translation (Daniel Molkentin <daniel@molkentin.de>)
* Romanian translation (Arthur Țițeică <arthur@psw.ro>)
version 0.2.0: no official release
version 0.1.0 (release 2013-01-16)
* Initial release

View File

@ -1,4 +0,0 @@
set(QTKEYCHAIN_INCLUDE_DIRS
"@PROJECT_SOURCE_DIR@"
"@PROJECT_BINARY_DIR@"
)

View File

@ -1,21 +0,0 @@
# - Config file for the QtKeychain package
# It defines the following variables
# QTKEYCHAIN_INCLUDE_DIRS - include directories for QtKeychain
# QTKEYCHAIN_LIBRARIES - libraries to link against
# Compute paths
get_filename_component(QTKEYCHAIN_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
if(EXISTS "${QTKEYCHAIN_CMAKE_DIR}/CMakeCache.txt")
# In build tree
include("${QTKEYCHAIN_CMAKE_DIR}/Qt@QTKEYCHAIN_VERSION_INFIX@KeychainBuildTreeSettings.cmake")
else()
set(QTKEYCHAIN_INCLUDE_DIRS "@CMAKE_INSTALL_FULL_INCLUDEDIR@")
endif()
# Our library dependencies (contains definitions for IMPORTED targets)
include("${QTKEYCHAIN_CMAKE_DIR}/Qt@QTKEYCHAIN_VERSION_INFIX@KeychainLibraryDepends.cmake")
# These are IMPORTED targets created by FooBarLibraryDepends.cmake
set(QTKEYCHAIN_LIBRARIES "@QTKEYCHAIN_TARGET_NAME@")
set(QTKEYCHAIN_FOUND TRUE)

View File

@ -1,11 +0,0 @@
set(PACKAGE_VERSION "@QTKEYCHAIN_VERSION@")
# Check whether the requested PACKAGE_FIND_VERSION is compatible
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()

View File

@ -1,15 +0,0 @@
QtKeychain
==========
QtKeychain is a Qt API to store passwords and other secret data securely. How the data is stored depends on the platform:
* **Mac OS X:** Passwords are stored in the OS X Keychain.
* **Linux/Unix:** If running, GNOME Keyring is used, otherwise
qtkeychain tries to use KWallet (via D-Bus), if available.
* **Windows:** Windows does not provide a service for secure storage. QtKeychain uses the Windows API function [CryptProtectData](http://msdn.microsoft.com/en-us/library/windows/desktop/aa380261%28v=vs.85%29.aspx "CryptProtectData function") to encrypt the password with the user's logon credentials. The encrypted data is then persisted via QSettings.
In unsupported environments QtKeychain will report an error. It will not store any data unencrypted unless explicitly requested (setInsecureFallback( true )).
**License:** QtKeychain is available under the [Modified BSD License](http://www.gnu.org/licenses/license-list.html#ModifiedBSD). See the file COPYING for details.

View File

@ -1,15 +0,0 @@
QtKeychain
==========
QtKeychain is a Qt API to store passwords and other secret data securely. How the data is stored depends on the platform:
* **Mac OS X:** Passwords are stored in the OS X Keychain.
* **Linux/Unix:** If running, GNOME Keyring is used, otherwise
qtkeychain tries to use KWallet (via D-Bus), if available.
* **Windows:** Windows does not provide a service for secure storage. QtKeychain uses the Windows API function [CryptProtectData](http://msdn.microsoft.com/en-us/library/windows/desktop/aa380261%28v=vs.85%29.aspx "CryptProtectData function") to encrypt the password with the user's logon credentials. The encrypted data is then persisted via QSettings.
In unsupported environments QtKeychain will report an error. It will not store any data unencrypted unless explicitly requested (setInsecureFallback( true )).
**License:** QtKeychain is available under the [Modified BSD License](http://www.gnu.org/licenses/license-list.html#ModifiedBSD). See the file COPYING for details.

View File

@ -1,188 +0,0 @@
# - Define GNU standard installation directories
# Provides install directory variables as defined for GNU software:
# http://www.gnu.org/prep/standards/html_node/Directory-Variables.html
# Inclusion of this module defines the following variables:
# CMAKE_INSTALL_<dir> - destination for files of a given type
# CMAKE_INSTALL_FULL_<dir> - corresponding absolute path
# where <dir> is one of:
# BINDIR - user executables (bin)
# SBINDIR - system admin executables (sbin)
# LIBEXECDIR - program executables (libexec)
# SYSCONFDIR - read-only single-machine data (etc)
# SHAREDSTATEDIR - modifiable architecture-independent data (com)
# LOCALSTATEDIR - modifiable single-machine data (var)
# LIBDIR - object code libraries (lib or lib64 or lib/<multiarch-tuple> on Debian)
# INCLUDEDIR - C header files (include)
# OLDINCLUDEDIR - C header files for non-gcc (/usr/include)
# DATAROOTDIR - read-only architecture-independent data root (share)
# DATADIR - read-only architecture-independent data (DATAROOTDIR)
# INFODIR - info documentation (DATAROOTDIR/info)
# LOCALEDIR - locale-dependent data (DATAROOTDIR/locale)
# MANDIR - man documentation (DATAROOTDIR/man)
# DOCDIR - documentation root (DATAROOTDIR/doc/PROJECT_NAME)
# Each CMAKE_INSTALL_<dir> value may be passed to the DESTINATION options of
# install() commands for the corresponding file type. If the includer does
# not define a value the above-shown default will be used and the value will
# appear in the cache for editing by the user.
# Each CMAKE_INSTALL_FULL_<dir> value contains an absolute path constructed
# from the corresponding destination by prepending (if necessary) the value
# of CMAKE_INSTALL_PREFIX.
#=============================================================================
# Copyright 2011 Nikita Krupen'ko <krnekit@gmail.com>
# Copyright 2011 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
# Installation directories
#
if(NOT DEFINED CMAKE_INSTALL_BINDIR)
set(CMAKE_INSTALL_BINDIR "bin" CACHE PATH "user executables (bin)")
endif()
if(NOT DEFINED CMAKE_INSTALL_SBINDIR)
set(CMAKE_INSTALL_SBINDIR "sbin" CACHE PATH "system admin executables (sbin)")
endif()
if(NOT DEFINED CMAKE_INSTALL_LIBEXECDIR)
set(CMAKE_INSTALL_LIBEXECDIR "libexec" CACHE PATH "program executables (libexec)")
endif()
if(NOT DEFINED CMAKE_INSTALL_SYSCONFDIR)
set(CMAKE_INSTALL_SYSCONFDIR "etc" CACHE PATH "read-only single-machine data (etc)")
endif()
if(NOT DEFINED CMAKE_INSTALL_SHAREDSTATEDIR)
set(CMAKE_INSTALL_SHAREDSTATEDIR "com" CACHE PATH "modifiable architecture-independent data (com)")
endif()
if(NOT DEFINED CMAKE_INSTALL_LOCALSTATEDIR)
set(CMAKE_INSTALL_LOCALSTATEDIR "var" CACHE PATH "modifiable single-machine data (var)")
endif()
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(_LIBDIR_DEFAULT "lib")
# Override this default 'lib' with 'lib64' iff:
# - we are on Linux system but NOT cross-compiling
# - we are NOT on debian
# - we are on a 64 bits system
# reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf
# For Debian with multiarch, use 'lib/${CMAKE_LIBRARY_ARCHITECTURE}' if
# CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu"
# See http://wiki.debian.org/Multiarch
if(CMAKE_SYSTEM_NAME MATCHES "Linux"
AND NOT CMAKE_CROSSCOMPILING)
if (EXISTS "/etc/debian_version") # is this a debian system ?
if(CMAKE_LIBRARY_ARCHITECTURE)
set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
endif()
else() # not debian, rely on CMAKE_SIZEOF_VOID_P:
if(NOT DEFINED CMAKE_SIZEOF_VOID_P)
message(AUTHOR_WARNING
"Unable to determine default CMAKE_INSTALL_LIBDIR directory because no target architecture is known. "
"Please enable at least one language before including GNUInstallDirs.")
else()
if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(_LIBDIR_DEFAULT "lib64")
endif()
endif()
endif()
endif()
set(CMAKE_INSTALL_LIBDIR "${_LIBDIR_DEFAULT}" CACHE PATH "object code libraries (${_LIBDIR_DEFAULT})")
endif()
if(NOT DEFINED CMAKE_INSTALL_INCLUDEDIR)
set(CMAKE_INSTALL_INCLUDEDIR "include" CACHE PATH "C header files (include)")
endif()
if(NOT DEFINED CMAKE_INSTALL_OLDINCLUDEDIR)
set(CMAKE_INSTALL_OLDINCLUDEDIR "/usr/include" CACHE PATH "C header files for non-gcc (/usr/include)")
endif()
if(NOT DEFINED CMAKE_INSTALL_DATAROOTDIR)
set(CMAKE_INSTALL_DATAROOTDIR "share" CACHE PATH "read-only architecture-independent data root (share)")
endif()
#-----------------------------------------------------------------------------
# Values whose defaults are relative to DATAROOTDIR. Store empty values in
# the cache and store the defaults in local variables if the cache values are
# not set explicitly. This auto-updates the defaults as DATAROOTDIR changes.
if(NOT CMAKE_INSTALL_DATADIR)
set(CMAKE_INSTALL_DATADIR "" CACHE PATH "read-only architecture-independent data (DATAROOTDIR)")
set(CMAKE_INSTALL_DATADIR "${CMAKE_INSTALL_DATAROOTDIR}")
endif()
if(NOT CMAKE_INSTALL_INFODIR)
set(CMAKE_INSTALL_INFODIR "" CACHE PATH "info documentation (DATAROOTDIR/info)")
set(CMAKE_INSTALL_INFODIR "${CMAKE_INSTALL_DATAROOTDIR}/info")
endif()
if(NOT CMAKE_INSTALL_LOCALEDIR)
set(CMAKE_INSTALL_LOCALEDIR "" CACHE PATH "locale-dependent data (DATAROOTDIR/locale)")
set(CMAKE_INSTALL_LOCALEDIR "${CMAKE_INSTALL_DATAROOTDIR}/locale")
endif()
if(NOT CMAKE_INSTALL_MANDIR)
set(CMAKE_INSTALL_MANDIR "" CACHE PATH "man documentation (DATAROOTDIR/man)")
set(CMAKE_INSTALL_MANDIR "${CMAKE_INSTALL_DATAROOTDIR}/man")
endif()
if(NOT CMAKE_INSTALL_DOCDIR)
set(CMAKE_INSTALL_DOCDIR "" CACHE PATH "documentation root (DATAROOTDIR/doc/PROJECT_NAME)")
set(CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DATAROOTDIR}/doc/${PROJECT_NAME}")
endif()
#-----------------------------------------------------------------------------
mark_as_advanced(
CMAKE_INSTALL_BINDIR
CMAKE_INSTALL_SBINDIR
CMAKE_INSTALL_LIBEXECDIR
CMAKE_INSTALL_SYSCONFDIR
CMAKE_INSTALL_SHAREDSTATEDIR
CMAKE_INSTALL_LOCALSTATEDIR
CMAKE_INSTALL_LIBDIR
CMAKE_INSTALL_INCLUDEDIR
CMAKE_INSTALL_OLDINCLUDEDIR
CMAKE_INSTALL_DATAROOTDIR
CMAKE_INSTALL_DATADIR
CMAKE_INSTALL_INFODIR
CMAKE_INSTALL_LOCALEDIR
CMAKE_INSTALL_MANDIR
CMAKE_INSTALL_DOCDIR
)
# Result directories
#
foreach(dir
BINDIR
SBINDIR
LIBEXECDIR
SYSCONFDIR
SHAREDSTATEDIR
LOCALSTATEDIR
LIBDIR
INCLUDEDIR
OLDINCLUDEDIR
DATAROOTDIR
DATADIR
INFODIR
LOCALEDIR
MANDIR
DOCDIR
)
if(NOT IS_ABSOLUTE ${CMAKE_INSTALL_${dir}})
set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_${dir}}")
else()
set(CMAKE_INSTALL_FULL_${dir} "${CMAKE_INSTALL_${dir}}")
endif()
endforeach()

View File

@ -1,71 +0,0 @@
#include "gnomekeyring_p.h"
const char* GnomeKeyring::GNOME_KEYRING_DEFAULT = NULL;
bool GnomeKeyring::isAvailable()
{
const GnomeKeyring& keyring = instance();
return keyring.isLoaded() &&
keyring.NETWORK_PASSWORD &&
keyring.is_available &&
keyring.find_password &&
keyring.store_password &&
keyring.delete_password &&
keyring.is_available();
}
GnomeKeyring::gpointer GnomeKeyring::store_network_password( const gchar* keyring, const gchar* display_name,
const gchar* user, const gchar* server, const gchar* password,
OperationDoneCallback callback, gpointer data, GDestroyNotify destroy_data )
{
if ( !isAvailable() )
return 0;
return instance().store_password( instance().NETWORK_PASSWORD,
keyring, display_name, password, callback, data, destroy_data,
"user", user, "server", server, static_cast<char*>(0) );
}
GnomeKeyring::gpointer GnomeKeyring::find_network_password( const gchar* user, const gchar* server,
OperationGetStringCallback callback, gpointer data, GDestroyNotify destroy_data )
{
if ( !isAvailable() )
return 0;
return instance().find_password( instance().NETWORK_PASSWORD,
callback, data, destroy_data,
"user", user, "server", server, static_cast<char*>(0) );
}
GnomeKeyring::gpointer GnomeKeyring::delete_network_password( const gchar* user,
const gchar* server,
OperationDoneCallback callback,
gpointer data,
GDestroyNotify destroy_data )
{
if ( !isAvailable() )
return 0;
return instance().delete_password( instance().NETWORK_PASSWORD,
callback, data, destroy_data,
"user", user, "server", server, static_cast<char*>(0) );
}
GnomeKeyring::GnomeKeyring()
: QLibrary("gnome-keyring", 0)
{
static const PasswordSchema schema = {
ITEM_NETWORK_PASSWORD,
{{ "user", ATTRIBUTE_TYPE_STRING },
{ "server", ATTRIBUTE_TYPE_STRING },
{ 0, static_cast<AttributeType>( 0 ) }}
};
NETWORK_PASSWORD = &schema;
is_available = reinterpret_cast<is_available_fn*>( resolve( "gnome_keyring_is_available" ) );
find_password = reinterpret_cast<find_password_fn*>( resolve( "gnome_keyring_find_password" ) );
store_password = reinterpret_cast<store_password_fn*>( resolve( "gnome_keyring_store_password" ) );
delete_password = reinterpret_cast<delete_password_fn*>( resolve( "gnome_keyring_delete_password" ) );
}
GnomeKeyring& GnomeKeyring::instance() {
static GnomeKeyring keyring;
return keyring;
}

View File

@ -1,88 +0,0 @@
#ifndef QTKEYCHAIN_GNOME_P_H
#define QTKEYCHAIN_GNOME_P_H
#include <QLibrary>
class GnomeKeyring : private QLibrary {
public:
enum Result {
RESULT_OK,
RESULT_DENIED,
RESULT_NO_KEYRING_DAEMON,
RESULT_ALREADY_UNLOCKED,
RESULT_NO_SUCH_KEYRING,
RESULT_BAD_ARGUMENTS,
RESULT_IO_ERROR,
RESULT_CANCELLED,
RESULT_KEYRING_ALREADY_EXISTS,
RESULT_NO_MATCH
};
enum ItemType {
ITEM_GENERIC_SECRET = 0,
ITEM_NETWORK_PASSWORD,
ITEM_NOTE,
ITEM_CHAINED_KEYRING_PASSWORD,
ITEM_ENCRYPTION_KEY_PASSWORD,
ITEM_PK_STORAGE = 0x100
};
enum AttributeType {
ATTRIBUTE_TYPE_STRING,
ATTRIBUTE_TYPE_UINT32
};
typedef char gchar;
typedef void* gpointer;
typedef bool gboolean;
typedef struct {
ItemType item_type;
struct {
const gchar* name;
AttributeType type;
} attributes[32];
} PasswordSchema;
typedef void ( *OperationGetStringCallback )( Result result, const char* string, gpointer data );
typedef void ( *OperationDoneCallback )( Result result, gpointer data );
typedef void ( *GDestroyNotify )( gpointer data );
static const char* GNOME_KEYRING_DEFAULT;
static bool isAvailable();
static gpointer store_network_password( const gchar* keyring, const gchar* display_name,
const gchar* user, const gchar* server, const gchar* password,
OperationDoneCallback callback, gpointer data, GDestroyNotify destroy_data );
static gpointer find_network_password( const gchar* user, const gchar* server,
OperationGetStringCallback callback, gpointer data, GDestroyNotify destroy_data );
static gpointer delete_network_password( const gchar* user, const gchar* server,
OperationDoneCallback callback, gpointer data, GDestroyNotify destroy_data );
private:
GnomeKeyring();
static GnomeKeyring& instance();
const PasswordSchema* NETWORK_PASSWORD;
typedef gboolean ( is_available_fn )( void );
typedef gpointer ( store_password_fn )( const PasswordSchema* schema, const gchar* keyring,
const gchar* display_name, const gchar* password,
OperationDoneCallback callback, gpointer data, GDestroyNotify destroy_data,
... );
typedef gpointer ( find_password_fn )( const PasswordSchema* schema,
OperationGetStringCallback callback, gpointer data, GDestroyNotify destroy_data,
... );
typedef gpointer ( delete_password_fn )( const PasswordSchema* schema,
OperationDoneCallback callback, gpointer data, GDestroyNotify destroy_data,
... );
is_available_fn* is_available;
find_password_fn* find_password;
store_password_fn* store_password;
delete_password_fn* delete_password;
};
#endif

View File

@ -1,229 +0,0 @@
/******************************************************************************
* Copyright (C) 2011-2015 Frank Osterfeld <frank.osterfeld@gmail.com> *
* *
* This program 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. For licensing and distribution *
* details, check the accompanying file 'COPYING'. *
*****************************************************************************/
#include "keychain.h"
#include "keychain_p.h"
using namespace QKeychain;
Job::Job( const QString& service, QObject *parent )
: QObject( parent )
, d ( new JobPrivate( service ) ) {
}
Job::~Job() {
delete d;
}
QString Job::service() const {
return d->service;
}
QSettings* Job::settings() const {
return d->settings;
}
void Job::setSettings( QSettings* settings ) {
d->settings = settings;
}
void Job::start() {
QMetaObject::invokeMethod( this, "doStart", Qt::QueuedConnection );
}
bool Job::autoDelete() const {
return d->autoDelete;
}
void Job::setAutoDelete( bool autoDelete ) {
d->autoDelete = autoDelete;
}
bool Job::insecureFallback() const {
return d->insecureFallback;
}
void Job::setInsecureFallback( bool insecureFallback ) {
d->insecureFallback = insecureFallback;
}
void Job::emitFinished() {
emit finished( this );
if ( d->autoDelete )
deleteLater();
}
void Job::emitFinishedWithError( Error error, const QString& errorString ) {
d->error = error;
d->errorString = errorString;
emitFinished();
}
Error Job::error() const {
return d->error;
}
QString Job::errorString() const {
return d->errorString;
}
void Job::setError( Error error ) {
d->error = error;
}
void Job::setErrorString( const QString& errorString ) {
d->errorString = errorString;
}
ReadPasswordJob::ReadPasswordJob( const QString& service, QObject* parent )
: Job( service, parent )
, d( new ReadPasswordJobPrivate( this ) )
{}
ReadPasswordJob::~ReadPasswordJob() {
delete d;
}
QString ReadPasswordJob::textData() const {
return QString::fromUtf8( d->data );
}
QByteArray ReadPasswordJob::binaryData() const {
return d->data;
}
QString ReadPasswordJob::key() const {
return d->key;
}
void ReadPasswordJob::setKey( const QString& key ) {
d->key = key;
}
void ReadPasswordJob::doStart() {
JobExecutor::instance()->enqueue( this );
}
WritePasswordJob::WritePasswordJob( const QString& service, QObject* parent )
: Job( service, parent )
, d( new WritePasswordJobPrivate( this ) ) {
}
WritePasswordJob::~WritePasswordJob() {
delete d;
}
QString WritePasswordJob::key() const {
return d->key;
}
void WritePasswordJob::setKey( const QString& key ) {
d->key = key;
}
void WritePasswordJob::setBinaryData( const QByteArray& data ) {
d->binaryData = data;
d->mode = WritePasswordJobPrivate::Binary;
}
void WritePasswordJob::setTextData( const QString& data ) {
d->textData = data;
d->mode = WritePasswordJobPrivate::Text;
}
void WritePasswordJob::doStart() {
JobExecutor::instance()->enqueue( this );
}
DeletePasswordJob::DeletePasswordJob( const QString& service, QObject* parent )
: Job( service, parent )
, d( new DeletePasswordJobPrivate( this ) ) {
}
DeletePasswordJob::~DeletePasswordJob() {
delete d;
}
void DeletePasswordJob::doStart() {
//Internally, to delete a password we just execute a write job with no data set (null byte array).
//In all current implementations, this deletes the entry so this is sufficient
WritePasswordJob* job = new WritePasswordJob( service(), this );
connect( job, SIGNAL(finished(QKeychain::Job*)), d, SLOT(jobFinished(QKeychain::Job*)) );
job->setInsecureFallback(true);
job->setSettings(settings());
job->setKey( d->key );
job->doStart();
}
QString DeletePasswordJob::key() const {
return d->key;
}
void DeletePasswordJob::setKey( const QString& key ) {
d->key = key;
}
void DeletePasswordJobPrivate::jobFinished( Job* job ) {
q->setError( job->error() );
q->setErrorString( job->errorString() );
q->emitFinished();
}
JobExecutor::JobExecutor()
: QObject( 0 )
, m_runningJob( 0 )
{
}
void JobExecutor::enqueue( Job* job ) {
m_queue.append( job );
startNextIfNoneRunning();
}
void JobExecutor::startNextIfNoneRunning() {
if ( m_queue.isEmpty() || m_runningJob )
return;
QPointer<Job> next;
while ( !next && !m_queue.isEmpty() ) {
next = m_queue.first();
m_queue.pop_front();
}
if ( next ) {
connect( next, SIGNAL(finished(QKeychain::Job*)), this, SLOT(jobFinished(QKeychain::Job*)) );
connect( next, SIGNAL(destroyed(QObject*)), this, SLOT(jobDestroyed(QObject*)) );
m_runningJob = next;
if ( ReadPasswordJob* rpj = qobject_cast<ReadPasswordJob*>( m_runningJob ) )
rpj->d->scheduledStart();
else if ( WritePasswordJob* wpj = qobject_cast<WritePasswordJob*>( m_runningJob) )
wpj->d->scheduledStart();
}
}
void JobExecutor::jobDestroyed( QObject* object ) {
Q_UNUSED( object ) // for release mode
Q_ASSERT( object == m_runningJob );
m_runningJob->disconnect( this );
m_runningJob = 0;
startNextIfNoneRunning();
}
void JobExecutor::jobFinished( Job* job ) {
Q_UNUSED( job ) // for release mode
Q_ASSERT( job == m_runningJob );
m_runningJob->disconnect( this );
m_runningJob = 0;
startNextIfNoneRunning();
}
JobExecutor* JobExecutor::s_instance = 0;
JobExecutor* JobExecutor::instance() {
if ( !s_instance )
s_instance = new JobExecutor;
return s_instance;
}

View File

@ -1,145 +0,0 @@
/******************************************************************************
* Copyright (C) 2011-2015 Frank Osterfeld <frank.osterfeld@gmail.com> *
* *
* This program 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. For licensing and distribution *
* details, check the accompanying file 'COPYING'. *
*****************************************************************************/
#ifndef KEYCHAIN_H
#define KEYCHAIN_H
#include "qkeychain_export.h"
#include <QtCore/QObject>
#include <QtCore/QString>
class QSettings;
#define QTKEYCHAIN_VERSION 0x000100
namespace QKeychain {
/**
* Error codes
*/
enum Error {
NoError=0, /**< No error occurred, operation was successful */
EntryNotFound, /**< For the given key no data was found */
CouldNotDeleteEntry, /**< Could not delete existing secret data */
AccessDeniedByUser, /**< User denied access to keychain */
AccessDenied, /**< Access denied for other reasons */
NoBackendAvailable, /**< No platform-specific keychain service available */
NotImplemented, /**< Not implemented on platform */
OtherError /**< Something else went wrong (errorString() might provide details) */
};
class JobExecutor;
class JobPrivate;
class QKEYCHAIN_EXPORT Job : public QObject {
Q_OBJECT
public:
explicit Job( const QString& service, QObject* parent=0 );
~Job();
QSettings* settings() const;
void setSettings( QSettings* settings );
void start();
QString service() const;
Error error() const;
QString errorString() const;
bool autoDelete() const;
void setAutoDelete( bool autoDelete );
bool insecureFallback() const;
void setInsecureFallback( bool insecureFallback );
Q_SIGNALS:
void finished( QKeychain::Job* );
protected:
Q_INVOKABLE virtual void doStart() = 0;
void setError( Error error );
void setErrorString( const QString& errorString );
void emitFinished();
void emitFinishedWithError(Error, const QString& errorString);
private:
JobPrivate* const d;
};
class ReadPasswordJobPrivate;
class QKEYCHAIN_EXPORT ReadPasswordJob : public Job {
Q_OBJECT
public:
explicit ReadPasswordJob( const QString& service, QObject* parent=0 );
~ReadPasswordJob();
QString key() const;
void setKey( const QString& key );
QByteArray binaryData() const;
QString textData() const;
protected:
void doStart();
private:
friend class QKeychain::ReadPasswordJobPrivate;
friend class QKeychain::JobExecutor;
ReadPasswordJobPrivate* const d;
};
class WritePasswordJobPrivate;
class QKEYCHAIN_EXPORT WritePasswordJob : public Job {
Q_OBJECT
public:
explicit WritePasswordJob( const QString& service, QObject* parent=0 );
~WritePasswordJob();
QString key() const;
void setKey( const QString& key );
void setBinaryData( const QByteArray& data );
void setTextData( const QString& data );
protected:
void doStart();
private:
friend class QKeychain::JobExecutor;
friend class QKeychain::WritePasswordJobPrivate;
friend class DeletePasswordJob;
WritePasswordJobPrivate* const d;
};
class DeletePasswordJobPrivate;
class QKEYCHAIN_EXPORT DeletePasswordJob : public Job {
Q_OBJECT
public:
explicit DeletePasswordJob( const QString& service, QObject* parent=0 );
~DeletePasswordJob();
QString key() const;
void setKey( const QString& key );
protected:
void doStart();
private:
friend class QKeychain::DeletePasswordJobPrivate;
DeletePasswordJobPrivate* const d;
};
} // namespace QtKeychain
#endif

View File

@ -1,161 +0,0 @@
/******************************************************************************
* Copyright (C) 2011-2015 Frank Osterfeld <frank.osterfeld@gmail.com> *
* *
* This program 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. For licensing and distribution *
* details, check the accompanying file 'COPYING'. *
*****************************************************************************/
#include "keychain_p.h"
#include <CoreFoundation/CoreFoundation.h>
#include <Security/Security.h>
#include <QDebug>
using namespace QKeychain;
template <typename T>
struct Releaser {
explicit Releaser( const T& v ) : value( v ) {}
~Releaser() {
CFRelease( value );
}
const T value;
};
static QString strForStatus( OSStatus os ) {
const Releaser<CFStringRef> str( SecCopyErrorMessageString( os, 0 ) );
const char * const buf = CFStringGetCStringPtr( str.value, kCFStringEncodingUTF8 );
if ( !buf )
return QObject::tr( "%1 (OSStatus %2)" )
.arg( "OSX Keychain Error" ).arg( os );
return QObject::tr( "%1 (OSStatus %2)" )
.arg( QString::fromUtf8( buf, strlen( buf ) ) ).arg( os );
}
static OSStatus readPw( QByteArray* pw,
const QString& service,
const QString& account,
SecKeychainItemRef* ref ) {
Q_ASSERT( pw );
pw->clear();
const QByteArray serviceData = service.toUtf8();
const QByteArray accountData = account.toUtf8();
void* data = 0;
UInt32 len = 0;
const OSStatus ret = SecKeychainFindGenericPassword( NULL, // default keychain
serviceData.size(),
serviceData.constData(),
accountData.size(),
accountData.constData(),
&len,
&data,
ref );
if ( ret == noErr ) {
*pw = QByteArray( reinterpret_cast<const char*>( data ), len );
const OSStatus ret2 = SecKeychainItemFreeContent ( 0, data );
if ( ret2 != noErr )
qWarning() << "Could not free item content: " << strForStatus( ret2 );
}
return ret;
}
void ReadPasswordJobPrivate::scheduledStart()
{
QString errorString;
Error error = NoError;
const OSStatus ret = readPw( &data, q->service(), q->key(), 0 );
switch ( ret ) {
case noErr:
break;
case errSecItemNotFound:
errorString = tr("Password not found");
error = EntryNotFound;
break;
default:
errorString = strForStatus( ret );
error = OtherError;
break;
}
q->emitFinishedWithError( error, errorString );
}
static QKeychain::Error deleteEntryImpl( const QString& service, const QString& account, QString* err ) {
SecKeychainItemRef ref;
QByteArray pw;
const OSStatus ret1 = readPw( &pw, service, account, &ref );
if ( ret1 == errSecItemNotFound )
return NoError; // No item stored, we're done
if ( ret1 != noErr ) {
*err = strForStatus( ret1 );
//TODO map error code, set errstr
return OtherError;
}
const Releaser<SecKeychainItemRef> releaser( ref );
const OSStatus ret2 = SecKeychainItemDelete( ref );
if ( ret2 == noErr )
return NoError;
//TODO map error code
*err = strForStatus( ret2 );
return CouldNotDeleteEntry;
}
static QKeychain::Error writeEntryImpl( const QString& service,
const QString& account,
const QByteArray& data,
QString* err ) {
Q_ASSERT( err );
err->clear();
const QByteArray serviceData = service.toUtf8();
const QByteArray accountData = account.toUtf8();
const OSStatus ret = SecKeychainAddGenericPassword( NULL, //default keychain
serviceData.size(),
serviceData.constData(),
accountData.size(),
accountData.constData(),
data.size(),
data.constData(),
NULL //item reference
);
if ( ret != noErr ) {
switch ( ret ) {
case errSecDuplicateItem:
{
Error derr = deleteEntryImpl( service, account, err );
if ( derr != NoError )
return CouldNotDeleteEntry;
else
return writeEntryImpl( service, account, data, err );
}
default:
*err = strForStatus( ret );
return OtherError;
}
}
return NoError;
}
void WritePasswordJobPrivate::scheduledStart()
{
QString errorString;
Error error = NoError;
if ( mode == Delete ) {
const Error derr = deleteEntryImpl( q->service(), key, &errorString );
if ( derr != NoError )
error = CouldNotDeleteEntry;
q->emitFinishedWithError( error, errorString );
return;
}
const QByteArray data = mode == Text ? textData.toUtf8() : binaryData;
error = writeEntryImpl( q->service(), key, data, &errorString );
q->emitFinishedWithError( error, errorString );
}

View File

@ -1,163 +0,0 @@
/******************************************************************************
* Copyright (C) 2011-2015 Frank Osterfeld <frank.osterfeld@gmail.com> *
* *
* This program 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. For licensing and distribution *
* details, check the accompanying file 'COPYING'. *
*****************************************************************************/
#ifndef KEYCHAIN_P_H
#define KEYCHAIN_P_H
#include <QCoreApplication>
#include <QObject>
#include <QPointer>
#include <QSettings>
#include <QVector>
#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN)
#include <QDBusPendingCallWatcher>
#include "kwallet_interface.h"
#else
class QDBusPendingCallWatcher;
#endif
#include "keychain.h"
namespace QKeychain {
class JobExecutor;
class JobPrivate : public QObject {
Q_OBJECT
public:
JobPrivate( const QString& service_ )
: error( NoError )
, service( service_ )
, autoDelete( true )
, insecureFallback( false ) {}
QKeychain::Error error;
QString errorString;
QString service;
bool autoDelete;
bool insecureFallback;
QPointer<QSettings> settings;
};
class ReadPasswordJobPrivate : public QObject {
Q_OBJECT
public:
explicit ReadPasswordJobPrivate( ReadPasswordJob* qq ) : q( qq ), walletHandle( 0 ), dataType( Text ) {}
void scheduledStart();
ReadPasswordJob* const q;
QByteArray data;
QString key;
int walletHandle;
enum DataType {
Binary,
Text
};
DataType dataType;
#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN)
org::kde::KWallet* iface;
static void gnomeKeyring_cb( int result, const char* string, ReadPasswordJobPrivate* data );
friend class QKeychain::JobExecutor;
void fallbackOnError(const QDBusError& err);
private Q_SLOTS:
void kwalletWalletFound( QDBusPendingCallWatcher* watcher );
void kwalletOpenFinished( QDBusPendingCallWatcher* watcher );
void kwalletEntryTypeFinished( QDBusPendingCallWatcher* watcher );
void kwalletReadFinished( QDBusPendingCallWatcher* watcher );
#else //moc's too dumb to respect above macros, so just define empty slot implementations
private Q_SLOTS:
void kwalletWalletFound( QDBusPendingCallWatcher* ) {}
void kwalletOpenFinished( QDBusPendingCallWatcher* ) {}
void kwalletEntryTypeFinished( QDBusPendingCallWatcher* ) {}
void kwalletReadFinished( QDBusPendingCallWatcher* ) {}
#endif
};
class WritePasswordJobPrivate : public QObject {
Q_OBJECT
public:
explicit WritePasswordJobPrivate( WritePasswordJob* qq ) : q( qq ), mode( Delete ) {}
void scheduledStart();
enum Mode {
Delete,
Text,
Binary
};
static QString modeToString(Mode m);
static Mode stringToMode(const QString& s);
WritePasswordJob* const q;
Mode mode;
QString key;
QByteArray binaryData;
QString textData;
#if defined(Q_OS_UNIX) && !defined(Q_OS_DARWIN)
org::kde::KWallet* iface;
static void gnomeKeyring_cb( int result, WritePasswordJobPrivate* self );
friend class QKeychain::JobExecutor;
void fallbackOnError(const QDBusError& err);
private Q_SLOTS:
void kwalletWalletFound( QDBusPendingCallWatcher* watcher );
void kwalletOpenFinished( QDBusPendingCallWatcher* watcher );
void kwalletWriteFinished( QDBusPendingCallWatcher* watcher );
#else
private Q_SLOTS:
void kwalletWalletFound( QDBusPendingCallWatcher* ) {}
void kwalletOpenFinished( QDBusPendingCallWatcher* ) {}
void kwalletWriteFinished( QDBusPendingCallWatcher* ) {}
#endif
};
class DeletePasswordJobPrivate : public QObject {
Q_OBJECT
public:
explicit DeletePasswordJobPrivate( DeletePasswordJob* qq ) : q( qq ) {}
void doStart();
DeletePasswordJob* const q;
QString key;
private Q_SLOTS:
void jobFinished( QKeychain::Job* );
};
class JobExecutor : public QObject {
Q_OBJECT
public:
static JobExecutor* instance();
void enqueue( Job* job );
private:
explicit JobExecutor();
void startNextIfNoneRunning();
private Q_SLOTS:
void jobFinished( QKeychain::Job* );
void jobDestroyed( QObject* object );
private:
static JobExecutor* s_instance;
Job* m_runningJob;
QVector<QPointer<Job> > m_queue;
};
}
#endif // KEYCHAIN_P_H

View File

@ -1,510 +0,0 @@
/******************************************************************************
* Copyright (C) 2011-2015 Frank Osterfeld <frank.osterfeld@gmail.com> *
* *
* This program 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. For licensing and distribution *
* details, check the accompanying file 'COPYING'. *
*****************************************************************************/
#include "keychain_p.h"
#include "gnomekeyring_p.h"
#include <QSettings>
#include <QScopedPointer>
using namespace QKeychain;
static QString typeKey( const QString& key )
{
return QString::fromLatin1( "%1/type" ).arg( key );
}
static QString dataKey( const QString& key )
{
return QString::fromLatin1( "%1/data" ).arg( key );
}
enum KeyringBackend {
Backend_GnomeKeyring,
Backend_Kwallet4,
Backend_Kwallet5
};
enum DesktopEnvironment {
DesktopEnv_Gnome,
DesktopEnv_Kde4,
DesktopEnv_Plasma5,
DesktopEnv_Unity,
DesktopEnv_Xfce,
DesktopEnv_Other
};
// the following detection algorithm is derived from chromium,
// licensed under BSD, see base/nix/xdg_util.cc
static DesktopEnvironment getKdeVersion() {
QString value = qgetenv("KDE_SESSION_VERSION");
if ( value == "5" ) {
return DesktopEnv_Plasma5;
} else if (value == "4" ) {
return DesktopEnv_Kde4;
} else {
// most likely KDE3
return DesktopEnv_Other;
}
}
static DesktopEnvironment detectDesktopEnvironment() {
QByteArray xdgCurrentDesktop = qgetenv("XDG_CURRENT_DESKTOP");
if ( xdgCurrentDesktop == "GNOME" ) {
return DesktopEnv_Gnome;
} else if ( xdgCurrentDesktop == "Unity" ) {
return DesktopEnv_Unity;
} else if ( xdgCurrentDesktop == "KDE" ) {
return getKdeVersion();
}
QByteArray desktopSession = qgetenv("DESKTOP_SESSION");
if ( desktopSession == "gnome" ) {
return DesktopEnv_Gnome;
} else if ( desktopSession == "kde" ) {
return getKdeVersion();
} else if ( desktopSession == "kde4" ) {
return DesktopEnv_Kde4;
} else if ( desktopSession.contains("xfce") || desktopSession == "xubuntu" ) {
return DesktopEnv_Xfce;
}
if ( !qgetenv("GNOME_DESKTOP_SESSION_ID").isEmpty() ) {
return DesktopEnv_Gnome;
} else if ( !qgetenv("KDE_FULL_SESSION").isEmpty() ) {
return getKdeVersion();
}
return DesktopEnv_Other;
}
static KeyringBackend detectKeyringBackend()
{
switch (detectDesktopEnvironment()) {
case DesktopEnv_Kde4:
return Backend_Kwallet4;
break;
case DesktopEnv_Plasma5:
return Backend_Kwallet5;
break;
// fall through
case DesktopEnv_Gnome:
case DesktopEnv_Unity:
case DesktopEnv_Xfce:
case DesktopEnv_Other:
default:
if ( GnomeKeyring::isAvailable() ) {
return Backend_GnomeKeyring;
} else {
return Backend_Kwallet4;
}
}
}
static KeyringBackend getKeyringBackend()
{
static KeyringBackend backend = detectKeyringBackend();
return backend;
}
static void kwalletReadPasswordScheduledStartImpl(const char * service, const char * path, ReadPasswordJobPrivate * priv) {
if ( QDBusConnection::sessionBus().isConnected() )
{
priv->iface = new org::kde::KWallet( QLatin1String(service), QLatin1String(path), QDBusConnection::sessionBus(), priv );
const QDBusPendingReply<QString> reply = priv->iface->networkWallet();
QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher( reply, priv );
priv->connect( watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), priv, SLOT(kwalletWalletFound(QDBusPendingCallWatcher*)) );
}
else
{
// D-Bus is not reachable so none can tell us something about KWalletd
QDBusError err( QDBusError::NoServer, ReadPasswordJobPrivate::tr("D-Bus is not running") );
priv->fallbackOnError( err );
}
}
void ReadPasswordJobPrivate::scheduledStart() {
switch ( getKeyringBackend() ) {
case Backend_GnomeKeyring:
if ( !GnomeKeyring::find_network_password( key.toUtf8().constData(), q->service().toUtf8().constData(),
reinterpret_cast<GnomeKeyring::OperationGetStringCallback>( &ReadPasswordJobPrivate::gnomeKeyring_cb ),
this, 0 ) )
q->emitFinishedWithError( OtherError, tr("Unknown error") );
break;
case Backend_Kwallet4:
kwalletReadPasswordScheduledStartImpl("org.kde.kwalletd", "/modules/kwalletd", this);
break;
case Backend_Kwallet5:
kwalletReadPasswordScheduledStartImpl("org.kde.kwalletd5", "/modules/kwalletd5", this);
break;
}
}
void ReadPasswordJobPrivate::kwalletWalletFound(QDBusPendingCallWatcher *watcher)
{
watcher->deleteLater();
const QDBusPendingReply<QString> reply = *watcher;
const QDBusPendingReply<int> pendingReply = iface->open( reply.value(), 0, q->service() );
QDBusPendingCallWatcher* pendingWatcher = new QDBusPendingCallWatcher( pendingReply, this );
connect( pendingWatcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(kwalletOpenFinished(QDBusPendingCallWatcher*)) );
}
static QPair<Error, QString> mapGnomeKeyringError( int result )
{
Q_ASSERT( result != GnomeKeyring::RESULT_OK );
switch ( result ) {
case GnomeKeyring::RESULT_DENIED:
return qMakePair( AccessDenied, QObject::tr("Access to keychain denied") );
case GnomeKeyring::RESULT_NO_KEYRING_DAEMON:
return qMakePair( NoBackendAvailable, QObject::tr("No keyring daemon") );
case GnomeKeyring::RESULT_ALREADY_UNLOCKED:
return qMakePair( OtherError, QObject::tr("Already unlocked") );
case GnomeKeyring::RESULT_NO_SUCH_KEYRING:
return qMakePair( OtherError, QObject::tr("No such keyring") );
case GnomeKeyring::RESULT_BAD_ARGUMENTS:
return qMakePair( OtherError, QObject::tr("Bad arguments") );
case GnomeKeyring::RESULT_IO_ERROR:
return qMakePair( OtherError, QObject::tr("I/O error") );
case GnomeKeyring::RESULT_CANCELLED:
return qMakePair( OtherError, QObject::tr("Cancelled") );
case GnomeKeyring::RESULT_KEYRING_ALREADY_EXISTS:
return qMakePair( OtherError, QObject::tr("Keyring already exists") );
case GnomeKeyring::RESULT_NO_MATCH:
return qMakePair( EntryNotFound, QObject::tr("No match") );
default:
break;
}
return qMakePair( OtherError, QObject::tr("Unknown error") );
}
void ReadPasswordJobPrivate::gnomeKeyring_cb( int result, const char* string, ReadPasswordJobPrivate* self )
{
if ( result == GnomeKeyring::RESULT_OK ) {
if ( self->dataType == ReadPasswordJobPrivate::Text )
self->data = string;
else
self->data = QByteArray::fromBase64( string );
self->q->emitFinished();
} else {
const QPair<Error, QString> errorResult = mapGnomeKeyringError( result );
self->q->emitFinishedWithError( errorResult.first, errorResult.second );
}
}
void ReadPasswordJobPrivate::fallbackOnError(const QDBusError& err )
{
QScopedPointer<QSettings> local( !q->settings() ? new QSettings( q->service() ) : 0 );
QSettings* actual = q->settings() ? q->settings() : local.data();
if ( q->insecureFallback() && actual->contains( dataKey( key ) ) ) {
const WritePasswordJobPrivate::Mode mode = WritePasswordJobPrivate::stringToMode( actual->value( typeKey( key ) ).toString() );
if (mode == WritePasswordJobPrivate::Binary)
dataType = Binary;
else
dataType = Text;
data = actual->value( dataKey( key ) ).toByteArray();
q->emitFinished();
} else {
if ( err.type() == QDBusError::ServiceUnknown ) //KWalletd not running
q->emitFinishedWithError( NoBackendAvailable, tr("No keychain service available") );
else
q->emitFinishedWithError( OtherError, tr("Could not open wallet: %1; %2").arg( QDBusError::errorString( err.type() ), err.message() ) );
}
}
void ReadPasswordJobPrivate::kwalletOpenFinished( QDBusPendingCallWatcher* watcher ) {
watcher->deleteLater();
const QDBusPendingReply<int> reply = *watcher;
QScopedPointer<QSettings> local( !q->settings() ? new QSettings( q->service() ) : 0 );
QSettings* actual = q->settings() ? q->settings() : local.data();
if ( reply.isError() ) {
fallbackOnError( reply.error() );
return;
}
if ( actual->contains( dataKey( key ) ) ) {
// We previously stored data in the insecure QSettings, but now have KWallet available.
// Do the migration
data = actual->value( dataKey( key ) ).toByteArray();
const WritePasswordJobPrivate::Mode mode = WritePasswordJobPrivate::stringToMode( actual->value( typeKey( key ) ).toString() );
actual->remove( key );
q->emitFinished();
WritePasswordJob* j = new WritePasswordJob( q->service(), 0 );
j->setSettings( q->settings() );
j->setKey( key );
j->setAutoDelete( true );
if ( mode == WritePasswordJobPrivate::Binary )
j->setBinaryData( data );
else if ( mode == WritePasswordJobPrivate::Text )
j->setTextData( QString::fromUtf8( data ) );
else
Q_ASSERT( false );
j->start();
return;
}
walletHandle = reply.value();
if ( walletHandle < 0 ) {
q->emitFinishedWithError( AccessDenied, tr("Access to keychain denied") );
return;
}
const QDBusPendingReply<int> nextReply = iface->entryType( walletHandle, q->service(), key, q->service() );
QDBusPendingCallWatcher* nextWatcher = new QDBusPendingCallWatcher( nextReply, this );
connect( nextWatcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(kwalletEntryTypeFinished(QDBusPendingCallWatcher*)) );
}
//Must be in sync with KWallet::EntryType (kwallet.h)
enum KWalletEntryType {
Unknown=0,
Password,
Stream,
Map
};
void ReadPasswordJobPrivate::kwalletEntryTypeFinished( QDBusPendingCallWatcher* watcher ) {
watcher->deleteLater();
if ( watcher->isError() ) {
const QDBusError err = watcher->error();
q->emitFinishedWithError( OtherError, tr("Could not determine data type: %1; %2").arg( QDBusError::errorString( err.type() ), err.message() ) );
return;
}
const QDBusPendingReply<int> reply = *watcher;
const int value = reply.value();
switch ( value ) {
case Unknown:
q->emitFinishedWithError( EntryNotFound, tr("Entry not found") );
return;
case Password:
dataType = Text;
break;
case Stream:
dataType = Binary;
break;
case Map:
q->emitFinishedWithError( EntryNotFound, tr("Unsupported entry type 'Map'") );
return;
default:
q->emitFinishedWithError( OtherError, tr("Unknown kwallet entry type '%1'").arg( value ) );
return;
}
const QDBusPendingCall nextReply = dataType == Text
? QDBusPendingCall( iface->readPassword( walletHandle, q->service(), key, q->service() ) )
: QDBusPendingCall( iface->readEntry( walletHandle, q->service(), key, q->service() ) );
QDBusPendingCallWatcher* nextWatcher = new QDBusPendingCallWatcher( nextReply, this );
connect( nextWatcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(kwalletReadFinished(QDBusPendingCallWatcher*)) );
}
void ReadPasswordJobPrivate::kwalletReadFinished( QDBusPendingCallWatcher* watcher ) {
watcher->deleteLater();
if ( watcher->isError() ) {
const QDBusError err = watcher->error();
q->emitFinishedWithError( OtherError, tr("Could not read password: %1; %2").arg( QDBusError::errorString( err.type() ), err.message() ) );
return;
}
if ( dataType == Binary ) {
QDBusPendingReply<QByteArray> reply = *watcher;
data = reply.value();
} else {
QDBusPendingReply<QString> reply = *watcher;
data = reply.value().toUtf8();
}
q->emitFinished();
}
static void kwalletWritePasswordScheduledStart( const char * service, const char * path, WritePasswordJobPrivate * priv ) {
if ( QDBusConnection::sessionBus().isConnected() )
{
priv->iface = new org::kde::KWallet( QLatin1String(service), QLatin1String(path), QDBusConnection::sessionBus(), priv );
const QDBusPendingReply<QString> reply = priv->iface->networkWallet();
QDBusPendingCallWatcher* watcher = new QDBusPendingCallWatcher( reply, priv );
priv->connect( watcher, SIGNAL(finished(QDBusPendingCallWatcher*)), priv, SLOT(kwalletWalletFound(QDBusPendingCallWatcher*)) );
}
else
{
// D-Bus is not reachable so none can tell us something about KWalletd
QDBusError err( QDBusError::NoServer, WritePasswordJobPrivate::tr("D-Bus is not running") );
priv->fallbackOnError( err );
}
}
void WritePasswordJobPrivate::scheduledStart() {
switch ( getKeyringBackend() ) {
case Backend_GnomeKeyring:
if ( mode == WritePasswordJobPrivate::Delete ) {
if ( !GnomeKeyring::delete_network_password( key.toUtf8().constData(), q->service().toUtf8().constData(),
reinterpret_cast<GnomeKeyring::OperationDoneCallback>( &WritePasswordJobPrivate::gnomeKeyring_cb ),
this, 0 ) )
q->emitFinishedWithError( OtherError, tr("Unknown error") );
} else {
QByteArray password = mode == WritePasswordJobPrivate::Text ? textData.toUtf8() : binaryData.toBase64();
QByteArray service = q->service().toUtf8();
if ( !GnomeKeyring::store_network_password( GnomeKeyring::GNOME_KEYRING_DEFAULT, service.constData(),
key.toUtf8().constData(), service.constData(), password.constData(),
reinterpret_cast<GnomeKeyring::OperationDoneCallback>( &WritePasswordJobPrivate::gnomeKeyring_cb ),
this, 0 ) )
q->emitFinishedWithError( OtherError, tr("Unknown error") );
}
break;
case Backend_Kwallet4:
kwalletWritePasswordScheduledStart("org.kde.kwalletd", "/modules/kwalletd", this);
break;
case Backend_Kwallet5:
kwalletWritePasswordScheduledStart("org.kde.kwalletd5", "/modules/kwalletd5", this);
break;
}
}
QString WritePasswordJobPrivate::modeToString(Mode m)
{
switch (m) {
case Delete:
return QLatin1String("Delete");
case Text:
return QLatin1String("Text");
case Binary:
return QLatin1String("Binary");
}
Q_ASSERT_X(false, Q_FUNC_INFO, "Unhandled Mode value");
return QString();
}
WritePasswordJobPrivate::Mode WritePasswordJobPrivate::stringToMode(const QString& s)
{
if (s == QLatin1String("Delete") || s == QLatin1String("0"))
return Delete;
if (s == QLatin1String("Text") || s == QLatin1String("1"))
return Text;
if (s == QLatin1String("Binary") || s == QLatin1String("2"))
return Binary;
qCritical("Unexpected mode string '%s'", qPrintable(s));
return Text;
}
void WritePasswordJobPrivate::fallbackOnError(const QDBusError &err)
{
QScopedPointer<QSettings> local( !q->settings() ? new QSettings( q->service() ) : 0 );
QSettings* actual = q->settings() ? q->settings() : local.data();
if ( !q->insecureFallback() ) {
q->emitFinishedWithError( OtherError, tr("Could not open wallet: %1; %2").arg( QDBusError::errorString( err.type() ), err.message() ) );
return;
}
if ( mode == Delete ) {
actual->remove( key );
actual->sync();
q->emitFinished();
return;
}
actual->setValue( QString::fromLatin1( "%1/type" ).arg( key ), mode );
if ( mode == Text )
actual->setValue( QString::fromLatin1( "%1/data" ).arg( key ), textData.toUtf8() );
else if ( mode == Binary )
actual->setValue( QString::fromLatin1( "%1/data" ).arg( key ), binaryData );
actual->sync();
q->emitFinished();
}
void WritePasswordJobPrivate::gnomeKeyring_cb( int result, WritePasswordJobPrivate* self )
{
if ( result == GnomeKeyring::RESULT_OK ) {
self->q->emitFinished();
} else {
const QPair<Error, QString> errorResult = mapGnomeKeyringError( result );
self->q->emitFinishedWithError( errorResult.first, errorResult.second );
}
}
void WritePasswordJobPrivate::kwalletWalletFound(QDBusPendingCallWatcher *watcher)
{
watcher->deleteLater();
const QDBusPendingReply<QString> reply = *watcher;
const QDBusPendingReply<int> pendingReply = iface->open( reply.value(), 0, q->service() );
QDBusPendingCallWatcher* pendingWatcher = new QDBusPendingCallWatcher( pendingReply, this );
connect( pendingWatcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(kwalletOpenFinished(QDBusPendingCallWatcher*)) );
}
void WritePasswordJobPrivate::kwalletOpenFinished( QDBusPendingCallWatcher* watcher ) {
watcher->deleteLater();
QDBusPendingReply<int> reply = *watcher;
QScopedPointer<QSettings> local( !q->settings() ? new QSettings( q->service() ) : 0 );
QSettings* actual = q->settings() ? q->settings() : local.data();
if ( reply.isError() ) {
fallbackOnError( reply.error() );
return;
}
if ( actual->contains( key ) )
{
// If we had previously written to QSettings, but we now have a kwallet available, migrate and delete old insecure data
actual->remove( key );
actual->sync();
}
const int handle = reply.value();
if ( handle < 0 ) {
q->emitFinishedWithError( AccessDenied, tr("Access to keychain denied") );
return;
}
QDBusPendingReply<int> nextReply;
if ( !textData.isEmpty() )
nextReply = iface->writePassword( handle, q->service(), key, textData, q->service() );
else if ( !binaryData.isEmpty() )
nextReply = iface->writeEntry( handle, q->service(), key, binaryData, q->service() );
else
nextReply = iface->removeEntry( handle, q->service(), key, q->service() );
QDBusPendingCallWatcher* nextWatcher = new QDBusPendingCallWatcher( nextReply, this );
connect( nextWatcher, SIGNAL(finished(QDBusPendingCallWatcher*)), this, SLOT(kwalletWriteFinished(QDBusPendingCallWatcher*)) );
}
void WritePasswordJobPrivate::kwalletWriteFinished( QDBusPendingCallWatcher* watcher ) {
watcher->deleteLater();
QDBusPendingReply<int> reply = *watcher;
if ( reply.isError() ) {
const QDBusError err = reply.error();
q->emitFinishedWithError( OtherError, tr("Could not open wallet: %1; %2").arg( QDBusError::errorString( err.type() ), err.message() ) );
return;
}
q->emitFinished();
}

View File

@ -1,107 +0,0 @@
/******************************************************************************
* Copyright (C) 2011-2015 Frank Osterfeld <frank.osterfeld@gmail.com> *
* *
* This program 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. For licensing and distribution *
* details, check the accompanying file 'COPYING'. *
*****************************************************************************/
#include "keychain_p.h"
#include <QSettings>
#include <windows.h>
#include <wincrypt.h>
#include <memory>
using namespace QKeychain;
void ReadPasswordJobPrivate::scheduledStart() {
//Use settings member if there, create local settings object if not
std::auto_ptr<QSettings> local( !q->settings() ? new QSettings( q->service() ) : 0 );
QSettings* actual = q->settings() ? q->settings() : local.get();
QByteArray encrypted = actual->value( key ).toByteArray();
if ( encrypted.isNull() ) {
q->emitFinishedWithError( EntryNotFound, tr("Entry not found") );
return;
}
DATA_BLOB blob_in, blob_out;
blob_in.pbData = reinterpret_cast<BYTE*>( encrypted.data() );
blob_in.cbData = encrypted.size();
const BOOL ret = CryptUnprotectData( &blob_in,
NULL,
NULL,
NULL,
NULL,
0,
&blob_out );
if ( !ret ) {
q->emitFinishedWithError( OtherError, tr("Could not decrypt data") );
return;
}
data = QByteArray( reinterpret_cast<char*>( blob_out.pbData ), blob_out.cbData );
SecureZeroMemory( blob_out.pbData, blob_out.cbData );
LocalFree( blob_out.pbData );
q->emitFinished();
}
void WritePasswordJobPrivate::scheduledStart() {
if ( mode == Delete ) {
//Use settings member if there, create local settings object if not
std::auto_ptr<QSettings> local( !q->settings() ? new QSettings( q->service() ) : 0 );
QSettings* actual = q->settings() ? q->settings() : local.get();
actual->remove( key );
actual->sync();
if ( actual->status() != QSettings::NoError ) {
const QString err = actual->status() == QSettings::AccessError
? tr("Could not delete encrypted data from settings: access error")
: tr("Could not delete encrypted data from settings: format error");
q->emitFinishedWithError( OtherError, err );
} else {
q->emitFinished();
}
return;
}
QByteArray data = mode == Binary ? binaryData : textData.toUtf8();
DATA_BLOB blob_in, blob_out;
blob_in.pbData = reinterpret_cast<BYTE*>( data.data() );
blob_in.cbData = data.size();
const BOOL res = CryptProtectData( &blob_in,
L"QKeychain-encrypted data",
NULL,
NULL,
NULL,
0,
&blob_out );
if ( !res ) {
q->emitFinishedWithError( OtherError, tr("Encryption failed") ); //TODO more details available?
return;
}
const QByteArray encrypted( reinterpret_cast<char*>( blob_out.pbData ), blob_out.cbData );
LocalFree( blob_out.pbData );
//Use settings member if there, create local settings object if not
std::auto_ptr<QSettings> local( !q->settings() ? new QSettings( q->service() ) : 0 );
QSettings* actual = q->settings() ? q->settings() : local.get();
actual->setValue( key, encrypted );
actual->sync();
if ( actual->status() != QSettings::NoError ) {
const QString errorString = actual->status() == QSettings::AccessError
? tr("Could not store encrypted data in settings: access error")
: tr("Could not store encrypted data in settings: format error");
q->emitFinishedWithError( OtherError, errorString );
return;
}
q->emitFinished();
}

View File

@ -1,276 +0,0 @@
<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="org.kde.KWallet">
<signal name="walletListDirty">
</signal>
<signal name="walletCreated">
<arg name="wallet" type="s" direction="out"/>
</signal>
<signal name="walletOpened">
<arg name="wallet" type="s" direction="out"/>
</signal>
<signal name="walletAsyncOpened">
<arg name="tId" type="i" direction="out"/>
<arg name="handle" type="i" direction="out"/>
</signal>
<signal name="walletDeleted">
<arg name="wallet" type="s" direction="out"/>
</signal>
<signal name="walletClosed">
<arg name="wallet" type="s" direction="out"/>
</signal>
<signal name="walletClosed">
<arg name="handle" type="i" direction="out"/>
</signal>
<signal name="allWalletsClosed">
</signal>
<signal name="folderListUpdated">
<arg name="wallet" type="s" direction="out"/>
</signal>
<signal name="folderUpdated">
<arg type="s" direction="out"/>
<arg type="s" direction="out"/>
</signal>
<signal name="applicationDisconnected">
<arg name="wallet" type="s" direction="out"/>
<arg name="application" type="s" direction="out"/>
</signal>
<method name="isEnabled">
<arg type="b" direction="out"/>
</method>
<method name="open">
<arg type="i" direction="out"/>
<arg name="wallet" type="s" direction="in"/>
<arg name="wId" type="x" direction="in"/>
<arg name="appid" type="s" direction="in"/>
</method>
<method name="openPath">
<arg type="i" direction="out"/>
<arg name="path" type="s" direction="in"/>
<arg name="wId" type="x" direction="in"/>
<arg name="appid" type="s" direction="in"/>
</method>
<method name="openAsync">
<arg type="i" direction="out"/>
<arg name="wallet" type="s" direction="in"/>
<arg name="wId" type="x" direction="in"/>
<arg name="appid" type="s" direction="in"/>
<arg name="handleSession" type="b" direction="in"/>
</method>
<method name="openPathAsync">
<arg type="i" direction="out"/>
<arg name="path" type="s" direction="in"/>
<arg name="wId" type="x" direction="in"/>
<arg name="appid" type="s" direction="in"/>
<arg name="handleSession" type="b" direction="in"/>
</method>
<method name="close">
<arg type="i" direction="out"/>
<arg name="wallet" type="s" direction="in"/>
<arg name="force" type="b" direction="in"/>
</method>
<method name="close">
<arg type="i" direction="out"/>
<arg name="handle" type="i" direction="in"/>
<arg name="force" type="b" direction="in"/>
<arg name="appid" type="s" direction="in"/>
</method>
<method name="sync">
<arg name="handle" type="i" direction="in"/>
<arg name="appid" type="s" direction="in"/>
<annotation name="org.freedesktop.DBus.Method.NoReply" value="true"/>
</method>
<method name="deleteWallet">
<arg type="i" direction="out"/>
<arg name="wallet" type="s" direction="in"/>
</method>
<method name="isOpen">
<arg type="b" direction="out"/>
<arg name="wallet" type="s" direction="in"/>
</method>
<method name="isOpen">
<arg type="b" direction="out"/>
<arg name="handle" type="i" direction="in"/>
</method>
<method name="users">
<arg type="as" direction="out"/>
<arg name="wallet" type="s" direction="in"/>
</method>
<method name="changePassword">
<arg name="wallet" type="s" direction="in"/>
<arg name="wId" type="x" direction="in"/>
<arg name="appid" type="s" direction="in"/>
</method>
<method name="wallets">
<arg type="as" direction="out"/>
</method>
<method name="folderList">
<arg type="as" direction="out"/>
<arg name="handle" type="i" direction="in"/>
<arg name="appid" type="s" direction="in"/>
</method>
<method name="hasFolder">
<arg type="b" direction="out"/>
<arg name="handle" type="i" direction="in"/>
<arg name="folder" type="s" direction="in"/>
<arg name="appid" type="s" direction="in"/>
</method>
<method name="createFolder">
<arg type="b" direction="out"/>
<arg name="handle" type="i" direction="in"/>
<arg name="folder" type="s" direction="in"/>
<arg name="appid" type="s" direction="in"/>
</method>
<method name="removeFolder">
<arg type="b" direction="out"/>
<arg name="handle" type="i" direction="in"/>
<arg name="folder" type="s" direction="in"/>
<arg name="appid" type="s" direction="in"/>
</method>
<method name="entryList">
<arg type="as" direction="out"/>
<arg name="handle" type="i" direction="in"/>
<arg name="folder" type="s" direction="in"/>
<arg name="appid" type="s" direction="in"/>
</method>
<method name="readEntry">
<arg type="ay" direction="out"/>
<arg name="handle" type="i" direction="in"/>
<arg name="folder" type="s" direction="in"/>
<arg name="key" type="s" direction="in"/>
<arg name="appid" type="s" direction="in"/>
</method>
<method name="readMap">
<arg type="ay" direction="out"/>
<arg name="handle" type="i" direction="in"/>
<arg name="folder" type="s" direction="in"/>
<arg name="key" type="s" direction="in"/>
<arg name="appid" type="s" direction="in"/>
</method>
<method name="readPassword">
<arg type="s" direction="out"/>
<arg name="handle" type="i" direction="in"/>
<arg name="folder" type="s" direction="in"/>
<arg name="key" type="s" direction="in"/>
<arg name="appid" type="s" direction="in"/>
</method>
<method name="readEntryList">
<arg type="a{sv}" direction="out"/>
<annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
<arg name="handle" type="i" direction="in"/>
<arg name="folder" type="s" direction="in"/>
<arg name="key" type="s" direction="in"/>
<arg name="appid" type="s" direction="in"/>
</method>
<method name="readMapList">
<arg type="a{sv}" direction="out"/>
<annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
<arg name="handle" type="i" direction="in"/>
<arg name="folder" type="s" direction="in"/>
<arg name="key" type="s" direction="in"/>
<arg name="appid" type="s" direction="in"/>
</method>
<method name="readPasswordList">
<arg type="a{sv}" direction="out"/>
<annotation name="com.trolltech.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
<arg name="handle" type="i" direction="in"/>
<arg name="folder" type="s" direction="in"/>
<arg name="key" type="s" direction="in"/>
<arg name="appid" type="s" direction="in"/>
</method>
<method name="renameEntry">
<arg type="i" direction="out"/>
<arg name="handle" type="i" direction="in"/>
<arg name="folder" type="s" direction="in"/>
<arg name="oldName" type="s" direction="in"/>
<arg name="newName" type="s" direction="in"/>
<arg name="appid" type="s" direction="in"/>
</method>
<method name="writeEntry">
<arg type="i" direction="out"/>
<arg name="handle" type="i" direction="in"/>
<arg name="folder" type="s" direction="in"/>
<arg name="key" type="s" direction="in"/>
<arg name="value" type="ay" direction="in"/>
<arg name="entryType" type="i" direction="in"/>
<arg name="appid" type="s" direction="in"/>
</method>
<method name="writeEntry">
<arg type="i" direction="out"/>
<arg name="handle" type="i" direction="in"/>
<arg name="folder" type="s" direction="in"/>
<arg name="key" type="s" direction="in"/>
<arg name="value" type="ay" direction="in"/>
<arg name="appid" type="s" direction="in"/>
</method>
<method name="writeMap">
<arg type="i" direction="out"/>
<arg name="handle" type="i" direction="in"/>
<arg name="folder" type="s" direction="in"/>
<arg name="key" type="s" direction="in"/>
<arg name="value" type="ay" direction="in"/>
<arg name="appid" type="s" direction="in"/>
</method>
<method name="writePassword">
<arg type="i" direction="out"/>
<arg name="handle" type="i" direction="in"/>
<arg name="folder" type="s" direction="in"/>
<arg name="key" type="s" direction="in"/>
<arg name="value" type="s" direction="in"/>
<arg name="appid" type="s" direction="in"/>
</method>
<method name="hasEntry">
<arg type="b" direction="out"/>
<arg name="handle" type="i" direction="in"/>
<arg name="folder" type="s" direction="in"/>
<arg name="key" type="s" direction="in"/>
<arg name="appid" type="s" direction="in"/>
</method>
<method name="entryType">
<arg type="i" direction="out"/>
<arg name="handle" type="i" direction="in"/>
<arg name="folder" type="s" direction="in"/>
<arg name="key" type="s" direction="in"/>
<arg name="appid" type="s" direction="in"/>
</method>
<method name="removeEntry">
<arg type="i" direction="out"/>
<arg name="handle" type="i" direction="in"/>
<arg name="folder" type="s" direction="in"/>
<arg name="key" type="s" direction="in"/>
<arg name="appid" type="s" direction="in"/>
</method>
<method name="disconnectApplication">
<arg type="b" direction="out"/>
<arg name="wallet" type="s" direction="in"/>
<arg name="application" type="s" direction="in"/>
</method>
<method name="reconfigure">
</method>
<method name="folderDoesNotExist">
<arg type="b" direction="out"/>
<arg name="wallet" type="s" direction="in"/>
<arg name="folder" type="s" direction="in"/>
</method>
<method name="keyDoesNotExist">
<arg type="b" direction="out"/>
<arg name="wallet" type="s" direction="in"/>
<arg name="folder" type="s" direction="in"/>
<arg name="key" type="s" direction="in"/>
</method>
<method name="closeAllWallets">
</method>
<method name="networkWallet">
<arg type="s" direction="out"/>
</method>
<method name="localWallet">
<arg type="s" direction="out"/>
</method>
<method name="pamOpen">
<arg name="wallet" type="s" direction="in"/>
<arg name="passwordHash" type="ay" direction="in"/>
<arg name="sessionTimeout" type="i" direction="in"/>
<annotation name="org.freedesktop.DBus.Method.NoReply" value="true"/>
</method>
</interface>
</node>

View File

@ -1,17 +0,0 @@
#ifndef QKEYCHAIN_EXPORT_H
#define QKEYCHAIN_EXPORT_H
#include <qglobal.h>
# ifdef QKEYCHAIN_STATICLIB
# undef QKEYCHAIN_SHAREDLIB
# define QKEYCHAIN_EXPORT
# else
# ifdef QKEYCHAIN_BUILD_QKEYCHAIN_LIB
# define QKEYCHAIN_EXPORT Q_DECL_EXPORT
# else
# define QKEYCHAIN_EXPORT Q_DECL_IMPORT
# endif
# endif
#endif

View File

@ -1,98 +0,0 @@
/******************************************************************************
* Copyright (C) 2011-2015 Frank Osterfeld <frank.osterfeld@gmail.com> *
* *
* This program 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. For licensing and distribution *
* details, check the accompanying file 'COPYING'. *
*****************************************************************************/
#include <QCoreApplication>
#include <QStringList>
#include "keychain.h"
#include <iostream>
using namespace QKeychain;
static int printUsage() {
std::cerr << "testclient store <account> <password>" << std::endl;
std::cerr << "testclient restore <account>" << std::endl;
std::cerr << "testclient delete <account>" << std::endl;
return 1;
}
int main( int argc, char** argv ) {
QCoreApplication app( argc, argv );
const QStringList args = app.arguments();
if ( args.count() < 2 )
return printUsage();
QStringList::ConstIterator it = args.constBegin();
++it;
if ( *it == QLatin1String("store") ) {
if ( ++it == args.constEnd() )
return printUsage();
const QString acc = *it;
if ( ++it == args.constEnd() )
return printUsage();
const QString pass = *it;
if ( ++it != args.constEnd() )
return printUsage();
WritePasswordJob job( QLatin1String("qtkeychain-testclient") );
job.setAutoDelete( false );
job.setKey( acc );
job.setTextData( pass );
QEventLoop loop;
job.connect( &job, SIGNAL(finished(QKeychain::Job*)), &loop, SLOT(quit()) );
job.start();
loop.exec();
if ( job.error() ) {
std::cerr << "Storing password failed: " << qPrintable(job.errorString()) << std::endl;
return 1;
}
std::cout << "Password stored successfully" << std::endl;
} else if ( *it == QLatin1String("restore") ) {
if ( ++it == args.constEnd() )
return printUsage();
const QString acc = *it;
if ( ++it != args.constEnd() )
return printUsage();
ReadPasswordJob job( QLatin1String("qtkeychain-testclient") );
job.setAutoDelete( false );
job.setKey( acc );
QEventLoop loop;
job.connect( &job, SIGNAL(finished(QKeychain::Job*)), &loop, SLOT(quit()) );
job.start();
loop.exec();
const QString pw = job.textData();
if ( job.error() ) {
std::cerr << "Restoring password failed: " << qPrintable(job.errorString()) << std::endl;
return 1;
}
std::cout << qPrintable(pw) << std::endl;
} else if ( *it == QLatin1String("delete") ) {
if ( ++it == args.constEnd() )
return printUsage();
const QString acc = *it;
if ( ++it != args.constEnd() )
return printUsage();
DeletePasswordJob job( QLatin1String("qtkeychain-testclient") );
job.setAutoDelete( false );
job.setKey( acc );
QEventLoop loop;
job.connect( &job, SIGNAL(finished(QKeychain::Job*)), &loop, SLOT(quit()) );
job.start();
loop.exec();
if ( job.error() ) {
std::cerr << "Deleting password failed: " << qPrintable(job.errorString()) << std::endl;
return 1;
}
std::cout << "Password deleted successfully" << std::endl;
} else {
return printUsage();
}
}

View File

@ -1,177 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="de_DE">
<context>
<name>QKeychain::ReadPasswordJobPrivate</name>
<message>
<location filename="../keychain_unix.cpp" line="140"/>
<source>Unknown error</source>
<translation>Unbekannter Fehler</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="129"/>
<source>D-Bus is not running</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="222"/>
<source>No keychain service available</source>
<translation>Kein Schlüsselbund-Dienst verfügbar</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="224"/>
<source>Could not open wallet: %1; %2</source>
<translation>Konnte Brieftasche nicht öffnen: %1; %2</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="270"/>
<source>Access to keychain denied</source>
<translation>Zugriff auf Schlüsselbund verweigert</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="291"/>
<source>Could not determine data type: %1; %2</source>
<translation>Datentyp kann nicht ermittelt werden: %1: %2</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="309"/>
<source>Unsupported entry type &apos;Map&apos;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="312"/>
<source>Unknown kwallet entry type &apos;%1&apos;</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="327"/>
<source>Could not read password: %1; %2</source>
<translation>Passwort konnte nicht ausgelesen werden: %1; %2</translation>
</message>
<message>
<location filename="../keychain_mac.cpp" line="76"/>
<source>Password not found</source>
<translation>Passwort nicht gefunden</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="300"/>
<location filename="../keychain_win.cpp" line="27"/>
<source>Entry not found</source>
<translation>Eintrag nicht gefunden</translation>
</message>
<message>
<location filename="../keychain_win.cpp" line="44"/>
<source>Could not decrypt data</source>
<translation>Kann Daten nicht entschlüsseln</translation>
</message>
</context>
<context>
<name>QKeychain::WritePasswordJobPrivate</name>
<message>
<location filename="../keychain_unix.cpp" line="364"/>
<location filename="../keychain_unix.cpp" line="372"/>
<source>Unknown error</source>
<translation>Unbekannter Fehler</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="352"/>
<source>D-Bus is not running</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="420"/>
<location filename="../keychain_unix.cpp" line="505"/>
<source>Could not open wallet: %1; %2</source>
<translation>Konnte Brieftasche nicht öffnen: %1; %2</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="483"/>
<source>Access to keychain denied</source>
<translation>Zugriff auf Schlüsselbund verweigert</translation>
</message>
<message>
<location filename="../keychain_win.cpp" line="64"/>
<source>Could not delete encrypted data from settings: access error</source>
<translation>Kann verschlüsselte Daten nicht aus den Einstellungen entfernen: Zugriffsfehler</translation>
</message>
<message>
<location filename="../keychain_win.cpp" line="65"/>
<source>Could not delete encrypted data from settings: format error</source>
<translation>Kann verschlüsselte Daten nicht aus den Einstellungen entfernen: Formatfehler</translation>
</message>
<message>
<location filename="../keychain_win.cpp" line="85"/>
<source>Encryption failed</source>
<translation>Verschlüsselung fehlgeschlagen</translation>
</message>
<message>
<location filename="../keychain_win.cpp" line="100"/>
<source>Could not store encrypted data in settings: access error</source>
<translation>Kann verschlüsselte Daten nicht in den Einstellungen speichern: Zugriffsfehler</translation>
</message>
<message>
<location filename="../keychain_win.cpp" line="101"/>
<source>Could not store encrypted data in settings: format error</source>
<translation>Kann verschlüsselte Daten nicht in den Einstellungen speichern: Formatfehler</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="../keychain_unix.cpp" line="167"/>
<source>Access to keychain denied</source>
<translation>Zugriff auf Schlüsselbund verweigert</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="169"/>
<source>No keyring daemon</source>
<translation>Kein Schlüsselbund-Dienst </translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="171"/>
<source>Already unlocked</source>
<translation>Bereits entsperrt</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="173"/>
<source>No such keyring</source>
<translation>Kein solcher Schlüsselbund</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="175"/>
<source>Bad arguments</source>
<translation>Ungültige Argumente</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="177"/>
<source>I/O error</source>
<translation>Ein-/Ausgabe-Fehler</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="179"/>
<source>Cancelled</source>
<translation>Abgebrochen</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="181"/>
<source>Keyring already exists</source>
<translation>Schlüsselbund existiert bereits</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="183"/>
<source>No match</source>
<translation>Kein Treffer</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="188"/>
<source>Unknown error</source>
<translation>Unbekannter Fehler</translation>
</message>
<message>
<location filename="../keychain_mac.cpp" line="31"/>
<location filename="../keychain_mac.cpp" line="33"/>
<source>%1 (OSStatus %2)</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@ -1,178 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="ro_RO">
<context>
<name>QKeychain::ReadPasswordJobPrivate</name>
<message>
<location filename="../keychain_unix.cpp" line="140"/>
<source>Unknown error</source>
<translation>Eroare necunoscută</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="129"/>
<source>D-Bus is not running</source>
<translation>D-Bus nu rulează</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="222"/>
<source>No keychain service available</source>
<translatorcomment>Nu există niciun serviciu de chei disponibil</translatorcomment>
<translation>Kein Schlüsselbund-Dienst verfügbar</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="224"/>
<source>Could not open wallet: %1; %2</source>
<translation>Nu se poate deschide portofelul: %1; %2</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="270"/>
<source>Access to keychain denied</source>
<translation>Acces interzis la serviciul de chei</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="291"/>
<source>Could not determine data type: %1; %2</source>
<translation>Nu se poate stabili tipul de date: %1: %2</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="309"/>
<source>Unsupported entry type &apos;Map&apos;</source>
<translation>Tip de înregistrare nesuportat &apos;Map&apos;</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="312"/>
<source>Unknown kwallet entry type &apos;%1&apos;</source>
<translation>Tip de înregistrare kwallet necunoscut &apos;%1&apos;</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="327"/>
<source>Could not read password: %1; %2</source>
<translation>Nu se poate citi parola: %1; %2</translation>
</message>
<message>
<location filename="../keychain_mac.cpp" line="76"/>
<source>Password not found</source>
<translation>Parola nu a fost găsită</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="300"/>
<location filename="../keychain_win.cpp" line="27"/>
<source>Entry not found</source>
<translation>Înregistrarea nu a fost găsită</translation>
</message>
<message>
<location filename="../keychain_win.cpp" line="44"/>
<source>Could not decrypt data</source>
<translation>Nu se poate decripta data</translation>
</message>
</context>
<context>
<name>QKeychain::WritePasswordJobPrivate</name>
<message>
<location filename="../keychain_unix.cpp" line="364"/>
<location filename="../keychain_unix.cpp" line="372"/>
<source>Unknown error</source>
<translation>Eroare necunoscută</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="352"/>
<source>D-Bus is not running</source>
<translation>D-Bus nu rulează</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="420"/>
<location filename="../keychain_unix.cpp" line="505"/>
<source>Could not open wallet: %1; %2</source>
<translation>Nu se poate deschide portofelul: %1; %2</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="483"/>
<source>Access to keychain denied</source>
<translation>Acces interzis la serviciul de chei</translation>
</message>
<message>
<location filename="../keychain_win.cpp" line="64"/>
<source>Could not delete encrypted data from settings: access error</source>
<translation>Nu se pot șterge datele criptate din setări: eroare de acces</translation>
</message>
<message>
<location filename="../keychain_win.cpp" line="65"/>
<source>Could not delete encrypted data from settings: format error</source>
<translation>Nu se pot șterge datele criptate din setări: eroare de format</translation>
</message>
<message>
<location filename="../keychain_win.cpp" line="85"/>
<source>Encryption failed</source>
<translation>Criptarea a eșuat</translation>
</message>
<message>
<location filename="../keychain_win.cpp" line="100"/>
<source>Could not store encrypted data in settings: access error</source>
<translation>Nu se pot stoca datele criptate în setări: eroare de acces</translation>
</message>
<message>
<location filename="../keychain_win.cpp" line="101"/>
<source>Could not store encrypted data in settings: format error</source>
<translation>Nu se pot stoca datele criptate în setări: eroare de format</translation>
</message>
</context>
<context>
<name>QObject</name>
<message>
<location filename="../keychain_unix.cpp" line="167"/>
<source>Access to keychain denied</source>
<translation>Acces interzis la serviciul de chei</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="169"/>
<source>No keyring daemon</source>
<translation>Niciun demon pentru inelul de chei</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="171"/>
<source>Already unlocked</source>
<translation>Deja deblocat</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="173"/>
<source>No such keyring</source>
<translation>Nu există astfel de inel de chei</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="175"/>
<source>Bad arguments</source>
<translation>Argumente greșite</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="177"/>
<source>I/O error</source>
<translation>Eroare de I/E</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="179"/>
<source>Cancelled</source>
<translation>Anulat</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="181"/>
<source>Keyring already exists</source>
<translation>Inelul de chei deja există</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="183"/>
<source>No match</source>
<translation>Nicio potrivire</translation>
</message>
<message>
<location filename="../keychain_unix.cpp" line="188"/>
<source>Unknown error</source>
<translation>Eroare necunoscută</translation>
</message>
<message>
<location filename="../keychain_mac.cpp" line="31"/>
<location filename="../keychain_mac.cpp" line="33"/>
<source>%1 (OSStatus %2)</source>
<translation>%1 (OSStatus %2)</translation>
</message>
</context>
</TS>

279
fuel.pro
View File

@ -1,147 +1,132 @@
#-------------------------------------------------
# Fuel
#-------------------------------------------------
QT = core gui webkit
contains(QT_VERSION, ^5\\..*) {
QT += widgets webkitwidgets
QT -= quick multimediawidgets opengl printsupport qml multimedia positioning sensors
}
TARGET = Fuel
TEMPLATE = app
win32 {
RC_FILE = rsrc/fuel.rc
LIBS += -luser32 -lshell32 -luuid
}
macx {
ICON = rsrc/icons/fuel.icns
}
# FreeBSD needs explicit paths to Qt install
unix:freebsd {
INCLUDEPATH += /usr/local/include
LIBS += -L/usr/local/lib
}
unix:!macx {
TARGET = fuel
ICON = rsrc/icons/fuel.png
PREFIX = /usr
BINDIR = $$PREFIX/bin
DATADIR = $$PREFIX/share
target.path = $$BINDIR
desktop.path = $$DATADIR/applications
desktop.files += rsrc/fuel.desktop
icon.path = $$DATADIR/icons/hicolor/256x256/apps
icon.files += rsrc/icons/fuel.png
INSTALLS += target desktop icon
system(intl/convert.sh)
}
INCLUDEPATH += src
SOURCES += src/main.cpp\
src/MainWindow.cpp \
src/CommitDialog.cpp \
src/FileActionDialog.cpp \
src/SettingsDialog.cpp \
src/FslSettingsDialog.cpp \
src/CloneDialog.cpp \
src/RevisionDialog.cpp \
src/Utils.cpp \
src/FileTableView.cpp \
src/LoggedProcess.cpp \
src/BrowserWidget.cpp \
src/CustomWebView.cpp \
src/Fossil.cpp \
src/Workspace.cpp \
src/SearchBox.cpp \
src/Settings.cpp \
src/RemoteDialog.cpp \
src/AboutDialog.cpp
HEADERS += src/MainWindow.h \
src/CommitDialog.h \
src/FileActionDialog.h \
src/SettingsDialog.h \
src/FslSettingsDialog.h \
src/CloneDialog.h \
src/RevisionDialog.h \
src/Utils.h \
src/FileTableView.h \
src/LoggedProcess.h \
src/BrowserWidget.h \
src/CustomWebView.h \
src/Fossil.h \
src/Workspace.h \
src/SearchBox.h \
src/Settings.h \
src/RemoteDialog.h \
src/AboutDialog.h
FORMS += ui/MainWindow.ui \
ui/CommitDialog.ui \
ui/FileActionDialog.ui \
ui/SettingsDialog.ui \
ui/FslSettingsDialog.ui \
ui/CloneDialog.ui \
ui/BrowserWidget.ui \
ui/RevisionDialog.ui \
ui/RemoteDialog.ui \
ui/AboutDialog.ui
RESOURCES += \
rsrc/resources.qrc
# QtKeychain
SOURCES += ext/qtkeychain/keychain.cpp
HEADERS += ext/qtkeychain/keychain.h \
ext/qtkeychain/keychain_p.h \
ext/qtkeychain/qkeychain_export.h
DEFINES += QKEYCHAIN_STATICLIB
unix:!macx {
QT += dbus
SOURCES += ext/qtkeychain/keychain_unix.cpp \
ext/qtkeychain/gnomekeyring.cpp
HEADERS += ext/qtkeychain/gnomekeyring_p.h
DBUS_INTERFACES += ext/qtkeychain/org.kde.KWallet.xml
}
macx {
SOURCES += ext/qtkeychain/keychain_mac.cpp
}
win32 {
SOURCES += ext/qtkeychain/keychain_win.cpp
LIBS += -lCrypt32
}
CODECFORTR = UTF-8
TRANSLATIONS += \
intl/en_US.ts \
intl/el_GR.ts \
intl/de_DE.ts \
intl/es_ES.ts \
intl/fr_FR.ts \
intl/ru_RU.ts \
intl/pt_PT.ts \
intl/it_IT.ts \
intl/nl_NL.ts \
intl/ko_KO.ts \
#-------------------------------------------------
# Fuel
#-------------------------------------------------
lessThan(QT_MAJOR_VERSION, 5) {
message("Unsupported Qt version $${QT_VERSION}.")
error("Fuel requires Qt 5.4.0 or greater")
}
# Fuel requires at least Qt 5.4 due to QtWebEngine
equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 4) {
message("Unsupported Qt version $${QT_VERSION}.")
error("Fuel requires Qt 5.4.0 or greater")
}
QT = core gui widgets webengine webenginewidgets
QT-= quick multimediawidgets opengl printsupport qml multimedia positioning sensors
TARGET = Fuel
TEMPLATE = app
DEFINES += FUEL_VERSION=\\\"2.0.1\\\"
win32 {
RC_FILE = rsrc/fuel.rc
LIBS += -luser32 -lshell32 -luuid
}
macx {
ICON = rsrc/icons/fuel.icns
}
# FreeBSD needs explicit paths to Qt install
unix:freebsd {
INCLUDEPATH += /usr/local/include
LIBS += -L/usr/local/lib
}
unix:!macx {
TARGET = fuel
ICON = rsrc/icons/fuel.png
PREFIX = /usr
BINDIR = $$PREFIX/bin
DATADIR = $$PREFIX/share
target.path = $$BINDIR
desktop.path = $$DATADIR/applications
desktop.files += rsrc/fuel.desktop
icon.path = $$DATADIR/icons/hicolor/256x256/apps
icon.files += rsrc/icons/fuel.png
INSTALLS += target desktop icon
}
exists( $$OUT_PWD/conanbuildinfo.pri ) {
message("Using conan packages")
CONFIG += conan_basic_setup
include($$OUT_PWD/conanbuildinfo.pri)
} else {
QT += Qt5Keychain
}
INCLUDEPATH += src
SOURCES += src/main.cpp\
src/MainWindow.cpp \
src/CommitDialog.cpp \
src/FileActionDialog.cpp \
src/SettingsDialog.cpp \
src/FslSettingsDialog.cpp \
src/CloneDialog.cpp \
src/RevisionDialog.cpp \
src/Utils.cpp \
src/FileTableView.cpp \
src/LoggedProcess.cpp \
src/BrowserWidget.cpp \
src/CustomWebView.cpp \
src/Fossil.cpp \
src/Workspace.cpp \
src/SearchBox.cpp \
src/AppSettings.cpp \
src/RemoteDialog.cpp \
src/AboutDialog.cpp
HEADERS += src/MainWindow.h \
src/CommitDialog.h \
src/FileActionDialog.h \
src/SettingsDialog.h \
src/FslSettingsDialog.h \
src/CloneDialog.h \
src/RevisionDialog.h \
src/Utils.h \
src/FileTableView.h \
src/LoggedProcess.h \
src/BrowserWidget.h \
src/CustomWebView.h \
src/Fossil.h \
src/Workspace.h \
src/SearchBox.h \
src/AppSettings.h \
src/RemoteDialog.h \
src/AboutDialog.h \
src/WorkspaceCommon.h
FORMS += ui/MainWindow.ui \
ui/CommitDialog.ui \
ui/FileActionDialog.ui \
ui/SettingsDialog.ui \
ui/FslSettingsDialog.ui \
ui/CloneDialog.ui \
ui/BrowserWidget.ui \
ui/RevisionDialog.ui \
ui/RemoteDialog.ui \
ui/AboutDialog.ui
RESOURCES += \
rsrc/resources.qrc
CODECFORTR = UTF-8
TRANSLATIONS += \
intl/en_US.ts \
intl/el_GR.ts \
intl/de_DE.ts \
intl/es_ES.ts \
intl/fr_FR.ts \
intl/ru_RU.ts \
intl/pt_PT.ts \
intl/it_IT.ts \
intl/nl_NL.ts \
intl/ko_KR.ts \

View File

@ -1,23 +0,0 @@
@echo off
setlocal EnableDelayedExpansion
set SCRIPTDIR=%CD%
set PRJDIR=%SCRIPTDIR%\..
set QTPATH=C:\Qt\5.4\mingw491_32
echo Converting localizations
del /q %PRJDIR%\rsrc\intl\*
if not exist %PRJDIR%\rsrc\intl\ mkdir %PRJDIR%\rsrc\intl\
REM Convert all except the en_US which is the original text in the code
%QTPATH%\bin\lrelease de_DE.ts -qm ..\rsrc\intl\de_DE.qm
%QTPATH%\bin\lrelease el_GR.ts -qm ..\rsrc\intl\el_GR.qm
%QTPATH%\bin\lrelease es_ES.ts -qm ..\rsrc\intl\es_ES.qm
%QTPATH%\bin\lrelease fr_FR.ts -qm ..\rsrc\intl\fr_FR.qm
%QTPATH%\bin\lrelease ru_RU.ts -qm ..\rsrc\intl\ru_RU.qm
%QTPATH%\bin\lrelease pt_PT.ts -qm ..\rsrc\intl\pt_PT.qm
%QTPATH%\bin\lrelease it_IT.ts -qm ..\rsrc\intl\it_IT.qm
%QTPATH%\bin\lrelease nl_NL.ts -qm ..\rsrc\intl\nl_NL.qm
%QTPATH%\bin\lrelease ko_KR.ts -qm ..\rsrc\intl\ko_KR.qm
endlocal

View File

@ -1,36 +0,0 @@
#!/bin/sh
SCRIPTDIR="$( cd "$( dirname "$0" )" && pwd )"
PRJDIR=$SCRIPTDIR/..
INTLDIR=$SCRIPTDIR
# Detect lrelease tool
if which lrelease-qt5 2>/dev/null; then
LRELEASE="lrelease-qt5"
elif which lrelease4 2>/dev/null; then
LRELEASE="lrelease4"
elif which lrelease 2>/dev/null; then
LRELEASE="lrelease"
else
echo "lrelease not found"
exit 1
fi
echo "Using ${LRELEASE}"
echo "Converting localizations"
rm -rf $PRJDIR/rsrc/intl
mkdir $PRJDIR/rsrc/intl
for i in $INTLDIR/*.ts
do
BASE=`basename $i .ts`
# Convert all except the en_US which is
# the original text in the code
if [ "$BASE" != "en_US" ]; then
echo "$TARGET"
$LRELEASE $i -qm $PRJDIR/rsrc/intl/$BASE.qm
fi
done

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +0,0 @@
#!/bin/sh
# Update existing translations
lupdate-qt5 ../fuel.pro

266
manifest
View File

@ -1,266 +0,0 @@
C Custom\sactions\snow\sexpect\smacros\sfor\sfile\sand\sfolder\sexpansion\nCustom\sactions\snow\strigger\seven\swithout\sa\sselection\nUse\snative\spath\sseparators\sin\scustom\sactions\n
D 2015-08-21T10:54:20.418
F .travis.yml 77966888a81c4ceee1fcc79bce842c9667ad8a35
F debian/changelog eb4304dfcb6bb66850ec740838090eb50ce1249b
F debian/compat b6abd567fa79cbe0196d093a067271361dc6ca8b
F debian/control f4f9bbf38a523520eadbb6f66325d2784297e2a0
F debian/copyright 6bcc83e13533b6cc208f3cd423f1f483163b62ad
F debian/fuel.install 761f61f2c45aa522df4ffb345121c10da958cb63
F debian/menu aa1321fe6597a631df5cc978a3cf7b21ac1a3657
F debian/rules 468914cbcf1bcc252ab3f616e1fdc2b37bc10b5d x
F debian/source/format 1064dc0ce263680c076a1005f35ec906a5cf5a32
F debian/watch 34f0921ff100a3e16a7ad84dcc303731de830a60
F dist/arch/PKGBUILD 26623327e467028a883cd13963daa36baf10dfa3
F dist/win/fuel.iss ef3558dbba409eb194938b930377fc9ee27d319e
F doc/Building.md 149d959751ae488829e084a9f88449a08220c1d1
F doc/Changes.md af49b873012c6b453fe8084f46b6aadbd6fe6e63
F doc/License.txt 4cc77b90af91e615a64ae04893fdffa7939db84c
F ext/qtkeychain/CMakeLists.txt fc1afa05034f2765ba243ce758a7e9d6b6efe2d6
F ext/qtkeychain/COPYING d0f83c8198fdd5464d2373015b7b64ce7cae607e
F ext/qtkeychain/ChangeLog 1703279e17036995806ba1719033d14840a8a7e2
F ext/qtkeychain/QtKeychainBuildTreeSettings.cmake.in a50c3b646181124f15b946c3297f13012e959341
F ext/qtkeychain/QtKeychainConfig.cmake.in ac7c87e54854a06c51e00f833f21f8323d1e6884
F ext/qtkeychain/QtKeychainConfigVersion.cmake.in 3b650037d5775f28802c0471afe2cf6dbe51084e
F ext/qtkeychain/ReadMe.markdown 65fe7f400600aa98a9a7fa5c3fc842ad8699cc43
F ext/qtkeychain/ReadMe.txt 65fe7f400600aa98a9a7fa5c3fc842ad8699cc43
F ext/qtkeychain/cmake/Modules/GNUInstallDirs.cmake 7a2ccf81f25546e93a6f48c792cdebaae51857e9
F ext/qtkeychain/gnomekeyring.cpp 7fa97bd4ffb7c9df00d25e56cd9173d34109afe6
F ext/qtkeychain/gnomekeyring_p.h 7f6acaf6d00b36bd08f5f31ba9136efa969e9875
F ext/qtkeychain/keychain.cpp 427cbda7c6a76de995b1f1b4caa700cd06a9d19a
F ext/qtkeychain/keychain.h f084c671b481af6ac7ce00bf641055a3cfc9cf9b
F ext/qtkeychain/keychain_mac.cpp a028f6fc5e40f9ab88c94ebe30b8b0ae417f2f34
F ext/qtkeychain/keychain_p.h 36f4caee2cbdbde971a1105ab388681ad2924665
F ext/qtkeychain/keychain_unix.cpp 8e657da9acd9e86b2fdec19dc40f1afa4a1c5191
F ext/qtkeychain/keychain_win.cpp e52877828703650219c1c674e618c7211f588d0d
F ext/qtkeychain/org.kde.KWallet.xml f3729fda9f8fa8031a6f69415dcc29455c3c9ae6
F ext/qtkeychain/qkeychain_export.h d756528188ef9bf3c4461ecc80048f06c362b54b
F ext/qtkeychain/testclient.cpp cb1290a9584b627306a7bfdf1c02a8bbae503f5f
F ext/qtkeychain/translations/qtkeychain_de.ts 0a70c8205c066c30ed8172f0670942de1fc5eede
F ext/qtkeychain/translations/qtkeychain_ro.ts f16939382fd1a047b0692426bc82847347f14b32
F fuel.pro 7802dc9513da36539818ee1e927ec1e3494ecb54
F intl/convert.bat 357d461ee8c6a7be6d2f60ac77c3232678ffb513 x
F intl/convert.sh ac6edc8d99b575601cf9c6b85b18c9e25875b6e0 x
F intl/de_DE.ts e2faceab920ac60c97bbc6fba038e261d51fc741
F intl/el_GR.ts 1b805ee57309d02059d9e3e4cb49d945f9d9ac82
F intl/en_US.ts 7917816efedf35d5f4f798d18896d7aa0cb3c71b
F intl/es_ES.ts fbddd3374f7999e602536de9870ae1fef0c28ea8
F intl/fr_FR.ts 8d2c00ab00927ee5239c1d273f380bbe4cfb2464
F intl/it_IT.ts 54b962cc19ce2e86268da67cea63db53beb751af
F intl/ko_KR.ts fecec68593af8a862f032c0361eaf94a1737736f
F intl/nl_NL.ts ff9b6ae9da5b6ffacc74fc1075a14ad80ebc0429
F intl/pt_PT.ts f93bcc3df5447ab1d85407e1dec4cd68c03d2245
F intl/ru_RU.ts 74189b3ee2b30b0b47b2db5bd7c9935db84947fc
F intl/update.sh 39d4561630ba6681bb27e7beadc225a31469728f x
F rsrc/docs/Licenses.txt 4021c1b126d55c1630ae2b43a8b805f99e39a357
F rsrc/docs/Translators.txt caf04efd7391546adda7da73679156e3ff5d5fcd
F rsrc/fuel.desktop 43145556bc61f5a91b497c38a16aec44af271d29
F rsrc/fuel.rc 8e9ac966f283102c11a77cd7f936cdc09e09bd79
F rsrc/icons/Address\sBook-01.png ef2cec80ea5a559b72e8be4a344a1869fe69cbd8
F rsrc/icons/Adobe\sIllustrator\sCS3\sDocument-01.png 2e44e933d58eefee7ccfa1650fed4ceadcf3c2be
F rsrc/icons/Adobe\sPDF\sDocument-01.png 8a0bc3ba633d08debde748d64b5a9675e30447a3
F rsrc/icons/Adobe\sPhotoshop\sCS3\sDocument-01.png 2adf660fad1e339e4a5dc0fded32902ba7e98379
F rsrc/icons/Battery-01.png 40daf53b7f6bdcdd0d6aa5ef433d078ec5ea4342
F rsrc/icons/Binoculars-01.png 386d0f3f9fa5b80a0abb650b3704bb450434d44f
F rsrc/icons/Book-01.png 07fc552ba34b69f4d038dfe57f23be211405ed27
F rsrc/icons/Briefcase-01.png 43cc1bb663f3470303cd94b473128f44754fcffa
F rsrc/icons/Button\sAdd-01.png e256fcdf5f374e58f0731ef500e7cd3117a7b6ec
F rsrc/icons/Button\sBlank\sBlue-01.png 1935637b553ca06c5187ef7fc52f90536c989f07
F rsrc/icons/Button\sBlank\sGray-01.png 2758d7f21d1fe39f5fb942fcb1c4b8aafe5eb61e
F rsrc/icons/Button\sBlank\sGreen-01.png 75ba0e98d49367f364cf4138825fb94a1acbe947
F rsrc/icons/Button\sBlank\sRed-01.png 9126ac9058892f2ea02589a458ebb1910a88d6a4
F rsrc/icons/Button\sBlank\sYellow-01.png c99b31de0194cc4a569d6286ffdc6c63237b7e80
F rsrc/icons/Button\sCancel-01.png 18ca405914aa4af713432bc2e440e34f8159b8e7
F rsrc/icons/Button\sClose-01.png 61e86985ea0820b2b1c77687085a334f80e8683f
F rsrc/icons/Button\sDelete-01.png bd92e3cac0a2de2c9d7423f6f7148484c4082c37
F rsrc/icons/Button\sDownload-01.png d4225280a2dc32202eed8effd5054974f2b88157
F rsrc/icons/Button\sFavorite-01.png 8d2cf9abaf1949070b1a619ccd16ed1edc4ae9d0
F rsrc/icons/Button\sForward-01.png 6e331bfd3a233a40d6fa6fef3a521701ef348efe
F rsrc/icons/Button\sHelp-01.png d039a2098fca2627ad8788c6b32af93ab42844f0
F rsrc/icons/Button\sInfo-01.png be1b3aa44d390070fd2bf4e01283c3eb3965764a
F rsrc/icons/Button\sLog\sOff-01.png 40c91569a169521608f0bb768a553d0376120573
F rsrc/icons/Button\sNext-01.png 964bed76e228f8c9efa11300b691b839478e11a0
F rsrc/icons/Button\sPause-01.png 9c1d5a8fd2a0b609909a3756c173b147c2cc49e5
F rsrc/icons/Button\sPlay-01.png 89bdf23e613c74e57979cb197bfd00e09c1c8a79
F rsrc/icons/Button\sPrevious-01.png 92f7a31def5383ec7a86f0414aa70f54c7f4bce8
F rsrc/icons/Button\sRefresh-01.png 594c33a7ecc20dd13dd0e8717f873357da50cb6c
F rsrc/icons/Button\sReload-01.png 7566acfe8bfa1b022e27010b943e3852d7f33808
F rsrc/icons/Button\sReminder-01.png b6603db497ab7c8c8aef63d999ff5ac5c614610d
F rsrc/icons/Button\sRewind-01.png 6356da09a8b401cc5f7c430b0c529f8702feac52
F rsrc/icons/Button\sTalk\sBalloon-01.png a6f9ffb5f2dd0bd3a41048651a6aacdf53ee1c37
F rsrc/icons/Button\sTurn\sOff-01.png eb741164d55a0d7b5d073a0113abc45ebe0c4b5b
F rsrc/icons/Button\sTurn\sOn-01.png 2856f779e240a99bc5d181b52f358ce92c65700e
F rsrc/icons/Button\sUpload-01.png 942019d20bc3bd7227bd1624d2ffc3d5531963b0
F rsrc/icons/Button\sWarning-01.png bd41b99c1584a86181f5fb8ff213f86334e3d94b
F rsrc/icons/Calculator-01.png a52cc6339c98f3a8f467ce8eb8e60f34eb778f61
F rsrc/icons/Calendar\sBlue-01.png 80f5da756794307a8d354a8bf715d6e687ee920e
F rsrc/icons/Calendar\sGreen-01.png bb242aa1b9e6c997fcc91968143b492516d9d27f
F rsrc/icons/Calendar\sRed-01.png 179b04cc2700660823720d1a7679b33de7b958b8
F rsrc/icons/Clipboard\sPaste-01.png 9d93fc2ce21e7aa4211a0dde9023589b374262e8
F rsrc/icons/Clipboard-01.png bb9c311135d48bd6a3d435f0c5d51ff4c35b6b3c
F rsrc/icons/Clock-01.png 6607d4181689c30e91bfdd16159ecbd742dbdce4
F rsrc/icons/Coin-01.png 36bfdcba641f0ecdb902771b71a18e154777102f
F rsrc/icons/Compressed\sFile\sRAR-01.png c2de3e5ac4547639f9d311b61fca84478531e67c
F rsrc/icons/Compressed\sFile\sSIT-01.png 4adbd6c08e7f4f292abd7298fad6da6d0ff5d3b9
F rsrc/icons/Compressed\sFile\sZip-01.png 3ac05b15cb16df4a2ee6c2320ebd4312ceeb63aa
F rsrc/icons/Computer\sMonitor-01.png f17362f4ec7afd4531eaef6a905a2e25c5b64b63
F rsrc/icons/Computer\sNetwork-01.png fa296534cbc19c9fd5a683a02bb5aa5f85022d08
F rsrc/icons/Document\sAttach-01.png 50bbd2ff79326893f93224c46d0d41f21c675f59
F rsrc/icons/Document\sBlank-01.png c4e260ee3d1461eae0f9b12fe4bf84e6ef710a40
F rsrc/icons/Document\sChart-01.png 3764305ca853077a2fa0dc1e264c2aeebf44d192
F rsrc/icons/Document\sCopy-01.png 2d56e677afb57ab2423bdaaaabc5353369346b61
F rsrc/icons/Document\sFlow\sChart-01.png 4f954822a1a0b5ca0f66c0c48bf18f1fd4fa6b21
F rsrc/icons/Document\sGant\sChart-01.png c94eb569a056bdcc61e1daed4ef8d763b3db1e70
F rsrc/icons/Document\sHelp-01.png 27ac48d35020476070382d68bd1d652ee5996589
F rsrc/icons/Document\sLine\sChart-01.png 47427bbde9d578dbf7a3ce317b5fcad35a5b53b9
F rsrc/icons/Document\sMicrosoft\sExcel-01.png 1961228e739fe2451aa0a3375c8328e5a1038a8a
F rsrc/icons/Document\sMicrosoft\sPowerPoint-01.png f83b4dc5665201b9038690efb4403bcb4281b7bf
F rsrc/icons/Document\sMicrosoft\sWord-01.png 1e994fe798bd71bde553f119ca4d95eb2534992a
F rsrc/icons/Document\sOrganization\sChart-01.png 08e2d90232609a6537ff27c2fcbaf8669d27eef4
F rsrc/icons/Document\sPreview-01.png 6dad0c2b3796f79b9ca2afeda35a4a25b2bf1a93
F rsrc/icons/Document\sText-01.png d2032f213666611e1f2ac3c6d3bbd5ac3cb70c4e
F rsrc/icons/Document-01.png 5caa3fb0c2803a5824967b772e221b8a6bf81888
F rsrc/icons/Document-Revert-icon.png e0b9cdfe17a0f5f56fea52f129adb99e99d3013a
F rsrc/icons/Edit\sDocument-01.png f83318cc0406ec8404162c6fd90bdb87ffd953d2
F rsrc/icons/Email\sAttachment-01.png 9140f252ce29af0f3ca8f8b9438bc5fd73084627
F rsrc/icons/Email\sDelete-01.png 6f7f1f536dcedf8e560a688e10be05c8f292f481
F rsrc/icons/Email\sDownload-01.png b258db6c84afd8d25ad083388715040549fc4f5d
F rsrc/icons/Email\sForward-01.png 2103ff91b3892d31f972ee05c0ae0975bd15630f
F rsrc/icons/Email\sInbox-01.png da93bcba8b4b4e8c809f03c0b0bf836debc26034
F rsrc/icons/Email\sReply-01.png 0d8c08f82ab27fdec23ee9876df08de17c2ceea8
F rsrc/icons/Email-01.png 92d6b1952b23844c162f9641988e1d1d367c6827
F rsrc/icons/File\sAudio\sAIFF-01.png f96b29301442962bf8d0cd9474526213ca91cb0f
F rsrc/icons/File\sAudio\sMP3-01.png ed08e831ac7fa06d307562e0831b1d5279dd0df7
F rsrc/icons/File\sAudio\sWAV-01.png 3c67326fd5ded4dc81792b2439dfc9f9c8c202c9
F rsrc/icons/File\sAudio\sWMA-01.png 90ed8def8fb40f1072087b008a7247dd4c477f5a
F rsrc/icons/File\sAudio-01.png 6b05fba6d25c44345fe7feebc874e3dc0579a980
F rsrc/icons/File\sDelete-01.png e41d9c1bfda748df54f4a60c4bf09e33f01be36e
F rsrc/icons/File\sHistory-01.png e009e86ecf1ab1f79aacd74d69f7c99f7f6a3134
F rsrc/icons/File\sNew-01.png 48347428962e33d2b4b25f4dce85dc892d673aea
F rsrc/icons/File\sOpen-01.png 406b558c24285b5da50604d89c171a8684b9d689
F rsrc/icons/File\sVideo\s3GP-01.png 855490ff7380da71789408e848697e3d0584737a
F rsrc/icons/File\sVideo\sAVI-01.png e307ad10e6761eb2cc47083070bac14288d36381
F rsrc/icons/File\sVideo\sMOV-01.png 8eaa2eabfeaa194aa42d1a3bd6bd0f55b14275ed
F rsrc/icons/File\sVideo\sMPEG-01.png 77bfaf4f0fef4d19a572a34449be609eee146c89
F rsrc/icons/File\sVideo\sWMV-01.png 396d52a2cfbe8ac3c91e67576b7b1d6d25941919
F rsrc/icons/File\sVideo-01.png 8ebed5e9ff46d1532a5df8cd0427918eae2d3565
F rsrc/icons/Folder\sAdd-01.png d069b3c05a9bc41fc58fe5fee85a75dbed2a2f7e
F rsrc/icons/Folder\sCompressed-01.png 8c25f6bc354ac7d48989319627531d94a0e1fd7d
F rsrc/icons/Folder\sDelete-01.png fde9f4c91eade5281999165af04c1b53827fd63c
F rsrc/icons/Folder\sExplorer-01.png 4bca07d4e2a90580ab43fc864826fe9ada299464
F rsrc/icons/Folder\sGeneric\sBlue-01.png 65a1ec6e34725b1ed65e98be169558e3ffbaf95f
F rsrc/icons/Folder\sGeneric\sGreen-01.png 56a1d1084a8de4ebd29be2398b737fdbf956107d
F rsrc/icons/Folder\sGeneric\sRed-01.png 58e9ea810ab2c4b22ac4589ade357beaddd42612
F rsrc/icons/Folder\sGeneric\sSilver-01.png d7c336da6d33cb1b78d4439ca932e5ab0287c976
F rsrc/icons/Folder\sOpen-01.png 8f65da9130e1c4a553d23accc0222a307f209b71
F rsrc/icons/Folder\sRAR-01.png 984bc1348f47d73b59cc66829f14906a4e22d811
F rsrc/icons/Folder-01.png 797254b9c180b17c336eb24510732306454b631b
F rsrc/icons/Games-01.png 36d2c9b086320a67a7bce7ae80bd80b06f660f8b
F rsrc/icons/Gear-01.png dd9d2f1b3eaefd2b376547e8d7dc0224b142fb79
F rsrc/icons/Highlighter\sBlue-01.png f13cd5ab2131e0405e6cca65c9bf859ddeac7dca
F rsrc/icons/Highlighter\sGreen-01.png c27855873f1603692ddec1fe5eb387d82dec4511
F rsrc/icons/Highlighter\sYellow-01.png 50c25fe8857e04ccbe7d518abc8e50cad64e82da
F rsrc/icons/IconCredits.txt e38bd317b7d007b1bffb910f543dbbd376b2b16a
F rsrc/icons/Image\sBMP-01.png 79a0ca5cd1a794b711c37a3ab9a9d45d458c6cd1
F rsrc/icons/Image\sGIF-01.png d409ac6dfeceac46d711cc7bef274d94bbd4e9b0
F rsrc/icons/Image\sJPEG-01.png 63bc765c3c2c389c580faa66c7802f8d18e2ddd7
F rsrc/icons/Image\sPNG-01.png 858fc6a016aa903777fe9e7994b1ebd94d16bd35
F rsrc/icons/Image\sTIFF-01.png c21d860de99f929afe4541f4ac1d8a71c80bff68
F rsrc/icons/Lock\sLock-01.png b1502b0b7ef07d643ae2d169d831a7a6272a02d1
F rsrc/icons/Lock\sUnlock-01.png e47398b3f0ab0f78e04afebb697bd3ab9eff6aa7
F rsrc/icons/My\sDocuments-01.png 4553fc16e9a4b08127f09016469ab5eb00300c8c
F rsrc/icons/My\sEbooks-01.png 0ed4118b3b7fff5d56c8612fb6e0a8e3fd083169
F rsrc/icons/My\sMusic-01.png f7b0dfce2ea321a3b72795fc5501dedf9f5f683c
F rsrc/icons/My\sPictures.png 93728e10f32a81cc965c3390b40abff8cbffbfdc
F rsrc/icons/My\sVideos-01.png 2e8cee013490100dfe4c42c5b2fb10ee3cdee7b0
F rsrc/icons/My\sWebsites-01.png 1af5ae10a10bcc628c60b65bcc82f65537e4b93e
F rsrc/icons/Network\sFirewall-01.png 4bbfe1f6d4b08c900fb5a15ab3ae212ca06ffe88
F rsrc/icons/Network\sMAC-01.png 9001794331edc31f166d9c90be59e49604cc7ee7
F rsrc/icons/Network\sPC-01.png 1d862ce6c21d89cec29e518a290dad785aa17324
F rsrc/icons/Network\sRefresh-01.png 2fd0f18658addfc9f728cb1462fb007e514db9ec
F rsrc/icons/Pen\sBlue-01.png 162d6d34b71697c202e16309962ad8e48fb77ad9
F rsrc/icons/Pen\sGreen-01.png b0ec213414205cc2a443f3113d3c22396fe0556b
F rsrc/icons/Pen\sRed-01.png 6af49c0ee04376c446cdcf0baa404bb724cf2d01
F rsrc/icons/Save-01.png d0b40c336956c9b8dd1ddafe72801c2ff1718ca1
F rsrc/icons/Text\sEdit.png 010ae940be096d9d65d6e53c52fc31d8c238cacc
F rsrc/icons/USB-01.png 2c7e2200c2ddb6e6465dbb167c2b5ee34aaaf5cb
F rsrc/icons/User\sAdministrator\sBlue-01.png e7c742a268bea5242caa41b80a23756b198338a6
F rsrc/icons/User\sAdministrator\sGreen-01.png 86aed5f9bbf259a9aa9d725f033ecd0351c0131e
F rsrc/icons/User\sAdministrator\sRed-01.png d315742668de4b255de1a5ea141bb5e605e9389c
F rsrc/icons/User\sChat-01.png e755eb8d6d476fa92d0155db761819272a0dbf3f
F rsrc/icons/User\sClients-01.png 769b86d73904c0256c7835b0f3dd9e922be4abc4
F rsrc/icons/User\sCoat\sBlue-01.png 2a2a6b9bec6506c55de188a81136c770a0cade72
F rsrc/icons/User\sCoat\sGreen-01.png 61756d020524c1b33c29121188a2b6fe29ab9884
F rsrc/icons/User\sCoat\sRed-01.png 2c63e8b957f56caffa297314e8eae9b646a70440
F rsrc/icons/User\sExecutive\sBlue-01.png f6e5d1c4a4f534f106d1c517cddada9d080a8317
F rsrc/icons/User\sExecutive\sGreen-01.png bd120c95a3b5f03ded7eda8cbd36b0890d830ced
F rsrc/icons/User\sExecutive\sRed-01.png 2a0300a88c070ee20eebd1fef1995ea5bab3297e
F rsrc/icons/User\sGroup-01.png 95efb545e7d01f97ab5c1e1eace5afa0d7d4b31b
F rsrc/icons/User\sPreppy\sBlue-01.png a44530fa2d2a51172f00d78242e2dd922408bdf5
F rsrc/icons/User\sPreppy\sGreen-01.png b814dcaf10f54adb0557d1dd8dc8c09abf1ed0e5
F rsrc/icons/User\sPreppy\sRed-01.png b28eaef39fdff249fb4bf5e49ad4c584a3845ed5
F rsrc/icons/Web\sHTML-01.png 6232d980a5ad2b3a313475abda43659ab400bb69
F rsrc/icons/Web\sXML-01.png 0f5cd39709e7b99a1e6833b6718c631756ce8f7c
F rsrc/icons/Window\sRefresh-01.png 14740f1fbc0bf6fe43e571bf344f1354c3b55f82
F rsrc/icons/Window-01.png c283536f3825409ce01c0446a528b9a0c3cee203
F rsrc/icons/Windows\sCascade-01.png 4d61073295f73437d2c01c4829da94b29823fa7e
F rsrc/icons/Windows-01.png c5da37a9fb6e9c777107668b39fec98169a1db77
F rsrc/icons/Zoom\sIn-01.png bdd24558fd23a1003f1a569f092f22022736f236
F rsrc/icons/Zoom\sOut-01.png 8eda092100d9e00c9097f43a80d1e26695947448
F rsrc/icons/Zoom-01.png 67ca532922e9166325c5c75fce1ca3fbb0d2b6a6
F rsrc/icons/fuel.icns 81e535004b62db801a02f3e15d0a33afc9d4070b
F rsrc/icons/fuel.ico eb529ab3332a17b9302ef3e851db5b9ebce2a038
F rsrc/icons/fuel.png 40daf53b7f6bdcdd0d6aa5ef433d078ec5ea4342
F rsrc/resources.qrc 21ae6205e27ac989001eb0edc075d7e405b992c8
F src/AboutDialog.cpp fc9e3ba03aa6cb145ace610d9b38a2de157551ba
F src/AboutDialog.h 269f3a0589067c08f19b542e4576b0ef58bc6ec5
F src/BrowserWidget.cpp 8b8f545cdff4a4188edc698a1b4777f5df46f056
F src/BrowserWidget.h 764d66aa9a93b890298bd0301097739cb4e16597
F src/CloneDialog.cpp c341622b01d493387d6e4928018b3392d92471e8
F src/CloneDialog.h 8813d91f893eb3eb86a4ea5e50f9a53a0ea07047
F src/CommitDialog.cpp 3d25ae2aa8af0ab417736a3f2d7f95a8dcb7480a
F src/CommitDialog.h 921bf27c0c538ab9e9d6bdc750064337d346270b
F src/CustomWebView.cpp b7dd0c41977c2cba005df07ed8967ba6f58d07d9
F src/CustomWebView.h fbc8ee55812d1acb3c3b2bc31be7533e8a112822
F src/FileActionDialog.cpp fcaebf9986f789b3440d5390b3458ad5f86fe0c8
F src/FileActionDialog.h 15db1650b3a13d70bc338371e4c033c66e3b79ce
F src/FileTableView.cpp 5ddf8c391c9a3ac449ec61fb1db837b577afeec2
F src/FileTableView.h 03e56d87c2d46411b9762b87f4d301619aaf18df
F src/Fossil.cpp e3451ddd8f19f1b6f2d446d9390b336e493da197
F src/Fossil.h 7acbd4a9d43f6a11c183dbffd73b71d54a4c5108
F src/FslSettingsDialog.cpp e00907d493fba469e48a008aecda88426350b5ac
F src/FslSettingsDialog.h dfe2a61884a55a74cbb9206b6f6b482b979725e7
F src/LoggedProcess.cpp 2a1e5c94bc1e57c8984563e66c210e43a14dc60c
F src/LoggedProcess.h 85df7c635c807a5a0e8c4763f17a0752aaff7261
F src/MainWindow.cpp dfa81f94f04e418bdd22985b898855733842d496
F src/MainWindow.h f4cffbe4d360d30aa2eeaa25fc6d50d0a39c617f
F src/RemoteDialog.cpp 8540cc5e2e41c4127ed8a028d84691604fa6ecac
F src/RemoteDialog.h 5e0438c2bd7c79b1bb44bfbd58c2181b544a9e5d
F src/RevisionDialog.cpp e58c4f8a704f00addebb15d521b76620fdafda79
F src/RevisionDialog.h b718c3009342eaabad39c8a11a253a4e4fef7a73
F src/SearchBox.cpp d4209c575baa9933e1ce5ed376e785b289a145ba
F src/SearchBox.h 0c78d3a68136dab3e0e71b83ae36f22bd2688ab2
F src/Settings.cpp 258d3f466f6a125ce2b8519d6d57a312cbc44a3f
F src/Settings.h 0a10b0b83fe804bdc7dac58eed06b5b6ee422055
F src/SettingsDialog.cpp fa0c70eaf0fa7edb15de302d041cdb552fe523d5
F src/SettingsDialog.h 5eb3ae2cbb00ab5544e1889860f5376f69fe47cd
F src/Utils.cpp a375d6b641658b49d84462773d1e052de0c716dd
F src/Utils.h c6341ee49a8fc35f215facb196d70bf9b1f2fc0f
F src/Workspace.cpp feab8b238a99cf1a60731aedf07af96010d9795d
F src/Workspace.h 54eef32658b13a34fe78ae26887420e8ff358eaa
F src/main.cpp d8c65ea5e54102e4989fef9fd8cfd4f13ef8a8f0
F tools/git-push.sh 62cc58434cae5b7bcd6bd9d4cce8b08739f31cd7 x
F tools/pack.sh d7f38a498c4e9327fecd6a6e5ac27be270d43008 x
F ui/AboutDialog.ui 77704a7422a59ccdddbdf00979bd20a861d9ee5a
F ui/BrowserWidget.ui 994ad9ea0e9f5815d6b1a27acc2f6f39164c507f
F ui/CloneDialog.ui 4886e7d4f258ea8b852b5eefc860396e35145712
F ui/CommitDialog.ui 1e5dafa742e9ae07ec937bcda8cda3297ddc6199
F ui/FileActionDialog.ui 89bb4dc2d0b8adcd41adcb11ec65f2028a09a12d
F ui/FslSettingsDialog.ui eb3d4cb764cab90b01e82922237d8c42d6ce1749
F ui/MainWindow.ui f9774e6dddb9462d8072bffd6c511bee7f470b9d
F ui/RemoteDialog.ui 95a4750d972ed8c49bb10b95db91ff16cfe2dd0b
F ui/RevisionDialog.ui 27c3b98c665fec014a50cbf3352c0627f75e68cd
F ui/SettingsDialog.ui 2e1b6ce7a49100088c5649292c1319e62e0302e1
P 9b67709b92eae80e70f8ae2b775014092f820fdf
R 53802be5132d1fc255734da4b05ec8a0
U Kostas
Z 11e2710ccd6ed208d70aec7542a52542

View File

@ -1 +1 @@
e017a9126cf63ed060dd88accfcabbd9726e9aa7
6b21c5057dad0036c043e4d57effd5cceb6d2a10

View File

@ -0,0 +1,34 @@
from conans import ConanFile, CMake, tools
class QtkeychainConan(ConanFile):
name = "qtkeychain"
version = "0.13.2"
license = "BSD-3"
author = "Edgar"
url = "https://github.com/AnotherFoxGuy/fuel-scm"
description = "Platform-independent Qt API for storing passwords securely"
settings = "os", "compiler", "build_type", "arch"
options = {"static": [True, False]}
default_options = {"static": False}
scm = {
"type": "git",
"url": "https://github.com/frankosterfeld/qtkeychain.git",
"revision": "v0.13.2"
}
def build(self):
cmake = CMake(self)
cmake.definitions["QTKEYCHAIN_STATIC"] = self.options.static
cmake.definitions["BUILD_TEST_APPLICATION"] = "OFF"
cmake.configure()
cmake.build()
def package(self):
cmake = CMake(self)
cmake.install()
def package_info(self):
self.cpp_info.names["cmake_find_package"] = "Qt5Keychain"
self.cpp_info.names["cmake_find_package_multi"] = "Qt5Keychain"
self.cpp_info.libs = tools.collect_libs(self)

View File

@ -1,10 +1,9 @@
[Desktop Entry]
Encoding=UTF-8
Type=Application
Exec=/usr/bin/fuel
Icon=/usr/share/icons/hicolor/256x256/apps/fuel.png
Exec=Fuel
Icon=fuel
Terminal=false
Name=Fuel
GenericName=Software Configuration Management tool
Comment=GUI Front-End to the Fossil SCM tool
Categories=Qt;Development;RevisionControl
Categories=Development;RevisionControl;

Binary file not shown.

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

13
rsrc/languages.qrc Normal file
View File

@ -0,0 +1,13 @@
<RCC>
<qresource prefix="/intl">
<file>el_GR.qm</file>
<file>de_DE.qm</file>
<file>es_ES.qm</file>
<file>fr_FR.qm</file>
<file>ru_RU.qm</file>
<file>pt_PT.qm</file>
<file>it_IT.qm</file>
<file>nl_NL.qm</file>
<file>ko_KR.qm</file>
</qresource>
</RCC>

152
rsrc/license.rtf Normal file
View File

@ -0,0 +1,152 @@
{\rtf1\ansi\deff0{\fonttbl{\f0 \fswiss Helvetica;}{\f1 Courier;}}
{\colortbl;\red255\green0\blue0;\red0\green0\blue255;}
\widowctrl\hyphauto
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs28 GNU GENERAL PUBLIC LICENSE\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Version 3, 29 June 2007\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Copyright \u169? 2007 Free Software Foundation, Inc. <{\field{\*\fldinst{HYPERLINK "https://fsf.org/"}}{\fldrslt{\ul
https://fsf.org/
}}}
>\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs28 Preamble\par}
{\pard \ql \f0 \sa180 \li0 \fi0 The GNU General Public License is a free, copyleft license for software and other kinds of works.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 The precise terms and conditions for copying, distribution and modification follow.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs28 TERMS AND CONDITIONS\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 0. Definitions.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \u8220"This License\u8221" refers to version 3 of the GNU General Public License.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \u8220"Copyright\u8221" also means copyright-like laws that apply to other kinds of works, such as semiconductor masks.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \u8220"The Program\u8221" refers to any copyrightable work licensed under this License. Each licensee is addressed as \u8220"you\u8221". \u8220"Licensees\u8221" and \u8220"recipients\u8221" may be individuals or organizations.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 To \u8220"modify\u8221" a work means to copy from or adapt all or part of the work in a fashion requiring copyright permission, other than the making of an exact copy. The resulting work is called a \u8220"modified version\u8221" of the earlier work or a work \u8220"based on\u8221" the earlier work.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 A \u8220"covered work\u8221" means either the unmodified Program or a work based on the Program.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 To \u8220"propagate\u8221" a work means to do anything with it that, without permission, would make you directly or secondarily liable for infringement under applicable copyright law, except executing it on a computer or modifying a private copy. Propagation includes copying, distribution (with or without modification), making available to the public, and in some countries other activities as well.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 To \u8220"convey\u8221" a work means any kind of propagation that enables other parties to make or receive copies. Mere interaction with a user through a computer network, with no transfer of a copy, is not conveying.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 An interactive user interface displays \u8220"Appropriate Legal Notices\u8221" to the extent that it includes a convenient and prominently visible feature that (1) displays an appropriate copyright notice, and (2) tells the user that there is no warranty for the work (except to the extent that warranties are provided), that licensees may convey the work under this License, and how to view a copy of this License. If the interface presents a list of user commands or options, such as a menu, a prominent item in the list meets this criterion.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 1. Source Code.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 The \u8220"source code\u8221" for a work means the preferred form of the work for making modifications to it. \u8220"Object code\u8221" means any non-source form of a work.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 A \u8220"Standard Interface\u8221" means an interface that either is an official standard defined by a recognized standards body, or, in the case of interfaces specified for a particular programming language, one that is widely used among developers working in that language.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 The \u8220"System Libraries\u8221" of an executable work include anything, other than the work as a whole, that (a) is included in the normal form of packaging a Major Component, but which is not part of that Major Component, and (b) serves only to enable use of the work with that Major Component, or to implement a Standard Interface for which an implementation is available to the public in source code form. A \u8220"Major Component\u8221", in this context, means a major essential component (kernel, window system, and so on) of the specific operating system (if any) on which the executable work runs, or a compiler used to produce the work, or an object code interpreter used to run it.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 The \u8220"Corresponding Source\u8221" for a work in object code form means all the source code needed to generate, install, and (for an executable work) run the object code and to modify the work, including scripts to control those activities. However, it does not include the work's System Libraries, or general-purpose tools or generally available free programs which are used unmodified in performing those activities but which are not part of the work. For example, Corresponding Source includes interface definition files associated with source files for the work, and the source code for shared libraries and dynamically linked subprograms that the work is specifically designed to require, such as by intimate data communication or control flow between those subprograms and other parts of the work.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 The Corresponding Source need not include anything that users can regenerate automatically from other parts of the Corresponding Source.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 The Corresponding Source for a work in source code form is that same work.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 2. Basic Permissions.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 All rights granted under this License are granted for the term of copyright on the Program, and are irrevocable provided the stated conditions are met. This License explicitly affirms your unlimited permission to run the unmodified Program. The output from running a covered work is covered by this License only if the output, given its content, constitutes a covered work. This License acknowledges your rights of fair use or other equivalent, as provided by copyright law.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 You may make, run and propagate covered works that you do not convey, without conditions so long as your license otherwise remains in force. You may convey covered works to others for the sole purpose of having them make modifications exclusively for you, or provide you with facilities for running those works, provided that you comply with the terms of this License in conveying all material for which you do not control copyright. Those thus making or running the covered works for you must do so exclusively on your behalf, under your direction and control, on terms that prohibit them from making any copies of your copyrighted material outside their relationship with you.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Conveying under any other circumstances is permitted solely under the conditions stated below. Sublicensing is not allowed; section 10 makes it unnecessary.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 3. Protecting Users' Legal Rights From Anti-Circumvention Law.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 No covered work shall be deemed part of an effective technological measure under any applicable law fulfilling obligations under article 11 of the WIPO copyright treaty adopted on 20 December 1996, or similar laws prohibiting or restricting circumvention of such measures.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 When you convey a covered work, you waive any legal power to forbid circumvention of technological measures to the extent such circumvention is effected by exercising rights under this License with respect to the covered work, and you disclaim any intention to limit operation or modification of the work as a means of enforcing, against the work's users, your or third parties' legal rights to forbid circumvention of technological measures.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 4. Conveying Verbatim Copies.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 You may convey verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice; keep intact all notices stating that this License and any non-permissive terms added in accord with section 7 apply to the code; keep intact all notices of the absence of any warranty; and give all recipients a copy of this License along with the Program.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 You may charge any price or no price for each copy that you convey, and you may offer support or warranty protection for a fee.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 5. Conveying Modified Source Versions.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 You may convey a work based on the Program, or the modifications to produce it from the Program, in the form of source code under the terms of section 4, provided that you also meet all of these conditions:\par}
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab a) The work must carry prominent notices stating that you modified it, and giving a relevant date.\par}
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab b) The work must carry prominent notices stating that it is released under this License and any conditions added under section 7. This requirement modifies the requirement in section 4 to \u8220"keep intact all notices\u8221".\par}
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab c) You must license the entire work, as a whole, under this License to anyone who comes into possession of a copy. This License will therefore apply, along with any applicable section 7 additional terms, to the whole of the work, and all its parts, regardless of how they are packaged. This License gives no permission to license the work in any other way, but it does not invalidate such permission if you have separately received it.\par}
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab d) If the work has interactive user interfaces, each must display Appropriate Legal Notices; however, if the Program has interactive interfaces that do not display Appropriate Legal Notices, your work need not make them do so.\sa180\par}
{\pard \ql \f0 \sa180 \li0 \fi0 A compilation of a covered work with other separate and independent works, which are not by their nature extensions of the covered work, and which are not combined with it such as to form a larger program, in or on a volume of a storage or distribution medium, is called an \u8220"aggregate\u8221" if the compilation and its resulting copyright are not used to limit the access or legal rights of the compilation's users beyond what the individual works permit. Inclusion of a covered work in an aggregate does not cause this License to apply to the other parts of the aggregate.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 6. Conveying Non-Source Forms.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 You may convey a covered work in object code form under the terms of sections 4 and 5, provided that you also convey the machine-readable Corresponding Source under the terms of this License, in one of these ways:\par}
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab a) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by the Corresponding Source fixed on a durable physical medium customarily used for software interchange.\par}
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab b) Convey the object code in, or embodied in, a physical product (including a physical distribution medium), accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model, to give anyone who possesses the object code either (1) a copy of the Corresponding Source for all the software in the product that is covered by this License, on a durable physical medium customarily used for software interchange, for a price no more than your reasonable cost of physically performing this conveying of source, or (2) access to copy the Corresponding Source from a network server at no charge.\par}
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab c) Convey individual copies of the object code with a copy of the written offer to provide the Corresponding Source. This alternative is allowed only occasionally and noncommercially, and only if you received the object code with such an offer, in accord with subsection 6b.\par}
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab d) Convey the object code by offering access from a designated place (gratis or for a charge), and offer equivalent access to the Corresponding Source in the same way through the same place at no further charge. You need not require recipients to copy the Corresponding Source along with the object code. If the place to copy the object code is a network server, the Corresponding Source may be on a different server (operated by you or a third party) that supports equivalent copying facilities, provided you maintain clear directions next to the object code saying where to find the Corresponding Source. Regardless of what server hosts the Corresponding Source, you remain obligated to ensure that it is available for as long as needed to satisfy these requirements.\par}
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab e) Convey the object code using peer-to-peer transmission, provided you inform other peers where the object code and Corresponding Source of the work are being offered to the general public at no charge under subsection 6d.\sa180\par}
{\pard \ql \f0 \sa180 \li0 \fi0 A separable portion of the object code, whose source code is excluded from the Corresponding Source as a System Library, need not be included in conveying the object code work.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 A \u8220"User Product\u8221" is either (1) a \u8220"consumer product\u8221", which means any tangible personal property which is normally used for personal, family, or household purposes, or (2) anything designed or sold for incorporation into a dwelling. In determining whether a product is a consumer product, doubtful cases shall be resolved in favor of coverage. For a particular product received by a particular user, \u8220"normally used\u8221" refers to a typical or common use of that class of product, regardless of the status of the particular user or of the way in which the particular user actually uses, or expects or is expected to use, the product. A product is a consumer product regardless of whether the product has substantial commercial, industrial or non-consumer uses, unless such uses represent the only significant mode of use of the product.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \u8220"Installation Information\u8221" for a User Product means any methods, procedures, authorization keys, or other information required to install and execute modified versions of a covered work in that User Product from a modified version of its Corresponding Source. The information must suffice to ensure that the continued functioning of the modified object code is in no case prevented or interfered with solely because modification has been made.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 If you convey an object code work under this section in, or with, or specifically for use in, a User Product, and the conveying occurs as part of a transaction in which the right of possession and use of the User Product is transferred to the recipient in perpetuity or for a fixed term (regardless of how the transaction is characterized), the Corresponding Source conveyed under this section must be accompanied by the Installation Information. But this requirement does not apply if neither you nor any third party retains the ability to install modified object code on the User Product (for example, the work has been installed in ROM).\par}
{\pard \ql \f0 \sa180 \li0 \fi0 The requirement to provide Installation Information does not include a requirement to continue to provide support service, warranty, or updates for a work that has been modified or installed by the recipient, or for the User Product in which it has been modified or installed. Access to a network may be denied when the modification itself materially and adversely affects the operation of the network or violates the rules and protocols for communication across the network.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Corresponding Source conveyed, and Installation Information provided, in accord with this section must be in a format that is publicly documented (and with an implementation available to the public in source code form), and must require no special password or key for unpacking, reading or copying.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 7. Additional Terms.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \u8220"Additional permissions\u8221" are terms that supplement the terms of this License by making exceptions from one or more of its conditions. Additional permissions that are applicable to the entire Program shall be treated as though they were included in this License, to the extent that they are valid under applicable law. If additional permissions apply only to part of the Program, that part may be used separately under those permissions, but the entire Program remains governed by this License without regard to the additional permissions.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 When you convey a copy of a covered work, you may at your option remove any additional permissions from that copy, or from any part of it. (Additional permissions may be written to require their own removal in certain cases when you modify the work.) You may place additional permissions on material, added by you to a covered work, for which you have or can give appropriate copyright permission.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Notwithstanding any other provision of this License, for material you add to a covered work, you may (if authorized by the copyright holders of that material) supplement the terms of this License with terms:\par}
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab a) Disclaiming warranty or limiting liability differently from the terms of sections 15 and 16 of this License; or\par}
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab b) Requiring preservation of specified reasonable legal notices or author attributions in that material or in the Appropriate Legal Notices displayed by works containing it; or\par}
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab c) Prohibiting misrepresentation of the origin of that material, or requiring that modified versions of such material be marked in reasonable ways as different from the original version; or\par}
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab d) Limiting the use for publicity purposes of names of licensors or authors of the material; or\par}
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab e) Declining to grant rights under trademark law for use of some trade names, trademarks, or service marks; or\par}
{\pard \ql \f0 \sa0 \li360 \fi-360 \bullet \tx360\tab f) Requiring indemnification of licensors and authors of that material by anyone who conveys the material (or modified versions of it) with contractual assumptions of liability to the recipient, for any liability that these contractual assumptions directly impose on those licensors and authors.\sa180\par}
{\pard \ql \f0 \sa180 \li0 \fi0 All other non-permissive additional terms are considered \u8220"further restrictions\u8221" within the meaning of section 10. If the Program as you received it, or any part of it, contains a notice stating that it is governed by this License along with a term that is a further restriction, you may remove that term. If a license document contains a further restriction but permits relicensing or conveying under this License, you may add to a covered work material governed by the terms of that license document, provided that the further restriction does not survive such relicensing or conveying.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 If you add terms to a covered work in accord with this section, you must place, in the relevant source files, a statement of the additional terms that apply to those files, or a notice indicating where to find the applicable terms.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Additional terms, permissive or non-permissive, may be stated in the form of a separately written license, or stated as exceptions; the above requirements apply either way.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 8. Termination.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 You may not propagate or modify a covered work except as expressly provided under this License. Any attempt otherwise to propagate or modify it is void, and will automatically terminate your rights under this License (including any patent licenses granted under the third paragraph of section 11).\par}
{\pard \ql \f0 \sa180 \li0 \fi0 However, if you cease all violation of this License, then your license from a particular copyright holder is reinstated (a) provisionally, unless and until the copyright holder explicitly and finally terminates your license, and (b) permanently, if the copyright holder fails to notify you of the violation by some reasonable means prior to 60 days after the cessation.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Moreover, your license from a particular copyright holder is reinstated permanently if the copyright holder notifies you of the violation by some reasonable means, this is the first time you have received notice of violation of this License (for any work) from that copyright holder, and you cure the violation prior to 30 days after your receipt of the notice.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Termination of your rights under this section does not terminate the licenses of parties who have received copies or rights from you under this License. If your rights have been terminated and not permanently reinstated, you do not qualify to receive new licenses for the same material under section 10.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 9. Acceptance Not Required for Having Copies.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 You are not required to accept this License in order to receive or run a copy of the Program. Ancillary propagation of a covered work occurring solely as a consequence of using peer-to-peer transmission to receive a copy likewise does not require acceptance. However, nothing other than this License grants you permission to propagate or modify any covered work. These actions infringe copyright if you do not accept this License. Therefore, by modifying or propagating a covered work, you indicate your acceptance of this License to do so.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 10. Automatic Licensing of Downstream Recipients.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Each time you convey a covered work, the recipient automatically receives a license from the original licensors, to run, modify and propagate that work, subject to this License. You are not responsible for enforcing compliance by third parties with this License.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 An \u8220"entity transaction\u8221" is a transaction transferring control of an organization, or substantially all assets of one, or subdividing an organization, or merging organizations. If propagation of a covered work results from an entity transaction, each party to that transaction who receives a copy of the work also receives whatever licenses to the work the party's predecessor in interest had or could give under the previous paragraph, plus a right to possession of the Corresponding Source of the work from the predecessor in interest, if the predecessor has it or can get it with reasonable efforts.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 You may not impose any further restrictions on the exercise of the rights granted or affirmed under this License. For example, you may not impose a license fee, royalty, or other charge for exercise of rights granted under this License, and you may not initiate litigation (including a cross-claim or counterclaim in a lawsuit) alleging that any patent claim is infringed by making, using, selling, offering for sale, or importing the Program or any portion of it.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 11. Patents.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 A \u8220"contributor\u8221" is a copyright holder who authorizes use under this License of the Program or a work on which the Program is based. The work thus licensed is called the contributor's \u8220"contributor version\u8221".\par}
{\pard \ql \f0 \sa180 \li0 \fi0 A contributor's \u8220"essential patent claims\u8221" are all patent claims owned or controlled by the contributor, whether already acquired or hereafter acquired, that would be infringed by some manner, permitted by this License, of making, using, or selling its contributor version, but do not include claims that would be infringed only as a consequence of further modification of the contributor version. For purposes of this definition, \u8220"control\u8221" includes the right to grant patent sublicenses in a manner consistent with the requirements of this License.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Each contributor grants you a non-exclusive, worldwide, royalty-free patent license under the contributor's essential patent claims, to make, use, sell, offer for sale, import and otherwise run, modify and propagate the contents of its contributor version.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 In the following three paragraphs, a \u8220"patent license\u8221" is any express agreement or commitment, however denominated, not to enforce a patent (such as an express permission to practice a patent or covenant not to sue for patent infringement). To \u8220"grant\u8221" such a patent license to a party means to make such an agreement or commitment not to enforce a patent against the party.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 If you convey a covered work, knowingly relying on a patent license, and the Corresponding Source of the work is not available for anyone to copy, free of charge and under the terms of this License, through a publicly available network server or other readily accessible means, then you must either (1) cause the Corresponding Source to be so available, or (2) arrange to deprive yourself of the benefit of the patent license for this particular work, or (3) arrange, in a manner consistent with the requirements of this License, to extend the patent license to downstream recipients. \u8220"Knowingly relying\u8221" means you have actual knowledge that, but for the patent license, your conveying the covered work in a country, or your recipient's use of the covered work in a country, would infringe one or more identifiable patents in that country that you have reason to believe are valid.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 If, pursuant to or in connection with a single transaction or arrangement, you convey, or propagate by procuring conveyance of, a covered work, and grant a patent license to some of the parties receiving the covered work authorizing them to use, propagate, modify or convey a specific copy of the covered work, then the patent license you grant is automatically extended to all recipients of the covered work and works based on it.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 A patent license is \u8220"discriminatory\u8221" if it does not include within the scope of its coverage, prohibits the exercise of, or is conditioned on the non-exercise of one or more of the rights that are specifically granted under this License. You may not convey a covered work if you are a party to an arrangement with a third party that is in the business of distributing software, under which you make payment to the third party based on the extent of your activity of conveying the work, and under which the third party grants, to any of the parties who would receive the covered work from you, a discriminatory patent license (a) in connection with copies of the covered work conveyed by you (or copies made from those copies), or (b) primarily for and in connection with specific products or compilations that contain the covered work, unless you entered into that arrangement, or that patent license was granted, prior to 28 March 2007.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Nothing in this License shall be construed as excluding or limiting any implied license or other defenses to infringement that may otherwise be available to you under applicable patent law.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 12. No Surrender of Others' Freedom.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 If conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot convey a covered work so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not convey it at all. For example, if you agree to terms that obligate you to collect a royalty for further conveying from those to whom you convey the Program, the only way you could satisfy both those terms and this License would be to refrain entirely from conveying the Program.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 13. Use with the GNU Affero General Public License.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Notwithstanding any other provision of this License, you have permission to link or combine any covered work with a work licensed under version 3 of the GNU Affero General Public License into a single combined work, and to convey the resulting work. The terms of this License will continue to apply to the part which is the covered work, but the special requirements of the GNU Affero General Public License, section 13, concerning interaction through a network will apply to the combination as such.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 14. Revised Versions of this License.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 The Free Software Foundation may publish revised and/or new versions of the GNU General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Each version is given a distinguishing version number. If the Program specifies that a certain numbered version of the GNU General Public License \u8220"or any later version\u8221" applies to it, you have the option of following the terms and conditions either of that numbered version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the GNU General Public License, you may choose any version ever published by the Free Software Foundation.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 If the Program specifies that a proxy can decide which future versions of the GNU General Public License can be used, that proxy's public statement of acceptance of a version permanently authorizes you to choose that version for the Program.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Later license versions may give you additional or different permissions. However, no additional obligations are imposed on any author or copyright holder as a result of your choosing to follow a later version.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 15. Disclaimer of Warranty.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \u8220"AS IS\u8221" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 16. Limitation of Liability.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs24 17. Interpretation of Sections 15 and 16.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 If the disclaimer of warranty and limitation of liability provided above cannot be given local legal effect according to their terms, reviewing courts shall apply local law that most closely approximates an absolute waiver of all civil liability in connection with the Program, unless a warranty or assumption of liability accompanies a copy of the Program in return for a fee.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 END OF TERMS AND CONDITIONS\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \b \fs28 How to Apply These Terms to Your New Programs\par}
{\pard \ql \f0 \sa180 \li0 \fi0 If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively state the exclusion of warranty; and each file should have at least the \u8220"copyright\u8221" line and a pointer to where the full notice is found.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \f1 <one line to give the program's name and a brief idea of what it does.>\line
Copyright (C) <year> <name of author>\line
\line
This program is free software: you can redistribute it and/or modify\line
it under the terms of the GNU General Public License as published by\line
the Free Software Foundation, either version 3 of the License, or\line
(at your option) any later version.\line
\line
This program is distributed in the hope that it will be useful,\line
but WITHOUT ANY WARRANTY; without even the implied warranty of\line
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\line
GNU General Public License for more details.\line
\line
You should have received a copy of the GNU General Public License\line
along with this program. If not, see <https://www.gnu.org/licenses/>.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 Also add information on how to contact you by electronic and paper mail.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 If the program does terminal interaction, make it output a short notice like this when it starts in an interactive mode:\par}
{\pard \ql \f0 \sa180 \li0 \fi0 \f1 <program> Copyright (C) <year> <name of author>\line
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\line
This is free software, and you are welcome to redistribute it\line
under certain conditions; type `show c' for details.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an \u8220"about box\u8221".\par}
{\pard \ql \f0 \sa180 \li0 \fi0 You should also get your employer (if you work as a programmer) or school, if any, to sign a \u8220"copyright disclaimer\u8221" for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <{\field{\*\fldinst{HYPERLINK "https://www.gnu.org/licenses/"}}{\fldrslt{\ul
https://www.gnu.org/licenses/
}}}
>.\par}
{\pard \ql \f0 \sa180 \li0 \fi0 The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <{\field{\*\fldinst{HYPERLINK "https://www.gnu.org/licenses/why-not-lgpl.html"}}{\fldrslt{\ul
https://www.gnu.org/licenses/why-not-lgpl.html
}}}
>.\par}
}

View File

@ -1,174 +1,167 @@
<RCC>
<qresource prefix="/icons">
<file>icons/Address Book-01.png</file>
<file>icons/Adobe Illustrator CS3 Document-01.png</file>
<file>icons/Adobe PDF Document-01.png</file>
<file>icons/Adobe Photoshop CS3 Document-01.png</file>
<file alias="icon-application">icons/Battery-01.png</file>
<file>icons/Binoculars-01.png</file>
<file alias="icon-item-tag">icons/Book-01.png</file>
<file>icons/Briefcase-01.png</file>
<file alias="icon-item-added">icons/Button Add-01.png</file>
<file>icons/Button Blank Blue-01.png</file>
<file alias="icon-item-unknown">icons/Button Blank Gray-01.png</file>
<file alias="icon-item-unchanged">icons/Button Blank Green-01.png</file>
<file alias="icon-item-conflicted">icons/Button Blank Red-01.png</file>
<file alias="icon-item-edited">icons/Button Blank Yellow-01.png</file>
<file>icons/Button Cancel-01.png</file>
<file alias="icon-item-deleted">icons/Button Close-01.png</file>
<file alias="icon-action-tag-delete">icons/Button Close-01.png</file>
<file alias="icon-action-stop">icons/Button Close-01.png</file>
<file>icons/Button Delete-01.png</file>
<file alias="icon-action-pull">icons/Button Download-01.png</file>
<file>icons/Button Favorite-01.png</file>
<file>icons/Button Forward-01.png</file>
<file alias="icon-item-missing">icons/Button Help-01.png</file>
<file>icons/Button Info-01.png</file>
<file>icons/Button Log Off-01.png</file>
<file alias="icon-action-next">icons/Button Next-01.png</file>
<file>icons/Button Pause-01.png</file>
<file alias="icon-action-update">icons/Button Play-01.png</file>
<file alias="icon-action-previous">icons/Button Previous-01.png</file>
<file alias="icon-action-refresh">icons/Button Refresh-01.png</file>
<file alias="icon-action-undo">icons/Button Reload-01.png</file>
<file alias="icon-item-renamed">icons/Button Reload-01.png</file>
<file>icons/Button Reminder-01.png</file>
<file alias="icon-action-revert">icons/Button Rewind-01.png</file>
<file>icons/Button Talk Balloon-01.png</file>
<file alias="icon-action-quit">icons/Button Turn Off-01.png</file>
<file>icons/Button Turn On-01.png</file>
<file alias="icon-action-push">icons/Button Upload-01.png</file>
<file>icons/Button Warning-01.png</file>
<file>icons/Calculator-01.png</file>
<file>icons/Calendar Blue-01.png</file>
<file>icons/Calendar Green-01.png</file>
<file>icons/Calendar Red-01.png</file>
<file>icons/Clipboard-01.png</file>
<file>icons/Clipboard Paste-01.png</file>
<file alias="icon-action-timeline">icons/Clock-01.png</file>
<file>icons/Coin-01.png</file>
<file>icons/Compressed File RAR-01.png</file>
<file>icons/Compressed File SIT-01.png</file>
<file>icons/Compressed File Zip-01.png</file>
<file>icons/Computer Monitor-01.png</file>
<file>icons/Computer Network-01.png</file>
<file alias="icon-item-file">icons/Document-01.png</file>
<file>icons/Document Attach-01.png</file>
<file alias="icon-action-repo-new">icons/Document Blank-01.png</file>
<file>icons/Document Chart-01.png</file>
<file alias="icon-item-diff">icons/Document Copy-01.png</file>
<file alias="icon-action-merge">icons/Document Flow Chart-01.png</file>
<file>icons/Document Gant Chart-01.png</file>
<file>icons/Document Help-01.png</file>
<file>icons/Document Line Chart-01.png</file>
<file>icons/Document Microsoft Excel-01.png</file>
<file>icons/Document Microsoft PowerPoint-01.png</file>
<file>icons/Document Microsoft Word-01.png</file>
<file alias="icon-item-branch">icons/Document Organization Chart-01.png</file>
<file>icons/Document Preview-01.png</file>
<file alias="icon-item-revert">icons/Document-Revert-icon.png</file>
<file>icons/Document Text-01.png</file>
<file>icons/Edit Document-01.png</file>
<file>icons/Email-01.png</file>
<file>icons/Email Attachment-01.png</file>
<file>icons/Email Delete-01.png</file>
<file>icons/Email Download-01.png</file>
<file>icons/Email Forward-01.png</file>
<file>icons/Email Inbox-01.png</file>
<file>icons/Email Reply-01.png</file>
<file>icons/File Audio-01.png</file>
<file>icons/File Audio AIFF-01.png</file>
<file>icons/File Audio MP3-01.png</file>
<file>icons/File Audio WAV-01.png</file>
<file>icons/File Audio WMA-01.png</file>
<file alias="icon-item-delete">icons/File Delete-01.png</file>
<file alias="icon-item-history">icons/File History-01.png</file>
<file alias="icon-item-add">icons/File New-01.png</file>
<file alias="icon-item-rename">icons/File Open-01.png</file>
<file>icons/File Video 3GP-01.png</file>
<file>icons/File Video-01.png</file>
<file>icons/File Video AVI-01.png</file>
<file>icons/File Video MOV-01.png</file>
<file>icons/File Video MPEG-01.png</file>
<file>icons/File Video WMV-01.png</file>
<file alias="icon-item-folder">icons/Folder-01.png</file>
<file alias="icon-action-stash-new">icons/Folder Add-01.png</file>
<file alias="icon-action-stash-apply">icons/Folder Compressed-01.png</file>
<file alias="icon-action-stash-delete">icons/Folder Delete-01.png</file>
<file alias="icon-action-stash-diff">icons/Folder Explorer-01.png</file>
<file alias="icon-action-folder-explore">icons/Folder Explorer-01.png</file>
<file>icons/Folder Generic Blue-01.png</file>
<file alias="icon-item-folder-unchanged">icons/Folder Generic Green-01.png</file>
<file alias="icon-item-folder-modified">icons/Folder Generic Red-01.png</file>
<file alias="icon-item-folder-unknown">icons/Folder Generic Silver-01.png</file>
<file alias="icon-action-folder-rename">icons/Folder Open-01.png</file>
<file>icons/Folder RAR-01.png</file>
<file>icons/Games-01.png</file>
<file alias="icon-action-settings">icons/Gear-01.png</file>
<file>icons/Highlighter Blue-01.png</file>
<file>icons/Highlighter Green-01.png</file>
<file alias="icon-action-tag-new">icons/Highlighter Yellow-01.png</file>
<file>icons/Image BMP-01.png</file>
<file>icons/Image GIF-01.png</file>
<file>icons/Image JPEG-01.png</file>
<file>icons/Image PNG-01.png</file>
<file>icons/Image TIFF-01.png</file>
<file>icons/Lock Lock-01.png</file>
<file>icons/Lock Unlock-01.png</file>
<file alias="icon-action-repo-open">icons/My Documents-01.png</file>
<file>icons/My Ebooks-01.png</file>
<file>icons/My Music-01.png</file>
<file>icons/My Pictures.png</file>
<file>icons/My Videos-01.png</file>
<file alias="icon-action-repo-clone">icons/My Websites-01.png</file>
<file>icons/Network Firewall-01.png</file>
<file alias="icon-webview">icons/Network MAC-01.png</file>
<file alias="icon-item-remote" >icons/Network PC-01.png</file>
<file>icons/Network Refresh-01.png</file>
<file>icons/Pen Blue-01.png</file>
<file>icons/Pen Green-01.png</file>
<file>icons/Pen Red-01.png</file>
<file alias="icon-action-commit">icons/Save-01.png</file>
<file alias="icon-clear-log">icons/Text Edit.png</file>
<file>icons/USB-01.png</file>
<file>icons/User Administrator Blue-01.png</file>
<file>icons/User Administrator Green-01.png</file>
<file>icons/User Administrator Red-01.png</file>
<file>icons/User Chat-01.png</file>
<file>icons/User Clients-01.png</file>
<file>icons/User Coat Blue-01.png</file>
<file>icons/User Coat Green-01.png</file>
<file>icons/User Coat Red-01.png</file>
<file>icons/User Executive Blue-01.png</file>
<file>icons/User Executive Green-01.png</file>
<file>icons/User Executive Red-01.png</file>
<file>icons/User Group-01.png</file>
<file>icons/User Preppy Blue-01.png</file>
<file>icons/User Preppy Green-01.png</file>
<file>icons/User Preppy Red-01.png</file>
<file>icons/Web HTML-01.png</file>
<file>icons/Web XML-01.png</file>
<file>icons/Window-01.png</file>
<file>icons/Window Refresh-01.png</file>
<file>icons/Windows-01.png</file>
<file>icons/Windows Cascade-01.png</file>
<file>icons/Zoom-01.png</file>
<file>icons/Zoom In-01.png</file>
<file>icons/Zoom Out-01.png</file>
</qresource>
<qresource prefix="/intl">
<file>intl/el_GR.qm</file>
<file>intl/de_DE.qm</file>
<file>intl/es_ES.qm</file>
<file>intl/fr_FR.qm</file>
<file>intl/ru_RU.qm</file>
<file>intl/pt_PT.qm</file>
<file>intl/it_IT.qm</file>
<file>intl/nl_NL.qm</file>
<file>intl/ko_KR.qm</file>
</qresource>
<qresource prefix="/docs">
<file>docs/Translators.txt</file>
<file>docs/Licenses.txt</file>
</qresource>
<qresource prefix="/icons">
<file>icons/Address Book-01.png</file>
<file>icons/Adobe Illustrator CS3 Document-01.png</file>
<file>icons/Adobe PDF Document-01.png</file>
<file>icons/Adobe Photoshop CS3 Document-01.png</file>
<file alias="icon-application">icons/Battery-01.png</file>
<file>icons/Binoculars-01.png</file>
<file alias="icon-item-tag">icons/Book-01.png</file>
<file>icons/Briefcase-01.png</file>
<file alias="icon-item-added">icons/Button Add-01.png</file>
<file>icons/Button Blank Blue-01.png</file>
<file alias="icon-item-unknown">icons/Button Blank Gray-01.png</file>
<file alias="icon-item-unchanged">icons/Button Blank Green-01.png</file>
<file alias="icon-item-conflicted">icons/Button Blank Red-01.png</file>
<file alias="icon-item-edited">icons/Button Blank Yellow-01.png</file>
<file>icons/Button Cancel-01.png</file>
<file alias="icon-item-deleted">icons/Button Close-01.png</file>
<file alias="icon-action-tag-delete">icons/Button Close-01.png</file>
<file alias="icon-action-stop">icons/Button Close-01.png</file>
<file>icons/Button Delete-01.png</file>
<file alias="icon-action-pull">icons/Button Download-01.png</file>
<file>icons/Button Favorite-01.png</file>
<file>icons/Button Forward-01.png</file>
<file alias="icon-item-missing">icons/Button Help-01.png</file>
<file>icons/Button Info-01.png</file>
<file>icons/Button Log Off-01.png</file>
<file alias="icon-action-next">icons/Button Next-01.png</file>
<file>icons/Button Pause-01.png</file>
<file alias="icon-action-update">icons/Button Play-01.png</file>
<file alias="icon-action-previous">icons/Button Previous-01.png</file>
<file alias="icon-action-refresh">icons/Button Refresh-01.png</file>
<file alias="icon-action-undo">icons/Button Reload-01.png</file>
<file alias="icon-item-renamed">icons/Button Reload-01.png</file>
<file>icons/Button Reminder-01.png</file>
<file alias="icon-action-revert">icons/Button Rewind-01.png</file>
<file>icons/Button Talk Balloon-01.png</file>
<file alias="icon-action-quit">icons/Button Turn Off-01.png</file>
<file>icons/Button Turn On-01.png</file>
<file alias="icon-action-push">icons/Button Upload-01.png</file>
<file>icons/Button Warning-01.png</file>
<file>icons/Calculator-01.png</file>
<file>icons/Calendar Blue-01.png</file>
<file>icons/Calendar Green-01.png</file>
<file>icons/Calendar Red-01.png</file>
<file>icons/Clipboard-01.png</file>
<file>icons/Clipboard Paste-01.png</file>
<file alias="icon-action-timeline">icons/Clock-01.png</file>
<file>icons/Coin-01.png</file>
<file>icons/Compressed File RAR-01.png</file>
<file>icons/Compressed File SIT-01.png</file>
<file>icons/Compressed File Zip-01.png</file>
<file>icons/Computer Monitor-01.png</file>
<file>icons/Computer Network-01.png</file>
<file alias="icon-item-file">icons/Document-01.png</file>
<file>icons/Document Attach-01.png</file>
<file alias="icon-action-repo-new">icons/Document Blank-01.png</file>
<file>icons/Document Chart-01.png</file>
<file alias="icon-item-diff">icons/Document Copy-01.png</file>
<file alias="icon-action-merge">icons/Document Flow Chart-01.png</file>
<file>icons/Document Gant Chart-01.png</file>
<file>icons/Document Help-01.png</file>
<file>icons/Document Line Chart-01.png</file>
<file>icons/Document Microsoft Excel-01.png</file>
<file>icons/Document Microsoft PowerPoint-01.png</file>
<file>icons/Document Microsoft Word-01.png</file>
<file alias="icon-item-branch">icons/Document Organization Chart-01.png</file>
<file>icons/Document Preview-01.png</file>
<file alias="icon-item-revert">icons/Document-Revert-icon.png</file>
<file>icons/Document Text-01.png</file>
<file>icons/Edit Document-01.png</file>
<file>icons/Email-01.png</file>
<file>icons/Email Attachment-01.png</file>
<file>icons/Email Delete-01.png</file>
<file>icons/Email Download-01.png</file>
<file>icons/Email Forward-01.png</file>
<file>icons/Email Inbox-01.png</file>
<file>icons/Email Reply-01.png</file>
<file>icons/File Audio-01.png</file>
<file>icons/File Audio AIFF-01.png</file>
<file>icons/File Audio MP3-01.png</file>
<file>icons/File Audio WAV-01.png</file>
<file>icons/File Audio WMA-01.png</file>
<file alias="icon-item-delete">icons/File Delete-01.png</file>
<file alias="icon-item-history">icons/File History-01.png</file>
<file alias="icon-item-add">icons/File New-01.png</file>
<file alias="icon-item-rename">icons/File Open-01.png</file>
<file>icons/File Video 3GP-01.png</file>
<file>icons/File Video-01.png</file>
<file>icons/File Video AVI-01.png</file>
<file>icons/File Video MOV-01.png</file>
<file>icons/File Video MPEG-01.png</file>
<file>icons/File Video WMV-01.png</file>
<file alias="icon-item-folder">icons/Folder-01.png</file>
<file alias="icon-action-stash-new">icons/Folder Add-01.png</file>
<file alias="icon-action-stash-apply">icons/Folder Compressed-01.png</file>
<file alias="icon-action-stash-delete">icons/Folder Delete-01.png</file>
<file alias="icon-action-stash-diff">icons/Folder Explorer-01.png</file>
<file alias="icon-action-folder-explore">icons/Folder Explorer-01.png</file>
<file>icons/Folder Generic Blue-01.png</file>
<file alias="icon-item-folder-unchanged">icons/Folder Generic Green-01.png</file>
<file alias="icon-item-folder-modified">icons/Folder Generic Red-01.png</file>
<file alias="icon-item-folder-unknown">icons/Folder Generic Silver-01.png</file>
<file alias="icon-action-folder-rename">icons/Folder Open-01.png</file>
<file>icons/Folder RAR-01.png</file>
<file>icons/Games-01.png</file>
<file alias="icon-action-settings">icons/Gear-01.png</file>
<file>icons/Highlighter Blue-01.png</file>
<file>icons/Highlighter Green-01.png</file>
<file alias="icon-action-tag-new">icons/Highlighter Yellow-01.png</file>
<file>icons/Image BMP-01.png</file>
<file>icons/Image GIF-01.png</file>
<file>icons/Image JPEG-01.png</file>
<file>icons/Image PNG-01.png</file>
<file>icons/Image TIFF-01.png</file>
<file>icons/Lock Lock-01.png</file>
<file>icons/Lock Unlock-01.png</file>
<file alias="icon-action-repo-open">icons/My Documents-01.png</file>
<file>icons/My Ebooks-01.png</file>
<file>icons/My Music-01.png</file>
<file>icons/My Pictures.png</file>
<file>icons/My Videos-01.png</file>
<file alias="icon-action-repo-clone">icons/My Websites-01.png</file>
<file>icons/Network Firewall-01.png</file>
<file alias="icon-webview">icons/Network MAC-01.png</file>
<file alias="icon-item-remote">icons/Network PC-01.png</file>
<file>icons/Network Refresh-01.png</file>
<file>icons/Pen Blue-01.png</file>
<file>icons/Pen Green-01.png</file>
<file>icons/Pen Red-01.png</file>
<file alias="icon-action-commit">icons/Save-01.png</file>
<file alias="icon-clear-log">icons/Text Edit.png</file>
<file>icons/USB-01.png</file>
<file>icons/User Administrator Blue-01.png</file>
<file>icons/User Administrator Green-01.png</file>
<file>icons/User Administrator Red-01.png</file>
<file>icons/User Chat-01.png</file>
<file>icons/User Clients-01.png</file>
<file>icons/User Coat Blue-01.png</file>
<file>icons/User Coat Green-01.png</file>
<file>icons/User Coat Red-01.png</file>
<file>icons/User Executive Blue-01.png</file>
<file>icons/User Executive Green-01.png</file>
<file>icons/User Executive Red-01.png</file>
<file>icons/User Group-01.png</file>
<file>icons/User Preppy Blue-01.png</file>
<file>icons/User Preppy Green-01.png</file>
<file>icons/User Preppy Red-01.png</file>
<file>icons/Web HTML-01.png</file>
<file>icons/Web XML-01.png</file>
<file>icons/Window-01.png</file>
<file>icons/Window Refresh-01.png</file>
<file>icons/Windows-01.png</file>
<file>icons/Windows Cascade-01.png</file>
<file>icons/Zoom-01.png</file>
<file>icons/Zoom In-01.png</file>
<file>icons/Zoom Out-01.png</file>
<file alias="icon-item-addremove">icons/File Refresh-01.png</file>
</qresource>
<qresource prefix="/docs">
<file>docs/Translators.txt</file>
<file>docs/Licenses.txt</file>
</qresource>
<qresource prefix="/version">
<file alias="manifest">../manifest.uuid</file>
</qresource>
</RCC>

View File

@ -1,41 +1,56 @@
#include "AboutDialog.h"
#include "ui_AboutDialog.h"
#include <QFile>
AboutDialog::AboutDialog(QWidget *parent, const QString &fossilVersion) :
QDialog(parent),
ui(new Ui::AboutDialog)
{
ui->setupUi(this);
QString banner(QCoreApplication::applicationName() + " " + QCoreApplication::applicationVersion());
ui->lblBanner->setText(banner + "\n" + ui->lblBanner->text());
ui->lblQtVersion->setText(tr("QT version %0").arg(QT_VERSION_STR));
if(!fossilVersion.isEmpty())
ui->lblFossilVersion->setText(tr("Fossil version %0").arg(fossilVersion));
QString additional;
QFile ftrans(":/docs/docs/Translators.txt");
if(ftrans.open(QFile::ReadOnly))
{
additional.append(tr("Translations with the help of:")+"\n");
additional.append(ftrans.readAll());
additional.append("\n\n");
ftrans.close();
}
QFile flicenses(":/docs/docs/Licenses.txt");
if(flicenses.open(QFile::ReadOnly))
{
additional.append(tr("This sofware uses the following open-source libraries and assets:")+"\n");
additional.append(flicenses.readAll());
flicenses.close();
}
ui->txtAdditional->setText(additional);
}
AboutDialog::~AboutDialog()
{
delete ui;
}
#include "AboutDialog.h"
#include "ui_AboutDialog.h"
#include <QFile>
AboutDialog::AboutDialog(QWidget *parent, const QString &fossilVersion) : QDialog(parent), ui(new Ui::AboutDialog)
{
ui->setupUi(this);
QString banner(QCoreApplication::applicationName() + " " + QCoreApplication::applicationVersion());
banner += "\n" + ui->lblBanner->text();
banner += "\n<a href=\"https://fuel-scm.org/\">https://fuel-scm.org/</a>";
banner = banner.replace("\n", "<br/>");
ui->lblBanner->setText(banner);
ui->lblBanner->setOpenExternalLinks(true);
ui->lblBanner->setTextFormat(Qt::RichText);
ui->lblQtVersion->setText(tr("QT version %0").arg(QT_VERSION_STR));
if (!fossilVersion.isEmpty())
ui->lblFossilVersion->setText(tr("Fossil version %0").arg(fossilVersion));
QString revisiontxt;
QFile fmanifest(":/version/manifest");
if (fmanifest.open(QFile::ReadOnly))
{
QString revision = QString(fmanifest.readAll()).trimmed();
revisiontxt = QString(tr("Fuel revision %0").arg("<a href=\"https://fuel-scm.org/fossil/timeline?c=%0\">%0</a>").arg(revision));
ui->lblFuelRevision->setOpenExternalLinks(true);
ui->lblFuelRevision->setTextFormat(Qt::RichText);
fmanifest.close();
}
ui->lblFuelRevision->setText(revisiontxt);
QString additional;
QFile ftrans(":/docs/docs/Translators.txt");
if (ftrans.open(QFile::ReadOnly))
{
additional.append(tr("Translations with the help of:") + "\n");
additional.append(ftrans.readAll());
additional.append("\n\n");
ftrans.close();
}
QFile flicenses(":/docs/docs/Licenses.txt");
if (flicenses.open(QFile::ReadOnly))
{
additional.append(tr("This sofware uses the following open-source libraries and assets:") + "\n");
additional.append(flicenses.readAll());
flicenses.close();
}
ui->txtAdditional->setText(additional);
}
AboutDialog::~AboutDialog()
{
delete ui;
}

View File

@ -3,20 +3,21 @@
#include <QDialog>
namespace Ui {
namespace Ui
{
class AboutDialog;
}
class AboutDialog : public QDialog
{
Q_OBJECT
Q_OBJECT
public:
explicit AboutDialog(QWidget *parent, const QString &fossilVersion);
~AboutDialog();
explicit AboutDialog(QWidget *parent, const QString &fossilVersion);
~AboutDialog();
private:
Ui::AboutDialog *ui;
Ui::AboutDialog *ui;
};
#endif // ABOUTDIALOG_H
#endif // ABOUTDIALOG_H

129
src/AppSettings.cpp Normal file
View File

@ -0,0 +1,129 @@
#include "AppSettings.h"
#include <QCoreApplication>
#include <QDir>
#include <QResource>
#include <QSettings>
#include <QTextCodec>
#include <QTranslator>
///////////////////////////////////////////////////////////////////////////////
Settings::Settings(bool portableMode) : store(0)
{
Mappings.insert(FOSSIL_SETTING_GDIFF_CMD, Setting("", Setting::TYPE_FOSSIL_GLOBAL));
Mappings.insert(FOSSIL_SETTING_GMERGE_CMD, Setting("", Setting::TYPE_FOSSIL_GLOBAL));
Mappings.insert(FOSSIL_SETTING_PROXY_URL, Setting("", Setting::TYPE_FOSSIL_GLOBAL));
Mappings.insert(FOSSIL_SETTING_HTTP_PORT, Setting("", Setting::TYPE_FOSSIL_GLOBAL));
Mappings.insert(FOSSIL_SETTING_IGNORE_GLOB, Setting("", Setting::TYPE_FOSSIL_LOCAL));
Mappings.insert(FOSSIL_SETTING_CRNL_GLOB, Setting("", Setting::TYPE_FOSSIL_LOCAL));
// Go into portable mode when explicitly requested or if a config file exists next to the executable
QString ini_path = QDir::toNativeSeparators(QCoreApplication::applicationDirPath() + QDir::separator() + QCoreApplication::applicationName() + ".ini");
if (portableMode || QFile::exists(ini_path))
store = new QSettings(ini_path, QSettings::IniFormat);
else
{
// Linux: ~/.config/organizationName/applicationName.conf
// Windows: HKEY_CURRENT_USER\Software\organizationName\Fuel
store = new QSettings(QSettings::UserScope, QCoreApplication::organizationName(), QCoreApplication::applicationName());
}
Q_ASSERT(store);
if (!HasValue(FUEL_SETTING_FILE_DBLCLICK))
SetValue(FUEL_SETTING_FILE_DBLCLICK, 0);
if (!HasValue(FUEL_SETTING_LANGUAGE) && SupportsLang(QLocale::system().name()))
SetValue(FUEL_SETTING_LANGUAGE, QLocale::system().name());
if (!HasValue(FUEL_SETTING_WEB_BROWSER))
SetValue(FUEL_SETTING_WEB_BROWSER, 0);
for (int i = 0; i < MAX_CUSTOM_ACTIONS; ++i)
{
CustomAction action;
action.Id = QObject::tr("Custom Action %0").arg(i + 1);
customActions.append(action);
}
ApplyEnvironment();
}
//-----------------------------------------------------------------------------
Settings::~Settings()
{
Q_ASSERT(store);
delete store;
}
//-----------------------------------------------------------------------------
void Settings::ApplyEnvironment()
{
QString lang_id = GetValue(FUEL_SETTING_LANGUAGE).toString();
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
QTextCodec::setCodecForTr(QTextCodec::codecForName("utf8"));
#endif
if (!InstallLang(lang_id))
SetValue(FUEL_SETTING_LANGUAGE, "en_US");
}
//-----------------------------------------------------------------------------
bool Settings::InstallLang(const QString &langId)
{
if (langId == "en_US")
{
QCoreApplication::instance()->removeTranslator(&translator);
return true;
}
QString locale_path = QString(":intl/%0.qm").arg(langId);
if (!translator.load(locale_path))
return false;
Q_ASSERT(!translator.isEmpty());
QCoreApplication::instance()->installTranslator(&translator);
return true;
}
//-----------------------------------------------------------------------------
bool Settings::HasValue(const QString &name) const
{
return store->contains(name);
}
//-----------------------------------------------------------------------------
const QVariant Settings::GetValue(const QString &name)
{
if (!HasValue(name))
return QVariant();
return store->value(name);
}
//-----------------------------------------------------------------------------
void Settings::SetValue(const QString &name, const QVariant &value)
{
store->setValue(name, value);
}
//-----------------------------------------------------------------------------
QVariant &Settings::GetFossilValue(const QString &name)
{
mappings_t::iterator it = Mappings.find(name);
Q_ASSERT(it != Mappings.end());
return it.value().Value;
}
//-----------------------------------------------------------------------------
void Settings::SetFossilValue(const QString &name, const QVariant &value)
{
mappings_t::iterator it = Mappings.find(name);
Q_ASSERT(it != Mappings.end());
it->Value = value;
}
//-----------------------------------------------------------------------------
bool Settings::SupportsLang(const QString &langId) const
{
QString locale_path = QString(":intl/%0.qm").arg(langId);
QResource res(locale_path);
return res.isValid();
}

112
src/AppSettings.h Normal file
View File

@ -0,0 +1,112 @@
#ifndef APPSETTINGS_H
#define APPSETTINGS_H
#include <QMap>
#include <QTranslator>
#include <QVariant>
#include <QVector>
#define FUEL_SETTING_FOSSIL_PATH "FossilPath"
#define FUEL_SETTING_COMMIT_MSG "CommitMsgHistory"
#define FUEL_SETTING_FILE_DBLCLICK "FileDblClickAction"
#define FUEL_SETTING_LANGUAGE "Language"
#define FUEL_SETTING_WEB_BROWSER "WebBrowser"
#define FOSSIL_SETTING_GDIFF_CMD "gdiff-command"
#define FOSSIL_SETTING_GMERGE_CMD "gmerge-command"
#define FOSSIL_SETTING_PROXY_URL "proxy"
#define FOSSIL_SETTING_IGNORE_GLOB "ignore-glob"
#define FOSSIL_SETTING_CRNL_GLOB "crnl-glob"
#define FOSSIL_SETTING_HTTP_PORT "http-port"
enum FileDblClickAction
{
FILE_DLBCLICK_ACTION_DIFF,
FILE_DLBCLICK_ACTION_OPEN,
FILE_DLBCLICK_ACTION_OPENCONTAINING,
FILE_DLBCLICK_ACTION_CUSTOM, // Custom Action 1
FILE_DLBCLICK_ACTION_MAX
};
enum CustomActionContext
{
ACTION_CONTEXT_FILES = 1 << 0,
ACTION_CONTEXT_FOLDERS = 1 << 1,
ACTION_CONTEXT_FILES_AND_FOLDERS = ACTION_CONTEXT_FILES | ACTION_CONTEXT_FOLDERS
};
enum
{
MAX_CUSTOM_ACTIONS = 9
};
struct CustomAction
{
QString Id;
QString Description;
QString Command;
CustomActionContext Context;
bool MultipleSelection;
CustomAction() { Clear(); }
bool IsValid() const { return !(Description.isEmpty() || Command.isEmpty()); }
bool IsActive(CustomActionContext context) const { return (Context & context) != 0; }
void Clear()
{
Description.clear();
Command.clear();
Context = ACTION_CONTEXT_FILES;
MultipleSelection = true;
}
};
struct Settings
{
struct Setting
{
enum SettingType
{
TYPE_FOSSIL_GLOBAL,
TYPE_FOSSIL_LOCAL
};
Setting(QVariant value, SettingType type) : Value(value), Type(type) {}
QVariant Value;
SettingType Type;
};
typedef QMap<QString, Setting> mappings_t;
typedef QVector<CustomAction> custom_actions_t;
Settings(bool portableMode = false);
~Settings();
void ApplyEnvironment();
// App configuration access
class QSettings *GetStore() { return store; }
bool HasValue(const QString &name) const; // store->contains(FUEL_SETTING_FOSSIL_PATH)
const QVariant GetValue(const QString &name); // settings.store->value
void SetValue(const QString &name, const QVariant &value); // settings.store->value
// Fossil configuration access
QVariant &GetFossilValue(const QString &name);
void SetFossilValue(const QString &name, const QVariant &value);
mappings_t &GetMappings() { return Mappings; }
bool SupportsLang(const QString &langId) const;
bool InstallLang(const QString &langId);
custom_actions_t &GetCustomActions() { return customActions; }
private:
mappings_t Mappings;
class QSettings *store;
QTranslator translator;
custom_actions_t customActions;
};
#endif // APPSETTINGS_H

View File

@ -1,73 +1,69 @@
#include <QLineEdit>
#include "BrowserWidget.h"
#include "ui_BrowserWidget.h"
#include <QLineEdit>
BrowserWidget::BrowserWidget(QWidget *parent) :
QWidget(parent),
loading(false)
BrowserWidget::BrowserWidget(QWidget *parent) : QWidget(parent), loading(false)
{
ui = new Ui::BrowserWidget;
ui->setupUi(this);
ui->toolBar->addWidget(ui->txtUrl);
connect(ui->txtUrl, SIGNAL(returnPressed()), this, SLOT(on_txtUrl_returnPressed()) );
ui->actionBrowserStop->setVisible(false);
ui = new Ui::BrowserWidget;
ui->setupUi(this);
ui->toolBar->addWidget(ui->txtUrl);
connect(ui->txtUrl, SIGNAL(returnPressed()), this, SLOT(on_txtUrl_returnPressed()));
ui->actionBrowserStop->setVisible(false);
}
BrowserWidget::~BrowserWidget()
{
delete ui;
delete ui;
}
void BrowserWidget::load(const QUrl &url)
{
ui->webView->load(url);
ui->webView->load(url);
}
void BrowserWidget::on_webView_urlChanged(const QUrl &url)
{
ui->txtUrl->setText(url.toString());
ui->txtUrl->setText(url.toString());
}
void BrowserWidget::on_webView_loadStarted()
{
loading=true;
ui->actionBrowserRefresh->setVisible(false);
ui->actionBrowserStop->setVisible(true);
loading = true;
ui->actionBrowserRefresh->setVisible(false);
ui->actionBrowserStop->setVisible(true);
}
void BrowserWidget::on_webView_loadFinished(bool /*errorOccured*/)
{
loading=false;
ui->actionBrowserRefresh->setVisible(true);
ui->actionBrowserStop->setVisible(false);
loading = false;
ui->actionBrowserRefresh->setVisible(true);
ui->actionBrowserStop->setVisible(false);
}
void BrowserWidget::on_txtUrl_returnPressed()
{
QUrl url(ui->txtUrl->text());
if(url.scheme().isEmpty())
url.setScheme("http");
ui->webView->load(url);
QUrl url(ui->txtUrl->text());
if (url.scheme().isEmpty())
url.setScheme("http");
ui->webView->load(url);
}
void BrowserWidget::on_actionBrowserBack_triggered()
{
ui->webView->back();
ui->webView->back();
}
void BrowserWidget::on_actionBrowserForward_triggered()
{
ui->webView->forward();
ui->webView->forward();
}
void BrowserWidget::on_actionBrowserRefresh_triggered()
{
ui->webView->reload();
ui->webView->reload();
}
void BrowserWidget::on_actionBrowserStop_triggered()
{
ui->webView->stop();
ui->webView->stop();
}

View File

@ -1,37 +1,38 @@
#ifndef BROWSERWIDGET_H
#define BROWSERWIDGET_H
#include <QWidget>
#include <QUrl>
#include <QWidget>
namespace Ui {
namespace Ui
{
class BrowserWidget;
}
class BrowserWidget : public QWidget
{
Q_OBJECT
Q_OBJECT
public:
explicit BrowserWidget(QWidget *parent = 0);
~BrowserWidget();
explicit BrowserWidget(QWidget *parent = 0);
~BrowserWidget();
void load(const QUrl &url);
void load(const QUrl &url);
private slots:
void on_webView_urlChanged(const QUrl &url);
void on_webView_loadStarted();
void on_webView_loadFinished(bool);
void on_actionBrowserBack_triggered();
void on_actionBrowserForward_triggered();
void on_actionBrowserRefresh_triggered();
void on_txtUrl_returnPressed();
void on_webView_urlChanged(const QUrl &url);
void on_webView_loadStarted();
void on_webView_loadFinished(bool);
void on_actionBrowserBack_triggered();
void on_actionBrowserForward_triggered();
void on_actionBrowserRefresh_triggered();
void on_txtUrl_returnPressed();
void on_actionBrowserStop_triggered();
void on_actionBrowserStop_triggered();
private:
Ui::BrowserWidget *ui;
bool loading;
Ui::BrowserWidget *ui;
bool loading;
};
#endif // BROWSERWIDGET_H
#endif // BROWSERWIDGET_H

View File

@ -1,135 +1,134 @@
#include "CloneDialog.h"
#include "ui_CloneDialog.h"
#include <QFileDialog>
#include <QDir>
#include <QMessageBox>
#include <QClipboard>
#include <QUrl>
#include "Utils.h"
#include "ui_CloneDialog.h"
#include <QClipboard>
#include <QDir>
#include <QFileDialog>
#include <QMessageBox>
#include <QUrl>
//-----------------------------------------------------------------------------
CloneDialog::CloneDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::CloneDialog)
CloneDialog::CloneDialog(QWidget *parent) : QDialog(parent), ui(new Ui::CloneDialog)
{
ui->setupUi(this);
ui->setupUi(this);
}
//-----------------------------------------------------------------------------
CloneDialog::~CloneDialog()
{
delete ui;
delete ui;
}
//-----------------------------------------------------------------------------
bool CloneDialog::run(QWidget *parent, QUrl &url, QString &repository, QUrl &urlProxy)
{
CloneDialog dlg(parent);
CloneDialog dlg(parent);
// Try to parse a url from the clipboard
QClipboard *clipboard = QApplication::clipboard();
if(clipboard)
{
QUrl nurl = QUrl::fromUserInput(clipboard->text());
// Try to parse a url from the clipboard
QClipboard *clipboard = QApplication::clipboard();
if (clipboard)
{
QUrl nurl = QUrl::fromUserInput(clipboard->text());
// If we have a valid url
if(nurl.isValid() && !nurl.isEmpty())
{
// Fill in dialog
dlg.ui->lineUserName->setText(nurl.userName());
dlg.ui->linePassword->setText(nurl.password());
nurl.setUserName("");
nurl.setPassword("");
dlg.ui->lineURL->setText(UrlToStringNoCredentials(nurl));
}
}
// If we have a valid url
if (nurl.isValid() && !nurl.isEmpty())
{
// Fill in dialog
dlg.ui->lineUserName->setText(nurl.userName());
dlg.ui->linePassword->setText(nurl.password());
nurl.setUserName("");
nurl.setPassword("");
dlg.ui->lineURL->setText(UrlToStringNoCredentials(nurl));
}
}
if(dlg.exec() != QDialog::Accepted)
return false;
if (dlg.exec() != QDialog::Accepted)
return false;
QString urltext = dlg.ui->lineURL->text();
QString urltext = dlg.ui->lineURL->text();
url = QUrl::fromUserInput(urltext);
if(url.isEmpty() || !url.isValid())
{
QMessageBox::critical(parent, tr("Error"), tr("Invalid URL."), QMessageBox::Ok );
return false;
}
// Check if the url is a local file
if (QFileInfo::exists(urltext))
url = QUrl::fromLocalFile(urltext);
else
{
url = QUrl::fromUserInput(urltext);
if (url.isEmpty() || !url.isValid())
{
QMessageBox::critical(parent, tr("Error"), tr("Invalid URL."), QMessageBox::Ok);
return false;
}
}
if(!dlg.ui->lineUserName->text().trimmed().isEmpty())
url.setUserName(dlg.ui->lineUserName->text());
if (!dlg.ui->lineUserName->text().trimmed().isEmpty())
url.setUserName(dlg.ui->lineUserName->text());
if(!dlg.ui->linePassword->text().trimmed().isEmpty())
url.setPassword(dlg.ui->linePassword->text());
if (!dlg.ui->linePassword->text().trimmed().isEmpty())
url.setPassword(dlg.ui->linePassword->text());
if(dlg.ui->lineTargetRepository->text().isEmpty())
{
QMessageBox::critical(parent, tr("Error"), tr("Invalid Repository File."), QMessageBox::Ok );
return false;
}
if (dlg.ui->lineTargetRepository->text().isEmpty())
{
QMessageBox::critical(parent, tr("Error"), tr("Invalid Repository File."), QMessageBox::Ok);
return false;
}
urlProxy = QUrl::fromUserInput(dlg.ui->lineHttpProxyUrl->text());
if(!urlProxy.isEmpty() && !urlProxy.isValid())
{
QMessageBox::critical(parent, tr("Error"), tr("Invalid Proxy URL."), QMessageBox::Ok );
return false;
}
urlProxy = QUrl::fromUserInput(dlg.ui->lineHttpProxyUrl->text());
if (!urlProxy.isEmpty() && !urlProxy.isValid())
{
QMessageBox::critical(parent, tr("Error"), tr("Invalid Proxy URL."), QMessageBox::Ok);
return false;
}
repository = dlg.ui->lineTargetRepository->text();
return true;
repository = dlg.ui->lineTargetRepository->text();
return true;
}
//-----------------------------------------------------------------------------
void CloneDialog::GetRepositoryPath(QString &pathResult)
{
QString filter(tr("Fossil Repository") + QString(" (*." FOSSIL_EXT ")"));
QString filter(tr("Fossil Repository") + QString(" (*." FOSSIL_EXT ")"));
pathResult = QFileDialog::getSaveFileName(
this,
tr("Select Fossil Repository"),
QDir::toNativeSeparators(pathResult),
filter,
&filter,
QFileDialog::DontConfirmOverwrite);
pathResult = QFileDialog::getSaveFileName(this, tr("Select Fossil Repository"), QDir::toNativeSeparators(pathResult), filter, &filter, QFileDialog::DontConfirmOverwrite);
// Ensure that it ends in the required extension (On GTK, Qt doesn't seem to add it automatically)
QFileInfo fi(pathResult);
if(fi.suffix().toLower() != ("." FOSSIL_EXT))
pathResult += "." FOSSIL_EXT;
// Ensure that it ends in the required extension (On GTK, Qt doesn't seem to add it automatically)
QFileInfo fi(pathResult);
QString ext = fi.suffix().toLower();
if (ext != FOSSIL_EXT)
pathResult += "." FOSSIL_EXT;
}
//-----------------------------------------------------------------------------
void CloneDialog::on_btnSelectSourceRepo_clicked()
{
QString path = ui->lineURL->text();
GetRepositoryPath(path);
QString path = ui->lineURL->text();
GetRepositoryPath(path);
if(path.trimmed().isEmpty())
return;
if (path.trimmed().isEmpty())
return;
if(!QFile::exists(path))
{
QMessageBox::critical(this, tr("Error"), tr("Invalid Repository File."), QMessageBox::Ok);
return;
}
if (!QFile::exists(path))
{
QMessageBox::critical(this, tr("Error"), tr("Invalid Repository File."), QMessageBox::Ok);
return;
}
ui->lineURL->setText(QDir::toNativeSeparators(path));
ui->lineURL->setText(QDir::toNativeSeparators(path));
}
//-----------------------------------------------------------------------------
void CloneDialog::on_btnSelectTargetRepo_clicked()
{
QString path = ui->lineTargetRepository->text();
GetRepositoryPath(path);
QString path = ui->lineTargetRepository->text();
GetRepositoryPath(path);
if(path.trimmed().isEmpty())
return;
if (path.trimmed().isEmpty())
return;
if(QFile::exists(path))
{
QMessageBox::critical(this, tr("Error"), tr("This repository file already exists."), QMessageBox::Ok);
return;
}
if (QFile::exists(path))
{
QMessageBox::critical(this, tr("Error"), tr("This repository file already exists."), QMessageBox::Ok);
return;
}
ui->lineTargetRepository->setText(QDir::toNativeSeparators(path));
ui->lineTargetRepository->setText(QDir::toNativeSeparators(path));
}

View File

@ -3,28 +3,29 @@
#include <QDialog>
namespace Ui {
namespace Ui
{
class CloneDialog;
}
class CloneDialog : public QDialog
{
Q_OBJECT
Q_OBJECT
public:
explicit CloneDialog(QWidget *parent = 0);
~CloneDialog();
explicit CloneDialog(QWidget *parent = 0);
~CloneDialog();
static bool run(QWidget *parent, class QUrl &url, QString &repository, QUrl& urlProxy);
static bool run(QWidget *parent, class QUrl &url, QString &repository, QUrl &urlProxy);
private slots:
void on_btnSelectSourceRepo_clicked();
void on_btnSelectTargetRepo_clicked();
void on_btnSelectSourceRepo_clicked();
void on_btnSelectTargetRepo_clicked();
private:
void GetRepositoryPath(QString &pathResult);
void GetRepositoryPath(QString &pathResult);
Ui::CloneDialog *ui;
Ui::CloneDialog *ui;
};
#endif // CLONEDIALOG_H
#endif // CLONEDIALOG_H

View File

@ -1,170 +1,168 @@
#include "CommitDialog.h"
#include "MainWindow.h" // Ugly. I know.
#include "ui_CommitDialog.h"
#include <QAction>
#include <QPushButton>
#include <QShortcut>
#include "ui_CommitDialog.h"
#include "MainWindow.h" // Ugly. I know.
CommitDialog::CommitDialog(QWidget *parent, const QString &title, QStringList &files, const QStringList *history, bool stashMode) :
QDialog(parent, Qt::Sheet),
ui(new Ui::CommitDialog)
CommitDialog::CommitDialog(QWidget *parent, const QString &title, QStringList &files, const QStringList *history, bool stashMode) : QDialog(parent, Qt::Sheet), ui(new Ui::CommitDialog)
{
ui->setupUi(this);
ui->plainTextEdit->clear();
ui->listView->setModel(&itemModel);
ui->setupUi(this);
ui->plainTextEdit->clear();
ui->listView->setModel(&itemModel);
setWindowTitle(title);
setWindowTitle(title);
// Activate the appropriate control based on mode
ui->plainTextEdit->setVisible(!stashMode);
ui->lineEdit->setVisible(stashMode);
// Activate the appropriate control based on mode
ui->plainTextEdit->setVisible(!stashMode);
ui->lineEdit->setVisible(stashMode);
// Activate the checkbox if we have some text
ui->chkRevertFiles->setVisible(stashMode);
// Activate the checkbox if we have some text
ui->chkRevertFiles->setVisible(stashMode);
ui->widgetBranchOptions->setVisible(!stashMode);
ui->widgetBranchOptions->setVisible(!stashMode);
// Activate the combo if we have history
ui->comboBox->setVisible(history!=0);
if(history)
{
// Generate the history combo
foreach(const QString msg, *history)
{
QString trimmed = msg.trimmed();
if(trimmed.isEmpty())
continue;
// Activate the combo if we have history
ui->comboBox->setVisible(history != 0);
if (history)
{
// Generate the history combo
foreach (const QString msg, *history)
{
QString trimmed = msg.trimmed();
if (trimmed.isEmpty())
continue;
commitMessages.append(trimmed);
QStringList lines = trimmed.split('\n');
QString first_line;
if(!lines.empty())
first_line = lines[0] + "...";
commitMessages.append(trimmed);
QStringList lines = trimmed.split('\n');
QString first_line;
if (!lines.empty())
first_line = lines[0] + "...";
ui->comboBox->addItem(first_line);
}
}
ui->comboBox->addItem(first_line);
}
}
// Populate file list
for(QStringList::const_iterator it=files.begin(); it!=files.end(); ++it)
{
QStandardItem *si = new QStandardItem(*it);
si->setCheckable(true);
si->setCheckState(Qt::Checked);
itemModel.appendRow(si);
}
// Populate file list
for (QStringList::const_iterator it = files.begin(); it != files.end(); ++it)
{
QStandardItem *si = new QStandardItem(*it);
si->setCheckable(true);
si->setCheckState(Qt::Checked);
itemModel.appendRow(si);
}
// Trigger commit with a Ctrl-Return from the comment box
QAction *action = new QAction(ui->plainTextEdit);
QShortcut *shortcut = new QShortcut(QKeySequence("Ctrl+Return"), ui->plainTextEdit);
action->setAutoRepeat(false);
connect(shortcut, SIGNAL(activated()), ui->buttonBox->button(QDialogButtonBox::Ok), SLOT(click()));
// Trigger commit with a Ctrl-Return from the comment box
QAction* action = new QAction(ui->plainTextEdit);
QShortcut* shortcut = new QShortcut(QKeySequence("Ctrl+Return"), ui->plainTextEdit);
action->setAutoRepeat(false);
connect(shortcut, SIGNAL(activated()), ui->buttonBox->button(QDialogButtonBox::Ok), SLOT(click()));
// Abort commit with an Escape key from the comment box
action = new QAction(ui->plainTextEdit);
shortcut = new QShortcut(QKeySequence("Escape"), ui->plainTextEdit);
action->setAutoRepeat(false);
connect(shortcut, SIGNAL(activated()), ui->buttonBox->button(QDialogButtonBox::Cancel), SLOT(click()));
// Abort commit with an Escape key from the comment box
action = new QAction(ui->plainTextEdit);
shortcut = new QShortcut(QKeySequence("Escape"), ui->plainTextEdit);
action->setAutoRepeat(false);
connect(shortcut, SIGNAL(activated()), ui->buttonBox->button(QDialogButtonBox::Cancel), SLOT(click()));
}
//------------------------------------------------------------------------------
CommitDialog::~CommitDialog()
{
delete ui;
delete ui;
}
//------------------------------------------------------------------------------
bool CommitDialog::runCommit(QWidget* parent, QStringList& files, QString& commitMsg, const QStringList& commitMsgHistory, QString &branchName, bool &privateBranch)
bool CommitDialog::runCommit(QWidget *parent, QStringList &files, QString &commitMsg, const QStringList &commitMsgHistory, QString &branchName, bool &privateBranch)
{
CommitDialog dlg(parent, tr("Commit Changes"), files, &commitMsgHistory, false);
int res = dlg.exec();
CommitDialog dlg(parent, tr("Commit Changes"), files, &commitMsgHistory, false);
int res = dlg.exec();
commitMsg = dlg.ui->plainTextEdit->toPlainText();
commitMsg = dlg.ui->plainTextEdit->toPlainText();
if(res!=QDialog::Accepted)
return false;
if (res != QDialog::Accepted)
return false;
files.clear();
for(int i=0; i<dlg.itemModel.rowCount(); ++i)
{
QStandardItem *si = dlg.itemModel.item(i);
if(si->checkState()!=Qt::Checked)
continue;
files.append(si->text());
}
files.clear();
for (int i = 0; i < dlg.itemModel.rowCount(); ++i)
{
QStandardItem *si = dlg.itemModel.item(i);
if (si->checkState() != Qt::Checked)
continue;
files.append(si->text());
}
branchName.clear();
if(dlg.ui->chkNewBranch->isChecked())
{
branchName = dlg.ui->lineBranchName->text().trimmed();
privateBranch = dlg.ui->chkPrivateBranch->isChecked();
}
branchName.clear();
if (dlg.ui->chkNewBranch->isChecked())
{
branchName = dlg.ui->lineBranchName->text().trimmed();
privateBranch = dlg.ui->chkPrivateBranch->isChecked();
}
return true;
return true;
}
//------------------------------------------------------------------------------
bool CommitDialog::runStashNew(QWidget* parent, QStringList& stashedFiles, QString& stashName, bool& revertFiles)
bool CommitDialog::runStashNew(QWidget *parent, QStringList &stashedFiles, QString &stashName, bool &revertFiles)
{
CommitDialog dlg(parent, tr("Stash Changes"), stashedFiles, NULL, true);
int res = dlg.exec();
CommitDialog dlg(parent, tr("Stash Changes"), stashedFiles, NULL, true);
int res = dlg.exec();
stashName = dlg.ui->lineEdit->text();
stashName = dlg.ui->lineEdit->text();
if(res!=QDialog::Accepted)
return false;
if (res != QDialog::Accepted)
return false;
stashedFiles.clear();
for(int i=0; i<dlg.itemModel.rowCount(); ++i)
{
QStandardItem *si = dlg.itemModel.item(i);
if(si->checkState()!=Qt::Checked)
continue;
stashedFiles.append(si->text());
}
stashedFiles.clear();
for (int i = 0; i < dlg.itemModel.rowCount(); ++i)
{
QStandardItem *si = dlg.itemModel.item(i);
if (si->checkState() != Qt::Checked)
continue;
stashedFiles.append(si->text());
}
revertFiles = dlg.ui->chkRevertFiles->checkState() == Qt::Checked;
return true;
revertFiles = dlg.ui->chkRevertFiles->checkState() == Qt::Checked;
return true;
}
//------------------------------------------------------------------------------
void CommitDialog::on_comboBox_activated(int index)
{
Q_ASSERT(index < commitMessages.length());
Q_ASSERT(index < commitMessages.length());
if(ui->plainTextEdit->isVisible())
ui->plainTextEdit->setPlainText(commitMessages[index]);
if (ui->plainTextEdit->isVisible())
ui->plainTextEdit->setPlainText(commitMessages[index]);
if(ui->lineEdit->isVisible())
ui->lineEdit->setText(commitMessages[index]);
if (ui->lineEdit->isVisible())
ui->lineEdit->setText(commitMessages[index]);
}
//------------------------------------------------------------------------------
void CommitDialog::on_listView_doubleClicked(const QModelIndex &index)
{
QVariant data = itemModel.data(index);
QString filename = data.toString();
reinterpret_cast<MainWindow*>(parent())->diffFile(filename);
QVariant data = itemModel.data(index);
QString filename = data.toString();
reinterpret_cast<MainWindow *>(parent())->diffFile(filename);
}
//------------------------------------------------------------------------------
void CommitDialog::on_listView_clicked(const QModelIndex &)
{
int num_selected = 0;
for(int i=0; i<itemModel.rowCount(); ++i)
{
QStandardItem *si = itemModel.item(i);
if(si->checkState()==Qt::Checked)
++num_selected;
}
int num_selected = 0;
for (int i = 0; i < itemModel.rowCount(); ++i)
{
QStandardItem *si = itemModel.item(i);
if (si->checkState() == Qt::Checked)
++num_selected;
}
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(num_selected>0);
ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(num_selected > 0);
}
//------------------------------------------------------------------------------
void CommitDialog::on_chkNewBranch_toggled(bool checked)
{
ui->lblPrivateBranch->setEnabled(checked);
ui->chkPrivateBranch->setEnabled(checked);
ui->lineBranchName->setEnabled(checked);
ui->lblPrivateBranch->setEnabled(checked);
ui->chkPrivateBranch->setEnabled(checked);
ui->lineBranchName->setEnabled(checked);
}

View File

@ -4,31 +4,32 @@
#include <QDialog>
#include <QStandardItemModel>
namespace Ui {
class CommitDialog;
namespace Ui
{
class CommitDialog;
}
class CommitDialog : public QDialog
{
Q_OBJECT
Q_OBJECT
public:
explicit CommitDialog(QWidget *parent, const QString &title, QStringList &files, const QStringList *history, bool stashMode);
~CommitDialog();
explicit CommitDialog(QWidget *parent, const QString &title, QStringList &files, const QStringList *history, bool stashMode);
~CommitDialog();
static bool runStashNew(QWidget* parent, QStringList& stashedFiles, QString& stashName, bool &revertFiles);
static bool runCommit(QWidget* parent, QStringList& files, QString& commitMsg, const QStringList &commitMsgHistory, QString& branchName, bool& privateBranch);
static bool runStashNew(QWidget *parent, QStringList &stashedFiles, QString &stashName, bool &revertFiles);
static bool runCommit(QWidget *parent, QStringList &files, QString &commitMsg, const QStringList &commitMsgHistory, QString &branchName, bool &privateBranch);
private slots:
void on_comboBox_activated(int index);
void on_listView_doubleClicked(const QModelIndex &index);
void on_listView_clicked(const QModelIndex &index);
void on_chkNewBranch_toggled(bool checked);
void on_comboBox_activated(int index);
void on_listView_doubleClicked(const QModelIndex &index);
void on_listView_clicked(const QModelIndex &index);
void on_chkNewBranch_toggled(bool checked);
private:
Ui::CommitDialog *ui;
QStandardItemModel itemModel;
QStringList commitMessages;
Ui::CommitDialog *ui;
QStandardItemModel itemModel;
QStringList commitMessages;
};
#endif // COMMITDIALOG_H
#endif // COMMITDIALOG_H

View File

@ -1,19 +1,18 @@
#include "CustomWebView.h"
#include <QMouseEvent>
CustomWebView::CustomWebView(QWidget *parent) :
QWebView(parent)
CustomWebView::CustomWebView(QWidget *parent) : QWebEngineView(parent)
{
setUrl(QUrl("about:blank"));
setUrl(QUrl("about:blank"));
}
void CustomWebView::mousePressEvent(QMouseEvent *event)
{
Qt::MouseButton but = event->button();
if(but == Qt::XButton1)
back();
else if(but == Qt::XButton2)
forward();
else
QWebView::mousePressEvent(event);
Qt::MouseButton but = event->button();
if (but == Qt::XButton1)
back();
else if (but == Qt::XButton2)
forward();
else
QWebEngineView::mousePressEvent(event);
}

View File

@ -1,21 +1,20 @@
#ifndef CUSTOMWEBVIEW_H
#define CUSTOMWEBVIEW_H
#include <QWebView>
#include <QWebEngineView>
class CustomWebView : public QWebView
class CustomWebView : public QWebEngineView
{
Q_OBJECT
Q_OBJECT
public:
explicit CustomWebView(QWidget *parent = 0);
explicit CustomWebView(QWidget *parent = 0);
signals:
public slots:
protected:
virtual void mousePressEvent(QMouseEvent *event);
virtual void mousePressEvent(QMouseEvent *event);
};
#endif // CUSTOMWEBVIEW_H
#endif // CUSTOMWEBVIEW_H

View File

@ -1,64 +1,61 @@
#include <QCheckBox>
#include "FileActionDialog.h"
#include "ui_FileActionDialog.h"
#include <QCheckBox>
FileActionDialog::FileActionDialog(QWidget *parent, const QString &title, const QString &message, const QStringList &listData, const QString &checkBoxText, bool *checkBoxResult) :
QDialog(parent, Qt::Sheet),
ui(new Ui::FileActionDialog),
clickedButton(QDialogButtonBox::NoButton)
QDialog(parent, Qt::Sheet), ui(new Ui::FileActionDialog), clickedButton(QDialogButtonBox::NoButton)
{
ui->setupUi(this);
setWindowTitle(title);
ui->label->setText(message);
ui->listView->setModel(&itemModel);
setWindowTitle(title);
ui->label->setText(message);
ui->listView->setModel(&itemModel);
if(!checkBoxText.isEmpty() && checkBoxResult)
{
checkBox = new QCheckBox(this);
checkBox->setText(checkBoxText);
checkBox->setEnabled(true);
checkBox->setChecked(*checkBoxResult);
this->checkBoxResult = checkBoxResult;
ui->verticalLayout->insertWidget(2, checkBox);
}
if (!checkBoxText.isEmpty() && checkBoxResult)
{
checkBox = new QCheckBox(this);
checkBox->setText(checkBoxText);
checkBox->setEnabled(true);
checkBox->setChecked(*checkBoxResult);
this->checkBoxResult = checkBoxResult;
ui->verticalLayout->insertWidget(2, checkBox);
}
if(listData.empty())
ui->listView->setVisible(false);
else
{
foreach(const QString &s, listData)
itemModel.appendRow(new QStandardItem(s));
}
if (listData.empty())
ui->listView->setVisible(false);
else
{
foreach (const QString &s, listData)
itemModel.appendRow(new QStandardItem(s));
}
}
FileActionDialog::~FileActionDialog()
{
delete ui;
delete ui;
}
bool FileActionDialog::run(QWidget *parent, const QString &title, const QString &message, const QStringList &listData, const QString &checkBoxText, bool *checkBoxResult)
{
FileActionDialog dlg(parent, title, message, listData, checkBoxText, checkBoxResult);
int res = dlg.exec();
FileActionDialog dlg(parent, title, message, listData, checkBoxText, checkBoxResult);
int res = dlg.exec();
if(!checkBoxText.isEmpty() && checkBoxResult && dlg.checkBox)
*checkBoxResult = dlg.checkBox->isChecked();
if (!checkBoxText.isEmpty() && checkBoxResult && dlg.checkBox)
*checkBoxResult = dlg.checkBox->isChecked();
return res == QDialog::Accepted;
return res == QDialog::Accepted;
}
QDialogButtonBox::StandardButton FileActionDialog::runStandardButtons(QWidget *parent, StandardButtons buttons, const QString &title, const QString &message, const QStringList &listData)
{
FileActionDialog dlg(parent, title, message, listData);
dlg.ui->buttonBox->setStandardButtons(buttons);
FileActionDialog dlg(parent, title, message, listData);
dlg.ui->buttonBox->setStandardButtons(buttons);
dlg.exec();
return dlg.clickedButton;
dlg.exec();
return dlg.clickedButton;
}
void FileActionDialog::on_buttonBox_clicked(QAbstractButton *button)
{
// Retrieve the flag corresponding to the standard clicked
clickedButton = ui->buttonBox->standardButton(button);
// Retrieve the flag corresponding to the standard clicked
clickedButton = ui->buttonBox->standardButton(button);
}

View File

@ -2,37 +2,37 @@
#define FILEACTIONDIALOG_H
#include <QDialog>
#include <QStandardItemModel>
#include <QDialogButtonBox>
#include <QStandardItemModel>
namespace Ui {
class FileActionDialog;
namespace Ui
{
class FileActionDialog;
}
class FileActionDialog : public QDialog
{
Q_OBJECT
public:
explicit FileActionDialog(QWidget *parent, const QString &title, const QString &message, const QStringList &listData, const QString &checkBoxText=QString(), bool *checkBoxResult=0);
explicit FileActionDialog(QWidget *parent, const QString &title, const QString &message, const QStringList &listData, const QString &checkBoxText = QString(), bool *checkBoxResult = 0);
~FileActionDialog();
static bool run(QWidget *parent, const QString &title, const QString &message, const QStringList &listData, const QString &checkBoxText=QString(), bool *checkBoxResult=0);
static bool run(QWidget *parent, const QString &title, const QString &message, const QStringList &listData, const QString &checkBoxText = QString(), bool *checkBoxResult = 0);
typedef QDialogButtonBox::StandardButton StandardButton;
typedef QDialogButtonBox::StandardButtons StandardButtons;
static StandardButton runStandardButtons(QWidget *parent, StandardButtons, const QString &title, const QString &message, const QStringList &listData);
typedef QDialogButtonBox::StandardButton StandardButton;
typedef QDialogButtonBox::StandardButtons StandardButtons;
static StandardButton runStandardButtons(QWidget *parent, StandardButtons, const QString &title, const QString &message, const QStringList &listData);
private slots:
void on_buttonBox_clicked(QAbstractButton *button);
void on_buttonBox_clicked(QAbstractButton *button);
private:
Ui::FileActionDialog *ui;
QStandardItemModel itemModel;
class QCheckBox *checkBox;
bool *checkBoxResult;
StandardButton clickedButton;
QStandardItemModel itemModel;
class QCheckBox *checkBox;
bool *checkBoxResult;
StandardButton clickedButton;
};
#endif // FILEACTIONDIALOG_H
#endif // FILEACTIONDIALOG_H

View File

@ -1,31 +1,27 @@
#include "FileTableView.h"
#include <QMouseEvent>
#include <QApplication>
#include <QMouseEvent>
FileTableView::FileTableView(QWidget *parent) :
QTableView(parent)
{
}
FileTableView::FileTableView(QWidget *parent) : QTableView(parent) {}
//------------------------------------------------------------------------------
void FileTableView::mousePressEvent(QMouseEvent *event)
{
if (event->button() == Qt::LeftButton)
dragStartPos = event->pos();
if (event->button() == Qt::LeftButton)
dragStartPos = event->pos();
QTableView::mousePressEvent(event);
QTableView::mousePressEvent(event);
}
//------------------------------------------------------------------------------
void FileTableView::mouseMoveEvent(QMouseEvent *event)
{
int distance = (event->pos() - dragStartPos).manhattanLength();
if (event->buttons() & Qt::LeftButton && distance >= QApplication::startDragDistance())
{
dragOutEvent();
QTableView::mouseReleaseEvent(event);
}
else
QTableView::mouseMoveEvent(event);
int distance = (event->pos() - dragStartPos).manhattanLength();
if (event->buttons() & Qt::LeftButton && distance >= QApplication::startDragDistance())
{
dragOutEvent();
QTableView::mouseReleaseEvent(event);
}
else
QTableView::mouseMoveEvent(event);
}

View File

@ -1,24 +1,24 @@
#ifndef FILETABLEVIEW_H
#define FILETABLEVIEW_H
#include <QTableView>
#include <QPoint>
#include <QTableView>
class FileTableView : public QTableView
{
Q_OBJECT
Q_OBJECT
public:
explicit FileTableView(QWidget *parent = 0);
explicit FileTableView(QWidget *parent = 0);
signals:
void dragOutEvent();
void dragOutEvent();
private:
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
private:
QPoint dragStartPos;
QPoint dragStartPos;
};
#endif // FILETABLEVIEW_H
#endif // FILETABLEVIEW_H

File diff suppressed because it is too large Load Diff

View File

@ -2,151 +2,120 @@
#define FOSSIL_H
class QStringList;
#include "LoggedProcess.h"
#include "Utils.h"
#include "WorkspaceCommon.h"
#include <QString>
#include <QStringList>
#include <QUrl>
#include "LoggedProcess.h"
#include "Utils.h"
typedef QMap<QString, QString> stashmap_t;
enum RunFlags
{
RUNFLAGS_NONE = 0<<0,
RUNFLAGS_SILENT_INPUT = 1<<0,
RUNFLAGS_SILENT_OUTPUT = 1<<1,
RUNFLAGS_SILENT_ALL = RUNFLAGS_SILENT_INPUT | RUNFLAGS_SILENT_OUTPUT,
RUNFLAGS_DETACHED = 1<<2,
RUNFLAGS_DEBUG = 1<<3,
};
enum RepoStatus
{
REPO_OK,
REPO_NOT_FOUND,
REPO_OLD_SCHEMA
};
class Fossil
{
public:
Fossil()
: operationAborted(false)
, uiCallback(0)
{
}
Fossil();
void Init(UICallback *callback, const QString &exePath);
void Init(UICallback *callback)
{
uiCallback = callback;
fossilPath.clear();
workspacePath.clear();
}
// Repositories
bool createRepository(const QString &repositoryPath);
bool cloneRepository(const QString &repository, const QUrl &url, const QUrl &proxyUrl);
bool runFossil(const QStringList &args, QStringList *output=0, int runFlags=RUNFLAGS_NONE);
bool runFossilRaw(const QStringList &args, QStringList *output, int *exitCode, int runFlags);
// Workspace
bool createWorkspace(const QString &repositoryPath, const QString &workspacePath);
bool closeWorkspace(bool force = false);
void setWorkspace(const QString &_workspacePath);
bool pushWorkspace(const QUrl &url);
bool pullWorkspace(const QUrl &url);
bool undoWorkspace(QStringList &result, bool explainOnly);
bool updateWorkspace(QStringList &result, const QString &revision, bool explainOnly);
bool statusWorkspace(QStringList &result);
WorkspaceState getWorkspaceState();
static bool isWorkspace(const QString &path);
static bool isWorkspace(const QString &path);
// Workspace Information
const QString &getProjectName() const { return projectName; }
const QString &getRepositoryFile() const { return repositoryFile; }
const QString &getWorkspacePath() const { return workspacePath; }
RepoStatus getRepoStatus();
// Files
bool listFiles(QStringList &files);
bool diffFile(const QString &repoFile, bool graphical);
bool commitFiles(const QStringList &fileList, const QString &comment, const QString &newBranchName, bool isPrivateBranch);
bool addFiles(const QStringList &fileList);
bool removeFiles(const QStringList &fileList, bool deleteLocal);
bool addRemoveFiles();
bool revertFiles(const QStringList &fileList);
bool renameFile(const QString &beforePath, const QString &afterPath, bool renameLocal);
void setWorkspacePath(const QString &workspace)
{
workspacePath = workspace;
}
// Settings
bool getSettings(QStringList &result);
bool setSetting(const QString &name, const QString &value, bool global);
const QString &getWorkspacePath() const
{
return workspacePath;
}
// Remotes
bool setRemoteUrl(const QUrl &url);
bool getRemoteUrl(QUrl &url);
const QString &getProjectName() const
{
return projectName;
}
// Stashes
bool stashNew(const QStringList &fileList, const QString &name, bool revert);
bool stashList(stashmap_t &stashes);
bool stashApply(const QString &name);
bool stashDrop(const QString &name);
bool stashDiff(const QString &name);
const QString &getRepositoryFile() const
{
return repositoryFile;
}
// Tags
bool tagList(QStringMap &tags);
bool tagNew(const QString &name, const QString &revision);
bool tagDelete(const QString &name, const QString &revision);
void setRepositoryFile(const QString &filename)
{
repositoryFile = filename;
}
// Branches
bool branchList(QStringList &branches, QStringList &activeBranches);
bool branchNew(const QString &name, const QString &revisionBasis, bool isPrivate = false);
bool branchMerge(QStringList &res, const QString &revision, bool integrate, bool force, bool testOnly);
bool openRepository(const QString &repositoryPath, const QString& workspacePath);
bool newRepository(const QString &repositoryPath);
bool closeRepository();
bool pushRepository(const QUrl& url);
bool pullRepository(const QUrl& url);
bool cloneRepository(const QString &repository, const QUrl &url, const QUrl &proxyUrl);
bool undoRepository(QStringList& result, bool explainOnly);
bool updateRepository(QStringList& result, const QString& revision, bool explainOnly);
bool getFossilVersion(QString &version);
const QString &getCurrentRevision() const { return currentRevision; }
const QStringList &getActiveTags() const { return activeTags; }
bool uiRunning() const;
bool startUI(const QString &httpPort);
void stopUI();
// UI
bool uiRunning() const;
bool startUI(const QString &httpPort);
void stopUI();
const QString &getUIHttpPort() const { return fossilUIPort; }
QString getUIHttpAddress() const;
bool listFiles(QStringList &files);
bool status(QStringList& result);
bool diffFile(const QString &repoFile, bool graphical);
bool commitFiles(const QStringList &fileList, const QString &comment, const QString& newBranchName, bool isPrivateBranch);
bool addFiles(const QStringList& fileList);
bool removeFiles(const QStringList& fileList, bool deleteLocal);
bool revertFiles(const QStringList& fileList);
bool renameFile(const QString& beforePath, const QString& afterPath, bool renameLocal);
bool getFossilSettings(QStringList& result);
bool setFossilSetting(const QString &name, const QString &value, bool global);
bool setRemoteUrl(const QUrl& url);
bool getRemoteUrl(QUrl &url);
bool stashNew(const QStringList& fileList, const QString& name, bool revert);
bool stashList(stashmap_t &stashes);
bool stashApply(const QString& name);
bool stashDrop(const QString& name);
bool stashDiff(const QString& name);
void abortOperation() { operationAborted = true; }
bool tagList(QStringMap& tags);
bool tagNew(const QString& name, const QString& revision);
bool tagDelete(const QString& name, const QString& revision);
bool branchList(QStringList& branches, QStringList& activeBranches);
bool branchNew(const QString& name, const QString& revisionBasis, bool isPrivate=false);
bool branchMerge(QStringList& res, const QString& revision, bool integrate, bool force, bool testOnly);
const QString &getCurrentRevision() const { return currentRevision; }
const QStringList &getActiveTags() const { return activeTags; }
const QString &getUIHttpPort() const { return fossilUIPort; }
QString getUIHttpAddress() const;
void setExecutablePath(const QString &path) { fossilPath = path; }
// Fossil executable
void setExePath(const QString &path) { fossilPath = path; }
bool getExeVersion(QString &version);
private:
void log(const QString &text, bool isHTML=false)
{
if(uiCallback)
uiCallback->logText(text, isHTML);
}
enum RunFlags
{
RUNFLAGS_NONE = 0 << 0,
RUNFLAGS_SILENT_INPUT = 1 << 0,
RUNFLAGS_SILENT_OUTPUT = 1 << 1,
RUNFLAGS_SILENT_ALL = RUNFLAGS_SILENT_INPUT | RUNFLAGS_SILENT_OUTPUT,
RUNFLAGS_DETACHED = 1 << 2,
RUNFLAGS_DEBUG = 1 << 3,
};
QString getFossilPath();
void setRepositoryFile(const QString &filename) { repositoryFile = filename; }
bool runFossil(const QStringList &args, QStringList *output = 0, int runFlags = RUNFLAGS_NONE);
bool runFossilRaw(const QStringList &args, QStringList *output, int *exitCode, int runFlags);
QString getFossilPath();
bool operationAborted;
UICallback *uiCallback;
QString workspacePath;
QString fossilPath; // The value from the settings
QString repositoryFile;
QString projectName;
QString currentRevision;
QStringList activeTags;
LoggedProcess fossilUI;
QString fossilUIPort;
void log(const QString &text, bool isHTML = false)
{
if (uiCallback)
uiCallback->logText(text, isHTML);
}
UICallback *uiCallback;
QString workspacePath;
QString fossilPath; // The value from the settings
QString repositoryFile;
QString projectName;
QString currentRevision;
QStringList activeTags;
LoggedProcess fossilUI;
QString fossilUIPort;
};
#endif // FOSSIL_H
#endif // FOSSIL_H

View File

@ -1,70 +1,66 @@
#include "FslSettingsDialog.h"
#include "ui_FslSettingsDialog.h"
#include "Utils.h"
#include "ui_FslSettingsDialog.h"
#include <QDir>
///////////////////////////////////////////////////////////////////////////////
FslSettingsDialog::FslSettingsDialog(QWidget *parent, Settings &_settings) :
QDialog(parent, Qt::Sheet),
ui(new Ui::FslSettingsDialog),
settings(&_settings)
FslSettingsDialog::FslSettingsDialog(QWidget *parent, Settings &_settings) : QDialog(parent, Qt::Sheet), ui(new Ui::FslSettingsDialog), settings(&_settings)
{
ui->setupUi(this);
ui->setupUi(this);
ui->lineUIPort->setText(settings->GetFossilValue(FOSSIL_SETTING_HTTP_PORT).toString());
ui->lineUIPort->setText(settings->GetFossilValue(FOSSIL_SETTING_HTTP_PORT).toString());
// Global Settings
ui->lineGDiffCommand->setText(settings->GetFossilValue(FOSSIL_SETTING_GDIFF_CMD).toString());
ui->lineGMergeCommand->setText(settings->GetFossilValue(FOSSIL_SETTING_GMERGE_CMD).toString());
ui->lineProxy->setText(settings->GetFossilValue(FOSSIL_SETTING_PROXY_URL).toString());
// Global Settings
ui->lineGDiffCommand->setText(settings->GetFossilValue(FOSSIL_SETTING_GDIFF_CMD).toString());
ui->lineGMergeCommand->setText(settings->GetFossilValue(FOSSIL_SETTING_GMERGE_CMD).toString());
ui->lineProxy->setText(settings->GetFossilValue(FOSSIL_SETTING_PROXY_URL).toString());
// Repository Settings
ui->lineIgnore->setText(settings->GetFossilValue(FOSSIL_SETTING_IGNORE_GLOB).toString());
ui->lineIgnoreCRNL->setText(settings->GetFossilValue(FOSSIL_SETTING_CRNL_GLOB).toString());
// Repository Settings
ui->lineIgnore->setText(settings->GetFossilValue(FOSSIL_SETTING_IGNORE_GLOB).toString());
ui->lineIgnoreCRNL->setText(settings->GetFossilValue(FOSSIL_SETTING_CRNL_GLOB).toString());
}
//-----------------------------------------------------------------------------
FslSettingsDialog::~FslSettingsDialog()
{
delete ui;
delete ui;
}
//-----------------------------------------------------------------------------
bool FslSettingsDialog::run(QWidget *parent, Settings &settings)
{
FslSettingsDialog dlg(parent, settings);
return dlg.exec() == QDialog::Accepted;
FslSettingsDialog dlg(parent, settings);
return dlg.exec() == QDialog::Accepted;
}
//-----------------------------------------------------------------------------
void FslSettingsDialog::on_buttonBox_accepted()
{
settings->SetFossilValue(FOSSIL_SETTING_HTTP_PORT, ui->lineUIPort->text());
settings->SetFossilValue(FOSSIL_SETTING_HTTP_PORT, ui->lineUIPort->text());
settings->SetFossilValue(FOSSIL_SETTING_GDIFF_CMD, ui->lineGDiffCommand->text());
settings->SetFossilValue(FOSSIL_SETTING_GMERGE_CMD, ui->lineGMergeCommand->text());
settings->SetFossilValue(FOSSIL_SETTING_PROXY_URL, ui->lineProxy->text());
settings->SetFossilValue(FOSSIL_SETTING_GDIFF_CMD, ui->lineGDiffCommand->text());
settings->SetFossilValue(FOSSIL_SETTING_GMERGE_CMD, ui->lineGMergeCommand->text());
settings->SetFossilValue(FOSSIL_SETTING_PROXY_URL, ui->lineProxy->text());
settings->SetFossilValue(FOSSIL_SETTING_IGNORE_GLOB, ui->lineIgnore->text());
settings->SetFossilValue(FOSSIL_SETTING_CRNL_GLOB, ui->lineIgnoreCRNL->text());
settings->SetFossilValue(FOSSIL_SETTING_IGNORE_GLOB, ui->lineIgnore->text());
settings->SetFossilValue(FOSSIL_SETTING_CRNL_GLOB, ui->lineIgnoreCRNL->text());
settings->ApplyEnvironment();
settings->ApplyEnvironment();
}
//-----------------------------------------------------------------------------
void FslSettingsDialog::on_btnSelectFossilGDiff_clicked()
{
QString path = SelectExe(this, tr("Select Graphical Diff application"));
if(!path.isEmpty())
ui->lineGDiffCommand->setText(QDir::toNativeSeparators(path));
QString path = SelectExe(this, tr("Select Graphical Diff application"));
if (!path.isEmpty())
ui->lineGDiffCommand->setText(QDir::toNativeSeparators(path));
}
//-----------------------------------------------------------------------------
void FslSettingsDialog::on_btnSelectGMerge_clicked()
{
QString path = SelectExe(this, tr("Select Graphical Merge application"));
if(!path.isEmpty())
ui->lineGMergeCommand->setText(path);
QString path = SelectExe(this, tr("Select Graphical Merge application"));
if (!path.isEmpty())
ui->lineGMergeCommand->setText(path);
}

View File

@ -1,33 +1,32 @@
#ifndef FSLSETTINGSDIALOG_H
#define FSLSETTINGSDIALOG_H
#include "AppSettings.h"
#include <QDialog>
#include "Settings.h"
namespace Ui {
class FslSettingsDialog;
namespace Ui
{
class FslSettingsDialog;
}
class FslSettingsDialog : public QDialog
{
Q_OBJECT
Q_OBJECT
public:
explicit FslSettingsDialog(QWidget *parent, Settings &_settings);
~FslSettingsDialog();
static bool run(QWidget *parent, Settings &_settings);
explicit FslSettingsDialog(QWidget *parent, Settings &_settings);
~FslSettingsDialog();
static bool run(QWidget *parent, Settings &_settings);
private slots:
void on_buttonBox_accepted();
void on_btnSelectFossilGDiff_clicked();
void on_btnSelectGMerge_clicked();
void on_buttonBox_accepted();
void on_btnSelectFossilGDiff_clicked();
void on_btnSelectGMerge_clicked();
private:
Ui::FslSettingsDialog *ui;
Settings *settings;
Ui::FslSettingsDialog *ui;
Settings *settings;
};
#endif // FSLSETTINGSDIALOG_H
#endif // FSLSETTINGSDIALOG_H

View File

@ -3,20 +3,19 @@
///////////////////////////////////////////////////////////////////////////////
LoggedProcess::LoggedProcess(QObject *parent) : QProcess(parent)
{
setProcessChannelMode(QProcess::MergedChannels);
connect(this, SIGNAL(readyReadStandardOutput()), this, SLOT(onReadyReadStandardOutput()));
setProcessChannelMode(QProcess::MergedChannels);
connect(this, SIGNAL(readyReadStandardOutput()), this, SLOT(onReadyReadStandardOutput()));
}
void LoggedProcess::getLogAndClear(QByteArray &buffer)
{
QMutexLocker lck(&mutex);
buffer = log;
log.clear();
QMutexLocker lck(&mutex);
buffer = log;
log.clear();
}
void LoggedProcess::onReadyReadStandardOutput()
{
QMutexLocker lck(&mutex);
log.append(readAllStandardOutput());
QMutexLocker lck(&mutex);
log.append(readAllStandardOutput());
}

View File

@ -1,24 +1,24 @@
#ifndef LOGGEDPROCESS_H
#define LOGGEDPROCESS_H
#include <QProcess>
#include <QMutex>
#include <QProcess>
class LoggedProcess : public QProcess
{
Q_OBJECT
Q_OBJECT
public:
explicit LoggedProcess(QObject *parent = 0);
void getLogAndClear(QByteArray &buffer);
bool isLogEmpty() const { return log.isEmpty(); }
qint64 logBytesAvailable() const { return log.size(); }
explicit LoggedProcess(QObject *parent = 0);
void getLogAndClear(QByteArray &buffer);
bool isLogEmpty() const { return log.isEmpty(); }
qint64 logBytesAvailable() const { return log.size(); }
private slots:
void onReadyReadStandardOutput();
void onReadyReadStandardOutput();
private:
QMutex mutex;
QByteArray log;
QMutex mutex;
QByteArray log;
};
#endif // LOGGEDPROCESS_H
#endif // LOGGEDPROCESS_H

File diff suppressed because it is too large Load Diff

View File

@ -1,14 +1,15 @@
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include "AppSettings.h"
#include "Workspace.h"
#include <QFileIconProvider>
#include <QMainWindow>
#include <QStringList>
#include <QFileIconProvider>
#include "Settings.h"
#include "Workspace.h"
namespace Ui {
class MainWindow;
namespace Ui
{
class MainWindow;
}
//////////////////////////////////////////////////////////////////////////
@ -16,195 +17,191 @@ namespace Ui {
//////////////////////////////////////////////////////////////////////////
class MainWindow : public QMainWindow
{
Q_OBJECT
Q_OBJECT
public:
explicit MainWindow(Settings &_settings, QWidget *parent = 0, QString *workspacePath = 0);
~MainWindow();
bool diffFile(const QString& repoFile);
void fullRefresh();
explicit MainWindow(Settings &_settings, QWidget *parent = 0, QString *workspacePath = 0);
~MainWindow();
bool diffFile(const QString &repoFile);
void fullRefresh();
private:
bool refresh();
void scanWorkspace();
void applySettings();
void updateSettings();
void updateRevision(const QString& revision);
void setCurrentWorkspace(const QString &workspace);
void log(const QString &text, bool isHTML=false);
void setStatus(const QString &text);
bool uiRunning() const;
void getSelectionFilenames(QStringList &filenames, int includeMask=WorkspaceFile::TYPE_ALL, bool allIfEmpty=false);
void getFileViewSelection(QStringList &filenames, int includeMask=WorkspaceFile::TYPE_ALL, bool allIfEmpty=false);
void getDirViewSelection(QStringList &filenames, int includeMask=WorkspaceFile::TYPE_ALL, bool allIfEmpty=false);
void getSelectionStashes(QStringList &stashNames);
void getSelectionPaths(stringset_t &paths);
void getSelectionRemotes(QStringList& remoteUrls);
void getAllFilenames(QStringList &filenames, int includeMask=WorkspaceFile::TYPE_ALL);
bool startUI();
void stopUI();
void enableActions(bool on);
void addWorkspaceHistory(const QString &dir);
void rebuildRecent();
bool openWorkspace(const QString &path);
void loadFossilSettings();
void updateWorkspaceView();
void updateFileView();
void selectRootDir();
void mergeRevision(const QString& defaultRevision);
void updateCustomActions();
void invokeCustomAction(int actionId);
bool refresh();
bool scanWorkspace();
void applySettings();
void updateSettings();
void updateRevision(const QString &revision);
void setCurrentWorkspace(const QString &workspace);
void log(const QString &text, bool isHTML = false);
void setStatus(const QString &text);
bool uiRunning() const;
void getSelectionFilenames(QStringList &filenames, int includeMask = WorkspaceFile::TYPE_ALL, bool allIfEmpty = false);
void getFileViewSelection(QStringList &filenames, int includeMask = WorkspaceFile::TYPE_ALL, bool allIfEmpty = false);
void getDirViewSelection(QStringList &filenames, int includeMask = WorkspaceFile::TYPE_ALL, bool allIfEmpty = false);
void getSelectionStashes(QStringList &stashNames);
void getSelectionPaths(stringset_t &paths);
void getSelectionRemotes(QStringList &remoteUrls);
void getAllFilenames(QStringList &filenames, int includeMask = WorkspaceFile::TYPE_ALL);
bool startUI();
void stopUI();
void enableActions(bool on);
void addWorkspaceHistory(const QString &dir);
void rebuildRecent();
bool openWorkspace(const QString &path);
void loadFossilSettings();
void updateWorkspaceView();
void updateFileView();
void selectRootDir();
void mergeRevision(const QString &defaultRevision);
void updateCustomActions();
void invokeCustomAction(int actionId);
void fossilBrowse(const QString &fossilUrl);
void dragEnterEvent(class QDragEnterEvent *event);
void dropEvent(class QDropEvent *event);
void setBusy(bool busy);
virtual QMenu *createPopupMenu();
const QIcon& getCachedIcon(const char *name);
const QIcon& getCachedFileIcon(const QFileInfo &finfo);
void fossilBrowse(const QString &fossilUrl);
void dragEnterEvent(class QDragEnterEvent *event);
void dropEvent(class QDropEvent *event);
void setBusy(bool busy);
virtual QMenu *createPopupMenu();
const QIcon &getCachedIcon(const char *name);
const QIcon &getCachedFileIcon(const QFileInfo &finfo);
enum ViewMode
{
VIEWMODE_LIST,
VIEWMODE_TREE
};
enum ViewMode
{
VIEWMODE_LIST,
VIEWMODE_TREE
};
private slots:
// Manual slots.
// Use a different naming scheme to prevent warnings from Qt's automatic signaling
void onOpenRecent();
void onWorkspaceTreeViewSelectionChanged(const class QItemSelection &selected, const class QItemSelection &deselected);
void onFileViewDragOut();
void onAbort();
void onSearchBoxTextChanged(const QString &text);
void onSearch();
void onCustomActionTriggered();
// Manual slots.
// Use a different naming scheme to prevent warnings from Qt's automatic signaling
void onOpenRecent();
void onWorkspaceTreeViewSelectionChanged(const class QItemSelection &selected, const class QItemSelection &deselected);
void onFileViewDragOut();
void onSearchBoxTextChanged(const QString &text);
void onSearch();
void onCustomActionTriggered();
// Designer slots
void on_actionRefresh_triggered();
void on_actionDiff_triggered();
void on_actionFossilUI_triggered();
void on_actionQuit_triggered();
void on_actionTimeline_triggered();
void on_actionHistory_triggered();
void on_actionClearLog_triggered();
void on_fileTableView_doubleClicked(const QModelIndex &index);
void on_workspaceTreeView_doubleClicked(const QModelIndex &index);
void on_actionOpenFile_triggered();
void on_actionPush_triggered();
void on_actionPull_triggered();
void on_actionPushRemote_triggered();
void on_actionPullRemote_triggered();
void on_actionCommit_triggered();
void on_actionAdd_triggered();
void on_actionDelete_triggered();
void on_actionRevert_triggered();
void on_actionOpenContaining_triggered();
void on_actionRename_triggered();
void on_actionUndo_triggered();
void on_actionAbout_triggered();
void on_actionUpdate_triggered();
void on_actionSettings_triggered();
void on_actionFossilSettings_triggered();
void on_actionViewUnchanged_triggered();
void on_actionViewModified_triggered();
void on_actionViewUnknown_triggered();
void on_actionViewIgnored_triggered();
void on_actionViewAll_triggered();
void on_actionViewModifedOnly_triggered();
void on_actionViewAsList_triggered();
void on_actionViewAsFolders_triggered();
void on_actionOpenFolder_triggered();
void on_actionRenameFolder_triggered();
void on_actionNewRepository_triggered();
void on_actionOpenRepository_triggered();
void on_actionCloseRepository_triggered();
void on_actionCloneRepository_triggered();
void on_actionCreateStash_triggered();
void on_actionApplyStash_triggered();
void on_actionDeleteStash_triggered();
void on_actionDiffStash_triggered();
void on_textBrowser_customContextMenuRequested(const QPoint &pos);
void on_fileTableView_customContextMenuRequested(const QPoint &pos);
void on_workspaceTreeView_customContextMenuRequested(const QPoint &pos);
void on_actionCreateTag_triggered();
void on_actionDeleteTag_triggered();
void on_actionCreateBranch_triggered();
void on_actionMergeBranch_triggered();
void on_actionEditRemote_triggered();
void on_actionSetDefaultRemote_triggered();
void on_actionAddRemote_triggered();
void on_actionDeleteRemote_triggered();
// Designer slots
void on_actionRefresh_triggered();
void on_actionDiff_triggered();
void on_actionFossilUI_triggered();
void on_actionQuit_triggered();
void on_actionTimeline_triggered();
void on_actionHistory_triggered();
void on_actionClearLog_triggered();
void on_fileTableView_doubleClicked(const QModelIndex &index);
void on_workspaceTreeView_doubleClicked(const QModelIndex &index);
void on_actionOpenFile_triggered();
void on_actionPush_triggered();
void on_actionPull_triggered();
void on_actionPushRemote_triggered();
void on_actionPullRemote_triggered();
void on_actionCommit_triggered();
void on_actionAdd_triggered();
void on_actionAddRemove_triggered();
void on_actionDelete_triggered();
void on_actionRevert_triggered();
void on_actionOpenContaining_triggered();
void on_actionRename_triggered();
void on_actionUndo_triggered();
void on_actionAbout_triggered();
void on_actionUpdate_triggered();
void on_actionSettings_triggered();
void on_actionFossilSettings_triggered();
void on_actionViewUnchanged_triggered();
void on_actionViewModified_triggered();
void on_actionViewUnknown_triggered();
void on_actionViewIgnored_triggered();
void on_actionViewAll_triggered();
void on_actionViewModifedOnly_triggered();
void on_actionViewAsList_triggered();
void on_actionViewAsFolders_triggered();
void on_actionOpenFolder_triggered();
void on_actionRenameFolder_triggered();
void on_actionNewRepository_triggered();
void on_actionOpenRepository_triggered();
void on_actionCloseRepository_triggered();
void on_actionCloneRepository_triggered();
void on_actionCreateStash_triggered();
void on_actionApplyStash_triggered();
void on_actionDeleteStash_triggered();
void on_actionDiffStash_triggered();
void on_textBrowser_customContextMenuRequested(const QPoint &pos);
void on_fileTableView_customContextMenuRequested(const QPoint &pos);
void on_workspaceTreeView_customContextMenuRequested(const QPoint &pos);
void on_actionCreateTag_triggered();
void on_actionDeleteTag_triggered();
void on_actionCreateBranch_triggered();
void on_actionMergeBranch_triggered();
void on_actionEditRemote_triggered();
void on_actionSetDefaultRemote_triggered();
void on_actionAddRemote_triggered();
void on_actionDeleteRemote_triggered();
void on_actionAbortOperation_triggered();
private:
class MainWinUICallback : public UICallback
{
public:
MainWinUICallback() : mainWindow(0)
{}
class MainWinUICallback : public UICallback
{
public:
MainWinUICallback() : mainWindow(0), aborted(false) {}
void init(class MainWindow *mainWindow)
{
this->mainWindow = mainWindow;
}
void init(class MainWindow *mainWindow) { this->mainWindow = mainWindow; }
virtual void logText(const QString& text, bool isHTML);
virtual void beginProcess(const QString& text);
virtual void updateProcess(const QString& text);
virtual void endProcess();
virtual QMessageBox::StandardButton Query(const QString &title, const QString &query, QMessageBox::StandardButtons buttons);
virtual void logText(const QString &text, bool isHTML);
virtual void beginProcess(const QString &text);
virtual void updateProcess(const QString &text);
virtual bool processAborted() const { return aborted; }
virtual void endProcess();
virtual QMessageBox::StandardButton Query(const QString &title, const QString &query, QMessageBox::StandardButtons buttons);
void abortProcess() { aborted = true; }
private:
class MainWindow *mainWindow;
bool aborted;
};
private:
class MainWindow *mainWindow;
};
friend class MainWinUICallback;
friend class MainWinUICallback;
enum
{
MAX_RECENT = 5
};
enum
{
MAX_RECENT=5
};
typedef QMap<QString, QIcon> icon_map_t;
typedef QMap<QString, QIcon> icon_map_t;
Ui::MainWindow *ui;
QFileIconProvider iconProvider;
icon_map_t iconCache;
class QAction *recentWorkspaceActs[MAX_RECENT];
class QAction *customActions[MAX_CUSTOM_ACTIONS];
class QAction *fileActionSeparator;
class QAction *workspaceActionSeparator;
class QProgressBar *progressBar;
class QToolButton *abortButton;
class QLabel *lblTags;
class SearchBox *searchBox;
class QShortcut *searchShortcut;
QMenu *menuWorkspace;
QMenu *menuStashes;
QMenu *menuTags;
QMenu *menuBranches;
QMenu *menuRemotes;
Ui::MainWindow *ui;
QFileIconProvider iconProvider;
icon_map_t iconCache;
class QAction *recentWorkspaceActs[MAX_RECENT];
class QAction *customActions[MAX_CUSTOM_ACTIONS];
class QAction *fileActionSeparator;
class QAction *workspaceActionSeparator;
class QProgressBar *progressBar;
class QLabel *lblTags;
class QShortcut *abortShortcut;
class SearchBox *searchBox;
class QShortcut *searchShortcut;
QMenu *menuWorkspace;
QMenu *menuStashes;
QMenu *menuTags;
QMenu *menuBranches;
QMenu *menuRemotes;
bool operationAborted;
stringset_t selectedDirs; // The directory selected in the tree
QStringList selectedTags;
QStringList selectedBranches;
QStringList versionList;
bool operationAborted;
stringset_t selectedDirs; // The directory selected in the tree
QStringList selectedTags;
QStringList selectedBranches;
QStringList versionList;
Workspace workspace;
Workspace &getWorkspace() { return workspace; }
const Workspace &getWorkspace() const { return workspace; }
Workspace workspace;
Workspace & getWorkspace() { return workspace; }
Settings &settings;
QStringList workspaceHistory;
Fossil & fossil() { return workspace.fossil(); }
const Fossil & fossil() const { return workspace.fossil(); }
MainWinUICallback uiCallback;
Settings &settings;
QStringList workspaceHistory;
MainWinUICallback uiCallback;
ViewMode viewMode;
ViewMode viewMode;
};
#endif // MAINWINDOW_H
#endif // MAINWINDOW_H

View File

@ -1,95 +1,98 @@
#include "RemoteDialog.h"
#include "ui_RemoteDialog.h"
#include <QFileDialog>
#include <QDir>
#include <QMessageBox>
#include <QClipboard>
#include <QUrl>
#include "Utils.h"
#include "ui_RemoteDialog.h"
#include <QClipboard>
#include <QDir>
#include <QFileDialog>
#include <QMessageBox>
#include <QUrl>
//-----------------------------------------------------------------------------
RemoteDialog::RemoteDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::RemoteDialog)
RemoteDialog::RemoteDialog(QWidget *parent) : QDialog(parent), ui(new Ui::RemoteDialog)
{
ui->setupUi(this);
ui->setupUi(this);
}
//-----------------------------------------------------------------------------
RemoteDialog::~RemoteDialog()
{
delete ui;
delete ui;
}
//-----------------------------------------------------------------------------
bool RemoteDialog::run(QWidget *parent, QUrl &url, QString &name)
{
RemoteDialog dlg(parent);
RemoteDialog dlg(parent);
// Set URL components
if(!url.isEmpty())
{
QString url_no_credentials = UrlToStringNoCredentials(url);
dlg.ui->lineURL->setText(url_no_credentials);
dlg.ui->lineUserName->setText(url.userName());
dlg.ui->linePassword->setText(url.password());
dlg.ui->lineName->setText(name);
}
// Set URL components
if (!url.isEmpty())
{
dlg.ui->lineName->setText(name);
if(dlg.exec() != QDialog::Accepted)
return false;
if (url.isLocalFile())
dlg.ui->lineURL->setText(QDir::toNativeSeparators(url.toLocalFile()));
else
{
QString url_no_credentials = UrlToStringNoCredentials(url);
dlg.ui->lineURL->setText(url_no_credentials);
dlg.ui->lineUserName->setText(url.userName());
dlg.ui->linePassword->setText(url.password());
}
}
QString urltext = dlg.ui->lineURL->text();
if (dlg.exec() != QDialog::Accepted)
return false;
url = QUrl::fromUserInput(urltext);
if(url.isEmpty() || !url.isValid())
{
QMessageBox::critical(parent, tr("Error"), tr("Invalid URL."), QMessageBox::Ok );
return false;
}
QString urltext = dlg.ui->lineURL->text();
if(!dlg.ui->lineUserName->text().trimmed().isEmpty())
url.setUserName(dlg.ui->lineUserName->text());
// Check if the url is a local file
if (QFileInfo(urltext).exists())
url = QUrl::fromLocalFile(urltext);
else
{
url = QUrl::fromUserInput(urltext);
if (url.isEmpty() || !url.isValid())
{
QMessageBox::critical(parent, tr("Error"), tr("Invalid URL."), QMessageBox::Ok);
return false;
}
}
if(!dlg.ui->linePassword->text().trimmed().isEmpty())
url.setPassword(dlg.ui->linePassword->text());
if (!dlg.ui->lineUserName->text().trimmed().isEmpty())
url.setUserName(dlg.ui->lineUserName->text());
name =dlg.ui->lineName->text().trimmed();
if(name.isEmpty())
name = UrlToStringNoCredentials(url);
if (!dlg.ui->linePassword->text().trimmed().isEmpty())
url.setPassword(dlg.ui->linePassword->text());
return true;
name = dlg.ui->lineName->text().trimmed();
if (name.isEmpty())
name = UrlToStringNoCredentials(url);
return true;
}
//-----------------------------------------------------------------------------
void RemoteDialog::GetRepositoryPath(QString &pathResult)
{
QString filter(tr("Fossil Repository") + QString(" (*." FOSSIL_EXT ")"));
QString filter(tr("Fossil Repository") + QString(" (*." FOSSIL_EXT ")"));
pathResult = QFileDialog::getSaveFileName(
this,
tr("Select Fossil Repository"),
QDir::toNativeSeparators(pathResult),
filter,
&filter,
QFileDialog::DontConfirmOverwrite);
pathResult = QFileDialog::getSaveFileName(this, tr("Select Fossil Repository"), QDir::toNativeSeparators(pathResult), filter, &filter, QFileDialog::DontConfirmOverwrite);
}
//-----------------------------------------------------------------------------
void RemoteDialog::on_btnSelectSourceRepo_clicked()
{
QString path = ui->lineURL->text();
GetRepositoryPath(path);
QString path = ui->lineURL->text();
GetRepositoryPath(path);
if(path.trimmed().isEmpty())
return;
if (path.trimmed().isEmpty())
return;
if(!QFile::exists(path))
{
QMessageBox::critical(this, tr("Error"), tr("Invalid Repository File."), QMessageBox::Ok);
return;
}
if (!QFile::exists(path))
{
QMessageBox::critical(this, tr("Error"), tr("Invalid Repository File."), QMessageBox::Ok);
return;
}
ui->lineURL->setText(QDir::toNativeSeparators(path));
ui->lineURL->setText(QDir::toNativeSeparators(path));
}

View File

@ -3,27 +3,28 @@
#include <QDialog>
namespace Ui {
namespace Ui
{
class RemoteDialog;
}
class RemoteDialog : public QDialog
{
Q_OBJECT
Q_OBJECT
public:
explicit RemoteDialog(QWidget *parent = 0);
~RemoteDialog();
explicit RemoteDialog(QWidget *parent = 0);
~RemoteDialog();
static bool run(QWidget *parent, class QUrl &url, QString &name);
static bool run(QWidget *parent, class QUrl &url, QString &name);
private slots:
void on_btnSelectSourceRepo_clicked();
void on_btnSelectSourceRepo_clicked();
private:
void GetRepositoryPath(QString &pathResult);
void GetRepositoryPath(QString &pathResult);
Ui::RemoteDialog *ui;
Ui::RemoteDialog *ui;
};
#endif // REMOTEDIALOG_H
#endif // REMOTEDIALOG_H

View File

@ -1,100 +1,96 @@
#include "RevisionDialog.h"
#include "ui_RevisionDialog.h"
#include "Utils.h"
#include "ui_RevisionDialog.h"
//-----------------------------------------------------------------------------
RevisionDialog::RevisionDialog(QWidget *parent, const QStringList &completions, const QString &defaultValue) :
QDialog(parent),
ui(new Ui::RevisionDialog),
completer(completions, parent)
RevisionDialog::RevisionDialog(QWidget *parent, const QStringList &completions, const QString &defaultValue) : QDialog(parent), ui(new Ui::RevisionDialog), completer(completions, parent)
{
ui->setupUi(this);
ui->cmbRevision->setCompleter(&completer);
ui->setupUi(this);
ui->cmbRevision->setCompleter(&completer);
ui->cmbRevision->addItems(completions);
ui->cmbRevision->addItems(completions);
if(!defaultValue.isEmpty())
{
if (!defaultValue.isEmpty())
{
#if (QT_VERSION < QT_VERSION_CHECK(5, 0, 0))
int index = ui->cmbRevision->findText(defaultValue);
if(index>=0)
ui->cmbRevision->setCurrentIndex(index);
int index = ui->cmbRevision->findText(defaultValue);
if (index >= 0)
ui->cmbRevision->setCurrentIndex(index);
#else
ui->cmbRevision->setCurrentText(defaultValue);
ui->cmbRevision->setCurrentText(defaultValue);
#endif
}
}
}
//-----------------------------------------------------------------------------
RevisionDialog::~RevisionDialog()
{
delete ui;
delete ui;
}
//-----------------------------------------------------------------------------
QString RevisionDialog::runUpdate(QWidget *parent, const QString &title, const QStringList &completions, const QString &defaultValue)
{
RevisionDialog dlg(parent, completions, defaultValue);
dlg.setWindowTitle(title);
dlg.ui->lblName->setVisible(false);
dlg.ui->lineName->setVisible(false);
dlg.ui->lblIntegrate->setVisible(false);
dlg.ui->chkIntegrate->setVisible(false);
dlg.ui->lblForce->setVisible(false);
dlg.ui->chkForce->setVisible(false);
RevisionDialog dlg(parent, completions, defaultValue);
dlg.setWindowTitle(title);
dlg.ui->lblName->setVisible(false);
dlg.ui->lineName->setVisible(false);
dlg.ui->lblIntegrate->setVisible(false);
dlg.ui->chkIntegrate->setVisible(false);
dlg.ui->lblForce->setVisible(false);
dlg.ui->chkForce->setVisible(false);
dlg.adjustSize();
dlg.adjustSize();
if(dlg.exec() != QDialog::Accepted)
return QString("");
return dlg.ui->cmbRevision->currentText().trimmed();
if (dlg.exec() != QDialog::Accepted)
return QString("");
return dlg.ui->cmbRevision->currentText().trimmed();
}
//-----------------------------------------------------------------------------
QString RevisionDialog::runMerge(QWidget *parent, const QString &title, const QStringList &completions, const QString &defaultValue, bool &integrate, bool &force)
{
RevisionDialog dlg(parent, completions, defaultValue);
dlg.setWindowTitle(title);
dlg.ui->lblName->setVisible(false);
dlg.ui->lineName->setVisible(false);
dlg.ui->lblIntegrate->setVisible(true);
dlg.ui->chkIntegrate->setVisible(true);
dlg.ui->chkIntegrate->setChecked(integrate);
dlg.ui->lblForce->setVisible(true);
dlg.ui->chkForce->setVisible(true);
dlg.ui->chkForce->setChecked(force);
RevisionDialog dlg(parent, completions, defaultValue);
dlg.setWindowTitle(title);
dlg.ui->lblName->setVisible(false);
dlg.ui->lineName->setVisible(false);
dlg.ui->lblIntegrate->setVisible(true);
dlg.ui->chkIntegrate->setVisible(true);
dlg.ui->chkIntegrate->setChecked(integrate);
dlg.ui->lblForce->setVisible(true);
dlg.ui->chkForce->setVisible(true);
dlg.ui->chkForce->setChecked(force);
dlg.adjustSize();
dlg.adjustSize();
if(dlg.exec() != QDialog::Accepted)
return QString("");
if (dlg.exec() != QDialog::Accepted)
return QString("");
integrate = dlg.ui->chkIntegrate->checkState() == Qt::Checked;
force = dlg.ui->chkForce->checkState() == Qt::Checked;
integrate = dlg.ui->chkIntegrate->checkState() == Qt::Checked;
force = dlg.ui->chkForce->checkState() == Qt::Checked;
return dlg.ui->cmbRevision->currentText().trimmed();
return dlg.ui->cmbRevision->currentText().trimmed();
}
//-----------------------------------------------------------------------------
bool RevisionDialog::runNewTag(QWidget *parent, const QString &title, const QStringList &completions, const QString &defaultValue, QString &revision, QString &name)
{
RevisionDialog dlg(parent, completions, defaultValue);
dlg.setWindowTitle(title);
RevisionDialog dlg(parent, completions, defaultValue);
dlg.setWindowTitle(title);
dlg.ui->lblName->setVisible(true);
dlg.ui->lineName->setVisible(true);
dlg.ui->lblIntegrate->setVisible(false);
dlg.ui->chkIntegrate->setVisible(false);
dlg.ui->lblForce->setVisible(false);
dlg.ui->chkForce->setVisible(false);
dlg.ui->lblName->setVisible(true);
dlg.ui->lineName->setVisible(true);
dlg.ui->lblIntegrate->setVisible(false);
dlg.ui->chkIntegrate->setVisible(false);
dlg.ui->lblForce->setVisible(false);
dlg.ui->chkForce->setVisible(false);
dlg.adjustSize();
dlg.adjustSize();
if(dlg.exec() != QDialog::Accepted)
return false;
if (dlg.exec() != QDialog::Accepted)
return false;
revision = dlg.ui->cmbRevision->currentText().trimmed();
name = dlg.ui->lineName->text().trimmed();
return true;
revision = dlg.ui->cmbRevision->currentText().trimmed();
name = dlg.ui->lineName->text().trimmed();
return true;
}

View File

@ -1,28 +1,29 @@
#ifndef REVISIONDIALOG_H
#define REVISIONDIALOG_H
#include <QDialog>
#include <QCompleter>
#include <QDialog>
namespace Ui {
class RevisionDialog;
namespace Ui
{
class RevisionDialog;
}
class RevisionDialog : public QDialog
{
Q_OBJECT
Q_OBJECT
public:
explicit RevisionDialog(QWidget *parent, const QStringList &completions, const QString &defaultValue);
~RevisionDialog();
explicit RevisionDialog(QWidget *parent, const QStringList &completions, const QString &defaultValue);
~RevisionDialog();
static QString runUpdate(QWidget *parent, const QString &title, const QStringList &completions, const QString &defaultValue);
static QString runMerge(QWidget* parent, const QString& title, const QStringList& completions, const QString& defaultValue, bool& integrate, bool& force);
static bool runNewTag(QWidget *parent, const QString &title, const QStringList &completions, const QString &defaultValue, QString &revision, QString &name);
static QString runUpdate(QWidget *parent, const QString &title, const QStringList &completions, const QString &defaultValue);
static QString runMerge(QWidget *parent, const QString &title, const QStringList &completions, const QString &defaultValue, bool &integrate, bool &force);
static bool runNewTag(QWidget *parent, const QString &title, const QStringList &completions, const QString &defaultValue, QString &revision, QString &name);
private:
Ui::RevisionDialog *ui;
QCompleter completer;
Ui::RevisionDialog *ui;
QCompleter completer;
};
#endif // REVISIONDIALOG_H
#endif // REVISIONDIALOG_H

View File

@ -1,24 +1,18 @@
#include "SearchBox.h"
#include <QKeyEvent>
SearchBox::SearchBox(QWidget *parent) : QLineEdit(parent)
{
}
SearchBox::SearchBox(QWidget *parent) : QLineEdit(parent) {}
SearchBox::~SearchBox()
{
}
SearchBox::~SearchBox() {}
void SearchBox::keyPressEvent(QKeyEvent *event)
{
// Clear text on escape
if(event->key() == Qt::Key_Escape)
{
setText("");
clearFocus();
}
else
QLineEdit::keyPressEvent(event);
// Clear text on escape
if (event->key() == Qt::Key_Escape)
{
setText("");
clearFocus();
}
else
QLineEdit::keyPressEvent(event);
}

View File

@ -5,19 +5,17 @@
class SearchBox : public QLineEdit
{
Q_OBJECT
Q_OBJECT
public:
explicit SearchBox(QWidget* parent=0);
~SearchBox();
explicit SearchBox(QWidget *parent = 0);
~SearchBox();
signals:
public slots:
protected:
void keyPressEvent(QKeyEvent *event);
void keyPressEvent(QKeyEvent *event);
};
#endif // SEARCHBOX_H
#endif // SEARCHBOX_H

Some files were not shown because too many files have changed in this diff Show More