trunk 20080912
[gitenigma.git] / src / software_update.cpp
blobaac40f54c4e671d26e855fc7c41c0b7f0923653e
1 /*
2 * software_update.cpp
4 * Copyright (C) 2003 Andreas Monzner <ghost@tuxbox.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 * $Id: software_update.cpp,v 1.5 2005/02/04 17:27:57 ghostrider Exp $
23 #include <software_update.h>
24 #include <flashtool.h>
25 #include <lib/gui/emessage.h>
26 #include <upgrade.h>
28 eSoftwareUpdate::eSoftwareUpdate()
29 :eSetupWindow(_("Software Update"), 6, 400)
31 move(ePoint(140, 100));
32 #ifndef DISABLE_NETWORK
33 int entry=0;
34 CONNECT((new eListBoxEntryMenu(&list, _("Internet Update"), eString().sprintf("(%d) %s", ++entry, _("open internet update")) ))->selected, eSoftwareUpdate::internet_update );
35 CONNECT((new eListBoxEntryMenu(&list, _("Manual Update"), eString().sprintf("(%d) %s", ++entry, _("open manual update")) ))->selected, eSoftwareUpdate::manual_update );
36 #ifdef ENABLE_FLASHTOOL
37 CONNECT((new eListBoxEntryMenu(&list, _("Expert Flash Save/Restore"), eString().sprintf("(%d) %s", ++entry, _("open expert flash tool")) ))->selected, eSoftwareUpdate::flash_tool);
38 #endif
39 #endif
42 #ifndef DISABLE_NETWORK
43 void eSoftwareUpdate::internet_update()
45 hide();
46 eUpgrade up(false);
47 #ifndef DISABLE_LCD
48 up.setLCD(LCDTitle, LCDElement);
49 #endif
50 up.show();
51 up.exec();
52 up.hide();
53 show();
56 void eSoftwareUpdate::manual_update()
58 hide();
59 eMessageBox box(_("Upload your Image via FTP or Samba to the '/tmp' folder."
60 "Then rename it to 'root.cramfs' and press ok."
61 "In the upcomming list select 'manual update' and follow the instructions."), _("Manual update"), eMessageBox::iconInfo|eMessageBox::btOK );
62 box.show();
63 int ret = box.exec();
64 box.hide();
65 if ( ret == eMessageBox::btOK )
67 eUpgrade up(true);
68 #ifndef DISABLE_LCD
69 up.setLCD(LCDTitle, LCDElement);
70 #endif
71 up.show();
72 up.exec();
73 up.hide();
75 show();
77 #endif
79 #ifdef ENABLE_FLASHTOOL
80 void eSoftwareUpdate::flash_tool()
82 hide();
83 eFlashtoolMain setup;
84 #ifndef DISABLE_LCD
85 setup.setLCD(LCDTitle, LCDElement);
86 #endif
87 setup.show();
88 setup.exec();
89 setup.hide();
90 show();
92 #endif