~ubuntu-branches/ubuntu/quantal/muse/quantal

« back to all changes in this revision

Viewing changes to muse/arranger/arrangerview.cpp

  • Committer: Package Import Robot
  • Author(s): Alessio Treglia
  • Date: 2012-07-18 16:07:06 UTC
  • mto: (10.1.11 sid) (1.1.12)
  • mto: This revision was merged to the branch mainline in revision 31.
  • Revision ID: package-import@ubuntu.com-20120718160706-yc6332ishfcq7b7g
ImportĀ upstreamĀ versionĀ 2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
37
37
#include <QMessageBox>
38
38
#include <QMimeData>
39
39
#include <QPushButton>
40
 
//#include <QResizeEvent>
41
40
#include <QScrollArea>
42
41
#include <QScrollBar>
43
42
#include <QSettings>
59
58
#include "mtscale.h"
60
59
#include "scoreedit.h"
61
60
#include "shortcuts.h"
62
 
#include "sig.h"
63
61
#include "song.h"
64
62
#include "structure.h"
65
63
#include "tb1.h"
67
65
#include "ttoolbar.h"
68
66
#include "visibletracks.h"
69
67
#include "xml.h"
 
68
#include "arrangercolumns.h"
70
69
 
71
70
namespace MusEGui {
72
71
 
77
76
ArrangerView::ArrangerView(QWidget* parent)
78
77
   : TopWin(TopWin::ARRANGER, parent, "arrangerview", Qt::Window)
79
78
{
80
 
  //using MusEGlobal::muse;
81
 
  
82
 
  //setAttribute(Qt::WA_DeleteOnClose);
83
79
  setWindowTitle(tr("MusE: Arranger"));
84
 
  setFocusPolicy(Qt::StrongFocus);
 
80
  setFocusPolicy(Qt::NoFocus);  
85
81
 
86
82
  arranger = new Arranger(this, "arranger");
87
83
  setCentralWidget(arranger);
88
 
  setFocusProxy(arranger);
 
84
  //setFocusProxy(arranger);
89
85
 
90
86
  scoreOneStaffPerTrackMapper = new QSignalMapper(this);
91
87
  scoreAllInOneMapper = new QSignalMapper(this);
97
93
  editSignalMapper->setMapping(sc, CMD_DELETE);
98
94
 
99
95
  // Toolbars ---------------------------------------------------------
100
 
  QToolBar* undo_tools=addToolBar(tr("Undo/Redo tools"));
101
 
  undo_tools->setObjectName("Undo/Redo tools");
102
 
  undo_tools->addActions(MusEGlobal::undoRedo->actions());
103
 
 
104
 
 
105
 
  QToolBar* panic_toolbar = addToolBar(tr("panic"));
106
 
  panic_toolbar->setObjectName("panic");
107
 
  panic_toolbar->addAction(MusEGlobal::panicAction);
108
 
 
109
 
  QToolBar* transport_toolbar = addToolBar(tr("transport"));
110
 
  transport_toolbar->setObjectName("transport");
111
 
  transport_toolbar->addActions(MusEGlobal::transportAction->actions());
112
 
 
113
96
  editTools = new EditToolBar(this, arrangerTools);
114
97
  addToolBar(editTools);
115
98
  editTools->setObjectName("arrangerTools");
148
131
  editDeleteSelectedAction = new QAction(QIcon(*edit_track_delIcon), tr("Delete Selected Tracks"), this);
149
132
  editDuplicateSelTrackAction = new QAction(QIcon(*edit_track_addIcon), tr("Duplicate Selected Tracks"), this);
150
133
 
151
 
  editShrinkPartsAction = new QAction(tr("Shrink selected parts"), this); //FINDMICH TODO tooltips!
 
134
  editShrinkPartsAction = new QAction(tr("Shrink selected parts"), this);
152
135
  editExpandPartsAction = new QAction(tr("Expand selected parts"), this);
153
136
  editCleanPartsAction = new QAction(tr("Clean selected parts"), this);
154
137
 
285
268
  
286
269
  
287
270
  QMenu* menuSettings = menuBar()->addMenu(tr("Window &Config"));
 
271
  menuSettings->addAction(tr("Configure &custom columns"), this, SLOT(configCustomColumns()));
 
272
  menuSettings->addSeparator();
288
273
  menuSettings->addAction(subwinAction);
289
274
  menuSettings->addAction(shareAction);
290
275
  menuSettings->addAction(fullscreenAction);
367
352
  connect(cb, SIGNAL(dataChanged()), SLOT(clipboardChanged()));
368
353
  connect(cb, SIGNAL(selectionChanged()), SLOT(clipboardChanged()));
369
354
 
370
 
  MusEGlobal::muse->topwinMenuInited(this);
 
355
  finalizeInit();
371
356
 
372
357
  // work around for probable QT/WM interaction bug.
373
358
  // for certain window managers, e.g xfce, this window is
448
433
                  case MusECore::Xml::TagStart:
449
434
                        if (tag == "topwin")
450
435
                              TopWin::readConfiguration(ARRANGER, xml);
 
436
                        else if (tag == "arranger")
 
437
                              Arranger::readConfiguration(xml);
451
438
                        else
452
439
                              xml.unknown("ArrangerView");
453
440
                        break;
468
455
      {
469
456
      xml.tag(level++, "arrangerview");
470
457
      TopWin::writeConfiguration(ARRANGER, level, xml);
 
458
      arranger->writeConfiguration(level,xml);
471
459
      xml.tag(level, "/arrangerview");
472
460
      }
473
461
 
664
652
void ArrangerView::addNewTrack(QAction* action)
665
653
{
666
654
  MusEGlobal::song->addNewTrack(action, MusEGlobal::muse->arranger()->curTrack());  // Insert at current selected track.
667
 
  //MusEGlobal::song->addNewTrack(action);  // Add at end.
668
655
}
669
656
 
670
657
void ArrangerView::updateShortcuts()
754
741
void ArrangerView::globalInsertSel() { MusECore::globalInsert(true); }
755
742
void ArrangerView::globalSplitSel() { MusECore::globalSplit(true); }
756
743
 
 
744
void ArrangerView::configCustomColumns()
 
745
{
 
746
  ArrangerColumns* dialog = new ArrangerColumns(this);
 
747
  dialog->exec();
 
748
  delete dialog;
 
749
  
 
750
  QMessageBox::information(this, tr("Changed Settings"), tr("Unfortunately, the changed arranger column settings\ncannot be applied while MusE is running.\nTo apply the changes, please restart MusE. Sorry.\n(we'll try to fix that)"));
 
751
}
 
752
 
757
753
} // namespace MusEGui