diff --git a/AUTHORS b/AUTHORS index aa8961344..a65e73df6 100644 --- a/AUTHORS +++ b/AUTHORS @@ -36,9 +36,9 @@ Images Authors: url: http://www.oxygen-icons.org * files: src/Icons/flags/*.png - copyright: Open Clip Art Library - license: Creative Commons Public Domain Dedication - url: http://www.openclipart.org + copyright: Mark James + license: Public Domain + url: http://www.famfamfam.com * files: src/Icons/skin/*.png files: src/menuicons/YYxYY/*.png diff --git a/Changelog b/Changelog index 53e3a1b56..be82864e2 100644 --- a/Changelog +++ b/Changelog @@ -11,8 +11,10 @@ - FEATURE: Major code refactoring and optimization - FEATURE: Added "Amount downloaded/left" columns to transfer list - FEATURE: Simplified proxy settings + - FEATURE: Optimized and improved the peer country resolution code - COSMETIC: Replaced message box by on-screen notification for download errors - COSMETIC: Improved the torrent creation tool appearance + - COSMETIC: Use country flags by Mark James (Thanks to Dmytro Pukha) - OTHERS: Dropped support for Qt <= 4.4 * Tue Aug 24 2010 - Christophe Dumez - v2.4.0 diff --git a/src/Icons/flags/ad.png b/src/Icons/flags/ad.png new file mode 100755 index 000000000..625ca84f9 Binary files /dev/null and b/src/Icons/flags/ad.png differ diff --git a/src/Icons/flags/ae.png b/src/Icons/flags/ae.png new file mode 100755 index 000000000..ef3a1ecfc Binary files /dev/null and b/src/Icons/flags/ae.png differ diff --git a/src/Icons/flags/af.png b/src/Icons/flags/af.png new file mode 100755 index 000000000..a4742e299 Binary files /dev/null and b/src/Icons/flags/af.png differ diff --git a/src/Icons/flags/ag.png b/src/Icons/flags/ag.png new file mode 100755 index 000000000..556d5504d Binary files /dev/null and b/src/Icons/flags/ag.png differ diff --git a/src/Icons/flags/ai.png b/src/Icons/flags/ai.png new file mode 100755 index 000000000..74ed29d92 Binary files /dev/null and b/src/Icons/flags/ai.png differ diff --git a/src/Icons/flags/al.png b/src/Icons/flags/al.png new file mode 100755 index 000000000..92354cb6e Binary files /dev/null and b/src/Icons/flags/al.png differ diff --git a/src/Icons/flags/algeria.png b/src/Icons/flags/algeria.png deleted file mode 100644 index 798ed119a..000000000 Binary files a/src/Icons/flags/algeria.png and /dev/null differ diff --git a/src/Icons/flags/am.png b/src/Icons/flags/am.png new file mode 100755 index 000000000..344a2a86c Binary files /dev/null and b/src/Icons/flags/am.png differ diff --git a/src/Icons/flags/an.png b/src/Icons/flags/an.png new file mode 100755 index 000000000..633e4b89f Binary files /dev/null and b/src/Icons/flags/an.png differ diff --git a/src/Icons/flags/ao.png b/src/Icons/flags/ao.png new file mode 100644 index 000000000..bcbd1d6d4 Binary files /dev/null and b/src/Icons/flags/ao.png differ diff --git a/src/Icons/flags/ar.png b/src/Icons/flags/ar.png new file mode 100755 index 000000000..e5ef8f1fc Binary files /dev/null and b/src/Icons/flags/ar.png differ diff --git a/src/Icons/flags/argentina.png b/src/Icons/flags/argentina.png deleted file mode 100644 index 65a769ccf..000000000 Binary files a/src/Icons/flags/argentina.png and /dev/null differ diff --git a/src/Icons/flags/as.png b/src/Icons/flags/as.png new file mode 100755 index 000000000..32f30e4ce Binary files /dev/null and b/src/Icons/flags/as.png differ diff --git a/src/Icons/flags/at.png b/src/Icons/flags/at.png new file mode 100755 index 000000000..0f15f34f2 Binary files /dev/null and b/src/Icons/flags/at.png differ diff --git a/src/Icons/flags/au.png b/src/Icons/flags/au.png new file mode 100755 index 000000000..a01389a74 Binary files /dev/null and b/src/Icons/flags/au.png differ diff --git a/src/Icons/flags/australia.png b/src/Icons/flags/australia.png deleted file mode 100644 index 033dd21bd..000000000 Binary files a/src/Icons/flags/australia.png and /dev/null differ diff --git a/src/Icons/flags/austria.png b/src/Icons/flags/austria.png deleted file mode 100644 index 3c5a6eafd..000000000 Binary files a/src/Icons/flags/austria.png and /dev/null differ diff --git a/src/Icons/flags/aw.png b/src/Icons/flags/aw.png new file mode 100755 index 000000000..a3579c2d6 Binary files /dev/null and b/src/Icons/flags/aw.png differ diff --git a/src/Icons/flags/ax.png b/src/Icons/flags/ax.png new file mode 100755 index 000000000..1eea80a7b Binary files /dev/null and b/src/Icons/flags/ax.png differ diff --git a/src/Icons/flags/az.png b/src/Icons/flags/az.png new file mode 100755 index 000000000..4ee9fe5ce Binary files /dev/null and b/src/Icons/flags/az.png differ diff --git a/src/Icons/flags/ba.png b/src/Icons/flags/ba.png new file mode 100755 index 000000000..c77499249 Binary files /dev/null and b/src/Icons/flags/ba.png differ diff --git a/src/Icons/flags/bb.png b/src/Icons/flags/bb.png new file mode 100755 index 000000000..0df19c71d Binary files /dev/null and b/src/Icons/flags/bb.png differ diff --git a/src/Icons/flags/bd.png b/src/Icons/flags/bd.png new file mode 100755 index 000000000..076a8bf87 Binary files /dev/null and b/src/Icons/flags/bd.png differ diff --git a/src/Icons/flags/be.png b/src/Icons/flags/be.png new file mode 100755 index 000000000..d86ebc800 Binary files /dev/null and b/src/Icons/flags/be.png differ diff --git a/src/Icons/flags/belarus.png b/src/Icons/flags/belarus.png deleted file mode 100644 index 6a1e63f7e..000000000 Binary files a/src/Icons/flags/belarus.png and /dev/null differ diff --git a/src/Icons/flags/belgium.png b/src/Icons/flags/belgium.png deleted file mode 100644 index 980d634b7..000000000 Binary files a/src/Icons/flags/belgium.png and /dev/null differ diff --git a/src/Icons/flags/bf.png b/src/Icons/flags/bf.png new file mode 100755 index 000000000..ab5ce8fe1 Binary files /dev/null and b/src/Icons/flags/bf.png differ diff --git a/src/Icons/flags/bg.png b/src/Icons/flags/bg.png new file mode 100755 index 000000000..0469f0607 Binary files /dev/null and b/src/Icons/flags/bg.png differ diff --git a/src/Icons/flags/bh.png b/src/Icons/flags/bh.png new file mode 100755 index 000000000..ea8ce6876 Binary files /dev/null and b/src/Icons/flags/bh.png differ diff --git a/src/Icons/flags/bi.png b/src/Icons/flags/bi.png new file mode 100755 index 000000000..5cc2e30cf Binary files /dev/null and b/src/Icons/flags/bi.png differ diff --git a/src/Icons/flags/bj.png b/src/Icons/flags/bj.png new file mode 100755 index 000000000..1cc8b458a Binary files /dev/null and b/src/Icons/flags/bj.png differ diff --git a/src/Icons/flags/bm.png b/src/Icons/flags/bm.png new file mode 100755 index 000000000..c0c7aead8 Binary files /dev/null and b/src/Icons/flags/bm.png differ diff --git a/src/Icons/flags/bn.png b/src/Icons/flags/bn.png new file mode 100755 index 000000000..8fb09849e Binary files /dev/null and b/src/Icons/flags/bn.png differ diff --git a/src/Icons/flags/bo.png b/src/Icons/flags/bo.png new file mode 100755 index 000000000..ce7ba522a Binary files /dev/null and b/src/Icons/flags/bo.png differ diff --git a/src/Icons/flags/bosnia.png b/src/Icons/flags/bosnia.png deleted file mode 100644 index da493ac44..000000000 Binary files a/src/Icons/flags/bosnia.png and /dev/null differ diff --git a/src/Icons/flags/br.png b/src/Icons/flags/br.png new file mode 100755 index 000000000..9b1a5538b Binary files /dev/null and b/src/Icons/flags/br.png differ diff --git a/src/Icons/flags/brazil.png b/src/Icons/flags/brazil.png deleted file mode 100644 index b2bb642bf..000000000 Binary files a/src/Icons/flags/brazil.png and /dev/null differ diff --git a/src/Icons/flags/bs.png b/src/Icons/flags/bs.png new file mode 100755 index 000000000..639fa6cfa Binary files /dev/null and b/src/Icons/flags/bs.png differ diff --git a/src/Icons/flags/bt.png b/src/Icons/flags/bt.png new file mode 100755 index 000000000..1d512dfff Binary files /dev/null and b/src/Icons/flags/bt.png differ diff --git a/src/Icons/flags/bulgaria.png b/src/Icons/flags/bulgaria.png deleted file mode 100644 index f0097b058..000000000 Binary files a/src/Icons/flags/bulgaria.png and /dev/null differ diff --git a/src/Icons/flags/bv.png b/src/Icons/flags/bv.png new file mode 100755 index 000000000..160b6b5b7 Binary files /dev/null and b/src/Icons/flags/bv.png differ diff --git a/src/Icons/flags/bw.png b/src/Icons/flags/bw.png new file mode 100755 index 000000000..fcb103941 Binary files /dev/null and b/src/Icons/flags/bw.png differ diff --git a/src/Icons/flags/by.png b/src/Icons/flags/by.png new file mode 100755 index 000000000..504774ec1 Binary files /dev/null and b/src/Icons/flags/by.png differ diff --git a/src/Icons/flags/bz.png b/src/Icons/flags/bz.png new file mode 100755 index 000000000..be63ee1c6 Binary files /dev/null and b/src/Icons/flags/bz.png differ diff --git a/src/Icons/flags/ca.png b/src/Icons/flags/ca.png new file mode 100755 index 000000000..1f204193a Binary files /dev/null and b/src/Icons/flags/ca.png differ diff --git a/src/Icons/flags/canada.png b/src/Icons/flags/canada.png deleted file mode 100644 index a6e35bcca..000000000 Binary files a/src/Icons/flags/canada.png and /dev/null differ diff --git a/src/Icons/flags/cc.png b/src/Icons/flags/cc.png new file mode 100755 index 000000000..aed3d3b4e Binary files /dev/null and b/src/Icons/flags/cc.png differ diff --git a/src/Icons/flags/cd.png b/src/Icons/flags/cd.png new file mode 100644 index 000000000..5e4894248 Binary files /dev/null and b/src/Icons/flags/cd.png differ diff --git a/src/Icons/flags/cf.png b/src/Icons/flags/cf.png new file mode 100755 index 000000000..da687bdce Binary files /dev/null and b/src/Icons/flags/cf.png differ diff --git a/src/Icons/flags/cg.png b/src/Icons/flags/cg.png new file mode 100755 index 000000000..a859792ef Binary files /dev/null and b/src/Icons/flags/cg.png differ diff --git a/src/Icons/flags/ch.png b/src/Icons/flags/ch.png new file mode 100755 index 000000000..242ec01aa Binary files /dev/null and b/src/Icons/flags/ch.png differ diff --git a/src/Icons/flags/china.png b/src/Icons/flags/china.png deleted file mode 100644 index 58cf04ded..000000000 Binary files a/src/Icons/flags/china.png and /dev/null differ diff --git a/src/Icons/flags/ci.png b/src/Icons/flags/ci.png new file mode 100755 index 000000000..3f2c62eb4 Binary files /dev/null and b/src/Icons/flags/ci.png differ diff --git a/src/Icons/flags/ck.png b/src/Icons/flags/ck.png new file mode 100755 index 000000000..746d3d6f7 Binary files /dev/null and b/src/Icons/flags/ck.png differ diff --git a/src/Icons/flags/cl.png b/src/Icons/flags/cl.png new file mode 100755 index 000000000..29c6d61bd Binary files /dev/null and b/src/Icons/flags/cl.png differ diff --git a/src/Icons/flags/cm.png b/src/Icons/flags/cm.png new file mode 100755 index 000000000..f65c5bd5a Binary files /dev/null and b/src/Icons/flags/cm.png differ diff --git a/src/Icons/flags/cn.png b/src/Icons/flags/cn.png new file mode 100755 index 000000000..891441462 Binary files /dev/null and b/src/Icons/flags/cn.png differ diff --git a/src/Icons/flags/co.png b/src/Icons/flags/co.png new file mode 100755 index 000000000..a118ff4a1 Binary files /dev/null and b/src/Icons/flags/co.png differ diff --git a/src/Icons/flags/costa_rica.png b/src/Icons/flags/costa_rica.png deleted file mode 100644 index 2c379e574..000000000 Binary files a/src/Icons/flags/costa_rica.png and /dev/null differ diff --git a/src/Icons/flags/cr.png b/src/Icons/flags/cr.png new file mode 100755 index 000000000..c7a373179 Binary files /dev/null and b/src/Icons/flags/cr.png differ diff --git a/src/Icons/flags/croatia.png b/src/Icons/flags/croatia.png deleted file mode 100644 index 2d3775695..000000000 Binary files a/src/Icons/flags/croatia.png and /dev/null differ diff --git a/src/Icons/flags/cs.png b/src/Icons/flags/cs.png new file mode 100755 index 000000000..8254790ca Binary files /dev/null and b/src/Icons/flags/cs.png differ diff --git a/src/Icons/flags/cu.png b/src/Icons/flags/cu.png new file mode 100755 index 000000000..083f1d611 Binary files /dev/null and b/src/Icons/flags/cu.png differ diff --git a/src/Icons/flags/cv.png b/src/Icons/flags/cv.png new file mode 100755 index 000000000..a63f7eaf6 Binary files /dev/null and b/src/Icons/flags/cv.png differ diff --git a/src/Icons/flags/cx.png b/src/Icons/flags/cx.png new file mode 100755 index 000000000..48e31adbf Binary files /dev/null and b/src/Icons/flags/cx.png differ diff --git a/src/Icons/flags/cy.png b/src/Icons/flags/cy.png new file mode 100755 index 000000000..5b1ad6c07 Binary files /dev/null and b/src/Icons/flags/cy.png differ diff --git a/src/Icons/flags/cz.png b/src/Icons/flags/cz.png new file mode 100755 index 000000000..c8403dd21 Binary files /dev/null and b/src/Icons/flags/cz.png differ diff --git a/src/Icons/flags/czech.png b/src/Icons/flags/czech.png deleted file mode 100644 index 3c135f9f3..000000000 Binary files a/src/Icons/flags/czech.png and /dev/null differ diff --git a/src/Icons/flags/de.png b/src/Icons/flags/de.png new file mode 100755 index 000000000..ac4a97736 Binary files /dev/null and b/src/Icons/flags/de.png differ diff --git a/src/Icons/flags/denmark.png b/src/Icons/flags/denmark.png deleted file mode 100644 index 3e055375a..000000000 Binary files a/src/Icons/flags/denmark.png and /dev/null differ diff --git a/src/Icons/flags/dj.png b/src/Icons/flags/dj.png new file mode 100755 index 000000000..582af364f Binary files /dev/null and b/src/Icons/flags/dj.png differ diff --git a/src/Icons/flags/dk.png b/src/Icons/flags/dk.png new file mode 100755 index 000000000..e2993d3c5 Binary files /dev/null and b/src/Icons/flags/dk.png differ diff --git a/src/Icons/flags/dm.png b/src/Icons/flags/dm.png new file mode 100755 index 000000000..5fbffcba3 Binary files /dev/null and b/src/Icons/flags/dm.png differ diff --git a/src/Icons/flags/do.png b/src/Icons/flags/do.png new file mode 100755 index 000000000..5a04932d8 Binary files /dev/null and b/src/Icons/flags/do.png differ diff --git a/src/Icons/flags/dz.png b/src/Icons/flags/dz.png new file mode 100755 index 000000000..335c2391d Binary files /dev/null and b/src/Icons/flags/dz.png differ diff --git a/src/Icons/flags/ec.png b/src/Icons/flags/ec.png new file mode 100755 index 000000000..0caa0b1e7 Binary files /dev/null and b/src/Icons/flags/ec.png differ diff --git a/src/Icons/flags/ee.png b/src/Icons/flags/ee.png new file mode 100755 index 000000000..0c82efb7d Binary files /dev/null and b/src/Icons/flags/ee.png differ diff --git a/src/Icons/flags/eg.png b/src/Icons/flags/eg.png new file mode 100755 index 000000000..8a3f7a10b Binary files /dev/null and b/src/Icons/flags/eg.png differ diff --git a/src/Icons/flags/egypt.png b/src/Icons/flags/egypt.png deleted file mode 100644 index e863d40be..000000000 Binary files a/src/Icons/flags/egypt.png and /dev/null differ diff --git a/src/Icons/flags/eh.png b/src/Icons/flags/eh.png new file mode 100755 index 000000000..90a1195b4 Binary files /dev/null and b/src/Icons/flags/eh.png differ diff --git a/src/Icons/flags/er.png b/src/Icons/flags/er.png new file mode 100755 index 000000000..13065ae99 Binary files /dev/null and b/src/Icons/flags/er.png differ diff --git a/src/Icons/flags/es.png b/src/Icons/flags/es.png new file mode 100755 index 000000000..c2de2d711 Binary files /dev/null and b/src/Icons/flags/es.png differ diff --git a/src/Icons/flags/et.png b/src/Icons/flags/et.png new file mode 100755 index 000000000..2e893fa05 Binary files /dev/null and b/src/Icons/flags/et.png differ diff --git a/src/Icons/flags/fi.png b/src/Icons/flags/fi.png new file mode 100755 index 000000000..14ec091b8 Binary files /dev/null and b/src/Icons/flags/fi.png differ diff --git a/src/Icons/flags/finland.png b/src/Icons/flags/finland.png deleted file mode 100644 index 818f5d415..000000000 Binary files a/src/Icons/flags/finland.png and /dev/null differ diff --git a/src/Icons/flags/fj.png b/src/Icons/flags/fj.png new file mode 100755 index 000000000..cee998892 Binary files /dev/null and b/src/Icons/flags/fj.png differ diff --git a/src/Icons/flags/fk.png b/src/Icons/flags/fk.png new file mode 100755 index 000000000..ceaeb27de Binary files /dev/null and b/src/Icons/flags/fk.png differ diff --git a/src/Icons/flags/fm.png b/src/Icons/flags/fm.png new file mode 100755 index 000000000..066bb2473 Binary files /dev/null and b/src/Icons/flags/fm.png differ diff --git a/src/Icons/flags/fo.png b/src/Icons/flags/fo.png new file mode 100755 index 000000000..cbceb809e Binary files /dev/null and b/src/Icons/flags/fo.png differ diff --git a/src/Icons/flags/fr.png b/src/Icons/flags/fr.png new file mode 100755 index 000000000..8332c4ec2 Binary files /dev/null and b/src/Icons/flags/fr.png differ diff --git a/src/Icons/flags/france.png b/src/Icons/flags/france.png deleted file mode 100644 index d6d430a6e..000000000 Binary files a/src/Icons/flags/france.png and /dev/null differ diff --git a/src/Icons/flags/ga.png b/src/Icons/flags/ga.png new file mode 100755 index 000000000..0e0d43436 Binary files /dev/null and b/src/Icons/flags/ga.png differ diff --git a/src/Icons/flags/gb.png b/src/Icons/flags/gb.png new file mode 100644 index 000000000..ff701e19f Binary files /dev/null and b/src/Icons/flags/gb.png differ diff --git a/src/Icons/flags/gd.png b/src/Icons/flags/gd.png new file mode 100755 index 000000000..9ab57f548 Binary files /dev/null and b/src/Icons/flags/gd.png differ diff --git a/src/Icons/flags/ge.png b/src/Icons/flags/ge.png new file mode 100755 index 000000000..728d97078 Binary files /dev/null and b/src/Icons/flags/ge.png differ diff --git a/src/Icons/flags/georgia.png b/src/Icons/flags/georgia.png deleted file mode 100644 index 5d646b548..000000000 Binary files a/src/Icons/flags/georgia.png and /dev/null differ diff --git a/src/Icons/flags/germany.png b/src/Icons/flags/germany.png deleted file mode 100644 index 9ebf4c652..000000000 Binary files a/src/Icons/flags/germany.png and /dev/null differ diff --git a/src/Icons/flags/gf.png b/src/Icons/flags/gf.png new file mode 100755 index 000000000..8332c4ec2 Binary files /dev/null and b/src/Icons/flags/gf.png differ diff --git a/src/Icons/flags/gh.png b/src/Icons/flags/gh.png new file mode 100755 index 000000000..4e2f89659 Binary files /dev/null and b/src/Icons/flags/gh.png differ diff --git a/src/Icons/flags/gi.png b/src/Icons/flags/gi.png new file mode 100755 index 000000000..e76797f62 Binary files /dev/null and b/src/Icons/flags/gi.png differ diff --git a/src/Icons/flags/gl.png b/src/Icons/flags/gl.png new file mode 100755 index 000000000..ef12a73bf Binary files /dev/null and b/src/Icons/flags/gl.png differ diff --git a/src/Icons/flags/gm.png b/src/Icons/flags/gm.png new file mode 100755 index 000000000..0720b667a Binary files /dev/null and b/src/Icons/flags/gm.png differ diff --git a/src/Icons/flags/gn.png b/src/Icons/flags/gn.png new file mode 100755 index 000000000..ea660b01f Binary files /dev/null and b/src/Icons/flags/gn.png differ diff --git a/src/Icons/flags/gp.png b/src/Icons/flags/gp.png new file mode 100755 index 000000000..dbb086d00 Binary files /dev/null and b/src/Icons/flags/gp.png differ diff --git a/src/Icons/flags/gq.png b/src/Icons/flags/gq.png new file mode 100755 index 000000000..ebe20a28d Binary files /dev/null and b/src/Icons/flags/gq.png differ diff --git a/src/Icons/flags/gr.png b/src/Icons/flags/gr.png new file mode 100755 index 000000000..8651ade7c Binary files /dev/null and b/src/Icons/flags/gr.png differ diff --git a/src/Icons/flags/greece.png b/src/Icons/flags/greece.png deleted file mode 100644 index 461f60f8a..000000000 Binary files a/src/Icons/flags/greece.png and /dev/null differ diff --git a/src/Icons/flags/gs.png b/src/Icons/flags/gs.png new file mode 100755 index 000000000..7ef0bf598 Binary files /dev/null and b/src/Icons/flags/gs.png differ diff --git a/src/Icons/flags/gt.png b/src/Icons/flags/gt.png new file mode 100755 index 000000000..c43a70d36 Binary files /dev/null and b/src/Icons/flags/gt.png differ diff --git a/src/Icons/flags/gu.png b/src/Icons/flags/gu.png new file mode 100755 index 000000000..92f37c053 Binary files /dev/null and b/src/Icons/flags/gu.png differ diff --git a/src/Icons/flags/gw.png b/src/Icons/flags/gw.png new file mode 100755 index 000000000..b37bcf06b Binary files /dev/null and b/src/Icons/flags/gw.png differ diff --git a/src/Icons/flags/gy.png b/src/Icons/flags/gy.png new file mode 100755 index 000000000..22cbe2f59 Binary files /dev/null and b/src/Icons/flags/gy.png differ diff --git a/src/Icons/flags/hk.png b/src/Icons/flags/hk.png new file mode 100755 index 000000000..d5c380ca9 Binary files /dev/null and b/src/Icons/flags/hk.png differ diff --git a/src/Icons/flags/hm.png b/src/Icons/flags/hm.png new file mode 100755 index 000000000..a01389a74 Binary files /dev/null and b/src/Icons/flags/hm.png differ diff --git a/src/Icons/flags/hn.png b/src/Icons/flags/hn.png new file mode 100755 index 000000000..96f838859 Binary files /dev/null and b/src/Icons/flags/hn.png differ diff --git a/src/Icons/flags/hr.png b/src/Icons/flags/hr.png new file mode 100755 index 000000000..696b51546 Binary files /dev/null and b/src/Icons/flags/hr.png differ diff --git a/src/Icons/flags/ht.png b/src/Icons/flags/ht.png new file mode 100755 index 000000000..416052af7 Binary files /dev/null and b/src/Icons/flags/ht.png differ diff --git a/src/Icons/flags/hu.png b/src/Icons/flags/hu.png new file mode 100755 index 000000000..7baafe44d Binary files /dev/null and b/src/Icons/flags/hu.png differ diff --git a/src/Icons/flags/hungary.png b/src/Icons/flags/hungary.png deleted file mode 100644 index 4dd38a245..000000000 Binary files a/src/Icons/flags/hungary.png and /dev/null differ diff --git a/src/Icons/flags/iceland.png b/src/Icons/flags/iceland.png deleted file mode 100644 index b3b7984b6..000000000 Binary files a/src/Icons/flags/iceland.png and /dev/null differ diff --git a/src/Icons/flags/icons-set-readme.txt b/src/Icons/flags/icons-set-readme.txt new file mode 100755 index 000000000..1028eec3b --- /dev/null +++ b/src/Icons/flags/icons-set-readme.txt @@ -0,0 +1,9 @@ +Flag icons - http://www.famfamfam.com + +These icons are public domain, and as such are free for any use (attribution appreciated but not required). + +Note that these flags are named using the ISO3166-1 alpha-2 country codes where appropriate. A list of codes can be found at http://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 + +If you find these icons useful, please donate via paypal to mjames@gmail.com (or click the donate button available at http://www.famfamfam.com/lab/icons/silk) + +Contact: mjames@gmail.com \ No newline at end of file diff --git a/src/Icons/flags/id.png b/src/Icons/flags/id.png new file mode 100755 index 000000000..c6bc0fafa Binary files /dev/null and b/src/Icons/flags/id.png differ diff --git a/src/Icons/flags/ie.png b/src/Icons/flags/ie.png new file mode 100755 index 000000000..26baa31e1 Binary files /dev/null and b/src/Icons/flags/ie.png differ diff --git a/src/Icons/flags/il.png b/src/Icons/flags/il.png new file mode 100755 index 000000000..2ca772d0b Binary files /dev/null and b/src/Icons/flags/il.png differ diff --git a/src/Icons/flags/in.png b/src/Icons/flags/in.png new file mode 100755 index 000000000..e4d7e81a9 Binary files /dev/null and b/src/Icons/flags/in.png differ diff --git a/src/Icons/flags/india.png b/src/Icons/flags/india.png deleted file mode 100644 index 8ba6383be..000000000 Binary files a/src/Icons/flags/india.png and /dev/null differ diff --git a/src/Icons/flags/indonesia.png b/src/Icons/flags/indonesia.png deleted file mode 100644 index 4baaf3c94..000000000 Binary files a/src/Icons/flags/indonesia.png and /dev/null differ diff --git a/src/Icons/flags/io.png b/src/Icons/flags/io.png new file mode 100755 index 000000000..3e74b6a31 Binary files /dev/null and b/src/Icons/flags/io.png differ diff --git a/src/Icons/flags/iq.png b/src/Icons/flags/iq.png new file mode 100755 index 000000000..878a35140 Binary files /dev/null and b/src/Icons/flags/iq.png differ diff --git a/src/Icons/flags/ir.png b/src/Icons/flags/ir.png new file mode 100755 index 000000000..c5fd136ae Binary files /dev/null and b/src/Icons/flags/ir.png differ diff --git a/src/Icons/flags/ireland.png b/src/Icons/flags/ireland.png deleted file mode 100644 index a14277a3e..000000000 Binary files a/src/Icons/flags/ireland.png and /dev/null differ diff --git a/src/Icons/flags/is.png b/src/Icons/flags/is.png new file mode 100755 index 000000000..b8f6d0f06 Binary files /dev/null and b/src/Icons/flags/is.png differ diff --git a/src/Icons/flags/israel.png b/src/Icons/flags/israel.png deleted file mode 100644 index 7a49b01ad..000000000 Binary files a/src/Icons/flags/israel.png and /dev/null differ diff --git a/src/Icons/flags/it.png b/src/Icons/flags/it.png new file mode 100755 index 000000000..89692f74f Binary files /dev/null and b/src/Icons/flags/it.png differ diff --git a/src/Icons/flags/italy.png b/src/Icons/flags/italy.png deleted file mode 100644 index c46d8a1ae..000000000 Binary files a/src/Icons/flags/italy.png and /dev/null differ diff --git a/src/Icons/flags/japan.png b/src/Icons/flags/japan.png deleted file mode 100644 index 2aaa7cce7..000000000 Binary files a/src/Icons/flags/japan.png and /dev/null differ diff --git a/src/Icons/flags/jm.png b/src/Icons/flags/jm.png new file mode 100755 index 000000000..7be119e03 Binary files /dev/null and b/src/Icons/flags/jm.png differ diff --git a/src/Icons/flags/jo.png b/src/Icons/flags/jo.png new file mode 100755 index 000000000..11bd4972b Binary files /dev/null and b/src/Icons/flags/jo.png differ diff --git a/src/Icons/flags/jp.png b/src/Icons/flags/jp.png new file mode 100755 index 000000000..325fbad3f Binary files /dev/null and b/src/Icons/flags/jp.png differ diff --git a/src/Icons/flags/ke.png b/src/Icons/flags/ke.png new file mode 100755 index 000000000..51879adf1 Binary files /dev/null and b/src/Icons/flags/ke.png differ diff --git a/src/Icons/flags/kg.png b/src/Icons/flags/kg.png new file mode 100755 index 000000000..0a818f67e Binary files /dev/null and b/src/Icons/flags/kg.png differ diff --git a/src/Icons/flags/kh.png b/src/Icons/flags/kh.png new file mode 100755 index 000000000..30f6bb1b9 Binary files /dev/null and b/src/Icons/flags/kh.png differ diff --git a/src/Icons/flags/ki.png b/src/Icons/flags/ki.png new file mode 100755 index 000000000..2dcce4b33 Binary files /dev/null and b/src/Icons/flags/ki.png differ diff --git a/src/Icons/flags/km.png b/src/Icons/flags/km.png new file mode 100755 index 000000000..812b2f56c Binary files /dev/null and b/src/Icons/flags/km.png differ diff --git a/src/Icons/flags/kn.png b/src/Icons/flags/kn.png new file mode 100755 index 000000000..febd5b486 Binary files /dev/null and b/src/Icons/flags/kn.png differ diff --git a/src/Icons/flags/kp.png b/src/Icons/flags/kp.png new file mode 100755 index 000000000..d3d509aa8 Binary files /dev/null and b/src/Icons/flags/kp.png differ diff --git a/src/Icons/flags/kr.png b/src/Icons/flags/kr.png new file mode 100755 index 000000000..9c0a78eb9 Binary files /dev/null and b/src/Icons/flags/kr.png differ diff --git a/src/Icons/flags/kw.png b/src/Icons/flags/kw.png new file mode 100755 index 000000000..96546da32 Binary files /dev/null and b/src/Icons/flags/kw.png differ diff --git a/src/Icons/flags/ky.png b/src/Icons/flags/ky.png new file mode 100755 index 000000000..15c5f8e47 Binary files /dev/null and b/src/Icons/flags/ky.png differ diff --git a/src/Icons/flags/kz.png b/src/Icons/flags/kz.png new file mode 100755 index 000000000..45a8c8874 Binary files /dev/null and b/src/Icons/flags/kz.png differ diff --git a/src/Icons/flags/la.png b/src/Icons/flags/la.png new file mode 100755 index 000000000..e28acd018 Binary files /dev/null and b/src/Icons/flags/la.png differ diff --git a/src/Icons/flags/lb.png b/src/Icons/flags/lb.png new file mode 100755 index 000000000..d0d452bf8 Binary files /dev/null and b/src/Icons/flags/lb.png differ diff --git a/src/Icons/flags/lc.png b/src/Icons/flags/lc.png new file mode 100644 index 000000000..a47d06554 Binary files /dev/null and b/src/Icons/flags/lc.png differ diff --git a/src/Icons/flags/li.png b/src/Icons/flags/li.png new file mode 100755 index 000000000..6469909c0 Binary files /dev/null and b/src/Icons/flags/li.png differ diff --git a/src/Icons/flags/lk.png b/src/Icons/flags/lk.png new file mode 100755 index 000000000..088aad6db Binary files /dev/null and b/src/Icons/flags/lk.png differ diff --git a/src/Icons/flags/lr.png b/src/Icons/flags/lr.png new file mode 100755 index 000000000..89a5bc7e7 Binary files /dev/null and b/src/Icons/flags/lr.png differ diff --git a/src/Icons/flags/ls.png b/src/Icons/flags/ls.png new file mode 100755 index 000000000..33fdef101 Binary files /dev/null and b/src/Icons/flags/ls.png differ diff --git a/src/Icons/flags/lt.png b/src/Icons/flags/lt.png new file mode 100755 index 000000000..c8ef0da09 Binary files /dev/null and b/src/Icons/flags/lt.png differ diff --git a/src/Icons/flags/lu.png b/src/Icons/flags/lu.png new file mode 100755 index 000000000..4cabba98a Binary files /dev/null and b/src/Icons/flags/lu.png differ diff --git a/src/Icons/flags/luxembourg.png b/src/Icons/flags/luxembourg.png deleted file mode 100644 index 70f03280a..000000000 Binary files a/src/Icons/flags/luxembourg.png and /dev/null differ diff --git a/src/Icons/flags/lv.png b/src/Icons/flags/lv.png new file mode 100755 index 000000000..49b699810 Binary files /dev/null and b/src/Icons/flags/lv.png differ diff --git a/src/Icons/flags/ly.png b/src/Icons/flags/ly.png new file mode 100755 index 000000000..b163a9f8a Binary files /dev/null and b/src/Icons/flags/ly.png differ diff --git a/src/Icons/flags/ma.png b/src/Icons/flags/ma.png new file mode 100755 index 000000000..f38677028 Binary files /dev/null and b/src/Icons/flags/ma.png differ diff --git a/src/Icons/flags/malaysia.png b/src/Icons/flags/malaysia.png deleted file mode 100644 index e78066ebc..000000000 Binary files a/src/Icons/flags/malaysia.png and /dev/null differ diff --git a/src/Icons/flags/mc.png b/src/Icons/flags/mc.png new file mode 100755 index 000000000..1aa830f12 Binary files /dev/null and b/src/Icons/flags/mc.png differ diff --git a/src/Icons/flags/md.png b/src/Icons/flags/md.png new file mode 100755 index 000000000..4e92c1890 Binary files /dev/null and b/src/Icons/flags/md.png differ diff --git a/src/Icons/flags/me.png b/src/Icons/flags/me.png new file mode 100644 index 000000000..ac7253558 Binary files /dev/null and b/src/Icons/flags/me.png differ diff --git a/src/Icons/flags/mexico.png b/src/Icons/flags/mexico.png deleted file mode 100644 index e5217d244..000000000 Binary files a/src/Icons/flags/mexico.png and /dev/null differ diff --git a/src/Icons/flags/mg.png b/src/Icons/flags/mg.png new file mode 100755 index 000000000..d2715b3d0 Binary files /dev/null and b/src/Icons/flags/mg.png differ diff --git a/src/Icons/flags/mh.png b/src/Icons/flags/mh.png new file mode 100755 index 000000000..fb523a8c3 Binary files /dev/null and b/src/Icons/flags/mh.png differ diff --git a/src/Icons/flags/mk.png b/src/Icons/flags/mk.png new file mode 100755 index 000000000..db173aaff Binary files /dev/null and b/src/Icons/flags/mk.png differ diff --git a/src/Icons/flags/ml.png b/src/Icons/flags/ml.png new file mode 100755 index 000000000..2cec8ba44 Binary files /dev/null and b/src/Icons/flags/ml.png differ diff --git a/src/Icons/flags/mm.png b/src/Icons/flags/mm.png new file mode 100755 index 000000000..f464f67ff Binary files /dev/null and b/src/Icons/flags/mm.png differ diff --git a/src/Icons/flags/mn.png b/src/Icons/flags/mn.png new file mode 100755 index 000000000..9396355db Binary files /dev/null and b/src/Icons/flags/mn.png differ diff --git a/src/Icons/flags/mo.png b/src/Icons/flags/mo.png new file mode 100755 index 000000000..deb801dda Binary files /dev/null and b/src/Icons/flags/mo.png differ diff --git a/src/Icons/flags/morocco.png b/src/Icons/flags/morocco.png deleted file mode 100644 index 4698aaf38..000000000 Binary files a/src/Icons/flags/morocco.png and /dev/null differ diff --git a/src/Icons/flags/mp.png b/src/Icons/flags/mp.png new file mode 100755 index 000000000..298d588b1 Binary files /dev/null and b/src/Icons/flags/mp.png differ diff --git a/src/Icons/flags/mq.png b/src/Icons/flags/mq.png new file mode 100755 index 000000000..010143b38 Binary files /dev/null and b/src/Icons/flags/mq.png differ diff --git a/src/Icons/flags/mr.png b/src/Icons/flags/mr.png new file mode 100755 index 000000000..319546b10 Binary files /dev/null and b/src/Icons/flags/mr.png differ diff --git a/src/Icons/flags/ms.png b/src/Icons/flags/ms.png new file mode 100755 index 000000000..d4cbb433d Binary files /dev/null and b/src/Icons/flags/ms.png differ diff --git a/src/Icons/flags/mt.png b/src/Icons/flags/mt.png new file mode 100755 index 000000000..00af94871 Binary files /dev/null and b/src/Icons/flags/mt.png differ diff --git a/src/Icons/flags/mu.png b/src/Icons/flags/mu.png new file mode 100755 index 000000000..b7fdce1bd Binary files /dev/null and b/src/Icons/flags/mu.png differ diff --git a/src/Icons/flags/mv.png b/src/Icons/flags/mv.png new file mode 100755 index 000000000..5073d9ec4 Binary files /dev/null and b/src/Icons/flags/mv.png differ diff --git a/src/Icons/flags/mw.png b/src/Icons/flags/mw.png new file mode 100755 index 000000000..13886e9f8 Binary files /dev/null and b/src/Icons/flags/mw.png differ diff --git a/src/Icons/flags/mx.png b/src/Icons/flags/mx.png new file mode 100755 index 000000000..5bc58ab3e Binary files /dev/null and b/src/Icons/flags/mx.png differ diff --git a/src/Icons/flags/my.png b/src/Icons/flags/my.png new file mode 100755 index 000000000..9034cbab2 Binary files /dev/null and b/src/Icons/flags/my.png differ diff --git a/src/Icons/flags/mz.png b/src/Icons/flags/mz.png new file mode 100755 index 000000000..76405e063 Binary files /dev/null and b/src/Icons/flags/mz.png differ diff --git a/src/Icons/flags/na.png b/src/Icons/flags/na.png new file mode 100755 index 000000000..63358c67d Binary files /dev/null and b/src/Icons/flags/na.png differ diff --git a/src/Icons/flags/nc.png b/src/Icons/flags/nc.png new file mode 100755 index 000000000..2cad28378 Binary files /dev/null and b/src/Icons/flags/nc.png differ diff --git a/src/Icons/flags/ne.png b/src/Icons/flags/ne.png new file mode 100755 index 000000000..d85f424f3 Binary files /dev/null and b/src/Icons/flags/ne.png differ diff --git a/src/Icons/flags/netherlands.png b/src/Icons/flags/netherlands.png deleted file mode 100644 index ddac91291..000000000 Binary files a/src/Icons/flags/netherlands.png and /dev/null differ diff --git a/src/Icons/flags/newzealand.png b/src/Icons/flags/newzealand.png deleted file mode 100644 index 56a562e1e..000000000 Binary files a/src/Icons/flags/newzealand.png and /dev/null differ diff --git a/src/Icons/flags/nf.png b/src/Icons/flags/nf.png new file mode 100755 index 000000000..f9bcdda12 Binary files /dev/null and b/src/Icons/flags/nf.png differ diff --git a/src/Icons/flags/ng.png b/src/Icons/flags/ng.png new file mode 100755 index 000000000..3eea2e020 Binary files /dev/null and b/src/Icons/flags/ng.png differ diff --git a/src/Icons/flags/ni.png b/src/Icons/flags/ni.png new file mode 100755 index 000000000..3969aaaae Binary files /dev/null and b/src/Icons/flags/ni.png differ diff --git a/src/Icons/flags/nl.png b/src/Icons/flags/nl.png new file mode 100755 index 000000000..fe44791e3 Binary files /dev/null and b/src/Icons/flags/nl.png differ diff --git a/src/Icons/flags/no.png b/src/Icons/flags/no.png new file mode 100755 index 000000000..160b6b5b7 Binary files /dev/null and b/src/Icons/flags/no.png differ diff --git a/src/Icons/flags/norway.png b/src/Icons/flags/norway.png deleted file mode 100644 index d4cc87f5b..000000000 Binary files a/src/Icons/flags/norway.png and /dev/null differ diff --git a/src/Icons/flags/np.png b/src/Icons/flags/np.png new file mode 100755 index 000000000..aeb058b7e Binary files /dev/null and b/src/Icons/flags/np.png differ diff --git a/src/Icons/flags/nr.png b/src/Icons/flags/nr.png new file mode 100755 index 000000000..705fc337c Binary files /dev/null and b/src/Icons/flags/nr.png differ diff --git a/src/Icons/flags/nu.png b/src/Icons/flags/nu.png new file mode 100755 index 000000000..c3ce4aedd Binary files /dev/null and b/src/Icons/flags/nu.png differ diff --git a/src/Icons/flags/nz.png b/src/Icons/flags/nz.png new file mode 100755 index 000000000..10d6306d1 Binary files /dev/null and b/src/Icons/flags/nz.png differ diff --git a/src/Icons/flags/om.png b/src/Icons/flags/om.png new file mode 100755 index 000000000..2ffba7e8c Binary files /dev/null and b/src/Icons/flags/om.png differ diff --git a/src/Icons/flags/pa.png b/src/Icons/flags/pa.png new file mode 100755 index 000000000..9b2ee9a78 Binary files /dev/null and b/src/Icons/flags/pa.png differ diff --git a/src/Icons/flags/pakistan.png b/src/Icons/flags/pakistan.png deleted file mode 100644 index 16be3bd21..000000000 Binary files a/src/Icons/flags/pakistan.png and /dev/null differ diff --git a/src/Icons/flags/pe.png b/src/Icons/flags/pe.png new file mode 100755 index 000000000..62a04977f Binary files /dev/null and b/src/Icons/flags/pe.png differ diff --git a/src/Icons/flags/pf.png b/src/Icons/flags/pf.png new file mode 100755 index 000000000..771a0f652 Binary files /dev/null and b/src/Icons/flags/pf.png differ diff --git a/src/Icons/flags/pg.png b/src/Icons/flags/pg.png new file mode 100755 index 000000000..10d623349 Binary files /dev/null and b/src/Icons/flags/pg.png differ diff --git a/src/Icons/flags/ph.png b/src/Icons/flags/ph.png new file mode 100755 index 000000000..b89e15935 Binary files /dev/null and b/src/Icons/flags/ph.png differ diff --git a/src/Icons/flags/philippines.png b/src/Icons/flags/philippines.png deleted file mode 100644 index d33c19c3b..000000000 Binary files a/src/Icons/flags/philippines.png and /dev/null differ diff --git a/src/Icons/flags/pk.png b/src/Icons/flags/pk.png new file mode 100755 index 000000000..e9df70ca4 Binary files /dev/null and b/src/Icons/flags/pk.png differ diff --git a/src/Icons/flags/pl.png b/src/Icons/flags/pl.png new file mode 100755 index 000000000..d413d010b Binary files /dev/null and b/src/Icons/flags/pl.png differ diff --git a/src/Icons/flags/pm.png b/src/Icons/flags/pm.png new file mode 100755 index 000000000..ba91d2c7a Binary files /dev/null and b/src/Icons/flags/pm.png differ diff --git a/src/Icons/flags/pn.png b/src/Icons/flags/pn.png new file mode 100755 index 000000000..aa9344f57 Binary files /dev/null and b/src/Icons/flags/pn.png differ diff --git a/src/Icons/flags/poland.png b/src/Icons/flags/poland.png deleted file mode 100644 index 5fa93af11..000000000 Binary files a/src/Icons/flags/poland.png and /dev/null differ diff --git a/src/Icons/flags/portugal.png b/src/Icons/flags/portugal.png deleted file mode 100644 index dacd17c88..000000000 Binary files a/src/Icons/flags/portugal.png and /dev/null differ diff --git a/src/Icons/flags/pr.png b/src/Icons/flags/pr.png new file mode 100755 index 000000000..82d9130da Binary files /dev/null and b/src/Icons/flags/pr.png differ diff --git a/src/Icons/flags/ps.png b/src/Icons/flags/ps.png new file mode 100755 index 000000000..f5f547762 Binary files /dev/null and b/src/Icons/flags/ps.png differ diff --git a/src/Icons/flags/pt.png b/src/Icons/flags/pt.png new file mode 100755 index 000000000..ece798015 Binary files /dev/null and b/src/Icons/flags/pt.png differ diff --git a/src/Icons/flags/pw.png b/src/Icons/flags/pw.png new file mode 100755 index 000000000..6178b254a Binary files /dev/null and b/src/Icons/flags/pw.png differ diff --git a/src/Icons/flags/py.png b/src/Icons/flags/py.png new file mode 100755 index 000000000..cb8723c06 Binary files /dev/null and b/src/Icons/flags/py.png differ diff --git a/src/Icons/flags/qa.png b/src/Icons/flags/qa.png new file mode 100755 index 000000000..ed4c621fa Binary files /dev/null and b/src/Icons/flags/qa.png differ diff --git a/src/Icons/flags/re.png b/src/Icons/flags/re.png new file mode 100755 index 000000000..8332c4ec2 Binary files /dev/null and b/src/Icons/flags/re.png differ diff --git a/src/Icons/flags/ro.png b/src/Icons/flags/ro.png new file mode 100755 index 000000000..57e74a651 Binary files /dev/null and b/src/Icons/flags/ro.png differ diff --git a/src/Icons/flags/romania.png b/src/Icons/flags/romania.png deleted file mode 100644 index 8fce28465..000000000 Binary files a/src/Icons/flags/romania.png and /dev/null differ diff --git a/src/Icons/flags/rs.png b/src/Icons/flags/rs.png new file mode 100644 index 000000000..9439a5b60 Binary files /dev/null and b/src/Icons/flags/rs.png differ diff --git a/src/Icons/flags/ru.png b/src/Icons/flags/ru.png new file mode 100755 index 000000000..47da4214f Binary files /dev/null and b/src/Icons/flags/ru.png differ diff --git a/src/Icons/flags/russia.png b/src/Icons/flags/russia.png deleted file mode 100644 index 2cf3deaf5..000000000 Binary files a/src/Icons/flags/russia.png and /dev/null differ diff --git a/src/Icons/flags/rw.png b/src/Icons/flags/rw.png new file mode 100755 index 000000000..535649178 Binary files /dev/null and b/src/Icons/flags/rw.png differ diff --git a/src/Icons/flags/sa.png b/src/Icons/flags/sa.png new file mode 100755 index 000000000..b4641c7e8 Binary files /dev/null and b/src/Icons/flags/sa.png differ diff --git a/src/Icons/flags/saoudi_arabia.png b/src/Icons/flags/saoudi_arabia.png deleted file mode 100644 index 1b4b8bb4f..000000000 Binary files a/src/Icons/flags/saoudi_arabia.png and /dev/null differ diff --git a/src/Icons/flags/sb.png b/src/Icons/flags/sb.png new file mode 100755 index 000000000..a9937ccf0 Binary files /dev/null and b/src/Icons/flags/sb.png differ diff --git a/src/Icons/flags/sc.png b/src/Icons/flags/sc.png new file mode 100755 index 000000000..39ee37184 Binary files /dev/null and b/src/Icons/flags/sc.png differ diff --git a/src/Icons/flags/sd.png b/src/Icons/flags/sd.png new file mode 100755 index 000000000..eaab69eb7 Binary files /dev/null and b/src/Icons/flags/sd.png differ diff --git a/src/Icons/flags/se.png b/src/Icons/flags/se.png new file mode 100755 index 000000000..1994653da Binary files /dev/null and b/src/Icons/flags/se.png differ diff --git a/src/Icons/flags/serbia.png b/src/Icons/flags/serbia.png deleted file mode 100644 index c5e3822a0..000000000 Binary files a/src/Icons/flags/serbia.png and /dev/null differ diff --git a/src/Icons/flags/sg.png b/src/Icons/flags/sg.png new file mode 100755 index 000000000..dd34d6121 Binary files /dev/null and b/src/Icons/flags/sg.png differ diff --git a/src/Icons/flags/sh.png b/src/Icons/flags/sh.png new file mode 100755 index 000000000..4b1d2a291 Binary files /dev/null and b/src/Icons/flags/sh.png differ diff --git a/src/Icons/flags/si.png b/src/Icons/flags/si.png new file mode 100755 index 000000000..bb1476ff5 Binary files /dev/null and b/src/Icons/flags/si.png differ diff --git a/src/Icons/flags/singapore.png b/src/Icons/flags/singapore.png deleted file mode 100644 index 698fb7320..000000000 Binary files a/src/Icons/flags/singapore.png and /dev/null differ diff --git a/src/Icons/flags/sj.png b/src/Icons/flags/sj.png new file mode 100755 index 000000000..160b6b5b7 Binary files /dev/null and b/src/Icons/flags/sj.png differ diff --git a/src/Icons/flags/sk.png b/src/Icons/flags/sk.png new file mode 100755 index 000000000..7ccbc8274 Binary files /dev/null and b/src/Icons/flags/sk.png differ diff --git a/src/Icons/flags/sl.png b/src/Icons/flags/sl.png new file mode 100755 index 000000000..12d812d29 Binary files /dev/null and b/src/Icons/flags/sl.png differ diff --git a/src/Icons/flags/slovakia.png b/src/Icons/flags/slovakia.png deleted file mode 100644 index d6eae2b6c..000000000 Binary files a/src/Icons/flags/slovakia.png and /dev/null differ diff --git a/src/Icons/flags/slovenia.png b/src/Icons/flags/slovenia.png deleted file mode 100644 index 4acc18348..000000000 Binary files a/src/Icons/flags/slovenia.png and /dev/null differ diff --git a/src/Icons/flags/sm.png b/src/Icons/flags/sm.png new file mode 100755 index 000000000..3df2fdcf8 Binary files /dev/null and b/src/Icons/flags/sm.png differ diff --git a/src/Icons/flags/sn.png b/src/Icons/flags/sn.png new file mode 100755 index 000000000..eabb71db4 Binary files /dev/null and b/src/Icons/flags/sn.png differ diff --git a/src/Icons/flags/so.png b/src/Icons/flags/so.png new file mode 100755 index 000000000..4a1ea4b29 Binary files /dev/null and b/src/Icons/flags/so.png differ diff --git a/src/Icons/flags/south_africa.png b/src/Icons/flags/south_africa.png deleted file mode 100644 index abc2c22b7..000000000 Binary files a/src/Icons/flags/south_africa.png and /dev/null differ diff --git a/src/Icons/flags/south_korea.png b/src/Icons/flags/south_korea.png deleted file mode 100644 index ed1328dba..000000000 Binary files a/src/Icons/flags/south_korea.png and /dev/null differ diff --git a/src/Icons/flags/spain.png b/src/Icons/flags/spain.png deleted file mode 100644 index 34e4a5242..000000000 Binary files a/src/Icons/flags/spain.png and /dev/null differ diff --git a/src/Icons/flags/spain_catalunya.png b/src/Icons/flags/spain_catalunya.png deleted file mode 100644 index 015347ccb..000000000 Binary files a/src/Icons/flags/spain_catalunya.png and /dev/null differ diff --git a/src/Icons/flags/sr.png b/src/Icons/flags/sr.png new file mode 100755 index 000000000..5eff9271d Binary files /dev/null and b/src/Icons/flags/sr.png differ diff --git a/src/Icons/flags/st.png b/src/Icons/flags/st.png new file mode 100755 index 000000000..2978557b1 Binary files /dev/null and b/src/Icons/flags/st.png differ diff --git a/src/Icons/flags/suisse.png b/src/Icons/flags/suisse.png deleted file mode 100644 index 72741bdf0..000000000 Binary files a/src/Icons/flags/suisse.png and /dev/null differ diff --git a/src/Icons/flags/sv.png b/src/Icons/flags/sv.png new file mode 100755 index 000000000..24987990b Binary files /dev/null and b/src/Icons/flags/sv.png differ diff --git a/src/Icons/flags/sweden.png b/src/Icons/flags/sweden.png deleted file mode 100644 index 6548b8417..000000000 Binary files a/src/Icons/flags/sweden.png and /dev/null differ diff --git a/src/Icons/flags/sy.png b/src/Icons/flags/sy.png new file mode 100755 index 000000000..f5ce30dcb Binary files /dev/null and b/src/Icons/flags/sy.png differ diff --git a/src/Icons/flags/sz.png b/src/Icons/flags/sz.png new file mode 100755 index 000000000..914ee861d Binary files /dev/null and b/src/Icons/flags/sz.png differ diff --git a/src/Icons/flags/taiwan.png b/src/Icons/flags/taiwan.png deleted file mode 100644 index 29b3ff28f..000000000 Binary files a/src/Icons/flags/taiwan.png and /dev/null differ diff --git a/src/Icons/flags/tc.png b/src/Icons/flags/tc.png new file mode 100755 index 000000000..8fc1156be Binary files /dev/null and b/src/Icons/flags/tc.png differ diff --git a/src/Icons/flags/td.png b/src/Icons/flags/td.png new file mode 100755 index 000000000..667f21fd9 Binary files /dev/null and b/src/Icons/flags/td.png differ diff --git a/src/Icons/flags/tf.png b/src/Icons/flags/tf.png new file mode 100755 index 000000000..80529a436 Binary files /dev/null and b/src/Icons/flags/tf.png differ diff --git a/src/Icons/flags/tg.png b/src/Icons/flags/tg.png new file mode 100755 index 000000000..3aa00ad4d Binary files /dev/null and b/src/Icons/flags/tg.png differ diff --git a/src/Icons/flags/th.png b/src/Icons/flags/th.png new file mode 100755 index 000000000..dd8ba9171 Binary files /dev/null and b/src/Icons/flags/th.png differ diff --git a/src/Icons/flags/thailand.png b/src/Icons/flags/thailand.png deleted file mode 100644 index 68e9dee4d..000000000 Binary files a/src/Icons/flags/thailand.png and /dev/null differ diff --git a/src/Icons/flags/tj.png b/src/Icons/flags/tj.png new file mode 100755 index 000000000..617bf6455 Binary files /dev/null and b/src/Icons/flags/tj.png differ diff --git a/src/Icons/flags/tk.png b/src/Icons/flags/tk.png new file mode 100755 index 000000000..67b8c8cb5 Binary files /dev/null and b/src/Icons/flags/tk.png differ diff --git a/src/Icons/flags/tl.png b/src/Icons/flags/tl.png new file mode 100755 index 000000000..77da181e9 Binary files /dev/null and b/src/Icons/flags/tl.png differ diff --git a/src/Icons/flags/tm.png b/src/Icons/flags/tm.png new file mode 100755 index 000000000..828020ecd Binary files /dev/null and b/src/Icons/flags/tm.png differ diff --git a/src/Icons/flags/tn.png b/src/Icons/flags/tn.png new file mode 100755 index 000000000..183cdd3dc Binary files /dev/null and b/src/Icons/flags/tn.png differ diff --git a/src/Icons/flags/to.png b/src/Icons/flags/to.png new file mode 100755 index 000000000..f89b8ba75 Binary files /dev/null and b/src/Icons/flags/to.png differ diff --git a/src/Icons/flags/tr.png b/src/Icons/flags/tr.png new file mode 100755 index 000000000..be32f77e9 Binary files /dev/null and b/src/Icons/flags/tr.png differ diff --git a/src/Icons/flags/tt.png b/src/Icons/flags/tt.png new file mode 100755 index 000000000..2a11c1e20 Binary files /dev/null and b/src/Icons/flags/tt.png differ diff --git a/src/Icons/flags/turkey.png b/src/Icons/flags/turkey.png deleted file mode 100644 index b5d03f269..000000000 Binary files a/src/Icons/flags/turkey.png and /dev/null differ diff --git a/src/Icons/flags/tv.png b/src/Icons/flags/tv.png new file mode 100755 index 000000000..28274c5fb Binary files /dev/null and b/src/Icons/flags/tv.png differ diff --git a/src/Icons/flags/tw.png b/src/Icons/flags/tw.png new file mode 100755 index 000000000..f31c654c9 Binary files /dev/null and b/src/Icons/flags/tw.png differ diff --git a/src/Icons/flags/tz.png b/src/Icons/flags/tz.png new file mode 100755 index 000000000..c00ff7961 Binary files /dev/null and b/src/Icons/flags/tz.png differ diff --git a/src/Icons/flags/ua.png b/src/Icons/flags/ua.png new file mode 100755 index 000000000..09563a219 Binary files /dev/null and b/src/Icons/flags/ua.png differ diff --git a/src/Icons/flags/ug.png b/src/Icons/flags/ug.png new file mode 100755 index 000000000..33f4affad Binary files /dev/null and b/src/Icons/flags/ug.png differ diff --git a/src/Icons/flags/ukraine.png b/src/Icons/flags/ukraine.png deleted file mode 100644 index 18c059088..000000000 Binary files a/src/Icons/flags/ukraine.png and /dev/null differ diff --git a/src/Icons/flags/um.png b/src/Icons/flags/um.png new file mode 100755 index 000000000..c1dd9654b Binary files /dev/null and b/src/Icons/flags/um.png differ diff --git a/src/Icons/flags/united_arab_emirates.png b/src/Icons/flags/united_arab_emirates.png deleted file mode 100644 index 811584668..000000000 Binary files a/src/Icons/flags/united_arab_emirates.png and /dev/null differ diff --git a/src/Icons/flags/united_kingdom.png b/src/Icons/flags/united_kingdom.png deleted file mode 100644 index b3ad272c9..000000000 Binary files a/src/Icons/flags/united_kingdom.png and /dev/null differ diff --git a/src/Icons/flags/us.png b/src/Icons/flags/us.png new file mode 100755 index 000000000..10f451fe8 Binary files /dev/null and b/src/Icons/flags/us.png differ diff --git a/src/Icons/flags/usa.png b/src/Icons/flags/usa.png deleted file mode 100644 index 2395fd837..000000000 Binary files a/src/Icons/flags/usa.png and /dev/null differ diff --git a/src/Icons/flags/uy.png b/src/Icons/flags/uy.png new file mode 100755 index 000000000..31d948a06 Binary files /dev/null and b/src/Icons/flags/uy.png differ diff --git a/src/Icons/flags/uz.png b/src/Icons/flags/uz.png new file mode 100755 index 000000000..fef5dc170 Binary files /dev/null and b/src/Icons/flags/uz.png differ diff --git a/src/Icons/flags/va.png b/src/Icons/flags/va.png new file mode 100755 index 000000000..b31eaf225 Binary files /dev/null and b/src/Icons/flags/va.png differ diff --git a/src/Icons/flags/vc.png b/src/Icons/flags/vc.png new file mode 100755 index 000000000..8fa17b061 Binary files /dev/null and b/src/Icons/flags/vc.png differ diff --git a/src/Icons/flags/ve.png b/src/Icons/flags/ve.png new file mode 100755 index 000000000..00c90f9af Binary files /dev/null and b/src/Icons/flags/ve.png differ diff --git a/src/Icons/flags/vg.png b/src/Icons/flags/vg.png new file mode 100755 index 000000000..415690798 Binary files /dev/null and b/src/Icons/flags/vg.png differ diff --git a/src/Icons/flags/vi.png b/src/Icons/flags/vi.png new file mode 100755 index 000000000..ed26915a3 Binary files /dev/null and b/src/Icons/flags/vi.png differ diff --git a/src/Icons/flags/vn.png b/src/Icons/flags/vn.png new file mode 100755 index 000000000..ec7cd48a3 Binary files /dev/null and b/src/Icons/flags/vn.png differ diff --git a/src/Icons/flags/vu.png b/src/Icons/flags/vu.png new file mode 100755 index 000000000..b3397bc63 Binary files /dev/null and b/src/Icons/flags/vu.png differ diff --git a/src/Icons/flags/wf.png b/src/Icons/flags/wf.png new file mode 100755 index 000000000..9f9558734 Binary files /dev/null and b/src/Icons/flags/wf.png differ diff --git a/src/Icons/flags/ws.png b/src/Icons/flags/ws.png new file mode 100755 index 000000000..c16950802 Binary files /dev/null and b/src/Icons/flags/ws.png differ diff --git a/src/Icons/flags/ye.png b/src/Icons/flags/ye.png new file mode 100755 index 000000000..468dfad03 Binary files /dev/null and b/src/Icons/flags/ye.png differ diff --git a/src/Icons/flags/yt.png b/src/Icons/flags/yt.png new file mode 100755 index 000000000..c298f378b Binary files /dev/null and b/src/Icons/flags/yt.png differ diff --git a/src/Icons/flags/za.png b/src/Icons/flags/za.png new file mode 100755 index 000000000..57c58e211 Binary files /dev/null and b/src/Icons/flags/za.png differ diff --git a/src/Icons/flags/zm.png b/src/Icons/flags/zm.png new file mode 100755 index 000000000..c25b07bee Binary files /dev/null and b/src/Icons/flags/zm.png differ diff --git a/src/Icons/flags/zw.png b/src/Icons/flags/zw.png new file mode 100755 index 000000000..53c97259b Binary files /dev/null and b/src/Icons/flags/zw.png differ diff --git a/src/geoip.h b/src/geoip.h deleted file mode 100644 index 7a426cf45..000000000 --- a/src/geoip.h +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Bittorrent Client using Qt4 and libtorrent. - * Copyright (C) 2006 Christophe Dumez - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program 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 General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - * In addition, as a special exception, the copyright holders give permission to - * link this program with the OpenSSL project's "OpenSSL" library (or with - * modified versions of it that use the same license as the "OpenSSL" library), - * and distribute the linked executables. You must obey the GNU General Public - * License in all respects for all of the code used other than "OpenSSL". If you - * modify file(s), you may extend this exception to your version of the file(s), - * but you are not obligated to do so. If you do not wish to do so, delete this - * exception statement from your version. - * - * Contact : chris@qbittorrent.org - */ - -#ifndef GEOIP_H -#define GEOIP_H - -#include -#include -#include -#include -#include -#include "misc.h" - -using namespace libtorrent; - -class GeoIP : public QObject { - Q_OBJECT -protected: -#ifdef WITH_GEOIP_EMBEDDED - static QString geoipFolder(bool embedded=false) { - if(embedded) - return ":/geoip/"; - return misc::QDesktopServicesDataLocation()+"geoip"+QDir::separator(); -#else - static QString geoipFolder(bool) { - if(QFile::exists("/usr/local/share/GeoIP/GeoIP.dat")) - return "/usr/local/share/GeoIP/"; - if(QFile::exists("/var/lib/GeoIP/GeoIP.dat")) - return "/var/lib/GeoIP/"; - return "/usr/share/GeoIP/"; -#endif - } - - static QString geoipDBpath(bool embedded=false) { - return geoipFolder(embedded)+"GeoIP.dat"; - } - -#ifdef WITH_GEOIP_EMBEDDED - static void exportEmbeddedDb() { - if(!QFile::exists(geoipDBpath(false)) || QFile(geoipDBpath(false)).size() != QFile(geoipDBpath(true)).size()) { // Export is required - qDebug("A local Geoip database update is required, proceeding..."); - // Create geoip folder is necessary - QDir gfolder(geoipFolder(false)); - if(!gfolder.exists()) { - if(!gfolder.mkpath(geoipFolder(false))) { - std::cerr << "Failed to create geoip folder at " << qPrintable(geoipFolder(false)) << std::endl; - return; - } - } - // Remove destination files - if(QFile::exists(geoipDBpath(false))) - misc::safeRemove(geoipDBpath(false)); - // Copy from executable to hard disk - qDebug("%s -> %s", qPrintable(geoipDBpath(true)), qPrintable(geoipDBpath(false))); - if(!QFile::copy(geoipDBpath(true), geoipDBpath(false))) { - std::cerr << "ERROR: Failed to copy geoip.dat from executable to hard disk" << std::endl; - } - qDebug("Local Geoip database was updated"); - } - } -#endif - -public: - static void loadDatabase(session *s) { - #ifdef WITH_GEOIP_EMBEDDED - exportEmbeddedDb(); -#endif - if(QFile::exists(geoipDBpath(false))) { - qDebug("Loading GeoIP database from %s...", qPrintable(geoipDBpath(false))); - if(!s->load_country_db(geoipDBpath(false).toLocal8Bit().constData())) { - std::cerr << "Failed to load Geoip Database at " << qPrintable(geoipDBpath(false)) << std::endl; - } - } else { - qDebug("ERROR: Impossible to find local Geoip Database"); - } - } - - // TODO: Support more countries - // http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm - static QIcon CountryISOCodeToIcon(const char* iso, QString &country_name) { - switch(iso[0]) { - case 0: - case '-': - case '!': - //qDebug("Not returning any icon because iso is invalid: %s", iso); - return QIcon(); - case 'A': - if(iso[1] == 'U') { country_name = tr("Australia"); return QIcon(":/Icons/flags/australia.png"); } - if(iso[1] == 'R') { country_name = tr("Argentina"); return QIcon(":/Icons/flags/argentina.png"); } - if(iso[1] == 'T') { country_name = tr("Austria"); return QIcon(":/Icons/flags/austria.png"); } - if(iso[1] == 'E') { country_name = tr("United Arab Emirates"); return QIcon(":/Icons/flags/united_arab_emirates.png"); } - break; - case 'B': - if(iso[1] == 'R') { country_name = tr("Brazil"); return QIcon(":/Icons/flags/brazil.png"); } - if(iso[1] == 'G') { country_name = tr("Bulgaria"); return QIcon(":/Icons/flags/bulgaria.png"); } - if(iso[1] == 'Y') { country_name = tr("Belarus"); return QIcon(":/Icons/flags/belarus.png"); } - if(iso[1] == 'E') { country_name = tr("Belgium"); return QIcon(":/Icons/flags/belgium.png"); } - if(iso[1] == 'A') { country_name = tr("Bosnia"); return QIcon(":/Icons/flags/bosnia.png"); } - break; - case 'C': - if(iso[1] == 'A') { country_name = tr("Canada"); return QIcon(":/Icons/flags/canada.png"); } - if(iso[1] == 'Z') { country_name = tr("Czech Republic"); return QIcon(":/Icons/flags/czech.png"); } - if(iso[1] == 'N') { country_name = tr("China"); return QIcon(":/Icons/flags/china.png"); } - if(iso[1] == 'R') { country_name = tr("Costa Rica"); return QIcon(":/Icons/flags/costa_rica.png"); } - if(iso[1] == 'H') { country_name = tr("Switzerland"); return QIcon(":/Icons/flags/suisse.png"); } - break; - case 'D': - if(iso[1] == 'E') { country_name = tr("Germany"); return QIcon(":/Icons/flags/germany.png"); } - if(iso[1] == 'K') { country_name = tr("Denmark"); return QIcon(":/Icons/flags/denmark.png"); } - if(iso[1] == 'Z') { country_name = tr("Algeria"); return QIcon(":/Icons/flags/algeria.png"); } - break; - case 'E': - if(iso[1] == 'S') { country_name = tr("Spain"); return QIcon(":/Icons/flags/spain.png"); } - if(iso[1] == 'G') { country_name = tr("Egypt"); return QIcon(":/Icons/flags/egypt.png"); } - break; - case 'F': - if(iso[1] == 'I') { country_name = tr("Finland"); return QIcon(":/Icons/flags/finland.png"); } - if(iso[1] == 'R') { country_name = tr("France"); return QIcon(":/Icons/flags/france.png"); } - break; - case 'G': - if(iso[1] == 'B') { country_name = tr("United Kingdom"); return QIcon(":/Icons/flags/united_kingdom.png"); } - if(iso[1] == 'R') { country_name = tr("Greece"); return QIcon(":/Icons/flags/greece.png"); } - if(iso[1] == 'E') { country_name = tr("Georgia"); return QIcon(":/Icons/flags/georgia.png"); } - break; - case 'H': - if(iso[1] == 'U') { country_name = tr("Hungary"); return QIcon(":/Icons/flags/hungary.png"); } - if(iso[1] == 'K') { country_name = tr("China"); return QIcon(":/Icons/flags/china.png"); } - if(iso[1] == 'R') { country_name = tr("Croatia"); return QIcon(":/Icons/flags/croatia.png"); } - break; - case 'I': - if(iso[1] == 'T') { country_name = tr("Italy"); return QIcon(":/Icons/flags/italy.png"); } - if(iso[1] == 'N') { country_name = tr("India"); return QIcon(":/Icons/flags/india.png"); } - if(iso[1] == 'L') { country_name = tr("Israel"); return QIcon(":/Icons/flags/israel.png"); } - if(iso[1] == 'E') { country_name = tr("Ireland"); return QIcon(":/Icons/flags/ireland.png"); } - if(iso[1] == 'S') { country_name = tr("Iceland"); return QIcon(":/Icons/flags/iceland.png"); } - if(iso[1] == 'D') { country_name = tr("Indonesia"); return QIcon(":/Icons/flags/indonesia.png"); } - break; - case 'J': - if(iso[1] == 'P') { country_name = tr("Japan"); return QIcon(":/Icons/flags/japan.png"); } - break; - case 'K': - if(iso[1] == 'R') { country_name = tr("South Korea"); return QIcon(":/Icons/flags/south_korea.png"); } - break; - case 'L': - if(iso[1] == 'U') { country_name = tr("Luxembourg"); return QIcon(":/Icons/flags/luxembourg.png"); } - break; - case 'M': - if(iso[1] == 'Y') { country_name = tr("Malaysia"); return QIcon(":/Icons/flags/malaysia.png"); } - if(iso[1] == 'X') { country_name = tr("Mexico"); return QIcon(":/Icons/flags/mexico.png"); } - if(iso[1] == 'E') { country_name = tr("Serbia"); return QIcon(":/Icons/flags/serbia.png"); } - if(iso[1] == 'A') { country_name = tr("Morocco"); return QIcon(":/Icons/flags/morocco.png"); } - break; - case 'N': - if(iso[1] == 'L') { country_name = tr("Netherlands"); return QIcon(":/Icons/flags/netherlands.png"); } - if(iso[1] == 'O') { country_name = tr("Norway"); return QIcon(":/Icons/flags/norway.png"); } - if(iso[1] == 'Z') { country_name = tr("New Zealand"); return QIcon(":/Icons/flags/newzealand.png"); } - break; - case 'P': - if(iso[1] == 'T') { country_name = tr("Portugal"); return QIcon(":/Icons/flags/portugal.png"); } - if(iso[1] == 'L') { country_name = tr("Poland"); return QIcon(":/Icons/flags/poland.png"); } - if(iso[1] == 'K') { country_name = tr("Pakistan"); return QIcon(":/Icons/flags/pakistan.png"); } - if(iso[1] == 'H') { country_name = tr("Philippines"); return QIcon(":/Icons/flags/philippines.png"); } - break; - case 'R': - if(iso[1] == 'U') { country_name = tr("Russia"); return QIcon(":/Icons/flags/russia.png"); } - if(iso[1] == 'O') { country_name = tr("Romania"); return QIcon(":/Icons/flags/romania.png"); } - if(iso[1] == 'E') { country_name = tr("France (Reunion Island)"); return QIcon(":/Icons/flags/france.png"); } - if(iso[1] == 'S') { country_name = tr("Serbia"); return QIcon(":/Icons/flags/serbia.png"); } - break; - case 'S': - if(iso[1] == 'A') { country_name = tr("Saudi Arabia"); return QIcon(":/Icons/flags/saoudi_arabia.png"); } - if(iso[1] == 'E') { country_name = tr("Sweden"); return QIcon(":/Icons/flags/sweden.png"); } - if(iso[1] == 'K') { country_name = tr("Slovakia"); return QIcon(":/Icons/flags/slovakia.png"); } - if(iso[1] == 'G') { country_name = tr("Singapore"); return QIcon(":/Icons/flags/singapore.png"); } - if(iso[1] == 'I') { country_name = tr("Slovenia"); return QIcon(":/Icons/flags/slovenia.png"); } - break; - case 'T': - if(iso[1] == 'W') { country_name = tr("Taiwan"); return QIcon(":/Icons/flags/china.png"); } - if(iso[1] == 'R') { country_name = tr("Turkey"); return QIcon(":/Icons/flags/turkey.png"); } - if(iso[1] == 'H') { country_name = tr("Thailand"); return QIcon(":/Icons/flags/thailand.png"); } - break; - case 'U': - if(iso[1] == 'S') { country_name = tr("USA"); return QIcon(":/Icons/flags/usa.png"); } - if(iso[1] == 'M') { country_name = tr("USA"); return QIcon(":/Icons/flags/usa.png"); } - if(iso[1] == 'A') { country_name = tr("Ukraine"); return QIcon(":/Icons/flags/ukraine.png"); } - break; - case 'Z': - if(iso[1] == 'A') { country_name = tr("South Africa"); return QIcon(":/Icons/flags/south_africa.png"); } - break; - } - qDebug("Unrecognized country code: %c%c", iso[0], iso[1]); - return QIcon(); - } -}; - -#endif // GEOIP_H diff --git a/src/geoipmanager.cpp b/src/geoipmanager.cpp new file mode 100644 index 000000000..1983d3860 --- /dev/null +++ b/src/geoipmanager.cpp @@ -0,0 +1,204 @@ +/* + * Bittorrent Client using Qt4 and libtorrent. + * Copyright (C) 2010 Christophe Dumez + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * In addition, as a special exception, the copyright holders give permission to + * link this program with the OpenSSL project's "OpenSSL" library (or with + * modified versions of it that use the same license as the "OpenSSL" library), + * and distribute the linked executables. You must obey the GNU General Public + * License in all respects for all of the code used other than "OpenSSL". If you + * modify file(s), you may extend this exception to your version of the file(s), + * but you are not obligated to do so. If you do not wish to do so, delete this + * exception statement from your version. + * + * Contact : chris@qbittorrent.org + */ + +#include "geoipmanager.h" + +/* + * Bittorrent Client using Qt4 and libtorrent. + * Copyright (C) 2010 Christophe Dumez + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * In addition, as a special exception, the copyright holders give permission to + * link this program with the OpenSSL project's "OpenSSL" library (or with + * modified versions of it that use the same license as the "OpenSSL" library), + * and distribute the linked executables. You must obey the GNU General Public + * License in all respects for all of the code used other than "OpenSSL". If you + * modify file(s), you may extend this exception to your version of the file(s), + * but you are not obligated to do so. If you do not wish to do so, delete this + * exception statement from your version. + * + * Contact : chris@qbittorrent.org + */ + +#include +#include +#include + +#include "misc.h" + +using namespace libtorrent; + +QString GeoIPManager::geoipFolder(bool embedded) { +#ifdef WITH_GEOIP_EMBEDDED + if(embedded) + return ":/geoip/"; + return misc::QDesktopServicesDataLocation()+"geoip"+QDir::separator(); +#else + Q_UNUSED(embedded); + if(QFile::exists("/usr/local/share/GeoIP/GeoIP.dat")) + return "/usr/local/share/GeoIP/"; + if(QFile::exists("/var/lib/GeoIP/GeoIP.dat")) + return "/var/lib/GeoIP/"; + return "/usr/share/GeoIP/"; +#endif +} + +QString GeoIPManager::geoipDBpath(bool embedded) { + return geoipFolder(embedded)+"GeoIP.dat"; +} + +#ifdef WITH_GEOIP_EMBEDDED +void GeoIPManager::exportEmbeddedDb() { + if(!QFile::exists(geoipDBpath(false)) || QFile(geoipDBpath(false)).size() != QFile(geoipDBpath(true)).size()) { // Export is required + qDebug("A local Geoip database update is required, proceeding..."); + // Create geoip folder is necessary + QDir gfolder(geoipFolder(false)); + if(!gfolder.exists()) { + if(!gfolder.mkpath(geoipFolder(false))) { + std::cerr << "Failed to create geoip folder at " << qPrintable(geoipFolder(false)) << std::endl; + return; + } + } + // Remove destination files + if(QFile::exists(geoipDBpath(false))) + misc::safeRemove(geoipDBpath(false)); + // Copy from executable to hard disk + qDebug("%s -> %s", qPrintable(geoipDBpath(true)), qPrintable(geoipDBpath(false))); + if(!QFile::copy(geoipDBpath(true), geoipDBpath(false))) { + std::cerr << "ERROR: Failed to copy geoip.dat from executable to hard disk" << std::endl; + } + qDebug("Local Geoip database was updated"); + } +} +#endif + +void GeoIPManager::loadDatabase(session *s) { +#ifdef WITH_GEOIP_EMBEDDED + exportEmbeddedDb(); +#endif + if(QFile::exists(geoipDBpath(false))) { + qDebug("Loading GeoIP database from %s...", qPrintable(geoipDBpath(false))); + if(!s->load_country_db(geoipDBpath(false).toLocal8Bit().constData())) { + std::cerr << "Failed to load Geoip Database at " << qPrintable(geoipDBpath(false)) << std::endl; + } + } else { + qDebug("ERROR: Impossible to find local Geoip Database"); + } +} + +const char country_code[253][3] = +{ "--","AP","EU","AD","AE","AF","AG","AI","AL","AM","AN", + "AO","AQ","AR","AS","AT","AU","AW","AZ","BA","BB", + "BD","BE","BF","BG","BH","BI","BJ","BM","BN","BO", + "BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD", + "CF","CG","CH","CI","CK","CL","CM","CN","CO","CR", + "CU","CV","CX","CY","CZ","DE","DJ","DK","DM","DO", + "DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ", + "FK","FM","FO","FR","FX","GA","GB","GD","GE","GF", + "GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT", + "GU","GW","GY","HK","HM","HN","HR","HT","HU","ID", + "IE","IL","IN","IO","IQ","IR","IS","IT","JM","JO", + "JP","KE","KG","KH","KI","KM","KN","KP","KR","KW", + "KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT", + "LU","LV","LY","MA","MC","MD","MG","MH","MK","ML", + "MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV", + "MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI", + "NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF", + "PG","PH","PK","PL","PM","PN","PR","PS","PT","PW", + "PY","QA","RE","RO","RU","RW","SA","SB","SC","SD", + "SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO", + "SR","ST","SV","SY","SZ","TC","TD","TF","TG","TH", + "TJ","TK","TM","TN","TO","TL","TR","TT","TV","TW", + "TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE", + "VG","VI","VN","VU","WF","WS","YE","YT","RS","ZA", + "ZM","ME","ZW","A1","A2","O1","AX","GG","IM","JE", + "BL","MF"}; + +static const uint num_countries = (unsigned)(sizeof(country_code)/sizeof(country_code[0])); + +const char * country_name[253] = +{"N/A","Asia/Pacific Region","Europe","Andorra","United Arab Emirates","Afghanistan","Antigua and Barbuda","Anguilla","Albania","Armenia","Netherlands Antilles", + "Angola","Antarctica","Argentina","American Samoa","Austria","Australia","Aruba","Azerbaijan","Bosnia and Herzegovina","Barbados", + "Bangladesh","Belgium","Burkina Faso","Bulgaria","Bahrain","Burundi","Benin","Bermuda","Brunei Darussalam","Bolivia", + "Brazil","Bahamas","Bhutan","Bouvet Island","Botswana","Belarus","Belize","Canada","Cocos (Keeling) Islands","Congo, The Democratic Republic of the", + "Central African Republic","Congo","Switzerland","Cote D'Ivoire","Cook Islands","Chile","Cameroon","China","Colombia","Costa Rica", + "Cuba","Cape Verde","Christmas Island","Cyprus","Czech Republic","Germany","Djibouti","Denmark","Dominica","Dominican Republic", + "Algeria","Ecuador","Estonia","Egypt","Western Sahara","Eritrea","Spain","Ethiopia","Finland","Fiji", + "Falkland Islands (Malvinas)","Micronesia, Federated States of","Faroe Islands","France","France, Metropolitan","Gabon","United Kingdom","Grenada","Georgia","French Guiana", + "Ghana","Gibraltar","Greenland","Gambia","Guinea","Guadeloupe","Equatorial Guinea","Greece","South Georgia and the South Sandwich Islands","Guatemala", + "Guam","Guinea-Bissau","Guyana","Hong Kong","Heard Island and McDonald Islands","Honduras","Croatia","Haiti","Hungary","Indonesia", + "Ireland","Israel","India","British Indian Ocean Territory","Iraq","Iran, Islamic Republic of","Iceland","Italy","Jamaica","Jordan", + "Japan","Kenya","Kyrgyzstan","Cambodia","Kiribati","Comoros","Saint Kitts and Nevis","Korea, Democratic People's Republic of","Korea, Republic of","Kuwait", + "Cayman Islands","Kazakhstan","Lao People's Democratic Republic","Lebanon","Saint Lucia","Liechtenstein","Sri Lanka","Liberia","Lesotho","Lithuania", + "Luxembourg","Latvia","Libyan Arab Jamahiriya","Morocco","Monaco","Moldova, Republic of","Madagascar","Marshall Islands","Macedonia","Mali", + "Myanmar","Mongolia","Macau","Northern Mariana Islands","Martinique","Mauritania","Montserrat","Malta","Mauritius","Maldives", + "Malawi","Mexico","Malaysia","Mozambique","Namibia","New Caledonia","Niger","Norfolk Island","Nigeria","Nicaragua", + "Netherlands","Norway","Nepal","Nauru","Niue","New Zealand","Oman","Panama","Peru","French Polynesia", + "Papua New Guinea","Philippines","Pakistan","Poland","Saint Pierre and Miquelon","Pitcairn Islands","Puerto Rico","Palestinian Territory","Portugal","Palau", + "Paraguay","Qatar","Reunion","Romania","Russian Federation","Rwanda","Saudi Arabia","Solomon Islands","Seychelles","Sudan", + "Sweden","Singapore","Saint Helena","Slovenia","Svalbard and Jan Mayen","Slovakia","Sierra Leone","San Marino","Senegal","Somalia","Suriname", + "Sao Tome and Principe","El Salvador","Syrian Arab Republic","Swaziland","Turks and Caicos Islands","Chad","French Southern Territories","Togo","Thailand", + "Tajikistan","Tokelau","Turkmenistan","Tunisia","Tonga","Timor-Leste","Turkey","Trinidad and Tobago","Tuvalu","Taiwan", + "Tanzania, United Republic of","Ukraine","Uganda","United States Minor Outlying Islands","United States","Uruguay","Uzbekistan","Holy See (Vatican City State)","Saint Vincent and the Grenadines","Venezuela", + "Virgin Islands, British","Virgin Islands, U.S.","Vietnam","Vanuatu","Wallis and Futuna","Samoa","Yemen","Mayotte","Serbia","South Africa", + "Zambia","Montenegro","Zimbabwe","Anonymous Proxy","Satellite Provider","Other","Aland Islands","Guernsey","Isle of Man","Jersey", + "Saint Barthelemy","Saint Martin"}; + +QString GeoIPManager::CountryISOCodeToName(const char* iso) { + if(iso[0] == 0) return "N/A"; + for(uint i = 0; i < num_countries; ++i) { + if(iso[0] == country_code[i][0] && iso[1] == country_code[i][1]) { + return QLatin1String(country_name[i]); + } + } + qDebug("GeoIPManager: Country name resolution failed for: %c%c", iso[0], iso[1]); + return "N/A"; +} + +// http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm +QIcon GeoIPManager::CountryISOCodeToIcon(const char* iso) { + if(iso[0] == 0 || iso[0] == '!') return QIcon(); + const QString isoStr = QString(QByteArray(iso, 2)).toLower(); + return QIcon(":/Icons/flags/"+isoStr+".png"); +} + diff --git a/src/geoipmanager.h b/src/geoipmanager.h new file mode 100644 index 000000000..00bb730fa --- /dev/null +++ b/src/geoipmanager.h @@ -0,0 +1,55 @@ +/* + * Bittorrent Client using Qt4 and libtorrent. + * Copyright (C) 2010 Christophe Dumez + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + * In addition, as a special exception, the copyright holders give permission to + * link this program with the OpenSSL project's "OpenSSL" library (or with + * modified versions of it that use the same license as the "OpenSSL" library), + * and distribute the linked executables. You must obey the GNU General Public + * License in all respects for all of the code used other than "OpenSSL". If you + * modify file(s), you may extend this exception to your version of the file(s), + * but you are not obligated to do so. If you do not wish to do so, delete this + * exception statement from your version. + * + * Contact : chris@qbittorrent.org + */ + +#ifndef GEOIPMANAGER_H +#define GEOIPMANAGER_H + +#include +#include +#include + +class GeoIPManager : public QObject { + Q_OBJECT + +public: + static void loadDatabase(libtorrent::session *s); + static QIcon CountryISOCodeToIcon(const char* iso); + static QString CountryISOCodeToName(const char* iso); + +private: + static QString geoipFolder(bool embedded=false); + static QString geoipDBpath(bool embedded=false); +#ifdef WITH_GEOIP_EMBEDDED + static void exportEmbeddedDb(); +#endif +}; + + +#endif // GEOIP_H diff --git a/src/icons.qrc b/src/icons.qrc index a399de7a3..9dea07a47 100644 --- a/src/icons.qrc +++ b/src/icons.qrc @@ -63,66 +63,247 @@ Icons/skin/filteractive.png Icons/skin/bg-handle-horizontal.gif Icons/skin/download.png - Icons/flags/pakistan.png - Icons/flags/argentina.png - Icons/flags/netherlands.png - Icons/flags/australia.png - Icons/flags/finland.png - Icons/flags/croatia.png - Icons/flags/indonesia.png - Icons/flags/greece.png - Icons/flags/belarus.png - Icons/flags/morocco.png - Icons/flags/portugal.png - Icons/flags/egypt.png - Icons/flags/georgia.png - Icons/flags/costa_rica.png - Icons/flags/denmark.png - Icons/flags/bosnia.png - Icons/flags/newzealand.png - Icons/flags/serbia.png - Icons/flags/singapore.png - Icons/flags/italy.png - Icons/flags/brazil.png - Icons/flags/taiwan.png - Icons/flags/south_korea.png - Icons/flags/turkey.png - Icons/flags/algeria.png - Icons/flags/japan.png - Icons/flags/luxembourg.png - Icons/flags/poland.png - Icons/flags/iceland.png - Icons/flags/spain.png - Icons/flags/saoudi_arabia.png - Icons/flags/norway.png - Icons/flags/russia.png - Icons/flags/slovakia.png - Icons/flags/philippines.png - Icons/flags/thailand.png - Icons/flags/israel.png - Icons/flags/bulgaria.png - Icons/flags/czech.png - Icons/flags/usa.png - Icons/flags/malaysia.png - Icons/flags/belgium.png - Icons/flags/south_africa.png - Icons/flags/slovenia.png - Icons/flags/china.png - Icons/flags/germany.png - Icons/flags/ukraine.png - Icons/flags/india.png - Icons/flags/spain_catalunya.png - Icons/flags/romania.png - Icons/flags/united_kingdom.png - Icons/flags/united_arab_emirates.png - Icons/flags/sweden.png - Icons/flags/canada.png - Icons/flags/mexico.png - Icons/flags/hungary.png - Icons/flags/france.png - Icons/flags/ireland.png - Icons/flags/austria.png - Icons/flags/suisse.png + Icons/flags/sm.png + Icons/flags/lt.png + Icons/flags/th.png + Icons/flags/sd.png + Icons/flags/mr.png + Icons/flags/by.png + Icons/flags/sc.png + Icons/flags/mz.png + Icons/flags/tt.png + Icons/flags/kp.png + Icons/flags/re.png + Icons/flags/um.png + Icons/flags/ec.png + Icons/flags/fk.png + Icons/flags/aw.png + Icons/flags/lb.png + Icons/flags/vg.png + Icons/flags/do.png + Icons/flags/ee.png + Icons/flags/ck.png + Icons/flags/gn.png + Icons/flags/cg.png + Icons/flags/ao.png + Icons/flags/dk.png + Icons/flags/ms.png + Icons/flags/sg.png + Icons/flags/bw.png + Icons/flags/br.png + Icons/flags/cn.png + Icons/flags/ua.png + Icons/flags/ae.png + Icons/flags/tg.png + Icons/flags/ge.png + Icons/flags/ne.png + Icons/flags/km.png + Icons/flags/bf.png + Icons/flags/nf.png + Icons/flags/az.png + Icons/flags/sl.png + Icons/flags/md.png + Icons/flags/ph.png + Icons/flags/mc.png + Icons/flags/mq.png + Icons/flags/ng.png + Icons/flags/vu.png + Icons/flags/et.png + Icons/flags/bj.png + Icons/flags/nl.png + Icons/flags/ad.png + Icons/flags/tv.png + Icons/flags/fj.png + Icons/flags/to.png + Icons/flags/ru.png + Icons/flags/jp.png + Icons/flags/ma.png + Icons/flags/bz.png + Icons/flags/vn.png + Icons/flags/bt.png + Icons/flags/ht.png + Icons/flags/kw.png + Icons/flags/tr.png + Icons/flags/sy.png + Icons/flags/nr.png + Icons/flags/nz.png + Icons/flags/np.png + Icons/flags/uz.png + Icons/flags/in.png + Icons/flags/ga.png + Icons/flags/sa.png + Icons/flags/tl.png + Icons/flags/ly.png + Icons/flags/lr.png + Icons/flags/cz.png + Icons/flags/bm.png + Icons/flags/us.png + Icons/flags/ye.png + Icons/flags/gs.png + Icons/flags/sb.png + Icons/flags/hm.png + Icons/flags/ke.png + Icons/flags/so.png + Icons/flags/ni.png + Icons/flags/cm.png + Icons/flags/li.png + Icons/flags/gp.png + Icons/flags/co.png + Icons/flags/kz.png + Icons/flags/de.png + Icons/flags/mm.png + Icons/flags/gb.png + Icons/flags/mx.png + Icons/flags/la.png + Icons/flags/au.png + Icons/flags/gu.png + Icons/flags/gw.png + Icons/flags/lc.png + Icons/flags/st.png + Icons/flags/nc.png + Icons/flags/ch.png + Icons/flags/cd.png + Icons/flags/mh.png + Icons/flags/pg.png + Icons/flags/bh.png + Icons/flags/kr.png + Icons/flags/is.png + Icons/flags/gh.png + Icons/flags/mp.png + Icons/flags/ca.png + Icons/flags/bi.png + Icons/flags/yt.png + Icons/flags/it.png + Icons/flags/kn.png + Icons/flags/ve.png + Icons/flags/cu.png + Icons/flags/bs.png + Icons/flags/rs.png + Icons/flags/tw.png + Icons/flags/bd.png + Icons/flags/pr.png + Icons/flags/lk.png + Icons/flags/sn.png + Icons/flags/gr.png + Icons/flags/gm.png + Icons/flags/na.png + Icons/flags/om.png + Icons/flags/tz.png + Icons/flags/as.png + Icons/flags/no.png + Icons/flags/mv.png + Icons/flags/ki.png + Icons/flags/eg.png + Icons/flags/tj.png + Icons/flags/sj.png + Icons/flags/fi.png + Icons/flags/lv.png + Icons/flags/cx.png + Icons/flags/ci.png + Icons/flags/vi.png + Icons/flags/be.png + Icons/flags/mw.png + Icons/flags/zw.png + Icons/flags/si.png + Icons/flags/dm.png + Icons/flags/jo.png + Icons/flags/hk.png + Icons/flags/me.png + Icons/flags/va.png + Icons/flags/pm.png + Icons/flags/qa.png + Icons/flags/cc.png + Icons/flags/kh.png + Icons/flags/id.png + Icons/flags/ai.png + Icons/flags/mn.png + Icons/flags/gd.png + Icons/flags/mt.png + Icons/flags/gq.png + Icons/flags/hr.png + Icons/flags/sv.png + Icons/flags/dz.png + Icons/flags/kg.png + Icons/flags/gy.png + Icons/flags/bv.png + Icons/flags/ag.png + Icons/flags/hn.png + Icons/flags/ml.png + Icons/flags/fo.png + Icons/flags/pw.png + Icons/flags/mg.png + Icons/flags/iq.png + Icons/flags/jm.png + Icons/flags/bo.png + Icons/flags/sk.png + Icons/flags/sh.png + Icons/flags/tf.png + Icons/flags/mk.png + Icons/flags/my.png + Icons/flags/es.png + Icons/flags/py.png + Icons/flags/ax.png + Icons/flags/ls.png + Icons/flags/tn.png + Icons/flags/ps.png + Icons/flags/bn.png + Icons/flags/dj.png + Icons/flags/cs.png + Icons/flags/pl.png + Icons/flags/cl.png + Icons/flags/pf.png + Icons/flags/gi.png + Icons/flags/bb.png + Icons/flags/ws.png + Icons/flags/cy.png + Icons/flags/pt.png + Icons/flags/ba.png + Icons/flags/gl.png + Icons/flags/ie.png + Icons/flags/fr.png + Icons/flags/tm.png + Icons/flags/er.png + Icons/flags/cr.png + Icons/flags/af.png + Icons/flags/mu.png + Icons/flags/lu.png + Icons/flags/pk.png + Icons/flags/am.png + Icons/flags/ar.png + Icons/flags/uy.png + Icons/flags/hu.png + Icons/flags/pn.png + Icons/flags/gf.png + Icons/flags/ir.png + Icons/flags/pe.png + Icons/flags/nu.png + Icons/flags/ro.png + Icons/flags/mo.png + Icons/flags/za.png + Icons/flags/ky.png + Icons/flags/zm.png + Icons/flags/se.png + Icons/flags/il.png + Icons/flags/fm.png + Icons/flags/sr.png + Icons/flags/pa.png + Icons/flags/cv.png + Icons/flags/tc.png + Icons/flags/an.png + Icons/flags/sz.png + Icons/flags/io.png + Icons/flags/rw.png + Icons/flags/eh.png + Icons/flags/cf.png + Icons/flags/gt.png + Icons/flags/al.png + Icons/flags/ug.png + Icons/flags/td.png + Icons/flags/at.png + Icons/flags/vc.png + Icons/flags/tk.png + Icons/flags/bg.png + Icons/flags/wf.png Icons/oxygen/peer.png Icons/oxygen/unavailable.png Icons/oxygen/subscribe.png diff --git a/src/options_imp.cpp b/src/options_imp.cpp index 65cbbf78d..30d95d741 100644 --- a/src/options_imp.cpp +++ b/src/options_imp.cpp @@ -76,67 +76,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ connect(buttonBox, SIGNAL(clicked(QAbstractButton*)), this, SLOT(applySettings(QAbstractButton*))); comboStyle->addItems(QStyleFactory::keys()); // Languages supported - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/united_kingdom.png"))), QString::fromUtf8("English")); - locales << "en_GB"; - comboI18n->setCurrentIndex(0); - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/france.png"))), QString::fromUtf8("Français")); - locales << "fr_FR"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/germany.png"))), QString::fromUtf8("Deutsch")); - locales << "de_DE"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/hungary.png"))), QString::fromUtf8("Magyar")); - locales << "hu_HU"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/italy.png"))), QString::fromUtf8("Italiano")); - locales << "it_IT"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/netherlands.png"))), QString::fromUtf8("Nederlands")); - locales << "nl_NL"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/spain.png"))), QString::fromUtf8("Español")); - locales << "es_ES"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/spain_catalunya.png"))), QString::fromUtf8("Català")); - locales << "ca_ES"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/portugal.png"))), QString::fromUtf8("Português")); - locales << "pt_PT"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/brazil.png"))), QString::fromUtf8("Português brasileiro")); - locales << "pt_BR"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/poland.png"))), QString::fromUtf8("Polski")); - locales << "pl_PL"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/czech.png"))), QString::fromUtf8("Čeština")); - locales << "cs_CZ"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/slovakia.png"))), QString::fromUtf8("Slovenčina")); - locales << "sk_SK"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/croatia.png"))), QString::fromUtf8("Hrvatski")); - locales << "hr_HR"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/serbia.png"))), QString::fromUtf8("Српски")); - locales << "sr_CS"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/romania.png"))), QString::fromUtf8("Română")); - locales << "ro_RO"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/turkey.png"))), QString::fromUtf8("Türkçe")); - locales << "tr_TR"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/saoudi_arabia.png"))), QString::fromUtf8("عربي")); - locales << "ar_SA"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/greece.png"))), QString::fromUtf8("Ελληνικά")); - locales << "el_GR"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/sweden.png"))), QString::fromUtf8("Svenska")); - locales << "sv_SE"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/finland.png"))), QString::fromUtf8("Suomi")); - locales << "fi_FI"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/norway.png"))), QString::fromUtf8("Norsk")); - locales << "nb_NO"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/denmark.png"))), QString::fromUtf8("Dansk")); - locales << "da_DK"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/bulgaria.png"))), QString::fromUtf8("Български")); - locales << "bg_BG"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/ukraine.png"))), QString::fromUtf8("Українська")); - locales << "uk_UA"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/russia.png"))), QString::fromUtf8("Русский")); - locales << "ru_RU"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/japan.png"))), QString::fromUtf8("日本語")); - locales << "ja_JP"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/china.png"))), QString::fromUtf8("中文 (简体)")); - locales << "zh_CN"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/taiwan.png"))), QString::fromUtf8("中文 (繁體)")); - locales << "zh_TW"; - comboI18n->addItem((QIcon(QString::fromUtf8(":/Icons/flags/south_korea.png"))), QString::fromUtf8("한글")); - locales << "ko_KR"; + initializeLanguageCombo(); // Load week days (scheduler) for(uint i=1; i<=7; ++i) { @@ -267,6 +207,22 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ loadWindowState(); } +void options_imp::initializeLanguageCombo() +{ + // List language files + const QDir lang_dir(":/lang"); + const QStringList lang_files = lang_dir.entryList(QStringList() << "qbittorrent_*.qm", QDir::Files); + foreach(QString lang_file, lang_files) { + QString localeStr = lang_file.mid(12); // remove "qbittorrent_" + localeStr.chop(3); // Remove ".qm" + QLocale locale(localeStr); + const QString country = locale.name().split("_").last().toLower(); + QString language_name = QLocale::languageToString(locale.language()); + comboI18n->addItem(QIcon(":/Icons/flags/"+country+".png"), language_name, locale.name()); + qDebug() << "Supported locale:" << locale.name(); + } +} + // Main destructor options_imp::~options_imp(){ qDebug("-> destructing Options"); @@ -1009,14 +965,19 @@ QString options_imp::getProxyPassword() const{ // Locale Settings QString options_imp::getLocale() const{ - return locales.at(comboI18n->currentIndex()); + return comboI18n->itemData(comboI18n->currentIndex(), Qt::UserRole).toString(); } -void options_imp::setLocale(QString locale){ - int indexLocales=locales.indexOf(QRegExp(locale)); - if(indexLocales != -1){ - comboI18n->setCurrentIndex(indexLocales); +void options_imp::setLocale(QString localeStr) { + QLocale locale(localeStr); + // Attempt to find exact match + int index = comboI18n->findData(locale.name(), Qt::UserRole); + if(index < 0) { + // Unreconized, use US English + index = comboI18n->findData(QLocale("en").name(), Qt::UserRole); + Q_ASSERT(index >= 0); } + comboI18n->setCurrentIndex(index); } QString options_imp::getExportDir() const { @@ -1180,3 +1141,4 @@ void options_imp::showConnectionTab() { tabSelection->setCurrentRow(2); } + diff --git a/src/options_imp.h b/src/options_imp.h index 68758167d..ca34f2bf0 100644 --- a/src/options_imp.h +++ b/src/options_imp.h @@ -45,23 +45,56 @@ class AdvancedSettings; class options_imp : public QDialog, private Ui_Preferences { Q_OBJECT -private: - QButtonGroup choiceLanguage; - QStringList locales; - QAbstractButton *applyButton; - AdvancedSettings *advancedSettings; - QList addedScanDirs; - public: // Contructor / Destructor options_imp(QWidget *parent=0); ~options_imp(); QSize sizeFittingScreen(); -protected: +protected slots: + void enableUploadLimit(bool checked); + void enableDownloadLimit(bool checked); + void enableProxy(int comboIndex); + void enableProxyAuth(bool checked); + void enableMaxConnecsLimit(bool checked); + void enableMaxConnecsLimitPerTorrent(bool checked); + void enableMaxUploadsLimitPerTorrent(bool checked); + void enableMaxRatio(bool checked); + void setStyle(QString style); + void on_buttonBox_accepted(); + void closeEvent(QCloseEvent *e); + void on_buttonBox_rejected(); + void applySettings(QAbstractButton* button); + void on_browseExportDirButton_clicked(); + void on_browseFilterButton_clicked(); + void on_browseSaveDirButton_clicked(); + void on_browseTempDirButton_clicked(); + void enableApplyButton(); + void enableSystrayOptions(); + void disableSystrayOptions(); + void setSystrayOptionsState(bool checked); + void changePage(QListWidgetItem*, QListWidgetItem*); + void loadWindowState(); + void saveWindowState() const; + void on_randomButton_clicked(); + void on_addScanFolderButton_clicked(); + void on_removeScanFolderButton_clicked(); + void handleScanFolderViewSelectionChanged(); + +public slots: + void setLocale(QString locale); + void useStyle(); + void showConnectionTab(); + +signals: + void status_changed() const; + void exitWithCancel(); + +private: // Methods void saveOptions(); void loadOptions(); + void initializeLanguageCombo(); // General options QString getLocale() const; QString getStyle() const; @@ -116,44 +149,12 @@ protected: QString webUiUsername() const; QString webUiPassword() const; -protected slots: - void enableUploadLimit(bool checked); - void enableDownloadLimit(bool checked); - void enableProxy(int comboIndex); - void enableProxyAuth(bool checked); - void enableMaxConnecsLimit(bool checked); - void enableMaxConnecsLimitPerTorrent(bool checked); - void enableMaxUploadsLimitPerTorrent(bool checked); - void enableMaxRatio(bool checked); - void setStyle(QString style); - void on_buttonBox_accepted(); - void closeEvent(QCloseEvent *e); - void on_buttonBox_rejected(); - void applySettings(QAbstractButton* button); - void on_browseExportDirButton_clicked(); - void on_browseFilterButton_clicked(); - void on_browseSaveDirButton_clicked(); - void on_browseTempDirButton_clicked(); - void enableApplyButton(); - void enableSystrayOptions(); - void disableSystrayOptions(); - void setSystrayOptionsState(bool checked); - void changePage(QListWidgetItem*, QListWidgetItem*); - void loadWindowState(); - void saveWindowState() const; - void on_randomButton_clicked(); - void on_addScanFolderButton_clicked(); - void on_removeScanFolderButton_clicked(); - void handleScanFolderViewSelectionChanged(); - -public slots: - void setLocale(QString locale); - void useStyle(); - void showConnectionTab(); +private: + QButtonGroup choiceLanguage; + QAbstractButton *applyButton; + AdvancedSettings *advancedSettings; + QList addedScanDirs; -signals: - void status_changed() const; - void exitWithCancel(); }; #endif diff --git a/src/preferences.h b/src/preferences.h index bbc556520..1764b27b9 100644 --- a/src/preferences.h +++ b/src/preferences.h @@ -36,6 +36,7 @@ #include #include #include +#include #include #ifndef DISABLE_GUI @@ -62,7 +63,9 @@ class Preferences : public QIniSettings { Q_DISABLE_COPY(Preferences); public: - Preferences() : QIniSettings("qBittorrent", "qBittorrent") {} + Preferences() : QIniSettings("qBittorrent", "qBittorrent") { + qDebug() << "Preferences constructor"; + } public: // General options @@ -174,7 +177,7 @@ public: QString getSavePath() const { #ifdef Q_WS_WIN return value(QString::fromUtf8("Preferences/Downloads/SavePath"), - QDir(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)).absoluteFilePath("Downloads")).toString(); + QDir(QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation)).absoluteFilePath("Downloads")).toString(); #else return value(QString::fromUtf8("Preferences/Downloads/SavePath"), QDir::home().absoluteFilePath("qBT_dir")).toString(); #endif diff --git a/src/properties/peerlistwidget.cpp b/src/properties/peerlistwidget.cpp index 9583d41e6..e1e28ebf7 100644 --- a/src/properties/peerlistwidget.cpp +++ b/src/properties/peerlistwidget.cpp @@ -33,7 +33,7 @@ #include "reverseresolution.h" #include "preferences.h" #include "propertieswidget.h" -#include "geoip.h" +#include "geoipmanager.h" #include "peeraddition.h" #include "speedlimitdlg.h" #include @@ -355,11 +355,10 @@ QStandardItem* PeerListWidget::addPeer(QString ip, peer_info peer) { if(resolver && host.isNull()) resolver->resolve(peer.ip); if(display_flags) { - QString country_name; - const QIcon ico = GeoIP::CountryISOCodeToIcon(peer.country, country_name); + const QIcon ico = GeoIPManager::CountryISOCodeToIcon(peer.country); if(!ico.isNull()) { listModel->setData(listModel->index(row, IP), ico, Qt::DecorationRole); - Q_ASSERT(!country_name.isEmpty()); + const QString country_name = GeoIPManager::CountryISOCodeToName(peer.country); listModel->setData(listModel->index(row, IP), country_name, Qt::ToolTipRole); } else { missingFlags.insert(ip); @@ -378,11 +377,10 @@ void PeerListWidget::updatePeer(QString ip, peer_info peer) { QStandardItem *item = peerItems.value(ip); int row = item->row(); if(display_flags) { - QString country_name; - const QIcon ico = GeoIP::CountryISOCodeToIcon(peer.country, country_name); + const QIcon ico = GeoIPManager::CountryISOCodeToIcon(peer.country); if(!ico.isNull()) { listModel->setData(listModel->index(row, IP), ico, Qt::DecorationRole); - Q_ASSERT(!country_name.isEmpty()); + const QString country_name = GeoIPManager::CountryISOCodeToName(peer.country); listModel->setData(listModel->index(row, IP), country_name, Qt::ToolTipRole); missingFlags.remove(ip); } diff --git a/src/qtlibtorrent/qbtsession.cpp b/src/qtlibtorrent/qbtsession.cpp index 2d446b3fb..fb6afc63b 100644 --- a/src/qtlibtorrent/qbtsession.cpp +++ b/src/qtlibtorrent/qbtsession.cpp @@ -46,7 +46,7 @@ #include "preferences.h" #include "scannedfoldersmodel.h" #ifndef DISABLE_GUI -#include "geoip.h" +#include "geoipmanager.h" #endif #include "torrentpersistentdata.h" #include "httpserver.h" @@ -356,7 +356,7 @@ void QBtSession::configureSession() { resolve_countries = new_resolv_countries; if(resolve_countries && !geoipDBLoaded) { qDebug("Loading geoip database"); - GeoIP::loadDatabase(s); + GeoIPManager::loadDatabase(s); geoipDBLoaded = true; } // Update torrent handles diff --git a/src/src.pro b/src/src.pro index 3f09cd693..33a1affb9 100644 --- a/src/src.pro +++ b/src/src.pro @@ -291,7 +291,6 @@ contains(DEFINES, DISABLE_GUI) { transferlistdelegate.h \ transferlistfilterswidget.h \ torrentfilesmodel.h \ - geoip.h \ deletionconfirmationdlg.h \ statusbar.h \ reverseresolution.h \ @@ -308,7 +307,8 @@ contains(DEFINES, DISABLE_GUI) { advancedsettings.h \ hidabletabwidget.h \ sessionapplication.h \ - torrentimportdlg.h + torrentimportdlg.h \ + geoipmanager.h win32 { HEADERS += programupdater.h @@ -380,7 +380,8 @@ SOURCES += main.cpp \ transferlistwidget.cpp \ torrentadditiondlg.cpp \ sessionapplication.cpp \ - torrentimportdlg.cpp + torrentimportdlg.cpp \ + geoipmanager.cpp win32 { SOURCES += programupdater.cpp