From 8bf7463edbbccb3e005b0c6f1ffb417ea8791fa9 Mon Sep 17 00:00:00 2001 From: w1z7ard Date: Sun, 2 Mar 2008 05:58:25 +0000 Subject: [PATCH] to lower case renaming of qprojectm complete git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/trunk@879 6778bc44-b910-0410-a7a0-be141de4315d --- src/qprojectM/CMakeLists.txt | 44 ++--- src/qprojectM/QPlaylistFileDialog.hpp | 165 ------------------ .../{ConfigFile.h => configfile.hpp} | 0 src/qprojectM/qplaylistfiledialog.cpp | 27 +++ src/qprojectM/qplaylistfiledialog.hpp | 146 +++++++++++++++- src/qprojectM/qplaylistmodel.cpp | 4 +- src/qprojectM/qprojectm_mainwindow.cpp | 16 +- src/qprojectM/qprojectmconfigdialog.cpp | 4 +- src/qprojectM/qprojectmconfigdialog.hpp | 4 +- ...nfigDialog.ui => qprojectmconfigdialog.ui} | 0 ...istHandler.hpp => qxmlplaylisthandler.hpp} | 0 11 files changed, 205 insertions(+), 205 deletions(-) delete mode 100644 src/qprojectM/QPlaylistFileDialog.hpp rename src/qprojectM/{ConfigFile.h => configfile.hpp} (100%) create mode 100644 src/qprojectM/qplaylistfiledialog.cpp rename src/qprojectM/{QProjectMConfigDialog.ui => qprojectmconfigdialog.ui} (100%) rename src/qprojectM/{QXmlPlaylistHandler.hpp => qxmlplaylisthandler.hpp} (100%) diff --git a/src/qprojectM/CMakeLists.txt b/src/qprojectM/CMakeLists.txt index 097126510..b6fa414ca 100644 --- a/src/qprojectM/CMakeLists.txt +++ b/src/qprojectM/CMakeLists.txt @@ -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) \ No newline at end of file +install(FILES "${CMAKE_BINARY_DIR}/libqprojectM.pc" DESTINATION ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig) diff --git a/src/qprojectM/QPlaylistFileDialog.hpp b/src/qprojectM/QPlaylistFileDialog.hpp deleted file mode 100644 index 2a47aebe0..000000000 --- a/src/qprojectM/QPlaylistFileDialog.hpp +++ /dev/null @@ -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 -#include -#include - - 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 diff --git a/src/qprojectM/ConfigFile.h b/src/qprojectM/configfile.hpp similarity index 100% rename from src/qprojectM/ConfigFile.h rename to src/qprojectM/configfile.hpp diff --git a/src/qprojectM/qplaylistfiledialog.cpp b/src/qprojectM/qplaylistfiledialog.cpp new file mode 100644 index 000000000..3dca4d01c --- /dev/null +++ b/src/qprojectM/qplaylistfiledialog.cpp @@ -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"); + diff --git a/src/qprojectM/qplaylistfiledialog.hpp b/src/qprojectM/qplaylistfiledialog.hpp index 14c32a2be..2a47aebe0 100644 --- a/src/qprojectM/qplaylistfiledialog.hpp +++ b/src/qprojectM/qplaylistfiledialog.hpp @@ -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 +#include +#include + 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 diff --git a/src/qprojectM/qplaylistmodel.cpp b/src/qprojectM/qplaylistmodel.cpp index ca9de181b..e4ee06d23 100644 --- a/src/qprojectM/qplaylistmodel.cpp +++ b/src/qprojectM/qplaylistmodel.cpp @@ -6,8 +6,8 @@ #include #include -#include "QXmlPlaylistHandler.hpp" -#include "QPlaylistModel.hpp" +#include "qxmlplaylisthandler.hpp" +#include "qplaylistmodel.hpp" #include QString QPlaylistModel::PRESET_MIME_TYPE("text/x-projectM-preset"); diff --git a/src/qprojectM/qprojectm_mainwindow.cpp b/src/qprojectM/qprojectm_mainwindow.cpp index ece67c1b0..daf63e92e 100644 --- a/src/qprojectM/qprojectm_mainwindow.cpp +++ b/src/qprojectM/qprojectm_mainwindow.cpp @@ -20,20 +20,20 @@ #include -#include "QProjectM_MainWindow.hpp" -#include "QPresetFileDialog.hpp" -#include "QPlaylistFileDialog.hpp" +#include "qprojectm_mainwindow.hpp" +#include "qpresetfiledialog.hpp" +#include "qplaylistfiledialog.hpp" #include #include #include -#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, diff --git a/src/qprojectM/qprojectmconfigdialog.cpp b/src/qprojectM/qprojectmconfigdialog.cpp index a58a88485..356632686 100644 --- a/src/qprojectM/qprojectmconfigdialog.cpp +++ b/src/qprojectM/qprojectmconfigdialog.cpp @@ -1,7 +1,7 @@ -#include "QProjectMConfigDialog.hpp" +#include "qprojectmconfigdialog.hpp" #include #include -#include "QPlaylistFileDialog.hpp" +#include "qplaylistfiledialog.hpp" #include QProjectMConfigDialog::QProjectMConfigDialog(const std::string & configFile, QProjectMWidget * qprojectMWidget, QWidget * parent, Qt::WindowFlags f) : QDialog(parent, f), _configFile(configFile), _qprojectMWidget(qprojectMWidget), _settings("projectM", "qprojectM") { diff --git a/src/qprojectM/qprojectmconfigdialog.hpp b/src/qprojectM/qprojectmconfigdialog.hpp index 7c7689e1c..7a66968cb 100644 --- a/src/qprojectM/qprojectmconfigdialog.hpp +++ b/src/qprojectM/qprojectmconfigdialog.hpp @@ -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 class QProjectMConfigDialog : public QDialog { diff --git a/src/qprojectM/QProjectMConfigDialog.ui b/src/qprojectM/qprojectmconfigdialog.ui similarity index 100% rename from src/qprojectM/QProjectMConfigDialog.ui rename to src/qprojectM/qprojectmconfigdialog.ui diff --git a/src/qprojectM/QXmlPlaylistHandler.hpp b/src/qprojectM/qxmlplaylisthandler.hpp similarity index 100% rename from src/qprojectM/QXmlPlaylistHandler.hpp rename to src/qprojectM/qxmlplaylisthandler.hpp