diff --git a/src/qprojectM-jack/CMakeLists.txt b/src/qprojectM-jack/CMakeLists.txt index 0a9f5ad59..462b113be 100644 --- a/src/qprojectM-jack/CMakeLists.txt +++ b/src/qprojectM-jack/CMakeLists.txt @@ -31,12 +31,12 @@ ADD_DEFINITIONS(-DLINUX -DPROJECTM_PREFIX='"${PROJECTM_PREFIX}"') ADD_DEFINITIONS(${QT_DEFINITIONS}) ADD_DEFINITIONS(-DQT_NO_DEBUG) -INCLUDE_DIRECTORIES(${PROJECTM_INCLUDEDIR} ${JACK_INCLUDEDIR} ${SDL_INCLUDE_DIR} ${GTK_INCLUDE_DIR} ${QT_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTOPENGL_INCLUDE_DIR}) +INCLUDE_DIRECTORIES(${PROJECTM_INCLUDEDIR} ${JACK_INCLUDEDIR} ${SDL_INCLUDE_DIR} ${GTK_INCLUDE_DIR} ${QT_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTOPENGL_INCLUDE_DIR} ${QT_QTCORE_INCLUDE_DIR}) LINK_DIRECTORIES(${PROJECTM_LDFLAGS} ${JACK_LDFLAGS}) ADD_EXECUTABLE(qprojectM-jack ${qprojectM_jack_SRCS} ${qprojectM_jack_MOC_SRCS}) -TARGET_LINK_LIBRARIES(qprojectM-jack qprojectM projectM jack ${QT_QTGUI_LIBRARIES} ${QT_QTOPENGL_LIBRARIES} ${QT_LIBRARIES}) +TARGET_LINK_LIBRARIES(qprojectM-jack qprojectM projectM jack ${QT_QTGUI_LIBRARIES} ${QT_QTOPENGL_LIBRARIES} ${${QT_QTCORE_LIBRARIES} ${QT_LIBRARIES}) INSTALL(TARGETS qprojectM-jack DESTINATION ${CMAKE_INSTALL_PREFIX}/bin ) \ No newline at end of file diff --git a/src/qprojectM/src/CMakeLists.txt b/src/qprojectM/src/CMakeLists.txt index 4e15f88ae..52a6e061d 100644 --- a/src/qprojectM/src/CMakeLists.txt +++ b/src/qprojectM/src/CMakeLists.txt @@ -55,5 +55,5 @@ include_directories(${QT_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR} ${QT_QTXML_INCLUDE # link the "qprojectM" target against the Qt libraries. which libraries exactly, is defined by the "include(${QT_USE_FILE})" line above, which sets up this variable. target_link_libraries(qprojectM projectM ${QT_QTGUI_LIBRARIES} ${QT_QTOPENGL_LIBRARIES} ${QT_QTXML_LIBRARIES} ${QT_LIBRARIES}) -install(FILES QProjectM_MainWindow.hpp ui_QProjectM_MainWindow.h DESTINATION include/libprojectM) +install(FILES QProjectM_MainWindow.hpp DESTINATION include/libprojectM) install(TARGETS qprojectM DESTINATION lib) diff --git a/src/qprojectM/src/QProjectM_MainWindow.cpp b/src/qprojectM/src/QProjectM_MainWindow.cpp index bad2f53b4..57f83532f 100644 --- a/src/qprojectM/src/QProjectM_MainWindow.cpp +++ b/src/qprojectM/src/QProjectM_MainWindow.cpp @@ -28,22 +28,25 @@ #include #include "QPlaylistModel.hpp" +#include "ui_QProjectM_MainWindow.h" QProjectM_MainWindow::QProjectM_MainWindow ( const std::string & config_file ) :m_QPresetFileDialog ( new QPresetFileDialog ( this ) ), m_QPlaylistFileDialog ( new QPlaylistFileDialog ( this ) ), oldPresetIndex ( -1 ) { - ui.setupUi ( this ); + ui = new Ui::qProjectM_MainWindow(); + + ui->setupUi ( this ); m_QProjectMWidget = new QProjectMWidget ( config_file, this ); m_timer = new QTimer ( this ); connect ( m_timer, SIGNAL ( timeout() ), m_QProjectMWidget, SLOT ( updateGL() ) ); - connect ( ui.lockPresetCheckBox, SIGNAL ( stateChanged ( int ) ), + connect ( ui->lockPresetCheckBox, SIGNAL ( stateChanged ( int ) ), m_QProjectMWidget, SLOT ( setPresetLock ( int ) ) ); - connect ( ui.clearPresetList_PushButton, SIGNAL ( pressed() ), + connect ( ui->clearPresetList_PushButton, SIGNAL ( pressed() ), this, SLOT ( clearPlaylist() ) ); @@ -62,7 +65,7 @@ QProjectM_MainWindow::QProjectM_MainWindow ( const std::string & config_file ) createToolBars(); createStatusBar(); readSettings(); - ui.presetPlayListDockWidget->hide(); + ui->presetPlayListDockWidget->hide(); } @@ -74,7 +77,9 @@ QProjectM_MainWindow::~QProjectM_MainWindow() { if (pos.value()) delete ( pos.value() ); } - + + delete (ui); + } void QProjectM_MainWindow::clearPlaylist() @@ -88,7 +93,7 @@ void QProjectM_MainWindow::clearPlaylist() historyHash.clear(); historyHash.insert ( QString(), new PlaylistItemVector ); previousFilter = QString(); - ui.presetSearchBarLineEdit->clear(); + ui->presetSearchBarLineEdit->clear(); } QProjectM * QProjectM_MainWindow::getQProjectM() @@ -127,20 +132,20 @@ void QProjectM_MainWindow::postProjectM_Initialize() playlistModel = new QPlaylistModel ( *m_QProjectMWidget->getQProjectM(),this ); refreshPlaylist(); - ui.tableView->setModel ( playlistModel ); + ui->tableView->setModel ( playlistModel ); connect ( m_QProjectMWidget->getQProjectM(), SIGNAL ( presetSwitchedSignal ( bool,unsigned int ) ), this, SLOT ( updatePlaylistSelection ( bool,unsigned int ) ) ); - connect ( ui.presetSearchBarLineEdit, SIGNAL ( textChanged ( const QString& ) ), this, SLOT ( updateFilteredPlaylist ( const QString& ) ) ); + connect ( ui->presetSearchBarLineEdit, SIGNAL ( textChanged ( const QString& ) ), this, SLOT ( updateFilteredPlaylist ( const QString& ) ) ); - connect ( ui.tableView, SIGNAL ( activated ( const QModelIndex & ) ), + connect ( ui->tableView, SIGNAL ( activated ( const QModelIndex & ) ), this, SLOT ( selectPlaylistItem ( const QModelIndex & ) ) ); - connect ( ui.tableView, SIGNAL ( clicked ( const QModelIndex & ) ), + connect ( ui->tableView, SIGNAL ( clicked ( const QModelIndex & ) ), this, SLOT ( changeRating ( const QModelIndex & ) ) ); connect ( m_QProjectMWidget, SIGNAL ( presetLockChanged ( bool ) ), playlistModel, SLOT ( updateItemHighlights() ) ); connect ( m_QProjectMWidget->getQProjectM(), SIGNAL ( presetSwitchedSignal ( bool,unsigned int ) ), playlistModel, SLOT ( updateItemHighlights() ) ); /// @bug not right - selected preset problems when searching - connect ( ui.presetSearchBarLineEdit, SIGNAL ( textChanged ( const QString& ) ), playlistModel, SLOT ( updateItemHighlights() ) ); + connect ( ui->presetSearchBarLineEdit, SIGNAL ( textChanged ( const QString& ) ), playlistModel, SLOT ( updateItemHighlights() ) ); } @@ -160,17 +165,17 @@ void QProjectM_MainWindow::keyReleaseEvent ( QKeyEvent * e ) switch ( e->key() ) { case Qt::Key_L: - if ( ui.presetSearchBarLineEdit->hasFocus() ) + if ( ui->presetSearchBarLineEdit->hasFocus() ) return; - if ( ui.lockPresetCheckBox->checkState() == Qt::Checked ) + if ( ui->lockPresetCheckBox->checkState() == Qt::Checked ) { - ui.lockPresetCheckBox->setCheckState ( Qt::Unchecked ); + ui->lockPresetCheckBox->setCheckState ( Qt::Unchecked ); } else { - ui.lockPresetCheckBox->setCheckState ( Qt::Checked ); + ui->lockPresetCheckBox->setCheckState ( Qt::Checked ); } // the projectM widget handles the actual lock @@ -182,21 +187,21 @@ void QProjectM_MainWindow::keyReleaseEvent ( QKeyEvent * e ) return; //emit(keyPressed m_QProjectMWidget, case Qt::Key_F: - if ( ui.presetSearchBarLineEdit->hasFocus() ) + if ( ui->presetSearchBarLineEdit->hasFocus() ) return; this->setWindowState ( this->windowState() ^ Qt::WindowFullScreen ); return; case Qt::Key_M: - if ( ui.presetSearchBarLineEdit->hasFocus() ) + if ( ui->presetSearchBarLineEdit->hasFocus() ) return; - if ( ui.presetPlayListDockWidget->isVisible()) + if ( ui->presetPlayListDockWidget->isVisible()) { - ui.presetPlayListDockWidget->hide(); + ui->presetPlayListDockWidget->hide(); } else - ui.presetPlayListDockWidget->show(); + ui->presetPlayListDockWidget->show(); if ( menuBar()->isVisible() ) { @@ -219,7 +224,7 @@ void QProjectM_MainWindow::keyReleaseEvent ( QKeyEvent * e ) return; case Qt::Key_R: - if ( ui.presetSearchBarLineEdit->hasFocus() ) + if ( ui->presetSearchBarLineEdit->hasFocus() ) return; //modelIndex.selectRandom() @@ -267,7 +272,7 @@ void QProjectM_MainWindow::addPresets() historyHash.insert ( QString(), playlistItems ); updateFilteredPlaylist ( previousFilter ); - ui.presetPlayListDockWidget->setWindowModified(true); + ui->presetPlayListDockWidget->setWindowModified(true); } //playlistModel->setHeaderData(0, Qt::Horizontal, tr("Preset"));//, Qt::DisplayRole); @@ -283,8 +288,8 @@ void QProjectM_MainWindow::savePlaylist() } if (playlistModel->writePlaylist(m_currentPlaylistFile)) { - this->ui.statusbar->showMessage(QString("Saved preset playlist \"%1\" successfully.").arg(m_currentPlaylistFile), 3000); - this->ui.presetPlayListDockWidget->setWindowModified(false); + this->ui->statusbar->showMessage(QString("Saved preset playlist \"%1\" successfully.").arg(m_currentPlaylistFile), 3000); + this->ui->presetPlayListDockWidget->setWindowModified(false); } } @@ -300,15 +305,15 @@ void QProjectM_MainWindow::openPlaylist() const QString file = m_QPlaylistFileDialog->selectedFiles() [0]; if (playlistModel->readPlaylist ( file )) { - ui.presetPlayListDockWidget->setWindowTitle + ui->presetPlayListDockWidget->setWindowTitle (QString("Preset Playlist - %1 [*]").arg(playlistModel->playlistName())); m_currentPlaylistFile = file; } else { - ui.dockWidgetContents->setWindowTitle("Preset Playlist"); + ui->dockWidgetContents->setWindowTitle("Preset Playlist"); } - ui.presetPlayListDockWidget->setWindowModified(false); + ui->presetPlayListDockWidget->setWindowModified(false); copyPlaylist(); - updateFilteredPlaylist(ui.presetSearchBarLineEdit->text()); + updateFilteredPlaylist(ui->presetSearchBarLineEdit->text()); } } @@ -345,8 +350,8 @@ void QProjectM_MainWindow::refreshPlaylist() //hHeader->setSortIndicator(1, Qt::AscendingOrder); hHeader->setStretchLastSection ( false ); - ui.tableView->setVerticalHeader ( vHeader ); - ui.tableView->setHorizontalHeader ( hHeader ); + ui->tableView->setVerticalHeader ( vHeader ); + ui->tableView->setHorizontalHeader ( hHeader ); hHeader->setResizeMode ( QHeaderView::Stretch); //hHeader->resizeSection(0, 500); @@ -379,20 +384,20 @@ void QProjectM_MainWindow::about() void QProjectM_MainWindow::createActions() { - connect ( ui.actionExit, SIGNAL ( triggered() ), this, SLOT ( close() ) ); + connect ( ui->actionExit, SIGNAL ( triggered() ), this, SLOT ( close() ) ); - connect ( ui.actionAddPresets, SIGNAL ( triggered() ), this, SLOT ( addPresets() ) ); - connect ( ui.actionOpen_Play_List, SIGNAL ( triggered() ), this, SLOT ( openPlaylist() ) ); - connect ( ui.actionSave_play_list, SIGNAL ( triggered() ), this, SLOT ( savePlaylist() ) ); - connect ( ui.actionAbout_qprojectM, SIGNAL ( triggered() ), this, SLOT ( about() ) ); + connect ( ui->actionAddPresets, SIGNAL ( triggered() ), this, SLOT ( addPresets() ) ); + connect ( ui->actionOpen_Play_List, SIGNAL ( triggered() ), this, SLOT ( openPlaylist() ) ); + connect ( ui->actionSave_play_list, SIGNAL ( triggered() ), this, SLOT ( savePlaylist() ) ); + connect ( ui->actionAbout_qprojectM, SIGNAL ( triggered() ), this, SLOT ( about() ) ); - //connect(ui.actionAbout_Qt, SIGNAL(triggered()), this, SLOT(aboutQt())); + //connect(ui->actionAbout_Qt, SIGNAL(triggered()), this, SLOT(aboutQt())); } void QProjectM_MainWindow::createMenus() { - ui.menuBar->hide(); + ui->menuBar->hide(); } diff --git a/src/qprojectM/src/QProjectM_MainWindow.hpp b/src/qprojectM/src/QProjectM_MainWindow.hpp index 360bc43c2..7e59bd486 100644 --- a/src/qprojectM/src/QProjectM_MainWindow.hpp +++ b/src/qprojectM/src/QProjectM_MainWindow.hpp @@ -23,21 +23,26 @@ #define QPROJECTM_MAINWINDOW_H #define CONFIG_FILE "/share/projectM/config.inp" -#include "ui_QProjectM_MainWindow.h" +//#include "ui_QProjectM_MainWindow.h" #include #include #include -#include "libprojectM/projectM.hpp" - #include +#include + +#include "libprojectM/projectM.hpp" class QAction; class QMenu; class QPresetFileDialog; class QPlaylistFileDialog; class QPlaylistModel; +class QModelIndex; +namespace Ui { +class qProjectM_MainWindow; +} #include @@ -248,7 +253,7 @@ private: QString m_currentPlaylistFile; QPlaylistModel * playlistModel; - Ui::qProjectM_MainWindow ui; + Ui::qProjectM_MainWindow * ui; QHash historyHash;