Use Qt's native icon theme support rather than our own
authorManuel Nickschas <sputnick@quassel-irc.org>
Sat, 25 Oct 2014 20:03:34 +0000 (22:03 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sat, 25 Oct 2014 21:16:33 +0000 (23:16 +0200)
For the longest time, we've had our own icon loader (or used KDE's)
in order to provide rudimentary icon theme support. However, since
2009, Qt has had native support for loading icons from themes. In recent
version (due to platform integration etc.), proper icon theme support
has gotten much more complex too... things like theme inheritance,
proper fallback policies, specialized states and so on have never been
supported by our simple custom icon loader.

This commit switches all icon loading to QIcon::fromTheme().

The downside is that we have little control about Qt's icon loader,
which may cause issues with some of the non-standard icons we ship.
In case of the native Qt icon loader being used, we define fallbacks
that should find the extra icons. If you use Qt5 and have the
KDE Frameworks integration plugin for Qt enabled, these fallbacks won't
work unfortunately. If you see missing icons, you may have to install
Quassel's 'hicolor' icons into /usr/share/icons/hicolor so they get
picked up.

For non-Linux platforms, we recommend using the bundled Oxygen icon
set (this is the default).

41 files changed:
src/qtui/aboutdlg.cpp
src/qtui/bufferwidget.cpp
src/qtui/channellistdlg.cpp
src/qtui/chatitem.cpp
src/qtui/chatmonitorview.cpp
src/qtui/chatscene.cpp
src/qtui/chatviewsearchbar.cpp
src/qtui/coreconfigwizard.cpp
src/qtui/coreconnectdlg.cpp
src/qtui/coreconnectionstatuswidget.cpp
src/qtui/indicatornotificationbackend.cpp
src/qtui/inputwidget.cpp
src/qtui/knotificationbackend.cpp
src/qtui/mainwin.cpp
src/qtui/phononnotificationbackend.cpp
src/qtui/qtuiapplication.cpp
src/qtui/settingsdlg.cpp
src/qtui/settingspagedlg.cpp
src/qtui/settingspages/aliasessettingspage.cpp
src/qtui/settingspages/bufferviewsettingspage.cpp
src/qtui/settingspages/chatmonitorsettingspage.cpp
src/qtui/settingspages/coreaccountsettingspage.cpp
src/qtui/settingspages/identitiessettingspage.cpp
src/qtui/settingspages/identityeditwidget.cpp
src/qtui/settingspages/ignorelistsettingspage.cpp
src/qtui/settingspages/keysequencewidget.cpp
src/qtui/settingspages/networkssettingspage.cpp
src/qtui/settingspages/networkssettingspage.h
src/qtui/simplenetworkeditor.cpp
src/qtui/snorenotificationbackend.cpp
src/qtui/systemtray.cpp
src/qtui/systraynotificationbackend.cpp
src/qtui/taskbarnotificationbackend.cpp
src/qtui/topicwidget.cpp
src/uisupport/clearablelineedit.cpp
src/uisupport/contextmenuactionprovider.cpp
src/uisupport/networkmodelcontroller.cpp
src/uisupport/networkmodelcontroller.h
src/uisupport/toolbaractionprovider.cpp
src/uisupport/uistyle.cpp
src/uisupport/uistyle.h

index b76f899..8bfdad3 100644 (file)
@@ -28,7 +28,7 @@
 AboutDlg::AboutDlg(QWidget *parent) : QDialog(parent)
 {
     ui.setupUi(this);
-    ui.quasselLogo->setPixmap(DesktopIcon("quassel", IconLoader::SizeHuge));
+    ui.quasselLogo->setPixmap(QIcon(":/icons/quassel-64.png").pixmap(64)); // don't let the icon theme affect our logo here
 
     ui.versionLabel->setText(QString(tr("<b>Version:</b> %1<br><b>Protocol version:</b> %2<br><b>Built:</b> %3"))
         .arg(Quassel::buildInfo().fancyVersionString)
index 3f6ba6d..60a3571 100644 (file)
@@ -77,16 +77,16 @@ BufferWidget::BufferWidget(QWidget *parent)
 
     Action *zoomInChatview = coll->add<Action>("ZoomInChatView", this, SLOT(zoomIn()));
     zoomInChatview->setText(tr("Zoom In"));
-    zoomInChatview->setIcon(SmallIcon("zoom-in"));
+    zoomInChatview->setIcon(QIcon::fromTheme("zoom-in"));
     zoomInChatview->setShortcut(QKeySequence::ZoomIn);
 
     Action *zoomOutChatview = coll->add<Action>("ZoomOutChatView", this, SLOT(zoomOut()));
-    zoomOutChatview->setIcon(SmallIcon("zoom-out"));
+    zoomOutChatview->setIcon(QIcon::fromTheme("zoom-out"));
     zoomOutChatview->setText(tr("Zoom Out"));
     zoomOutChatview->setShortcut(QKeySequence::ZoomOut);
 
     Action *zoomOriginalChatview = coll->add<Action>("ZoomOriginalChatView", this, SLOT(zoomOriginal()));
-    zoomOriginalChatview->setIcon(SmallIcon("zoom-original"));
+    zoomOriginalChatview->setIcon(QIcon::fromTheme("zoom-original"));
     zoomOriginalChatview->setText(tr("Actual Size"));
     //zoomOriginalChatview->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_0)); // used for RTS switching
 
index f16fd22..d81ba3a 100644 (file)
@@ -42,7 +42,7 @@ ChannelListDlg::ChannelListDlg(QWidget *parent)
     _sortFilter.setFilterKeyColumn(-1);
 
     ui.setupUi(this);
-    ui.advancedModeLabel->setPixmap(BarIcon("edit-rename"));
+    ui.advancedModeLabel->setPixmap(QIcon::fromTheme("edit-rename").pixmap(22));
 
     ui.channelListView->setSelectionBehavior(QAbstractItemView::SelectRows);
     ui.channelListView->setSelectionMode(QAbstractItemView::SingleSelection);
@@ -133,14 +133,14 @@ void ChannelListDlg::setAdvancedMode(bool advanced)
             delete _simpleModeSpacer;
             _simpleModeSpacer = 0;
         }
-        ui.advancedModeLabel->setPixmap(BarIcon("edit-clear-locationbar-rtl"));
+        ui.advancedModeLabel->setPixmap(QIcon::fromTheme("edit-clear-locationbar-rtl", QIcon::fromTheme("edit-clear")).pixmap(16));
     }
     else {
         if (!_simpleModeSpacer) {
             _simpleModeSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
             ui.searchLayout->insertSpacerItem(0, _simpleModeSpacer);
         }
-        ui.advancedModeLabel->setPixmap(BarIcon("edit-rename"));
+        ui.advancedModeLabel->setPixmap(QIcon::fromTheme("edit-rename").pixmap(16));
     }
 
     ui.channelNameLineEdit->clear();
index 117ec10..4e19931 100644 (file)
@@ -798,7 +798,7 @@ void ContentsChatItem::addActionsToMenu(QMenu *menu, const QPointF &pos)
         switch (click.type()) {
         case Clickable::Url:
             privateData()->activeClickable = click;
-            menu->addAction(SmallIcon("edit-copy"), tr("Copy Link Address"),
+            menu->addAction(QIcon::fromTheme("edit-copy"), tr("Copy Link Address"),
                 &_actionProxy, SLOT(copyLinkToClipboard()))->setData(QVariant::fromValue<void *>(this));
             break;
         case Clickable::Channel:
index a995ef0..3bea4f8 100644 (file)
@@ -70,7 +70,7 @@ void ChatMonitorView::addActionsToMenu(QMenu *menu, const QPointF &pos)
     }
 
     menu->addSeparator();
-    menu->addAction(SmallIcon("configure"), tr("Configure..."), this, SLOT(showSettingsPage()));
+    menu->addAction(QIcon::fromTheme("configure"), tr("Configure..."), this, SLOT(showSettingsPage()));
 }
 
 
