| 1 |
/* |
|---|
| 2 |
* $Id$ |
|---|
| 3 |
*/ |
|---|
| 4 |
/* |
|---|
| 5 |
* Linbox Rescue Server |
|---|
| 6 |
* Copyright (C) 2002-2005 Linbox FAS, Free & Alter Soft |
|---|
| 7 |
* |
|---|
| 8 |
* This program is free software; you can redistribute it and/or modify |
|---|
| 9 |
* it under the terms of the GNU General Public License as published by |
|---|
| 10 |
* the Free Software Foundation; either version 2 of the License, or |
|---|
| 11 |
* (at your option) any later version. |
|---|
| 12 |
* |
|---|
| 13 |
* This program is distributed in the hope that it will be useful, |
|---|
| 14 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 15 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 16 |
* GNU General Public License for more details. |
|---|
| 17 |
* |
|---|
| 18 |
* You should have received a copy of the GNU General Public License |
|---|
| 19 |
* along with this program; if not, write to the Free Software |
|---|
| 20 |
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|---|
| 21 |
*/ |
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
#include <stdlib.h> |
|---|
| 25 |
#include <stdio.h> |
|---|
| 26 |
#include <signal.h> |
|---|
| 27 |
#include <newt.h> |
|---|
| 28 |
#include <time.h> |
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
int |
|---|
| 32 |
main (int argc, char *argv[]) |
|---|
| 33 |
{ |
|---|
| 34 |
int i; |
|---|
| 35 |
|
|---|
| 36 |
if (argc != 2) |
|---|
| 37 |
{ |
|---|
| 38 |
fprintf (stderr, "Usage : image_error message-to-display\n"); |
|---|
| 39 |
exit (1); |
|---|
| 40 |
} |
|---|
| 41 |
|
|---|
| 42 |
init_newt (argv[1]); |
|---|
| 43 |
// close_newt (); |
|---|
| 44 |
|
|---|
| 45 |
return 0; |
|---|
| 46 |
} |
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
/* newt */ |
|---|
| 50 |
|
|---|
| 51 |
newtComponent sc1, sc2, f; |
|---|
| 52 |
newtComponent t, i1, i2, l1, l2, l3, l4; |
|---|
| 53 |
newtComponent time1, time2, bitrate; |
|---|
| 54 |
|
|---|
| 55 |
time_t start, now; |
|---|
| 56 |
int old_curr, old_nb; |
|---|
| 57 |
|
|---|
| 58 |
unsigned long olddiff, bps; |
|---|
| 59 |
unsigned long long olddone; |
|---|
| 60 |
unsigned long long done, todo; |
|---|
| 61 |
|
|---|
| 62 |
void |
|---|
| 63 |
init_newt (unsigned char *message) |
|---|
| 64 |
{ |
|---|
| 65 |
newtComponent myForm, l; |
|---|
| 66 |
|
|---|
| 67 |
newtInit (); |
|---|
| 68 |
newtCls (); |
|---|
| 69 |
|
|---|
| 70 |
newtDrawRootText (0, 0, "LBLImage"); |
|---|
| 71 |
|
|---|
| 72 |
newtOpenWindow (2, 2, 72, 20, "LBLImage v" LBLIMAGEVER); |
|---|
| 73 |
|
|---|
| 74 |
newtRefresh (); |
|---|
| 75 |
|
|---|
| 76 |
newtCenteredWindow (60, 10, "LBL Error"); |
|---|
| 77 |
|
|---|
| 78 |
myForm = newtForm (NULL, NULL, 0); |
|---|
| 79 |
//l = newtLabel (1, 1, message); |
|---|
| 80 |
l = newtTextbox(1, 1, 58, 8, NEWT_FLAG_WRAP); |
|---|
| 81 |
newtTextboxSetText(l, message); |
|---|
| 82 |
newtFormAddComponents (myForm, l, NULL); |
|---|
| 83 |
newtDrawForm (myForm); |
|---|
| 84 |
|
|---|
| 85 |
newtBell(); |
|---|
| 86 |
|
|---|
| 87 |
newtRefresh (); |
|---|
| 88 |
|
|---|
| 89 |
|
|---|
| 90 |
} |
|---|
| 91 |
|
|---|
| 92 |
void |
|---|
| 93 |
close_newt (void) |
|---|
| 94 |
{ |
|---|
| 95 |
newtFormDestroy (f); |
|---|
| 96 |
|
|---|
| 97 |
//SLsmg_refresh(); |
|---|
| 98 |
//SLsmg_reset_smg(); |
|---|
| 99 |
SLang_reset_tty(); |
|---|
| 100 |
|
|---|
| 101 |
//newtFinished (); |
|---|
| 102 |
} |
|---|