/* Demo Recorder for MAEMO 5 * Copyright (C) 2010 Dru Moore * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, * or (at your option) any later version, as published by the Free * Software Foundation * * 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. */ namespace IdWorks { public class AboutDialog : Hildon.Dialog { public AboutDialog(Gtk.Widget parent) { this.set_title("About Demo Recorder"); this.set_parent(parent); this.set_default_response(Gtk.ResponseType.OK); construct_interface(); } private void construct_interface() { this.add_button(Gtk.STOCK_OK, Gtk.ResponseType.OK); Gtk.VBox control_area = (Gtk.VBox)this.get_content_area(); string text = "Demo Recorder, (c)2010 Dru Moore usr@dru-id.co.uk"; string license = "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2, or (at your option) any later version, as published by the Free Software Foundation\n\nThis 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\n\nYou 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."; Gtk.Label about_text = new Gtk.Label(text); about_text.set_line_wrap(true); Gtk.Label license_text = new Gtk.Label(license); license_text.set_line_wrap(true); Hildon.Button site_link = new Hildon.Button(Hildon.SizeType.FINGER_HEIGHT | Hildon.SizeType.AUTO_WIDTH, Hildon.ButtonArrangement.HORIZONTAL); site_link.set_text("Project Homepage", ""); site_link.clicked.connect((e) => {open_url("http://demorecorder.garage.maemo.org/");}); Hildon.Button bug_link = new Hildon.Button(Hildon.SizeType.FINGER_HEIGHT | Hildon.SizeType.AUTO_WIDTH, Hildon.ButtonArrangement.HORIZONTAL); bug_link.set_text("Report a Bug", ""); bug_link.clicked.connect((e) => {open_url("https://garage.maemo.org/tracker/?group_id=1799");}); Gtk.VBox contents = new Gtk.VBox(false, 4); contents.pack_start(about_text, true, true, 4); Gtk.HBox button_bar = new Gtk.HBox(true, 4); button_bar.pack_start(site_link, true, true, 4); button_bar.pack_start(bug_link, true, true, 4); contents.pack_start(button_bar, true, true, 4); contents.pack_start(license_text, true, true, 4); Hildon.PannableArea container = new Hildon.PannableArea(); container.add_with_viewport(contents); container.set_size_request_policy(Hildon.SizeRequestPolicy.CHILDREN); control_area.pack_start(container, true, true, 4); this.show_all(); } private void open_homepage() { open_url("http://demorecorder.garage.maemo.org/"); } private void open_bugtrack() { open_url("https://garage.maemo.org/tracker/?group_id=1799"); } private void open_url(string url) { Osso.Context osso_context = new Osso.Context("DemoRecorder", "0.1", false, null); Osso.Rpc ret; osso_context.rpc_run("com.nokia.osso_browser", "/com/nokia/osso_browser", "com.nokia.osso_browser", "open_new_window", out ret, DBus.RawType.STRING, url); osso_context = null; } } }