Improve project configuration files.

Set the TS file to update automatically.
Set to automatically generate QM files.
Adjust the configuration file reading path.
Fix the refresh logic of the configuration file.
Set icon for executable file
Improve the about page.
Adjust the configuration file reading and setting related to Key Server.
This commit is contained in:
Saturneric 2021-06-18 16:47:06 +08:00
parent c551649795
commit 4bd6e0a8f1
36 changed files with 7511 additions and 12650 deletions

2
.idea/.name generated
View File

@ -1 +1 @@
GpgConstants.h gpg4usb_zh.ts

View File

@ -32,14 +32,14 @@ find_package(Git QUIET)
if(GIT_FOUND) if(GIT_FOUND)
execute_process( execute_process(
COMMAND ${GIT_EXECUTABLE} log -1 --pretty=format:%H COMMAND ${GIT_EXECUTABLE} log -1 --pretty=format:%H
OUTPUT_VARIABLE COMMIT_HASH OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET ERROR_QUIET
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
) )
execute_process( execute_process(
COMMAND ${GIT_EXECUTABLE} symbolic-ref --short -q HEAD COMMAND ${GIT_EXECUTABLE} symbolic-ref --short -q HEAD
OUTPUT_VARIABLE BRANCH_NAME OUTPUT_VARIABLE GIT_BRANCH_NAME
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET ERROR_QUIET
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
@ -48,10 +48,10 @@ endif()
set(BUILD_VERSION ${PROJECT_VERSION}_${CMAKE_SYSTEM}_${CMAKE_SYSTEM_PROCESSOR}_${CMAKE_BUILD_TYPE}) set(BUILD_VERSION ${PROJECT_VERSION}_${CMAKE_SYSTEM}_${CMAKE_SYSTEM_PROCESSOR}_${CMAKE_BUILD_TYPE})
set(GIT_VERSION ${PROJECT_NAME}_${GIT_COMMIT_HASH}_${GIT_COMMIT_HASH}) set(GIT_VERSION ${GIT_BRANCH_NAME}_${GIT_COMMIT_HASH})
string(TIMESTAMP BUILD_TIMESTAMP "%Y-%m-%d %H:%M:%S") string(TIMESTAMP BUILD_TIMESTAMP "%Y-%m-%d %H:%M:%S")
message("Build Timestamp ${BUILD_TIMESTAMP}") message(STATUS "Build Timestamp ${BUILD_TIMESTAMP}")
message(STATUS "Build Version ${BUILD_VERSION}") message(STATUS "Build Version ${BUILD_VERSION}")
message(STATUS "Git Version ${GIT_VERSION}") message(STATUS "Git Version ${GIT_VERSION}")
@ -110,7 +110,7 @@ if(LINUX)
endif() endif()
find_package(Qt5 COMPONENTS Core Test Widgets PrintSupport Network REQUIRED) find_package(Qt5 COMPONENTS Core Test Widgets PrintSupport Network LinguistTools REQUIRED)
add_subdirectory(src) add_subdirectory(src)

View File

@ -1,487 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:y="http://www.yworks.com/xml/graphml" xmlns:yed="http://www.yworks.com/xml/yed/3" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://www.yworks.com/xml/schema/graphml/1.1/ygraphml.xsd">
<!--Created by yFiles for Java 2.8-->
<key for="graphml" id="d0" yfiles.type="resources"/>
<key for="port" id="d1" yfiles.type="portgraphics"/>
<key for="port" id="d2" yfiles.type="portgeometry"/>
<key for="port" id="d3" yfiles.type="portuserdata"/>
<key attr.name="url" attr.type="string" for="node" id="d4"/>
<key attr.name="description" attr.type="string" for="node" id="d5"/>
<key for="node" id="d6" yfiles.type="nodegraphics"/>
<key attr.name="Beschreibung" attr.type="string" for="graph" id="d7"/>
<key attr.name="url" attr.type="string" for="edge" id="d8"/>
<key attr.name="description" attr.type="string" for="edge" id="d9"/>
<key for="edge" id="d10" yfiles.type="edgegraphics"/>
<graph edgedefault="directed" id="G">
<data key="d7"/>
<node id="n0">
<data key="d6">
<y:ShapeNode>
<y:Geometry height="30.0" width="150.0" x="19.5" y="90.0"/>
<y:Fill color="#FFCC99" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="79.955078125" x="35.0224609375" y="6.015625">attachments</y:NodeLabel>
<y:Shape type="rectangle"/>
</y:ShapeNode>
</data>
</node>
<node id="n1">
<data key="d6">
<y:ShapeNode>
<y:Geometry height="30.0" width="150.0" x="19.5" y="150.0"/>
<y:Fill color="#FFCC99" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="141.4609375" x="4.26953125" y="6.015625">attachmenttablemodel</y:NodeLabel>
<y:Shape type="rectangle"/>
</y:ShapeNode>
</data>
</node>
<node id="n2">
<data key="d6">
<y:ShapeNode>
<y:Geometry height="30.0" width="150.0" x="655.5" y="395.0"/>
<y:Fill color="#FFCC99" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="60.859375" x="44.5703125" y="6.015625">context.h</y:NodeLabel>
<y:Shape type="rectangle"/>
</y:ShapeNode>
</data>
</node>
<node id="n3">
<data key="d6">
<y:ShapeNode>
<y:Geometry height="30.0" width="150.0" x="199.5" y="150.0"/>
<y:Fill color="#FFCC99" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="80.705078125" x="34.6474609375" y="6.015625">editorpage.h</y:NodeLabel>
<y:Shape type="rectangle"/>
</y:ShapeNode>
</data>
</node>
<node id="n4">
<data key="d6">
<y:ShapeNode>
<y:Geometry height="30.0" width="150.0" x="508.25" y="90.0"/>
<y:Fill color="#FFCC99" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="123.09765625" x="13.451171875" y="6.015625">fileencryptiondialog</y:NodeLabel>
<y:Shape type="rectangle"/>
</y:ShapeNode>
</data>
</node>
<node id="n5">
<data key="d6">
<y:ShapeNode>
<y:Geometry height="30.0" width="150.0" x="553.25" y="0.0"/>
<y:Fill color="#FFCC99" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="47.60546875" x="51.197265625" y="6.015625">gpgwin</y:NodeLabel>
<y:Shape type="rectangle"/>
</y:ShapeNode>
</data>
</node>
<node id="n6">
<data key="d6">
<y:ShapeNode>
<y:Geometry height="30.0" width="159.0" x="651.0" y="320.0"/>
<y:Fill color="#FFCC99" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="102.009765625" x="28.4951171875" y="6.015625">keydetailsdialog</y:NodeLabel>
<y:Shape type="rectangle"/>
</y:ShapeNode>
</data>
</node>
<node id="n7">
<data key="d6">
<y:ShapeNode>
<y:Geometry height="30.0" width="159.0" x="462.0" y="320.0"/>
<y:Fill color="#FFCC99" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="87.63671875" x="35.681640625" y="6.015625">keygenthread</y:NodeLabel>
<y:Shape type="rectangle"/>
</y:ShapeNode>
</data>
</node>
<node id="n8">
<data key="d6">
<y:ShapeNode>
<y:Geometry height="30.0" width="154.5" x="1029.0" y="320.0"/>
<y:Fill color="#FFCC99" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="43.05859375" x="55.720703125" y="6.015625">keylist</y:NodeLabel>
<y:Shape type="rectangle"/>
</y:ShapeNode>
</data>
</node>
<node id="n9">
<data key="d6">
<y:ShapeNode>
<y:Geometry height="30.0" width="159.0" x="593.75" y="200.0"/>
<y:Fill color="#FFCC99" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="61.134765625" x="48.9326171875" y="6.015625">keymgmt</y:NodeLabel>
<y:Shape type="rectangle"/>
</y:ShapeNode>
</data>
</node>
<node id="n10">
<data key="d6">
<y:ShapeNode>
<y:Geometry height="30.0" width="159.0" x="840.0" y="320.0"/>
<y:Fill color="#FFCC99" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="143.86328125" x="7.568359375" y="6.015625">keyserverfimportdialog</y:NodeLabel>
<y:Shape type="rectangle"/>
</y:ShapeNode>
</data>
</node>
<node id="n11">
<data key="d6">
<y:ShapeNode>
<y:Geometry height="30.0" width="159.0" x="15.0" y="200.0"/>
<y:Fill color="#FFCC99" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="38.095703125" x="60.4521484375" y="6.015625">mime</y:NodeLabel>
<y:Shape type="rectangle"/>
</y:ShapeNode>
</data>
</node>
<node id="n12">
<data key="d6">
<y:ShapeNode>
<y:Geometry height="30.0" width="125.0" x="953.75" y="90.0"/>
<y:Fill color="#FFCC99" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="88.451171875" x="18.2744140625" y="6.015625">settingsdialog</y:NodeLabel>
<y:Shape type="rectangle"/>
</y:ShapeNode>
</data>
</node>
<node id="n13">
<data key="d6">
<y:ShapeNode>
<y:Geometry height="30.0" width="125.0" x="353.25" y="90.0"/>
<y:Fill color="#FFCC99" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="50.93359375" x="37.033203125" y="6.015625">textedit</y:NodeLabel>
<y:Shape type="rectangle"/>
</y:ShapeNode>
</data>
</node>
<node id="n14">
<data key="d6">
<y:ShapeNode>
<y:Geometry height="30.0" width="135.0" x="785.75" y="150.0"/>
<y:Fill color="#FFCC99" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="114.654296875" x="10.1728515625" y="6.015625">verifydetailsdialog</y:NodeLabel>
<y:Shape type="rectangle"/>
</y:ShapeNode>
</data>
</node>
<node id="n15">
<data key="d6">
<y:ShapeNode>
<y:Geometry height="30.0" width="141.0" x="782.75" y="200.0"/>
<y:Fill color="#FFCC99" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="115.298828125" x="12.8505859375" y="6.015625">verifykeydetailbox</y:NodeLabel>
<y:Shape type="rectangle"/>
</y:ShapeNode>
</data>
</node>
<node id="n16">
<data key="d6">
<y:ShapeNode>
<y:Geometry height="30.0" width="141.0" x="782.75" y="90.0"/>
<y:Fill color="#FFCC99" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="105.560546875" x="17.7197265625" y="6.015625">verifynotification</y:NodeLabel>
<y:Shape type="rectangle"/>
</y:ShapeNode>
</data>
</node>
<node id="n17">
<data key="d6">
<y:ShapeNode>
<y:Geometry height="30.0" width="135.0" x="379.5" y="150.0"/>
<y:Fill color="#FFCC99" transparent="false"/>
<y:BorderStyle color="#000000" type="line" width="1.0"/>
<y:NodeLabel alignment="center" autoSizePolicy="content" fontFamily="Dialog" fontSize="12" fontStyle="plain" hasBackgroundColor="false" hasLineColor="false" height="17.96875" modelName="internal" modelPosition="c" textColor="#000000" visible="true" width="63.859375" x="35.5703125" y="6.015625">quitdialog</y:NodeLabel>
<y:Shape type="rectangle"/>
</y:ShapeNode>
</data>
</node>
<edge id="e0" source="n0" target="n1">
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="15.0" tx="0.0" ty="-15.0"/>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="standard"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="e1" source="n1" target="n11">
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="15.0" tx="0.0" ty="-15.0"/>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="standard"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="e2" source="n6" target="n2">
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="15.0" tx="0.0" ty="-15.0"/>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="standard"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="e3" source="n7" target="n2">
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="15.0" tx="-30.0" ty="-15.0">
<y:Point x="541.5" y="365.0"/>
<y:Point x="700.5" y="365.0"/>
</y:Path>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="standard"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="e4" source="n8" target="n2">
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="15.0" tx="60.0" ty="-15.0">
<y:Point x="1106.25" y="380.0"/>
<y:Point x="790.5" y="380.0"/>
</y:Path>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="standard"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="e5" source="n9" target="n8">
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="59.625" sy="15.0" tx="-38.625" ty="-15.0">
<y:Point x="732.875" y="275.0"/>
<y:Point x="1067.625" y="275.0"/>
</y:Path>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="standard"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="e6" source="n9" target="n7">
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="-59.625" sy="15.0" tx="0.0" ty="-15.0">
<y:Point x="613.625" y="245.0"/>
<y:Point x="541.5" y="245.0"/>
</y:Path>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="standard"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="e7" source="n9" target="n6">
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="-19.875" sy="15.0" tx="0.0" ty="-15.0">
<y:Point x="653.375" y="305.0"/>
<y:Point x="730.5" y="305.0"/>
</y:Path>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="standard"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="e8" source="n9" target="n10">
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="19.875" sy="15.0" tx="-39.75" ty="-15.0">
<y:Point x="693.125" y="290.0"/>
<y:Point x="879.75" y="290.0"/>
</y:Path>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="standard"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="e9" source="n10" target="n2">
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="15.0" tx="30.0" ty="-15.0">
<y:Point x="919.5" y="365.0"/>
<y:Point x="760.5" y="365.0"/>
</y:Path>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="standard"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="e10" source="n13" target="n3">
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="-31.25" sy="15.0" tx="0.0" ty="-15.0">
<y:Point x="384.5" y="135.0"/>
<y:Point x="274.5" y="135.0"/>
</y:Path>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="standard"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="e11" source="n13" target="n17">
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="31.25" sy="15.0" tx="0.0" ty="-15.0"/>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="standard"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="e12" source="n14" target="n15">
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="15.0" tx="0.0" ty="-15.0"/>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="standard"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="e13" source="n15" target="n8">
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="35.25" sy="15.0" tx="38.625" ty="-15.0">
<y:Point x="888.5" y="245.0"/>
<y:Point x="1144.875" y="245.0"/>
</y:Path>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="standard"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="e14" source="n15" target="n10">
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="-35.25" sy="15.0" tx="39.75" ty="-15.0">
<y:Point x="818.0" y="260.0"/>
<y:Point x="959.25" y="260.0"/>
</y:Path>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="standard"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="e15" source="n16" target="n14">
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="0.0" sy="15.0" tx="0.0" ty="-15.0"/>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="standard"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="e16" source="n5" target="n0">
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="-62.5" sy="15.0" tx="0.0" ty="-15.0">
<y:Point x="565.75" y="45.0"/>
<y:Point x="94.5" y="45.0"/>
</y:Path>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="standard"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="e17" source="n5" target="n9">
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="12.5" sy="15.0" tx="0.0" ty="-15.0">
<y:Point x="640.75" y="75.0"/>
<y:Point x="673.25" y="75.0"/>
</y:Path>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="standard"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="e18" source="n5" target="n13">
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="-37.5" sy="15.0" tx="0.0" ty="-15.0">
<y:Point x="590.75" y="60.0"/>
<y:Point x="415.75" y="60.0"/>
</y:Path>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="standard"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="e19" source="n5" target="n4">
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="-12.5" sy="15.0" tx="0.0" ty="-15.0">
<y:Point x="615.75" y="75.0"/>
<y:Point x="583.25" y="75.0"/>
</y:Path>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="standard"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="e20" source="n5" target="n12">
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="62.5" sy="15.0" tx="0.0" ty="-15.0">
<y:Point x="690.75" y="45.0"/>
<y:Point x="1016.25" y="45.0"/>
</y:Path>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="standard"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
<edge id="e21" source="n5" target="n16">
<data key="d10">
<y:PolyLineEdge>
<y:Path sx="37.5" sy="15.0" tx="0.0" ty="-15.0">
<y:Point x="665.75" y="60.0"/>
<y:Point x="853.25" y="60.0"/>
</y:Path>
<y:LineStyle color="#000000" type="line" width="1.0"/>
<y:Arrows source="none" target="standard"/>
<y:BendStyle smoothed="false"/>
</y:PolyLineEdge>
</data>
</edge>
</graph>
<data key="d0">
<y:Resources/>
</data>
</graphml>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 66 KiB

View File

@ -1,3 +1,4 @@
<!DOCTYPE RCC>
<RCC> <RCC>
<qresource prefix="/"> <qresource prefix="/">
<file alias="keymgmt.png">resource/icons/keymgmt.png</file> <file alias="keymgmt.png">resource/icons/keymgmt.png</file>

1
gpgfrontend.rc Normal file
View File

@ -0,0 +1 @@
IDI_ICON1 ICON DISCARDABLE "gpgfrontend.ico"

View File

@ -17,15 +17,15 @@
#define PROJECT_NAME "GPGFrontend" #define PROJECT_NAME "GPGFrontend"
#define BUILD_VERSION "1.0.0_Windows-10.0.19042_AMD64_Debug" #define BUILD_VERSION "1.0.0_Windows-10.0.19042_AMD64_Debug"
#define GIT_VERSION "GPGFrontend__" #define GIT_VERSION "develop_8d6aad31ebdd6dcf953cba87c5e79d49e48fcf6c"
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 0 #define VERSION_MINOR 0
#define VERSION_PATCH 0 #define VERSION_PATCH 0
#define BUILD_TIMESTAMP "2021-06-18 01:49:12" #define BUILD_TIMESTAMP "2021-06-18 16:18:23"
#define GIT_BRANCH_NAME "" #define GIT_BRANCH_NAME "develop"
#define GIT_COMMIT_HASH "" #define GIT_COMMIT_HASH "8d6aad31ebdd6dcf953cba87c5e79d49e48fcf6c"
#endif //GPGFRONTEND_H_IN #endif //GPGFRONTEND_H_IN

View File

@ -352,8 +352,11 @@ private:
QAction *addPgpHeaderAct; /** Action for adding the PGP header */ QAction *addPgpHeaderAct; /** Action for adding the PGP header */
QLabel *statusBarIcon; /**< TODO */ QLabel *statusBarIcon; /**< TODO */
QSettings settings; /**< TODO */
KeyList *mKeyList; /**< TODO */ QString appPath;
QSettings settings;
KeyList *mKeyList;
InfoBoardWidget *infoBoard; InfoBoardWidget *infoBoard;
Attachments *mAttachments; /**< TODO */ Attachments *mAttachments; /**< TODO */
GpgME::GpgContext *mCtx; /**< TODO */ GpgME::GpgContext *mCtx; /**< TODO */

View File

@ -38,6 +38,10 @@ public:
void applySettings(); void applySettings();
private: private:
QString appPath;
QSettings settings;
QCheckBox *rememberPasswordCheckBox; QCheckBox *rememberPasswordCheckBox;
[[maybe_unused]] QCheckBox *importConfirmationcheckBox{}; [[maybe_unused]] QCheckBox *importConfirmationcheckBox{};
QCheckBox *saveCheckedKeysCheckBox; QCheckBox *saveCheckedKeysCheckBox;
@ -73,6 +77,10 @@ public:
void applySettings(); void applySettings();
private: private:
QString appPath;
QSettings settings;
QCheckBox *mimeParseCheckBox; QCheckBox *mimeParseCheckBox;
QCheckBox *mimeQPCheckBox; QCheckBox *mimeQPCheckBox;
QCheckBox *mimeOpenAttachmentCheckBox; QCheckBox *mimeOpenAttachmentCheckBox;
@ -95,6 +103,10 @@ public:
void applySettings(); void applySettings();
private: private:
QString appPath;
QSettings settings;
QButtonGroup *iconStyleGroup; QButtonGroup *iconStyleGroup;
QRadioButton *iconSizeSmall; QRadioButton *iconSizeSmall;
QRadioButton *iconSizeMedium; QRadioButton *iconSizeMedium;
@ -122,6 +134,10 @@ public:
void applySettings(); void applySettings();
private: private:
QString appPath;
QSettings settings;
QComboBox *comboBox; QComboBox *comboBox;
QLineEdit *newKeyServerEdit; QLineEdit *newKeyServerEdit;
@ -146,6 +162,10 @@ public:
void applySettings(); void applySettings();
private: private:
QString appPath;
QSettings settings;
QCheckBox *steganoCheckBox; QCheckBox *steganoCheckBox;
signals: signals:
@ -164,6 +184,9 @@ public:
private: private:
static QString getRelativePath(const QString& dir1, const QString& dir2); static QString getRelativePath(const QString& dir1, const QString& dir2);
QString appPath;
QSettings settings;
QString defKeydbPath; /** The default keydb path used by gpg4usb */ QString defKeydbPath; /** The default keydb path used by gpg4usb */
QString accKeydbPath; /** The currently used keydb path */ QString accKeydbPath; /** The currently used keydb path */
QLabel *keydbLabel; QLabel *keydbLabel;

View File

@ -55,6 +55,8 @@ public:
private: private:
GpgME::GpgContext *mCtx; GpgME::GpgContext *mCtx;
KeyMgmt *mKeyMgmt; KeyMgmt *mKeyMgmt;
QString appPath;
QSettings settings;
private slots: private slots:
@ -75,6 +77,10 @@ public:
[[nodiscard]] int nextId() const override; [[nodiscard]] int nextId() const override;
private:
QString appPath;
QSettings settings;
private slots: private slots:
void slotLangChange(const QString& lang); void slotLangChange(const QString& lang);
@ -114,6 +120,9 @@ private slots:
private: private:
[[nodiscard]] int nextId() const override; [[nodiscard]] int nextId() const override;
QString appPath;
QSettings settings;
KeyMgmt *mKeyMgmt; KeyMgmt *mKeyMgmt;
GpgME::GpgContext *mCtx; GpgME::GpgContext *mCtx;
QCheckBox *gpg4usbKeyCheckBox; QCheckBox *gpg4usbKeyCheckBox;

View File

@ -1,15 +0,0 @@
/* CSS for GUI, look e.g. at http://doc.qt.nokia.com/latest/stylesheet-examples.html */
/*
QLabel, QAbstractButton {
font: bold;
}
*/
*[keyNotFound="true"] { background-color: yellow }
*[keyFound="true"] { background-color: green }
QLabel#warning { background-color: #ececba }
QLabel#ok { background-color: #ccffcc }
QLabel#critical { background-color: #ff8080 }

0
resource/css/default.qss Normal file
View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -3,16 +3,36 @@ add_subdirectory(ui)
aux_source_directory(. BASE_SOURCE) aux_source_directory(. BASE_SOURCE)
file(GLOB_RECURSE GPG4USB_HEADER_FILES RELACTIVE ../include/* *.h) set(APP_ICON_RESOURCE_WINDOWS "${CMAKE_SOURCE_DIR}/gpgfrontend.rc")
qt5_wrap_cpp(QT5_MOCS ${GPG4USB_HEADER_FILES} TARGET gpgfrontend) set_property(SOURCE gpgfrontend.rc APPEND PROPERTY OBJECT_DEPENDS ${CMAKE_SOURCE_DIR}/gpgfrontend.ico)
file(GLOB_RECURSE GPGFRONTEND_HEADER_FILES RELACTIVE ${CMAKE_SOURCE_DIR}/include/*.h)
qt5_wrap_cpp(QT5_MOCS ${GPGFRONTEND_HEADER_FILES} TARGET gpgfrontend)
# Set Translation Files
file(GLOB_RECURSE QT_TS_FILES RELACTIVE ${CMAKE_SOURCE_DIR}/resource/ts/*.ts)
set(QT_QM_FILES_OUTPUT_DIR ${CMAKE_BINARY_DIR}/src/ts)
set_source_files_properties(${QT_TS_FILES} PROPERTIES OUTPUT_LOCATION ${QT_QM_FILES_OUTPUT_DIR})
QT5_create_translation(QON_QM_FILES ${BASE_SOURCE} ${QT_TS_FILES})
message(STATUS ${QON_QM_FILES})
add_custom_target(translations DEPENDS ${QON_QM_FILES})
# Set Build Information # Set Build Information
configure_file(${CMAKE_SOURCE_DIR}/include/GpgFrontend.h.in ${CMAKE_SOURCE_DIR}/include/GpgFrontend.h @ONLY) configure_file(${CMAKE_SOURCE_DIR}/include/GpgFrontend.h.in ${CMAKE_SOURCE_DIR}/include/GpgFrontend.h @ONLY)
# Copy Resource File # Copy Resource Files
file(COPY ${CMAKE_SOURCE_DIR}/resource/ DESTINATION ${EXECUTABLE_OUTPUT_PATH}/ FOLLOW_SYMLINK_CHAIN) file(COPY ${CMAKE_SOURCE_DIR}/resource/css DESTINATION ${EXECUTABLE_OUTPUT_PATH}/ FOLLOW_SYMLINK_CHAIN)
file(COPY ${CMAKE_SOURCE_DIR}/resource/icons DESTINATION ${EXECUTABLE_OUTPUT_PATH}/ FOLLOW_SYMLINK_CHAIN)
file(COPY ${CMAKE_SOURCE_DIR}/resource/help DESTINATION ${EXECUTABLE_OUTPUT_PATH}/ FOLLOW_SYMLINK_CHAIN)
file(COPY ${CMAKE_SOURCE_DIR}/resource/conf DESTINATION ${EXECUTABLE_OUTPUT_PATH}/ FOLLOW_SYMLINK_CHAIN)
add_executable(gpgfrontend ${BASE_SOURCE} ${CMAKE_SOURCE_DIR}/gpgfrontend.qrc ${QT5_MOCS}) set(RESOURCE_FILES ${CMAKE_SOURCE_DIR}/gpgfrontend.qrc ${APP_ICON_RESOURCE_WINDOWS} ${QON_QM_FILES})
add_custom_target(resources ALL DEPENDS ${RESOURCE_FILES})
add_dependencies(resources translations)
add_executable(gpgfrontend ${BASE_SOURCE} ${RESOURCE_FILES} ${QT5_MOCS})
IF (MINGW) IF (MINGW)
message(STATUS "Link Application Static Library For MINGW") message(STATUS "Link Application Static Library For MINGW")

View File

@ -24,7 +24,10 @@
#include "MainWindow.h" #include "MainWindow.h"
MainWindow::MainWindow() { MainWindow::MainWindow()
: appPath(qApp->applicationDirPath()),
settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
mCtx = new GpgME::GpgContext(); mCtx = new GpgME::GpgContext();
/* get path were app was started */ /* get path were app was started */
@ -92,8 +95,9 @@ MainWindow::MainWindow() {
// Show wizard, if the don't show wizard message box wasn't checked // Show wizard, if the don't show wizard message box wasn't checked
// and keylist doesn't contain a private key // and keylist doesn't contain a private key
QSettings qSettings; qDebug() << "wizard/showWizard" << settings.value("wizard/showWizard", true).toBool() ;
if (qSettings.value("wizard/showWizard", true).toBool() || !qSettings.value("wizard/nextPage").isNull()) { qDebug() << "wizard/nextPage" << settings.value("wizard/nextPage").isNull() ;
if (settings.value("wizard/showWizard", true).toBool() || !settings.value("wizard/nextPage").isNull()) {
slotStartWizard(); slotStartWizard();
} }
} }
@ -121,15 +125,15 @@ void MainWindow::restoreSettings() {
fileEncButton->setIconSize(iconSize); fileEncButton->setIconSize(iconSize);
// set list of keyserver if not defined // set list of keyserver if not defined
QStringList *keyServerDefaultList; QStringList *keyServerDefaultList;
keyServerDefaultList = new QStringList("http://pgp.mit.edu"); keyServerDefaultList = new QStringList("http://keys.gnupg.net");
keyServerDefaultList->append("https://keyserver.ubuntu.com");
keyServerDefaultList->append("http://pool.sks-keyservers.net"); keyServerDefaultList->append("http://pool.sks-keyservers.net");
keyServerDefaultList->append("http://subkeys.pgp.net");
QStringList keyServerList = settings.value("keyserver/keyServerList", *keyServerDefaultList).toStringList(); QStringList keyServerList = settings.value("keyserver/keyServerList", *keyServerDefaultList).toStringList();
settings.setValue("keyserver/keyServerList", keyServerList); settings.setValue("keyserver/keyServerList", keyServerList);
// set default keyserver, if it's not set // set default keyserver, if it's not set
QString defaultKeyServer = settings.value("keyserver/defaultKeyServer", QString("http://pgp.mit.edu")).toString(); QString defaultKeyServer = settings.value("keyserver/defaultKeyServer", QString("http://keys.gnupg.net")).toString();
settings.setValue("keyserver/defaultKeyServer", defaultKeyServer); settings.setValue("keyserver/defaultKeyServer", defaultKeyServer);
// Iconstyle // Iconstyle
@ -499,7 +503,7 @@ void MainWindow::createMenus() {
cryptMenu->addMenu(fileEncMenu); cryptMenu->addMenu(fileEncMenu);
keyMenu = menuBar()->addMenu(tr("&Keys")); keyMenu = menuBar()->addMenu(tr("&Keys"));
importKeyMenu = keyMenu->addMenu(tr("&Import Key From...")); importKeyMenu = keyMenu->addMenu(tr("&Import Key"));
importKeyMenu->setIcon(QIcon(":key_import.png")); importKeyMenu->setIcon(QIcon(":key_import.png"));
importKeyMenu->addAction(keyMgmt->importKeyFromFileAct); importKeyMenu->addAction(keyMgmt->importKeyFromFileAct);
importKeyMenu->addAction(importKeyFromEditAct); importKeyMenu->addAction(importKeyFromEditAct);
@ -547,7 +551,6 @@ void MainWindow::createToolBars() {
cryptToolBar->addAction(decryptVerifyAct); cryptToolBar->addAction(decryptVerifyAct);
cryptToolBar->addAction(signAct); cryptToolBar->addAction(signAct);
cryptToolBar->addAction(verifyAct); cryptToolBar->addAction(verifyAct);
//cryptToolBar->addAction(fileEncryptionAct);
viewMenu->addAction(cryptToolBar->toggleViewAction()); viewMenu->addAction(cryptToolBar->toggleViewAction());
keyToolBar = addToolBar(tr("Key")); keyToolBar = addToolBar(tr("Key"));
@ -562,10 +565,11 @@ void MainWindow::createToolBars() {
editToolBar->addAction(selectallAct); editToolBar->addAction(selectallAct);
viewMenu->addAction(editToolBar->toggleViewAction()); viewMenu->addAction(editToolBar->toggleViewAction());
specialEditToolBar = addToolBar(tr("Special edit")); specialEditToolBar = addToolBar(tr("Special Edit"));
specialEditToolBar->setObjectName("specialEditToolBar"); specialEditToolBar->setObjectName("specialEditToolBar");
specialEditToolBar->addAction(quoteAct); specialEditToolBar->addAction(quoteAct);
specialEditToolBar->addAction(cleanDoubleLinebreaksAct); specialEditToolBar->addAction(cleanDoubleLinebreaksAct);
specialEditToolBar->hide();
viewMenu->addAction(specialEditToolBar->toggleViewAction()); viewMenu->addAction(specialEditToolBar->toggleViewAction());
// Add dropdown menu for key import to keytoolbar // Add dropdown menu for key import to keytoolbar
@ -584,6 +588,7 @@ void MainWindow::createToolBars() {
fileEncButton->setIcon(QIcon(":fileencryption.png")); fileEncButton->setIcon(QIcon(":fileencryption.png"));
fileEncButton->setToolTip(tr("Encrypt or decrypt File")); fileEncButton->setToolTip(tr("Encrypt or decrypt File"));
fileEncButton->setText(tr("File..")); fileEncButton->setText(tr("File.."));
fileEncButton->hide();
cryptToolBar->addWidget(fileEncButton); cryptToolBar->addWidget(fileEncButton);
@ -990,41 +995,47 @@ void MainWindow::slotOpenSettingsDialog() {
QString preLang = settings.value("int/lang").toString(); QString preLang = settings.value("int/lang").toString();
QString preKeydbPath = settings.value("gpgpaths/keydbpath").toString(); QString preKeydbPath = settings.value("gpgpaths/keydbpath").toString();
new SettingsDialog(mCtx, this); auto dialog = new SettingsDialog(mCtx, this);
// Iconsize
QSize iconSize = settings.value("toolbar/iconsize", QSize(32, 32)).toSize();
this->setIconSize(iconSize);
importButton->setIconSize(iconSize);
fileEncButton->setIconSize(iconSize);
// Iconstyle connect(dialog, &SettingsDialog::finished, this, [&] () -> void {
Qt::ToolButtonStyle buttonStyle = static_cast<Qt::ToolButtonStyle>(settings.value("toolbar/iconstyle",
Qt::ToolButtonTextUnderIcon).toUInt());
this->setToolButtonStyle(buttonStyle);
importButton->setToolButtonStyle(buttonStyle);
fileEncButton->setToolButtonStyle(buttonStyle);
// Mime-settings qDebug() << "Setting Dialog Finished";
if (settings.value("mime/parseMime").toBool()) {
createAttachmentDock();
} else if (attachmentDockCreated) {
closeAttachmentDock();
}
// restart mainwindow if necessary // Iconsize
if (getRestartNeeded()) { QSize iconSize = settings.value("toolbar/iconsize", QSize(32, 32)).toSize();
if (edit->maybeSaveAnyTab()) { this->setIconSize(iconSize);
saveSettings(); importButton->setIconSize(iconSize);
qApp->exit(RESTART_CODE); fileEncButton->setIconSize(iconSize);
// Iconstyle
Qt::ToolButtonStyle buttonStyle = static_cast<Qt::ToolButtonStyle>(settings.value("toolbar/iconstyle",
Qt::ToolButtonTextUnderIcon).toUInt());
this->setToolButtonStyle(buttonStyle);
importButton->setToolButtonStyle(buttonStyle);
fileEncButton->setToolButtonStyle(buttonStyle);
// Mime-settings
if (settings.value("mime/parseMime").toBool()) {
createAttachmentDock();
} else if (attachmentDockCreated) {
closeAttachmentDock();
} }
}
// steganography hide/show // restart mainwindow if necessary
if (!settings.value("advanced/steganography").toBool()) { if (getRestartNeeded()) {
this->menuBar()->removeAction(steganoMenu->menuAction()); if (edit->maybeSaveAnyTab()) {
} else { saveSettings();
this->menuBar()->insertAction(viewMenu->menuAction(), steganoMenu->menuAction()); qApp->exit(RESTART_CODE);
} }
}
// steganography hide/show
if (!settings.value("advanced/steganography").toBool()) {
this->menuBar()->removeAction(steganoMenu->menuAction());
} else {
this->menuBar()->insertAction(viewMenu->menuAction(), steganoMenu->menuAction());
}
});
} }

View File

@ -43,7 +43,7 @@ int main(int argc, char *argv[]) {
QTextCodec::setCodecForLocale(QTextCodec::codecForName("utf-8")); QTextCodec::setCodecForLocale(QTextCodec::codecForName("utf-8"));
// css // css
QFile file(qApp->applicationDirPath() + "/css/default.css"); QFile file(qApp->applicationDirPath() + "/css/default.qss");
file.open(QFile::ReadOnly); file.open(QFile::ReadOnly);
QString styleSheet = QLatin1String(file.readAll()); QString styleSheet = QLatin1String(file.readAll());
qApp->setStyleSheet(styleSheet); qApp->setStyleSheet(styleSheet);
@ -53,11 +53,16 @@ int main(int argc, char *argv[]) {
* internationalisation. loop to restart mainwindow * internationalisation. loop to restart mainwindow
* with changed translation when settings change. * with changed translation when settings change.
*/ */
if(!QDir(appPath + "/conf").exists()) {
QDir().mkdir(appPath + "/conf");
}
QSettings::setDefaultFormat(QSettings::IniFormat); QSettings::setDefaultFormat(QSettings::IniFormat);
QSettings settings; QSettings settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat);
QTranslator translator, translator2; QTranslator translator, translator2;
int return_from_event_loop_code; int return_from_event_loop_code;
qDebug() << settings.fileName();
do { do {
QApplication::removeTranslator(&translator); QApplication::removeTranslator(&translator);
QApplication::removeTranslator(&translator2); QApplication::removeTranslator(&translator2);
@ -66,12 +71,14 @@ int main(int argc, char *argv[]) {
if (lang.isEmpty()) { if (lang.isEmpty()) {
lang = QLocale::system().name(); lang = QLocale::system().name();
} }
qDebug() << "Language set" << lang;
translator.load("./ts/gpg4usb_" + lang, appPath); translator.load( appPath + "/ts/" + "gpg4usb_" + lang);
qDebug() << "Translator" << translator.filePath();
QApplication::installTranslator(&translator); QApplication::installTranslator(&translator);
// set qt translations // set qt translations
translator2.load("./ts/qt_" + lang, appPath); translator2.load("./ts/qt_" + lang, appPath);
qDebug() << "Translator2" << translator2.filePath();
QApplication::installTranslator(&translator2); QApplication::installTranslator(&translator2);
MainWindow window; MainWindow window;

View File

@ -49,19 +49,22 @@ AboutDialog::AboutDialog(QWidget *parent)
InfoTab::InfoTab(QWidget *parent) InfoTab::InfoTab(QWidget *parent)
: QWidget(parent) { : QWidget(parent) {
auto *pixmap = new QPixmap(":gpgfrontend-logo.png"); auto *pixmap = new QPixmap(":gpgfrontend-logo.png");
auto *text = new QString("<center><h2>" + qApp->applicationName() + " " auto *text = new QString("<center><h2>" + qApp->applicationName() + "</h2></center>"
+ qApp->applicationVersion() + "</h2></center>" + "<center><b>" + qApp->applicationVersion() + "</b></center>"
+ tr("<center>This application allows simple encryption <br>" + "<center>" + GIT_VERSION + "</center>"
"and decryption of text messages or files.<br>" + tr("<br><center>GPGFrontend is a modern, easy-to-use, compact, <br>"
"It's licensed under the GPL v3<br><br>" "cross-platform, and installation-free gpg front-end tool.<br>"
"<b>Developer:</b><br>" "It visualizes most of the common operations of gpg commands.<br>"
"Saturneric<br><br>" "It's licensed under the GPL v3<br><br>"
"If you have any questions or suggestions have a look<br/>" "<b>Developer:</b><br>"
"at my <a href=\"https://bktus.com/%e8%81%94%e7%b3%bb%e4%b8%8e%e9%aa%8c%e8%af%81\">" "Saturneric<br><br>"
"contact page</a> or send a mail to my<br/> mailing list at" "If you have any questions or suggestions have a look<br/>"
" <a href=\"mailto:eric@bktus.com\">eric@bktus.com</a>.") + "at my <a href=\"https://bktus.com/%e8%81%94%e7%b3%bb%e4%b8%8e%e9%aa%8c%e8%af%81\">"
tr("<br><br> Built with Qt ") + qVersion() "contact page</a> or send a mail to my<br/> mailing list at"
+ tr(" and GPGME ") + GpgME::GpgContext::getGpgmeVersion() + "</center>"); " <a href=\"mailto:eric@bktus.com\">eric@bktus.com</a>.") +
tr("<br><br> Built with Qt ") + qVersion()
+ tr(" and GPGME ") + GpgME::GpgContext::getGpgmeVersion() +
tr("<br>Built at ") + BUILD_TIMESTAMP + "</center>");
auto *layout = new QGridLayout(); auto *layout = new QGridLayout();
auto *pixmapLabel = new QLabel(); auto *pixmapLabel = new QLabel();

View File

@ -121,7 +121,8 @@ QHash<QString, QString> SettingsDialog::listLanguages() {
GeneralTab::GeneralTab(GpgME::GpgContext *ctx, QWidget *parent) GeneralTab::GeneralTab(GpgME::GpgContext *ctx, QWidget *parent)
: QWidget(parent) { : QWidget(parent), appPath(qApp->applicationDirPath()),
settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
mCtx = ctx; mCtx = ctx;
/***************************************** /*****************************************
@ -225,7 +226,6 @@ GeneralTab::GeneralTab(GpgME::GpgContext *ctx, QWidget *parent)
* appropriately * appropriately
**********************************/ **********************************/
void GeneralTab::setSettings() { void GeneralTab::setSettings() {
QSettings settings;
// Keysaving // Keysaving
if (settings.value("keys/keySave").toBool()) { if (settings.value("keys/keySave").toBool()) {
saveCheckedKeysCheckBox->setCheckState(Qt::Checked); saveCheckedKeysCheckBox->setCheckState(Qt::Checked);
@ -276,7 +276,6 @@ void GeneralTab::setSettings() {
* write them to settings-file * write them to settings-file
*************************************/ *************************************/
void GeneralTab::applySettings() { void GeneralTab::applySettings() {
QSettings settings;
settings.setValue("keys/keySave", saveCheckedKeysCheckBox->isChecked()); settings.setValue("keys/keySave", saveCheckedKeysCheckBox->isChecked());
// TODO: clear passwordCache instantly on unset rememberPassword // TODO: clear passwordCache instantly on unset rememberPassword
settings.setValue("general/rememberPassword", rememberPasswordCheckBox->isChecked()); settings.setValue("general/rememberPassword", rememberPasswordCheckBox->isChecked());
@ -333,7 +332,8 @@ void GeneralTab::slotOwnKeyIdChanged() {
} }
MimeTab::MimeTab(QWidget *parent) MimeTab::MimeTab(QWidget *parent)
: QWidget(parent) { : QWidget(parent), appPath(qApp->applicationDirPath()),
settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
/***************************************** /*****************************************
* MIME-Parsing-Box * MIME-Parsing-Box
*****************************************/ *****************************************/
@ -379,7 +379,6 @@ MimeTab::MimeTab(QWidget *parent)
* appropriately * appropriately
**********************************/ **********************************/
void MimeTab::setSettings() { void MimeTab::setSettings() {
QSettings settings;
// MIME-Parsing // MIME-Parsing
if (settings.value("mime/parsemime").toBool()) mimeParseCheckBox->setCheckState(Qt::Checked); if (settings.value("mime/parsemime").toBool()) mimeParseCheckBox->setCheckState(Qt::Checked);
@ -397,7 +396,6 @@ void MimeTab::setSettings() {
* write them to settings-file * write them to settings-file
*************************************/ *************************************/
void MimeTab::applySettings() { void MimeTab::applySettings() {
QSettings settings;
settings.setValue("mime/parsemime", mimeParseCheckBox->isChecked()); settings.setValue("mime/parsemime", mimeParseCheckBox->isChecked());
settings.setValue("mime/parseQP", mimeQPCheckBox->isChecked()); settings.setValue("mime/parseQP", mimeQPCheckBox->isChecked());
settings.setValue("mime/openAttachment", mimeOpenAttachmentCheckBox->isChecked()); settings.setValue("mime/openAttachment", mimeOpenAttachmentCheckBox->isChecked());
@ -405,7 +403,8 @@ void MimeTab::applySettings() {
} }
AppearanceTab::AppearanceTab(QWidget *parent) AppearanceTab::AppearanceTab(QWidget *parent)
: QWidget(parent) { : QWidget(parent), appPath(qApp->applicationDirPath()),
settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
/***************************************** /*****************************************
* Icon-Size-Box * Icon-Size-Box
*****************************************/ *****************************************/
@ -470,7 +469,6 @@ AppearanceTab::AppearanceTab(QWidget *parent)
* appropriately * appropriately
**********************************/ **********************************/
void AppearanceTab::setSettings() { void AppearanceTab::setSettings() {
QSettings settings;
//Iconsize //Iconsize
QSize iconSize = settings.value("toolbar/iconsize", QSize(24, 24)).toSize(); QSize iconSize = settings.value("toolbar/iconsize", QSize(24, 24)).toSize();
@ -512,7 +510,6 @@ void AppearanceTab::setSettings() {
* write them to settings-file * write them to settings-file
*************************************/ *************************************/
void AppearanceTab::applySettings() { void AppearanceTab::applySettings() {
QSettings settings;
switch (iconSizeGroup->checkedId()) { switch (iconSizeGroup->checkedId()) {
case 1: case 1:
settings.setValue("toolbar/iconsize", QSize(12, 12)); settings.setValue("toolbar/iconsize", QSize(12, 12));
@ -541,7 +538,11 @@ void AppearanceTab::applySettings() {
} }
KeyserverTab::KeyserverTab(QWidget *parent) KeyserverTab::KeyserverTab(QWidget *parent)
: QWidget(parent) { : QWidget(parent), appPath(qApp->applicationDirPath()),
settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
auto keyServerList = settings.value("keyserver/keyServerList").toStringList();
auto *mainLayout = new QVBoxLayout(this); auto *mainLayout = new QVBoxLayout(this);
auto *label = new QLabel(tr("Default Keyserver for import:")); auto *label = new QLabel(tr("Default Keyserver for import:"));
@ -549,6 +550,13 @@ KeyserverTab::KeyserverTab(QWidget *parent)
comboBox->setEditable(false); comboBox->setEditable(false);
comboBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); comboBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
for (const auto &keyServer : keyServerList) {
comboBox->addItem(keyServer);
qDebug() << "KeyserverTab Get ListItemText" << keyServer;
}
comboBox->setCurrentText(settings.value("keyserver/defaultKeyServer").toString());
auto *addKeyServerBox = new QWidget(this); auto *addKeyServerBox = new QWidget(this);
auto *addKeyServerLayout = new QHBoxLayout(addKeyServerBox); auto *addKeyServerLayout = new QHBoxLayout(addKeyServerBox);
auto *http = new QLabel("URL: "); auto *http = new QLabel("URL: ");
@ -575,14 +583,13 @@ KeyserverTab::KeyserverTab(QWidget *parent)
* appropriately * appropriately
**********************************/ **********************************/
void KeyserverTab::setSettings() { void KeyserverTab::setSettings() {
QSettings settings;
QString defKeyserver = settings.value("keyserver/defaultKeyServer").toString();
auto *keyServerList = new QStringList(); auto *keyServerList = new QStringList();
for (int i = 0; i < comboBox->count(); i++) { for (int i = 0; i < comboBox->count(); i++) {
keyServerList->append(comboBox->itemText(i)); keyServerList->append(comboBox->itemText(i));
qDebug() << "KeyserverTab ListItemText" << comboBox->itemText(i);
} }
settings.setValue("keyserver/keyServerList", *keyServerList); settings.setValue("keyserver/keyServerList", *keyServerList);
settings.setValue("keyserver/defaultKeyServer", comboBox->currentText());
} }
void KeyserverTab::addKeyServer() { void KeyserverTab::addKeyServer() {
@ -599,12 +606,12 @@ void KeyserverTab::addKeyServer() {
* write them to settings-file * write them to settings-file
*************************************/ *************************************/
void KeyserverTab::applySettings() { void KeyserverTab::applySettings() {
QSettings settings;
settings.setValue("keyserver/defaultKeyServer", comboBox->currentText()); settings.setValue("keyserver/defaultKeyServer", comboBox->currentText());
} }
AdvancedTab::AdvancedTab(QWidget *parent) AdvancedTab::AdvancedTab(QWidget *parent)
: QWidget(parent) { : QWidget(parent), appPath(qApp->applicationDirPath()),
settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
/***************************************** /*****************************************
* Steganography Box * Steganography Box
*****************************************/ *****************************************/
@ -623,19 +630,18 @@ AdvancedTab::AdvancedTab(QWidget *parent)
} }
void AdvancedTab::setSettings() { void AdvancedTab::setSettings() {
QSettings settings;
if (settings.value("advanced/steganography").toBool()) { if (settings.value("advanced/steganography").toBool()) {
steganoCheckBox->setCheckState(Qt::Checked); steganoCheckBox->setCheckState(Qt::Checked);
} }
} }
void AdvancedTab::applySettings() { void AdvancedTab::applySettings() {
QSettings settings;
settings.setValue("advanced/steganography", steganoCheckBox->isChecked()); settings.setValue("advanced/steganography", steganoCheckBox->isChecked());
} }
GpgPathsTab::GpgPathsTab(QWidget *parent) GpgPathsTab::GpgPathsTab(QWidget *parent)
: QWidget(parent) { : QWidget(parent), appPath(qApp->applicationDirPath()),
settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
setSettings(); setSettings();
/***************************************** /*****************************************
@ -696,7 +702,6 @@ QString GpgPathsTab::chooseKeydbDir() {
void GpgPathsTab::setSettings() { void GpgPathsTab::setSettings() {
defKeydbPath = qApp->applicationDirPath() + "/keydb"; defKeydbPath = qApp->applicationDirPath() + "/keydb";
QSettings settings;
accKeydbPath = settings.value("gpgpaths/keydbpath").toString(); accKeydbPath = settings.value("gpgpaths/keydbpath").toString();
if (accKeydbPath.isEmpty()) { if (accKeydbPath.isEmpty()) {
accKeydbPath = "."; accKeydbPath = ".";
@ -704,6 +709,5 @@ void GpgPathsTab::setSettings() {
} }
void GpgPathsTab::applySettings() { void GpgPathsTab::applySettings() {
QSettings settings;
settings.setValue("gpgpaths/keydbpath", accKeydbPath); settings.setValue("gpgpaths/keydbpath", accKeydbPath);
} }

View File

@ -29,7 +29,8 @@
#endif #endif
Wizard::Wizard(GpgME::GpgContext *ctx, KeyMgmt *keyMgmt, QWidget *parent) Wizard::Wizard(GpgME::GpgContext *ctx, KeyMgmt *keyMgmt, QWidget *parent)
: QWizard(parent) { : QWizard(parent), appPath(qApp->applicationDirPath()),
settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
mCtx = ctx; mCtx = ctx;
mKeyMgmt = keyMgmt; mKeyMgmt = keyMgmt;
@ -49,7 +50,6 @@ Wizard::Wizard(GpgME::GpgContext *ctx, KeyMgmt *keyMgmt, QWidget *parent)
setPixmap(QWizard::LogoPixmap, QPixmap(":/logo_small.png")); setPixmap(QWizard::LogoPixmap, QPixmap(":/logo_small.png"));
setPixmap(QWizard::BannerPixmap, QPixmap(":/banner.png")); setPixmap(QWizard::BannerPixmap, QPixmap(":/banner.png"));
QSettings settings;
setStartId(settings.value("wizard/nextPage", -1).toInt()); setStartId(settings.value("wizard/nextPage", -1).toInt());
settings.remove("wizard/nextPage"); settings.remove("wizard/nextPage");
@ -59,7 +59,6 @@ Wizard::Wizard(GpgME::GpgContext *ctx, KeyMgmt *keyMgmt, QWidget *parent)
} }
void Wizard::slotWizardAccepted() { void Wizard::slotWizardAccepted() {
QSettings settings;
// Don't show is mapped to show -> negation // Don't show is mapped to show -> negation
settings.setValue("wizard/showWizard", !field("showWizard").toBool()); settings.setValue("wizard/showWizard", !field("showWizard").toBool());
@ -107,7 +106,8 @@ bool Wizard::importPubAndSecKeysFromDir(const QString &dir, KeyMgmt *keyMgmt) {
} }
IntroPage::IntroPage(QWidget *parent) IntroPage::IntroPage(QWidget *parent)
: QWizardPage(parent) { : QWizardPage(parent), appPath(qApp->applicationDirPath()),
settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
setTitle(tr("Getting started...")); setTitle(tr("Getting started..."));
setSubTitle(tr("... with GPGFrontend")); setSubTitle(tr("... with GPGFrontend"));
@ -130,7 +130,6 @@ IntroPage::IntroPage(QWidget *parent)
langSelectBox->addItem(l); langSelectBox->addItem(l);
} }
// selected entry from config // selected entry from config
QSettings settings;
QString langKey = settings.value("int/lang").toString(); QString langKey = settings.value("int/lang").toString();
QString langValue = languages.value(langKey); QString langValue = languages.value(langKey);
if (langKey != "") { if (langKey != "") {
@ -148,7 +147,6 @@ IntroPage::IntroPage(QWidget *parent)
} }
void IntroPage::slotLangChange(const QString &lang) { void IntroPage::slotLangChange(const QString &lang) {
QSettings settings;
settings.setValue("int/lang", languages.key(lang)); settings.setValue("int/lang", languages.key(lang));
settings.setValue("wizard/nextPage", this->wizard()->currentId()); settings.setValue("wizard/nextPage", this->wizard()->currentId());
qApp->exit(RESTART_CODE); qApp->exit(RESTART_CODE);
@ -203,7 +201,8 @@ void ChoosePage::slotJumpPage(const QString &page) {
} }
ImportFromGpg4usbPage::ImportFromGpg4usbPage(GpgME::GpgContext *ctx, KeyMgmt *keyMgmt, QWidget *parent) ImportFromGpg4usbPage::ImportFromGpg4usbPage(GpgME::GpgContext *ctx, KeyMgmt *keyMgmt, QWidget *parent)
: QWizardPage(parent) { : QWizardPage(parent), appPath(qApp->applicationDirPath()),
settings(appPath + "/conf/gpgfrontend.ini", QSettings::IniFormat) {
mCtx = ctx; mCtx = ctx;
mKeyMgmt = keyMgmt; mKeyMgmt = keyMgmt;
setTitle(tr("Import from...")); setTitle(tr("Import from..."));
@ -255,7 +254,6 @@ void ImportFromGpg4usbPage::slotImportFromOlderGpg4usb() {
if (gpg4usbConfigCheckBox->isChecked()) { if (gpg4usbConfigCheckBox->isChecked()) {
slotImportConfFromGpg4usb(dir); slotImportConfFromGpg4usb(dir);
QSettings settings;
settings.setValue("wizard/nextPage", this->nextId()); settings.setValue("wizard/nextPage", this->nextId());
QMessageBox::information(nullptr, tr("Configuration Imported"), QMessageBox::information(nullptr, tr("Configuration Imported"),
tr("Imported Configuration from old GPGFrontend.<br>" tr("Imported Configuration from old GPGFrontend.<br>"
@ -267,7 +265,7 @@ void ImportFromGpg4usbPage::slotImportFromOlderGpg4usb() {
} }
bool ImportFromGpg4usbPage::slotImportConfFromGpg4usb(const QString &dir) { bool ImportFromGpg4usbPage::slotImportConfFromGpg4usb(const QString &dir) {
QString path = dir + "/conf/GPGFrontend.ini"; QString path = dir + "/conf/gpgfrontend.ini";
QSettings oldconf(path, QSettings::IniFormat, this); QSettings oldconf(path, QSettings::IniFormat, this);
QSettings actualConf; QSettings actualConf;
foreach(QString key, oldconf.allKeys()) { foreach(QString key, oldconf.allKeys()) {