Commit 92a96dda authored by Martin Koller's avatar Martin Koller
Browse files

Use KDE::icon() to find icons installed by kolourpaint

When run without the frameworks-integration plugin (e.g. in a non-
KDE desktop environment), no tool icons are loaded, because
QIcon::fromTheme() does not automatically search per-application
icons. KDE::icon() finds these icons
parent 23468c3f
......@@ -46,6 +46,7 @@
#include <ktoolbarpopupaction.h>
#include <kactioncollection.h>
#include <kconfiggroup.h>
#include <kiconloader.h>
#include <kpCommand.h>
#include <kpCommandEnvironment.h>
......@@ -54,6 +55,7 @@
#include <kpMainWindow.h>
#include <kpTool.h>
//---------------------------------------------------------------------
//template <typename T>
static void ClearPointerList (QLinkedList <kpCommand *> *listPtr)
......@@ -76,12 +78,12 @@ kpCommandHistoryBase::kpCommandHistoryBase (bool doReadConfig,
KActionCollection *ac)
: d (new kpCommandHistoryBasePrivate ())
{
m_actionUndo = new KToolBarPopupAction (QIcon::fromTheme ("edit-undo"), undoActionText (), this);
m_actionUndo = new KToolBarPopupAction(KDE::icon("edit-undo"), undoActionText (), this);
ac->addAction (KStandardAction::name (KStandardAction::Undo), m_actionUndo);
ac->setDefaultShortcuts (m_actionUndo, KStandardShortcut::shortcut (KStandardShortcut::Undo));
connect (m_actionUndo, SIGNAL(triggered(bool)), this, SLOT (undo ()));
m_actionRedo = new KToolBarPopupAction (QIcon::fromTheme ("edit-redo"), redoActionText (), this);
m_actionRedo = new KToolBarPopupAction(KDE::icon("edit-redo"), redoActionText (), this);
ac->addAction (KStandardAction::name (KStandardAction::Redo), m_actionRedo);
ac->setDefaultShortcuts (m_actionRedo, KStandardShortcut::shortcut (KStandardShortcut::Redo));
connect (m_actionRedo, SIGNAL(triggered(bool)), this, SLOT (redo ()));
......
......@@ -103,7 +103,7 @@ void kpMainWindow::setupFileMenuActions ()
d->actionExport = ac->addAction("file_export");
d->actionExport->setText (i18n ("E&xport..."));
d->actionExport->setIcon (QIcon::fromTheme ("document-export"));
d->actionExport->setIcon(KDE::icon("document-export"));
connect(d->actionExport, SIGNAL(triggered(bool) ), SLOT (slotExport ()));
d->actionScan = ac->addAction("file_scan");
......@@ -117,13 +117,13 @@ void kpMainWindow::setupFileMenuActions ()
d->actionProperties = ac->addAction ("file_properties");
d->actionProperties->setText (i18n ("Properties"));
d->actionProperties->setIcon (QIcon::fromTheme ("document-properties"));
d->actionProperties->setIcon(KDE::icon("document-properties"));
connect (d->actionProperties, SIGNAL (triggered (bool)), SLOT (slotProperties ()));
//d->actionRevert = KStandardAction::revert (this, SLOT (slotRevert ()), ac);
d->actionReload = ac->addAction ("file_revert");
d->actionReload->setText (i18n ("Reloa&d"));
d->actionReload->setIcon (QIcon::fromTheme ("view-refresh"));
d->actionReload->setIcon(KDE::icon("view-refresh"));
connect(d->actionReload, SIGNAL(triggered(bool) ), SLOT (slotReload ()));
ac->setDefaultShortcuts (d->actionReload, KStandardShortcut::reload ());
slotEnableReload ();
......
......@@ -41,6 +41,7 @@
#include <kdebug.h>
#include <klocale.h>
#include <KToggleAction>
#include <kiconloader.h>
#include <kpAbstractImageSelection.h>
#include <kpColor.h>
......@@ -141,19 +142,19 @@ void kpMainWindow::setupImageMenuActions ()
d->actionRotate = ac->addAction ("image_rotate");
d->actionRotate->setText (i18n ("&Rotate..."));
d->actionRotate->setIcon (QIcon::fromTheme ("transform-rotate"));
d->actionRotate->setIcon(KDE::icon("transform-rotate"));
connect (d->actionRotate, SIGNAL (triggered (bool)), SLOT (slotRotate ()));
ac->setDefaultShortcut (d->actionRotate, Qt::CTRL + Qt::Key_R);
d->actionRotateLeft = ac->addAction ("image_rotate_270deg");
d->actionRotateLeft->setText (i18n ("Rotate &Left"));
d->actionRotateLeft->setIcon (QIcon::fromTheme ("object-rotate-left"));
d->actionRotateLeft->setIcon(KDE::icon("object-rotate-left"));
connect (d->actionRotateLeft, SIGNAL (triggered (bool)), SLOT (slotRotate270 ()));
ac->setDefaultShortcut (d->actionRotateLeft, Qt::CTRL + Qt::SHIFT + Qt::Key_Left);
d->actionRotateRight = ac->addAction ("image_rotate_90deg");
d->actionRotateRight->setText (i18n ("Rotate Righ&t"));
d->actionRotateRight->setIcon (QIcon::fromTheme ("object-rotate-right"));
d->actionRotateRight->setIcon(KDE::icon("object-rotate-right"));
connect (d->actionRotateRight, SIGNAL (triggered (bool)), SLOT (slotRotate90 ()));
ac->setDefaultShortcut (d->actionRotateRight, Qt::CTRL + Qt::SHIFT + Qt::Key_Right);
......
/*
Copyright (c) 2003-2007 Clarence Dang <dang@kde.org>
All rights reserved.
......@@ -39,6 +38,7 @@
#include <klocale.h>
#include <KToolBar>
#include <ktoggleaction.h>
#include <kiconloader.h>
#include <kpColorToolBar.h>
#include <kpDefs.h>
......@@ -65,25 +65,25 @@ void kpMainWindow::setupTextToolBarActions ()
this, SLOT (slotTextFontSizeChanged ()));
d->actionTextBold = ac->add<KToggleAction> ("text_bold");
d->actionTextBold->setIcon (QIcon::fromTheme ("format-text-bold"));
d->actionTextBold->setIcon(KDE::icon("format-text-bold"));
d->actionTextBold->setText (i18n ("Bold"));
connect (d->actionTextBold, SIGNAL (triggered (bool)),
SLOT (slotTextBoldChanged ()));
d->actionTextItalic = ac->add<KToggleAction> ("text_italic");
d->actionTextItalic->setIcon (QIcon::fromTheme ("format-text-italic"));
d->actionTextItalic->setIcon (KDE::icon("format-text-italic"));
d->actionTextItalic->setText (i18n ("Italic"));
connect (d->actionTextItalic, SIGNAL (triggered (bool)),
SLOT (slotTextItalicChanged ()));
d->actionTextUnderline = ac->add<KToggleAction> ("text_underline");
d->actionTextUnderline->setIcon (QIcon::fromTheme ("format-text-underline"));
d->actionTextUnderline->setIcon (KDE::icon("format-text-underline"));
d->actionTextUnderline->setText (i18n ("Underline"));
connect (d->actionTextUnderline, SIGNAL (triggered (bool)),
SLOT (slotTextUnderlineChanged ()));
d->actionTextStrikeThru = ac->add<KToggleAction> ("text_strike_thru");
d->actionTextStrikeThru->setIcon (QIcon::fromTheme ("format-text-strikethrough"));
d->actionTextStrikeThru->setIcon(KDE::icon("format-text-strikethrough"));
d->actionTextStrikeThru->setText (i18n ("Strike Through"));
connect (d->actionTextStrikeThru, SIGNAL (triggered (bool)),
SLOT (slotTextStrikeThruChanged ()));
......
......@@ -26,18 +26,18 @@
*/
#include <kpToolAction.h>
#include <kactioncollection.h>
#include <kpTool.h>
#include <kiconloader.h>
//---------------------------------------------------------------------
kpToolAction::kpToolAction(const QString &text,
const QString &pic, const QList<QKeySequence> &shortcut,
const QObject *receiver, const char *slot,
KActionCollection *ac, const QString &name)
: KToggleAction(QIcon::fromTheme(pic), text, ac)
: KToggleAction(KDE::icon(pic), text, ac)
{
ac->setDefaultShortcuts(this, shortcut);
......
/*
Copyright (c) 2003-2007 Clarence Dang <dang@kde.org>
All rights reserved.
......@@ -35,6 +34,7 @@
#include <kdebug.h>
#include <klocale.h>
#include <kiconloader.h>
#include <kpDefs.h>
#include <kpDocument.h>
......@@ -45,6 +45,7 @@
#include <kpToolAction.h>
#include <kpViewManager.h>
//---------------------------------------------------------------------
struct DrawZoomRectPackage
{
......@@ -78,7 +79,7 @@ kpToolZoom::kpToolZoom (kpToolEnvironment *environ, QWidget *parent)
d (new kpToolZoomPrivate ())
{
// different from objectName()
action()->setIcon(QIcon::fromTheme("zoom-original"));
action()->setIcon(KDE::icon("zoom-original"));
}
//---------------------------------------------------------------------
......
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