[banshee] [OpenLocationDialog] drop glade dep (bgo#589705)
- From: Aaron Bockover <abock src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [banshee] [OpenLocationDialog] drop glade dep (bgo#589705)
- Date: Sat, 6 Feb 2010 19:58:19 +0000 (UTC)
commit a10c09c80d2db3bf9cbba6400fb936d7b5ea4601
Author: Aaron Bockover <abockover novell com>
Date: Sat Feb 6 14:57:43 2010 -0500
[OpenLocationDialog] drop glade dep (bgo#589705)
.../Banshee.Gui.Dialogs/OpenLocationDialog.cs | 41 +++++++++++---------
1 files changed, 23 insertions(+), 18 deletions(-)
---
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui.Dialogs/OpenLocationDialog.cs b/src/Core/Banshee.ThickClient/Banshee.Gui.Dialogs/OpenLocationDialog.cs
index b7cdba9..b808ee5 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui.Dialogs/OpenLocationDialog.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui.Dialogs/OpenLocationDialog.cs
@@ -4,7 +4,7 @@
// Author:
// Aaron Bockover <abockover novell com>
//
-// Copyright (C) 2006-2007 Novell, Inc.
+// Copyright 2006-2010 Novell, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
@@ -30,48 +30,53 @@ using System;
using System.Collections.Generic;
using Mono.Unix;
using Gtk;
-using Glade;
using Banshee.Base;
using Banshee.Configuration;
namespace Banshee.Gui.Dialogs
{
- public class OpenLocationDialog : GladeDialog
+ public class OpenLocationDialog : BansheeDialog
{
- [Widget] private HBox location_box;
private ComboBoxEntry address_entry;
- private Button browse_button;
private List<string> history = new List<string>();
- public OpenLocationDialog() : base("OpenLocationDialog")
+ public OpenLocationDialog () : base (Catalog.GetString ("Open Location"))
{
+ var location_box = new HBox () {
+ Spacing = 6
+ };
+
address_entry = ComboBoxEntry.NewText();
- address_entry.Show();
- address_entry.Entry.Activated += OnEntryActivated;
+ address_entry.Entry.Activated += (o, e) => Respond (ResponseType.Ok);
- browse_button = new Button(Catalog.GetString("Browse..."));
+ var browse_button = new Button(Catalog.GetString("Browse..."));
browse_button.Clicked += OnBrowseClicked;
- browse_button.Show();
location_box.PackStart(address_entry, true, true, 0);
location_box.PackStart(browse_button, false, false, 0);
- Dialog.Response += OnResponse;
+ VBox.Spacing = 6;
+ VBox.PackStart (new Label () {
+ Xalign = 0.0f,
+ Text = Catalog.GetString (
+ "Enter the address of the file you would like to open:")
+ }, false, false, 0);
+ VBox.PackStart (location_box, false, false, 0);
+ VBox.ShowAll ();
+
+ AddStockButton (Stock.Cancel, ResponseType.Cancel);
+ AddStockButton (Stock.Open, ResponseType.Ok, true);
+
LoadHistory();
address_entry.Entry.HasFocus = true;
}
- private void OnEntryActivated(object o, EventArgs args)
- {
- Dialog.Respond(ResponseType.Ok);
- }
-
- private void OnResponse(object o, ResponseArgs args)
+ protected override void OnResponse (ResponseType responseId)
{
- if(args.ResponseId != ResponseType.Ok) {
+ if (responseId != ResponseType.Ok) {
return;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]