~teejee2008/timeshift/trunk

« back to all changes in this revision

Viewing changes to src/Utility/Gtk/DonationWindow.vala

  • Committer: Tony George
  • Date: 2016-10-29 11:17:41 UTC
  • Revision ID: tony.george.kol@gmail.com-20161029111741-u2kir9dawb1pz176
Moved console and Gtk code to separate utilities: timeshift and timeshift-gtk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * DonationWindow.vala
 
3
 *
 
4
 * Copyright 2016 Tony George <teejeetech@gmail.com>
 
5
 *
 
6
 * This program is free software; you can redistribute it and/or modify
 
7
 * it under the terms of the GNU General Public License as published by
 
8
 * the Free Software Foundation; either version 2 of the License, or
 
9
 * (at your option) any later version.
 
10
 *
 
11
 * This program is distributed in the hope that it will be useful,
 
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
14
 * GNU General Public License for more details.
 
15
 *
 
16
 * You should have received a copy of the GNU General Public License
 
17
 * along with this program; if not, write to the Free Software
 
18
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
 
19
 * MA 02110-1301, USA.
 
20
 *
 
21
 *
 
22
 */
 
23
 
 
24
using Gtk;
 
25
 
 
26
using TeeJee.Logging;
 
27
using TeeJee.FileSystem;
 
28
using TeeJee.JsonHelper;
 
29
using TeeJee.ProcessHelper;
 
30
using TeeJee.GtkHelper;
 
31
using TeeJee.System;
 
32
using TeeJee.Misc;
 
33
 
 
34
public class DonationWindow : Dialog {
 
35
        public DonationWindow() {
 
36
                set_title(_("Donate"));
 
37
                window_position = WindowPosition.CENTER_ON_PARENT;
 
38
                set_destroy_with_parent (true);
 
39
                set_modal (true);
 
40
                set_deletable(true);
 
41
                set_skip_taskbar_hint(false);
 
42
                set_default_size (400, 20);
 
43
                icon = get_app_icon(16);
 
44
 
 
45
                //vbox_main
 
46
                Box vbox_main = get_content_area();
 
47
                vbox_main.margin = 6;
 
48
                vbox_main.homogeneous = false;
 
49
 
 
50
                get_action_area().visible = false;
 
51
 
 
52
                //lbl_message
 
53
                Label lbl_message = new Gtk.Label("");
 
54
                string msg = _("Did you find this software useful?\n\nYou can buy me a coffee or make a donation via PayPal to show your support. Or just drop me an email and say Hi. This application is completely free and will continue to remain that way. Your contributions will help in keeping this project alive and improving it further.\n\nFeel free to send me an email if you find any issues in this application or if you need any changes. Suggestions and feedback are always welcome.\n\nThanks,\nTony George\n(teejeetech@gmail.com)");
 
55
                lbl_message.label = msg;
 
56
                lbl_message.wrap = true;
 
57
                vbox_main.pack_start(lbl_message,true,true,0);
 
58
 
 
59
                //vbox_actions
 
60
                Box vbox_actions = new Box (Orientation.VERTICAL, 6);
 
61
                vbox_actions.margin_left = 50;
 
62
                vbox_actions.margin_right = 50;
 
63
                vbox_actions.margin_top = 20;
 
64
                vbox_main.pack_start(vbox_actions,false,false,0);
 
65
 
 
66
                //btn_donate_paypal
 
67
                Button btn_donate_paypal = new Button.with_label("   " + _("Donate with PayPal") + "   ");
 
68
                vbox_actions.add(btn_donate_paypal);
 
69
                btn_donate_paypal.clicked.connect(()=>{
 
70
                        xdg_open("https://www.paypal.com/cgi-bin/webscr?business=teejeetech@gmail.com&cmd=_xclick&currency_code=USD&amount=10&item_name=Timeshift%20Donation");
 
71
                });
 
72
 
 
73
                //btn_donate_wallet
 
74
                Button btn_donate_wallet = new Button.with_label("   " + _("Donate with Google Wallet") + "   ");
 
75
                vbox_actions.add(btn_donate_wallet);
 
76
                btn_donate_wallet.clicked.connect(()=>{
 
77
                        xdg_open("https://support.google.com/mail/answer/3141103?hl=en");
 
78
                });
 
79
                
 
80
                //btn_send_email
 
81
                Button btn_send_email = new Button.with_label("   " + _("Send Email") + "   ");
 
82
                vbox_actions.add(btn_send_email);
 
83
                btn_send_email.clicked.connect(()=>{
 
84
                        xdg_open("mailto:teejeetech@gmail.com");
 
85
                });
 
86
 
 
87
                //btn_visit
 
88
                Button btn_visit = new Button.with_label("   " + _("Visit Website") + "   ");
 
89
                vbox_actions.add(btn_visit);
 
90
                btn_visit.clicked.connect(()=>{
 
91
                        xdg_open("http://www.teejeetech.in");
 
92
                });
 
93
 
 
94
                //btn_exit
 
95
                Button btn_exit = new Button.with_label("   " + _("OK") + "   ");
 
96
                vbox_actions.add(btn_exit);
 
97
                btn_exit.clicked.connect(() => {
 
98
                        this.destroy();
 
99
                });
 
100
        }
 
101
}