Resources.vala 42.2 KB
Newer Older
Eric Gregory's avatar
Eric Gregory committed
1
/* Copyright 2009-2011 Yorba Foundation
2 3 4 5
 *
 * This software is licensed under the GNU LGPL (version 2.1 or later).
 * See the COPYING file in this distribution. 
 */
6

Jim Nelson's avatar
Jim Nelson committed
7 8 9
// defined by ./configure or Makefile and included by gcc -D
extern const string _PREFIX;
extern const string _VERSION;
10
extern const string GETTEXT_PACKAGE;
Lucas Beeler's avatar
Lucas Beeler committed
11
extern const string _LIB;
12 13

namespace Resources {
14
    public const string APP_TITLE = "Shotwell";
15
    public const string APP_LIBRARY_ROLE = _("Photo Manager");
16
    public const string APP_DIRECT_ROLE = _("Photo Viewer");
17
    public const string APP_VERSION = _VERSION;
Eric Gregory's avatar
Eric Gregory committed
18
    public const string COPYRIGHT = _("Copyright 2009-2011 Yorba Foundation");
19
    public const string APP_GETTEXT_PACKAGE = GETTEXT_PACKAGE;
Jim Nelson's avatar
Jim Nelson committed
20
    
21
    public const string YORBA_URL = "http://www.yorba.org";
22 23
    public const string WIKI_URL = "http://redmine.yorba.org/projects/shotwell/wiki/Shotwell";
    public const string FAQ_URL = "http://redmine.yorba.org/projects/shotwell/wiki/ShotwellFAQ";
24
    public const string DIR_PATTERN_URI_SYSWIDE = "ghelp:shotwell?other-files";
25

Lucas Beeler's avatar
Lucas Beeler committed
26
    private const string LIB = _LIB;
27

28
    public const string PREFIX = _PREFIX;
Jim Nelson's avatar
Jim Nelson committed
29

30 31
    public const double TRANSIENT_WINDOW_OPACITY = 0.90;
    
32
    public const int DEFAULT_ICON_SCALE = 24;
33
   
34
    public const string[] AUTHORS = { 
Jim Nelson's avatar
Jim Nelson committed
35
        "Jim Nelson <jim@yorba.org>", 
Adam Dingle's avatar
Adam Dingle committed
36
        "Lucas Beeler <lucas@yorba.org>",
Adam Dingle's avatar
Adam Dingle committed
37
        "Allison Barlow <allison@yorba.org>",
Adam Dingle's avatar
Adam Dingle committed
38
        "Eric Gregory <eric@yorba.org>",
Adam Dingle's avatar
Adam Dingle committed
39
        null
Jim Nelson's avatar
Jim Nelson committed
40 41
    };

42
    public const string LICENSE = """
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
Shotwell is free software; you can redistribute it and/or modify it under the 
terms of the GNU Lesser General Public License as published by the Free 
Software Foundation; either version 2.1 of the License, or (at your option) 
any later version.

Shotwell is distributed in the hope that it will be useful, but WITHOUT 
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for 
more details.

You should have received a copy of the GNU Lesser General Public License 
along with Shotwell; if not, write to the Free Software Foundation, Inc., 
51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
""";

58 59 60 61
    public const string CLOCKWISE = "object-rotate-right";
    public const string COUNTERCLOCKWISE = "object-rotate-left";
    public const string HFLIP = "object-flip-horizontal";
    public const string VFLIP = "object-flip-vertical";
62
    public const string CROP = "shotwell-crop";
63
    public const string REDEYE = "shotwell-redeye";
64
    public const string ADJUST = "shotwell-adjust";
65 66 67 68
    public const string PIN_TOOLBAR = "shotwell-pin-toolbar";
    public const string MAKE_PRIMARY = "shotwell-make-primary";
    public const string IMPORT = "shotwell-import";
    public const string IMPORT_ALL = "shotwell-import-all";
69
    public const string ENHANCE = "shotwell-auto-enhance";
70
    public const string CROP_PIVOT_RETICLE = "shotwell-crop-pivot-reticle";
71
    public const string PUBLISH = "applications-internet";
72
    public const string MERGE = "shotwell-merge-events";
73 74
    public const string SEARCHBOX_FIND = "shotwell-searchbox-find";
    public const string SEARCHBOX_CLEAR = "shotwell-searchbox-clear";
75
    public const string FACES_TOOL = "faces";
76

77
    public const string ICON_APP = "shotwell.svg";
78 79 80 81 82
    public const string ICON_APP16 = "shotwell-16.svg";
    public const string ICON_APP24 = "shotwell-24.svg";
    
