Browse Source

removed the tip of the day dialog

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@1946 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Markus Palme 19 years ago
parent
commit
9c565052a2
  1. 5
      AddIns/ICSharpCode.SharpDevelop.addin
  2. 6
      data/options/TipsOfTheDay.xml
  3. 4
      src/AddIns/DisplayBindings/IconEditor/IconEditor/IconEditor.csproj
  4. 4
      src/Libraries/ICSharpCode.TextEditor/Project/ICSharpCode.TextEditor.csproj
  5. 4
      src/Libraries/NRefactory/Project/NRefactory.csproj
  6. 3
      src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj
  7. 21
      src/Main/Base/Project/Src/Commands/AutostartCommands.cs
  8. 11
      src/Main/Base/Project/Src/Commands/HelpCommands.cs
  9. 188
      src/Main/Base/Project/Src/Gui/Dialogs/TipOfTheDay.cs
  10. 4
      src/Main/Core/Project/ICSharpCode.Core.csproj
  11. 1
      src/Main/ICSharpCode.SharpDevelop.Sda/Src/CallHelper.cs

5
AddIns/ICSharpCode.SharpDevelop.addin

@ -1573,11 +1573,6 @@ @@ -1573,11 +1573,6 @@
label = "${res:XML.MainMenu.HelpMenu.Topics}"
shortcut = "Alt|F1"
link = "http://wiki.sharpdevelop.net/"/>
<MenuItem id = "TipOfTheDay"
label = "${res:XML.MainMenu.HelpMenu.Tips}"
icon = "Icons.16x16.TipOfTheDay"
class = "ICSharpCode.SharpDevelop.Commands.ViewTipOfTheDay" />
<MenuItem id = "Separator1" type = "Separator" />
<MenuItem id = "ViewReadme"
label = "${res:XML.MainMenu.HelpMenu.ReadMe}"

6
data/options/TipsOfTheDay.xml

@ -1,6 +0,0 @@ @@ -1,6 +0,0 @@
<?xml version="1.0"?>
<TIPS>
<TIP>${res:XML.StartupTips.Tip1}</TIP>
<TIP>${res:XML.StartupTips.Tip2}</TIP>
<TIP>${res:XML.StartupTips.Tip3}</TIP>
</TIPS>

4
src/AddIns/DisplayBindings/IconEditor/IconEditor/IconEditor.csproj

@ -15,7 +15,6 @@ @@ -15,7 +15,6 @@
<FileAlignment>4096</FileAlignment>
<WarningLevel>4</WarningLevel>
<TreatWarningsAsErrors>false</TreatWarningsAsErrors>
<PreBuildEvent>..\..\..\..\src\Tools\UpdateAssemblyInfo\bin\Debug\UpdateAssemblyInfo.exe</PreBuildEvent>
<RunPostBuildEvent>Always</RunPostBuildEvent>
<OutputPath>..\..\..\..\..\AddIns\AddIns\DisplayBindings\IconEditor\</OutputPath>
</PropertyGroup>
@ -74,4 +73,7 @@ @@ -74,4 +73,7 @@
</Compile>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.Targets" />
<PropertyGroup>
<PreBuildEvent>..\..\..\..\src\Tools\UpdateAssemblyInfo\bin\Debug\UpdateAssemblyInfo.exe</PreBuildEvent>
</PropertyGroup>
</Project>

4
src/Libraries/ICSharpCode.TextEditor/Project/ICSharpCode.TextEditor.csproj

@ -20,7 +20,6 @@ @@ -20,7 +20,6 @@
<BaseAddress>98041856</BaseAddress>
<PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>4096</FileAlignment>
<PreBuildEvent>..\src\Tools\UpdateAssemblyInfo\bin\Debug\UpdateAssemblyInfo.exe</PreBuildEvent>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<Optimize>False</Optimize>
@ -205,4 +204,7 @@ @@ -205,4 +204,7 @@
<Compile Include="Src\Document\HighlightingStrategy\SpanStack.cs" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<PropertyGroup>
<PreBuildEvent>..\src\Tools\UpdateAssemblyInfo\bin\Debug\UpdateAssemblyInfo.exe</PreBuildEvent>
</PropertyGroup>
</Project>

