[Compbench-devel] CompBenchmarks++/Qt-4/Status Status-Console.cpp, 1.5, 1.6 Status-Console.h, 1.3,
Brought to you by:
xfred
|
From: Frederic T. <xf...@us...> - 2007-09-16 18:53:34
|
Update of /cvsroot/compbench/CompBenchmarks++/Qt-4/Status In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22397 Modified Files: Status-Console.cpp Status-Console.h Status.cpp Status.h Log Message: UIMsg::Info handling. Index: Status-Console.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Status/Status-Console.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Status-Console.h 12 Sep 2007 17:00:45 -0000 1.3 --- Status-Console.h 16 Sep 2007 18:53:26 -0000 1.4 *************** *** 46,49 **** --- 46,51 ---- StatusConsole(QScrollArea *_sa, QWidget *parent = 0); + virtual CBM::UIMsg *outputInfo(std::string _text); + virtual void Display(CBM::UIMsg *_msg); virtual void DisplayProgressUpdate(CBM::UIMsg *_msg); Index: Status.h =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Status/Status.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Status.h 11 Sep 2007 20:17:40 -0000 1.4 --- Status.h 16 Sep 2007 18:53:26 -0000 1.5 *************** *** 22,29 **** private: - QPixmap pixmapOK; - QPixmap pixmapKO; - QPixmap pixmapRunning; - LedColor ledColor; QLabel *icon; --- 22,25 ---- *************** *** 50,53 **** --- 46,63 ---- virtual ~StatusAction(); }; + + class StatusInfo : public QWidget { + private: + Q_OBJECT + + private: + QLabel *icon; + QLabel *label; + + public: + StatusInfo(std::string _label, + QWidget *_parent = 0); + virtual ~StatusInfo(); + }; } Index: Status.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Status/Status.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Status.cpp 12 Sep 2007 17:00:45 -0000 1.6 --- Status.cpp 16 Sep 2007 18:53:26 -0000 1.7 *************** *** 58,61 **** --- 58,63 ---- ncolor=KO; break; + case CBM::UIMsg::Info: + break; } changeColor(ncolor); *************** *** 76,77 **** --- 78,104 ---- { } + + StatusInfo::StatusInfo(std::string _label, + QWidget *_parent) + : QWidget(_parent) + { + QHBoxLayout *lay = new QHBoxLayout; + + lay->setAlignment(Qt::AlignLeft); + icon=new QLabel(); + icon->setPixmap(*App->pixmapObject(Info)); + lay->addWidget(icon); + icon->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); + + label=new QLabel(_label.c_str()); + lay->addWidget(label); + label->setAlignment(Qt::AlignLeft | Qt::AlignVCenter); + setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); + lay->setMargin(2); + lay->setSizeConstraint(QLayout::SetMinimumSize); + setLayout(lay); + } + + StatusInfo::~StatusInfo() + { + } Index: Status-Console.cpp =================================================================== RCS file: /cvsroot/compbench/CompBenchmarks++/Qt-4/Status/Status-Console.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** Status-Console.cpp 12 Sep 2007 18:59:03 -0000 1.5 --- Status-Console.cpp 16 Sep 2007 18:53:26 -0000 1.6 *************** *** 42,45 **** --- 42,59 ---- } + CBM::UIMsg *StatusConsole::outputInfo(std::string _text) + { + CBM::UIMsg *msg = currentMsg(); + + printf("there outputInfo!!\n"); + StatusInfo *widget = new StatusInfo(_text, this); + widget->setContentsMargins(CBM::UI::depth(msg)*16, 0, 0, 0); + lay->addWidget(widget); + + autoscroll(); + + return(msg); + } + StatusAction *StatusConsole::MsgStatus(CBM::UIMsg *_msg) { *************** *** 51,59 **** child=lay->itemAt(i); r=dynamic_cast<StatusAction*>(child->widget()); ! if (r) { ! if (r->Message()==_msg) ! return(r); } - } return(0); --- 65,73 ---- child=lay->itemAt(i); r=dynamic_cast<StatusAction*>(child->widget()); ! if (r) { ! if (r->Message()==_msg) ! return(r); ! } } return(0); *************** *** 302,306 **** status=(CBM::UIMsg::Status)atoi(A->Value().c_str()); act=MsgStatus(msg); ! if (act) { act->changeStatus(status); if (flags(msg)==CBM::UIMsg::Progress) { --- 316,329 ---- status=(CBM::UIMsg::Status)atoi(A->Value().c_str()); act=MsgStatus(msg); ! printf("pushing msgdone, act=%x\n", act); ! if (!act) ! break; ! ! if (N->Value()!="") { ! printf("info : %s\n", N->Value().c_str()); ! CBM::cbmUI->outputInfo(N->Value()); ! } ! ! if (status!=CBM::UIMsg::Info) { act->changeStatus(status); if (flags(msg)==CBM::UIMsg::Progress) { |