Reworked AboutDialog.
authordruid23 <usr@dru-id.co.uk>
Sun, 3 Oct 2010 17:32:20 +0000 (18:32 +0100)
committerdruid23 <usr@dru-id.co.uk>
Sun, 3 Oct 2010 17:32:20 +0000 (18:32 +0100)
modified:   ../build.sh
modified:   AboutDialog.vala

build.sh
src/AboutDialog.vala

index 6c5e591..dd45d50 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -9,6 +9,7 @@ fi
 --pkg gstreamer-0.10 \
 --pkg libxml-2.0 \
 --pkg libosso \
 --pkg gstreamer-0.10 \
 --pkg libxml-2.0 \
 --pkg libosso \
+--pkg dbus-glib-1 \
 -o bin/demorecorder \
 src/Program.vala \
 src/DemoRecorder.vala \
 -o bin/demorecorder \
 src/Program.vala \
 src/DemoRecorder.vala \
index 35bab94..0721e43 100644 (file)
@@ -20,7 +20,7 @@ namespace IdWorks {
 public class AboutDialog : Hildon.Dialog {
 
   public AboutDialog(Gtk.Widget parent) {
 public class AboutDialog : Hildon.Dialog {
 
   public AboutDialog(Gtk.Widget parent) {
-    this.set_title("Demo Recorder");
+    this.set_title("About Demo Recorder");
     this.set_parent(parent);
     this.set_default_response(Gtk.ResponseType.OK);
     construct_interface();
     this.set_parent(parent);
     this.set_default_response(Gtk.ResponseType.OK);
     construct_interface();
@@ -30,14 +30,51 @@ public class AboutDialog : Hildon.Dialog {
     this.add_button(Gtk.STOCK_OK, Gtk.ResponseType.OK);
     
     Gtk.VBox control_area = (Gtk.VBox)this.get_content_area();
     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\n\nhttp://demorecorder.garage.maemo.org/\n\nThis 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";
-    Gtk.Label aboutText = new Gtk.Label(text);
-    aboutText.set_line_wrap(true);
+    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);
     
     
-    control_area.pack_start(aboutText, true, true, 4);
+    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();
   }
     
     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;
+  }
 
 }
 
 
 }