From: <ks...@us...> - 2012-02-14 20:21:59
|
Revision: 4451 http://mp-plugins.svn.sourceforge.net/mp-plugins/?rev=4451&view=rev Author: ksya Date: 2012-02-14 20:21:46 +0000 (Tue, 14 Feb 2012) Log Message: ----------- Added Paths: ----------- trunk/plugins/OperaMobileLauncher/ trunk/plugins/OperaMobileLauncher/Opera Mobile/ trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.Designer.cs trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.cs trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.resx trunk/plugins/OperaMobileLauncher/Opera Mobile/IniFile.cs trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs.bak trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs.new trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.csproj trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.csproj.user trunk/plugins/OperaMobileLauncher/Opera Mobile/Properties/ trunk/plugins/OperaMobileLauncher/Opera Mobile/Properties/AssemblyInfo.cs trunk/plugins/OperaMobileLauncher/Opera Mobile/Properties/Resources.Designer.cs trunk/plugins/OperaMobileLauncher/Opera Mobile/Properties/Resources.resx trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/ trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Debug/ trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Debug/OperaMobile.dll trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Debug/OperaMobile.pdb trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Debug/Utils.dll trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/ trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobile.png trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobile.xml trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobileLauncher - kopie.xmp2 trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobileLauncher.dll trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobileLauncher.mpe1 trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobileLauncher.pdb trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobileLauncher.xmp2 trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobileLauncher_0.2.zip trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobileLauncher_0.3.zip trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/OperaMobileSettings.png trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/hover_Opera Mobile Launcher.png trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/hover_Opera Mobile Launcher1.png trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/opera_left_installer.jpg trunk/plugins/OperaMobileLauncher/Opera Mobile/bin/Release/update.xml trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/ trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/ trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/Opera Mobile.csproj.FileListAbsolute.txt trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/OperaLauncher.FormSettings.resources trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/OperaLauncher.csproj.FileListAbsolute.txt trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/OperaMobile.csproj.FileListAbsolute.txt trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/OperaMobile.dll trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/OperaMobile.pdb trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/ResGen.read.1.tlog trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/ResGen.write.1.tlog trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/ResolveAssemblyReference.cache trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/TempPE/ trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Debug/eventGhostTrigger.FormSettings.resources trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/ trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/DesignTimeResolveAssemblyReferencesInput.cache trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/Opera Mobile.csproj.FileListAbsolute.txt trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/OperaLauncher.FormSettings.resources trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/OperaLauncher.Properties.Resources.resources trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/OperaLauncher.csproj.FileListAbsolute.txt trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/OperaMobile.csproj.FileListAbsolute.txt trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/OperaMobileLauncher.dll trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/OperaMobileLauncher.pdb trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/ResGen.read.1.tlog trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/ResGen.write.1.tlog trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/ResolveAssemblyReference.cache trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/TempPE/ trunk/plugins/OperaMobileLauncher/Opera Mobile/obj/Release/TempPE/Properties.Resources.Designer.cs.dll trunk/plugins/OperaMobileLauncher/Opera Mobile/opera-logo.png trunk/plugins/OperaMobileLauncher/Opera Mobile/opera-logo_disabled.png trunk/plugins/OperaMobileLauncher/OperaMobileLauncher.sln trunk/plugins/OperaMobileLauncher/OperaMobileLauncher.suo Added: trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.Designer.cs =================================================================== --- trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.Designer.cs (rev 0) +++ trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.Designer.cs 2012-02-14 20:21:46 UTC (rev 4451) @@ -0,0 +1,388 @@ +namespace OperaLauncher +{ + partial class FormSettings + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.IContainer components = null; + + /// <summary> + /// Clean up any resources being used. + /// </summary> + /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param> + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() + { + this.buttonOk = new System.Windows.Forms.Button(); + this.buttonCancel = new System.Windows.Forms.Button(); + this.imageFileName_Button = new System.Windows.Forms.Button(); + this.imageFileName_Editbox = new System.Windows.Forms.TextBox(); + this.label4 = new System.Windows.Forms.Label(); + this.test_btn = new System.Windows.Forms.Button(); + this.fullscreen_chk = new System.Windows.Forms.CheckBox(); + this.touchinterface_chk = new System.Windows.Forms.CheckBox(); + this.customargs_txt = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.widthZoom_txt = new System.Windows.Forms.TextBox(); + this.widthZoom_chk = new System.Windows.Forms.CheckBox(); + this.ApplyOpera_btn = new System.Windows.Forms.Button(); + this.downloadLink = new System.Windows.Forms.LinkLabel(); + this.minFontSize_nud = new System.Windows.Forms.NumericUpDown(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.setToDesktopUA_btn = new System.Windows.Forms.Button(); + this.customUA_txt = new System.Windows.Forms.TextBox(); + this.useCustomUA_chk = new System.Windows.Forms.CheckBox(); + this.label2 = new System.Windows.Forms.Label(); + this.useMinFontsize_chk = new System.Windows.Forms.CheckBox(); + this.label3 = new System.Windows.Forms.Label(); + this.openHelp_btn = new System.Windows.Forms.Button(); + this.useButtonForwarding = new System.Windows.Forms.CheckBox(); + ((System.ComponentModel.ISupportInitialize)(this.minFontSize_nud)).BeginInit(); + this.groupBox1.SuspendLayout(); + this.SuspendLayout(); + // + // buttonOk + // + this.buttonOk.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonOk.DialogResult = System.Windows.Forms.DialogResult.OK; + this.buttonOk.Location = new System.Drawing.Point(362, 436); + this.buttonOk.Name = "buttonOk"; + this.buttonOk.Size = new System.Drawing.Size(75, 23); + this.buttonOk.TabIndex = 2; + this.buttonOk.Text = "Save"; + this.buttonOk.UseVisualStyleBackColor = true; + this.buttonOk.Click += new System.EventHandler(this.buttonOk_Click); + // + // buttonCancel + // + this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.buttonCancel.Location = new System.Drawing.Point(443, 436); + this.buttonCancel.Name = "buttonCancel"; + this.buttonCancel.Size = new System.Drawing.Size(75, 23); + this.buttonCancel.TabIndex = 2; + this.buttonCancel.Text = "Cancel"; + this.buttonCancel.UseVisualStyleBackColor = true; + // + // imageFileName_Button + // + this.imageFileName_Button.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.imageFileName_Button.Location = new System.Drawing.Point(493, 24); + this.imageFileName_Button.Name = "imageFileName_Button"; + this.imageFileName_Button.Size = new System.Drawing.Size(27, 23); + this.imageFileName_Button.TabIndex = 19; + this.imageFileName_Button.Text = "..."; + this.imageFileName_Button.UseVisualStyleBackColor = true; + this.imageFileName_Button.Click += new System.EventHandler(this.imageFileName_Button_Click); + // + // imageFileName_Editbox + // + this.imageFileName_Editbox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.imageFileName_Editbox.Location = new System.Drawing.Point(15, 26); + this.imageFileName_Editbox.Name = "imageFileName_Editbox"; + this.imageFileName_Editbox.Size = new System.Drawing.Size(472, 20); + this.imageFileName_Editbox.TabIndex = 20; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(12, 9); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(179, 13); + this.label4.TabIndex = 21; + this.label4.Text = "Select the Opera Mobile executable:"; + // + // test_btn + // + this.test_btn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.test_btn.Location = new System.Drawing.Point(15, 436); + this.test_btn.Name = "test_btn"; + this.test_btn.Size = new System.Drawing.Size(52, 23); + this.test_btn.TabIndex = 22; + this.test_btn.Text = "Test"; + this.test_btn.UseVisualStyleBackColor = true; + this.test_btn.Click += new System.EventHandler(this.test_btn_Click); + // + // fullscreen_chk + // + this.fullscreen_chk.AutoSize = true; + this.fullscreen_chk.Location = new System.Drawing.Point(15, 53); + this.fullscreen_chk.Name = "fullscreen_chk"; + this.fullscreen_chk.Size = new System.Drawing.Size(293, 17); + this.fullscreen_chk.TabIndex = 23; + this.fullscreen_chk.Text = "Do not start in fullscreen (clears the -fullscreen argument)"; + this.fullscreen_chk.UseVisualStyleBackColor = true; + // + // touchinterface_chk + // + this.touchinterface_chk.AutoSize = true; + this.touchinterface_chk.Location = new System.Drawing.Point(15, 73); + this.touchinterface_chk.Name = "touchinterface_chk"; + this.touchinterface_chk.Size = new System.Drawing.Size(231, 17); + this.touchinterface_chk.TabIndex = 24; + this.touchinterface_chk.Text = "Use the touch interface (not recommended)"; + this.touchinterface_chk.UseVisualStyleBackColor = true; + // + // customargs_txt + // + this.customargs_txt.Location = new System.Drawing.Point(15, 116); + this.customargs_txt.Name = "customargs_txt"; + this.customargs_txt.Size = new System.Drawing.Size(250, 20); + this.customargs_txt.TabIndex = 25; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 99); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(97, 13); + this.label1.TabIndex = 26; + this.label1.Text = "Custom arguments:"; + // + // widthZoom_txt + // + this.widthZoom_txt.Enabled = false; + this.widthZoom_txt.Location = new System.Drawing.Point(9, 44); + this.widthZoom_txt.Name = "widthZoom_txt"; + this.widthZoom_txt.Size = new System.Drawing.Size(59, 20); + this.widthZoom_txt.TabIndex = 28; + // + // widthZoom_chk + // + this.widthZoom_chk.AutoSize = true; + this.widthZoom_chk.Location = new System.Drawing.Point(9, 24); + this.widthZoom_chk.Name = "widthZoom_chk"; + this.widthZoom_chk.Size = new System.Drawing.Size(279, 17); + this.widthZoom_chk.TabIndex = 29; + this.widthZoom_chk.Text = "Zoom to fit and use minimum width of: (recommended)"; + this.widthZoom_chk.UseVisualStyleBackColor = true; + this.widthZoom_chk.CheckedChanged += new System.EventHandler(this.widthZoom_chk_CheckedChanged); + // + // ApplyOpera_btn + // + this.ApplyOpera_btn.Anchor = System.Windows.Forms.AnchorStyles.Bottom; + this.ApplyOpera_btn.ForeColor = System.Drawing.Color.DarkBlue; + this.ApplyOpera_btn.Location = new System.Drawing.Point(165, 172); + this.ApplyOpera_btn.Name = "ApplyOpera_btn"; + this.ApplyOpera_btn.Size = new System.Drawing.Size(173, 23); + this.ApplyOpera_btn.TabIndex = 30; + this.ApplyOpera_btn.Text = "Apply settings to Opera Mobile"; + this.ApplyOpera_btn.UseVisualStyleBackColor = false; + this.ApplyOpera_btn.Click += new System.EventHandler(this.ApplyOpera_btn_Click); + // + // downloadLink + // + this.downloadLink.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.downloadLink.AutoSize = true; + this.downloadLink.Location = new System.Drawing.Point(343, 416); + this.downloadLink.Name = "downloadLink"; + this.downloadLink.Size = new System.Drawing.Size(165, 13); + this.downloadLink.TabIndex = 31; + this.downloadLink.TabStop = true; + this.downloadLink.Text = "Download Opera Mobile Emulator"; + this.downloadLink.TextAlign = System.Drawing.ContentAlignment.TopRight; + this.downloadLink.Click += new System.EventHandler(this.downloadLink_Click); + // + // minFontSize_nud + // + this.minFontSize_nud.Enabled = false; + this.minFontSize_nud.Location = new System.Drawing.Point(9, 88); + this.minFontSize_nud.Name = "minFontSize_nud"; + this.minFontSize_nud.Size = new System.Drawing.Size(51, 20); + this.minFontSize_nud.TabIndex = 33; + this.minFontSize_nud.Value = new decimal(new int[] { + 10, + 0, + 0, + 0}); + // + // groupBox1 + // + this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox1.Controls.Add(this.setToDesktopUA_btn); + this.groupBox1.Controls.Add(this.customUA_txt); + this.groupBox1.Controls.Add(this.useCustomUA_chk); + this.groupBox1.Controls.Add(this.label2); + this.groupBox1.Controls.Add(this.useMinFontsize_chk); + this.groupBox1.Controls.Add(this.minFontSize_nud); + this.groupBox1.Controls.Add(this.ApplyOpera_btn); + this.groupBox1.Controls.Add(this.widthZoom_txt); + this.groupBox1.Controls.Add(this.widthZoom_chk); + this.groupBox1.Location = new System.Drawing.Point(12, 196); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(505, 201); + this.groupBox1.TabIndex = 34; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "These settings need to be applied first"; + // + // setToDesktopUA_btn + // + this.setToDesktopUA_btn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.setToDesktopUA_btn.Enabled = false; + this.setToDesktopUA_btn.Location = new System.Drawing.Point(406, 133); + this.setToDesktopUA_btn.Name = "setToDesktopUA_btn"; + this.setToDesktopUA_btn.Size = new System.Drawing.Size(88, 23); + this.setToDesktopUA_btn.TabIndex = 38; + this.setToDesktopUA_btn.Text = "Set to desktop"; + this.setToDesktopUA_btn.UseVisualStyleBackColor = true; + this.setToDesktopUA_btn.Click += new System.EventHandler(this.setToDesktopUA_Click); + // + // customUA_txt + // + this.customUA_txt.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.customUA_txt.Enabled = false; + this.customUA_txt.Location = new System.Drawing.Point(9, 135); + this.customUA_txt.Name = "customUA_txt"; + this.customUA_txt.Size = new System.Drawing.Size(391, 20); + this.customUA_txt.TabIndex = 37; + // + // useCustomUA_chk + // + this.useCustomUA_chk.AutoSize = true; + this.useCustomUA_chk.Location = new System.Drawing.Point(9, 114); + this.useCustomUA_chk.Name = "useCustomUA_chk"; + this.useCustomUA_chk.Size = new System.Drawing.Size(276, 17); + this.useCustomUA_chk.TabIndex = 36; + this.useCustomUA_chk.Text = "Use custom User-Agent: (standard is Android/Mobile)"; + this.useCustomUA_chk.UseVisualStyleBackColor = true; + this.useCustomUA_chk.CheckedChanged += new System.EventHandler(this.useCustomUA_chk_CheckedChanged); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(69, 44); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(33, 13); + this.label2.TabIndex = 35; + this.label2.Text = "pixels"; + // + // useMinFontsize_chk + // + this.useMinFontsize_chk.AutoSize = true; + this.useMinFontsize_chk.Location = new System.Drawing.Point(9, 69); + this.useMinFontsize_chk.Name = "useMinFontsize_chk"; + this.useMinFontsize_chk.Size = new System.Drawing.Size(133, 17); + this.useMinFontsize_chk.TabIndex = 34; + this.useMinFontsize_chk.Text = "Use minimum font size:"; + this.useMinFontsize_chk.UseVisualStyleBackColor = true; + this.useMinFontsize_chk.CheckedChanged += new System.EventHandler(this.useMinFontsize_chk_CheckedChanged); + // + // label3 + // + this.label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(14, 416); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(83, 13); + this.label3.TabIndex = 35; + this.label3.Text = "0.3 beta - Dragy"; + // + // openHelp_btn + // + this.openHelp_btn.Location = new System.Drawing.Point(268, 114); + this.openHelp_btn.Name = "openHelp_btn"; + this.openHelp_btn.Size = new System.Drawing.Size(75, 23); + this.openHelp_btn.TabIndex = 36; + this.openHelp_btn.Text = "Open help"; + this.openHelp_btn.UseVisualStyleBackColor = true; + this.openHelp_btn.Click += new System.EventHandler(this.openHelp_btn_Click); + // + // useButtonForwarding + // + this.useButtonForwarding.AutoSize = true; + this.useButtonForwarding.Checked = true; + this.useButtonForwarding.CheckState = System.Windows.Forms.CheckState.Checked; + this.useButtonForwarding.Location = new System.Drawing.Point(15, 145); + this.useButtonForwarding.Name = "useButtonForwarding"; + this.useButtonForwarding.Size = new System.Drawing.Size(445, 30); + this.useButtonForwarding.TabIndex = 37; + this.useButtonForwarding.Text = "Use MP to forward remote buttons to Opera Mobile (T9 typing not yet supported/wor" + + "king)\r\n(External app to re-map buttons is still recommended. Don\'t enable when u" + + "sing such app)\r\n"; + this.useButtonForwarding.UseVisualStyleBackColor = true; + // + // FormSettings + // + this.AcceptButton = this.buttonOk; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.buttonCancel; + this.ClientSize = new System.Drawing.Size(529, 471); + this.Controls.Add(this.useButtonForwarding); + this.Controls.Add(this.openHelp_btn); + this.Controls.Add(this.label3); + this.Controls.Add(this.downloadLink); + this.Controls.Add(this.label1); + this.Controls.Add(this.customargs_txt); + this.Controls.Add(this.touchinterface_chk); + this.Controls.Add(this.fullscreen_chk); + this.Controls.Add(this.test_btn); + this.Controls.Add(this.label4); + this.Controls.Add(this.imageFileName_Editbox); + this.Controls.Add(this.imageFileName_Button); + this.Controls.Add(this.buttonCancel); + this.Controls.Add(this.buttonOk); + this.Controls.Add(this.groupBox1); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "FormSettings"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "Opera Mobile Launcher Settings"; + this.Load += new System.EventHandler(this.FormSettings_Load); + ((System.ComponentModel.ISupportInitialize)(this.minFontSize_nud)).EndInit(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button buttonOk; + private System.Windows.Forms.Button buttonCancel; + private System.Windows.Forms.Button imageFileName_Button; + private System.Windows.Forms.TextBox imageFileName_Editbox; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Button test_btn; + private System.Windows.Forms.CheckBox fullscreen_chk; + private System.Windows.Forms.CheckBox touchinterface_chk; + private System.Windows.Forms.TextBox customargs_txt; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.TextBox widthZoom_txt; + private System.Windows.Forms.CheckBox widthZoom_chk; + private System.Windows.Forms.Button ApplyOpera_btn; + private System.Windows.Forms.LinkLabel downloadLink; + private System.Windows.Forms.NumericUpDown minFontSize_nud; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.CheckBox useMinFontsize_chk; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Button openHelp_btn; + private System.Windows.Forms.TextBox customUA_txt; + private System.Windows.Forms.CheckBox useCustomUA_chk; + private System.Windows.Forms.Button setToDesktopUA_btn; + private System.Windows.Forms.CheckBox useButtonForwarding; + + } +} \ No newline at end of file Added: trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.cs =================================================================== --- trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.cs (rev 0) +++ trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.cs 2012-02-14 20:21:46 UTC (rev 4451) @@ -0,0 +1,256 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Threading; +using System.Windows.Forms; +using MediaPortal.GUI.Library; +//using MediaPortal.Util; +using MediaPortal.Configuration; +using System.Diagnostics; +using System.IO; +using System.Runtime.InteropServices; + +namespace OperaLauncher +{ + public partial class FormSettings : Form + { + public string arguments; + + public FormSettings() + { + InitializeComponent(); + } + + + private void displayDeviceSettings() + { + using (MediaPortal.Profile.Settings xmlReader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + + string Path = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "Path", ""); + bool noFullscreen = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "noFullscreen", false); + bool TouchInferface = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "TouchInferface", false); + string Arguments = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "Arguments", ""); + bool UseZoomWidth = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseZoomWidth", false); + string ZoomWidth = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "ZoomWidth", "950"); + bool UseMinFontSize = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseMinFontSize", false); + string MinFontSize = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "MinFontSize", "9"); + bool UseCustomUserAgent = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseCustomUserAgent", false); + string CustomUserAgent = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "CustomUserAgent", ""); + bool UseButtonForwarding = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseButtonForwarding", true); + + imageFileName_Editbox.Text = Path; + fullscreen_chk.Checked = noFullscreen; + touchinterface_chk.Checked = TouchInferface; + customargs_txt.Text = Arguments; + useButtonForwarding.Checked = UseButtonForwarding; + + widthZoom_txt.Text = ZoomWidth; + if (UseZoomWidth) + { + widthZoom_chk.Checked = true; + widthZoom_txt.Enabled = true; + } + + minFontSize_nud.Value = Convert.ToDecimal(MinFontSize); + if (UseMinFontSize) + { + useMinFontsize_chk.Checked = true; + minFontSize_nud.Enabled = true; + } + + customUA_txt.Text = CustomUserAgent; + if (UseCustomUserAgent) + { + useCustomUA_chk.Checked = true; + customUA_txt.Enabled = true; + setToDesktopUA_btn.Enabled = true; + } + + } + } + private void FormSettings_Load(object sender, EventArgs e) + { + displayDeviceSettings(); + } + + public static void Main() + { + FormSettings frm = new FormSettings(); + if (frm.ShowDialog() == DialogResult.OK) + { + } + } + + private void buttonOk_Click(object sender, EventArgs e) + { + using (MediaPortal.Profile.Settings xmlWriter = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + xmlWriter.SetValue(OperaLauncher.PLUGIN_NAME, "Path", imageFileName_Editbox.Text); + xmlWriter.SetValueAsBool(OperaLauncher.PLUGIN_NAME, "noFullscreen", fullscreen_chk.Checked); + xmlWriter.SetValueAsBool(OperaLauncher.PLUGIN_NAME, "TouchInferface", touchinterface_chk.Checked); + xmlWriter.SetValue(OperaLauncher.PLUGIN_NAME, "Arguments", customargs_txt.Text); + xmlWriter.SetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseZoomWidth", widthZoom_chk.Checked); + xmlWriter.SetValue(OperaLauncher.PLUGIN_NAME, "ZoomWidth", widthZoom_txt.Text); + xmlWriter.SetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseMinFontSize", useMinFontsize_chk.Checked); + xmlWriter.SetValue(OperaLauncher.PLUGIN_NAME, "MinFontSize", minFontSize_nud.Value); + xmlWriter.SetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseCustomUserAgent", useCustomUA_chk.Checked); + xmlWriter.SetValue(OperaLauncher.PLUGIN_NAME, "CustomUserAgent", customUA_txt.Text); + xmlWriter.SetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseButtonForwarding", useButtonForwarding.Checked); + } + } + + private void imageFileName_Button_Click(object sender, EventArgs e) + { + OpenFileDialog fdlg = new OpenFileDialog(); + fdlg.Title = "Select the Opera Mobile Emulator executable"; + fdlg.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); + fdlg.Filter = "Opera Mobile|OperaMobileEmu.exe"; + fdlg.FilterIndex = 2; + fdlg.RestoreDirectory = true; + + if (fdlg.ShowDialog() == DialogResult.OK) + { + imageFileName_Editbox.Text = fdlg.FileName; + } + } + + private void test_btn_Click(object sender, EventArgs e) + { + arguments = ""; + Process opera = new Process(); + if (!fullscreen_chk.Checked) + arguments += " -fullscreen"; + if (touchinterface_chk.Checked) + arguments += " -tabletui"; + else + arguments += " -notouchwithtouchevents"; + + arguments += " "+customargs_txt.Text; + + opera.StartInfo.FileName = imageFileName_Editbox.Text; + opera.StartInfo.WorkingDirectory = Directory.GetParent(imageFileName_Editbox.Text).FullName; + opera.StartInfo.Arguments = arguments; + + try + { + opera.Start(); + } + catch (Exception ex) + { + MessageBox.Show(ex.Message, "Could not start.."); + Log.Error("Start Opera failed: " + ex.Message); + } + } + + private void ApplyOpera_btn_Click(object sender, EventArgs e) + { + //make scripts/user.js file + string operaLocation = Directory.GetParent(imageFileName_Editbox.Text).FullName; + string scriptsFile = System.IO.Path.Combine(operaLocation, @"opera\user.js"); + + // Delete the file if it exists. + if (File.Exists(scriptsFile)) + { + File.Delete(scriptsFile); + } + + // Create the file. + if (!File.Exists(scriptsFile)) + { + using (FileStream fs = File.Create(scriptsFile)) + { + } + } + + // create a writer and open the file + TextWriter tw = new StreamWriter(scriptsFile); + tw.WriteLine("if(" + widthZoom_chk.Checked.ToString().ToLower() + ")"); + tw.WriteLine("{"); + tw.WriteLine("var yourTag=document.createElement('meta');"); + tw.WriteLine("yourTag.name = \"viewport\";"); + tw.WriteLine("yourTag.content = \"width=" + widthZoom_txt.Text + "px;\";"); + tw.WriteLine("document.getElementsByTagName('head')[0].appendChild(yourTag);"); + tw.WriteLine("}"); + tw.Close(); + + string OperaIniFile = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Opera\OperaMobileEmulator\opera.ini"; + + if (File.Exists(OperaIniFile)) + { + IniFile ini = new IniFile(OperaIniFile); + + //write values to opera.ini + ini.IniWriteValue("User Prefs", "User JavaScript", "1"); + ini.IniWriteValue("User Prefs", "User JavaScript File", scriptsFile); + + if (useMinFontsize_chk.Checked) + ini.IniWriteValue("User Prefs", "Minimum Font Size", minFontSize_nud.Value.ToString()); + else + ini.IniWriteValue("User Prefs", "Minimum Font Size", null); + + if (useCustomUA_chk.Checked) + ini.IniWriteValue("User Prefs", "Custom User-Agent", customUA_txt.Text); + else + ini.IniWriteValue("User Prefs", "Custom User-Agent", null); + + } + else + { + MessageBox.Show("Opera Program Data not yet created. Please, press the test button first and try to apply settings again.", "Error Message"); + } + } + + private void widthZoom_chk_CheckedChanged(object sender, EventArgs e) + { + if (widthZoom_chk.Checked) + widthZoom_txt.Enabled = true; + else + widthZoom_txt.Enabled = false; + } + private void useMinFontsize_chk_CheckedChanged(object sender, EventArgs e) + { + if (useMinFontsize_chk.Checked) + minFontSize_nud.Enabled = true; + else + minFontSize_nud.Enabled = false; + } + private void useCustomUA_chk_CheckedChanged(object sender, EventArgs e) + { + if (useCustomUA_chk.Checked) + { + customUA_txt.Enabled = true; + setToDesktopUA_btn.Enabled = true; + } + else + { + customUA_txt.Enabled = false; + setToDesktopUA_btn.Enabled = false; + } + } + + + private void downloadLink_Click(object sender, EventArgs e) + { + Process.Start("http://www.opera.com/developer/tools/mobile/"); + } + + private void openHelp_btn_Click(object sender, EventArgs e) + { + Process opera = new Process(); + opera.StartInfo.FileName = imageFileName_Editbox.Text; + opera.StartInfo.WorkingDirectory = Directory.GetParent(imageFileName_Editbox.Text).FullName; + opera.StartInfo.Arguments = "-?"; + opera.Start(); + } + + private void setToDesktopUA_Click(object sender, EventArgs e) + { + customUA_txt.Text = "Opera/9.80 (Windows NT 6.0; U; en) Presto/2.8.99 Version/11.10"; + } + + } +} \ No newline at end of file Added: trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.resx =================================================================== --- trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.resx (rev 0) +++ trunk/plugins/OperaMobileLauncher/Opera Mobile/FormSettings.resx 2012-02-14 20:21:46 UTC (rev 4451) @@ -0,0 +1,120 @@ +<?xml version="1.0" encoding="utf-8"?> +<root> + <!-- + Microsoft ResX Schema + + Version 2.0 + + The primary goals of this format is to allow a simple XML format + that is mostly human readable. The generation and parsing of the + various data types are done through the TypeConverter classes + associated with the data types. + + Example: + + ... ado.net/XML headers & schema ... + <resheader name="resmimetype">text/microsoft-resx</resheader> + <resheader name="version">2.0</resheader> + <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> + <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> + <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> + <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> + <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> + <value>[base64 mime encoded serialized .NET Framework object]</value> + </data> + <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> + <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> + <comment>This is a comment</comment> + </data> + + There are any number of "resheader" rows that contain simple + name/value pairs. + + Each data row contains a name, and value. The row also contains a + type or mimetype. Type corresponds to a .NET class that support + text/value conversion through the TypeConverter architecture. + Classes that don't support this are serialized and stored with the + mimetype set. + + The mimetype is used for serialized objects, and tells the + ResXResourceReader how to depersist the object. This is currently not + extensible. For a given mimetype the value must be set accordingly: + + Note - application/x-microsoft.net.object.binary.base64 is the format + that the ResXResourceWriter will generate, however the reader can + read any of the formats listed below. + + mimetype: application/x-microsoft.net.object.binary.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.soap.base64 + value : The object must be serialized with + : System.Runtime.Serialization.Formatters.Soap.SoapFormatter + : and then encoded with base64 encoding. + + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> + <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> + <xsd:element name="root" msdata:IsDataSet="true"> + <xsd:complexType> + <xsd:choice maxOccurs="unbounded"> + <xsd:element name="metadata"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" /> + </xsd:sequence> + <xsd:attribute name="name" use="required" type="xsd:string" /> + <xsd:attribute name="type" type="xsd:string" /> + <xsd:attribute name="mimetype" type="xsd:string" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="assembly"> + <xsd:complexType> + <xsd:attribute name="alias" type="xsd:string" /> + <xsd:attribute name="name" type="xsd:string" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="data"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> + <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> + <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> + <xsd:attribute ref="xml:space" /> + </xsd:complexType> + </xsd:element> + <xsd:element name="resheader"> + <xsd:complexType> + <xsd:sequence> + <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> + </xsd:sequence> + <xsd:attribute name="name" type="xsd:string" use="required" /> + </xsd:complexType> + </xsd:element> + </xsd:choice> + </xsd:complexType> + </xsd:element> + </xsd:schema> + <resheader name="resmimetype"> + <value>text/microsoft-resx</value> + </resheader> + <resheader name="version"> + <value>2.0</value> + </resheader> + <resheader name="reader"> + <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> + <resheader name="writer"> + <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> + </resheader> +</root> \ No newline at end of file Added: trunk/plugins/OperaMobileLauncher/Opera Mobile/IniFile.cs =================================================================== --- trunk/plugins/OperaMobileLauncher/Opera Mobile/IniFile.cs (rev 0) +++ trunk/plugins/OperaMobileLauncher/Opera Mobile/IniFile.cs 2012-02-14 20:21:46 UTC (rev 4451) @@ -0,0 +1,56 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; + + public class IniFile + { + public string path; + + [DllImport("kernel32")] + private static extern long WritePrivateProfileString(string section, + string key, string val, string filePath); + [DllImport("kernel32")] + private static extern int GetPrivateProfileString(string section, + string key, string def, StringBuilder retVal, int size, string filePath); + + /// <summary> + /// INIFile Constructor. + /// </summary> + /// <PARAM name="INIPath"></PARAM> + + public IniFile(string INIPath) + { + path = INIPath; + } + /// <summary> + /// Write Data to the INI File + /// </summary> + /// <PARAM name="Section"></PARAM> + /// Section name + /// <PARAM name="Key"></PARAM> + /// Key Name + /// <PARAM name="Value"></PARAM> + /// Value Name + + public void IniWriteValue(string Section, string Key, string Value) + { + WritePrivateProfileString(Section, Key, Value, this.path); + } + + /// <summary> + /// Read Data Value From the Ini File + /// </summary> + /// <PARAM name="Section"></PARAM> + /// <PARAM name="Key"></PARAM> + /// <PARAM name="Path"></PARAM> + /// <returns></returns> + + public string IniReadValue(string Section, string Key) + { + StringBuilder temp = new StringBuilder(255); + int i = GetPrivateProfileString(Section, Key, "", temp, + 255, this.path); + return temp.ToString(); + + } + } Added: trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs =================================================================== --- trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs (rev 0) +++ trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs 2012-02-14 20:21:46 UTC (rev 4451) @@ -0,0 +1,299 @@ +using System; +using System.Diagnostics; +using MediaPortal.GUI.Library; +using MediaPortal.Configuration; +using System.IO; +using System.Windows.Forms; +using System.Runtime.InteropServices; + +namespace OperaLauncher +{ + [PluginIcons("OperaLauncher.opera-logo.png", "OperaLauncher.opera-logo_disabled.png")] + + public class OperaLauncher : GUIWindow, ISetupForm + { + public const string PLUGIN_NAME = "Opera Mobile Launcher"; + public string Path; + public bool noFullscreen; + public bool TouchInferface; + public string Arguments; + public bool UseButtonForwarding; + + [DllImport("user32.dll")] + public static extern int FindWindow( + string lpClassName, // class name + string lpWindowName // window name + ); + + [DllImport("user32.dll")] + public static extern int SendMessage( + int hWnd, // handle to destination window + uint Msg, // message + int wParam, // first message parameter + int lParam // second message parameter + ); + + [DllImport("user32.dll")] + private static extern bool ShowWindowAsync(int hWnd, int nCmdShow); + + [DllImport("user32.dll")] + private static extern bool BringWindowToTop(int hWnd); + + [DllImport("user32.dll")] + private static extern bool EnableWindow(int hWnd, bool bEnable); + + [DllImport("user32.dll")] + private static extern int SetFocus(int hWnd); + + + const int WM_KEYDOWN = 0x0100; + const int WM_KEYUP = 0x0101; + const int WM_APPCOMMAND = 0x0319; + const int SW_HIDE = 0; + const int SW_SHOWNORMAL = 1; + const int SW_SHOWMINIMIZED = 2; + const int SW_SHOWMAXIMIZED = 3; + const int SW_RESTORE = 9; + const int VK_F1 = 0x70; + const int VK_F2 = 0x71; + const int VK_NUMPAD0 = 0x60; + const int VK_NUMPAD1 = 0x61; + const int VK_NUMPAD2 = 0x62; + const int VK_NUMPAD3 = 0x63; + const int VK_NUMPAD4 = 0x64; + const int VK_NUMPAD5 = 0x65; + const int VK_NUMPAD6 = 0x66; + const int VK_NUMPAD7 = 0x67; + const int VK_NUMPAD8 = 0x68; + const int VK_NUMPAD9 = 0x69; + + ProcessStartInfo startInfo = new ProcessStartInfo(); + Process opera = new Process(); + public OperaLauncher() + { + using (MediaPortal.Profile.Settings xmlReader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + Path = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "Path", ""); + noFullscreen = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "noFullscreen", false); + TouchInferface = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "TouchInferface", false); + Arguments = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "Arguments", ""); + UseButtonForwarding = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseButtonForwarding", true); + } + } + + protected override void OnPageLoad() + { + string strUrl = GUIPropertyManager.GetProperty("#browserlink"); + startOpera(strUrl); + + if(!UseButtonForwarding) + GUIWindowManager.ShowPreviousWindow(); + base.OnPageLoad(); + } + + protected override void OnPageDestroy(int newWindowId) + { + //close opera + opera.CloseMainWindow(); + + /*int WindowToFind = FindWindow("WindowsForms10.Window.8.app.0.2386859", null); + bool test = ShowWindowAsync(WindowToFind, SW_RESTORE);*/ + } + + public void startOpera(string strUrl = null) + { + string arguments = ""; + if (!noFullscreen) + arguments += " -fullscreen"; + if (TouchInferface) + arguments += " -tabletui"; + else + arguments += " -notouchwithtouchevents"; + + arguments += " " + Arguments; + + opera.StartInfo.FileName = @Path; + opera.StartInfo.WorkingDirectory = Directory.GetParent(Path).FullName; + if (strUrl != null) + opera.StartInfo.Arguments = arguments + " -url " + strUrl; + else + opera.StartInfo.Arguments = arguments; + + try + { + opera.Start(); + + int OperaHandle = FindWindow("QWidget", null); + bool top = BringWindowToTop(OperaHandle); + + if (UseButtonForwarding) + { + int MPHandle = FindWindow("WindowsForms10.Window.8.app.0.2386859", null); + int disableinput = SetFocus(MPHandle); + Log.Info("Set focus: (MP Handle: " + MPHandle.ToString() + ", Focus: " + disableinput + ")"); + } + //bool test = ShowWindowAsync(WindowToFind, SW_HIDE); + Cursor.Hide(); + } + catch (Exception ex) + { + Log.Error("Start Opera failed: " + ex.Message); + Cursor.Show(); + } + } + + + public override void OnAction(MediaPortal.GUI.Library.Action action) + { + if (UseButtonForwarding) + { + int WindowToFind = FindWindow("QWidget", null); + + switch (action.wID) + { + case MediaPortal.GUI.Library.Action.ActionType.ACTION_CONTEXT_MENU: + GUIPropertyManager.SetProperty("#keypressed", "Info"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_F1, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_F1, 0); + break; + + case MediaPortal.GUI.Library.Action.ActionType.ACTION_PREV_ITEM: + GUIPropertyManager.SetProperty("#keypressed", "Replay"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_F2, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_F2, 0); + break; + + case MediaPortal.GUI.Library.Action.ActionType.ACTION_PAGE_UP: + GUIPropertyManager.SetProperty("#keypressed", "Channel Up"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD8, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD8, 0); + break; + + case MediaPortal.GUI.Library.Action.ActionType.ACTION_PAGE_DOWN: + GUIPropertyManager.SetProperty("#keypressed", "Channel Down"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD2, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD2, 0); + break; + + case MediaPortal.GUI.Library.Action.ActionType.REMOTE_0: + GUIPropertyManager.SetProperty("#keypressed", "0"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD0, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD0, 0); + break; + case MediaPortal.GUI.Library.Action.ActionType.REMOTE_1: + GUIPropertyManager.SetProperty("#keypressed", "1"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD1, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD1, 0); + break; + case MediaPortal.GUI.Library.Action.ActionType.REMOTE_2: + GUIPropertyManager.SetProperty("#keypressed", "2"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD2, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD2, 0); + break; + } + } + base.OnAction(action); + } + + + public override bool Init() //bij het laden van MediaPortal + { + Log.Debug("Init Opera Mobile Launcher"); + if (UseButtonForwarding) + return Load(GUIGraphicsContext.Skin + @"\OperaMobile.xml"); + else + return true; + } + + #region ISetupForm Members + + // Returns the name of the plugin which is shown in the plugin menu + public string PluginName() + { + return PLUGIN_NAME; + } + + // Returns the description of the plugin is shown in the plugin menu + public string Description() + { + return "Starts Opera Mobile Emulator from MediaPortal"; + } + + // Returns the author of the plugin which is shown in the plugin menu + public string Author() + { + return "Dragy"; + } + + // show the setup dialog + public void ShowPlugin() + { + FormSettings frm = new FormSettings(); + frm.ShowDialog(); + } + + // Indicates whether plugin can be enabled/disabled + public bool CanEnable() + { + return true; + } + + // Get Windows-ID + public int GetWindowId() + { + // WindowID of windowplugin belonging to this setup + // enter your own unique code + return 156778; + } + + // Indicates if plugin is enabled by default; + public bool DefaultEnabled() + { + return true; + } + + // indicates if a plugin has it's own setup screen + public bool HasSetup() + { + return true; + } + + /// <summary> + /// If the plugin should have it's own button on the main menu of MediaPortal 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 it's own button on home + /// false : plugin does not need it's own button on home</returns> + + public bool GetHome(out string strButtonText, out string strButtonImage, out string strButtonImageFocus, out string strPictureImage) + { + strButtonText = "Opera Mobile"; + strButtonImage = String.Empty; + strButtonImageFocus = String.Empty; + strPictureImage = String.Empty; + return true; + } + + // With GetID it will be an window-plugin / otherwise a process-plugin + // Enter the id number here again + public override int GetID + { + get + { + return 156778; + } + + set + { + } + } + + #endregion + + } +} \ No newline at end of file Added: trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs.bak =================================================================== --- trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs.bak (rev 0) +++ trunk/plugins/OperaMobileLauncher/Opera Mobile/OperaLauncher.cs.bak 2012-02-14 20:21:46 UTC (rev 4451) @@ -0,0 +1,260 @@ +using System; +using System.Diagnostics; +using MediaPortal.GUI.Library; +using MediaPortal.Configuration; +using System.IO; +using System.Windows.Forms; +using System.Runtime.InteropServices; + +namespace OperaLauncher +{ + [PluginIcons("OperaLauncher.opera-logo.png", "OperaLauncher.opera-logo_disabled.png")] + + public class OperaLauncher : GUIWindow, ISetupForm + { + public const string PLUGIN_NAME = "Opera Mobile Launcher"; + public string Path; + public bool noFullscreen; + public bool TouchInferface; + public string Arguments; + public bool UseButtonForwarding; + + [DllImport("user32.dll")] + public static extern int FindWindow( + string lpClassName, // class name + string lpWindowName // window name + ); + + [DllImport("user32.dll")] + public static extern int SendMessage( + int hWnd, // handle to destination window + uint Msg, // message + int wParam, // first message parameter + int lParam // second message parameter + ); + + const int WM_KEYDOWN = 0x0100; + const int WM_KEYUP = 0x0101; + //const int WM_APPCOMMAND = 0x0319; + const int VK_F1 = 0x70; + const int VK_F2 = 0x71; + const int VK_NUMPAD0 = 0x60; + const int VK_NUMPAD1 = 0x61; + const int VK_NUMPAD2 = 0x62; + const int VK_NUMPAD3 = 0x63; + const int VK_NUMPAD4 = 0x64; + const int VK_NUMPAD5 = 0x65; + const int VK_NUMPAD6 = 0x66; + const int VK_NUMPAD7 = 0x67; + const int VK_NUMPAD8 = 0x68; + const int VK_NUMPAD9 = 0x69; + + ProcessStartInfo startInfo = new ProcessStartInfo(); + Process opera = new Process(); + public OperaLauncher() + { + using (MediaPortal.Profile.Settings xmlReader = new MediaPortal.Profile.Settings(Config.GetFile(Config.Dir.Config, "MediaPortal.xml"))) + { + Path = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "Path", ""); + noFullscreen = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "noFullscreen", false); + TouchInferface = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "TouchInferface", false); + Arguments = xmlReader.GetValueAsString(OperaLauncher.PLUGIN_NAME, "Arguments", ""); + UseButtonForwarding = xmlReader.GetValueAsBool(OperaLauncher.PLUGIN_NAME, "UseButtonForwarding", true); + } + } + + protected override void OnPageLoad() + { + string strUrl = GUIPropertyManager.GetProperty("#browserlink"); + startOpera(strUrl); + + if(!UseButtonForwarding) + GUIWindowManager.ShowPreviousWindow(); + base.OnPageLoad(); + } + + protected override void OnPageDestroy(int newWindowId) + { + //close opera + opera.CloseMainWindow(); + } + + public void startOpera(string strUrl = null) + { + string arguments = ""; + if (!noFullscreen) + arguments += " -fullscreen"; + if (TouchInferface) + arguments += " -tabletui"; + else + arguments += " -notouchwithtouchevents"; + + arguments += " " + Arguments; + + opera.StartInfo.FileName = @Path; + opera.StartInfo.WorkingDirectory = Directory.GetParent(Path).FullName; + if (strUrl != null) + opera.StartInfo.Arguments = arguments + " -url " + strUrl; + else + opera.StartInfo.Arguments = arguments; + + try + { + opera.Start(); + } + catch (Exception ex) + { + Log.Error("Start Opera failed: " + ex.Message); + } + } + + + public override void OnAction(MediaPortal.GUI.Library.Action action) + { + if (UseButtonForwarding) + { + int WindowToFind = FindWindow("QWidget", null); + + switch (action.wID) + { + case MediaPortal.GUI.Library.Action.ActionType.ACTION_CONTEXT_MENU: + GUIPropertyManager.SetProperty("#keypressed", "Info"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_F1, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_F1, 0); + break; + + case MediaPortal.GUI.Library.Action.ActionType.ACTION_PREV_ITEM: + GUIPropertyManager.SetProperty("#keypressed", "Replay"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_F2, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_F2, 0); + break; + + case MediaPortal.GUI.Library.Action.ActionType.ACTION_PAGE_UP: + GUIPropertyManager.SetProperty("#keypressed", "Channel Up"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD8, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD8, 0); + break; + + case MediaPortal.GUI.Library.Action.ActionType.ACTION_PAGE_DOWN: + GUIPropertyManager.SetProperty("#keypressed", "Channel Down"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD2, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD2, 0); + break; + + case MediaPortal.GUI.Library.Action.ActionType.REMOTE_0: + GUIPropertyManager.SetProperty("#keypressed", "0"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD0, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD0, 0); + break; + case MediaPortal.GUI.Library.Action.ActionType.REMOTE_1: + GUIPropertyManager.SetProperty("#keypressed", "1"); + SendMessage(WindowToFind, WM_KEYDOWN, VK_NUMPAD1, 0); + SendMessage(WindowToFind, WM_KEYUP, VK_NUMPAD1, 0); + break; + } + } + base.OnAction(action); + } + + + public override bool Init() //bij het laden van MediaPortal + { + Log.Debug("Init Opera Mobile Launcher"); + if (UseButtonForwarding) + return Load(GUIGraphicsContext.Skin + @"\OperaMobile.xml")... [truncated message content] |