Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Add initial version of a notepad

The notepad offers a Text Area to work with Text mode encryption /
decryption. For now we only support OpenPGP.
S/MIME might be added later but it's not so common to send "no-mime"
messages with S/MIME.

Maniphest Tasks: T2040
parent 35cee091
......@@ -97,6 +97,7 @@ set(_kleopatra_SRCS
view/keytreeview.cpp
view/searchbar.cpp
view/smartcardwidget.cpp
view/padwidget.cpp
view/pgpcardwidget.cpp
view/netkeywidget.cpp
view/nullpinwidget.cpp
......
<!DOCTYPE gui >
<gui name="kleopatra" version="501" >
<gui name="kleopatra" version="502" >
<MenuBar>
<Menu name="file">
<text>&amp;File</text>
......@@ -33,6 +33,8 @@
<Separator/>
<Action name="window_expand_all"/>
<Action name="window_collapse_all"/>
<Separator/>
<Action name="pad_view"/>
</Menu>
<Menu name="certMenu">
<text>&amp;Certificates</text>
......@@ -58,6 +60,8 @@
<Separator/>
<Action name="manage_smartcard"/>
<Separator/>
<Action name="clipboard_menu"/>
<Separator/>
<Action name="crl_import_crl"/>
<Separator/>
<Action name="crl_clear_crl_cache"/>
......@@ -97,7 +101,8 @@
<Action name="certificates_certify_certificate"/>
<Action name="file_lookup_certificates"/>
<Separator/>
<Action name="clipboard_menu"/>
<Action name="pad_view"/>
<Separator/>
</ToolBar>
<Menu name="listview_popup">
......
......@@ -35,6 +35,7 @@
#include "mainwindow.h"
#include "aboutdata.h"
#include "view/padwidget.h"
#include "view/searchbar.h"
#include "view/tabwidget.h"
#include "view/keylistcontroller.h"
......@@ -264,6 +265,8 @@ public:
}
}
void togglePadView();
private:
void setupActions();
......@@ -274,7 +277,7 @@ private:
void checkWelcomePage()
{
if (ui.scWidget->isVisible()) {
if (ui.scWidget->isVisible() || ui.padWidget->isVisible()) {
return;
}
if (KeyCache::instance()->keys().empty()) {
......@@ -295,6 +298,7 @@ private:
TabWidget tabWidget;
SearchBar *searchBar;
PadWidget *padWidget;
SmartCardWidget *scWidget;
WelcomeWidget *welcomeWidget;
explicit UI(MainWindow *q);
......@@ -326,6 +330,10 @@ MainWindow::Private::UI::UI(MainWindow *q)
vbox->addWidget(welcomeWidget);
welcomeWidget->hide();
padWidget = new PadWidget();
vbox->addWidget(padWidget);
padWidget->hide();
q->setCentralWidget(mainWidget);
}
......@@ -403,6 +411,10 @@ void MainWindow::Private::setupActions()
"gpg4win-compact", q, SLOT(openCompendium()), QString(), false, true
},
#endif
{
"pad_view", i18nc("Title for a generic data input / output area supporting text actions.", "Notepad"),
i18n("Switch to Pad view."), "edittext", q, SLOT(togglePadView()), QString(), true, true
},
// most have been MOVED TO keylistcontroller.cpp
#if 0
{
......@@ -484,6 +496,20 @@ void MainWindow::Private::slotConfigCommitted()
updateStatusBar();
}
void MainWindow::Private::togglePadView()
{
if (ui.padWidget->isVisible()) {
ui.padWidget->hide();
ui.searchBar->show();
ui.tabWidget.show();
} else {
ui.padWidget->show();
ui.searchBar->hide();
ui.tabWidget.hide();
ui.welcomeWidget->hide();
}
}
void MainWindow::closeEvent(QCloseEvent *e)
{
// KMainWindow::closeEvent() insists on quitting the application,
......
......@@ -72,6 +72,7 @@ private:
Q_PRIVATE_SLOT(d, void slotConfigCommitted())
Q_PRIVATE_SLOT(d, void slotContextMenuRequested(QAbstractItemView *, QPoint))
Q_PRIVATE_SLOT(d, void slotFocusQuickSearch())
Q_PRIVATE_SLOT(d, void togglePadView())
Q_PRIVATE_SLOT(d, void toggleSmartcardView())
Q_PRIVATE_SLOT(d, void forceUpdateCheck())
Q_PRIVATE_SLOT(d, void openCompendium())
......
This diff is collapsed.
/* -*- mode: c++; c-basic-offset:4 -*-
padwidget.h
This file is part of Kleopatra, the KDE keymanager
Copyright (c) 2018 Intevation GmbH
Kleopatra is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Kleopatra is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
In addition, as a special exception, the copyright holders give
permission to link the code of this program with any edition of
the Qt library by Trolltech AS, Norway (or with modified versions
of Qt that use the same license as Qt), and distribute linked
combinations including the two. You must obey the GNU General
Public License in all respects for all of the code used other than
Qt. If you modify this file, you may extend this exception to
your version of the file, but you are not obligated to do so. If
you do not wish to do so, delete this exception statement from
your version.
*/
#ifndef KLEOPATRA_VIEW_PADWIDGET
#define KLEOPATRA_VIEW_PADWIDGET
#include <QWidget>
#include <memory>
namespace Kleo
{
/** The padwidget provides a general I/O area inside of kleopatra
* and can be used as an alternative view to the tabwidget. */
class PadWidget: public QWidget
{
Q_OBJECT
public:
explicit PadWidget(QWidget *parent = Q_NULLPTR);
private:
class Private;
std::shared_ptr<Private> d;
};
} // namespace Kleo
#endif // DIALOGS_CLIPBOARD_H
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment