summaryrefslogtreecommitdiffstats
path: root/certmanager/lib/ui/dnattributeorderconfigwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'certmanager/lib/ui/dnattributeorderconfigwidget.cpp')
-rw-r--r--certmanager/lib/ui/dnattributeorderconfigwidget.cpp124
1 files changed, 62 insertions, 62 deletions
diff --git a/certmanager/lib/ui/dnattributeorderconfigwidget.cpp b/certmanager/lib/ui/dnattributeorderconfigwidget.cpp
index 54fe32af1..4c7184066 100644
--- a/certmanager/lib/ui/dnattributeorderconfigwidget.cpp
+++ b/certmanager/lib/ui/dnattributeorderconfigwidget.cpp
@@ -45,76 +45,76 @@
#include <kconfig.h>
#include <kapplication.h>
-#include <qtoolbutton.h>
-#include <qlayout.h>
-#include <qheader.h>
-#include <qlabel.h>
-#include <qlistview.h>
-#include <qtooltip.h>
+#include <tqtoolbutton.h>
+#include <tqlayout.h>
+#include <tqheader.h>
+#include <tqlabel.h>
+#include <tqlistview.h>
+#include <tqtooltip.h>
#include <assert.h>
struct Kleo::DNAttributeOrderConfigWidget::Private {
enum { UUp=0, Up=1, Left=2, Right=3, Down=4, DDown=5 };
- QListView * availableLV;
- QListView * currentLV;
- QToolButton * navTB[6];
+ TQListView * availableLV;
+ TQListView * currentLV;
+ TQToolButton * navTB[6];
- QListViewItem * placeHolderItem;
+ TQListViewItem * placeHolderItem;
Kleo::DNAttributeMapper * mapper;
};
-static void prepare( QListView * lv ) {
+static void prepare( TQListView * lv ) {
lv->setAllColumnsShowFocus( true );
- lv->setResizeMode( QListView::LastColumn );
+ lv->setResizeMode( TQListView::LastColumn );
lv->header()->setClickEnabled( false );
- lv->addColumn( QString::null );
+ lv->addColumn( TQString::null );
lv->addColumn( i18n("Description") );
}
-Kleo::DNAttributeOrderConfigWidget::DNAttributeOrderConfigWidget( DNAttributeMapper * mapper, QWidget * parent, const char * name, WFlags f )
- : QWidget( parent, name, f ), d( 0 )
+Kleo::DNAttributeOrderConfigWidget::DNAttributeOrderConfigWidget( DNAttributeMapper * mapper, TQWidget * parent, const char * name, WFlags f )
+ : TQWidget( parent, name, f ), d( 0 )
{
assert( mapper );
d = new Private();
d->mapper = mapper;
- QGridLayout * glay = new QGridLayout( this, 2, 3, 0, KDialog::spacingHint() );
+ TQGridLayout * glay = new TQGridLayout( this, 2, 3, 0, KDialog::spacingHint() );
glay->setColStretch( 0, 1 );
glay->setColStretch( 2, 1 );
int row = -1;
++row;
- glay->addWidget( new QLabel( i18n("Available attributes:"), this ), row, 0 );
- glay->addWidget( new QLabel( i18n("Current attribute order:"), this ), row, 2 );
+ glay->addWidget( new TQLabel( i18n("Available attributes:"), this ), row, 0 );
+ glay->addWidget( new TQLabel( i18n("Current attribute order:"), this ), row, 2 );
++row;
glay->setRowStretch( row, 1 );
- d->availableLV = new QListView( this );
+ d->availableLV = new TQListView( this );
prepare( d->availableLV );
d->availableLV->setSorting( 0 );
glay->addWidget( d->availableLV, row, 0 );
- d->currentLV = new QListView( this );
+ d->currentLV = new TQListView( this );
prepare( d->currentLV );
d->currentLV->setSorting( -1 );
glay->addWidget( d->currentLV, row, 2 );
- connect( d->availableLV, SIGNAL(clicked( QListViewItem * )),
- SLOT(slotAvailableSelectionChanged(QListViewItem*)) );
- connect( d->currentLV, SIGNAL(clicked(QListViewItem*)),
- SLOT(slotCurrentOrderSelectionChanged(QListViewItem*)) );
+ connect( d->availableLV, TQT_SIGNAL(clicked( TQListViewItem * )),
+ TQT_SLOT(slotAvailableSelectionChanged(TQListViewItem*)) );
+ connect( d->currentLV, TQT_SIGNAL(clicked(TQListViewItem*)),
+ TQT_SLOT(slotCurrentOrderSelectionChanged(TQListViewItem*)) );
- d->placeHolderItem = new QListViewItem( d->availableLV, "_X_", i18n("All others") );
+ d->placeHolderItem = new TQListViewItem( d->availableLV, "_X_", i18n("All others") );
// the up/down/left/right arrow cross:
- QGridLayout * xlay = new QGridLayout( 5, 3, 0, "xlay" );
+ TQGridLayout * xlay = new TQGridLayout( 5, 3, 0, "xlay" );
xlay->setAlignment( AlignCenter );
static const struct {
@@ -123,21 +123,21 @@ Kleo::DNAttributeOrderConfigWidget::DNAttributeOrderConfigWidget( DNAttributeMap
const char * tooltip;
const char * slot;
} navButtons[] = {
- { "2uparrow", 0, 1, I18N_NOOP( "Move to top" ), SLOT(slotDoubleUpButtonClicked()) },
- { "1uparrow", 1, 1, I18N_NOOP( "Move one up" ), SLOT(slotUpButtonClicked()) },
- { "1leftarrow", 2, 0, I18N_NOOP( "Remove from current attribute order" ), SLOT(slotLeftButtonClicked()) },
- { "1rightarrow", 2, 2, I18N_NOOP( "Add to current attribute order" ), SLOT(slotRightButtonClicked()) },
- { "1downarrow", 3, 1, I18N_NOOP( "Move one down" ), SLOT(slotDownButtonClicked()) },
- { "2downarrow", 4, 1, I18N_NOOP( "Move to bottom" ), SLOT(slotDoubleDownButtonClicked()) }
+ { "2uparrow", 0, 1, I18N_NOOP( "Move to top" ), TQT_SLOT(slotDoubleUpButtonClicked()) },
+ { "1uparrow", 1, 1, I18N_NOOP( "Move one up" ), TQT_SLOT(slotUpButtonClicked()) },
+ { "1leftarrow", 2, 0, I18N_NOOP( "Remove from current attribute order" ), TQT_SLOT(slotLeftButtonClicked()) },
+ { "1rightarrow", 2, 2, I18N_NOOP( "Add to current attribute order" ), TQT_SLOT(slotRightButtonClicked()) },
+ { "1downarrow", 3, 1, I18N_NOOP( "Move one down" ), TQT_SLOT(slotDownButtonClicked()) },
+ { "2downarrow", 4, 1, I18N_NOOP( "Move to bottom" ), TQT_SLOT(slotDoubleDownButtonClicked()) }
};
for ( unsigned int i = 0 ; i < sizeof navButtons / sizeof *navButtons ; ++i ) {
- QToolButton * tb = d->navTB[i] = new QToolButton( this );
+ TQToolButton * tb = d->navTB[i] = new TQToolButton( this );
tb->setIconSet( SmallIconSet( navButtons[i].icon ) );
tb->setEnabled( false );
- QToolTip::add( tb, i18n( navButtons[i].tooltip ) );
+ TQToolTip::add( tb, i18n( navButtons[i].tooltip ) );
xlay->addWidget( tb, navButtons[i].row, navButtons[i].col );
- connect( tb, SIGNAL(clicked()), navButtons[i].slot );
+ connect( tb, TQT_SIGNAL(clicked()), navButtons[i].slot );
}
glay->addLayout( xlay, row, 1 );
@@ -154,40 +154,40 @@ void Kleo::DNAttributeOrderConfigWidget::load() {
d->availableLV->clear();
d->currentLV->clear();
- const QStringList order = d->mapper->attributeOrder();
+ const TQStringList order = d->mapper->attributeOrder();
// fill the RHS listview:
- QListViewItem * last = 0;
- for ( QStringList::const_iterator it = order.begin() ; it != order.end() ; ++it ) {
- const QString attr = (*it).upper();
+ TQListViewItem * last = 0;
+ for ( TQStringList::const_iterator it = order.begin() ; it != order.end() ; ++it ) {
+ const TQString attr = (*it).upper();
if ( attr == "_X_" ) {
takePlaceHolderItem();
d->currentLV->insertItem( d->placeHolderItem );
d->placeHolderItem->moveItem( last );
last = d->placeHolderItem;
} else
- last = new QListViewItem( d->currentLV, last, attr, d->mapper->name2label( attr ) );
+ last = new TQListViewItem( d->currentLV, last, attr, d->mapper->name2label( attr ) );
}
// fill the LHS listview with what's left:
- const QStringList all = Kleo::DNAttributeMapper::instance()->names();
- for ( QStringList::const_iterator it = all.begin() ; it != all.end() ; ++it )
+ const TQStringList all = Kleo::DNAttributeMapper::instance()->names();
+ for ( TQStringList::const_iterator it = all.begin() ; it != all.end() ; ++it )
if ( order.find( *it ) == order.end() )
- (void)new QListViewItem( d->availableLV, *it, d->mapper->name2label( *it ) );
+ (void)new TQListViewItem( d->availableLV, *it, d->mapper->name2label( *it ) );
if ( !d->placeHolderItem->listView() )
d->availableLV->insertItem( d->placeHolderItem );
}
void Kleo::DNAttributeOrderConfigWidget::takePlaceHolderItem() {
- if ( QListView * lv = d->placeHolderItem->listView() )
+ if ( TQListView * lv = d->placeHolderItem->listView() )
lv->takeItem( d->placeHolderItem );
}
void Kleo::DNAttributeOrderConfigWidget::save() const {
- QStringList order;
- for ( QListViewItemIterator it( d->currentLV ) ; it.current() ; ++it )
+ TQStringList order;
+ for ( TQListViewItemIterator it( d->currentLV ) ; it.current() ; ++it )
order.push_back( it.current()->text( 0 ) );
d->mapper->setAttributeOrder( order );
@@ -199,15 +199,15 @@ void Kleo::DNAttributeOrderConfigWidget::defaults() {
-void Kleo::DNAttributeOrderConfigWidget::slotAvailableSelectionChanged( QListViewItem * item ) {
+void Kleo::DNAttributeOrderConfigWidget::slotAvailableSelectionChanged( TQListViewItem * item ) {
d->navTB[Private::Right]->setEnabled( item );
}
-void Kleo::DNAttributeOrderConfigWidget::slotCurrentOrderSelectionChanged( QListViewItem * item ) {
+void Kleo::DNAttributeOrderConfigWidget::slotCurrentOrderSelectionChanged( TQListViewItem * item ) {
enableDisableButtons( item );
}
-void Kleo::DNAttributeOrderConfigWidget::enableDisableButtons( QListViewItem * item ) {
+void Kleo::DNAttributeOrderConfigWidget::enableDisableButtons( TQListViewItem * item ) {
d->navTB[Private::UUp ]->setEnabled( item && item->itemAbove() );
d->navTB[Private::Up ]->setEnabled( item && item->itemAbove() );
d->navTB[Private::Left ]->setEnabled( item );
@@ -216,10 +216,10 @@ void Kleo::DNAttributeOrderConfigWidget::enableDisableButtons( QListViewItem * i
}
void Kleo::DNAttributeOrderConfigWidget::slotUpButtonClicked() {
- QListViewItem * item = d->currentLV->selectedItem();
+ TQListViewItem * item = d->currentLV->selectedItem();
if ( !item )
return;
- QListViewItem * above = item->itemAbove();
+ TQListViewItem * above = item->itemAbove();
if ( !above )
return;
above->moveItem( item ); // moves "above" to after "item", ie. "item" one up
@@ -228,7 +228,7 @@ void Kleo::DNAttributeOrderConfigWidget::slotUpButtonClicked() {
}
void Kleo::DNAttributeOrderConfigWidget::slotDoubleUpButtonClicked() {
- QListViewItem * item = d->currentLV->selectedItem();
+ TQListViewItem * item = d->currentLV->selectedItem();
if ( !item )
return;
if ( item == d->currentLV->firstChild() )
@@ -241,10 +241,10 @@ void Kleo::DNAttributeOrderConfigWidget::slotDoubleUpButtonClicked() {
}
void Kleo::DNAttributeOrderConfigWidget::slotDownButtonClicked() {
- QListViewItem * item = d->currentLV->selectedItem();
+ TQListViewItem * item = d->currentLV->selectedItem();
if ( !item )
return;
- QListViewItem * below = item->itemBelow();
+ TQListViewItem * below = item->itemBelow();
if ( !below )
return;
item->moveItem( below ); // moves "item" to after "below", ie. "item" one down
@@ -253,10 +253,10 @@ void Kleo::DNAttributeOrderConfigWidget::slotDownButtonClicked() {
}
void Kleo::DNAttributeOrderConfigWidget::slotDoubleDownButtonClicked() {
- QListViewItem * item = d->currentLV->selectedItem();
+ TQListViewItem * item = d->currentLV->selectedItem();
if ( !item )
return;
- QListViewItem * last = d->currentLV->lastItem();
+ TQListViewItem * last = d->currentLV->lastItem();
assert( last );
if ( item == last )
return;
@@ -266,10 +266,10 @@ void Kleo::DNAttributeOrderConfigWidget::slotDoubleDownButtonClicked() {
}
void Kleo::DNAttributeOrderConfigWidget::slotLeftButtonClicked() {
- QListViewItem * right = d->currentLV->selectedItem();
+ TQListViewItem * right = d->currentLV->selectedItem();
if ( !right )
return;
- QListViewItem * next = right->itemBelow();
+ TQListViewItem * next = right->itemBelow();
if ( !next )
next = right->itemAbove();
d->currentLV->takeItem( right );
@@ -281,16 +281,16 @@ void Kleo::DNAttributeOrderConfigWidget::slotLeftButtonClicked() {
}
void Kleo::DNAttributeOrderConfigWidget::slotRightButtonClicked() {
- QListViewItem * left = d->availableLV->selectedItem();
+ TQListViewItem * left = d->availableLV->selectedItem();
if ( !left )
return;
- QListViewItem * next = left->itemBelow();
+ TQListViewItem * next = left->itemBelow();
if ( !next )
next = left->itemAbove();
d->availableLV->takeItem( left );
d->currentLV->insertItem( left );
- if ( QListViewItem * right = d->currentLV->selectedItem() ) {
- if ( QListViewItem * above = right->itemAbove() )
+ if ( TQListViewItem * right = d->currentLV->selectedItem() ) {
+ if ( TQListViewItem * above = right->itemAbove() )
left->moveItem( above ); // move new item immediately before old selected
d->currentLV->setSelected( right, false );
}