Commit 3570221c authored by Boudewijn Rempt's avatar Boudewijn Rempt

Second part of KoFavorite/KisFavoriteResourceManager rename

parent 7da528fa
......@@ -106,7 +106,7 @@ public:
int openGLFilterMode;
#endif
KisToolProxy *toolProxy;
KoFavoriteResourceManager *favoriteResourceManager;
KisFavoriteResourceManager *favoriteResourceManager;
#ifdef HAVE_OPENGL
KisOpenGLImageTexturesSP openGLImageTextures;
#endif
......@@ -792,7 +792,7 @@ QPoint KisCanvas2::documentOffset() const
void KisCanvas2::createFavoriteResourceManager(KisPaintopBox* paintopbox)
{
m_d->favoriteResourceManager = new KoFavoriteResourceManager(paintopbox, canvasWidget());
m_d->favoriteResourceManager = new KisFavoriteResourceManager(paintopbox, canvasWidget());
connect(this, SIGNAL(favoritePaletteCalled(QPoint)), favoriteResourceManager(), SLOT(slotShowPopupPalette(QPoint)));
connect(view()->resourceProvider(), SIGNAL(sigFGColorUsed(KoColor)), favoriteResourceManager(), SLOT(slotAddRecentColor(KoColor)));
connect(view()->resourceProvider(), SIGNAL(sigFGColorChanged(KoColor)), favoriteResourceManager(), SLOT(slotChangeFGColorSelector(KoColor)));
......@@ -800,7 +800,7 @@ void KisCanvas2::createFavoriteResourceManager(KisPaintopBox* paintopbox)
connect(favoriteResourceManager(), SIGNAL(sigEnableChangeColor(bool)), view()->resourceProvider(), SLOT(slotResetEnableFGChange(bool)));
}
KoFavoriteResourceManager* KisCanvas2::favoriteResourceManager()
KisFavoriteResourceManager* KisCanvas2::favoriteResourceManager()
{
return m_d->favoriteResourceManager;
}
......
......@@ -40,7 +40,7 @@ class KoColorProfile;
class KisCanvasDecoration;
class KisView2;
class KisPaintopBox;
class KoFavoriteResourceManager;
class KisFavoriteResourceManager;
class KisDisplayFilter;
class KisInputManager;
......@@ -229,7 +229,7 @@ public:
void resetCanvas(bool useOpenGL);
void createFavoriteResourceManager(KisPaintopBox*);
KoFavoriteResourceManager* favoriteResourceManager();
KisFavoriteResourceManager* favoriteResourceManager();
bool handlePopupPaletteIsVisible();
private:
......
......@@ -36,11 +36,11 @@
#include "kis_resource_server_provider.h"
#ifndef _MSC_EXTENSIONS
const int KoFavoriteResourceManager::MAX_FAVORITE_PRESETS;
//const int KoFavoriteResourceManager::MAX_RECENT_COLORS;
const int KisFavoriteResourceManager::MAX_FAVORITE_PRESETS;
//const int KisFavoriteResourceManager::MAX_RECENT_COLORS;
#endif
KoFavoriteResourceManager::KoFavoriteResourceManager(KisPaintopBox *paintopBox, QWidget* popupParent)
KisFavoriteResourceManager::KisFavoriteResourceManager(KisPaintopBox *paintopBox, QWidget* popupParent)
: m_favoriteBrushManager(0)
, m_popupPalette(0)
, m_paintopBox(paintopBox)
......@@ -59,7 +59,7 @@ KoFavoriteResourceManager::KoFavoriteResourceManager(KisPaintopBox *paintopBox,
rServer->addObserver(this);
}
KoFavoriteResourceManager::~KoFavoriteResourceManager()
KisFavoriteResourceManager::~KisFavoriteResourceManager()
{
KoResourceServer<KisPaintOpPreset>* rServer = KisResourceServerProvider::instance()->paintOpPresetServer();
rServer->removeObserver(this);
......@@ -67,24 +67,24 @@ KoFavoriteResourceManager::~KoFavoriteResourceManager()
delete m_colorList;
}
void KoFavoriteResourceManager::unsetResourceServer()
void KisFavoriteResourceManager::unsetResourceServer()
{
// ...
}
QStringList KoFavoriteResourceManager::favoritePresetList()
QStringList KisFavoriteResourceManager::favoritePresetList()
{
return m_favoritePresetsList;
}
//Popup Palette
void KoFavoriteResourceManager::slotShowPopupPalette(const QPoint &p)
void KisFavoriteResourceManager::slotShowPopupPalette(const QPoint &p)
{
if (!m_popupPalette) return;
else m_popupPalette->showPopupPalette(p);
}
void KoFavoriteResourceManager::resetPopupPaletteParent(QWidget* w)
void KisFavoriteResourceManager::resetPopupPaletteParent(QWidget* w)
{
if (m_popupPalette)
{
......@@ -92,7 +92,7 @@ void KoFavoriteResourceManager::resetPopupPaletteParent(QWidget* w)
}
}
QList<QImage> KoFavoriteResourceManager::favoritePresetImages()
QList<QImage> KisFavoriteResourceManager::favoritePresetImages()
{
QList<QImage> images;
KoResourceServer<KisPaintOpPreset>* rServer = KisResourceServerProvider::instance()->paintOpPresetServer();
......@@ -108,7 +108,7 @@ QList<QImage> KoFavoriteResourceManager::favoritePresetImages()
return images;
}
void KoFavoriteResourceManager::slotChangeActivePaintop(int pos)
void KisFavoriteResourceManager::slotChangeActivePaintop(int pos)
{
if (pos < 0 || pos >= m_favoritePresetsList.size()) return;
......@@ -121,14 +121,14 @@ void KoFavoriteResourceManager::slotChangeActivePaintop(int pos)
}
}
bool KoFavoriteResourceManager::isPopupPaletteVisible()
bool KisFavoriteResourceManager::isPopupPaletteVisible()
{
if (!m_popupPalette) return false;
else return m_popupPalette->isVisible();
}
//Palette Manager
void KoFavoriteResourceManager::showPaletteManager()
void KisFavoriteResourceManager::showPaletteManager()
{
if (!m_favoriteBrushManager)
......@@ -140,7 +140,7 @@ void KoFavoriteResourceManager::showPaletteManager()
}
//Favorite Brushes
int KoFavoriteResourceManager::addFavoritePreset(const QString& name)
int KisFavoriteResourceManager::addFavoritePreset(const QString& name)
{
int pos = isFavoriteBrushSaved(name);
......@@ -165,12 +165,12 @@ int KoFavoriteResourceManager::addFavoritePreset(const QString& name)
}
}
int KoFavoriteResourceManager::isFavoriteBrushSaved(const QString& name)
int KisFavoriteResourceManager::isFavoriteBrushSaved(const QString& name)
{
return m_favoritePresetsList.indexOf(name);
}
void KoFavoriteResourceManager::removeFavoritePreset(int pos)
void KisFavoriteResourceManager::removeFavoritePreset(int pos)
{
if (pos < 0 || pos > m_favoritePresetsList.size())
{
......@@ -183,23 +183,23 @@ void KoFavoriteResourceManager::removeFavoritePreset(int pos)
}
}
void KoFavoriteResourceManager::removeFavoritePreset(const QString& name)
void KisFavoriteResourceManager::removeFavoritePreset(const QString& name)
{
int pos = isFavoriteBrushSaved(name);
if (pos > -1) removeFavoritePreset(pos);
}
bool KoFavoriteResourceManager::isFavoritePresetsFull()
bool KisFavoriteResourceManager::isFavoritePresetsFull()
{
return m_favoritePresetsList.size() == KoFavoriteResourceManager::MAX_FAVORITE_PRESETS;
return m_favoritePresetsList.size() == KisFavoriteResourceManager::MAX_FAVORITE_PRESETS;
}
int KoFavoriteResourceManager::numFavoritePresets()
int KisFavoriteResourceManager::numFavoritePresets()
{
return m_favoritePresetsList.size();
}
void KoFavoriteResourceManager::saveFavoritePresets()
void KisFavoriteResourceManager::saveFavoritePresets()
{
QString favoriteList;
......@@ -216,9 +216,9 @@ void KoFavoriteResourceManager::saveFavoritePresets()
}
//Recent Colors
void KoFavoriteResourceManager::slotUpdateRecentColor(int pos)
void KisFavoriteResourceManager::slotUpdateRecentColor(int pos)
{
// qDebug() << "[KoFavoriteResourceManager] selected color: " << recentColorAt(pos)
// qDebug() << "[KisFavoriteResourceManager] selected color: " << recentColorAt(pos)
// << "(r)" << recentColorAt(pos).red() << "(g)" << recentColorAt(pos).green()
// << "(b)" << recentColorAt(pos).blue();
......@@ -228,21 +228,21 @@ void KoFavoriteResourceManager::slotUpdateRecentColor(int pos)
m_popupPalette->showPopupPalette(false); //automatically close the palette after a button is clicked.
}
void KoFavoriteResourceManager::slotAddRecentColor(const KoColor& color)
void KisFavoriteResourceManager::slotAddRecentColor(const KoColor& color)
{
addRecentColor(color);
}
void KoFavoriteResourceManager::slotChangeFGColorSelector(KoColor c)
void KisFavoriteResourceManager::slotChangeFGColorSelector(KoColor c)
{
QColor color;
color = c.toQColor();
//qDebug() << "[KoFavoriteResourceManager] slotChangeFGColorSelector | color " << color ;
//qDebug() << "[KisFavoriteResourceManager] slotChangeFGColorSelector | color " << color ;
emit sigChangeFGColorSelector(color);
}
void KoFavoriteResourceManager::addRecentColorUpdate(int guipos)
void KisFavoriteResourceManager::addRecentColorUpdate(int guipos)
{
// Do not update the key, the colour might be selected but it is not used yet. So we are not supposed
// to update the colour priority when we select it.
......@@ -257,7 +257,7 @@ void KoFavoriteResourceManager::addRecentColorUpdate(int guipos)
printColors();
}
void KoFavoriteResourceManager::addRecentColor(const KoColor& color)
void KisFavoriteResourceManager::addRecentColor(const KoColor& color)
{
m_colorList->append(color);
int pos = m_colorList->findPos(color);
......@@ -270,7 +270,7 @@ void KoFavoriteResourceManager::addRecentColor(const KoColor& color)
printColors();
}
void KoFavoriteResourceManager::removingResource(KisPaintOpPreset* resource)
void KisFavoriteResourceManager::removingResource(KisPaintOpPreset* resource)
{
if(m_blockUpdates) {
return;
......@@ -278,23 +278,23 @@ void KoFavoriteResourceManager::removingResource(KisPaintOpPreset* resource)
removeFavoritePreset(resource->name());
}
void KoFavoriteResourceManager::resourceAdded(KisPaintOpPreset* /*resource*/)
void KisFavoriteResourceManager::resourceAdded(KisPaintOpPreset* /*resource*/)
{
}
void KoFavoriteResourceManager::resourceChanged(KisPaintOpPreset* /*resource*/)
void KisFavoriteResourceManager::resourceChanged(KisPaintOpPreset* /*resource*/)
{
}
void KoFavoriteResourceManager::setBlockUpdates(bool block)
void KisFavoriteResourceManager::setBlockUpdates(bool block)
{
m_blockUpdates = block;
}
void KoFavoriteResourceManager::syncTaggedResourceView(){}
void KisFavoriteResourceManager::syncTaggedResourceView(){}
void KoFavoriteResourceManager::syncTagAddition(const QString& /*tag*/){}
void KisFavoriteResourceManager::syncTagAddition(const QString& /*tag*/){}
void KoFavoriteResourceManager::syncTagRemoval(const QString& /*tag*/){}
void KisFavoriteResourceManager::syncTagRemoval(const QString& /*tag*/){}
#include "kis_favorite_resource_manager.moc"
......@@ -37,14 +37,14 @@ class KisPaintopBox;
class KisPaletteManager;
class KisView2;
class KoFavoriteResourceManager : public QObject, public KoResourceServerObserver<KisPaintOpPreset>
class KisFavoriteResourceManager : public QObject, public KoResourceServerObserver<KisPaintOpPreset>
{
Q_OBJECT
public:
KoFavoriteResourceManager(KisPaintopBox*, QWidget* = 0);
~KoFavoriteResourceManager();
KisFavoriteResourceManager(KisPaintopBox*, QWidget* = 0);
~KisFavoriteResourceManager();
virtual void unsetResourceServer();
......
......@@ -807,7 +807,7 @@ void KisPaintopBox::slotPreviousFavoritePreset()
if (!m_view->canvasBase()->favoriteResourceManager()) {
m_view->canvasBase()->createFavoriteResourceManager(this);
}
KoFavoriteResourceManager *mgr = m_view->canvasBase()->favoriteResourceManager();
KisFavoriteResourceManager *mgr = m_view->canvasBase()->favoriteResourceManager();
int i = 0;
foreach (const QString &preset, mgr->favoritePresetList()) {
if (m_resourceProvider->currentPreset()->name() == preset) {
......@@ -829,7 +829,7 @@ void KisPaintopBox::slotNextFavoritePreset()
if (!m_view->canvasBase()->favoriteResourceManager()) {
m_view->canvasBase()->createFavoriteResourceManager(this);
}
KoFavoriteResourceManager *mgr = m_view->canvasBase()->favoriteResourceManager();
KisFavoriteResourceManager *mgr = m_view->canvasBase()->favoriteResourceManager();
int i = 0;
foreach (const QString &preset, mgr->favoritePresetList()) {
if (m_resourceProvider->currentPreset()->name() == preset) {
......
......@@ -54,7 +54,7 @@
#include "kis_preset_chooser.h"
#include <kconfiggroup.h>
KisPaletteManager::KisPaletteManager(KoFavoriteResourceManager *manager, KisPaintopBox *paintOpBox)
KisPaletteManager::KisPaletteManager(KisFavoriteResourceManager *manager, KisPaintopBox *paintOpBox)
: KDialog(paintOpBox)
, m_saveButton(0)
, m_removeButton(0)
......
......@@ -29,7 +29,7 @@ class QStringListModel;
class QListView;
class QLabel;
class QPushButton;
class KoFavoriteResourceManager;
class KisFavoriteResourceManager;
class KisPaintopBox;
class KisPresetChooser;
......@@ -38,7 +38,7 @@ class KisPaletteManager : public KDialog
Q_OBJECT
public:
KisPaletteManager(KoFavoriteResourceManager*, KisPaintopBox*);
KisPaletteManager(KisFavoriteResourceManager*, KisPaintopBox*);
~KisPaletteManager();
virtual void showEvent(QShowEvent* );
......@@ -56,7 +56,7 @@ private slots:
private:
QPushButton *m_saveButton;
QPushButton *m_removeButton;
KoFavoriteResourceManager *m_resourceManager;
KisFavoriteResourceManager *m_resourceManager;
KisPresetChooser* m_allPresetsView;
KisPresetChooser* m_palettePresetsView;
};
......
......@@ -77,7 +77,7 @@ private:
bool m_dragging;
};
KisPopupPalette::KisPopupPalette(KoFavoriteResourceManager* manager, QWidget *parent)
KisPopupPalette::KisPopupPalette(KisFavoriteResourceManager* manager, QWidget *parent)
: QWidget(parent, Qt::FramelessWindowHint)
, m_resourceManager (manager)
, m_triangleColorSelector (0)
......
......@@ -25,7 +25,7 @@
#include <KoTriangleColorSelector.h>
class KisFavoriteBrushData;
class KoFavoriteResourceManager;
class KisFavoriteResourceManager;
class QWidget;
class KisTriangleColorSelector;
class KoColor;
......@@ -38,7 +38,7 @@ class KisPopupPalette : public QWidget
Q_PROPERTY (int selectedColor READ selectedColor WRITE setSelectedColor)
public:
KisPopupPalette(KoFavoriteResourceManager* , QWidget *parent=0);
KisPopupPalette(KisFavoriteResourceManager* , QWidget *parent=0);
~KisPopupPalette();
QSize sizeHint() const;
......@@ -86,7 +86,7 @@ private:
int m_hoveredPreset;
int m_hoveredColor;
int m_selectedColor;
KoFavoriteResourceManager* m_resourceManager;
KisFavoriteResourceManager* m_resourceManager;
KoTriangleColorSelector* m_triangleColorSelector;
QTimer* m_timer;
......
......@@ -52,7 +52,7 @@ class KisSelectionManager;
class KisStatusBar;
class KisUndoAdapter;
class KisZoomManager;
class KoFavoriteResourceManager;
class KisFavoriteResourceManager;
class KisPaintopBox;
class KisCanvasController;
class KisFlipbook;
......
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