1 package rero.dcc; 2 3 import java.util.*; 4 import rero.config.*; 5 import rero.dialogs.dcc.*; 6 7 import rero.client.*; 8 import rero.gui.*; 9 10 public class DCCUtilities 11 { 12 13 14 public static final int RESUME_OPTION_SELECTED = 0; public static final int RENAME_OPTION_SELECTED = 1; public static final int OVERWRITE_OPTION_SELECTED = 2; 17 18 19 20 public static final int ASK_OPTION_SET = 0; 21 public static final int AUTO_ACCEPT_OPTION_SET = 1; 22 public static final int IGNORE_OPTION_SET = 2; 23 24 25 26 public static final int ASK_RESUME_OPTION_SET = 0; 27 public static final int OVERWRITE_RESUME_OPTION_SET = 1; 28 public static final int RESUME_RESUME_OPTION_SET = 2; 29 public static final int IGNORE_RESUME_OPTION_SET = 3; 30 31 32 public static final int DetermineResumeOption(Capabilities c, ConnectDCC connect) 33 { 34 int resumeOption = -1; 35 int selectedOption = ClientState.getClientState().getInteger("dcc.exists", ClientDefaults.dcc_accept); 36 37 switch (selectedOption) 38 { 39 case ASK_RESUME_OPTION_SET: 40 resumeOption = ResumeRequest.showDialog(c.getGlobalCapabilities().getFrame(), connect); break; 42 case OVERWRITE_RESUME_OPTION_SET: 43 resumeOption = OVERWRITE_OPTION_SELECTED; 44 break; 45 case RESUME_RESUME_OPTION_SET: 46 resumeOption = RESUME_OPTION_SELECTED; 47 break; 48 case IGNORE_RESUME_OPTION_SET: 49 resumeOption = -1; break; 51 } 52 53 return resumeOption; 54 } 55 } 56 57 58 | Popular Tags |