Back to index

salome-paravis  6.5.0
MyViewActiveOptions.cxx
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003    Program: ParaView
00004    Module:    $RCSfile: MyViewActiveOptions.cxx,v $
00005 
00006    Copyright (c) 2005-2008 Sandia Corporation, Kitware Inc.
00007    All rights reserved.
00008 
00009    ParaView is a free software; you can redistribute it and/or modify it
00010    under the terms of the ParaView license version 1.2. 
00011 
00012    See License_v1.2.txt for the full ParaView license.
00013    A copy of this license can be obtained by contacting
00014    Kitware Inc.
00015    28 Corporate Drive
00016    Clifton Park, NY 12065
00017    USA
00018 
00019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00020 ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00021 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
00022 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR
00023 CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00024 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00025 PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00026 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00027 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00028 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00029 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00030 
00031 =========================================================================*/
00032 
00033 #include "MyViewActiveOptions.h"
00034 
00035 #include "MyViewOptions.h"
00036 
00037 #include "pqOptionsDialog.h"
00038 
00039 MyViewActiveOptions::MyViewActiveOptions(QObject *parentObject)
00040   : pqActiveViewOptions(parentObject)
00041 {
00042 }
00043 
00044 MyViewActiveOptions::~MyViewActiveOptions()
00045 {
00046 }
00047 
00048 void MyViewActiveOptions::showOptions(pqView *view, const QString &page,
00049     QWidget *widgetParent)
00050 {
00051   if(!this->Dialog)
00052     {
00053     this->Dialog = new pqOptionsDialog(widgetParent);
00054     this->Dialog->setApplyNeeded(true);
00055     this->Dialog->setObjectName("ActiveMyViewOptions");
00056     this->Dialog->setWindowTitle("My View Options");
00057     this->Options = new MyViewOptions;
00058     this->Dialog->addOptions(this->Options);
00059     if(page.isEmpty())
00060       {
00061       QStringList pages = this->Options->getPageList();
00062       if(pages.size())
00063         {
00064         this->Dialog->setCurrentPage(pages[0]);
00065         }
00066       }
00067     else
00068       {
00069       this->Dialog->setCurrentPage(page);
00070       }
00071     
00072     this->connect(this->Dialog, SIGNAL(finished(int)),
00073         this, SLOT(finishDialog()));
00074     }
00075 
00076   this->changeView(view);
00077   this->Dialog->show();
00078 }
00079 
00080 void MyViewActiveOptions::changeView(pqView *view)
00081 {
00082   this->Options->setView(view);
00083 }
00084 
00085 void MyViewActiveOptions::closeOptions()
00086 {
00087   if(this->Dialog)
00088     {
00089     this->Dialog->accept();
00090     }
00091 }
00092 
00093 void MyViewActiveOptions::finishDialog()
00094 {
00095   emit this->optionsClosed(this);
00096 }
00097 
00098