Continue to implement fullsync
[kdepim.git] / sieveeditor / sieveeditorcentralwidget.cpp
blobe61e593c8294e4128f30b4982672e7d55d91c3a7
1 /*
2 Copyright (c) 2014-2015 Montel Laurent <montel@kde.org>
4 This program is free software; you can redistribute it and/or modify it
5 under the terms of the GNU General Public License, version 2, as
6 published by the Free Software Foundation.
8 This program is distributed in the hope that it will be useful, but
9 WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 General Public License for more details.
13 You should have received a copy of the GNU General Public License along
14 with this program; if not, write to the Free Software Foundation, Inc.,
15 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 #include "sieveeditorcentralwidget.h"
19 #include "sieveeditormainwidget.h"
20 #include "sieveeditorconfigureserverpage.h"
22 SieveEditorCentralWidget::SieveEditorCentralWidget(QWidget *parent)
23 : QStackedWidget(parent)
25 mConfigureWidget = new SieveEditorConfigureServerPage;
26 connect(mConfigureWidget, &SieveEditorConfigureServerPage::configureClicked, this, &SieveEditorCentralWidget::configureClicked);
27 addWidget(mConfigureWidget);
28 mSieveEditorMainWidget = new SieveEditorMainWidget;
29 connect(mSieveEditorMainWidget, &SieveEditorMainWidget::serverSieveFound, this, &SieveEditorCentralWidget::slotServerSieveFound);
30 addWidget(mSieveEditorMainWidget);
31 setCurrentWidget(mConfigureWidget);
34 SieveEditorCentralWidget::~SieveEditorCentralWidget()
39 void SieveEditorCentralWidget::slotServerSieveFound(bool hasServer)
41 if (hasServer) {
42 setCurrentWidget(mSieveEditorMainWidget);
43 } else {
44 setCurrentWidget(mConfigureWidget);
48 SieveEditorMainWidget *SieveEditorCentralWidget::sieveEditorMainWidget() const
50 return mSieveEditorMainWidget;