    public const string APP_ICONS[] = { ICON_APP, ICON_APP16, ICON_APP24 };
    
83
    public const string ICON_ABOUT_LOGO = "shotwell-street.jpg";
84 85
    public const string ICON_GENERIC_PLUGIN = "generic-plugin.png";
    public const string ICON_SLIDESHOW_EXTENSION_POINT = "slideshow-extension-point";
86
    public const string ICON_RATING_REJECTED = "rejected.svg";
87 88 89 90 91
    public const string ICON_RATING_ONE = "one-star.svg";
    public const string ICON_RATING_TWO = "two-stars.svg";
    public const string ICON_RATING_THREE = "three-stars.svg";
    public const string ICON_RATING_FOUR = "four-stars.svg";
    public const string ICON_RATING_FIVE = "five-stars.svg";
92
    public const string ICON_FILTER_REJECTED_OR_BETTER = "all-rejected.png";
Jim Nelson's avatar
Jim Nelson committed
93 94 95
    public const int ICON_FILTER_REJECTED_OR_BETTER_FIXED_SIZE = 32;
    public const string ICON_FILTER_UNRATED_OR_BETTER = "shotwell-16.svg";
    public const int ICON_FILTER_UNRATED_OR_BETTER_FIXED_SIZE = 16;
96 97 98 99 100
    public const string ICON_FILTER_ONE_OR_BETTER = "one-star-filter-plus.svg";
    public const string ICON_FILTER_TWO_OR_BETTER = "two-star-filter-plus.svg";
    public const string ICON_FILTER_THREE_OR_BETTER = "three-star-filter-plus.svg";
    public const string ICON_FILTER_FOUR_OR_BETTER = "four-star-filter-plus.svg";
    public const string ICON_FILTER_FIVE = "five-star-filter.svg";
101 102 103
    public const string ICON_ZOOM_IN = "zoom-in.png";
    public const string ICON_ZOOM_OUT = "zoom-out.png";
    public const int ICON_ZOOM_SCALE = 16;
104

105
    public const string ICON_CAMERAS = "camera-photo";
106 107 108 109
    public const string ICON_EVENTS = "multiple-events";
    public const string ICON_ONE_EVENT = "one-event";
    public const string ICON_ONE_TAG = "one-tag";
    public const string ICON_TAGS = "multiple-tags";
110 111
    public const string ICON_ONE_FACE = "one-face";
    public const string ICON_FACES = "many-faces";
112 113 114
    public const string ICON_FOLDER_CLOSED = "folder";
    public const string ICON_FOLDER_OPEN = "folder-open";
    public const string ICON_IMPORTING = "go-down";
115
    public const string ICON_LAST_IMPORT = "document-open-recent";
116
    public const string ICON_MISSING_FILES = "process-stop";
117
    public const string ICON_PHOTOS = "shotwell-16";
118
    public const string ICON_SINGLE_PHOTO = "image-x-generic";
119
    public const string ICON_FILTER_PHOTOS = "filter-photos";
120
    public const string ICON_FILTER_PHOTOS_DISABLED = "filter-photos-disabled";
121
    public const string ICON_FILTER_VIDEOS = "filter-videos";
122
    public const string ICON_FILTER_VIDEOS_DISABLED = "filter-videos-disabled";
123
    public const string ICON_FILTER_RAW = "filter-raw";
124
    public const string ICON_FILTER_RAW_DISABLED = "filter-raw-disabled";
125
    public const string ICON_FILTER_FLAGGED = "filter-flagged";
126
    public const string ICON_FILTER_FLAGGED_DISABLED = "filter-flagged-disabled";
127 128
    public const string ICON_TRASH_EMPTY = "user-trash";
    public const string ICON_TRASH_FULL = "user-trash-full";
129
    public const string ICON_VIDEOS_PAGE = "videos-page";
130 131
    public const string ICON_FLAGGED_PAGE = "flag-page";
    public const string ICON_FLAGGED_TRINKET = "flag-trinket.png";
132

133
    public const string ROTATE_CW_MENU = _("Rotate _Right");
134
    public const string ROTATE_CW_LABEL = _("Rotate");
135
    public const string ROTATE_CW_FULL_LABEL = _("Rotate Right");
136
    public const string ROTATE_CW_TOOLTIP = _("Rotate the photos right (press Ctrl to rotate left)");
137 138
    
    public const string ROTATE_CCW_MENU = _("Rotate _Left");
139
    public const string ROTATE_CCW_LABEL = _("Rotate");
140 141 142
    public const string ROTATE_CCW_FULL_LABEL = _("Rotate Left");
    public const string ROTATE_CCW_TOOLTIP = _("Rotate the photos left");
    
143 144
    public const string HFLIP_MENU = _("Flip Hori_zontally");
    public const string HFLIP_LABEL = _("Flip Horizontally");
145
    
146 147
    public const string VFLIP_MENU = _("Flip Verti_cally");
    public const string VFLIP_LABEL = _("Flip Vertically");
148
    
149
    public const string ENHANCE_MENU = _("_Enhance");
150 151
    public const string ENHANCE_LABEL = _("Enhance");
    public const string ENHANCE_TOOLTIP = _("Automatically improve the photo's appearance");
152
    
153 154 155
    public const string CROP_MENU = _("_Crop");
    public const string CROP_LABEL = _("Crop");
    public const string CROP_TOOLTIP = _("Crop the photo's size");
156 157 158 159

    public const string STRAIGHTEN_MENU = _("_Straighten");
    public const string STRAIGHTEN_LABEL = _("Straighten");    
    public const string STRAIGHTEN_TOOLTIP = _("Straightens the photo");    
160 161 162 163 164 165 166 167 168
    
    public const string RED_EYE_MENU = _("_Red-eye");
    public const string RED_EYE_LABEL = _("Red-eye");
    public const string RED_EYE_TOOLTIP = _("Reduce or eliminate any red-eye effects in the photo");
    
    public const string ADJUST_MENU = _("_Adjust");
    public const string ADJUST_LABEL = _("Adjust");
    public const string ADJUST_TOOLTIP = _("Adjust the photo's color and tone");
    
169 170
    public const string REVERT_MENU = _("Re_vert to Original");
    public const string REVERT_LABEL = _("Revert to Original");
171 172 173 174
    
    public const string REVERT_EDITABLE_MENU = _("Revert External E_dits");
    public const string REVERT_EDITABLE_TOOLTIP = _("Revert to the master photo");
    
175
    public const string SET_BACKGROUND_MENU = _("Set as _Desktop Background");
176
    public const string SET_BACKGROUND_TOOLTIP = _("Set selected image to be the new desktop background");
177
    public const string SET_BACKGROUND_SLIDESHOW_MENU = _("Set as _Desktop Slideshow...");
178 179 180 181 182 183 184 185 186 187 188 189
    
    public const string UNDO_MENU = _("_Undo");
    public const string UNDO_LABEL = _("Undo");
    
    public const string REDO_MENU = _("_Redo");
    public const string REDO_LABEL = _("Redo");
    
    public const string RENAME_EVENT_MENU = _("Re_name Event...");
    public const string RENAME_EVENT_LABEL = _("Rename Event");
    
    public const string MAKE_KEY_PHOTO_MENU = _("Make _Key Photo for Event");
    public const string MAKE_KEY_PHOTO_LABEL = _("Make Key Photo for Event");
190 191 192
    
    public const string NEW_EVENT_MENU = _("_New Event");
    public const string NEW_EVENT_LABEL = _("New Event");
193 194 195
            
    public const string SET_PHOTO_EVENT_LABEL = _("Move Photos");
    public const string SET_PHOTO_EVENT_TOOLTIP = _("Move photos to an event");
196 197 198
    
    public const string MERGE_MENU = _("_Merge Events");
    public const string MERGE_LABEL = _("Merge");
199 200 201 202 203 204 205 206 207 208 209 210

    public const string RATING_MENU = _("_Set Rating");
    public const string RATING_LABEL = _("Set Rating");
    public const string RATING_TOOLTIP = _("Change the rating of your photo");

    public const string INCREASE_RATING_MENU = _("_Increase");
    public const string INCREASE_RATING_LABEL = _("Increase Rating");
    
    public const string DECREASE_RATING_MENU = _("_Decrease");
    public const string DECREASE_RATING_LABEL = _("Decrease Rating");

