summaryrefslogtreecommitdiff
path: root/libopie2/opieui
Side-by-side diff
Diffstat (limited to 'libopie2/opieui') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opieui/okeyconfigwidget.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libopie2/opieui/okeyconfigwidget.cpp b/libopie2/opieui/okeyconfigwidget.cpp
index 1991381..56f4746 100644
--- a/libopie2/opieui/okeyconfigwidget.cpp
+++ b/libopie2/opieui/okeyconfigwidget.cpp
@@ -119,132 +119,132 @@ OKeyConfigWidget::~OKeyConfigWidget() {
/**
* @internal
*/
void OKeyConfigWidget::initUi() {
QBoxLayout *layout = new QVBoxLayout( this );
QGridLayout *gridLay = new QGridLayout( 2, 2 );
layout->addLayout( gridLay, 10 );
gridLay->setRowStretch( 1, 10 ); // let only the ListView strecth
/*
* LISTVIEW with the Keys
*/
m_view = new Opie::Ui::OListView( this );
m_view->setFocus();
m_view->setAllColumnsShowFocus( true );
m_view->addColumn( tr("Pixmap") );
m_view->addColumn( tr("Name","Name of the Action in the ListView Header" ) );
m_view->addColumn( tr("Key" ) );
m_view->addColumn( tr("Default Key" ) );
m_view->setRootIsDecorated( true );
connect(m_view, SIGNAL(currentChanged(QListViewItem*)),
this, SLOT(slotListViewItem(QListViewItem*)) );
gridLay->addMultiCellWidget( m_view, 1, 1, 0, 1 );
/*
* GROUP with button info
*/
QGroupBox *box = new QGroupBox( this );
box ->setTitle( tr("Shortcut for Selected Action") );
box ->setFrameStyle( QFrame::Box | QFrame::Sunken );
layout->addWidget( box, 1 );
gridLay = new QGridLayout( box, 3, 4 );
gridLay->addRowSpacing( 0, fontMetrics().lineSpacing() );
gridLay->setMargin( 4 );
QButtonGroup *gr = new QButtonGroup( box );
gr->hide();
gr->setExclusive( true );
QRadioButton *rad = new QRadioButton( tr( "&None" ), box );
connect( rad, SIGNAL(clicked()),
this, SLOT(slotNoKey()) );
gr->insert( rad, 10 );
gridLay->addWidget( rad, 1, 0 );
m_none = rad;
rad = new QRadioButton( tr("&Default" ), box );
connect( rad, SIGNAL(clicked()),
this, SLOT(slotDefaultKey()) );
gr->insert( rad, 11 );
gridLay->addWidget( rad, 1, 1 );
m_def = rad;
rad = new QRadioButton( tr("C&ustom"), box );
connect( rad, SIGNAL(clicked()),
this, SLOT(slotCustomKey()) );
gr->insert( rad, 12 );
gridLay->addWidget( rad, 1, 2 );
m_cus = rad;
m_btn = new QPushButton( tr("Configure Key"), box );
- gridLay->addWidget( m_btn, 1, 4 );
+ gridLay->addWidget( m_btn, 1, 3 );
m_lbl= new QLabel( tr( "Default: " ), box );
- gridLay->addWidget( m_lbl, 2, 0 );
+ gridLay->addMultiCellWidget( m_lbl, 2, 2, 0, 3 );
connect(m_btn, SIGNAL(clicked()),
this, SLOT(slotConfigure()));
m_box = box;
}
/**
* Set the ChangeMode.
* You need to call this function prior to load
* If you call this function past load the behaviour is undefined
* But caling load again is safe
*/
void OKeyConfigWidget::setChangeMode( enum ChangeMode mode) {
m_mode = mode;
}
/**
* return the current mode
*/
OKeyConfigWidget::ChangeMode OKeyConfigWidget::changeMode()const {
return m_mode;
}
/**
* insert these items before calling load
*/
void OKeyConfigWidget::insert( const QString& str, OKeyConfigManager* man ) {
Opie::Ui::Internal::OKeyConfigWidgetPrivate root( str, man );
m_list.append(root);
}
/**
* loads the items and allows editing them
*/
void OKeyConfigWidget::load() {
Opie::Ui::Internal::OKeyConfigWidgetPrivateList::Iterator it;
for ( it = m_list.begin(); it != m_list.end(); ++it ) {
OListViewItem *item = new OListViewItem( m_view, (*it).name );
OKeyConfigItem::List list = (*it).manager->keyConfigList();
for (OKeyConfigItem::List::Iterator keyIt = list.begin(); keyIt != list.end();++keyIt )
(void )new Opie::Ui::Internal::OKeyListViewItem(*keyIt, (*it).manager, item );
}
}
/**
* Saves if in Queue Mode. It'll update the supplied
* OKeyConfigManager objects.
* If in Queue mode it'll just return
*/
void OKeyConfigWidget::save() {
/*
* Iterate over all config items
*/
QListViewItemIterator it( m_view );
while ( it.current() ) {
if (it.current()->parent() ) {
Opie::Ui::Internal::OKeyListViewItem *item = static_cast<Opie::Ui::Internal::OKeyListViewItem*>( it.current() );
OKeyConfigManager *man = item->manager();
man->removeKeyConfig( item->origItem() );