[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdepim/akonadi/clients/akonadiconsole
From: Tom Albers <tomalbers () kde ! nl>
Date: 2008-11-01 14:42:59
Message-ID: 1225550579.055889.25610.nullmailer () svn ! kde ! org
[Download RAW message or body]
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 <akonadi/agenttypewidget.h>
+#include <akonadi/agenttypedialog.h>
#include <akonadi/agentinstancewidget.h>
#include <akonadi/agentmanager.h>
#include <akonadi/agentinstancecreatejob.h>
@@ -29,60 +29,12 @@
#include <KLocale>
-#include <QtGui/QDialog>
-#include <QtGui/QDialogButtonBox>
#include <QtGui/QGridLayout>
#include <QtGui/QMenu>
#include <QtGui/QPushButton>
-#include <QtGui/QVBoxLayout>
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();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic