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 | |||
@@ -123,59 +123,63 @@ CButtonPrefs::CButtonPrefs( QMap<orKey, int>* _kmap, QWidget* parent, const cha | |||
123 | 123 | ||
124 | 124 | ||
125 | 125 | ||
126 | QMultiLineEdit* TextLabel1 = new QMultiLineEdit( this ); | 126 | QMultiLineEdit* TextLabel1 = new QMultiLineEdit( this ); |
127 | 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." ) ); | 127 | 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." ) ); |
128 | TextLabel1->setReadOnly(true); | 128 | TextLabel1->setReadOnly(true); |
129 | TextLabel1->setWordWrap(QMultiLineEdit::WidgetWidth); | 129 | TextLabel1->setWordWrap(QMultiLineEdit::WidgetWidth); |
130 | 130 | ||
131 | // lo->addWidget(TextLabel, 0, Qt::AlignTop); | 131 | // lo->addWidget(TextLabel, 0, Qt::AlignTop); |
132 | // lo->addWidget(action, 0, Qt::AlignTop); | 132 | // lo->addWidget(action, 0, Qt::AlignTop); |
133 | lo->addWidget(TextLabel1); | 133 | lo->addWidget(TextLabel1); |
134 | lo->addWidget(action); | 134 | lo->addWidget(action); |
135 | vo->addLayout(lo); | 135 | vo->addLayout(lo); |
136 | lb = new QListView(this); | 136 | lb = new QListView(this); |
137 | lb->addColumn( tr( "Key" ) ); | 137 | lb->addColumn( tr( "Key" ) ); |
138 | lb->addColumn( tr( "Function" ) ); | 138 | lb->addColumn( tr( "Function" ) ); |
139 | lb->addColumn( tr( "Scroll" ) ); | 139 | lb->addColumn( tr( "Scroll" ) ); |
140 | lb->setFocusProxy(this); | 140 | lb->setFocusProxy(this); |
141 | vo->addWidget(lb,1); | 141 | vo->addWidget(lb,1); |
142 | for (QMap<orKey,int>::Iterator i = kmap->begin(); i != kmap->end(); i++) | 142 | for (QMap<orKey,int>::Iterator i = kmap->begin(); i != kmap->end(); i++) |
143 | { | 143 | { |
144 | listmap[i.key()] = new MyQListViewItem(i.key(), lb, i.key().text(), action->text(i.data()), (i.key().isScroll()) ? "*":""); | 144 | listmap[i.key()] = new MyQListViewItem(i.key(), lb, i.key().text(), action->text(i.data()), (i.key().isScroll()) ? "*":""); |
145 | } | 145 | } |
146 | 146 | ||
147 | lo = new QHBoxLayout(); | 147 | lo = new QHBoxLayout(); |
148 | QLabel* TextLabel = new QLabel( this, "TextLabel1" ); | 148 | QLabel* TextLabel = new QLabel( this, "TextLabel1" ); |
149 | TextLabel->setText( tr( "Debounce" ) ); | 149 | TextLabel->setText( tr( "Debounce" ) ); |
150 | lo->addWidget(TextLabel); | 150 | lo->addWidget(TextLabel); |
151 | 151 | ||
152 | debounce = new QSpinBox( this, "Debounce" ); | 152 | debounce = new QSpinBox( this, "Debounce" ); |
153 | debounce->setRange(0,1000); | 153 | debounce->setRange(0,1000); |
154 | lo->addWidget(debounce); | 154 | lo->addWidget(debounce); |
155 | /* | ||
156 | QPushButton* assignClose = new QPushButton("Assign\nCancel", this); | ||
157 | lo->addWidget(assignClose); | ||
158 | */ | ||
155 | lo->addStretch(1); | 159 | lo->addStretch(1); |
156 | QPushButton* delButton = new QPushButton("Delete", this); | 160 | QPushButton* delButton = new QPushButton("Delete", this); |
157 | connect(delButton, SIGNAL( clicked() ), this, SLOT( erasemapping() )); | 161 | connect(delButton, SIGNAL( clicked() ), this, SLOT( erasemapping() )); |
158 | lo->addWidget(delButton); | 162 | lo->addWidget(delButton); |
159 | QPushButton* exitButton = new QPushButton("Close", this); | 163 | QPushButton* exitButton = new QPushButton("Close", this); |
160 | connect(exitButton, SIGNAL( clicked() ), this, SLOT( slotClosed() ) ); | 164 | connect(exitButton, SIGNAL( clicked() ), this, SLOT( slotClosed() ) ); |
161 | lo->addWidget(exitButton); | 165 | lo->addWidget(exitButton); |
162 | vo->addLayout(lo); | 166 | vo->addLayout(lo); |
163 | } | 167 | } |
164 | 168 | ||
165 | void CButtonPrefs::erasemapping() | 169 | void CButtonPrefs::erasemapping() |
166 | { | 170 | { |
167 | MyQListViewItem* li = (MyQListViewItem*)lb->selectedItem(); | 171 | MyQListViewItem* li = (MyQListViewItem*)lb->selectedItem(); |
168 | if (li != NULL) | 172 | if (li != NULL) |
169 | { | 173 | { |
170 | orKey key(li->getKey()); | 174 | orKey key(li->getKey()); |
171 | qDebug("Tapped %s", (const char*)key.text()); | 175 | qDebug("Tapped %s", (const char*)key.text()); |
172 | kmap->remove(key); | 176 | kmap->remove(key); |
173 | lb->takeItem(listmap[key]); | 177 | lb->takeItem(listmap[key]); |
174 | listmap.remove(key); | 178 | listmap.remove(key); |
175 | } | 179 | } |
176 | } | 180 | } |
177 | 181 | ||
178 | CButtonPrefs::~CButtonPrefs() | 182 | CButtonPrefs::~CButtonPrefs() |
179 | { | 183 | { |
180 | // no need to delete child widgets, Qt does it all for us | 184 | // no need to delete child widgets, Qt does it all for us |
181 | } | 185 | } |