File indexing completed on 2024-05-12 16:35:24

0001 /* This file is part of the KDE project
0002    Copyright (C) 2012-2013 Jigar Raisinghani <jigarraisinghani@gmail.com>
0003 
0004    This library is free software; you can redistribute it and/or
0005    modify it under the terms of the GNU Library General Public
0006    License as published by the Free Software Foundation; either
0007    version 2 of the License, or (at your option) any later version.
0008 
0009    This library is distributed in the hope that it will be useful,
0010    but WITHOUT ANY WARRANTY; without even the implied warranty of
0011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0012    Library General Public License for more details.
0013 
0014    You should have received a copy of the GNU Library General Public License
0015    along with this library; see the file COPYING.LIB.  If not, write to
0016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0017    Boston, MA 02110-1301, USA.
0018 */
0019 
0020 // Local
0021 
0022 #include "pivot.h"
0023 #include "ui_pivot.h"
0024 #include "ui_pivotmain.h"
0025 #include "pivotmain.h"
0026 
0027 #include <QApplication>
0028 #include <QMessageBox>
0029 
0030 #include <sheets/Sheet.h>
0031 #include <sheets/ui/Selection.h>
0032 using namespace Calligra::Sheets;
0033 
0034 class Pivot::Private
0035 {
0036 public:
0037     Selection *selection;
0038     Ui::Pivot mainWidget;
0039 };
0040 
0041 
0042 Pivot::Pivot(QWidget* parent,Selection* selection):
0043     KoDialog(parent),
0044     d(new Private)
0045 {
0046     setCaption(i18n("Select Source"));
0047     
0048     QWidget* widget = new QWidget(this);
0049     d->mainWidget.setupUi(widget);
0050     setButtons(Ok|Cancel);   
0051     d->mainWidget.Current->setChecked(true);
0052     setMainWidget(widget);
0053     d->selection=selection;
0054     connect(this, SIGNAL(okClicked()), this, SLOT(slotUser2Clicked()));
0055 
0056 }
0057 
0058 Pivot::~Pivot()
0059 {
0060     delete d;
0061 }
0062 
0063 void Pivot::slotUser2Clicked()
0064 {
0065       if(d->mainWidget.Current->isChecked())
0066       {
0067           PivotMain *pMain= new PivotMain(this,d->selection);
0068           pMain->setModal(true);
0069           pMain->exec();
0070       }
0071       
0072       if(d->mainWidget.External->isChecked())
0073       {
0074           QMessageBox msgBox;
0075           msgBox.setText("Functionality Yet to be Added");
0076           msgBox.exec();
0077           
0078           Pivot *p=new Pivot(this,d->selection);
0079           p->setModal(true);
0080           p->exec();
0081       }
0082 }