14 setWindowTitle( tr(
"Available Raw MWL Directories with .mwrs Files" ) );
18 setWindowTitle( tr(
"Available US3 Directories with MWL .auc Files" ) );
24 QVBoxLayout*
main =
new QVBoxLayout(
this );
25 main->setSpacing ( 2 );
26 main->setContentsMargins( 2, 2, 2, 2 );
29 QHBoxLayout* search =
new QHBoxLayout;
30 QLabel* lb_search =
us_label( tr(
"Search" ) );
32 search ->addWidget( lb_search );
34 connect(
le_search, SIGNAL( textChanged(
const QString& ) ),
35 this, SLOT (
limit_data (
const QString& ) ) );
41 tw =
new QTableWidget(
runInfo.size(), 3, this );
45 QHBoxLayout* buttons =
new QHBoxLayout;
48 connect( pb_cancel, SIGNAL( clicked() ), SLOT( reject() ) );
49 buttons->addWidget( pb_cancel );
52 connect( pb_accept, SIGNAL( clicked() ), SLOT(
select() ) );
53 buttons->addWidget( pb_accept );
55 main->addLayout( search );
56 main->addWidget(
tw );
57 main->addLayout( buttons );
58 qDebug() <<
"gDBr: size" << size();
61 qDebug() <<
"gDBr: size" << size();
79 QStringList rdirs = QDir(
resdir ).entryList(
80 QDir::AllDirs | QDir::NoDotAndDotDot, QDir::Name );
81 qDebug() <<
"LdDk: rdirs count" << rdirs.count() <<
"resdir" <<
resdir;
82 qDebug() <<
"LdDk: RawMwl" <<
isRawMwl <<
"efilt" << efilt <<
"rdirscount"
88 for (
int ii = 0; ii < rdirs.count(); ii++ )
90 QString
runID = rdirs[ ii ];
92 QStringList efiles = QDir( wdir ).entryList( efilt, QDir::Files,
95 int nfiles = efiles.count();
96 qDebug() <<
"LdDk: ii" << ii <<
"run" << rdirs[ii] <<
"count" << nfiles;
104 for (
int jj = 0; jj < nfiles; jj++ )
106 QString waveln = QString( efiles[ jj ] ).section(
".", -2, -2 );
107 if ( ! wavelns.contains( waveln ) )
109 if ( wavelns.count() > 2 )
break;
111 qDebug() <<
"LdDk: ii" << ii <<
"run" << rdirs[ii] <<
"nwaveln"
114 if ( wavelns.count() < 2 )
118 QString rfn = wdir +
"/" + efiles[ 0 ];
120 QFileInfo( rfn ).lastModified().toUTC()
121 .toString( Qt::ISODate ),
true )
122 .section(
" ", 0, 0 ).simplified();
137 QMessageBox::information(
this,
139 tr(
"There are no US3 runs on the local Disk to load.\n" ) );
148 int ndx =
tw ->currentRow();
152 QMessageBox::information(
this, tr(
"No Run Selected" ),
153 tr(
"You have not selected a run to load."
154 " To cancel loading, click on the \"Cancel\" button."
155 " Otherwise, make a selection in the list before"
156 " clicking on the \"Select\" button" ) );
161 qDebug() <<
"MwlRun: accept : runID" <<
runID;
170 QFontMetrics* fm =
new QFontMetrics( tw_font );
171 int rowht = fm->height() + 2;
172 tw->setFont ( tw_font );
177 headers << tr(
"Run" )
179 << tr(
"Count of " ) + (
isRawMwl ?
".mwrs" :
".auc" );
181 tw->setHorizontalHeaderLabels( headers );
182 tw->verticalHeader()->hide();
183 tw->setShowGrid(
false );
184 tw->setSelectionBehavior( QAbstractItemView::SelectRows );
185 tw->setMinimumWidth ( 100 );
186 tw->setMinimumHeight( 100 );
187 tw->setColumnWidth( 0, 250 );
188 tw->setColumnWidth( 1, 150 );
189 tw->setColumnWidth( 2, 50 );
190 tw->setSortingEnabled(
false );
194 for (
int ii = 0; ii <
runInfo.size(); ii++ )
196 QTableWidgetItem* item;
199 item =
new QTableWidgetItem( rr.
runID );
200 item->setFlags( item->flags() ^ Qt::ItemIsEditable );
201 tw ->setItem( ii, 0, item );
203 item =
new QTableWidgetItem( rr.
date );
204 item->setFlags( item->flags() ^ Qt::ItemIsEditable );
205 tw ->setItem( ii, 1, item );
207 item =
new QTableWidgetItem( QString().sprintf(
"%6d", rr.
nfiles ) );
208 item->setFlags( item->flags() ^ Qt::ItemIsEditable );
209 tw ->setItem( ii, 2, item );
213 tw ->setRowHeight( ii, rowht );
216 tw->setSortingEnabled(
true );
217 tw->sortByColumn( 1, Qt::DescendingOrder );
218 tw->resizeColumnsToContents();
220 tw->resize( size().width() - 4,
tw->size().height() );
221 qApp->processEvents();
227 qDebug() <<
"LimData: sfilt" << sfilt;
228 bool have_search = ! sfilt.isEmpty();
231 QFontMetrics* fm =
new QFontMetrics( tw_font );
232 int rowht = fm->height() + 2;
234 tw->setSortingEnabled(
false );
236 for (
int ii = 0; ii <
runInfo.size(); ii++ )
238 QTableWidgetItem* item;
243 ! rr.
runID.contains( sfilt, Qt::CaseInsensitive ) )
246 item =
new QTableWidgetItem( rr.
runID );
247 item->setFlags( item->flags() ^ Qt::ItemIsEditable );
248 tw ->setItem( ii, 0, item );
250 item =
new QTableWidgetItem( rr.
date );
251 item->setFlags( item->flags() ^ Qt::ItemIsEditable );
252 tw ->setItem( ii, 1, item );
254 item =
new QTableWidgetItem( QString().sprintf(
"%5d", rr.
nfiles ) );
255 item->setFlags( item->flags() ^ Qt::ItemIsEditable );
256 tw ->setItem( ii, 2, item );
260 tw ->setRowHeight( ii, rowht );
263 tw->setSortingEnabled(
true );
264 tw->sortByColumn( 1, Qt::DescendingOrder );
265 tw->resizeColumnsToContents();
269 tw->resize( size().width() - 4,
tw->size().height() );
270 qApp->processEvents();