    public const string RATE_UNRATED_MENU = _("_Unrated");
211
    public const string RATE_UNRATED_COMBO_BOX = _("Unrated");
212 213 214 215 216
    public const string RATE_UNRATED_LABEL = _("Rate Unrated");
    public const string RATE_UNRATED_PROGRESS = _("Setting as unrated");
    public const string RATE_UNRATED_TOOLTIP = _("Remove any ratings");
    
    public const string RATE_REJECTED_MENU = _("_Rejected");
217
    public const string RATE_REJECTED_COMBO_BOX = _("Rejected");
218 219 220
    public const string RATE_REJECTED_LABEL = _("Rate Rejected");
    public const string RATE_REJECTED_PROGRESS = _("Setting as rejected");
    public const string RATE_REJECTED_TOOLTIP = _("Set rating to rejected");
221 222 223 224 225 226 227 228 229 230 231 232
    
    public const string DISPLAY_REJECTED_ONLY_MENU = _("Rejected _Only");
    public const string DISPLAY_REJECTED_ONLY_LABEL = _("Rejected Only");
    public const string DISPLAY_REJECTED_ONLY_TOOLTIP = _("Show only rejected photos");
    
    public const string DISPLAY_REJECTED_OR_HIGHER_MENU = _("All + _Rejected");
    public const string DISPLAY_REJECTED_OR_HIGHER_LABEL = _("Show all photos, including rejected");
    public const string DISPLAY_REJECTED_OR_HIGHER_TOOLTIP = _("Show all photos, including rejected");
    
    public const string DISPLAY_UNRATED_OR_HIGHER_MENU = _("_All Photos");
    public const string DISPLAY_UNRATED_OR_HIGHER_LABEL = _("Show all photos");
    public const string DISPLAY_UNRATED_OR_HIGHER_TOOLTIP = _("Show all photos");
233

234 235 236
    public const string VIEW_RATINGS_MENU = _("_Ratings");
    public const string VIEW_RATINGS_TOOLTIP = _("Display each photo's rating");

237 238 239
    public const string FILTER_PHOTOS_MENU = _("_Filter Photos");
    public const string FILTER_PHOTOS_LABEL = _("Filter Photos");
    public const string FILTER_PHOTOS_TOOLTIP = _("Limit the number of photos displayed based on a filter");
240
    
241 242 243
    public const string DUPLICATE_PHOTO_MENU = _("_Duplicate");
    public const string DUPLICATE_PHOTO_LABEL = _("Duplicate");
    public const string DUPLICATE_PHOTO_TOOLTIP = _("Make a duplicate of the photo");
244 245

    public const string EXPORT_MENU = _("_Export...");
246
    
247
    public const string PRINT_MENU = _("_Print...");
248
    
249
    public const string PUBLISH_MENU = _("Pu_blish...");
250
    public const string PUBLISH_LABEL = _("Publish");
251
    public const string PUBLISH_TOOLTIP = _("Publish to various websites");
252

253 254
    public const string EDIT_TITLE_MENU = _("E_dit Title...");
    public const string EDIT_TITLE_LABEL = _("Edit Title");
255

256 257
    public const string ADJUST_DATE_TIME_MENU = _("_Adjust Date and Time...");
    public const string ADJUST_DATE_TIME_LABEL = _("Adjust Date and Time");
258
    
259 260
    public const string ADD_TAGS_MENU = _("Add _Tags...");
    public const string ADD_TAGS_TITLE = _("Add Tags");
261 262

    public const string PREFERENCES_MENU = _("_Preferences");
263
    
264 265 266 267
    public const string EXTERNAL_EDIT_MENU = _("_Open With External Editor");
    
    public const string EXTERNAL_EDIT_RAW_MENU = _("Open With RA_W Editor");
    
Jim Nelson's avatar
Jim Nelson committed
268
    public const string SEND_TO_MENU = _("Send _To...");
Jim Nelson's avatar
Jim Nelson committed
269
    
270
    public const string FIND_MENU = _("_Find...");
271
    public const string FIND_LABEL = _("Find");
272
    public const string FIND_TOOLTIP = _("Find an image by typing text that appears in its name or tags");
Jim Nelson's avatar
Jim Nelson committed
273
    
274 275
    public const string FLAG_MENU = _("_Flag");
    
Jim Nelson's avatar
Jim Nelson committed
276
    public const string UNFLAG_MENU = _("Un_flag");
277 278

#if ENABLE_FACES    
279 280 281 282 283 284 285
    public const string FACES_MENU = _("Faces");
    public const string FACES_LABEL = _("Faces");
    public const string FACES_TOOLTIP = _("Mark faces of people in the photo");
    public const string MODIFY_FACES_LABEL = _("Modify Faces");
    public const string DELETE_FACE_TITLE = _("Delete Face");
    public const string DELETE_FACE_SIDEBAR_MENU = _("_Delete");
    public const string RENAME_FACE_SIDEBAR_MENU = _("_Rename...");
286 287
#endif

288 289 290 291
    public string launch_editor_failed(Error err) {
        return _("Unable to launch editor: %s").printf(err.message);
    }
    
292 293
    public string add_tags_label(string[] names) {
        if (names.length == 1)
294
            return _("Add Tag \"%s\"").printf(HierarchicalTagUtilities.get_basename(names[0]));
295
        else if (names.length == 2)
296 297 298
            return _("Add Tags \"%s\" and \"%s\"").printf(
            HierarchicalTagUtilities.get_basename(names[0]),
            HierarchicalTagUtilities.get_basename(names[1]));
299 300
        else
            return _("Add Tags");
301 302 303 304 305 306 307 308 309 310
    }
    
    public string delete_tag_menu(string name) {
        return _("_Delete Tag \"%s\"").printf(name);
    }
    
    public string delete_tag_label(string name) {
        return _("Delete Tag \"%s\"").printf(name);
    }
    
311
    public const string DELETE_TAG_TITLE = _("Delete Tag");
312
    public const string DELETE_TAG_SIDEBAR_MENU = _("_Delete");
Jim Nelson's avatar
Jim Nelson committed
313
    
314 315
    public const string NEW_CHILD_TAG_SIDEBAR_MENU = _("_New");
    
316 317 318 319 320 321 322 323
    public string rename_tag_menu(string name) {
        return _("Re_name Tag \"%s\"...").printf(name);
    }
    
