dlgUncomp::dlgUncomp(QWidget *parent = 0) : QDialog(parent) { selected = UNCOMP_NO_FILE_SELECTED; setupUi(this); setFont(parent->font()); //tableWidget_Selection->setStyleSheet("QTreeView {selection-background-color: red;}"); setWindowTitle(QFileInfo(uQString(info.rom_file)).fileName()); for (int i = 0; i < uncomp.files_founded; i++) { if (uncomp_name_file(&uncomp.file[i]) == EXIT_OK) { QTableWidgetItem *item = new QTableWidgetItem(QFileInfo(uQString(uncomp.buffer)).fileName()); tableWidget_Selection->insertRow(i); tableWidget_Selection->setItem(i, 0, item); } } connect(pushButton_Ok, SIGNAL(clicked(bool)), this, SLOT(s_ok_clicked(bool))); connect(pushButton_Cancel, SIGNAL(clicked(bool)), this, SLOT(s_cancel_clicked(bool))); QVBoxLayout *vbox = new QVBoxLayout(this); vbox->addWidget(tableWidget_Selection); vbox->addWidget(horizontalLayoutWidget); // se l'archivio compresso e' caricato da riga di comando, // la gui non e' ancora stata avviata. if (gui.start == TRUE) { emu_pause(TRUE); } setAttribute(Qt::WA_DeleteOnClose); }
void dlgUncomp::closeEvent(QCloseEvent *e) { if (gui.start == TRUE) { emu_pause(FALSE); } gui.dlg_rc = selected; QDialog::closeEvent(e); }
void dlgUncomp::closeEvent(QCloseEvent *e) { // restituisco alla finestra principale la gestione del focus gui.main_win_lfp = TRUE; if (gui.start == TRUE) { emu_pause(FALSE); } gui.dlg_rc = selected; QDialog::closeEvent(e); }
bool dlgOverscanBorders::eventFilter(QObject *obj, QEvent *event) { if (event->type() == QEvent::Show) { parentMain->ui->action_Oscan_Set_Borders->setEnabled(false); } else if (event->type() == QEvent::Close) { BYTE force; /* aggiorno l'attuale tabella */ force = overscan_set_mode(machine.type); /* ripristino il valore originario del parametro */ if (data.save_overscan != cfg->oscan) { force = TRUE; cfg->oscan = data.save_overscan; } /* * se le dimensioni dei bordi sono cambiati rispetto ai * valori di ingresso allora forzo il gfx_set_screen. */ { BYTE i, *src = (BYTE *) &data.save_borders, *dst = (BYTE *) overscan.borders; for (i = 0; i < sizeof(_overscan_borders); i++) { if ((*(src + i)) != (*(dst + i))) { force = TRUE; break; } } } if (force == TRUE) { #if defined (WITH_OPENGL) && defined (__WIN32__) gfx_sdlwe_set(SDLWIN_FORCE_SCALE, SDLWIN_NONE); #else gfx_FORCE_SCALE(); #endif } emu_pause(FALSE); /* restituisco alla finestra principale la gestione del focus */ gui.main_win_lfp = TRUE; parentMain->ui->action_Oscan_Set_Borders->setEnabled(true); } else if (event->type() == QEvent::LanguageChange) { Set_borders::retranslateUi(this); } return (QObject::eventFilter(obj, event)); }
dlgOverscanBorders::dlgOverscanBorders(QWidget *parent = 0) : QDialog(parent) { memset(&data, 0x00, sizeof(data)); memcpy(&data.overscan_borders, &overscan_borders, sizeof(overscan_borders)); /* * salvo sia il parametro dell'overscan * che il settaggio attuale dei bordi. */ data.save_overscan = cfg->oscan; data.save_borders = (*overscan.borders); data.borders = &data.overscan_borders[0]; setupUi(this); setFont(parent->font()); frame->setFrameStyle(QFrame::Panel | QFrame::Sunken); { comboBox_Mode->addItem(tr("NTSC")); comboBox_Mode->addItem(tr("PAL/Dendy")); if (machine.type == NTSC) { data.mode = 0; } else { data.mode = 1; } comboBox_Mode->setCurrentIndex(data.mode); data.borders = &data.overscan_borders[data.mode]; connect(comboBox_Mode, SIGNAL(activated(int)), this, SLOT(s_combobox_activated(int))); } connect(pushButton_Preview, SIGNAL(clicked(bool)), this, SLOT(s_preview_clicked(bool))); connect(pushButton_Defaults, SIGNAL(clicked(bool)), this, SLOT(s_default_clicked(bool))); { spinBox_Up->setRange(OVERSCAN_BORDERS_MIN, OVERSCAN_BORDERS_MAX); spinBox_Down->setRange(OVERSCAN_BORDERS_MIN, OVERSCAN_BORDERS_MAX); spinBox_Left->setRange(OVERSCAN_BORDERS_MIN, OVERSCAN_BORDERS_MAX); spinBox_Right->setRange(OVERSCAN_BORDERS_MIN, OVERSCAN_BORDERS_MAX); connect(spinBox_Up, SIGNAL(valueChanged(int)), this, SLOT(s_spinbox_value_changed(int))); connect(spinBox_Down, SIGNAL(valueChanged(int)), this, SLOT(s_spinbox_value_changed(int))); connect(spinBox_Left, SIGNAL(valueChanged(int)), this, SLOT(s_spinbox_value_changed(int))); connect(spinBox_Right, SIGNAL(valueChanged(int)), this, SLOT(s_spinbox_value_changed(int))); } update_dialog(); connect(pushButton_Apply, SIGNAL(clicked(bool)), this, SLOT(s_apply_clicked(bool))); connect(pushButton_Discard, SIGNAL(clicked(bool)), this, SLOT(s_discard_clicked(bool))); setAttribute(Qt::WA_DeleteOnClose); setFixedSize(width(), height()); installEventFilter(this); /* disabilito la gestiore del focus della finestra principale */ gui.main_win_lfp = FALSE; emu_pause(TRUE); }