// 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(); }
NotifyOptionsWidget::NotifyOptionsWidget(INotifications *ANotifications, QWidget *AParent) : QWidget(AParent) { ui.setupUi(this); FNotifications = ANotifications; FBlockChangesCheck = 0; createTreeModel(); FSortModel.setSourceModel(&FModel); FSortModel.setSortLocaleAware(true); FSortModel.setSortCaseSensitivity(Qt::CaseInsensitive); FSortModel.setSortRole(MDR_SORT); ui.trvNotifies->setModel(&FSortModel); ui.trvNotifies->header()->hide(); ui.trvNotifies->header()->setResizeMode(COL_NAME,QHeaderView::Stretch); ui.trvNotifies->header()->setResizeMode(COL_ENABLE,QHeaderView::ResizeToContents); ui.trvNotifies->sortByColumn(COL_NAME,Qt::AscendingOrder); ui.trvNotifies->setItemsExpandable(false); ui.trvNotifies->expandAll(); connect(ui.spbPopupTimeout,SIGNAL(valueChanged(int)),SIGNAL(modified())); connect(ui.pbtRestoreDefaults,SIGNAL(clicked()),SLOT(onRestoreDefaultsClicked())); connect(&FModel,SIGNAL(itemChanged(QStandardItem *)),SLOT(onModelItemChanged(QStandardItem *))); reset(); }