    public string rename_tag_label(string old_name, string new_name) {
        return _("Rename Tag \"%s\" to \"%s\"").printf(old_name, new_name);
    }
    
324
    public const string RENAME_TAG_SIDEBAR_MENU = _("_Rename...");
Jim Nelson's avatar
Jim Nelson committed
325
    
326
    public const string MODIFY_TAGS_MENU = _("Modif_y Tags...");
327
    public const string MODIFY_TAGS_LABEL = _("Modify Tags");
328
    
329
    public string tag_photos_label(string name, int count) {
Lucas Beeler's avatar
Lucas Beeler committed
330
        return ((count == 1) ? _("Tag Photo as \"%s\"") : _("Tag Photos as \"%s\"")).printf(name);
331
    }
Jim Nelson's avatar
Jim Nelson committed
332
    
333
    public string tag_photos_tooltip(string name, int count) {
Lucas Beeler's avatar
Lucas Beeler committed
334 335
        return ((count == 1) ? _("Tag the selected photo as \"%s\"") :
            _("Tag the selected photos as \"%s\"")).printf(name);
336 337
    }
    
338
    public string untag_photos_menu(string name, int count) {
Lucas Beeler's avatar
Lucas Beeler committed
339 340
        return ((count == 1) ? _("Remove Tag \"%s\" From _Photo") :
            _("Remove Tag \"%s\" From _Photos")).printf(name);
341 342 343
    }
    
    public string untag_photos_label(string name, int count) {
Lucas Beeler's avatar
Lucas Beeler committed
344 345
        return ((count == 1) ? _("Remove Tag \"%s\" From Photo") :
            _("Remove Tag \"%s\" From Photos")).printf(name);
346 347
    }
    
348 349 350 351
    public static string rename_tag_exists_message(string name) {
        return _("Unable to rename tag to \"%s\" because the tag already exists.").printf(name);
    }
    
Eric Gregory's avatar
Eric Gregory committed
352 353 354 355
    public static string rename_search_exists_message(string name) {
        return _("Unable to rename search to \"%s\" because the search already exists.").printf(name);
    }
    
356
    public const string DEFAULT_SAVED_SEARCH_NAME = _("Saved Search");
357
    
358
    public const string DELETE_SAVED_SEARCH_DIALOG_TITLE = _("Delete Search");
Eric Gregory's avatar
Eric Gregory committed
359
    
360 361 362
    public const string DELETE_SEARCH_MENU = _("_Delete");
    public const string EDIT_SEARCH_MENU = _("_Edit...");
    public const string RENAME_SEARCH_MENU = _("Re_name...");
Eric Gregory's avatar
Eric Gregory committed
363 364 365 366
    
    public string rename_search_label(string old_name, string new_name) {
        return _("Rename Search \"%s\" to \"%s\"").printf(old_name, new_name);
    }
367 368 369 370
    
    public string delete_search_label(string name) {
        return _("Delete Search \"%s\"").printf(name);
    }
Eric Gregory's avatar
Eric Gregory committed
371
    
372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401
    public static string rename_face_exists_message(string name) {
        return _("Unable to rename face to \"%s\" because the face already exists.").printf(name);
    }
    
    public string remove_face_from_photos_menu(string name, int count) {
        return ((count == 1) ? _("Remove Face \"%s\" From _Photo") :
            _("Remove Face \"%s\" From _Photos")).printf(name);
    }
    
    public string remove_face_from_photos_label(string name, int count) {
        return ((count == 1) ? _("Remove Face \"%s\" From Photo") :
            _("Remove Face \"%s\" From Photos")).printf(name);
    }
    
    public string rename_face_menu(string name) {
        return _("Re_name Face \"%s\"...").printf(name);
    }
    
    public string rename_face_label(string old_name, string new_name) {
        return _("Rename Face \"%s\" to \"%s\"").printf(old_name, new_name);
    }
    
    public string delete_face_menu(string name) {
        return _("_Delete Face \"%s\"").printf(name);
    }
    
    public string delete_face_label(string name) {
        return _("Delete Face \"%s\"").printf(name);
    }
    
402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443
    private unowned string rating_menu(Rating rating) {
        switch (rating) {
            case Rating.REJECTED:
                return RATE_REJECTED_MENU;
            case Rating.UNRATED:
                return RATE_UNRATED_MENU;
            case Rating.ONE:
                return RATE_ONE_MENU;
            case Rating.TWO:
                return RATE_TWO_MENU;
            case Rating.THREE:
                return RATE_THREE_MENU;
            case Rating.FOUR:
                return RATE_FOUR_MENU;
            case Rating.FIVE:
                return RATE_FIVE_MENU;
            default:
                return RATE_UNRATED_MENU;
        }
    }

    private unowned string rating_label(Rating rating) {
        switch (rating) {
            case Rating.REJECTED:
                return RATE_REJECTED_LABEL;
            case Rating.UNRATED:
                return RATE_UNRATED_LABEL;
            case Rating.ONE:
                return RATE_ONE_LABEL;
            case Rating.TWO:
                return RATE_TWO_LABEL;
            case Rating.THREE:
                return RATE_THREE_LABEL;
            case Rating.FOUR:
                return RATE_FOUR_LABEL;
            case Rating.FIVE:
                return RATE_FIVE_LABEL;
            default:
                return RATE_UNRATED_LABEL;
        }
    }
    
444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464
    private unowned string rating_combo_box(Rating rating) {
        switch (rating) {
            case Rating.REJECTED:
                return RATE_REJECTED_COMBO_BOX;
            case Rating.UNRATED:
                return RATE_UNRATED_COMBO_BOX;
            case Rating.ONE:
                return RATE_ONE_MENU;
            case Rating.TWO:
                return RATE_TWO_MENU;
            case Rating.THREE:
                return RATE_THREE_MENU;
            case Rating.FOUR:
                return RATE_FOUR_MENU;
            case Rating.FIVE:
                return RATE_FIVE_MENU;
            default:
                return RATE_UNRATED_MENU;
        }
    }
    
465 466 467 468
    private string get_rating_filter_tooltip(RatingFilter filter) {
        switch (filter) {
            case RatingFilter.REJECTED_OR_HIGHER:
                return Resources.DISPLAY_REJECTED_OR_HIGHER_TOOLTIP;
469
            
470 471
            case RatingFilter.ONE_OR_HIGHER:
                return Resources.DISPLAY_ONE_OR_HIGHER_TOOLTIP;
472
            
473 474
            case RatingFilter.TWO_OR_HIGHER:
                return Resources.DISPLAY_TWO_OR_HIGHER_TOOLTIP;
475
            
476 477
            case RatingFilter.THREE_OR_HIGHER:
                return Resources.DISPLAY_THREE_OR_HIGHER_TOOLTIP;
478
            
479 480
            case RatingFilter.FOUR_OR_HIGHER:
                return Resources.DISPLAY_FOUR_OR_HIGHER_TOOLTIP;
481
            
482 483 484
            case RatingFilter.FIVE_ONLY:
            case RatingFilter.FIVE_OR_HIGHER:
                return Resources.DISPLAY_FIVE_OR_HIGHER_TOOLTIP;
485 486 487 488
            
            case RatingFilter.REJECTED_ONLY:
                return Resources.DISPLAY_REJECTED_ONLY_TOOLTIP;
            
489 490 491 492 493 494
            case RatingFilter.UNRATED_OR_HIGHER:
            default:
                return Resources.DISPLAY_UNRATED_OR_HIGHER_TOOLTIP;
        }
    }

495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536
    private string rating_progress(Rating rating) {
        switch (rating) {
            case Rating.REJECTED:
                return RATE_REJECTED_PROGRESS;
            case Rating.UNRATED:
                return RATE_UNRATED_PROGRESS;
            case Rating.ONE:
                return RATE_ONE_PROGRESS;
            case Rating.TWO:
                return RATE_TWO_PROGRESS;
            case Rating.THREE:
                return RATE_THREE_PROGRESS;
            case Rating.FOUR:
                return RATE_FOUR_PROGRESS;
            case Rating.FIVE:
                return RATE_FIVE_PROGRESS;
            default:
                return RATE_UNRATED_PROGRESS;
        }
    }

