From: <hor...@us...> - 2011-11-29 10:23:19
|
Revision: 4354 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4354&view=rev Author: horned-reaper Date: 2011-11-29 10:23:07 +0000 (Tue, 29 Nov 2011) Log Message: ----------- Build 0.3.5 Added Paths: ----------- trunk/plugins/FritzBox/FritzBox/ trunk/plugins/FritzBox/FritzBox/FritzBox.cs trunk/plugins/FritzBox/FritzBox/FritzBox.csproj trunk/plugins/FritzBox/FritzBox/FritzBox.png trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.Designer.cs trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.cs trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.resx trunk/plugins/FritzBox/FritzBox/FritzBoxDisabled.png trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/ trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/CallAction.cs trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/Caller.cs trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/FritzBoxClient.cs trunk/plugins/FritzBox/FritzBox/FritzCallMonitor/PhoneBook.cs trunk/plugins/FritzBox/FritzBox/FritzManager/ trunk/plugins/FritzBox/FritzBox/FritzManager/BackGroundWorker.cs trunk/plugins/FritzBox/FritzBox/FritzManager/BlockingQueue.cs trunk/plugins/FritzBox/FritzBox/FritzManager/CallItem.cs trunk/plugins/FritzBox/FritzBox/FritzManager/Fritz.cs trunk/plugins/FritzBox/FritzBox/FritzManager/FritzboxPhonebook.cs trunk/plugins/FritzBox/FritzBox/FritzManager/GCollections.cs trunk/plugins/FritzBox/FritzBox/FritzManager/InversSearch.cs trunk/plugins/FritzBox/FritzBox/FritzManager/InversSearchOert.cs trunk/plugins/FritzBox/FritzBox/FritzManager/Logger.cs trunk/plugins/FritzBox/FritzBox/FritzManager/LoggerFactory.cs trunk/plugins/FritzBox/FritzBox/FritzManager/MyBinaryReader.cs trunk/plugins/FritzBox/FritzBox/FritzManager/PhonebookItem.cs trunk/plugins/FritzBox/FritzBox/FritzManager/Task.cs trunk/plugins/FritzBox/FritzBox/FritzManager/VoiceboxItem.cs trunk/plugins/FritzBox/FritzBox/LocalizeStrings.cs trunk/plugins/FritzBox/FritzBox/Properties/ trunk/plugins/FritzBox/FritzBox/Properties/AssemblyInfo.cs trunk/plugins/FritzBox/FritzBox/Properties/Resources.Designer.cs trunk/plugins/FritzBox/FritzBox/Properties/Resources.resx trunk/plugins/FritzBox/FritzBox/Resources/ trunk/plugins/FritzBox/FritzBox/Resources/fritzdial.sh trunk/plugins/FritzBox/FritzBox/Resources/gfx/ trunk/plugins/FritzBox/FritzBox/Resources/gfx/FritzBox.ico trunk/plugins/FritzBox/FritzBox/Resources/gfx/FritzBoxIconMadeByHarley.png trunk/plugins/FritzBox/FritzBox/Resources/speexdec.exe trunk/plugins/FritzBox/FritzBox/Settings.cs trunk/plugins/FritzBox/FritzBox/Skin/ trunk/plugins/FritzBox/FritzBox/Skin/Black & White/ trunk/plugins/FritzBox/FritzBox/Skin/Black & White/FritzManager.xml trunk/plugins/FritzBox/FritzBox/Skin/Black & White/Media/ trunk/plugins/FritzBox/FritzBox/Skin/Black & White/Media/hover_FritzBox.png trunk/plugins/FritzBox/FritzBox/Skin/Blue3/ trunk/plugins/FritzBox/FritzBox/Skin/Blue3/FritzManager.xml trunk/plugins/FritzBox/FritzBox/Skin/Blue3/Media/ trunk/plugins/FritzBox/FritzBox/Skin/Blue3/Media/hover_FritzBox.png trunk/plugins/FritzBox/FritzBox/docs/ trunk/plugins/FritzBox/FritzBox/docs/Changes.txt trunk/plugins/FritzBox/FritzBox/docs/Install.txt trunk/plugins/FritzBox/FritzBox/docs/todo.txt trunk/plugins/FritzBox/FritzBox.sln trunk/plugins/FritzBox/Tools/ trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/ trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/FritzBoxConfigTester.csproj trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/Program.cs trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/Properties/ trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/Properties/AssemblyInfo.cs trunk/plugins/FritzBox/Tools/FritzBoxConfigTester/app.config trunk/plugins/FritzBox/Tools/FritzBoxDebugger/ trunk/plugins/FritzBox/Tools/FritzBoxDebugger/DebugForm.Designer.cs trunk/plugins/FritzBox/Tools/FritzBoxDebugger/DebugForm.cs trunk/plugins/FritzBox/Tools/FritzBoxDebugger/DebugForm.resx trunk/plugins/FritzBox/Tools/FritzBoxDebugger/FritzBoxDebugger.csproj trunk/plugins/FritzBox/Tools/FritzBoxDebugger/Program.cs trunk/plugins/FritzBox/Tools/FritzBoxDebugger/Properties/ trunk/plugins/FritzBox/Tools/FritzBoxDebugger/Properties/AssemblyInfo.cs trunk/plugins/FritzBox/Tools/FritzBoxDebugger/app.config Removed Paths: ------------- trunk/plugins/FritzBox/Build/ trunk/plugins/FritzBox/FritzBox/ trunk/plugins/FritzBox/FritzBox.5.1.resharper trunk/plugins/FritzBox/FritzBox.sln trunk/plugins/FritzBox/MP2version/ trunk/plugins/FritzBox/MpeRelease/ trunk/plugins/FritzBox/Tools/ trunk/plugins/FritzBox/releases/ Added: trunk/plugins/FritzBox/FritzBox/FritzBox.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.cs (rev 0) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.cs 2011-11-29 10:23:07 UTC (rev 4354) @@ -0,0 +1,1423 @@ +#region Copyright (C) 2005-2009 Team MediaPortal + +// Copyright (C) 2005-2009 Team MediaPortal +// http://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 + +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Globalization; +using System.IO; +using System.Reflection; +using System.Threading; +using System.Xml.Serialization; +using FritzManager; +using GCollections; +using MediaPortal.Configuration; +using MediaPortal.Dialogs; +using MediaPortal.GUI.Library; +using MediaPortal.Player; +using MediaPortal.Util; +using Microsoft.Win32; + +namespace FritzBox +{ + internal enum FritzBoxGuiMode + { + CallList = 0, + VoiceBox = 1, + PhoneBook = 2 + } + + [PluginIcons("FritzBox.FritzBox.png", "FritzBox.FritzBoxDisabled.png")] + public class FritzBox : GUIWindow, ISetupForm, IPlugin + { + static Logger Log = LoggerFactory.getLogger("FritzBox"); + + #region CallMonitor + + #region Variables + + private readonly List<CallAction> _actionList = new List<CallAction>(); + private readonly List<CallAction> _notifyQueue = new List<CallAction>(); + private bool _showNotify = true; + private object _tempNotify; + + private int notifyCount = 0; + + #endregion Variables + + #region Properties + + public string ContactPicturesFolder + { + get { return Config.GetSubFolder(Config.Dir.Thumbs, "FritzBox.Contacts"); } + } + + public string YacFolder + { + get { return Config.GetSubFolder(Config.Dir.Thumbs, "yac"); } + } + + public string SkinMediaFolder + { + get { return Path.Combine(Config.GetSubFolder(Config.Dir.Skin, Settings.MediaPortalSkin), "Media"); } + } + + public string UnknownCallerImage + { + get + { + string filePath; + + // check if skin supports it's own images + filePath = Utils.GetCoverArt(SkinMediaFolder, @"FritzBox\CallMonitor.Unknown"); + if (!String.IsNullOrEmpty(filePath)) return filePath; + + // use new default image + filePath = Utils.GetCoverArt(ContactPicturesFolder, @"FritzBox\CallMonitor.Unknown"); + if (!String.IsNullOrEmpty(filePath)) return filePath; + + // use old default image + filePath = Utils.GetCoverArt(YacFolder, "_unknown"); + if (!String.IsNullOrEmpty(filePath)) return filePath; + + return String.Empty; + } + } + + public string MissingCallerImage + { + get + { + string filePath; + + // check if skin supports it's own images + filePath = Utils.GetCoverArt(SkinMediaFolder, @"FritzBox\CallMonitor.Missing"); + if (!String.IsNullOrEmpty(filePath)) return filePath; + + // use new default image + filePath = Utils.GetCoverArt(ContactPicturesFolder, @"FritzBox\CallMonitor.Missing"); + if (!String.IsNullOrEmpty(filePath)) return filePath; + + // use old default image + filePath = Utils.GetCoverArt(YacFolder, "_noImage"); + if (!String.IsNullOrEmpty(filePath)) return filePath; + + return String.Empty; + } + } + + #endregion + + #region Private Functions/Methods + + private void OnStartExternal(Process proc, bool waitForExit) + { + if (waitForExit) _showNotify = false; + else _showNotify = true; + } + + private void OnStopExternal(Process proc, bool waitForExit) + { + _showNotify = true; + + //for (int i = 0; i < _notifyQueue.Count; i++) + // OnFritzBoxEvent(_notifyQueue[i]); + + _notifyQueue.Clear(); + } + + private void OnCallAction(CallAction callAction) + { + Log.Info("FRITZ!Box: OnCallAction()"); + callAction.WriteToLog(); + + if (!_showNotify) + { + Log.Info("External process is running. Notify is queued and will be shown later."); + _notifyQueue.Add(callAction); + return; + } + + switch (callAction.Type) + { + case CallAction.CallType.Incoming: + if (PhoneBook.Enabled) callAction.Caller = PhoneBook.GetCaller(phoneBook, callAction.Caller); + OnCall(callAction); + break; + case CallAction.CallType.Outgoing: + if (PhoneBook.Enabled) callAction.Caller = PhoneBook.GetCaller(phoneBook, callAction.Caller); + OnCall(callAction); + break; + case CallAction.CallType.ConnectionStarted: + break; + case CallAction.CallType.ConnectionClosed: + if (Settings.CloseOnConnectionClosed) + { + Log.Info("_closeOnConnectionClosed is enabled. Try to close active notify."); + if (_tempNotify != null) + { + MediaPortal.GUI.Library.Action act = new MediaPortal.GUI.Library.Action(); + act.wID = MediaPortal.GUI.Library.Action.ActionType.ACTION_CLOSE_DIALOG; + GUIWindowManager.GetWindow((int) GUIWindow.Window.WINDOW_DIALOG_NOTIFY).OnAction(act); + } + } + break; + default: + Log.Error("incorrect callAction.Type"); + break; + } + } + + private void OnLogAction(FritzBoxClient.LogLevel logLevel, string logMessage) + { + switch (logLevel) + { + case FritzBoxClient.LogLevel.Debug: + Log.Debug(logMessage); + break; + case FritzBoxClient.LogLevel.Error: + Log.Error(logMessage); + break; + case FritzBoxClient.LogLevel.Warning: + Log.Warn(logMessage); + break; + case FritzBoxClient.LogLevel.Info: + Log.Info(logMessage); + break; + default: + break; + } + } + + private void OnCall(CallAction callAction) + { + Log.Info("FRITZ!Box: OnCall()"); + + if (_tempNotify != null) + { + Log.Info("yet another dialog is active. action is sent to queue."); + if (_actionList.Count < Settings.MaxNotifies - 1) _actionList.Add(callAction); + return; + } + + // config settings for dialog + string strHeading = string.Empty; + string strImage = string.Empty; + string strText = string.Empty; + + // set heading for NotifyDialog + switch (callAction.Type) + { + case CallAction.CallType.Incoming: + strHeading = GUILocalizeStrings.Get(1); // 1 = Incoming call + break; + case CallAction.CallType.Outgoing: + strHeading = GUILocalizeStrings.Get(2); // 2 = Outgoing call + break; + } + + // set Image for NotifyDialog + strImage = GetCallerImage(callAction.Caller); + + // set message text for NotifyDialog + strText = Environment.NewLine; + if (callAction.Caller.ID == "") strText += GUILocalizeStrings.Get(3); // 3 = Unknown + else if (callAction.Caller.Name == "") strText += callAction.Caller.ID; + else + { + strText += callAction.Caller.Name; + if (Settings.ShowMSNOnNotify) strText += Environment.NewLine + callAction.Caller.ID; + } + + // config settings for dialog FINISHED + + // if MSN is disabled, stop here + if (!IsMsnEnabled(callAction.MSN)) return; + + // if notifies are disabled for this call, stop here + if (!IsCallerEnabled(callAction.Caller)) return; + + if (callAction.Type == CallAction.CallType.Incoming && Settings.IncomingSound != null && Settings.IncomingSound.Length > 0 ) Utils.PlaySound(Settings.IncomingSound, false, true); + + ShowNotify(strHeading, strImage, strText); + } + + #endregion + + #region Helper Methods + + private string GetCallerImage(string callerId) + { + // search image for caller + if (Settings.ExtensiveLogging) + Log.Info("searching image for callerId: " + callerId); + + string filePath; + + // use new image path + filePath = Utils.GetCoverArt(ContactPicturesFolder, callerId); + if (!String.IsNullOrEmpty(filePath)) return filePath; + Log.Info("found image not in: " + ContactPicturesFolder); + + // use old image path + filePath = Utils.GetCoverArt(YacFolder, callerId); + if (!String.IsNullOrEmpty(filePath)) return filePath; + Log.Info("found image not in: " + YacFolder); + + return String.Empty; + } + + private string GetCallerImage(Caller caller) + { + if (caller.ID == "") + return UnknownCallerImage; + else + { + string strImage = GetCallerImage(caller.Name); + + if (File.Exists(strImage)) + { + if (Settings.ExtensiveLogging) Log.Info("found image for caller: " + strImage); + else Log.Info("found image for caller"); + + return strImage; + } + else + { + Log.Info("found NO image for caller"); + return MissingCallerImage; + } + } + } + + private bool IsMsnEnabled(string msn) + { + if (!Settings.FilterMSN) + { + Log.Info("MSN filter is disabled."); + return true; + } + + if (Settings.MSNList.Contains(msn)) + { + Log.Info("MSN is on list."); + return true; + } + else + { + Log.Info("MSN is not on list. Notify won't be shown."); + return false; + } + } + + private bool IsCallerEnabled(Caller caller) + { + if (!PhoneBook.Enabled) + { + Log.Info("Phone book is disabled. Notify will be shown."); + return true; + } + else if (caller.Show) return true; + else return false; + } + + private void ShowNotify(string strHeading, string strImage, string strText) + { + bool resumePlayer = false; + + if (notifyCount >= Settings.MaxNotifies) return; + + // pause player + if (g_Player.Playing && !g_Player.Paused && Settings.StopMedia) + { + g_Player.Pause(); + resumePlayer = true; + } + + // show dialog + GUIDialogNotify dlgNotify = (GUIDialogNotify)GUIWindowManager.GetWindow((int)GUIWindow.Window.WINDOW_DIALOG_NOTIFY); + if (dlgNotify == null) return; + + dlgNotify.Reset(); + dlgNotify.ClearAll(); + dlgNotify.SetHeading(strHeading); + dlgNotify.SetImage(strImage); + dlgNotify.SetText(strText); + if (Settings.CloseOnTimeout) dlgNotify.TimeOut = Settings.NotifyTimeout; + else dlgNotify.TimeOut = -1; + + _tempNotify = dlgNotify; + dlgNotify.DoModal(GUIWindowManager.ActiveWindow); + + // resume player + if (resumePlayer && g_Player.Playing && g_Player.Paused && Settings.StopMedia && Settings.ResumeMedia) g_Player.Pause(); + + _tempNotify = null; + if (_actionList.Count > 0) + { + CallAction tmpAction = _actionList[0]; + _actionList.RemoveAt(0); + OnCallAction(tmpAction); + } + } + + #endregion + + #endregion CallMonitor + + #region <Interface> Implementations + + #region IPlugin Interface + + /// <summary> + /// This method will be called by mediaportal to start your process plugin + /// </summary> + public void Start() + { + Log.Info("FRITZ!Box Plugin {0} starting.", Assembly.GetExecutingAssembly().GetName().Version); + Settings.Load(); + + Utils.OnStartExternal += OnStartExternal; + Utils.OnStopExternal += OnStopExternal; + + FritzBoxClient.LogEvent += OnLogAction; + FritzBoxClient.CallEvent += OnCallAction; + FritzBoxClient.StartClient(); + + // start monitoring Windows power mode changes (Standby & Hibernate) + SystemEvents.PowerModeChanged += new PowerModeChangedEventHandler(SystemEvents_PowerModeChanged); + } + + /// <summary> + /// this method will be called by mediaportal to stop your process plugin + /// </summary> + public void Stop() + { + Log.Info("FRITZ!Box Plugin {0} stopping.", Assembly.GetExecutingAssembly().GetName().Version); + + FritzBoxClient.StopClient(); + FritzBoxClient.CallEvent -= OnCallAction; + FritzBoxClient.LogEvent -= OnLogAction; + + Utils.OnStartExternal -= OnStartExternal; + Utils.OnStopExternal -= OnStopExternal; + + // stop monitoring power changes + SystemEvents.PowerModeChanged -= new PowerModeChangedEventHandler(SystemEvents_PowerModeChanged); + + PhoneBook.SaveSettings(); + } + + #endregion + + #region ISetupForm Member + + /// <summary> + /// With GetID it will be an window-plugin / otherwise a process-plugin + /// Enter the id number here again + /// </summary> + public override int GetID + { + get { return GetWindowId(); } + set { } + } + + public string PluginName() + { + return "FRITZ!Box Manager"; + } + + public string Author() + { + return "chefkoch, S.Rinke"; + } + + public string Description() + { + return "Displays FRITZ!Box caller lists and voice box infos and notifies on incoming calls."; + } + + public void ShowPlugin() + { + try + { + FritzBoxConfig config = new FritzBoxConfig(); + config.ShowDialog(); + } + catch (Exception ex) + { + Log.Error(ex.ToString()); + } + } + + public bool CanEnable() + { + return true; + } + + public int GetWindowId() + { + return 464554871; + } + + public bool DefaultEnabled() + { + return true; + } + + public bool HasSetup() + { + return true; + } + + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = GUILocalizeStrings.Get(28); // 28 = Telefon + strButtonImage = String.Empty; + strButtonImageFocus = String.Empty; + strPictureImage = "hover_FritzBox.png"; + + return true; + } + + #endregion + + #endregion + + #region FritzManager + + #region enums + + #region Nested type: Filter + + private enum Filter + { + All = 0, + Incoming = 1, + Outgoing = 2, + Rejected = 3 + } + + #endregion + + #region Nested type: View + + private enum View + { + List = 0, + Icons = 1, + LargeIcons = 2, + } + + #endregion + + #endregion + + #region skin + + [SkinControl(3)] protected GUISortButtonControl btnFilter; + [SkinControl(4)] protected GUIButtonControl btnModus; + [SkinControl(9)] protected GUIButtonControl btnUpdate; + [SkinControl(2)] protected GUIButtonControl btnViewAs; + [SkinControl(50)] protected GUIFacadeControl facadeView; + [SkinControl(4711)] protected GUIFadeLabel headerLabel; + + #endregion + + #region fields + + // update timer for background thread + private static System.Timers.Timer updateTimer = new System.Timers.Timer(); + // path to voice box files + private string vBPath; + // FRITZBox password + private string passwd; + // list of call items (callers) + private List<CallItem> callItemList; + // filter on callitems used in list view + private Filter currentFilter = Filter.All; + // what kind of items is shown (callers, phoneBook, voicebox) + private FritzBoxGuiMode currentMode = FritzBoxGuiMode.CallList; + // state of facede view + private View currentView = View.List; + // list of tmp files to delete when deinit + // TODO should called in timer callback also + private List<string> filesToDelete = new List<string>(); + // FritzBox WebGUI Client + private Fritz fritz; + // stores mapped msns + private HashMap<string, string> msns = new HashMap<string, string>(); + // phone book + public HashMap<string, PhonebookItem> phoneBook = new HashMap<string, PhonebookItem>(); + // dirty marker, if set the timer task will save phoneBook + private volatile bool phoneBookDirty; + // stores pathname for internal pb save file + private string phoneBookPath; + private string mediaPortalLanguage; + // if set true, use revers lookup + private bool useInversSearch; + // list of voivebox messages + private List<VoiceBoxItem> voiceboxItemList; + // worker for task + private BackGroundWorker worker; + // and the thread + private Thread workerThread; + + #endregion + + // the instance + private static FritzBox thePlugin; + // fritz phoneBook + protected FritzPhonebooks fritzPhonebooks = new FritzPhonebooks(); + // sync the access to phoneBook / calllist + private System.Object sync = new System.Object(); + + public override bool Init() + { + Start(); + updateGUIProperties(0,0,""); + loadConfig(); + GUILocalizeStrings.ChangeLanguage(mediaPortalLanguage); + + return Load(GUIGraphicsContext.Skin + @"\FritzManager.xml"); + } + + private void startBackGroundWorker(InversSearch search) + { + if (worker == null) + { + worker = new BackGroundWorker(fritz, this, search); + workerThread = new Thread(worker.Run); + workerThread.Start(); + } + } + + public override void DeInit() + { + cleanup(); + + if (worker != null) + { + worker.stop(); + workerThread.Abort(); + } + + Stop(); + + // persist some props for next time + Log.Debug("DeInit called: persisting current props" ); + using (MediaPortal.Profile.Settings xmlwriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + xmlwriter.SetValue("FritzManager", "currentMode", (int)currentFilter); + xmlwriter.SetValue("FritzManager", "currentFilter", (int)currentMode); + } + + base.DeInit(); + } + + protected void loadConfig() + { + string dialport = "0"; + string areacode = ""; + + using (MediaPortal.Profile.Settings xmlreader = new MediaPortal.Profile.Settings("MediaPortal.xml")) + { + phoneBookPath = Config.GetFolder(Config.Dir.Config) + "\\fritzmanagerPhonebook.xml"; + mediaPortalLanguage = xmlreader.GetValue("gui", "language"); + + passwd = xmlreader.GetValue("FritzManager", "passwd"); + vBPath = xmlreader.GetValue("FritzManager", "vBPath"); + dialport = xmlreader.GetValue("FritzManager", "dialport"); + useInversSearch = xmlreader.GetValueAsBool("FritzManager", "useInversSearch", true); + areacode = xmlreader.GetValue("FritzManager", "defaultAreacode"); + + string str = xmlreader.GetValue("FritzManager", "currentMode"); + + if (str != null && str != "") currentMode = (FritzBoxGuiMode)System.Enum.Parse(typeof(FritzBoxGuiMode), str); + + str = xmlreader.GetValue("FritzManager", "currentFilter"); + + if (str != null && str != "") currentFilter = (Filter)System.Enum.Parse(typeof(Filter), str); + + int interval = xmlreader.GetValueAsInt("FritzManager", "updateInterval", 0); + + if (interval != 0) + { + thePlugin = this; + updateTimer.Interval = interval * 1000; // interval is in sec + updateTimer.Elapsed += OnTimedEvent; + updateTimer.Enabled = true; + } + } + + fritz = new Fritz(passwd, Config.GetFolder(Config.Dir.Config), FritzBoxClient.Address, dialport); + + initMSN(); + + InversSearch search = new InversSearchOert(areacode); + + startBackGroundWorker(search); + } + + protected override void OnPageLoad() + { + phoneBook = InternalPhoneBook.loadPhoneBook(phoneBookPath); + + update(false); + + if (currentMode == FritzBoxGuiMode.VoiceBox) worker.queue.Enqueue(new Task(Task.TaskAction.LoadCallItems, null)); + + ShowThumbPanel(); + } + + private static void OnTimedEvent(object source, System.Timers.ElapsedEventArgs e) + { + Log.Debug("FritzBox Manager processing timer event"); + + if (thePlugin.phoneBookDirty) + { + thePlugin.phoneBookDirty = false; + InternalPhoneBook.savePhonebook(thePlugin.phoneBook.Values, thePlugin.phoneBookPath); + } + + thePlugin.fritz.keepAlive(); + + List<VoiceBoxItem> items = VBReader.loadVoiceBoxDir(thePlugin.vBPath); + + int newItems = 0; + string caller = null; + + foreach(VoiceBoxItem item in items) + { + if (item.isNew != 0 && item.type == 3) + { + if (caller == null ) caller = thePlugin.lookupCaller(item.callerId); + newItems++; + } + } + + thePlugin.updateGUIProperties(newItems, items.Count, caller); + } + + protected void initMSN() + { + // populate MSNs + if (File.Exists(Config.GetFolder(Config.Dir.Config) + "\\fritzmanager_msns.txt")) + { + using (StreamReader sr = new StreamReader(Config.GetFolder(Config.Dir.Config) + "\\fritzmanager_msns.txt")) + { + while (!sr.EndOfStream) + { + string line = sr.ReadLine(); + string[] items = line.Split('='); + if (items.GetLength(0) > 1) msns.Add(items[0], items[1]); + } + } + } + } + + protected override void OnPageDestroy(int new_windowId) + { + cleanup(); + base.OnPageDestroy(new_windowId); + } + + /// <summary> + /// deletes temp files (decoded voicebox messages) + /// </summary> + private void cleanup() + { + // cleanup temp + foreach (string file in filesToDelete) + { + File.Delete(file); + } + + filesToDelete.Clear(); + } + + /// <summary> + /// update data for the views. + /// </summary> + /// <param name="forceReload">if set the update is forced, and data will be fetched in + /// any case.</param> + protected void update(bool forceReload) + { + if (currentMode == FritzBoxGuiMode.CallList) loadCallListFromFritzbox(forceReload); + else if (currentMode == FritzBoxGuiMode.VoiceBox) + { + if (!String.IsNullOrEmpty(vBPath)) voiceboxItemList = VBReader.loadVoiceBoxDir(vBPath); + else + { + Log.Debug("voice box path is not set"); + return; + } + } + else if (currentMode == FritzBoxGuiMode.PhoneBook) + { + string str = fritz.loadPhoneBook(); + + if (str == "") ShowError(GUILocalizeStrings.Get(24)); // 24 = "Could not load phone book" + else + { + XmlSerializer s = new XmlSerializer(typeof (FritzPhonebooks)); + fritzPhonebooks = (FritzPhonebooks) s.Deserialize(new StringReader(str)); + } + } + + refreshView(); + + UpdateButtonStates(); + } + + /// <summary> + /// refreshes the view. call when backing lists / maps have changed + /// </summary> + protected void refreshView() + { + if (currentMode == FritzBoxGuiMode.CallList) populateCallItems(); + else if (currentMode == FritzBoxGuiMode.VoiceBox) populateVoiceBoxItems(); + else if (currentMode == FritzBoxGuiMode.PhoneBook) populatePhonebookItems(); + } + + /// <summary> + /// load internal callers list from csv contained in data + /// </summary> + /// <param name="data">holds csv list</param> + public void refreshCallData(byte[] data) + { + lock (sync) + { + callItemList = CallItem.load(new MemoryStream(data)); + + // populate phoneBook + bool updatePhonebook = false; + int idx = 0; + + foreach (CallItem i in callItemList) + { + PhonebookItem pi = phoneBook[i.number]; + + if (pi == null) + { + pi = new PhonebookItem(); + pi.number = i.number; + phoneBook[i.number] = pi; + } + + if (i.name != "" && pi.name != i.name) + { + pi.name = i.name; + pi.fritzEntry = true; + pi.inverseLookupDone = false; + updatePhonebook = true; + } + else if (useInversSearch && !pi.inverseLookupDone && !pi.fritzEntry && i.number != "") worker.queue.Enqueue(new Task(Task.TaskAction.InversLookup, new object[] { i.number, idx })); + + idx++; + } + + if (updatePhonebook) InternalPhoneBook.savePhonebook(phoneBook.Values, phoneBookPath); + } + + refreshView(); + } + + public void updatePhonebook(string number, string name, int index) + { + if (name != null && name != "" && phoneBook.Contains(number)) + { + lock (sync) + { + phoneBook[number].inverseLookupDone = true; + phoneBookDirty = true; + + if (name != number) + { + // search without result + phoneBook[number].name = name; + + if (currentMode == FritzBoxGuiMode.CallList) + { + GUIListItem item = facadeView[index]; + + if (item != null) + { + Log.Debug("replacing label {0} with {1}", item.Label2, name); + string l = name; + + if (l.Length > 30) l = name.Substring(0, 30); + + item.Label2 = l; + } + } + } + } + } + } + + protected void loadCallListFromFritzbox(bool forceReload) + { + GUIWaitCursor.Show(); + try + { + Log.Debug("load callitem from fritzbox"); + byte[] data = fritz.loadCallListData(forceReload); + refreshCallData(data); + } + catch (Exception e) + { + Log.Debug("Exception {0}", e.Message); + } + GUIWaitCursor.Hide(); + } + + protected string decode(VoiceBoxItem item) + { + System.Diagnostics.Process proc = new System.Diagnostics.Process(); + proc.EnableRaisingEvents = false; + proc.StartInfo.FileName = "speexdec"; + string target = Path.GetTempPath() + item.seq + ".wav"; + proc.StartInfo.Arguments = "\"" + vBPath + "\\rec\\" + item.filename + "\" \"" + target + "\""; + proc.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden; + + proc.Start(); + proc.WaitForExit(); + proc.Close(); + + filesToDelete.Add(target); + + return target; + } + + protected void populatePhonebookItems() + { + facadeView.Clear(); + + if (fritzPhonebooks.Items == null || fritzPhonebooks.Items.GetLength(0) == 0) + { + Log.Debug("no fritz phone book items found"); + + return; + } + + Phonebook p = fritzPhonebooks.Items[0]; // always choose first phone book + int i = 0; + string thumbDir = Config.GetFolder(Config.Dir.Thumbs) + "\\yac\\"; + + foreach (Contact c in p.contact) + { + string name = c.person[0].realName; + + foreach (TelephonyNumber number in c.telephony) + { + GUIListItem elem = new GUIListItem(); + elem.Label = name; + elem.Label2 = number.Value; + + if (elem.Label2.Length > 0) + { + if (File.Exists(thumbDir + c.person[0].realName + ".jpg")) elem.ThumbnailImage = thumbDir + c.person[0].realName + ".jpg"; + else elem.ThumbnailImage = thumbDir + "_noImage.png"; + + elem.Path = Convert.ToString(i++); + + facadeView.Add(elem); + } + } + } + } + + /// <summary> + /// fill in voice box items in facadeView + /// </summary> + protected void populateVoiceBoxItems() + { + CultureInfo ci = CultureInfo.InvariantCulture; + string format = "dd.MM.yy HH:mm"; + facadeView.Clear(); + voiceboxItemList.Sort(VoiceBoxItem.CompareByDate); + int i = 0; + int newItems = 0; + string callerNotify = null; + + foreach (VoiceBoxItem item in voiceboxItemList) + { + if (item.type == 3) + { + GUIListItem elem = new GUIListItem(); + string caller = lookupCaller(item.callerId); + + if (item.isNew != 0 ) + { + if (callerNotify == null) callerNotify = caller; + + newItems++; + } + string msnName = item.mynumber; + + if (msns.Contains(item.mynumber)) msnName = msns[item.mynumber]; + + elem.Label = (item.isNew == 1 ? "* " : " ") + item.time.ToString(format, ci); + elem.Label2 = caller + " " + GUILocalizeStrings.Get(26) + " " + msnName; // 26 = to + elem.Path = Convert.ToString(i); + elem.IconImageBig = "defaultAudioBig.png"; + elem.IconImage = "defaultAudio.png"; + + string thumbDir = Config.GetFolder(Config.Dir.Thumbs) + "\\yac\\"; + + if (File.Exists(thumbDir + caller + ".jpg")) elem.ThumbnailImage = thumbDir + caller + ".jpg"; + else elem.ThumbnailImage = thumbDir + "_noImage.png"; + + facadeView.Add(elem); + } + + i++; + } + + updateGUIProperties(newItems, voiceboxItemList.Count, callerNotify); + } + + private string lookupCaller(string caller) + { + if (phoneBook.Contains(caller)) caller = phoneBook[caller].name; + if (caller == "" || caller == null) caller = GUILocalizeStrings.Get(3); // 3 = Unknown + + return caller; + } + + public void updateGUIProperties(int newItems, int total, string name) + { + if (newItems == 0) + { + GUIPropertyManager.SetProperty("#FritzManager.NewMessages", " "); + GUIPropertyManager.SetProperty("#FritzManager.Caller", " "); + GUIPropertyManager.SetProperty("#FritzManager.NewMessageCount", string.Empty); + GUIPropertyManager.SetProperty("#FritzManager.NewMessagesAvail", "false"); + } + else + { + if (newItems > 1) GUIPropertyManager.SetProperty("#FritzManager.NewMessages", newItems + " " + GUILocalizeStrings.Get(7)); // 7 = Messages + else GUIPropertyManager.SetProperty("#FritzManager.NewMessages", newItems + " " + GUILocalizeStrings.Get(27)); // 27 = Message + + GUIPropertyManager.SetProperty("#FritzManager.Caller", name); + GUIPropertyManager.SetProperty("#FritzManager.NewMessageCount", newItems.ToString()); + GUIPropertyManager.SetProperty("#FritzManager.NewMessagesAvail", "true"); + } + + if (total == 0) + { + GUIPropertyManager.SetProperty("#FritzManager.TotalMessages", " "); + GUIPropertyManager.SetProperty("#FritzManager.TotalMessageCount", string.Empty); + } + else + { + if (newItems > 1) GUIPropertyManager.SetProperty("#FritzManager.TotalMessages", total + " " + GUILocalizeStrings.Get(7)); // 7 = Messages + else GUIPropertyManager.SetProperty("#FritzManager.TotalMessages", total + " " + GUILocalizeStrings.Get(27)); // 27 = Message + + GUIPropertyManager.SetProperty("#FritzManager.TotalMessageCount", total.ToString()); + } + + // set properties for skin file labels + GUIPropertyManager.SetProperty("#FritzManager.LabelCallList", GUILocalizeStrings.Get(18)); // 18 = Call list + GUIPropertyManager.SetProperty("#FritzManager.LabelUpdate", GUILocalizeStrings.Get(25)); // 25 = Update + } + + /// <summary> + /// fill in call items in facadeView + /// </summary> + protected void populateCallItems() + { + CultureInfo ci = CultureInfo.InvariantCulture; + string format = "dd.MM.yy HH:mm"; + facadeView.Clear(); + int i = -1; + + if (callItemList == null) + { + Log.Debug("callItemList is not initialized"); + + return; + } + + foreach (CallItem item in callItemList) + { + GUIListItem elem = new GUIListItem(); + + i++; + + if (currentFilter == Filter.Rejected) if (item.type != 2) continue; + if (currentFilter == Filter.Incoming) if (item.type != 1) continue; + if (currentFilter == Filter.Outgoing) if (item.type != 3) continue; + + elem.Label = item.timestamp.ToString(format, ci) + " - " + item.duration.ToString("HH:mm", ci); + PhonebookItem pi = phoneBook[item.number]; + + if (pi.name != null) + { + elem.Label2 = pi.inverseLookupDone + ? + (pi.name + " (" + pi.number + ")") + : + pi.name; + } + else elem.Label2 = pi.number; + + elem.DVDLabel = item.mynumber + item.extension; + elem.Path = Convert.ToString(i); + + string thumbDir = Config.GetFolder(Config.Dir.Thumbs) + "\\yac\\"; + + if (File.Exists(thumbDir + pi.name + ".jpg")) elem.ThumbnailImage = thumbDir + pi.name + ".jpg"; + else + { + if (pi.name == null || pi.name == "") elem.ThumbnailImage = thumbDir + "_unknown.png"; + else elem.ThumbnailImage = thumbDir + "_noImage.png"; + } + + string prefix = "FritzBox\\"; + string icon = "defaultAudioBig.png"; + + if (item.type == 1) icon = prefix + "callin.png"; + else if (item.type == 3) icon = prefix + "callout.png"; + else if (item.type == 2) icon = prefix + "rejected.png"; + + elem.IconImageBig = icon; + elem.IconImage = icon; + elem.IsFolder = false; + + facadeView.Add(elem); + } + } + + private void ShowThumbPanel() + { + int itemIndex = facadeView.SelectedListItemIndex; + + if (currentView == View.LargeIcons) facadeView.CurrentLayout = GUIFacadeControl.Layout.LargeIcons; + else if (currentView == View.Icons) facadeView.CurrentLayout = GUIFacadeControl.Layout.SmallIcons; + else if (currentView == View.List) facadeView.CurrentLayout = GUIFacadeControl.Layout.List; + + if (itemIndex > -1) GUIControl.SelectItemControl(GetID, facadeView.GetID, itemIndex); + + UpdateButtonStates(); + } + + protected override void OnShowContextMenu() + { + base.OnShowContextMenu(); + + if (currentMode == FritzBoxGuiMode.VoiceBox) + { + int r = ShowVoiceboxContextMenu(); + + switch (r) + { + case 0: // play + g_Player.Play(decode(voiceboxItemList[Convert.ToInt16(facadeView.SelectedListItem.Path)])); + break; + case 1: + break; + } + } + else if (currentMode == FritzBoxGuiMode.CallList) + { + int r = ShowCallListContextMenu(); + int idx = Convert.ToInt16(facadeView.SelectedListItem.Path); + CallItem item = callItemList[idx]; + + switch (r) + { + case 0: // call back + fritz.dial(item.number); + break; + case 1: // reverse search + worker.queue.Enqueue(new Task(Task.TaskAction.InversLookup, new object[] {item.number, idx})); + break; + } + } + } + + protected override void OnClicked(int controlId, GUIControl control, MediaPortal.GUI.Library.Action.ActionType actionType) + { + base.OnClicked(controlId, control, actionType); + + if (actionType == MediaPortal.GUI.Library.Action.ActionType.ACTION_SHOW_INFO) + { + OnShowContextMenu(); + + return; + } + + if (control == facadeView) + { + GUIMessage msg = new GUIMessage(GUIMessage.MessageType.GUI_MSG_ITEM_SELECTED, GetID, 0, controlId, 0, 0, null); + OnMessage(msg); + int itemIndex = msg.Param1; + + if (actionType == MediaPortal.GUI.Library.Action.ActionType.ACTION_SELECT_ITEM) + { + GUIListItem actual = facadeView.SelectedListItem; + + if (currentMode == FritzBoxGuiMode.VoiceBox) + { + string tmp = decode(voiceboxItemList[Convert.ToInt16(actual.Path)]); + g_Player.Play(tmp); + } + } + } + + if (control == btnViewAs) + { + bool shouldContinue = false; + + do + { + shouldContinue = false; + + switch (currentView) + { + case View.List: + currentView = View.Icons; + + if (facadeView.ThumbnailLayout == null) + shouldContinue = true; + else + facadeView.CurrentLayout = GUIFacadeControl.Layout.SmallIcons; + + break; + + case View.Icons: + currentView = View.LargeIcons; + + if (facadeView.ThumbnailLayout == null) + shouldContinue = true; + else + facadeView.CurrentLayout = GUIFacadeControl.Layout.LargeIcons; + + break; + + case View.LargeIcons: + currentView = View.List; + + if (facadeView.ListLayout == null) shouldContinue = true; + + else facadeView.CurrentLayout = GUIFacadeControl.Layout.List; + + break; + } + } + while (shouldContinue); + + UpdateButtonStates(); + + GUIControl.FocusControl(GetID, controlId); + + return; + } + + if (control == btnFilter) + { + switch (currentFilter) + { + case Filter.All: + currentFilter = Filter.Incoming; + break; + case Filter.Incoming: + currentFilter = Filter.Outgoing; + break; + case Filter.Outgoing: + currentFilter = Filter.Rejected; + break; + case Filter.Rejected: + currentFilter = Filter.All; + break; + } + + populateCallItems(); + + UpdateButtonStates(); + + GUIControl.FocusControl(GetID, controlId); + } + + if (control == btnUpdate) update(true); + + // Messages -> Call list -> Phone book + if (control == btnModus) + { + switch (currentMode) + { + case FritzBoxGuiMode.VoiceBox: + currentMode = FritzBoxGuiMode.CallList; + break; + case FritzBoxGuiMode.CallList: + currentMode = FritzBoxGuiMode.PhoneBook; + break; + case FritzBoxGuiMode.PhoneBook: + currentMode = FritzBoxGuiMode.VoiceBox; + break; + } + + if (currentMode == FritzBoxGuiMode.CallList) + { + // when switching into caller item list, then schedule a task + worker.queue.Enqueue(new Task(Task.TaskAction.LoadCallItems, null)); + } + + // TODO write currentMode + update(false); + } + } + + private int ShowCallListContextMenu() + { + GUIDialogMenu dlgMenu = (GUIDialogMenu) GUIWindowManager.GetWindow((int) GUIWindow.Window.WINDOW_DIALOG_MENU); + + if (dlgMenu != null) + { + dlgMenu.Reset(); + dlgMenu.SetHeading(GUILocalizeStrings.Get(4)); // 4 = Calls + dlgMenu.Add(GUILocalizeStrings.Get(5)); // 5 = Call back + dlgMenu.Add(GUILocalizeStrings.Get(6)); // 6 = New reverse search + dlgMenu.DoModal(GetID); + + if (dlgMenu.SelectedLabel == -1) return -1; // nothing was selected + + return dlgMenu.SelectedLabel; + } + + return -1; + } + + private int ShowVoiceboxContextMenu() + { + GUIDialogMenu dlgMenu = (GUIDialogMenu) GUIWindowManager.GetWindow((int) GUIWindow.Window.WINDOW_DIALOG_MENU); + + if (dlgMenu != null) + { + dlgMenu.Reset(); + dlgMenu.SetHeading(GUILocalizeStrings.Get(7)); // 7 = Messages + dlgMenu.Add(GUILocalizeStrings.Get(8)); // 8 = Play message + dlgMenu.Add(GUILocalizeStrings.Get(9)); // 9 = Mark message as heared + dlgMenu.Add(GUILocalizeStrings.Get(10)); // 10 = Delete message + dlgMenu.DoModal(GetID); + + if (dlgMenu.SelectedLabel == -1) return -1; // Nothing was selected + + return dlgMenu.SelectedLabel; + } + + return -1; + } + + private void UpdateButtonStates() + { + facadeView.IsVisible = false; + facadeView.IsVisible = true; + GUIControl.FocusControl(GetID, facadeView.GetID); + + string strLine = string.Empty; + View view = currentView; + + switch (view) + { + case View.List: + strLine = GUILocalizeStrings.Get(11); // 11 = View: List + break; + case View.Icons: + strLine = GUILocalizeStrings.Get(12); // 12 = View: Small icons + break; + case View.LargeIcons: + strLine = GUILocalizeStrings.Get(13); // 13 = View: Large icons + break; + } + + if (btnViewAs != null) btnViewAs.Label = strLine; + + switch (currentFilter) + { + case Filter.All: + strLine = GUILocalizeStrings.Get(14); // 14 = All + break; + case Filter.Incoming: + strLine = GUILocalizeStrings.Get(15); // 15 = Incoming + break; + case Filter.Outgoing: + strLine = GUILocalizeStrings.Get(16); // 16 = Outgoing + break; + case Filter.Rejected: + strLine = GUILocalizeStrings.Get(17); // 17 = Rejected + break; + } + + if (btnFilter != null) + { + btnFilter.Label = strLine; + btnFilter.IsAscending = true; + } + + // Messages -> Call list -> Phone book + switch (currentMode) + { + case FritzBoxGuiMode.VoiceBox: + if (headerLabel != null) headerLabel.Label = GUILocalizeStrings.Get(19); // 19 = FritzBox messages + btnModus.Label = GUILocalizeStrings.Get(18); // 18 = Call list + break; + case FritzBoxGuiMode.CallList: + if (headerLabel != null) headerLabel.Label = GUILocalizeStrings.Get(21); // 21 = FritzBox call list + btnModus.Label = GUILocalizeStrings.Get(20); // 20 = Phone book + break; + case FritzBoxGuiMode.PhoneBook: + if (headerLabel != null) headerLabel.Label = GUILocalizeStrings.Get(22); // 22 = FritzBox phone book + btnModus.Label = GUILocalizeStrings.Get(7); // 7 = Messages + break; + } + } + + private void ShowError(string msg) + { + GUIDialogOK dlg = (GUIDialogOK) GUIWindowManager.GetWindow((int) GUIWindow.Window.WINDOW_DIALOG_OK); + dlg.SetHeading(GUILocalizeStrings.Get(23)); // 23 = Error + dlg.SetLine(1, msg); + dlg.SetLine(2, String.Empty); + dlg.SetLine(3, String.Empty); + dlg.DoModal(GUIWindowManager.ActiveWindow); + } + + private void SystemEvents_PowerModeChanged(object sender, Microsoft.Win32.PowerModeChangedEventArgs e) + { + switch (e.Mode) + { + case PowerModes.Suspend: + FritzBoxClient.StopClient(); + break; + + case PowerModes.Resume: + FritzBoxClient.StartClient(); + break; + } + } + + #endregion FritzManager + } +} \ No newline at end of file Added: trunk/plugins/FritzBox/FritzBox/FritzBox.csproj =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBox.csproj (rev 0) +++ trunk/plugins/FritzBox/FritzBox/FritzBox.csproj 2011-11-29 10:23:07 UTC (rev 4354) @@ -0,0 +1,223 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> + <PropertyGroup> + <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> + <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> + <ProductVersion>9.0.21022</ProductVersion> + <SchemaVersion>2.0</SchemaVersion> + <ProjectGuid>{7A458560-A537-429E-A016-1A4513CB586F}</ProjectGuid> + <OutputType>Library</OutputType> + <AppDesignerFolder>Properties</AppDesignerFolder> + <RootNamespace>FritzBox</RootNamespace> + <AssemblyName>FritzBox</AssemblyName> + <ApplicationIcon> + </ApplicationIcon> + <FileUpgradeFlags> + </FileUpgradeFlags> + <UpgradeBackupLocation> + </UpgradeBackupLocation> + <OldToolsVersion>3.5</OldToolsVersion> + <SourceAnalysisOverrideSettingsFile>C:\Dokumente und Einstellungen\sr\Anwendungsdaten\ICSharpCode/SharpDevelop3.0\Settings.SourceAnalysis</SourceAnalysisOverrideSettingsFile> + <TargetFrameworkVersion>v4.0</TargetFrameworkVersion> + <AllowUnsafeBlocks>False</AllowUnsafeBlocks> + <NoStdLib>False</NoStdLib> + <TreatWarningsAsErrors>false</TreatWarningsAsErrors> + <TargetFrameworkProfile /> + <PublishUrl>publish\</PublishUrl> + <Install>true</Install> + <InstallFrom>Disk</InstallFrom> + <UpdateEnabled>false</UpdateEnabled> + <UpdateMode>Foreground</UpdateMode> + <UpdateInterval>7</UpdateInterval> + <UpdateIntervalUnits>Days</UpdateIntervalUnits> + <UpdatePeriodically>false</UpdatePeriodically> + <UpdateRequired>false</UpdateRequired> + <MapFileExtensions>true</MapFileExtensions> + <ApplicationRevision>0</ApplicationRevision> + <ApplicationVersion>1.0.0.%2a</ApplicationVersion> + <IsWebBootstrapper>false</IsWebBootstrapper> + <UseApplicationTrust>false</UseApplicationTrust> + <BootstrapperEnabled>true</BootstrapperEnabled> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> + <DebugSymbols>true</DebugSymbols> + <DebugType>Full</DebugType> + <Optimize>false</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>DEBUG;TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> + <DebugType>pdbonly</DebugType> + <Optimize>true</Optimize> + <OutputPath>bin\Release\</OutputPath> + <DefineConstants>TRACE</DefineConstants> + <ErrorReport>prompt</ErrorReport> + <WarningLevel>4</WarningLevel> + </PropertyGroup> + <PropertyGroup Condition=" '$(Configuration)' == 'Debug' "> + <CheckForOverflowUnderflow>False</CheckForOverflowUnderflow> + <StartAction>Program</StartAction> + <StartProgram>..\..\..\..\..\..\Programme\Team MediaPortal\MediaPortal\MediaPortal.exe</StartProgram> + </PropertyGroup> + <PropertyGroup Condition=" '$(Platform)' == 'AnyCPU' "> + <RegisterForComInterop>False</RegisterForComInterop> + <GenerateSerializationAssemblies>Auto</GenerateSerializationAssemblies> + <BaseAddress>4194304</BaseAddress> + <PlatformTarget>AnyCPU</PlatformTarget> + <FileAlignment>4096</FileAlignment> + </PropertyGroup> + <ItemGroup> + <Reference Include="Common.Utils"> + <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Common.Utils.dll</HintPath> + </Reference> + <Reference Include="Core"> + <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Core.dll</HintPath> + </Reference> + <Reference Include="Dialogs"> + <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\plugins\Windows\Dialogs.dll</HintPath> + </Reference> + <Reference Include="System" /> + <Reference Include="System.Data" /> + <Reference Include="System.Drawing" /> + <Reference Include="System.Windows.Forms" /> + <Reference Include="System.Xml" /> + <Reference Include="Utils"> + <HintPath>C:\Program Files\Team MediaPortal\MediaPortal\Utils.dll</HintPath> + </Reference> + </ItemGroup> + <ItemGroup> + <Compile Include="FritzCallMonitor\FritzBoxClient.cs" /> + <Compile Include="FritzManager\VBReader.cs" /> + <Compile Include="FritzManager\BackGroundWorker.cs" /> + <Compile Include="FritzManager\BlockingQueue.cs" /> + <Compile Include="FritzManager\CallItem.cs" /> + <Compile Include="FritzManager\Fritz.cs" /> + <Compile Include="FritzManager\FritzboxPhonebook.cs" /> + <Compile Include="FritzManager\GCollections.cs" /> + <Compile Include="FritzManager\InversSearch.cs" /> + <Compile Include="FritzManager\InversSearchOert.cs" /> + <Compile Include="FritzManager\Logger.cs" /> + <Compile Include="FritzManager\LoggerFactory.cs" /> + <Compile Include="FritzManager\MyBinaryReader.cs" /> + <Compile Include="FritzManager\PhonebookItem.cs" /> + <Compile Include="FritzManager\Task.cs" /> + <Compile Include="FritzManager\VoiceBoxItem.cs" /> + <Compile Include="LocalizeStrings.cs" /> + <Compile Include="Properties\AssemblyInfo.cs" /> + <Compile Include="FritzCallMonitor\Caller.cs" /> + <Compile Include="FritzCallMonitor\CallAction.cs" /> + <Compile Include="FritzBoxConfig.cs"> + <SubType>Form</SubType> + </Compile> + <Compile Include="FritzBoxConfig.Designer.cs"> + <DependentUpon>FritzBoxConfig.cs</DependentUpon> + </Compile> + <Compile Include="FritzBox.cs" /> + <Compile Include="FritzCallMonitor\PhoneBook.cs" /> + <Compile Include="Properties\Resources.Designer.cs"> + <AutoGen>True</AutoGen> + <DesignTime>True</DesignTime> + <DependentUpon>Resources.resx</DependentUpon> + </Compile> + <Compile Include="Settings.cs" /> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="Properties\Resources.resx"> + <Generator>ResXFileCodeGenerator</Generator> + <LastGenOutput>Resources.Designer.cs</LastGenOutput> + <SubType>Designer</SubType> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="FritzBoxConfig.resx"> + <SubType>Designer</SubType> + <DependentUpon>FritzBoxConfig.cs</DependentUpon> + </EmbeddedResource> + </ItemGroup> + <ItemGroup> + <EmbeddedResource Include="FritzBox.png" /> + <EmbeddedResource Include="FritzBoxDisabled.png" /> + </ItemGroup> + <ItemGroup> + <None Include="docs\Changes.txt"> + </None> + <None Include="docs\todo.txt"> + </None> + <Content Include="docs\Install.txt"> + </Content> + <Content Include="Skin\Black & White\FritzManager.xml"> + </Content> + <Content Include="Skin\Black & White\Media\callin.png"> + </Content> + <Content Include="Skin\Black & White\Media\callout.png"> + </Content> + <Content Include="Skin\Black & White\Media\hover_FritzBox.png" /> + <Content Include="Skin\Black & White\Media\rejected.png"> + </Content> + <Content Include="Skin\Blue3\FritzManager.xml"> + </Content> + <Content Include="Skin\Blue3\Media\callin.png"> + </Content> + <Content Include="Skin\Blue3\Media\callout.png"> + </Content> + <Content Include="Skin\Blue3\Media\FritzBox.CallMonitor.Missing.png"> + </Content> + <Content Include="Skin\Blue3\Media\FritzBox.CallMonitor.Unknown.png"> + </Content> + <Content Include="Skin\Blue3\Media\hover_FritzBox.png" /> + <Content Include="Skin\Blue3\Media\rejected.png"> + </Content> + <Content Include="Skin\GenericSkin\FritzManager.xml"> + </Content> + <Content Include="Skin\GenericSkin\Media\callin.png"> + </Content> + <Content Include="Skin\GenericSkin\Media\callout.png"> + </Content> + <Content Include="Skin\GenericSkin\Media\hover_FritzBox.png" /> + <Content Include="Skin\GenericSkin\Media\rejected.png"> + </Content> + <Content Include="Resources\gfx\FritzBox.ico" /> + <Content Include="Resources\gfx\FritzBoxIconMadeByHarley.png" /> + <Content Include="Skin\GenericSkin\Media\FritzBox.CallMonitor.Missing.png"> + </Content> + <Content Include="Skin\GenericSkin\Media\FritzBox.CallMonitor.Unknown.png"> + </Content> + <Content Include="Resources\speexdec.exe"> + </Content> + </ItemGroup> + <ItemGroup> + <None Include="Resources\fritzdial.sh" /> + <None Include="Resources\MpeRelease\FritzBox.xmp2" /> + </ItemGroup> + <ItemGroup> + <BootstrapperPackage Include="Microsoft.Net.Client.3.5"> + <Visible>False</Visible> + <ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName> + <Install>false</Install> + </BootstrapperPackage> + <BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> + <Visible>False</Visible> + <ProductName>.NET Framework 3.5 SP1</ProductName> + <Install>true</Install> + </BootstrapperPackage> + <BootstrapperPackage Include="Microsoft.Windows.Installer.3.1"> + <Visible>False</Visible> + <ProductName>Windows Installer 3.1</ProductName> + <Install>true</Install> + </BootstrapperPackage> + </ItemGroup> + <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> + <!-- To modify your build process, add your task inside one of the targets below and uncomment it. + Other similar extension points exist, see Microsoft.Common.targets. + <Target Name="BeforeBuild"> + </Target> + <Target Name="AfterBuild"> + </Target> + --> + <PropertyGroup> + <PostBuildEvent>rem xcopy /y "$(TargetPath)" "$(SolutionDir)\xbmc\bin\$(ConfigurationName)\plugins\windows" +rem xcopy /y "$(TargetPath)" "$(SolutionDir)\Configuration\bin\$(ConfigurationName)\plugins\windows"</PostBuildEvent> + </PropertyGroup> +</Project> \ No newline at end of file Added: trunk/plugins/FritzBox/FritzBox/FritzBox.png =================================================================== (Binary files differ) Property changes on: trunk/plugins/FritzBox/FritzBox/FritzBox.png ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Added: trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.Designer.cs =================================================================== --- trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.Designer.cs (rev 0) +++ trunk/plugins/FritzBox/FritzBox/FritzBoxConfig.Designer.cs 2011-11-29 10:23:07 UTC (rev 4354) @@ -0,0 +1,1102 @@ +namespace FritzBox +{ + partial class FritzBoxConfig + { + /// <summary> + /// Erforderliche Designervariable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Verwendete Ressourcen bereinigen. + /// </summary> + /// <param name="disposing">True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Windows Form-Designer generierter Code + + /// <summary> + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// </summary> + private void InitializeComponent() + { + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.ComponentModel.ComponentResourceManager resources = new System.Co... [truncated message content] |