#!/usr/bin/perl -pi # # $Id$ # # This is not an automatic gtk+-1.x to gtk+-2.x port tool, # just a tool that ease perl apps' gtk2 port. # you'll have to fix all remaining problems, beginning by spotted warnings # it'll save you basic conversion work # # if you used Gtk::Text, a little more work will be needed (look at logdrake gtk2 port) # if you used Gtk::CTree, Gtk::CList or worse, Gtk::Tree, you'll need quite a lot of exhausting work :-( # # usage: porting-ugtk <file> # # hint: always use strict # switch to gtk2 : s!Gtk:!Gtk2:!g; /(use|require) Gtk/ and print STDERR "Warning: if this (bad) app that did not use my_gtk, you'll have a hard time :-)\n if not, using both Gtk && my_gtk was misdesigned ...\n"; s!(use|require) Gtk.*!!g; # s!my_gtk!ugtk2!g; # one should pass the right ":stuff" to "use ugtk2 qw();" /ugtk::/ and print STDERR "Warning: you'll have to passe eiter :ask, :create, :helpers or :wrappers to ugtk\n"; s!ugtk::!!g; # if my_gtk wasn't used, this'll be spotted by the lack of "use ugtk2;" anyway s!(require|use) ugtk.*!!g; # deprecated : /::(CTree|CList|Text[^V])/ and print STDERR "Warning: CTree, CList and Text widgets are deprecated... Good luck :-(\n"; /gtkcreate_(png|xpm)/ and print STDERR "Warning: new Gtk::Pixmap(gtkcreate_(png|xpm)) should be replaced by gtkcreate_img\n"; /set_policy/ and print STDERR "Warning: ->set_policy() should be replaced by allow_shrink/allow_grow/set_resizable\n"; # obsoletes methods||functions : s!set_usize!set_size_request!g; s!gtkset_set_border_width!gtkset_border_width!g; s!border_width!set_border_width!g; s!-(end|spread|extended|start|single)!'\1'!g; s!createScrolledWindow!create_scrolled_window!g; # quite a lot less usefull with gtk+2 but who knows... : s!set_position\(1\)!set_position('center')!g; s!gtkpng!gtkcreate_img!g; # hacky but usefull in ->set_pixmap() context; else that'll be spoted at run time : s!gtkcreate_png!gtkcreate_img!g; # usefull sometimes but not in most cases : #s!new GtkVBox!create_vbox!g; #s!new GtkHBox!create_hbox!g; 'search' size='10' name='q' value=''/> <input type='submit' value='search'/> </form> </td></tr></table> <div class='path'>path: <a href='/qa/qarepo/commit/?id=51f5991e35c8d5e384c6b642042132b7a2238d07'>root</a>/<a href='/qa/qarepo/commit/po?id=51f5991e35c8d5e384c6b642042132b7a2238d07'>po</a>/<a href='/qa/qarepo/commit/po/POTFILES.in?id=51f5991e35c8d5e384c6b642042132b7a2238d07'>POTFILES.in</a></div><div class='content'><div class='cgit-panel'><b>diff options</b><form method='get'><input type='hidden' name='id' value='51f5991e35c8d5e384c6b642042132b7a2238d07'/><table><tr><td colspan='2'/></tr><tr><td class='label'>context:</td><td class='ctrl'><select name='context' onchange='this.form.submit();'><option value='1'>1</option><option value='2'>2</option><option value='3' selected='selected'>3</option><option value='4'>4</option><option value='5'>5</option><option value='6'>6</option><option value='7'>7</option><option value='8'>8</option><option value='9'>9</option><option value='10'>10</option><option value='15'>15</option><option value='20'>20</option><option value='25'>25</option><option value='30'>30</option><option value='35'>35</option><option value='40'>40</option></select></td></tr><tr><td class='label'>space:</td><td class='ctrl'><select name='ignorews' onchange='this.form.submit();'><option value='0' selected='selected'>include</option><option value='1'>ignore</option></select></td></tr><tr><td class='label'>mode:</td><td class='ctrl'><select name='dt' onchange='this.form.submit();'><option value='0' selected='selected'>unified</option><option value='1'>ssdiff</option><option value='2'>stat only</option></select></td></tr><tr><td/><td class='ctrl'><noscript><input type='submit' value='reload'/></noscript></td></tr></table></form></div><table summary='commit info' class='commit-info'> <tr><th>author</th><td>Martin Whitaker <mageia@martin-whitaker.me.uk></td><td class='right'>2024-01-21 17:21:05 +0000</td></tr> <tr><th>committer</th><td>Martin Whitaker <mageia@martin-whitaker.me.uk></td><td class='right'>2024-01-21 19:50:43 +0000</td></tr> <tr><th>commit</th><td colspan='2' class='sha1'><a href='/qa/qarepo/commit/po/POTFILES.in?id=51f5991e35c8d5e384c6b642042132b7a2238d07'>51f5991e35c8d5e384c6b642042132b7a2238d07</a> (<a href='/qa/qarepo/patch/po/POTFILES.in?id=51f5991e35c8d5e384c6b642042132b7a2238d07'>patch</a>)</td></tr> <tr><th>tree</th><td colspan='2' class='sha1'><a href='/qa/qarepo/tree/?id=51f5991e35c8d5e384c6b642042132b7a2238d07'>7f1a059d9faef3bc154d0cdde8def34d0b2cbb2c</a> /<a href='/qa/qarepo/tree/po/POTFILES.in?id=51f5991e35c8d5e384c6b642042132b7a2238d07'>po/POTFILES.in</a></td></tr> <tr><th>parent</th><td colspan='2' class='sha1'><a href='/qa/qarepo/commit/po/POTFILES.in?id=238402069f07fc90d274b291fa8df967ae74c620'>238402069f07fc90d274b291fa8df967ae74c620</a> (<a href='/qa/qarepo/diff/po/POTFILES.in?id=51f5991e35c8d5e384c6b642042132b7a2238d07&id2=238402069f07fc90d274b291fa8df967ae74c620'>diff</a>)</td></tr><tr><th>download</th><td colspan='2' class='sha1'><a href='/qa/qarepo/snapshot/qarepo-51f5991e35c8d5e384c6b642042132b7a2238d07.tar'>qarepo-51f5991e35c8d5e384c6b642042132b7a2238d07.tar</a><br/><a href='/qa/qarepo/snapshot/qarepo-51f5991e35c8d5e384c6b642042132b7a2238d07.tar.gz'>qarepo-51f5991e35c8d5e384c6b642042132b7a2238d07.tar.gz</a><br/><a href='/qa/qarepo/snapshot/qarepo-51f5991e35c8d5e384c6b642042132b7a2238d07.tar.bz2'>qarepo-51f5991e35c8d5e384c6b642042132b7a2238d07.tar.bz2</a><br/><a href='/qa/qarepo/snapshot/qarepo-51f5991e35c8d5e384c6b642042132b7a2238d07.tar.xz'>qarepo-51f5991e35c8d5e384c6b642042132b7a2238d07.tar.xz</a><br/><a href='/qa/qarepo/snapshot/qarepo-51f5991e35c8d5e384c6b642042132b7a2238d07.zip'>qarepo-51f5991e35c8d5e384c6b642042132b7a2238d07.zip</a><br/></td></tr></table> <div class='commit-subject'>Convert UTF-8 strings returned by gettext to native Perl strings.</div><div class='commit-msg'>