From 712aa213de77e51cd9501273f147b0330ee0d49e Mon Sep 17 00:00:00 2001 From: Clement Lefebvre Date: Wed, 22 Jun 2022 13:00:22 +0200 Subject: [PATCH] Remove donation window --- src/Gtk/MainWindow.vala | 12 --- src/Utility/Gtk/DonationWindow.vala | 143 ---------------------------- 2 files changed, 155 deletions(-) delete mode 100755 src/Utility/Gtk/DonationWindow.vala diff --git a/src/Gtk/MainWindow.vala b/src/Gtk/MainWindow.vala index 860517b..9de389a 100644 --- a/src/Gtk/MainWindow.vala +++ b/src/Gtk/MainWindow.vala @@ -44,7 +44,6 @@ class MainWindow : Gtk.Window{ private Gtk.ToolButton btn_browse_snapshot; private Gtk.ToolButton btn_settings; private Gtk.ToolButton btn_wizard; - private Gtk.ToolButton btn_donate; private Gtk.Menu menu_extra; private SnapshotListBox snapshot_list_box; @@ -372,11 +371,6 @@ class MainWindow : Gtk.Window{ menu_item.activate.connect(btn_view_app_logs_clicked); } - // donate - menu_item = create_menu_item(_("Donate"), "", "", 16); - menu_extra.append(menu_item); - menu_item.activate.connect(btn_donate_clicked); - // about menu_item = create_menu_item(_("About"), "", "", 16); menu_extra.append(menu_item); @@ -911,12 +905,6 @@ class MainWindow : Gtk.Window{ exo_open_folder(App.log_dir); } - public void btn_donate_clicked(){ - - var dialog = new DonationWindow(this); - dialog.show_all(); - } - private void btn_about_clicked (){ var dialog = new AboutWindow(this); diff --git a/src/Utility/Gtk/DonationWindow.vala b/src/Utility/Gtk/DonationWindow.vala deleted file mode 100755 index 211e9db..0000000 --- a/src/Utility/Gtk/DonationWindow.vala +++ /dev/null @@ -1,143 +0,0 @@ -/* - * DonationWindow.vala - * - * Copyright 2012-18 Tony George - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, - * MA 02110-1301, USA. - * - * - */ - -using Gtk; - -using TeeJee.Logging; -using TeeJee.FileSystem; -using TeeJee.JsonHelper; -using TeeJee.ProcessHelper; -using TeeJee.System; -using TeeJee.Misc; -using TeeJee.GtkHelper; - -public class DonationWindow : Gtk.Window { - - private Gtk.Box vbox_main; - private string username = ""; - private string appname = "Timeshift"; - - public DonationWindow(Gtk.Window window) { - - set_title(_("Donate")); - - set_transient_for(window); - set_destroy_with_parent(true); - - window_position = WindowPosition.CENTER_ON_PARENT; - - set_modal(true); - set_resizable(false); - set_deletable(true); - - // vbox_main - vbox_main = new Gtk.Box(Orientation.VERTICAL, 12); - vbox_main.margin = 12; - - this.add(vbox_main); - - if (get_user_id_effective() == 0){ - username = get_username(); - } - - // ----------------------------- - - string msg = _("This software is free for personal and commercial use. It is distributed in the hope that it is useful but without any warranty or support. See the GNU General Public License v2 or later for more information"); - - add_label(msg); - - msg = _("If you find this software useful, you can buy me a coffee by making a donation with PayPal."); - - add_label(msg); - - var hbox = add_hbox(); - - add_button(hbox, _("Donate"), - "https://www.paypal.com/cgi-bin/webscr?business=teejeetech@gmail.com&cmd=_xclick¤cy_code=USD&item_name=%s+Donation".printf(appname)); - - // ----------------------------- - - msg = _("Use the GitHub issue tracker for reporting issues, or post your questions on the Linux Mint forums. Please avoid reporting issues by email."); - - add_label(msg); - - // close window --------------------------------------------------------- - - hbox = add_hbox(); - - add_button(hbox, _("GitHub"), "https://github.com/teejee2008/%s/issues".printf(appname.down())); - - add_button(hbox, _("Website"), "https://teejeetech.com/"); - - add_button(hbox, _("More Apps"), "https://teejeetech.com/shop/"); - - var button = new Gtk.Button.with_label(_("Close")); - hbox.add(button); - - button.clicked.connect(() => { - this.destroy(); - }); - - this.show_all(); - } - - private Gtk.Label add_label(string msg){ - - var label = new Gtk.Label(msg); - - label.set_use_markup(true); - - label.wrap = true; - label.wrap_mode = Pango.WrapMode.WORD; - label.max_width_chars = 50; - - label.xalign = 0.0f; - - vbox_main.add(label); - - return label; - } - - private Gtk.ButtonBox add_hbox(){ - - var hbox = new Gtk.ButtonBox(Orientation.HORIZONTAL); - hbox.set_layout(Gtk.ButtonBoxStyle.CENTER); - hbox.set_spacing(6); - vbox_main.add(hbox); - return hbox; - } - - private void add_button(Gtk.Box box, string text, string url){ - - var button = new Gtk.Button.with_label(text); - button.set_tooltip_text(url); - box.add(button); - - //button.set_size_request(200,-1); - - button.clicked.connect(() => { - xdg_open(url, username); - }); - } -} -