viewgit/index.php:465 Only variables should be passed by reference [2048]

viewgit/index.php:466 Non-static method GeSHi::get_language_name_from_extension() should not be called statically [2048]

  1. using System;
  2. using Gtk;
  3. using Dizzy;
  4.  
  5. public partial class MainWindow : Gtk.Window
  6. {
  7.  
  8. Protocol protocol;
  9. FileTreeView files;
  10. TaskTreeView tasks;
  11. GlobalConfig config;
  12.  
  13. bool connected = false;
  14.  
  15. public MainWindow (ref GlobalConfig config) : base(Gtk.WindowType.Toplevel)
  16. {
  17.  
  18. Build ();
  19. this.config = config;
  20.  
  21. // Inizializziamo la vista dei file.
  22. files = new Dizzy.FileTreeView (filelist);
  23.  
  24. // .. e anche quella dei download
  25. tasks = new Dizzy.TaskTreeView (tasklist);
  26.  
  27. // Carichiamo qualche impostazione di default
  28. string downloadpath = config.GetValue("download_folder");
  29. if (downloadpath != "")
  30. downloadpathchooser.SetFilename(downloadpath);
  31.  
  32. this.Connect ();
  33. }
  34.  
  35. protected void Connect ()
  36. {
  37. AuthDialog a = new AuthDialog (ref this.config);
  38. this.connected = true;
  39. try {
  40. a.Run ();
  41. a.Destroy ();
  42. this.protocol = new Protocol (ref config);
  43. } catch (Exception ex) {
  44. this.connected = false;
  45. Gtk.MessageDialog d = new Gtk.MessageDialog(this,
  46. DialogFlags.Modal,
  47. MessageType.Error,
  48. ButtonsType.Ok,
  49. true,"");
  50. d.Markup = "Errore di autenticazione. Non è stato possibile connettersi" +
  51. "all'host <b>poisson.phc.unipi.it</b>.";
  52. d.Run ();
  53. d.Destroy ();
  54. }
  55. }
  56.  
  57.  
  58. protected void OnDeleteEvent (object sender, DeleteEventArgs a)
  59. {
  60. protocol.Disconnect ();
  61. Application.Quit ();
  62.  
  63. // Questo è molto grezzo ma è effettivamente l'unico metodo per uscire
  64. // per il momento.
  65. this.Destroy ();
  66. a.RetVal = true;
  67. }
  68.  
  69. protected virtual void OnSearchRequested (object sender, System.EventArgs e)
  70. {
  71. if(!connected) {this.Connect ();}
  72. if(connected)
  73. {
  74. this.files.SearchInProgress ();
  75. this.protocol.Search(searchBox.Text, ref this.files);
  76. }
  77. }
  78.  
  79. protected virtual void OnRowActivated (object o, Gtk.RowActivatedArgs args)
  80. {
  81. Console.WriteLine("row_activated called");
  82. File f = this.files.GetFileFromPath (args.Path);
  83. // this.tasks.AddTask (f.name, 24);
  84. string download_folder = this.downloadpathchooser.Filename;
  85.  
  86. if(!connected) {this.Connect ();}
  87. if(connected) {this.protocol.Download(f, ref tasks, download_folder);}
  88.  
  89. }
  90.  
  91. protected virtual void OnDownloadPathSelectionChanged (object sender, System.EventArgs e)
  92. {
  93. config.InsertValue("download_folder", downloadpathchooser.Filename);
  94. }
  95.  
  96.  
  97. }