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