SVN_SILENT made messages (.desktop file)
[kdepim.git] / akonadiconsole / agentconfigdialog.cpp
blob1ba698ede8be17f5d926262d70feaa438e6afb01
1 /*
2 Copyright (c) 2010 Volker Krause
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
17 USA.
20 #include "agentconfigdialog.h"
21 #include "agentconfigmodel.h"
22 #include <KLocalizedString>
24 AgentConfigDialog::AgentConfigDialog(QWidget* parent) :
25 KDialog(parent),
26 m_model( new AgentConfigModel( this ) )
28 ui.setupUi( mainWidget() );
29 ui.propertyView->setModel( m_model );
31 setButtons( User1 | User2 | Apply | Close );
32 setButtonGuiItem( User1, KGuiItem( i18n( "Save Configuration" ), KIcon( "document-save" ) ) );
33 setButtonGuiItem( User2, KGuiItem( i18n( "Refresh" ), KIcon( "view-refresh" ) ) );
34 setButtonText( Apply, i18n( "Apply Configuration" ) );
36 setCaption( i18n( "Agent Configuration" ) );
38 connect( this, SIGNAL(applyClicked()), SLOT(reconfigure()) );
39 connect( this, SIGNAL(user1Clicked()), m_model, SLOT(writeConfig()) );
40 connect( this, SIGNAL(user2Clicked()), m_model, SLOT(reload()) );
43 void AgentConfigDialog::setAgentInstance(const Akonadi::AgentInstance& instance)
45 m_instance = instance;
46 m_model->setAgentInstance( instance );
49 void AgentConfigDialog::reconfigure()
51 m_instance.reconfigure();
54 #include "agentconfigdialog.moc"