mirror of
https://github.com/projectM-visualizer/projectm.git
synced 2026-03-03 22:15:22 +00:00
to lower case renaming of qprojectm complete
git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/trunk@879 6778bc44-b910-0410-a7a0-be141de4315d
This commit is contained in:
@ -40,33 +40,33 @@ ADD_DEFINITIONS(-DQT_SHARED)
|
||||
|
||||
# the variable "qprojectM_SRCS" contains all .cpp files of this project
|
||||
set(qprojectM_SRCS
|
||||
QProjectM_MainWindow.cpp
|
||||
QProjectM_MainWindow.hpp
|
||||
ConfigFile.h ConfigFile.cpp
|
||||
QPresetFileDialog.hpp
|
||||
QPlaylistFileDialog.cpp
|
||||
QPlaylistFileDialog.hpp
|
||||
QPlaylistModel.cpp
|
||||
QPlaylistModel.hpp
|
||||
QXmlPlaylistHandler.hpp
|
||||
QProjectMConfigDialog.cpp
|
||||
QProjectMConfigDialog.hpp
|
||||
QPlaylistTableView.hpp
|
||||
qprojectm_mainwindow.cpp
|
||||
qprojectm_mainwindow.hpp
|
||||
configfile.hpp configfile.cpp
|
||||
qpresetfiledialog.hpp
|
||||
qplaylistfiledialog.cpp
|
||||
qplaylistfiledialog.hpp
|
||||
qplaylistmodel.cpp
|
||||
qplaylistmodel.hpp
|
||||
qxmlplaylisthandler.hpp
|
||||
qprojectmconfigdialog.cpp
|
||||
qprojectmconfigdialog.hpp
|
||||
qplaylisttableview.hpp
|
||||
)
|
||||
|
||||
|
||||
set(qprojectM_MOC_HDRS
|
||||
QProjectM_MainWindow.hpp
|
||||
QPresetFileDialog.hpp
|
||||
QPlaylistFileDialog.hpp
|
||||
QPlaylistModel.hpp
|
||||
QProjectMConfigDialog.hpp
|
||||
QPlaylistTableView.hpp
|
||||
qprojectm_mainwindow.hpp
|
||||
qpresetfiledialog.hpp
|
||||
qplaylistfiledialog.hpp
|
||||
qplaylistmodel.hpp
|
||||
qprojectmconfigdialog.hpp
|
||||
qplaylisttableview.hpp
|
||||
)
|
||||
|
||||
set(qprojectM_UIS
|
||||
QProjectM_MainWindow.ui
|
||||
QProjectMConfigDialog.ui
|
||||
qprojectm_mainwindow.ui
|
||||
qprojectmconfigdialog.ui
|
||||
)
|
||||
|
||||
# Qt resource file
|
||||
@ -101,6 +101,6 @@ include_directories(${PROJECTM_INCLUDE} ${QT_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR
|
||||
# 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 DESTINATION include/libqprojectM)
|
||||
install(FILES qprojectm_mainwindow.hpp DESTINATION include/libqprojectM)
|
||||
install(TARGETS qprojectM DESTINATION lib)
|
||||
install(FILES "${CMAKE_BINARY_DIR}/libqprojectM.pc" DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig)
|
||||
install(FILES "${CMAKE_BINARY_DIR}/libqprojectM.pc" DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig)
|
||||
|
||||
@ -1,165 +0,0 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007 by carm *
|
||||
* carm@localhost *
|
||||
* *
|
||||
* 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) any later version. *
|
||||
* *
|
||||
* 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., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#ifndef QPLAYLIST_FILEDIALOG_H
|
||||
#define QPLAYLIST_FILEDIALOG_H
|
||||
|
||||
#include <QFileDialog>
|
||||
#include <QStringList>
|
||||
#include <QtDebug>
|
||||
|
||||
class QPlaylistFileDialog : public QFileDialog
|
||||
{
|
||||
Q_OBJECT // must include this if you use Qt signals/slots
|
||||
|
||||
public:
|
||||
static QString OPEN_PLAYLIST_TITLE;
|
||||
static QString OPEN_PLAYLIST_OR_DIRECTORY_TITLE;
|
||||
static QString SAVE_PLAYLIST_TITLE;
|
||||
|
||||
inline QPlaylistFileDialog(QWidget * parent = 0):
|
||||
QFileDialog(parent, OPEN_PLAYLIST_OR_DIRECTORY_TITLE, QString()), m_directorySelectAllowed(true), m_fileSelectAllowed(true) {
|
||||
|
||||
updateFileMode(selectedFiles());
|
||||
|
||||
//connect(this, SIGNAL(filesSelected(const QStringList&)),
|
||||
// this, SLOT(updateFileMode(const QStringList&)));
|
||||
|
||||
connect(this, SIGNAL(currentChanged(const QString&)),
|
||||
this, SLOT(updateFileMode(const QString&)));
|
||||
}
|
||||
|
||||
inline bool isPlaylistSaveMode() {
|
||||
return this->acceptMode() == QFileDialog::AcceptSave;
|
||||
}
|
||||
|
||||
inline void setPlaylistSaveMode(bool isSaveMode) {
|
||||
if (isSaveMode) {
|
||||
this->setAcceptMode(QFileDialog::AcceptSave);
|
||||
updateWindowTitle();
|
||||
updateFileMode(selectedFiles());
|
||||
}
|
||||
else {
|
||||
this->setAcceptMode(QFileDialog::AcceptOpen);
|
||||
updateWindowTitle();
|
||||
updateFileMode(selectedFiles());
|
||||
}
|
||||
}
|
||||
|
||||
inline void setAllowDirectorySelect(bool isAllowed) {
|
||||
m_directorySelectAllowed = isAllowed;
|
||||
updateFileMode(selectedFiles());
|
||||
updateWindowTitle();
|
||||
}
|
||||
|
||||
inline void setAllowFileSelect(bool isAllowed) {
|
||||
m_fileSelectAllowed = isAllowed;
|
||||
updateFileMode(selectedFiles());
|
||||
updateWindowTitle();
|
||||
}
|
||||
|
||||
|
||||
inline bool isFileSelectAllowed() const {
|
||||
return m_fileSelectAllowed;
|
||||
}
|
||||
|
||||
|
||||
inline bool isDirectorySelectAllowed() const {
|
||||
return m_directorySelectAllowed;
|
||||
}
|
||||
|
||||
|
||||
|
||||
~QPlaylistFileDialog() { }
|
||||
|
||||
private:
|
||||
|
||||
bool m_directorySelectAllowed;
|
||||
bool m_fileSelectAllowed;
|
||||
QString getFilter() {
|
||||
QString filter;
|
||||
if (isDirectorySelectAllowed()) {
|
||||
|
||||
filter += "Directories";
|
||||
}
|
||||
|
||||
if (isFileSelectAllowed()) {
|
||||
if (filter != QString())
|
||||
filter += " and ";
|
||||
|
||||
filter += "Preset Playlists (*.ppl)";
|
||||
}
|
||||
|
||||
return filter;
|
||||
}
|
||||
|
||||
void updateWindowTitle() {
|
||||
if (isPlaylistSaveMode())
|
||||
setWindowTitle(SAVE_PLAYLIST_TITLE);
|
||||
else {
|
||||
if (isDirectorySelectAllowed() && isFileSelectAllowed())
|
||||
setWindowTitle(OPEN_PLAYLIST_OR_DIRECTORY_TITLE);
|
||||
else
|
||||
setWindowTitle(OPEN_PLAYLIST_TITLE);
|
||||
}
|
||||
}
|
||||
|
||||
private slots:
|
||||
|
||||
void updateFileMode(const QString & fileName) {
|
||||
|
||||
QString filter = getFilter();
|
||||
|
||||
if (QFileInfo(fileName).isDir()) {
|
||||
if (isDirectorySelectAllowed())
|
||||
this->setFileMode(QFileDialog::Directory);
|
||||
else
|
||||
this->setFileMode(QFileDialog::ExistingFile);
|
||||
}
|
||||
else if (QFileInfo(fileName).isFile()) {
|
||||
|
||||
if (isPlaylistSaveMode())
|
||||
this->setFileMode(QFileDialog::AnyFile);
|
||||
else if (isFileSelectAllowed())
|
||||
this->setFileMode(QFileDialog::ExistingFile);
|
||||
else
|
||||
this->setFileMode(QFileDialog::Directory);
|
||||
}
|
||||
|
||||
else {
|
||||
if (isPlaylistSaveMode())
|
||||
this->setFileMode(QFileDialog::AnyFile);
|
||||
else
|
||||
this->setFileMode(QFileDialog::ExistingFile);
|
||||
}
|
||||
|
||||
this->setFilter(filter);
|
||||
}
|
||||
|
||||
void updateFileMode(const QStringList & selectedFiles) {
|
||||
if (selectedFiles.empty())
|
||||
return;
|
||||
updateFileMode(selectedFiles[0]);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
27
src/qprojectM/qplaylistfiledialog.cpp
Normal file
27
src/qprojectM/qplaylistfiledialog.cpp
Normal file
@ -0,0 +1,27 @@
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007 by carm *
|
||||
* carm@localhost *
|
||||
* *
|
||||
* 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) any later version. *
|
||||
* *
|
||||
* 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., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include "qplaylistfiledialog.hpp"
|
||||
|
||||
QString QPlaylistFileDialog::OPEN_PLAYLIST_TITLE("Open a playlist file");
|
||||
QString QPlaylistFileDialog::OPEN_PLAYLIST_OR_DIRECTORY_TITLE("Open a playlist or directory");
|
||||
QString QPlaylistFileDialog::SAVE_PLAYLIST_TITLE("Save a playlist");
|
||||
|
||||
@ -19,9 +19,147 @@
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include "QPlaylistFileDialog.hpp"
|
||||
#ifndef QPLAYLIST_FILEDIALOG_H
|
||||
#define QPLAYLIST_FILEDIALOG_H
|
||||
|
||||
QString QPlaylistFileDialog::OPEN_PLAYLIST_TITLE("Open a playlist file");
|
||||
QString QPlaylistFileDialog::OPEN_PLAYLIST_OR_DIRECTORY_TITLE("Open a playlist or directory");
|
||||
QString QPlaylistFileDialog::SAVE_PLAYLIST_TITLE("Save a playlist");
|
||||
#include <QFileDialog>
|
||||
#include <QStringList>
|
||||
#include <QtDebug>
|
||||
|
||||
class QPlaylistFileDialog : public QFileDialog
|
||||
{
|
||||
Q_OBJECT // must include this if you use Qt signals/slots
|
||||
|
||||
public:
|
||||
static QString OPEN_PLAYLIST_TITLE;
|
||||
static QString OPEN_PLAYLIST_OR_DIRECTORY_TITLE;
|
||||
static QString SAVE_PLAYLIST_TITLE;
|
||||
|
||||
inline QPlaylistFileDialog(QWidget * parent = 0):
|
||||
QFileDialog(parent, OPEN_PLAYLIST_OR_DIRECTORY_TITLE, QString()), m_directorySelectAllowed(true), m_fileSelectAllowed(true) {
|
||||
|
||||
updateFileMode(selectedFiles());
|
||||
|
||||
//connect(this, SIGNAL(filesSelected(const QStringList&)),
|
||||
// this, SLOT(updateFileMode(const QStringList&)));
|
||||
|
||||
connect(this, SIGNAL(currentChanged(const QString&)),
|
||||
this, SLOT(updateFileMode(const QString&)));
|
||||
}
|
||||
|
||||
inline bool isPlaylistSaveMode() {
|
||||
return this->acceptMode() == QFileDialog::AcceptSave;
|
||||
}
|
||||
|
||||
inline void setPlaylistSaveMode(bool isSaveMode) {
|
||||
if (isSaveMode) {
|
||||
this->setAcceptMode(QFileDialog::AcceptSave);
|
||||
updateWindowTitle();
|
||||
updateFileMode(selectedFiles());
|
||||
}
|
||||
else {
|
||||
this->setAcceptMode(QFileDialog::AcceptOpen);
|
||||
updateWindowTitle();
|
||||
updateFileMode(selectedFiles());
|
||||
}
|
||||
}
|
||||
|
||||
inline void setAllowDirectorySelect(bool isAllowed) {
|
||||
m_directorySelectAllowed = isAllowed;
|
||||
updateFileMode(selectedFiles());
|
||||
updateWindowTitle();
|
||||
}
|
||||
|
||||
inline void setAllowFileSelect(bool isAllowed) {
|
||||
m_fileSelectAllowed = isAllowed;
|
||||
updateFileMode(selectedFiles());
|
||||
updateWindowTitle();
|
||||
}
|
||||
|
||||
|
||||
inline bool isFileSelectAllowed() const {
|
||||
return m_fileSelectAllowed;
|
||||
}
|
||||
|
||||
|
||||
inline bool isDirectorySelectAllowed() const {
|
||||
return m_directorySelectAllowed;
|
||||
}
|
||||
|
||||
|
||||
|
||||
~QPlaylistFileDialog() { }
|
||||
|
||||
private:
|
||||
|
||||
bool m_directorySelectAllowed;
|
||||
bool m_fileSelectAllowed;
|
||||
QString getFilter() {
|
||||
QString filter;
|
||||
if (isDirectorySelectAllowed()) {
|
||||
|
||||
filter += "Directories";
|
||||
}
|
||||
|
||||
if (isFileSelectAllowed()) {
|
||||
if (filter != QString())
|
||||
filter += " and ";
|
||||
|
||||
filter += "Preset Playlists (*.ppl)";
|
||||
}
|
||||
|
||||
return filter;
|
||||
}
|
||||
|
||||
void updateWindowTitle() {
|
||||
if (isPlaylistSaveMode())
|
||||
setWindowTitle(SAVE_PLAYLIST_TITLE);
|
||||
else {
|
||||
if (isDirectorySelectAllowed() && isFileSelectAllowed())
|
||||
setWindowTitle(OPEN_PLAYLIST_OR_DIRECTORY_TITLE);
|
||||
else
|
||||
setWindowTitle(OPEN_PLAYLIST_TITLE);
|
||||
}
|
||||
}
|
||||
|
||||
private slots:
|
||||
|
||||
void updateFileMode(const QString & fileName) {
|
||||
|
||||
QString filter = getFilter();
|
||||
|
||||
if (QFileInfo(fileName).isDir()) {
|
||||
if (isDirectorySelectAllowed())
|
||||
this->setFileMode(QFileDialog::Directory);
|
||||
else
|
||||
this->setFileMode(QFileDialog::ExistingFile);
|
||||
}
|
||||
else if (QFileInfo(fileName).isFile()) {
|
||||
|
||||
if (isPlaylistSaveMode())
|
||||
this->setFileMode(QFileDialog::AnyFile);
|
||||
else if (isFileSelectAllowed())
|
||||
this->setFileMode(QFileDialog::ExistingFile);
|
||||
else
|
||||
this->setFileMode(QFileDialog::Directory);
|
||||
}
|
||||
|
||||
else {
|
||||
if (isPlaylistSaveMode())
|
||||
this->setFileMode(QFileDialog::AnyFile);
|
||||
else
|
||||
this->setFileMode(QFileDialog::ExistingFile);
|
||||
}
|
||||
|
||||
this->setFilter(filter);
|
||||
}
|
||||
|
||||
void updateFileMode(const QStringList & selectedFiles) {
|
||||
if (selectedFiles.empty())
|
||||
return;
|
||||
updateFileMode(selectedFiles[0]);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@ -6,8 +6,8 @@
|
||||
#include <QDir>
|
||||
#include <QMessageBox>
|
||||
|
||||
#include "QXmlPlaylistHandler.hpp"
|
||||
#include "QPlaylistModel.hpp"
|
||||
#include "qxmlplaylisthandler.hpp"
|
||||
#include "qplaylistmodel.hpp"
|
||||
#include <QMimeData>
|
||||
|
||||
QString QPlaylistModel::PRESET_MIME_TYPE("text/x-projectM-preset");
|
||||
|
||||
@ -20,20 +20,20 @@
|
||||
|
||||
|
||||
#include <QtGui>
|
||||
#include "QProjectM_MainWindow.hpp"
|
||||
#include "QPresetFileDialog.hpp"
|
||||
#include "QPlaylistFileDialog.hpp"
|
||||
#include "qprojectm_mainwindow.hpp"
|
||||
#include "qpresetfiledialog.hpp"
|
||||
#include "qplaylistfiledialog.hpp"
|
||||
#include <QTextStream>
|
||||
#include <QCloseEvent>
|
||||
#include <QFileDialog>
|
||||
|
||||
#include "QPlaylistModel.hpp"
|
||||
#include "ui_QProjectM_MainWindow.h"
|
||||
#include "QProjectMConfigDialog.hpp"
|
||||
#include "qplaylistmodel.hpp"
|
||||
#include "ui_qprojectm_mainwindow.h"
|
||||
#include "qprojectmconfigdialog.hpp"
|
||||
|
||||
#include "ConfigFile.h"
|
||||
#include "QXmlPlaylistHandler.hpp"
|
||||
#include "Nullable.hpp"
|
||||
#include "qxmlplaylisthandler.hpp"
|
||||
#include "nullable.hpp"
|
||||
class PlaylistWriteFunctor {
|
||||
public:
|
||||
PlaylistWriteFunctor(const QProjectM_MainWindow::PlaylistItemVector::iterator & begin,
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#include "QProjectMConfigDialog.hpp"
|
||||
#include "qprojectmconfigdialog.hpp"
|
||||
#include <QtDebug>
|
||||
#include <QAction>
|
||||
#include "QPlaylistFileDialog.hpp"
|
||||
#include "qplaylistfiledialog.hpp"
|
||||
#include <QSettings>
|
||||
|
||||
QProjectMConfigDialog::QProjectMConfigDialog(const std::string & configFile, QProjectMWidget * qprojectMWidget, QWidget * parent, Qt::WindowFlags f) : QDialog(parent, f), _configFile(configFile), _qprojectMWidget(qprojectMWidget), _settings("projectM", "qprojectM") {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#ifndef QPROJECTM_CONFIG_DIALOG_HPP
|
||||
#define QPROJECTM_CONFIG_DIALOG_HPP
|
||||
#include "ui_QProjectMConfigDialog.h"
|
||||
#include "QProjectM_MainWindow.hpp"
|
||||
#include "ui_qprojectmconfigdialog.h"
|
||||
#include "qprojectm_mainwindow.hpp"
|
||||
#include <QSettings>
|
||||
class QProjectMConfigDialog : public QDialog {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user