+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>CFBundleName</key>
- <string>Minitube</string>
- <key>CFBundleIconFile</key>
- <string>minitube.icns</string>
- <key>CFBundlePackageType</key>
- <string>APPL</string>
- <key>CFBundleGetInfoString</key>
- <string>Copyright 2009 Flavio Tordini</string>
- <key>CFBundleExecutable</key>
- <string>minitube</string>
- <key>CFBundleIdentifier</key>
- <string>org.tordini.flavio.minitube</string>
-</dict>
-</plist>
+++ /dev/null
-IDI_ICON1 ICON DISCARDABLE "minitube.ico"
-
<RCC>
<qresource prefix="/">
<file>images/app.png</file>
- <file>images/view-fullscreen.png</file>
- <file>images/media-playback-pause.png</file>
- <file>images/media-playback-start.png</file>
- <file>images/media-playback-stop.png</file>
- <file>images/media-skip-forward.png</file>
</qresource>
</RCC>
+++ /dev/null
-#ifndef CONSTANTS_H
-#define CONSTANTS_H
-
-#include <QString>
-
-namespace Constants {
- static const char *VERSION = "1.0";
- static const char *APP_NAME = "Minitube";
- static const char *ORG_NAME = "Flavio Tordini";
- static const char *ORG_DOMAIN = "flavio.tordini.org";
- static const char *WEBSITE = "http://flavio.tordini.org/minitube";
- static const char *EMAIL = "flavio.tordini@gmail.com";
- static const QString USER_AGENT = QString(APP_NAME) + " " + VERSION + " (" + WEBSITE + ")";
-}
-
-#endif
QMap<QString, QAction*> *actions = The::globalActions();
- stopAct = new QAction(QtIconLoader::icon("media-playback-stop", QIcon(":/images/media-playback-stop.png")), tr("&Stop"), this);
+ stopAct = new QAction(QtIconLoader::icon("media-playback-stop"), tr("&Stop"), this);
stopAct->setStatusTip(tr("Stop playback and go back to the search view"));
stopAct->setShortcuts(QList<QKeySequence>() << QKeySequence(Qt::Key_Escape) << QKeySequence(Qt::Key_MediaStop));
actions->insert("stop", stopAct);
connect(stopAct, SIGNAL(triggered()), this, SLOT(stop()));
- skipAct = new QAction(QtIconLoader::icon("media-skip-forward", QIcon(":/images/media-skip-forward.png")), tr("S&kip"), this);
+ skipAct = new QAction(QtIconLoader::icon("media-skip-forward"), tr("S&kip"), this);
skipAct->setStatusTip(tr("Skip to the next video"));
skipAct->setShortcuts(QList<QKeySequence>() << QKeySequence(Qt::CTRL + Qt::Key_Right) << QKeySequence(Qt::Key_MediaNext));
skipAct->setEnabled(false);
actions->insert("skip", skipAct);
connect(skipAct, SIGNAL(triggered()), mediaView, SLOT(skip()));
- pauseAct = new QAction(QtIconLoader::icon("media-playback-pause", QIcon(":/images/media-playback-pause.png")), tr("&Pause"), this);
+ pauseAct = new QAction(QtIconLoader::icon("media-playback-pause"), tr("&Pause"), this);
pauseAct->setStatusTip(tr("Pause playback"));
pauseAct->setShortcuts(QList<QKeySequence>() << QKeySequence(Qt::Key_Space) << QKeySequence(Qt::Key_MediaPlay));
pauseAct->setEnabled(false);
actions->insert("pause", pauseAct);
connect(pauseAct, SIGNAL(triggered()), mediaView, SLOT(pause()));
- fullscreenAct = new QAction(QtIconLoader::icon("view-fullscreen", QIcon(":/images/view-fullscreen.png")), tr("&Full Screen"), this);
+ fullscreenAct = new QAction(QtIconLoader::icon("view-fullscreen"), tr("&Full Screen"), this);
fullscreenAct->setStatusTip(tr("Go full screen"));
fullscreenAct->setShortcut(QKeySequence(Qt::ALT + Qt::Key_Return));
fullscreenAct->setShortcutContext(Qt::ApplicationShortcut);
case Phonon::PlayingState:
pauseAct->setEnabled(true);
- pauseAct->setIcon(QtIconLoader::icon("media-playback-pause", QIcon(":/images/media-playback-pause.png")));
+ pauseAct->setIcon(QtIconLoader::icon("media-playback-pause"));
pauseAct->setText(tr("&Pause"));
pauseAct->setStatusTip(tr("Pause playback") + " (" + pauseAct->shortcut().toString(QKeySequence::NativeText) + ")");
skipAct->setEnabled(true);
case Phonon::PausedState:
skipAct->setEnabled(true);
pauseAct->setEnabled(true);
- pauseAct->setIcon(QtIconLoader::icon("media-playback-start", QIcon(":/images/media-playback-start.png")));
+ pauseAct->setIcon(QtIconLoader::icon("media-playback-start"));
pauseAct->setText(tr("&Play"));
pauseAct->setStatusTip(tr("Resume playback") + " (" + pauseAct->shortcut().toString(QKeySequence::NativeText) + ")");
break;
Q_GLOBAL_STATIC(QtIconLoaderImplementation, iconLoaderInstance)
#endif
-/*!
+ /*!
Returns the standard icon for the given icon /a name
as specified in the freedesktop icon spec
crossplatform code.
*/
-QIcon QtIconLoader::icon(const QString &name, const QIcon &fallback)
+ QIcon QtIconLoader::icon(const QString &name)
{
QIcon icon;
-#if QT_VERSION < 0x040600
-
#ifdef Q_WS_X11
+#if QT_VERSION < 0x040600
QString pngExtension(QLatin1String(".png"));
QList<int> iconSizes;
- iconSizes << 16 << 24 << 32 << 48 << 64;
+ iconSizes << 16 << 22 << 24 << 32 << 48;
Q_FOREACH (int size, iconSizes) {
- icon.addPixmap(iconLoaderInstance()->findIcon(size, name + pngExtension));
+ icon.addPixmap(iconLoaderInstance()->findIcon(size, name));
}
+#else
+ icon = QIcon::fromTheme(name);
#endif
-
#else
- icon = QIcon::fromTheme(name, fallback);
+ icon = QIcon(QString(":/images/%1.png").arg(name));
#endif
- if (icon.isNull())
- icon = fallback;
- Q_UNUSED(name);
return icon;
}
dataDirs.prepend(QDir::homePath() + QLatin1String("/:"));
QStringList kdeDirs = QFile::decodeName(getenv("KDEDIRS")).split(QLatin1Char(':'));
Q_FOREACH (const QString dirName, kdeDirs)
- dataDirs.append(QLatin1Char(':') + dirName + QLatin1String("/share"));
+ dataDirs.append(QLatin1Char(':') + dirName + QLatin1String("/share"));
iconDirs = dataDirs.split(QLatin1Char(':'));
QFileInfo fileInfo(QLatin1String("/usr/share/icons/default.kde"));
QString contentDir = (iconDirs[i].startsWith(QDir::homePath())) ?
QLatin1String("/.icons/") : QLatin1String("/icons/");
QString fileName = iconDirs[i] + contentDir + themeName + QLatin1Char('/') + subDirs[j] + QLatin1Char('/') + iconName;
- QFile file(fileName);
- if (file.exists())
- pixmap.load(fileName);
+
+ QString svgExtension(QLatin1String(".svg"));
+ QString svgFilename = fileName + svgExtension;
+ QFile svgFile(svgFilename);
+ if (false && svgFile.exists()) {
+ // qDebug() << "Found svg";
+ pixmap.load(svgFilename);
+ } else {
+ QString pngExtension(QLatin1String(".png"));
+ QString pngFilename = fileName + pngExtension;
+ QFile pngFile(pngFilename);
+ if (pngFile.exists()) {
+ // qDebug() << "Found png";
+ pixmap.load(pngFilename);
+ }
+ }
+
if (!pixmap.isNull())
break;
}
class QtIconLoader
{
public:
- static QIcon icon(const QString &name, const QIcon &fallback = QIcon());
+ static QIcon icon(const QString &name);
};
#endif // QTICONLOADER_H