Reply to thread

I haven't seen anyone else using the IShowPlugin interface.


I added return values to the GetHome function and also return true now, but it is still showing up as a process plugin.  I looked in the GUIWindow.cs file and I didn't see a list of plugin IDs in the enumeration section.  There really wasn't a whole lot there.  Is it maybe in a different file?


Here's the whole code in case someone sees something I missed.


Jesse



[code]

#region Copyright (C) 2006 Team MediaPortal


/*

 *      Copyright (C) 2006 Team MediaPortal

 *      https://www.team-mediaportal.com

 *

 *  This Program is free software; you can redistribute it and/or modify

 *  it under the terms of the GNU General Public License as published by

 *  the Free Software Foundation; either version 2, or (at your option)

 *  any later version.

 *  

 *  This Program is distributed in the hope that it will be useful,

 *  but WITHOUT ANY WARRANTY; without even the implied warranty of

 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

 *  GNU General Public License for more details.

 *  

 *  You should have received a copy of the GNU General Public License

 *  along with GNU Make; see the file COPYING.  If not, write to

 *  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

 *  http://www.gnu.org/copyleft/gpl.html

 *

 */


#endregion


#region XMMImporter: Version History


/*

 *     XMM Importer

 *

 *     Plugin to allow converting Extreme Movie Manager (XMM) databases to

 *     MediaPortal.

 *

 * 060827 - JBL - 0.0.0.1

 * Started 060819.

 *

 * This is my first attempt at a C# program and plugin for MediaPortal.  This first

 * version of XMM Importer is capable of reading Extreme Movie Manager v5 database

 * files and converting the video data into a MediaPortal video database.

 *

 * Current Version Features:

 * + Configuration control through a MediaPortal plugin interface and a

 *   windows form.

 * + Capable of reading XMM v5 database files.

 * + Automatically copies cover files to specified MediaPortal thumbnail directory.

 *

 * Future Work:

 * + Auto detect MediaPortal directories and database files

 * + Save settings to XML or SQLite database to retain settings between uses.

 * + Allow for importing multiple databases by allowing multiple settings in configuration

 *   file

 * + Add more control over import information

 * + Relook over SQLite.NET and other MP database code to see if it would work better

 *   than the current method of working with SQLite databases

 * + Clean up and add more comments to code for next version

 *

 * Known Issues:

 * + The method of access the MP databases probably isn't optimal.  It is currently done

 *   using the alternative SQLite interface and a data reader has to be generated each

 *   time a query needs to be made.  It seems there should be a better way, but seems to

 *   work OK for now.

 * + There are no warnings before clearing the data in the video database.  The next

 *   version should include a warning and even backup the MP video database before working

 *   on it.

 * + Only tried on US English version of Windows.  May not be compatable with different

 *   character sets, but remains to be seen.

 *

 */

#endregion



using System;

using System.Collections.Generic;

using System.Text;

//using System.ComponentModel;

using System.Windows.Forms;

using MediaPortal.GUI.Library;



namespace GUIXMM

{

  /// <summary>

  /// CLASS: XMMImporterPlugin

  /// This is the main plugin interface to MediaPortal.

  /// </summary>

  public class XMMImporterPlugin : GUIWindow, ISetupForm

  {

    public XMMImporterPlugin()

    {

    }


    #region ISetupForm Members

   

    //Returns the name of the plugin which is shown in the plugin menu

    public string PluginName()

    {

      return "XMMImporter";

    }

    //Returns the description of the plugin is shown in the plugin menu

    public string Description()

    {

      return "Imports XMM Libraries into the MediaPortal database";

    }

    // Returns the author of the plugin which is shown in the plugin menu

    public string Author()

    {

      return "Hesse";

    }

    // Show the setup dialog

    public void ShowPlugin()

    {

      //MessageBox.Show("Nothing to do now");

      XMMImportForm myXMMImporterForm = new XMMImportForm();

      myXMMImporterForm.Show();

    }

    //Indicates whether plugin can be enabled/disabled

    public bool CanEnable()

    {

      return true;

    }

    // Indicates if a plugin is enabled by default

    public bool DefaultEnabled()

    {

      return false;

    }

    // get ID Of windowplugin belonging to this setup

    public int GetWindowId()

    {

      return 4444;

    }

    // Indicates if a plugin has its own setup screen

    public bool HasSetup()

    {

      return true;

    }


    /// <summary>

    /// If the plugin should have its own button on the main menu of Media Portal then it

    /// should return true to this method, otherwise if it should not be on home

    /// it should return false

    /// </summary>

    /// <param name="strButtonText">text the button should have</param>

    /// <param name="strButtonImage">image for the button, or empty for default</param>

    /// <param name="strButtonImageFocus">image for the button, or empty for default</param>

    /// <param name="strPictureImage">subpicture for the button or empty for none</param>

    /// <returns>true : plugin needs its own button on home

    ///          false : plugin does not need its own button on home</returns>


    public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage)

    {

      strButtonText = "XMMImporter";

      strButtonImage = "";

      strButtonImageFocus = "";

      strPictureImage = "";

      return true;

    }

    #endregion


  }

}

[/code]


Top Bottom