mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-08 07:07:05 +02:00
Add basic support for loading a qml gui
This commit is contained in:
@@ -24,6 +24,8 @@ SET( TOMAHAWK_VERSION_PATCH 99 )
|
|||||||
# build options
|
# build options
|
||||||
option(BUILD_GUI "Build Tomahawk with GUI" ON)
|
option(BUILD_GUI "Build Tomahawk with GUI" ON)
|
||||||
option(BUILD_RELEASE "Generate TOMAHAWK_VERSION without GIT info" OFF)
|
option(BUILD_RELEASE "Generate TOMAHAWK_VERSION without GIT info" OFF)
|
||||||
|
option(BUILD_GUI_QML"Build Tomahawk with QML Support" OFF)
|
||||||
|
|
||||||
|
|
||||||
# generate version string
|
# generate version string
|
||||||
|
|
||||||
@@ -71,6 +73,11 @@ ELSE()
|
|||||||
MESSAGE( STATUS "Building Tomahawk ${TOMAHAWK_VERSION} full GUI version ***" )
|
MESSAGE( STATUS "Building Tomahawk ${TOMAHAWK_VERSION} full GUI version ***" )
|
||||||
LIST(APPEND NEEDED_QT4_COMPONENTS "QtGui" "QtWebkit" )
|
LIST(APPEND NEEDED_QT4_COMPONENTS "QtGui" "QtWebkit" )
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
IF( BUILD_GUI_QML )
|
||||||
|
MESSAGE( STATUS "Building Tomahawk QML version ***" )
|
||||||
|
LIST(APPEND NEEDED_QT4_COMPONENTS "QtDeclarative" )
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
|
|
||||||
IF( BUILD_GUI AND UNIX AND NOT APPLE )
|
IF( BUILD_GUI AND UNIX AND NOT APPLE )
|
||||||
FIND_PACKAGE( X11 )
|
FIND_PACKAGE( X11 )
|
||||||
|
@@ -238,7 +238,7 @@ IF(QCA2_FOUND)
|
|||||||
SET(LINK_LIBRARIES ${LINK_LIBRARIES} ${QCA2_LIBRARIES} )
|
SET(LINK_LIBRARIES ${LINK_LIBRARIES} ${QCA2_LIBRARIES} )
|
||||||
ENDIF(QCA2_FOUND)
|
ENDIF(QCA2_FOUND)
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES( tomahawk
|
SET( tomahawkLinkLibraries
|
||||||
${LINK_LIBRARIES}
|
${LINK_LIBRARIES}
|
||||||
${TOMAHAWK_LIBRARIES}
|
${TOMAHAWK_LIBRARIES}
|
||||||
${PHONON_LIBS}
|
${PHONON_LIBS}
|
||||||
@@ -251,6 +251,13 @@ TARGET_LINK_LIBRARIES( tomahawk
|
|||||||
${TAGLIB_LIBRARIES}
|
${TAGLIB_LIBRARIES}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
TARGET_LINK_LIBRARIES( tomahawk ${tomahawkLinkLibraries} )
|
||||||
|
|
||||||
|
IF( BUILD_GUI_QML )
|
||||||
|
# sic! add_subdirectory would make it harder to reuse ${final_src}
|
||||||
|
INCLUDE( active/CMakeLists.txt )
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
IF( APPLE )
|
IF( APPLE )
|
||||||
IF(HAVE_SPARKLE)
|
IF(HAVE_SPARKLE)
|
||||||
MESSAGE("Sparkle Found, installing framekwork in bundle")
|
MESSAGE("Sparkle Found, installing framekwork in bundle")
|
||||||
|
@@ -42,6 +42,10 @@ main( int argc, char *argv[] )
|
|||||||
AEInstallEventHandler( 'GURL', 'GURL', h, 0, false );
|
AEInstallEventHandler( 'GURL', 'GURL', h, 0, false );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef TOUCHMAHAWK
|
||||||
|
QApplication::setGraphicsSystem( "raster" );
|
||||||
|
#endif
|
||||||
|
|
||||||
TomahawkApp a( argc, argv );
|
TomahawkApp a( argc, argv );
|
||||||
KDSingleApplicationGuard guard( &a, KDSingleApplicationGuard::AutoKillOtherInstances );
|
KDSingleApplicationGuard guard( &a, KDSingleApplicationGuard::AutoKillOtherInstances );
|
||||||
QObject::connect( &guard, SIGNAL( instanceStarted( KDSingleApplicationGuard::Instance ) ), &a, SLOT( instanceStarted( KDSingleApplicationGuard::Instance ) ) );
|
QObject::connect( &guard, SIGNAL( instanceStarted( KDSingleApplicationGuard::Instance ) ), &a, SLOT( instanceStarted( KDSingleApplicationGuard::Instance ) ) );
|
||||||
|
@@ -69,6 +69,10 @@
|
|||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef TOUCHMAHAWK
|
||||||
|
#include "active/tomahawkwindowdeclarative.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
// should go to a plugin actually
|
// should go to a plugin actually
|
||||||
#ifdef GLOOX_FOUND
|
#ifdef GLOOX_FOUND
|
||||||
#include "xmppbot/xmppbot.h"
|
#include "xmppbot/xmppbot.h"
|
||||||
@@ -222,7 +226,15 @@ TomahawkApp::init()
|
|||||||
m_mainwindow = new TomahawkWindow();
|
m_mainwindow = new TomahawkWindow();
|
||||||
m_mainwindow->setWindowTitle( "Tomahawk" );
|
m_mainwindow->setWindowTitle( "Tomahawk" );
|
||||||
m_mainwindow->setObjectName( "TH_Main_Window" );
|
m_mainwindow->setObjectName( "TH_Main_Window" );
|
||||||
|
|
||||||
|
#ifndef TOUCHMAHAWK
|
||||||
m_mainwindow->show();
|
m_mainwindow->show();
|
||||||
|
#else
|
||||||
|
m_declarativeWindow = new TomahawkWindowDeclarative();
|
||||||
|
m_declarativeWindow->setWindowTitle( "Touch-ma-hawk" );
|
||||||
|
m_declarativeWindow->show();
|
||||||
|
#endif // TOUCHMAHAWK
|
||||||
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@@ -68,6 +68,10 @@ namespace Tomahawk
|
|||||||
class TomahawkWindow;
|
class TomahawkWindow;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef TOUCHMAHAWK
|
||||||
|
class TomahawkWindowDeclarative;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// this also acts as a a container for important top-level objects
|
// this also acts as a a container for important top-level objects
|
||||||
// that other parts of the app need to find
|
// that other parts of the app need to find
|
||||||
@@ -90,6 +94,10 @@ public:
|
|||||||
TomahawkWindow* mainWindow() const { return m_mainwindow; }
|
TomahawkWindow* mainWindow() const { return m_mainwindow; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef TOUCHMAHAWK
|
||||||
|
TomahawkWindowDeclarative* declarativeWindow() const { return m_declarativeWindow; }
|
||||||
|
#endif
|
||||||
|
|
||||||
void enableScriptResolver( const QString& scriptPath );
|
void enableScriptResolver( const QString& scriptPath );
|
||||||
void disableScriptResolver( const QString& scriptPath );
|
void disableScriptResolver( const QString& scriptPath );
|
||||||
Tomahawk::ExternalResolver* resolverForPath( const QString& scriptPath );
|
Tomahawk::ExternalResolver* resolverForPath( const QString& scriptPath );
|
||||||
@@ -139,6 +147,10 @@ private:
|
|||||||
TomahawkWindow* m_mainwindow;
|
TomahawkWindow* m_mainwindow;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef TOUCHMAHAWK
|
||||||
|
TomahawkWindowDeclarative* m_declarativeWindow;
|
||||||
|
#endif
|
||||||
|
|
||||||
bool m_headless;
|
bool m_headless;
|
||||||
|
|
||||||
QxtHttpServerConnector m_connector;
|
QxtHttpServerConnector m_connector;
|
||||||
|
@@ -42,6 +42,11 @@ TomahawkTrayIcon::TomahawkTrayIcon( QObject* parent )
|
|||||||
m_contextMenu = new QMenu();
|
m_contextMenu = new QMenu();
|
||||||
setContextMenu( m_contextMenu );
|
setContextMenu( m_contextMenu );
|
||||||
|
|
||||||
|
#ifdef TOUCHMAHAWK
|
||||||
|
connect(m_contextMenu->addAction( tr("Show Desktop Gui") ), SIGNAL( triggered() ), parent, SLOT( show() ) );
|
||||||
|
m_contextMenu->addSeparator();
|
||||||
|
#endif TOUCHMAHAWK
|
||||||
|
|
||||||
m_playPauseAction = m_contextMenu->addAction( tr( "Play" ) );
|
m_playPauseAction = m_contextMenu->addAction( tr( "Play" ) );
|
||||||
//m_pauseAction = m_contextMenu->addAction( tr( "Pause" ) );
|
//m_pauseAction = m_contextMenu->addAction( tr( "Pause" ) );
|
||||||
m_stopAction = m_contextMenu->addAction( tr( "Stop" ) );
|
m_stopAction = m_contextMenu->addAction( tr( "Stop" ) );
|
||||||
@@ -179,7 +184,14 @@ TomahawkTrayIcon::onActivated( QSystemTrayIcon::ActivationReason reason )
|
|||||||
{
|
{
|
||||||
case QSystemTrayIcon::Trigger:
|
case QSystemTrayIcon::Trigger:
|
||||||
{
|
{
|
||||||
TomahawkWindow* mainwindow = APP->mainWindow();
|
QMainWindow* mainwindow = 0;
|
||||||
|
|
||||||
|
#ifndef TOUCHMAHAWK
|
||||||
|
mainwindow = APP->mainWindow();
|
||||||
|
#else
|
||||||
|
mainwindow = (QMainWindow*) APP->declarativeWindow();
|
||||||
|
#endif
|
||||||
|
|
||||||
if ( mainwindow->isVisible() )
|
if ( mainwindow->isVisible() )
|
||||||
{
|
{
|
||||||
mainwindow->hide();
|
mainwindow->hide();
|
||||||
|
Reference in New Issue
Block a user