    // TODO: remove unicode stars from the code, replace with HTML escape
    private string get_stars(Rating rating) {
        switch (rating) {
            case Rating.ONE:
                return "★";
            case Rating.TWO:
                return "★★";
            case Rating.THREE:
                return "★★★";
            case Rating.FOUR:
                return "★★★★";
            case Rating.FIVE:
                return "★★★★★";
            default:
                return "";
        }
    }

    private Gdk.Pixbuf? get_rating_trinket(Rating rating, int scale) {
        switch (rating) {
            case Rating.REJECTED:
537
                return Resources.get_icon(Resources.ICON_RATING_REJECTED, scale);
538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558
            // case Rating.UNRATED needs no icon
            case Rating.ONE:
                return Resources.get_icon(Resources.ICON_RATING_ONE, scale);
            case Rating.TWO:
                return Resources.get_icon(Resources.ICON_RATING_TWO, scale*2);
            case Rating.THREE:
                return Resources.get_icon(Resources.ICON_RATING_THREE, scale*3);
            case Rating.FOUR:
                return Resources.get_icon(Resources.ICON_RATING_FOUR, scale*4);
            case Rating.FIVE:
                return Resources.get_icon(Resources.ICON_RATING_FIVE, scale*5);
            default:
                return null;
        }
    }
    
    private void generate_rating_strings() {
        string menu_base = "%s";
        string label_base = _("Rate %s");
        string tooltip_base = _("Set rating to %s");
        string progress_base = _("Setting rating to %s");
559 560 561
        string display_rating_menu_base = "%s";
        string display_rating_label_base = _("Display %s");
        string display_rating_tooltip_base = _("Only show photos with a rating of %s");
562 563 564
        string display_rating_or_higher_menu_base = _("%s or Better");
        string display_rating_or_higher_label_base = _("Display %s or Better");
        string display_rating_or_higher_tooltip_base = _("Only show photos with a rating of %s or better");
565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588

        RATE_ONE_MENU = menu_base.printf(get_stars(Rating.ONE));
        RATE_TWO_MENU = menu_base.printf(get_stars(Rating.TWO));
        RATE_THREE_MENU = menu_base.printf(get_stars(Rating.THREE));
        RATE_FOUR_MENU = menu_base.printf(get_stars(Rating.FOUR));
        RATE_FIVE_MENU = menu_base.printf(get_stars(Rating.FIVE));

        RATE_ONE_LABEL = label_base.printf(get_stars(Rating.ONE));
        RATE_TWO_LABEL = label_base.printf(get_stars(Rating.TWO));
        RATE_THREE_LABEL = label_base.printf(get_stars(Rating.THREE));
        RATE_FOUR_LABEL = label_base.printf(get_stars(Rating.FOUR));
        RATE_FIVE_LABEL = label_base.printf(get_stars(Rating.FIVE));

        RATE_ONE_TOOLTIP = tooltip_base.printf(get_stars(Rating.ONE));
        RATE_TWO_TOOLTIP = tooltip_base.printf(get_stars(Rating.TWO));
        RATE_THREE_TOOLTIP = tooltip_base.printf(get_stars(Rating.THREE));
        RATE_FOUR_TOOLTIP = tooltip_base.printf(get_stars(Rating.FOUR));
        RATE_FIVE_TOOLTIP = tooltip_base.printf(get_stars(Rating.FIVE));

        RATE_ONE_PROGRESS = progress_base.printf(get_stars(Rating.ONE));
        RATE_TWO_PROGRESS = progress_base.printf(get_stars(Rating.TWO));
        RATE_THREE_PROGRESS = progress_base.printf(get_stars(Rating.THREE));
        RATE_FOUR_PROGRESS = progress_base.printf(get_stars(Rating.FOUR));
        RATE_FIVE_PROGRESS = progress_base.printf(get_stars(Rating.FIVE));
589 590 591 592 593

        DISPLAY_ONE_OR_HIGHER_MENU = display_rating_or_higher_menu_base.printf(get_stars(Rating.ONE));
        DISPLAY_TWO_OR_HIGHER_MENU = display_rating_or_higher_menu_base.printf(get_stars(Rating.TWO));
        DISPLAY_THREE_OR_HIGHER_MENU = display_rating_or_higher_menu_base.printf(get_stars(Rating.THREE));
        DISPLAY_FOUR_OR_HIGHER_MENU = display_rating_or_higher_menu_base.printf(get_stars(Rating.FOUR));
594
        DISPLAY_FIVE_OR_HIGHER_MENU = display_rating_menu_base.printf(get_stars(Rating.FIVE));
595 596 597 598 599

        DISPLAY_ONE_OR_HIGHER_LABEL = display_rating_or_higher_label_base.printf(get_stars(Rating.ONE));
        DISPLAY_TWO_OR_HIGHER_LABEL = display_rating_or_higher_label_base.printf(get_stars(Rating.TWO));
        DISPLAY_THREE_OR_HIGHER_LABEL = display_rating_or_higher_label_base.printf(get_stars(Rating.THREE));
        DISPLAY_FOUR_OR_HIGHER_LABEL = display_rating_or_higher_label_base.printf(get_stars(Rating.FOUR));
600
        DISPLAY_FIVE_OR_HIGHER_LABEL = display_rating_label_base.printf(get_stars(Rating.FIVE));
601 602 603 604 605

        DISPLAY_ONE_OR_HIGHER_TOOLTIP = display_rating_or_higher_tooltip_base.printf(get_stars(Rating.ONE));
        DISPLAY_TWO_OR_HIGHER_TOOLTIP = display_rating_or_higher_tooltip_base.printf(get_stars(Rating.TWO));
        DISPLAY_THREE_OR_HIGHER_TOOLTIP = display_rating_or_higher_tooltip_base.printf(get_stars(Rating.THREE));
        DISPLAY_FOUR_OR_HIGHER_TOOLTIP = display_rating_or_higher_tooltip_base.printf(get_stars(Rating.FOUR));
606
        DISPLAY_FIVE_OR_HIGHER_TOOLTIP = display_rating_tooltip_base.printf(get_stars(Rating.FIVE));
607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633
    }