4
src/Libraries/NRefactory/Project/NRefactory.csproj

@ -21,7 +21,6 @@ @@ -21,7 +21,6 @@
<BaseAddress>94896128</BaseAddress>
<PlatformTarget>AnyCPU</PlatformTarget>
<FileAlignment>4096</FileAlignment>
<PreBuildEvent>..\src\Tools\UpdateAssemblyInfo\bin\Debug\UpdateAssemblyInfo.exe</PreBuildEvent>
<RunCodeAnalysis>False</RunCodeAnalysis>
<CodeAnalysisRules>-Microsoft.Design#CA1002;-Microsoft.Design#CA1020;-Microsoft.Design#CA1051;-Microsoft.Design#CA1062;-Microsoft.Globalization#CA1303;-Microsoft.Globalization#CA1305;-Microsoft.Naming#CA1704;-Microsoft.Performance#CA1800;-Microsoft.Performance#CA1805;-Microsoft.Usage#CA2211;-Microsoft.Usage#CA2227</CodeAnalysisRules>
</PropertyGroup>
@ -150,4 +149,7 @@ @@ -150,4 +149,7 @@
<Folder Include="Src\Ast\General" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<PropertyGroup>
<PreBuildEvent>..\src\Tools\UpdateAssemblyInfo\bin\Debug\UpdateAssemblyInfo.exe</PreBuildEvent>
</PropertyGroup>
</Project>

3
src/Main/Base/Project/ICSharpCode.SharpDevelop.csproj

@ -161,9 +161,6 @@ @@ -161,9 +161,6 @@
<Compile Include="Src\Gui\Dialogs\TabbedOptions.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\TipOfTheDay.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Src\Gui\Dialogs\TreeViewOptions.cs">
<SubType>Form</SubType>
</Compile>

21
src/Main/Base/Project/Src/Commands/AutostartCommands.cs

