~ubuntu-branches/ubuntu/karmic/fsviewer/karmic

« back to all changes in this revision

Viewing changes to src/iconInspector.c

  • Committer: Bazaar Package Importer
  • Author(s): Francois Gurin
  • Date: 2004-08-12 16:13:27 UTC
  • mfrom: (1.1.1 warty)
  • Revision ID: james.westby@ubuntu.com-20040812161327-4b2uq9v4gmxpgp9t
Tags: 0.2.5-6
* Fix ICONDIR problem  (closes: #261880)
* Fix FTBFS problems with patched api changes and dependency on libwraster-dev (closes: #280283)
* Implemented work around for BadWindow error (re: #288605)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include "config.h"
 
1
/* iconInspector.c */
 
2
 
2
3
#include "FSViewer.h"
3
4
#include "FSUtils.h"
4
5
 
44
45
    WMPixmap *pixmap;
45
46
    _Panel *panel = (_Panel *) data;
46
47
    
47
 
    color.red = 0xae;
 
48
    color.red   = 0xae;
48
49
    color.green = 0xaa;
49
 
    color.blue = 0xae;
 
50
    color.blue  = 0xae;
50
51
    color.alpha = 0;
51
52
    
52
53
    if(panel->iconName)
53
54
        free(panel->iconName);
54
55
    panel->iconName = getSelectedFilename(panel);
55
 
 
56
 
    pixmap = FSCreateBlendedPixmapFromFile(panel->scr, 
 
56
          /* FS.. */
 
57
    pixmap = WMCreateBlendedPixmapFromFile(panel->scr, 
57
58
                                           LocateImage(panel->iconName), 
58
59
                                           &color);
59
60
    WMSetLabelImage(panel->iconLabel, pixmap);
60
61
}
61
62
 
 
63
 
62
64
static void
63
65
fillIconFileList(WMWidget *self, void *data)
64
66
{
92
94
    {
93
95
        free(pathname);
94
96
    }
95
 
 
 
97
    WMSortListItems(panel->fileList);
96
98
}
97
99
 
98
100
static char *
113
115
        RColor color;
114
116
        WMPixmap *pixmap;
115
117
        
116
 
        color.red = 0xae;
 
118
        color.red   = 0xae;
117
119
        color.green = 0xaa;
118
 
        color.blue = 0xae;
 
120
        color.blue  = 0xae;
119
121
        color.alpha = 0;
120
122
        
121
123
        fileInfo = (FileInfo *) listItem->clientData;
129
131
            filename = GetPathnameFromPathName(fileInfo->path, fileInfo->name);
130
132
        
131
133
        imgName = LocateImage(filename);
132
 
        pixmap = FSCreateBlendedPixmapFromFile(WMWidgetScreen(panel->win),
 
134
              /* FS..*/
 
135
        pixmap = WMCreateBlendedPixmapFromFile(WMWidgetScreen(panel->win),
133
136
                                               imgName, &color);
134
137
 
135
138
        WMSetLabelImage(panel->iconLabel, pixmap);
149
152
    RColor color;
150
153
    WMPixmap *pixmap;
151
154
    
152
 
    color.red = 0xae;
 
155
    color.red =   0xae;
153
156
    color.green = 0xaa;
154
 
    color.blue = 0xae;
 
157
    color.blue =  0xae;
155
158
    color.alpha = 0;
156
 
    
157
 
    pixmap = FSCreateBlendedPixmapFromFile(panel->scr, 
 
159
          /* FS..*/ 
 
160
    pixmap = WMCreateBlendedPixmapFromFile(panel->scr, 
158
161
                                           panel->fileInfo->imgName, 
159
162
                                           &color);
160
163
    WMClearList(panel->pathList);
163
166
    FSLoadIconPaths(panel->pathList);
164
167
    WMAddListItem(panel->pathList, panel->xpmDir);
165
168
    WMAddListItem(panel->pathList, panel->tiffDir);
 
169
    WMSortListItems(panel->pathList);
166
170
 
167
171
    WMSetLabelImage(panel->iconLabel, pixmap);
168
172
}
188
192
    if ((WMButton *)self == panel->okBtn) 
189
193
    {
190
194
        storeData(panel);
 
195
        WMSetButtonEnabled(panel->revertBtn, True);
191
196
        FSUpdateFileViewPath(FSGetFSViewerCurrentView(panel->app));
192
197
    }
193
 
    else
194
 
    {
195
 
/*      WMSetButtonEnabled(panel->okBtn, False); */
 
198
    else {
 
199
      WMRunAlertPanel(panel->scr, NULL,
 
200
        _("Inspector Error"), 
 
201
        _("This function has not yet been implemented."),
 
202
        _("OK"), NULL, NULL);
 
203
        /* reloadDefaults(); */
196
204
        WMSetButtonEnabled(panel->revertBtn, False);
197
205
    }
198
206
}
204
212
    panel->revertBtn = WMCreateCommandButton(panel->frame);
205
213
    WMMoveWidget(panel->revertBtn, 16, HEIGHT-24);
206
214
    WMResizeWidget(panel->revertBtn, 115, 24);
207
 
    WMSetButtonText(panel->revertBtn, "Revert");
 
215
    WMSetButtonText(panel->revertBtn, _("Revert"));
208
216
    WMSetButtonEnabled(panel->revertBtn, False);
209
217
    WMSetButtonAction(panel->revertBtn, buttonClick, panel);
210
218
   
211
219
    panel->okBtn = WMCreateCommandButton(panel->frame);
212
220
    WMMoveWidget(panel->okBtn, 140, HEIGHT-24);
213
221
    WMResizeWidget(panel->okBtn, 115, 24);
214
 
    WMSetButtonText(panel->okBtn, "Set Default");
 
222
    WMSetButtonText(panel->okBtn, _("Set Default"));
215
223
    WMSetButtonImage(panel->okBtn, 
216
224
                     WMGetSystemPixmap(panel->scr, WSIReturnArrow));
217
225
    WMSetButtonAltImage(panel->okBtn, 
245
253
    l = WMCreateLabel(f);
246
254
    WMMoveWidget(l, 10, 0);
247
255
    WMResizeWidget(l, 252, 20);
248
 
    WMSetLabelText(l, "Directories");
 
256
    WMSetLabelText(l, _("Directories"));
249
257
    WMSetLabelRelief(l, WRSunken);
250
258
    WMSetWidgetBackgroundColor(l, WMDarkGrayColor(panel->scr));
251
259
    WMSetLabelTextColor(l, WMWhiteColor(panel->scr));
263
271
    l = WMCreateLabel(f);
264
272
    WMMoveWidget(l, 10, 114);
265
273
    WMResizeWidget(l, 252, 20);
266
 
    WMSetLabelText(l, "Files");
 
274
    WMSetLabelText(l, _("Files"));
267
275
    WMSetLabelRelief(l, WRSunken);
268
276
    WMSetWidgetBackgroundColor(l, WMDarkGrayColor(panel->scr));
269
277
    WMSetLabelTextColor(l, WMWhiteColor(panel->scr));
297
305
    panel = wmalloc(sizeof(_Panel));
298
306
    memset(panel, 0, sizeof(_Panel));
299
307
 
300
 
    panel->sectionName = (char *) wmalloc(strlen("Icon Inspector")+1);
301
 
    strcpy(panel->sectionName, "Icon Inspector");
 
308
    panel->sectionName = (char *) wmalloc(strlen(_("Icon Inspector"))+1);
 
309
    strcpy(panel->sectionName, _("Icon Inspector"));
302
310
 
303
311
    panel->win = parent;
304
312
    panel->app = app;