Commit cf7d10dc authored by Laurent Montel's avatar Laurent Montel 😁

Fix Bug 341116 - cannot edit IMAP flags; Save button stays grayed-out

BUG: 341116
parent d65a518b
...@@ -195,6 +195,7 @@ BrowserWidget::BrowserWidget(KXmlGuiWindow *xmlGuiWindow, QWidget * parent) : ...@@ -195,6 +195,7 @@ BrowserWidget::BrowserWidget(KXmlGuiWindow *xmlGuiWindow, QWidget * parent) :
connect( contentUi.saveButton, SIGNAL(clicked()), SLOT(save()) ); connect( contentUi.saveButton, SIGNAL(clicked()), SLOT(save()) );
splitter3->addWidget( contentViewParent ); splitter3->addWidget( contentViewParent );
connect( contentUi.attrAddButton, SIGNAL(clicked()), SLOT(addAttribute()) ); connect( contentUi.attrAddButton, SIGNAL(clicked()), SLOT(addAttribute()) );
connect( contentUi.attrDeleteButton, SIGNAL(clicked()), SLOT(delAttribute()) ); connect( contentUi.attrDeleteButton, SIGNAL(clicked()), SLOT(delAttribute()) );
...@@ -220,6 +221,8 @@ BrowserWidget::BrowserWidget(KXmlGuiWindow *xmlGuiWindow, QWidget * parent) : ...@@ -220,6 +221,8 @@ BrowserWidget::BrowserWidget(KXmlGuiWindow *xmlGuiWindow, QWidget * parent) :
m_stateMaintainer->setView( mCollectionView ); m_stateMaintainer->setView( mCollectionView );
m_stateMaintainer->restoreState(); m_stateMaintainer->restoreState();
connect(contentUi.flags, SIGNAL(changed()), this, SLOT(slotFlagsChanged()));
connect(contentUi.tags, SIGNAL(changed()), this, SLOT(slotTagsChanged()));
} }
BrowserWidget::~BrowserWidget() BrowserWidget::~BrowserWidget()
...@@ -227,6 +230,17 @@ BrowserWidget::~BrowserWidget() ...@@ -227,6 +230,17 @@ BrowserWidget::~BrowserWidget()
m_stateMaintainer->saveState(); m_stateMaintainer->saveState();
} }
void BrowserWidget::slotFlagsChanged()
{
contentUi.saveButton->setEnabled( true );
}
void BrowserWidget::slotTagsChanged()
{
contentUi.saveButton->setEnabled( true );
}
void BrowserWidget::clear() void BrowserWidget::clear()
{ {
contentUi.stack->setCurrentWidget( contentUi.unsupportedTypePage ); contentUi.stack->setCurrentWidget( contentUi.unsupportedTypePage );
...@@ -240,6 +254,7 @@ void BrowserWidget::clear() ...@@ -240,6 +254,7 @@ void BrowserWidget::clear()
contentUi.flags->clear(); contentUi.flags->clear();
contentUi.tags->clear(); contentUi.tags->clear();
contentUi.attrView->setModel( 0 ); contentUi.attrView->setModel( 0 );
contentUi.saveButton->setEnabled( false );
} }
void BrowserWidget::itemActivated(const QModelIndex & index) void BrowserWidget::itemActivated(const QModelIndex & index)
...@@ -394,6 +409,7 @@ void BrowserWidget::saveResult(KJob * job) ...@@ -394,6 +409,7 @@ void BrowserWidget::saveResult(KJob * job)
if ( job->error() ) { if ( job->error() ) {
KMessageBox::error( this, i18n( "Failed to save changes: %1", job->errorString() ) ); KMessageBox::error( this, i18n( "Failed to save changes: %1", job->errorString() ) );
} }
contentUi.saveButton->setEnabled( false );
} }
void BrowserWidget::addAttribute() void BrowserWidget::addAttribute()
......
...@@ -75,6 +75,8 @@ class BrowserWidget: public QWidget ...@@ -75,6 +75,8 @@ class BrowserWidget: public QWidget
void dumpToXmlResult( KJob *job ); void dumpToXmlResult( KJob *job );
void clear(); void clear();
void updateItemFetchScope(); void updateItemFetchScope();
void slotFlagsChanged();
void slotTagsChanged();
private: private:
Akonadi::Collection currentCollection() const; Akonadi::Collection currentCollection() const;
......
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