void DlgffDPjrProperties::DoInitDialog() {
    if (IsPrjCreate) {
        setWindowTitle(QApplication::translate("DlgffDPjrProperties","New project"));
        OkBt->setText(QApplication::translate("DlgffDPjrProperties","Create project"));
    } else {
        setWindowTitle(QApplication::translate("DlgffDPjrProperties","Project properties"));
    }
    ui->GeometryCombo->setCurrentIndex(ffdProject->ImageGeometry);
    ui->GeometryCombo->setEnabled(IsPrjCreate);
    ui->TitleED->setText(ffdProject->ProjectInfo->Title);
    ui->DateED->setPlainText(ffdProject->ProjectInfo->LongDate);
    ui->DateEdit->setDate(ffdProject->ProjectInfo->EventDate);
    ui->DateEdit->setDisplayFormat(ApplicationConfig->ShortDateFormat);
    ui->OverrideDateCB->setChecked(ffdProject->ProjectInfo->OverrideDate);
    ui->DateED->setEnabled(ui->OverrideDateCB->isChecked());
    ui->AuthorED->setText(ffdProject->ProjectInfo->Author);
    ui->AlbumED->setText(ffdProject->ProjectInfo->Album);
    ui->CommentED->setPlainText(ffdProject->ProjectInfo->Comment);
    ui->LanguageED->setText(ffdProject->ProjectInfo->DefaultLanguage);
    ui->TransitionSpeedWaveCB->SetCurrentValue(ffdProject->TransitionSpeedWave);
    ui->BlockSpeedWaveCB->SetCurrentValue(ffdProject->BlockAnimSpeedWave);
    ui->ImageSpeedWaveCB->SetCurrentValue(ffdProject->ImageAnimSpeedWave);
    if (ApplicationConfig->ID3V2Comptatibility) {
        ui->TitleED->setMaxLength(30);
        ui->AuthorED->setMaxLength(30);
        ui->AlbumED->setMaxLength(30);
    }
    DoInitTableWidget(ui->ChapterTable,QApplication::translate("DlgffDPjrProperties","#;Slide;Title;Start;End;Duration","Column headers"));
    for (int i=0;(i==0)||(i<ffdProject->ProjectInfo->NbrChapters);i++) {
        int     iChapterNum=ffdProject->ProjectInfo->NbrChapters==0?0:i+1;
        QString ChapterNum=QString("%1").arg(iChapterNum); while (ChapterNum.length()<3) ChapterNum="0"+ChapterNum;
        ChapterNum="Chapter_"+ChapterNum+":";
        QColor Background=((i & 0x01)==0x01)?Qt::white:QColor(0xE0,0xE0,0xE0);
        ui->ChapterTable->insertRow(ui->ChapterTable->rowCount());
        ui->ChapterTable->setItem(ui->ChapterTable->rowCount()-1,0,CreateItem(QString("%1").arg(iChapterNum),Qt::AlignLeft|Qt::AlignVCenter,Background));
        ui->ChapterTable->setItem(ui->ChapterTable->rowCount()-1,1,CreateItem(GetInformationValue(ChapterNum+"InSlide", &ffdProject->ProjectInfo->ChaptersProperties),Qt::AlignLeft|Qt::AlignVCenter,Background));
        ui->ChapterTable->setItem(ui->ChapterTable->rowCount()-1,2,CreateItem(GetInformationValue(ChapterNum+"title",   &ffdProject->ProjectInfo->ChaptersProperties),Qt::AlignLeft|Qt::AlignVCenter,Background));
        ui->ChapterTable->setItem(ui->ChapterTable->rowCount()-1,3,CreateItem(GetInformationValue(ChapterNum+"Start",   &ffdProject->ProjectInfo->ChaptersProperties),Qt::AlignLeft|Qt::AlignVCenter,Background));
        ui->ChapterTable->setItem(ui->ChapterTable->rowCount()-1,4,CreateItem(GetInformationValue(ChapterNum+"End",     &ffdProject->ProjectInfo->ChaptersProperties),Qt::AlignLeft|Qt::AlignVCenter,Background));
        ui->ChapterTable->setItem(ui->ChapterTable->rowCount()-1,5,CreateItem(GetInformationValue(ChapterNum+"Duration",&ffdProject->ProjectInfo->ChaptersProperties),Qt::AlignLeft|Qt::AlignVCenter,Background));
    }
    DoResizeColumnsTableWidget(ui->ChapterTable);

    if (ffdProject->ThumbnailName=="*") ApplicationConfig->ThumbnailModels->AppendCustomModel();
    ui->ThumbCB->ProjectThumbnail=ffdProject->ProjectThumbnail;
    ui->ThumbCB->PrepareTable(true,ApplicationConfig->ThumbnailModels);
    ui->ThumbCB->SetCurrentModel(ffdProject->ThumbnailName);

    if (ffdProject->ProjectInfo->Location) {
        ui->Location->setText(QString("%1 (%2)").arg(((cLocation *)ffdProject->ProjectInfo->Location)->Name).arg(((cLocation *)ffdProject->ProjectInfo->Location)->FriendlyAddress));
        ui->LocationIcon->setPixmap(QPixmap().fromImage(((cLocation *)ffdProject->ProjectInfo->Location)->GetThumb(16)));
    } else {
        ui->Location->setText("");
        ui->LocationIcon->setPixmap(QPixmap());
    }

    // Define handler
    connect(ui->DateEdit,SIGNAL(dateChanged(const QDate &)),this,SLOT(EventDateChanged(const QDate &)));
    connect(ui->OverrideDateCB,SIGNAL(stateChanged(int)),this,SLOT(OverrideDateChanged(int)));
    connect(ui->AdminEditThumbBT,SIGNAL(clicked()),this,SLOT(AdminEditThumb()));
    connect(ui->EditThumbBT,SIGNAL(clicked()),this,SLOT(EditThumb()));
    connect(ui->ExportThumbBT,SIGNAL(clicked()),this,SLOT(ExportThumb()));
    connect(ui->ThumbCB,SIGNAL(itemSelectionHaveChanged()),this,SLOT(ThumbChanged()));
    connect(ui->TitleED,SIGNAL(textChanged(QString)),this,SLOT(TitleChanged(QString)));
    connect(ui->AlbumED,SIGNAL(textChanged(QString)),this,SLOT(AlbumChanged(QString)));
    connect(ui->AuthorED,SIGNAL(textChanged(QString)),this,SLOT(AuthorChanged(QString)));
    connect(ui->LocationBT,SIGNAL(pressed()),this,SLOT(SelectLocation()));
    connect(ui->ClearLocationBT,SIGNAL(pressed()),this,SLOT(ClearLocation()));

    ui->ThumbCB->MakeIcons();    // Refresh icons for curstom combo
    ThumbChanged();
}
Ejemplo n.º 2
0
/** OnActivate
  *
  *
  */
void MemoryGrid::OnActivate(wxActivateEvent& event)
{
    SelectLocation(last_address);
    event.Skip();
}