From 584f6f7457e6f165de9c6f3716e0ad7be7b57150 Mon Sep 17 00:00:00 2001 From: Werner Schweer Date: Fri, 23 Jun 2006 10:12:22 +0000 Subject: project property dialog --- muse/ChangeLog | 2 + muse/muse/CMakeLists.txt | 11 ++- muse/muse/icons.cpp | 6 +- muse/muse/muse.cpp | 25 +++++- muse/muse/muse.h | 4 + muse/muse/projectpropsdialog.h | 46 ++++++++++ muse/muse/projectpropsdialog.ui | 188 ++++++++++++++++++++++++++++++++++++++++ muse/muse/song.h | 1 + 8 files changed, 274 insertions(+), 9 deletions(-) create mode 100644 muse/muse/projectpropsdialog.h create mode 100644 muse/muse/projectpropsdialog.ui diff --git a/muse/ChangeLog b/muse/ChangeLog index b83fe865..d1f6b7c4 100644 --- a/muse/ChangeLog +++ b/muse/ChangeLog @@ -1,3 +1,5 @@ +23.6. (ws) + * new project property dialog to edit the project comment 22.6. (ws) * fix: get reference count right when undo "split part" * implement: rename part diff --git a/muse/muse/CMakeLists.txt b/muse/muse/CMakeLists.txt index d3bb0d5c..f40eb74f 100644 --- a/muse/muse/CMakeLists.txt +++ b/muse/muse/CMakeLists.txt @@ -45,8 +45,14 @@ subdirs( ) set (muse_uics - muse preferences exportmididialog configmidifile - transport aboutbox transpose + muse + preferences + exportmididialog + configmidifile + transport + aboutbox + transpose + projectpropsdialog projectdialog templatedialog midiedit/quantconfig @@ -58,6 +64,7 @@ set (muse_uics ) set(muse_mocs + projectpropsdialog projectdialog templatedialog preferences plugingui midiplugin muse song transport conf editor diff --git a/muse/muse/icons.cpp b/muse/muse/icons.cpp index 8c4f05c6..fec9711d 100644 --- a/muse/muse/icons.cpp +++ b/muse/muse/icons.cpp @@ -111,8 +111,8 @@ #include "xpm/flagS.xpm" #include "xpm/lock.xpm" #include "xpm/toc.xpm" -#include "xpm/piano.xpm" -// #include "xpm/pianoS.xpm" +// #include "xpm/piano.xpm" +#include "xpm/pianoS.xpm" #include "xpm/exitS.xpm" #include "xpm/undo.xpm" @@ -512,7 +512,7 @@ void initIcons() select_inside_loopIcon = new QPixmap(select_inside_loop_xpm); select_invert_selectionIcon = new QPixmap(select_invert_selection); select_outside_loopIcon = new QPixmap(select_outside_loop_xpm); - pianoIconSet = new QIcon(QPixmap(piano_xpm)); + pianoIconSet = new QIcon(QPixmap(pianoS_xpm)); audio_bounce_to_fileIcon = new QPixmap(audio_bounce_to_file_xpm); audio_bounce_to_trackIcon = new QPixmap(audio_bounce_to_track_xpm); diff --git a/muse/muse/muse.cpp b/muse/muse/muse.cpp index f6eba4b7..d2b153ad 100644 --- a/muse/muse/muse.cpp +++ b/muse/muse/muse.cpp @@ -65,6 +65,7 @@ #include "part.h" #include "projectdialog.h" #include "templatedialog.h" +#include "projectpropsdialog.h" static pthread_t watchdogThread; @@ -463,6 +464,7 @@ MusE::MusE() mixer2 = 0; markerView = 0; exportMidiDialog = 0; + projectPropsDialog = 0; song->blockSignals(true); heartBeatTimer = new QTimer(this); @@ -684,15 +686,19 @@ MusE::MusE() menuEdit->addSeparator(); menuEdit->addAction(pianoAction); - menu_ids[CMD_OPEN_DRUMS] = menuEdit->addAction(QIcon(*edit_drummsIcon), tr("Drums"), this, SLOT(startDrumEditor()), 0); - menu_ids[CMD_OPEN_LIST] = menuEdit->addAction(QIcon(*edit_listIcon), tr("List"), this, SLOT(startListEditor()), 0); - + menu_ids[CMD_OPEN_DRUMS] = menuEdit->addAction(QIcon(*edit_drummsIcon), tr("Drums")); + menu_ids[CMD_OPEN_LIST] = menuEdit->addAction(QIcon(*edit_listIcon), tr("List")); menu_ids[CMD_OPEN_GRAPHIC_MASTER] = menuEdit->addAction(QIcon(*mastertrack_graphicIcon),tr("Mastertrack")); + menu_ids[CMD_OPEN_PROJECT_PROPS] = menuEdit->addAction(*saveIcon, tr("Project Properties")); + + connect(menu_ids[CMD_OPEN_DRUMS], SIGNAL(triggered()), SLOT(startDrumEditor())); + connect(menu_ids[CMD_OPEN_LIST], SIGNAL(triggered()), SLOT(startListEditor())); connect(menu_ids[CMD_OPEN_GRAPHIC_MASTER], SIGNAL(triggered()), SLOT(startMasterEditor())); + connect(menu_ids[CMD_OPEN_PROJECT_PROPS], SIGNAL(triggered()), SLOT(showProjectPropsDialog())); menuEdit->addSeparator(); connect(menuEdit, SIGNAL(triggered(QAction*)), SLOT(cmd(QAction*))); - connect(select, SIGNAL(triggered(QAction*)), SLOT(cmd(QAction*))); + connect(select, SIGNAL(triggered(QAction*)), SLOT(cmd(QAction*))); midiEdit = menuEdit->addMenu(QIcon(*edit_midiIcon), tr("Midi")); // menu_ids[CMD_OPEN_MIDI_TRANSFORM] = midiEdit->addAction(QIcon(*midi_transformIcon), tr("Midi &Transform"), this, SLOT(startMidiTransformer()), 0); @@ -1543,6 +1549,17 @@ void MusE::startMasterEditor() masterEditor->show(); } +//--------------------------------------------------------- +// showProjectPropsDialog +//--------------------------------------------------------- + +void MusE::showProjectPropsDialog() + { + if (projectPropsDialog == 0) + projectPropsDialog = new ProjectPropsDialog(this); + projectPropsDialog->show(); + } + //--------------------------------------------------------- // startDrumEditor //--------------------------------------------------------- diff --git a/muse/muse/muse.h b/muse/muse/muse.h index 711cf3d0..36c23ae3 100644 --- a/muse/muse/muse.h +++ b/muse/muse/muse.h @@ -84,6 +84,7 @@ class MusE : public QMainWindow, public Ui::MuseBase CMD_MIXER_SNAPSHOT, CMD_MIXER_AUTOMATION_CLEAR, CMD_OPEN_HELP, CMD_OPEN_HOMEPAGE, CMD_OPEN_BUG, CMD_START_WHATSTHIS, CMD_AUDIO_BOUNCE_TO_FILE, CMD_AUDIO_BOUNCE_TO_TRACK, CMD_AUDIO_RESTART, + CMD_OPEN_PROJECT_PROPS, CMD_LAST }; QAction* menu_ids[CMD_LAST]; @@ -147,6 +148,8 @@ class MusE : public QMainWindow, public Ui::MuseBase QMenu* openRecent; QSpinBox* globalTempoSpinBox; + QDialog* projectPropsDialog; + //------------------------------------------ bool readMidi(FILE*); @@ -206,6 +209,7 @@ class MusE : public QMainWindow, public Ui::MuseBase void startWaveEditor(PartList*); void writeGlobalConfiguration() const; void startEditInstrument(); + void showProjectPropsDialog(); void openRecentMenu(); void selectProject(QAction*); diff --git a/muse/muse/projectpropsdialog.h b/muse/muse/projectpropsdialog.h new file mode 100644 index 00000000..83b7a511 --- /dev/null +++ b/muse/muse/projectpropsdialog.h @@ -0,0 +1,46 @@ +//============================================================================= +// MusE +// Linux Music Editor +// $Id:$ +// +// Copyright (C) 2002-2006 by Werner Schweer and others +// +// This program is free software; you can redistribute it and/or modify +// it under the terms of the GNU General Public License version 2. +// +// 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., 675 Mass Ave, Cambridge, MA 02139, USA. +//============================================================================= + +#ifndef __PROJECTPROPS_DIALOG_H__ +#define __PROJECTPROPS_DIALOG_H__ + +#include "ui_projectpropsdialog.h" + +//--------------------------------------------------------- +// ProjectPropsDialog +//--------------------------------------------------------- + +class ProjectPropsDialog : public QDialog, public Ui_ProjectPropsDialogBase { + Q_OBJECT + + QString projectComment; + + public slots: + virtual void accept(); + virtual void reject(); + + public: + ProjectPropsDialog(QWidget* parent = 0); + }; + +#endif + + + diff --git a/muse/muse/projectpropsdialog.ui b/muse/muse/projectpropsdialog.ui new file mode 100644 index 00000000..f431b602 --- /dev/null +++ b/muse/muse/projectpropsdialog.ui @@ -0,0 +1,188 @@ + + + + + ProjectPropsDialogBase + + + + 0 + 0 + 456 + 382 + + + + MusE: Project Properties + + + + 9 + + + 6 + + + + + + + + Comment: + + + + + + + true + + + Hz + + + 100000 + + + 48000 + + + + + + + Samplerate: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + Length: + + + + + + + Qt::NoFocus + + + true + + + + + + + Qt::NoFocus + + + true + + + + + + + 0 + + + 6 + + + + + Qt::Horizontal + + + + 131 + 31 + + + + + + + + OK + + + + + + + Cancel + + + + + + + + + Created: + + + + + + + + 0 + 0 + 0 + 0 + + + + Project: + + + + + + + + + + + + + okButton + clicked() + ProjectPropsDialogBase + accept() + + + 278 + 253 + + + 96 + 254 + + + + + cancelButton + clicked() + ProjectPropsDialogBase + reject() + + + 369 + 253 + + + 179 + 282 + + + + + diff --git a/muse/muse/song.h b/muse/muse/song.h index 344d1c80..40842a3f 100644 --- a/muse/muse/song.h +++ b/muse/muse/song.h @@ -407,6 +407,7 @@ class Song : public QObject { void setComment(const QString& s) { _comment = s; } void setCreated(bool val) { _created = val; } bool created() const { return _created; } + QDateTime createDate() const { return _createDate; } bool read(QFile* qf); void read20(QDomNode node); -- cgit v1.2.3