Page MenuHomePhabricator (Chris)

No OneTemporary

Authored By
Unknown
Size
138 KB
Referenced Files
None
Subscribers
None
diff --git a/.gitignore b/.gitignore
index af3a31d..a36ebb9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,11 +1,13 @@
*.user
win.rc
Info.plist
version.c
_notes
_release
.DS_Store
image/about.psd
extra/_build_*
misc/win32tools
_bin/
+build/
+src/version.h
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..ca8bd2e
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,384 @@
+cmake_minimum_required(VERSION 3.2)
+
+project(Guitar
+ VERSION 0.9.0
+ LANGUAGES CXX C
+)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTOUIC ON)
+set(CMAKE_AUTORCC ON)
+
+list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules/")
+
+find_package(Qt5 COMPONENTS Core Widgets Network Svg REQUIRED)
+find_package(zlib REQUIRED )
+find_package(OpenSSL REQUIRED )
+find_package(Qt5LinguistTools REQUIRED)
+if(WIN32)
+ # check package at
+ # https://github.com/rprichard/winpty
+ find_package(winpty REQUIRED )
+endif()
+
+# extract version information
+string(TIMESTAMP Guitar_copyright_year "%Y")
+execute_process(
+ COMMAND git rev-parse --short=7 HEAD
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ OUTPUT_VARIABLE Guitar_git_hash
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+)
+
+add_compile_options(-std=c++11)
+
+configure_file(version.h.in version.h)
+configure_file(win.rc.in win.rc.h)
+configure_file(Info.plist.in Info.plist)
+
+set(Guitar_SOURCES
+ src/main.cpp
+ src/MainWindow.cpp
+ src/Git.cpp
+ src/common/joinpath.cpp
+ src/common/misc.cpp
+ src/ConfigCredentialHelperDialog.cpp
+ src/MySettings.cpp
+ src/FileDiffWidget.cpp
+ src/TextEditDialog.cpp
+ src/LogTableWidget.cpp
+ src/FileDiffSliderWidget.cpp
+ src/FileUtil.cpp
+ src/SettingsDialog.cpp
+ src/MergeBranchDialog.cpp
+ src/CloneDialog.cpp
+ src/AboutDialog.cpp
+ src/RepositoryInfoFrame.cpp
+ src/RepositoryPropertyDialog.cpp
+ src/RepositoryData.cpp
+ src/MyToolButton.cpp
+ src/GitDiff.cpp
+ src/CommitPropertyDialog.cpp
+ src/Terminal.cpp
+ src/DeleteTagsDialog.cpp
+ src/RepositoriesTreeWidget.cpp
+ src/SelectCommandDialog.cpp
+ src/ImageViewWidget.cpp
+ src/FileHistoryWindow.cpp
+ src/GitPackIdxV2.cpp
+ src/GitPack.cpp
+ src/GitObjectManager.cpp
+ src/FilePropertyDialog.cpp
+ src/BigDiffWindow.cpp
+ src/MaximizeButton.cpp
+ src/CommitExploreWindow.cpp
+ src/ReadOnlyLineEdit.cpp
+ src/ReadOnlyPlainTextEdit.cpp
+ src/MyTableWidgetDelegate.cpp
+ src/SetRemoteUrlDialog.cpp
+ src/ClearButton.cpp
+ src/SetUserDialog.cpp
+ src/SearchFromGitHubDialog.cpp
+ src/webclient.cpp
+ src/charvec.cpp
+ src/urlencode.cpp
+ src/HyperLinkLabel.cpp
+ src/JumpDialog.cpp
+ src/CheckoutDialog.cpp
+ src/DeleteBranchDialog.cpp
+ src/BasicRepositoryDialog.cpp
+ src/RemoteRepositoriesTableWidget.cpp
+ src/LocalSocketReader.cpp
+ src/PushDialog.cpp
+ src/StatusLabel.cpp
+ src/RepositoryLineEdit.cpp
+ src/DirectoryLineEdit.cpp
+ src/AbstractSettingForm.cpp
+ src/SettingExampleForm.cpp
+ src/CreateRepositoryDialog.cpp
+ src/GitHubAPI.cpp
+ src/MemoryReader.cpp
+ src/ExperimentDialog.cpp
+ src/gunzip.cpp
+ src/AvatarLoader.cpp
+ src/SettingNetworkForm.cpp
+ src/Photoshop.cpp
+ src/SettingBehaviorForm.cpp
+ src/MyProcess.cpp
+ src/FileViewWidget.cpp
+ src/MyTextEditorWidget.cpp
+ src/AbstractProcess.cpp
+ src/texteditor/AbstractCharacterBasedApplication.cpp
+ src/texteditor/InputMethodPopup.cpp
+ src/texteditor/TextEditorTheme.cpp
+ src/texteditor/TextEditorWidget.cpp
+ src/texteditor/unicode.cpp
+ src/texteditor/UnicodeWidth.cpp
+ src/MyImageViewWidget.cpp
+ src/SetGlobalUserDialog.cpp
+ src/ReflogWindow.cpp
+ src/Theme.cpp
+ src/ApplicationGlobal.cpp
+ src/BlameWindow.cpp
+ src/MenuButton.cpp
+ src/SettingGeneralForm.cpp
+ src/WelcomeWizardDialog.cpp
+ src/DialogHeaderFrame.cpp
+ src/CommitViewWindow.cpp
+ src/EditRemoteDialog.cpp
+ src/gpg.cpp
+ src/SelectGpgKeyDialog.cpp
+ src/SetGpgSigningDialog.cpp
+ src/CommitDialog.cpp
+ src/ConfigSigningDialog.cpp
+ src/AreYouSureYouWantToContinueConnectingDialog.cpp
+ src/LineEditDialog.cpp
+ src/SettingProgramsForm.cpp
+ src/InputNewTagDialog.cpp
+ src/EditTagsDialog.cpp
+ src/darktheme/DarkStyle.cpp
+ src/darktheme/NinePatch.cpp
+ src/darktheme/StandardStyle.cpp
+ src/darktheme/TraditionalWindowsStyleTreeControl.cpp
+ src/EditGitIgnoreDialog.cpp
+ src/SelectItemDialog.cpp
+ src/RebaseOntoDialog.cpp
+ src/RemoteWatcher.cpp
+ src/DoYouWantToInitDialog.cpp
+ )
+
+
+set(Guitar_HEADERS
+ src/MainWindow.h
+ src/Git.h
+ src/common/joinpath.h
+ src/common/misc.h
+ src/ConfigCredentialHelperDialog.h
+ src/MySettings.h
+ src/main.h
+ src/FileDiffWidget.h
+ src/TextEditDialog.h
+ src/LogTableWidget.h
+ src/FileDiffSliderWidget.h
+ src/FileUtil.h
+ src/SettingsDialog.h
+ src/MergeBranchDialog.h
+ src/CloneDialog.h
+ src/AboutDialog.h
+ src/RepositoryInfoFrame.h
+ src/RepositoryPropertyDialog.h
+ src/RepositoryData.h
+ src/MyToolButton.h
+ src/GitDiff.h
+ src/CommitPropertyDialog.h
+ src/Terminal.h
+ src/DeleteTagsDialog.h
+ src/RepositoriesTreeWidget.h
+ src/SelectCommandDialog.h
+ src/ImageViewWidget.h
+ src/FileHistoryWindow.h
+ src/Debug.h
+ src/GitPackIdxV2.h
+ src/GitPack.h
+ src/GitObjectManager.h
+ src/FilePropertyDialog.h
+ src/BigDiffWindow.h
+ src/MaximizeButton.h
+ src/CommitExploreWindow.h
+ src/ReadOnlyLineEdit.h
+ src/ReadOnlyPlainTextEdit.h
+ src/MyTableWidgetDelegate.h
+ src/SetRemoteUrlDialog.h
+ src/ClearButton.h
+ src/SetUserDialog.h
+ src/SearchFromGitHubDialog.h
+ src/webclient.h
+ src/charvec.h
+ src/urlencode.h
+ src/HyperLinkLabel.h
+ src/JumpDialog.h
+ src/CheckoutDialog.h
+ src/DeleteBranchDialog.h
+ src/BasicRepositoryDialog.h
+ src/RemoteRepositoriesTableWidget.h
+ src/LocalSocketReader.h
+ src/PushDialog.h
+ src/StatusLabel.h
+ src/RepositoryLineEdit.h
+ src/DirectoryLineEdit.h
+ src/AbstractSettingForm.h
+ src/SettingExampleForm.h
+ src/CreateRepositoryDialog.h
+ src/GitHubAPI.h
+ src/MemoryReader.h
+ src/ExperimentDialog.h
+ src/gunzip.h
+ src/AvatarLoader.h
+ src/SettingNetworkForm.h
+ src/Photoshop.h
+ src/SettingBehaviorForm.h
+ src/MyProcess.h
+ src/FileViewWidget.h
+ src/MyTextEditorWidget.h
+ src/AbstractProcess.h
+ src/texteditor/AbstractCharacterBasedApplication.h
+ src/texteditor/InputMethodPopup.h
+ src/texteditor/TextEditorTheme.h
+ src/texteditor/TextEditorWidget.h
+ src/texteditor/unicode.h
+ src/texteditor/UnicodeWidth.h
+ src/MyImageViewWidget.h
+ src/SetGlobalUserDialog.h
+ src/ReflogWindow.h
+ src/Theme.h
+ src/ApplicationGlobal.h
+ src/BlameWindow.h
+ src/MenuButton.h
+ src/SettingGeneralForm.h
+ src/WelcomeWizardDialog.h
+ src/DialogHeaderFrame.h
+ src/CommitViewWindow.h
+ src/EditRemoteDialog.h
+ src/gpg.h
+ src/SelectGpgKeyDialog.h
+ src/SetGpgSigningDialog.h
+ src/CommitDialog.h
+ src/ConfigSigningDialog.h
+ src/AreYouSureYouWantToContinueConnectingDialog.h
+ src/LineEditDialog.h
+ src/SettingProgramsForm.h
+ src/InputNewTagDialog.h
+ src/EditTagsDialog.h
+ src/darktheme/DarkStyle.h
+ src/darktheme/NinePatch.h
+ src/darktheme/StandardStyle.h
+ src/darktheme/TraditionalWindowsStyleTreeControl.h
+ src/EditGitIgnoreDialog.h
+ src/SelectItemDialog.h
+ src/RebaseOntoDialog.h
+ src/RemoteWatcher.h
+ src/DoYouWantToInitDialog.h
+ )
+
+if(UNIX)
+ list(APPEND Guitar_SOURCES
+ src/unix/UnixProcess.cpp
+ src/unix/UnixPtyProcess.cpp
+ )
+ list(APPEND Guitar_HEADERS
+ src/unix/UnixProcess.h
+ src/unix/UnixPtyProcess.h
+ )
+elseif(WIN32)
+ list(APPEND Guitar_SOURCES
+ src/win32/thread.cpp
+ src/win32/event.cpp
+ src/win32/win32.cpp
+ src/win32/Win32Process.cpp
+ src/win32/Win32PtyProcess.cpp
+ )
+ list(APPEND Guitar_HEADERS
+ src/win32/thread.h
+ src/win32/event.h
+ src/win32/mutex.h
+ src/win32/win32.h
+ src/win32/Win32Process.h
+ src/win32/Win32PtyProcess.h
+ )
+endif()
+
+set(Guitar_UIS
+ src/MainWindow.ui
+ src/ConfigCredentialHelperDialog.ui
+ src/TextEditDialog.ui
+ src/SettingsDialog.ui
+ src/MergeBranchDialog.ui
+ src/CloneDialog.ui
+ src/AboutDialog.ui
+ src/RepositoryPropertyDialog.ui
+ src/CommitPropertyDialog.ui
+ src/DeleteTagsDialog.ui
+ src/SelectCommandDialog.ui
+ src/FileDiffWidget.ui
+ src/FileHistoryWindow.ui
+ src/FilePropertyDialog.ui
+ src/BigDiffWindow.ui
+ src/CommitExploreWindow.ui
+ src/SetRemoteUrlDialog.ui
+ src/SetUserDialog.ui
+ src/SearchFromGitHubDialog.ui
+ src/JumpDialog.ui
+ src/CheckoutDialog.ui
+ src/DeleteBranchDialog.ui
+ src/PushDialog.ui
+ src/SettingExampleForm.ui
+ src/CreateRepositoryDialog.ui
+ src/ExperimentDialog.ui
+ src/SettingNetworkForm.ui
+ src/SettingBehaviorForm.ui
+ src/SetGlobalUserDialog.ui
+ src/ReflogWindow.ui
+ src/BlameWindow.ui
+ src/SettingGeneralForm.ui
+ src/WelcomeWizardDialog.ui
+ src/CommitViewWindow.ui
+ src/EditRemoteDialog.ui
+ src/SelectGpgKeyDialog.ui
+ src/SetGpgSigningDialog.ui
+ src/CommitDialog.ui
+ src/ConfigSigningDialog.ui
+ src/AreYouSureYouWantToContinueConnectingDialog.ui
+ src/LineEditDialog.ui
+ src/SettingProgramsForm.ui
+ src/InputNewTagDialog.ui
+ src/EditTagsDialog.ui
+ src/EditGitIgnoreDialog.ui
+ src/SelectItemDialog.ui
+ src/RebaseOntoDialog.ui
+ src/DoYouWantToInitDialog.ui
+ )
+
+set(Guitar_RESOURCES
+ src/resources/resources.qrc
+ )
+
+set(Guitar_TRANSLATIONS
+ src/resources/translations/ja_JPN.ts
+ )
+
+qt5_add_translation(Guitar_QM_FILES ${Guitar_TRANSLATIONS})
+configure_file(${Guitar_RESOURCES} ${CMAKE_BINARY_DIR} COPYONLY)
+
+add_custom_target(translations ALL DEPENDS ${Guitar_QM_FILES})
+
+add_custom_target(resources ALL DEPENDS ${Guitar_RESOURCES})
+
+add_dependencies(resources translations)
+
+include_directories(src)
+include_directories(src/texteditor)
+
+add_executable(${PROJECT_NAME}
+ ${Guitar_SOURCES}
+ ${Guitar_HEADERS}
+ ${Guitar_UIS}
+ ${Guitar_RESOURCES}
+ ${Guitar_QM_FILES}
+ )
+
+set_target_properties(${PROJECT_NAME} PROPERTIES
+ CXX_STANDARD 11
+ CXX_EXTENSIONS OFF
+)
+
+target_link_libraries(${PROJECT_NAME}
+ Qt5::Widgets
+ Qt5::Network
+ Qt5::Svg
+ zlib
+ OpenSSL::SSL OpenSSL::Crypto
+)
+
+
+add_subdirectory(extra)
diff --git a/Guitar.pro b/Guitar.pro
index 1c8b4b2..537aa23 100644
--- a/Guitar.pro
+++ b/Guitar.pro
@@ -1,393 +1,393 @@
QT += core gui widgets svg network
win32:QT += winextras
CONFIG(debug,debug|release):TARGET = Guitard
CONFIG(release,debug|release):TARGET = Guitar
TEMPLATE = app
CONFIG += c++11
DESTDIR = $$PWD/_bin
TRANSLATIONS = Guitar_ja.ts
DEFINES += APP_GUITAR
DEFINES += USE_DARK_THEME
DEFINES += HAVE_POSIX_OPENPT
macx:DEFINES += HAVE_SYS_TIME_H
macx:DEFINES += HAVE_UTMPX
gcc:QMAKE_CXXFLAGS += -Wall -Wextra -Werror=return-type -Werror=trigraphs -Wno-switch -Wno-reorder
linux:QMAKE_RPATHDIR += $ORIGIN
macx:QMAKE_RPATHDIR += @executable_path/../Frameworks
linux:QTPLUGIN += ibusplatforminputcontextplugin
#linux:QTPLUGIN += fcitxplatforminputcontextplugin
INCLUDEPATH += $$PWD/src
INCLUDEPATH += $$PWD/src/texteditor
win32:INCLUDEPATH += $$PWD/winpty
win32:LIBS += $$PWD/winpty/winpty.lib
# OpenSSL
linux:LIBS += -lssl -lcrypto
haiku:LIBS += -lssl -lcrypto -lnetwork
macx:INCLUDEPATH += /usr/local/include
macx:LIBS += /usr/local/lib/libssl.a /usr/local/lib/libcrypto.a
win32:msvc {
INCLUDEPATH += C:\openssl\include
LIBS += -LC:\openssl\lib
}
win32:gcc {
INCLUDEPATH += C:\Qt\Tools\mingw530_32\opt\include
LIBS += -LC:\Qt\Tools\mingw530_32\opt\lib
LIBS += -lcrypto -lssl
}
# execute 'ruby prepare.rb' automatically
prepare.target = prepare
prepare.commands = cd $$PWD && ruby -W0 prepare.rb
QMAKE_EXTRA_TARGETS += prepare
PRE_TARGETDEPS += prepare
# zlib
win32:msvc {
CONFIG(debug, debug|release):LIBS += $$PWD/_bin/libz.lib
CONFIG(release, debug|release):LIBS += $$PWD/_bin/libz.lib
}
win32:gcc {
CONFIG(debug, debug|release):LIBS += $$PWD/_bin/liblibz.a
CONFIG(release, debug|release):LIBS += $$PWD/_bin/liblibz.a
}
!haiku {
unix:CONFIG(debug, debug|release):LIBS += $$PWD/_bin/libzd.a
unix:CONFIG(release, debug|release):LIBS += $$PWD/_bin/libz.a
#unix:LIBS += -lz
}
haiku:LIBS += -lz
win32 {
LIBS += -ladvapi32 -lshell32 -luser32 -lws2_32
RC_FILE = win.rc
QMAKE_SUBSYSTEM_SUFFIX=,5.01
}
macx {
QMAKE_INFO_PLIST = Info.plist
ICON += Guitar.icns
t.path=Contents/Resources
QMAKE_BUNDLE_DATA += t
}
SOURCES += \
- version.c \
src/main.cpp\
src/MainWindow.cpp \
src/Git.cpp \
src/common/joinpath.cpp \
src/common/misc.cpp \
src/ConfigCredentialHelperDialog.cpp \
src/MySettings.cpp \
src/FileDiffWidget.cpp \
src/TextEditDialog.cpp \
src/LogTableWidget.cpp \
src/FileDiffSliderWidget.cpp \
src/FileUtil.cpp \
src/SettingsDialog.cpp \
src/MergeBranchDialog.cpp \
src/CloneDialog.cpp \
src/AboutDialog.cpp \
src/RepositoryInfoFrame.cpp \
src/RepositoryPropertyDialog.cpp \
src/RepositoryData.cpp \
src/MyToolButton.cpp \
src/GitDiff.cpp \
src/CommitPropertyDialog.cpp \
src/Terminal.cpp \
src/DeleteTagsDialog.cpp \
src/RepositoriesTreeWidget.cpp \
src/SelectCommandDialog.cpp \
src/ImageViewWidget.cpp \
src/FileHistoryWindow.cpp \
src/GitPackIdxV2.cpp \
src/GitPack.cpp \
src/GitObjectManager.cpp \
src/FilePropertyDialog.cpp \
src/BigDiffWindow.cpp \
src/MaximizeButton.cpp \
src/CommitExploreWindow.cpp \
src/ReadOnlyLineEdit.cpp \
src/ReadOnlyPlainTextEdit.cpp \
src/MyTableWidgetDelegate.cpp \
src/SetRemoteUrlDialog.cpp \
src/ClearButton.cpp \
src/SetUserDialog.cpp \
src/SearchFromGitHubDialog.cpp \
src/webclient.cpp \
src/charvec.cpp \
src/urlencode.cpp \
src/HyperLinkLabel.cpp \
src/JumpDialog.cpp \
src/CheckoutDialog.cpp \
src/DeleteBranchDialog.cpp \
src/BasicRepositoryDialog.cpp \
src/RemoteRepositoriesTableWidget.cpp \
src/LocalSocketReader.cpp \
src/PushDialog.cpp \
src/StatusLabel.cpp \
src/RepositoryLineEdit.cpp \
src/DirectoryLineEdit.cpp \
src/AbstractSettingForm.cpp \
src/SettingExampleForm.cpp \
src/CreateRepositoryDialog.cpp \
src/GitHubAPI.cpp \
src/MemoryReader.cpp \
src/ExperimentDialog.cpp \
src/gunzip.cpp \
src/AvatarLoader.cpp \
src/SettingNetworkForm.cpp \
src/Photoshop.cpp \
src/SettingBehaviorForm.cpp \
src/MyProcess.cpp \
src/FileViewWidget.cpp \
src/MyTextEditorWidget.cpp \
src/AbstractProcess.cpp \
src/texteditor/AbstractCharacterBasedApplication.cpp \
src/texteditor/InputMethodPopup.cpp \
src/texteditor/TextEditorTheme.cpp \
src/texteditor/TextEditorWidget.cpp \
src/texteditor/unicode.cpp \
src/texteditor/UnicodeWidth.cpp \
src/MyImageViewWidget.cpp \
src/SetGlobalUserDialog.cpp \
src/ReflogWindow.cpp \
src/Theme.cpp \
src/ApplicationGlobal.cpp \
src/BlameWindow.cpp \
src/MenuButton.cpp \
src/SettingGeneralForm.cpp \
src/WelcomeWizardDialog.cpp \
src/DialogHeaderFrame.cpp \
src/CommitViewWindow.cpp \
src/EditRemoteDialog.cpp \
src/gpg.cpp \
src/SelectGpgKeyDialog.cpp \
src/SetGpgSigningDialog.cpp \
src/CommitDialog.cpp \
src/ConfigSigningDialog.cpp \
src/AreYouSureYouWantToContinueConnectingDialog.cpp \
src/LineEditDialog.cpp \
src/SettingProgramsForm.cpp \
src/InputNewTagDialog.cpp \
src/EditTagsDialog.cpp \
- darktheme/src/DarkStyle.cpp \
- darktheme/src/NinePatch.cpp \
- darktheme/src/StandardStyle.cpp \
- darktheme/src/TraditionalWindowsStyleTreeControl.cpp \
+ src/darktheme/DarkStyle.cpp \
+ src/darktheme/NinePatch.cpp \
+ src/darktheme/StandardStyle.cpp \
+ src/darktheme/TraditionalWindowsStyleTreeControl.cpp \
src/EditGitIgnoreDialog.cpp \
src/SelectItemDialog.cpp \
src/RebaseOntoDialog.cpp \
src/DoYouWantToInitDialog.cpp \
src/RemoteWatcher.cpp
HEADERS += \
src/MainWindow.h \
src/Git.h \
src/common/joinpath.h \
src/common/misc.h \
src/ConfigCredentialHelperDialog.h \
src/MySettings.h \
src/main.h \
src/FileDiffWidget.h \
src/TextEditDialog.h \
src/LogTableWidget.h \
src/FileDiffSliderWidget.h \
src/FileUtil.h \
src/SettingsDialog.h \
src/MergeBranchDialog.h \
src/CloneDialog.h \
src/AboutDialog.h \
src/RepositoryInfoFrame.h \
src/RepositoryPropertyDialog.h \
src/RepositoryData.h \
src/MyToolButton.h \
src/GitDiff.h \
src/CommitPropertyDialog.h \
src/Terminal.h \
src/DeleteTagsDialog.h \
src/RepositoriesTreeWidget.h \
src/SelectCommandDialog.h \
src/ImageViewWidget.h \
src/FileHistoryWindow.h \
src/Debug.h \
src/GitPackIdxV2.h \
src/GitPack.h \
src/GitObjectManager.h \
src/FilePropertyDialog.h \
src/BigDiffWindow.h \
src/MaximizeButton.h \
src/CommitExploreWindow.h \
src/ReadOnlyLineEdit.h \
src/ReadOnlyPlainTextEdit.h \
src/MyTableWidgetDelegate.h \
src/SetRemoteUrlDialog.h \
- myzlib.h \
src/ClearButton.h \
src/SetUserDialog.h \
src/SearchFromGitHubDialog.h \
src/webclient.h \
src/charvec.h \
src/urlencode.h \
src/HyperLinkLabel.h \
src/JumpDialog.h \
src/CheckoutDialog.h \
src/DeleteBranchDialog.h \
src/BasicRepositoryDialog.h \
src/RemoteRepositoriesTableWidget.h \
src/LocalSocketReader.h \
src/PushDialog.h \
src/StatusLabel.h \
src/RepositoryLineEdit.h \
src/DirectoryLineEdit.h \
src/AbstractSettingForm.h \
src/SettingExampleForm.h \
src/CreateRepositoryDialog.h \
src/GitHubAPI.h \
src/MemoryReader.h \
src/ExperimentDialog.h \
src/gunzip.h \
src/AvatarLoader.h \
src/SettingNetworkForm.h \
src/Photoshop.h \
src/SettingBehaviorForm.h \
src/MyProcess.h \
src/MyTextEditorWidget.h \
src/AbstractProcess.h \
src/texteditor/AbstractCharacterBasedApplication.h \
src/texteditor/InputMethodPopup.h \
src/texteditor/TextEditorTheme.h \
src/texteditor/TextEditorWidget.h \
src/texteditor/unicode.h \
src/texteditor/UnicodeWidth.h \
src/MyImageViewWidget.h \
src/SetGlobalUserDialog.h \
src/ReflogWindow.h \
src/Theme.h \
src/ApplicationGlobal.h \
src/BlameWindow.h \
src/MenuButton.h \
src/SettingGeneralForm.h \
src/WelcomeWizardDialog.h \
src/DialogHeaderFrame.h \
src/CommitViewWindow.h \
src/EditRemoteDialog.h \
src/gpg.h \
src/SelectGpgKeyDialog.h \
src/SetGpgSigningDialog.h \
src/CommitDialog.h \
src/ConfigSigningDialog.h \
src/AreYouSureYouWantToContinueConnectingDialog.h \
src/LineEditDialog.h \
src/SettingProgramsForm.h \
src/InputNewTagDialog.h \
src/EditTagsDialog.h \
- darktheme/src/DarkStyle.h \
- darktheme/src/NinePatch.h \
- darktheme/src/StandardStyle.h \
- darktheme/src/TraditionalWindowsStyleTreeControl.h \
+ src/darktheme/DarkStyle.h \
+ src/darktheme/NinePatch.h \
+ src/darktheme/StandardStyle.h \
+ src/darktheme/TraditionalWindowsStyleTreeControl.h \
src/EditGitIgnoreDialog.h \
src/SelectItemDialog.h \
src/RebaseOntoDialog.h \
src/DoYouWantToInitDialog.h \
src/RemoteWatcher.h
FORMS += \
src/MainWindow.ui \
src/ConfigCredentialHelperDialog.ui \
src/TextEditDialog.ui \
src/SettingsDialog.ui \
src/MergeBranchDialog.ui \
src/CloneDialog.ui \
src/AboutDialog.ui \
src/RepositoryPropertyDialog.ui \
src/CommitPropertyDialog.ui \
src/DeleteTagsDialog.ui \
src/SelectCommandDialog.ui \
src/FileDiffWidget.ui \
src/FileHistoryWindow.ui \
src/FilePropertyDialog.ui \
src/BigDiffWindow.ui \
src/CommitExploreWindow.ui \
src/SetRemoteUrlDialog.ui \
src/SetUserDialog.ui \
src/SearchFromGitHubDialog.ui \
src/JumpDialog.ui \
src/CheckoutDialog.ui \
src/DeleteBranchDialog.ui \
src/PushDialog.ui \
src/SettingExampleForm.ui \
src/CreateRepositoryDialog.ui \
src/ExperimentDialog.ui \
src/SettingNetworkForm.ui \
src/SettingBehaviorForm.ui \
src/SetGlobalUserDialog.ui \
src/ReflogWindow.ui \
src/BlameWindow.ui \
src/SettingGeneralForm.ui \
src/WelcomeWizardDialog.ui \
src/CommitViewWindow.ui \
src/EditRemoteDialog.ui \
src/SelectGpgKeyDialog.ui \
src/SetGpgSigningDialog.ui \
src/CommitDialog.ui \
src/ConfigSigningDialog.ui \
src/AreYouSureYouWantToContinueConnectingDialog.ui \
src/LineEditDialog.ui \
src/SettingProgramsForm.ui \
src/InputNewTagDialog.ui \
src/EditTagsDialog.ui \
src/EditGitIgnoreDialog.ui \
src/SelectItemDialog.ui \
src/RebaseOntoDialog.ui \
src/DoYouWantToInitDialog.ui
RESOURCES += \
- resources.qrc
+ src/resources/resources.qrc
unix {
SOURCES += \
src/unix/UnixProcess.cpp \
src/unix/UnixPtyProcess.cpp
HEADERS += \
src/unix/UnixProcess.h \
src/unix/UnixPtyProcess.h
}
win32 {
SOURCES += \
src/win32/thread.cpp \
src/win32/event.cpp \
src/win32/win32.cpp \
src/win32/Win32Process.cpp \
src/win32/Win32PtyProcess.cpp
HEADERS += \
src/win32/thread.h \
src/win32/event.h \
src/win32/mutex.h \
src/win32/win32.h \
src/win32/Win32Process.h \
src/win32/Win32PtyProcess.h
}
+
+
diff --git a/Info.plist.in b/Info.plist.in
new file mode 100644
index 0000000..eb01716
--- /dev/null
+++ b/Info.plist.in
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>NSPrincipalClass</key>
+ <string>NSApplication</string>
+ <key>CFBundleIconFile</key>
+ <string>Guitar.icns</string>
+ <key>CFBundlePackageType</key>
+ <string>APPL</string>
+ <key>CFBundleGetInfoString</key>
+ <string>@CMAKE_PROJECT_VERSION@</string>
+ <key>CFBundleSignature</key>
+ <string>????</string>
+ <key>CFBundleExecutable</key>
+ <string>Guitar</string>
+ <key>CFBundleIdentifier</key>
+ <string>jp.soramimi.Guitar</string>
+</dict>
+</plist>
diff --git a/cmake/modules/Findzlib.cmake b/cmake/modules/Findzlib.cmake
new file mode 100644
index 0000000..7773469
--- /dev/null
+++ b/cmake/modules/Findzlib.cmake
@@ -0,0 +1,30 @@
+set(zlib_ROOT_DIR "${zlib_DIR}")
+
+find_path(zlib_INCLUDE_DIRS
+ NAMES zlib.h
+ HINTS "${zlib_ROOT_DIR}/include"
+ DOC "The zlib include directory"
+ )
+
+find_library(zlib_LIBRARIES
+ NAMES z
+ HINTS "${zlib_ROOT_DIR}/lib"
+ DOC "The zlib library"
+ )
+
+include(FindPackageHandleStandardArgs)
+
+find_package_handle_standard_args(zlib DEFAULT_MSG
+ zlib_LIBRARIES
+ zlib_INCLUDE_DIRS
+ )
+
+mark_as_advanced(zlib_INCLUDE_DIRS zlib_LIBRARIES )
+
+if(zlib_FOUND)
+ add_library(zlib SHARED IMPORTED)
+ set_target_properties(zlib PROPERTIES
+ INTERFACE_INCLUDE_DIRECTORIES "${zlib_INCLUDE_DIRS}"
+ )
+ set_property(TARGET zlib APPEND PROPERTY IMPORTED_LOCATION "${zlib_LIBRARIES}")
+endif()
diff --git a/extra/CMakeLists.txt b/extra/CMakeLists.txt
new file mode 100644
index 0000000..f21f97d
--- /dev/null
+++ b/extra/CMakeLists.txt
@@ -0,0 +1 @@
+add_subdirectory(FileView)
diff --git a/extra/FileView/CMakeLists.txt b/extra/FileView/CMakeLists.txt
new file mode 100644
index 0000000..58071bb
--- /dev/null
+++ b/extra/FileView/CMakeLists.txt
@@ -0,0 +1,64 @@
+cmake_minimum_required(VERSION 3.2)
+
+project(FileView
+ VERSION 0.9.0
+ LANGUAGES CXX C
+)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+set(CMAKE_AUTOMOC ON)
+set(CMAKE_AUTOUIC ON)
+set(CMAKE_AUTORCC ON)
+
+find_package(Qt5 COMPONENTS Core Widgets Network Svg REQUIRED)
+
+set(FileView_SOURCES
+ main.cpp
+ MainWindow.cpp
+ ../../src/texteditor/AbstractCharacterBasedApplication.cpp
+ ../../src/texteditor/InputMethodPopup.cpp
+ ../../src/texteditor/TextEditorTheme.cpp
+ ../../src/texteditor/TextEditorWidget.cpp
+ ../../src/texteditor/unicode.cpp
+ ../../src/texteditor/UnicodeWidth.cpp
+ ../../src/FileViewWidget.cpp
+ ../../src/common/joinpath.cpp
+ ../../src/common/misc.cpp
+ ../../src/ImageViewWidget.cpp
+ ../../src/MemoryReader.cpp
+ ../../src/Photoshop.cpp
+ ../../src/ImageViewWidget.cpp
+ )
+
+set(FileView_HEADERS
+ MainWindow.h
+ ../../src/texteditor/AbstractCharacterBasedApplication.h
+ ../../src/texteditor/InputMethodPopup.h
+ ../../src/texteditor/TextEditorTheme.h
+ ../../src/texteditor/TextEditorWidget.h
+ ../../src/texteditor/unicode.h
+ ../../src/texteditor/UnicodeWidth.h
+ ../../src/FileViewWidget.h
+ ../../src/common/joinpath.h
+ ../../src/common/misc.h
+ ../../src/ImageViewWidget.h
+ ../../src/MemoryReader.h
+ ../../src/Photoshop.h
+ ../../src/ImageViewWidget.h
+ )
+
+set(FileView_UIS
+ MainWindow.ui
+ )
+
+add_executable(${PROJECT_NAME}
+ ${FileView_SOURCES}
+ ${FileView_HEADERS}
+ ${FileView_UIS}
+ )
+
+target_link_libraries(${PROJECT_NAME}
+ Qt5::Widgets
+ Qt5::Network
+ Qt5::Svg
+)
diff --git a/myzlib.h b/myzlib.h
deleted file mode 100644
index 213d57e..0000000
--- a/myzlib.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifdef __HAIKU__
-#include <zlib.h>
-#else
-#include "../zlib/zlib.h"
-#endif
-//#include <QtZlib/zlib.h>
diff --git a/prepare.rb b/prepare.rb
index d00ea42..0f87dcb 100755
--- a/prepare.rb
+++ b/prepare.rb
@@ -1,89 +1,89 @@
#!/usr/bin/ruby
# create the following files
# * version.c
# * win.rc
# * Info.plist
load 'version.rb'
def get_revision()
rev = ""
if Dir.exist?(".git")
hash = `git rev-parse HEAD`
if hash =~ /^[0-9A-Za-z]+/
rev = hash[0, 7]
end
end
return rev
end
-File.open("version.c", "w") {|f|
+File.open("src/version.h", "w") {|f|
f.puts <<_____
int copyright_year = #{$copyright_year};
char const product_version[] = "#{$version_a}.#{$version_b}.#{$version_c}";
char const source_revision[] = "#{get_revision()}";
_____
}
File.open("win.rc", "w") {|f|
f.puts <<_____
#include <windows.h>
100 ICON DISCARDABLE "#{$product_name}.ico"
VS_VERSION_INFO VERSIONINFO
FILEVERSION #{$version_a},#{$version_b},#{$version_c},#{$version_d}
PRODUCTVERSION #{$version_a},#{$version_b},#{$version_c},#{$version_d}
FILEFLAGSMASK 0x3fL
FILEFLAGS 0x0L
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "041103a4"
BEGIN
VALUE "CompanyName", "S.Fuchita"
VALUE "FileDescription", "The Git GUI Client"
VALUE "FileVersion", "#{$version_a}, #{$version_b}, #{$version_c}, #{$version_d}"
VALUE "InternalName", "#{$product_name}.exe"
VALUE "LegalCopyright", "Copyright (C) #{$copyright_year} S.Fuchita (@soramimi_jp)"
VALUE "OriginalFilename","#{$product_name}.exe"
VALUE "ProductName", "#{$product_name}"
VALUE "ProductVersion", "#{$version_a}, #{$version_b}, #{$version_c}, #{$version_d}"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0411, 932
END
END
_____
}
File.open("Info.plist", "w") {|f|
f.puts <<_____
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSPrincipalClass</key>
<string>NSApplication</string>
<key>CFBundleIconFile</key>
<string>#{$product_name}.icns</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleGetInfoString</key>
<string>#{$version_a}.#{$version_b}.#{$version_c}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleExecutable</key>
<string>#{$product_name}</string>
<key>CFBundleIdentifier</key>
<string>jp.soramimi.#{$product_name}</string>
</dict>
</plist>
_____
}
diff --git a/src/AboutDialog.cpp b/src/AboutDialog.cpp
index b20e775..653be49 100644
--- a/src/AboutDialog.cpp
+++ b/src/AboutDialog.cpp
@@ -1,67 +1,64 @@
#include "AboutDialog.h"
#include "ui_AboutDialog.h"
#include "common/misc.h"
#include <QPainter>
-// defined in 'version.c' generated by prepare.rb
-extern "C" int copyright_year;
-extern "C" char const product_version[];
-extern "C" char const source_revision[];
+#include "version.h"
AboutDialog::AboutDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::AboutDialog)
{
ui->setupUi(this);
Qt::WindowFlags flags = windowFlags();
flags &= ~Qt::WindowContextHelpButtonHint;
setWindowFlags(flags);
misc::setFixedSize(this);
QString copyright_holder = "S.Fuchita";
QString twitter_account = "soramimi_jp";
pixmap.load(":/image/about.png");
setWindowTitle(tr("About %1").arg(qApp->applicationName()));
setStyleSheet("QLabel { color: black; }");
ui->label_title->setText(appVersion());
ui->label_copyright->setText(QString("Copyright (C) %1 %2").arg(copyright_year).arg(copyright_holder));
ui->label_twitter->setText(twitter_account.isEmpty() ? QString() : QString("(@%1)").arg(twitter_account));
QString t = QString("Qt %1").arg(qVersion());
#if defined(_MSC_VER)
t += QString(", msvc=%1").arg(_MSC_VER);
#elif defined(__clang__)
t += QString(", clang=%1.%2").arg(__clang_major__).arg(__clang_minor__);
#elif defined(__GNUC__)
t += QString(", gcc=%1.%2.%3").arg(__GNUC__).arg(__GNUC_MINOR__).arg(__GNUC_PATCHLEVEL__);
#endif
ui->label_qt->setText(t);
}
AboutDialog::~AboutDialog()
{
delete ui;
}
void AboutDialog::mouseReleaseEvent(QMouseEvent *)
{
accept();
}
void AboutDialog::paintEvent(QPaintEvent *)
{
QPainter pr(this);
int w = width();
int h = height();
pr.drawPixmap(0, 0, w, h, pixmap);
}
QString AboutDialog::appVersion()
{
return QString("%1, v%2 (%3)").arg(qApp->applicationName()).arg(product_version).arg(source_revision);
}
diff --git a/src/CommitPropertyDialog.ui b/src/CommitPropertyDialog.ui
index ac9a0c8..0560ed9 100644
--- a/src/CommitPropertyDialog.ui
+++ b/src/CommitPropertyDialog.ui
@@ -1,386 +1,386 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CommitPropertyDialog</class>
<widget class="QDialog" name="CommitPropertyDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>527</width>
<height>482</height>
</rect>
</property>
<property name="windowTitle">
<string>Commit Property</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="ReadOnlyLineEdit" name="lineEdit_description">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
<enum>QFormLayout::ExpandingFieldsGrow</enum>
</property>
<property name="labelAlignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="formAlignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="verticalSpacing">
<number>3</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
<string>Date</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="ReadOnlyLineEdit" name="lineEdit_date"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_5">
<property name="text">
<string>Author</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="ReadOnlyLineEdit" name="lineEdit_author"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_6">
<property name="text">
<string>Mail</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="ReadOnlyLineEdit" name="lineEdit_mail"/>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_user_avatar">
<property name="minimumSize">
<size>
<width>64</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>64</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QFrame" name="frame_sign">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<property name="spacing">
<number>2</number>
</property>
<item>
<widget class="QLabel" name="label_signature_icon">
<property name="minimumSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="pixmap">
- <pixmap resource="../resources.qrc">:/image/signature-good.png</pixmap>
+ <pixmap resource="resources/resources.qrc">:/image/signature-good.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_10">
<property name="text">
<string>GPG Sign</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<layout class="QFormLayout" name="formLayout_2">
<property name="labelAlignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
<property name="formAlignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
<property name="verticalSpacing">
<number>3</number>
</property>
<item row="0" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>ID</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="ReadOnlyLineEdit" name="lineEdit_sign_id"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
<string>Name</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="ReadOnlyLineEdit" name="lineEdit_sign_name"/>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_9">
<property name="text">
<string>Mail</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="ReadOnlyLineEdit" name="lineEdit_sign_mail"/>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label_sign_avatar">
<property name="minimumSize">
<size>
<width>64</width>
<height>0</height>
</size>
</property>
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Commit ID</string>
</property>
</widget>
</item>
<item>
<widget class="ReadOnlyLineEdit" name="lineEdit_commit_id"/>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>Parent IDs</string>
</property>
</widget>
</item>
<item>
<widget class="ReadOnlyPlainTextEdit" name="plainTextEdit_parent_ids">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="pushButton_details">
<property name="text">
<string>Files...</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_explorer">
<property name="text">
<string>Explorer</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_checkout">
<property name="text">
<string>Checkout</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="pushButton_jump">
<property name="text">
<string>Jump</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton_close">
<property name="text">
<string>Close</string>
</property>
<property name="default">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>ReadOnlyLineEdit</class>
<extends>QLineEdit</extends>
<header>ReadOnlyLineEdit.h</header>
</customwidget>
<customwidget>
<class>ReadOnlyPlainTextEdit</class>
<extends>QPlainTextEdit</extends>
<header>ReadOnlyPlainTextEdit.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>lineEdit_description</tabstop>
<tabstop>lineEdit_date</tabstop>
<tabstop>lineEdit_author</tabstop>
<tabstop>lineEdit_mail</tabstop>
<tabstop>lineEdit_commit_id</tabstop>
<tabstop>plainTextEdit_parent_ids</tabstop>
<tabstop>pushButton_checkout</tabstop>
<tabstop>pushButton_close</tabstop>
</tabstops>
<resources>
- <include location="../resources.qrc"/>
+ <include location="resources/resources.qrc"/>
</resources>
<connections>
<connection>
<sender>pushButton_close</sender>
<signal>clicked()</signal>
<receiver>CommitPropertyDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>368</x>
<y>347</y>
</hint>
<hint type="destinationlabel">
<x>367</x>
<y>394</y>
</hint>
</hints>
</connection>
</connections>
</ui>
diff --git a/src/GitPack.cpp b/src/GitPack.cpp
index 74c1306..8819f28 100644
--- a/src/GitPack.cpp
+++ b/src/GitPack.cpp
@@ -1,252 +1,252 @@
#include "GitPack.h"
-#include "../myzlib.h"
+#include <zlib.h>
#include <QDebug>
#include <QFile>
#include "GitPackIdxV2.h"
void GitPack::decodeTree(QByteArray *out)
{
if (out && out->size() > 0) {
QByteArray ba;
uint8_t const *begin = (uint8_t const *)out->data();
uint8_t const *end = begin + out->size();
uint8_t const *ptr = begin;
while (ptr < end) {
int mode = 0;
while (ptr < end) {
int c = *ptr & 0xff;
ptr++;
if (isdigit(c & 0xff)) {
mode = mode * 10 + (c - '0');
} else if (c == ' ') {
break;
}
}
uint8_t const *left = ptr;
while (ptr < end && *ptr) {
ptr++;
}
std::string name(left, ptr);
if (ptr + 20 < end) {
ptr++;
char tmp[100];
sprintf(tmp, "%06u %s ", mode, mode < 100000 ? "tree" : "blob");
char *p = tmp + 12;
for (int i = 0; i < 20; i++) {
sprintf(p, "%02x", ptr[i]);
p += 2;
}
ba.append(tmp, p - tmp);
ba.append('\t');
ba.append(name.c_str(), name.size());
ba.append('\n');
ptr += 20;
} else {
break;
}
}
*out = std::move(ba);
}
}
Git::Object::Type GitPack::stripHeader(QByteArray *out)
{
if (out) {
int n = out->size();
if (n > 0) {
char const *p = out->data();
if (n > 16) n = 16;
for (int i = 0; i < n; i++) {
if (p[i] == 0) {
Git::Object::Type type = Git::Object::Type::UNKNOWN;
if (strncmp(p, "blob ", 5) == 0) {
type = Git::Object::Type::BLOB;
} else if (strncmp(p, "tree ", 5) == 0) {
type = Git::Object::Type::TREE;
} else if (strncmp(p, "commit ", 7) == 0) {
type = Git::Object::Type::COMMIT;
} else if (strncmp(p, "tag ", 4) == 0) {
type = Git::Object::Type::TAG;
}
if (type != Git::Object::Type::UNKNOWN) {
*out = out->mid(i + 1);
}
return type;
}
}
}
}
return Git::Object::Type::UNKNOWN;
}
bool GitPack::decompress(QIODevice *in, size_t expanded_size, QByteArray *out, size_t *consumed, uint32_t *crc)
{
if (consumed) *consumed = 0;
try {
int err;
z_stream d_stream;
d_stream.zalloc = (alloc_func)0;
d_stream.zfree = (free_func)0;
d_stream.opaque = (voidpf)0;
d_stream.next_in = 0;
d_stream.avail_in = 0;
err = inflateInit(&d_stream);
if (err != Z_OK) {
throw QString("failed: inflateInit");
}
while (1) {
if (expanded_size > 0 && (size_t)out->size() > expanded_size) {
throw QString("file too large");
}
uint8_t src[1024];
uint8_t tmp[65536];
if (d_stream.next_in != src && d_stream.avail_in > 0) {
memmove(src, d_stream.next_in, d_stream.avail_in);
}
d_stream.next_in = src;
if (d_stream.avail_in < sizeof(src)) {
int n = sizeof(src) - d_stream.avail_in;
n = in->read((char *)(src + d_stream.avail_in), n);
if (n >= 0) {
d_stream.avail_in += n;
}
}
d_stream.next_out = tmp;
size_t l = expanded_size - out->size();
if (l > sizeof(tmp)) l = sizeof(tmp);
d_stream.avail_out = l;
uLong total = d_stream.total_out;
err = ::inflate(&d_stream, Z_NO_FLUSH);
int in_len = (uint8_t *)d_stream.next_in - src;
if (consumed) *consumed += in_len;
if (crc) *crc = crc32(*crc, src, in_len);
int out_len = d_stream.total_out - total;
out->append((char const *)tmp, out_len);
if (err == Z_STREAM_END) {
break;
}
if (err != Z_OK) {
throw QString("failed: inflate");
}
}
err = inflateEnd(&d_stream);
if (err != Z_OK) {
throw QString("failed: inflateEnd");
}
return true;
} catch (QString const &e) {
qDebug() << e;
}
return false;
}
bool GitPack::seekPackedObject(QIODevice *file, const GitPackIdxItem *item, Info *out)
{
try {
Info info;
auto Read = [&](void *ptr, size_t len){
const auto l = file->read((char *)ptr, len);
if (l < 0 || ((size_t)(l)) != len) {
throw QString("failed to read");
}
info.checksum = crc32(info.checksum, (uint8_t const *)ptr, len);
};
file->seek(0);
uint32_t header[3];
Read(header, sizeof(int32_t) * 3);
if (memcmp(header, "PACK", 4) != 0) throw QString("invalid pack file");
uint32_t version = read_uint32_be(header + 1);
if (version < 2) throw QString("invalid pack file version");
/*int count = */read_uint32_be(header + 2);
file->seek(item->offset);
info.checksum = 0;
// cf. https://github.com/github/git-msysgit/blob/master/builtin/unpack-objects.c
{
size_t size = 0;
char c;
Read(&c, 1);
info.type = (Git::Object::Type)((c >> 4) & 7);
size = c & 0x0f;
int shift = 4;
while (c & 0x80) {
Read(&c, 1);
size |= (c & 0x7f) << shift;
shift += 7;
}
info.expanded_size = size;
}
if (info.type == Git::Object::Type::OFS_DELTA) {
uint64_t offset = 0;
char c;
Read(&c, 1);
offset = c & 0x7f;
while (c & 0x80) {
Read(&c, 1);
offset = ((offset + 1) << 7) | (c & 0x7f);
}
info.offset = offset;
} else if (info.type == Git::Object::Type::REF_DELTA) {
char bin[20];
Read(bin, 20);
char tmp[41];
for (int i = 0; i < 20; i++) {
sprintf(tmp + i * 2, "%02x", bin[i] & 0xff);
}
info.ref_id = QString::fromLatin1(tmp, GIT_ID_LENGTH);
}
*out = info;
return true;
} catch (QString const &e) {
qDebug() << e;
}
return false;
}
bool GitPack::load(QIODevice *file, const GitPackIdxItem *item, Object *out)
{
*out = Object();
try {
seekPackedObject(file, item, out);
if (decompress(file, out->expanded_size, &out->content, &out->packed_size, &out->checksum)) {
out->expanded_size = out->expanded_size;
return true;
}
} catch (QString const &e) {
qDebug() << e;
}
return false;
}
bool GitPack::load(QString const &packfile, const GitPackIdxItem *item, GitPack::Object *out)
{
QFile file(packfile);
if (file.open(QFile::ReadOnly)) {
if (load(&file, item, out)) {
return true;
}
}
return false;
}
diff --git a/src/MainWindow.ui b/src/MainWindow.ui
index 8afa631..8438b65 100644
--- a/src/MainWindow.ui
+++ b/src/MainWindow.ui
@@ -1,1518 +1,1518 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>MainWindow</class>
<widget class="QMainWindow" name="MainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>848</width>
<height>596</height>
</rect>
</property>
<property name="windowTitle">
<string>Guitar</string>
</property>
<property name="animated">
<bool>false</bool>
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QVBoxLayout" name="verticalLayout_8">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>4</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>4</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QFrame" name="frame_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>56</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>56</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>1</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>2</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>2</number>
</property>
<item>
<widget class="MyToolButton" name="toolButton_clone">
<property name="minimumSize">
<size>
<width>64</width>
<height>48</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>48</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Clone</string>
</property>
<property name="icon">
- <iconset resource="../resources.qrc">
+ <iconset resource="resources/resources.qrc">
<normaloff>:/image/clone.svg</normaloff>:/image/clone.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="MyToolButton" name="toolButton_fetch">
<property name="minimumSize">
<size>
<width>64</width>
<height>48</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>48</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Fetch</string>
</property>
<property name="icon">
- <iconset resource="../resources.qrc">
+ <iconset resource="resources/resources.qrc">
<normaloff>:/image/fetch.svg</normaloff>:/image/fetch.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="MyToolButton" name="toolButton_pull">
<property name="minimumSize">
<size>
<width>64</width>
<height>48</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>48</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Pull</string>
</property>
<property name="icon">
- <iconset resource="../resources.qrc">
+ <iconset resource="resources/resources.qrc">
<normaloff>:/image/pull.svg</normaloff>:/image/pull.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="MyToolButton" name="toolButton_push">
<property name="minimumSize">
<size>
<width>64</width>
<height>48</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>48</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Push</string>
</property>
<property name="icon">
- <iconset resource="../resources.qrc">
+ <iconset resource="resources/resources.qrc">
<normaloff>:/image/push.svg</normaloff>:/image/push.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>8</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="MyToolButton" name="toolButton_terminal">
<property name="minimumSize">
<size>
<width>64</width>
<height>48</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>48</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Terminal</string>
</property>
<property name="icon">
- <iconset resource="../resources.qrc">
+ <iconset resource="resources/resources.qrc">
<normaloff>:/image/terminal.svg</normaloff>:/image/terminal.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<widget class="MyToolButton" name="toolButton_explorer">
<property name="minimumSize">
<size>
<width>64</width>
<height>48</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>16777215</width>
<height>48</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Explorer</string>
</property>
<property name="icon">
- <iconset resource="../resources.qrc">
+ <iconset resource="resources/resources.qrc">
<normaloff>:/image/explorer.svg</normaloff>:/image/explorer.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>8</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>503</width>
<height>48</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="RepositoryInfoFrame" name="frame_3">
<property name="maximumSize">
<size>
<width>16777215</width>
<height>48</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>6</number>
</property>
<property name="topMargin">
<number>4</number>
</property>
<property name="rightMargin">
<number>6</number>
</property>
<property name="bottomMargin">
<number>4</number>
</property>
<item>
<widget class="QLabel" name="label_repo_name">
<property name="font">
<font>
<pointsize>14</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Repository</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_branch_name">
<property name="text">
<string>Branch Name</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>4</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_10">
<property name="spacing">
<number>1</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<property name="spacing">
<number>4</number>
</property>
<item>
<widget class="QRadioButton" name="radioButton_remote_offline">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Offline</string>
</property>
</widget>
</item>
<item>
<widget class="QRadioButton" name="radioButton_remote_online">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
<property name="text">
<string>Online</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="ReadOnlyLineEdit" name="lineEdit_remote">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QSplitter" name="splitter_v">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="childrenCollapsible">
<bool>false</bool>
</property>
<widget class="QWidget" name="layoutWidget">
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="RepositoriesTreeWidget" name="treeWidget_repos">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="acceptDrops">
<bool>true</bool>
</property>
<property name="editTriggers">
<set>QAbstractItemView::EditKeyPressed|QAbstractItemView::SelectedClicked</set>
</property>
<property name="dragEnabled">
<bool>true</bool>
</property>
<property name="dragDropMode">
<enum>QAbstractItemView::InternalMove</enum>
</property>
<property name="defaultDropAction">
<enum>Qt::MoveAction</enum>
</property>
<property name="verticalScrollMode">
<enum>QAbstractItemView::ScrollPerPixel</enum>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<attribute name="headerVisible">
<bool>false</bool>
</attribute>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
</widget>
</item>
<item>
<widget class="QFrame" name="frame_5">
<property name="frameShape">
<enum>QFrame::NoFrame</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Plain</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<property name="spacing">
<number>2</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QLineEdit" name="lineEdit_filter">
<property name="focusPolicy">
<enum>Qt::ClickFocus</enum>
</property>
</widget>
</item>
<item>
<widget class="ClearButton" name="toolButton_erase_filter">
<property name="minimumSize">
<size>
<width>22</width>
<height>17</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="iconSize">
<size>
<width>20</width>
<height>15</height>
</size>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<widget class="QSplitter" name="splitter_h">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="childrenCollapsible">
<bool>false</bool>
</property>
<widget class="QStackedWidget" name="stackedWidget_log">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="page_log_table">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="LogTableWidget" name="tableWidget_log">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="tabKeyNavigation">
<bool>false</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::SingleSelection</enum>
</property>
<property name="selectionBehavior">
<enum>QAbstractItemView::SelectRows</enum>
</property>
<property name="horizontalScrollMode">
<enum>QAbstractItemView::ScrollPerPixel</enum>
</property>
<property name="wordWrap">
<bool>false</bool>
</property>
<attribute name="horizontalHeaderHighlightSections">
<bool>false</bool>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
<attribute name="verticalHeaderVisible">
<bool>false</bool>
</attribute>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_log_progress">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>244</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="pushButton">
<property name="text">
<string>PushButton</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>243</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget>
<widget class="QStackedWidget" name="stackedWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="page_uncommited">
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="1,0,1">
<property name="spacing">
<number>2</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QListWidget" name="listWidget_unstaged">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
</widget>
</item>
<item>
<widget class="QFrame" name="frame_2">
<property name="frameShape">
<enum>QFrame::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Raised</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<layout class="QGridLayout" name="gridLayout" columnstretch="1,1">
<property name="topMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<property name="spacing">
<number>3</number>
</property>
<item row="2" column="0" colspan="2">
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="MyToolButton" name="toolButton_unstage">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>64</width>
<height>0</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="text">
<string>Unstage</string>
</property>
<property name="icon">
- <iconset resource="../resources.qrc">
+ <iconset resource="resources/resources.qrc">
<normaloff>:/image/unstage.svg</normaloff>:/image/unstage.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item row="0" column="0" colspan="2">
<widget class="MyToolButton" name="toolButton_select_all">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="text">
<string>Select all</string>
</property>
<property name="icon">
- <iconset resource="../resources.qrc">
+ <iconset resource="resources/resources.qrc">
<normaloff>:/image/selall.svg</normaloff>:/image/selall.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>18</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="MyToolButton" name="toolButton_stage">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>64</width>
<height>0</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="text">
<string>Stage</string>
</property>
<property name="icon">
- <iconset resource="../resources.qrc">
+ <iconset resource="resources/resources.qrc">
<normaloff>:/image/stage.svg</normaloff>:/image/stage.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
<item row="3" column="0" colspan="2">
<widget class="MyToolButton" name="toolButton_commit">
<property name="sizePolicy">
<sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="text">
<string>Commit</string>
</property>
<property name="icon">
- <iconset resource="../resources.qrc">
+ <iconset resource="resources/resources.qrc">
<normaloff>:/image/commit.svg</normaloff>:/image/commit.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>24</width>
<height>24</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonTextUnderIcon</enum>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QListWidget" name="listWidget_staged">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="page_files">
<layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QListWidget" name="listWidget_files">
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
<widget class="QFrame" name="frame_6">
<property name="frameShape">
<enum>QFrame::Panel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="FileDiffWidget" name="widget_diff_view" native="true">
<property name="minimumSize">
<size>
<width>0</width>
<height>100</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>848</width>
- <height>24</height>
+ <height>18</height>
</rect>
</property>
<widget class="QMenu" name="menu_File">
<property name="title">
<string>&amp;File</string>
</property>
<addaction name="action_clone"/>
<addaction name="action_open_existing_working_copy"/>
<addaction name="action_create_a_repository"/>
<addaction name="separator"/>
<addaction name="action_stop_process"/>
<addaction name="separator"/>
<addaction name="action_exit"/>
</widget>
<widget class="QMenu" name="menu_View">
<property name="title">
<string>&amp;View</string>
</property>
<addaction name="action_view_refresh"/>
</widget>
<widget class="QMenu" name="menu_Edit">
<property name="title">
<string>&amp;Edit</string>
</property>
<addaction name="action_edit_gitignore"/>
<addaction name="action_edit_git_config"/>
<addaction name="action_edit_global_gitconfig"/>
<addaction name="action_set_config_user"/>
<addaction name="action_set_gpg_signing"/>
<addaction name="separator"/>
<addaction name="action_edit_settings"/>
</widget>
<widget class="QMenu" name="menu_Help">
<property name="title">
<string>&amp;Help</string>
</property>
<addaction name="action_about"/>
</widget>
<widget class="QMenu" name="menu_Window">
<property name="title">
<string>&amp;Window</string>
</property>
<addaction name="action_window_log"/>
</widget>
<widget class="QMenu" name="menu_Repository">
<property name="title">
<string>&amp;Repository</string>
</property>
<addaction name="action_fetch"/>
<addaction name="action_commit"/>
<addaction name="action_pull"/>
<addaction name="action_push"/>
<addaction name="action_push_u"/>
<addaction name="separator"/>
<addaction name="action_repo_jump"/>
<addaction name="action_repo_checkout"/>
<addaction name="action_delete_branch"/>
<addaction name="action_delete_remote_branch"/>
<addaction name="action_edit_tags"/>
<addaction name="action_reflog"/>
<addaction name="separator"/>
<addaction name="action_clone"/>
<addaction name="separator"/>
<addaction name="action_repository_property"/>
</widget>
<widget class="QMenu" name="menuExperiment">
<property name="title">
<string>Experiment</string>
</property>
<addaction name="action_test"/>
<addaction name="action_tag_push_all"/>
<addaction name="action_reset_HEAD_1"/>
<addaction name="action_rebase_onto"/>
</widget>
<addaction name="menu_File"/>
<addaction name="menu_View"/>
<addaction name="menu_Edit"/>
<addaction name="menu_Repository"/>
<addaction name="menu_Window"/>
<addaction name="menu_Help"/>
<addaction name="menuExperiment"/>
</widget>
<widget class="QStatusBar" name="statusBar"/>
<widget class="QDockWidget" name="dockWidget_log">
<property name="floating">
<bool>false</bool>
</property>
<property name="features">
<set>QDockWidget::DockWidgetFeatureMask</set>
</property>
<property name="allowedAreas">
<set>Qt::BottomDockWidgetArea|Qt::TopDockWidgetArea</set>
</property>
<property name="windowTitle">
<string>Log</string>
</property>
<attribute name="dockWidgetArea">
<number>8</number>
</attribute>
<widget class="QWidget" name="dockWidgetContents">
<layout class="QVBoxLayout" name="verticalLayout_7">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QFrame" name="frame">
<property name="frameShape">
<enum>QFrame::Panel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Sunken</enum>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>0</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>0</number>
</property>
<item>
<widget class="QFrame" name="frame_8">
<layout class="QVBoxLayout" name="verticalLayout_5">
<property name="spacing">
<number>1</number>
</property>
<property name="leftMargin">
<number>1</number>
</property>
<property name="topMargin">
<number>1</number>
</property>
<property name="rightMargin">
<number>1</number>
</property>
<property name="bottomMargin">
<number>1</number>
</property>
<item>
<widget class="QToolButton" name="toolButton_stop_process">
<property name="minimumSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>20</width>
<height>20</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
- <iconset resource="../resources.qrc">
+ <iconset resource="resources/resources.qrc">
<normaloff>:/image/redsquare.svg</normaloff>:/image/redsquare.svg</iconset>
</property>
<property name="iconSize">
<size>
<width>12</width>
<height>12</height>
</size>
</property>
<property name="toolButtonStyle">
<enum>Qt::ToolButtonIconOnly</enum>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>5</width>
<height>45</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</item>
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="gridLayout_2">
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="1">
<widget class="QScrollBar" name="verticalScrollBar_log">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="TextEditorWidget" name="widget_log" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>80</height>
</size>
</property>
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QScrollBar" name="horizontalScrollBar_log">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
</widget>
<action name="action_open_existing_working_copy">
<property name="text">
<string>&amp;Open existing working copy...</string>
</property>
<property name="toolTip">
<string>Add existing working copy</string>
</property>
</action>
<action name="action_view_refresh">
<property name="text">
<string>Refresh</string>
</property>
<property name="toolTip">
<string>Refresh</string>
</property>
<property name="shortcut">
<string>F5</string>
</property>
</action>
<action name="action_commit">
<property name="icon">
- <iconset resource="../resources.qrc">
+ <iconset resource="resources/resources.qrc">
<normaloff>:/image/commit.svg</normaloff>:/image/commit.svg</iconset>
</property>
<property name="text">
<string>&amp;Commit</string>
</property>
</action>
<action name="action_push">
<property name="icon">
- <iconset resource="../resources.qrc">
+ <iconset resource="resources/resources.qrc">
<normaloff>:/image/push.svg</normaloff>:/image/push.svg</iconset>
</property>
<property name="text">
<string>&amp;Push</string>
</property>
<property name="autoRepeat">
<bool>false</bool>
</property>
</action>
<action name="action_test">
<property name="text">
<string>test</string>
</property>
<property name="shortcut">
<string>Ctrl+T</string>
</property>
</action>
<action name="action_pull">
<property name="icon">
- <iconset resource="../resources.qrc">
+ <iconset resource="resources/resources.qrc">
<normaloff>:/image/pull.svg</normaloff>:/image/pull.svg</iconset>
</property>
<property name="text">
<string>Pu&amp;ll</string>
</property>
</action>
<action name="action_fetch">
<property name="icon">
- <iconset resource="../resources.qrc">
+ <iconset resource="resources/resources.qrc">
<normaloff>:/image/fetch.svg</normaloff>:/image/fetch.svg</iconset>
</property>
<property name="text">
<string>&amp;Fetch</string>
</property>
</action>
<action name="action_edit_global_gitconfig">
<property name="text">
<string>Edit global .gitconfig</string>
</property>
<property name="toolTip">
<string>Edit global .gitconfig</string>
</property>
</action>
<action name="action_edit_git_config">
<property name="text">
<string>Edit .git/config</string>
</property>
</action>
<action name="action_edit_gitignore">
<property name="text">
<string>Edit .gitignore</string>
</property>
</action>
<action name="action_edit_settings">
<property name="text">
<string>&amp;Settings...</string>
</property>
<property name="toolTip">
<string>Settings</string>
</property>
</action>
<action name="action_clone">
<property name="icon">
- <iconset resource="../resources.qrc">
+ <iconset resource="resources/resources.qrc">
<normaloff>:/image/clone.svg</normaloff>:/image/clone.svg</iconset>
</property>
<property name="text">
<string>Clone</string>
</property>
<property name="toolTip">
<string>Clone</string>
</property>
</action>
<action name="action_about">
<property name="text">
<string>&amp;About</string>
</property>
</action>
<action name="action_edit_tags">
<property name="text">
<string>Edit tags...</string>
</property>
<property name="toolTip">
<string>Edit tags</string>
</property>
</action>
<action name="action_tag_push_all">
<property name="text">
<string>Push all tags</string>
</property>
</action>
<action name="action_set_config_user">
<property name="text">
<string>Set config user</string>
</property>
</action>
<action name="action_window_log">
<property name="checkable">
<bool>true</bool>
</property>
<property name="text">
<string>&amp;Log</string>
</property>
</action>
<action name="action_repo_jump">
<property name="text">
<string>&amp;Jump...</string>
</property>
<property name="shortcut">
<string>Ctrl+J</string>
</property>
</action>
<action name="action_repo_checkout">
<property name="text">
<string>Check&amp;out...</string>
</property>
</action>
<action name="action_delete_branch">
<property name="text">
<string>Delete branch...</string>
</property>
</action>
<action name="action_push_u">
<property name="text">
<string>Push --set-upstream</string>
</property>
</action>
<action name="action_reset_HEAD_1">
<property name="text">
<string>reset HEAD~1</string>
</property>
</action>
<action name="action_create_a_repository">
<property name="text">
<string>Create a repository</string>
</property>
</action>
<action name="action_stop_process">
<property name="icon">
- <iconset resource="../resources.qrc">
+ <iconset resource="resources/resources.qrc">
<normaloff>:/image/redsquare.svg</normaloff>:/image/redsquare.svg</iconset>
</property>
<property name="text">
<string>Stop process</string>
</property>
</action>
<action name="action_exit">
<property name="text">
<string>E&amp;xit</string>
</property>
<property name="shortcut">
<string>Ctrl+Q</string>
</property>
</action>
<action name="action_reflog">
<property name="text">
<string>Reflog...</string>
</property>
</action>
<action name="action_repository_property">
<property name="text">
<string>Property...</string>
</property>
</action>
<action name="action_set_gpg_signing">
<property name="text">
<string>Set GPG signing</string>
</property>
<property name="toolTip">
<string>Set GPG signing</string>
</property>
</action>
<action name="action_delete_remote_branch">
<property name="text">
<string>Delete remote branch...</string>
</property>
</action>
<action name="action_rebase_onto">
<property name="text">
<string>rebase onto</string>
</property>
</action>
</widget>
<layoutdefault spacing="6" margin="11"/>
<customwidgets>
+ <customwidget>
+ <class>ReadOnlyLineEdit</class>
+ <extends>QLineEdit</extends>
+ <header>ReadOnlyLineEdit.h</header>
+ </customwidget>
<customwidget>
<class>TextEditorWidget</class>
<extends>QWidget</extends>
<header>TextEditorWidget.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>ClearButton</class>
<extends>QToolButton</extends>
<header>ClearButton.h</header>
</customwidget>
<customwidget>
<class>LogTableWidget</class>
<extends>QTableWidget</extends>
<header>LogTableWidget.h</header>
</customwidget>
<customwidget>
<class>RepositoryInfoFrame</class>
<extends>QFrame</extends>
<header>RepositoryInfoFrame.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>MyToolButton</class>
<extends>QToolButton</extends>
<header>MyToolButton.h</header>
</customwidget>
<customwidget>
<class>RepositoriesTreeWidget</class>
<extends>QTreeWidget</extends>
<header>RepositoriesTreeWidget.h</header>
</customwidget>
<customwidget>
<class>FileDiffWidget</class>
<extends>QWidget</extends>
<header location="global">FileDiffWidget.h</header>
<container>1</container>
</customwidget>
- <customwidget>
- <class>ReadOnlyLineEdit</class>
- <extends>QLineEdit</extends>
- <header>ReadOnlyLineEdit.h</header>
- </customwidget>
</customwidgets>
<tabstops>
<tabstop>treeWidget_repos</tabstop>
<tabstop>toolButton_erase_filter</tabstop>
<tabstop>tableWidget_log</tabstop>
<tabstop>listWidget_unstaged</tabstop>
<tabstop>toolButton_select_all</tabstop>
<tabstop>toolButton_stage</tabstop>
<tabstop>toolButton_unstage</tabstop>
<tabstop>toolButton_commit</tabstop>
<tabstop>listWidget_staged</tabstop>
<tabstop>listWidget_files</tabstop>
<tabstop>widget_diff_view</tabstop>
</tabstops>
<resources>
- <include location="../resources.qrc"/>
+ <include location="resources/resources.qrc"/>
</resources>
<connections/>
</ui>
diff --git a/src/Theme.cpp b/src/Theme.cpp
index 27e9184..f04e7fa 100644
--- a/src/Theme.cpp
+++ b/src/Theme.cpp
@@ -1,142 +1,142 @@
#include "Theme.h"
#include <QApplication>
#include <QRgb>
#include <QProxyStyle>
// AbstractTheme
AbstractTheme::AbstractTheme()
{
}
AbstractTheme::~AbstractTheme()
{
}
// StandardTheme
-#include "../darktheme/src/StandardStyle.h"
+#include "../darktheme/StandardStyle.h"
StandardTheme::StandardTheme()
{
}
QStyle *StandardTheme::newStyle()
{
return new StandardStyle();
}
QImage StandardTheme::graphColorMap()
{
QImage image;
image.load(":/image/graphcolor.png");
return image;
}
QPixmap StandardTheme::resource_clear_png()
{
return QPixmap(":/image/clear.png");
}
QPixmap StandardTheme::resource_maximize_png()
{
return QPixmap(":/image/maximize.png");
}
QPixmap StandardTheme::resource_menu_png()
{
return QPixmap(":/image/menu.png");
}
ThemePtr createStandardTheme()
{
AbstractTheme *p = new StandardTheme;
p->text_editor_theme = TextEditorTheme::Light();
p->dialog_header_frame_bg = Qt::white;
p->diff_slider_normal_bg = Qt::white;
p->diff_slider_unknown_bg = QColor(208, 208, 208);
p->diff_slider_add_bg = QColor(64, 192, 64);
p->diff_slider_del_bg = QColor(240, 64, 64);
p->diff_slider_handle = Qt::black;
return ThemePtr(p);
}
-#ifdef USE_DARK_THEME
+//#ifdef USE_DARK_THEME
-#include "../darktheme/src/DarkStyle.h"
+#include "darktheme/DarkStyle.h"
// DarkTheme
DarkTheme::DarkTheme()
{
}
QStyle *DarkTheme::newStyle()
{
return new DarkStyle();
}
QImage DarkTheme::graphColorMap()
{
QImage image;
image.load(":/darktheme/graphcolor.png");
return image;
}
static QImage loadInvertedImage(QString const &path)
{
QImage img(path);
int w = img.width();
int h = img.height();
for (int y = 0; y < h; y++) {
QRgb *p = (QRgb *)img.scanLine(y);
for (int x = 0; x < w; x++) {
int r = qRed(*p);
int g = qGreen(*p);
int b = qBlue(*p);
int a = qAlpha(*p);
*p = qRgba(255 - r, 255 - g, 255 - b, a);
p++;
}
}
return img;
}
QPixmap DarkTheme::resource_clear_png()
{
QImage img = loadInvertedImage(":/image/clear.png");
return QPixmap::fromImage(img);
}
QPixmap DarkTheme::resource_maximize_png()
{
QImage img = loadInvertedImage(":/image/maximize.png");
return QPixmap::fromImage(img);
}
QPixmap DarkTheme::resource_menu_png()
{
QImage img = loadInvertedImage(":/image/menu.png");
return QPixmap::fromImage(img);
}
ThemePtr createDarkTheme()
{
AbstractTheme *p = new DarkTheme;
p->text_editor_theme = TextEditorTheme::Dark();
p->dialog_header_frame_bg = QColor(32, 32, 32);
p->diff_slider_normal_bg = QColor(48, 48, 48);
p->diff_slider_unknown_bg = QColor(0, 0, 0);
p->diff_slider_add_bg = QColor(0, 144, 0);
p->diff_slider_del_bg = QColor(160, 0, 0);
p->diff_slider_handle = QColor(255, 255, 255);
return ThemePtr(p);
}
-#endif // USE_DAR_THEME
+//#endif // USE_DAR_THEME
diff --git a/src/Theme.h b/src/Theme.h
index f77cef8..c2d60d6 100644
--- a/src/Theme.h
+++ b/src/Theme.h
@@ -1,60 +1,60 @@
#ifndef THEME_H
#define THEME_H
#include <QImage>
#include <QPalette>
#include <memory>
#include "TextEditorTheme.h"
class QStyle;
class AbstractTheme {
public:
TextEditorThemePtr text_editor_theme;
QColor dialog_header_frame_bg;
QColor diff_slider_normal_bg;
QColor diff_slider_unknown_bg;
QColor diff_slider_add_bg;
QColor diff_slider_del_bg;
QColor diff_slider_handle;
AbstractTheme();
virtual ~AbstractTheme();
virtual QStyle *newStyle() = 0;
virtual QImage graphColorMap() = 0;
virtual QPixmap resource_clear_png() = 0;
virtual QPixmap resource_maximize_png() = 0;
virtual QPixmap resource_menu_png() = 0;
};
typedef std::shared_ptr<AbstractTheme> ThemePtr;
class StandardTheme : public AbstractTheme {
public:
StandardTheme();
QStyle *newStyle();
QImage graphColorMap();
QPixmap resource_clear_png();
QPixmap resource_maximize_png();
QPixmap resource_menu_png();
};
ThemePtr createStandardTheme();
-#ifdef USE_DARK_THEME
+// #ifdef USE_DARK_THEME
class DarkTheme : public AbstractTheme {
public:
DarkTheme();
QStyle *newStyle();
QImage graphColorMap();
QPixmap resource_clear_png();
QPixmap resource_maximize_png();
QPixmap resource_menu_png();
};
ThemePtr createDarkTheme();
-#endif
+// #endif
#endif // THEME_H
diff --git a/darktheme/src/DarkStyle.cpp b/src/darktheme/DarkStyle.cpp
similarity index 100%
rename from darktheme/src/DarkStyle.cpp
rename to src/darktheme/DarkStyle.cpp
diff --git a/darktheme/src/DarkStyle.h b/src/darktheme/DarkStyle.h
similarity index 100%
rename from darktheme/src/DarkStyle.h
rename to src/darktheme/DarkStyle.h
diff --git a/darktheme/src/NinePatch.cpp b/src/darktheme/NinePatch.cpp
similarity index 100%
rename from darktheme/src/NinePatch.cpp
rename to src/darktheme/NinePatch.cpp
diff --git a/darktheme/src/NinePatch.h b/src/darktheme/NinePatch.h
similarity index 100%
rename from darktheme/src/NinePatch.h
rename to src/darktheme/NinePatch.h
diff --git a/darktheme/src/StandardStyle.cpp b/src/darktheme/StandardStyle.cpp
similarity index 100%
rename from darktheme/src/StandardStyle.cpp
rename to src/darktheme/StandardStyle.cpp
diff --git a/darktheme/src/StandardStyle.h b/src/darktheme/StandardStyle.h
similarity index 100%
rename from darktheme/src/StandardStyle.h
rename to src/darktheme/StandardStyle.h
diff --git a/darktheme/src/TraditionalWindowsStyleTreeControl.cpp b/src/darktheme/TraditionalWindowsStyleTreeControl.cpp
similarity index 100%
rename from darktheme/src/TraditionalWindowsStyleTreeControl.cpp
rename to src/darktheme/TraditionalWindowsStyleTreeControl.cpp
diff --git a/darktheme/src/TraditionalWindowsStyleTreeControl.h b/src/darktheme/TraditionalWindowsStyleTreeControl.h
similarity index 100%
rename from darktheme/src/TraditionalWindowsStyleTreeControl.h
rename to src/darktheme/TraditionalWindowsStyleTreeControl.h
diff --git a/src/gunzip.cpp b/src/gunzip.cpp
index 3ffb774..b98156d 100644
--- a/src/gunzip.cpp
+++ b/src/gunzip.cpp
@@ -1,228 +1,228 @@
#include "gunzip.h"
-#include "myzlib.h"
+#include <zlib.h>
#include <stdint.h>
#include <QFile>
void gunzip::set_header_only(bool f)
{
header_only = f;
}
void gunzip::set_maximul_size(int64_t size)
{
maxsize = size;
}
bool gunzip::decode(QIODevice *input, QIODevice *output)
{
error = QString();
try {
struct Header {
uint8_t id1;
uint8_t id2;
uint8_t cm;
uint8_t flg;
uint8_t mtime[4];
uint8_t xfl;
uint8_t os;
};
enum {
FTEXT = 0x01,
FHCRC = 0x02,
FEXTRA = 0x04,
FNAME = 0x08,
FCOMMENT = 0x10,
};
unsigned char ibuf[4096];
bool ok = true;
int n;
n = input->read((char *)ibuf, sizeof(Header));
if (n != 10) {
throw QString("failed to read the header");
}
Header *h = (Header *)ibuf;
if (h->id1 == 0x1f && h->id2 == 0x8b && h->cm == 8) {
// ok
if (header_only) {
return true;
}
} else {
throw QString("invalid input format");
}
auto ReadText = [&](){
char c;
std::vector<uint8_t> vec;
while (1) {
if (input->read(&c, 1) != 1) {
break;
}
if (c == 0) break;
vec.push_back((uint8_t)c);
}
std::string str;
if (!vec.empty()) {
str.assign((char const *)&vec[0], vec.size());
}
return str;
};
if (h->flg & FEXTRA) {
n = input->read((char *)ibuf, 2);
n = ((uint8_t)ibuf[1] << 8) | (uint8_t)ibuf[0];
input->seek(input->pos() + n);
}
if (h->flg & FNAME) {
std::string name = ReadText();
(void)name;
}
if (h->flg & FCOMMENT) {
std::string comment = ReadText();
(void)comment;
}
if (h->flg & FHCRC) {
input->read((char *)ibuf, 2);
}
z_stream stream;
uint32_t crc = 0;
int err;
stream.zalloc = (alloc_func)0;
stream.zfree = (free_func)0;
stream.opaque = (voidpf)0;
stream.next_in = ibuf;
stream.avail_in = 0;
err = inflateInit2(&stream, -MAX_WBITS);
if (err != Z_OK) {
throw QString("inflateInit2 faled");
}
if (open) {
if (!open(output)) {
ok = false;
}
} else {
if (!output->open(QIODevice::WriteOnly)) {
ok = false;
}
}
if (!ok) throw QString("failed to open the output device");
int64_t inpos = input->pos();
auto Close = [&](){
if (close) {
close(output);
} else {
output->close();
}
inflateEnd(&stream);
};
try {
while (1) {
if (stream.avail_in == 0) {
stream.next_in = ibuf;
}
if (stream.avail_in < sizeof(ibuf)) {
stream.next_in = ibuf + stream.avail_in;
auto len = input->read((char *)stream.next_in, sizeof(ibuf) - stream.avail_in);
stream.avail_in += len;
}
unsigned char obuf[65536];
stream.next_out = obuf; /* discard the output */
stream.avail_out = sizeof(obuf);
if (maxsize != -1 && stream.total_out + stream.avail_out > (unsigned)maxsize && (unsigned)maxsize >= stream.total_out) {
stream.avail_out = maxsize - stream.total_out;
}
uLong total_out = stream.total_out;
err = ::inflate(&stream, Z_NO_FLUSH);
int n = stream.total_out - total_out;
if (write) {
if (!write(output, (char const *)obuf, n)) {
ok = false;
}
} else {
int w = output->write((char const *)obuf, n);
if (w != n) {
ok = false;
}
}
if (!ok) throw QString("failed to write to the output device");
crc = crc32(crc, (unsigned char const *)obuf, n);
if (err == Z_STREAM_END) {
break;
}
if (err != Z_OK) {
throw QString("inflate failed");
}
if (stream.total_out >= (unsigned)maxsize) {
break;
}
}
} catch (...) {
Close();
throw;
}
Close();
input->seek(inpos + stream.total_in);
n = input->read((char *)ibuf, 8);
auto ReadU32LE = [](void const *p)->uint32_t{
uint8_t const *q = (uint8_t const *)p;
return (q[3] << 24) | (q[2] << 16) | (q[1] << 8) | q[0];
};
auto c = ReadU32LE(ibuf);
auto l = ReadU32LE(ibuf + 4);
if (c != crc) throw QString("crc incorrect");
if (l != stream.total_out) throw QString("length incorrect");
return true;
} catch (QString const &e) {
error = e;
}
return false;
}
bool gunzip::decode(const QString &inpath, const QString &outpath)
{
QFile infile(inpath);
QFile outfile(outpath);
if (infile.open(QFile::ReadOnly)) {
if (decode(&infile, &outfile)) {
return true;
}
}
return false;
}
bool gunzip::is_valid_gz_file(QIODevice *input)
{
gunzip z;
z.set_header_only(true);
return z.decode(input, nullptr);
}
bool gunzip::is_valid_gz_file(const QString &inpath)
{
QFile infile(inpath);
if (infile.open(QFile::ReadOnly)) {
gunzip z;
if (z.is_valid_gz_file(&infile)) {
return true;
}
}
return false;
}
diff --git a/src/main.cpp b/src/main.cpp
index 8ea71ad..9092a6a 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -1,144 +1,144 @@
#include "MainWindow.h"
#include <QApplication>
#include "ApplicationGlobal.h"
#include "MySettings.h"
#include "main.h"
#include <string>
#include <QMessageBox>
#include <QDir>
#include <QDebug>
#include <QProxyStyle>
#include <QTranslator>
#include "webclient.h"
#include "win32/win32.h"
#include "common/misc.h"
-#include "../darktheme/src/DarkStyle.h"
+#include "darktheme/DarkStyle.h"
#include <QStandardPaths>
#include "common/joinpath.h"
ApplicationGlobal *global = 0;
ApplicationSettings ApplicationSettings::defaultSettings()
{
ApplicationSettings s;
s.proxy_server = "http://squid:3128/";
return s;
}
static bool isHighDpiScalingEnabled()
{
MySettings s;
s.beginGroup("UI");
QVariant v = s.value("EnableHighDpiScaling");
return v.isNull() || v.toBool();
}
int main(int argc, char *argv[])
{
putenv((char *)"UNICODEMAP_JP=cp932");
ApplicationGlobal g;
global = &g;
global->organization_name = ORGANIZATION_NAME;
global->application_name = APPLICATION_NAME;
global->generic_config_dir = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation);
global->app_config_dir = global->generic_config_dir / global->organization_name / global->application_name;
global->config_file_path = joinpath(global->app_config_dir, global->application_name + ".ini");
if (!QFileInfo(global->app_config_dir).isDir()) {
QDir().mkpath(global->app_config_dir);
}
if (isHighDpiScalingEnabled()){
#if (QT_VERSION < QT_VERSION_CHECK(5, 6, 0))
qDebug() << "High DPI scaling is not supported";
#else
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
}
QApplication a(argc, argv);
a.setOrganizationName(global->organization_name);
a.setApplicationName(global->application_name);
{
MySettings s;
s.beginGroup("UI");
global->language_id = s.value("Language").toString();
global->theme_id = s.value("Theme").toString();
if (global->theme_id.compare("dark", Qt::CaseInsensitive) == 0) {
global->theme = createDarkTheme();
} else {
global->theme = createStandardTheme();
}
s.endGroup();
}
QApplication::setStyle(global->theme->newStyle());
if (QApplication::queryKeyboardModifiers() & Qt::ShiftModifier) {
global->start_with_shift_key = true;
}
WebClient::initialize();
bool f_open_here = false;
QStringList args;
for (int i = 1; i < argc; i++) {
std::string arg = argv[i];
if (arg[0] == '-') {
if (arg == "--open-here") {
f_open_here = true;
}
} else {
args.push_back(QString::fromStdString(arg));
}
}
if (global->app_config_dir.isEmpty()) {
QMessageBox::warning(0, qApp->applicationName(), "Preparation of data storage folder failed.");
return 1;
}
QTranslator translator;
{
if (global->language_id.isEmpty() || global->language_id == "en") {
// thru
} else {
#if defined(Q_OS_MACX)
QString path = "../Resources/Guitar_" + global->language_id;
#else
QString path = "Guitar_" + global->language_id;
#endif
translator.load(path, a.applicationDirPath());
a.installTranslator(&translator);
}
}
MainWindow w;
global->panel_bg_color = w.palette().color(QPalette::Background);
w.setWindowIcon(QIcon(":/image/guitar.png"));
w.show();
w.shown();
if (f_open_here) {
QString dir = QDir::current().absolutePath();
w.autoOpenRepository(dir);
} else if (args.size() == 1) {
QString dir = args[0] / QString();
if (dir.startsWith("./") || dir.startsWith(".\\")) {
dir = QDir::current().absolutePath() / dir.mid(2);
}
QFileInfo fi(dir);
if (fi.isDir()) {
dir = fi.absolutePath();
w.autoOpenRepository(dir);
}
}
return a.exec();
}
diff --git a/Guitar.icns b/src/resources/Guitar.icns
similarity index 100%
rename from Guitar.icns
rename to src/resources/Guitar.icns
diff --git a/Guitar.ico b/src/resources/Guitar.ico
similarity index 100%
rename from Guitar.ico
rename to src/resources/Guitar.ico
diff --git a/darktheme/button/button_normal.png b/src/resources/darktheme/button/button_normal.png
similarity index 100%
rename from darktheme/button/button_normal.png
rename to src/resources/darktheme/button/button_normal.png
diff --git a/darktheme/button/button_press.png b/src/resources/darktheme/button/button_press.png
similarity index 100%
rename from darktheme/button/button_press.png
rename to src/resources/darktheme/button/button_press.png
diff --git a/darktheme/graphcolor.png b/src/resources/darktheme/graphcolor.png
similarity index 100%
rename from darktheme/graphcolor.png
rename to src/resources/darktheme/graphcolor.png
diff --git a/darktheme/hsb/hsb_add_line.png b/src/resources/darktheme/hsb/hsb_add_line.png
similarity index 100%
rename from darktheme/hsb/hsb_add_line.png
rename to src/resources/darktheme/hsb/hsb_add_line.png
diff --git a/darktheme/hsb/hsb_page_bg.png b/src/resources/darktheme/hsb/hsb_page_bg.png
similarity index 100%
rename from darktheme/hsb/hsb_page_bg.png
rename to src/resources/darktheme/hsb/hsb_page_bg.png
diff --git a/darktheme/hsb/hsb_slider.png b/src/resources/darktheme/hsb/hsb_slider.png
similarity index 100%
rename from darktheme/hsb/hsb_slider.png
rename to src/resources/darktheme/hsb/hsb_slider.png
diff --git a/darktheme/hsb/hsb_sub_line.png b/src/resources/darktheme/hsb/hsb_sub_line.png
similarity index 100%
rename from darktheme/hsb/hsb_sub_line.png
rename to src/resources/darktheme/hsb/hsb_sub_line.png
diff --git a/darktheme/progress/horz.png b/src/resources/darktheme/progress/horz.png
similarity index 100%
rename from darktheme/progress/horz.png
rename to src/resources/darktheme/progress/horz.png
diff --git a/darktheme/progress/vert.png b/src/resources/darktheme/progress/vert.png
similarity index 100%
rename from darktheme/progress/vert.png
rename to src/resources/darktheme/progress/vert.png
diff --git a/darktheme/vsb/vsb_add_line.png b/src/resources/darktheme/vsb/vsb_add_line.png
similarity index 100%
rename from darktheme/vsb/vsb_add_line.png
rename to src/resources/darktheme/vsb/vsb_add_line.png
diff --git a/darktheme/vsb/vsb_page_bg.png b/src/resources/darktheme/vsb/vsb_page_bg.png
similarity index 100%
rename from darktheme/vsb/vsb_page_bg.png
rename to src/resources/darktheme/vsb/vsb_page_bg.png
diff --git a/darktheme/vsb/vsb_slider.png b/src/resources/darktheme/vsb/vsb_slider.png
similarity index 100%
rename from darktheme/vsb/vsb_slider.png
rename to src/resources/darktheme/vsb/vsb_slider.png
diff --git a/darktheme/vsb/vsb_sub_line.png b/src/resources/darktheme/vsb/vsb_sub_line.png
similarity index 100%
rename from darktheme/vsb/vsb_sub_line.png
rename to src/resources/darktheme/vsb/vsb_sub_line.png
diff --git a/image/Guitar.svg b/src/resources/image/Guitar.svg
similarity index 100%
rename from image/Guitar.svg
rename to src/resources/image/Guitar.svg
diff --git a/image/about.png b/src/resources/image/about.png
similarity index 100%
rename from image/about.png
rename to src/resources/image/about.png
diff --git a/image/clear.png b/src/resources/image/clear.png
similarity index 100%
rename from image/clear.png
rename to src/resources/image/clear.png
diff --git a/image/clone.svg b/src/resources/image/clone.svg
similarity index 100%
rename from image/clone.svg
rename to src/resources/image/clone.svg
diff --git a/image/commit.svg b/src/resources/image/commit.svg
similarity index 100%
rename from image/commit.svg
rename to src/resources/image/commit.svg
diff --git a/image/digits.png b/src/resources/image/digits.png
similarity index 100%
rename from image/digits.png
rename to src/resources/image/digits.png
diff --git a/image/explorer.svg b/src/resources/image/explorer.svg
similarity index 100%
rename from image/explorer.svg
rename to src/resources/image/explorer.svg
diff --git a/image/fetch.svg b/src/resources/image/fetch.svg
similarity index 100%
rename from image/fetch.svg
rename to src/resources/image/fetch.svg
diff --git a/image/file.png b/src/resources/image/file.png
similarity index 100%
rename from image/file.png
rename to src/resources/image/file.png
diff --git a/image/folder.png b/src/resources/image/folder.png
similarity index 100%
rename from image/folder.png
rename to src/resources/image/folder.png
diff --git a/image/graphcolor.png b/src/resources/image/graphcolor.png
similarity index 100%
rename from image/graphcolor.png
rename to src/resources/image/graphcolor.png
diff --git a/image/guitar.ai b/src/resources/image/guitar.ai
similarity index 100%
rename from image/guitar.ai
rename to src/resources/image/guitar.ai
diff --git a/image/guitar.png b/src/resources/image/guitar.png
similarity index 100%
rename from image/guitar.png
rename to src/resources/image/guitar.png
diff --git a/image/guitaricon.ai b/src/resources/image/guitaricon.ai
similarity index 100%
rename from image/guitaricon.ai
rename to src/resources/image/guitaricon.ai
diff --git a/image/maximize.png b/src/resources/image/maximize.png
similarity index 100%
rename from image/maximize.png
rename to src/resources/image/maximize.png
diff --git a/image/menu.png b/src/resources/image/menu.png
similarity index 100%
rename from image/menu.png
rename to src/resources/image/menu.png
diff --git a/image/pull.svg b/src/resources/image/pull.svg
similarity index 100%
rename from image/pull.svg
rename to src/resources/image/pull.svg
diff --git a/image/push.svg b/src/resources/image/push.svg
similarity index 100%
rename from image/push.svg
rename to src/resources/image/push.svg
diff --git a/image/redsquare.svg b/src/resources/image/redsquare.svg
similarity index 100%
rename from image/redsquare.svg
rename to src/resources/image/redsquare.svg
diff --git a/image/repository.png b/src/resources/image/repository.png
similarity index 100%
rename from image/repository.png
rename to src/resources/image/repository.png
diff --git a/image/selall.svg b/src/resources/image/selall.svg
similarity index 100%
rename from image/selall.svg
rename to src/resources/image/selall.svg
diff --git a/image/signature-bad.png b/src/resources/image/signature-bad.png
similarity index 100%
rename from image/signature-bad.png
rename to src/resources/image/signature-bad.png
diff --git a/image/signature-dubious.png b/src/resources/image/signature-dubious.png
similarity index 100%
rename from image/signature-dubious.png
rename to src/resources/image/signature-dubious.png
diff --git a/image/signature-good.png b/src/resources/image/signature-good.png
similarity index 100%
rename from image/signature-good.png
rename to src/resources/image/signature-good.png
diff --git a/image/stage.svg b/src/resources/image/stage.svg
similarity index 100%
rename from image/stage.svg
rename to src/resources/image/stage.svg
diff --git a/image/terminal.svg b/src/resources/image/terminal.svg
similarity index 100%
rename from image/terminal.svg
rename to src/resources/image/terminal.svg
diff --git a/image/transparent.png b/src/resources/image/transparent.png
similarity index 100%
rename from image/transparent.png
rename to src/resources/image/transparent.png
diff --git a/image/unstage.svg b/src/resources/image/unstage.svg
similarity index 100%
rename from image/unstage.svg
rename to src/resources/image/unstage.svg
diff --git a/resources.qrc b/src/resources/resources.qrc
similarity index 94%
rename from resources.qrc
rename to src/resources/resources.qrc
index 3af07a0..d1eee50 100644
--- a/resources.qrc
+++ b/src/resources/resources.qrc
@@ -1,43 +1,46 @@
<RCC>
<qresource prefix="/">
<file>image/stage.svg</file>
<file>image/unstage.svg</file>
<file>image/commit.svg</file>
<file>image/push.svg</file>
<file>image/selall.svg</file>
<file>image/graphcolor.png</file>
<file>image/pull.svg</file>
<file>image/clone.svg</file>
<file>image/fetch.svg</file>
<file>image/digits.png</file>
<file>image/guitar.png</file>
<file>image/Guitar.svg</file>
<file>image/folder.png</file>
<file>image/repository.png</file>
<file>image/maximize.png</file>
<file>image/transparent.png</file>
<file>image/file.png</file>
<file>image/clear.png</file>
<file>image/terminal.svg</file>
<file>image/explorer.svg</file>
<file>image/about.png</file>
<file>image/redsquare.svg</file>
<file>darktheme/button/button_normal.png</file>
<file>darktheme/button/button_press.png</file>
<file>darktheme/hsb/hsb_add_line.png</file>
<file>darktheme/hsb/hsb_page_bg.png</file>
<file>darktheme/hsb/hsb_slider.png</file>
<file>darktheme/hsb/hsb_sub_line.png</file>
<file>darktheme/progress/horz.png</file>
<file>darktheme/progress/vert.png</file>
<file>darktheme/vsb/vsb_add_line.png</file>
<file>darktheme/vsb/vsb_page_bg.png</file>
<file>darktheme/vsb/vsb_slider.png</file>
<file>darktheme/vsb/vsb_sub_line.png</file>
<file>darktheme/graphcolor.png</file>
<file>image/menu.png</file>
<file>image/signature-bad.png</file>
<file>image/signature-dubious.png</file>
<file>image/signature-good.png</file>
</qresource>
+ <qresource prefix="/translations">
+ <file>translations/ja_JPN.qm</file>
+ </qresource>
</RCC>
diff --git a/Guitar_ja.qm b/src/resources/translations/ja_JPN.qm
similarity index 100%
rename from Guitar_ja.qm
rename to src/resources/translations/ja_JPN.qm
diff --git a/Guitar_ja.ts b/src/resources/translations/ja_JPN.ts
similarity index 100%
rename from Guitar_ja.ts
rename to src/resources/translations/ja_JPN.ts
diff --git a/version.h.in b/version.h.in
new file mode 100644
index 0000000..f931ac1
--- /dev/null
+++ b/version.h.in
@@ -0,0 +1,10 @@
+#ifndef GUITAR_VERSION_H
+#define GUITAR_VERSION_H
+
+// this file was autogenerated from src/version.h.in
+
+int copyright_year = @Guitar_copyright_year@;
+char const product_version[] = "@CMAKE_PROJECT_VERSION@";
+char const source_revision[] = "@Guitar_git_hash@";
+
+#endif // GUITAR_VERSION_H
diff --git a/win.rc.in b/win.rc.in
new file mode 100644
index 0000000..cbdbb9f
--- /dev/null
+++ b/win.rc.in
@@ -0,0 +1,32 @@
+#include <windows.h>
+
+100 ICON DISCARDABLE "Guitar.ico"
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION @CMAKE_PROJECT_VERSION_MAJOR@,@CMAKE_PROJECT_VERSION_MINOR@,@CMAKE_PROJECT_VERSION_PATCH@,0
+ PRODUCTVERSION @CMAKE_PROJECT_VERSION_MAJOR@,@CMAKE_PROJECT_VERSION_MINOR@,@CMAKE_PROJECT_VERSION_PATCH@,0
+ FILEFLAGSMASK 0x3fL
+ FILEFLAGS 0x0L
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "041103a4"
+ BEGIN
+ VALUE "CompanyName", "S.Fuchita"
+ VALUE "FileDescription", "The Git GUI Client"
+ VALUE "FileVersion", "@CMAKE_PROJECT_VERSION_MAJOR@, @CMAKE_PROJECT_VERSION_MINOR@, @CMAKE_PROJECT_VERSION_PATCH@0, 0"
+ VALUE "InternalName", "Guitar.exe"
+ VALUE "LegalCopyright", "Copyright (C) @Guitar_copyright_year S.Fuchita (@soramimi_jp)"
+ VALUE "OriginalFilename","Guitar.exe"
+ VALUE "ProductName", "Guitar"
+ VALUE "ProductVersion", "@CMAKE_PROJECT_VERSION_MAJOR@, @CMAKE_PROJECT_VERSION_MINOR@, @CMAKE_PROJECT_VERSION_PATCH@0, 0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0411, 932
+ END
+END
diff --git a/winpty/winpty.h b/winpty/winpty.h
deleted file mode 100644
index fdfe4bc..0000000
--- a/winpty/winpty.h
+++ /dev/null
@@ -1,242 +0,0 @@
-/*
- * Copyright (c) 2011-2016 Ryan Prichard
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#ifndef WINPTY_H
-#define WINPTY_H
-
-#include <windows.h>
-
-#include "winpty_constants.h"
-
-/* On 32-bit Windows, winpty functions have the default __cdecl (not __stdcall)
- * calling convention. (64-bit Windows has only a single calling convention.)
- * When compiled with __declspec(dllexport), with either MinGW or MSVC, the
- * winpty functions are unadorned--no underscore prefix or '@nn' suffix--so
- * GetProcAddress can be used easily. */
-#ifdef COMPILING_WINPTY_DLL
-#define WINPTY_API __declspec(dllexport)
-#else
-#define WINPTY_API __declspec(dllimport)
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* The winpty API uses wide characters, instead of UTF-8, to avoid conversion
- * complications related to surrogates. Windows generally tolerates unpaired
- * surrogates in text, which makes conversion to and from UTF-8 ambiguous and
- * complicated. (There are different UTF-8 variants that deal with UTF-16
- * surrogates differently.) */
-
-
-
-/*****************************************************************************
- * Error handling. */
-
-/* All the APIs have an optional winpty_error_t output parameter. If a
- * non-NULL argument is specified, then either the API writes NULL to the
- * value (on success) or writes a newly allocated winpty_error_t object. The
- * object must be freed using winpty_error_free. */
-
-/* An error object. */
-typedef struct winpty_error_s winpty_error_t;
-typedef winpty_error_t *winpty_error_ptr_t;
-
-/* An error code -- one of WINPTY_ERROR_xxx. */
-typedef DWORD winpty_result_t;
-
-/* Gets the error code from the error object. */
-WINPTY_API winpty_result_t winpty_error_code(winpty_error_ptr_t err);
-
-/* Returns a textual representation of the error. The string is freed when
- * the error is freed. */
-WINPTY_API LPCWSTR winpty_error_msg(winpty_error_ptr_t err);
-
-/* Free the error object. Every error returned from the winpty API must be
- * freed. */
-WINPTY_API void winpty_error_free(winpty_error_ptr_t err);
-
-
-
-/*****************************************************************************
- * Configuration of a new agent. */
-
-/* The winpty_config_t object is not thread-safe. */
-typedef struct winpty_config_s winpty_config_t;
-
-/* Allocate a winpty_config_t value. Returns NULL on error. There are no
- * required settings -- the object may immediately be used. agentFlags is a
- * set of zero or more WINPTY_FLAG_xxx values. An unrecognized flag results
- * in an assertion failure. */
-WINPTY_API winpty_config_t *
-winpty_config_new(UINT64 agentFlags, winpty_error_ptr_t *err /*OPTIONAL*/);
-
-/* Free the cfg object after passing it to winpty_open. */
-WINPTY_API void winpty_config_free(winpty_config_t *cfg);
-
-WINPTY_API void
-winpty_config_set_initial_size(winpty_config_t *cfg, int cols, int rows);
-
-/* Set the mouse mode to one of the WINPTY_MOUSE_MODE_xxx constants. */
-WINPTY_API void
-winpty_config_set_mouse_mode(winpty_config_t *cfg, int mouseMode);
-
-/* Amount of time to wait for the agent to startup and to wait for any given
- * agent RPC request. Must be greater than 0. Can be INFINITE. */
-WINPTY_API void
-winpty_config_set_agent_timeout(winpty_config_t *cfg, DWORD timeoutMs);
-
-
-
-/*****************************************************************************
- * Start the agent. */
-
-/* The winpty_t object is thread-safe. */
-typedef struct winpty_s winpty_t;
-
-/* Starts the agent. Returns NULL on error. This process will connect to the
- * agent over a control pipe, and the agent will open data pipes (e.g. CONIN
- * and CONOUT). */
-WINPTY_API winpty_t *
-winpty_open(const winpty_config_t *cfg,
- winpty_error_ptr_t *err /*OPTIONAL*/);
-
-/* A handle to the agent process. This value is valid for the lifetime of the
- * winpty_t object. Do not close it. */
-WINPTY_API HANDLE winpty_agent_process(winpty_t *wp);
-
-
-
-/*****************************************************************************
- * I/O pipes. */
-
-/* Returns the names of named pipes used for terminal I/O. Each input or
- * output direction uses a different half-duplex pipe. The agent creates
- * these pipes, and the client can connect to them using ordinary I/O methods.
- * The strings are freed when the winpty_t object is freed.
- *
- * winpty_conerr_name returns NULL unless WINPTY_FLAG_CONERR is specified.
- *
- * N.B.: CreateFile does not block when connecting to a local server pipe. If
- * the server pipe does not exist or is already connected, then it fails
- * instantly. */
-WINPTY_API LPCWSTR winpty_conin_name(winpty_t *wp);
-WINPTY_API LPCWSTR winpty_conout_name(winpty_t *wp);
-WINPTY_API LPCWSTR winpty_conerr_name(winpty_t *wp);
-
-
-
-/*****************************************************************************
- * winpty agent RPC call: process creation. */
-
-/* The winpty_spawn_config_t object is not thread-safe. */
-typedef struct winpty_spawn_config_s winpty_spawn_config_t;
-
-/* winpty_spawn_config strings do not need to live as long as the config
- * object. They are copied. Returns NULL on error. spawnFlags is a set of
- * zero or more WINPTY_SPAWN_FLAG_xxx values. An unrecognized flag results in
- * an assertion failure.
- *
- * env is a a pointer to an environment block like that passed to
- * CreateProcess--a contiguous array of NUL-terminated "VAR=VAL" strings
- * followed by a final NUL terminator.
- *
- * N.B.: If you want to gather all of the child's output, you may want the
- * WINPTY_SPAWN_FLAG_AUTO_SHUTDOWN flag.
- */
-WINPTY_API winpty_spawn_config_t *
-winpty_spawn_config_new(UINT64 spawnFlags,
- LPCWSTR appname /*OPTIONAL*/,
- LPCWSTR cmdline /*OPTIONAL*/,
- LPCWSTR cwd /*OPTIONAL*/,
- LPCWSTR env /*OPTIONAL*/,
- winpty_error_ptr_t *err /*OPTIONAL*/);
-
-/* Free the cfg object after passing it to winpty_spawn. */
-WINPTY_API void winpty_spawn_config_free(winpty_spawn_config_t *cfg);
-
-/*
- * Spawns the new process.
- *
- * The function initializes all output parameters to zero or NULL.
- *
- * On success, the function returns TRUE. For each of process_handle and
- * thread_handle that is non-NULL, the HANDLE returned from CreateProcess is
- * duplicated from the agent and returned to the winpty client. The client is
- * responsible for closing these HANDLES.
- *
- * On failure, the function returns FALSE, and if err is non-NULL, then *err
- * is set to an error object.
- *
- * If the agent's CreateProcess call failed, then *create_process_error is set
- * to GetLastError(), and the WINPTY_ERROR_SPAWN_CREATE_PROCESS_FAILED error
- * is returned.
- *
- * winpty_spawn can only be called once per winpty_t object. If it is called
- * before the output data pipe(s) is/are connected, then collected output is
- * buffered until the pipes are connected, rather than being discarded.
- *
- * N.B.: GetProcessId works even if the process has exited. The PID is not
- * recycled until the NT process object is freed.
- * (https://blogs.msdn.microsoft.com/oldnewthing/20110107-00/?p=11803)
- */
-WINPTY_API BOOL
-winpty_spawn(winpty_t *wp,
- const winpty_spawn_config_t *cfg,
- HANDLE *process_handle /*OPTIONAL*/,
- HANDLE *thread_handle /*OPTIONAL*/,
- DWORD *create_process_error /*OPTIONAL*/,
- winpty_error_ptr_t *err /*OPTIONAL*/);
-
-
-
-/*****************************************************************************
- * winpty agent RPC calls: everything else */
-
-/* Change the size of the Windows console window. */
-WINPTY_API BOOL
-winpty_set_size(winpty_t *wp, int cols, int rows,
- winpty_error_ptr_t *err /*OPTIONAL*/);
-
-/* Gets a list of processes attached to the console. */
-WINPTY_API int
-winpty_get_console_process_list(winpty_t *wp, int *processList, const int processCount,
- winpty_error_ptr_t *err /*OPTIONAL*/);
-
-/* Frees the winpty_t object and the OS resources contained in it. This
- * call breaks the connection with the agent, which should then close its
- * console, terminating the processes attached to it.
- *
- * This function must not be called if any other threads are using the
- * winpty_t object. Undefined behavior results. */
-WINPTY_API void winpty_free(winpty_t *wp);
-
-
-
-/****************************************************************************/
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* WINPTY_H */
diff --git a/winpty/winpty.lib b/winpty/winpty.lib
deleted file mode 100644
index a35c429..0000000
Binary files a/winpty/winpty.lib and /dev/null differ
diff --git a/winpty/winpty_constants.h b/winpty/winpty_constants.h
deleted file mode 100644
index 11e34cf..0000000
--- a/winpty/winpty_constants.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * Copyright (c) 2016 Ryan Prichard
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to
- * deal in the Software without restriction, including without limitation the
- * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
- * sell copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
- * IN THE SOFTWARE.
- */
-
-#ifndef WINPTY_CONSTANTS_H
-#define WINPTY_CONSTANTS_H
-
-/*
- * You may want to include winpty.h instead, which includes this header.
- *
- * This file is split out from winpty.h so that the agent can access the
- * winpty flags without also declaring the libwinpty APIs.
- */
-
-/*****************************************************************************
- * Error codes. */
-
-#define WINPTY_ERROR_SUCCESS 0
-#define WINPTY_ERROR_OUT_OF_MEMORY 1
-#define WINPTY_ERROR_SPAWN_CREATE_PROCESS_FAILED 2
-#define WINPTY_ERROR_LOST_CONNECTION 3
-#define WINPTY_ERROR_AGENT_EXE_MISSING 4
-#define WINPTY_ERROR_UNSPECIFIED 5
-#define WINPTY_ERROR_AGENT_DIED 6
-#define WINPTY_ERROR_AGENT_TIMEOUT 7
-#define WINPTY_ERROR_AGENT_CREATION_FAILED 8
-
-
-
-/*****************************************************************************
- * Configuration of a new agent. */
-
-/* Create a new screen buffer (connected to the "conerr" terminal pipe) and
- * pass it to child processes as the STDERR handle. This flag also prevents
- * the agent from reopening CONOUT$ when it polls -- regardless of whether the
- * active screen buffer changes, winpty continues to monitor the original
- * primary screen buffer. */
-#define WINPTY_FLAG_CONERR 0x1ull
-
-/* Don't output escape sequences. */
-#define WINPTY_FLAG_PLAIN_OUTPUT 0x2ull
-
-/* Do output color escape sequences. These escapes are output by default, but
- * are suppressed with WINPTY_FLAG_PLAIN_OUTPUT. Use this flag to reenable
- * them. */
-#define WINPTY_FLAG_COLOR_ESCAPES 0x4ull
-
-/* On XP and Vista, winpty needs to put the hidden console on a desktop in a
- * service window station so that its polling does not interfere with other
- * (visible) console windows. To create this desktop, it must change the
- * process' window station (i.e. SetProcessWindowStation) for the duration of
- * the winpty_open call. In theory, this change could interfere with the
- * winpty client (e.g. other threads, spawning children), so winpty by default
- * spawns a special agent process to create the hidden desktop. Spawning
- * processes on Windows is slow, though, so if
- * WINPTY_FLAG_ALLOW_CURPROC_DESKTOP_CREATION is set, winpty changes this
- * process' window station instead.
- * See https://github.com/rprichard/winpty/issues/58. */
-#define WINPTY_FLAG_ALLOW_CURPROC_DESKTOP_CREATION 0x8ull
-
-#define WINPTY_FLAG_MASK (0ull \
- | WINPTY_FLAG_CONERR \
- | WINPTY_FLAG_PLAIN_OUTPUT \
- | WINPTY_FLAG_COLOR_ESCAPES \
- | WINPTY_FLAG_ALLOW_CURPROC_DESKTOP_CREATION \
-)
-
-/* QuickEdit mode is initially disabled, and the agent does not send mouse
- * mode sequences to the terminal. If it receives mouse input, though, it
- * still writes MOUSE_EVENT_RECORD values into CONIN. */
-#define WINPTY_MOUSE_MODE_NONE 0
-
-/* QuickEdit mode is initially enabled. As CONIN enters or leaves mouse
- * input mode (i.e. where ENABLE_MOUSE_INPUT is on and ENABLE_QUICK_EDIT_MODE
- * is off), the agent enables or disables mouse input on the terminal.
- *
- * This is the default mode. */
-#define WINPTY_MOUSE_MODE_AUTO 1
-
-/* QuickEdit mode is initially disabled, and the agent enables the terminal's
- * mouse input mode. It does not disable terminal mouse mode (until exit). */
-#define WINPTY_MOUSE_MODE_FORCE 2
-
-
-
-/*****************************************************************************
- * winpty agent RPC call: process creation. */
-
-/* If the spawn is marked "auto-shutdown", then the agent shuts down console
- * output once the process exits. The agent stops polling for new console
- * output, and once all pending data has been written to the output pipe, the
- * agent closes the pipe. (At that point, the pipe may still have data in it,
- * which the client may read. Once all the data has been read, further reads
- * return EOF.) */
-#define WINPTY_SPAWN_FLAG_AUTO_SHUTDOWN 1ull
-
-/* After the agent shuts down output, and after all output has been written
- * into the pipe(s), exit the agent by closing the console. If there any
- * surviving processes still attached to the console, they are killed.
- *
- * Note: With this flag, an RPC call (e.g. winpty_set_size) issued after the
- * agent exits will fail with an I/O or dead-agent error. */
-#define WINPTY_SPAWN_FLAG_EXIT_AFTER_SHUTDOWN 2ull
-
-/* All the spawn flags. */
-#define WINPTY_SPAWN_FLAG_MASK (0ull \
- | WINPTY_SPAWN_FLAG_AUTO_SHUTDOWN \
- | WINPTY_SPAWN_FLAG_EXIT_AFTER_SHUTDOWN \
-)
-
-
-
-#endif /* WINPTY_CONSTANTS_H */
diff --git a/zlib.pro b/zlib.pro
deleted file mode 100644
index 913f468..0000000
--- a/zlib.pro
+++ /dev/null
@@ -1,42 +0,0 @@
-unix:CONFIG(debug,debug|release):TARGET = zd
-unix:CONFIG(release,debug|release):TARGET = z
-win32:CONFIG(debug,debug|release):TARGET = libzd
-win32:CONFIG(release,debug|release):TARGET = libz
-
-TEMPLATE = lib
-CONFIG += console staticlib
-CONFIG -= app_bundle
-CONFIG -= qt
-
-DESTDIR = $$PWD/_bin
-
-SOURCES += \
- ../zlib/gzclose.c \
- ../zlib/uncompr.c \
- ../zlib/compress.c \
- ../zlib/adler32.c \
- ../zlib/crc32.c \
- ../zlib/gzread.c \
- ../zlib/infback.c \
- ../zlib/inflate.c \
- ../zlib/trees.c \
- ../zlib/zutil.c \
- ../zlib/inffast.c \
- ../zlib/inftrees.c \
- ../zlib/gzlib.c \
- ../zlib/gzwrite.c \
- ../zlib/deflate.c
-
-HEADERS += \
- ../zlib/trees.h \
- ../zlib/inftrees.h \
- ../zlib/inffast.h \
- ../zlib/inffixed.h \
- ../zlib/crc32.h \
- ../zlib/inflate.h \
- ../zlib/gzguts.h \
- ../zlib/zutil.h \
- ../zlib/deflate.h \
- ../zlib/zconf.h \
- ../zlib/zlib.h
-

File Metadata

Mime Type
text/x-diff
Expires
Wed, Jun 17, 9:05 PM (1 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
71385
Default Alt Text
(138 KB)

Event Timeline