index 4dfd813..f1ef288 100644 (file)
@@ -823,7 +823,7 @@ void ChatScene::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
     // If we have text selected, insert the Copy Selection as first item
     if (isPosOverSelection(pos)) {
         QAction *sep = menu.insertSeparator(menu.actions().first());
-        QAction *act = new Action(SmallIcon("edit-copy"), tr("Copy Selection"), &menu, this,
+        QAction *act = new Action(QIcon::fromTheme("edit-copy"), tr("Copy Selection"), &menu, this,
             SLOT(selectionToClipboard()), QKeySequence::Copy);
         menu.insertAction(sep, act);
 
@@ -832,7 +832,7 @@ void ChatScene::contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
             searchSelectionText = searchSelectionText.left(_webSearchSelectionTextMaxVisible).append(QString::fromUtf8("…"));
         searchSelectionText = tr("Search '%1'").arg(searchSelectionText);
 
-        menu.addAction(SmallIcon("edit-find"), searchSelectionText, this, SLOT(webSearchOnSelection()));
+        menu.addAction(QIcon::fromTheme("edit-find"), searchSelectionText, this, SLOT(webSearchOnSelection()));
     }
 
     if (QtUi::mainWindow()->menuBar()->isHidden())
index 6d0533a..7113ab5 100644 (file)
@@ -29,9 +29,9 @@ ChatViewSearchBar::ChatViewSearchBar(QWidget *parent)
     : QWidget(parent)
 {
     ui.setupUi(this);
-    ui.hideButton->setIcon(BarIcon("dialog-close"));
-    ui.searchUpButton->setIcon(SmallIcon("go-up"));
-    ui.searchDownButton->setIcon(SmallIcon("go-down"));
+    ui.hideButton->setIcon(QIcon::fromTheme("dialog-close"));
+    ui.searchUpButton->setIcon(QIcon::fromTheme("go-up"));
+    ui.searchDownButton->setIcon(QIcon::fromTheme("go-down"));
     _searchDelayTimer.setSingleShot(true);
 
     layout()->setContentsMargins(0, 0, 0, 0);
index e1d74fe..4d065f0 100644 (file)
@@ -67,7 +67,7 @@ CoreConfigWizard::CoreConfigWizard(CoreConnection *connection, const QList<QVari
     setModal(true);
 
     setWindowTitle(tr("Core Configuration Wizard"));
-    setPixmap(QWizard::LogoPixmap, DesktopIcon("quassel"));
+    setPixmap(QWizard::LogoPixmap, QIcon::fromTheme("quassel", QIcon(":/icons/quassel.png")).pixmap(48));
 
     connect(connection, SIGNAL(coreSetupSuccess()), SLOT(coreSetupSuccess()));
     connect(connection, SIGNAL(coreSetupFailed(QString)), SLOT(coreSetupFailed(QString)));
index e277a71..b57e29e 100644 (file)
@@ -39,7 +39,7 @@ CoreConnectDlg::CoreConnectDlg(QWidget *parent) : QDialog(parent)
         _settingsPage->setSelectedAccount(lastAccount);
 
     setWindowTitle(tr("Connect to Core"));
-    setWindowIcon(SmallIcon("network-disconnect"));
+    setWindowIcon(QIcon::fromTheme("network-disconnect"));
 
     QVBoxLayout *layout = new QVBoxLayout(this);
     layout->addWidget(_settingsPage);
index 77140b8..954004e 100644 (file)
@@ -79,11 +79,11 @@ void CoreConnectionStatusWidget::connectionStateChanged(CoreConnection::Connecti
 {
     if (state >= CoreConnection::Connected) {
         if (coreConnection()->isEncrypted()) {
-            ui.sslLabel->setPixmap(SmallIcon("security-high"));
+            ui.sslLabel->setPixmap(QIcon::fromTheme("security-high").pixmap(16));
             ui.sslLabel->setToolTip(tr("The connection to your core is encrypted with SSL."));
         }
         else {
-            ui.sslLabel->setPixmap(SmallIcon("security-low"));
+            ui.sslLabel->setPixmap(QIcon::fromTheme("security-low").pixmap(16));
             ui.sslLabel->setToolTip(tr("The connection to your core is not encrypted."));
         }
         ui.sslLabel->show();
index 4fc0bb8..2057083 100644 (file)
@@ -175,7 +175,7 @@ IndicatorNotificationBackend::ConfigWidget::ConfigWidget(QWidget *parent)
 {
     ui.setupUi(this);
     // FIXME find proper icon (this one is used by the plasmoid as well)
-    ui.enabled->setIcon(SmallIcon("mail-message-new"));
+    ui.enabled->setIcon(QIcon::fromTheme("mail-message-new"));
 
     connect(ui.enabled, SIGNAL(toggled(bool)), SLOT(widgetChanged()));
 }
index 6ac42be..86009a6 100644 (file)
@@ -60,11 +60,11 @@ InputWidget::InputWidget(QWidget *parent)
     ui.inputEdit->setMode(MultiLineEdit::MultiLine);
     ui.inputEdit->setPasteProtectionEnabled(true);
 
-    ui.boldButton->setIcon(SmallIcon("format-text-bold"));
-    ui.italicButton->setIcon(SmallIcon("format-text-italic"));
-    ui.underlineButton->setIcon(SmallIcon("format-text-underline"));
-    ui.textcolorButton->setIcon(SmallIcon("format-text-color"));
-    ui.highlightcolorButton->setIcon(SmallIcon("format-fill-color"));
+    ui.boldButton->setIcon(QIcon::fromTheme("format-text-bold"));
+    ui.italicButton->setIcon(QIcon::fromTheme("format-text-italic"));
+    ui.underlineButton->setIcon(QIcon::fromTheme("format-text-underline"));
+    ui.textcolorButton->setIcon(QIcon::fromTheme("format-text-color"));
+    ui.highlightcolorButton->setIcon(QIcon::fromTheme("format-fill-color"));
     ui.encryptionIconLabel->hide();
 
     _colorMenu = new QMenu();
@@ -470,7 +470,7 @@ void InputWidget::updateNickSelector() const
     ui.ownNick->addItems(nicks);
 
     if (me && me->isAway())
-        ui.ownNick->setItemData(nickIdx, SmallIcon("user-away"), Qt::DecorationRole);
+        ui.ownNick->setItemData(nickIdx, QIcon::fromTheme("user-away"), Qt::DecorationRole);
 
     ui.ownNick->setCurrentIndex(nickIdx);
 }
@@ -589,7 +589,7 @@ void InputWidget::colorChosen(QAction *action)
         mergeFormatOnSelection(fmt);
     }
     ui.textcolorButton->setDefaultAction(action);
-    ui.textcolorButton->setIcon(createColorToolButtonIcon(SmallIcon("format-text-color"), color));
+    ui.textcolorButton->setIcon(createColorToolButtonIcon(QIcon::fromTheme("format-text-color"), color));
 }
 
 
@@ -609,7 +609,7 @@ void InputWidget::colorHighlightChosen(QAction *action)
         mergeFormatOnSelection(fmt);
     }
     ui.highlightcolorButton->setDefaultAction(action);
-    ui.highlightcolorButton->setIcon(createColorToolButtonIcon(SmallIcon("format-fill-color"), color));
+    ui.highlightcolorButton->setIcon(createColorToolButtonIcon(QIcon::fromTheme("format-fill-color"), color));
 }
 
 
index 20d84d9..1dd9553 100644 (file)
@@ -61,7 +61,7 @@ void KNotificationBackend::notify(const Notification &n)
 #else
     QString message = QString("<b>&lt;%1&gt;</b> %2").arg(n.sender, n.message.toHtmlEscaped());
 #endif
-    KNotification *notification = KNotification::event(type, message, DesktopIcon("dialog-information"), QtUi::mainWindow(),
+    KNotification *notification = KNotification::event(type, message, QIcon::fromTheme("dialog-information").pixmap(48), QtUi::mainWindow(),
         KNotification::RaiseWidgetOnActivation
         |KNotification::CloseWhenWidgetActivated
         |KNotification::CloseOnTimeout);
index 73124aa..c7796ca 100644 (file)
@@ -337,17 +337,11 @@ void MainWin::restoreStateFromSettings(UiSettings &s)
 
 void MainWin::updateIcon()
 {
-#ifdef Q_OS_MAC
-    const int size = 128;
-#else
-    const int size = 48;
-#endif
-
-    QPixmap icon;
+    QIcon icon;
     if (Client::isConnected())
-        icon = DesktopIcon("quassel", size);
+        icon = QIcon::fromTheme("quassel", QIcon(":/icons/quassel-128.png"));
     else
-        icon = DesktopIcon("quassel-inactive", size);
+        icon = QIcon::fromTheme("quassel-inactive", QIcon(":/icons/quassel-128.png"));
     setWindowIcon(icon);
     qApp->setWindowIcon(icon);
 }
@@ -357,16 +351,16 @@ void MainWin::setupActions()
 {
     ActionCollection *coll = QtUi::actionCollection("General", tr("General"));
     // File
-    coll->addAction("ConnectCore", new Action(SmallIcon("network-connect"), tr("&Connect to Core..."), coll,
+    coll->addAction("ConnectCore", new Action(QIcon::fromTheme("network-connect"), tr("&Connect to Core..."), coll,
             this, SLOT(showCoreConnectionDlg())));
-    coll->addAction("DisconnectCore", new Action(SmallIcon("network-disconnect"), tr("&Disconnect from Core"), coll,
+    coll->addAction("DisconnectCore", new Action(QIcon::fromTheme("network-disconnect"), tr("&Disconnect from Core"), coll,
             Client::instance(), SLOT(disconnectFromCore())));
-    coll->addAction("CoreInfo", new Action(SmallIcon("help-about"), tr("Core &Info..."), coll,
+    coll->addAction("CoreInfo", new Action(QIcon::fromTheme("help-about"), tr("Core &Info..."), coll,
             this, SLOT(showCoreInfoDlg())));
-    coll->addAction("ConfigureNetworks", new Action(SmallIcon("configure"), tr("Configure &Networks..."), coll,
+    coll->addAction("ConfigureNetworks", new Action(QIcon::fromTheme("configure"), tr("Configure &Networks..."), coll,
             this, SLOT(on_actionConfigureNetworks_triggered())));
     // FIXME: use QKeySequence::Quit once we depend on Qt 4.6
-    coll->addAction("Quit", new Action(SmallIcon("application-exit"), tr("&Quit"), coll,
+    coll->addAction("Quit", new Action(QIcon::fromTheme("application-exit"), tr("&Quit"), coll,
             this, SLOT(quit()), Qt::CTRL + Qt::Key_Q));
 
     // View
@@ -377,11 +371,11 @@ void MainWin::setupActions()
     lockAct->setCheckable(true);
     connect(lockAct, SIGNAL(toggled(bool)), SLOT(on_actionLockLayout_toggled(bool)));
 
-    coll->addAction("ToggleSearchBar", new Action(SmallIcon("edit-find"), tr("Show &Search Bar"), coll,
+    coll->addAction("ToggleSearchBar", new Action(QIcon::fromTheme("edit-find"), tr("Show &Search Bar"), coll,
             0, 0, QKeySequence::Find))->setCheckable(true);
     coll->addAction("ShowAwayLog", new Action(tr("Show Away Log"), coll,
             this, SLOT(showAwayLog())));
-    coll->addAction("ToggleMenuBar", new Action(SmallIcon("show-menu"), tr("Show &Menubar"), coll,
+    coll->addAction("ToggleMenuBar", new Action(QIcon::fromTheme("show-menu"), tr("Show &Menubar"), coll,
             0, 0, QKeySequence(Qt::CTRL + Qt::Key_M)))->setCheckable(true);
 
     coll->addAction("ToggleStatusBar", new Action(tr("Show Status &Bar"), coll,
@@ -390,30 +384,30 @@ void MainWin::setupActions()
 #ifdef HAVE_KDE
     QAction *fullScreenAct = KStandardAction::fullScreen(this, SLOT(onFullScreenToggled()), this, coll);
 #else
-    QAction *fullScreenAct = new Action(SmallIcon("view-fullscreen"), tr("&Full Screen Mode"), coll,
+    QAction *fullScreenAct = new Action(QIcon::fromTheme("view-fullscreen"), tr("&Full Screen Mode"), coll,
         this, SLOT(onFullScreenToggled()), QKeySequence(Qt::Key_F11));
     fullScreenAct->setCheckable(true);
 #endif
     coll->addAction("ToggleFullScreen", fullScreenAct);
 
     // Settings
-    QAction *configureShortcutsAct = new Action(SmallIcon("configure-shortcuts"), tr("Configure &Shortcuts..."), coll,
+    QAction *configureShortcutsAct = new Action(QIcon::fromTheme("configure-shortcuts"), tr("Configure &Shortcuts..."), coll,
         this, SLOT(showShortcutsDlg()));
     configureShortcutsAct->setMenuRole(QAction::NoRole);
     coll->addAction("ConfigureShortcuts", configureShortcutsAct);
 
   #ifdef Q_OS_MAC
-    QAction *configureQuasselAct = new Action(SmallIcon("configure"), tr("&Configure Quassel..."), coll,
+    QAction *configureQuasselAct = new Action(QIcon::fromTheme("configure"), tr("&Configure Quassel..."), coll,
         this, SLOT(showSettingsDlg()));
     configureQuasselAct->setMenuRole(QAction::PreferencesRole);
   #else
-    QAction *configureQuasselAct = new Action(SmallIcon("configure"), tr("&Configure Quassel..."), coll,
+    QAction *configureQuasselAct = new Action(QIcon::fromTheme("configure"), tr("&Configure Quassel..."), coll,
         this, SLOT(showSettingsDlg()), QKeySequence(Qt::Key_F7));
   #endif
     coll->addAction("ConfigureQuassel", configureQuasselAct);
 
     // Help
-    QAction *aboutQuasselAct = new Action(SmallIcon("quassel"), tr("&About Quassel"), coll,
+    QAction *aboutQuasselAct = new Action(QIcon(":/icons/quassel.png"), tr("&About Quassel"), coll,
         this, SLOT(showAboutDlg()));
     aboutQuasselAct->setMenuRole(QAction::AboutRole);
     coll->addAction("AboutQuassel", aboutQuasselAct);
@@ -422,17 +416,17 @@ void MainWin::setupActions()
         qApp, SLOT(aboutQt()));
     aboutQtAct->setMenuRole(QAction::AboutQtRole);
     coll->addAction("AboutQt", aboutQtAct);
-    coll->addAction("DebugNetworkModel", new Action(SmallIcon("tools-report-bug"), tr("Debug &NetworkModel"), coll,
+    coll->addAction("DebugNetworkModel", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &NetworkModel"), coll,
             this, SLOT(on_actionDebugNetworkModel_triggered())));
-    coll->addAction("DebugBufferViewOverlay", new Action(SmallIcon("tools-report-bug"), tr("Debug &BufferViewOverlay"), coll,
+    coll->addAction("DebugBufferViewOverlay", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &BufferViewOverlay"), coll,
             this, SLOT(on_actionDebugBufferViewOverlay_triggered())));
-    coll->addAction("DebugMessageModel", new Action(SmallIcon("tools-report-bug"), tr("Debug &MessageModel"), coll,
+    coll->addAction("DebugMessageModel", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &MessageModel"), coll,
             this, SLOT(on_actionDebugMessageModel_triggered())));
-    coll->addAction("DebugHotList", new Action(SmallIcon("tools-report-bug"), tr("Debug &HotList"), coll,
+    coll->addAction("DebugHotList", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &HotList"), coll,
             this, SLOT(on_actionDebugHotList_triggered())));
-    coll->addAction("DebugLog", new Action(SmallIcon("tools-report-bug"), tr("Debug &Log"), coll,
+    coll->addAction("DebugLog", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &Log"), coll,
             this, SLOT(on_actionDebugLog_triggered())));
-    coll->addAction("ReloadStyle", new Action(SmallIcon("view-refresh"), tr("Reload Stylesheet"), coll,
+    coll->addAction("ReloadStyle", new Action(QIcon::fromTheme("view-refresh"), tr("Reload Stylesheet"), coll,
             QtUi::style(), SLOT(reload()), QKeySequence::Refresh));
 
     coll->addAction("HideCurrentBuffer", new Action(tr("Hide Current Buffer"), coll,
@@ -496,13 +490,13 @@ void MainWin::setupActions()
             QKeySequence(jumpModifier + Qt::Key_9)))->setProperty("Index", 9);
 
     // Buffer navigation
-    coll->addAction("NextBufferView", new Action(SmallIcon("go-next-view"), tr("Activate Next Chat List"), coll,
+    coll->addAction("NextBufferView", new Action(QIcon::fromTheme("go-next-view"), tr("Activate Next Chat List"), coll,
             this, SLOT(nextBufferView()), QKeySequence(QKeySequence::Forward)));
-    coll->addAction("PreviousBufferView", new Action(SmallIcon("go-previous-view"), tr("Activate Previous Chat List"), coll,
+    coll->addAction("PreviousBufferView", new Action(QIcon::fromTheme("go-previous-view"), tr("Activate Previous Chat List"), coll,
             this, SLOT(previousBufferView()), QKeySequence::Back));
-    coll->addAction("NextBuffer", new Action(SmallIcon("go-down"), tr("Go to Next Chat"), coll,
+    coll->addAction("NextBuffer", new Action(QIcon::fromTheme("go-down"), tr("Go to Next Chat"), coll,
             this, SLOT(nextBuffer()), QKeySequence(Qt::ALT + Qt::Key_Down)));
-    coll->addAction("PreviousBuffer", new Action(SmallIcon("go-up"), tr("Go to Previous Chat"), coll,
+    coll->addAction("PreviousBuffer", new Action(QIcon::fromTheme("go-up"), tr("Go to Previous Chat"), coll,
             this, SLOT(previousBuffer()), QKeySequence(Qt::ALT + Qt::Key_Up)));
 }
 
@@ -564,7 +558,7 @@ void MainWin::setupMenus()
     _helpMenu->addAction(KStandardAction::aboutKDE(_kHelpMenu, SLOT(aboutKDE()), this));
 #endif
     _helpMenu->addSeparator();
-    _helpDebugMenu = _helpMenu->addMenu(SmallIcon("tools-report-bug"), tr("Debug"));
+    _helpDebugMenu = _helpMenu->addMenu(QIcon::fromTheme("tools-report-bug"), tr("Debug"));
     _helpDebugMenu->addAction(coll->action("DebugNetworkModel"));
     _helpDebugMenu->addAction(coll->action("DebugBufferViewOverlay"));
     _helpDebugMenu->addAction(coll->action("DebugMessageModel"));
@@ -1564,7 +1558,7 @@ void MainWin::clientNetworkUpdated()
 
     switch (net->connectionState()) {
     case Network::Initialized:
-        action->setIcon(SmallIcon("network-connect"));
+        action->setIcon(QIcon::fromTheme("network-connect"));
         // if we have no currently selected buffer, jump to the first connecting statusbuffer
         if (!bufferWidget()->currentBuffer().isValid()) {
             QModelIndex idx = Client::networkModel()->networkIndex(net->networkId());
@@ -1575,10 +1569,10 @@ void MainWin::clientNetworkUpdated()
         }
         break;
     case Network::Disconnected:
-        action->setIcon(SmallIcon("network-disconnect"));
+        action->setIcon(QIcon::fromTheme("network-disconnect"));
         break;
     default:
-        action->setIcon(SmallIcon("network-wired"));
+        action->setIcon(QIcon::fromTheme("network-wired"));
     }
 }
 
index 59513bf..f8c613c 100644 (file)
@@ -112,9 +112,9 @@ PhononNotificationBackend::ConfigWidget::ConfigWidget(QWidget *parent)
 {
     ui.setupUi(this);
     _audioAvailable = !Phonon::BackendCapabilities::availableAudioOutputDevices().isEmpty();
-    ui.enabled->setIcon(SmallIcon("media-playback-start"));
-    ui.play->setIcon(SmallIcon("media-playback-start"));
-    ui.open->setIcon(SmallIcon("document-open"));
+    ui.enabled->setIcon(QIcon::fromTheme("media-playback-start"));
+    ui.play->setIcon(QIcon::fromTheme("media-playback-start"));
+    ui.open->setIcon(QIcon::fromTheme("document-open"));
 
     connect(ui.enabled, SIGNAL(toggled(bool)), SLOT(widgetChanged()));
     connect(ui.filename, SIGNAL(textChanged(const QString &)), SLOT(widgetChanged()));
index cd95678..5bf11bb 100644 (file)
@@ -20,6 +20,7 @@
 
 #include "qtuiapplication.h"
 
+#include <QIcon>
 #include <QStringList>
 
 #ifdef HAVE_KDE
@@ -67,6 +68,10 @@ QtUiApplication::QtUiApplication(int &argc, char **argv)
 #else
     qInstallMessageHandler(Client::logMessage);
 #endif
+
+    // Some platforms don't set a default icon theme; chances are we can find our bundled Oxygen theme though
+    if (QIcon::themeName().isEmpty())
+        QIcon::setThemeName("oxygen");
 }
 
 
index 309f140..3907694 100644 (file)
@@ -33,7 +33,7 @@ SettingsDlg::SettingsDlg(QWidget *parent)
     ui.setupUi(this);
     setModal(true);
     setAttribute(Qt::WA_DeleteOnClose, true);
-    setWindowIcon(SmallIcon("configure"));
+    setWindowIcon(QIcon::fromTheme("configure"));
 
     updateGeometry();
 
index c9c3d0b..a87a0cf 100644 (file)
@@ -37,7 +37,7 @@ SettingsPageDlg::SettingsPageDlg(SettingsPage *page, QWidget *parent)
 
     ui.pageTitle->setText(page->title());
     setWindowTitle(tr("Configure %1").arg(page->title()));
-    setWindowIcon(SmallIcon("configure"));
+    setWindowIcon(QIcon::fromTheme("configure"));
 
     // make the scrollarea behave sanely
     ui.settingsFrame->setWidgetResizable(true);
index 1f9d679..fe8b26e 100644 (file)
@@ -29,8 +29,8 @@ AliasesSettingsPage::AliasesSettingsPage(QWidget *parent)
     : SettingsPage(tr("IRC"), tr("Aliases"), parent)
 {
     ui.setupUi(this);
-    ui.newAliasButton->setIcon(SmallIcon("list-add"));
-    ui.deleteAliasButton->setIcon(SmallIcon("edit-delete"));
+    ui.newAliasButton->setIcon(QIcon::fromTheme("list-add"));
+    ui.deleteAliasButton->setIcon(QIcon::fromTheme("edit-delete"));
 
     ui.aliasesView->setSelectionBehavior(QAbstractItemView::SelectRows);
     ui.aliasesView->setSelectionMode(QAbstractItemView::SingleSelection);
index 3207075..42759ee 100644 (file)
@@ -43,9 +43,9 @@ BufferViewSettingsPage::BufferViewSettingsPage(QWidget *parent)
     if (!(Client::coreFeatures() & Quassel::HideInactiveNetworks))
         ui.hideInactiveNetworks->hide();
 
-    ui.renameBufferView->setIcon(SmallIcon("edit-rename"));
-    ui.addBufferView->setIcon(SmallIcon("list-add"));
-    ui.deleteBufferView->setIcon(SmallIcon("edit-delete"));
+    ui.renameBufferView->setIcon(QIcon::fromTheme("edit-rename"));
+    ui.addBufferView->setIcon(QIcon::fromTheme("list-add"));
+    ui.deleteBufferView->setIcon(QIcon::fromTheme("edit-delete"));
 
     reset();
 
index 535c987..f2855ef 100644 (file)
@@ -36,8 +36,8 @@ ChatMonitorSettingsPage::ChatMonitorSettingsPage(QWidget *parent)
 {
     ui.setupUi(this);
 
-    ui.activateBuffer->setIcon(SmallIcon("go-next"));
-    ui.deactivateBuffer->setIcon(SmallIcon("go-previous"));
+    ui.activateBuffer->setIcon(QIcon::fromTheme("go-next"));
+    ui.deactivateBuffer->setIcon(QIcon::fromTheme("go-previous"));
 
     // setup available buffers config (for the bufferview on the left)
     _configAvailable = new BufferViewConfig(-667, this);
index b7c1064..9b667e0 100644 (file)
@@ -33,9 +33,9 @@ CoreAccountSettingsPage::CoreAccountSettingsPage(QWidget *parent)
 {
     ui.setupUi(this);
     initAutoWidgets();
-    ui.addAccountButton->setIcon(SmallIcon("list-add"));
-    ui.editAccountButton->setIcon(SmallIcon("document-edit"));
-    ui.deleteAccountButton->setIcon(SmallIcon("edit-delete"));
+    ui.addAccountButton->setIcon(QIcon::fromTheme("list-add"));
+    ui.editAccountButton->setIcon(QIcon::fromTheme("document-edit"));
+    ui.deleteAccountButton->setIcon(QIcon::fromTheme("edit-delete"));
 
     _model = new CoreAccountModel(Client::coreAccountModel(), this);
     _filteredModel = new FilteredCoreAccountModel(_model, this);
index b26e45f..254b216 100644 (file)
@@ -32,9 +32,9 @@ IdentitiesSettingsPage::IdentitiesSettingsPage(QWidget *parent)
     _editSsl(false)
 {
     ui.setupUi(this);
-    ui.renameIdentity->setIcon(BarIcon("edit-rename"));
-    ui.addIdentity->setIcon(BarIcon("list-add-user"));
-    ui.deleteIdentity->setIcon(BarIcon("list-remove-user"));
+    ui.renameIdentity->setIcon(QIcon::fromTheme("edit-rename"));
+    ui.addIdentity->setIcon(QIcon::fromTheme("list-add-user"));
+    ui.deleteIdentity->setIcon(QIcon::fromTheme("list-remove-user"));
 
     coreConnectionStateChanged(Client::isConnected()); // need a core connection!
     connect(Client::instance(), SIGNAL(coreConnectionStateChanged(bool)), this, SLOT(coreConnectionStateChanged(bool)));
@@ -417,7 +417,7 @@ SaveIdentitiesDlg::SaveIdentitiesDlg(const QList<CertIdentity *> &toCreate, cons
     : QDialog(parent)
 {
     ui.setupUi(this);
-    ui.abort->setIcon(SmallIcon("dialog-cancel"));
+    ui.abort->setIcon(QIcon::fromTheme("dialog-cancel"));
 
     numevents = toCreate.count() + toUpdate.count() + toRemove.count();
     rcvevents = 0;
index 331a081..13be1c9 100644 (file)
@@ -41,11 +41,11 @@ IdentityEditWidget::IdentityEditWidget(QWidget *parent)
 {
     ui.setupUi(this);
 
-    ui.addNick->setIcon(SmallIcon("list-add"));
-    ui.deleteNick->setIcon(SmallIcon("edit-delete"));
-    ui.renameNick->setIcon(SmallIcon("edit-rename"));
-    ui.nickUp->setIcon(SmallIcon("go-up"));
-    ui.nickDown->setIcon(SmallIcon("go-down"));
+    ui.addNick->setIcon(QIcon::fromTheme("list-add"));
+    ui.deleteNick->setIcon(QIcon::fromTheme("edit-delete"));
+    ui.renameNick->setIcon(QIcon::fromTheme("edit-rename"));
+    ui.nickUp->setIcon(QIcon::fromTheme("go-up"));
+    ui.nickDown->setIcon(QIcon::fromTheme("go-down"));
 
     // We need to know whenever the state of input widgets changes...
     connect(ui.realName, SIGNAL(textEdited(const QString &)), this, SIGNAL(widgetHasChanged()));
index 4b80d64..5330626 100644 (file)
@@ -35,9 +35,9 @@ IgnoreListSettingsPage::IgnoreListSettingsPage(QWidget *parent)
 {
     ui.setupUi(this);
     _delegate = new IgnoreListDelegate(ui.ignoreListView);
-    ui.newIgnoreRuleButton->setIcon(SmallIcon("list-add"));
-    ui.deleteIgnoreRuleButton->setIcon(SmallIcon("edit-delete"));
-    ui.editIgnoreRuleButton->setIcon(SmallIcon("configure"));
+    ui.newIgnoreRuleButton->setIcon(QIcon::fromTheme("list-add"));
+    ui.deleteIgnoreRuleButton->setIcon(QIcon::fromTheme("edit-delete"));
+    ui.editIgnoreRuleButton->setIcon(QIcon::fromTheme("configure"));
 
     ui.ignoreListView->setSelectionBehavior(QAbstractItemView::SelectRows);
     ui.ignoreListView->setSelectionMode(QAbstractItemView::SingleSelection);
index 9f75c75..38fa2d9 100644 (file)
@@ -172,7 +172,7 @@ KeySequenceWidget::KeySequenceWidget(QWidget *parent)
 
     _keyButton = new KeySequenceButton(this, this);
     _keyButton->setFocusPolicy(Qt::StrongFocus);
-    _keyButton->setIcon(SmallIcon("configure"));
+    _keyButton->setIcon(QIcon::fromTheme("configure"));
     _keyButton->setToolTip(tr("Click on the button, then enter the shortcut like you would in the program.\nExample for Ctrl+a: hold the Ctrl key and press a."));
     layout->addWidget(_keyButton);
 
@@ -180,9 +180,9 @@ KeySequenceWidget::KeySequenceWidget(QWidget *parent)
     layout->addWidget(_clearButton);
 
     if (qApp->isLeftToRight())
-        _clearButton->setIcon(SmallIcon("edit-clear-locationbar-rtl"));
+        _clearButton->setIcon(QIcon::fromTheme("edit-clear-locationbar-rtl", QIcon::fromTheme("edit-clear")));
     else
-        _clearButton->setIcon(SmallIcon("edit-clear-locationbar-ltr"));
+        _clearButton->setIcon(QIcon::fromTheme("edit-clear-locationbar-ltr", QIcon::fromTheme("edit-clear")));
 
     setLayout(layout);
 
index 618636a..c951a5e 100644 (file)
@@ -52,21 +52,21 @@ NetworksSettingsPage::NetworksSettingsPage(QWidget *parent)
 #endif
 
     // set up icons
-    ui.renameNetwork->setIcon(SmallIcon("edit-rename"));
-    ui.addNetwork->setIcon(SmallIcon("list-add"));
-    ui.deleteNetwork->setIcon(SmallIcon("edit-delete"));
-    ui.addServer->setIcon(SmallIcon("list-add"));
-    ui.deleteServer->setIcon(SmallIcon("edit-delete"));
-    ui.editServer->setIcon(SmallIcon("configure"));
-    ui.upServer->setIcon(SmallIcon("go-up"));
-    ui.downServer->setIcon(SmallIcon("go-down"));
-    ui.editIdentities->setIcon(SmallIcon("configure"));
+    ui.renameNetwork->setIcon(QIcon::fromTheme("edit-rename"));
+    ui.addNetwork->setIcon(QIcon::fromTheme("list-add"));
+    ui.deleteNetwork->setIcon(QIcon::fromTheme("edit-delete"));
+    ui.addServer->setIcon(QIcon::fromTheme("list-add"));
+    ui.deleteServer->setIcon(QIcon::fromTheme("edit-delete"));
+    ui.editServer->setIcon(QIcon::fromTheme("configure"));
+    ui.upServer->setIcon(QIcon::fromTheme("go-up"));
+    ui.downServer->setIcon(QIcon::fromTheme("go-down"));
+    ui.editIdentities->setIcon(QIcon::fromTheme("configure"));
 
     _ignoreWidgetChanges = false;
 
-    connectedIcon = SmallIcon("network-connect");
-    connectingIcon = SmallIcon("network-wired"); // FIXME network-connecting
-    disconnectedIcon = SmallIcon("network-disconnect");
+    connectedIcon = QIcon::fromTheme("network-connect");
+    connectingIcon = QIcon::fromTheme("network-wired"); // FIXME network-connecting
+    disconnectedIcon = QIcon::fromTheme("network-disconnect");
 
     foreach(int mib, QTextCodec::availableMibs()) {
         QByteArray codec = QTextCodec::codecForMib(mib)->name();
@@ -497,7 +497,7 @@ void NetworksSettingsPage::displayNetwork(NetworkId id)
         foreach(Network::Server server, info.serverList) {
             QListWidgetItem *item = new QListWidgetItem(QString("%1:%2").arg(server.host).arg(server.port));
             if (server.useSsl)
-                item->setIcon(SmallIcon("document-encrypt"));
+                item->setIcon(QIcon::fromTheme("document-encrypt"));
             ui.serverList->addItem(item);
         }
         //setItemState(id);
@@ -784,7 +784,7 @@ IdentityId NetworksSettingsPage::defaultIdentity() const
 NetworkAddDlg::NetworkAddDlg(const QStringList &exist, QWidget *parent) : QDialog(parent), existing(exist)
 {
     ui.setupUi(this);
-    ui.useSSL->setIcon(SmallIcon("document-encrypt"));
+    ui.useSSL->setIcon(QIcon::fromTheme("document-encrypt"));
 
     // read preset networks
     QStringList networks = PresetNetworks::names();
@@ -863,7 +863,7 @@ void NetworkEditDlg::on_networkEdit_textChanged(const QString &text)
 ServerEditDlg::ServerEditDlg(const Network::Server &server, QWidget *parent) : QDialog(parent)
 {
     ui.setupUi(this);
-    ui.useSSL->setIcon(SmallIcon("document-encrypt"));
+    ui.useSSL->setIcon(QIcon::fromTheme("document-encrypt"));
     ui.host->setText(server.host);
     ui.port->setValue(server.port);
     ui.password->setText(server.password);
index 065869a..a8843b6 100644 (file)
@@ -21,7 +21,7 @@
 #ifndef NETWORKSSETTINGSPAGE_H
 #define NETWORKSSETTINGSPAGE_H
 
-#include <QPixmap>
+#include <QIcon>
 
 #include "network.h"
 #include "settingspage.h"
@@ -95,7 +95,7 @@ private:
     CertIdentity *_cid;
 #endif
 
-    QPixmap connectedIcon, connectingIcon, disconnectedIcon;
+    QIcon connectedIcon, connectingIcon, disconnectedIcon;
 
     void reset();
     bool testHasChanged();
index 38f5b58..901170a 100644 (file)
@@ -29,11 +29,11 @@ SimpleNetworkEditor::SimpleNetworkEditor(QWidget *parent)
 {
     ui.setupUi(this);
 
-    ui.addServer->setIcon(SmallIcon("list-add"));
-    ui.deleteServer->setIcon(SmallIcon("edit-delete"));
-    ui.editServer->setIcon(SmallIcon("configure"));
-    ui.upServer->setIcon(SmallIcon("go-up"));
-    ui.downServer->setIcon(SmallIcon("go-down"));
+    ui.addServer->setIcon(QIcon::fromTheme("list-add"));
+    ui.deleteServer->setIcon(QIcon::fromTheme("edit-delete"));
+    ui.editServer->setIcon(QIcon::fromTheme("configure"));
+    ui.upServer->setIcon(QIcon::fromTheme("go-up"));
+    ui.downServer->setIcon(QIcon::fromTheme("go-down"));
 
     connect(ui.networkNameEdit, SIGNAL(textEdited(const QString &)), this, SIGNAL(widgetHasChanged()));
     connect(ui.channelList, SIGNAL(textChanged()), this, SIGNAL(widgetHasChanged()));
@@ -65,7 +65,7 @@ void SimpleNetworkEditor::displayNetworkInfo(const NetworkInfo &networkInfo)
     foreach(Network::Server server, _networkInfo.serverList) {
         QListWidgetItem *item = new QListWidgetItem(QString("%1:%2").arg(server.host).arg(server.port));
         if (server.useSsl)
-            item->setIcon(SmallIcon("document-encrypt"));
+            item->setIcon(QIcon::fromTheme("document-encrypt"));
         ui.serverList->addItem(item);
     }
 
index 3612bb0..d217b9f 100644 (file)
@@ -50,7 +50,7 @@ SnoreNotificationBackend::SnoreNotificationBackend (QObject *parent)
     //TODO: try to get an instance of the tray icon to be able to show popups
     m_snore = new Snore::SnoreCore();
     m_snore->loadPlugins(Snore::SnorePlugin::BACKEND);
-    m_icon = Snore::Icon(DesktopIcon("quassel").toImage());
+    m_icon = Snore::Icon(QIcon::fromTheme("quassel").toImage());
     m_application = Snore::Application("Quassel", m_icon);
     m_application.hints().setValue("WINDOWS_APP_ID","QuasselProject.QuasselIRC");
 
index 02ecffa..62c60b8 100644 (file)
@@ -40,9 +40,9 @@ SystemTray::SystemTray(QWidget *parent)
     _mode(Invalid),
     _state(Passive),
     _shouldBeVisible(true),
-    _passiveIcon(DesktopIcon("quassel-inactive")),
-    _activeIcon(DesktopIcon("quassel")),
-    _needsAttentionIcon(DesktopIcon("quassel-message")),
+    _passiveIcon(QIcon::fromTheme("quassel-inactive")),
+    _activeIcon(QIcon::fromTheme("quassel")),
+    _needsAttentionIcon(QIcon::fromTheme("quassel-message")),
     _trayMenu(0),
     _associatedWidget(parent)
 {
index 5492f0a..0d9b8df 100644 (file)
@@ -154,7 +154,7 @@ SettingsPage *SystrayNotificationBackend::createConfigWidget() const
 SystrayNotificationBackend::ConfigWidget::ConfigWidget(QWidget *parent) : SettingsPage("Internal", "SystrayNotification", parent)
 {
     _showBubbleBox = new QCheckBox(tr("Show a message in a popup"));
-    _showBubbleBox->setIcon(SmallIcon("dialog-information"));
+    _showBubbleBox->setIcon(QIcon::fromTheme("dialog-information"));
     connect(_showBubbleBox, SIGNAL(toggled(bool)), this, SLOT(widgetChanged()));
     QHBoxLayout *layout = new QHBoxLayout(this);
     layout->addWidget(_showBubbleBox);
index a689c13..62cc60b 100644 (file)
@@ -84,7 +84,7 @@ TaskbarNotificationBackend::ConfigWidget::ConfigWidget(QWidget *parent) : Settin
 #else
     layout->addWidget(enabledBox = new QCheckBox(tr("Mark taskbar entry, timeout:"), this));
 #endif
-    enabledBox->setIcon(SmallIcon("flag-blue"));
+    enabledBox->setIcon(QIcon::fromTheme("flag-blue"));
     enabledBox->setEnabled(true);
 
     timeoutBox = new QSpinBox(this);
index ae83501..fbf1443 100644 (file)
@@ -31,7 +31,7 @@ TopicWidget::TopicWidget(QWidget *parent)
     : AbstractItemView(parent)
 {
     ui.setupUi(this);
-    ui.topicEditButton->setIcon(SmallIcon("edit-rename"));
+    ui.topicEditButton->setIcon(QIcon::fromTheme("edit-rename"));
     ui.topicLineEdit->setLineWrapEnabled(true);
     ui.topicLineEdit->installEventFilter(this);
 
index c7b1fab..57d7868 100644 (file)
@@ -29,7 +29,7 @@ ClearableLineEdit::ClearableLineEdit(QWidget *parent)
     : QLineEdit(parent)
 {
     clearButton = new QToolButton(this);
-    clearButton->setIcon(SmallIcon("edit-clear-locationbar-rtl"));
+    clearButton->setIcon(QIcon::fromTheme("edit-clear-locationbar-rtl", QIcon::fromTheme("edit-clear")));
 #ifndef Q_WS_QWS
     clearButton->setCursor(Qt::ArrowCursor);
 #endif
index 3eefc16..e605e3b 100644 (file)
 
 ContextMenuActionProvider::ContextMenuActionProvider(QObject *parent) : NetworkModelController(parent)
 {
-    registerAction(NetworkConnect, SmallIcon("network-connect"), tr("Connect"));
-    registerAction(NetworkDisconnect, SmallIcon("network-disconnect"), tr("Disconnect"));
+    registerAction(NetworkConnect, QIcon::fromTheme("network-connect"), tr("Connect"));
+    registerAction(NetworkDisconnect, QIcon::fromTheme("network-disconnect"), tr("Disconnect"));
 
-    registerAction(BufferJoin, SmallIcon("irc-join-channel"), tr("Join"));
-    registerAction(BufferPart, SmallIcon("irc-close-channel"), tr("Part"));
+    registerAction(BufferJoin, QIcon::fromTheme("irc-join-channel"), tr("Join"));
+    registerAction(BufferPart, QIcon::fromTheme("irc-close-channel"), tr("Part"));
     registerAction(BufferRemove, tr("Delete Chat(s)..."));
     registerAction(BufferSwitchTo, tr("Go to Chat"));
 
@@ -54,7 +54,7 @@ ContextMenuActionProvider::ContextMenuActionProvider(QObject *parent) : NetworkM
     registerAction(HideApplyToAll, tr("Set as Default..."));
     registerAction(HideUseDefaults, tr("Use Defaults..."));
 
-    registerAction(JoinChannel, SmallIcon("irc-join-channel"), tr("Join Channel..."));
+    registerAction(JoinChannel, QIcon::fromTheme("irc-join-channel"), tr("Join Channel..."));
 
     registerAction(NickQuery, tr("Start Query"));
     registerAction(NickSwitchTo, tr("Show Query"));
@@ -76,15 +76,15 @@ ContextMenuActionProvider::ContextMenuActionProvider(QObject *parent) : NetworkM
     registerAction(NickIgnoreToggleEnabled3, "Enable", true);
     registerAction(NickIgnoreToggleEnabled4, "Enable", true);
 
-    registerAction(NickOp, SmallIcon("irc-operator"), tr("Give Operator Status"));
-    registerAction(NickDeop, SmallIcon("irc-remove-operator"), tr("Take Operator Status"));
-    registerAction(NickHalfop, SmallIcon("irc-voice"), tr("Give Half-Operator Status"));
-    registerAction(NickDehalfop, SmallIcon("irc-unvoice"), tr("Take Half-Operator Status"));
-    registerAction(NickVoice, SmallIcon("irc-voice"), tr("Give Voice"));
-    registerAction(NickDevoice, SmallIcon("irc-unvoice"), tr("Take Voice"));
-    registerAction(NickKick, SmallIcon("im-kick-user"), tr("Kick From Channel"));
-    registerAction(NickBan, SmallIcon("im-ban-user"), tr("Ban From Channel"));
-    registerAction(NickKickBan, SmallIcon("im-ban-kick-user"), tr("Kick && Ban"));
+    registerAction(NickOp, QIcon::fromTheme("irc-operator"), tr("Give Operator Status"));
+    registerAction(NickDeop, QIcon::fromTheme("irc-remove-operator"), tr("Take Operator Status"));
+    registerAction(NickHalfop, QIcon::fromTheme("irc-voice"), tr("Give Half-Operator Status"));
+    registerAction(NickDehalfop, QIcon::fromTheme("irc-unvoice"), tr("Take Half-Operator Status"));
+    registerAction(NickVoice, QIcon::fromTheme("irc-voice"), tr("Give Voice"));
+    registerAction(NickDevoice, QIcon::fromTheme("irc-unvoice"), tr("Take Voice"));
+    registerAction(NickKick, QIcon::fromTheme("im-kick-user"), tr("Kick From Channel"));
+    registerAction(NickBan, QIcon::fromTheme("im-ban-user"), tr("Ban From Channel"));
+    registerAction(NickKickBan, QIcon::fromTheme("im-ban-kick-user"), tr("Kick && Ban"));
 
     registerAction(HideBufferTemporarily, tr("Hide Chat(s) Temporarily"));
     registerAction(HideBufferPermanently, tr("Hide Chat(s) Permanently"));
index 9e42fe2..0dcd718 100644 (file)
@@ -59,7 +59,7 @@ Action *NetworkModelController::registerAction(ActionType type, const QString &t
 }
 
 
-Action *NetworkModelController::registerAction(ActionType type, const QPixmap &icon, const QString &text, bool checkable)
+Action *NetworkModelController::registerAction(ActionType type, const QIcon &icon, const QString &text, bool checkable)
 {
     Action *act;
     if (icon.isNull())
@@ -526,7 +526,7 @@ void NetworkModelController::handleNickAction(ActionType type, QAction *action)
 
 NetworkModelController::JoinDlg::JoinDlg(const QModelIndex &index, QWidget *parent) : QDialog(parent)
 {
-    setWindowIcon(SmallIcon("irc-join-channel"));
+    setWindowIcon(QIcon::fromTheme("irc-join-channel"));
     setWindowTitle(tr("Join Channel"));
 
     QGridLayout *layout = new QGridLayout(this);
index a06c08c..11dd97a 100644 (file)
@@ -138,7 +138,7 @@ protected:
     void setSlot(QObject *receiver, const char *method);
 
     Action *registerAction(ActionType type, const QString &text, bool checkable = false);
-    Action *registerAction(ActionType type, const QPixmap &icon, const QString &text, bool checkable = false);
+    Action *registerAction(NetworkModelController::ActionType type, const QIcon &icon, const QString &text, bool checkable = false);
     bool checkRequirements(const QModelIndex &index, ItemActiveStates requiredActiveState = QFlags<ItemActiveState>(ActiveState | InactiveState));
 
     QString nickName(const QModelIndex &index) const;
index 3c92cf1..15d89b0 100644 (file)
 ToolBarActionProvider::ToolBarActionProvider(QObject *parent)
     : NetworkModelController(parent)
 {
-    registerAction(NetworkConnectAll, DesktopIcon("network-connect"), tr("Connect"))->setToolTip(tr("Connect to IRC"));
-    registerAction(NetworkDisconnectAll, DesktopIcon("network-disconnect"), tr("Disconnect"))->setToolTip(tr("Disconnect from IRC"));
-
-    registerAction(BufferPart, DesktopIcon("irc-close-channel"), tr("Part"))->setToolTip(tr("Leave currently selected channel"));
-    registerAction(JoinChannel, DesktopIcon("irc-join-channel"), tr("Join"))->setToolTip(tr("Join a channel"));
-
-    registerAction(NickQuery, DesktopIcon("mail-message-new"), tr("Query"))->setToolTip(tr("Start a private conversation")); // fix icon
-    registerAction(NickWhois, DesktopIcon("im-user"), tr("Whois"))->setToolTip(tr("Request user information")); // fix icon
-
-    registerAction(NickOp, DesktopIcon("irc-operator"), tr("Op"))->setToolTip(tr("Give operator privileges to user"));
-    registerAction(NickDeop, DesktopIcon("irc-remove-operator"), tr("Deop"))->setToolTip(tr("Take operator privileges from user"));
-    registerAction(NickVoice, DesktopIcon("irc-voice"), tr("Voice"))->setToolTip(tr("Give voice to user"));
-    registerAction(NickDevoice, DesktopIcon("irc-unvoice"), tr("Devoice"))->setToolTip(tr("Take voice from user"));
-    registerAction(NickKick, DesktopIcon("im-kick-user"), tr("Kick"))->setToolTip(tr("Remove user from channel"));
-    registerAction(NickBan, DesktopIcon("im-ban-user"), tr("Ban"))->setToolTip(tr("Ban user from channel"));
-    registerAction(NickKickBan, DesktopIcon("im-ban-kick-user"), tr("Kick/Ban"))->setToolTip(tr("Remove and ban user from channel"));
+    registerAction(NetworkConnectAll, QIcon::fromTheme("network-connect"), tr("Connect"))->setToolTip(tr("Connect to IRC"));
+    registerAction(NetworkDisconnectAll, QIcon::fromTheme("network-disconnect"), tr("Disconnect"))->setToolTip(tr("Disconnect from IRC"));
+
+    registerAction(BufferPart, QIcon::fromTheme("irc-close-channel"), tr("Part"))->setToolTip(tr("Leave currently selected channel"));
+    registerAction(JoinChannel, QIcon::fromTheme("irc-join-channel"), tr("Join"))->setToolTip(tr("Join a channel"));
+
+    registerAction(NickQuery, QIcon::fromTheme("mail-message-new"), tr("Query"))->setToolTip(tr("Start a private conversation")); // fix icon
+    registerAction(NickWhois, QIcon::fromTheme("im-user"), tr("Whois"))->setToolTip(tr("Request user information")); // fix icon
+
+    registerAction(NickOp, QIcon::fromTheme("irc-operator"), tr("Op"))->setToolTip(tr("Give operator privileges to user"));
+    registerAction(NickDeop, QIcon::fromTheme("irc-remove-operator"), tr("Deop"))->setToolTip(tr("Take operator privileges from user"));
+    registerAction(NickVoice, QIcon::fromTheme("irc-voice"), tr("Voice"))->setToolTip(tr("Give voice to user"));
+    registerAction(NickDevoice, QIcon::fromTheme("irc-unvoice"), tr("Devoice"))->setToolTip(tr("Take voice from user"));
+    registerAction(NickKick, QIcon::fromTheme("im-kick-user"), tr("Kick"))->setToolTip(tr("Remove user from channel"));
+    registerAction(NickBan, QIcon::fromTheme("im-ban-user"), tr("Ban"))->setToolTip(tr("Ban user from channel"));
+    registerAction(NickKickBan, QIcon::fromTheme("im-ban-kick-user"), tr("Kick/Ban"))->setToolTip(tr("Remove and ban user from channel"));
 
     _networksConnectMenu = new QMenu();
     _networksConnectMenu->setSeparatorsCollapsible(false);
index 3ed50c1..d219f27 100644 (file)
@@ -33,13 +33,13 @@ QString UiStyle::_timestampFormatString;
 
 UiStyle::UiStyle(QObject *parent)
     : QObject(parent),
-    _channelJoinedIcon(SmallIcon("irc-channel-active")),
-    _channelPartedIcon(SmallIcon("irc-channel-inactive")),
-    _userOfflineIcon(SmallIcon("im-user-offline")),
-    _userOnlineIcon(SmallIcon("im-user")),
-    _userAwayIcon(SmallIcon("im-user-away")),
-    _categoryOpIcon(SmallIcon("irc-operator")),
-    _categoryVoiceIcon(SmallIcon("irc-voice")),
+    _channelJoinedIcon(QIcon::fromTheme("irc-channel-joined", QIcon(":/icons/irc-channel-joined.png"))),
+    _channelPartedIcon(QIcon::fromTheme("irc-channel-parted", QIcon(":/icons/irc-channel-parted.png"))),
+    _userOfflineIcon(QIcon::fromTheme("im-user-offline", QIcon::fromTheme("user-offline", QIcon(":/icons/im-user-offline.png")))),
+    _userOnlineIcon(QIcon::fromTheme("im-user", QIcon::fromTheme("user-available", QIcon(":/icons/im-user.png")))), // im-user-* are non-standard oxygen extensions
+    _userAwayIcon(QIcon::fromTheme("im-user-away", QIcon::fromTheme("user-away", QIcon(":/icons/im-user-away.png")))),
+    _categoryOpIcon(QIcon::fromTheme("irc-operator")),
+    _categoryVoiceIcon(QIcon::fromTheme("irc-voice")),
     _opIconLimit(UserCategoryItem::categoryFromModes("o")),
     _voiceIconLimit(UserCategoryItem::categoryFromModes("v"))
 {
index ccdeecd..0b51501 100644 (file)
@@ -24,6 +24,7 @@
 #include <QDataStream>
 #include <QFontMetricsF>
 #include <QHash>
+#include <QIcon>
 #include <QTextCharFormat>
 #include <QTextLayout>
 #include <QPalette>
@@ -185,13 +186,13 @@ private:
     static QHash<QString, FormatType> _formatCodes;
     static QString _timestampFormatString;
 
-    QPixmap _channelJoinedIcon;
-    QPixmap _channelPartedIcon;
-    QPixmap _userOfflineIcon;
-    QPixmap _userOnlineIcon;
-    QPixmap _userAwayIcon;
-    QPixmap _categoryOpIcon;
-    QPixmap _categoryVoiceIcon;
+    QIcon _channelJoinedIcon;
+    QIcon _channelPartedIcon;
+    QIcon _userOfflineIcon;
+    QIcon _userOnlineIcon;
+    QIcon _userAwayIcon;
+    QIcon _categoryOpIcon;
+    QIcon _categoryVoiceIcon;
     int _opIconLimit;
     int _voiceIconLimit;
     bool _showNickViewIcons;