This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 125825
Collapse All | Expand All

(-)versioncontrol/mercurial/src/org/netbeans/modules/mercurial/HgModuleConfig.java (-1 / +10 lines)
Lines 68-73 Link Here
68
    public static final String PROP_RUN_VERSION             = "runVersion";                                 // NOI18N
68
    public static final String PROP_RUN_VERSION             = "runVersion";                                 // NOI18N
69
    public static final String KEY_EXECUTABLE_BINARY        = "hgExecBinary";                              // NOI18N
69
    public static final String KEY_EXECUTABLE_BINARY        = "hgExecBinary";                              // NOI18N
70
    public static final String KEY_EXPORT_FILENAME          = "hgExportFilename";                          // NOI18N
70
    public static final String KEY_EXPORT_FILENAME          = "hgExportFilename";                          // NOI18N
71
    public static final String KEY_EXPORT_FOLDER            = "hgExportFolder";                          // NOI18N
71
    public static final String KEY_ANNOTATION_FORMAT        = "annotationFormat";                           // NOI18N
72
    public static final String KEY_ANNOTATION_FORMAT        = "annotationFormat";                           // NOI18N
72
    public static final String SAVE_PASSWORD                = "savePassword";                               // NOI18N
73
    public static final String SAVE_PASSWORD                = "savePassword";                               // NOI18N
73
    public static final String KEY_BACKUP_ON_REVERTMODS = "backupOnRevert";                               // NOI18N
74
    public static final String KEY_BACKUP_ON_REVERTMODS = "backupOnRevert";                               // NOI18N
Lines 83-89 Link Here
83
    
84
    
84
    public static final String TEXT_ANNOTATIONS_FORMAT_DEFAULT = "{DEFAULT}";                               // NOI18N           
85
    public static final String TEXT_ANNOTATIONS_FORMAT_DEFAULT = "{DEFAULT}";                               // NOI18N           
85
86
86
    private static final String DEFAULT_EXPORT_FILENAME = "/tmp/%b_%r_%h";                                  // NOI18N
87
    private static final String DEFAULT_EXPORT_FILENAME = "%b_%r_%h";                                  // NOI18N
87
    private static final HgModuleConfig INSTANCE = new HgModuleConfig();    
88
    private static final HgModuleConfig INSTANCE = new HgModuleConfig();    
88
    
89
    
89
    private static String userName;
90
    private static String userName;
Lines 151-156 Link Here
151
        getPreferences().put(KEY_EXECUTABLE_BINARY, path);
152
        getPreferences().put(KEY_EXECUTABLE_BINARY, path);
152
    }
153
    }
153
154
155
    public String getExportFolder() {
156
        return (String) getPreferences().get(KEY_EXPORT_FOLDER, System.getProperty("user.home")); // NOI18N
157
    }
158
    
159
    public void setExportFolder(String path) {
160
        getPreferences().put(KEY_EXPORT_FOLDER, path);
161
    }
162
154
    public String getExportFilename() {
163
    public String getExportFilename() {
155
        String str = (String) getPreferences().get(KEY_EXPORT_FILENAME, ""); // NOI18N
164
        String str = (String) getPreferences().get(KEY_EXPORT_FILENAME, ""); // NOI18N
156
        if (str.trim().length() == 0) str = DEFAULT_EXPORT_FILENAME;
165
        if (str.trim().length() == 0) str = DEFAULT_EXPORT_FILENAME;
(-)versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/diff/ExportDiffAction.java (+3 lines)
Lines 50-55 Link Here
50
import org.netbeans.modules.mercurial.HgException;
50
import org.netbeans.modules.mercurial.HgException;
51
import org.netbeans.modules.mercurial.HgProgressSupport;
51
import org.netbeans.modules.mercurial.HgProgressSupport;
52
import org.netbeans.modules.mercurial.Mercurial;
52
import org.netbeans.modules.mercurial.Mercurial;
53
import org.netbeans.modules.mercurial.HgModuleConfig;
53
import org.netbeans.modules.mercurial.util.HgUtils;
54
import org.netbeans.modules.mercurial.util.HgUtils;
54
import org.netbeans.modules.mercurial.util.HgRepositoryContextCache;
55
import org.netbeans.modules.mercurial.util.HgRepositoryContextCache;
55
import org.netbeans.modules.mercurial.util.HgCommand;
56
import org.netbeans.modules.mercurial.util.HgCommand;
Lines 102-107 Link Here
102
        }
103
        }
103
        final String revStr = ed.getSelectionRevision();
104
        final String revStr = ed.getSelectionRevision();
104
        final String outputFileName = ed.getOutputFileName();
105
        final String outputFileName = ed.getOutputFileName();
106
        File outputFile = new File(outputFileName);
107
        HgModuleConfig.getDefault().setExportFolder(outputFile.getParent());
105
        RequestProcessor rp = Mercurial.getInstance().getRequestProcessor(root.getAbsolutePath());
108
        RequestProcessor rp = Mercurial.getInstance().getRequestProcessor(root.getAbsolutePath());
106
        HgProgressSupport support = new HgProgressSupport() {
109
        HgProgressSupport support = new HgProgressSupport() {
107
            public void perform() {
110
            public void perform() {
(-)versioncontrol/mercurial/src/org/netbeans/modules/mercurial/ui/diff/ExportDiffPanel.java (-1 / +5 lines)
Lines 174-180 Link Here
174
    }
174
    }
175
175
176
    private void getDefaultOutputFile() {
176
    private void getDefaultOutputFile() {
177
        outputFileTextField.setText(HgModuleConfig.getDefault().getExportFilename());
177
        String folderName = HgModuleConfig.getDefault().getExportFolder();
178
        String fileName = HgModuleConfig.getDefault().getExportFilename();
179
        File file = new File(folderName, fileName);
180
        outputFileTextField.setText(file.getAbsolutePath());
178
    }
181
    }
179
182
180
    private void refreshRevisions() {
183
    private void refreshRevisions() {
Lines 219-224 Link Here
219
            fileChooser.removeChoosableFileFilter(fileFilter);
222
            fileChooser.removeChoosableFileFilter(fileFilter);
220
223
221
        }
224
        }
225
        fileChooser.setCurrentDirectory(new File(HgModuleConfig.getDefault().getExportFolder()));
222
        fileChooser.showDialog(this, NbBundle.getMessage(ExportDiffPanel.class, "OK_Button"));                                            // NO I18N
226
        fileChooser.showDialog(this, NbBundle.getMessage(ExportDiffPanel.class, "OK_Button"));                                            // NO I18N
223
        File f = fileChooser.getSelectedFile();
227
        File f = fileChooser.getSelectedFile();
224
        if (f != null) {
228
        if (f != null) {

Return to bug 125825