Commit 218524d1 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Update buttons when we fill combobox

parent be0e4824
...@@ -81,6 +81,7 @@ EventEdit::EventEdit(QWidget *parent) ...@@ -81,6 +81,7 @@ EventEdit::EventEdit(QWidget *parent)
#endif #endif
mCollectionCombobox->setToolTip(i18n("Calendar where the new event will be stored")); mCollectionCombobox->setToolTip(i18n("Calendar where the new event will be stored"));
connect(mCollectionCombobox->model(), &QAbstractItemModel::rowsInserted, this, &EventEdit::comboboxRowInserted);
connect(mCollectionCombobox, static_cast<void (Akonadi::CollectionComboBox::*)(int)>(&Akonadi::CollectionComboBox::currentIndexChanged), this, &EventEdit::slotCollectionChanged); connect(mCollectionCombobox, static_cast<void (Akonadi::CollectionComboBox::*)(int)>(&Akonadi::CollectionComboBox::currentIndexChanged), this, &EventEdit::slotCollectionChanged);
connect(mCollectionCombobox, static_cast<void (Akonadi::CollectionComboBox::*)(int)>(&Akonadi::CollectionComboBox::activated), this, &EventEdit::slotCollectionChanged); connect(mCollectionCombobox, static_cast<void (Akonadi::CollectionComboBox::*)(int)>(&Akonadi::CollectionComboBox::activated), this, &EventEdit::slotCollectionChanged);
hbox->addWidget(mCollectionCombobox); hbox->addWidget(mCollectionCombobox);
...@@ -164,6 +165,11 @@ EventEdit::~EventEdit() ...@@ -164,6 +165,11 @@ EventEdit::~EventEdit()
writeConfig(); writeConfig();
} }
void EventEdit::comboboxRowInserted()
{
slotUpdateButtons(mEventEdit->text());
}
void EventEdit::writeConfig() void EventEdit::writeConfig()
{ {
const Akonadi::Collection col = mCollectionCombobox->currentCollection(); const Akonadi::Collection col = mCollectionCombobox->currentCollection();
......
...@@ -70,6 +70,7 @@ protected: ...@@ -70,6 +70,7 @@ protected:
bool eventFilter(QObject *object, QEvent *e) override; bool eventFilter(QObject *object, QEvent *e) override;
private: private:
void readConfig(); void readConfig();
void comboboxRowInserted();
Akonadi::Collection mCollection; Akonadi::Collection mCollection;
KMime::Message::Ptr mMessage; KMime::Message::Ptr mMessage;
QLineEdit *mEventEdit; QLineEdit *mEventEdit;
......
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