diff options
author | Tobias Markmann <tm@ayena.de> | 2014-10-16 10:49:23 (GMT) |
---|---|---|
committer | Swift Review <review@swift.im> | 2014-10-16 14:25:33 (GMT) |
commit | 80a0e4117219a196f9f2c09e243713b26ead763f (patch) | |
tree | 313c9644c0b92e2e29d8e0c49db65ae1a14278be | |
parent | b70bc475dbf6f608cbc06754a7ce99f305fe0923 (diff) | |
download | swift-contrib-80a0e4117219a196f9f2c09e243713b26ead763f.zip swift-contrib-80a0e4117219a196f9f2c09e243713b26ead763f.tar.bz2 |
Change text in blocking list editor from 'click' to 'double-click' to reflect
actual behavior.
Test-Information:
Swift's blocking list UI works as descibed in the text displayed in the UI.
Change-Id: Ic10d907d89dfc43b97aa21132ceb58210de807b4
-rw-r--r-- | Swift/QtUI/QtBlockListEditorWindow.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Swift/QtUI/QtBlockListEditorWindow.cpp b/Swift/QtUI/QtBlockListEditorWindow.cpp index 2484eb7..82500df 100644 --- a/Swift/QtUI/QtBlockListEditorWindow.cpp +++ b/Swift/QtUI/QtBlockListEditorWindow.cpp @@ -43,71 +43,71 @@ class QtJIDValidatedItemDelegate : public QItemDelegate { QtJIDValidatedItemDelegate(QObject* parent) : QItemDelegate(parent) {} virtual ~QtJIDValidatedItemDelegate() {} virtual QWidget* createEditor(QWidget* parent, const QStyleOptionViewItem&, const QModelIndex&) const { QLineEdit *editor = new QLineEdit(parent); editor->setValidator(new QtJIDValidator(editor)); return editor; } void setEditorData(QWidget *editor, const QModelIndex &index) const { QString value = index.model()->data(index, Qt::EditRole).toString(); QLineEdit *lineEdit = static_cast<QLineEdit*>(editor); lineEdit->setText(value); } void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const { QLineEdit *lineEdit = static_cast<QLineEdit*>(editor); QString currentValue = lineEdit->text(); int pos = 0; if (lineEdit->validator()->validate(currentValue, pos) == QValidator::Acceptable) { model->setData(index, lineEdit->text(), Qt::EditRole); } else { model->setData(index, QString(), Qt::EditRole); } } void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &/* index */) const { editor->setGeometry(option.rect); } }; QtBlockListEditorWindow::QtBlockListEditorWindow() : QWidget(), ui(new Ui::QtBlockListEditorWindow), removeItemDelegate(0), editItemDelegate(0) { ui->setupUi(this); - freshBlockListTemplate = tr("Click to add contact"); + freshBlockListTemplate = tr("Double-click to add contact"); new QShortcut(QKeySequence::Close, this, SLOT(close())); ui->throbberLabel->setMovie(new QMovie(":/icons/throbber.gif", QByteArray(), this)); removeItemDelegate = new QtRemovableItemDelegate(style()); editItemDelegate = new QtJIDValidatedItemDelegate(this); connect(ui->savePushButton, SIGNAL(clicked()), SLOT(applyChanges())); ui->blockListTreeWidget->setColumnCount(2); ui->blockListTreeWidget->header()->setStretchLastSection(false); ui->blockListTreeWidget->header()->resizeSection(1, removeItemDelegate->sizeHint(QStyleOptionViewItem(), QModelIndex()).width()); #if QT_VERSION >= 0x050000 ui->blockListTreeWidget->header()->setSectionResizeMode(0, QHeaderView::Stretch); #else ui->blockListTreeWidget->header()->setResizeMode(0, QHeaderView::Stretch); #endif ui->blockListTreeWidget->setHeaderHidden(true); ui->blockListTreeWidget->setRootIsDecorated(false); ui->blockListTreeWidget->setEditTriggers(QAbstractItemView::DoubleClicked | QAbstractItemView::SelectedClicked | QAbstractItemView::EditKeyPressed); ui->blockListTreeWidget->setItemDelegateForColumn(0, editItemDelegate); ui->blockListTreeWidget->setItemDelegateForColumn(1, removeItemDelegate); connect(ui->blockListTreeWidget, SIGNAL(itemChanged(QTreeWidgetItem*,int)), SLOT(handleItemChanged(QTreeWidgetItem*,int))); ui->blockListTreeWidget->installEventFilter(this); QTreeWidgetItem* item = new QTreeWidgetItem(QStringList(freshBlockListTemplate) << "x"); item->setFlags(item->flags() | Qt::ItemIsEditable); ui->blockListTreeWidget->addTopLevelItem(item); } QtBlockListEditorWindow::~QtBlockListEditorWindow() { } |