@ -19,23 +19,6 @@ namespace ICSharpCode.SharpDevelop.Commands @@ -19,23 +19,6 @@ namespace ICSharpCode.SharpDevelop.Commands
{
const string workbenchMemento = "WorkbenchMemento";
public bool AllowTipOfTheDay = true;
public bool TipOfTheDayDefault = true;
/// <remarks>
/// The worst workaround in the whole project
/// </remarks>
void ShowTipOfTheDay(object sender, EventArgs e)
{
Application.Idle -= ShowTipOfTheDay;
// show tip of the day
if (PropertyService.Get("ShowTipsAtStartup", TipOfTheDayDefault)) {
ViewTipOfTheDay dview = new ViewTipOfTheDay();
dview.Run();
}
}
class FormKeyHandler : IMessageFilter
{
const int keyPressedMessage = 0x100;
@ -97,10 +80,6 @@ namespace ICSharpCode.SharpDevelop.Commands @@ -97,10 +80,6 @@ namespace ICSharpCode.SharpDevelop.Commands
Form f = (Form)WorkbenchSingleton.Workbench;
f.Show();
if (AllowTipOfTheDay) {
Application.Idle += ShowTipOfTheDay;
}
bool didLoadCombineOrFile = false;
foreach (string file in fileList) {

11
src/Main/Base/Project/Src/Commands/HelpCommands.cs

@ -59,17 +59,6 @@ namespace ICSharpCode.SharpDevelop.Commands @@ -59,17 +59,6 @@ namespace ICSharpCode.SharpDevelop.Commands
}
}
public class ViewTipOfTheDay : AbstractMenuCommand
{
public override void Run()
{
using (TipOfTheDayDialog totdd = new TipOfTheDayDialog()) {
totdd.Owner = (Form)WorkbenchSingleton.Workbench;
totdd.ShowDialog(ICSharpCode.SharpDevelop.Gui.WorkbenchSingleton.MainForm);
}
}
}
public class AboutSharpDevelop : AbstractMenuCommand
{
public override void Run()

188
src/Main/Base/Project/Src/Gui/Dialogs/TipOfTheDay.cs

@ -1,188 +0,0 @@ @@ -1,188 +0,0 @@
// <file>
// <copyright see="prj:///doc/copyright.txt"/>
// <license see="prj:///doc/license.txt"/>
// <owner name="Mike Krüger" email="mike@icsharpcode.net"/>
// <version>$Revision$</version>
// </file>
using System;
using System.Drawing;
using System.ComponentModel;
using System.Resources;
using System.Windows.Forms;
using System.Xml;
using System.IO;
using ICSharpCode.Core;
namespace ICSharpCode.SharpDevelop.Gui
{
public class TipOfTheDayView : UserControl
{
readonly int ICON_DISTANCE = 16;
Bitmap icon = null;
Font titlefont;
Font textfont;
string[] tips;
int curtip = 0;
string didyouknowtext;
public TipOfTheDayView(XmlElement el)
{
titlefont = ResourceService.LoadFont("Times new Roman", 15, FontStyle.Bold);
textfont = ResourceService.LoadFont("Times new Roman", 12);
this.didyouknowtext = ResourceService.GetString("Dialog.TipOfTheDay.DidYouKnowText");
icon = ResourceService.GetBitmap("Icons.TipOfTheDayIcon");
// XmlNodeList nodes = el.GetElementsByTagName("TIP");
XmlNodeList nodes = el.ChildNodes;
tips = new string[nodes.Count];
for (int i = 0; i < nodes.Count; ++i) {
tips[i] = StringParser.Parse(nodes[i].InnerText);
}
curtip = (new Random().Next()) % nodes.Count;
}
protected override void OnPaintBackground(PaintEventArgs pe)
{
}
protected override void OnPaint(PaintEventArgs pe)
{
Graphics g = pe.Graphics;
g.FillRectangle(Brushes.Gray, 0,
0,
icon.Width + ICON_DISTANCE,
Height);
g.FillRectangle(Brushes.White, 0 + icon.Width + ICON_DISTANCE,
0,
Width - icon.Width - ICON_DISTANCE,
Height);
g.DrawImage(icon, 2 + ICON_DISTANCE / 2, 4);
g.DrawString(didyouknowtext, titlefont, Brushes.Black, icon.Width + ICON_DISTANCE + 4, 8);
g.DrawLine(Pens.Black, new Point(icon.Width + ICON_DISTANCE, 8 + titlefont.Height + 2),
new Point(Width, 8 + titlefont.Height + 2));
drawrect = new Rectangle(icon.Width + ICON_DISTANCE, 8 + titlefont.Height + 6,
Width - icon.Width - ICON_DISTANCE, Height - (8 + titlefont.Height + 6));
g.DrawString(tips[curtip], textfont, Brushes.Black, drawrect);
}
Rectangle drawrect;
public void NextTip()
{
curtip = (curtip + 1) % tips.Length;
Invalidate(drawrect);
Update();
}
}
public class TipOfTheDayDialog : Form
{
CheckBox viewTipsAtStartCheckBox;
Button closeButton;
Button nextTipButton;
Panel panel = new Panel();
TipOfTheDayView tipview;
void NextTip(object sender, EventArgs e)
{
tipview.NextTip();
}
void CheckChange(object sender, EventArgs e)
{
PropertyService.Set("ShowTipsAtStartup", viewTipsAtStartCheckBox.Checked);
}
public TipOfTheDayDialog()
{
InitializeComponent();
StartPosition = FormStartPosition.CenterScreen;
Icon = null;
XmlDocument doc = new XmlDocument();
doc.Load(PropertyService.DataDirectory +
Path.DirectorySeparatorChar + "options" +
Path.DirectorySeparatorChar + "TipsOfTheDay.xml" );
tipview = new TipOfTheDayView(doc.DocumentElement);
panel.Controls.Add(tipview);
// panel.FormBorderStyle = FormBorderStyle.Fixed3D;
Controls.Add(panel);
panel.Width = tipview.Width = Width - 24;
panel.Height = tipview.Height = nextTipButton.Top - 15;
panel.Location = new Point(8, 5);
nextTipButton.Click += new EventHandler(NextTip);
viewTipsAtStartCheckBox.CheckedChanged += new EventHandler(CheckChange);
viewTipsAtStartCheckBox.Checked = PropertyService.Get("ShowTipsAtStartup", true);
MaximizeBox = MinimizeBox = false;
ShowInTaskbar = false;
RightToLeftConverter.ConvertRecursive(this);
}
void ExitDialog(object sender, EventArgs e)
{
Close();
Dispose();
}
private void InitializeComponent()
{
this.closeButton = new Button();
this.viewTipsAtStartCheckBox = new CheckBox();
this.nextTipButton = new Button();
closeButton.Location = new System.Drawing.Point(328, 232);
closeButton.Click += new EventHandler(ExitDialog);
closeButton.Size = new System.Drawing.Size(80, 24);
closeButton.TabIndex = 1;
closeButton.Text = ResourceService.GetString("Global.CloseButtonText");
closeButton.FlatStyle = FlatStyle.System;
viewTipsAtStartCheckBox.Location = new System.Drawing.Point(8, 232);
viewTipsAtStartCheckBox.Text = ResourceService.GetString("Dialog.TipOfTheDay.checkBox1Text");
viewTipsAtStartCheckBox.Size = new System.Drawing.Size(210, 24);
// viewTipsAtStartCheckBox.AccessibleRole = AccessibleRoles.CheckButton;
viewTipsAtStartCheckBox.TabIndex = 2;
viewTipsAtStartCheckBox.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
viewTipsAtStartCheckBox.FlatStyle = FlatStyle.System;
this.Text = ResourceService.GetString("Dialog.TipOfTheDay.DialogName");
//@design this.TrayLargeIcon = true;
this.FormBorderStyle = FormBorderStyle.FixedDialog;
//@design this.TrayHeight = 0;
this.ClientSize = new System.Drawing.Size(418, 263);
nextTipButton.Location = new System.Drawing.Point(240 - 16, 232);
nextTipButton.Size = new System.Drawing.Size(96, 24);
nextTipButton.TabIndex = 0;
nextTipButton.Text = ResourceService.GetString("Dialog.TipOfTheDay.button1Text");
nextTipButton.FlatStyle = FlatStyle.System;
this.Controls.Add(viewTipsAtStartCheckBox);
this.Controls.Add(closeButton);
this.Controls.Add(nextTipButton);
}
}
}

4
src/Main/Core/Project/ICSharpCode.Core.csproj

@ -14,7 +14,6 @@ @@ -14,7 +14,6 @@
<SignAssembly>true</SignAssembly>
<AssemblyOriginatorKeyFile>..\..\ICSharpCode.SharpDevelop.snk</AssemblyOriginatorKeyFile>
<BaseAddress>83886080</BaseAddress>
<PreBuildEvent>..\src\Tools\UpdateAssemblyInfo\bin\Debug\UpdateAssemblyInfo.exe</PreBuildEvent>
<RunPostBuildEvent>Always</RunPostBuildEvent>
<DelaySign>False</DelaySign>
<AssemblyOriginatorKeyMode>File</AssemblyOriginatorKeyMode>
@ -163,4 +162,7 @@ @@ -163,4 +162,7 @@
</Content>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" />
<PropertyGroup>
<PreBuildEvent>..\src\Tools\UpdateAssemblyInfo\bin\Debug\UpdateAssemblyInfo.exe</PreBuildEvent>
</PropertyGroup>
</Project>

1
src/Main/ICSharpCode.SharpDevelop.Sda/Src/CallHelper.cs

@ -117,7 +117,6 @@ namespace ICSharpCode.SharpDevelop.Sda @@ -117,7 +117,6 @@ namespace ICSharpCode.SharpDevelop.Sda
// finally start the workbench.
try {
StartWorkbenchCommand wbc = new StartWorkbenchCommand();
wbc.AllowTipOfTheDay = wbSettings.UseTipOfTheDay;
callback.BeforeRunWorkbench();
if (Debugger.IsAttached) {
wbc.Run(wbSettings.InitialFileList);

Loading…
Cancel
Save