    private string RATE_ONE_MENU;
    private string RATE_ONE_LABEL;
    private string RATE_ONE_TOOLTIP;
    private string RATE_ONE_PROGRESS;
    
    private string RATE_TWO_MENU;
    private string RATE_TWO_LABEL;
    private string RATE_TWO_TOOLTIP;
    private string RATE_TWO_PROGRESS;

    private string RATE_THREE_MENU;
    private string RATE_THREE_LABEL;
    private string RATE_THREE_TOOLTIP;
    private string RATE_THREE_PROGRESS;

    private string RATE_FOUR_MENU;
    private string RATE_FOUR_LABEL;
    private string RATE_FOUR_TOOLTIP;
    private string RATE_FOUR_PROGRESS;

    private string RATE_FIVE_MENU;
    private string RATE_FIVE_LABEL;
    private string RATE_FIVE_TOOLTIP;
    private string RATE_FIVE_PROGRESS;

634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653
    private string DISPLAY_ONE_OR_HIGHER_MENU;
    private string DISPLAY_ONE_OR_HIGHER_LABEL;
    private string DISPLAY_ONE_OR_HIGHER_TOOLTIP;

    private string DISPLAY_TWO_OR_HIGHER_MENU;
    private string DISPLAY_TWO_OR_HIGHER_LABEL;
    private string DISPLAY_TWO_OR_HIGHER_TOOLTIP;

    private string DISPLAY_THREE_OR_HIGHER_MENU;
    private string DISPLAY_THREE_OR_HIGHER_LABEL;
    private string DISPLAY_THREE_OR_HIGHER_TOOLTIP;

    private string DISPLAY_FOUR_OR_HIGHER_MENU;
    private string DISPLAY_FOUR_OR_HIGHER_LABEL;
    private string DISPLAY_FOUR_OR_HIGHER_TOOLTIP;

    private string DISPLAY_FIVE_OR_HIGHER_MENU;
    private string DISPLAY_FIVE_OR_HIGHER_LABEL;
    private string DISPLAY_FIVE_OR_HIGHER_TOOLTIP;

654
    public const string DELETE_PHOTOS_MENU = _("_Delete");
655 656
    public const string DELETE_FROM_TRASH_TOOLTIP = _("Remove the selected photos from the trash");
    public const string DELETE_FROM_LIBRARY_TOOLTIP = _("Remove the selected photos from the library");
657
    
Jim Nelson's avatar
Jim Nelson committed
658 659 660
    public const string RESTORE_PHOTOS_MENU = _("_Restore");
    public const string RESTORE_PHOTOS_TOOLTIP = _("Move the selected photos back into the library");
    
661
    public const string JUMP_TO_FILE_MENU = _("Show in File Mana_ger");
662 663 664 665 666 667
    public const string JUMP_TO_FILE_TOOLTIP = _("Open the selected photo's directory in the file manager");
    
    public string jump_to_file_failed(Error err) {
        return _("Unable to open in file manager: %s").printf(err.message);
    }
    
668
    public const string REMOVE_FROM_LIBRARY_MENU = _("R_emove From Library");
669
    
670
    public const string MOVE_TO_TRASH_MENU = _("_Move to Trash");
671 672 673
    
    public const string SELECT_ALL_MENU = _("Select _All");
    public const string SELECT_ALL_TOOLTIP = _("Select all items");
674
    
675
    private Gtk.IconFactory factory = null;
676
    private Gee.HashMap<string, Gdk.Pixbuf> icon_cache = null;
Jim Nelson's avatar
Jim Nelson committed
677
    Gee.HashMap<string, Gdk.Pixbuf> scaled_icon_cache = null;
678 679
    
    public void init () {
680
        // load application-wide stock icons as IconSets
681
        factory = new Gtk.IconFactory();
682

683
        File icons_dir = AppDirs.get_resources_dir().get_child("icons");
684
        add_stock_icon(icons_dir.get_child("crop.svg"), CROP);
685
#if ENABLE_FACES
686
        add_stock_icon(icons_dir.get_child("faces-tool.png"), FACES_TOOL);
687
#endif
688
        add_stock_icon(icons_dir.get_child("redeye.png"), REDEYE);
689
        add_stock_icon(icons_dir.get_child("image-adjust.svg"), ADJUST);
690 691 692
        add_stock_icon(icons_dir.get_child("pin-toolbar.svg"), PIN_TOOLBAR);
        add_stock_icon(icons_dir.get_child("make-primary.svg"), MAKE_PRIMARY);
        add_stock_icon(icons_dir.get_child("import.svg"), IMPORT);
693
        add_stock_icon(icons_dir.get_child("import-all.png"), IMPORT_ALL);
694
        add_stock_icon(icons_dir.get_child("enhance.png"), ENHANCE);
695
        add_stock_icon(icons_dir.get_child("crop-pivot-reticle.png"), CROP_PIVOT_RETICLE);
696
        add_stock_icon(icons_dir.get_child("merge.svg"), MERGE);
697 698
        add_stock_icon(icons_dir.get_child("searchbox-find.svg"), SEARCHBOX_FIND);
        add_stock_icon(icons_dir.get_child("searchbox-clear.svg"), SEARCHBOX_CLEAR);
Jim Nelson's avatar
Jim Nelson committed
699 700 701 702
        add_stock_icon_from_themed_icon(new GLib.ThemedIcon(ICON_FLAGGED_PAGE), ICON_FLAGGED_PAGE);
        add_stock_icon_from_themed_icon(new GLib.ThemedIcon(ICON_VIDEOS_PAGE), ICON_VIDEOS_PAGE);
        add_stock_icon_from_themed_icon(new GLib.ThemedIcon(ICON_SINGLE_PHOTO), ICON_SINGLE_PHOTO);
        add_stock_icon_from_themed_icon(new GLib.ThemedIcon(ICON_CAMERAS), ICON_CAMERAS);
703
        
704 705 706 707 708 709 710 711 712
        add_stock_icon_from_themed_icon(new GLib.ThemedIcon(ICON_FILTER_FLAGGED), 
            ICON_FILTER_FLAGGED_DISABLED, dim_pixbuf);
        add_stock_icon_from_themed_icon(new GLib.ThemedIcon(ICON_FILTER_PHOTOS), 
            ICON_FILTER_PHOTOS_DISABLED, dim_pixbuf);
        add_stock_icon_from_themed_icon(new GLib.ThemedIcon(ICON_FILTER_VIDEOS), 
            ICON_FILTER_VIDEOS_DISABLED, dim_pixbuf);
        add_stock_icon_from_themed_icon(new GLib.ThemedIcon(ICON_FILTER_RAW), 
            ICON_FILTER_RAW_DISABLED, dim_pixbuf);
        
713
        factory.add_default();
714 715

        generate_rating_strings();
716 717 718 719
    }
    
