[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdebase/kxkb
From: Andy Rysin <arysin () yahoo ! com>
Date: 2004-07-16 8:44:30
Message-ID: 20040716084430.39652126C2 () office ! kde ! org
[Download RAW message or body]
CVS commit by rysin:
- don't select added layout - does not work reliable in Qt (possible related to bug #74587)
- doubleclick to add layout
- check for us* en* to disable 'include latin group'
M +18 -11 kcmlayout.cpp 1.87
--- kdebase/kxkb/kcmlayout.cpp #1.86:1.87
@@ -93,7 +93,7 @@ LayoutConfig::LayoutConfig(QWidget *pare
connect( widget->comboModel, SIGNAL(activated(int)), this, SLOT(changed()));
- connect( widget->btnAdd, SIGNAL(clicked()), this, SLOT(changed()));
+ connect( widget->listLayoutsSrc, SIGNAL(doubleClicked(QListViewItem*,const QPoint&, int)),
+ this, SLOT(add()));
connect( widget->btnAdd, SIGNAL(clicked()), this, SLOT(add()));
- connect( widget->btnRemove, SIGNAL(clicked()), this, SLOT(changed()));
connect( widget->btnRemove, SIGNAL(clicked()), this, SLOT(remove()));
@@ -150,10 +150,14 @@ void LayoutConfig::add()
return;
+ widget->listLayoutsSrc->takeItem(sel);
widget->listLayoutsDst->insertItem(sel);
+ if( widget->listLayoutsDst->childCount() > 1 )
sel->moveItem(widget->listLayoutsDst->lastItem());
- widget->listLayoutsSrc->setSelected(sel, true);
- layoutSelChanged(sel);
+// disabling temporary: does not work reliable in Qt :(
+// widget->listLayoutsSrc->setSelected(sel, true);
+// layoutSelChanged(sel);
updateStickyLimit();
+ changed();
}
@@ -172,4 +176,5 @@ void LayoutConfig::remove()
newSel = sel->itemAbove();
+ widget->listLayoutsDst->takeItem(sel);
widget->listLayoutsSrc->insertItem(sel);
if( newSel )
@@ -178,4 +183,5 @@ void LayoutConfig::remove()
updateStickyLimit();
+ changed();
}
@@ -248,10 +253,12 @@ void LayoutConfig::layoutSelChanged(QLis
QString kbdLayout = lookupLocalized( m_rules->layouts(), sel->text(1) );
- if ( ! m_rules->isSingleGroup(kbdLayout) || kbdLayout == "us" ) {
+// need better algorithm here for determining if needs us group
+ if ( ! m_rules->isSingleGroup(kbdLayout)
+ || kbdLayout.startsWith("us") || kbdLayout.startsWith("en") ) {
widget->chkLatin->setEnabled( false );
}
else {
char* inc = m_includes[ kbdLayout ];
- if ( inc && strcmp(inc, "us")==0 ) {
+ if ( inc && (strncmp(inc, "us", 2)==0 || strncmp(inc, "en", 2)==0) ) {
widget->chkLatin->setChecked(true);
}
@@ -437,4 +443,5 @@ void LayoutConfig::load()
QListViewItem* srcItem = src_it.current();
if ( *it == lookupLocalized(m_rules->layouts(), src_it.current()->text(1)) ) {
+ widget->listLayoutsSrc->takeItem(srcItem);
widget->listLayoutsDst->insertItem(srcItem);
srcItem->moveItem(widget->listLayoutsDst->lastItem());
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic