7#include "catalogeditform.h"
8#include "dialogs/catalogcoloreditor.h"
10#include "ui_catalogeditform.h"
11#include "catalogsdb.h"
12#include <QColorDialog>
15 const int min_id,
const bool allow_id_edit)
19 ui->
id->setMinimum(min_id);
20 ui->id->setEnabled(allow_id_edit);
22 fill_form_from_catalog();
24 [&](
const int id) { m_catalog.id = id; });
27 [&](
const QString &s) { m_catalog.name = s; });
30 [&](
const QString &s) { m_catalog.author = s; });
33 [&](
const QString &s) { m_catalog.source = s; });
36 [&]() { m_catalog.description = ui->description->toHtml(); });
39 [&](
const QString &s) { m_catalog.license = s; });
42 [&](
const QString &s) { m_catalog.maintainer = s; });
45 CatalogColorEditor editor{
46 m_catalog.color ==
"" ?
47 KStarsData::Instance()->colorScheme()->colorNamed(
"DSOColor").name() :
54 m_catalog.color = editor.color_string();
58CatalogEditForm::~CatalogEditForm()
63void CatalogEditForm::fill_form_from_catalog()
65 ui->id->setValue(m_catalog.
id);
66 ui->name->setText(m_catalog.
name);
67 ui->author->setText(m_catalog.
author);
68 ui->source->setText(m_catalog.
source);
70 ui->license->setText(m_catalog.
license);
void textChanged(const QString &text)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
A simple struct to hold information about catalogs.
QString maintainer
The catalog maintainer.
QString name
The catalog mame.
QString license
The catalog license.
QString description
A (short) description for the catalog.
QString author
The author of the catalog.
QString source
The catalog source.