Skip to content
API Documentation
BastionGuard™
PasswordDialogs.hpp
Go to the documentation of this file.
1/*
2 * BastionGuard™
3 * Copyright (C) 2025–2026 Calogero Scarnà
4 *
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, version 3.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <https://www.gnu.org/licenses/>.
16 *
17 * BastionGuard™ is a trademark of Calogero Scarnà.
18 * The BastionGuard™ name and branding are not licensed under the GPL.
19 */
20
21#pragma once
22
23#include <gtkmm.h>
24#include "PasswordEntry.hpp"
25
26
27
28class PasswordDialog : public Gtk::Dialog {
29public:
30 PasswordDialog(Gtk::Window& parent, const Glib::ustring& title);
31 PasswordDialog(Gtk::Window& parent, const Glib::ustring& title,
32 const PasswordEntry& entry, const std::string& secret);
33 ~PasswordDialog() override;
34
35 PasswordEntry getEntry() const;
36 std::string getSecret() const;
37
38private:
39 Gtk::Entry nameEntry_;
40 Gtk::Entry usernameEntry_;
41 Gtk::Entry urlEntry_;
42 Gtk::Entry tagsEntry_;
43 Gtk::TextView notesView_;
44 Gtk::Entry passwordEntry_;
45 Gtk::CheckButton showPasswordCheck_;
46 Glib::RefPtr<Gtk::TextBuffer> notesBuffer_;
47
48 void build();
49 void fillFrom(const PasswordEntry& entry, const std::string& secret);
50};
Gtk::Entry nameEntry_
PasswordDialog(Gtk::Window &parent, const Glib::ustring &title)
Gtk::CheckButton showPasswordCheck_
std::string getSecret() const
void fillFrom(const PasswordEntry &entry, const std::string &secret)
Gtk::Entry usernameEntry_
Gtk::Entry tagsEntry_
~PasswordDialog() override
Glib::RefPtr< Gtk::TextBuffer > notesBuffer_
Gtk::Entry passwordEntry_
Gtk::TextView notesView_
PasswordEntry getEntry() const