use real icons in edit dialogs of category, feed, acc

This commit is contained in:
Martin Rotter 2021-08-04 15:10:23 +02:00
parent fd91a2d738
commit 53f78fb3c9
3 changed files with 14 additions and 10 deletions

View File

@ -55,7 +55,9 @@ void FormCategoryDetails::loadCategoryData() {
loadCategories(m_serviceRoot->getSubTreeCategories(), m_serviceRoot, m_category); loadCategories(m_serviceRoot->getSubTreeCategories(), m_serviceRoot, m_category);
if (m_creatingNew) { if (m_creatingNew) {
setWindowTitle(tr("Add new category")); GuiUtilities::applyDialogProperties(*this,
qApp->icons()->fromTheme(QSL("folder")),
tr("Add new category"));
// Make sure that "default" icon is used as the default option for new // Make sure that "default" icon is used as the default option for new
// categories. // categories.
@ -76,7 +78,10 @@ void FormCategoryDetails::loadCategoryData() {
} }
} }
else { else {
setWindowTitle(tr("Edit \"%1\"").arg(m_category->title())); GuiUtilities::applyDialogProperties(*this,
m_category->fullIcon(),
tr("Edit \"%1\"").arg(m_category->title()));
m_ui->m_cmbParentCategory->setCurrentIndex(m_ui->m_cmbParentCategory->findData(QVariant::fromValue((void*) m_category->parent()))); m_ui->m_cmbParentCategory->setCurrentIndex(m_ui->m_cmbParentCategory->findData(QVariant::fromValue((void*) m_category->parent())));
} }
@ -161,9 +166,6 @@ void FormCategoryDetails::initialize() {
m_ui->m_txtDescription->lineEdit()->setPlaceholderText(tr("Category description")); m_ui->m_txtDescription->lineEdit()->setPlaceholderText(tr("Category description"));
m_ui->m_txtDescription->lineEdit()->setToolTip(tr("Set description for your category.")); m_ui->m_txtDescription->lineEdit()->setToolTip(tr("Set description for your category."));
// Set flags and attributes.
GuiUtilities::applyDialogProperties(*this, qApp->icons()->fromTheme(QSL("folder")));
// Setup button box. // Setup button box.
m_ui->m_buttonBox->button(QDialogButtonBox::StandardButton::Ok)->setEnabled(false); m_ui->m_buttonBox->button(QDialogButtonBox::StandardButton::Ok)->setEnabled(false);

View File

@ -78,10 +78,14 @@ void FormFeedDetails::createConnections() {
void FormFeedDetails::loadFeedData() { void FormFeedDetails::loadFeedData() {
if (m_creatingNew) { if (m_creatingNew) {
setWindowTitle(tr("Add new feed")); GuiUtilities::applyDialogProperties(*this,
qApp->icons()->fromTheme(QSL("application-rss+xml")),
tr("Add new feed"));
} }
else { else {
setWindowTitle(tr("Edit \"%1\"").arg(m_feed->title())); GuiUtilities::applyDialogProperties(*this,
m_feed->fullIcon(),
tr("Edit \"%1\"").arg(m_feed->title()));
} }
m_ui->m_cmbAutoUpdateType->setCurrentIndex(m_ui->m_cmbAutoUpdateType->findData(QVariant::fromValue(int(m_feed->autoUpdateType())))); m_ui->m_cmbAutoUpdateType->setCurrentIndex(m_ui->m_cmbAutoUpdateType->findData(QVariant::fromValue(int(m_feed->autoUpdateType()))));
@ -107,9 +111,6 @@ void FormFeedDetails::initialize() {
m_ui.reset(new Ui::FormFeedDetails()); m_ui.reset(new Ui::FormFeedDetails());
m_ui->setupUi(this); m_ui->setupUi(this);
// Set flags and attributes.
GuiUtilities::applyDialogProperties(*this, qApp->icons()->fromTheme(QSL("application-rss+xml")));
// Setup auto-update options. // Setup auto-update options.
m_ui->m_spinAutoUpdateInterval->setValue(DEFAULT_AUTO_UPDATE_INTERVAL); m_ui->m_spinAutoUpdateInterval->setValue(DEFAULT_AUTO_UPDATE_INTERVAL);
m_ui->m_cmbAutoUpdateType->addItem(tr("Fetch articles using global interval"), m_ui->m_cmbAutoUpdateType->addItem(tr("Fetch articles using global interval"),

View File

@ -45,6 +45,7 @@ void FormEditGreaderAccount::loadAccountData() {
GreaderServiceRoot* existing_root = account<GreaderServiceRoot>(); GreaderServiceRoot* existing_root = account<GreaderServiceRoot>();
setWindowIcon(existing_root->icon());
m_details->setService(existing_root->network()->service()); m_details->setService(existing_root->network()->service());
m_details->m_ui.m_txtUsername->lineEdit()->setText(existing_root->network()->username()); m_details->m_ui.m_txtUsername->lineEdit()->setText(existing_root->network()->username());
m_details->m_ui.m_txtPassword->lineEdit()->setText(existing_root->network()->password()); m_details->m_ui.m_txtPassword->lineEdit()->setText(existing_root->network()->password());