17 setWindowTitle( tr(
"Triples Selector for Deletes" ) );
20 QVBoxLayout*
main =
new QVBoxLayout(
this );
21 main->setSpacing ( 2 );
22 main->setContentsMargins( 2, 2, 2, 2 );
23 QVBoxLayout* left =
new QVBoxLayout;
24 QVBoxLayout* right =
new QVBoxLayout;
25 QHBoxLayout* lists =
new QHBoxLayout;
34 QLabel* lb_original =
us_label( tr(
"Included Triples" ) );
35 QLabel* lb_selected =
us_label( tr(
"Excluded Triples" ) );
40 lw_original->setSelectionMode( QAbstractItemView::ExtendedSelection );
41 lw_selected->setSelectionMode( QAbstractItemView::ExtendedSelection );
45 for (
int ii = 0; ii <
nbr_orig; ii++ )
55 QHBoxLayout* buttons =
new QHBoxLayout;
68 connect( pb_reset, SIGNAL( clicked() ), SLOT(
reset() ) );
69 connect( pb_help, SIGNAL( clicked() ), SLOT(
help() ) );
70 connect( pb_cancel, SIGNAL( clicked() ), SLOT(
cancel() ) );
74 buttons->addWidget( pb_reset );
75 buttons->addWidget( pb_help );
76 buttons->addWidget( pb_cancel );
79 left ->addWidget( lb_original );
81 left ->addWidget(
pb_add );
82 right->addWidget( lb_selected );
85 lists->addLayout( left );
86 lists->addLayout( right );
89 main ->addLayout( lists );
90 main ->addLayout( buttons );
98 DbgLv(0) <<
"AddSelections";
100 QList< QListWidgetItem* > selitems =
lw_original->selectedItems();
105 QListWidgetItem* l_item = selitems.at( ii );
106 QString triple = l_item->text();
107 lw_original->setCurrentItem ( l_item, QItemSelectionModel::Deselect );
118 for (
int ii = 0; ii <
nbr_incl; ii++ )
121 for (
int ii = 0; ii <
nbr_excl; ii++ )
126 tr(
"1 included triple" ) :
127 tr(
"%1 included triples" ).arg( nbr_incl )
128 + tr(
" (of %1 original)" ).arg(
nbr_orig ) );
130 tr(
"1 excluded triple" ) :
131 tr(
"%1 excluded triples" ).arg( nbr_excl ) );
134 pb_accept->setEnabled( nbr_excl > 0 && nbr_incl > 0 );
142 DbgLv(0) <<
"RemoveSelections";
144 QList< QListWidgetItem* > selitems =
lw_selected->selectedItems();
149 QListWidgetItem* l_item = selitems.at( ii );
150 QString triple = l_item->text();
151 lw_selected->setCurrentItem ( l_item, QItemSelectionModel::Deselect );
162 for (
int ii = 0; ii <
nbr_incl; ii++ )
165 for (
int ii = 0; ii <
nbr_excl; ii++ )
170 tr(
"1 included triple" ) :
171 tr(
"%1 included triples" ).arg( nbr_incl )
172 + tr(
" (of %1 original)" ).arg(
nbr_orig ) );
174 tr(
"1 excluded triple" ) :
175 tr(
"%1 excluded triples" ).arg( nbr_excl ) );
178 pb_accept->setEnabled( nbr_excl > 0 && nbr_incl > 0 );
192 for (
int ii = 0; ii <
includes.count(); ii++ )
196 le_selected->setText( tr(
"0 selected triples" ) );