summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElvis Angelaccio <elvis.angelaccio@kde.org>2016-11-17 15:06:01 (GMT)
committerElvis Angelaccio <elvis.angelaccio@kde.org>2016-11-17 15:08:04 (GMT)
commit1caeff2b888dbff865bd8c879e21b10f10aec940 (patch)
tree2397807a58de521865c38f1cba1e77011fb7924d
parent9e49ae1e14cf8e9eeeabe1ca5fadcb5b31220729 (diff)
Add option to disable AES encryption warning
The new option is available in a new General Settings page in the settings dialog. This paves the way for moving the radiobuttons currently in the Preview page. CCBUG: 357658 Differential Revision: D3380
-rw-r--r--kerfuffle/CMakeLists.txt2
-rw-r--r--kerfuffle/ark.kcfg6
-rw-r--r--kerfuffle/compressionoptionswidget.cpp3
-rw-r--r--kerfuffle/generalsettings.ui41
-rw-r--r--kerfuffle/generalsettingspage.cpp38
-rw-r--r--kerfuffle/generalsettingspage.h45
-rw-r--r--part/part.cpp2
7 files changed, 136 insertions, 1 deletions
diff --git a/kerfuffle/CMakeLists.txt b/kerfuffle/CMakeLists.txt
index 663e2ef..214dc33 100644
--- a/kerfuffle/CMakeLists.txt
+++ b/kerfuffle/CMakeLists.txt
@@ -5,6 +5,7 @@ set(kerfuffle_SRCS
archive_kerfuffle.cpp
archiveinterface.cpp
extractionsettingspage.cpp
+ generalsettingspage.cpp
previewsettingspage.cpp
settingspage.cpp
jobs.cpp
@@ -30,6 +31,7 @@ ki18n_wrap_ui(kerfuffle_SRCS
createdialog.ui
extractiondialog.ui
extractionsettings.ui
+ generalsettings.ui
previewsettings.ui
propertiesdialog.ui
compressionoptionswidget.ui
diff --git a/kerfuffle/ark.kcfg b/kerfuffle/ark.kcfg
index 9e2ae8b..2e8d2f4 100644
--- a/kerfuffle/ark.kcfg
+++ b/kerfuffle/ark.kcfg
@@ -4,6 +4,12 @@
xsi:schemaLocation="http://www.kde.org/standards/kcfg/1.0
http://www.kde.org/standards/kcfg/1.0/kcfg.xsd" >
<kcfgfile name="arkrc"/>
+ <group name="General">
+ <entry name="showEncryptionWarning" type="Bool">
+ <label>Whether to show a warning when creating zip archives with AES encryption.</label>
+ <default>true</default>
+ </entry>
+ </group>
<group name="Extraction">
<entry name="openDestinationFolderAfterExtraction" type="Bool">
<label>Open destination folder after extraction.</label>
diff --git a/kerfuffle/compressionoptionswidget.cpp b/kerfuffle/compressionoptionswidget.cpp
index 56e35a8..dad86f8 100644
--- a/kerfuffle/compressionoptionswidget.cpp
+++ b/kerfuffle/compressionoptionswidget.cpp
@@ -29,6 +29,7 @@
#include "ark_debug.h"
#include "archiveformat.h"
#include "pluginmanager.h"
+#include "settings.h"
#include <KColorScheme>
#include <KPluginMetaData>
@@ -292,7 +293,7 @@ void CompressionOptionsWidget::slotEncryptionMethodChanged(const QString &value)
}
// AES encryption is not supported by unzip, warn the users if they are creating a zip.
- warningMsgWidget->setVisible(value != QLatin1String("ZipCrypto"));
+ warningMsgWidget->setVisible(value != QLatin1String("ZipCrypto") && ArkSettings::showEncryptionWarning());
}
}
diff --git a/kerfuffle/generalsettings.ui b/kerfuffle/generalsettings.ui
new file mode 100644
index 0000000..7cdd529
--- /dev/null
+++ b/kerfuffle/generalsettings.ui
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>GeneralSettings</class>
+ <widget class="QWidget" name="GeneralSettings">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>547</width>
+ <height>487</height>
+ </rect>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QCheckBox" name="kcfg_showEncryptionWarning">
+ <property name="text">
+ <string>Show a warning when creating zip archives with AES encryption</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="verticalSpacer">
+ <property name="orientation">
+ <enum>Qt::Vertical</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>20</width>
+ <height>40</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
diff --git a/kerfuffle/generalsettingspage.cpp b/kerfuffle/generalsettingspage.cpp
new file mode 100644
index 0000000..ea76b88
--- /dev/null
+++ b/kerfuffle/generalsettingspage.cpp
@@ -0,0 +1,38 @@
+/*
+ * ark -- archiver for the KDE project
+ *
+ * Copyright (C) 2016 Elvis Angelaccio <elvis.angelaccio@kde.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ( INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "generalsettingspage.h"
+
+namespace Kerfuffle
+{
+GeneralSettingsPage::GeneralSettingsPage(QWidget *parent, const QString &name, const QString &iconName)
+ : SettingsPage(parent, name, iconName)
+{
+ setupUi(this);
+}
+}
+
diff --git a/kerfuffle/generalsettingspage.h b/kerfuffle/generalsettingspage.h
new file mode 100644
index 0000000..1089042
--- /dev/null
+++ b/kerfuffle/generalsettingspage.h
@@ -0,0 +1,45 @@
+/*
+ * ark -- archiver for the KDE project
+ *
+ * Copyright (C) 2016 Elvis Angelaccio <elvis.angelaccio@kde.org>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES ( INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION ) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * ( INCLUDING NEGLIGENCE OR OTHERWISE ) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef GENERALSETTINGSPAGE_H
+#define GENERALSETTINGSPAGE_H
+
+#include "settingspage.h"
+#include "ui_generalsettings.h"
+
+namespace Kerfuffle
+{
+class KERFUFFLE_EXPORT GeneralSettingsPage : public SettingsPage, public Ui::GeneralSettings
+{
+ Q_OBJECT
+
+public:
+ explicit GeneralSettingsPage(QWidget *parent = 0, const QString &name = QString(), const QString &iconName = QString());
+};
+}
+
+#endif
diff --git a/part/part.cpp b/part/part.cpp
index 6e22a45..3906d7d 100644
--- a/part/part.cpp
+++ b/part/part.cpp
@@ -33,6 +33,7 @@
#include "dnddbusinterfaceadaptor.h"
#include "infopanel.h"
#include "jobtracker.h"
+#include "generalsettingspage.h"
#include "kerfuffle/extractiondialog.h"
#include "kerfuffle/extractionsettingspage.h"
#include "kerfuffle/jobs.h"
@@ -741,6 +742,7 @@ KConfigSkeleton *Part::config() const
QList<Kerfuffle::SettingsPage*> Part::settingsPages(QWidget *parent) const
{
QList<SettingsPage*> pages;
+ pages.append(new GeneralSettingsPage(parent, i18nc("@title:tab", "General Settings"), QStringLiteral("go-home")));
pages.append(new ExtractionSettingsPage(parent, i18nc("@title:tab", "Extraction Settings"), QStringLiteral("archive-extract")));
pages.append(new PreviewSettingsPage(parent, i18nc("@title:tab", "Preview Settings"), QStringLiteral("document-preview-archive")));