Put scripts into 'scripts' sub-folder, and .css files into 'themes'

This commit is contained in:
craig.p.drummond
2013-04-08 17:10:02 +00:00
committed by craig.p.drummond
parent af8ae74754
commit ffe9477277
9 changed files with 18 additions and 16 deletions

View File

@@ -598,7 +598,7 @@ ELSE( ENABLE_KDE_SUPPORT )
ENDIF( ENABLE_KDE_SUPPORT )
if (NOT WIN32)
install(PROGRAMS dynamic/cantata-dynamic DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME}/)
install(PROGRAMS dynamic/cantata-dynamic DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME}/scripts)
if (MTP_FOUND)
TARGET_LINK_LIBRARIES(cantata ${MTP_LIBRARIES})
include_directories(${MTP_INCLUDE_DIR})

15
README
View File

@@ -202,8 +202,9 @@ The list of dynamic playlists may be obtained by looking in
To 'load' a dynamic playlist, all you need to do is symlink the desired one in
~/.config/cantata/dynamic to ~/.cache/cantata/dynamic/rules. Then you can start
the helper by calling '/usr/bin/cantata-dynamic start' (or first call
'/usr/bin/cantata-dynamic stop' to stop any current playlist).
the helper by calling '/usr/share/cantata/scripts/cantata-dynamic start' (or
first call '/usr/share/cantata/scripts/cantata-dynamic stop' to stop any current
playlist).
To pass connection details, cantata-dynamic reads the same environment variables
as mpc - namely MPD_HOST and MPD_PORT
@@ -213,7 +214,7 @@ playlist, load the 'MyPlaylist' playlist, and start this on the mpd at
'hostname:1234' with password 'pass'
# Stop current dynamic playlist
/usr/share/cantata/cantata-dynamic stop
/usr/share/cantata/scripts/cantata-dynamic stop
# Clear the playqueue (this requires mpc)
MPD_HOST=pass@hostname MPD_PORT=1234 mpc clear
# 'Load' new playlist
@@ -222,7 +223,7 @@ playlist, load the 'MyPlaylist' playlist, and start this on the mpd at
fi
ln -s "$HOME/.config/cantata/dynamic/MyPlaylist.rules" "$HOME/.cache/cantata/dynamic/rules"
# Restart dynamic script
MPD_HOST=pass@hostname MPD_PORT=1234 /usr/share/cantata/cantata-dynamic start
MPD_HOST=pass@hostname MPD_PORT=1234 /usr/share/cantata/scripts/cantata-dynamic start
Dynamic Helper - Server Mode
@@ -235,7 +236,7 @@ started. e.g. The script should be started as:
<prefix>/share/cantata/cantata-dynamic server <location of config file>
e.g.: /usr/share/cantata/cantata-dynamic server /etc/cantata-dynamic.conf
e.g.: /usr/share/cantata/scripts/cantata-dynamic server /etc/cantata-dynamic.conf
When run as described above, the script will automatically daemonize itself.
@@ -290,8 +291,8 @@ one of the example init scripts (or create a new one) to
/etc/init.d/cantata.dynamic - and create the appropriate links in /etc/rc?.d
NOTE: These example script assume cantata has been installed to /usr, and that
cantata-dynamic is in /usr/share/cantata/. If this is not the case, then these
will need to be edited.
cantata-dynamic is in /usr/share/cantata/scripts. If this is not the case, then
these will need to be edited.
Copy dynamic/init/cantata-dynamic.conf to /etc, and edit as appropriate.

View File

@@ -24,4 +24,4 @@ include_directories( ${QTINCLUDES} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_B
install(FILES ${_qmFile} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/cantata/)
install(PROGRAMS mount.cifs.wrapper DESTINATION ${CMAKE_INSTALL_PREFIX}/share/cantata/ )
install(PROGRAMS mount.cifs.wrapper DESTINATION ${CMAKE_INSTALL_PREFIX}/share/cantata/scripts/ )

View File

@@ -131,7 +131,8 @@ void Mounter::mount(const QString &url, const QString &mountPoint, int uid, int
connect(proc, SIGNAL(finished(int)), SLOT(mountResult(int)));
proc->setProperty("mp", mountPoint);
proc->setProperty("pid", pid);
proc->start(INSTALL_PREFIX"/share/cantata/mount.cifs.wrapper", QStringList() << path << mountPoint
proc->start(QLatin1String(INSTALL_PREFIX"/share/cantata/scripts/mount.cifs.wrapper"),
QStringList() << path << mountPoint
<< "-o" <<
(temp ? ("credentials="+temp->fileName()+",") : QString())+
"uid="+QString::number(uid)+",gid="+QString::number(gid)+

View File

@@ -405,7 +405,7 @@ int Dynamic::getPid() const
bool Dynamic::controlApp(bool isStart)
{
QString cmd=QLatin1String(INSTALL_PREFIX"/share/cantata/cantata-dynamic");
QString cmd=QLatin1String(INSTALL_PREFIX"/share/cantata/scripts/cantata-dynamic");
QProcess process;
if (isStart) {

View File

@@ -8,12 +8,12 @@
case "$1" in
start)
stat_busy 'Starting Cantata MPD Dynamizer'
/usr/share/cantata/cantata-dynamic server /etc/cantata-dynamic.conf &> /dev/null &&
/usr/share/cantata/scripts/cantata-dynamic server /etc/cantata-dynamic.conf &> /dev/null &&
{ add_daemon cantata-dynamic; stat_done; } || stat_fail
;;
stop)
stat_busy 'Stopping Cantata MPD Dynamizer'
/usr/share/cantata/cantata-dynamic stopserver /etc/cantata-dynamic.conf &> /dev/null &&
/usr/share/cantata/scripts/cantata-dynamic stopserver /etc/cantata-dynamic.conf &> /dev/null &&
{ rm_daemon cantata-dynamic; stat_done; } || stat_fail
;;
restart)

View File

@@ -17,7 +17,7 @@
PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=cantata-dynamic
DESC="Cantata MPD Dynamizer"
DAEMON=/usr/share/cantata/cantata-dynamic
DAEMON=/usr/share/cantata/scripts/cantata-dynamic
CANTATA_DYNAMIC_CONF=/etc/cantata-dynamic.conf
START_CANTATA_DYNAMIC=true

View File

@@ -27,7 +27,7 @@ if (NOT WIN32)
SET( SUPPORT_SRCS ${SUPPORT_SRCS} osthumb.cpp)
SET( SUPPORT_MOC_HDRS ${SUPPORT_MOC_HDRS} osthumb.h)
endif (ENABLE_OVERLAYSCROLLBARS)
install(FILES ambiance.css radiance.css DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME}/)
install(FILES ambiance.css radiance.css DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${CMAKE_PROJECT_NAME}/themes)
endif (NOT WIN32)
if (ENABLE_KDE_SUPPORT )

View File

@@ -180,7 +180,7 @@ void GtkStyle::applyTheme(QWidget *widget)
QString theme=GtkStyle::themeName().toLower();
GtkProxyStyle::ScrollbarType sbType=GtkProxyStyle::SB_Standard;
if (!theme.isEmpty()) {
QFile cssFile(QLatin1String(INSTALL_PREFIX"/share/")+QCoreApplication::applicationName()+"/"+theme+QLatin1String(".css"));
QFile cssFile(QLatin1String(INSTALL_PREFIX"/share/")+QCoreApplication::applicationName()+QLatin1String("/themes/")+theme+QLatin1String(".css"));
if (cssFile.open(QFile::ReadOnly)) {
QString css=QLatin1String(cssFile.readAll());
QString header=css.left(100);