Commit Graph

238 Commits

Author SHA1 Message Date
Christian Hohnstaedt
99a7768fd9 Improve/Fix database loading
Do not interact with the GUI when loading datbase items (beginInsertRows,
beginMoveRows, beginRemoveRows, etc.) by not using
insertChild() / remFromCont() anymore.

Fill and organize the root- tree- and sub-items and call
columnsContentChanged() once when done.

Automatically set "parent" of a pki-item when inserting or removing
as child items.
2023-09-19 16:43:24 +02:00
Christian Hohnstaedt
441bc8630d Really erase element after deleting 2023-09-19 16:42:25 +02:00
Christian Hohnstaedt
11a88781f9 Merge branch 'vertical-align-fix' of github.com:gentoo90/xca 2023-05-30 18:39:35 +02:00
gentoo90
1e06d60f8e Fix vertical text alignment in the tree views 2023-05-30 18:41:11 +03:00
Christian Hohnstaedt
061f676041 Improve/simplify item import
Unify import functions for some (on_butImport_clicked)
or all (on_butOk_clicked) items.
They both call "importIndexes(const QModelIndexList &indexes)"
containing some or all indexes to import.

db_x509.cpp: Only need to search the treeItem (containing all items
without issuer, not all in the rootItem (containing also certificates
with known issuer)

Re-use "remFromCont()" when stealing items from an other CA.
2023-05-30 14:38:55 +02:00
Christian Hohnstaedt
02fc95c70b Reset parent pointer when removing child from container
and use the issuer as parent when inserting it to
put it under the correct issuer
2023-05-16 09:49:46 +02:00
Christian Hohnstaedt
ced6dfc41a Add support for Qt6
XCA now supports both, Qt6 and Qt5 down to Qt-5.2

Use CMAKE_PREFIX_PATH to point to the QT dompiler directory like
$ cmake -B build -DCMAKE_PREFIX_PATH=$HOME/6.3.1/gcc_64
2022-08-31 00:09:37 +02:00
Christian Hohnstaedt
186657fbce Close: #366 Not Responding after upgrade
cache the results of visibility check as long as the search text remains.
This function is called many times when displaying the data,
even if the search string does not change.
2022-08-03 07:36:33 +02:00
Christian Hohnstaedt
ed475c8d9f Close #327: "Dump database" dumps everything to everywhere
Select the items to be dumped to the currently selected
directory.
2022-07-31 13:02:29 +02:00
Christian Hohnstädt
6ea01e80f6 Refactor item export: separate GUI and database
Collect all export formats in pki_export.

Each export format has assigned acouple of flags, indicating,
whether they are text, concatenateable, encrypted, usable for
multiple selections or only for a single item.
2021-11-13 14:49:02 +01:00
Christian Hohnstaedt
f2fe9be3f3 Move file loading GUI element out of non-gui container class (db_*)
into GUI View widgets/*TreeView.cpp
2021-10-30 11:51:35 +02:00
Christian Hohnstädt
13b0992780 Set Key export format separately via context menu
The popping up query dialog during PEM export via Drag&Drop
and Ctrl-C during Key export was pretty annoying.
2021-10-24 14:41:25 +02:00
Christian Hohnstaedt
e9f36fc72b Move storeItems() from db_base to XcaTeeView 2021-09-09 21:30:06 +02:00
Christian Hohnstädt
56c6df6c90 editComment: Move Gui elements to widgets/XcaTreeView
Another step to separate GUI from functionality
2021-06-19 13:18:48 +02:00
Christian Hohnstaedt
9180a3ea31 Move font information from db_base to TreeView 2021-06-01 17:48:37 +02:00
Christian Hohnstaedt
f8915fbc98 PwDialog: Split into cmdline-core and GUI
Another step to split core and GUI components
2021-06-01 17:48:37 +02:00
Christian Hohnstädt
68273d0a30 Switch from autotools/qmake to cmake
Why?
 - QT will switch from qmake to cmake sooner or later.
 - autotools are good for unix-ish systems, cmake also for
   macOS and Xcode as well as Windows and VS-code
 - Cross compiling the windows-binaries on linux
   is not very helpful to attract windows-centric
   developers.

Also drop qmake's xca.pro
Generate man-page and sphinx sources of commandline arguments
during build by executing xca (xcadoc.cpp).
Generating Version-patchlevel and git hash is now also
OS independent.
2021-06-01 17:48:37 +02:00
Christian Hohnstädt
703d9c0ba7 sql: better handle SQL errors during insert
Don't pop-up a success message, but delete the item,
if an SQL error occures during insert.
2021-05-05 19:39:28 +02:00
Christian Hohnstädt
8c04bc2b27 Rename PACKAGE_VERSION to XCA_VERSION
For an official release XCA_VERSION == PACKAGE_VERSION.
For any additional commit, XCA_VERSION's path-level is increased.

PACKAGE_VERSION cannot be modified after initially set.
Change any occurance of PACKAGE_VERSION by XCA_VERSION
2021-04-26 10:10:23 +02:00
Christian Hohnstaedt
51f3418c68 db_base.cpp: Improve loading database content
If tan item has unsupported content like key type or algorithm,
it will be skipped with a warning now, but the database loads.
2021-04-23 15:57:32 +02:00
Christian Hohnstaedt
ff7704ff0b Add context sensitive documentation
All dialogs get the "Qt::WindowModal" modality to
operate the Help window in parallel
while also blocking the dialog parent windows.

The manageRevocations() moved from model to view

The Details dialogs become more self-sufficient.
There is a statc start method that shows the dialog and
updates name and comment after accept().
This allows recursive starts of certificate details and
independence of mainwin.
It is necessary to set the current toplevel widget as parent
for the next dialog to not block the application.
2021-04-23 15:50:13 +02:00
Christian Hohnstaedt
cbe7709b20 Close #224: Store original path/filename on import 2020-10-16 00:37:12 +02:00
Christian Hohnstaedt
ef24c00c22 Minor fixes 2020-06-26 14:21:32 +02:00
Christian Hohnstaedt
45f834a6e4 Move tree-handling from db_x509 class to the base class
This is a preparation for possibly inserting
structuring folder elements later.
2020-05-08 17:37:40 +02:00
Christian Hohnstaedt
1e544161f6 Eliminate the use of "mainwin" in lib/db_* 2020-05-08 11:59:09 +02:00
Christian Hohnstaedt
7c65a786ea Revamp database management
The global variable "Database" of class xca_db
can be used by any other class to access. No need
to provide it.

The "xca_db" class managed the "database_model" pointer.
Accessing the name of the current database has been unified.
2020-05-08 07:47:15 +02:00
Christian Hohnstaedt
b2ab7570b8 Minor fixxes and constifies 2020-04-30 18:47:28 +02:00
Christian Hohnstaedt
0f7465dcc5 Add convenience function to convert QModelIndex to pki_base * 2020-04-30 18:46:08 +02:00
Christian Hohnstaedt
03633d7a8a Provide db class name through constructor 2020-04-30 18:44:36 +02:00
Christian Hohnstaedt
a3344100e3 Drop FOR_ALL_pki() makro and use a foreach() loop
The foreach loop iterates over all items of a type.
The iterate method is now superflous
2020-04-30 18:40:49 +02:00
Christian Hohnstaedt
5a64725556 Move item store from db_base into separate class "pki_lookup"
Since also pki_base and other classes need to access them.
2020-04-30 18:37:25 +02:00
Christian Hohnstaedt
ea453d4336 Encapsulate all BIOs in the BioByteArray class
If we have a QByteArray (ba) and must provide it to
a BIO* expecting OpenSSL function, the following
construct provides it: BioByteArray(ba).ro()
directly providing the QByteArray buffer as BIO

It also supports mixed writes:
  BIO_write(bba, buf, size)
  bba += QByteArray
2020-04-06 22:07:57 +02:00
Christian Hohnstaedt
5543ec2fb8 Merge branch 'master' into develop 2020-04-02 07:35:18 +02:00
Christian Hohnstaedt
b41d322069 Refactor native separators / and \ on windows.
Always only use forward slash /
Drop all "QDir::separator()" and "nativeSeparator()"
functions. Only use it where filenames are displayed for the user.
2020-04-02 06:12:47 +02:00
Christian Hohnstaedt
7babd609be Drop unneeded pki_base::insert()
Insert / append does not matter,
because the rows are sorted by columns anyway.
2020-03-17 05:13:35 +01:00
Christian Hohnstaedt
ef9b3aff3d Drop superflous includes from header files 2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
3dd34a61bc Move "showPki()" from the model class to the view
The displaying function requires UI.
2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
d0d387b03e Directly display the error instead of signaling others
The XCA_ERROR() is console-compatible and can be used
without GUI
2020-03-13 12:13:27 +01:00
Christian Hohnstaedt
113a201d39 Separate database from Mainwin for better cmdline support
New classes:
 - database_model: Manage the database tables (keys, req, cert, crl, templ)
   extracted from widgets/MW_database.cpp
 - arguments: parse commandline, dynamically create help text
2020-03-11 07:19:56 +01:00
Christian Hohnstaedt
b9a8bb1a04 Cleanup: remove unused properties and declarations 2019-03-27 05:58:25 +01:00
Christian Hohnstaedt
f43e7520db Support concurrent database access.
If a database is modified by another instance of XCA the passive
instance reloads and displays the changed parts.
2019-03-25 06:47:25 +01:00
Christian Hohnstaedt
026d8f8e6d Extend PEM files by human readable information about the item
This can be enabled or disabled during export.
Move from FILE* to QFile
2019-03-18 06:25:20 +01:00
Christian Hohnstaedt
d5305d33c7 Check all dates regularily whether a "view" update is neccessary 2018-06-28 14:33:30 +02:00
Christian Hohnstaedt
acea9e5c21 Fix translation of dates 2018-06-27 07:50:21 +02:00
Christian Hohnstaedt
96d8c5cf37 Generalize handling of DateTime columns 2018-06-26 23:32:40 +02:00
Christian Hohnstaedt
b10b4f7a53 Inspired by #42: display insertion date relative
Easy to find the most recent entry, because it says
"3 seconds ago"
2018-06-25 21:20:25 +02:00
Christian Hohnstaedt
efd3bff700 Add missing break in switch 2018-05-16 17:43:03 +02:00
Christian Hohnstaedt
dc36728df8 Generate calender (.ics) files for certificate and CRL expiries
Also support consolidated calendar entries for a CA,
containing the CA, all issued certificates and the CRL expiry dates.
2018-05-10 12:49:59 +02:00
Christian Hohnstaedt
8d64db6be3 Const-ify remFromCont() 2018-04-24 23:10:46 +02:00
Christian Hohnstaedt
331b79bd9d Close #23: Improve limiting to pattern in certificate tree view
CA certificates that don't match the search pattern, but have
matching childs are shown disabled with internal name.
2018-04-22 07:06:31 +02:00