summaryrefslogtreecommitdiff
path: root/library/categoryedit_p.cpp
Side-by-side diff
Diffstat (limited to 'library/categoryedit_p.cpp') (more/less context) (show whitespace changes)
-rw-r--r--library/categoryedit_p.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/library/categoryedit_p.cpp b/library/categoryedit_p.cpp
index 07e707e..9321259 100644
--- a/library/categoryedit_p.cpp
+++ b/library/categoryedit_p.cpp
@@ -123,48 +123,49 @@ void CategoryEdit::slotSetText( QListViewItem *selected )
chkGlobal->setChecked( true );
else
chkGlobal->setChecked( false );
}
void CategoryEdit::slotAdd()
{
QString name = tr( "New Category" );
bool insertOk = FALSE;
int num = 0;
while ( !insertOk ) {
if ( num++ > 0 )
name = tr("New Category ") + QString::number(num);
insertOk = d->mCategories.addCategory( d->mStrApp, name );
}
QCheckListItem *chk;
chk = new QCheckListItem( lvView, name, QCheckListItem::CheckBox );
if ( !chkGlobal->isChecked() )
chk->setText( 1, tr(d->mVisible) );
else
chk->setText( 1, tr("All") );
lvView->setSelected( chk, TRUE );
txtCat->selectAll();
+ txtCat->setFocus();
}
void CategoryEdit::slotRemove()
{
d->editItem = lvView->selectedItem();
if ( d->editItem ) {
QListViewItem *sibling = d->editItem->nextSibling();
d->mCategories.removeCategory( d->mStrApp, d->editItem->text(0) );
delete d->editItem;
d->editItem = 0;
if ( sibling )
lvView->setSelected( sibling, TRUE );
}
if ( lvView->childCount() < 1 ) {
txtCat->clear();
txtCat->setEnabled( FALSE );
}
}
void CategoryEdit::slotSetGlobal( bool isChecked )
{