You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
piklab/src/progs/gpsim/gui/gpsim_group_ui.cpp

43 lines
1.8 KiB

/***************************************************************************
* Copyright (C) 2006 Nicolas Hadacek <hadacek@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#include "gpsim_group_ui.h"
#include <tqtimer.h>
#include "progs/base/prog_group.h"
#include "progs/gpsim/base/gpsim.h"
//----------------------------------------------------------------------------
GPSim::ConfigWidget::ConfigWidget(const ::Programmer::Group &group, TQWidget *parent)
: ::Programmer::ConfigWidget(group, parent)
{
uint row = numRows();
TQLabel *label = new TQLabel(i18n("Status:"), this);
addWidget(label, row,row, 0,0);
_status = new TQLabel(this);
addWidget(_status, row,row, 1,1);
TQTimer::singleShot(0, this, TQT_SLOT(updateStatus()));
}
void GPSim::ConfigWidget::updateStatus()
{
VersionData version;
ProcessManager manager(0);
if ( !manager.start() ) _status->setText(i18n("Could not start \"gpsim\""));
else if ( !manager.getVersion(version) || !version.isValid() ) _status->setText(i18n("Could not detect \"gpsim\" version"));
else _status->setText(i18n("Found version \"%1\"").tqarg(version.pretty()));
}
//----------------------------------------------------------------------------
::Programmer::ConfigWidget *GPSim::GroupUI::createConfigWidget(TQWidget *parent) const
{
return new ConfigWidget(static_cast<const ::Programmer::Group &>(group()), parent);
}