    public void terminate() {
    }
720

721
    public File get_ui(string filename) {
722
        return AppDirs.get_resources_dir().get_child("ui").get_child(filename);
723
    }
724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739

    private const string NONINTERPRETABLE_BADGE_FILE = "noninterpretable-video.png";
    private Gdk.Pixbuf? noninterpretable_badge_pixbuf = null;

    public Gdk.Pixbuf? get_noninterpretable_badge_pixbuf() {
        if (noninterpretable_badge_pixbuf == null) {
            try {
                noninterpretable_badge_pixbuf = new Gdk.Pixbuf.from_file(AppDirs.get_resources_dir().get_child(
                    "icons").get_child(NONINTERPRETABLE_BADGE_FILE).get_path());
            } catch (Error err) {
                error("VideoReader can't load noninterpretable badge image: %s", err.message);
            }
        }
        
        return noninterpretable_badge_pixbuf;
    }
Jim Nelson's avatar
Jim Nelson committed
740
    
741 742 743 744 745 746 747
    public Gtk.IconTheme get_icon_theme_engine() {
        Gtk.IconTheme icon_theme = Gtk.IconTheme.get_default();
        icon_theme.append_search_path(AppDirs.get_resources_dir().get_child("icons").get_path());
        
        return icon_theme;
    }
    
748 749
    // This method returns a reference to a cached pixbuf that may be shared throughout the system.
    // If the pixbuf is to be modified, make a copy of it.
750
    public Gdk.Pixbuf? get_icon(string name, int scale = DEFAULT_ICON_SCALE) {
Jim Nelson's avatar
Jim Nelson committed
751 752 753 754 755 756
        if (scaled_icon_cache != null) {
            string scaled_name = "%s-%d".printf(name, scale);
            if (scaled_icon_cache.has_key(scaled_name))
                return scaled_icon_cache.get(scaled_name);
        }
        
757 758 759 760 761 762 763 764 765 766 767 768 769 770 771
        // stash icons not available through the UI Manager (i.e. used directly as pixbufs)
        // in the local cache
        if (icon_cache == null)
            icon_cache = new Gee.HashMap<string, Gdk.Pixbuf>();
        
        // fetch from cache and if not present, from disk
        Gdk.Pixbuf? pixbuf = icon_cache.get(name);
        if (pixbuf == null) {
            pixbuf = load_icon(name, 0);
            if (pixbuf == null)
                return null;
            
            icon_cache.set(name, pixbuf);
        }
        
772
        if (scale <= 0)
Jim Nelson's avatar
Jim Nelson committed
773 774 775 776 777 778 779 780 781 782
            return pixbuf;
        
        Gdk.Pixbuf scaled_pixbuf = scale_pixbuf(pixbuf, scale, Gdk.InterpType.BILINEAR, false);
        
        if (scaled_icon_cache == null)
            scaled_icon_cache = new Gee.HashMap<string, Gdk.Pixbuf>();
        
        scaled_icon_cache.set("%s-%d".printf(name, scale), scaled_pixbuf);
        
        return scaled_pixbuf;
783 784 785
    }
    
    public Gdk.Pixbuf? load_icon(string name, int scale = DEFAULT_ICON_SCALE) {
786
        File icons_dir = AppDirs.get_resources_dir().get_child("icons");
787 788 789 790 791 792 793 794 795 796 797
        
        Gdk.Pixbuf pixbuf = null;
        try {
            pixbuf = new Gdk.Pixbuf.from_file(icons_dir.get_child(name).get_path());
        } catch (Error err) {
            critical("Unable to load icon %s: %s", name, err.message);
        }

        if (pixbuf == null)
            return null;
        
798
        return (scale > 0) ? scale_pixbuf(pixbuf, scale, Gdk.InterpType.BILINEAR, false) : pixbuf;
799 800
    }
    
801 802 803 804 805 806 807 808 809 810 811
    private void add_stock_icon(File file, string stock_id) {
        Gdk.Pixbuf pixbuf = null;
        try {
            pixbuf = new Gdk.Pixbuf.from_file(file.get_path());
        } catch (Error err) {
            error("%s", err.message);
        }
        
        Gtk.IconSet icon_set = new Gtk.IconSet.from_pixbuf(pixbuf);
        factory.add(stock_id, icon_set);
    }
Jim Nelson's avatar
Jim Nelson committed
812
    
813 814 815 816
    public delegate void AddStockIconModify(Gdk.Pixbuf pixbuf);
    
