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. AuthDialog a;
  12.  
  13. public MainWindow () : base(Gtk.WindowType.Toplevel)
  14. {
  15.  
  16. Build ();
  17. GlobalConfig.authenticated = false;
  18.  
  19. // Inizializziamo la vista dei file.
  20. files = new Dizzy.FileTreeView (filelist);
  21. EventManager.RegisterFileTreeView (ref files);
  22.  
  23. // .. e anche quella dei download
  24. tasks = new Dizzy.TaskTreeView (tasklist);
  25. EventManager.RegisterTaskTreeView (ref tasks);
  26.  
  27.  
  28. // Carichiamo qualche impostazione di default
  29. string downloadpath = GlobalConfig.GetValue("download_folder");
  30. if (downloadpath != "")
  31. downloadpathchooser.SetFilename(downloadpath);
  32.  
  33.  
  34.  
  35. this.protocol = new Protocol ();
  36. this.protocol.AuthenticationRequired += this.Connect;
  37.  
  38. Log.StatusBarUpdate += this.OnStatusBarUpdate;
  39.  
  40. }
  41.  
  42. public void OnStatusBarUpdate (string message)
  43. {
  44. dizzystatus.Push(0, message);
  45. }
  46.  
  47.  
  48. protected void Connect ()
  49. {
  50. if (this.a != null)
  51. return;
  52. this.a = new AuthDialog ();
  53. a.Run ();
  54. a.Destroy ();
  55. a = null;
  56.  
  57. }
  58.  
  59.  
  60. protected void OnDeleteEvent (object sender, DeleteEventArgs a)
  61. {
  62. if (protocol != null)
  63. {
  64. Log.Info ("Calling Protocol.Disconnect ()");
  65. protocol.Disconnect ();
  66. }
  67.  
  68. Application.Quit ();
  69.  
  70. // Questo è molto grezzo ma è effettivamente l'unico metodo per uscire
  71. // per il momento.
  72. this.Destroy ();
  73. a.RetVal = true;
  74. }
  75.  
  76. protected virtual void OnSearchRequested (object sender, System.EventArgs e)
  77. {
  78. Search ();
  79. }
  80.  
  81. protected void Search ()
  82. {
  83. this.files.Clear ();
  84. this.protocol.Search (searchBox.Text, searchUserBox.Text, typeBox.ActiveText);
  85. }
  86.  
  87. protected virtual void OnRowActivated (object o, Gtk.RowActivatedArgs args)
  88. {
  89.  
  90. File f = this.files.GetFileFromPath (args.Path);
  91.  
  92. string download_folder = this.downloadpathchooser.Filename;
  93.  
  94. this.protocol.Download(f, download_folder);
  95.  
  96. }
  97.  
  98. protected virtual void OnDownloadPathSelectionChanged (object sender, System.EventArgs e)
  99. {
  100. GlobalConfig.InsertValue("download_folder", downloadpathchooser.Filename);
  101. }
  102.  
  103. protected virtual void OnListUpdateRequired (object sender, System.EventArgs e)
  104. {
  105. this.protocol.UpdateFileList ();
  106. }
  107.  
  108. protected virtual void OnDisconnectionRequested (object sender, System.EventArgs e)
  109. {
  110. GlobalConfig.authenticated = false;
  111. }
  112.  
  113. protected virtual void OnUploadRequested (object sender, System.EventArgs e)
  114. {
  115. // Come prima cosa otteniamo il file che il povero utente desidera
  116. // caricare sul server.
  117.  
  118. this.protocol.Upload(uploadChooserButton.Filename);
  119.  
  120. }
  121.  
  122.  
  123. protected virtual void OnTasklistCursorChanged (object sender, System.EventArgs e)
  124. {
  125. if (tasklist.Selection != null)
  126. blockTransfer.Sensitive = true;
  127. else
  128. blockTransfer.Sensitive = false;
  129. }
  130.  
  131. protected virtual void OnBlockTransferClicked (object sender, System.EventArgs e)
  132. {
  133. // Dobbiamo determinare che trasferimento bloccare
  134. TreePath path;
  135. path = tasks.GetActivePath ();
  136. string GUID = EventManager.GetGUID (path);
  137. this.protocol.DisconnectPath (GUID);
  138. }
  139.  
  140. protected virtual void OnSearchBoxActivated (object sender, System.EventArgs e)
  141. {
  142. Search ();
  143. }
  144.  
  145. protected virtual void OnSearchUserBoxActivated (object sender, System.EventArgs e)
  146. {
  147. Search ();
  148. }
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156. }