aboutsummaryrefslogtreecommitdiffstats
path: root/src/gpg/GpgCoreInit.cpp
diff options
context:
space:
mode:
authorSaturneric <[email protected]>2022-01-02 03:40:22 +0000
committerSaturneric <[email protected]>2022-01-02 03:40:22 +0000
commita056f2186de2470d4328bd1cd682e5e484af4587 (patch)
tree27775ca169ad93fc812e94a4da99ebd3fa1c53f9 /src/gpg/GpgCoreInit.cpp
parent<refactor, test>(core, test): test decryption when key not found (diff)
downloadGpgFrontend-a056f2186de2470d4328bd1cd682e5e484af4587.tar.gz
GpgFrontend-a056f2186de2470d4328bd1cd682e5e484af4587.zip
<refactor, fixed, test>(core, ui): add & modify core and ui
1. add init functions for core. 2. add non ascii settings. 3. fit ui with this version of core.
Diffstat (limited to 'src/gpg/GpgCoreInit.cpp')
-rw-r--r--src/gpg/GpgCoreInit.cpp52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/gpg/GpgCoreInit.cpp b/src/gpg/GpgCoreInit.cpp
new file mode 100644
index 00000000..3f07d2b1
--- /dev/null
+++ b/src/gpg/GpgCoreInit.cpp
@@ -0,0 +1,52 @@
+/**
+ * This file is part of GpgFrontend.
+ *
+ * GpgFrontend is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * Foobar is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Foobar. If not, see <https://www.gnu.org/licenses/>.
+ *
+ * The initial version of the source code is inherited from gpg4usb-team.
+ * Their source code version also complies with GNU General Public License.
+ *
+ * The source code version of this software was modified and released
+ * by Saturneric<[email protected]> starting on May 12, 2021.
+ *
+ */
+
+#include "GpgCoreInit.h"
+
+#include "GpgContext.h"
+
+void GpgFrontend::init_gpgfrontend_core() {
+ GpgFrontend::GpgContext::CreateInstance(
+ GPGFRONTEND_DEFAULT_CHANNEL,
+ [&]() -> std::unique_ptr<GpgFrontend::GpgContext> {
+ GpgFrontend::GpgContextInitArgs args;
+ return std::make_unique<GpgFrontend::GpgContext>(args);
+ });
+
+ GpgFrontend::GpgContext::CreateInstance(
+ GPGFRONTEND_NON_ASCII_CHANNEL,
+ [&]() -> std::unique_ptr<GpgFrontend::GpgContext> {
+ GpgFrontend::GpgContextInitArgs args;
+ args.ascii = false;
+ return std::make_unique<GpgFrontend::GpgContext>(args);
+ });
+}
+
+void GpgFrontend::new_default_settings_channel(int channel) {
+ GpgFrontend::GpgContext::CreateInstance(
+ channel, [&]() -> std::unique_ptr<GpgFrontend::GpgContext> {
+ GpgFrontend::GpgContextInitArgs args;
+ return std::make_unique<GpgFrontend::GpgContext>(args);
+ });
+} \ No newline at end of file