[Banshee-List] Browser for Banshee Lovers..



Title: Browser for Banshee Lovers..

Hi Everyone.

Attached is the browser and the querybuilder patch and additional files to maximize your banshee experience. ;) (as promised to slomo)
The tar.gz also includes a patch for src/Makefile.am for the lazy ones like myself.
Ctrl+F5 is the default hotkey for the browser notebook. But this is due to immediate change as i naturally leave the decision to Aaron.

i hope this one gets committed for the next release.
Tried to test the browser as much as possible. Please report issues immediately,

Aahh, the patch is diffed against 0.9.12. Have fun!

Best
Aydemir Ulaş Şahin


P.S..
Aaron, may i ask you to revert my name on credits as seen like above. :) Sorry for any inconvenience..

Index: src/LibraryTransactions.cs
===================================================================
RCS file: /cvs/gnome/banshee/src/LibraryTransactions.cs,v
retrieving revision 1.29
diff -r1.29 LibraryTransactions.cs
768a769,828
>     
>     public class SqlQueryTransaction : LibraryTransaction
>  	{
>  		private string sql;
>  		public event HaveTrackInfoHandler HaveTrackInfo;
>  		
>  		public override string Name {
>  			get {
>  				return Catalog.GetString("Library Track Loader");
>  			}
>  		}
>  		
>  		public SqlQueryTransaction(string sql)
>  		{
>  		    showStatus = false;
>  			this.sql = sql;
>  		}
>  		
>  		public SqlQueryTransaction(Statement sql) : this(sql.ToString())
>  		{
>  		
>  		}
>  		
>  		public override void Run()
>  		{
>  			statusMessage = Catalog.GetString("Processing");
>  			FilterSql();
>  		}
>  		
>  		private void RaiseTrackInfo(TrackInfo ti)
>  		{
>  			statusMessage = String.Format(
>  				Catalog.GetString("Loading {0} - {1} ..."),
>  				ti.Artist, ti.Title);
>  			currentCount++;
>  			
>  			HaveTrackInfoHandler handler = HaveTrackInfo;
>  			if(handler != null) {
>  				HaveTrackInfoArgs args = new HaveTrackInfoArgs();
>  				args.TrackInfo = ti;
>  				handler(this, args);
>  			}
>  		}
>  		
>  		
>  		private void FilterSql()
>  		{
>  			IDataReader reader = Core.Library.Db.Query(sql);
>  			while(reader.Read() && !cancelRequested) {
>  				DateTime startStamp = DateTime.Now;
>                 int tid = Convert.ToInt32(reader[0]);
>                 TrackInfo ti = Core.Library.Tracks[tid] as TrackInfo;
>                 
>                 if(ti != null) {
>                     RaiseTrackInfo(ti);
>                     UpdateAverageDuration(startStamp);
>                 }
>  			}
>  		}
>  	}	
Index: src/PlayerInterface.cs
===================================================================
RCS file: /cvs/gnome/banshee/src/PlayerInterface.cs,v
retrieving revision 1.100
diff -r1.100 PlayerInterface.cs
62a63,65
>         [Widget] private Expander CustomExpander;
>         [Widget] private Gtk.VBox DisclosureBox;
>         
92a96,97
>         
>         private BrowserNoteBook browser_notebook;
374c379,388
<                 
---
>             
>             // Custom Expander and browser related stuff.
>             CustomExpander = ((Expander)gxml["CustomExpander"]);
>             DisclosureBox = ((VBox)gxml["DisclosureBox"]);
>             CustomExpander.Activated += OnExpandAreaClicked;
>             browser_notebook = new BrowserNoteBook();
>             browser_notebook.QueryTransactionComplete += OnQueryTransactionComplete;
>             DisclosureBox.Add(browser_notebook);
> 
>                     
515a530,534
>         private void OnQueryTransactionComplete(object o, QueryTransactionEventArgs args)
>         {
>           	playlistModel.LoadFromQuery(args.query);
>         }
>         
738a758,768
>                 case Gdk.Key.F5:
>                     if((args.Event.State & Gdk.ModifierType.ControlMask) != 0) {
>                         if (CustomExpander.Expanded) {
>                         	CustomExpander.Expanded = false;
>                         } else {
>                         	CustomExpander.Expanded = true;
>                         }
>                         OnExpandAreaClicked(this, new EventArgs());
>                         handled = true;
>                     } 
>                     break;
2453a2484,2495
>         
>         private void OnExpandAreaClicked (object sender, EventArgs args)
> 		{
> 			if (CustomExpander.Expanded)
> 			{
> 				DisclosureBox.Visible = true;
> 			}
> 			else
> 			{
> 				DisclosureBox.Visible = false;
> 			}	
> 		}
Index: src/PlaylistModel.cs
===================================================================
RCS file: /cvs/gnome/banshee/src/PlaylistModel.cs,v
retrieving revision 1.20
diff -r1.20 PlaylistModel.cs
62a63
>         
168a170,177
>         public void LoadFromQuery(Statement query)
>         {
>             ClearModel();
>             SqlQueryTransaction loader = new SqlQueryTransaction(query);
>             loader.HaveTrackInfo += OnLoaderHaveTrackInfo;
>             Core.Library.TransactionManager.Register(loader);
>         }
>         
176c185
<         
---
>           
Index: src/QueryBuilderModel.cs
===================================================================
RCS file: /cvs/gnome/banshee/src/QueryBuilderModel.cs,v
retrieving revision 1.4
diff -r1.4 QueryBuilderModel.cs
33d32
< using Sql;
34a34
> using Sql;
37a38
> 
130a132
> 					QueryFilterOperation.Contains,
133d134
< 					QueryFilterOperation.Contains,
277c278,293
< 	
---
> 		
> 		private string built_query;
>  		public event EventHandler SearchButtonClicked;
> 		
> 		
> 		public string Query
> 		{
>             get {
>                 return built_query;
>             	}
>              
>             set {
>                  built_query = value;
>              	}
> 		}
> 		
302a319,339
> 		public SqlBuilderUI(VBox parentVBox)
>  		{	
>  			VBox box = new VBox();
>  			box.Show();
>  			parentVBox.Add(box);
>  			box.Spacing = 10;
>  			
>  			model = new TracksQueryModel();
>  			builder = new QueryBuilder(model);
>  			builder.Show();
>  			builder.Spacing = 4;
>  			
>  			box.PackStart(builder, true, true, 0);
>  			
>  			Button btn = new Button("Search");
>  			btn.Show();
>  			box.PackStart(btn, false, false, 0);
>  			btn.Clicked += OnButtonClicked;
>  	
>  		}
> 		
314,315c351,356
< 			
< 			Console.WriteLine(query);
---
> 				
> 			built_query = query;
> 
> 			EventHandler handler = SearchButtonClicked;
> 			if(handler != null)
> 				handler(this, new EventArgs());
Index: data/glade/player.glade
===================================================================
RCS file: /cvs/gnome/banshee/data/glade/player.glade,v
retrieving revision 1.33
diff -r1.33 player.glade
957c957
< 			<widget class="GtkHBox" id="PlaylistHeaderBox">
---
> 			<widget class="GtkVBox" id="HeaderVBox">
960c960
< 			  <property name="spacing">5</property>
---
> 			  <property name="spacing">0</property>
963c963
< 			    <widget class="GtkLabel" id="ViewNameLabel">
---
> 			    <widget class="GtkHBox" id="HeaderHBox">
965,978c965,1045
< 			      <property name="label" translatable="yes">&lt;b&gt;Playlist&lt;/b&gt;</property>
< 			      <property name="use_underline">False</property>
< 			      <property name="use_markup">True</property>
< 			      <property name="justify">GTK_JUSTIFY_LEFT</property>
< 			      <property name="wrap">False</property>
< 			      <property name="selectable">False</property>
< 			      <property name="xalign">0</property>
< 			      <property name="yalign">0.5</property>
< 			      <property name="xpad">0</property>
< 			      <property name="ypad">0</property>
< 			      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
< 			      <property name="width_chars">-1</property>
< 			      <property name="single_line_mode">False</property>
< 			      <property name="angle">0</property>
---
> 			      <property name="homogeneous">False</property>
> 			      <property name="spacing">0</property>
> 
> 			      <child>
> 				<widget class="GtkExpander" id="CustomExpander">
> 				  <property name="visible">True</property>
> 				  <property name="can_focus">True</property>
> 				  <property name="expanded">False</property>
> 				  <property name="spacing">0</property>
> 
> 				  <child>
> 				    <placeholder/>
> 				  </child>
> 
> 				  <child>
> 				    <widget class="GtkLabel" id="ViewNameLabel">
> 				      <property name="visible">True</property>
> 				      <property name="label" translatable="yes">&lt;b&gt;Library&lt;/b&gt;</property>
> 				      <property name="use_underline">False</property>
> 				      <property name="use_markup">True</property>
> 				      <property name="justify">GTK_JUSTIFY_LEFT</property>
> 				      <property name="wrap">False</property>
> 				      <property name="selectable">False</property>
> 				      <property name="xalign">0.5</property>
> 				      <property name="yalign">0.5</property>
> 				      <property name="xpad">0</property>
> 				      <property name="ypad">0</property>
> 				      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
> 				      <property name="width_chars">-1</property>
> 				      <property name="single_line_mode">False</property>
> 				      <property name="angle">0</property>
> 				    </widget>
> 				    <packing>
> 				      <property name="type">label_item</property>
> 				    </packing>
> 				  </child>
> 				</widget>
> 				<packing>
> 				  <property name="padding">0</property>
> 				  <property name="expand">True</property>
> 				  <property name="fill">True</property>
> 				</packing>
> 			      </child>
> 
> 			      <child>
> 				<widget class="GtkHBox" id="PlaylistHeaderBox">
> 				  <property name="visible">True</property>
> 				  <property name="homogeneous">False</property>
> 				  <property name="spacing">0</property>
> 
> 				  <child>
> 				    <widget class="GtkLabel" id="SearchLabel">
> 				      <property name="visible">True</property>
> 				      <property name="label" translatable="yes">Search:</property>
> 				      <property name="use_underline">False</property>
> 				      <property name="use_markup">False</property>
> 				      <property name="justify">GTK_JUSTIFY_LEFT</property>
> 				      <property name="wrap">False</property>
> 				      <property name="selectable">False</property>
> 				      <property name="xalign">0.5</property>
> 				      <property name="yalign">0.5</property>
> 				      <property name="xpad">0</property>
> 				      <property name="ypad">0</property>
> 				      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
> 				      <property name="width_chars">-1</property>
> 				      <property name="single_line_mode">False</property>
> 				      <property name="angle">0</property>
> 				    </widget>
> 				    <packing>
> 				      <property name="padding">0</property>
> 				      <property name="expand">False</property>
> 				      <property name="fill">False</property>
> 				    </packing>
> 				  </child>
> 				</widget>
> 				<packing>
> 				  <property name="padding">0</property>
> 				  <property name="expand">False</property>
> 				  <property name="fill">False</property>
> 				</packing>
> 			      </child>
986,1010d1052
< 
< 			  <child>
< 			    <widget class="GtkLabel" id="SearchLabel">
< 			      <property name="visible">True</property>
< 			      <property name="label" translatable="yes">Search:</property>
< 			      <property name="use_underline">False</property>
< 			      <property name="use_markup">False</property>
< 			      <property name="justify">GTK_JUSTIFY_LEFT</property>
< 			      <property name="wrap">False</property>
< 			      <property name="selectable">False</property>
< 			      <property name="xalign">0.5</property>
< 			      <property name="yalign">0.5</property>
< 			      <property name="xpad">0</property>
< 			      <property name="ypad">0</property>
< 			      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
< 			      <property name="width_chars">-1</property>
< 			      <property name="single_line_mode">False</property>
< 			      <property name="angle">0</property>
< 			    </widget>
< 			    <packing>
< 			      <property name="padding">0</property>
< 			      <property name="expand">False</property>
< 			      <property name="fill">False</property>
< 			    </packing>
< 			  </child>
1020c1062
< 			<widget class="GtkAlignment" id="LibraryAlignment">
---
> 			<widget class="GtkVPaned" id="VPane">
1022,1029c1064,1065
< 			  <property name="xalign">0.5</property>
< 			  <property name="yalign">0.5</property>
< 			  <property name="xscale">1</property>
< 			  <property name="yscale">1</property>
< 			  <property name="top_padding">0</property>
< 			  <property name="bottom_padding">0</property>
< 			  <property name="left_padding">0</property>
< 			  <property name="right_padding">0</property>
---
> 			  <property name="can_focus">True</property>
> 			  <property name="position">200</property>
1032,1038c1068,1070
< 			    <widget class="GtkScrolledWindow" id="LibraryContainer">
< 			      <property name="visible">True</property>
< 			      <property name="can_focus">True</property>
< 			      <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
< 			      <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
< 			      <property name="shadow_type">GTK_SHADOW_IN</property>
< 			      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
---
> 			    <widget class="GtkVBox" id="DisclosureBox">
> 			      <property name="homogeneous">False</property>
> 			      <property name="spacing">0</property>
1043a1076,1112
> 			    <packing>
> 			      <property name="shrink">False</property>
> 			      <property name="resize">False</property>
> 			    </packing>
> 			  </child>
> 
> 			  <child>
> 			    <widget class="GtkAlignment" id="LibraryAlignment">
> 			      <property name="visible">True</property>
> 			      <property name="xalign">0.5</property>
> 			      <property name="yalign">0.5</property>
> 			      <property name="xscale">1</property>
> 			      <property name="yscale">1</property>
> 			      <property name="top_padding">0</property>
> 			      <property name="bottom_padding">0</property>
> 			      <property name="left_padding">0</property>
> 			      <property name="right_padding">0</property>
> 
> 			      <child>
> 				<widget class="GtkScrolledWindow" id="LibraryContainer">
> 				  <property name="visible">True</property>
> 				  <property name="can_focus">True</property>
> 				  <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
> 				  <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
> 				  <property name="shadow_type">GTK_SHADOW_IN</property>
> 				  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
> 
> 				  <child>
> 				    <placeholder/>
> 				  </child>
> 				</widget>
> 			      </child>
> 			    </widget>
> 			    <packing>
> 			      <property name="shrink">True</property>
> 			      <property name="resize">True</property>
> 			    </packing>

Attachment: browser_files.tar.gz
Description: browser_files.tar.gz

Attachment: ChangeLogAdditions
Description: ChangeLogAdditions



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]