~ubuntu-branches/ubuntu/trusty/vice/trusty-proposed

« back to all changes in this revision

Viewing changes to src/arch/win32/uisnapshot.c

  • Committer: Bazaar Package Importer
  • Author(s): Zed Pobre
  • Date: 2006-07-30 19:15:59 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060730191559-aybuaxdqc7uc57fc
Tags: 1.19-1
* New upstream version (Closes: #344245, #379781)
* Reference to roms in package description fixed (Closes: #302900)
* Acknowledge xlibs NMU (Closes: #346768)
* Build-Depends: bison++ | bison
* Build-Depends: libxaw-headers

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
#include "res.h"
43
43
#include "resources.h"
44
44
#include "system.h"
 
45
#include "translate.h"
45
46
#include "ui.h"
46
47
#include "uilib.h"
47
48
#include "winmain.h"
91
92
    TCHAR name[1024] = TEXT("");
92
93
    OPENFILENAME ofn;
93
94
    char *ret = NULL;
94
 
    TCHAR *st_filter;
 
95
    /* TCHAR *st_filter; */
95
96
 
96
 
    st_filter = system_mbstowcs_alloc(filter);
 
97
    /* FIXME: filter is a list of string pairs; system_mbstowcs doesn't work */
 
98
    /* st_filter = system_mbstowcs_alloc(filter); */
97
99
 
98
100
    memset(&ofn, 0, sizeof(ofn));
99
101
    ofn.lStructSize = sizeof(ofn);
100
102
    ofn.hwndOwner = hwnd;
101
103
    ofn.hInstance = winmain_instance;
102
 
    ofn.lpstrFilter = st_filter;
 
104
    ofn.lpstrFilter = filter;
103
105
    ofn.lpstrCustomFilter = NULL;
104
106
    ofn.nMaxCustFilter = 0;
105
107
    ofn.nFilterIndex = 1;
136
138
 
137
139
static void ui_snapshot_save_dialog(HWND hwnd)
138
140
{
 
141
    int filter_len,mask_len;
139
142
    char *s;
140
 
    s = ui_save_snapshot(TEXT("Save snapshot image"),
141
 
                         "VICE snapshot files (*.vsf)\0*.vsf\0",
142
 
                         hwnd, IDD_SNAPSHOT_SAVE_DIALOG);
 
143
    char *filter;
 
144
    char mask[]="*.vsf";
 
145
    s=translate_text(IDS_SNAPSHOT_FILES_FILTER);
 
146
    filter_len=strlen(s);
 
147
    mask_len=strlen(mask);
 
148
    filter = util_concat(s, "0", mask, "0", NULL);
 
149
    filter[filter_len]='\0';
 
150
    filter[filter_len+mask_len+1]='\0';
 
151
 
 
152
    s = ui_save_snapshot(translate_text(IDS_SAVE_SNAPSHOT_IMAGE),
 
153
                         filter,
 
154
                         hwnd, translate_res(IDD_SNAPSHOT_SAVE_DIALOG));
 
155
    lib_free(filter);
143
156
    if (s != NULL) {
144
157
        util_add_extension(&s, "vsf");
145
158
 
146
159
        if (machine_write_snapshot(s, save_roms, save_disks, 0) < 0)
147
 
            ui_error("Cannot write snapshot file `%s'.", s);
 
160
            ui_error(translate_text(IDS_CANNOT_WRITE_SNAPSHOT_S), s);
148
161
        lib_free(s);
149
162
    }
150
163
}
154
167
{
155
168
    TCHAR *st_name;
156
169
 
157
 
    if ((st_name = uilib_select_file(hwnd, TEXT("Load snapshot image"),
 
170
    if ((st_name = uilib_select_file(hwnd, translate_text(IDS_LOAD_SNAPSHOT_IMAGE),
158
171
        UILIB_FILTER_ALL | UILIB_FILTER_SNAPSHOT,
159
172
        UILIB_SELECTOR_TYPE_FILE_LOAD,
160
173
        UILIB_SELECTOR_STYLE_SNAPSHOT)) != NULL) {
162
175
 
163
176
        name = system_wcstombs_alloc(st_name);
164
177
        if (machine_read_snapshot(name, 0) < 0)
165
 
            ui_error("Cannot read snapshot image");
 
178
            ui_error(translate_text(IDS_CANNOT_READ_SNAPSHOT_IMG));
166
179
        system_wcstombs_free(name);
167
180
        lib_free(st_name);
168
181
    }