    private void add_stock_icon_from_themed_icon(GLib.ThemedIcon gicon, string stock_id, 
        AddStockIconModify? modify = null) {
Jim Nelson's avatar
Jim Nelson committed
817 818 819 820 821 822 823 824 825 826 827
        Gtk.IconTheme icon_theme = Gtk.IconTheme.get_default();
        icon_theme.append_search_path(AppDirs.get_resources_dir().get_child("icons").get_path());

        Gtk.IconInfo? info = icon_theme.lookup_by_gicon(gicon, 
            Resources.DEFAULT_ICON_SCALE, Gtk.IconLookupFlags.FORCE_SIZE);
        if (info == null) {
            debug("unable to load icon for: %s", stock_id);
            return;
        }
        
        try {
828 829 830 831 832
            Gdk.Pixbuf pix = info.load_icon();
            if (modify != null) {
                modify(pix);
            }
            Gtk.IconSet icon_set = new Gtk.IconSet.from_pixbuf(pix);
Jim Nelson's avatar
Jim Nelson committed
833 834 835 836 837
                factory.add(stock_id, icon_set);
        } catch (Error err) {
            debug("%s", err.message);
        }
    }
838

839 840 841 842 843
    // Get the directory where our help files live.  Returns a string
    // describing the help path we want, or, if we're installed system
    // -wide already, returns null.
    public static string? get_help_path() {
        // Try looking for our 'index.page' in the build directory.
844 845
        //
        // TODO: Need to look for internationalized help before falling back on help/C
846
        
847
        File help_dir = AppDirs.get_exec_dir().get_child("help").get_child("C");
848
        File help_index = help_dir.get_child("index.page");
849
        
850
        if (help_index.query_exists(null)) {
851 852 853 854
            string help_path;

            help_path = help_dir.get_path();
         
855 856 857
            if (!help_path.has_suffix("/"))
                help_path += "/";
            
858 859 860 861 862 863 864 865 866 867
            // Found it.
            return help_path;
        }
        
        // "./help/C/index.page" doesn't exist, so we're installed  
        // system-wide, and the caller should assume the default 
        // help location. 
        return null;
    }

868
    public static void launch_help(Gdk.Screen screen, string? anchor=null) throws Error {
869 870 871 872
        string? help_path = get_help_path();
        
        if(help_path != null) {
            // We're running from the build directory; use local help.
873 874 875 876 877
            
            // Allow the caller to request a specific page.
            if (anchor != null) {
                help_path +=anchor;
            }
Jim Nelson's avatar
Jim Nelson committed
878
            
879 880 881
            string[] argv = new string[2];
            argv[0] = "gnome-help";
            argv[1] = help_path;
Jim Nelson's avatar
Jim Nelson committed
882
            argv[2] = null;
883 884
            
            Pid pid;
Jim Nelson's avatar
Jim Nelson committed
885
            if (Process.spawn_async(AppDirs.get_exec_dir().get_path(), argv, null,
886 887 888 889 890 891 892 893
                SpawnFlags.SEARCH_PATH | SpawnFlags.STDERR_TO_DEV_NULL, null, out pid)) {
                return;
            }
            
            warning("Unable to launch %s", argv[0]);
        }
        
        // launch from system-installed help
894 895 896 897 898
        if (anchor != null) {
            sys_show_uri(screen, "ghelp:shotwell" + anchor);
        } else {
            sys_show_uri(screen, "ghelp:shotwell");
        }
899
    }
900
    
901 902 903 904 905 906 907 908
    public string to_css_color(Gdk.Color color) {
        int r = (int) ((((double) color.red) / uint16.MAX) * 255);
        int g = (int) ((((double) color.green) / uint16.MAX) * 255);
        int b = (int) ((((double) color.blue) / uint16.MAX) * 255);
        
        return "rgb(%d, %d, %d)".printf(r, g, b);
    }
    
909 910
    public const int ALL_DATA = -1;
    
911 912
    private static Gee.Map<Gtk.Widget, Gtk.CssProvider> providers = null;
    
913
    public static void style_widget(Gtk.Widget widget, string stylesheet) {
914 915 916 917 918 919
        if (providers == null)
            providers = new Gee.HashMap<Gtk.Widget, Gtk.CssProvider>();

        if (providers.has_key(widget))
            widget.get_style_context().remove_provider(providers.get(widget));

920 921 922 923 924 925 926 927 928 929 930 931 932 933
        Gtk.CssProvider styler = new Gtk.CssProvider();
        
        try {
            styler.load_from_data(stylesheet, ALL_DATA);
        } catch (Error e) {
            warning("couldn't parse widget stylesheet '%s': %s", stylesheet,
                e.message);
            // short-circuit return -- if the stylesheet couldn't be interpreted
            // then we can't do anything more
            return;
        }
        
        widget.get_style_context().add_provider(styler,
            Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION);
934 935

        providers.set(widget, styler);
936 937 938
    }
    
    public const string INSET_FRAME_STYLESHEET =
939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972
        """ .frame {
               border-style: inset;
               border-width: 1;
           }""";
           
    public const string SCROLL_FRAME_STYLESHEET =
        """ GtkScrolledWindow {
               border-width: 0;
               border-style: none;
               border-radius: 0;
               padding: 0;
           }
           
            .frame {
                border-width: 1;
                border-style: inset;
            }""";

    public const string PAGE_STYLESHEET =
        """ .frame {
               border-width: 1;
               border-style: inset;
               border-radius: 0;
               
               padding: 0;
           }""";
    
    public const string VIEWPORT_STYLESHEET =
        """ GtkViewport {
               border-width: 1;
               border-style: inset;
               border-radius: 0;
               padding: 0;
           }""";
973 974

    public const string TOOLBAR_STYLESHEET_TEMPLATE =
975 976 977 978 979
        """
             @define-color primary-bg %s;
             
            .toolbar {
                background-color: @primary-bg;
980
                border-width: 1;
981
                border-color: shade (@primary-bg, 0.75);
982 983
                border-style: solid;
            }""";
984 985 986 987 988 989 990 991

    public const string SEARCH_BUTTON_STYLESHEET_TEMPLATE =
        """ 
             @define-color primary-bg %s;
             
            .button {
                background-image: none;
                background-color: @primary-bg;
992
                border-image: none;
993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025
                border-style: none;
                margin: 5;
                
                -unico-border-gradient: none;
                -unico-outer-stroke-width: 0;
                -unico-outer-stroke-gradient: none;
                -unico-glow-radius: 0;
                -unico-inner-stroke-width: 0;
                -unico-inner-stroke-color: shade (@primary-bg, 1.1);
            }
            
            .button:prelight {
                border-style: solid;
                border-width: 1;
                border-color: shade (@primary-bg, 1.1);
                
                -unico-inner-stroke-color: shade (@primary-bg, 1.1);
                -unico-inner-stroke-width: 0;

                -unico-outer-stroke-width: 1;
                -unico-outer-stroke-color: shade (@primary-bg, 0.8);
            }
            
            .button:active {
                background-image: none;
                background-color: shade (@primary-bg, 0.75);
                border-style: solid;
                border-width: 1;
                border-color: shade (@primary-bg, 0.6);
                
                -unico-outer-stroke-width: 1;
                -unico-outer-stroke-color: shade (@primary-bg, 1.1);
            }""";
1026 1027
}