Commit 3fd6db55 authored by Vera Lukman's avatar Vera Lukman

Implementation of favorite brushes palette is half done.

svn path=/trunk/koffice/; revision=1048296
parent a8dcf047
......@@ -151,6 +151,9 @@
<Separator/>
<Action name="paintops"/>
<Action name="paintop_options"/>
<Separator/>
<Action name="palette_manager"/>
<Action name="palette"/>
</ToolBar>
<Menu name="image_popup">
......
......@@ -47,6 +47,7 @@ set(kritaui_LIB_SRCS
flake/kis_shape_selection_canvas.cpp
flake/kis_shape_selection_model.cpp
flake/kis_layermap_visitor.cpp
flowlayout.cpp
kis_autogradient.cc
kis_autogradient_resource.cc
kis_bookmarked_configurations_editor.cc
......@@ -65,6 +66,7 @@ set(kritaui_LIB_SRCS
kis_doc2.cc
kis_exposure_visitor.cc
kis_factory2.cc
kis_favorite_brush_data.cpp
kis_filter_handler.cc
kis_filter_manager.cc
kis_filters_model.cc
......@@ -80,14 +82,18 @@ set(kritaui_LIB_SRCS
kis_painting_assistant.cc
kis_painting_assistants_manager.cc
kis_paintop_box.cc
kis_palette_manager.cpp
kis_popup_palette.cpp
kis_png_converter.cpp
kis_print_job.cpp
kis_recent_color_data.cpp
kis_resource_server_provider.cpp
kis_selection_decoration.cc
kis_selection_manager.cc
kis_statusbar.cc
kis_view2.cpp
kis_zoom_manager.cc
ko_favorite_resource_manager.cpp
kisexiv2/kis_exif_io.cpp
kisexiv2/kis_exiv2.cpp
kisexiv2/kis_iptc_io.cpp
......
/****************************************************************************
**
** Copyright (C) 2004-2008 Trolltech ASA. All rights reserved.
**
** This file is part of the documentation of the Qt Toolkit.
**
** This file may be used under the terms of the GNU General Public
** License versions 2.0 or 3.0 as published by the Free Software
** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Alternatively you may (at
** your option) use any later version of the GNU General Public
** License if such license has been publicly approved by Trolltech ASA
** (or its successors, if any) and the KDE Free Qt Foundation. In
** addition, as a special exception, Trolltech gives you certain
** additional rights. These rights are described in the Trolltech GPL
** Exception version 1.2, which can be found at
** http://www.trolltech.com/products/qt/gplexception/ and in the file
** GPL_EXCEPTION.txt in this package.
**
** Please review the following information to ensure GNU General
** Public Licensing requirements will be met:
** http://trolltech.com/products/qt/licenses/licensing/opensource/. If
** you are unsure which license is appropriate for your use, please
** review the following information:
** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
** or contact the sales department at sales@trolltech.com.
**
** In addition, as a special exception, Trolltech, as the sole
** copyright holder for Qt Designer, grants users of the Qt/Eclipse
** Integration plug-in the right for the Qt/Eclipse Integration to
** link to functionality provided by Qt Designer and its related
** libraries.
**
** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly
** granted herein.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
****************************************************************************/
#include <QtGui>
#include "flowlayout.h"
FlowLayout::FlowLayout(QWidget *parent, int margin, int spacing)
: QLayout(parent)
{
setMargin(margin);
setSpacing(spacing);
}
FlowLayout::FlowLayout(int spacing)
{
setSpacing(spacing);
}
FlowLayout::~FlowLayout()
{
QLayoutItem *item;
while ((item = takeAt(0)))
delete item;
}
void FlowLayout::addItem(QLayoutItem *item)
{
itemList.append(item);
}
int FlowLayout::count() const
{
return itemList.size();
}
QLayoutItem *FlowLayout::itemAt(int index) const
{
return itemList.value(index);
}
QLayoutItem *FlowLayout::takeAt(int index)
{
if (index >= 0 && index < itemList.size())
return itemList.takeAt(index);
else
return 0;
}
Qt::Orientations FlowLayout::expandingDirections() const
{
return 0;
}
bool FlowLayout::hasHeightForWidth() const
{
return true;
}
int FlowLayout::heightForWidth(int width) const
{
int height = doLayout(QRect(0, 0, width, 0), true);
return height;
}
void FlowLayout::setGeometry(const QRect &rect)
{
QLayout::setGeometry(rect);
doLayout(rect, false);
}
QSize FlowLayout::sizeHint() const
{
return minimumSize();
}
QSize FlowLayout::minimumSize() const
{
QSize size;
QLayoutItem *item;
foreach (item, itemList)
size = size.expandedTo(item->minimumSize());
size += QSize(2*margin(), 2*margin());
return size;
}
int FlowLayout::doLayout(const QRect &rect, bool testOnly) const
{
int x = rect.x();
int y = rect.y();
int lineHeight = 0;
QLayoutItem *item;
foreach (item, itemList) {
int nextX = x + item->sizeHint().width() + spacing();
if (nextX - spacing() > rect.right() && lineHeight > 0) {
x = rect.x();
y = y + lineHeight + spacing();
nextX = x + item->sizeHint().width() + spacing();
lineHeight = 0;
}
if (!testOnly)
item->setGeometry(QRect(QPoint(x, y), item->sizeHint()));
x = nextX;
lineHeight = qMax(lineHeight, item->sizeHint().height());
}
return y + lineHeight - rect.y();
}
/****************************************************************************
**
** Copyright (C) 2004-2008 Trolltech ASA. All rights reserved.
**
** This file is part of the documentation of the Qt Toolkit.
**
** This file may be used under the terms of the GNU General Public
** License versions 2.0 or 3.0 as published by the Free Software
** Foundation and appearing in the files LICENSE.GPL2 and LICENSE.GPL3
** included in the packaging of this file. Alternatively you may (at
** your option) use any later version of the GNU General Public
** License if such license has been publicly approved by Trolltech ASA
** (or its successors, if any) and the KDE Free Qt Foundation. In
** addition, as a special exception, Trolltech gives you certain
** additional rights. These rights are described in the Trolltech GPL
** Exception version 1.2, which can be found at
** http://www.trolltech.com/products/qt/gplexception/ and in the file
** GPL_EXCEPTION.txt in this package.
**
** Please review the following information to ensure GNU General
** Public Licensing requirements will be met:
** http://trolltech.com/products/qt/licenses/licensing/opensource/. If
** you are unsure which license is appropriate for your use, please
** review the following information:
** http://trolltech.com/products/qt/licenses/licensing/licensingoverview
** or contact the sales department at sales@trolltech.com.
**
** In addition, as a special exception, Trolltech, as the sole
** copyright holder for Qt Designer, grants users of the Qt/Eclipse
** Integration plug-in the right for the Qt/Eclipse Integration to
** link to functionality provided by Qt Designer and its related
** libraries.
**
** This file is provided "AS IS" with NO WARRANTY OF ANY KIND,
** INCLUDING THE WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE. Trolltech reserves all rights not expressly
** granted herein.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
****************************************************************************/
#ifndef FLOWLAYOUT_H
#define FLOWLAYOUT_H
#include <QLayout>
#include <QRect>
#include <QWidgetItem>
class FlowLayout : public QLayout
{
public:
FlowLayout(QWidget *parent, int margin = 0, int spacing = -1);
FlowLayout(int spacing = -1);
~FlowLayout();
void addItem(QLayoutItem *item);
Qt::Orientations expandingDirections() const;
bool hasHeightForWidth() const;
int heightForWidth(int) const;
int count() const;
QLayoutItem *itemAt(int index) const;
QSize minimumSize() const;
void setGeometry(const QRect &rect);
QSize sizeHint() const;
QLayoutItem *takeAt(int index);
private:
int doLayout(const QRect &rect, bool testOnly) const;
QList<QLayoutItem *> itemList;
};
#endif // FLOWLAYOUT_H
......@@ -65,6 +65,7 @@ KAboutData * newKritaAboutData()
aboutData->addAuthor(ki18n("Toshitaka Fujioka"), KLocalizedString(), "fujioka@kde.org");
aboutData->addAuthor(ki18n("Thomas Zander"), KLocalizedString(), "zander@kde.org");
aboutData->addAuthor(ki18n("Tom Burdick"), KLocalizedString(), "tburdi1@uic.edu");
aboutData->addAuthor(ki18n("Vera Lukman"), KLocalizedString(), "shichan.karachu@gmail.com");
aboutData->addAuthor(ki18n("Sander Koning"), KLocalizedString(), "sanderkoning@kde.nl");
aboutData->addAuthor(ki18n("Andreas Lundin"), KLocalizedString(), "adde@update.uu.se");
return aboutData;
......
......@@ -58,6 +58,8 @@
#include "kis_paintop_box.h"
#include "kis_custom_pattern.h"
#include "widgets/kis_pattern_chooser.h"
#include "kis_popup_palette.h"
#include "ko_favorite_resource_manager.h"
KisControlFrame::KisControlFrame(KisView2 * view, const char* name)
......@@ -113,6 +115,21 @@ KisControlFrame::KisControlFrame(KisView2 * view, const char* name)
view->actionCollection()->addAction("paintops", action);
action->setDefaultWidget(m_paintopBox);
/***TESTING***/
m_view->setFavoriteResourceManager(m_paintopBox);
m_paletteButton = new QPushButton("Save to Palette");
connect(m_paletteButton, SIGNAL(clicked()), this, SLOT(slotSaveToFavouriteBrushes()));
action = new KAction(i18n("&Palette"), this);
view->actionCollection()->addAction("palette_manager", action);
action->setDefaultWidget(m_paletteButton);
QPushButton* m_popupPaletteButton = new QPushButton("Palette (temp)");
connect(m_popupPaletteButton, SIGNAL(clicked()), this, SLOT(slotPaletteTemp()));
action = new KAction(i18n("&PopupPalette"), this);
view->actionCollection()->addAction("palette", action);
action->setDefaultWidget(m_popupPaletteButton);
}
......@@ -163,8 +180,32 @@ void KisControlFrame::createPatternsChooser(KisView2 * view)
chooser->setCurrentItem(0, 0);
if (chooser->currentResource())
view->resourceProvider()->slotPatternActivated(chooser->currentResource());
}
void KisControlFrame::slotPaletteTemp()
{
if(! m_view->favoriteResourceManager())
{
qDebug() << "favoriteResourceManager is not instantiated";
m_view->setFavoriteResourceManager(m_paintopBox);
}
else{
m_view->favoriteResourceManager()->showPopupPalette();
}
}
void KisControlFrame::slotSaveToFavouriteBrushes()
{
if(! m_view->favoriteResourceManager())
{
qDebug() << "favoriteResourceManager is not instantiated";
m_view->setFavoriteResourceManager(m_paintopBox);
}
else {
m_view->favoriteResourceManager()->showPaletteManager();
}
}
void KisControlFrame::createGradientsChooser(KisView2 * view)
{
......
......@@ -30,6 +30,7 @@
class QWidget;
class QTabWidget;
class QTableWidgetItem;
class QPushButton;
class KToolBar;
......@@ -65,6 +66,8 @@ public slots:
void slotSetPattern(KisPattern * pattern);
void slotSetGradient(KoAbstractGradient * gradient);
void slotSaveToFavouriteBrushes();
void slotPaletteTemp();
private:
......@@ -88,6 +91,7 @@ private:
KisGradientChooser * m_gradientChooser;
KisPaintopBox * m_paintopBox;
QPushButton* m_paletteButton;
};
#endif
......
/* This file is part of the KDE project
Copyright 2009 Vera Lukman <vla24@sfu.ca>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include "kis_favorite_brush_data.h"
#include "kis_popup_palette.h"
#include <kis_paintop_preset.h>
#include <kis_types.h>
#include <KoID.h>
#include <QDebug>
#include <QIcon>
#include <QToolButton>
KisFavoriteBrushData::KisFavoriteBrushData(KisPaintOpPresetSP newdata, QIcon* icon)
: m_button (0)
, m_data (newdata) // put this here instead of in the constructor is better style and more efficient.
{
// without a button, this class doesn't make sense, so always initialize it
m_button = new QToolButton();
m_button->setMinimumSize(KisPopupPalette::BUTTON_SIZE, KisPopupPalette::BUTTON_SIZE);
m_button->setMaximumSize(KisPopupPalette::BUTTON_SIZE, KisPopupPalette::BUTTON_SIZE);
m_button->connect(m_button, SIGNAL(clicked()), this, SLOT(slotBrushButtonClicked()));
if (icon) m_button->setIcon(*icon);
}
void KisFavoriteBrushData::slotBrushButtonClicked()
{
qDebug() << "Brush name:" << m_data->paintOp();
}
KisPaintOpPresetSP KisFavoriteBrushData::paintopPreset()
{
return m_data;
}
void KisFavoriteBrushData::setIcon (QIcon* icon)
{
m_button->setIcon(*icon);
}
QToolButton* KisFavoriteBrushData::paintopButton()
{
return m_button;
}
KisFavoriteBrushData::~KisFavoriteBrushData()
{
qDebug() << "Brush name:" << m_data->paintOp() << "deleting";
// don't delete m_data, it's a shared pointer
// only delete the button if it hasn't got a parent object, otherwise
// we have a double delete
if (!m_button->parent()) {
delete m_button;
}
}
#include "kis_favorite_brush_data.moc"
/* This file is part of the KDE project
Copyright 2009 Vera Lukman <vla24@sfu.ca>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KIS_FAVORITE_BRUSH_DATA_H
#define KIS_FAVORITE_BRUSH_DATA_H
#include <QObject>
#include <kis_types.h>
class QToolButton;
class QIcon;
class KisFavoriteBrushData : public QObject
{
Q_OBJECT
public:
KisFavoriteBrushData(KisPaintOpPresetSP, QIcon * = 0);
~KisFavoriteBrushData();
KisPaintOpPresetSP paintopPreset(); //CHANGE TO KisPresetPaintOpSP
void setIcon (QIcon*);
QToolButton* paintopButton();
private:
QToolButton* m_button;
KisPaintOpPresetSP m_data; //CHANGE TO KisPresetPaintOpSP
private slots:
void slotBrushButtonClicked();
};
#endif // KIS_FAVORITE_BRUSH_DATA_H
......@@ -58,6 +58,9 @@
#include "widgets/kis_paintop_presets_popup.h"
#include <kis_paintop_settings_widget.h>
#include "kis_favorite_brush_data.h"
#include "ko_favorite_resource_manager.h"
KisPaintopBox::KisPaintopBox(KisView2 * view, QWidget *parent, const char * name)
: QWidget(parent)
, m_resourceProvider(view->resourceProvider())
......@@ -113,12 +116,21 @@ KisPaintopBox::~KisPaintopBox()
{
// Do not delete the widget, since it it is global to the application, not owned by the view
m_presetsPopup->setPaintOpSettingsWidget(0);
}
foreach(const PresetMap& h, m_inputDevicePresets.values()) {
foreach(KisPaintOpPresetSP preset, h.values()) {
preset.clear();
}
}
KisPaintOpPresetSP KisPaintopBox::paintOpPresetSP(KoID* paintop)
{
if (paintop == 0)
return m_activePreset->clone();
else if (!QString::compare(paintop->id(), "eraser", Qt::CaseInsensitive))
return activePreset(*paintop, KoInputDevice::eraser());
else
return activePreset(*paintop, KoToolManager::instance()->currentInputDevice());
}
const KoID& KisPaintopBox::currentPaintopKoID()
{
return currentPaintop();
}
void KisPaintopBox::slotItemSelected(int index)
......@@ -223,7 +235,7 @@ void KisPaintopBox::slotCurrentNodeChanged(KisNodeSP node)
const KoID& KisPaintopBox::currentPaintop()
{
KoID id = m_currentID[KoToolManager::instance()->currentInputDevice()];
return m_currentID[KoToolManager::instance()->currentInputDevice()];;
return m_currentID[KoToolManager::instance()->currentInputDevice()];
}
......@@ -277,6 +289,10 @@ void KisPaintopBox::setCurrentPaintop(const KoID & paintop)
m_activePreset = preset;
m_presetWidget->setPreset(m_activePreset);
m_presetsPopup->presetPreview()->setPreset(m_activePreset);
//TODO: FIX THIS! use signal and slot instead!
if (m_view->favoriteResourceManager() != 0)
m_view->favoriteResourceManager()->changeCurrentBrush();
}
KoID KisPaintopBox::defaultPaintop(const KoInputDevice & inputDevice)
......
......@@ -63,7 +63,9 @@ class KisPaintopBox : public QWidget
public:
KisPaintopBox(KisView2 * view, QWidget * parent, const char * name);
KisPaintOpPresetSP paintOpPresetSP(KoID * = 0);
const KoID& currentPaintopKoID();
QPixmap paintopPixmap(const KoID & paintop);
~KisPaintopBox();
public slots:
......@@ -77,7 +79,6 @@ public slots:
private:
QPixmap paintopPixmap(const KoID & paintop);
const KoID & currentPaintop();
void setCurrentPaintop(const KoID & paintop);
KoID defaultPaintop(const KoInputDevice & inputDevice);
......
/* This file is part of the KDE project
Copyright 2009 Vera Lukman <vla24@sfu.ca>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
Known issues:
1. Current brush settings cannot be displayed yet due to a bug in Krita.
Open paintopBox, open the Palette Manager, open paintopBox again.
Notice that the setting widget is gone.
Opening the Palette Manager will crash the program.
2. KoID.name() doesn't work properly (line 135, 157)
Open the Palette Manager.
Save currently active brush, close manager.
Open the Palette Manager, the brush name changes to 'default'.
*/
#include "kis_palette_manager.h"
#include <QtGui>
#include <kis_paintop_settings_widget.h>
#include <KoToolManager.h>
#include <KoID.h>
#include <kglobal.h>
#include "kis_paintop_box.h"
#include "widgets/kis_preset_widget.h"
#include "KoID.h"
#include "KoInputDevice.h"
#include "kis_image.h"
#include "kis_paintop_settings.h"
#include "kis_paintop_registry.h"
#include "kis_paintop_settings_widget.h"
#include "kis_shared_ptr.h"
#include "kis_favorite_brush_data.h"
#include "ko_favorite_resource_manager.h"
KisPaletteManager::KisPaletteManager(KoFavoriteResourceManager *manager, KisPaintopBox *paintOpBox)
: QDialog(paintOpBox)
, m_model(0)
, m_brushList (0)
, m_saveButton(0)
, m_removeButton(0)
, m_resourceManager(manager)
, m_paintOpBox(paintOpBox)
, m_currentBrushLabel(0)
{
setWindowTitle("Krita - Palette Manager");
m_currentBrushLabel = new QLabel ("");
/*SETTING MODEL*/
m_model = new QStringListModel();
resetDataModel();
/*LEFT COMPONENTS*/
QFrame *HSeparator = new QFrame();
HSeparator->setFrameStyle(QFrame::HLine | QFrame::Sunken);
m_saveButton = new QPushButton (tr("&Save to Palette"));
m_saveButton->setSizePolicy(QSizePolicy::Fixed , QSizePolicy::Fixed);
/*LEFT LAYOUT*/
QVBoxLayout *leftLayout = new QVBoxLayout ();
leftLayout->addWidget(new QLabel (tr("Current Brush")));
leftLayout->addWidget(HSeparator);
leftLayout->addWidget(m_currentBrushLabel);
// leftLayout->addWidget(paintOpSettings->widget());
leftLayout->addStretch();
leftLayout->addWidget(m_saveButton);
/*CENTER COMPONENT : Divider*/
QFrame *VSeparator = new QFrame();
VSeparator->setFrameStyle(QFrame::VLine | QFrame::Sunken);
/*RIGHT COMPONENTS*/
m_brushList = new QListView;
m_brushList->setModel(m_model);
m_brushList->setWordWrap(true);
m_removeButton = new QPushButton(tr("Remove Brush"));
m_removeButton->setSizePolicy(QSizePolicy::Fixed , QSizePolicy::Fixed);
m_removeButton->setEnabled(false);//set the button to center
/*RIGHT LAYOUT*/
QVBoxLayout *rightLayout = new QVBoxLayout();
rightLayout->addWidget(new QLabel(tr("Favorite Brushes")));
rightLayout->addWidget(m_brushList);
rightLayout->addWidget(m_removeButton);
/*MAIN LAYOUT*/
QHBoxLayout *mainLayout = new QHBoxLayout();
mainLayout->addLayout(leftLayout);
mainLayout->addWidget(VSeparator);
mainLayout->addLayout(rightLayout);
this->setLayout(mainLayout);
this->changeCurrentBrushLabel();
/*SIGNALS AND SLOTS*/
connect(m_brushList, SIGNAL(pressed(QModelIndex)), this, SLOT(slotEnableRemoveButton()));
connect(m_removeButton, SIGNAL(clicked()), this, SLOT(slotDeleteBrush()));
connect(m_saveButton, SIGNAL(clicked()), this, SLOT(slotAddBrush()));
}
void KisPaletteManager::changeCurrentBrushLabel()
{
m_currentBrushLabel->setText(m_paintOpBox->currentPaintopKoID().id());
//m_paintOpBox->currentPaintopKoID().name() doesnt work properly.
}
void KisPaletteManager::resetDataModel()
{
int pos = 0;
for (pos=0; pos < m_resourceManager->favoriteBrushesTotal(); pos ++)
{
m_nameList.append(m_resourceManager->favoriteBrush(pos)->paintopPreset()->paintOp().id());
}
m_model->setStringList(m_nameList);
}
void KisPaletteManager::slotAddBrush()
{
if (m_resourceManager->isFavoriteBrushesFull()) return;
KisPaintOpPresetSP newBrush = m_paintOpBox->paintOpPresetSP();
int pos = m_resourceManager->addFavoriteBrush(newBrush);
QModelIndex index;
if (pos > -1)
{
index = m_model->index(pos);
}
else
{
m_nameList.append(m_paintOpBox->currentPaintopKoID().id());
m_model->setStringList(m_nameList);
index = m_model->index(m_resourceManager->favoriteBrushesTotal()-1);
}
m_brushList->setCurrentIndex(index);
slotEnableRemoveButton();
}
void KisPaletteManager::slotEnableRemoveButton()
{
QModelIndex index = m_brushList->currentIndex();
m_removeButton->setEnabled(index.row() != -1);
}
void KisPaletteManager::slotDeleteBrush()
{
int pos = m_brushList->currentIndex().row();
m_nameList.removeAt(pos);
m_resourceManager->removeFavoriteBrush(pos);
m_model->setStringList(m_nameList);
m_removeButton->setEnabled(false);
}
KisPaletteManager::~KisPaletteManager()
{