forked from e16/e16
1
0
Fork 0

Removed unfinished "upgrade" stuff.

SVN revision: 8269
This commit is contained in:
Kim Woelders 2004-01-03 23:59:06 +00:00
parent 5c66882c39
commit e842e073a9
8 changed files with 1 additions and 592 deletions

View File

@ -30,4 +30,3 @@ src/sound.c
src/tclass.c
src/theme.c
src/tooltips.c
src/update.c

View File

@ -1279,11 +1279,6 @@ typedef struct _emode
char windowdestroy;
int context_w;
int context_h;
char autoupgrade;
char activenetwork;
int motddate;
char motd;
char alreadytestingnetwork;
char show_pagers;
Pager *context_pager;
char pager_hiq;

View File

@ -16,7 +16,6 @@ endif
enlightenment_SOURCES = \
E.h \
timestamp.h \
update.h \
actions.c \
alert.c \
areas.c \
@ -60,7 +59,6 @@ enlightenment_SOURCES = \
misc.c \
modules.c \
mwm.c \
network.c \
pager.c \
progress.c \
regex.c \
@ -80,7 +78,6 @@ enlightenment_SOURCES = \
timers.c \
tooltips.c \
ttfont.c \
update.c \
warp.c \
windowmatch.c \
x.c \

View File

