liveupdatemodule.cpp

Go to the documentation of this file.
00001 #include "liveupdatemodule.h"
00002 
00003 #include <QMessageBox>
00004 
00005 
00006 /*! \file liveupdatemodule.cpp
00007     \brief LiveUpdate implementation of BBoB_Module and BBoB_Channel.
00008 
00009     Creates a module with echo channel, all data in is sent out.  Parameters include a prefix and postfix
00010     for the echo.  Any input is also sent to the debug output.
00011 */
00012 
00013 
00014 /** Creates a new Module and sets up standard channels.
00015  */
00016 LiveUpdateModule::LiveUpdateModule( QWidget* parent, QString module_name, QString commandline_args)
00017         : BBoB_Module(parent, module_name)
00018 {
00019     Updater = new LiveUpdate(this);
00020 
00021     Args = commandline_args;
00022 
00023     // LiveUpdateModule Channels
00024     Channels["Update Progress"] = (BBoB_Channel*) new LiveUpdateChannel(this, Channel_Dir_Out, Channel_Type_Bit, "Update Progress");
00025     Channels["Update Now"] = (BBoB_Channel*) new LiveUpdateChannel(this, Channel_Dir_In, Channel_Type_Bit, "Update Now");
00026 }
00027 
00028 
00029 void LiveUpdateModule::SaveSettings(const BBoB_Settings* settings, const QString modName)
00030 {
00031     qDebug("LiveUpdateModule->SaveSettings");
00032 
00033 }
00034 
00035 void LiveUpdateModule::Check()
00036 {
00037     Updater->downloadFile("update.xml", true, "");
00038 }
00039 
00040 
00041 void LiveUpdateModule::Download()
00042 {
00043     Updater->downloadNew();
00044 }
00045 
00046 
00047 void LiveUpdateModule::Install()
00048 {
00049     if (Updater->runDownloaded(Args))
00050         qApp->quit();
00051     else
00052         QMessageBox::warning((QWidget*) this, tr("BBoB Update"),
00053                    tr("The downloaded update did not run\n"),
00054                    QMessageBox::Ok, QMessageBox::Ok);
00055 }
00056 

Generated on Sun Oct 28 22:51:28 2007 for BBoB by  doxygen 1.5.3