stock items libglade-convert



this patch fixes up a bunch of stock icons.  i don't know python, but
this seems to work alright.  there could very well be a nicer way of
doing this...

ok to commit?

jacob
-- 
Index: libglade-convert
===================================================================
RCS file: /cvs/gnome/libglade/libglade-convert,v
retrieving revision 1.20
diff -u -r1.20 libglade-convert
--- libglade-convert	2001/10/20 16:44:32	1.20
+++ libglade-convert	2001/10/21 01:36:13
@@ -13,6 +13,71 @@
     'preview_text', 'tooltip'
 ]
 
+stock_pixmaps = {
+    'REVERT':      'gtk-revert-to-saved',
+    'SCORES':      'gnome-stock-scores',
+    'SEARCH':      'gtk-find',
+    'SEARCHRPL':   'gtk-find-and-replace',
+    'BACK':        'gtk-go-back',
+    'FORWARD':     'gtk-go-forward',
+    'FIRST':       'gtk-goto-first',
+    'LAST':        'gtk-goto-last',
+    'TIMER':       'gnome-stock-timer',
+    'TIMER_STOP':  'gnome-stock-timer-stop',
+    'MAIL':        'gnome-stock-mail',
+    'MAIL_RCV':    'gnome-stock-mail-rcv',
+    'MAIL_SND':    'gnome-stock-mail-send',
+    'MAIL_RPL':    'gnome-stock-mail-rply',
+    'MAIL_FWD':    'gnome-stock-mail-fwd',
+    'MAIL_NEW':    'gnome-stock-mail-new',
+    'TRASH':       'gnome-stock-trash',
+    'TRASH_FULL':  'gnome-stock-trash-full',
+    'SPELLCHECK':  'gtk-spell-check',
+    'MIC':         'gnome-stock-mic',
+    'LINE_IN':     'gnome-stock-line-in',
+    'VOLUME':      'gnome-stock-volume',
+    'MIDI':        'gnome-stock-midi',
+    'BOOK_RED':    'gnome-stock-book-red',
+    'BOOK_GREEN':  'gnome-stock-book-green',
+    'BOOK_BLUE':   'gnome-stock-book-blue',
+    'BOOK_YELLOW': 'gnome-stock-book-yellow',
+    'BOOK_OPEN':   'gnome-stock-book-open',
+    'ABOUT':       'gnome-stock-about',
+    'MULTIPLE':    'gnome-stock-multiple-file',
+    'NOT':         'gnome-stock-not',
+    'UP':          'gtk-go-up',
+    'DOWN':        'gtk-go-down',
+    'TOP':         'gtk-goto-top',
+    'BOTTOM':      'gtk-goto-bottom',
+    'ATTACH':      'gnome-stock-attach',
+    'FONT':        'gtk-select-font',
+    'EXEC':        'gtk-execute',
+
+    'ALIGN_LEFT':    'gtk-justify-left',
+    'ALIGN_RIGHT':   'gtk-justify-right',
+    'ALIGN_CENTER':  'gtk-justify-center',
+    'ALIGN_JUSTIFY': 'gtk-justify-fill',
+
+    'TEXT_BOLD':      'gtk-bold',
+    'TEXT_ITALIC':    'gtk-italic',
+    'TEXT_UNDERLINE': 'gtk-underline',
+    'TEXT_STRIKEOUT': 'gtk-strikethrough',
+
+    'TEXT_INDENT':    'gnome-stock-text-indent',
+    'TEXT_UNINDENT':  'gnome-stock-text-unindent',
+    'EXIT':           'gtk-quit',
+    'COLORSELECTOR':  'gtk-select-color',
+
+    'TABLE_BORDERS':  'gnome-stock-table-borders',
+    'TABLE_FILL':     'gnome-stock-table-fill',
+
+    'TEXT_BULLETED_LIST': 'gnome-stock-text-bulleted-list',
+    'TEXT_NUMBERED_LIST': 'gnome-stock-text-numbered-list',
+
+    'NEXT': 'gtk-go-forward',
+    'PREV': 'gtk-go-back'
+    }
+
 # --- Code to represent a widget in memory, and dump it to stdout ---
 
 class WidgetDef:
@@ -386,15 +451,23 @@
 
 def stock_icon_translate(old_name):
     if re.match ('GNOME_STOCK_MENU_.*', old_name):
-        name = re.sub('GNOME_STOCK_MENU_', 'gtk-', old_name)
-        return name.lower ()
+        name = re.sub('GNOME_STOCK_MENU_', '', old_name, 1)
+        try:
+            return stock_pixmaps[name]
+        except KeyError:
+            name = re.sub('_', '-', name)
+            return 'gtk-' + name.lowere ()
     else:
         return old_name
 
 def stock_button_translate(old_name):
     if re.match ('GNOME_STOCK_BUTTON_.*', old_name):
-        name = re.sub('GNOME_STOCK_BUTTON_', 'gtk-', old_name)
-        return name.lower ()
+        name = re.sub('GNOME_STOCK_BUTTON_', '', old_name)
+        try:
+            return stock_pixmaps[name]
+        except KeyError:
+            name = re.sub('_', '-', name)
+            return 'gtk-' + name.lower ()
     else:
         return old_name
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]