]>
cygwin.com Git - cygwin-apps/setup.git/blob - SourceSetting.cc
2 * Copyright (c) 2003, Robert Collins <rbtcollins@hotmail.com>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * A copy of the GNU General Public License can be found at
12 * Written by Robert Collins.
17 static const char *cvsid
=
21 #include "SourceSetting.h"
22 #include "UserSettings.h"
23 #include "io_stream.h"
31 static int inited
= 0;
34 io_stream
*f
= UserSettings::Instance().settingFileForLoad("last-action");
38 char *fg_ret
= f
->gets (localdir
, 1000);
41 source
= sourceFromString(fg_ret
);
50 io_stream
*f
= UserSettings::Instance().settingFileForSave("last-action");
54 case IDC_SOURCE_DOWNLOAD
:
55 f
->write("Download\n",9);
57 case IDC_SOURCE_NETINST
:
58 f
->write("Download,Install\n",17);
61 f
->write("Install\n",8);
71 SourceSetting::sourceFromString(String
const & aSource
)
73 if (!aSource
.casecompare("Download"))
74 return IDC_SOURCE_DOWNLOAD
;
75 if (!aSource
.casecompare("Download,Install"))
76 return IDC_SOURCE_NETINST
;
77 if (!aSource
.casecompare("Install"))
78 return IDC_SOURCE_CWD
;
80 /* A sanish default */
81 return IDC_SOURCE_NETINST
;
This page took 0.03723 seconds and 5 git commands to generate.