@ -65,7 +65,6 @@ static void IPC_WinOps(char *params, Client * c);
static void IPC_WinList(char *params, Client * c);
static void IPC_GotoArea(char *params, Client * c);
static void IPC_ButtonShow(char *params, Client * c);
static void IPC_ActiveNetwork(char *params, Client * c);
static void IPC_FX(char *params, Client * c);
static void IPC_MoveMode(char *params, Client * c);
static void IPC_ResizeMode(char *params, Client * c);
@ -322,12 +321,6 @@ IPCStruct IPCArray[] = {
"(removes all buttons and the dragbar)\n\"button_show\" "
"(removes all buttons)\n \"button_show buttons CONFIG*\" "
"(removes all buttons with CONFIG in the start)"},
{
IPC_ActiveNetwork,
"active_network", NULL,
"Enable or disable networking",
"use \"active_network <on/off>\" to toggle\n"
"use \"active_network ?\" to test status"},
{
IPC_FX,
"fx", NULL,
@ -3543,60 +3536,6 @@ IPC_FX(char *params, Client * c)
CommsSend(c, buf);
}
static void
IPC_ActiveNetwork(char *params, Client * c)
{
char buf[FILEPATH_LEN_MAX];
buf[0] = 0;
if (params)
{
#ifdef AUTOUPGRADE
if (!strcmp(params, "on"))
{
if (!mode.activenetwork)
{
mode.activenetwork = 1;
DoIn("MOTD_CHECK", 5.0, CheckForNewMOTD, 0, NULL);
}
}
else if (!strcmp(params, "off"))
{
if (mode.activenetwork)
{
mode.activenetwork = 0;
RemoveTimerEvent("MOTD_CHECK");
RemoveTimerEvent("UPDATE_CHECK");
}
else if (!strcmp(params, "?"))
{
if (mode.activenetwork)
{
Esnprintf(buf, sizeof(buf), "Active network: on");
}
else
{
Esnprintf(buf, sizeof(buf), "Active network: off");
}
}
else
{
Esnprintf(buf, sizeof(buf), "Error: unknown state.");
}
}
#else
Esnprintf(buf, sizeof(buf),
"Active Network not compiled into this version of E");
#endif
}
else
Esnprintf(buf, sizeof(buf), "Error: no state specified");
if (buf[0])
CommsSend(c, buf);
}
static void
IPC_ButtonShow(char *params, Client * c)
{

View File

@ -1,307 +0,0 @@
/*
* Copyright (C) 2000-2003 Carsten Haitzler, Geoff Harrison and various contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "E.h"
#ifdef AUTOUPGRADE
#include <ghttp.h>
/* a little struct to make our lives easier by grouping all this
* http stuff in the same place
*/
typedef struct conn_data_tag
{
int read_sock;
int write_sock;
ghttp_request *req;
}
conn_data;
#endif
char *
GetNetText(char *URL)
{
#ifdef AUTOUPGRADE
/* This function will retreive a text file off the net
* and return a (char *) to the appropriate text.
* Useful for retreiving config information and/or
* text messages off the net - such as the MOTD or
* the current version of E
*/
conn_data l_conn_data;
ghttp_status l_status;
ghttp_current_status l_cur_stat;
char *Data;
if (!URL)
return NULL;
l_conn_data.req = ghttp_request_new();
if (ghttp_set_uri(l_conn_data.req, URL) < 0)
{
/* invalid URI */
if (l_conn_data.req)
ghttp_request_destroy(l_conn_data.req);
return NULL;
}
if (ghttp_prepare(l_conn_data.req) < 0)
{
/* failed prep */
if (l_conn_data.req)
ghttp_request_destroy(l_conn_data.req);
return NULL;
}
/* set up some defaults */
ghttp_set_sync(l_conn_data.req, ghttp_async);
ghttp_set_chunksize(l_conn_data.req, 100);
if (ghttp_process(l_conn_data.req) < 0)
{
/* failed to process request */
if (l_conn_data.req)
ghttp_request_destroy(l_conn_data.req);
return NULL;
}
while ((l_status = ghttp_process(l_conn_data.req)) != ghttp_done)
{
l_cur_stat = ghttp_get_status(l_conn_data.req);
if (l_status == ghttp_error)
{
/* there was an error somewhere in here */
if (l_conn_data.req)
ghttp_request_destroy(l_conn_data.req);
return NULL;
}
}
Data = duplicate(ghttp_get_body(l_conn_data.req));
if (l_conn_data.req)
ghttp_request_destroy(l_conn_data.req);
if (Data)
return Data;
#else
URL = NULL;
#endif
return NULL;
}
time_t
GetNetFileDate(char *URL)
{
#ifdef AUTOUPGRADE
/* This function will return the date of a file on the
* network, for cache comparison purposes (do I
* have to download this file?)
*/
conn_data l_conn_data;
ghttp_status l_status;
ghttp_current_status l_cur_stat;
time_t ModifyDate = 0;
if (!URL)
return 0;
l_conn_data.req = ghttp_request_new();
if (ghttp_set_uri(l_conn_data.req, URL) < 0)
{
/* invalid URI */
if (l_conn_data.req)
ghttp_request_destroy(l_conn_data.req);
return 0;
}
if (ghttp_prepare(l_conn_data.req) < 0)
{
/* failed prep */
if (l_conn_data.req)
ghttp_request_destroy(l_conn_data.req);
return 0;
}
/* set up some defaults */
ghttp_set_sync(l_conn_data.req, ghttp_async);
ghttp_set_chunksize(l_conn_data.req, 100);
ghttp_set_type(l_conn_data.req, ghttp_type_head);
if (ghttp_process(l_conn_data.req) < 0)
{
/* failed to process request */
if (l_conn_data.req)
ghttp_request_destroy(l_conn_data.req);
return 0;
}
while ((l_status = ghttp_process(l_conn_data.req)) != ghttp_done)
{
l_cur_stat = ghttp_get_status(l_conn_data.req);
if (l_status == ghttp_error)
{
/* there was an error somewhere in here */
if (l_conn_data.req)
ghttp_request_destroy(l_conn_data.req);
return 0;
}
}
/* somehow right here we have to get the date out of the header.
* FIXME!!!!!!!!!!!!!!!
*/
/* ModifyDate = ghttp_parse_date(ghttp_get_header(l_conn_data.req, http_hdr_LastModified)); */
if (l_conn_data.req)
ghttp_request_destroy(l_conn_data.req);
if (ModifyDate)
return ModifyDate;
#else
URL = NULL;
#endif
return 0;
}
int
SaveNetFile(char *URL, char *pathtosave)
{
#ifdef AUTOUPGRADE
/* this function will download a file and save it to a local
* location from the network. this is for things like
* graphic files, etc, which we will need to be able to load
* again at another date. Also this will allow us to keep
* a local file cached copy of things we get off the net.
* Used with GetNetFileDate to coordinate caching system
*/
conn_data l_conn_data;
ghttp_status l_status;
ghttp_current_status l_cur_stat;
/*char *Data; */
if (!URL)
return 0;
if (!pathtosave)
return 0;
l_conn_data.req = ghttp_request_new();
if (ghttp_set_uri(l_conn_data.req, URL) < 0)
{
/* invalid URI */
if (l_conn_data.req)
ghttp_request_destroy(l_conn_data.req);
return 0;
}
if (ghttp_prepare(l_conn_data.req) < 0)
{
/* failed prep */
if (l_conn_data.req)
ghttp_request_destroy(l_conn_data.req);
return 0;
}
/* set up some defaults */
ghttp_set_sync(l_conn_data.req, ghttp_async);
ghttp_set_chunksize(l_conn_data.req, 100);
if (ghttp_process(l_conn_data.req) < 0)
{
/* failed to process request */
if (l_conn_data.req)
ghttp_request_destroy(l_conn_data.req);
return 0;
}
while ((l_status = ghttp_process(l_conn_data.req)) != ghttp_done)
{
l_cur_stat = ghttp_get_status(l_conn_data.req);
if (l_status == ghttp_error)
{
/* there was an error somewhere in here */
if (l_conn_data.req)
ghttp_request_destroy(l_conn_data.req);
return 0;
}
}
if (l_conn_data.req)
ghttp_request_destroy(l_conn_data.req);
return 1;
#else
URL = NULL;
pathtosave = NULL;
#endif
return 0;
}

View File

@ -482,17 +482,6 @@ SetupX()
mode.windowdestroy = 0;
mode.context_w = 0;
mode.context_h = 0;
#ifdef AUTOUPGRADE
mode.autoupgrade = 1;
mode.activenetwork = 0;
mode.motddate = 0;
mode.motd = 1;
#else
mode.autoupgrade = 0;
mode.activenetwork = 0;
mode.motddate = 0;
mode.motd = 0;
#endif
mode.show_pagers = 1;
mode.context_pager = NULL;
mode.pager_hiq = 1;
@ -526,6 +515,7 @@ SetupX()
desks.slidein = 1;
desks.slidespeed = 6000;
desks.hiqualitybg = 1;
SetAreaSize(2, 1);
ScreenInit();

View File

@ -1,179 +0,0 @@
/*
* Copyright (C) 2000-2003 Carsten Haitzler, Geoff Harrison and various contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#include "E.h"
#include "timestamp.h"
#include "update.h"
int
CompareNetVersion(int major, int minor, int patchlevel, char *date)
{
/* This function compares the currently compiled version with the
* version that exists on the server. returns a 0 if current, a 1
* if you need to upgrade
*/
#ifdef AUTOUPGRADE
if (mode.autoupgrade)
{
if (mode.autoupgrade > 1)
{
if (major > atoi(ENLIGHTENMENT_MAJOR))
return 1;
else if (minor > atoi(ENLIGHTENMENT_MINOR))
return 1;
else if (patchlevel > atoi(ENLIGHTENMENT_MICRO))
return 1;
}
else
{
if (strcmp(date, E_CHECKOUT_DATE))
return 1;
}
}
#else
major = 0;
minor = 0;
patchlevel = 0;
date = NULL;
#endif
return 0;
}
int
RetrieveUpdate(int major, int minor, int patchlevel, char *date)
{
/* This will download the update off the server */
#ifdef AUTOUPGRADE
if (mode.autoupgrade)
{
return 1;
}
#endif
major = 0;
minor = 0;
patchlevel = 0;
date = NULL;
return 0;
}
int
InstallUpdate(void)
{
/* this will install the update from off the server */
#ifdef AUTOUPGRADE
if (mode.autoupgrade)
{
return 1;
}
#endif
return 0;
}
void
SpawnNetworkTester(void)
{
/* This function forks off a seperate process to test the network
* connectivity. tests to see if I've got one running first, though.
*/
#ifdef AUTOUPGRADE
if (mode.alreadytestingnetwork)
return;
mode.alreadytestingnetwork = 1;
#endif
return;
}
void
TestForUpdate(void)
{
/* This function will check to see if there is an available upgrade on
* the server. Then it will notify the user, and potentially attempt to
* upgrade itself.
*/
#ifdef AUTOUPGRADE
if (mode.autoupgrade)
{
if (mode.activenetwork)
{
if (mode.autoupgrade > 1)
{
}
else
{
}
}
else
{
SpawnNetworkTester();
}
}
#endif
return;
}
void
CheckForNewMOTD(int val, void *data)
{
/* This function will check to see if there is a new MOTD on the server,
* and if there is, display it to the user
*/
val = 0;
data = NULL;
#ifdef AUTOUPGRADE
if (mode.motd)
{
if (mode.activenetwork)
{
if (GetNetFileDate(MOTDFILE) > mode.motddate)
{
char *MOTD = GetNetText(MOTDFILE);
if (MOTD)
{
DIALOG_OK(_("Enlightenment's message of the day"), MOTD);
Efree(MOTD);
}
}
DoIn("MOTD_CHECK", 3600.0, CheckForNewMOTD, 0, NULL);
}
else
{
SpawnNetworkTester();
}
}
#endif
return;
}

View File

@ -1,25 +0,0 @@
/*
* Copyright (C) 2000-2003 Carsten Haitzler, Geoff Harrison and various contributors
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies of the Software, its documentation and marketing & publicity
* materials, and acknowledgment shall be given in the documentation, materials
* and software packages that this Software was used.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#define VERSION_INFO_URL "http://www.enlightenment.org/release/"
#define DEV_VERSION_INFO_URL "http://www.enlightenment.org/dev-version/"
#define MOTDFILE "http://www.enlightenment.org/motd"