Guest User

Untitled

a guest
Sep 3rd, 2011
1,633
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 194.76 KB | None | 0 0
  1. #!/usr/bin/perl -w
  2.  
  3. # CheckGmail
  4. # Uses Atom feeds to check Gmail for new mail and displays status in
  5. # system tray; optionally saves password in encrypted form using
  6. # machine-unique passphrase
  7.  
  8. # version 1.14pre2-svn (4/11/2010)
  9. # Copyright © 2005-10 Owen Marshall
  10.  
  11. # This program is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 2 of the License, or (at
  14. # your option) any later version.
  15. #
  16. # This program is distributed in the hope that it will be useful, but
  17. # WITHOUT ANY WARRANTY; without even the implied warranty of
  18. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  19. # General Public License for more details.
  20. #
  21. # You should have received a copy of the GNU General Public License
  22. # along with this program; if not, write to the Free Software
  23. # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
  24. # USA
  25.  
  26. use strict;
  27. # use utf8;
  28.  
  29.  
  30. ###########################
  31. # Command-line processing
  32. #
  33.  
  34. # global variables (can't be set global in the BEGIN block)
  35. my ($version, $silent, $nocrypt, $update, $notsexy, $profile, $disable_monitors_check,
  36. $private, $cookies, $popup_size, $hosted_tmp, $show_popup_delay,
  37. $popup_persistence, $usekwallet, $libsexy, $nologin, $mailno, $debug);
  38. BEGIN {
  39. $version = "1.14pre2-svn";
  40. $silent = 1;
  41. $profile = "";
  42. $cookies = 1;
  43. $nologin = 1;
  44. $show_popup_delay = 250;
  45. $popup_persistence = 100;
  46.  
  47. # simple command line option switch ...
  48. foreach (@ARGV) {
  49. next unless m/\-(.*)/;
  50. for ($1) {
  51. /profile=(.*)/ && do {
  52. $profile = "-$1";
  53. last };
  54.  
  55. /private/ && do {
  56. $private = 1;
  57. last };
  58.  
  59. /silent/ && do {
  60. $silent = 1;
  61. last };
  62.  
  63. /disable-monitors-check/ && do {
  64. $disable_monitors_check = 1;
  65. last };
  66.  
  67. /no-libsexy/ && do {
  68. $notsexy = 1;
  69. last };
  70.  
  71. /no-login/ && do {
  72. $nologin = 1;
  73. last };
  74.  
  75. /cookie_login/ && do {
  76. $cookies = 1;
  77. last };
  78.  
  79. /no_cookies/ && do {
  80. $cookies = 0;
  81. last };
  82.  
  83. # /label=(.*),(\d+)/ && do {
  84. # $label_tmp{$1} = $2;
  85. # last };
  86.  
  87. /hosted=(.*)/ && do {
  88. $hosted_tmp = $1;
  89. last };
  90.  
  91. /popup_delay=(\d+)/ && do {
  92. $show_popup_delay = $1;
  93. last };
  94.  
  95. /popup_size=(\d+)/ && do {
  96. $popup_size = $1;
  97. last };
  98.  
  99. /popup_persistence=(\d+)/ && do {
  100. $popup_persistence = $1;
  101. last };
  102.  
  103. (/v$/ || /verbose/) && do {
  104. $silent = 0;
  105. print "CheckGmail v$version\nCopyright © 2005-7 Owen Marshall\n\n";
  106. last };
  107.  
  108. /nocrypt/ && do {
  109. $nocrypt = 1;
  110. last };
  111.  
  112. /update/ && do {
  113. $update = 1;
  114. last };
  115.  
  116.  
  117. /numbers/ && do {
  118. $mailno = 1;
  119. last };
  120.  
  121. /debug/ && do {
  122. $debug = 1;
  123. $silent = 0;
  124. last };
  125.  
  126.  
  127.  
  128. print "CheckGmail v$version\nCopyright © 2005-10 Owen Marshall\n\n";
  129. print "usage: checkgmail [-profile=profile_name] [-popup_delay=millisecs] [-hosted=hosted_domain] [-no_cookies] [-popup_persistence=millisecs] [-private] [-v | -verbose] [-nocrypt] [-no-libsexy] [-disable-monitors-check] [-numbers] [-update] [-h]\n\n";
  130. exit 1;
  131.  
  132. }
  133. }
  134. }
  135.  
  136.  
  137. #######################
  138. # Generate passphrase
  139. #
  140.  
  141. my ($passphrase);
  142. BEGIN {
  143. # passphrase generator - needs to run before Crypt::Simple is loaded ...
  144.  
  145. # The idea here is to at least make a non-local copy of .checkgmail
  146. # secure (for example, that found on a backup disc) - it's
  147. # impossible to store the password safely without requiring a user-entered
  148. # passphrase otherwise, which defeats the purpose of it all. The
  149. # passphrase used is based on the MAC address of the users ethernet
  150. # setup if it exists and the entire info from uname - this is the
  151. # most unique info I can think of to use here, though other suggestions
  152. # are welcome!
  153. #
  154. # (obviously uname info isn't that unique unless you're running a kernel that
  155. # you compiled yourself - which I do, but many don't ...)
  156.  
  157. my $uname = `uname -a`;
  158. chomp($uname);
  159.  
  160. $_ = `whereis -b ifconfig`;
  161. my ($ifconfig_path) = m/ifconfig:\s+([\w\/]+)/;
  162. $ifconfig_path ||= "ifconfig";
  163.  
  164. my $mac = `$ifconfig_path -a | grep -m 1 HWaddr | sed 's/ //g' | tail -18c`;
  165. chomp($mac);
  166.  
  167. $passphrase = "$mac$uname";
  168. $passphrase =~ s/\s+//g;
  169. }
  170.  
  171.  
  172. ##################
  173. # Check packages
  174. #
  175.  
  176. BEGIN {
  177. # A modular package checking routine ...
  178. my $failed_packages;
  179.  
  180. my $eval_sub = sub {
  181. print "$_\n" if $debug;
  182. eval $_;
  183. if ($@) {
  184. return unless m/(use|require)\s*([\w:-]+).*?\;/;
  185. my $package = $2;
  186.  
  187. $failed_packages .= " $package ";
  188. print "Warning: $package not found ...\n";
  189. }
  190. };
  191.  
  192. # required packages
  193. foreach (split("\n","
  194. use Gtk2(\"init\");
  195. use Gtk2::TrayIcon;
  196. use threads;
  197. use Thread::Queue;
  198. use Thread::Semaphore;
  199. use threads::shared;
  200. use Encode;
  201. use XML::Simple;
  202. use FileHandle;
  203. use LWP::UserAgent;
  204. # use LWP::Debug qw(+);
  205. use HTTP::Request::Common;
  206. use Crypt::SSLeay;
  207. ")) {&$eval_sub($_)};
  208. if ($failed_packages) {
  209. unless ($failed_packages =~ /Gtk2\s/) {
  210. # Show a nice GTK2 error dialogue if we can ...
  211. my $explanation = "Try installing them if they're provided by your distro, and then run CheckGmail again ...";
  212. if ($failed_packages =~ /threads/i) {
  213. $explanation = <<EOF;
  214. The threads packages are special: this means you're running a version of Perl that has been built without multi-threading support. There may be a package for your distro that provides this, or you may have to rebuild Perl.
  215.  
  216. You'll also have to install the other packages listed above, and then run CheckGmail again ...
  217. EOF
  218. chomp($explanation);
  219. }
  220. my $text = <<EOF;
  221. <b>CheckGmail v$version</b>
  222. Copyright &#169; 2005-6, Owen Marshall
  223.  
  224. Sorry! CheckGmail can't find the following package(s) on your system. These packages are needed for CheckGmail to run.
  225.  
  226. <b>$failed_packages</b>
  227.  
  228. $explanation
  229.  
  230. <small>If that fails, you might have to download and install the packages from CPAN (http://search.cpan.org)</small>
  231. EOF
  232. chomp($text);
  233. my $dialog = Gtk2::MessageDialog->new_with_markup(undef,
  234. 'destroy-with-parent',
  235. 'error',
  236. 'ok',
  237. $text,
  238. );
  239. $dialog->run;
  240. $dialog->destroy;
  241.  
  242. }
  243.  
  244. print "\nCheckGmail requires the above packages to run\nPlease download and install from CPAN (http://search.cpan.org) and try again ...\n\n";
  245. exit 1;
  246. }
  247.  
  248. # Use kwallet if available
  249. if (`which kwallet 2>/dev/null`) {
  250. $usekwallet = 1;
  251. $nocrypt = 1;
  252. }
  253.  
  254. # optional packages for encryption
  255. unless ($nocrypt) {
  256. foreach (split("\n","
  257. use Crypt::Simple passphrase => \"$passphrase\";
  258. use Crypt::Blowfish;
  259. use FreezeThaw;
  260. use Compress::Zlib;
  261. use Digest::MD5;
  262. use MIME::Base64;
  263. ")) {&$eval_sub($_)};
  264. if ($failed_packages) {
  265. print "\nCheckGmail requires the above packages for password encryption\nPlease download and install from CPAN (http://search.cpan.org) if you want to use this feature ...\n\n";
  266. $nocrypt = 1;
  267. }
  268. }
  269.  
  270. # optional packages for urls in labels
  271. foreach (split("\n","
  272. use Gtk2::Sexy;
  273. ")) {&$eval_sub($_)};
  274. if (($failed_packages) && ($failed_packages =~ m/Sexy/i)) {
  275. print "\nCheckGmail uses Gtk2::Sexy for clickable URLs in mail messages\nPlease download and install from CPAN (http://search.cpan.org) if you want to use this feature ...\n\n";
  276. $libsexy = 0;
  277. } else { $libsexy = 1 unless $notsexy; }
  278. }
  279.  
  280. # There's something wrong with Debian's Crypt::Simple, and it's causing problems ...
  281. unless (($nocrypt) || (eval("encrypt('test_encryption');"))) {
  282. print "Hmmmm ... Crypt::Simple doesn't seem to be working!\nNot using Debian or Ubuntu, are you??\n\n";
  283. print "Your best bet is to download the Crypt::Simple module from CPAN\n(http://search.cpan.org/~kasei/Crypt-Simple/) and install it manually. Sorry!\n\n";
  284. print "Disabling encrypted passwords for now ...\n\n";
  285. $nocrypt = 1;
  286. }
  287.  
  288. # Show big fat warning if Crypt::Simple not found ...
  289. if ($nocrypt && !$silent && !$usekwallet) {
  290. print <<EOF;
  291. *** Crypt::Simple not found, not working or disabled ***
  292. *** Passwords will be saved in plain text only ... ***\n
  293. EOF
  294. }
  295.  
  296. ##################
  297. # Update utility
  298. #
  299.  
  300. # Pretty damn simple right now, but it works ...
  301. # ... idea taken from a script on the checkgmail forums (thanks, guys!)
  302.  
  303. # no version checking right now -- but does show the user a diff of the changes ...
  304.  
  305. if ($update) {
  306. my $checkgmail_loc = $0;
  307. my ($exec_dir) = $checkgmail_loc =~ m/(.*)checkgmail/;
  308. chdir("/tmp");
  309. print "Downloading latest version of checkgmail from SVN ...\n\n";
  310. `wget http://checkgmail.svn.sourceforge.net/viewvc/*checkout*/checkgmail/checkgmail`;
  311. print "\n\nDifferences between old and new versions:\n";
  312. print "diff -urN checkgmail $checkgmail_loc\n";
  313. my $diff_out = `diff -urN checkgmail $checkgmail_loc`;
  314. print "$diff_out\n\n";
  315. my $do_update = ask("\n\nOK to update to new version via 'sudo mv checkgmail $exec_dir'?(Y/n)");
  316. if ($do_update eq "Y") {
  317. print "chmod a+x checkgmail\n";
  318. `chmod a+x checkgmail`;
  319. print "sudo mv checkgmail $exec_dir\n";
  320. `sudo mv checkgmail $exec_dir`;
  321. print "\nRestarting checkgmail ...\n";
  322. exec "$0";
  323. } else {
  324. print "Update NOT performed ...\n";
  325. print "Deleting temp file ...\n";
  326. unlink("checkgmail");
  327. print "Continuing with application startup ...\n\n";
  328. }
  329. }
  330.  
  331.  
  332. sub ask {
  333. my ($question,$prompt)=@_;
  334. $prompt||="> ";
  335. print "$question$prompt";
  336. my $ans = <STDIN>;
  337. chomp($ans);
  338. return $ans;
  339. }
  340.  
  341.  
  342. ##########################################
  343. # Threads for non-blocking HTTP-requests
  344. #
  345.  
  346. # Shared variables between threads
  347. # - need to be declared here, unfortunately ... can't do it in the prefs hash :(
  348. my $gmail_address : shared;
  349. my $user : shared;
  350. my $passwd : shared;
  351. my $passwd_decrypt : shared;
  352. my $save_passwd : shared;
  353. my $translations : shared;
  354. my %trans : shared;
  355. my $language : shared;
  356. my $HOME : shared;
  357. my $icons_dir : shared;
  358. my $gmail_at : shared;
  359. my $gmail_ik : shared;
  360. my $gmail_hid : shared;
  361. my $gmail_sid : shared;
  362. my $gmail_gausr : shared;
  363. my $delay : shared;
  364. my %label_delay : shared;
  365. # my @labels : shared;
  366. my $hosted : shared = $hosted_tmp;
  367.  
  368. # URI escape codes to allow non alphanumeric usernames & passwords ...
  369. # thanks to Leonardo Ribeiro for suggesting this, and to the lcwa package for this implementation
  370. my %escapes : shared;
  371. for (0..255) {
  372. $escapes{chr($_)} = sprintf("%%%02X", $_);
  373. }
  374.  
  375. # Thread controls
  376. my $request = new Thread::Queue;
  377. my $request_results = new Thread::Queue;
  378. my $http_status = new Thread::Queue;
  379. my $error_block = new Thread::Semaphore(0);
  380. my $fat_lady = new Thread::Semaphore(0);
  381. my $child_exit : shared = 0; # to signal exit to child
  382.  
  383. print "About to start new thread ...\n" if $debug;
  384. # Start http checking thread ...
  385. my $http_check = new threads(\&http_check);
  386. print "Parent: Process now continues ...\n" if $debug;
  387.  
  388.  
  389. #######################
  390. # Prefs and Variables
  391. #
  392.  
  393. print "Parent: Setting up global variables ...\n" if $debug;
  394. # Prefs hash
  395. my %pref_variables = (
  396. user => \$user,
  397. passwd => \$passwd,
  398. hosted => \$hosted,
  399. save_passwd => \$save_passwd,
  400. atomfeed_address => \$gmail_address,
  401. language => \$language,
  402. delay => \$delay,
  403. label_delay => \%label_delay,
  404. popup_size => \$popup_size,
  405. background => \(my $background),
  406. gmail_command => \(my $gmail_command),
  407. use_custom_mail_icon => \(my $custom_mail_icon),
  408. use_custom_no_mail_icon => \(my $custom_no_mail_icon),
  409. use_custom_error_icon => \(my $custom_error_icon),
  410. mail_icon => \(my $mail_icon),
  411. no_mail_icon => \(my $no_mail_icon),
  412. error_icon => \(my $error_icon),
  413. popup_delay => \(my $popup_delay),
  414. show_popup_delay => \$show_popup_delay,
  415. notify_command => \(my $notify_command),
  416. nomail_command => \(my $nomail_command),
  417. time_24 => \(my $time_24),
  418. archive_as_read => \(my $archive_as_read),
  419. );
  420.  
  421. # Default prefs
  422. $delay = 120000;
  423. $popup_delay = 6000;
  424. $save_passwd = 0;
  425. $time_24 = 0;
  426. $archive_as_read = 0;
  427. $gmail_command = 'firefox %u';
  428. $language = 'English';
  429.  
  430. # Global variables
  431. $HOME = (getpwuid($<))[7];
  432. my $gmail_web_address = "https://mail.google.com/mail";
  433. my $prefs_dir = "$HOME/.checkgmail";
  434. $icons_dir = "$prefs_dir/attachment_icons";
  435. my $prefs_file_nonxml = "$prefs_dir/prefs$profile";
  436. my $prefs_file = "$prefs_file_nonxml.xml";
  437. $gmail_address = gen_prefix_url()."/feed/atom";
  438. # $gmail_address = $hosted ? "mail.google.com/a/$hosted/feed/atom" : "mail.google.com/mail/feed/atom";
  439.  
  440. # for every gmail action ...
  441. my %gmail_act = (
  442. archive => 'rc_%5Ei',
  443. read => 'rd',
  444. spam => 'sp',
  445. delete => 'tr',
  446. star => 'st',
  447. unstar => 'xst',
  448. );
  449.  
  450. # ... there's a gmail re-action :)
  451. my %gmail_undo = (
  452. archive => 'ib',
  453. read => 'ur',
  454. spam => 'us',
  455. delete => 'ib:trash',
  456. star => 'xst',
  457. );
  458.  
  459. my @undo_buffer;
  460. my ($ua, $cookie_jar);
  461. my ($menu_x, $menu_y);
  462. my @popup_status;
  463. my $status_label;
  464. # my $message_flag;
  465.  
  466. print "Parent: Checking the existence of ~/.checkgmail ...\n" if $debug;
  467. # Create the default .checkgmail directory and migrate prefs from users of older versions
  468. unless (-d $prefs_dir) {
  469. if (-e "$prefs_dir") {
  470. print "Moving ~/.checkgmail to ~/.checkgmail/prefs ...\n\n";
  471. rename("$HOME/.checkgmail", "$HOME/.checkgmailbak");
  472. mkdir($prefs_dir, 0777);
  473. rename("$HOME/.checkgmailbak", "$prefs_dir/prefs");
  474. } else {
  475. # User hasn't run an old version, just create the dir
  476. mkdir($prefs_dir, 0700);
  477. }
  478. }
  479.  
  480. unless (-d $icons_dir) {
  481. mkdir($icons_dir, 0700);
  482. }
  483.  
  484.  
  485. #########
  486. # Icons
  487. #
  488.  
  489. print "Parent: Loading icon data ...\n" if $debug;
  490. # we load the pixmaps as uuencoded data
  491. my ($error_data, $no_mail_data, $mail_data, $compose_mail_data, $star_on_data, $star_off_data);
  492. load_icon_data();
  493.  
  494. my ($no_mail_pixbuf, $mail_pixbuf, $error_pixbuf, $star_pixbuf, $nostar_pixbuf);
  495. my ($custom_no_mail_pixbuf, $custom_mail_pixbuf, $custom_error_pixbuf);
  496. set_icons();
  497.  
  498. my $image = Gtk2::Image->new_from_pixbuf($no_mail_pixbuf);
  499.  
  500.  
  501. ##############
  502. # Setup tray
  503. #
  504.  
  505. print "Parent: Setting up system tray ...\n" if $debug;
  506. my $tray = Gtk2::TrayIcon->new("gmail");
  507. my $eventbox = Gtk2::EventBox->new;
  508. my $ebox2 = Gtk2::EventBox->new;
  509. my $tray_hbox = Gtk2::HBox->new(0,0);
  510. $tray_hbox->set_border_width(2);
  511.  
  512. my $win_notify;
  513. my ($notify_vbox_b, $notifybox);
  514. my ($old_x, $old_y);
  515. my $reshow;
  516. my $notify_enter = 0;
  517. my $popup_win;
  518. # my $scrolled;
  519. # my $vadj;
  520. my %new;
  521. my @messages;
  522. my %messages_ext;
  523. my %issued_h;
  524. my @labels;
  525.  
  526. $eventbox->add($ebox2);
  527. $ebox2->add($tray_hbox);
  528. $tray_hbox->pack_start($image,0,0,0);
  529.  
  530. # number of new mail messages (use -numbers)
  531. my $number_label;
  532. if ($mailno) {
  533. $number_label = Gtk2::Label->new;
  534. $number_label->hide;
  535. $number_label->set_markup("0");
  536. $tray_hbox->pack_start($number_label,0,0,2);
  537. }
  538.  
  539.  
  540. ########################
  541. # Read prefs and login
  542. #
  543.  
  544. print "Parent: Reading translations ...\n" if $debug;
  545. # Read translations if they exist ...
  546. read_translations();
  547.  
  548. print "Parent: Reading prefs ...\n" if $debug;
  549. # First time configuration ...
  550. unless (read_prefs()) {
  551. show_prefs();
  552. }
  553.  
  554. # kdewallet integration if present - thanks to Joechen Hoenicke for this ...
  555. if (($usekwallet) && ($save_passwd)) {
  556. $passwd = `kwallet -get checkgmail`;
  557. chomp $passwd;
  558. }
  559.  
  560. # remove passwd from the pref_variables hash if the user requests it and prompt for login
  561. unless ($save_passwd && !$usekwallet) {
  562. delete $pref_variables{passwd};
  563. login($trans{login_title}) unless $passwd;
  564. }
  565.  
  566.  
  567. # changing the passphrase causes Crypt::Simple to die horribly -
  568. # here we use an eval routine to catch this and ask the user to login again
  569. # - this will only happen if you change your network interface card or
  570. # recompile your kernel ...
  571. unless ((eval ('$passwd_decrypt = decrypt_real($passwd);'))) {
  572. login($trans{login_title});
  573. }
  574.  
  575. chomp($passwd_decrypt) if $passwd_decrypt;
  576.  
  577. # Continue building tray ...
  578. if ($background) {
  579. my ($red, $green, $blue) = convert_hex_to_colour($background);
  580. $eventbox->modify_bg('normal', Gtk2::Gdk::Color->new ($red, $green, $blue));
  581. }
  582.  
  583. $tray->add($eventbox);
  584. $tray->show_all;
  585. print "Parent: System tray now complete ...\n" if $debug;
  586.  
  587. ############################
  588. # enter/leave notification
  589. #
  590.  
  591. my $notify_vis = 0;
  592. my $notify_delay = 0;
  593. my $popup_delay_timeout;
  594. $eventbox->signal_connect('enter_notify_event', sub {
  595. if ($show_popup_delay) {
  596. # Tooltip-like delay in showing the popup
  597. # return if $notify_vis;
  598. # $notify_delay=1;
  599. $notify_vis =1;
  600. $popup_delay_timeout = Glib::Timeout->add($show_popup_delay, sub {
  601. if ($win_notify && $notify_vis) {
  602. # $notify_delay=0;
  603. show_notify();
  604. }
  605. });
  606. } else {
  607. if ($win_notify) {
  608. show_notify();
  609. $notify_vis=1;
  610. }
  611. }
  612. });
  613.  
  614. $eventbox->signal_connect('leave_notify_event', sub {
  615. if (@popup_status) {
  616. # This allows us to mouse into the popup by continuing to display it after
  617. # the mouse leaves the tray icon. We only call it when there are messages
  618. # displayed - no one (I'm assuming! :) wants to be able to mouse into the
  619. # "No new mail" tooltip ... (well, OK, I actually did play around doing exactly
  620. # that when I wrote the routine, but that doesn't count ... :)
  621. my $persistence = Glib::Timeout->add($popup_persistence, sub {
  622. unless ($notify_enter) {
  623. $win_notify->hide unless ($notify_enter || $notify_vis);
  624. }
  625. return 0;
  626. });
  627. } else {
  628. $win_notify->hide if $win_notify;
  629. }
  630.  
  631. Glib::Source->remove($popup_delay_timeout) if $popup_delay_timeout;
  632. $notify_vis=0;
  633. });
  634.  
  635.  
  636. ##################
  637. # Catch SIGs ...
  638. #
  639.  
  640. my %check;
  641. # my @labels;
  642.  
  643. $SIG{ALRM} = sub{
  644. print "Alarm clock sent ...\n" unless $silent;
  645. print "Resetting check delay ...\n" unless $silent;
  646. reinit_checks();
  647. };
  648.  
  649. $SIG{TERM} = \&exit_prog;
  650.  
  651.  
  652. ############################
  653. # All set? Let's login ...
  654. #
  655.  
  656. print "Parent: Sending semaphore to child process ...\n" if $debug;
  657. # She's singing ...
  658. $fat_lady->up;
  659.  
  660.  
  661. ##############
  662. # Popup Menu
  663. #
  664.  
  665. my $menu;
  666. pack_menu();
  667.  
  668. #######################
  669. # Events and Mainloop
  670. #
  671.  
  672. # set popup trigger
  673. $eventbox->signal_connect('button_press_event', \&handle_button_press);
  674.  
  675. # set timeout for checking mail
  676. reinit_checks();
  677. my $real_check = Glib::Timeout->add(1000, \&check); # no wait-variables, so we're polling once a second. No real CPU hit here ...
  678.  
  679. # do initial check
  680. queue_check();
  681.  
  682. Gtk2->main;
  683.  
  684. ################
  685. # Post GUI ...
  686. #
  687.  
  688. exit_prog();
  689.  
  690. sub exit_prog {
  691. # After quitting the GUI we need to logout (if using the cookie_login method) and then clean up the threads ...
  692. print "Exiting program ...\n" unless $silent;
  693.  
  694. # if ($cookies) {
  695. # $http_status->enqueue("Logging out ...");
  696. # $request->enqueue("LOGOUT:mail.google.com/mail/?logout");
  697. # sleep 1;
  698. # }
  699.  
  700. $child_exit = 1;
  701. queue_check();
  702.  
  703. $http_check->join();
  704.  
  705. exit 0;
  706. }
  707.  
  708.  
  709.  
  710. ##############################
  711. # Subroutines start here ...
  712. #
  713.  
  714.  
  715. ####################
  716. # Checking thread
  717. #
  718.  
  719. sub queue_check {
  720. # Simply adds to the $request queue to signal the http_check thread
  721. my ($label) = shift;
  722. $label = $label ? "$label" : "";
  723. $request->enqueue("GET:$gmail_address $label");
  724. return 1;
  725. }
  726.  
  727. sub http_check {
  728. # Threaded process for sending HTTP requests ...
  729. print "Child: Checking thread now starting ... waiting for semaphore to continue\n" if $debug;
  730.  
  731. # Variable initialisation isn't over until the fat lady sings ...
  732. $fat_lady->down;
  733. print "Initialisation complete\n" unless $silent;
  734.  
  735. # set up the useragent ....
  736. $ua = LWP::UserAgent->new();
  737. $ua->requests_redirectable (['GET', 'HEAD', 'POST']);
  738. # push @{ $ua->requests_redirectable }, 'POST';
  739.  
  740. # set time-out - defaults to 90 seconds or $delay, whichever is shorter
  741. $ua->timeout($delay/1000<90 ? $delay/1000 : 90);
  742.  
  743. # Get the cookie if requested
  744. if ($cookies) {
  745. use HTTP::Cookies;
  746. $cookie_jar = HTTP::Cookies->new();
  747.  
  748. $ua->cookie_jar($cookie_jar);
  749.  
  750. # Here we submit the login form to Google and the authorisation cookie gets saved
  751.  
  752. # This is only useful when Google's pulling an Error 503 party - it's less efficient
  753. # as there's a whole lot of unnecessary data associated with the process that slows
  754. # it all down ...
  755.  
  756. {
  757. # this loop is necessary as an incorrect login with Gmail's web form doesn't return a 401
  758. # So we simply check for the Gmail_AT cookie as confirmation of a successful login
  759. $http_status->enqueue($trans{notify_login});
  760.  
  761. my $URI_user = URI_escape($user);
  762. my $URI_passwd = URI_escape($passwd_decrypt);
  763.  
  764. # clumsy error detection code uses this variable to differentiate between unable to
  765. # connect and unable to login - the Gmail login provides no unauthorised code if unsuccessful
  766. my $error;
  767.  
  768. # Thanks to that wonderful Firefox extension LiveHTTPHeaders for
  769. # deciphering the login form! :)
  770. unless ($hosted) {
  771. # Normal Gmail login action ...
  772. $error = http_get("Email=$URI_user&Passwd=$URI_passwd", "LOGIN");
  773.  
  774. # $cookie_jar->scan(\&scan_at);
  775. # unless ($error || !$gmail_sid || !$gmail_gausr) {
  776. # $error = http_get("https://mail.google.com/mail/?pli=1&auth=$gmail_sid&gausr=$gmail_gausr", 'LOGIN');
  777. # }
  778.  
  779. # $error = http_get("https://mail.google.com/mail?nsr=0&auth=$gmail_sid&gausr=$gmail_gausr", "LOGIN");
  780.  
  781. } else {
  782. # hosted domains work differently ...
  783. # First we POST a login
  784. # $error = http_get("https://www.google.com/a/$hosted/LoginAction|at=null&continue=http%3A%2F%2Fmail.google.com%2Fa%2F$hosted&service=mail&userName=$URI_user&password=$URI_passwd", "POST");
  785. # thanks to Olinto Neto for this fix for hosted domains:
  786. $error = http_get("https://www.google.com/a/$hosted/LoginAction2|at=null&continue=http%3A%2F%2Fmail.google.com%2Fa%2F$hosted&service=mail&Email=$URI_user&Passwd=$URI_passwd", "POST");
  787.  
  788. # Then we grab the HID ("Hosted ID"?) cookie
  789. $cookie_jar->scan(\&scan_at);
  790.  
  791. # And now we login with that cookie, which will give us the GMAIL_AT cookie!
  792. unless ($error || !$gmail_hid) {
  793. $error = http_get("https://mail.google.com/a/$hosted?AuthEventSource=Internal&auth=$gmail_hid", 'GET');
  794. }
  795. }
  796.  
  797. $cookie_jar->scan(\&scan_at);
  798.  
  799. unless ($gmail_at) {
  800. unless ($error) {
  801. $http_status->enqueue("Error: 401 Unauthorised");
  802. $error_block->down;
  803. } else {
  804. # simple block to prevent checkgmail hogging CPU if not connected!
  805. sleep 30;
  806. }
  807.  
  808. redo;
  809. }
  810. }
  811.  
  812. print "Logged in ... AT = $gmail_at\n" unless $silent;
  813. }
  814.  
  815. while ((my $address = $request->dequeue) && ($child_exit==0)) {
  816. # this is a clumsy hack to allow POST methods to do things like mark messages as spam using the same queue
  817. # (can't send anonymous arrays down a queue, unfortunately!)
  818. # Now also used for labels ...
  819. my ($method, $address_real, $label) = ($address =~ /(.*?):([^\s]*)\s*(.*)/);
  820.  
  821. my $logon_string = "";
  822. unless ($cookies) {
  823. my $URI_user = URI_escape($user);
  824. my $URI_passwd = URI_escape($passwd_decrypt);
  825. $logon_string = "$URI_user:$URI_passwd\@";
  826. }
  827.  
  828. $request_results->enqueue(http_get("https://$logon_string$address_real", $method, $label))
  829. }
  830. }
  831.  
  832.  
  833. sub scan_at {
  834. my $cookie_ref = \@_;
  835.  
  836. unless ($silent) {
  837. # use Data::Dumper;
  838. # print Dumper(\@_);
  839. print "Saved cookie: ",$cookie_ref->[1],"\n",$cookie_ref->[2],"\n\n";
  840. }
  841.  
  842. # This sub is invoked for each cookie in the cookie jar.
  843. # What we're looking for here is the Gmail authorisation key, GMAIL_AT
  844. # - this is needed to interface with the Gmail server for actions on mail messages ...
  845. # or the HID cookie which is set with Gmail hosted domains
  846.  
  847. if ($cookie_ref->[1] =~ m/GMAIL_AT/) {
  848. $gmail_at = $cookie_ref->[2];
  849. }
  850.  
  851. if ($cookie_ref->[1] =~ m/HID/) {
  852. $gmail_hid = $cookie_ref->[2];
  853. }
  854.  
  855. if ($cookie_ref->[1] =~ m/GAUSR/) {
  856. $gmail_gausr = $cookie_ref->[2];
  857. }
  858.  
  859. if ($cookie_ref->[1] =~ m/SID/) {
  860. $gmail_sid = $cookie_ref->[2];
  861. }
  862. }
  863.  
  864.  
  865. sub http_get {
  866. # this is now called from the http-checking thread
  867. # - all GUI activities are handled through queues
  868. my ($address, $method, $label) = @_;
  869. $label = "/$label" if $label;
  870. $label||="";
  871. my $error;
  872.  
  873. if ($method eq 'POST') {
  874. # quick hack to use the POST method for Gmail actions ...
  875. my ($add1, $add2) = ($address =~ m/(.*)\|(.*)/);
  876. # print "($add1, $add2)\n" unless $silent;
  877.  
  878. my $req = HTTP::Request->new($method => $add1);
  879. $req->content_type('application/x-www-form-urlencoded');
  880. $req->content($add2);
  881.  
  882. $ua->request($req);
  883. return;
  884.  
  885. } elsif ($method eq 'POST_MB') {
  886. # quick hack to grab the message text ...
  887. my ($add1, $add2) = ($address =~ m/(.*)\|(.*)/);
  888. # print "($add1, $add2)\n" unless $silent;
  889.  
  890. my $req = HTTP::Request->new('POST' => $add1);
  891. $req->content_type('application/x-www-form-urlencoded');
  892. $req->content($add2);
  893.  
  894. my $response = $ua->request($req);
  895.  
  896. my $http = $response->content;
  897. $label =~ s/\///g;
  898. return "LABEL=$label\n$http";
  899.  
  900. } elsif ($method eq 'LOGIN') {
  901. # New LOGIN method written by Gerben van der Lubbe on Oct 6, 2009.
  902. # (based in turn on vially's (https://sourceforge.net/users/vially/) PHP code.
  903.  
  904. # Well, we did get a URL here, but it doesn't make any sense to send both LOGIN and the URL to this function.
  905. # So, this URL is just the username and password addition.
  906. my $req = HTTP::Request->new('GET' => "https://www.google.com/accounts/ServiceLogin?service=mail");
  907. my $response = $ua->request($req);
  908. if($response->is_error) {
  909. my $code = $response->code;
  910. my $message = $response->message;
  911. $error = "Error: $code $message";
  912. $http_status->enqueue($error);
  913. return $error;
  914. }
  915. my $http = $response->content;
  916.  
  917. # Find the value of the GALX input field
  918. my ($post_galx) = ($http =~ m/"GALX".*?value="(.*?)"/ismg);
  919. unless ($post_galx) {
  920. print "Error: No GALX input field found\n";
  921. return "Error: No GALX input field found";
  922. }
  923. $post_galx = URI_escape(URI_unescape($1));
  924.  
  925. # Find the data to post
  926. my $post_data;
  927. $post_data = "ltmpl=default&ltmplcache=2&continue=http://mail.google.com/mail/?ui%3Dhtml&service=mail&rm=false&scc=1&GALX=$post_galx&$address&PersistentCookie=yes&rmShown=1&signIn=Sign+in&asts=";
  928.  
  929. # Hide personal data from verbose display
  930. my $post_display = $post_data;
  931. $post_display =~ s/Email=(.*?)&/Email=******/;
  932. $post_display =~ s/Passwd=(.*?)&/Passwd=******/;
  933. print "Logging in with post data $post_display\n" unless $silent;
  934.  
  935. # Send the post data to the login URL
  936. my $post_req = HTTP::Request->new('POST' => "https://www.google.com/accounts/ServiceLoginAuth?service=mail");
  937. $post_req->content_type('application/x-www-form-urlencoded');
  938. $post_req->content($post_data);
  939. my $post_response = $ua->request($post_req);
  940. if ($post_response->is_error) {
  941. my $code = $response->code;
  942. my $message = $response->message;
  943. $error = "Error: $code $message";
  944. $http_status->enqueue($error);
  945. return $error;
  946. }
  947. my $post_http = $post_response->content;
  948.  
  949. # Find the location we're directed to, if any
  950. if ($post_http =~ m/location\.replace\("(.*)"\)/) {
  951. # Rewrite the redirect URI.
  952. # This URI uses \xXX. Replace those, and just to be sure \\. \" we don't handle, though.
  953. my $redirect_address = $1;
  954. $redirect_address =~ s/\\\\/\\/g;
  955. $redirect_address =~ s/\\x([0-9a-zA-Z]{2})/chr(hex($1))/eg;
  956. print "Redirecting to ".$redirect_address."\n" unless $silent;
  957.  
  958. # And request the actual URL
  959. my $req = HTTP::Request->new('GET' => $redirect_address);
  960. my $response = $ua->request($req);
  961. if($response->is_error) {
  962. my $code = $response->code;
  963. my $message = $response->message;
  964. $error = "Error: $code $message";
  965. $http_status->enqueue($error);
  966. return $error;
  967. }
  968. } else {
  969. print "No location.replace found in HTML\n" unless $silent;
  970. }
  971.  
  972. # Last part of the login process, in order to get Gmail's globar variables
  973. # (including the all-important ik parameter)
  974. $req = HTTP::Request->new('GET' => "https://mail.google.com/mail/?shva=1");
  975. $response = $ua->request($req);
  976. if($response->is_error) {
  977. my $code = $response->code;
  978. my $message = $response->message;
  979. $error = "Error: $code $message";
  980. $http_status->enqueue($error);
  981. return $error;
  982. }
  983. $http = $response->content;
  984.  
  985. # The globals. Lots of goodies here, which we don't need right now
  986. # but which might come in handy later ...
  987. if ($http =~ m/var GLOBALS=\[,.*?,.*?,.*?,.*?,.*?,.*?,.*?,.*?,"(.*?)"/) {
  988. $gmail_ik = $1;
  989. } else {
  990. print "Unable to find gmail_ik ... full message text won't work :(\n\n";
  991. }
  992.  
  993.  
  994. return $error;
  995.  
  996. } elsif ($method eq 'LOGOUT') {
  997. # a hack to streamline the logout process
  998. print "Logging out of Gmail ...\n" unless $silent;
  999.  
  1000. my $req = HTTP::Request->new('GET' => "$address");
  1001. my $response = $ua->request($req);
  1002.  
  1003. return;
  1004. } elsif ($method eq 'IMAGE') {
  1005. # a hack to grab attachment images
  1006. my $image_name = $label;
  1007.  
  1008. my $req = HTTP::Request->new(GET => "$address");
  1009. my $response = $ua->request($req);
  1010. if ($response->is_error) {
  1011. print "error retrieving!\n";
  1012. return 0;
  1013. }
  1014.  
  1015. my $http = $response->content;
  1016.  
  1017. open (DATA, ">$icons_dir$image_name") || print "Error: Could not open file for writing: $!\n";
  1018. print DATA $http;
  1019. close DATA;
  1020.  
  1021. # we need a semaphore here so the GUI doesn't redraw until the image is obtained
  1022. $error_block->up;
  1023.  
  1024. return 0;
  1025. }
  1026.  
  1027.  
  1028. $http_status->enqueue($trans{notify_check});
  1029.  
  1030. my $req = HTTP::Request->new($method => "$address$label");
  1031.  
  1032. my $response = $ua->request($req);
  1033. if ($response->is_error) {
  1034. my $code = $response->code;
  1035. my $message = $response->message;
  1036. $error = "Error: $code $message";
  1037. $http_status->enqueue($error);
  1038.  
  1039. # Incorrect username/password??
  1040. if ($code == 401) {
  1041. # Set a semaphore block to prevent multiple incorrect logins
  1042. # This is probably unneccessary because of the locked variables in the Login dialogue
  1043. # ... still, doesn't hurt to be careful ... :)
  1044. $error_block->down;
  1045. }
  1046.  
  1047. return 0;
  1048. }
  1049.  
  1050. my $http = $response->content;
  1051.  
  1052. $label =~ s/\///g;
  1053.  
  1054. return "LABEL=$label\n$http";
  1055. }
  1056.  
  1057.  
  1058. ############################
  1059. # Main thread checking ...
  1060. #
  1061.  
  1062. sub check {
  1063. # The check routine is polled every second:
  1064. # we always check first to see if there's a new status message and display it
  1065. # Errors are also caught at this point ...
  1066. my $status = $http_status->dequeue_nb;
  1067. if ($status) {
  1068. notify($status);
  1069. if ($status =~ m/error/i) {
  1070. # General error notification
  1071. $image->set_from_pixbuf($error_pixbuf);
  1072.  
  1073. if ($status =~ m/401/) {
  1074. # Unauthorised error
  1075. login("Error: Incorrect username or password");
  1076. Gtk2->main_iteration while (Gtk2->events_pending);
  1077.  
  1078. # queue a new request to check mail
  1079. queue_check();
  1080.  
  1081. # and release the semaphore block ...
  1082. $error_block->up;
  1083. }
  1084.  
  1085. }
  1086. }
  1087.  
  1088. # Return if there aren't any Atom feeds in the queue ...
  1089. return 1 unless my $atom = $request_results->dequeue_nb;
  1090.  
  1091. if ($atom =~ m/while\(1\);/) {
  1092. # datapack shortcircuit
  1093. # we use this to grab the full text of messages ...
  1094.  
  1095. # uncomment below to see the datapack structure
  1096. print "atom:\n$atom\n\n" unless $silent;
  1097.  
  1098. # as of 2/11/10, we can no longer use the old ui=1 datapack
  1099. # Unfortunately, the new ui=2 datapack is quite a bit less pleasant
  1100. # to use, with no nice "mb" cues ...
  1101.  
  1102. my ($mb, $ma);
  1103.  
  1104. # if ($atom =~ m/\["ms",.*?,.*?,.*?,.*?,.*?,.*?,.*?,.*?,\[.*?"\].*?\[.*?\[.*?,.*?,.*?,.*?,.*?,"(.*?)",\[/s) {#.*?,.*?,.*?,\[,.*?,.*?,.*?,.*?,.*?,"(.*?)",\[/g);
  1105. # print "\n\n-----\nYYYYY!\n$1\n";
  1106. # } else {
  1107. # print "\n\n-----\nNOPE!\n\n";
  1108. # }
  1109.  
  1110. # See what you've made me do, Google?? Just look at this fugly regex ...
  1111. while ($atom =~ m/\["ms",.*?,.*?,.*?,.*?,.*?,.*?,.*?,.*?,\[.*?"\].*?\[.*?\[.*?,.*?,.*?,.*?,.*?,"(.*?)",\[/sg) {
  1112. $mb .= "$1";
  1113. }
  1114.  
  1115. # ma is the attachment, if any
  1116. # (I suspect this doesn't work anymore with the new datapack ...)
  1117. while ($atom =~ m/\["ma",\[(.*?)\]/g) {
  1118. my $att = $1;
  1119. $ma = "/mail/images/paperclip.gif"; # default attachment
  1120. # print "attachment =\n$att\n\n";
  1121. if ($att =~ m/src\\u003d\\\"(.*?)\\\"/g) {
  1122. $ma = $1;
  1123. }
  1124. }
  1125.  
  1126. $mb = clean_text_body($mb);
  1127. print "cleaned text is\n$mb\n\n" unless $silent;
  1128.  
  1129. # cs is the message id
  1130. my ($cs) = ($atom =~ m/.*\["ms","(.*?)"/s);
  1131. $messages_ext{$cs}->{text} = $mb;
  1132. $messages_ext{$cs}->{shown} = 1;
  1133. $messages_ext{$cs}->{attachment} = $ma;
  1134.  
  1135.  
  1136. notify();
  1137. return 1;
  1138. }
  1139.  
  1140. # Process the Atom feed ...
  1141. my ($label, $atom_txt) = ($atom =~ m/LABEL=(.*?)\n(.*)/s);
  1142. # $label ||= "";
  1143. my $gmail = XMLin($atom_txt, ForceArray => 1);
  1144.  
  1145. # # Uncomment below to view xml->array structure
  1146. # use Data::Dumper;
  1147. # print Dumper($gmail);
  1148.  
  1149. # Count messages ...
  1150. $new{$label} = 0;
  1151. if ($gmail->{entry}) {
  1152. $new{$label} = @{$gmail->{entry}};
  1153. }
  1154.  
  1155. my $new_mail =0;
  1156.  
  1157. # remove old messages with the same label ...
  1158. my @new_messages;
  1159. foreach my $i (0 .. @messages) {
  1160. next unless $messages[$i];
  1161. if ($messages[$i]->{label} eq $label) {
  1162. delete $issued_h{$messages[$i]->{time}};
  1163. } else {
  1164. push (@new_messages, $messages[$i]);
  1165. }
  1166. }
  1167. @messages = @new_messages;
  1168.  
  1169. # print "\n--------\nmessages: @messages\n";
  1170.  
  1171.  
  1172. if ($new{$label}) {
  1173. # New messages - get the details ...
  1174. my (@tip_text, $popup_text, $popup_authors, @issued_l);
  1175. $image->set_from_pixbuf($mail_pixbuf);
  1176.  
  1177. CHECK: for my $i (0 .. $new{$label}-1) {
  1178.  
  1179. my $author_name = $gmail->{entry}->[$i]->{author}->[0]->{name}->[0];
  1180. my $author_mail = $gmail->{entry}->[$i]->{author}->[0]->{email}->[0];
  1181. my $issued = $gmail->{entry}->[$i]->{issued}->[0];
  1182. my $title = $gmail->{entry}->[$i]->{title}->[0];
  1183. my $summary = $gmail->{entry}->[$i]->{summary}->[0];
  1184. my $href = $gmail->{entry}->[$i]->{link}->[0]->{href};
  1185.  
  1186. my ($id) = ($href =~ m/message_id=(.*?)&/);
  1187.  
  1188. # No subject, summary or author name?
  1189. ref($title) && ($title = $trans{notify_no_subject});
  1190. ref($summary) && ($summary = $trans{notify_no_text});
  1191. my $author = $author_name || $author_mail;
  1192.  
  1193. # clean text for Pango compatible display ...
  1194. $title = clean_text_and_decode($title);
  1195. $author = clean_text_and_decode($author);
  1196. $summary = clean_text_and_decode($summary);
  1197.  
  1198. my ($year, $month, $day, $hour, $min, $sec) = ($issued =~ m/(\d+)-(\d+)-(\d+)T(\d+):(\d+):(\d+)Z/);
  1199. my $time_abs = $sec+$min*60+$hour*3600+$day*86400+$month*2678400+$year*32140800;
  1200.  
  1201. # check for duplicate labels
  1202. foreach (@messages) {
  1203. next CHECK if $_->{id} eq $id;
  1204. }
  1205.  
  1206. unless ($private) {
  1207. push @messages, { href=>$href, id=>$id, time=>$time_abs, issued=>$issued, title=>$title, author=>$author, body=>$summary, label=>$label };
  1208. }
  1209.  
  1210. # Save authors and time stamps for popup text below ...
  1211. $issued_h{$time_abs}=$author;
  1212. }
  1213.  
  1214. # create the mail details window ...
  1215. notify('', $new{$label}-1);
  1216.  
  1217. # Now check if a popup needs to be displayed:
  1218.  
  1219. # find previously unread entries and remove
  1220. if (@popup_status) {
  1221. for my $i (0 .. $#popup_status) {
  1222. next unless $popup_status[$i];
  1223. # print "$i: ",$popup_status[$i]->{time}," - ", $issued_h{$popup_status[$i]->{time}},"\n";
  1224. $issued_h{$popup_status[$i]->{time}} && delete $issued_h{$popup_status[$i]->{time}};
  1225. }
  1226. }
  1227.  
  1228. # build unread authors from what's left
  1229. foreach (keys(%issued_h)) {
  1230. # eliminate duplicate authors
  1231. next if $popup_authors && ($popup_authors =~ m/\Q$issued_h{$_}\E/);
  1232. $popup_authors .= ($popup_authors ? ", $issued_h{$_}" : "$issued_h{$_}");
  1233. }
  1234.  
  1235. # Create popup text
  1236. if ($popup_authors) {
  1237. $popup_authors =~ s/, ([\w\s-]+)$/ $trans{notify_and} $1/; # replace final comma with "and"
  1238. $popup_authors = clean_text_and_decode($popup_authors);
  1239. $popup_text = "<span foreground=\"#000000\"><small>$trans{notify_new_mail}$popup_authors ...</small></span>";
  1240. }
  1241.  
  1242. # Save current unread list
  1243. @popup_status = @messages;
  1244.  
  1245. # Finally, display popup if there's any new mail
  1246. # and run any command that the user has specified in the prefs
  1247. if ($popup_text) {
  1248. popup($popup_text);
  1249. run_command($notify_command) if $notify_command;
  1250. }
  1251.  
  1252. } elsif (!$new_mail) {
  1253. notify();
  1254. }
  1255.  
  1256. # Need to return true to keep the timeout going ...
  1257. return 1;
  1258. }
  1259.  
  1260. # Note -- for some reason (?? why ??) the title does not need decoding; all other data apparently does. Very strange ...
  1261. sub clean_text_and_decode {
  1262. ($_) = @_;
  1263. # some basic replacements so that the text is readable ...
  1264. # (these aren't used by pango markup, unlike other HTML escapes)
  1265. s/&hellip;/\.\.\./g;
  1266. s/&\s/\&amp; /g;
  1267. s/\\u003c/</g;
  1268. # s/\\n//g;
  1269. s/<br\s*\/*\\*>/\n/g;
  1270. s/</\&lt;/g;
  1271. s/>/\&gt;/g;
  1272. s/&(?>([\w\d\,\.]+))(?!;)/\&amp;$1/g; #not a great fix, but at least it's simple (heavy irony ... :)
  1273. s/&nbsp;/ /g;
  1274. # s/\\n/\n/g;
  1275. # Encode::from_to($body, 'utf-8', 'iso-8859-15');
  1276. # eval { decode("utf8", $_, Encode::FB_CROAK); };
  1277. # my $body_decode = $@ ? $_ : decode("utf8", $_);
  1278. #my $body_decode= decode("utf-8", $_);
  1279.  
  1280. # I have no idea why this works ...
  1281. my $body_encode = encode("utf8", $_);
  1282. my $body_decode = decode("utf8", $body_encode);
  1283.  
  1284. return $body_decode;
  1285. }
  1286.  
  1287. sub clean_text {
  1288. ($_) = @_;
  1289. # some basic replacements so that the text is readable ...
  1290. # (these aren't used by pango markup, unlike other HTML escapes)
  1291. s/&hellip;/\.\.\./g;
  1292. s/&\s/\&amp; /g;
  1293. s/\\u003c/</g;
  1294. # s/\\n//g;
  1295. s/<br\s*\/*\\*>/\n/g;
  1296. s/</\&lt;/g;
  1297. s/>/\&gt;/g;
  1298. s/&(?>([\w\d\,\.]+))(?!;)/\&amp;$1/g; #not a great fix, but at least it's simple (heavy irony ... :)
  1299. s/&nbsp;/ /g;
  1300. # s/\\n/\n/g;
  1301. return $_;
  1302. }
  1303.  
  1304.  
  1305. sub clean_text_body {
  1306. ($_) = @_;
  1307. # some basic replacements so that the text is readable ...
  1308. # (these aren't used by pango markup, unlike other HTML escapes)
  1309. s/&hellip;/\.\.\./g;
  1310. # s/&\s/\&amp; /g;
  1311. s/\\u003c/</g;
  1312. s/\>/>/g;
  1313. s/\\u([\d\w]{4})/"&#".hex($1).";";/gex;
  1314. s/&\#(\d+)\;/chr($1)/gex;
  1315.  
  1316. s/\\t/\t/g;
  1317. # s/\s\\n//g;
  1318. # s/\\n\s//g;
  1319. # s/\\n/ /g;
  1320. s/(\w)\\n(\w)/$1 $2/g;
  1321. s/\\n//g;
  1322. s/(\\n)+/\n/g;
  1323. s/\\(.)/$1/g;
  1324. s/<br\s*\/*\\*>/\n/g;
  1325. s/<p\s*\/*\\*>/\n\n/g;
  1326. s/<\/div\\*>/\n/g; # GMail now uses div blocks for paragraphs! Who'd have thought they could be so abhorrent?
  1327. # s/(?:\n\s*){3,}/\n\n/sg;
  1328. s/<.*?>//g unless $libsexy;
  1329. s/<a.*?(href=".*?").*?>(.*?)<\/a>/<-a $1>$2<-\/a>/ig;
  1330. s/<[^-].*?>//g;
  1331. # s/<([\/]|[^a])[^a].*?>//g;
  1332. # s/<a\s+>(.*?)<\/a>/$1/g;
  1333. s/<-/</g;
  1334. s/\\'/'/g;
  1335. # s/</\&lt;/g;
  1336. # s/>/\&gt;/g;
  1337. # s/&(?>([\w\d\,\.]+))(?!;)/\&amp;$1/g; #not a great fix, but at least it's simple (heavy irony ... :)
  1338. s/&nbsp;/ /g;
  1339. # s/\\n/\n/g;
  1340. # Encode::from_to($body, 'utf-8', 'iso-8859-15');
  1341. # eval { decode("utf8", $_, Encode::FB_CROAK); };
  1342. # my $body_decode = $@ ? $_ : decode("utf8", $_);
  1343. # my $body_encode = encode("utf8", $_);
  1344.  
  1345. # I have no idea why this works either ...
  1346. my $body_decode = decode("utf8", $_);
  1347.  
  1348. return $body_decode;
  1349. }
  1350.  
  1351.  
  1352. #################################
  1353. # External command handling ...
  1354. #
  1355.  
  1356. sub open_gmail {
  1357. # a routine to open Gmail in a web browser ... or not, as the user prefers!
  1358. my $command = $gmail_command;
  1359. my $login_address = get_login_href($gmail_web_address);
  1360. run_command($command, $login_address);
  1361. }
  1362.  
  1363. sub run_command {
  1364. my ($command, $address) = @_;
  1365.  
  1366. # We now allow the use of '%u' to delineate the web address
  1367. if ($address) {
  1368. $command =~ s/\%u/"$address"/g;
  1369. }
  1370.  
  1371. # allows the number of new messages to be used in scripts! :)
  1372. if ($command =~ m/\%m/) {
  1373. my $messages = @messages;
  1374. $command =~ s/\%m/$messages/g;
  1375. }
  1376.  
  1377. print "run command: $command\n" unless $silent;
  1378. system("$command &");
  1379. }
  1380.  
  1381.  
  1382. #############
  1383. # Prefs I/O
  1384. #
  1385.  
  1386. # These routines read or save anything referenced in %pref_variables ... isn't that neat?
  1387. # NB: as of version 1.9.3, we've moved over to an XML format - this allows us to save more complex data structures
  1388. # (i.e. hashes for the check delay on various labels) with ease ...
  1389.  
  1390. sub read_prefs {
  1391. unless (-e $prefs_file) {
  1392. # old, deprecated simple text tile method ...
  1393. return unless -e $prefs_file_nonxml;
  1394. open(PREFS, "<$prefs_file_nonxml") || die "Cannot open $prefs_file_nonxml for reading: $!\n";
  1395.  
  1396. # lock shared variables
  1397. lock($user);
  1398. lock($passwd);
  1399. lock($save_passwd);
  1400. lock($gmail_address);
  1401.  
  1402. while (<PREFS>) {
  1403. s/[\n\r]//g;
  1404. next if /^$/;
  1405. my ($key, $value) = split m/ = /;
  1406. my $pointer = $pref_variables{$key};
  1407. $$pointer = $value;
  1408. }
  1409. close (PREFS);
  1410. } else {
  1411. # new xml method
  1412. # read translations file if it exists
  1413. open(PREFS, "<$prefs_file") || die("Could not open $prefs_file for reading: $!\n");
  1414. my $prefs = join("",<PREFS>);
  1415. close PREFS;
  1416.  
  1417. # lock shared variables
  1418. lock($user);
  1419. lock($passwd);
  1420. lock($save_passwd);
  1421. lock($gmail_address);
  1422.  
  1423. my $prefs_xml = XMLin($prefs, ForceArray => 1);
  1424.  
  1425. ## For debugging ...
  1426. # use Data::Dumper;
  1427. # print Dumper $prefs_xml;
  1428.  
  1429. foreach my $i (keys %pref_variables) {
  1430. my $pointer = $pref_variables{$i};
  1431. for (ref($pointer)) {
  1432. /SCALAR/ && do {
  1433. $$pointer = $prefs_xml->{$i} if defined($prefs_xml->{$i});
  1434. last };
  1435.  
  1436. /HASH/ && do {
  1437. # last unless ref($prefs_xml->{$i}) eq "HASH";
  1438. %$pointer = %{ $prefs_xml->{$i}->[0]} if defined($prefs_xml->{$i}->[0]);
  1439. last };
  1440.  
  1441. /ARRAY/ && do {
  1442. # last unless ref($prefs_xml->{$i}) eq "HASH";
  1443. @$pointer = @{ $prefs_xml->{$i}->[0]} if defined($prefs_xml->{$i}->[0]);
  1444. last };
  1445. }
  1446. }
  1447. }
  1448.  
  1449. convert_labels_from_hash();
  1450. set_icons();
  1451. set_language();
  1452.  
  1453. return 1;
  1454. }
  1455.  
  1456. sub write_prefs {
  1457. # new XML-based preferences routine ...
  1458.  
  1459. # lock shared variables
  1460. lock($user);
  1461. lock($passwd);
  1462. lock($save_passwd);
  1463. lock($gmail_address);
  1464.  
  1465. convert_labels_from_array();
  1466.  
  1467. my %xml_out;
  1468. foreach my $i (keys %pref_variables) {
  1469. my $pointer = $pref_variables{$i};
  1470. for (ref($pointer)) {
  1471. /SCALAR/ && do {
  1472. $xml_out{$i} = $$pointer if defined($$pointer);
  1473. last };
  1474.  
  1475. /HASH/ && do {
  1476. $xml_out{$i} = {%$pointer}; # if defined(%$pointer);
  1477. last };
  1478. }
  1479.  
  1480. }
  1481.  
  1482. my $prefs = XMLout(\%xml_out, AttrIndent=>1);
  1483. open(PREFS, ">$prefs_file") || die("Could not open $prefs_file file for writing: $!");
  1484. binmode PREFS, ":utf8";
  1485. print PREFS $prefs;
  1486. close PREFS;
  1487. }
  1488.  
  1489. # This seems a bit silly, I know - but I can't seem to share a multi-dimensional data structure,
  1490. # and if I keep things as a straightforward hash then we can't have nice GUI editing
  1491. # (because I need an ordered structure to do this)
  1492. #
  1493. # It's very cumbersome though - I'm not all that happy with this solution!!!
  1494. sub convert_labels_from_hash {
  1495. @labels=();
  1496. push @labels, {label => "$_", delay => $label_delay{$_}} foreach sort(keys(%label_delay));
  1497. }
  1498.  
  1499. sub convert_labels_from_array {
  1500. %label_delay=();
  1501. $label_delay{$_->{label}} = $_->{delay} foreach @labels;
  1502. }
  1503.  
  1504.  
  1505. #####################
  1506. # Notify popups ...
  1507. #
  1508.  
  1509. sub notify {
  1510. # popup notify code to replace tooltips
  1511. # Why? Because tooltips can't do nice pango markup! :-)
  1512. my ($status, $text) = @_;
  1513. my $new_mail = @messages;
  1514.  
  1515. # display number of messages
  1516. if ($mailno) {
  1517. # print "setting \"$new_mail\"\n";
  1518. $number_label->set_markup("$new_mail");
  1519. $new_mail ? $number_label->show : $number_label->hide;
  1520. # $new_mail ? $number_label->set_markup("$new_mail") : $number_label->set_markup(" ")
  1521. }
  1522.  
  1523. my @sorted_messages = sort {$b->{time} <=> $a->{time}} @messages;
  1524. @messages = @sorted_messages;
  1525.  
  1526. unless ($status) {
  1527. if ($new_mail > 1) {
  1528. $status = "<small><span foreground=\"#000000\">$trans{notify_multiple1}$new_mail$trans{notify_multiple2}</span></small>";
  1529. } elsif ($new_mail) {
  1530. $status = "<small><span foreground=\"#000000\">$trans{notify_single1}$new_mail$trans{notify_single2}</span></small>";
  1531. } else {
  1532. # No new messages
  1533. $image->set_from_pixbuf($no_mail_pixbuf);
  1534.  
  1535. my $time = $time_24 ? `date +\"%k:%M\"` : `date +\"%l:%M %P\"`;
  1536. chomp($time);
  1537. $time =~ s/^\s+//g;
  1538. $status = "<span foreground=\"#000000\">$trans{notify_no_mail} <small>($time)</small></span>";
  1539.  
  1540. @popup_status = ();
  1541.  
  1542. run_command($nomail_command) if $nomail_command;
  1543. }
  1544. }
  1545.  
  1546.  
  1547. # strip markup for command line ...
  1548. unless ($silent) {
  1549. $_ = $status;
  1550. s/\<.*?\>//g;
  1551. print "$_\n";
  1552. }
  1553.  
  1554. # Check if popup is currently displayed ...
  1555. my $redisplay = 1 if (($win_notify) && ($win_notify->visible));
  1556.  
  1557. # *sigh* ... bloody gtk won't let me do this:
  1558. # if (($win_notify) && ($win_notify->visible)) {
  1559. # print "getting vadj\n";
  1560. # $vadj = $scrolled->get_vadjustment if $scrolled;
  1561. # } else {
  1562. # $vadj = 0;
  1563. # }
  1564.  
  1565. # Don't destroy the popup containing mail messages if we're just doing another check ...
  1566. if (@messages && $redisplay && ($status =~ /$trans{notify_check}/ || $status =~ /$trans{notify_undoing}/)) {
  1567. $status_label->set_markup("<span foreground=\"#000000\"><small>$status</small></span>");
  1568. show_notify();
  1569. return;
  1570. }
  1571.  
  1572. # return if (@messages && !defined($text));
  1573.  
  1574. if (!@messages && !$notify_vis && $redisplay) {
  1575. $redisplay = 0;
  1576. $win_notify->hide;
  1577. }
  1578.  
  1579. # Create new popup
  1580. my $win_notify_temp = Gtk2::Window->new('popup');
  1581.  
  1582. # If we're using enter/leave notification, we need to create borders with eventboxes
  1583. # - if there's a gap between window and eventbox, moving into the eventbox is considered a leave notification from the window!
  1584. my $notifybox_b = Gtk2::EventBox->new;
  1585. $notifybox_b->modify_bg('normal', Gtk2::Gdk::Color->new (0, 0, 0));
  1586.  
  1587. # we use the vbox here simply to give an outer border ...
  1588. $notify_vbox_b = Gtk2::VBox->new (0, 0);
  1589. $notify_vbox_b->set_border_width(1);
  1590. $notifybox_b->add($notify_vbox_b);
  1591.  
  1592. $notifybox = Gtk2::EventBox->new;
  1593. $notifybox->modify_bg('normal', Gtk2::Gdk::Color->new (65000, 65000, 65000));
  1594. $notify_vbox_b->pack_start($notifybox,0,0,0);
  1595.  
  1596. # we use the vbox here simply to give an internal border ...
  1597. my $notify_vbox = Gtk2::VBox->new (0, 0);
  1598. $notify_vbox->set_border_width(4);
  1599. $notifybox->add($notify_vbox);
  1600.  
  1601. # display mail status
  1602. my $status_hbox = Gtk2::HBox->new(0,0);
  1603. $notify_vbox->pack_start($status_hbox,0,0,0);
  1604.  
  1605. $status_label = Gtk2::Label->new;
  1606. $status_label->set_markup("<span foreground=\"#000000\">$status</span>");
  1607. $status_hbox->pack_start($status_label,0,0,0);
  1608.  
  1609. # $message_flag = @text ? 1 : 0;
  1610.  
  1611. if (@messages && $cookies) {
  1612. # mark all as read button and spacer
  1613. my $mark_all_label = Gtk2::Label->new;
  1614. $mark_all_label->set_markup(text_norm($trans{mail_mark_all}, "", ""));
  1615.  
  1616. my $mark_all_ebox = Gtk2::EventBox->new();
  1617. $mark_all_ebox->modify_bg('normal', Gtk2::Gdk::Color->new (65000, 65000, 65000));
  1618. my $ma1 = $mark_all_ebox->signal_connect(enter_notify_event=>sub{$mark_all_label->set_markup(text_u($trans{mail_mark_all}, "", ""));});
  1619. my $ma2 = $mark_all_ebox->signal_connect(leave_notify_event=>sub{$mark_all_label->set_markup(text_norm($trans{mail_mark_all}, "", ""));});
  1620.  
  1621. $mark_all_ebox->signal_connect(button_press_event=>sub{
  1622. @undo_buffer=();
  1623. my @labels_to_check;
  1624. foreach (@messages) {
  1625. my $id = $_->{id};
  1626. push @labels_to_check, $_->{label};
  1627. $request->enqueue(gen_action_url($gmail_act{read},$id));
  1628. $mark_all_label->set_markup(text_u($trans{mail_marking_all}, "", ""));
  1629.  
  1630. # don't want to try to disconnect the signals multiple times!
  1631. if ($ma1) {
  1632. $mark_all_ebox->signal_handler_disconnect($ma1);
  1633. $mark_all_ebox->signal_handler_disconnect($ma2);
  1634. $ma1 = $ma2 = undef;
  1635. }
  1636. show_notify();
  1637. push @undo_buffer, [$id, $_->{label}, 'read'];
  1638. }
  1639. queue_check($_) foreach @labels_to_check;
  1640. });
  1641.  
  1642. $mark_all_ebox->add($mark_all_label);
  1643. $status_hbox->pack_end($mark_all_ebox,0,0,0);
  1644.  
  1645. }
  1646.  
  1647. if (@messages) {
  1648. my $spacer = Gtk2::Label->new;
  1649. $spacer->set_markup("<small> </small>");
  1650. $notify_vbox->pack_start($spacer,0,0,0);
  1651. }
  1652.  
  1653. # display messages
  1654. my $number = @messages;
  1655. my $count;
  1656. foreach (@messages) {
  1657. $count++;
  1658. my ($href, $id, $title, $author, $body, $label, $att) = ($_->{href}, $_->{id}, $_->{title}, $_->{author}, $_->{body}, $_->{label}, $_->{attachment});
  1659. my $mb;
  1660. if ($messages_ext{$id}) {
  1661. $mb = $messages_ext{$id}->{text};
  1662. $body = $messages_ext{$id}->{text} if $messages_ext{$id}->{shown};
  1663. }
  1664.  
  1665. # --- title and author ---
  1666.  
  1667. my $hbox_t = Gtk2::HBox->new(0,0);
  1668. $notify_vbox->pack_start($hbox_t,0,0,0);
  1669.  
  1670. my $vbox_t = Gtk2::VBox->new(0,0);
  1671. $hbox_t->pack_start($vbox_t,0,0,0);
  1672.  
  1673. my $hbox_tt = Gtk2::HBox->new(0,0);
  1674. $vbox_t->pack_start($hbox_tt,0,0,0);
  1675.  
  1676.  
  1677.  
  1678. my $title_l = Gtk2::Label->new;
  1679. $title_l->set_markup("<span foreground=\"#000000\"><b><u>$title</u></b></span><small> <span foreground=\"#006633\">$label</span></small>");
  1680. $title_l->set_line_wrap(1);
  1681.  
  1682. my $title_l_ebox = Gtk2::EventBox->new();
  1683. $title_l_ebox->modify_bg('normal', Gtk2::Gdk::Color->new (65000, 65000, 65000));
  1684. my $s1 = $title_l_ebox->signal_connect(enter_notify_event=>sub{$title_l->set_markup("<span foreground=\"#000000\"><b><u><i>$title</i></u></b></span><small> <span foreground=\"#006633\">$label</span></small>")});
  1685. my $s2 = $title_l_ebox->signal_connect(leave_notify_event=>sub{$title_l->set_markup("<span foreground=\"#000000\"><b><u>$title</u></b></span><small> <span foreground=\"#006633\">$label</span></small>")});
  1686. $title_l_ebox->signal_connect(button_press_event=>sub{
  1687. # grabbing the full text of a message
  1688. return unless $cookies;
  1689. $title_l_ebox->signal_handler_disconnect($s1);
  1690. $title_l_ebox->signal_handler_disconnect($s2);
  1691. unless ($mb) {
  1692. # print "Message ID = $id\n";
  1693. # yep, here's the magic code. This accesses the datapack, which we read with a little hack in the check routine ...
  1694. #$request->enqueue("GET:".gen_prefix_url()."/?ui=1&view=cv&search=all&th=$id&qt=&prf=1&pft=undefined&rq=xm&at=$gmail_at");
  1695.  
  1696. # As of 3/11/10, Gmail has removed access to the old ui=1 version of Gmail
  1697. # ui=2 requires a POST command to get the datapack (which has also changed formats slightly)
  1698. $request->enqueue("POST_MB:".gen_prefix_url()."/?ui=2&ik=$gmail_ik&rid=&view=cv&prf=1&_reqid=&nsc=1|&mb=0&rt=j&cat=all&search=cat&th=$id&at=$gmail_at");
  1699. } else {
  1700. # this allows the message text to be toggled ...
  1701. # oh yes, we're all about usability here, folks! :)
  1702. $messages_ext{$id}->{shown} = 1-$messages_ext{$id}->{shown};
  1703. }
  1704. notify();
  1705. });
  1706.  
  1707. $title_l_ebox->add($title_l);
  1708. $hbox_tt->pack_start($title_l_ebox,0,0,0);
  1709.  
  1710. # short spacer
  1711. my $title_spacer = Gtk2::HBox->new(0,0);
  1712. $title_spacer->set_border_width(1);
  1713. $vbox_t->pack_start($title_spacer,0,0,0);
  1714.  
  1715. # my god, gtk2 has the most stupid packing routines imaginable!!!
  1716. my $hbox_from = Gtk2::HBox->new(0,0);
  1717. $vbox_t->pack_start($hbox_from,0,0,0);
  1718.  
  1719.  
  1720. # --- Starring messages ---
  1721. # Note: there's no way to check the star-status of a message from the atom feed
  1722. # of course, we're gradually getting to the stage where it'd be much easier to
  1723. # poll the server via http requests now, than to retrieve messages via the feed.
  1724. # (I'm thinking about it! Definitely thinking about it ... :)
  1725. #
  1726. # In the meantime, the icon adds a quick way to star messages that you'd like
  1727. # to come back to later, but ignore for the present.
  1728.  
  1729. # Star icons are taken from Mozilla Firefox 3 (http://getfirefox.com), licensed under
  1730. # the Creative Commons license
  1731.  
  1732. my $star_i = Gtk2::Image->new();
  1733. if ($messages_ext{$id}->{star}) {
  1734. $star_i->set_from_pixbuf($star_pixbuf);
  1735. } else {
  1736. $messages_ext{$id}->{star}=0;
  1737. $star_i->set_from_pixbuf($nostar_pixbuf);
  1738. }
  1739.  
  1740. my $star_ebox = Gtk2::EventBox->new();
  1741. $star_ebox->modify_bg('normal', Gtk2::Gdk::Color->new (65000, 65000, 65000));
  1742. $star_ebox->signal_connect(button_press_event=>sub{
  1743. # setting the star
  1744. return unless $cookies;
  1745. $messages_ext{$id}->{star} = 1-$messages_ext{$id}->{star};
  1746. if ($messages_ext{$id}->{star}) {
  1747. $star_i->set_from_pixbuf($star_pixbuf);
  1748. $request->enqueue(gen_action_url($gmail_act{star},$id));
  1749. } else {
  1750. $star_i->set_from_pixbuf($nostar_pixbuf);
  1751. $request->enqueue(gen_action_url($gmail_act{unstar},$id));
  1752. }
  1753. });
  1754.  
  1755. $star_ebox->add($star_i);
  1756.  
  1757. my $star_space = Gtk2::HBox->new(0,0);
  1758. $star_space->set_border_width(3);
  1759.  
  1760. # From: line (with star)
  1761. my $from_l = Gtk2::Label->new;
  1762. $from_l->set_markup("<b>$trans{notify_from}</b> $author");
  1763. $from_l->set_line_wrap(1);
  1764.  
  1765. $hbox_from->pack_start($from_l,0,0,0);
  1766. $hbox_from->pack_start($star_space,0,0,0);
  1767. $hbox_from->pack_start($star_ebox,0,0,0);
  1768.  
  1769.  
  1770. # --- Attachment icon ---
  1771. if ($messages_ext{$id}->{attachment}) {
  1772. $att = $messages_ext{$id}->{attachment};
  1773. my ($image_name) = ($att =~ m/.*\/(.*)$/);
  1774.  
  1775. check_icon($att);
  1776.  
  1777. my $att_image = Gtk2::Image->new_from_pixbuf(set_icon("$icons_dir/$image_name", 16));
  1778. $hbox_t->pack_end($att_image,0,0,0);
  1779.  
  1780. # my $title_att = Gtk2::Label->new;
  1781. # $title_att->set_markup("<span foreground=\"#000000\"><small>[$att]</small></span>");
  1782. # $title_att->set_line_wrap(1);
  1783. # $hbox_t->pack_end($title_att,0,0,0);
  1784.  
  1785. }
  1786.  
  1787.  
  1788.  
  1789. # --- options ---
  1790.  
  1791. my $hbox_opt = Gtk2::HBox->new(0,0);
  1792. $notify_vbox->pack_start($hbox_opt,0,0,0);
  1793.  
  1794. my $command_label = Gtk2::Label->new;
  1795. $command_label->set_markup(text_norm($trans{mail_open}, ""));
  1796.  
  1797. my $title_ebox = Gtk2::EventBox->new();
  1798. $title_ebox->modify_bg('normal', Gtk2::Gdk::Color->new (65000, 65000, 65000));
  1799. $title_ebox->signal_connect(button_press_event=>sub{
  1800. run_command($gmail_command, get_login_href($href));
  1801. if ($cookies) {
  1802. # mark as read if we can - otherwise opened messages hang around ...
  1803. ### probably need an option for this!
  1804. $request->enqueue(gen_action_url($gmail_act{read},$id));
  1805. @undo_buffer=([$id, $label, 'read']);
  1806. queue_check($label);
  1807. }
  1808. });
  1809. $title_ebox->signal_connect(enter_notify_event=>sub{$command_label->set_markup(text_u($trans{mail_open},""));});
  1810. $title_ebox->signal_connect(leave_notify_event=>sub{$command_label->set_markup(text_norm($trans{mail_open}, ""));});
  1811.  
  1812. $title_ebox->add($command_label);
  1813. $hbox_opt->pack_start($title_ebox,0,0,0);
  1814.  
  1815.  
  1816. if ($cookies) {
  1817. # We can only do these cute things when we've got a Gmail_at string to work with ...
  1818. # thus it's limited to the cookie_login method
  1819.  
  1820. # ---- mark as read
  1821.  
  1822. my $mark_label = Gtk2::Label->new;
  1823. $mark_label->set_markup(text_norm($trans{mail_mark}));
  1824.  
  1825. my $mark_ebox = Gtk2::EventBox->new();
  1826. $mark_ebox->modify_bg('normal', Gtk2::Gdk::Color->new (65000, 65000, 65000));
  1827. my $s1 = $mark_ebox->signal_connect(enter_notify_event=>sub{$mark_label->set_markup(text_u($trans{mail_mark}));});
  1828. my $s2 = $mark_ebox->signal_connect(leave_notify_event=>sub{$mark_label->set_markup(text_norm($trans{mail_mark}));});
  1829. $mark_ebox->signal_connect(button_press_event=>sub{
  1830. $request->enqueue(gen_action_url($gmail_act{read},$id));
  1831. $mark_label->set_markup(text_u($trans{mail_marking}));
  1832. $mark_ebox->signal_handler_disconnect($s1);
  1833. $mark_ebox->signal_handler_disconnect($s2);
  1834. show_notify();
  1835. @undo_buffer=([$id, $label, 'read']);
  1836. queue_check($label);
  1837. });
  1838. $mark_ebox->add($mark_label);
  1839. $hbox_opt->pack_start($mark_ebox,0,0,0);
  1840.  
  1841. # ---- archive
  1842.  
  1843. my $archive_label = Gtk2::Label->new;
  1844. $archive_label->set_markup(text_norm($trans{mail_archive}));
  1845.  
  1846. my $archive_ebox = Gtk2::EventBox->new();
  1847. $archive_ebox->modify_bg('normal', Gtk2::Gdk::Color->new (65000, 65000, 65000));
  1848. my $s1a = $archive_ebox->signal_connect(enter_notify_event=>sub{$archive_label->set_markup(text_u($trans{mail_archive}));});
  1849. my $s2a = $archive_ebox->signal_connect(leave_notify_event=>sub{$archive_label->set_markup(text_norm($trans{mail_archive}));});
  1850. $archive_ebox->signal_connect(button_press_event=>sub{
  1851. $request->enqueue(gen_action_url($gmail_act{archive},$id));
  1852. $request->enqueue(gen_action_url($gmail_act{read},$id)) if $archive_as_read;
  1853. $archive_label->set_markup(text_u($trans{mail_archiving}));
  1854. $archive_ebox->signal_handler_disconnect($s1a);
  1855. $archive_ebox->signal_handler_disconnect($s2a);
  1856. show_notify();
  1857. @undo_buffer=([$id, $label, 'archive']);
  1858. push(@{$undo_buffer[0]}, 'read') if $archive_as_read;
  1859. queue_check($label);
  1860. });
  1861. $archive_ebox->add($archive_label);
  1862. $hbox_opt->pack_start($archive_ebox,0,0,0);
  1863.  
  1864. # ---- report spam
  1865.  
  1866. my $spam_label = Gtk2::Label->new;
  1867. $spam_label->set_markup(text_norm($trans{mail_report_spam}));
  1868.  
  1869. my $spam_ebox = Gtk2::EventBox->new();
  1870. $spam_ebox->modify_bg('normal', Gtk2::Gdk::Color->new (65000, 65000, 65000));
  1871. my $s1s = $spam_ebox->signal_connect(enter_notify_event=>sub{$spam_label->set_markup(text_u($trans{mail_report_spam}));});
  1872. my $s2s = $spam_ebox->signal_connect(leave_notify_event=>sub{$spam_label->set_markup(text_norm($trans{mail_report_spam}));});
  1873. $spam_ebox->signal_connect(button_press_event=>sub{
  1874. $request->enqueue(gen_action_url($gmail_act{read},$id));
  1875. $request->enqueue(gen_action_url($gmail_act{spam},$id));
  1876. $spam_label->set_markup(text_u($trans{mail_reporting_spam}));
  1877. $spam_ebox->signal_handler_disconnect($s1s);
  1878. $spam_ebox->signal_handler_disconnect($s2s);
  1879. show_notify();
  1880. @undo_buffer=([$id, $label, 'spam', 'read']);
  1881. queue_check($label);
  1882. });
  1883. $spam_ebox->add($spam_label);
  1884. $hbox_opt->pack_start($spam_ebox,0,0,0);
  1885.  
  1886. # ---- delete
  1887.  
  1888. my $delete_label = Gtk2::Label->new;
  1889. $delete_label->set_markup(text_norm($trans{mail_delete}));
  1890.  
  1891. my $delete_ebox = Gtk2::EventBox->new();
  1892. $delete_ebox->modify_bg('normal', Gtk2::Gdk::Color->new (65000, 65000, 65000));
  1893. my $s1d = $delete_ebox->signal_connect(enter_notify_event=>sub{$delete_label->set_markup(text_u($trans{mail_delete}));});
  1894. my $s2d = $delete_ebox->signal_connect(leave_notify_event=>sub{$delete_label->set_markup(text_norm($trans{mail_delete}));});
  1895. $delete_ebox->signal_connect(button_press_event=>sub{
  1896. $request->enqueue(gen_action_url($gmail_act{delete},$id));
  1897. $delete_label->set_markup(text_u($trans{mail_deleting}));
  1898. $delete_ebox->signal_handler_disconnect($s1d);
  1899. $delete_ebox->signal_handler_disconnect($s2d);
  1900. show_notify();
  1901. @undo_buffer=([$id, $label, 'delete']);
  1902. queue_check($label);
  1903. });
  1904. $delete_ebox->add($delete_label);
  1905. $hbox_opt->pack_start($delete_ebox,0,0,0);
  1906.  
  1907. }
  1908.  
  1909. # --- Mail body ---
  1910.  
  1911. my $hbox_b = Gtk2::HBox->new(0,0);
  1912. $notify_vbox->pack_start($hbox_b,0,0,0);
  1913.  
  1914. my $body_l;
  1915. if ($libsexy) {
  1916. $body_l = Gtk2::Sexy::UrlLabel->new;
  1917. $body_l->signal_connect(url_activated => sub{
  1918. my ($url_label, $url) = @_;
  1919. run_command($gmail_command, $url);
  1920. });
  1921. } else {
  1922. $body_l = Gtk2::Label->new;
  1923. }
  1924. $body_l->set_line_wrap(1);
  1925. # my ($w, $h) = $body_l->get_size_request;
  1926. # print "($w, $h)\n";
  1927. $body_l->set_size_request($popup_size) if $popup_size;
  1928. # $body_l->set_width_chars(20);
  1929. # $body_l->set_selectable(1);
  1930. # $body_l->set_max_width_chars(100);
  1931.  
  1932.  
  1933. my $term = ($count == $number) ? "" : "\n";
  1934. $body_l->set_markup("<span foreground=\"grey25\">$body</span>$term");
  1935. $hbox_b->pack_start($body_l,0,0,0);
  1936. }
  1937.  
  1938. $win_notify_temp->add($notifybox_b);
  1939.  
  1940. # If popup was previously displayed, re-show it ...
  1941. if ($redisplay) {
  1942. show_notify($win_notify_temp);
  1943. } else {
  1944. $win_notify->destroy if $win_notify;
  1945. $win_notify="";
  1946. $win_notify = $win_notify_temp;
  1947. }
  1948. }
  1949.  
  1950.  
  1951. sub check_icon {
  1952. # download the icon if it doesn't exist ...
  1953. my ($image) = @_;
  1954. my ($image_name) = ($image =~ m/.*\/(.*)$/);
  1955. unless (-e "$icons_dir/$image_name") {
  1956. print "Retrieving $image from mail.google.com ...\n" unless $silent;
  1957. $request->enqueue("IMAGE:mail.google.com$image $image_name");
  1958. # return unless $data;
  1959. # print "data is $data\ngoing to >$icons_dir/$image_name";
  1960. # open (DATA, ">$icons_dir/$image_name") || die "Could not open file for writing: $!\n";
  1961. # print DATA $data;
  1962. # close DATA;
  1963. $error_block->down;
  1964. }
  1965. }
  1966.  
  1967. sub http_get_main {
  1968. my ($address) = @_;
  1969.  
  1970. my $ua = LWP::UserAgent->new();
  1971. my $req = HTTP::Request->new(GET => "$address");
  1972.  
  1973. my $response = $ua->request($req);
  1974. if ($response->is_error) {
  1975. print "error!\n";
  1976. return 0;
  1977. }
  1978.  
  1979. my $http = $response->content;
  1980.  
  1981. return $http;
  1982.  
  1983.  
  1984. }
  1985.  
  1986. sub text_norm {
  1987. my ($body, $pre, $post) = @_;
  1988. $pre = "| " unless defined($pre);
  1989. $post = " " unless defined($post);
  1990. return "$pre<small><span foreground=\"darkred\">$body</span></small>$post";
  1991. }
  1992.  
  1993. sub text_u {
  1994. my ($body, $pre, $post) = @_;
  1995. $pre = "| " unless defined($pre);
  1996. $post = " " unless defined($post);
  1997. return "$pre<small><span foreground=\"darkred\"><u>$body</u></span></small>$post";
  1998. }
  1999.  
  2000.  
  2001. sub get_login_href {
  2002. # Login directly to gmail ...
  2003. $_ = shift;
  2004.  
  2005. # The following is for people who like to stay permanently logged in ...
  2006. # (enable with -no-login on the command-line for now ...)
  2007. return $_ if $nologin;
  2008.  
  2009. my ($options) = m/.*?\?(.*)/;
  2010. my $options_uri = $options ? "?&$options" : "";
  2011.  
  2012. s/@/%40/g; # @ needs to be escaped in gmail address
  2013. s/http([^s])/https$1/g; # let's make it secure!
  2014.  
  2015. print "login command is: $_\n" unless $silent;
  2016.  
  2017. my $escaped_uri = URI_escape($_);
  2018. my $URI_user = URI_escape($user);
  2019. my $URI_passwd = URI_escape($passwd_decrypt);
  2020.  
  2021. my $target_uri;
  2022. if ($hosted) {
  2023. $target_uri = "http://mail.google.com/a/$hosted/$options_uri";
  2024. } else {
  2025. $target_uri = "https://www.google.com/accounts/ServiceLoginAuth?ltmpl=yj_wsad&ltmplcache=2&continue=$escaped_uri&service=mail&rm=false&ltmpl=yj_wsad&Email=$URI_user&Passwd=$URI_passwd&rmShown=1&null=Sign+in";
  2026. }
  2027.  
  2028. return $target_uri;
  2029. }
  2030.  
  2031.  
  2032. sub gen_action_url {
  2033. # I have a feeling that these complicated form post arguments are going to change
  2034. # without warning more than once in the future - collating things here should make
  2035. # updates a bit easier!
  2036. my ($act, $id) = @_;
  2037. my $search;
  2038.  
  2039. # Now that we can grab the full text of messages, we'd better clear the cache while we're here ...
  2040. # NB - I realise this won't remove all cached text, in the rare event someone looks at the full message text,
  2041. # and then opens it manually in the webbrowser - but it's the simplest solution for now ...
  2042. unless ($act =~ m/st/) {
  2043. $messages_ext{$id}=undef;
  2044. }
  2045.  
  2046. # Undeleting items from trash needs to have the search variable as "trash"
  2047. # - this is a quick hack to get around it!
  2048. ($act, $search) = split(":",$act);
  2049. $search ||= 'all';
  2050.  
  2051. my $prefix = gen_prefix_url();
  2052. return ("POST:$prefix/?&ik=&search=$search&view=tl&start=0|&act=$act&at=$gmail_at&vp=&msq=&ba=false&t=$id&fs=1&rt=j");
  2053.  
  2054. # if ($hosted) {
  2055. # return ("POST:mail.google.com/a/$hosted/?&ik=&search=$search&view=tl&start=0|&act=$act&at=$gmail_at&vp=&msq=&ba=false&t=$id&fs=1");
  2056. # } else {
  2057. # return ("POST:mail.google.com/mail/?&ik=&search=$search&view=tl&start=0|&act=$act&at=$gmail_at&vp=&msq=&ba=false&t=$id&fs=1");
  2058. # }
  2059. }
  2060.  
  2061. sub gen_prefix_url {
  2062. if ($hosted) {
  2063. return ("mail.google.com/a/$hosted");
  2064. } else {
  2065. return ("mail.google.com/mail");
  2066. }
  2067. }
  2068.  
  2069.  
  2070. sub undo_last {
  2071. # Undo last Gmail action ...
  2072. print "undo called\n" unless $silent;
  2073. return unless @undo_buffer;
  2074.  
  2075. notify($trans{notify_undoing});
  2076.  
  2077. my $label;
  2078. foreach my $i (@undo_buffer) {
  2079. my $id = shift(@$i);
  2080. $label = shift(@$i);
  2081. print "undoing $id, @$i\n" unless $silent;
  2082. foreach (@$i) {
  2083. $request->enqueue(gen_action_url($gmail_undo{$_},$id));
  2084. }
  2085. }
  2086. queue_check($label);
  2087. }
  2088.  
  2089. sub get_screen {
  2090. my ($boxx, $boxy)=@_;
  2091.  
  2092. # get screen resolution
  2093. my $monitor = $eventbox->get_screen->get_monitor_at_point($boxx,$boxy);
  2094. my $rect = $eventbox->get_screen->get_monitor_geometry($monitor);
  2095. my $height = $rect->height;
  2096.  
  2097. # support multiple monitors (thanks to Philip Jagielski for this simple solution!)
  2098. my $width;
  2099. unless ($disable_monitors_check) {
  2100. for my $i (0 .. $monitor) {
  2101. $width += $eventbox->get_screen->get_monitor_geometry($i)->width;
  2102. }
  2103. } else {
  2104. $width = $eventbox->get_screen->get_monitor_geometry($monitor)->width;
  2105. }
  2106.  
  2107. return ($monitor,$rect,$width,$height);
  2108. }
  2109.  
  2110. sub show_notify {
  2111. # We can only get the allocated width when the window is shown,
  2112. # so we do all this calculation in a separate subroutine ...
  2113. my ($win_notify_temp) = @_;
  2114. my $new_win = $win_notify_temp ? $win_notify_temp : $win_notify;
  2115.  
  2116. # get eventbox origin and icon height
  2117. my ($boxx, $boxy) = $eventbox->window->get_origin;
  2118. my $icon_height = $eventbox->allocation->height;
  2119.  
  2120. # get screen resolution
  2121. my ($monitor,$rect,$width,$height)=get_screen($boxx, $boxy);
  2122.  
  2123. # if the tray icon is at the top of the screen, it's safe to move the window
  2124. # to the previous window's position - this makes things look a lot smoother
  2125. # (we can't do it when the tray icon's at the bottom of the screen, because
  2126. # a larger window will cover the icon, and when we move it we'll get another
  2127. # show_notify() event)
  2128. $new_win->move($old_x,$old_y) if (($boxy<($height/2)) && ($old_x || $old_y));
  2129.  
  2130. # show the window to get width and height
  2131. $new_win->show_all unless ($new_win->visible);
  2132. my $notify_width=$new_win->allocation->width;
  2133. my $notify_height=$new_win->allocation->height;
  2134.  
  2135. if ($notify_height>($height-$icon_height-20)) {
  2136. # print "begin block\n";
  2137. $reshow=1;
  2138. $new_win->hide;
  2139.  
  2140. my $scrolled = Gtk2::ScrolledWindow->new;
  2141. $scrolled->modify_bg('normal', Gtk2::Gdk::Color->new (0, 0, 0));
  2142. $scrolled->set_policy('never','automatic');
  2143. $scrolled->set_shadow_type('GTK_SHADOW_NONE');
  2144. $notify_vbox_b->pack_start($scrolled,1,1,0);
  2145.  
  2146. my $scrolled_event = Gtk2::EventBox->new;
  2147. $scrolled_event->modify_bg('normal', Gtk2::Gdk::Color->new (0, 0, 0));
  2148.  
  2149. $scrolled->add_with_viewport($scrolled_event);
  2150.  
  2151.  
  2152. $new_win->resize($notify_width, $height-$icon_height-20);
  2153. $notifybox->reparent($scrolled_event);
  2154.  
  2155. $new_win->show_all;
  2156. $new_win->resize($notify_width, $height-$icon_height-20);
  2157. # print "vadj = $vadj\n";
  2158.  
  2159. $notify_height=$new_win->allocation->height;
  2160. $notify_width=$new_win->allocation->width;
  2161. }
  2162.  
  2163. # calculate best position
  2164. my $x_border = 4;
  2165. my $y_border = 5;
  2166. my $move_x = ($boxx+$notify_width+$x_border > $width) ? ($width-$notify_width-$x_border) : ($boxx);
  2167. my $move_y = ($boxy>($height/2)) ? ($boxy-$notify_height-$y_border) : ($boxy+$icon_height+$y_border);
  2168.  
  2169. # move the window
  2170. $new_win->move($move_x,$move_y) if ($move_x || $move_y);
  2171. Gtk2->main_iteration while (Gtk2->events_pending);
  2172.  
  2173. # $new_win->show_all unless ($new_win->visible);
  2174. # Gtk2->main_iteration while (Gtk2->events_pending);
  2175.  
  2176. # $scrolled->set_vadjustment($vadj) if $vadj;
  2177.  
  2178. # a small sleep to make compiz work better
  2179. # select(undef, undef, undef, 0.150);
  2180. if ($win_notify_temp) {
  2181. $win_notify->destroy;
  2182. $win_notify="";
  2183. $win_notify=$new_win;
  2184. }
  2185. # Gtk2->main_iteration while (Gtk2->events_pending);
  2186.  
  2187.  
  2188. ($old_x, $old_y) = ($move_x,$move_y);
  2189.  
  2190. # Enter/leave notification
  2191. $win_notify->signal_connect('enter_notify_event', sub {
  2192. # print "enter\n";
  2193. $notify_enter = 1;
  2194. my $persistence = Glib::Timeout->add($popup_persistence, sub {
  2195. $reshow=0;
  2196. });
  2197. });
  2198.  
  2199. $win_notify->signal_connect('leave_notify_event', sub {
  2200. # print "leave event ...\n";
  2201. return if ($reshow);
  2202.  
  2203. ### these four lines fix the XGL/Compiz problem where clicking on the links closes the notifier window
  2204. my ($widget, $event, $data) = @_;
  2205. if ($event->detail eq 'inferior') {
  2206. return;
  2207. }
  2208.  
  2209. # print "leave and hide\n";
  2210. $notify_enter = 0;
  2211. $notify_vis = 0;
  2212. $win_notify->hide;
  2213. });
  2214. }
  2215.  
  2216. sub popup {
  2217. # pops up a little message for new mail - disable by setting popup time to 0
  2218. return unless $popup_delay;
  2219.  
  2220. # no point displaying if the user is already looking at the popup ..
  2221. return if (($win_notify) && ($win_notify->visible));
  2222.  
  2223. my ($text) = @_;
  2224.  
  2225. $popup_win->destroy if $popup_win;
  2226.  
  2227. $popup_win = Gtk2::Window->new('popup');
  2228. $popup_win->set('allow-shrink',1);
  2229. $popup_win->set_border_width(2);
  2230. $popup_win->modify_bg('normal', Gtk2::Gdk::Color->new (14756, 20215, 33483));
  2231.  
  2232. # the eventbox is needed for the background ...
  2233. my $popupbox = Gtk2::EventBox->new;
  2234. $popupbox->modify_bg('normal', Gtk2::Gdk::Color->new (65000, 65000, 65000));
  2235.  
  2236. # the hbox gives an internal border, and allows us to chuck an icon in, too!
  2237. my $popup_hbox = Gtk2::HBox->new (0, 0);
  2238. $popup_hbox->set_border_width(4);
  2239. $popupbox->add($popup_hbox);
  2240.  
  2241. # Popup icon
  2242. my $popup_icon = Gtk2::Image->new_from_pixbuf($mail_pixbuf);
  2243. $popup_hbox->pack_start($popup_icon,0,0,3);
  2244.  
  2245. my $popuplabel = Gtk2::Label->new;
  2246. $popuplabel->set_line_wrap(1);
  2247.  
  2248. $popuplabel->set_markup("$text");
  2249. $popup_hbox->pack_start($popuplabel,0,0,3);
  2250. $popupbox->show_all;
  2251.  
  2252. $popup_win->add($popupbox);
  2253.  
  2254. # get eventbox origin and icon height
  2255. my ($boxx, $boxy) = $eventbox->window->get_origin;
  2256. my $icon_height = $eventbox->allocation->height;
  2257.  
  2258. # get screen resolution
  2259. my ($monitor,$rect,$width,$height)=get_screen($boxx, $boxy);
  2260.  
  2261. # show the window to get width and height
  2262. $popup_win->show_all;
  2263. my $popup_width=$popup_win->allocation->width;
  2264. my $popup_height=$popup_win->allocation->height;
  2265. $popup_win->hide;
  2266. $popup_win->resize($popup_width, 1);
  2267.  
  2268. # calculate best position
  2269. my $x_border = 4;
  2270. my $y_border = 6;
  2271. my $move_x = ($boxx+$popup_width+$x_border > $width) ? ($width-$popup_width-$x_border) : ($boxx);
  2272. my $move_y = ($boxy>($height/2)) ? ($boxy-$popup_height-$y_border) : ($icon_height+$y_border);
  2273.  
  2274. my $shift_y = ($boxy>($height/2)) ? 1 : 0;
  2275.  
  2276. $popup_win->move($move_x,$move_y);
  2277. $popup_win->show_all;
  2278.  
  2279. # and popup ...
  2280. my $ani_delay = 0.015;
  2281. for (my $i = 1; $i<=$popup_height; $i++) {
  2282. my $move_y = ($shift_y) ? ($boxy-$i-$y_border) : $move_y;
  2283.  
  2284. # move the window
  2285. $popup_win->move($move_x,$move_y);
  2286. $popup_win->resize($popup_width, $i);
  2287. Gtk2->main_iteration while (Gtk2->events_pending);
  2288.  
  2289. select(undef,undef,undef,$ani_delay);
  2290. }
  2291.  
  2292.  
  2293. my $close = Glib::Timeout->add($popup_delay, sub { popdown($popup_height, $popup_width, $shift_y, $move_y, $boxy, $y_border, $move_x) });
  2294. }
  2295.  
  2296. sub popdown {
  2297. # Hides the popup box with animation ...
  2298. my ($popup_height, $popup_width, $shift_y, $move_y, $boxy, $y_border, $move_x) = @_;
  2299.  
  2300. for (my $i = $popup_height; $i>0; $i--) {
  2301. my $move_y = ($shift_y) ? ($boxy-$i-$y_border) : $move_y;
  2302.  
  2303. # move the window
  2304. $popup_win->move($move_x,$move_y);
  2305. $popup_win->resize($popup_width, $i);
  2306. Gtk2->main_iteration while (Gtk2->events_pending);
  2307.  
  2308. select(undef,undef,undef,0.015);
  2309. }
  2310.  
  2311. $popup_win->destroy;
  2312. }
  2313.  
  2314.  
  2315. #######################
  2316. # Popup menu handling
  2317. #
  2318.  
  2319. sub handle_button_press {
  2320. # Modified from yarrsr ...
  2321. my ($widget, $event) = @_;
  2322.  
  2323. my $x = $event->x_root - $event->x;
  2324. my $y = $event->y_root - $event->y;
  2325.  
  2326. if ($event->button == 1) {
  2327. open_gmail();
  2328. } else {
  2329. $menu->popup(undef,undef, sub{return position_menu($x, $y)},0,$event->button,$event->time);
  2330. }
  2331. }
  2332.  
  2333. sub position_menu {
  2334. # Modified from yarrsr
  2335. my ($x, $y) = @_;
  2336.  
  2337. my $monitor = $menu->get_screen->get_monitor_at_point($x,$y);
  2338. my $rect = $menu->get_screen->get_monitor_geometry($monitor);
  2339.  
  2340. my $space_above = $y - $rect->y;
  2341. my $space_below = $rect->y + $rect->height - $y;
  2342.  
  2343. my $requisition = $menu->size_request();
  2344.  
  2345. if ($requisition->height <= $space_above || $requisition->height <= $space_below) {
  2346. if ($requisition->height <= $space_below) {
  2347. $y = $y + $eventbox->allocation->height;
  2348. } else {
  2349. $y = $y - $requisition->height;
  2350. }
  2351. } elsif ($requisition->height > $space_below && $requisition->height > $space_above) {
  2352. if ($space_below >= $space_above) {
  2353. $y = $rect->y + $rect->height - $requisition->height;
  2354. } else {
  2355. $y = $rect->y;
  2356. }
  2357. } else {
  2358. $y = $rect->y;
  2359. }
  2360.  
  2361. return ($x,$y,1);
  2362. }
  2363.  
  2364.  
  2365. sub pack_menu {
  2366. # This code (and the relevant menu display routine) is based
  2367. # on code from yarrsr (Yet Another RSS Reader) (http://yarrsr.sf.net)
  2368.  
  2369. $menu = Gtk2::Menu->new;
  2370.  
  2371. my $menu_check = Gtk2::ImageMenuItem->new($trans{menu_check});
  2372. $menu_check->set_image(Gtk2::Image->new_from_stock('gtk-refresh','menu'));
  2373. $menu_check->signal_connect('activate',sub {
  2374. queue_check();
  2375. foreach my $label (keys(%label_delay)) {
  2376. queue_check($label);
  2377. }
  2378. });
  2379.  
  2380. my $menu_undo;
  2381. if ($cookies) {
  2382. # Undo last POST action
  2383. $menu_undo = Gtk2::ImageMenuItem->new($trans{menu_undo});
  2384. $menu_undo->set_image(Gtk2::Image->new_from_stock('gtk-undo','menu'));
  2385. $menu_undo->signal_connect('activate', \&undo_last);
  2386. }
  2387.  
  2388. my $menu_compose = Gtk2::ImageMenuItem->new($trans{menu_compose});
  2389. $menu_compose->set_image(Gtk2::Image->new_from_pixbuf(load_pixbuf($compose_mail_data)));
  2390. $menu_compose->signal_connect('activate',sub {
  2391. run_command($gmail_command, get_login_href("https://mail.google.com/mail/??view=cm&tf=0#compose"));
  2392. });
  2393.  
  2394. my $menu_prefs = Gtk2::ImageMenuItem->new($trans{menu_prefs});
  2395. $menu_prefs->set_image(Gtk2::Image->new_from_stock('gtk-preferences','menu'));
  2396. $menu_prefs->signal_connect('activate',sub {
  2397. show_prefs();
  2398. });
  2399.  
  2400. my $menu_about = Gtk2::ImageMenuItem->new($trans{menu_about});
  2401. $menu_about->set_image(Gtk2::Image->new_from_stock('gtk-about','menu'));
  2402. $menu_about->signal_connect('activate',sub {
  2403. about();
  2404. });
  2405.  
  2406. my $menu_restart = Gtk2::ImageMenuItem->new($trans{menu_restart});
  2407. #$menu_about->set_image(Gtk2::Image->new_from_stock('gtk-about','menu'));
  2408. $menu_restart->signal_connect('activate',sub {
  2409. restart();
  2410. });
  2411.  
  2412. my $menu_quit = Gtk2::ImageMenuItem->new_from_stock('gtk-quit');
  2413. $menu_quit->signal_connect('activate',sub {
  2414. Gtk2->main_quit;
  2415. });
  2416.  
  2417. # Pack menu ...
  2418. $menu->append($menu_check);
  2419. $menu->append($menu_undo) if $cookies;
  2420. $menu->append($menu_compose);
  2421. $menu->append(Gtk2::SeparatorMenuItem->new);
  2422. $menu->append($menu_prefs);
  2423. $menu->append($menu_about);
  2424. $menu->append(Gtk2::SeparatorMenuItem->new);
  2425. $menu->append($menu_restart);
  2426. $menu->append($menu_quit);
  2427.  
  2428. $menu->show_all;
  2429. }
  2430.  
  2431. sub restart {
  2432. exec "$0 @ARGV";
  2433. }
  2434.  
  2435.  
  2436. #################
  2437. # GUI dialogues
  2438. #
  2439.  
  2440. sub show_prefs {
  2441. # The preferences dialogue ...
  2442. # Yes, I know, I know - it's getting seriously ugly, isn't it?? :)
  2443.  
  2444. my $dialog = Gtk2::Dialog->new ($trans{prefs}, undef,
  2445. 'destroy-with-parent',
  2446. 'gtk-ok' => 'ok',
  2447. 'gtk-cancel' => 'cancel',
  2448. );
  2449.  
  2450. my $hbox = Gtk2::HBox->new (0, 0);
  2451. $hbox->set_border_width (4);
  2452. $dialog->vbox->pack_start ($hbox, 0, 0, 0);
  2453.  
  2454. my $vbox = Gtk2::VBox->new (0, 4);
  2455. $hbox->pack_start ($vbox, 0, 0, 4);
  2456.  
  2457. my $frame_login = Gtk2::Frame->new ("$trans{prefs_login}");
  2458. $vbox->pack_start ($frame_login, 0, 0, 4);
  2459.  
  2460. my $table_login = Gtk2::Table->new (2, 3, 0);
  2461. $table_login->set_row_spacings (4);
  2462. $table_login->set_col_spacings (4);
  2463. $table_login->set_border_width (5);
  2464.  
  2465. $frame_login->add($table_login);
  2466.  
  2467. my $label_user = Gtk2::Label->new_with_mnemonic ($trans{prefs_login_user});
  2468. $label_user->set_alignment (0, 0.5);
  2469. $table_login->attach_defaults ($label_user, 0, 1, 0, 1);
  2470.  
  2471. my $entry_user = Gtk2::Entry->new;
  2472. $entry_user->set_width_chars(15);
  2473. $entry_user->append_text($user) if $user;
  2474. $table_login->attach_defaults ($entry_user, 1, 2, 0, 1);
  2475. $label_user->set_mnemonic_widget ($entry_user);
  2476.  
  2477. my $label_pwd = Gtk2::Label->new_with_mnemonic ($trans{prefs_login_pass});
  2478. $label_pwd->set_alignment (0, 0.5);
  2479. $table_login->attach_defaults ($label_pwd, 0, 1, 1, 2);
  2480.  
  2481. my $entry_pwd = Gtk2::Entry->new;
  2482. $entry_pwd->set_width_chars(15);
  2483. $entry_pwd->set_invisible_char('*');
  2484. $entry_pwd->set_visibility(0);
  2485. $entry_pwd->append_text($passwd_decrypt) if $passwd_decrypt;
  2486. $table_login->attach_defaults ($entry_pwd, 1, 2, 1, 2);
  2487. $label_pwd->set_mnemonic_widget ($entry_pwd);
  2488. $entry_pwd->signal_connect(activate=>sub {$dialog->response('ok')});
  2489.  
  2490. my $button_passwd = Gtk2::CheckButton->new_with_label($trans{prefs_login_save});
  2491. $table_login->attach_defaults($button_passwd, 0, 2, 2, 3 );
  2492. $button_passwd->set_active(1) if ($save_passwd);
  2493. $button_passwd->set_label("$trans{prefs_login_save} ($trans{prefs_login_save_plain})") if ($nocrypt && !$usekwallet);
  2494. $button_passwd->set_label("$trans{prefs_login_save} ($trans{prefs_login_save_kwallet})") if ($usekwallet);
  2495. $button_passwd->signal_connect(toggled=>sub {
  2496. $save_passwd = ($button_passwd->get_active) ? 1 : 0;
  2497. }
  2498. );
  2499.  
  2500. my $frame_lang = Gtk2::Frame->new ("$trans{prefs_lang}");
  2501. $vbox->pack_start ($frame_lang, 0, 0, 4);
  2502.  
  2503. my $vbox_lang = Gtk2::VBox->new (0, 0);
  2504. $frame_lang->add($vbox_lang);
  2505. $vbox_lang->set_border_width(6);
  2506.  
  2507. my $lang_option = Gtk2::OptionMenu->new;
  2508. my $lang_menu = Gtk2::Menu->new;
  2509.  
  2510. my $xmlin = XMLin($translations, ForceArray => 1);
  2511. my $count = 0;
  2512. my $index;
  2513.  
  2514. my @langs = keys(%{$xmlin->{Language}});
  2515. @langs = sort(@langs);
  2516. # foreach (keys(%{$xmlin->{Language}})) {
  2517. foreach (@langs) {
  2518. my $item = make_menu_item($_);
  2519. $lang_menu->append($item);
  2520. $index = $count if ($_ eq $language); # check which index number is the currently selected langauge
  2521. $count++;
  2522. }
  2523.  
  2524. $lang_option->set_menu($lang_menu);
  2525. $lang_option->set_history($index);
  2526. $vbox_lang->pack_start($lang_option,0,0,3);
  2527.  
  2528.  
  2529. my $frame_external = Gtk2::Frame->new ("$trans{prefs_external}");
  2530. $vbox->pack_start ($frame_external, 0, 0, 4);
  2531.  
  2532. my $vbox_external = Gtk2::VBox->new (0, 0);
  2533. $frame_external->add($vbox_external);
  2534. $vbox_external->set_border_width(6);
  2535.  
  2536. # my $hbox_browser = Gtk2::HBox->new (0,0);
  2537. # $vbox_external->pack_start($hbox_browser,1,1,2);
  2538.  
  2539. my $exe_label = Gtk2::Label->new_with_mnemonic($trans{prefs_external_browser});
  2540. $exe_label->set_line_wrap(1);
  2541. $exe_label->set_alignment (0, 0.5);
  2542. $vbox_external->pack_start($exe_label,0,0,2);
  2543.  
  2544. my $exe_label2 = Gtk2::Label->new();
  2545. $exe_label2->set_markup("<small>$trans{prefs_external_browser2}</small>");
  2546. $exe_label2->set_line_wrap(1);
  2547. $exe_label2->set_alignment (0, 0.5);
  2548. $vbox_external->pack_start($exe_label2,0,0,2);
  2549.  
  2550.  
  2551. my $hbox_exe = Gtk2::HBox->new (0,0);
  2552. $vbox_external->pack_start($hbox_exe,1,1,3);
  2553.  
  2554. my $label_exe_sp = Gtk2::Label->new(" ");
  2555. $label_exe_sp->set_alignment (0, 0.5);
  2556. $hbox_exe->pack_start($label_exe_sp, 0, 0, 0);
  2557.  
  2558. my $exe_entry = Gtk2::Entry->new();
  2559. $exe_entry->set_width_chars(14);
  2560. $exe_entry->set_text($gmail_command);
  2561. $hbox_exe->pack_end($exe_entry,1,1,0);
  2562.  
  2563. $vbox_external->pack_start (Gtk2::HSeparator->new, 0, 0, 4);
  2564.  
  2565. my $label_notify = Gtk2::Label->new_with_mnemonic ($trans{prefs_external_mail_command});
  2566. $label_notify->set_line_wrap(1);
  2567. $label_notify->set_alignment (0, 0.5);
  2568. $vbox_external->pack_start($label_notify,0,0,3);
  2569.  
  2570. my $hbox_notify = Gtk2::HBox->new (0,0);
  2571. $vbox_external->pack_start($hbox_notify,1,1,3);
  2572.  
  2573. my $label_notify_sp = Gtk2::Label->new(" ");
  2574. $label_notify_sp->set_alignment (0, 0.5);
  2575. $hbox_notify->pack_start($label_notify_sp, 0, 0, 0);
  2576.  
  2577. my $entry_notify = Gtk2::Entry->new;
  2578. $entry_notify->append_text($notify_command) if $notify_command;
  2579. $entry_notify->set_width_chars(15);
  2580. $hbox_notify->pack_start($entry_notify, 1, 1, 0);
  2581. $label_notify->set_mnemonic_widget ($entry_notify);
  2582.  
  2583. my $label_notify_none = Gtk2::Label->new_with_mnemonic ($trans{prefs_external_nomail_command});
  2584. $label_notify_none->set_alignment (0, 0.5);
  2585. $label_notify_none->set_line_wrap(1);
  2586. $vbox_external->pack_start($label_notify_none,0,0,3);
  2587.  
  2588. my $hbox_notify_none = Gtk2::HBox->new (0,0);
  2589. $vbox_external->pack_start($hbox_notify_none,1,1,3);
  2590.  
  2591. my $label_notify_none_sp = Gtk2::Label->new(" ");
  2592. $label_notify_none_sp->set_alignment (0, 0.5);
  2593. $hbox_notify_none->pack_start($label_notify_none_sp, 0, 0, 0);
  2594.  
  2595. my $entry_notify_none = Gtk2::Entry->new;
  2596. $entry_notify_none->set_width_chars(15);
  2597. $entry_notify_none->append_text($nomail_command) if $nomail_command;
  2598. $hbox_notify_none->pack_start($entry_notify_none, 1, 1, 0);
  2599. $label_notify_none->set_mnemonic_widget ($entry_notify_none);
  2600. # $vbox_external->pack_start($entry_notify_none,0,0,3);
  2601.  
  2602.  
  2603. my $vbox2 = Gtk2::VBox->new (0, 4);
  2604. $hbox->pack_start ($vbox2, 0, 0, 4);
  2605.  
  2606. my $frame_check = Gtk2::Frame->new ("$trans{prefs_check}");
  2607. $vbox2->pack_start ($frame_check, 0, 0, 4);
  2608.  
  2609. my $vbox_check = Gtk2::VBox->new (0, 0);
  2610. $frame_check->add($vbox_check);
  2611. $vbox_check->set_border_width(6);
  2612.  
  2613. my $hbox_delay = Gtk2::HBox->new (0,0);
  2614. $vbox_check->pack_start($hbox_delay,0,0,2);
  2615.  
  2616. my $label_delay = Gtk2::Label->new_with_mnemonic ($trans{prefs_check_delay});
  2617. $label_delay->set_alignment (0, 0.5);
  2618. $hbox_delay->pack_start($label_delay, 0, 0, 0);
  2619.  
  2620. my $entry_delay = Gtk2::Entry->new;
  2621. $entry_delay->set_width_chars(4);
  2622. $entry_delay->append_text($delay/1000) if $delay;
  2623. $hbox_delay->pack_start($entry_delay, 0, 0, 0);
  2624. $label_delay->set_mnemonic_widget ($entry_delay);
  2625.  
  2626. my $label_secs = Gtk2::Label->new_with_mnemonic ($trans{prefs_check_delay2});
  2627. $label_secs->set_alignment (0, 0.5);
  2628. $hbox_delay->pack_start($label_secs, 0, 0, 0);
  2629.  
  2630.  
  2631. ##########
  2632. # Labels
  2633. #
  2634.  
  2635. my $labels_label = Gtk2::Label->new_with_mnemonic($trans{prefs_check_labels});
  2636. $labels_label->set_line_wrap(1);
  2637. $labels_label->set_alignment (0, 0.5);
  2638. $vbox_check->pack_start($labels_label,0,0,4);
  2639.  
  2640. convert_labels_from_hash();
  2641.  
  2642. # most of this code is adapted from the treeview.pl example provided with Gtk2-perl ...
  2643. my $sw = Gtk2::ScrolledWindow->new;
  2644. $sw->set_shadow_type ('etched-in');
  2645. $sw->set_policy ('automatic', 'automatic');
  2646. $vbox_check->pack_start ($sw, 1, 1, 0);
  2647.  
  2648. # create model
  2649. my $model = Gtk2::ListStore->new (qw/Glib::String Glib::Int/);
  2650.  
  2651. # add labels to model
  2652. foreach my $a (@labels) {
  2653. my $iter = $model->append;
  2654. $model->set ($iter,
  2655. 0, $a->{label},
  2656. 1, $a->{delay});
  2657. }
  2658.  
  2659. # create tree view
  2660. my $treeview = Gtk2::TreeView->new_with_model ($model);
  2661. $treeview->set_rules_hint (1);
  2662. $treeview->get_selection->set_mode ('single');
  2663.  
  2664. # label columns
  2665. my $renderer = Gtk2::CellRendererText->new;
  2666. $renderer->signal_connect (edited => \&cell_edited, $model);
  2667. $renderer->set_data (column => 0);
  2668.  
  2669. $treeview->insert_column_with_attributes (-1, $trans{prefs_check_labels_label}, $renderer,
  2670. text => 0,
  2671. editable => 1);
  2672.  
  2673. # delay column
  2674. $renderer = Gtk2::CellRendererText->new;
  2675. $renderer->signal_connect (edited => \&cell_edited, $model);
  2676. $renderer->set_data (column => 1);
  2677.  
  2678. $treeview->insert_column_with_attributes (-1, $trans{prefs_check_labels_delay}, $renderer,
  2679. text => 1,
  2680. editable => 1);
  2681. $sw->add ($treeview);
  2682.  
  2683. # buttons for adding and removing labels ...
  2684. my $label_button_hbox = Gtk2::HBox->new (1, 4);
  2685. $vbox_check->pack_start ($label_button_hbox, 0, 0, 0);
  2686.  
  2687. my $button_addlabel = Gtk2::Button->new ($trans{prefs_check_labels_add});
  2688. $button_addlabel->signal_connect (clicked => sub {
  2689. push @labels, {
  2690. label => $trans{prefs_check_labels_new},
  2691. delay => 300,
  2692. };
  2693.  
  2694. my $iter = $model->append;
  2695. $model->set ($iter,
  2696. 0, $labels[-1]{label},
  2697. 1, $labels[-1]{delay},);
  2698. }, $model);
  2699. $label_button_hbox->pack_start ($button_addlabel, 1, 1, 0);
  2700.  
  2701. my $button_removelabel = Gtk2::Button->new ($trans{prefs_check_labels_remove});
  2702. $button_removelabel->signal_connect (clicked => sub {
  2703. my $selection = $treeview->get_selection;
  2704. my $iter = $selection->get_selected;
  2705. if ($iter) {
  2706. my $path = $model->get_path ($iter);
  2707. my $i = ($path->get_indices)[0];
  2708. $model->remove ($iter);
  2709. splice @labels, $i, 1;
  2710. }
  2711. }, $treeview);
  2712. $label_button_hbox->pack_start ($button_removelabel, 1, 1, 0);
  2713.  
  2714.  
  2715. $vbox_check->pack_start (Gtk2::HSeparator->new, 0, 0, 4);
  2716.  
  2717. my $hbox_atom = Gtk2::HBox->new (0,0);
  2718. $vbox_check->pack_start($hbox_atom,1,1,2);
  2719.  
  2720. my $atom_label = Gtk2::Label->new_with_mnemonic($trans{prefs_check_atom});
  2721. $hbox_atom->pack_start($atom_label,0,0,2);
  2722.  
  2723. my $atom_entry = Gtk2::Entry->new();
  2724. $atom_entry->set_width_chars(14);
  2725. $atom_entry->set_text($gmail_address);
  2726. $hbox_atom->pack_end($atom_entry,1,1,2);
  2727.  
  2728.  
  2729.  
  2730. # Thanks to Rune Maagensen for adding the 24 hour clock button ...
  2731. my $button_24h = Gtk2::CheckButton->new_with_label($trans{prefs_check_24_hour});
  2732. $vbox_check->pack_start($button_24h, 0, 0, 2);
  2733. $button_24h->set_active(1) if ($time_24);
  2734. $button_24h->signal_connect(toggled=>sub {
  2735. $time_24 = ($button_24h->get_active) ? 1 : 0;
  2736. }
  2737. );
  2738.  
  2739. my $button_archive = Gtk2::CheckButton->new_with_label($trans{prefs_check_archive});
  2740. $vbox_check->pack_start($button_archive, 0, 0, 2);
  2741. $button_archive->set_active(1) if ($archive_as_read);
  2742. $button_archive->signal_connect(toggled=>sub {
  2743. $archive_as_read = ($button_archive->get_active) ? 1 : 0;
  2744. }
  2745. );
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751. my $frame_tray = Gtk2::Frame->new ("$trans{prefs_tray}");
  2752. $vbox2->pack_start ($frame_tray, 0, 0, 4);
  2753.  
  2754. my $vbox_tray = Gtk2::VBox->new (0, 0);
  2755. $frame_tray->add($vbox_tray);
  2756. $vbox_tray->set_border_width(6);
  2757.  
  2758. # There's a lot of Gtk2-perl modules included in distros with only
  2759. # Gtk-2.4 bindings ... the following code needs 2.6 bindings to funtion
  2760. if (Gtk2->CHECK_VERSION (2, 6, 0)) {
  2761.  
  2762. my $hbox_icon_m = Gtk2::HBox->new (0,6);
  2763. $vbox_tray->pack_start($hbox_icon_m, 0, 0, 2);
  2764.  
  2765. my $button_m = Gtk2::CheckButton->new_with_label($trans{prefs_tray_mail_icon});
  2766. $hbox_icon_m->pack_start($button_m, 0, 0, 0 );
  2767. $button_m->set_active(1) if ($custom_mail_icon);
  2768. $button_m->signal_connect(toggled=>sub {
  2769. $custom_mail_icon = ($button_m->get_active) ? 1 : 0;
  2770. }
  2771. );
  2772.  
  2773. my $button_m_open = Gtk2::Button->new("");
  2774. $button_m_open->set_image(Gtk2::Image->new_from_pixbuf($custom_mail_pixbuf));
  2775. $button_m_open->signal_connect(clicked=>sub {
  2776. get_icon_file(\$mail_icon);
  2777. set_icons();
  2778. $button_m_open->set_image(Gtk2::Image->new_from_pixbuf($custom_mail_pixbuf));
  2779. }
  2780. );
  2781. $hbox_icon_m->pack_end($button_m_open, 0, 0, 0);
  2782.  
  2783. my $hbox_icon_nom = Gtk2::HBox->new (0,6);
  2784. $vbox_tray->pack_start($hbox_icon_nom, 1, 1, 2);
  2785.  
  2786. my $button_nom = Gtk2::CheckButton->new_with_label($trans{prefs_tray_no_mail_icon});
  2787. $hbox_icon_nom->pack_start($button_nom, 0, 0, 0 );
  2788. $button_nom->set_active(1) if ($custom_no_mail_icon);
  2789. $button_nom->signal_connect(toggled=>sub {
  2790. $custom_no_mail_icon = ($button_nom->get_active) ? 1 : 0;
  2791. }
  2792. );
  2793.  
  2794. my $button_nom_open = Gtk2::Button->new("");
  2795. $button_nom_open->set_image(Gtk2::Image->new_from_pixbuf($custom_no_mail_pixbuf));
  2796. $button_nom_open->signal_connect(clicked=>sub {
  2797. get_icon_file(\$no_mail_icon);
  2798. set_icons();
  2799. $button_nom_open->set_image(Gtk2::Image->new_from_pixbuf($custom_no_mail_pixbuf));
  2800. }
  2801. );
  2802. $hbox_icon_nom->pack_end($button_nom_open, 0, 0, 0);
  2803.  
  2804. my $hbox_icon_error = Gtk2::HBox->new (0,6);
  2805. $vbox_tray->pack_start($hbox_icon_error, 1, 1, 2);
  2806.  
  2807. my $button_error = Gtk2::CheckButton->new_with_label($trans{prefs_tray_error_icon});
  2808. $hbox_icon_error->pack_start($button_error, 0, 0, 0 );
  2809. $button_error->set_active(1) if ($custom_error_icon);
  2810. $button_error->signal_connect(toggled=>sub {
  2811. $custom_error_icon = ($button_error->get_active) ? 1 : 0;
  2812. }
  2813. );
  2814.  
  2815. my $button_error_open = Gtk2::Button->new("");
  2816. $button_error_open->set_image(Gtk2::Image->new_from_pixbuf($custom_error_pixbuf));
  2817. $button_error_open->signal_connect(clicked=>sub {
  2818. get_icon_file(\$error_icon);
  2819. set_icons();
  2820. $button_error_open->set_image(Gtk2::Image->new_from_pixbuf($custom_error_pixbuf));
  2821. }
  2822. );
  2823. $hbox_icon_error->pack_end($button_error_open, 0, 0, 0);
  2824.  
  2825. } else {
  2826. # Warning message if user doesn't have Gtk2.6 bindings ...
  2827. my $button_gtk_label = Gtk2::Label->new();
  2828. my $error_text = "<i>Button image functions are disabled</i>\n\nPlease upgrade to Gtk v2.6 or later and/or update Gtk2-perl bindings";
  2829. $button_gtk_label->set_line_wrap(1);
  2830. $button_gtk_label->set_markup($error_text);
  2831.  
  2832. $vbox_tray->pack_start($button_gtk_label, 1, 1, 2);
  2833. }
  2834.  
  2835. $vbox_tray->pack_start (Gtk2::HSeparator->new, 0, 0, 4);
  2836.  
  2837. my $hbox_pdelay = Gtk2::HBox->new (0,0);
  2838. $vbox_tray->pack_start($hbox_pdelay,0,0,3);
  2839.  
  2840. my $label_pdelay = Gtk2::Label->new_with_mnemonic ($trans{prefs_tray_pdelay});
  2841. $label_pdelay->set_alignment (0, 0.5);
  2842. $hbox_pdelay->pack_start($label_pdelay, 0, 0, 0);
  2843.  
  2844. my $entry_pdelay = Gtk2::Entry->new;
  2845. $entry_pdelay->set_width_chars(3);
  2846. $entry_pdelay->append_text($popup_delay/1000) if $popup_delay;
  2847. $hbox_pdelay->pack_start($entry_pdelay, 0, 0, 0);
  2848. $label_pdelay->set_mnemonic_widget ($entry_pdelay);
  2849.  
  2850. my $label_psecs = Gtk2::Label->new_with_mnemonic ($trans{prefs_tray_pdelay2});
  2851. $label_psecs->set_alignment (0, 0.5);
  2852. $hbox_pdelay->pack_start($label_psecs, 0, 0, 0);
  2853.  
  2854. $vbox_tray->pack_start (Gtk2::HSeparator->new, 0, 0, 3);
  2855.  
  2856. my $button_colour = Gtk2::Button->new($trans{prefs_tray_bg});
  2857. $button_colour->signal_connect(clicked=>\&set_bg_colour);
  2858. $vbox_tray->pack_start($button_colour,0,0,3);
  2859.  
  2860.  
  2861. $dialog->show_all;
  2862. my $response = $dialog->run;
  2863.  
  2864. if ($response eq 'ok') {
  2865. # remove password from the hash if user requests it ...
  2866. if ($save_passwd && !$usekwallet) {
  2867. $pref_variables{passwd}=\$passwd;
  2868. } else {
  2869. delete $pref_variables{passwd};
  2870. }
  2871.  
  2872. # grab all entry variables ...
  2873. $user = $entry_user->get_text;
  2874. $passwd_decrypt = $entry_pwd->get_text;
  2875. $passwd = encrypt_real($passwd_decrypt);
  2876. $delay = ($entry_delay->get_text)*1000;
  2877. $popup_delay = ($entry_pdelay->get_text)*1000;
  2878. $gmail_address = $atom_entry->get_text;
  2879. $gmail_command = $exe_entry->get_text;
  2880. $notify_command = $entry_notify->get_text;
  2881. $nomail_command = $entry_notify_none->get_text;
  2882.  
  2883. if ($usekwallet && $save_passwd) {
  2884. open KWALLET, "|kwallet -set checkgmail";
  2885. print KWALLET "$passwd\n";
  2886. close KWALLET;
  2887. }
  2888.  
  2889. reinit_checks();
  2890.  
  2891. write_prefs();
  2892. set_icons();
  2893. set_language();
  2894. pack_menu();
  2895. queue_check();
  2896. }
  2897.  
  2898. $dialog->destroy;
  2899. }
  2900.  
  2901.  
  2902. sub reinit_checks {
  2903. Glib::Source->remove($check{inbox}) if $check{inbox};
  2904. $check{inbox} = Glib::Timeout->add($delay, \&queue_check);
  2905.  
  2906. foreach my $label (keys(%label_delay)) {
  2907. Glib::Source->remove($check{$label}) if $check{$label};
  2908. $check{$label} = Glib::Timeout->add(($label_delay{$label}*1000), sub{queue_check($label)});
  2909. queue_check($label);
  2910. }
  2911. }
  2912.  
  2913.  
  2914. sub cell_edited {
  2915. my ($cell, $path_string, $new_text, $model) = @_;
  2916. my $path = Gtk2::TreePath->new_from_string ($path_string);
  2917.  
  2918. my $column = $cell->get_data ("column");
  2919.  
  2920. my $iter = $model->get_iter ($path);
  2921.  
  2922. if ($column == 0) {
  2923. my $i = ($path->get_indices)[0];
  2924. $labels[$i]{label} = $new_text;
  2925.  
  2926. $model->set ($iter, $column, $labels[$i]{label});
  2927.  
  2928. } elsif ($column == 1) {
  2929. my $i = ($path->get_indices)[0];
  2930. $labels[$i]{delay} = $new_text;
  2931.  
  2932. $model->set ($iter, $column, $labels[$i]{delay});
  2933. }
  2934. }
  2935.  
  2936.  
  2937. sub make_menu_item
  2938. {
  2939. my ($name) = @_;
  2940. my $item = Gtk2::MenuItem->new_with_label($name);
  2941. $item->signal_connect(activate => sub{$language=$name});
  2942. $item->show;
  2943.  
  2944. return $item;
  2945. }
  2946.  
  2947. sub login {
  2948. # a login dialogue - just ripped from the prefs above ...
  2949.  
  2950. # lock shared variables
  2951. lock($user);
  2952. lock($passwd);
  2953. lock($save_passwd);
  2954. lock($gmail_address);
  2955.  
  2956. my ($title) = @_;
  2957. my $dialog = Gtk2::Dialog->new ($title, undef,
  2958. 'destroy-with-parent',
  2959. 'gtk-ok' => 'ok',
  2960. 'gtk-cancel' => 'cancel',
  2961. );
  2962. # $dialog_login->set_default_response('ok');
  2963.  
  2964. my $hbox = Gtk2::HBox->new (0, 0);
  2965. $hbox->set_border_width (4);
  2966. $dialog->vbox->pack_start ($hbox, 0, 0, 0);
  2967.  
  2968. my $vbox = Gtk2::VBox->new (0, 4);
  2969. $hbox->pack_start ($vbox, 0, 0, 4);
  2970.  
  2971. my $table_login = Gtk2::Table->new (2, 3, 0);
  2972. $table_login->set_row_spacings (4);
  2973. $table_login->set_col_spacings (4);
  2974. $table_login->set_border_width (5);
  2975.  
  2976. $hbox->add($table_login);
  2977.  
  2978. my $label_user = Gtk2::Label->new_with_mnemonic ($trans{prefs_login_user});
  2979. $label_user->set_alignment (0, 0.5);
  2980. $table_login->attach_defaults ($label_user, 0, 1, 0, 1);
  2981.  
  2982. my $entry_user = Gtk2::Entry->new;
  2983. $entry_user->set_width_chars(12);
  2984. $entry_user->append_text($user) if $user;
  2985. $table_login->attach_defaults ($entry_user, 1, 2, 0, 1);
  2986. $label_user->set_mnemonic_widget ($entry_user);
  2987.  
  2988. my $label_pwd = Gtk2::Label->new_with_mnemonic ($trans{prefs_login_pass});
  2989. $label_pwd->set_alignment (0, 0.5);
  2990. $table_login->attach_defaults ($label_pwd, 0, 1, 1, 2);
  2991.  
  2992. my $entry_pwd = Gtk2::Entry->new;
  2993. $entry_pwd->set_width_chars(12);
  2994. $entry_pwd->set_invisible_char('*');
  2995. $entry_pwd->set_visibility(0);
  2996. $entry_pwd->append_text($passwd_decrypt) if $passwd_decrypt;
  2997. $table_login->attach_defaults ($entry_pwd, 1, 2, 1, 2);
  2998. $label_pwd->set_mnemonic_widget ($entry_pwd);
  2999. $entry_pwd->signal_connect(activate=>sub {$dialog->response('ok')});
  3000.  
  3001. my $button_passwd = Gtk2::CheckButton->new_with_label($trans{prefs_login_save});
  3002. $table_login->attach_defaults($button_passwd, 0, 2, 2, 3 );
  3003. $button_passwd->set_active(1) if ($save_passwd);
  3004. $button_passwd->set_label("$trans{prefs_login_save} ($trans{prefs_login_save_plain})") if ($nocrypt && !$usekwallet);
  3005. $button_passwd->set_label("$trans{prefs_login_save} ($trans{prefs_login_save_kwallet})") if ($usekwallet);
  3006. $button_passwd->signal_connect(toggled=>sub {
  3007. $save_passwd = ($button_passwd->get_active) ? 1 : 0;
  3008. }
  3009. );
  3010.  
  3011. $dialog->show_all;
  3012. my $response = $dialog->run;
  3013. if ($response eq 'ok') {
  3014. if (($save_passwd)) {
  3015. $pref_variables{passwd}=\$passwd;
  3016. } else {
  3017. delete $pref_variables{passwd};
  3018. }
  3019. $user = $entry_user->get_text;
  3020. $passwd_decrypt = $entry_pwd->get_text;
  3021. $passwd = encrypt_real($passwd_decrypt);
  3022. write_prefs();
  3023.  
  3024. if ($usekwallet && $save_passwd) {
  3025. open KWALLET, "|kwallet -set checkgmail";
  3026. print KWALLET "$passwd\n";
  3027. close KWALLET;
  3028. }
  3029.  
  3030. } else {
  3031. $dialog->destroy;
  3032. exit 0;
  3033. }
  3034. $dialog->destroy;
  3035. }
  3036.  
  3037. sub about {
  3038. my $text = <<EOF;
  3039. <b>CheckGmail v$version</b>
  3040. Copyright &#169; 2005-7, Owen Marshall
  3041.  
  3042. <small>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.</small>
  3043.  
  3044. <small>Special thanks to Sandro Tosi, Rune Maagensen, Jean-Baptiste Denis, Jochen Hoenicke, Melita Ivkovic, Poika Pilvimaa, Alvaro Arenas, Marek Drwota, Dennis van der Staal, Jordi Sanfeliu, Fernando Pereira, Matic Ahacic, Johan Gustafsson, Satoshi Tanabe, Marius Mihai, Marek Malysz, Ruszkai &#193;kos, Nageswaran Rajendran, &#23385;&#32487;&#19996;, Martin Kody&#353;, Rune Gangst&#248;, Christian M&#252;ller, Luciano Ziegler, Igor Donev and anonymous contributors for translations ...</small>
  3045.  
  3046. http://checkgmail.sf.net
  3047. EOF
  3048. chomp($text);
  3049. my $dialog = Gtk2::MessageDialog->new_with_markup(undef,
  3050. 'destroy-with-parent',
  3051. 'info',
  3052. 'ok',
  3053. $text,
  3054. );
  3055. $dialog->run;
  3056. $dialog->destroy;
  3057. }
  3058.  
  3059. sub set_bg_colour {
  3060. my $colour;
  3061. my $dialog = Gtk2::ColorSelectionDialog->new ("Set tray background");
  3062. my $colorsel = $dialog->colorsel;
  3063. if ($background) {
  3064. my ($red, $green, $blue) = convert_hex_to_colour($background);
  3065. $colour = Gtk2::Gdk::Color->new($red, $green, $blue);
  3066. $colorsel->set_current_color ($colour);
  3067. }
  3068.  
  3069. $colorsel->set_has_palette(1);
  3070.  
  3071. my $response = $dialog->run;
  3072. if ($response eq 'ok') {
  3073. $colour = $colorsel->get_current_color;
  3074. $eventbox->modify_bg('normal', $colour);
  3075. my $colour_hex =
  3076. sprintf("%.2X", ($colour->red /256))
  3077. . sprintf("%.2X", ($colour->green/256))
  3078. . sprintf("%.2X", ($colour->blue /256));
  3079. $background = $colour_hex;
  3080. }
  3081.  
  3082. $dialog->destroy;
  3083.  
  3084. }
  3085.  
  3086. sub get_icon_file {
  3087. my ($pointer) = @_;
  3088.  
  3089. my $icon_browser = Gtk2::FileChooserDialog->new(
  3090. "Select icon file ...",
  3091. undef,
  3092. 'open',
  3093. 'gtk-cancel' => 'cancel',
  3094. 'gtk-ok' => 'ok',
  3095. );
  3096.  
  3097. my $filter = Gtk2::FileFilter->new;
  3098. $filter->add_pixbuf_formats;
  3099. $filter->set_name("Image files");
  3100.  
  3101. $icon_browser->add_filter($filter);
  3102.  
  3103.  
  3104. my $response = $icon_browser->run;
  3105.  
  3106. my $icon;
  3107. if ($response eq 'ok') {
  3108. $icon = $icon_browser->get_filename;
  3109. $$pointer = $icon;
  3110. }
  3111.  
  3112. $icon_browser->destroy;
  3113. }
  3114.  
  3115. sub set_icons {
  3116.  
  3117. # Load custom or default icons for mail status notification ...
  3118.  
  3119. # load defaults
  3120. $mail_pixbuf = load_pixbuf($mail_data);
  3121. $no_mail_pixbuf = load_pixbuf($no_mail_data);
  3122. $error_pixbuf = load_pixbuf($error_data);
  3123. $star_pixbuf = load_pixbuf($star_on_data);
  3124. $nostar_pixbuf = load_pixbuf($star_off_data);
  3125.  
  3126. # load custom icons if defined
  3127. $custom_mail_pixbuf = Gtk2::Gdk::Pixbuf->new_from_file($mail_icon) if $mail_icon;
  3128. $custom_no_mail_pixbuf = Gtk2::Gdk::Pixbuf->new_from_file($no_mail_icon) if $no_mail_icon;
  3129. $custom_error_pixbuf = Gtk2::Gdk::Pixbuf->new_from_file($error_icon) if $error_icon;
  3130.  
  3131. # set custom pixbufs to defaults if undefined
  3132. $custom_mail_pixbuf ||= $mail_pixbuf;
  3133. $custom_no_mail_pixbuf ||= $no_mail_pixbuf;
  3134. $custom_error_pixbuf ||= $error_pixbuf;
  3135.  
  3136. # set icon pixbufs to custom pixbufs if user requested
  3137. $mail_pixbuf = $custom_mail_pixbuf if $custom_mail_icon;
  3138. $no_mail_pixbuf = $custom_no_mail_pixbuf if $custom_no_mail_icon;
  3139. $error_pixbuf = $custom_error_pixbuf if $custom_error_icon;
  3140.  
  3141. }
  3142.  
  3143. sub set_icon {
  3144. my ($file, $size) = @_;
  3145. my $pixbuf = Gtk2::Gdk::Pixbuf->new_from_file($file);
  3146. my $scaled = $pixbuf->scale_simple($size, $size, "hyper");
  3147. return $scaled;
  3148. }
  3149.  
  3150.  
  3151.  
  3152. #######################
  3153. # Encryption routines
  3154. #
  3155.  
  3156. sub encrypt_real {
  3157. $_ = shift;
  3158. if ($nocrypt) {
  3159. return $_;
  3160. } else {
  3161. return encrypt($_);
  3162. }
  3163. }
  3164.  
  3165. sub decrypt_real {
  3166. $_ = shift;
  3167. if ($nocrypt) {
  3168. return $_;
  3169. } else {
  3170. return decrypt($_);
  3171. }
  3172. }
  3173.  
  3174.  
  3175. ########
  3176. # Misc
  3177. #
  3178.  
  3179. sub convert_hex_to_colour {
  3180. my ($colour) = @_;
  3181. my ($red, $green, $blue) = $colour =~ /(..)(..)(..)/;
  3182.  
  3183. $red = hex($red)*256;
  3184. $green = hex($green)*256;
  3185. $blue = hex($blue)*256;
  3186.  
  3187. return ($red, $green, $blue);
  3188. }
  3189.  
  3190.  
  3191. #############
  3192. # Icon data
  3193. #
  3194.  
  3195. sub load_pixbuf {
  3196. my $data = shift;
  3197.  
  3198. my $loader = Gtk2::Gdk::PixbufLoader->new;
  3199. $loader->write ($data);
  3200. $loader->close;
  3201.  
  3202. return $loader->get_pixbuf;
  3203. }
  3204.  
  3205. sub load_icon_data {
  3206.  
  3207. $error_data = unpack("u",
  3208. 'MB5!.1PT*&@H````-24A$4@```!`````0"`8````?\_]A````!F)+1T0`_P#_
  3209. M`/^@O:>3````"7!(67,```QU```,=0$M>)1U````!W1)344\'U047"@0$Y9]#
  3210. MH0```85)1$%4.,NUTL%*XU`4QO&_-J3,3$-WTC()(Y\'6G;L+@;CH-AN?0\'P%
  3211. MWZ#*>0.?YFZSF(!KEPF#E@2]N"L%P9B*"TTF&<O,@\'AV(?E]^6Y.X(.SE0;!
  3212. M67TQBB+ZT^G?GJ\>T[0P6L=`,;V\7%OMNT9K)DI!%&W$:%TL6AA@N_WVH>^3
  3213. MB8#6&W$F$@]]O\$`30-G/@<1`#(1)E`W:?#HZ,CP].2E03`#7*#7.4(KI,I$
  3214. M\'B;0!^XRD?C[^;GY^OP\SD0:W&G0A"A5`05PE8FXP%4;#WW?_;*_WS-OQ^P&
  3215. MY\'E5+I>%HU0,&.#7X.3D\4_LS.?4`=L=G"2%\'8;QZO[>&*W[.\?\'&W%[Z@8-
  3216. M9K4R+!;CH>\?9"(%<-!@I=[MU@(JX!4/!J9,DK&CU`P8`7O`MQJ7RR5VGH/G
  3217. M=0)N@)_KVUNSOKX>VV$XP_-<)XIZB/2;[0!VGE,F"788_OZ5`=(@L\'Z<GKHU
  3218. MKE>T<=Y"%A<7KQ\Q#0(+^#\,X\'F=!A:P"QR62?)O_!GS`K6COO-L,Q_/````
  3219. )`$E%3D2N0F""');
  3220.  
  3221. $no_mail_data = unpack("u",
  3222. 'MB5!.1PT*&@H````-24A$4@```!`````0"`0```"U^C?J`````F)+1T0`_X>/
  3223. MS+\````)<$A9<P``#\'4```QU`2UXE\'4````\'=$E-10?5!!D#+C1^0]HI````
  3224. MB$E$050HS\7/H1&#0!!&X2^9E\'"2X!DD+K7@HE)%*L%1"PY)!;%("HBXRW\'$
  3225. M1N1WN^_M[BR_YO1XPLWU"[Q,X!++R5U7X#EASG&^,I@+/*C<=J%7%TK$M;X\
  3226. MT1LQP`%G@29!*G6J"F&UY6:ML5F%75@M6D%G1)\[68A8@A"TEOV+#RX3CAO^
  3227. 6FC<\3AZN>\`BO0````!)14Y$KD)@@@``');
  3228.  
  3229. $mail_data = unpack("u",
  3230. 'MB5!.1PT*&@H````-24A$4@```!`````0"`8````?\_]A````"7!(67,```QU
  3231. M```,=0$M>)1U````!W1)344\'U008#C<OWT).ZP```-))1$%4.,OED3$.@S`,
  3232. M15^KBHHA8NV2!:EP`B0D3I!+9<BE<@(N`5.5I2MC6=H%(A?2KAWZISCV^[83
  3233. M^+4.0]L^U^!B#.>J^@H\AH&[]S$^R>3=>ZY-`\:D:>^Y"1C@*+L79<GH\'&R*
  3234. M5GATCJ(LN8@&T4!92U[7:1,!YW6-LC:]@K(6G`-@=([K<O\)WAD`J*:)YW$Q
  3235. MB[#(I0U"8)ZF7>$*S]-$%@)HG3`(@;GOR;H.M$89$]=9Q\YDS=9`PF]O(J4U
  3236. E6=<Q]_W^%[;P1RTFR0G^5"_P^T_]<U3R]`````!)14Y$KD)@@@``');
  3237.  
  3238. $compose_mail_data = unpack("u",
  3239. 'MB5!.1PT*&@H````-24A$4@```!`````0"`8````?\_]A````!F)+1T0`_P#_
  3240. M`/^@O:>3````"7!(67,```L2```+$@\'2W7[\````!W1)344\'U0L#%PT06C)B
  3241. M\'P```?A)1$%4.,NMDTUH$U$4A;]))LEDR*1-4],L(H7J2A1+,6E$$"VF8HJ"
  3242. M%05_$%V)2,&-".X%<6,1"M*-NJG[4D\'MRK;XLTAB4(QH*5ALJN`B8\J;3)+)
  3243. MN!"C0Q)0].[>>><<WKWW//C\'DOZ4:)?=4?#O0Y+[L6T!9D;2*L_D=N0;-Z\/
  3244. M`KF?9[>KSOQBGKW);-;G"T2A7`4Q;Y?Y)G<27[UR[1=HY:!61!CQ(5M."XF/
  3245. M56IW4U#-R)W$[PMY2KI.I6*"]9*!_@*QS7$L:9?JLD&2-"_HMMQ)G,OGB42B
  3246. M=\'>\'\\\'H&<<DKF,8+?\'X08E5UL_\'.YZD___T%N3.GSO+D\1S+RQ\8\'1TCU-.#
  3247. MWZ^BJG&H!RE^NH>[](JN4(S91R-#Q\?NOW&T$`[W(H3)N?,74%75,9NOI6UL
  3248. M5"<PQ3I=?0E65J>1-,MV&"B*PO!P@H=SL^P?.0"`$`+#,#`,@\+;UQP^<A3%
  3249. MKS4U+5O8%(F0W)WDP<P,6[<,`.#UR:RM?6\'\V#BRRQF=MCD(:D\'"H0"I@ZDF
  3250. M-G7[%EY9PC1-%`)-W-4:.9N%A:><.\'FZ"36L.A<O3;"XM(1A"`>]Q2";R7`H
  3251. MG:9>-;$;#:Q:%0F)AM5@YX[M%-<_=VY!UW42R3T_+F2?@^@!%%6CMR^&KNMM
  3252. B#2;O3$]=_HN/.,G_J.\25[KK%,1Y@@````!)14Y$KD)@@@``');
  3253.  
  3254. $star_on_data = unpack("u",
  3255. 'MB5!.1PT*&@H````-24A$4@```!`````0"`8````?\_]A````!\'-"250("`@(
  3256. M?`ADB`````EP2%ES```-UP``#=<!0BB;>````!ET15AT4V]F=\'=A<F4`=W=W
  3257. M+FEN:W-C87!E+F]R9YON/!H```)\241!5#B-G5-=2U11%%W[W\'-GQID[V1A^
  3258. MI2/-1&9?.D%*,>)3/?10T4-%)4R1^!1!1(\1%/4#`B\'ZH!DMD`KRH;>@\'IIK
  3259. M0F$@E*$&HYD.(I0?,Z-S[SV[A]`<\'%_:<&"S66NOM0[G$#.C6)D)JA="O`-1
  3260. M3CG.L6B,AXOA1%$V`")Q,]AXN7);Y\'I("\'%G(QR8>=U)QE\'1W^.V\'&N6E3W\'
  3261. M\'YX9=C*.ZF+8C1QT5NUH9U(_`?LKMNZZQ``ZBSI-QN$"<`5`2`BMAHBJ&=38
  3262. M<BKE$3P,J%]P1#,^OMRY3\'"&F\'E:*6<2P#B`>V1VBQ?EX=,G:O=>TZ6[$IHT
  3263. M0)H/1*Y_,FH!2EFP<Q/(YU+(9Z=X:OBA-3\[]$:P4JD2?UB4E!Z`[@E"R$`A
  3264. M&0"$%\33D\'(*/K\;@=J3Y/+5"&9.43(./PG15Q$^W[;]8)<D`0`Z``6H!;"3
  3265. M!NP)L#T&0$#I;1A)7K5^I]\/L%+\'B9EA)D@2T7VW$;JP[W"W)C$`ML8!7@(X
  3266. M\_>R9!UL[2B^O.UP<O-CO<Q\,1IC2P)`-,8V@`XS09[TV/,SM0U\')%2V,(:K
  3267. M$3.CK^WLW&A?-,;M*V-9$%73*XPM$0EA@/0&0!@`"%`+@/##*&N20G-5%7!6
  3268. M&C-!Q$R\'O(\'](*T6Y&E%+K<)V44/R-,*TH(HV=P$5JK93-"J\%H\'>Z2[S\'!Y
  3269. MZV\';B_@Q>,M*CSY>)I!=\'C[KJXO<UG5O$+JWRI7/3$8`?"IP`*!461F5\'GG`
  3270. M@Z\:G/3(HUYVED+*R85FOO<\^=RW6TU_ZV)E916`TM67N/8W]O>XGQ*)@\'*6
  3271. M[D9C;*[-:B:H16B>&\PJPRI_+AICM6[!_]0?8_PDB6*NF@(`````245.1*Y"
  3272. "8((`');
  3273.  
  3274. $star_off_data = unpack("u",
  3275. 'MB5!.1PT*&@H````-24A$4@```!`````0"`8````?\_]A````!\'-"250("`@(
  3276. M?`ADB````?9)1$%4.(VMD\%J$V$4A;_)C&,F36B2,;1-:TA;720N3+.H@R!(
  3277. M$0*&K+((:.)3]`&ZRK)TF3?(&R3071]`*18B5!$%H8(FFC).F.DTU\4,4FLB
  3278. M")[5SW_//=S_W/.KS(<.;`(F8`.7LTB1OPB8@\\\'@SG`XO`_<FD>:)Z#&X_%D
  3279. MH5!82Z?3J5PNEP2T?Q%(=CJ=-/`)^\'!P<)`"DK.("J"&Q1OA60-BCN,4#<-X
  3280. M"7B3R>11+!9[#3@$7OC`!?!=`Y;W]_=7&XW&RG0ZO5A<7-0U33,,P_@!?%04
  3281. M143$=EUWRW5=9SP>>Y%(1.UVNY]W=W?/-.`RG\\\\;V6QV"7@#O`<FP#=%422<
  3282. MM*?K>E+7=2.12*P#]\KELA,^D0BPMK>WM^W[?DM$[L[Q!1\'9%)$7[7;[`7#[
  3283. MNH=+]7I]RW7=9R*R/J,YY_O^\V:S60:60__^0+[?[S\6D8<S!+:/CHYV@(VK
  3284. M]]?7Z)=*I07@2]BT(B*K8>UKL5A<(-C`+UP/1RR3R9C`1$2>>IZ7\#Q/1,0!
  3285. M7J52*1,PYDUPLU:KQ555C0([AX>\'MFF:)Z9IGO1ZO7/@B:JJ>JO52@#160):
  3286. M-!J=CD:CD659QY5*Y9UMVZ>>YYU6J]6WEF4=V[9]KBC*)4\'H@-^=5`C<58$1
  3287. C0>JNPB#XF5/@#!#^!WX"JHNT6FM(-L<`````245.1*Y"8((`');
  3288.  
  3289. }
  3290.  
  3291.  
  3292. #############
  3293. # Languages
  3294. #
  3295.  
  3296. sub URI_escape {
  3297. # Turn text into HTML escape codes
  3298. ($_) = @_;
  3299. s/([^a-zA-Z0-9])/$escapes{$1}/g;
  3300. return $_;
  3301. }
  3302.  
  3303. sub URI_unescape {
  3304. # Turn HTML escape code into text
  3305. ($_) = @_;
  3306. s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
  3307. return $_;
  3308. }
  3309.  
  3310. sub read_translations {
  3311. my $default_translations = <<EOF;
  3312. <opt Version="1.12">
  3313. <Language name="Català"
  3314. login_err="Error: Nom d'usuari o contrassenya incorrecte"
  3315. login_title="Entrant a Gmail ..."
  3316. mail_archive="Arxiva"
  3317. mail_archiving="Arxivant ..."
  3318. mail_delete="Suprimeix"
  3319. mail_deleting="Suprimint ..."
  3320. mail_mark="Marca'l com a llegit"
  3321. mail_mark_all="Marca'ls tots com a llegits"
  3322. mail_marking="Marcant com a llegit ..."
  3323. mail_marking_all="Marcant tots com a llegits ..."
  3324. mail_open="Obre"
  3325. mail_report_spam="Marca'l com a correu brossa"
  3326. mail_reporting_spam="Marcant com a correu brossa ..."
  3327. menu_about="_Quant a"
  3328. menu_check="_Comprova correu electrònic"
  3329. menu_compose="Redacta un missatge"
  3330. menu_prefs="_Preferències"
  3331. menu_undo="_Desfés la darrera acció"
  3332. notify_and="i"
  3333. notify_check="S'està comprovant Gmail ..."
  3334. notify_from="De:"
  3335. notify_login="S'està entrant a Gmail ..."
  3336. notify_multiple1="Hi ha"
  3337. notify_multiple2="nous missatges ..."
  3338. notify_new_mail="Nou missatge de"
  3339. notify_no_mail="No hi ha missatges nous"
  3340. notify_no_subject="(sense assumpte)"
  3341. notify_no_text="(sense text)"
  3342. notify_single1="Hi ha"
  3343. notify_single2="un nou missatge ..."
  3344. notify_undoing="Desfent la darrera acció ..."
  3345. prefs="Preferències de CheckGmail"
  3346. prefs_check="Comprovació de missatges"
  3347. prefs_check_24_hour="rellotje de 24 hores"
  3348. prefs_check_archive="Arxiu també marca'l com a llegit"
  3349. prefs_check_atom="Adreça de l'alimentador"
  3350. prefs_check_delay="Verifica nous missatges a la safata d'entrada cada"
  3351. prefs_check_delay2="segs"
  3352. prefs_check_labels="També verifica les següents etiquetes:"
  3353. prefs_check_labels_add="Afegeix una etiqueta"
  3354. prefs_check_labels_delay="Verifica cada (segs)"
  3355. prefs_check_labels_label="Etiqueta"
  3356. prefs_check_labels_new="[nova etiqueta]"
  3357. prefs_check_labels_remove="Suprimeix etiqueta"
  3358. prefs_external="Ordres Externes"
  3359. prefs_external_browser="Ordre a executar quan feu clic a la icona de la safata"
  3360. prefs_external_browser2="(feu servir %u per representar l'adreça web de Gmail)"
  3361. prefs_external_mail_command="Ordre a executar a cada nou missatge:"
  3362. prefs_external_nomail_command="Ordre a executar quan no hi hagi missatges:"
  3363. prefs_lang="Idioma"
  3364. prefs_login="Detalls d'accés"
  3365. prefs_login_pass="_Contrasenya"
  3366. prefs_login_save="Desa contrasenya"
  3367. prefs_login_save_kwallet="a la carpeta de KDE"
  3368. prefs_login_save_plain="com a text"
  3369. prefs_login_user="_Nom d'usuari"
  3370. prefs_tray="Safata del sistema"
  3371. prefs_tray_bg="Configura el color de fons de la safata ..."
  3372. prefs_tray_error_icon="Personalitza la icona d'error"
  3373. prefs_tray_mail_icon="Personalitza la icona de quan hi ha missatges"
  3374. prefs_tray_no_mail_icon="Personalitza la icona de quan no hi ha missatges"
  3375. prefs_tray_pdelay="Mostra finestra emergent de nous missatges durant"
  3376. prefs_tray_pdelay2="segs" />
  3377. <Language name="Dansk"
  3378. login_err="Fejl: forkert brugernavn eller adgangskode"
  3379. login_title="Gmail login"
  3380. mail_archive="Arkivér"
  3381. mail_archiving="Arkiverer ..."
  3382. mail_delete="Slet"
  3383. mail_deleting="Sletter ..."
  3384. mail_mark="Marker læst"
  3385. mail_mark_all="Marker alle som læst"
  3386. mail_marking="Markerer læst ..."
  3387. mail_marking_all="Markerer alle læst ..."
  3388. mail_open="Åbn"
  3389. mail_report_spam="Rapporter spam"
  3390. mail_reporting_spam="Rapporterer spam ..."
  3391. menu_about="_Om Checkgmail"
  3392. menu_check="_Se efter ny post på Gmail"
  3393. menu_compose="Skriv email"
  3394. menu_prefs="_Indstilinger"
  3395. menu_undo="_Fortyd sidste handling ..."
  3396. notify_and="og"
  3397. notify_check="Ser efter ny post på Gmail ..."
  3398. notify_from="Fra:"
  3399. notify_login="Logger ind på Gmail ..."
  3400. notify_multiple1="Der er "
  3401. notify_multiple2=" nye breve ..."
  3402. notify_new_mail="Nyt brev fra "
  3403. notify_no_mail="Ingen nye breve"
  3404. notify_no_subject="(intet emne)"
  3405. notify_no_text="(ingen tekst)"
  3406. notify_single1="Der er "
  3407. notify_single2=" nyt brev ..."
  3408. notify_undoing="Fortryder sidste handling ..."
  3409. prefs="CheckGmail indstillinger"
  3410. prefs_check="Se efter ny post"
  3411. prefs_check_24_hour="24 timers ur"
  3412. prefs_check_archive="Arkivér markerer også læst"
  3413. prefs_check_atom="Feed adresse"
  3414. prefs_check_delay="Se efter ny post i Inbox hver "
  3415. prefs_check_delay2=" sekunder"
  3416. prefs_check_labels="Se også efter følgende mærker:"
  3417. prefs_check_labels_add="Tilføj mærke"
  3418. prefs_check_labels_delay="Se hvert (sekunder)"
  3419. prefs_check_labels_label="Mærke"
  3420. prefs_check_labels_new="[nyt mærke]"
  3421. prefs_check_labels_remove="Fjern Mærke"
  3422. prefs_external="Eksterne programmer"
  3423. prefs_external_browser="Browser"
  3424. prefs_external_browser2="(%u repræsenterer Gmail adressen)"
  3425. prefs_external_mail_command="Kommando ved nyt brev:"
  3426. prefs_external_nomail_command="Kommando ved ingen nye breve:"
  3427. prefs_lang="Sprog"
  3428. prefs_login="Logindetaljer"
  3429. prefs_login_pass="_Adgangskode"
  3430. prefs_login_save="Gem adgagnskode"
  3431. prefs_login_save_kwallet="i KDE tegnebog"
  3432. prefs_login_save_plain="som tekst"
  3433. prefs_login_user="_Brugernavn"
  3434. prefs_tray="Statusfelt"
  3435. prefs_tray_bg="Sæt statusfelt baggrund ..."
  3436. prefs_tray_error_icon="Brug selvvalgt 'fejl' ikon"
  3437. prefs_tray_mail_icon="Brug selvvalgt 'ny post' ikon"
  3438. prefs_tray_no_mail_icon="Brug selvvalgt 'ingen post' ikon"
  3439. prefs_tray_pdelay="Vis nyt brev popup i "
  3440. prefs_tray_pdelay2=" sekunder" />
  3441. <Language name="Deutsch"
  3442. login_err="Fehler: Falsches Login oder Passwort"
  3443. login_title="Google-Mail Login ..."
  3444. mail_archive="Archivieren"
  3445. mail_archiving="Archiviere ..."
  3446. mail_delete="Löschen"
  3447. mail_deleting="Lösche ..."
  3448. mail_mark="Als gelesen markieren"
  3449. mail_mark_all="Alle als gelesen markieren"
  3450. mail_marking="Markiere als gelesen ..."
  3451. mail_marking_all="Markiere alle als gelesen ..."
  3452. mail_open="Öffnen"
  3453. mail_report_spam="Spam melden"
  3454. mail_reporting_spam="Melde Spam ..."
  3455. menu_about="Ü_ber"
  3456. menu_check="_Mail abfragen"
  3457. menu_compose="Neue Nachricht"
  3458. menu_prefs="_Einstellungen"
  3459. menu_undo="_Rückgängig machen"
  3460. notify_and="und"
  3461. notify_check="Frage Google-Mail ab ..."
  3462. notify_from="Von:"
  3463. notify_login="Anmelden bei Google-Mail ..."
  3464. notify_multiple1="Sie haben "
  3465. notify_multiple2=" neue Nachrichten ..."
  3466. notify_new_mail="Neue Nachricht von "
  3467. notify_no_mail="Keine neuen Nachrichten"
  3468. notify_no_subject="(kein Betreff)"
  3469. notify_no_text="(kein Text)"
  3470. notify_single1="Sie haben "
  3471. notify_single2=" neue Nachricht ..."
  3472. notify_undoing="Mache letzte Aktion rückgängig ..."
  3473. prefs="CheckGmail Einstellungen"
  3474. prefs_check="Nachrichtenabfrage"
  3475. prefs_check_24_hour="24 Stunden-Uhr"
  3476. prefs_check_archive="Beim Archivieren als gelesen markieren"
  3477. prefs_check_atom="Feed Adresse:"
  3478. prefs_check_delay="Frage Nachrichten alle "
  3479. prefs_check_delay2=" Sekunden ab"
  3480. prefs_check_labels="Auch die folgenden Labels abfragen:"
  3481. prefs_check_labels_add="Label hinzufügen"
  3482. prefs_check_labels_delay="Frage ab alle (Sekunden)"
  3483. prefs_check_labels_label="Label"
  3484. prefs_check_labels_new="[neues Label]"
  3485. prefs_check_labels_remove="Label entfernen"
  3486. prefs_external="Externe Programme"
  3487. prefs_external_browser="Web-Browser"
  3488. prefs_external_browser2="(Für %u wird die Webadresse (URL) eingesetzt)"
  3489. prefs_external_mail_command="Ausführen wenn neue Nachricht:"
  3490. prefs_external_nomail_command="Ausführen wenn keine neuen Nachrichten:"
  3491. prefs_lang="Sprache"
  3492. prefs_login="Login-Einstellungen"
  3493. prefs_login_pass="_Passwort"
  3494. prefs_login_save="Passwort speichern"
  3495. prefs_login_save_kwallet="in der KDE-Wallet"
  3496. prefs_login_save_plain="unverschlüsselt"
  3497. prefs_login_user="_Login"
  3498. prefs_tray="Systemabschnitt der Kontrollleiste"
  3499. prefs_tray_bg="Hintergrundfarbe ..."
  3500. prefs_tray_error_icon="Benutze eigenes Icon für Fehler"
  3501. prefs_tray_mail_icon="Benutze eigenes Icon für Mail"
  3502. prefs_tray_no_mail_icon="Benutze eigenes Icon für keine Mail"
  3503. prefs_tray_pdelay="Zeige Popupfenster für neue Mail für "
  3504. prefs_tray_pdelay2=" Sekunden" />
  3505. <Language name="English"
  3506. login_err="Error: Incorrect username or password"
  3507. login_title="Login to Gmail ..."
  3508. mail_archive="Archive"
  3509. mail_archiving="Archiving ..."
  3510. mail_delete="Delete"
  3511. mail_deleting="Deleting ..."
  3512. mail_mark="Mark as read"
  3513. mail_mark_all="Mark all as read"
  3514. mail_marking="Marking read ..."
  3515. mail_marking_all="Marking all read ..."
  3516. mail_open="Open"
  3517. mail_report_spam="Report spam"
  3518. mail_reporting_spam="Reporting spam ..."
  3519. menu_about="_About"
  3520. menu_check="_Check mail"
  3521. menu_compose="Compose mail"
  3522. menu_prefs="_Preferences"
  3523. menu_undo="_Undo last action"
  3524. menu_restart="Restart ..."
  3525. notify_and="and"
  3526. notify_check="Checking Gmail ..."
  3527. notify_from="From:"
  3528. notify_login="Logging in to Gmail ..."
  3529. notify_multiple1="There are "
  3530. notify_multiple2=" new messages ..."
  3531. notify_new_mail="New mail from "
  3532. notify_no_mail="No new mail"
  3533. notify_no_subject="(no subject)"
  3534. notify_no_text="(no text)"
  3535. notify_single1="There is "
  3536. notify_single2=" new message ..."
  3537. notify_undoing="Undoing last action ..."
  3538. prefs="CheckGmail preferences"
  3539. prefs_check="Mail checking"
  3540. prefs_check_24_hour="24 hour clock"
  3541. prefs_check_archive="Archive also marks as read"
  3542. prefs_check_atom="Feed address"
  3543. prefs_check_delay="Check Inbox for mail every "
  3544. prefs_check_delay2=" secs"
  3545. prefs_check_labels="Also check the following labels:"
  3546. prefs_check_labels_add="Add label"
  3547. prefs_check_labels_delay="Check every (secs)"
  3548. prefs_check_labels_label="Label"
  3549. prefs_check_labels_new="[new label]"
  3550. prefs_check_labels_remove="Remove label"
  3551. prefs_external="External Commands"
  3552. prefs_external_browser="Command to execute on clicking the tray icon"
  3553. prefs_external_browser2="(use %u to represent the Gmail web address)"
  3554. prefs_external_mail_command="Command to execute on new mail:"
  3555. prefs_external_nomail_command="Command to execute for no mail:"
  3556. prefs_lang="Language"
  3557. prefs_login="Login details"
  3558. prefs_login_pass="_Password"
  3559. prefs_login_save="Save password"
  3560. prefs_login_save_kwallet="in KDE wallet"
  3561. prefs_login_save_plain="as plain text"
  3562. prefs_login_user="_Username"
  3563. prefs_tray="System tray"
  3564. prefs_tray_bg="Set tray background ..."
  3565. prefs_tray_error_icon="Use custom error icon"
  3566. prefs_tray_mail_icon="Use custom mail icon"
  3567. prefs_tray_no_mail_icon="Use custom no mail icon"
  3568. prefs_tray_pdelay="Show new mail popup for "
  3569. prefs_tray_pdelay2=" secs" />
  3570. <Language name="Español"
  3571. login_err="Error: Nombre de usuario o contraseña incorreta"
  3572. login_title="Autentificando en Gmail ..."
  3573. mail_archive="Archivar"
  3574. mail_archiving="Archivando ..."
  3575. mail_delete="Delete"
  3576. mail_deleting="Deleting ..."
  3577. mail_mark="Marcar como leído"
  3578. mail_mark_all="Marcar todos como leído"
  3579. mail_marking="Marcando como leído ..."
  3580. mail_marking_all="Marcando todos com leído ..."
  3581. mail_open="Abrir"
  3582. mail_report_spam="Marcar como spam"
  3583. mail_reporting_spam="Marcando como spam ..."
  3584. menu_about="_Acerca de Checkgmail"
  3585. menu_check="_Revisar correo"
  3586. menu_compose="Compose mail"
  3587. menu_prefs="_Configurar"
  3588. menu_undo="_Deshacer última acción"
  3589. notify_and="y"
  3590. notify_check="Conectactando Gmail ..."
  3591. notify_from="De:"
  3592. notify_login="Autentificando en Gmail ..."
  3593. notify_multiple1="Hay "
  3594. notify_multiple2=" nuevos mensajes ..."
  3595. notify_new_mail="Nuevo correo de "
  3596. notify_no_mail="No hay nuevos mensajes"
  3597. notify_no_subject="(sin asunto)"
  3598. notify_no_text="(sin texto)"
  3599. notify_single1="Hay "
  3600. notify_single2=" nuevo mensaje ..."
  3601. notify_undoing="Deshacer la última acción ..."
  3602. prefs="Configuración de CheckGmail"
  3603. prefs_check="Verificación de correo"
  3604. prefs_check_24_hour="reloj de 24 horas"
  3605. prefs_check_archive="Archivar también marca como leído"
  3606. prefs_check_atom="Dirección del alimentador (feed)"
  3607. prefs_check_delay="Revisar la bandeja de entrada cada "
  3608. prefs_check_delay2=" segs"
  3609. prefs_check_labels="También verificar las siguientes etiquetas:"
  3610. prefs_check_labels_add="Agregar etiqueta"
  3611. prefs_check_labels_delay="Verificar cada (segs)"
  3612. prefs_check_labels_label="Etiqueta"
  3613. prefs_check_labels_new="[nueva etiqueta]"
  3614. prefs_check_labels_remove="Eliminar etiqueta"
  3615. prefs_external="Comandos Externos"
  3616. prefs_external_browser="Navegador"
  3617. prefs_external_browser2="(%u representa la dirección web de Gmail)"
  3618. prefs_external_mail_command="Comando a ejecutar para nuevos mensajes:"
  3619. prefs_external_nomail_command="Comando a ejecutar si no hay nuevos mensajes:"
  3620. prefs_lang="Lenguaje"
  3621. prefs_login="Detalles de Autentificación"
  3622. prefs_login_pass="_Contraseña"
  3623. prefs_login_save="Guardar contraseña"
  3624. prefs_login_save_kwallet="en KDE wallet"
  3625. prefs_login_save_plain="como texto plano"
  3626. prefs_login_user="_Nombre de usuario"
  3627. prefs_tray="Área de notificaciones"
  3628. prefs_tray_bg="Seleccionar color de fondo ..."
  3629. prefs_tray_error_icon="Personalizar ícono de error"
  3630. prefs_tray_mail_icon="Personalizar ícono de nuevos mensajes"
  3631. prefs_tray_no_mail_icon="Personalizar ícono de no mensajes"
  3632. prefs_tray_pdelay="Mostrar la ventana emergente para nuevos mensajes por "
  3633. prefs_tray_pdelay2=" segs" />
  3634. <Language name="Français"
  3635. login_err="Erreur: Nom d'utilisateur ou mot de passe incorrect"
  3636. login_title="Connexion à Gmail..."
  3637. mail_archive="Archiver"
  3638. mail_archiving="Archivage..."
  3639. mail_delete="Supprimer"
  3640. mail_deleting="Suppression..."
  3641. mail_mark="Marquer comme lu"
  3642. mail_mark_all="Tout marquer comme lu"
  3643. mail_marking="Marquage comme lu..."
  3644. mail_marking_all="Marquage comme lu..."
  3645. mail_open="Ouvrir"
  3646. mail_report_spam="Signaler comme spam"
  3647. mail_reporting_spam="Signalisation comme spam..."
  3648. menu_about="_À propos"
  3649. menu_check="_Vérifier les messages"
  3650. menu_compose="Nouveau message"
  3651. menu_prefs="_Préférences"
  3652. menu_undo="_Annuler la dernière action"
  3653. notify_and="et"
  3654. notify_check="Vérification Gmail..."
  3655. notify_from="De:"
  3656. notify_login="Connexion à Gmail..."
  3657. notify_multiple1="Il y a "
  3658. notify_multiple2=" nouveaux messages..."
  3659. notify_new_mail="Nouveau message de "
  3660. notify_no_mail="Pas de nouveaux messages"
  3661. notify_no_subject="(pas d'objet)"
  3662. notify_no_text="(pas de texte)"
  3663. notify_single1="Il y a "
  3664. notify_single2=" nouveau message..."
  3665. notify_undoing="Annulation de la dernière action..."
  3666. prefs="Préférences de CheckGmail"
  3667. prefs_check="Vérification des messages"
  3668. prefs_check_24_hour="Format horaire 24h "
  3669. prefs_check_archive="Archives marquées comme lues"
  3670. prefs_check_atom="Adresse de flux"
  3671. prefs_check_delay="Vérification toutes les "
  3672. prefs_check_delay2=" secs"
  3673. prefs_check_labels="Also check the following labels:"
  3674. prefs_check_labels_add="Add label"
  3675. prefs_check_labels_delay="Check every (secs)"
  3676. prefs_check_labels_label="Label"
  3677. prefs_check_labels_new="[new label]"
  3678. prefs_check_labels_remove="Remove label"
  3679. prefs_external="Commandes externes"
  3680. prefs_external_browser="Navigateur Web"
  3681. prefs_external_browser2="(utiliser %u pour réprésenter l'adresse web de Gmail)"
  3682. prefs_external_mail_command="Commande à exécuter en cas de nouveaux messages:"
  3683. prefs_external_nomail_command="Commande à exécuter si il n'y a pas de messages:"
  3684. prefs_lang="Langues"
  3685. prefs_login="Informations utilisateur"
  3686. prefs_login_pass="_Mot de passe"
  3687. prefs_login_save="Sauver le mot de passe"
  3688. prefs_login_save_kwallet="dans le portefeuille KDE"
  3689. prefs_login_save_plain="en clair"
  3690. prefs_login_user="_Nom d'utilisateur"
  3691. prefs_tray="Zone de notification"
  3692. prefs_tray_bg="Couleur de fond..."
  3693. prefs_tray_error_icon="Icône d'erreur personnalisée"
  3694. prefs_tray_mail_icon="Icône de mail personnalisée"
  3695. prefs_tray_no_mail_icon="Icône d'absence de mail personnalisée"
  3696. prefs_tray_pdelay="Afficher un popup de notification durant "
  3697. prefs_tray_pdelay2=" secs" />
  3698. <Language name="Hrvatski"
  3699. login_err="Greška: neispravan korisnik ili lozinka"
  3700. login_title="Prijava na Gmail ..."
  3701. mail_archive="Arhiv"
  3702. mail_archiving="Arhiviranje ..."
  3703. mail_delete="Obriši"
  3704. mail_deleting="Brisanje ..."
  3705. mail_mark="Označi kao pročitano"
  3706. mail_mark_all="Označi sve kao pročitano"
  3707. mail_marking="Označavanje pročitanog ..."
  3708. mail_marking_all="Označavanje svega kao pročitanog ..."
  3709. mail_open="Otvori"
  3710. mail_report_spam="Prijavi spam"
  3711. mail_reporting_spam="Prijava spama ..."
  3712. menu_about="_O programu"
  3713. menu_check="_Provjeri mail"
  3714. menu_compose="Napiši poruku"
  3715. menu_prefs="_Postavke"
  3716. menu_undo="_Poništi zadnju akciju"
  3717. notify_and="i"
  3718. notify_check="Provjera Gmaila ..."
  3719. notify_from="Od:"
  3720. notify_login="Prijava na Gmail ..."
  3721. notify_multiple1="Broj novih poruka: "
  3722. notify_multiple2=" ..."
  3723. notify_new_mail="Nova poruka: šalje "
  3724. notify_no_mail="Nema novih poruka"
  3725. notify_no_subject="(nema predmeta)"
  3726. notify_no_text="(nema teksta)"
  3727. notify_single1="Broj novih poruka: "
  3728. notify_single2=" "
  3729. notify_undoing="Poništavanje zadnje akcije ..."
  3730. prefs="Postavke CheckGmaila"
  3731. prefs_check="Provjera maila"
  3732. prefs_check_24_hour="24-satni oblik"
  3733. prefs_check_archive="Označi arhiv pročitanim"
  3734. prefs_check_atom="Adresa feeda"
  3735. prefs_check_delay="Provjeri dolaznu poštu svakih "
  3736. prefs_check_delay2=" sekundi"
  3737. prefs_check_labels="Provjeri i ove etikete:"
  3738. prefs_check_labels_add="Dodaj etiketu"
  3739. prefs_check_labels_delay="Provjeri svake (sekunde)"
  3740. prefs_check_labels_label="Etiketa"
  3741. prefs_check_labels_new="[nova etiketa]"
  3742. prefs_check_labels_remove="Makni etiketu"
  3743. prefs_external="Vanjske naredbe"
  3744. prefs_external_browser="Web preglednik"
  3745. prefs_external_browser2="(upotrijebi %u za prikaz web adrese Gmaila)"
  3746. prefs_external_mail_command="Naredba za izvršenje ako ima novih poruka:"
  3747. prefs_external_nomail_command="Naredba za izvršenje ako nema novih poruka:"
  3748. prefs_lang="Jezik"
  3749. prefs_login="Podaci za prijavu"
  3750. prefs_login_pass="_Lozinka"
  3751. prefs_login_save="Spremi lozinku"
  3752. prefs_login_save_kwallet="u KDE wallet"
  3753. prefs_login_save_plain="kao običan tekst"
  3754. prefs_login_user="_Korisnik"
  3755. prefs_tray="Sistemska traka"
  3756. prefs_tray_bg="Postavi pozadinu sistemske trake ..."
  3757. prefs_tray_error_icon="Odaberi vlastitu ikonu za pogrešku"
  3758. prefs_tray_mail_icon="Odaberi vlastitu ikonu za novu poruku"
  3759. prefs_tray_no_mail_icon="Odaberi vlastitu ikonu kada nema poruka"
  3760. prefs_tray_pdelay="Prikaz prozora za novi mail: "
  3761. prefs_tray_pdelay2=" sekundi" />
  3762. <Language name="Italiano"
  3763. login_err="Errore: Utente o password errato"
  3764. login_title="Login a Gmail ..."
  3765. mail_archive="Archivia"
  3766. mail_archiving="Archiviazione ..."
  3767. mail_delete="Cancella"
  3768. mail_deleting="Cancellazione ..."
  3769. mail_mark="Segna come letta"
  3770. mail_mark_all="Segna tutti come letti"
  3771. mail_marking="Segnalazione come letta ..."
  3772. mail_marking_all="Marcatura tutti come letti ..."
  3773. mail_open="Apri"
  3774. mail_report_spam="Segnala come spam"
  3775. mail_reporting_spam="Segnalazione come spam ..."
  3776. menu_about="_Info"
  3777. menu_check="_Controlla le mail"
  3778. menu_compose="Componi un messaggio"
  3779. menu_prefs="_Preferenze"
  3780. menu_undo="_Annulla l'ultima azione"
  3781. notify_and="e"
  3782. notify_check="Controllo di Gmail ..."
  3783. notify_from="Da:"
  3784. notify_login="Login a Gmail ..."
  3785. notify_multiple1="Ci sono "
  3786. notify_multiple2=" nuovi messaggi ..."
  3787. notify_new_mail="Nuova mail da "
  3788. notify_no_mail="Nessuna nuova mail"
  3789. notify_no_subject="(nessun soggetto)"
  3790. notify_no_text="(nessun testo)"
  3791. notify_single1="Ci sono "
  3792. notify_single2=" nuovi messaggi ..."
  3793. notify_undoing="Undoing last action ..."
  3794. prefs="Preferenze di CheckGmail"
  3795. prefs_check="Controllo delle mail"
  3796. prefs_check_24_hour="Orologio a 24 ore"
  3797. prefs_check_archive="Archivia marca anche come letto"
  3798. prefs_check_atom="Indirizzo dei feed"
  3799. prefs_check_delay="Controlla la Inbox per tutte le mail "
  3800. prefs_check_delay2=" secondi"
  3801. prefs_check_labels="Controlla anche le seguenti etichette:"
  3802. prefs_check_labels_add="Aggiungi etichetta"
  3803. prefs_check_labels_delay="Controlla ogni (sec)"
  3804. prefs_check_labels_label="Etichetta"
  3805. prefs_check_labels_new="[nuova etichetta]"
  3806. prefs_check_labels_remove="Rimuovi etichetta"
  3807. prefs_external="Comandi esterni"
  3808. prefs_external_browser="Comando da eseguire clickando sulla icona tray"
  3809. prefs_external_browser2="(usa %u per rappresentare l'indirizzo web di Gmail)"
  3810. prefs_external_mail_command="Comando da seguire per le nuove mail:"
  3811. prefs_external_nomail_command="Comando da eseguire quando non ci sono mail:"
  3812. prefs_lang="Linguaggio"
  3813. prefs_login="Dettagli di login"
  3814. prefs_login_pass="_Password"
  3815. prefs_login_save="Salva la password"
  3816. prefs_login_save_kwallet="nel wallet KDE"
  3817. prefs_login_save_plain="come testo in chiaro"
  3818. prefs_login_user="_Username"
  3819. prefs_tray="System tray"
  3820. prefs_tray_bg="Imposta lo sfondo della tray ..."
  3821. prefs_tray_error_icon="Utilizza un icona custom per gli errori"
  3822. prefs_tray_mail_icon="Utilizza un icona custom per le mail"
  3823. prefs_tray_no_mail_icon="Utilizza un icona custom per nessuna mail"
  3824. prefs_tray_pdelay="Mostra il popup di nuove mail per "
  3825. prefs_tray_pdelay2=" secondi" />
  3826. <Language name="Magyar"
  3827. login_err="HIBA!: Helytelen felhasználónév, vagy jelszó"
  3828. login_title="Bejelentkezés a Gmail-be ..."
  3829. mail_archive="Archívum"
  3830. mail_archiving="Archiválás ..."
  3831. mail_delete="Törlés"
  3832. mail_deleting="Törlés ..."
  3833. mail_mark="Jelöld olvasottnak"
  3834. mail_mark_all="Jelöld mindet olvasottnak"
  3835. mail_marking="Olvasottnak jelölés ..."
  3836. mail_marking_all="Mindet olvasottnak jelölés ..."
  3837. mail_open="Megnyitás"
  3838. mail_report_spam="Ez spam"
  3839. mail_reporting_spam="Spam bejelentése ..."
  3840. menu_about="_Névjegy"
  3841. menu_check="_Levelek ellenőrzése"
  3842. menu_compose="Levélírás"
  3843. menu_prefs="_Beállítások"
  3844. menu_undo="_Visszavonás"
  3845. notify_and="és"
  3846. notify_check="Gmail ellenőrzése ..."
  3847. notify_from="Küldő:"
  3848. notify_login="Bejelentkezés a Gmail-be ..."
  3849. notify_multiple1="Önnek "
  3850. notify_multiple2=" új levele érkezett ..."
  3851. notify_new_mail="Új levél. Küldő: "
  3852. notify_no_mail="Nincs új levél"
  3853. notify_no_subject="(nincs cím)"
  3854. notify_no_text="(nincs szöveg)"
  3855. notify_single1="Önnek "
  3856. notify_single2=" új levele érkezett ..."
  3857. notify_undoing="Utolsó művelet visszavonása ..."
  3858. prefs="CheckGmail beállításai"
  3859. prefs_check="Levelek ellenőrzése"
  3860. prefs_check_24_hour="24 órás formátum"
  3861. prefs_check_archive="Archiválás olvasottként is jelöl"
  3862. prefs_check_atom="Feed cím"
  3863. prefs_check_delay="Postaláda ellenőrzése minden "
  3864. prefs_check_delay2=" másodpercben"
  3865. prefs_check_labels="Az alábbi címkék ellenőrzése:"
  3866. prefs_check_labels_add="Címke hozzáadása"
  3867. prefs_check_labels_delay="Ellenőrzés gyakorisága (s)"
  3868. prefs_check_labels_label="Címke"
  3869. prefs_check_labels_new="[Új címke]"
  3870. prefs_check_labels_remove="Címke eltávolítása"
  3871. prefs_external="Külső parancsok"
  3872. prefs_external_browser="Parancs végrehajtása a tálcán lévő ikonra való kattintáskor"
  3873. prefs_external_browser2="(%u a Gmail-t jelenti )"
  3874. prefs_external_mail_command="Parancs végrehajtása új levél esetén:"
  3875. prefs_external_nomail_command="Parancs végrehajtása, ha nincs új levél:"
  3876. prefs_lang="Nyelv"
  3877. prefs_login="Bejelentkezési adatok"
  3878. prefs_login_pass="_Jelszó"
  3879. prefs_login_save="Jelszó mentése"
  3880. prefs_login_save_kwallet="KDE wallet-be"
  3881. prefs_login_save_plain="sima szövegként - nincs titkosítás"
  3882. prefs_login_user="_Felhasználónév"
  3883. prefs_tray="Tálca"
  3884. prefs_tray_bg="Tálca háttérszínének beállítása ..."
  3885. prefs_tray_error_icon="Saját hiba ikon"
  3886. prefs_tray_mail_icon="Saját új levél ikon"
  3887. prefs_tray_no_mail_icon="Saját nincs új levél ikon"
  3888. prefs_tray_pdelay="Felugró ablak mutatása új levél esetén "
  3889. prefs_tray_pdelay2=" másodpercig" />
  3890. <Language name="Nederlands"
  3891. login_err="Fout: Onjuiste gebruikersnaam of wachtwoord"
  3892. login_title="inloggen in Gmail ..."
  3893. mail_archive="Archief"
  3894. mail_archiving="Archieveren ..."
  3895. mail_delete="Verwijder"
  3896. mail_deleting="Verwijderen ..."
  3897. mail_mark="Markeren als gelezen"
  3898. mail_mark_all="Markeer alles als gelezen"
  3899. mail_marking="Markeer gelezen ..."
  3900. mail_marking_all="Alles als gelezen markeren ..."
  3901. mail_open="Openen"
  3902. mail_report_spam="Aanmelden spam"
  3903. mail_reporting_spam="Aanmelden als spam ..."
  3904. menu_about="_Info"
  3905. menu_check="_Controleer Post"
  3906. menu_compose="Een nieuw e-mail opstellen"
  3907. menu_prefs="_Voorkeuren"
  3908. menu_undo="_Ongedaan maken laatste bewerking"
  3909. notify_and="en"
  3910. notify_check="Controle Gmail ..."
  3911. notify_from="Van:"
  3912. notify_login="Aanmelden Gmail account"
  3913. notify_multiple1="Er zijn "
  3914. notify_multiple2=" nieuwe berichten ..."
  3915. notify_new_mail="Nieuw bericht van "
  3916. notify_no_mail="Geen nieuwe berichten"
  3917. notify_no_subject="(geen onderwerp)"
  3918. notify_no_text="(geen tekst)"
  3919. notify_single1="Er zijn "
  3920. notify_single2=" nieuwe berichten ..."
  3921. notify_undoing="Ongedaan maken ..."
  3922. prefs="CheckGmail instellingen"
  3923. prefs_check="Controle Post"
  3924. prefs_check_24_hour="24 klok type"
  3925. prefs_check_archive="Archief ook als gelezen markeren"
  3926. prefs_check_atom="Feed adres"
  3927. prefs_check_delay="Controleer postvak elke "
  3928. prefs_check_delay2=" seconden"
  3929. prefs_check_labels="Controleer de volgende accounts:"
  3930. prefs_check_labels_add="Toevoegen account"
  3931. prefs_check_labels_delay="Controleer elke (secs)"
  3932. prefs_check_labels_label="Account"
  3933. prefs_check_labels_new="[nieuw account]"
  3934. prefs_check_labels_remove="Verwijder account"
  3935. prefs_external="Externe Commando's"
  3936. prefs_external_browser="Commando uitvoeren na klikken op tray icoon"
  3937. prefs_external_browser2="gebruik %u om het Gmail web adres te vertegenwoordigen"
  3938. prefs_external_mail_command="Commando uitvoeren bij nieuwe berichten:"
  3939. prefs_external_nomail_command="Commando uitvoeren bij geen berichten:"
  3940. prefs_lang="Taal"
  3941. prefs_login="Account informatie"
  3942. prefs_login_pass="_Wachtwoord"
  3943. prefs_login_save="Wegschrijven wachtwoord"
  3944. prefs_login_save_kwallet="in KDE portefeuille"
  3945. prefs_login_save_plain="als normale tekst"
  3946. prefs_login_user="_Gebruikersnaam"
  3947. prefs_tray="Mededelingengebied"
  3948. prefs_tray_bg="Instelling mededelingengebied achtergrond ..."
  3949. prefs_tray_error_icon="Gebruik voorkeurs fout icoon"
  3950. prefs_tray_mail_icon="Gebruik standaard bericht icoon"
  3951. prefs_tray_no_mail_icon="Gebruik standaard geen bericht icoon"
  3952. prefs_tray_pdelay="Laat nieuwe berichten popup zien voor "
  3953. prefs_tray_pdelay2=" seconden" />
  3954. <Language name="Norsk"
  3955. login_err="Feil:: Feil brukernavn eller passord"
  3956. login_title="Gmail login"
  3957. mail_archive="Arkivér"
  3958. mail_archiving="Arkiverer ..."
  3959. mail_delete="Slett"
  3960. mail_deleting="Sletter ..."
  3961. mail_mark="Marker lest"
  3962. mail_mark_all="Marker alle som lest"
  3963. mail_marking="Markerer lest ..."
  3964. mail_marking_all="Markerer alle lest ..."
  3965. mail_open="Åpne"
  3966. mail_report_spam="Rapporter spam"
  3967. mail_reporting_spam="Rapporterer spam ..."
  3968. menu_about="_Om Checkgmail"
  3969. menu_check="_Se etter ny e-post på Gmail"
  3970. menu_compose="Skriv e-post"
  3971. menu_prefs="_Instillinger"
  3972. menu_undo="_angre sidste handling ..."
  3973. notify_and="og"
  3974. notify_check="Ser etter ny e-post på Gmail ..."
  3975. notify_from="Fra:"
  3976. notify_login="Logger inn på Gmail ..."
  3977. notify_multiple1="Det er "
  3978. notify_multiple2=" ny e-post ..."
  3979. notify_new_mail="Ny e-post fra "
  3980. notify_no_mail="Ingen ny e-post"
  3981. notify_no_subject="(intet emne)"
  3982. notify_no_text="(ingen tekst)"
  3983. notify_single1="Det er "
  3984. notify_single2=" ny e-post ..."
  3985. notify_undoing="Avbryt siste handling ..."
  3986. prefs="CheckGmail innstillinger"
  3987. prefs_check="Se etter ny e-post"
  3988. prefs_check_24_hour="24 timers ur"
  3989. prefs_check_archive="Arkivér markerer også lest"
  3990. prefs_check_atom="Feed adresse"
  3991. prefs_check_delay="Se etter ny e-post hver "
  3992. prefs_check_delay2=" sekunder"
  3993. prefs_check_labels="Sjekk også følgende merker:"
  3994. prefs_check_labels_add="Legg til merke"
  3995. prefs_check_labels_delay="Sjekk hvert (sekn)"
  3996. prefs_check_labels_label="Merke"
  3997. prefs_check_labels_new="[Nytt merke]"
  3998. prefs_check_labels_remove="Fjern merke"
  3999. prefs_external="Eksterne programmer"
  4000. prefs_external_browser="Nettleser"
  4001. prefs_external_browser2="(%u representerer Gmail adressen)"
  4002. prefs_external_mail_command="Kommando ved ny e-post:"
  4003. prefs_external_nomail_command="Kommando ved ingen nye e-poster:"
  4004. prefs_lang="Språk"
  4005. prefs_login="Logindetaljer"
  4006. prefs_login_pass="_passord"
  4007. prefs_login_save="Lagre passord"
  4008. prefs_login_save_kwallet="i KDE tegnebok"
  4009. prefs_login_save_plain="som tekst"
  4010. prefs_login_user="_Brukernavn"
  4011. prefs_tray="Statusfelt"
  4012. prefs_tray_bg="Sett statusfelt bakgrund ..."
  4013. prefs_tray_error_icon="Bruk selvvalgt 'feil' ikon"
  4014. prefs_tray_mail_icon="Bruk selvvalgt 'ny e-post' ikon"
  4015. prefs_tray_no_mail_icon="Brug selvvalgt 'ingen e-post' ikon"
  4016. prefs_tray_pdelay="Vis ny e-post popup i "
  4017. prefs_tray_pdelay2=" sekunder" />
  4018. <Language name="Polski"
  4019. login_err="Błąd: Zły login lub hasło"
  4020. login_title="Logowanie do Gmail ..."
  4021. mail_archive="Archiwizuj"
  4022. mail_archiving="Archiwizuje ..."
  4023. mail_delete="Usuń"
  4024. mail_deleting="Usuwam ..."
  4025. mail_mark="Zaznacz jako przeczytane"
  4026. mail_mark_all="Zaznacz wszystko jako przeczytane"
  4027. mail_marking="Zaznaczam jako przeczytane ..."
  4028. mail_marking_all="Zaznaczam wszystko jako przeczytane ..."
  4029. mail_open="Otwórz"
  4030. mail_report_spam="Raportuj spam"
  4031. mail_reporting_spam="Raportuje spam ..."
  4032. menu_about="_O programie"
  4033. menu_check="_Sprawdź pocztę"
  4034. menu_compose="Napisz list"
  4035. menu_prefs="_Preferencje"
  4036. menu_undo="_Cofnij ostatnią operacje"
  4037. notify_and="i"
  4038. notify_check="Sprawdzam Gmail ..."
  4039. notify_from="Od:"
  4040. notify_login="Logowanie do Gmail ..."
  4041. notify_multiple1="Są "
  4042. notify_multiple2=" nowe wiadomości ..."
  4043. notify_new_mail="Nowa poczta od "
  4044. notify_no_mail="Brak nowych wiadomości"
  4045. notify_no_subject="(brak tematu)"
  4046. notify_no_text="(brak treści)"
  4047. notify_single1="Jest "
  4048. notify_single2=" nowa wiadomość ..."
  4049. notify_undoing="Cofam ostatnią operację ..."
  4050. prefs="CheckGmail - preferencje"
  4051. prefs_check="Sprawdzanie poczty"
  4052. prefs_check_24_hour="zegar 24-o godzinny"
  4053. prefs_check_archive="Archiwizując oznacz również jako przeczytane"
  4054. prefs_check_atom="Adres "
  4055. prefs_check_delay="Sprawdzaj pocztę co "
  4056. prefs_check_delay2=" sekund"
  4057. prefs_check_labels="Sprawdź też etykiety:"
  4058. prefs_check_labels_add="Dodaj etykietę"
  4059. prefs_check_labels_delay="Sprawdź co: (sekund)"
  4060. prefs_check_labels_label="Etykieta"
  4061. prefs_check_labels_new="[nowa etykieta]"
  4062. prefs_check_labels_remove="Usuń etykietę"
  4063. prefs_external="Zewnętrzne polecenia"
  4064. prefs_external_browser="Polecenie do wykonania po kliknięciu w ikonkę"
  4065. prefs_external_browser2="(w miejscu %u zostanie wstawiony adres Gmail)"
  4066. prefs_external_mail_command="Polecenie do wykonania gdy przyjdzie nowa wiadomość:"
  4067. prefs_external_nomail_command="Polecenie do wykonania gdy nie ma nowych wiadomości:"
  4068. prefs_lang="Język"
  4069. prefs_login="Informacje o koncie"
  4070. prefs_login_pass="_Hasło"
  4071. prefs_login_save="Zapisz hasło"
  4072. prefs_login_save_kwallet="w portfelu KDE"
  4073. prefs_login_save_plain="jako zwykły text"
  4074. prefs_login_user="_Użytkownik"
  4075. prefs_tray="Ikonka"
  4076. prefs_tray_bg="Tło pod ikoną ..."
  4077. prefs_tray_error_icon="Własna ikona błędu"
  4078. prefs_tray_mail_icon="Własna ikona informująca o poczcie"
  4079. prefs_tray_no_mail_icon="Własna ikona informująca o braku poczty"
  4080. prefs_tray_pdelay="Pokazuj popup przez "
  4081. prefs_tray_pdelay2=" sekund" />
  4082. <Language name="Português"
  4083. login_err="Erro: Nome de utilizador e palavra passe incorrecta"
  4084. login_title="A autenticar no Gmail..."
  4085. mail_archive="Arquivar"
  4086. mail_archiving="A arquivar..."
  4087. mail_delete="Apagar"
  4088. mail_deleting="A apagar ..."
  4089. mail_mark="Marcar como lido"
  4090. mail_mark_all="Marcar todas como lidas"
  4091. mail_marking="A marcar como lida ..."
  4092. mail_marking_all="A marcar todas como lidas..."
  4093. mail_open="Abrir"
  4094. mail_report_spam="Reportar spam"
  4095. mail_reporting_spam="A reportar spam ..."
  4096. menu_about="_Sobre"
  4097. menu_check="_Verificar mensagens"
  4098. menu_compose="Criar nova mensagem"
  4099. menu_prefs="_Preferências"
  4100. menu_undo="_Desfazer última acção"
  4101. notify_and="e"
  4102. notify_check="A verificar Gmail ..."
  4103. notify_from="De:"
  4104. notify_login="A autenticar no Gmail ..."
  4105. notify_multiple1="Existem "
  4106. notify_multiple2=" mensagens novas..."
  4107. notify_new_mail="Nova mensagem de "
  4108. notify_no_mail="Nenhuma mensagem nova"
  4109. notify_no_subject="(sem assunto)"
  4110. notify_no_text="(sem texto)"
  4111. notify_single1="Existe "
  4112. notify_single2=" mensagem nova ..."
  4113. notify_undoing="A desfazer ultíma acção ..."
  4114. prefs="Preferências do CheckGmail"
  4115. prefs_check="Verificação do Correio"
  4116. prefs_check_24_hour="24"
  4117. prefs_check_archive="Arquivo também marca como lido"
  4118. prefs_check_atom="Endereço feed"
  4119. prefs_check_delay="Verificar Caixa de Entrada por mensagens a cada "
  4120. prefs_check_delay2=" segs"
  4121. prefs_check_labels="Verificar também as seguintes etiquetas:"
  4122. prefs_check_labels_add="Adicionar etiqueta"
  4123. prefs_check_labels_delay="Verificar a cada (segs)"
  4124. prefs_check_labels_label="Etiqueta"
  4125. prefs_check_labels_new="[nova etiqueta]"
  4126. prefs_check_labels_remove="Remover etiqueta"
  4127. prefs_external="Comandos Externos"
  4128. prefs_external_browser="Comando a executar ao clicar no ícone"
  4129. prefs_external_browser2="(use %u para representar o endereço web do Gmail)"
  4130. prefs_external_mail_command="Comando a executar com novas mensagens:"
  4131. prefs_external_nomail_command="Comando a executar quando não houver mensagens:"
  4132. prefs_lang="Ídioma"
  4133. prefs_login="Dados da conta"
  4134. prefs_login_pass="_Senha"
  4135. prefs_login_save="Guardar senha"
  4136. prefs_login_save_kwallet="na carteira do KDE"
  4137. prefs_login_save_plain="como texto"
  4138. prefs_login_user="_Nome do utilizador"
  4139. prefs_tray="Área de notificação"
  4140. prefs_tray_bg="Definir côr de fundo ..."
  4141. prefs_tray_error_icon="Personalizar ícone de erro"
  4142. prefs_tray_mail_icon="Personalizar ícone de mensagem recebida"
  4143. prefs_tray_no_mail_icon="Personalizar ícone de nenhuma mensagem"
  4144. prefs_tray_pdelay="Mostrar popup de nova mensagem durante "
  4145. prefs_tray_pdelay2=" segs" />
  4146. <Language name="Português (Brasil)"
  4147. login_err="Erro: Nome de usuário e senha incorreta"
  4148. login_title="Autenticando no Gmail..."
  4149. mail_archive="Arquivar"
  4150. mail_archiving="Arquivando..."
  4151. mail_delete="Apagar"
  4152. mail_deleting="Apagando ..."
  4153. mail_mark="Marcar como lido"
  4154. mail_mark_all="Marcar todas como lidas"
  4155. mail_marking="Marcando como lida ..."
  4156. mail_marking_all="Marcando todas como lidas..."
  4157. mail_open="Abrir"
  4158. mail_report_spam="Reportar spam"
  4159. mail_reporting_spam="Reportando spam ..."
  4160. menu_about="_Sobre"
  4161. menu_check="_Verificar mensagens"
  4162. menu_compose="Criar nova mensagem"
  4163. menu_prefs="_Preferências"
  4164. menu_undo="_Desfazer última ação"
  4165. notify_and="e"
  4166. notify_check="Verificando Gmail ..."
  4167. notify_from="De:"
  4168. notify_login="Autenticando no Gmail ..."
  4169. notify_multiple1="Existem "
  4170. notify_multiple2=" mensagens novas..."
  4171. notify_new_mail="Nova mensagem de "
  4172. notify_no_mail="Nenhuma mensagem nova"
  4173. notify_no_subject="(sem assunto)"
  4174. notify_no_text="(sem texto)"
  4175. notify_single1="Existe "
  4176. notify_single2=" mensagem nova ..."
  4177. notify_undoing="Desfazendo-se da última ação ..."
  4178. prefs="Preferências do CheckGmail"
  4179. prefs_check="Verificação do Correio"
  4180. prefs_check_24_hour="Utilizar padrão de relógio 24h"
  4181. prefs_check_archive="Quando arquivar, também marcar como lido"
  4182. prefs_check_atom="Endereço feed"
  4183. prefs_check_delay="Verificar por novas mensagens a cada "
  4184. prefs_check_delay2=" segs"
  4185. prefs_check_labels="Selecione também as seguintes etiquetas:"
  4186. prefs_check_labels_add="Nova etiqueta"
  4187. prefs_check_labels_delay="Verificar a cada (segs)"
  4188. prefs_check_labels_label="Etiqueta"
  4189. prefs_check_labels_new="[nova etiqueta]"
  4190. prefs_check_labels_remove="Remover etiqueta"
  4191. prefs_external="Comandos Externos"
  4192. prefs_external_browser="Comando a executar ao clicar no ícone"
  4193. prefs_external_browser2="(use %u para representar o endereço web do Gmail)"
  4194. prefs_external_mail_command="Comando a executar com novas mensagens:"
  4195. prefs_external_nomail_command="Comando a executar quando não houver mensagens:"
  4196. prefs_lang="Idioma"
  4197. prefs_login="Dados da conta"
  4198. prefs_login_pass="_Senha"
  4199. prefs_login_save="Salvar senha"
  4200. prefs_login_save_kwallet="na carteira do KDE"
  4201. prefs_login_save_plain="como texto"
  4202. prefs_login_user="_Nome do usuário"
  4203. prefs_tray="Área de notificação"
  4204. prefs_tray_bg="Definir côr de fundo ..."
  4205. prefs_tray_error_icon="Personalizar ícone de erro"
  4206. prefs_tray_mail_icon="Personalizar ícone de mensagem recebida"
  4207. prefs_tray_no_mail_icon="Personalizar ícone de nenhuma mensagem"
  4208. prefs_tray_pdelay="Mostrar popup de nova mensagem durante "
  4209. prefs_tray_pdelay2=" segs" />
  4210. <Language name="Romană"
  4211. login_err="Eroare: Utilizator sau parolă incorecte"
  4212. login_title="Autentificare la Gmail ..."
  4213. mail_archive="Arhivă"
  4214. mail_archiving="Arhivez ..."
  4215. mail_delete="Şterge"
  4216. mail_deleting="Şterg ..."
  4217. mail_mark="Marcaţi ca citită"
  4218. mail_mark_all="Marcheaza toate ca citite"
  4219. mail_marking="Marchez ca citită ..."
  4220. mail_marking_all="Marchez toate ca citite ..."
  4221. mail_open="Deschide"
  4222. mail_report_spam="Raportează ca spam"
  4223. mail_reporting_spam="Raportez ca spam ..."
  4224. menu_about="_Despre"
  4225. menu_check="_Verificare mail"
  4226. menu_compose="Compune mail nou"
  4227. menu_prefs="_Preferinţe"
  4228. menu_undo="_Anulează ultima acţiune"
  4229. notify_and="şi"
  4230. notify_check="Verific Gmail ..."
  4231. notify_from="De la:"
  4232. notify_login="Autentificare la Gmail ..."
  4233. notify_multiple1="Sunt disponibile "
  4234. notify_multiple2=" mesaje noi ..."
  4235. notify_new_mail="Mail nou de la "
  4236. notify_no_mail="Nici un mail nou"
  4237. notify_no_subject="(fară subiect)"
  4238. notify_no_text="(fară text)"
  4239. notify_single1="Este disponibil "
  4240. notify_single2=" mesaj nou ..."
  4241. notify_undoing="Anulez ultima acţiune ..."
  4242. prefs="Preferinţe CheckGmail"
  4243. prefs_check="Verific mailul"
  4244. prefs_check_24_hour="Afişare ceas în format 24 ore"
  4245. prefs_check_archive="Marchează şi Arhiva ca citită"
  4246. prefs_check_atom="Adresă feed "
  4247. prefs_check_delay="Verifică Căsuţa Poştală la fiecare "
  4248. prefs_check_delay2=" secunde"
  4249. prefs_check_labels="Deasemenea verifică şi următoarele etichete:"
  4250. prefs_check_labels_add="Adaugă etichetă"
  4251. prefs_check_labels_delay="Verifică la fiecare (secunde)"
  4252. prefs_check_labels_label="Etichetă"
  4253. prefs_check_labels_new="[etichetă nouă]"
  4254. prefs_check_labels_remove="Şterge eticheta"
  4255. prefs_external="Comenzi Externe"
  4256. prefs_external_browser="Comandă de executat la apăsarea icon-ului:"
  4257. prefs_external_browser2="(foloseşte %u pentru a reprezenta adresa web Gmail)"
  4258. prefs_external_mail_command="Comandă de executat la mail nou:"
  4259. prefs_external_nomail_command="Comandă de executat când nu este mail:"
  4260. prefs_lang="Limba"
  4261. prefs_login="Detalii autentificare"
  4262. prefs_login_pass="_Parolă"
  4263. prefs_login_save="Salvează parola"
  4264. prefs_login_save_kwallet="în KDE wallet"
  4265. prefs_login_save_plain="ca text simplu"
  4266. prefs_login_user="_Utilizator"
  4267. prefs_tray="Zona de notificare"
  4268. prefs_tray_bg="Selectează fundal zonă de notificare ..."
  4269. prefs_tray_error_icon="Foloseşte iconiţă de eroare diferită"
  4270. prefs_tray_mail_icon="Foloseşte iconiţă de mail diferită"
  4271. prefs_tray_no_mail_icon="Foloseşte iconiţă fară mail diferită"
  4272. prefs_tray_pdelay="Arată fereastra de notificare mail nou pentru "
  4273. prefs_tray_pdelay2=" secunde" />
  4274. <Language name="Slovenčina"
  4275. login_err="Chyba: Nesprávne prihlasovacie meno alebo heslo"
  4276. login_title="Prihlasuje sa na Gmail ..."
  4277. mail_archive="Archivovať"
  4278. mail_archiving="Archivuje sa ..."
  4279. mail_delete="Odstrániť"
  4280. mail_deleting="Odstraňuje sa ..."
  4281. mail_mark="Označiť ako prečítané"
  4282. mail_mark_all="Označiť všetko ako prečítané"
  4283. mail_marking="Označuje sa ako prečítané ..."
  4284. mail_marking_all="Označuje sa všetko ako prečítané ..."
  4285. mail_open="Otvoriť"
  4286. mail_report_spam="Nahlásiť spam"
  4287. mail_reporting_spam="Nahlasuje sa spam ..."
  4288. menu_about="_O programe..."
  4289. menu_check="_Skontrolovať poštu"
  4290. menu_compose="Zostaviť správu"
  4291. menu_prefs="_Nastavenia"
  4292. menu_undo="_Odvolať poslednú operáciu"
  4293. notify_and="a"
  4294. notify_check="Kontroluje sa Gmail ..."
  4295. notify_from="Od:"
  4296. notify_login="Prihlasuje sa na Gmail ..."
  4297. notify_multiple1="Máte nových správ: "
  4298. notify_multiple2=" ..."
  4299. notify_new_mail="Nová správa od: "
  4300. notify_no_mail="Žiadna nová pošta"
  4301. notify_no_subject="(bez predmetu)"
  4302. notify_no_text="(bez textu)"
  4303. notify_single1="Máte "
  4304. notify_single2=" novú správu ..."
  4305. notify_undoing="Odvoláva sa posledná operácia ..."
  4306. prefs="Nastavenia CheckGmail"
  4307. prefs_check="Kontrola pošty"
  4308. prefs_check_24_hour="24-hodinový čas"
  4309. prefs_check_archive="Archivovanie označí ako prečítané"
  4310. prefs_check_atom="Adresa zdroja"
  4311. prefs_check_delay="Kontrola schránky každých "
  4312. prefs_check_delay2=" s"
  4313. prefs_check_labels="Skontrolovať aj tieto zdroje:"
  4314. prefs_check_labels_add="Pridať zdroj"
  4315. prefs_check_labels_delay="Interval (v sekundách)"
  4316. prefs_check_labels_label="Zdroj"
  4317. prefs_check_labels_new="[nový zdroj]"
  4318. prefs_check_labels_remove="Zmazať zdroj"
  4319. prefs_external="Externé príkazy"
  4320. prefs_external_browser="Príkazy pri kliknutí na ikonu v systémovej lište:"
  4321. prefs_external_browser2="(použite %u namiesto web-adresy Gmail-u)"
  4322. prefs_external_mail_command="Príkaz pri zistení novej pošty:"
  4323. prefs_external_nomail_command="Príkaz pri žiadnej novej pošte:"
  4324. prefs_lang="Jazyk"
  4325. prefs_login="Podrobnosti prihlásenia"
  4326. prefs_login_pass="_Heslo"
  4327. prefs_login_save="Uložiť heslo"
  4328. prefs_login_save_kwallet="do KDE wallet"
  4329. prefs_login_save_plain="ako prostý text"
  4330. prefs_login_user="_Meno"
  4331. prefs_tray="Systémová lišta"
  4332. prefs_tray_bg="Nastaviť pozadie lišty ..."
  4333. prefs_tray_error_icon="Vlastnú ikonu - chyba"
  4334. prefs_tray_mail_icon="Vlastnú ikonu - pošta"
  4335. prefs_tray_no_mail_icon="Vlastnú ikonu - žiadna pošta"
  4336. prefs_tray_pdelay="Zobraziť okno novej pošty počas "
  4337. prefs_tray_pdelay2=" s" />
  4338. <Language name="Slovenščina"
  4339. login_err="Napaka: Napačno uporabniško ime ali geslo"
  4340. login_title="Prijavi se v Gmail ..."
  4341. mail_archive="Arhiviraj"
  4342. mail_archiving="Arhiviram ..."
  4343. mail_delete="Izbriši"
  4344. mail_deleting="Brišem ..."
  4345. mail_mark="Označi kot prebrano"
  4346. mail_mark_all="Označi vse kot prebrano"
  4347. mail_marking="Označujem kot prebrano ..."
  4348. mail_marking_all="Označujem vse kot prebrano ..."
  4349. mail_open="Odpri"
  4350. mail_report_spam="Prijavi vslijeno pošto"
  4351. mail_reporting_spam="Poročam vsiljeno pošto ..."
  4352. menu_about="_O CheckGmail"
  4353. menu_check="_Preglej pošto"
  4354. menu_compose="Novo sporočilo"
  4355. menu_prefs="_Nastavitve"
  4356. menu_undo="_Razveljavi zadnjo akcijo"
  4357. notify_and="in"
  4358. notify_check="Pregledujem Gmail ..."
  4359. notify_from="Od:"
  4360. notify_login="Prijavljanje v Gmail ..."
  4361. notify_multiple1="V predalu je "
  4362. notify_multiple2=" sporočil ..."
  4363. notify_new_mail="Nova pošta od "
  4364. notify_no_mail="Ni nove pošte"
  4365. notify_no_subject="(brez zadeve)"
  4366. notify_no_text="(ni besedila)"
  4367. notify_single1="V predalu je "
  4368. notify_single2=" novo sporočilo ..."
  4369. notify_undoing="Razveljavljam zadnjo akcijo ..."
  4370. prefs="CheckGmail nastavitve"
  4371. prefs_check="Preverjanje pošte"
  4372. prefs_check_24_hour="24 urni čas"
  4373. prefs_check_archive="Arhiviraj označi kot prebrano"
  4374. prefs_check_atom="Naslov informacij"
  4375. prefs_check_delay="Preveri pošto vsakih "
  4376. prefs_check_delay2=" sekund"
  4377. prefs_check_labels="Also check the following labels:"
  4378. prefs_check_labels_add="Add label"
  4379. prefs_check_labels_delay="Check every (secs)"
  4380. prefs_check_labels_label="Label"
  4381. prefs_check_labels_new="[new label]"
  4382. prefs_check_labels_remove="Remove label"
  4383. prefs_external="Znanji ukazi"
  4384. prefs_external_browser="Ukaz, ki se bo izvršil ob kliku na ikono na pultu"
  4385. prefs_external_browser2="(uporabi %u da predstaviš Gmail domačo stran)"
  4386. prefs_external_mail_command="Ukaz za izvršitev ob novem sporočilu:"
  4387. prefs_external_nomail_command="Ukaz, ki se izvrši če ni nobene pošte:"
  4388. prefs_lang="Jezik"
  4389. prefs_login="Podrobnosti prijave"
  4390. prefs_login_pass="_Geslo"
  4391. prefs_login_save="Shrani geslo"
  4392. prefs_login_save_kwallet="v KDE denarnico"
  4393. prefs_login_save_plain="kot navaden tekst"
  4394. prefs_login_user="_Uporabniško ime"
  4395. prefs_tray="Sistemski pult"
  4396. prefs_tray_bg="Izberi odzadje pulta ..."
  4397. prefs_tray_error_icon="Uporabi ikono po meri za napako"
  4398. prefs_tray_mail_icon="Uporabi ikono po meri za sporočila"
  4399. prefs_tray_no_mail_icon="Uporabi ikono po meri za brez sporočil"
  4400. prefs_tray_pdelay="Ob novem sporočilu prikaži okno za "
  4401. prefs_tray_pdelay2=" sek." />
  4402. <Language name="Suomi"
  4403. login_err="Virhe: Väärä käyttäjätunnus tai salasana"
  4404. login_title="Kirjaudutaan Gmailiin ..."
  4405. mail_archive="Arkistoi"
  4406. mail_archiving="Arkistoidaan ..."
  4407. mail_delete="Poista"
  4408. mail_deleting="Poistetaan ..."
  4409. mail_mark="Merkitse luetuksi"
  4410. mail_mark_all="Merkitse kaikki luetuiksi"
  4411. mail_marking="Merkitään luetuksi ..."
  4412. mail_marking_all="Merkitään kaikki luetuiksi ..."
  4413. mail_open="Avaa"
  4414. mail_report_spam="Ilmoita roskapostista"
  4415. mail_reporting_spam="Ilmoitetaan roskapostista ..."
  4416. menu_about="_Tietoja"
  4417. menu_check="_Tarkista posti"
  4418. menu_compose="Luo uusi viesti"
  4419. menu_prefs="_Asetukset"
  4420. menu_undo="_Peru viime toiminto"
  4421. notify_and="ja"
  4422. notify_check="Tarkistetaan postia ..."
  4423. notify_from="Lähettäjä:"
  4424. notify_login="Kirjaudutaan Gmailiin ..."
  4425. notify_multiple1="Sinulle on "
  4426. notify_multiple2=" uutta viestiä ..."
  4427. notify_new_mail="Uutta postia, lähettäjä "
  4428. notify_no_mail="Ei uusia viestejä"
  4429. notify_no_subject="(ei aihetta)"
  4430. notify_no_text="(ei tekstiä)"
  4431. notify_single1="Sinulle on "
  4432. notify_single2=" uusi viesti ..."
  4433. notify_undoing="Perutaan viime toimintoa ..."
  4434. prefs="CheckGmail asetukset"
  4435. prefs_check="Postin tarkistus"
  4436. prefs_check_24_hour="24-tuntinen kello"
  4437. prefs_check_archive="Arkistoiminen merkitsee luetuksi"
  4438. prefs_check_atom="Syötteen osoite"
  4439. prefs_check_delay="Tarkista posti "
  4440. prefs_check_delay2=" sekunnin välein"
  4441. prefs_check_labels="Also check the following labels:"
  4442. prefs_check_labels_add="Add label"
  4443. prefs_check_labels_delay="Check every (secs)"
  4444. prefs_check_labels_label="Label"
  4445. prefs_check_labels_new="[new label]"
  4446. prefs_check_labels_remove="Remove label"
  4447. prefs_external="Ulkoiset komennot"
  4448. prefs_external_browser="Kun ilmoitusalueen kuvaketta painetaan, suorita komento:"
  4449. prefs_external_browser2="(%u kuvastaa Gmailin web osoitetta)"
  4450. prefs_external_mail_command="Kun uutta postia saapuu, suorita komento:"
  4451. prefs_external_nomail_command="Kun uutta postia ei ole saapunut, suorita komento:"
  4452. prefs_lang="Kieli"
  4453. prefs_login="Kirjautumisasetukset"
  4454. prefs_login_pass="_Salasana"
  4455. prefs_login_save="Tallenna salasana"
  4456. prefs_login_save_kwallet="KDE lompakkoon"
  4457. prefs_login_save_plain="pelkkäteksti muodossa"
  4458. prefs_login_user="_Käyttäjätunnus"
  4459. prefs_tray="Ilmoitusalue"
  4460. prefs_tray_bg="Aseta ilmoitusalueen tausta ..."
  4461. prefs_tray_error_icon="Käytä omaa virhekuvaketta"
  4462. prefs_tray_mail_icon="Käytä omaa uutta postia -kuvaketta"
  4463. prefs_tray_no_mail_icon="Käytä omaa ei postia -kuvaketta"
  4464. prefs_tray_pdelay="Näytä ilmoitus saapuneesta postista "
  4465. prefs_tray_pdelay2=" sekuntia" />
  4466. <Language name="Svenska"
  4467. login_err="Fel: Felaktigt användarnamn eller lösenord"
  4468. login_title="Gmail Login ..."
  4469. mail_archive="Arkiv"
  4470. mail_archiving="Arkiverar ..."
  4471. mail_delete="Radera"
  4472. mail_deleting="Raderar ..."
  4473. mail_mark="Markera läst"
  4474. mail_mark_all="Markera alla som lästa"
  4475. mail_marking="Markerar läst ..."
  4476. mail_marking_all="Markerar alla lästa ..."
  4477. mail_open="Öppna"
  4478. mail_report_spam="Rapportera skräppost"
  4479. mail_reporting_spam="Rapporterar skräppost ..."
  4480. menu_about="_Om"
  4481. menu_check="_Kolla mail"
  4482. menu_compose="Skriv ett mail"
  4483. menu_prefs="_Inställningar"
  4484. menu_undo="_Ångra senast handling"
  4485. notify_and="och"
  4486. notify_check="Kollar Gmail ..."
  4487. notify_from="Från:"
  4488. notify_login="Loggar in till Gmail ..."
  4489. notify_multiple1="Det finns"
  4490. notify_multiple2="nya meddelanden ..."
  4491. notify_new_mail="Nytt mail från"
  4492. notify_no_mail="Inga nya mail"
  4493. notify_no_subject="(inget ämne)"
  4494. notify_no_text="(ingen text)"
  4495. notify_single1="Det finns"
  4496. notify_single2="nytt meddelande ..."
  4497. notify_undoing="Ångrar senaste handlingen ..."
  4498. prefs="CheckGmail inställningar"
  4499. prefs_check="Se efter nya mail"
  4500. prefs_check_24_hour="24-timmars klocka"
  4501. prefs_check_archive="Arkivering markerar också som läst"
  4502. prefs_check_atom="Feed adress"
  4503. prefs_check_delay="Kolla mail varje"
  4504. prefs_check_delay2="sekund"
  4505. prefs_check_labels="Also check the following labels:"
  4506. prefs_check_labels_add="Add label"
  4507. prefs_check_labels_delay="Check every (secs)"
  4508. prefs_check_labels_label="Label"
  4509. prefs_check_labels_new="[new label]"
  4510. prefs_check_labels_remove="Remove label"
  4511. prefs_external="Externa kommandon"
  4512. prefs_external_browser="Kommando att exekvera vid klick på fältikonen"
  4513. prefs_external_browser2="(använd %u för att representera Gmail webadressen)"
  4514. prefs_external_mail_command="Kommando att exekvera vid nytt mail:"
  4515. prefs_external_nomail_command="Kommando att exekvera vid inget mail:"
  4516. prefs_lang="Språk"
  4517. prefs_login="Logindetaljer"
  4518. prefs_login_pass="_Lösenord"
  4519. prefs_login_save="Spara lösenord"
  4520. prefs_login_save_kwallet="i KDE plånbok"
  4521. prefs_login_save_plain="som klartext"
  4522. prefs_login_user="_Användarnamn"
  4523. prefs_tray="Systemfält"
  4524. prefs_tray_bg="Välj fältbakgrund ..."
  4525. prefs_tray_error_icon="Använd annan fel-ikon"
  4526. prefs_tray_mail_icon="Använd annan mail-ikon"
  4527. prefs_tray_no_mail_icon="Använd annan ingen mail-ikon"
  4528. prefs_tray_pdelay="Visa nytt mail popup i"
  4529. prefs_tray_pdelay2="sekunder" />
  4530. <Language name="hrvatski"
  4531. login_err="Greška: pogrešno korisničko ime ili zaporka"
  4532. login_title="Prijava na Gmail ..."
  4533. mail_archive="Arhiviraj"
  4534. mail_archiving="Arhiviranje ..."
  4535. mail_delete="Obriši"
  4536. mail_deleting="Brisanje ..."
  4537. mail_mark="Označi kao pročitano"
  4538. mail_mark_all="Sve označi kao pročitano"
  4539. mail_marking="Označavanje kao pročitanog ..."
  4540. mail_marking_all="Označavanje svega kao pročitanog ..."
  4541. mail_open="Otvori"
  4542. mail_report_spam="Prijavi neželjenu poruku"
  4543. mail_reporting_spam="Prijava neželjene poruke ..."
  4544. menu_about="_O programu"
  4545. menu_check="_Provjeri poštu"
  4546. menu_compose="Napiši poruku"
  4547. menu_prefs="_Postavke"
  4548. menu_undo="_Poništi zadnji potez"
  4549. notify_and="i"
  4550. notify_check="Provjera Gmaila ..."
  4551. notify_from="Šalje:"
  4552. notify_login="Prijava na Gmail ..."
  4553. notify_multiple1="Broj novih poruka: "
  4554. notify_multiple2=" new messages ..."
  4555. notify_new_mail="Novu poruku šalje "
  4556. notify_no_mail="Nema novih poruka"
  4557. notify_no_subject="(nema predmeta)"
  4558. notify_no_text="(nema teksta)"
  4559. notify_single1="Stigla je "
  4560. notify_single2=" nova poruka ..."
  4561. notify_undoing="Poništavanje zadnjeg postupka ..."
  4562. prefs="Postavke CheckGmaila"
  4563. prefs_check="Provjera pošte"
  4564. prefs_check_24_hour="24-satni oblik"
  4565. prefs_check_archive="Označi i arhiv pročitanim"
  4566. prefs_check_atom="Adresa feeda"
  4567. prefs_check_delay="Provjeri pristiglu poštu svakih "
  4568. prefs_check_delay2=" sek"
  4569. prefs_check_labels="Provjeri i sljedeće oznake:"
  4570. prefs_check_labels_add="Dodaj oznaku"
  4571. prefs_check_labels_delay="Provjeri svakih (sek)"
  4572. prefs_check_labels_label="Oznaka"
  4573. prefs_check_labels_new="[nova oznaka]"
  4574. prefs_check_labels_remove="Ukloni oznaku"
  4575. prefs_external="Vanjske naredbe"
  4576. prefs_external_browser="Naredba za izvršenje prilikom klikanja ikonice na sistemskoj traci"
  4577. prefs_external_browser2="(koristi %u za prikaz web adrese Gmaila)"
  4578. prefs_external_mail_command="Naredba za izvršenje ako ima novih poruka:"
  4579. prefs_external_nomail_command="Naredba za izvršenje ako nema novih poruka:"
  4580. prefs_lang="Jezik"
  4581. prefs_login="Podaci za prijavu"
  4582. prefs_login_pass="_Zaporka"
  4583. prefs_login_save="Spremi zaporku"
  4584. prefs_login_save_kwallet="u KDE wallet"
  4585. prefs_login_save_plain="kao običan text"
  4586. prefs_login_user="_Korisničko ime"
  4587. prefs_tray="Sistemska traka"
  4588. prefs_tray_bg="Postavi pozadinu sistemske trake..."
  4589. prefs_tray_error_icon="Odaberi vlastitu ikonu za pogrešku"
  4590. prefs_tray_mail_icon="Odaberi vlastitu ikonu za novu poruku"
  4591. prefs_tray_no_mail_icon="Odaberi vlastitu ikonu kada nema poruka"
  4592. prefs_tray_pdelay="Prikaži prozorčić s novom porukom na "
  4593. prefs_tray_pdelay2=" sekundi" />
  4594. <Language name="Čeština"
  4595. login_err="Chyba: Špatné jméno nebo heslo"
  4596. login_title="Přihlašuji se na Gmail ..."
  4597. mail_archive="Archivuj"
  4598. mail_archiving="Archivuji ..."
  4599. mail_delete="Odstraň"
  4600. mail_deleting="Odstraňuji ..."
  4601. mail_mark="Označ jako přečtené"
  4602. mail_mark_all="Označ vše jako přečtené"
  4603. mail_marking="Označuji jako přečtené ..."
  4604. mail_marking_all="Označuji vše jako přečtené ..."
  4605. mail_open="Otevřít"
  4606. mail_report_spam="Nahlaš spam"
  4607. mail_reporting_spam="Nahlašuji spam ..."
  4608. menu_about="_O programu"
  4609. menu_check="_Zkontroluj poštu"
  4610. menu_compose="Napiš email"
  4611. menu_prefs="_Nastavení"
  4612. menu_undo="_Vrať poslední akci"
  4613. notify_and="a"
  4614. notify_check="Kontroluji Gmail ..."
  4615. notify_from="Od:"
  4616. notify_login="Přihlašuji se do Gmail ..."
  4617. notify_multiple1="Jsou "
  4618. notify_multiple2=" nové zprávy ..."
  4619. notify_new_mail="Nová zpráva od "
  4620. notify_no_mail="Žádné nové zprávy"
  4621. notify_no_subject="(bez předmětu)"
  4622. notify_no_text="(bez obsahu)"
  4623. notify_single1="Je "
  4624. notify_single2=" nová zpráva ..."
  4625. notify_undoing="Vracím poslední akci ..."
  4626. prefs="CheckGmail - Nastavení"
  4627. prefs_check="Kontrolování pošty"
  4628. prefs_check_24_hour="24-hodinový formát"
  4629. prefs_check_archive="Při archivaci označ jako přečtené"
  4630. prefs_check_atom="Adresa zdroje"
  4631. prefs_check_delay="Kontroluj poštu každých "
  4632. prefs_check_delay2=" vteřin"
  4633. prefs_check_labels="Kontroluj také štítky:"
  4634. prefs_check_labels_add="Přidej štítek"
  4635. prefs_check_labels_delay="Kontroluj každých: (vteřin)"
  4636. prefs_check_labels_label="Štítek"
  4637. prefs_check_labels_new="[nový štítek]"
  4638. prefs_check_labels_remove="Odstraň štítek"
  4639. prefs_external="Příkazy"
  4640. prefs_external_browser="Kliknutím na ikonu se provede"
  4641. prefs_external_browser2="(řetězec %u se nahradí adresou Gmailu)"
  4642. prefs_external_mail_command="Když přijde nová zpráva:"
  4643. prefs_external_nomail_command="Když žádná nová zpráva nepřišla:"
  4644. prefs_lang="Jazyk"
  4645. prefs_login="Informace o účtu"
  4646. prefs_login_pass="_Heslo"
  4647. prefs_login_save="Ulož heslo"
  4648. prefs_login_save_kwallet="w KDE peněžence"
  4649. prefs_login_save_plain="jako běžný text"
  4650. prefs_login_user="_Uživatel"
  4651. prefs_tray="Tray lišta"
  4652. prefs_tray_bg="Pozadí ikony ..."
  4653. prefs_tray_error_icon="Použít vlastní ikonu pro chybu"
  4654. prefs_tray_mail_icon="Použít vlastní ikonu pro novou zprávu"
  4655. prefs_tray_no_mail_icon="Použít vlastní ikonu pro žádnou zprávu"
  4656. prefs_tray_pdelay="Zobraz popup s novou zprávou "
  4657. prefs_tray_pdelay2=" vteřin" />
  4658. <Language name="Русский"
  4659. login_err="Ошибка: Неверный логин или пароль"
  4660. login_title="Логин в Google-Mail ..."
  4661. mail_archive="Архивировать"
  4662. mail_archiving="Архивирую ..."
  4663. mail_delete="Удалить"
  4664. mail_deleting="Удаляю ..."
  4665. mail_mark="Пометить как прочитанное"
  4666. mail_mark_all="Пометить все как прочитанные"
  4667. mail_marking="Помечаю как прочитаное ..."
  4668. mail_marking_all="Помечаю все как прочитанные ..."
  4669. mail_open="Открыть"
  4670. mail_report_spam="Пометить как спам"
  4671. mail_reporting_spam="Помечаю как спам ..."
  4672. menu_about="_О программе"
  4673. menu_check="_Проверить почту"
  4674. menu_compose="Новое сообщение"
  4675. menu_prefs="_Настройки"
  4676. menu_undo="От_менить"
  4677. notify_and="и"
  4678. notify_check="Проверяю Google-Mail ..."
  4679. notify_from="От:"
  4680. notify_login="Соединение с Google-Mail ..."
  4681. notify_multiple1="У вас "
  4682. notify_multiple2=" новых сообщений ..."
  4683. notify_new_mail="Новое сообщение от "
  4684. notify_no_mail="Нет новых сообщений"
  4685. notify_no_subject="(без темы)"
  4686. notify_no_text="(без сообщения)"
  4687. notify_single1="У вас "
  4688. notify_single2=" новое сообщение ..."
  4689. notify_undoing="Отменить последнее изменение ..."
  4690. prefs="Настройки CheckGmail"
  4691. prefs_check="Проверка сообщений"
  4692. prefs_check_24_hour="24-х часовой формат"
  4693. prefs_check_archive="При архивировании пометить как прочитанное"
  4694. prefs_check_atom="Feed адрес:"
  4695. prefs_check_delay="Проверять сообщения каждые "
  4696. prefs_check_delay2=" секунд"
  4697. prefs_check_labels="Также проверять следующие ярлыки:"
  4698. prefs_check_labels_add="Добавить ярлык"
  4699. prefs_check_labels_delay="Проверять каждые (сек)"
  4700. prefs_check_labels_label="Ярлык"
  4701. prefs_check_labels_new="[новый ярлык]"
  4702. prefs_check_labels_remove="Удалить ярлык"
  4703. prefs_external="Внешние программы"
  4704. prefs_external_browser="Web-браузер"
  4705. prefs_external_browser2="(Вместо %u будет установлен адрес)"
  4706. prefs_external_mail_command="Выполнять при новых сообщениях:"
  4707. prefs_external_nomail_command="Выполнять, когда новых сообщений нет:"
  4708. prefs_lang="Язык"
  4709. prefs_login="Login-настройки"
  4710. prefs_login_pass="_Пароль"
  4711. prefs_login_save="Сохранить пароль"
  4712. prefs_login_save_kwallet="в KDE-Wallet"
  4713. prefs_login_save_plain="незашифрованным"
  4714. prefs_login_user="_Логин"
  4715. prefs_tray="Системный трей"
  4716. prefs_tray_bg="Цвет заднего фона ..."
  4717. prefs_tray_error_icon="Использовать свою иконку для ошибок"
  4718. prefs_tray_mail_icon="Использовать свою иконку для новых сообщений"
  4719. prefs_tray_no_mail_icon="Использовать свою иконку для отсутствия новых сообщений"
  4720. prefs_tray_pdelay="Показывать оповещение "
  4721. prefs_tray_pdelay2=" секунд" />
  4722. <Language name="தமிழ்"
  4723. login_err="பிழை: பயனர் பெயரில் அல்லது கடவுச்சொல்லில்"
  4724. login_title="ஜிமெயிலினுள் நுழை ..."
  4725. mail_archive="பேழையிலிடு"
  4726. mail_archiving="பேழையினுள் இடுகிறது..."
  4727. mail_delete="அழி"
  4728. mail_deleting="அழிக்கப்படுகிறது ..."
  4729. mail_mark="படித்ததாகக் குறி"
  4730. mail_mark_all="அனைத்து மடல்களும் படித்ததாகக் குறி"
  4731. mail_marking="படித்ததாகக் குறிக்கப்படுகிறது ..."
  4732. mail_marking_all="அனைத்து மடல்களும் படித்ததாகக் குறிக்கப்படுகிறது ..."
  4733. mail_open="மடலினைத் திற"
  4734. mail_report_spam="ஒவ்வாத/விளம்பர மடல்"
  4735. mail_reporting_spam="ஒவ்வாத/விளம்பர மடலெனத் தெரிவி ..."
  4736. menu_about="_அறிவிப்பான் குறித்து"
  4737. menu_check="_மடல் உள்ளதாவெனப் பார்"
  4738. menu_compose="மடல் எழுத"
  4739. menu_prefs="_அமைவு விருப்பங்கள்"
  4740. menu_undo="_முந்தைய செயலை மாற்று"
  4741. notify_and="மற்றும்"
  4742. notify_check="மடல் வரவைப் பார் ..."
  4743. notify_from="அனுப்புனர்:"
  4744. notify_login="ஜிமெயிலுனுள் நுழைகிறது ..."
  4745. notify_multiple1="அஞ்சல் பெட்டியில் "
  4746. notify_multiple2=" புதிய மடல்கள் வந்துள்ளன ..."
  4747. notify_new_mail="புதிய மடலினை அனுப்பியவர் "
  4748. notify_no_mail="புதிய மடல் ஏதும் இல்லை"
  4749. notify_no_subject="(பொருள் இல்லை)"
  4750. notify_no_text="(எழுத்து எதுவும் இல்லை)"
  4751. notify_single1="அஞ்சல் பெட்டியில் "
  4752. notify_single2=" புதிய மடல் உள்ளது ..."
  4753. notify_undoing="முந்தைய செயலை நிராகரிக்கிறது ..."
  4754. prefs="ஜிமெயில் புதுமடல் வரத்தில் உங்களின் விருப்பங்கள்"
  4755. prefs_check="மடலின் வரவு பார்க்கப்படுகிறது"
  4756. prefs_check_24_hour="24 மணிநேரக் கடிகாரம்"
  4757. prefs_check_archive="பேழையிலிட்டுப் படித்ததாகக் குறி"
  4758. prefs_check_atom="ஆட்டோம் அல்லது ஈட்டு முகவரி"
  4759. prefs_check_delay="அஞ்சல் பெட்டியை "
  4760. prefs_check_delay2=" நொடிகளுக்கொருமுறை பார்"
  4761. prefs_check_labels="கீழ்க்கண்டக் குறிகளிடப்பட்ட மடல்கள் உள்ளனவா எனப் பார்:"
  4762. prefs_check_labels_add="புதிதாகக் குறியீட்டை இணை"
  4763. prefs_check_labels_delay="இவற்றை பார்ப்பதற்கான இடைவெளி (நொடிகளில்)"
  4764. prefs_check_labels_label="குறியீடு"
  4765. prefs_check_labels_new="[புதியக் குறியீடு]"
  4766. prefs_check_labels_remove="குறியீட்டை நீக்கு"
  4767. prefs_external="வெளி ஆணை"
  4768. prefs_external_browser="குறிப்படத்தை சொடுக்கும் பொழுது, இயற்றப்படும் ஆணை"
  4769. prefs_external_browser2="(ஜிமெயில் தளத்தைத் திறக்கவேண்டியத் தள உலாவி:)"
  4770. prefs_external_mail_command="புதிய மடல் எழுதுவதற்குத் தேவையான ஆணை:"
  4771. prefs_external_nomail_command="மடல் இல்லை எனில் இடப்படவேண்டிய ஆணை:"
  4772. prefs_lang="மொழி"
  4773. prefs_login="பயனாளர் விவரங்கள்"
  4774. prefs_login_pass="_கடவுச் சொல்"
  4775. prefs_login_save="கடவுச் சொல்லை சேமிக்க"
  4776. prefs_login_save_kwallet="KDE பையினுள் சேமிக்க"
  4777. prefs_login_save_plain="வெறும் எழுத்துக்களாக சேமிக்க"
  4778. prefs_login_user="_பயனர்"
  4779. prefs_tray="அறிவிப்பானின் பலகை"
  4780. prefs_tray_bg="அறிவிப்பானின் பலகையின் நிறத்தைத் தேர்ந்தெடுக்க ..."
  4781. prefs_tray_error_icon="வழக்கமான பிழை குறிப்படத்தைப் பயன்படுத்த"
  4782. prefs_tray_mail_icon="வழக்கமான மடல் குறிப்படத்தைப் பயன்படுத்த"
  4783. prefs_tray_no_mail_icon="வழக்கமான மடல்-இல்லை குறிப்படத்தைப் பயன்படுத்த"
  4784. prefs_tray_pdelay="புதிய மடலின் வருகை அறிவிப்பை"
  4785. prefs_tray_pdelay2="நொடிகளுக்குக் காட்டுக" />
  4786. <Language name="Македонски"
  4787. login_err="Грешка: Погрешно корисничко име или лозинка"
  4788. login_title="Се логирам на Gmail ..."
  4789. mail_archive="Архива"
  4790. mail_archiving="Архивирам ..."
  4791. mail_delete="Бриши"
  4792. mail_deleting="Бришам ..."
  4793. mail_mark="Обележи како прочитано"
  4794. mail_mark_all="Обележи сѐ како прочитано"
  4795. mail_marking="Обележувам како прочитано ..."
  4796. mail_marking_all="Обележувам сѐ како прочитано ..."
  4797. mail_open="Отвори"
  4798. mail_report_spam="Пријави спам"
  4799. mail_reporting_spam="Пријавувам спам ..."
  4800. menu_about="_За"
  4801. menu_check="_Провери пошта"
  4802. menu_compose="Пиши пошта"
  4803. menu_prefs="_Поставување"
  4804. menu_undo="_Врати ја претходната акција"
  4805. notify_and="и"
  4806. notify_check="Проверувам на Gmail ..."
  4807. notify_from="Од:"
  4808. notify_login="Се логирам на Gmail ..."
  4809. notify_multiple1="Има "
  4810. notify_multiple2=" нови пораки ..."
  4811. notify_new_mail="Нова пошта од "
  4812. notify_no_mail="Нема нови пораки"
  4813. notify_no_subject="(без наслов)"
  4814. notify_no_text="(без текст)"
  4815. notify_single1="Има "
  4816. notify_single2=" нова порака ..."
  4817. notify_undoing="Ја враќам претходната акција ..."
  4818. prefs="CheckGmail поставувања"
  4819. prefs_check="Проверување пошта"
  4820. prefs_check_24_hour="24 часа"
  4821. prefs_check_archive="Архивирај, исто така обележи како прочитано"
  4822. prefs_check_atom="Адреса на каналот"
  4823. prefs_check_delay="Провери го сандачето за пошта секои "
  4824. prefs_check_delay2=" секунди"
  4825. prefs_check_labels="Исто така провери ги следниве ознаки:"
  4826. prefs_check_labels_add="Додај ознака"
  4827. prefs_check_labels_delay="Провери секои (секунди)"
  4828. prefs_check_labels_label="Ознака"
  4829. prefs_check_labels_new="[нова ознака]"
  4830. prefs_check_labels_remove="Тргни ознака"
  4831. prefs_external="Надворешни команди"
  4832. prefs_external_browser="Команда која ќе се изврши на кликање на иконата "
  4833. prefs_external_browser2="(користи %u да ја преставиш Gmail веб адресата)"
  4834. prefs_external_mail_command="Команда која ќе се изврши кога има нова пошта:"
  4835. prefs_external_nomail_command="Команда која ќе се изврши кога нема нова пошта:"
  4836. prefs_lang="Јазик"
  4837. prefs_login="Детали за логирањето"
  4838. prefs_login_pass="_Лозинка"
  4839. prefs_login_save="Сними лозинка"
  4840. prefs_login_save_kwallet="во KDE паричникот"
  4841. prefs_login_save_plain="како обичен текст"
  4842. prefs_login_user="_Корисничко име"
  4843. prefs_tray="Системско ќоше"
  4844. prefs_tray_bg="Подеси боја на ќошето"
  4845. prefs_tray_error_icon="Користи посебна икона за грешка"
  4846. prefs_tray_mail_icon="Користи посебна икона за нова пошта"
  4847. prefs_tray_no_mail_icon="Користи посебна икона за немање нова пошта"
  4848. prefs_tray_pdelay="Покажи го скокачкото прозорче за нова пошта "
  4849. prefs_tray_pdelay2=" секунди" />
  4850. <Language name="Biełaruskaja łacinka"
  4851. login_err="Pamyłka: Drenny login albo parol"
  4852. login_title="Aŭtaryzacyja ŭ Gmail ..."
  4853. mail_archive="Archivizuj"
  4854. mail_archiving="Archivizuje ..."
  4855. mail_delete="Vydal"
  4856. mail_deleting="Vydalaje ..."
  4857. mail_mark="Paznač jak pračytanaje"
  4858. mail_mark_all="Paznač usio jak pračytanaje"
  4859. mail_marking="Zaznačaje jak pračytanaje ..."
  4860. mail_marking_all="Zaznačaje usio jak pračytanaje ..."
  4861. mail_open="Adčyni"
  4862. mail_report_spam="Rapartuj spam"
  4863. mail_reporting_spam="Rapartuje spam ..."
  4864. menu_about="_Pra prahramu"
  4865. menu_check="_Pravier poštu"
  4866. menu_compose="Napišy list"
  4867. menu_prefs="_Nałady"
  4868. menu_undo="_Anuluj apošniuju aperacyju"
  4869. notify_and="i"
  4870. notify_check="Spraŭdžvaju Gmail ..."
  4871. notify_from="Ad:"
  4872. notify_login="Aŭtaryzacyja ŭ Gmail ..."
  4873. notify_multiple1="Jość "
  4874. notify_multiple2=" novyja listy ..."
  4875. notify_new_mail="Novaja pošta ad "
  4876. notify_no_mail="Niama novych listoŭ"
  4877. notify_no_subject="(biaz temy)"
  4878. notify_no_text="(biaz źmiestu)"
  4879. notify_single1="Jość "
  4880. notify_single2=" novy list ..."
  4881. notify_undoing="Anuloŭvajecca apošniaja aperacyja ..."
  4882. prefs="CheckGmail - nałady"
  4883. prefs_check="Pravierka pošty"
  4884. prefs_check_24_hour="24-hadzinny hadzińnik"
  4885. prefs_check_archive="Aarchivizujučy paznač taksama jak pračytanaje"
  4886. prefs_check_atom="Adras "
  4887. prefs_check_delay="Praviaraj poštu kožnyja "
  4888. prefs_check_delay2=" sekund"
  4889. prefs_check_labels="Pravier taksama etykety:"
  4890. prefs_check_labels_add="Dadaj etykietu"
  4891. prefs_check_labels_delay="Pravier kožnyja: (sekund)"
  4892. prefs_check_labels_label="Etykieta"
  4893. prefs_check_labels_new="[novaja etykieta]"
  4894. prefs_check_labels_remove="Vydal etykietu"
  4895. prefs_external="Unutranyja zahady"
  4896. prefs_external_browser="Zahad kab vykanać paśla kliku ŭ ikonu"
  4897. prefs_external_browser2="(u miescy %u budzie ŭstaŭleny adras Gmail)"
  4898. prefs_external_mail_command="Zahad kab vykanać kali pryjdzie novy list:"
  4899. prefs_external_nomail_command="Zahad kab vykanać kali niama novych listoŭ:"
  4900. prefs_lang="Mova"
  4901. prefs_login="Infarmacyja pra kont"
  4902. prefs_login_pass="_Parol"
  4903. prefs_login_save="Zapišy parol"
  4904. prefs_login_save_kwallet="u hametcy KDE"
  4905. prefs_login_save_plain="jak zvyčajny tekst"
  4906. prefs_login_user="_Karystalnik"
  4907. prefs_tray="Ikona"
  4908. prefs_tray_bg="Fon pad ikonaj ..."
  4909. prefs_tray_error_icon="Ułasnaja ikona pamyłki"
  4910. prefs_tray_mail_icon="Ułasnaja ikona novaj pošty"
  4911. prefs_tray_no_mail_icon="Ułasnaja ikona adsutnaści pošty"
  4912. prefs_tray_pdelay="Pakazvaj vypłyŭnoje vakno ciaham "
  4913. prefs_tray_pdelay2=" sekund" />
  4914. <Language name="日本語"
  4915. login_err="エラー: ユーザーネームまたはパスワードが違います"
  4916. login_title="Gmail にログインしています ..."
  4917. mail_archive="アーカイブ"
  4918. mail_archiving="アーカイブしています ..."
  4919. mail_delete="削除"
  4920. mail_deleting="削除しています ..."
  4921. mail_mark="既読にする"
  4922. mail_mark_all="すべて既読にする"
  4923. mail_marking="既読にしています ..."
  4924. mail_marking_all="すべてを既読にしています ..."
  4925. mail_open="開く"
  4926. mail_report_spam="迷惑メールを報告"
  4927. mail_reporting_spam="迷惑メールを報告しています ..."
  4928. menu_about="CheckGmail について"
  4929. menu_check="メールをチェック"
  4930. menu_compose="メールを作成"
  4931. menu_prefs="設定"
  4932. menu_undo="やり直し"
  4933. notify_and="と"
  4934. notify_check="Gmail をチェックしています ..."
  4935. notify_from="From:"
  4936. notify_login="Gmail にログインしています ..."
  4937. notify_multiple1="新着メール: "
  4938. notify_multiple2=" 通のメッセージ ..."
  4939. notify_new_mail="新着メール from "
  4940. notify_no_mail="新しいメールはありません"
  4941. notify_no_subject="(件名なし)"
  4942. notify_no_text="(テキストなし)"
  4943. notify_single1="新着メール: "
  4944. notify_single2=" 通のメッセージ ..."
  4945. notify_undoing="やり直しを行っています ..."
  4946. prefs="CheckGmail の設定"
  4947. prefs_check="メールのチェック"
  4948. prefs_check_24_hour="24 時間時計"
  4949. prefs_check_archive="既読もアーカイブに入れる"
  4950. prefs_check_atom="フィードのアドレス"
  4951. prefs_check_delay="受信トレイをチェックする周期: "
  4952. prefs_check_delay2=" 秒"
  4953. prefs_check_labels="以下のラベルもチェックします:"
  4954. prefs_check_labels_add="ラベルの追加"
  4955. prefs_check_labels_delay="チェックの周期 (秒)"
  4956. prefs_check_labels_label="ラベル"
  4957. prefs_check_labels_new="[新しいラベル]"
  4958. prefs_check_labels_remove="ラベルの削除"
  4959. prefs_external="外部コマンド"
  4960. prefs_external_browser="トレイのアイコンをクリック時に実行するコマンド"
  4961. prefs_external_browser2="(%u は Gmail のウェブアドレスを指します)"
  4962. prefs_external_mail_command="新着メールに対して実行するコマンド:"
  4963. prefs_external_nomail_command="新着メールがない場合に実行するコマンド:"
  4964. prefs_lang="言語"
  4965. prefs_login="ログインの詳細"
  4966. prefs_login_pass="パスワード"
  4967. prefs_login_save="パスワードを保存"
  4968. prefs_login_save_kwallet="KDE ウォレットに保存"
  4969. prefs_login_save_plain="プレインテキストとして保存"
  4970. prefs_login_user="ユーザーネーム"
  4971. prefs_tray="システムトレイ"
  4972. prefs_tray_bg="トレイの背景を設定 ..."
  4973. prefs_tray_error_icon="カスタムのエラー・アイコンを使用"
  4974. prefs_tray_mail_icon="カスタムのメール・アイコンを使用"
  4975. prefs_tray_no_mail_icon="カスタムのメールなし・アイコンを使用"
  4976. prefs_tray_pdelay="新着メール時のポップアップ表示時間: "
  4977. prefs_tray_pdelay2=" 秒" />
  4978. <Language name="简体中文"
  4979. login_err="错误: 错误的用户名或密码"
  4980. login_title="登录到Gmail ..."
  4981. mail_archive="归档"
  4982. mail_archiving="正在归档 ..."
  4983. mail_delete="删除"
  4984. mail_deleting="正在删除 ..."
  4985. mail_mark="标记邮件为已读"
  4986. mail_mark_all="标记邮件所有为已读"
  4987. mail_marking="正在标记邮件为已读 ..."
  4988. mail_marking_all="正在标记所有邮件为已读 ..."
  4989. mail_open="打开"
  4990. mail_report_spam="报告垃圾邮件"
  4991. mail_reporting_spam="正在报告垃圾邮件 ..."
  4992. menu_about="关于(_A)"
  4993. menu_check="立即检查邮件(_C)"
  4994. menu_compose="写邮件"
  4995. menu_prefs="首选项(_P)"
  4996. menu_undo="撤消前一操作(_U)"
  4997. notify_and="和"
  4998. notify_check="正在检查Gmail ..."
  4999. notify_from="From:"
  5000. notify_login="正在登录到Gmail ..."
  5001. notify_multiple1="您有 "
  5002. notify_multiple2=" 封新邮件 ..."
  5003. notify_new_mail="新邮件 "
  5004. notify_no_mail="没有新邮件"
  5005. notify_no_subject="(无标题)"
  5006. notify_no_text="(无正文)"
  5007. notify_single1="您有 "
  5008. notify_single2=" 新邮件 ..."
  5009. notify_undoing="正在撤销前一操作 ..."
  5010. prefs="CheckGmail首选项"
  5011. prefs_check="检查设置"
  5012. prefs_check_24_hour="时钟类型为24小时"
  5013. prefs_check_archive="归档并标记为已读"
  5014. prefs_check_atom="Feed地址"
  5015. prefs_check_delay="检查收件箱频率 "
  5016. prefs_check_delay2=" 秒"
  5017. prefs_check_labels="同时检查一下标签:"
  5018. prefs_check_labels_add="添加标签"
  5019. prefs_check_labels_delay="检查频率(秒)"
  5020. prefs_check_labels_label="标签"
  5021. prefs_check_labels_new="[新标签]"
  5022. prefs_check_labels_remove="删除标签"
  5023. prefs_external="扩展设置"
  5024. prefs_external_browser="点击通知栏图标启动程序"
  5025. prefs_external_browser2="(使用 %u 表示Gmail地址)"
  5026. prefs_external_mail_command="写邮件时启动程序:"
  5027. prefs_external_nomail_command="无邮件时启动程序:"
  5028. prefs_lang="界面语言"
  5029. prefs_login="登录设置"
  5030. prefs_login_pass="密码(_P)"
  5031. prefs_login_save="保存密码"
  5032. prefs_login_save_kwallet="到KDE钱包"
  5033. prefs_login_save_plain="不加密"
  5034. prefs_login_user="用户名(_U)"
  5035. prefs_tray="通知栏设置"
  5036. prefs_tray_bg="通知栏背景颜色 ..."
  5037. prefs_tray_error_icon="个性化错误图标"
  5038. prefs_tray_mail_icon="个性化邮件图标"
  5039. prefs_tray_no_mail_icon="个性化无邮件图标"
  5040. prefs_tray_pdelay="通知显示延迟 "
  5041. prefs_tray_pdelay2=" 秒" />
  5042. </opt>
  5043.  
  5044. EOF
  5045. my $def_xml = XMLin($default_translations, ForceArray => 1);
  5046.  
  5047. unless (-e "$prefs_dir/lang.xml") {
  5048. print "Creating translations file at $prefs_dir/lang.xml ...\n";
  5049. # If there isn't a translation file, we create a default one
  5050. $translations = $default_translations;
  5051. open(LANG, ">$prefs_dir/lang.xml") || die("Could not open lang.xml file for writing: $!");
  5052. print LANG $translations;
  5053. close LANG;
  5054. } else {
  5055. # read translations file if it exists
  5056. open(LANG, "<$prefs_dir/lang.xml") || die("Could not open lang.xml file for reading: $!");
  5057. $translations = join("",<LANG>);
  5058. close LANG;
  5059. }
  5060.  
  5061. my $xmlin = XMLin($translations, ForceArray => 1);
  5062.  
  5063. my $user_trans_v = $xmlin->{Version};
  5064.  
  5065. my $trans_mod;
  5066. foreach my $lang (keys(%{$def_xml->{Language}})) {
  5067. # print "checking $lang\n";
  5068.  
  5069. # Check that all translation keys exist, and add in those that don't from defaults ...
  5070. if ($def_xml->{Language}->{$lang}) {
  5071. # user language exists in defaults
  5072. # next if $lang eq 'English';
  5073. foreach (keys(%{$def_xml->{Language}->{English}})) {
  5074.  
  5075. if ($lang eq 'English') {
  5076. next if ($xmlin->{Language}->{$lang}->{$_} && ($xmlin->{Language}->{$lang}->{$_} eq $def_xml->{Language}->{$lang}->{$_}));
  5077. $xmlin->{Language}->{$lang}->{$_} = $def_xml->{Language}->{$lang}->{$_};
  5078. } elsif ($def_xml->{Language}->{$lang}->{$_}) {
  5079. # Don't overwrite if the key exists in the user trans file and the version is current
  5080. next if ($xmlin->{Language}->{$lang}->{$_} && $user_trans_v eq $version);
  5081. # Don't overwrite if the key is the same
  5082. next if ($xmlin->{Language}->{$lang}->{$_} && ($xmlin->{Language}->{$lang}->{$_} eq $def_xml->{Language}->{$lang}->{$_}));
  5083. # Don't overwrite if the key exists in the user trans and the key in the default trans is the same as the English one
  5084. next if ($xmlin->{Language}->{$lang}->{$_} && ($def_xml->{Language}->{$lang}->{$_} eq $def_xml->{Language}->{English}->{$_}));
  5085. $xmlin->{Language}->{$lang}->{$_} = $def_xml->{Language}->{$lang}->{$_};
  5086. } else {
  5087. next if $xmlin->{Language}->{$lang}->{$_};
  5088. $xmlin->{Language}->{$lang}->{$_} = $def_xml->{Language}->{English}->{$_};
  5089. }
  5090. print "[$lang] updating key $_ ...\n" unless $silent;
  5091. $trans_mod = 1;
  5092. }
  5093. } else {
  5094. # user language does not exist - use English
  5095. foreach (keys(%{$def_xml->{Language}->{English}})) {
  5096. next if $xmlin->{Language}->{$lang}->{$_};
  5097. $xmlin->{Language}->{$lang}->{$_} = $def_xml->{Language}->{English}->{$_};
  5098. $trans_mod = 1;
  5099. }
  5100. }
  5101. }
  5102.  
  5103. foreach (keys(%{$def_xml->{Language}})) {
  5104. # Check that all translation languages are present, and add in those that don't from defaults ...
  5105. my $lang = $_;
  5106. unless ($xmlin->{Language}->{$lang}) {
  5107. $xmlin->{Language}->{$lang} = $def_xml->{Language}->{$lang};
  5108. $trans_mod = 1;
  5109. }
  5110. }
  5111.  
  5112.  
  5113. if ($trans_mod) {
  5114. $xmlin->{Version} = $version;
  5115. $translations = XMLout($xmlin, AttrIndent=>1);
  5116. print "Updating translations file ...\n";
  5117. open(LANG, ">$prefs_dir/lang.xml") || die("Could not open lang.xml file for writing: $!");
  5118. print LANG $translations;
  5119. close LANG;
  5120. print " ... done!\n";
  5121. }
  5122.  
  5123. set_language();
  5124. }
  5125.  
  5126. sub set_language {
  5127. my $xmlin = XMLin($translations, ForceArray => 1);
  5128.  
  5129. ## For debugging ...
  5130. # use Data::Dumper;
  5131. # print Dumper $xmlin;
  5132.  
  5133. %trans = %{$xmlin->{Language}->{$language}};
  5134. }
Add Comment
Please, Sign In to add comment