00001 #include "liveupdatemodule.h"
00002
00003 #include <QMessageBox>
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
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
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