diff options
author | Florian Jung <flo@windfisch.org> | 2011-08-10 17:53:12 +0000 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2011-08-10 17:53:12 +0000 |
commit | 55d5f2d38bfe7c9673a315bb5597c20675bfde99 (patch) | |
tree | 52d8b082cfe10aaa58d893bd32c823267e049818 /muse2/muse | |
parent | befca1aa676e5ee010525cc1af70051ec4c04722 (diff) |
THIS IS JUST A PROOF OF CONCEPT
arranger is now a MdiSubWin
Diffstat (limited to 'muse2/muse')
-rw-r--r-- | muse2/muse/app.cpp | 30 | ||||
-rw-r--r-- | muse2/muse/app.h | 4 | ||||
-rw-r--r-- | muse2/muse/arranger/arrangerview.cpp | 10 | ||||
-rw-r--r-- | muse2/muse/arranger/arrangerview.h | 1 | ||||
-rw-r--r-- | muse2/muse/cobject.cpp | 60 | ||||
-rw-r--r-- | muse2/muse/cobject.h | 16 | ||||
-rw-r--r-- | muse2/muse/midiedit/scoreedit.cpp | 1 |
7 files changed, 109 insertions, 13 deletions
diff --git a/muse2/muse/app.cpp b/muse2/muse/app.cpp index 53078d44..8f60cff5 100644 --- a/muse2/muse/app.cpp +++ b/muse2/muse/app.cpp @@ -14,6 +14,8 @@ #include <QWhatsThis> #include <QSettings> #include <QProgressDialog> +#include <QMdiArea> +#include <QMdiSubWindow> #include "app.h" #include "master/lmaster.h" @@ -824,18 +826,26 @@ MusE::MusE(int argc, char** argv) : QMainWindow() //menu_ids[CMD_START_WHATSTHIS] = menu_help->insertItem(tr("What's &This?"), this, SLOT(whatsThis()), 0); + //--------------------------------------------------- + // Central Widget + //--------------------------------------------------- + + + mdiArea=new QMdiArea(this); + setCentralWidget(mdiArea); + + arrangerView = new ArrangerView(this); connect(arrangerView, SIGNAL(closed()), SLOT(arrangerClosed())); toplevels.push_back(Toplevel(Toplevel::ARRANGER, (unsigned long)(arrangerView), arrangerView)); arrangerView->hide(); arranger=arrangerView->getArranger(); - - - //--------------------------------------------------- - // Central Widget - //--------------------------------------------------- - - //TODO FINDMICHJETZT mdiarea erstellen und als central widget setzen! + + //QMdiSubWindow* subwin=new QMdiSubWindow(this); //FINDMICHJETZT + //subwin->setWidget(arrangerView); + //mdiArea->addSubWindow(subwin); + mdiArea->addSubWindow(arrangerView->createMdiWrapper()); + //--------------------------------------------------- // read list of "Recent Projects" //--------------------------------------------------- @@ -1021,7 +1031,7 @@ void MusE::loadProjectFile(const QString& name, bool songTemplate, bool loadAll) if (restartSequencer) seqStart(); - //visTracks->updateVisibleTracksButtons(); //TODO FINDMICHJETZT + arrangerView->updateVisibleTracksButtons(); progress->setValue(100); delete progress; progress=0; @@ -2128,7 +2138,7 @@ static void catchSignal(int sig) // some cmd's from pulldown menu //--------------------------------------------------------- -void MusE::cmd(int cmd) //FINDMICHJETZT +void MusE::cmd(int cmd) { switch(cmd) { case CMD_FOLLOW_NO: @@ -2731,7 +2741,7 @@ void MusE::updateConfiguration() //menuSettings->setAccel(shortcuts[SHRT_CONFIG_AUDIO_PORTS].key, menu_ids[CMD_CONFIG_AUDIO_PORTS]); //menu_help->setAccel(menu_ids[CMD_START_WHATSTHIS], shortcuts[SHRT_START_WHATSTHIS].key); - //arrangerView->updateShortcuts(); //FINDMICHJETZT is done via signal + //arrangerView->updateShortcuts(); //commented out by flo: is done via signal } diff --git a/muse2/muse/app.h b/muse2/muse/app.h index 9b46d6f7..51a494bf 100644 --- a/muse2/muse/app.h +++ b/muse2/muse/app.h @@ -14,6 +14,7 @@ #include <QFileInfo> + class QCloseEvent; class QFocusEvent; class QMainWindow; @@ -27,6 +28,7 @@ class QToolBar; class QToolButton; class QProgressDialog; class EditToolBar; +class QMdiArea; class Part; class PartList; @@ -98,6 +100,8 @@ class MusE : public QMainWindow QAction *editSongInfoAction; private: + QMdiArea* mdiArea; + // View Menu actions QAction *viewTransportAction, *viewBigtimeAction, *viewMixerAAction, *viewMixerBAction, *viewCliplistAction, *viewMarkerAction, *viewArrangerAction; diff --git a/muse2/muse/arranger/arrangerview.cpp b/muse2/muse/arranger/arrangerview.cpp index 46685ce6..e9ace563 100644 --- a/muse2/muse/arranger/arrangerview.cpp +++ b/muse2/muse/arranger/arrangerview.cpp @@ -626,7 +626,7 @@ void ArrangerView::readStatus(Xml& xml) } -void ArrangerView::cmd(int cmd) //FINDMICHJETZT +void ArrangerView::cmd(int cmd) { TrackList* tracks = song->tracks(); int l = song->lpos(); @@ -866,10 +866,16 @@ void ArrangerView::clipboardChanged() // selectionChanged //--------------------------------------------------------- -void ArrangerView::selectionChanged() //FINDMICHJETZT +void ArrangerView::selectionChanged() { //bool flag = arranger->isSingleSelection(); // -- Hmm, why only single? bool flag = arranger->selectionSize() > 0; // -- Test OK cut and copy. For muse2. Tim. editCutAction->setEnabled(flag); editCopyAction->setEnabled(flag); } + + +void ArrangerView::updateVisibleTracksButtons() +{ + visTracks->updateVisibleTracksButtons(); +} diff --git a/muse2/muse/arranger/arrangerview.h b/muse2/muse/arranger/arrangerview.h index 9c19a731..9f869402 100644 --- a/muse2/muse/arranger/arrangerview.h +++ b/muse2/muse/arranger/arrangerview.h @@ -122,6 +122,7 @@ class ArrangerView : public TopWin void clipboardChanged(); void selectionChanged(); void updateShortcuts(); + void updateVisibleTracksButtons(); }; diff --git a/muse2/muse/cobject.cpp b/muse2/muse/cobject.cpp index 22f675a3..d486abf0 100644 --- a/muse2/muse/cobject.cpp +++ b/muse2/muse/cobject.cpp @@ -10,6 +10,8 @@ #include "xml.h" #include "gui.h" +#include <QMdiSubWindow> + //--------------------------------------------------------- // readStatus //--------------------------------------------------------- @@ -71,5 +73,63 @@ TopWin::TopWin(QWidget* parent, const char* name, // Allow multiple rows. Tim. //setDockNestingEnabled(true); setIconSize(ICON_SIZE); + + mdisubwin=NULL; } +void TopWin::hide() +{ + printf("HIDE SLOT: mdisubwin is %p\n",mdisubwin); //FINDMICH + if (mdisubwin) + mdisubwin->close(); + + QMainWindow::hide(); +} + +void TopWin::show() +{ + printf("SHOW SLOT: mdisubwin is %p\n",mdisubwin); //FINDMICH + if (mdisubwin) + mdisubwin->show(); + + QMainWindow::show(); +} + +void TopWin::setVisible(bool param) +{ + printf("SETVISIBLE SLOT (%i): mdisubwin is %p\n",(int)param, mdisubwin); //FINDMICH + if (mdisubwin) + { + if (param) + mdisubwin->show(); + else + mdisubwin->close(); + } + QMainWindow::setVisible(param); +} + +QMdiSubWindow* TopWin::createMdiWrapper() +{ + if (mdisubwin==NULL) + { + mdisubwin = new QMdiSubWindow(); + mdisubwin->setWidget(this); + } + + return mdisubwin; +} + +void TopWin::setFree() +{ + if (mdisubwin) + { + setParent(0); + mdisubwin->hide(); + delete mdisubwin; + } +} + +bool TopWin::isMdiWin() +{ + return (mdisubwin!=NULL); +} diff --git a/muse2/muse/cobject.h b/muse2/muse/cobject.h index 0ab509e8..3788fb8f 100644 --- a/muse2/muse/cobject.h +++ b/muse2/muse/cobject.h @@ -14,6 +14,7 @@ #include <QMainWindow> #include <list> +class QMdiSubWindow; class Xml; //--------------------------------------------------------- @@ -27,8 +28,21 @@ class TopWin : public QMainWindow public: virtual void readStatus(Xml&); virtual void writeStatus(int, Xml&) const; + + virtual QMdiSubWindow* createMdiWrapper(); + bool isMdiWin(); + void setFree(); + TopWin(QWidget* parent=0, const char* name=0, Qt::WindowFlags f = Qt::Window); + + private: + QMdiSubWindow* mdisubwin; + + public slots: + virtual void hide(); + virtual void show(); + virtual void setVisible(bool); }; //--------------------------------------------------------- @@ -51,7 +65,7 @@ class Toplevel { ToplevelType type() const { return _type; } unsigned long object() const { return _object; } TopWin* cobject() const { return _cobject; } - + private: ToplevelType _type; unsigned long _object; diff --git a/muse2/muse/midiedit/scoreedit.cpp b/muse2/muse/midiedit/scoreedit.cpp index 1636cc5d..cc581965 100644 --- a/muse2/muse/midiedit/scoreedit.cpp +++ b/muse2/muse/midiedit/scoreedit.cpp @@ -4473,6 +4473,7 @@ void staff_t::update_part_indices() * o IMPORTANT: check new windowed arranger! * - do all signal connections work? * - are there any segfaults? + * o store window state for arranger, probably also for other stuff * * IMPORTANT TODO * o redo transport menu: offer "one beat" and "one bar" steps |