void UserInterface::updateDisplay(Display &display)
{
	vector<Entry*> eventList;
	vector<Entry*> taskList;

	eventList = display.getEventList();
	taskList = display.getTaskList();

	generateEventStringList(eventList);
	generateTaskStringList(taskList);

	getFeedbackDisplay(display);

	displayEventList();
	displayTaskList();

	displayFeedback();
}
Exemple #2
0
UEditorWindow::UEditorWindow(QWidget *parent)
    : QMainWindow(parent),
      ui(new Ui::EditWindowClass),
      _confirmCloseMessageBox(0),
      _redoAction(0),
      _undoAction(0),
      _spaceNoteGeneration(false)
{

    this->setFocusPolicy(Qt::StrongFocus);
_startTime=0;
    _playViolon = false;
    _currentFile = NULL;
    _isPlaying=false;
setAcceptDrops(true);
USetting::Instance.init();

#ifdef QT_MODULE_NETWORK
UCheckUpdate * check = new UCheckUpdate(QUrl(URL_VERSION));
connect(check,SIGNAL(connected()),this,SLOT(onConnected()));
#endif


    setupAudio();
    setupUi();

            _currentFile = new UFile(this);// "songs/arkol - vingt ans/Arkol - vingt ans.txt");

            fileConnect();

            this->showSentenceWidget->setHScroll(0);

        connect(ui->vScroll,SIGNAL(valueChanged(int)),this,SLOT(onUpdateVScrollAndScale(int)));
        connect(ui->vSlider,SIGNAL(valueChanged(int)),this,SLOT(onUpdateVScrollAndScale(int)));
        connect(ui->vScroll,SIGNAL(sliderPressed()),this,SLOT(onUpdateVScrollAndScale()));
        connect(ui->vSlider,SIGNAL(sliderPressed()),this,SLOT(onUpdateVScrollAndScale()));
        //connect(ui->vScroll,SIGNAL(actionTriggered(int)),this,SLOT(changeVScroll(int)));

        connect(_hScroll,SIGNAL(valueChanged(int)),this,SLOT(changeHScroll(int)));
        //connect(ui->hSlider,SIGNAL(valueChanged(int)),this,SLOT(changeHSlider(int)));
        connect(_hScroll,SIGNAL(sliderPressed()),this,SLOT(changeHScroll()));
        //connect(ui->hSlider,SIGNAL(sliderPressed()),this,SLOT(changeHSlider()));
        connect(_hScroll,SIGNAL(pageStepChanged(int)),this,SLOT(changeHSlider(int)));





        connect(ui->actionOpen,SIGNAL(triggered()),this,SLOT(openFile()));

        connect(ui->actionEditHeaders,SIGNAL(triggered()),this,SLOT(editHeader()));
        connect(ui->actionApplyOffset,SIGNAL(triggered()),this,SLOT(openTiming()));
        connect(ui->actionAbout, SIGNAL(triggered()), this, SLOT(about()));
        connect(playAction, SIGNAL(triggered()), this, SLOT(tooglePlay()));
        connect(pauseAction, SIGNAL(triggered()), this, SLOT(tooglePlay()));
        connect(recordAction, SIGNAL(triggered()), this, SLOT(toggleRecord()));
        connect(showSentenceWidget,SIGNAL(haveToStop()), this, SLOT(tooglePlay()));

        connect(this->ui->offsetSpinBox, SIGNAL(valueChanged(int)), showSentenceWidget, SLOT(setPreviousDisplayed(int)));
        this->ui->offsetSpinBox->setValue(2);
        connect(ui->actionSetNormalNote,SIGNAL(triggered()),showSentenceWidget, SLOT(setNormal()));
        connect(ui->actionSetFreeNote,SIGNAL(triggered()),showSentenceWidget, SLOT(setFree()));
        connect(ui->actionSetGoldNote,SIGNAL(triggered()),showSentenceWidget, SLOT(setGold()));

        connect(ui->actionMergeNotes,SIGNAL(triggered()),showSentenceWidget, SLOT(fusion()));
        connect(ui->actionSplitNote,SIGNAL(triggered()),showSentenceWidget, SLOT(split()));

        connect(ui->actionAddNote,SIGNAL(triggered()),showSentenceWidget, SLOT(nextClickAddNote()));
        connect(ui->actionAddSeparator,SIGNAL(triggered()),showSentenceWidget, SLOT(nextClickAddSeparator()));

        connect(ui->actionSave,SIGNAL(triggered()),this,SLOT(save()));
        connect(ui->actionSaveAs,SIGNAL(triggered()),this,SLOT(saveAs()));
        connect(ui->actionNew,SIGNAL(triggered()),this,SLOT(newSong()));

        connect(ui->actionQuit,SIGNAL(triggered()),this,SLOT(close()));

        connect(&UInputManager::Instance,SIGNAL(spacePressEvent(void)),this,SLOT(tooglePlay()));

        connect(_wydget_timeline, SIGNAL(gapModified(double)),this, SLOT(gapModified(double)));

         connect(ui->actionDeleteNote,SIGNAL(triggered()),showSentenceWidget,SLOT(deleteNotes()));

        connect(ui->actionPreferences,SIGNAL(triggered()),&USetting::Instance,SLOT(showDialog()));

        connect(ui->actionMorphe,SIGNAL(triggered()),showSentenceWidget,SLOT(calquer()));


        connect(ui->actionLockTimings,SIGNAL(toggled(bool)),showSentenceWidget,SLOT(lockTime(bool)));

        connect(ui->actionCenter,SIGNAL(triggered()),this,SLOT(centerView()));

        connect(ui->actionHelp,SIGNAL(triggered()),this,SLOT(displayHelpScreen()));
        connect(ui->actionSendFeedback,SIGNAL(triggered()),this,SLOT(displayFeedback()));




        onUpdateVScrollAndScale();
        changeHScroll(0);


       // _currentFile = new UFile(this);
        this->showSentenceWidget->setLyrics(_currentFile->lyrics);
        _wydget_lyrics->setWidgetWords(showSentenceWidget);


        _undoAction = _currentFile->lyrics->history().createUndoAction(this->ui->menuEdit, tr("Annuler "));
        _undoAction->setShortcut(QKeySequence::Undo);
        _undoAction->setIcon(QIcon(":/images/undo.png"));
        this->ui->menuEdit->addAction(_undoAction);
        this->ui->toolBar->insertAction(this->ui->actionSetNormalNote, _undoAction);

        _redoAction = _currentFile->lyrics->history().createRedoAction(this->ui->menuEdit, tr("Refaire "));
        _redoAction->setShortcut(QKeySequence::Redo);
        _redoAction->setIcon(QIcon(":/images/redo.png"));
        this->ui->menuEdit->addAction(_redoAction);
        this->ui->toolBar->insertAction(this->ui->actionSetNormalNote, _redoAction);


        readLastFile();

        connect(ui->actionRecentFiles,SIGNAL(triggered()),this,SLOT(openLastFile()));



        readSettings();

        _spaceNote = new Recorder(this->showSentenceWidget);

        _autoSaveTimer = new QTimer(this);
          connect(_autoSaveTimer, SIGNAL(timeout()), this, SLOT(autoSave()));

          adaptNewFile();


}