SVN commit 878641 by toma: Akonadiconsole now uses the dialog from pimlibs I just added there. M +2 -50 agentwidget.cpp --- trunk/KDE/kdepim/akonadi/clients/akonadiconsole/agentwidget.cpp #878640:878641 @@ -21,7 +21,7 @@ #include "agentwidget.h" -#include +#include #include #include #include @@ -29,60 +29,12 @@ #include -#include -#include #include #include #include -#include using namespace Akonadi; -class Dialog : public QDialog -{ - public: - Dialog( QWidget *parent = 0 ) - : QDialog( parent ) - { - QVBoxLayout *layout = new QVBoxLayout( this ); - - mWidget = new Akonadi::AgentTypeWidget( this ); - connect( mWidget, SIGNAL( doubleClicked() ), this, SLOT( accept() ) ); - - QDialogButtonBox *box = new QDialogButtonBox( this ); - - layout->addWidget( mWidget ); - layout->addWidget( box ); - - QPushButton *ok = box->addButton( QDialogButtonBox::Ok ); - connect( ok, SIGNAL( clicked() ), this, SLOT( accept() ) ); - - QPushButton *cancel = box->addButton( QDialogButtonBox::Cancel ); - connect( cancel, SIGNAL( clicked() ), this, SLOT( reject() ) ); - - resize( 450, 320 ); - } - - virtual void done( int result ) - { - if ( result == Accepted ) - mAgentType = mWidget->currentAgentType(); - else - mAgentType = AgentType(); - - QDialog::done( result ); - } - - AgentType agentType() const - { - return mAgentType; - } - - private: - Akonadi::AgentTypeWidget *mWidget; - AgentType mAgentType; -}; - AgentWidget::AgentWidget( QWidget *parent ) : QWidget( parent ) { @@ -122,7 +74,7 @@ void AgentWidget::addAgent() { - Dialog dlg( this ); + Akonadi::AgentTypeDialog dlg( this ); if ( dlg.exec() ) { const AgentType agentType = dlg.agentType();