}
close BLACKLIST;
-# We now grep the source for QIcon::fromTheme("fubar") to find required icons
+# We now grep the source for icon::get() to find required icons
print "Grepping $srcdir for required icons...\n";
-my @results = `grep -r QIcon::fromTheme\\(\\" $srcdir`;
+my @results = `grep -r icon::get $srcdir`;
foreach(@results) {
- next unless my ($name) = /\W+QIcon::fromTheme\(\"([-\w]+)/;
- $req_icons{$name} = 1
- unless exists $blacklist{$name};
+ next unless my (@names) = /\W+icon::get\((?:\"([-\w]+)\")|(?:\{\s*\"([-\w]+)\"(?:,\s*\"([-\w]+)\")*\s*\})/;
+ foreach(@names) {
+ $req_icons{$_} = 1 unless not defined or exists $blacklist{$_};
+ }
}
# Clean old output dir
#include "aboutdlg.h"
#include <QDateTime>
-#include <QIcon>
+#include <QPixmap>
#include "aboutdata.h"
+#include "icon.h"
#include "quassel.h"
AboutDlg::AboutDlg(QWidget *parent)
ui.contributorTextBrowser->setHtml(contributors());
ui.thanksToTextBrowser->setHtml(thanksTo());
- setWindowIcon(QIcon::fromTheme("quassel", QIcon(":/icons/quassel.png")));
+ setWindowIcon(icon::get("quassel"));
}
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <QIcon>
#include <QLayout>
#include <QKeyEvent>
#include <QMenu>
#include "chatviewsearchcontroller.h"
#include "chatviewsettings.h"
#include "client.h"
+#include "icon.h"
#include "multilineedit.h"
#include "qtui.h"
#include "settings.h"
Action *zoomInChatview = coll->add<Action>("ZoomInChatView", this, SLOT(zoomIn()));
zoomInChatview->setText(tr("Zoom In"));
- zoomInChatview->setIcon(QIcon::fromTheme("zoom-in"));
+ zoomInChatview->setIcon(icon::get("zoom-in"));
zoomInChatview->setShortcut(QKeySequence::ZoomIn);
Action *zoomOutChatview = coll->add<Action>("ZoomOutChatView", this, SLOT(zoomOut()));
- zoomOutChatview->setIcon(QIcon::fromTheme("zoom-out"));
+ zoomOutChatview->setIcon(icon::get("zoom-out"));
zoomOutChatview->setText(tr("Zoom Out"));
zoomOutChatview->setShortcut(QKeySequence::ZoomOut);
Action *zoomOriginalChatview = coll->add<Action>("ZoomOriginalChatView", this, SLOT(zoomOriginal()));
- zoomOriginalChatview->setIcon(QIcon::fromTheme("zoom-original"));
+ zoomOriginalChatview->setIcon(icon::get("zoom-original"));
zoomOriginalChatview->setText(tr("Actual Size"));
//zoomOriginalChatview->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_0)); // used for RTS switching
#include <QHeaderView>
#include <QHBoxLayout>
-#include <QIcon>
#include <QSpacerItem>
#include "client.h"
#include "clientirclisthelper.h"
+#include "icon.h"
ChannelListDlg::ChannelListDlg(QWidget *parent)
: QDialog(parent),
_sortFilter.setFilterKeyColumn(-1);
ui.setupUi(this);
- ui.advancedModeLabel->setPixmap(QIcon::fromTheme("edit-rename").pixmap(22));
+ ui.advancedModeLabel->setPixmap(icon::get("edit-rename").pixmap(22));
ui.channelListView->setSelectionBehavior(QAbstractItemView::SelectRows);
ui.channelListView->setSelectionMode(QAbstractItemView::SingleSelection);
ui.searchChannelsButton->setAutoDefault(false);
- setWindowIcon(QIcon::fromTheme("format-list-unordered"));
+ setWindowIcon(icon::get("format-list-unordered"));
connect(ui.advancedModeLabel, SIGNAL(clicked()), this, SLOT(toggleMode()));
connect(ui.searchChannelsButton, SIGNAL(clicked()), this, SLOT(requestSearch()));
delete _simpleModeSpacer;
_simpleModeSpacer = 0;
}
- ui.advancedModeLabel->setPixmap(QIcon::fromTheme("edit-clear-locationbar-rtl", QIcon::fromTheme("edit-clear")).pixmap(16));
+ ui.advancedModeLabel->setPixmap(icon::get("edit-clear-locationbar-rtl").pixmap(16));
}
else {
if (!_simpleModeSpacer) {
_simpleModeSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
ui.searchLayout->insertSpacerItem(0, _simpleModeSpacer);
}
- ui.advancedModeLabel->setPixmap(QIcon::fromTheme("edit-rename").pixmap(16));
+ ui.advancedModeLabel->setPixmap(icon::get("edit-rename").pixmap(16));
}
ui.channelNameLineEdit->clear();
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
+#include "chatitem.h"
+
#include <QApplication>
#include <QClipboard>
#include <QDesktopServices>
#include <QFontMetrics>
#include <QGraphicsSceneMouseEvent>
-#include <QIcon>
#include <QPainter>
#include <QPalette>
#include <QTextLayout>
#include "buffermodel.h"
#include "bufferview.h"
-#include "chatitem.h"
#include "chatline.h"
#include "chatlinemodel.h"
#include "chatview.h"
#include "contextmenuactionprovider.h"
+#include "icon.h"
#include "mainwin.h"
#include "qtui.h"
#include "qtuistyle.h"
switch (click.type()) {
case Clickable::Url:
privateData()->activeClickable = click;
- menu->addAction(QIcon::fromTheme("edit-copy"), tr("Copy Link Address"),
+ menu->addAction(icon::get("edit-copy"), tr("Copy Link Address"),
&_actionProxy, SLOT(copyLinkToClipboard()))->setData(QVariant::fromValue<void *>(this));
break;
case Clickable::Channel:
#include "chatmonitorview.h"
#include <QAction>
-#include <QIcon>
#include <QMenu>
#include <QContextMenuEvent>
+#include "buffermodel.h"
#include "chatmonitorfilter.h"
#include "chatlinemodel.h"
#include "chatitem.h"
#include "chatscene.h"
#include "client.h"
+#include "clientignorelistmanager.h"
+#include "icon.h"
#include "networkmodel.h"
-#include "buffermodel.h"
#include "messagemodel.h"
#include "qtuisettings.h"
#include "settingspagedlg.h"
#include "settingspages/chatmonitorsettingspage.h"
-#include "clientignorelistmanager.h"
ChatMonitorView::ChatMonitorView(ChatMonitorFilter *filter, QWidget *parent)
: ChatView(filter, parent),
}
menu->addSeparator();
- menu->addAction(QIcon::fromTheme("configure"), tr("Configure..."), this, SLOT(showSettingsPage()));
+ menu->addAction(icon::get("configure"), tr("Configure..."), this, SLOT(showSettingsPage()));
}
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
+#include "chatscene.h"
+
#include <QApplication>
#include <QClipboard>
#include <QDesktopServices>
#include <QDrag>
#include <QGraphicsSceneMouseEvent>
-#include <QIcon>
#include <QMenu>
#include <QMenuBar>
#include <QMimeData>
#include "chatitem.h"
#include "chatline.h"
#include "chatlinemodelitem.h"
-#include "chatscene.h"
#include "chatview.h"
+#include "chatviewsettings.h"
#include "client.h"
#include "clientbacklogmanager.h"
#include "columnhandleitem.h"
#include "contextmenuactionprovider.h"
+#include "icon.h"
#include "mainwin.h"
#include "markerlineitem.h"
#include "messagefilter.h"
#include "qtui.h"
#include "qtuistyle.h"
-#include "chatviewsettings.h"
#include "webpreviewitem.h"
const qreal minContentsWidth = 200;
// 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(QIcon::fromTheme("edit-copy"), tr("Copy Selection"), &menu, this,
+ QAction *act = new Action(icon::get("edit-copy"), tr("Copy Selection"), &menu, this,
SLOT(selectionToClipboard()), QKeySequence::Copy);
menu.insertAction(sep, act);
searchSelectionText = searchSelectionText.left(_webSearchSelectionTextMaxVisible).append(QString::fromUtf8("…"));
searchSelectionText = tr("Search '%1'").arg(searchSelectionText);
- QAction *webSearchAction = new Action(QIcon::fromTheme("edit-find"), searchSelectionText, &menu, this, SLOT(webSearchOnSelection()));
+ QAction *webSearchAction = new Action(icon::get("edit-find"), searchSelectionText, &menu, this, SLOT(webSearchOnSelection()));
menu.insertAction(sep, webSearchAction);
}
#include "chatviewsearchbar.h"
-#include <QIcon>
-
#include "action.h"
#include "actioncollection.h"
+#include "icon.h"
#include "qtui.h"
ChatViewSearchBar::ChatViewSearchBar(QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
- ui.hideButton->setIcon(QIcon::fromTheme("dialog-close"));
- ui.searchUpButton->setIcon(QIcon::fromTheme("go-up"));
- ui.searchDownButton->setIcon(QIcon::fromTheme("go-down"));
+ ui.hideButton->setIcon(icon::get("dialog-close"));
+ ui.searchUpButton->setIcon(icon::get("go-up"));
+ ui.searchDownButton->setIcon(icon::get("go-down"));
_searchDelayTimer.setSingleShot(true);
layout()->setContentsMargins(0, 0, 0, 0);
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
+#include "coreconfigwizard.h"
+
#include <QDebug>
#include <QAbstractButton>
#include <QCoreApplication>
#include <QFormLayout>
-#include <QIcon>
#include <QSpinBox>
-#include "coreconfigwizard.h"
-#include "coreconnection.h"
-
#include "client.h"
+#include "coreconnection.h"
+#include "icon.h"
namespace {
setModal(true);
setWindowTitle(CoreConfigWizard::tr("Core Configuration Wizard"));
- setPixmap(QWizard::LogoPixmap, QIcon::fromTheme("quassel", QIcon(":/icons/quassel.png")).pixmap(48));
+ setPixmap(QWizard::LogoPixmap, icon::get("quassel").pixmap(48));
connect(connection, SIGNAL(coreSetupSuccess()), SLOT(coreSetupSuccess()));
connect(connection, SIGNAL(coreSetupFailed(QString)), SLOT(coreSetupFailed(QString)));
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
+#include "coreconnectdlg.h"
+
#include <QDialogButtonBox>
-#include <QIcon>
#include <QVBoxLayout>
-#include "coreconnectdlg.h"
-
#include "clientsettings.h"
#include "coreaccountsettingspage.h"
+#include "icon.h"
CoreConnectDlg::CoreConnectDlg(QWidget *parent) : QDialog(parent)
{
_settingsPage->setSelectedAccount(lastAccount);
setWindowTitle(tr("Connect to Core"));
- setWindowIcon(QIcon::fromTheme("network-disconnect"));
+ setWindowIcon(icon::get("network-disconnect"));
QVBoxLayout *layout = new QVBoxLayout(this);
layout->addWidget(_settingsPage);
#include "coreconnectionstatuswidget.h"
-#include <QIcon>
-
#include "client.h"
+#include "icon.h"
#include "signalproxy.h"
CoreConnectionStatusWidget::CoreConnectionStatusWidget(CoreConnection *connection, QWidget *parent)
{
if (state >= CoreConnection::Connected) {
if (coreConnection()->isEncrypted()) {
- ui.sslLabel->setPixmap(QIcon::fromTheme("security-high").pixmap(16));
+ ui.sslLabel->setPixmap(icon::get("security-high").pixmap(16));
ui.sslLabel->setToolTip(tr("The connection to your core is encrypted with SSL."));
}
else {
- ui.sslLabel->setPixmap(QIcon::fromTheme("security-low").pixmap(16));
+ ui.sslLabel->setPixmap(icon::get("security-low").pixmap(16));
ui.sslLabel->setToolTip(tr("The connection to your core is not encrypted."));
}
ui.sslLabel->show();
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <QMessageBox>
-
#include "coreinfodlg.h"
-#include "client.h"
+#include <QMessageBox>
+
#include "bufferwidget.h"
+#include "client.h"
+#include "icon.h"
CoreInfoDlg::CoreInfoDlg(QWidget *parent) : QDialog(parent) {
ui.setupUi(this);
coreInfoChanged(coreInfo->coreData());
// Warning icon
- ui.coreUnsupportedIcon->setPixmap(QIcon::fromTheme("dialog-warning").pixmap(16));
+ ui.coreUnsupportedIcon->setPixmap(icon::get("dialog-warning").pixmap(16));
updateUptime();
startTimer(1000);
#include "client.h"
#include "clientsettings.h"
+#include "icon"
#include "mainwin.h"
#include "networkmodel.h"
#include "qtui.h"
{
ui.setupUi(this);
// FIXME find proper icon (this one is used by the plasmoid as well)
- ui.enabled->setIcon(QIcon::fromTheme("mail-message-new"));
+ ui.enabled->setIcon(icon::get("mail-message-new"));
connect(ui.enabled, SIGNAL(toggled(bool)), SLOT(widgetChanged()));
}
#include "inputwidget.h"
#include <QIcon>
+#include <QPainter>
+#include <QPixmap>
+#include <QRect>
#include "action.h"
#include "actioncollection.h"
#include "bufferview.h"
#include "client.h"
+#include "icon.h"
#include "ircuser.h"
#include "networkmodel.h"
#include "qtui.h"
#include "qtuisettings.h"
#include "tabcompleter.h"
-#include <QPainter>
const int leftMargin = 3;
ui.inputEdit->setMode(MultiLineEdit::MultiLine);
ui.inputEdit->setPasteProtectionEnabled(true);
- 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.clearButton->setIcon(QIcon::fromTheme("edit-clear"));
+ ui.boldButton->setIcon(icon::get("format-text-bold"));
+ ui.italicButton->setIcon(icon::get("format-text-italic"));
+ ui.underlineButton->setIcon(icon::get("format-text-underline"));
+ ui.clearButton->setIcon(icon::get("edit-clear"));
ui.encryptionIconLabel->hide();
_colorMenu = new QMenu();
connect(_colorFillMenu, SIGNAL(triggered(QAction *)), this, SLOT(colorHighlightChosen(QAction *)));
// Needs to be done after adding the menu, otherwise the icon mysteriously vanishes until clicked
- ui.textcolorButton->setIcon(QIcon::fromTheme("format-text-color"));
- ui.highlightcolorButton->setIcon(QIcon::fromTheme("format-fill-color"));
+ ui.textcolorButton->setIcon(icon::get("format-text-color"));
+ ui.highlightcolorButton->setIcon(icon::get("format-fill-color"));
// Show/hide style button
connect(ui.showStyleButton, SIGNAL(toggled(bool)), this, SLOT(setStyleOptionsExpanded(bool)));
ui.ownNick->addItems(nicks);
if (me && me->isAway())
- ui.ownNick->setItemData(nickIdx, QIcon::fromTheme("user-away"), Qt::DecorationRole);
+ ui.ownNick->setItemData(nickIdx, icon::get({"im-user-away", "user-away"}), Qt::DecorationRole);
ui.ownNick->setCurrentIndex(nickIdx);
}
mergeFormatOnSelection(fmt);
}
ui.textcolorButton->setDefaultAction(action);
- ui.textcolorButton->setIcon(createColorToolButtonIcon(QIcon::fromTheme("format-text-color"), color));
+ ui.textcolorButton->setIcon(createColorToolButtonIcon(icon::get("format-text-color"), color));
}
mergeFormatOnSelection(fmt);
}
ui.highlightcolorButton->setDefaultAction(action);
- ui.highlightcolorButton->setIcon(createColorToolButtonIcon(QIcon::fromTheme("format-fill-color"), color));
+ ui.highlightcolorButton->setIcon(createColorToolButtonIcon(icon::get("format-fill-color"), color));
}
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#ifndef INPUTWIDGET_H
-#define INPUTWIDGET_H
+#pragma once
-#include "ui_inputwidget.h"
+#include <QHash>
+#include <QIcon>
+#include <QMap>
+#include <QTextCharFormat>
#include "abstractitemview.h"
+#include "action.h"
#include "buffermodel.h"
#include "bufferinfo.h"
#include "identity.h"
#include "network.h"
-#include <action.h>
+
+#include "ui_inputwidget.h"
class MultiLineEdit;
MouseWheelFilter(QObject *parent = 0);
virtual bool eventFilter(QObject *obj, QEvent *event);
};
-
-
-#endif // INPUTWIDGET_H
#include "knotificationbackend.h"
-#include <QIcon>
#include <QTextDocument>
#include <QVBoxLayout>
#endif
#include "client.h"
+#include "icon.h"
#include "mainwin.h"
#include "networkmodel.h"
#include "qtui.h"
#else
QString message = QString("<b><%1></b> %2").arg(n.sender, n.message.toHtmlEscaped());
#endif
- KNotification *notification = KNotification::event(type, message, QIcon::fromTheme("dialog-information").pixmap(48), QtUi::mainWindow(),
+ KNotification *notification = KNotification::event(type, message, icon::get("dialog-information").pixmap(48), QtUi::mainWindow(),
KNotification::RaiseWidgetOnActivation
|KNotification::CloseWhenWidgetActivated
|KNotification::CloseOnTimeout);
#ifndef QT_NO_SYSTEMTRAYICON
-#include <QIcon>
-
#include "legacysystemtray.h"
+
+#include "icon.h"
#include "mainwin.h"
#include "qtui.h"
void LegacySystemTray::updateIcon()
{
QString iconName = (state() == NeedsAttention) ? currentAttentionIconName() : currentIconName();
- _trayIcon->setIcon(QIcon::fromTheme(iconName, QIcon{QString{":/icons/hicolor/24x24/status/%1.svg"}.arg(iconName)}));
+ _trayIcon->setIcon(icon::get(iconName, QString{":/icons/hicolor/24x24/status/%1.svg"}.arg(iconName)));
}
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
+#include "mainpage.h"
+
#include <QPushButton>
#include <QImage>
#include <QLabel>
#include <QLayout>
#include <QPainter>
-#include "mainpage.h"
-#include "coreconnectdlg.h"
#include "client.h"
+#include "coreconnectdlg.h"
+#include "icon.h"
MainPage::MainPage(QWidget *parent) : QWidget(parent)
{
layout->addWidget(label);
if (Quassel::runMode() != Quassel::Monolithic) {
- _connectButton = new QPushButton(QIcon::fromTheme("network-connect"), tr("Connect to Core..."));
+ _connectButton = new QPushButton(icon::get("network-connect"), tr("Connect to Core..."));
_connectButton->setEnabled(Client::coreConnection()->state() == CoreConnection::Disconnected);
connect(Client::coreConnection(), SIGNAL(stateChanged(CoreConnection::ConnectionState)), this, SLOT(coreConnectionStateChanged()));
#include "debuglogwidget.h"
#include "debugmessagemodelfilter.h"
#include "flatproxymodel.h"
+#include "icon.h"
#include "inputwidget.h"
#include "irclistmodel.h"
#include "ircconnectionwizard.h"
setWindowTitle("Quassel IRC");
setWindowIconText("Quassel IRC");
// Set the default icon for all windows
- QApplication::setWindowIcon(QIcon::fromTheme("quassel"));
+ QApplication::setWindowIcon(icon::get("quassel"));
updateIcon();
}
{
QIcon icon;
if (Client::isConnected())
- icon = QIcon::fromTheme("quassel", QIcon(":/icons/quassel-128.png"));
+ icon = icon::get("quassel");
else
- icon = QIcon::fromTheme("inactive-quassel", QIcon(":/icons/inactive-quassel.png"));
+ icon = icon::get("inactive-quassel");
setWindowIcon(icon);
}
{
ActionCollection *coll = QtUi::actionCollection("General", tr("General"));
// File
- coll->addAction("ConnectCore", new Action(QIcon::fromTheme("connect-quassel", QIcon(":/icons/connect-quassel.png")), tr("&Connect to Core..."), coll,
+ coll->addAction("ConnectCore", new Action(icon::get("connect-quassel"), tr("&Connect to Core..."), coll,
this, SLOT(showCoreConnectionDlg())));
- coll->addAction("DisconnectCore", new Action(QIcon::fromTheme("disconnect-quassel", QIcon(":/icons/disconnect-quassel.png")), tr("&Disconnect from Core"), coll,
+ coll->addAction("DisconnectCore", new Action(icon::get("disconnect-quassel", ":/pics/quassel-eye.png"), tr("&Disconnect from Core"), coll,
Client::instance(), SLOT(disconnectFromCore())));
- coll->addAction("ChangePassword", new Action(QIcon::fromTheme("dialog-password"), tr("Change &Password..."), coll,
+ coll->addAction("ChangePassword", new Action(icon::get("dialog-password"), tr("Change &Password..."), coll,
this, SLOT(showPasswordChangeDlg())));
- coll->addAction("CoreInfo", new Action(QIcon::fromTheme("help-about"), tr("Core &Info..."), coll,
+ coll->addAction("CoreInfo", new Action(icon::get("help-about"), tr("Core &Info..."), coll,
this, SLOT(showCoreInfoDlg())));
- coll->addAction("ConfigureNetworks", new Action(QIcon::fromTheme("configure"), tr("Configure &Networks..."), coll,
+ coll->addAction("ConfigureNetworks", new Action(icon::get("configure"), tr("Configure &Networks..."), coll,
this, SLOT(on_actionConfigureNetworks_triggered())));
// QKeySequence::Quit was added in Qt 4.6, and could be used instead. However, that key
// sequence is empty by default on Windows, which would remove Ctrl-Q to quit. It may be best
// to just keep it this way.
//
// See https://doc.qt.io/qt-5/qkeysequence.html
- coll->addAction("Quit", new Action(QIcon::fromTheme("application-exit"), tr("&Quit"), coll,
+ coll->addAction("Quit", new Action(icon::get("application-exit"), tr("&Quit"), coll,
this, SLOT(quit()), Qt::CTRL + Qt::Key_Q));
// View
lockAct->setCheckable(true);
connect(lockAct, SIGNAL(toggled(bool)), SLOT(on_actionLockLayout_toggled(bool)));
- coll->addAction("ToggleSearchBar", new Action(QIcon::fromTheme("edit-find"), tr("Show &Search Bar"), coll,
+ coll->addAction("ToggleSearchBar", new Action(icon::get("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(QIcon::fromTheme("show-menu"), tr("Show &Menubar"), coll,
+ coll->addAction("ToggleMenuBar", new Action(icon::get("show-menu"), tr("Show &Menubar"), coll,
0, 0))->setCheckable(true);
coll->addAction("ToggleStatusBar", new Action(tr("Show Status &Bar"), coll,
#ifdef HAVE_KDE
_fullScreenAction = KStandardAction::fullScreen(this, SLOT(onFullScreenToggled()), this, coll);
#else
- _fullScreenAction = new Action(QIcon::fromTheme("view-fullscreen"), tr("&Full Screen Mode"), coll,
+ _fullScreenAction = new Action(icon::get("view-fullscreen"), tr("&Full Screen Mode"), coll,
this, SLOT(onFullScreenToggled()), QKeySequence(Qt::Key_F11));
_fullScreenAction->setCheckable(true);
coll->addAction("ToggleFullScreen", _fullScreenAction);
#endif
// Settings
- QAction *configureShortcutsAct = new Action(QIcon::fromTheme("configure-shortcuts"), tr("Configure &Shortcuts..."), coll,
+ QAction *configureShortcutsAct = new Action(icon::get("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(QIcon::fromTheme("configure"), tr("&Configure Quassel..."), coll,
+ QAction *configureQuasselAct = new Action(icon::get("configure"), tr("&Configure Quassel..."), coll,
this, SLOT(showSettingsDlg()));
configureQuasselAct->setMenuRole(QAction::PreferencesRole);
#else
- QAction *configureQuasselAct = new Action(QIcon::fromTheme("configure"), tr("&Configure Quassel..."), coll,
+ QAction *configureQuasselAct = new Action(icon::get("configure"), tr("&Configure Quassel..."), coll,
this, SLOT(showSettingsDlg()), QKeySequence(Qt::Key_F7));
#endif
coll->addAction("ConfigureQuassel", configureQuasselAct);
// Help
- QAction *aboutQuasselAct = new Action(QIcon::fromTheme("quassel"), tr("&About Quassel"), coll,
+ QAction *aboutQuasselAct = new Action(icon::get("quassel"), tr("&About Quassel"), coll,
this, SLOT(showAboutDlg()));
aboutQuasselAct->setMenuRole(QAction::AboutRole);
coll->addAction("AboutQuassel", aboutQuasselAct);
qApp, SLOT(aboutQt()));
aboutQtAct->setMenuRole(QAction::AboutQtRole);
coll->addAction("AboutQt", aboutQtAct);
- coll->addAction("DebugNetworkModel", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &NetworkModel"), coll,
+ coll->addAction("DebugNetworkModel", new Action(icon::get("tools-report-bug"), tr("Debug &NetworkModel"), coll,
this, SLOT(on_actionDebugNetworkModel_triggered())));
- coll->addAction("DebugBufferViewOverlay", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &BufferViewOverlay"), coll,
+ coll->addAction("DebugBufferViewOverlay", new Action(icon::get("tools-report-bug"), tr("Debug &BufferViewOverlay"), coll,
this, SLOT(on_actionDebugBufferViewOverlay_triggered())));
- coll->addAction("DebugMessageModel", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &MessageModel"), coll,
+ coll->addAction("DebugMessageModel", new Action(icon::get("tools-report-bug"), tr("Debug &MessageModel"), coll,
this, SLOT(on_actionDebugMessageModel_triggered())));
- coll->addAction("DebugHotList", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &HotList"), coll,
+ coll->addAction("DebugHotList", new Action(icon::get("tools-report-bug"), tr("Debug &HotList"), coll,
this, SLOT(on_actionDebugHotList_triggered())));
- coll->addAction("DebugLog", new Action(QIcon::fromTheme("tools-report-bug"), tr("Debug &Log"), coll,
+ coll->addAction("DebugLog", new Action(icon::get("tools-report-bug"), tr("Debug &Log"), coll,
this, SLOT(on_actionDebugLog_triggered())));
- coll->addAction("ReloadStyle", new Action(QIcon::fromTheme("view-refresh"), tr("Reload Stylesheet"), coll,
+ coll->addAction("ReloadStyle", new Action(icon::get("view-refresh"), tr("Reload Stylesheet"), coll,
QtUi::style(), SLOT(reload()), QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_R)));
coll->addAction("HideCurrentBuffer", new Action(tr("Hide Current Buffer"), coll,
coll = QtUi::actionCollection("TextFormat", tr("Text formatting"));
coll->addAction("FormatApplyColor", new Action(
- QIcon::fromTheme("format-text-color"), tr("Apply foreground color"), coll,
+ icon::get("format-text-color"), tr("Apply foreground color"), coll,
this, SLOT(on_inputFormatApplyColor_triggered()),
QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_G)));
coll->addAction("FormatApplyColorFill", new Action(
- QIcon::fromTheme("format-fill-color"), tr("Apply background color"), coll,
+ icon::get("format-fill-color"), tr("Apply background color"), coll,
this, SLOT(on_inputFormatApplyColorFill_triggered()),
QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_B)));
coll->addAction("FormatClear", new Action(
- QIcon::fromTheme("edit-clear"), tr("Clear formatting"), coll,
+ icon::get("edit-clear"), tr("Clear formatting"), coll,
this, SLOT(on_inputFormatClear_triggered()),
QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_C)));
coll->addAction("FormatBold", new Action(
- QIcon::fromTheme("format-text-bold"), tr("Toggle bold"), coll,
+ icon::get("format-text-bold"), tr("Toggle bold"), coll,
this, SLOT(on_inputFormatBold_triggered()),
QKeySequence::Bold));
coll->addAction("FormatItalic", new Action(
- QIcon::fromTheme("format-text-italic"), tr("Toggle italics"), coll,
+ icon::get("format-text-italic"), tr("Toggle italics"), coll,
this, SLOT(on_inputFormatItalic_triggered()),
QKeySequence::Italic));
coll->addAction("FormatUnderline", new Action(
- QIcon::fromTheme("format-text-underline"), tr("Toggle underline"), coll,
+ icon::get("format-text-underline"), tr("Toggle underline"), coll,
this, SLOT(on_inputFormatUnderline_triggered()), QKeySequence::Underline));
// Navigation
QKeySequence(jumpModifier + Qt::Key_9)))->setProperty("Index", 9);
// Buffer navigation
- coll->addAction("NextBufferView", new Action(QIcon::fromTheme("go-next-view"), tr("Activate Next Chat List"), coll,
+ coll->addAction("NextBufferView", new Action(icon::get("go-next-view"), tr("Activate Next Chat List"), coll,
this, SLOT(nextBufferView()), QKeySequence(QKeySequence::Forward)));
- coll->addAction("PreviousBufferView", new Action(QIcon::fromTheme("go-previous-view"), tr("Activate Previous Chat List"), coll,
+ coll->addAction("PreviousBufferView", new Action(icon::get("go-previous-view"), tr("Activate Previous Chat List"), coll,
this, SLOT(previousBufferView()), QKeySequence::Back));
- coll->addAction("NextBuffer", new Action(QIcon::fromTheme("go-down"), tr("Go to Next Chat"), coll,
+ coll->addAction("NextBuffer", new Action(icon::get("go-down"), tr("Go to Next Chat"), coll,
this, SLOT(nextBuffer()), QKeySequence(Qt::ALT + Qt::Key_Down)));
- coll->addAction("PreviousBuffer", new Action(QIcon::fromTheme("go-up"), tr("Go to Previous Chat"), coll,
+ coll->addAction("PreviousBuffer", new Action(icon::get("go-up"), tr("Go to Previous Chat"), coll,
this, SLOT(previousBuffer()), QKeySequence(Qt::ALT + Qt::Key_Up)));
}
_helpMenu->addAction(KStandardAction::aboutKDE(_kHelpMenu, SLOT(aboutKDE()), this));
#endif
_helpMenu->addSeparator();
- _helpDebugMenu = _helpMenu->addMenu(QIcon::fromTheme("tools-report-bug"), tr("Debug"));
+ _helpDebugMenu = _helpMenu->addMenu(icon::get("tools-report-bug"), tr("Debug"));
_helpDebugMenu->addAction(coll->action("DebugNetworkModel"));
_helpDebugMenu->addAction(coll->action("DebugBufferViewOverlay"));
_helpDebugMenu->addAction(coll->action("DebugMessageModel"));
auto action = dock->toggleViewAction();
action->setText(tr("Show File Transfers"));
- action->setIcon(QIcon::fromTheme("download"));
+ action->setIcon(icon::get("download"));
action->setShortcut(QKeySequence(Qt::Key_F6));
QtUi::actionCollection("General")->addAction("ShowTransferWidget", action);
_viewMenu->addAction(action);
switch (net->connectionState()) {
case Network::Initialized:
- action->setIcon(QIcon::fromTheme("network-connect"));
+ action->setIcon(icon::get("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());
}
break;
case Network::Disconnected:
- action->setIcon(QIcon::fromTheme("network-disconnect"));
+ action->setIcon(icon::get("network-disconnect"));
break;
default:
- action->setIcon(QIcon::fromTheme("network-wired"));
+ action->setIcon(icon::get("network-wired"));
}
}
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
+#include "phononnotificationbackend.h"
+
#include <QFileDialog>
-#include <QIcon>
#include <QUrl>
#include <phonon/mediaobject.h>
#include <phonon/backendcapabilities.h>
-#include "phononnotificationbackend.h"
-
#include "clientsettings.h"
+#include "icon.h"
#include "mainwin.h"
#include "qtui.h"
{
ui.setupUi(this);
_audioAvailable = !Phonon::BackendCapabilities::availableAudioOutputDevices().isEmpty();
- ui.enabled->setIcon(QIcon::fromTheme("media-playback-start"));
- ui.play->setIcon(QIcon::fromTheme("media-playback-start"));
- ui.open->setIcon(QIcon::fromTheme("document-open"));
+ ui.enabled->setIcon(icon::get("media-playback-start"));
+ ui.play->setIcon(icon::get("media-playback-start"));
+ ui.open->setIcon(icon::get("document-open"));
connect(ui.enabled, SIGNAL(toggled(bool)), SLOT(widgetChanged()));
connect(ui.filename, SIGNAL(textChanged(const QString &)), SLOT(widgetChanged()));
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
+#include "qtmultimedianotificationbackend.h"
+
#include <QFileDialog>
-#include <QIcon>
#include <QUrl>
-#include "qtmultimedianotificationbackend.h"
-
#include "clientsettings.h"
+#include "icon.h"
#include "mainwin.h"
#include "qtui.h"
: SettingsPage("Internal", "QtMultimediaNotification", parent)
{
ui.setupUi(this);
- ui.enabled->setIcon(QIcon::fromTheme("media-playback-start"));
- ui.play->setIcon(QIcon::fromTheme("media-playback-start"));
- ui.open->setIcon(QIcon::fromTheme("document-open"));
+ ui.enabled->setIcon(icon::get("media-playback-start"));
+ ui.play->setIcon(icon::get("media-playback-start"));
+ ui.open->setIcon(icon::get("document-open"));
_audioAvailable = (QMediaPlayer().availability() == QMultimedia::Available);
#include "buffermodel.h"
#include "chatlinemodel.h"
#include "contextmenuactionprovider.h"
+#include "icon.h"
#include "mainwin.h"
#include "qtuimessageprocessor.h"
#include "qtuisettings.h"
setupIconTheme();
- QApplication::setWindowIcon(QIcon::fromTheme("quassel"));
+ QApplication::setWindowIcon(icon::get("quassel"));
setContextMenuActionProvider(new ContextMenuActionProvider(this));
setToolBarActionProvider(new ToolBarActionProvider(this));
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <QIcon>
+#include "settingsdlg.h"
+
#include <QMessageBox>
#include <QPushButton>
-#include "settingsdlg.h"
-
#include "client.h"
+#include "icon.h"
SettingsDlg::SettingsDlg(QWidget *parent)
: QDialog(parent),
ui.setupUi(this);
setModal(true);
setAttribute(Qt::WA_DeleteOnClose, true);
- setWindowIcon(QIcon::fromTheme("configure"));
+ setWindowIcon(icon::get("configure"));
updateGeometry();
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <QIcon>
+#include "settingspagedlg.h"
+
#include <QMessageBox>
#include <QPushButton>
-#include "settingspagedlg.h"
+#include "icon.h"
SettingsPageDlg::SettingsPageDlg(SettingsPage *page, QWidget *parent)
: QDialog(parent)
ui.pageTitle->setText(page->title());
setWindowTitle(tr("Configure %1").arg(page->title()));
- setWindowIcon(QIcon::fromTheme("configure"));
+ setWindowIcon(icon::get("configure"));
// make the scrollarea behave sanely
ui.settingsFrame->setWidgetResizable(true);
#include "aliasessettingspage.h"
#include <QHeaderView>
-#include <QIcon>
#include <QItemSelectionModel>
+#include "icon.h"
+
AliasesSettingsPage::AliasesSettingsPage(QWidget *parent)
: SettingsPage(tr("IRC"), tr("Aliases"), parent)
{
ui.setupUi(this);
- ui.newAliasButton->setIcon(QIcon::fromTheme("list-add"));
- ui.deleteAliasButton->setIcon(QIcon::fromTheme("edit-delete"));
+ ui.newAliasButton->setIcon(icon::get("list-add"));
+ ui.deleteAliasButton->setIcon(icon::get("edit-delete"));
ui.aliasesView->setSelectionBehavior(QAbstractItemView::SelectRows);
ui.aliasesView->setSelectionMode(QAbstractItemView::SingleSelection);
#include "bufferviewsettingspage.h"
-#include <QIcon>
#include <QMessageBox>
-#include "client.h"
-#include "network.h"
+#include "buffermodel.h"
#include "bufferviewconfig.h"
#include "bufferviewfilter.h"
-#include "buffermodel.h"
+#include "client.h"
#include "clientbufferviewmanager.h"
+#include "icon.h"
+#include "network.h"
#include "networkmodel.h"
#include "util.h"
if (!Client::isCoreFeatureEnabled(Quassel::Feature::HideInactiveNetworks))
ui.hideInactiveNetworks->hide();
- ui.renameBufferView->setIcon(QIcon::fromTheme("edit-rename"));
- ui.addBufferView->setIcon(QIcon::fromTheme("list-add"));
- ui.deleteBufferView->setIcon(QIcon::fromTheme("edit-delete"));
+ ui.renameBufferView->setIcon(icon::get("edit-rename"));
+ ui.addBufferView->setIcon(icon::get("list-add"));
+ ui.deleteBufferView->setIcon(icon::get("edit-delete"));
reset();
#include "chatmonitorsettingspage.h"
-#include <QIcon>
-
#include "client.h"
+#include "icon.h"
#include "networkmodel.h"
#include "bufferviewconfig.h"
#include "buffermodel.h"
{
ui.setupUi(this);
- ui.activateBuffer->setIcon(QIcon::fromTheme("go-next"));
- ui.deactivateBuffer->setIcon(QIcon::fromTheme("go-previous"));
+ ui.activateBuffer->setIcon(icon::get("go-next"));
+ ui.deactivateBuffer->setIcon(icon::get("go-previous"));
// setup available buffers config (for the bufferview on the left)
_configAvailable = new BufferViewConfig(-667, this);
#include "coreaccountsettingspage.h"
-#include <QIcon>
-
#include "client.h"
#include "clientsettings.h"
#include "coreaccountmodel.h"
+#include "icon.h"
CoreAccountSettingsPage::CoreAccountSettingsPage(QWidget *parent)
: SettingsPage(tr("Remote Cores"), QString(), parent),
{
ui.setupUi(this);
initAutoWidgets();
- ui.addAccountButton->setIcon(QIcon::fromTheme("list-add"));
- ui.editAccountButton->setIcon(QIcon::fromTheme("document-edit"));
- ui.deleteAccountButton->setIcon(QIcon::fromTheme("edit-delete"));
+ ui.addAccountButton->setIcon(icon::get("list-add"));
+ ui.editAccountButton->setIcon(icon::get("document-edit"));
+ ui.deleteAccountButton->setIcon(icon::get("edit-delete"));
_model = new CoreAccountModel(Client::coreAccountModel(), this);
_filteredModel = new FilteredCoreAccountModel(_model, this);
#include "client.h"
#include "corehighlightsettingspage.h"
+#include "icon.h"
#include "qtui.h"
CoreHighlightSettingsPage::CoreHighlightSettingsPage(QWidget *parent)
connect(Client::instance(), SIGNAL(connected()), this, SLOT(clientConnected()));
// Warning icon
- ui.coreUnsupportedIcon->setPixmap(QIcon::fromTheme("dialog-warning").pixmap(16));
+ ui.coreUnsupportedIcon->setPixmap(icon::get("dialog-warning").pixmap(16));
// Set up client/monolithic remote highlights information
if (Quassel::runMode() == Quassel::Monolithic) {
#include "highlightsettingspage.h"
+#include <QHeaderView>
+#include <QMessageBox>
+
#include "client.h"
+#include "icon.h"
#include "qtui.h"
#include "uisettings.h"
-#include <QHeaderView>
-#include <QMessageBox>
HighlightSettingsPage::HighlightSettingsPage(QWidget *parent)
: SettingsPage(tr("Interface"),
#endif
// Information icon
- ui.localHighlightsIcon->setPixmap(QIcon::fromTheme("dialog-information").pixmap(16));
+ ui.localHighlightsIcon->setPixmap(icon::get("dialog-information").pixmap(16));
// Set up client/monolithic local highlights information
if (Quassel::runMode() == Quassel::Monolithic) {
#include "identitiessettingspage.h"
-#include <QIcon>
#include <QInputDialog>
#include <QMessageBox>
#include "client.h"
+#include "icon.h"
#include "signalproxy.h"
IdentitiesSettingsPage::IdentitiesSettingsPage(QWidget *parent)
_editSsl(false)
{
ui.setupUi(this);
- ui.renameIdentity->setIcon(QIcon::fromTheme("edit-rename"));
- ui.addIdentity->setIcon(QIcon::fromTheme("list-add-user"));
- ui.deleteIdentity->setIcon(QIcon::fromTheme("list-remove-user"));
+ ui.renameIdentity->setIcon(icon::get("edit-rename"));
+ ui.addIdentity->setIcon(icon::get("list-add-user"));
+ ui.deleteIdentity->setIcon(icon::get("list-remove-user"));
coreConnectionStateChanged(Client::isConnected()); // need a core connection!
connect(Client::instance(), SIGNAL(coreConnectionStateChanged(bool)), this, SLOT(coreConnectionStateChanged(bool)));
: QDialog(parent)
{
ui.setupUi(this);
- ui.abort->setIcon(QIcon::fromTheme("dialog-cancel"));
+ ui.abort->setIcon(icon::get("dialog-cancel"));
numevents = toCreate.count() + toUpdate.count() + toRemove.count();
rcvevents = 0;
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QFileDialog>
-#include <QIcon>
#include <QMimeData>
#include <QUrl>
#include <QMessageBox>
#endif
#include "client.h"
+#include "icon.h"
IdentityEditWidget::IdentityEditWidget(QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
- 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"));
+ ui.addNick->setIcon(icon::get("list-add"));
+ ui.deleteNick->setIcon(icon::get("edit-delete"));
+ ui.renameNick->setIcon(icon::get("edit-rename"));
+ ui.nickUp->setIcon(icon::get("go-up"));
+ ui.nickDown->setIcon(icon::get("go-down"));
// We need to know whenever the state of input widgets changes...
connect(ui.realName, SIGNAL(textEdited(const QString &)), this, SIGNAL(widgetHasChanged()));
#include "ignorelistsettingspage.h"
#include <QHeaderView>
-#include <QIcon>
#include <QItemSelectionModel>
#include <QModelIndex>
#include <QPainter>
#include <QEvent>
#include <QDebug>
+#include "icon.h"
+
IgnoreListSettingsPage::IgnoreListSettingsPage(QWidget *parent)
: SettingsPage(tr("IRC"), tr("Ignore List"), parent)
{
ui.setupUi(this);
_delegate = new IgnoreListDelegate(ui.ignoreListView);
- ui.newIgnoreRuleButton->setIcon(QIcon::fromTheme("list-add"));
- ui.deleteIgnoreRuleButton->setIcon(QIcon::fromTheme("edit-delete"));
- ui.editIgnoreRuleButton->setIcon(QIcon::fromTheme("configure"));
+ ui.newIgnoreRuleButton->setIcon(icon::get("list-add"));
+ ui.deleteIgnoreRuleButton->setIcon(icon::get("edit-delete"));
+ ui.editIgnoreRuleButton->setIcon(icon::get("configure"));
ui.ignoreListView->setSelectionBehavior(QAbstractItemView::SelectRows);
ui.ignoreListView->setSelectionMode(QAbstractItemView::SingleSelection);
#include <QDebug>
#include <QKeyEvent>
#include <QHBoxLayout>
-#include <QIcon>
#include <QMessageBox>
#include <QToolButton>
#include "action.h"
#include "actioncollection.h"
+#include "icon.h"
#include "keysequencewidget.h"
KeySequenceButton::KeySequenceButton(KeySequenceWidget *d_, QWidget *parent)
_keyButton = new KeySequenceButton(this, this);
_keyButton->setFocusPolicy(Qt::StrongFocus);
- _keyButton->setIcon(QIcon::fromTheme("configure"));
+ _keyButton->setIcon(icon::get("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);
layout->addWidget(_clearButton);
if (qApp->isLeftToRight())
- _clearButton->setIcon(QIcon::fromTheme("edit-clear-locationbar-rtl", QIcon::fromTheme("edit-clear")));
+ _clearButton->setIcon(icon::get("edit-clear-locationbar-rtl"));
else
- _clearButton->setIcon(QIcon::fromTheme("edit-clear-locationbar-ltr", QIcon::fromTheme("edit-clear")));
+ _clearButton->setIcon(icon::get("edit-clear-locationbar-ltr"));
setLayout(layout);
***************************************************************************/
#include <QHeaderView>
-#include <QIcon>
#include <QMessageBox>
#include <QTextCodec>
#include "networkssettingspage.h"
#include "client.h"
+#include "icon.h"
#include "identity.h"
#include "network.h"
#include "presetnetworks.h"
#endif
// set up icons
- 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"));
+ ui.renameNetwork->setIcon(icon::get("edit-rename"));
+ ui.addNetwork->setIcon(icon::get("list-add"));
+ ui.deleteNetwork->setIcon(icon::get("edit-delete"));
+ ui.addServer->setIcon(icon::get("list-add"));
+ ui.deleteServer->setIcon(icon::get("edit-delete"));
+ ui.editServer->setIcon(icon::get("configure"));
+ ui.upServer->setIcon(icon::get("go-up"));
+ ui.downServer->setIcon(icon::get("go-down"));
+ ui.editIdentities->setIcon(icon::get("configure"));
_ignoreWidgetChanges = false;
- connectedIcon = QIcon::fromTheme("network-connect");
- connectingIcon = QIcon::fromTheme("network-wired"); // FIXME network-connecting
- disconnectedIcon = QIcon::fromTheme("network-disconnect");
+ connectedIcon = icon::get("network-connect");
+ connectingIcon = icon::get("network-wired"); // FIXME network-connecting
+ disconnectedIcon = icon::get("network-disconnect");
// Status icons
- infoIcon = QIcon::fromTheme("dialog-information");
- warningIcon = QIcon::fromTheme("dialog-warning");
+ infoIcon = icon::get("dialog-information");
+ warningIcon = icon::get("dialog-warning");
foreach(int mib, QTextCodec::availableMibs()) {
QByteArray codec = QTextCodec::codecForMib(mib)->name();
foreach(Network::Server server, info.serverList) {
QListWidgetItem *item = new QListWidgetItem(QString("%1:%2").arg(server.host).arg(server.port));
if (server.useSsl)
- item->setIcon(QIcon::fromTheme("document-encrypt"));
+ item->setIcon(icon::get("document-encrypt"));
ui.serverList->addItem(item);
}
//setItemState(id);
NetworkAddDlg::NetworkAddDlg(const QStringList &exist, QWidget *parent) : QDialog(parent), existing(exist)
{
ui.setupUi(this);
- ui.useSSL->setIcon(QIcon::fromTheme("document-encrypt"));
+ ui.useSSL->setIcon(icon::get("document-encrypt"));
// Whenever useSSL is toggled, update the port number if not changed from the default
connect(ui.useSSL, SIGNAL(toggled(bool)), SLOT(updateSslPort(bool)));
ServerEditDlg::ServerEditDlg(const Network::Server &server, QWidget *parent) : QDialog(parent)
{
ui.setupUi(this);
- ui.useSSL->setIcon(QIcon::fromTheme("document-encrypt"));
+ ui.useSSL->setIcon(icon::get("document-encrypt"));
ui.host->setText(server.host);
ui.host->setFocus();
ui.port->setValue(server.port);
#include "simplenetworkeditor.h"
-#include <QIcon>
-
+#include "icon.h"
#include "networkssettingspage.h"
SimpleNetworkEditor::SimpleNetworkEditor(QWidget *parent)
{
ui.setupUi(this);
- 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.addServer->setIcon(icon::get("list-add"));
+ ui.deleteServer->setIcon(icon::get("edit-delete"));
+ ui.editServer->setIcon(icon::get("configure"));
+ ui.upServer->setIcon(icon::get("go-up"));
+ ui.downServer->setIcon(icon::get("go-down"));
connect(ui.networkNameEdit, SIGNAL(textEdited(const QString &)), this, SIGNAL(widgetHasChanged()));
connect(ui.channelList, SIGNAL(textChanged()), this, SIGNAL(widgetHasChanged()));
foreach(Network::Server server, _networkInfo.serverList) {
QListWidgetItem *item = new QListWidgetItem(QString("%1:%2").arg(server.host).arg(server.port));
if (server.useSsl)
- item->setIcon(QIcon::fromTheme("document-encrypt"));
+ item->setIcon(icon::get("document-encrypt"));
ui.serverList->addItem(item);
}
#include "snorenotificationbackend.h"
+#include <iostream>
+
#include <QtGui>
#include <QtGlobal>
#include <QMetaObject>
+#include <libsnore/snore.h>
+#include <libsnore/notification/notification.h>
+
#include "client.h"
+#include "icon.h"
#include "networkmodel.h"
#include "systraynotificationbackend.h"
#include "qtui.h"
-#include <iostream>
-
-
-#include <libsnore/snore.h>
-#include <libsnore/notification/notification.h>
-
SnoreNotificationBackend::SnoreNotificationBackend (QObject *parent)
- : AbstractNotificationBackend(parent),
- m_icon(QIcon::fromTheme("quassel", QIcon(":/icons/quassel.png")))
+ : AbstractNotificationBackend(parent)
+ , m_icon(icon::get("quassel"))
{
Snore::SnoreCore::instance().loadPlugins(
#ifdef HAVE_DBUS
+#include "statusnotifieritem.h"
+
#include <QApplication>
#include <QDir>
#include <QFile>
+#include <QIcon>
#include <QMenu>
#include <QMouseEvent>
#include <QTextDocument>
+#include "icon.h"
#include "qtui.h"
#include "quassel.h"
-#include "statusnotifieritem.h"
#include "statusnotifieritemdbus.h"
constexpr int kProtocolVersion {0};
baseDir.removeRecursively();
for (auto &&trayState : { State::Active, State::Passive, State::NeedsAttention }) {
auto iconName = SystemTray::iconName(trayState);
- QIcon icon = QIcon::fromTheme(iconName);
+ QIcon icon = icon::get(iconName);
if (!icon.isNull()) {
for (auto &&size : icon.availableSizes()) {
auto pixDir = QString{"%1/%2x%3/status"}.arg(baseDir.absolutePath()).arg(size.width()).arg(size.height());
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <QApplication>
-#include <QMenu>
-
#include "systemtray.h"
-#include "action.h"
-#include "actioncollection.h"
-#include "client.h"
-#include "qtui.h"
+#include <QApplication>
+#include <QMenu>
#ifdef HAVE_KDE4
# include <KMenu>
# include <KWindowSystem>
#endif
+#include "action.h"
+#include "actioncollection.h"
+#include "client.h"
+#include "icon.h"
+#include "qtui.h"
+
SystemTray::SystemTray(QWidget *parent)
: QObject(parent),
_associatedWidget(parent)
#ifdef HAVE_KDE4
KMenu *kmenu;
_trayMenu = kmenu = new KMenu();
- kmenu->addTitle(QIcon::fromTheme(iconName(State::Active)), "Quassel IRC");
+ kmenu->addTitle(icon::get(iconName(State::Active)), "Quassel IRC");
#else
_trayMenu = new QMenu(associatedWidget());
#endif
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <QIcon>
-
#include "systrayanimationnotificationbackend.h"
#include "clientsettings.h"
+#include "icon.h"
#include "mainwin.h"
#include "qtui.h"
#include "systemtray.h"
SystrayAnimationNotificationBackend::ConfigWidget::ConfigWidget(QWidget *parent) : SettingsPage("Internal", "SystrayAnimation", parent)
{
ui.setupUi(this);
- ui.enableAlert->setIcon(QIcon::fromTheme("dialog-information"));
+ ui.enableAlert->setIcon(icon::get("dialog-information"));
ui.attentionBehavior->setEnabled(ui.enableAlert->isChecked());
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
+#include "systraynotificationbackend.h"
+
#include <QApplication>
#include <QCheckBox>
#include <QGroupBox>
-#include <QIcon>
#include <QHBoxLayout>
-#include "systraynotificationbackend.h"
-
#include "client.h"
#include "clientsettings.h"
+#include "icon.h"
#include "mainwin.h"
#include "networkmodel.h"
#include "qtui.h"
SystrayNotificationBackend::ConfigWidget::ConfigWidget(QWidget *parent) : SettingsPage("Internal", "SystrayNotification", parent)
{
_showBubbleBox = new QCheckBox(tr("Show a message in a popup"));
- _showBubbleBox->setIcon(QIcon::fromTheme("dialog-information"));
+ _showBubbleBox->setIcon(icon::get("dialog-information"));
connect(_showBubbleBox, SIGNAL(toggled(bool)), this, SLOT(widgetChanged()));
QHBoxLayout *layout = new QHBoxLayout(this);
layout->addWidget(_showBubbleBox);
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
+#include "taskbarnotificationbackend.h"
+
#include <QApplication>
#include <QCheckBox>
#include <QHBoxLayout>
-#include <QIcon>
#include <QSpinBox>
-#include "taskbarnotificationbackend.h"
-
#include "clientsettings.h"
+#include "icon.h"
#include "mainwin.h"
#include "qtui.h"
#else
layout->addWidget(enabledBox = new QCheckBox(tr("Mark taskbar entry, timeout:"), this));
#endif
- enabledBox->setIcon(QIcon::fromTheme("flag-blue"));
+ enabledBox->setIcon(icon::get("flag-blue"));
enabledBox->setEnabled(true);
timeoutBox = new QSpinBox(this);
#include "topicwidget.h"
-#include <QIcon>
-
#include "client.h"
+#include "icon.h"
#include "networkmodel.h"
#include "uisettings.h"
#include "graphicalui.h"
: AbstractItemView(parent)
{
ui.setupUi(this);
- ui.topicEditButton->setIcon(QIcon::fromTheme("edit-rename"));
+ ui.topicEditButton->setIcon(icon::get("edit-rename"));
ui.topicLineEdit->setLineWrapEnabled(true);
ui.topicLineEdit->installEventFilter(this);
flatproxymodel.cpp
fontselector.cpp
graphicalui.cpp
+ icon.cpp
multilineedit.cpp
networkmodelcontroller.cpp
nickview.cpp
#include "clearablelineedit.h"
-#include <QIcon>
#include <QToolButton>
#include <QStyle>
+#include "icon.h"
+
ClearableLineEdit::ClearableLineEdit(QWidget *parent)
: QLineEdit(parent)
{
clearButton = new QToolButton(this);
- clearButton->setIcon(QIcon::fromTheme("edit-clear-locationbar-rtl", QIcon::fromTheme("edit-clear")));
+ clearButton->setIcon(icon::get("edit-clear-locationbar-rtl"));
clearButton->setCursor(Qt::ArrowCursor);
clearButton->setStyleSheet("QToolButton { border: none; padding: 0px; }");
clearButton->hide();
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <QIcon>
+#include "contextmenuactionprovider.h"
+
#include <QInputDialog>
#include <QMenu>
#include <QMessageBox>
#include <QMap>
-#include "contextmenuactionprovider.h"
-
#include "buffermodel.h"
#include "buffersettings.h"
-#include "clientidentity.h"
-#include "network.h"
-#include "util.h"
#include "client.h"
#include "clientignorelistmanager.h"
+#include "icon.h"
+#include "network.h"
+#include "util.h"
ContextMenuActionProvider::ContextMenuActionProvider(QObject *parent) : NetworkModelController(parent)
{
- registerAction(NetworkConnect, QIcon::fromTheme("network-connect"), tr("Connect"));
- registerAction(NetworkDisconnect, QIcon::fromTheme("network-disconnect"), tr("Disconnect"));
+ registerAction(NetworkConnect, icon::get("network-connect"), tr("Connect"));
+ registerAction(NetworkDisconnect, icon::get("network-disconnect"), tr("Disconnect"));
- registerAction(BufferJoin, QIcon::fromTheme("irc-join-channel"), tr("Join"));
- registerAction(BufferPart, QIcon::fromTheme("irc-close-channel"), tr("Part"));
+ registerAction(BufferJoin, icon::get("irc-join-channel"), tr("Join"));
+ registerAction(BufferPart, icon::get("irc-close-channel"), tr("Part"));
registerAction(BufferRemove, tr("Delete Chat(s)..."));
registerAction(BufferSwitchTo, tr("Go to Chat"));
registerAction(HideApplyToAll, tr("Set as Default..."));
registerAction(HideUseDefaults, tr("Use Defaults..."));
- registerAction(JoinChannel, QIcon::fromTheme("irc-join-channel"), tr("Join Channel..."));
+ registerAction(JoinChannel, icon::get("irc-join-channel"), tr("Join Channel..."));
registerAction(NickQuery, tr("Start Query"));
registerAction(NickSwitchTo, tr("Show Query"));
registerAction(NickIgnoreToggleEnabled3, "Enable", true);
registerAction(NickIgnoreToggleEnabled4, "Enable", true);
- 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(NickOp, icon::get("irc-operator"), tr("Give Operator Status"));
+ registerAction(NickDeop, icon::get("irc-remove-operator"), tr("Take Operator Status"));
+ registerAction(NickHalfop, icon::get("irc-voice"), tr("Give Half-Operator Status"));
+ registerAction(NickDehalfop, icon::get("irc-unvoice"), tr("Take Half-Operator Status"));
+ registerAction(NickVoice, icon::get("irc-voice"), tr("Give Voice"));
+ registerAction(NickDevoice, icon::get("irc-unvoice"), tr("Take Voice"));
+ registerAction(NickKick, icon::get("im-kick-user"), tr("Kick From Channel"));
+ registerAction(NickBan, icon::get("im-ban-user"), tr("Ban From Channel"));
+ registerAction(NickKickBan, icon::get("im-ban-kick-user"), tr("Kick && Ban"));
registerAction(HideBufferTemporarily, tr("Hide Chat(s) Temporarily"));
registerAction(HideBufferPermanently, tr("Hide Chat(s) Permanently"));
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-2018 by the Quassel Project *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) version 3. *
+ * *
+ * This program 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 General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+
+#include "icon.h"
+
+#include <set>
+
+#include <QDebug>
+
+namespace icon {
+
+namespace {
+
+void printWarning(const QString &iconName, const QString &extra = {})
+{
+ static std::set<QString> warnedAbout;
+ if (warnedAbout.insert(iconName).second) {
+ qWarning() << "Missing icon:" << iconName << qPrintable(extra);
+ }
+}
+
+}
+
+
+QIcon get(const QString &iconName, const QString &fallbackPath)
+{
+ return get(std::vector<QString>{iconName}, fallbackPath);
+}
+
+
+QIcon get(const std::vector<QString> &iconNames, const QString &fallbackPath)
+{
+ for (auto &&iconName : iconNames) {
+ // Exact match
+ if (QIcon::hasThemeIcon(iconName)) {
+ return QIcon::fromTheme(iconName);
+ }
+ }
+
+ for (auto &&iconName : iconNames) {
+ // Try to get something from the theme anyway (i.e. a more generic fallback)
+ QIcon fallback = QIcon::fromTheme(iconName);
+ if (!fallback.availableSizes().isEmpty()) {
+ printWarning(iconName, QString{"(using fallback: \"%1\")"}.arg(fallback.name()));
+ return fallback;
+ }
+ }
+
+ // Build error string
+ QStringList requested;
+ for (auto &&iconName : iconNames) {
+ requested << iconName;
+ }
+ QString missing = "{" + requested.join(", ") + "}";
+
+ // Nothing from the theme, so try to load from path if given
+ if (!fallbackPath.isEmpty()) {
+ QIcon fallback{fallbackPath};
+ if (!fallback.availableSizes().isEmpty()) {
+ printWarning(missing, QString{"(using fallback: \"%1\")"}.arg(fallbackPath));
+ return fallback;
+ }
+ }
+
+ // Meh.
+ printWarning(missing);
+ return {};
+}
+
+}
--- /dev/null
+/***************************************************************************
+ * Copyright (C) 2005-2018 by the Quassel Project *
+ * devel@quassel-irc.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) version 3. *
+ * *
+ * This program 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 General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the *
+ * Free Software Foundation, Inc., *
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
+ ***************************************************************************/
+
+#pragma once
+
+#include <vector>
+
+#include <QIcon>
+#include <QString>
+
+namespace icon {
+
+/**
+ * Gets an icon from the current icon theme.
+ *
+ * If the theme does not provide the icon, tries to load the icon from the
+ * fallback path, if given.
+ *
+ * If no icon can be found, a warning is displayed and a null icon returned.
+ *
+ * @param iconName Icon name
+ * @param fallbackPath Full path to a fallback icon
+ * @returns The requested icon, if available
+ */
+QIcon get(const QString &iconName, const QString &fallbackPath = {});
+
+/**
+ * Gets an icon from the current icon theme.
+ *
+ * If the theme does not provide any of the given icon names, tries to load the
+ * icon from the fallback path, if given.
+ *
+ * If no icon can be found, a warning is displayed and a null icon returned.
+ *
+ * @param iconNames List of icon names (first match wins)
+ * @param fallbackPath Full path to a fallback icon
+ * @returns The requested icon, if available
+ */
+QIcon get(const std::vector<QString> &iconNames, const QString &fallbackPath = {});
+
+}
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
+#include "networkmodelcontroller.h"
+
#include <QComboBox>
#include <QDialogButtonBox>
#include <QGridLayout>
#include <QMessageBox>
#include <QPushButton>
-#include "networkmodelcontroller.h"
-
#include "buffermodel.h"
#include "buffersettings.h"
+#include "client.h"
#include "clientidentity.h"
+#include "clientignorelistmanager.h"
+#include "icon.h"
#include "network.h"
#include "util.h"
-#include "clientignorelistmanager.h"
-#include "client.h"
NetworkModelController::NetworkModelController(QObject *parent)
: QObject(parent),
NetworkModelController::JoinDlg::JoinDlg(const QModelIndex &index, QWidget *parent) : QDialog(parent)
{
- setWindowIcon(QIcon::fromTheme("irc-join-channel"));
+ setWindowIcon(icon::get("irc-join-channel"));
setWindowTitle(tr("Join Channel"));
QGridLayout *layout = new QGridLayout(this);
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
***************************************************************************/
-#include <QIcon>
+#include "toolbaractionprovider.h"
+
#include <QMenu>
#include <QToolBar>
-#include "toolbaractionprovider.h"
+#include "icon.h"
ToolBarActionProvider::ToolBarActionProvider(QObject *parent)
: NetworkModelController(parent)
{
- registerAction(NetworkConnectAllWithDropdown, QIcon::fromTheme("network-connect"), tr("Connect"))->setToolTip(tr("Connect to IRC"));
- registerAction(NetworkDisconnectAllWithDropdown, QIcon::fromTheme("network-disconnect"), tr("Disconnect"))->setToolTip(tr("Disconnect from IRC"));
+ registerAction(NetworkConnectAllWithDropdown, icon::get("network-connect"), tr("Connect"))->setToolTip(tr("Connect to IRC"));
+ registerAction(NetworkDisconnectAllWithDropdown, icon::get("network-disconnect"), tr("Disconnect"))->setToolTip(tr("Disconnect from IRC"));
registerAction(NetworkConnectAll, tr("Connect to all"));
registerAction(NetworkDisconnectAll, tr("Disconnect from all"));
- 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(BufferPart, icon::get("irc-close-channel"), tr("Part"))->setToolTip(tr("Leave currently selected channel"));
+ registerAction(JoinChannel, icon::get("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(NickQuery, icon::get("mail-message-new"), tr("Query"))->setToolTip(tr("Start a private conversation")); // fix icon
+ registerAction(NickWhois, icon::get("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"));
+ registerAction(NickOp, icon::get("irc-operator"), tr("Op"))->setToolTip(tr("Give operator privileges to user"));
+ registerAction(NickDeop, icon::get("irc-remove-operator"), tr("Deop"))->setToolTip(tr("Take operator privileges from user"));
+ registerAction(NickVoice, icon::get("irc-voice"), tr("Voice"))->setToolTip(tr("Give voice to user"));
+ registerAction(NickDevoice, icon::get("irc-unvoice"), tr("Devoice"))->setToolTip(tr("Take voice from user"));
+ registerAction(NickKick, icon::get("im-kick-user"), tr("Kick"))->setToolTip(tr("Remove user from channel"));
+ registerAction(NickBan, icon::get("im-ban-user"), tr("Ban"))->setToolTip(tr("Ban user from channel"));
+ registerAction(NickKickBan, icon::get("im-ban-kick-user"), tr("Kick/Ban"))->setToolTip(tr("Remove and ban user from channel"));
_networksConnectMenu = new QMenu();
_networksConnectMenu->setSeparatorsCollapsible(false);
#include <QApplication>
#include <QColor>
-#include <QIcon>
#include "buffersettings.h"
+#include "icon.h"
#include "qssparser.h"
#include "quassel.h"
#include "uistyle.h"
}
UiStyle::UiStyle(QObject *parent)
- : QObject(parent),
- _channelJoinedIcon(QIcon::fromTheme("irc-channel-active", QIcon(":/icons/irc-channel-active.png"))),
- _channelPartedIcon(QIcon::fromTheme("irc-channel-inactive", QIcon(":/icons/irc-channel-inactive.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"))
+ : QObject(parent)
+ , _channelJoinedIcon{icon::get("irc-channel-active")}
+ , _channelPartedIcon{icon::get("irc-channel-inactive")}
+ , _userOfflineIcon{icon::get({"im-user-offline", "user-offline"})}
+ , _userOnlineIcon{icon::get({"im-user-online", "im-user", "user-available"})}
+ , _userAwayIcon{icon::get({"im-user-away", "user-away"})}
+ , _categoryOpIcon{icon::get("irc-operator")}
+ , _categoryVoiceIcon{icon::get("irc-voice")}
+ , _opIconLimit{UserCategoryItem::categoryFromModes("o")}
+ , _voiceIconLimit{UserCategoryItem::categoryFromModes("v")}
{
static bool registered = []() {
qRegisterMetaType<FormatList>();