Diffstat (limited to 'noncore/apps/opie-reader/ButtonPrefs.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-reader/ButtonPrefs.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/noncore/apps/opie-reader/ButtonPrefs.cpp b/noncore/apps/opie-reader/ButtonPrefs.cpp index 50365a8..762de55 100644 --- a/noncore/apps/opie-reader/ButtonPrefs.cpp +++ b/noncore/apps/opie-reader/ButtonPrefs.cpp @@ -107,75 +107,79 @@ void CButtonPrefs::populate(MenuButton *mb) mb->insertItem( tr("Goto link") ); } CButtonPrefs::CButtonPrefs( QMap<orKey, int>* _kmap, QWidget* parent, const char* name, WFlags fl ) : QWidget( parent, name, fl ), kmap(_kmap) { QVBoxLayout* vo = new QVBoxLayout(this); QHBoxLayout* lo = new QHBoxLayout(); setFocusPolicy(QWidget::StrongFocus); #ifdef USECOMBO action = new QComboBox( this ); #else action = new MenuButton( this ); #endif populate(action); action->setFocusProxy(this); QMultiLineEdit* TextLabel1 = new QMultiLineEdit( this ); TextLabel1->setText( tr( "Press the key(s) you want assigned to the highlighted function.\n\nPress the delete button to unmap the key.\n\nUse the \"Close\" button (not the [x]) to finish." ) ); TextLabel1->setReadOnly(true); TextLabel1->setWordWrap(QMultiLineEdit::WidgetWidth); // lo->addWidget(TextLabel, 0, Qt::AlignTop); // lo->addWidget(action, 0, Qt::AlignTop); lo->addWidget(TextLabel1); lo->addWidget(action); vo->addLayout(lo); lb = new QListView(this); lb->addColumn( tr( "Key" ) ); lb->addColumn( tr( "Function" ) ); lb->addColumn( tr( "Scroll" ) ); lb->setFocusProxy(this); vo->addWidget(lb,1); for (QMap<orKey,int>::Iterator i = kmap->begin(); i != kmap->end(); i++) { listmap[i.key()] = new MyQListViewItem(i.key(), lb, i.key().text(), action->text(i.data()), (i.key().isScroll()) ? "*":""); } lo = new QHBoxLayout(); QLabel* TextLabel = new QLabel( this, "TextLabel1" ); TextLabel->setText( tr( "Debounce" ) ); lo->addWidget(TextLabel); debounce = new QSpinBox( this, "Debounce" ); debounce->setRange(0,1000); lo->addWidget(debounce); + /* + QPushButton* assignClose = new QPushButton("Assign\nCancel", this); + lo->addWidget(assignClose); + */ lo->addStretch(1); QPushButton* delButton = new QPushButton("Delete", this); connect(delButton, SIGNAL( clicked() ), this, SLOT( erasemapping() )); lo->addWidget(delButton); QPushButton* exitButton = new QPushButton("Close", this); connect(exitButton, SIGNAL( clicked() ), this, SLOT( slotClosed() ) ); lo->addWidget(exitButton); vo->addLayout(lo); } void CButtonPrefs::erasemapping() { MyQListViewItem* li = (MyQListViewItem*)lb->selectedItem(); if (li != NULL) { orKey key(li->getKey()); qDebug("Tapped %s", (const char*)key.text()); kmap->remove(key); lb->takeItem(listmap[key]); listmap.remove(key); } } CButtonPrefs::~CButtonPrefs() { // no need to delete child widgets, Qt does it all for us } |