Commit e086acf2 authored by Dirk Wilden's avatar Dirk Wilden

remove the unloadPlugins widget

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@5124 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 18af343f
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Config
#==============================================================================
SUBDIRS = $(call find-subdirs)
PACKAGES := qt4 glut opengl x11 math ACG2 openmesh2
PROJ_LIBS =
MODULES := uic4compat moc4 cxx
#== SYSTEM PART -- DON'T TOUCH ==============================================
include $(ACGMAKE)/Rules
#==============================================================================
<ui version="4.0" >
<class>unloadPlugins</class>
<widget class="QWidget" name="unloadPlugins" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>290</width>
<height>404</height>
</rect>
</property>
<property name="windowTitle" >
<string>unload plugins</string>
</property>
<layout class="QGridLayout" >
<item row="0" column="0" colspan="3" >
<widget class="QListWidget" name="listWidget" >
<property name="selectionMode" >
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="sortingEnabled" >
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QPushButton" name="cancelButton" >
<property name="text" >
<string>&amp;Cancel</string>
</property>
</widget>
</item>
<item row="1" column="1" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="2" >
<widget class="QPushButton" name="unloadButton" >
<property name="text" >
<string>&amp;Unload</string>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
//=============================================================================
//
// OpenFlipper
// Copyright (C) 2008 by Computer Graphics Group, RWTH Aachen
// www.openflipper.org
//
//-----------------------------------------------------------------------------
//
// License
//
// OpenFlipper is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenFlipper is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenFlipper. If not, see <http://www.gnu.org/licenses/>.
//
//-----------------------------------------------------------------------------
//
// $Revision$
// $Author$
// $Date$
//
//=============================================================================
#include "unloadPluginsWidget.hh"
unloadPluginsWidget::unloadPluginsWidget(QStringList plugins, QWidget *parent)
: QWidget(parent)
{
setupUi(this);
listWidget->addItems(plugins);
connect(cancelButton,SIGNAL(clicked()),this,SLOT(close()));
connect(unloadButton,SIGNAL(clicked()),this,SLOT(slotUnload()));
}
void unloadPluginsWidget::slotUnload(){
int buttonState = QMessageBox::No;
QStringList dontLoad;
for (int i=0; i < listWidget->selectedItems().size(); i++){
QString name = listWidget->selectedItems()[i]->text();
if (listWidget->selectedItems().size() == 1){
//show messageBox without YESTOALL / NOTOALL
buttonState = QMessageBox::question(this, tr("Prevent Plugin Loading"),
tr("Do you want to prevent OpenFlipper from loading this plugin on the next start?"),
QMessageBox::Yes | QMessageBox::No,
QMessageBox::No);
}else{
//show messageBox with YESTOALL / NOTOALL
if (buttonState == QMessageBox::Yes || buttonState == QMessageBox::No)
buttonState = QMessageBox::question(this, tr("Prevent Plugin Loading"),
tr("Do you want to prevent OpenFlipper from loading this plugin on the next start?"),
QMessageBox::Yes | QMessageBox::YesToAll | QMessageBox::No | QMessageBox::NoToAll ,
QMessageBox::No);
}
if (buttonState == QMessageBox::Yes || buttonState == QMessageBox::YesToAll)
dontLoad << name;
//unload plugin
emit unload(name);
}
//prevent OpenFlipper from loading the plugin on the next start
if (!dontLoad.isEmpty())
emit dontLoadPlugins(dontLoad);
close();
}
void unloadPluginsWidget::setPlugins(QStringList plugins){
listWidget->clear();
listWidget->addItems(plugins);
}
//=============================================================================
//
// OpenFlipper
// Copyright (C) 2008 by Computer Graphics Group, RWTH Aachen
// www.openflipper.org
//
//-----------------------------------------------------------------------------
//
// License
//
// OpenFlipper is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// OpenFlipper is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with OpenFlipper. If not, see <http://www.gnu.org/licenses/>.
//
//-----------------------------------------------------------------------------
//
// $Revision$
// $Author$
// $Date$
//
//=============================================================================
#ifndef UNLOADPLUGINSWIDGET_HH
#define UNLOADPLUGINSWIDGET_HH
#include "ui_unloadPlugins.hh"
#include <QtGui>
#include <QStringList>
class unloadPluginsWidget : public QWidget, public Ui::unloadPlugins
{
Q_OBJECT
public:
unloadPluginsWidget(QStringList plugins, QWidget *parent = 0 );
signals:
void unload(QString name);
void dontLoadPlugins(QStringList plugins);
private slots:
void slotUnload();
public:
void setPlugins(QStringList plugins);
};
#endif //UNLOADPLUGINSWIDGET_HH
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment