CMiniLexicon::FindMajorSignatures(): use log file routines
[linguistica.git] / gui / Status.cpp
blob61d3ff2aa4e5681b1ec367c4a7f5db9c283171b5
1 // Status and progress bars as provided by Qt.
2 // Copyright © 2010 The University of Chicago
4 // Based on the setStatusBar1, etc methods from LinguisticaMainWindow.
6 #include <utility>
7 #include <QProgressBar>
8 #include <QLabel>
9 #include <QString>
10 #include "ui/Status.h"
11 #include "Status.h"
13 namespace linguistica { namespace ui {
15 namespace {
16 typedef qt::status_interface status;
19 // XXX. Processing blocks normal repaint events.
20 void status::label::update() { w.repaint(); }
21 void status::label::clear() { w.clear(); update(); }
22 status::label& status::label::operator=(const QString& str)
23 { w.setText(str); update(); return *this; }
25 // XXX. Processing blocks normal repaint events, but
26 // we do not force a repaint for historical raisons.
27 void status::progressbar::update() { }
28 void status::progressbar::clear() { w.reset(); update(); }
30 void status::progressbar::set_denominator(int denom)
31 { incr = std::max(denom / 20, 1); w.setRange(0, denom); }
33 status::progressbar& status::progressbar::assign(int n)
35 w.setValue(n);
36 update();
37 return *this;
40 } } // namespace linguistica::ui