// ShortcutOptionsWidget ShortcutOptionsWidget::ShortcutOptionsWidget(QWidget *AParent) : QWidget(AParent) { ui.setupUi(this); createTreeModel(); onRestoreDefaultsClicked(); FBlockChangesCheck = 0; FSortModel.setSourceModel(&FModel); FSortModel.setSortLocaleAware(true); FSortModel.setSortCaseSensitivity(Qt::CaseInsensitive); ui.trvShortcuts->setItemDelegate(new ShortcutOptionsDelegate(ui.trvShortcuts)); ui.trvShortcuts->setModel(&FSortModel); ui.trvShortcuts->header()->setSortIndicatorShown(false); ui.trvShortcuts->header()->setResizeMode(SCL_NAME,QHeaderView::Stretch); ui.trvShortcuts->header()->setResizeMode(SCL_KEY,QHeaderView::ResizeToContents); ui.trvShortcuts->sortByColumn(SCL_NAME,Qt::AscendingOrder); ui.trvShortcuts->expandAll(); FConflictTimer.setInterval(0); FConflictTimer.setSingleShot(true); connect(&FConflictTimer,SIGNAL(timeout()),SLOT(onShowConflictsTimerTimeout())); connect(ui.pbtDefault,SIGNAL(clicked()),SLOT(onDefaultClicked())); connect(ui.pbtClear,SIGNAL(clicked()),SLOT(onClearClicked())); connect(ui.pbtRestoreDefaults,SIGNAL(clicked()),SLOT(onRestoreDefaultsClicked())); connect(&FModel,SIGNAL(itemChanged(QStandardItem *)),SLOT(onModelItemChanged(QStandardItem *))); connect(ui.trvShortcuts,SIGNAL(doubleClicked(const QModelIndex &)),SLOT(onIndexDoubleClicked(const QModelIndex &))); reset(); FConflictTimer.start(); }
GameSetup::GameSetup(QWidget *parent) : ui(new Ui::GameSetup) { settings = new GameSettings(); setCaption(i18n("Setup GameOfLife")); setButtons(Ok|Cancel|Help|Default); setDefaultButton(Ok); setModal(true); showButtonSeparator(true); setButtonText(Help, i18n("A&bout")); QWidget *main = new QWidget(this); setMainWidget(main); ui->setupUi(main); ui->boxShapes->addItem("Rectangle"); ui->boxShapes->addItem("Rounded rectangle"); ui->boxShapes->addItem("Ellipse"); cell = QPixmap(71, 21); bkg = QPixmap(71, 21); connect(ui->sliderR, SIGNAL(valueChanged(int)), this, SLOT(onSliderRValueChanged(int))); connect(ui->sliderG, SIGNAL(valueChanged(int)), this, SLOT(onSliderGValueChanged(int))); connect(ui->sliderB, SIGNAL(valueChanged(int)), this, SLOT(onSliderValueChanged(int))); connect(ui->sliderR_2, SIGNAL(valueChanged(int)), this, SLOT(onSliderR_2ValueChanged(int))); connect(ui->sliderG_2, SIGNAL(valueChanged(int)), this, SLOT(onSliderG_2ValueChanged(int))); connect(ui->sliderB_2, SIGNAL(valueChanged(int)), this, SLOT(onSliderB_2ValueChanged(int))); connect(this, SIGNAL(okClicked()), SLOT(onOkClicked())); connect(this, SIGNAL(helpClicked()), SLOT(onHelpClicked())); connect(this, SIGNAL(defaultClicked()), SLOT(onDefaultClicked())); ShowSettings(); }