diff options
author | Florian Jung <flo@windfisch.org> | 2011-08-16 16:27:54 +0000 |
---|---|---|
committer | Florian Jung <flo@windfisch.org> | 2011-08-16 16:27:54 +0000 |
commit | 6b5e69ff5def2c8469657e33413bec84d815df9d (patch) | |
tree | 71bf8eb1a0ae14c20529dc35b91b14e0b43a560a /muse2/muse/waveedit | |
parent | 23f3026199641b6e2a2af69e10353cbe304e5649 (diff) |
this is only a backup commit
toolbar states are now saved also for shared toolbars
toolbar and window state saving is now handled in TopWin
TODO: finish list, cliplist, masterlist, marker, arranger
Diffstat (limited to 'muse2/muse/waveedit')
-rw-r--r-- | muse2/muse/waveedit/waveedit.cpp | 60 | ||||
-rw-r--r-- | muse2/muse/waveedit/waveedit.h | 5 |
2 files changed, 7 insertions, 58 deletions
diff --git a/muse2/muse/waveedit/waveedit.cpp b/muse2/muse/waveedit/waveedit.cpp index d4b692fe..9674af5a 100644 --- a/muse2/muse/waveedit/waveedit.cpp +++ b/muse2/muse/waveedit/waveedit.cpp @@ -40,10 +40,6 @@ extern QColor readColor(Xml& xml); -int WaveEdit::_widthInit = 600; -int WaveEdit::_heightInit = 400; -QByteArray WaveEdit::_toolbarInit; - //--------------------------------------------------------- // closeEvent //--------------------------------------------------------- @@ -64,8 +60,8 @@ void WaveEdit::closeEvent(QCloseEvent* e) WaveEdit::WaveEdit(PartList* pl) : MidiEditor(TopWin::WAVE, 1, pl) { - resize(_widthInit, _heightInit); setFocusPolicy(Qt::StrongFocus); + resize(_widthInit[_type], _heightInit[_type]); QSignalMapper* mapper = new QSignalMapper(this); QAction* act; @@ -207,7 +203,7 @@ WaveEdit::WaveEdit(PartList* pl) if (!parts()->empty()) { // Roughly match total size of part Part* firstPart = parts()->begin()->second; - xscale = 0 - firstPart->lenFrame()/_widthInit; + xscale = 0 - firstPart->lenFrame()/_widthInit[_type]; } else { xscale = -8000; @@ -260,9 +256,6 @@ WaveEdit::WaveEdit(PartList* pl) connect(hscroll, SIGNAL(scaleChanged(int)), SLOT(updateHScrollRange())); connect(song, SIGNAL(songChanged(int)), SLOT(songChanged1(int))); - if (!_toolbarInit.isEmpty()) - restoreState(_toolbarInit); - initShortcuts(); updateHScrollRange(); @@ -273,10 +266,9 @@ WaveEdit::WaveEdit(PartList* pl) WavePart* part = (WavePart*)(parts()->begin()->second); solo->setChecked(part->track()->solo()); } - QSettings settings("MusE", "MusE-qt"); - //restoreGeometry(settings.value("Waveedit/geometry").toByteArray()); - restoreState(settings.value("Waveedit/windowState").toByteArray()); + initTopwinState(); + initalizing=false; } void WaveEdit::initShortcuts() @@ -363,12 +355,8 @@ void WaveEdit::readConfiguration(Xml& xml) case Xml::TagStart: if (tag == "bgcolor") config.waveEditBackgroundColor = readColor(xml); - else if (tag == "width") - _widthInit = xml.parseInt(); - else if (tag == "height") - _heightInit = xml.parseInt(); - else if (tag == "toolbars") - _toolbarInit = QByteArray::fromHex(xml.parse1().toAscii()); + else if (tag == "topwin") + TopWin::readConfiguration(WAVE, xml); else xml.unknown("WaveEdit"); break; @@ -392,9 +380,7 @@ void WaveEdit::writeConfiguration(int level, Xml& xml) { xml.tag(level++, "waveedit"); xml.colorTag(level, "bgcolor", config.waveEditBackgroundColor); - xml.intTag(level, "width", _widthInit); - xml.intTag(level, "height", _heightInit); - xml.strTag(level, "toolbars", _toolbarInit.toHex().data()); + TopWin::writeConfiguration(WAVE, level,xml); xml.tag(level, "/waveedit"); } @@ -446,38 +432,6 @@ void WaveEdit::readStatus(Xml& xml) } } -//--------------------------------------------------------- -// resizeEvent -//--------------------------------------------------------- - -void WaveEdit::resizeEvent(QResizeEvent* ev) - { - QWidget::resizeEvent(ev); - storeInitialState(); - } - -//--------------------------------------------------------- -// focusOutEvent -//--------------------------------------------------------- - -void WaveEdit::focusOutEvent(QFocusEvent* ev) - { - QWidget::focusOutEvent(ev); - storeInitialState(); - } - - -//--------------------------------------------------------- -// storeInitialState -//--------------------------------------------------------- - -void WaveEdit::storeInitialState() - { - _widthInit = width(); - _heightInit = height(); - _toolbarInit=saveState(); - } - //--------------------------------------------------------- // songChanged1 diff --git a/muse2/muse/waveedit/waveedit.h b/muse2/muse/waveedit/waveedit.h index 2bfffcc1..4f040d6e 100644 --- a/muse2/muse/waveedit/waveedit.h +++ b/muse2/muse/waveedit/waveedit.h @@ -48,15 +48,10 @@ class WaveEdit : public MidiEditor { QAction* copyAction; QAction* pasteAction; - static int _widthInit, _heightInit; - static QByteArray _toolbarInit; virtual void closeEvent(QCloseEvent*); virtual void keyPressEvent(QKeyEvent*); - virtual void resizeEvent(QResizeEvent* ev); - virtual void focusOutEvent(QFocusEvent*); - void storeInitialState(); QMenu* menuFunctions, *select, *menuGain; |