[Monodevelop-patches-list] r740 - in trunk/MonoDevelop: data/resources/glade src/Main/Base/Commands src/Main/Base/Gui/Dialogs
commit-watcher at mono-cvs.ximian.com
commit-watcher at mono-cvs.ximian.com
Sun Feb 1 07:16:44 EST 2004
Author: jzwart
Date: 2004-02-01 07:16:44 -0500 (Sun, 01 Feb 2004)
New Revision: 740
Modified:
trunk/MonoDevelop/data/resources/glade/Base.glade
trunk/MonoDevelop/src/Main/Base/Commands/AutostartCommands.cs
trunk/MonoDevelop/src/Main/Base/Commands/HelpCommands.cs
trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/TipOfTheDay.cs
Log:
HIG'ified Tip Of The Day window.
Modified: trunk/MonoDevelop/data/resources/glade/Base.glade
===================================================================
--- trunk/MonoDevelop/data/resources/glade/Base.glade 2004-02-01 01:37:34 UTC (rev 739)
+++ trunk/MonoDevelop/data/resources/glade/Base.glade 2004-02-01 12:16:44 UTC (rev 740)
@@ -12,6 +12,11 @@
<property name="modal">False</property>
<property name="resizable">False</property>
<property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="has_separator">True</property>
<child internal-child="vbox">
@@ -33,6 +38,7 @@
<property name="label">gtk-cancel</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="response_id">-6</property>
<signal name="clicked" handler="CancelEvent" last_modification_time="Thu, 15 Jan 2004 07:06:35 GMT"/>
</widget>
@@ -46,6 +52,7 @@
<property name="label">gtk-ok</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="response_id">-5</property>
<signal name="clicked" handler="AcceptEvent" last_modification_time="Thu, 15 Jan 2004 07:06:24 GMT"/>
</widget>
@@ -204,6 +211,11 @@
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">True</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="has_separator">True</property>
<child internal-child="vbox">
@@ -225,6 +237,7 @@
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="response_id">-6</property>
<signal name="clicked" handler="cancelClicked" last_modification_time="Sat, 17 Jan 2004 16:47:11 GMT"/>
</widget>
@@ -239,6 +252,7 @@
<property name="label">gtk-new</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="response_id">-5</property>
<signal name="clicked" handler="OpenEvent" last_modification_time="Sat, 17 Jan 2004 16:46:13 GMT"/>
</widget>
@@ -602,6 +616,7 @@
<property name="label" translatable="yes">Create seperate c_ombine subdirectory</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">True</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -699,6 +714,11 @@
<property name="default_height">400</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">True</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="has_separator">True</property>
<child internal-child="vbox">
@@ -720,6 +740,7 @@
<property name="label">gtk-cancel</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="response_id">-6</property>
</widget>
</child>
@@ -732,6 +753,7 @@
<property name="label">gtk-ok</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="response_id">-5</property>
</widget>
</child>
@@ -854,6 +876,7 @@
<property name="label">gtk-remove</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<signal name="clicked" handler="RemoveReference" last_modification_time="Sat, 17 Jan 2004 22:02:58 GMT"/>
</widget>
</child>
@@ -890,6 +913,11 @@
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<child>
<widget class="GtkVBox" id="vbox8">
@@ -964,6 +992,7 @@
<property name="label" translatable="yes">_Start code block on the same line</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -982,6 +1011,7 @@
<property name="label" translatable="yes">_Else on same line as closing bracket</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1000,6 +1030,7 @@
<property name="label" translatable="yes">_Insert blank lines between members</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1018,6 +1049,7 @@
<property name="label" translatable="yes">_Use full type names</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1117,6 +1149,7 @@
<property name="label" translatable="yes">Generate _documentation comments</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1135,6 +1168,7 @@
<property name="label" translatable="yes">Generate _additional comments</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1183,6 +1217,11 @@
<property name="default_height">400</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<property name="has_separator">False</property>
<child internal-child="vbox">
@@ -1204,6 +1243,7 @@
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="response_id">-7</property>
<signal name="clicked" handler="OnCloseButtonClicked" last_modification_time="Sat, 24 Jan 2004 01:26:19 GMT"/>
</widget>
@@ -1231,6 +1271,8 @@
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="editable">False</property>
+ <property name="overwrite">False</property>
+ <property name="accepts_tab">True</property>
<property name="justification">GTK_JUSTIFY_LEFT</property>
<property name="wrap_mode">GTK_WRAP_NONE</property>
<property name="cursor_visible">False</property>
@@ -1262,6 +1304,11 @@
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<child>
<widget class="GtkVBox" id="vbox13">
@@ -1276,6 +1323,7 @@
<property name="label" translatable="yes">Show Extensions in project scout</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1311,6 +1359,11 @@
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<child>
<widget class="GtkVBox" id="vbox17">
@@ -1385,6 +1438,7 @@
<property name="label" translatable="yes">Load user-specific settings with the document-</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1484,6 +1538,7 @@
<property name="label" translatable="yes">Allways create backup copy-</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1562,6 +1617,7 @@
<property name="label" translatable="yes">Windows-</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1580,6 +1636,7 @@
<property name="label" translatable="yes">Macintosh-</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1599,6 +1656,7 @@
<property name="label" translatable="yes">Unix-</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1664,6 +1722,11 @@
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<child>
<widget class="GtkVBox" id="vbox23">
@@ -1787,6 +1850,7 @@
<property name="label" translatable="yes">_Load previous combine on startup-</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1927,6 +1991,7 @@
<property name="label" translatable="yes">_Save Changes to open documents-</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1945,6 +2010,7 @@
<property name="label" translatable="yes">_Prompt to save changes to open documents-</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -1964,6 +2030,7 @@
<property name="label" translatable="yes">_Don't save changes to open documents -</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -2010,6 +2077,7 @@
<property name="label" translatable="yes">Show _task list pad if build finished with errors-</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -2035,6 +2103,7 @@
<property name="label" translatable="yes">Show _output pad when build starts-</property>
<property name="use_underline">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
<property name="active">False</property>
<property name="inconsistent">False</property>
<property name="draw_indicator">True</property>
@@ -2070,4 +2139,258 @@
</child>
</widget>
+<widget class="GtkWindow" id="tipOfTheDayWindow">
+ <property name="border_width">5</property>
+ <property name="visible">True</property>
+ <property name="title" translatable="yes">Tip of the day</property>
+ <property name="type">GTK_WINDOW_TOPLEVEL</property>
+ <property name="window_position">GTK_WIN_POS_NONE</property>
+ <property name="modal">False</property>
+ <property name="resizable">True</property>
+ <property name="destroy_with_parent">False</property>
+ <property name="decorated">True</property>
+ <property name="skip_taskbar_hint">False</property>
+ <property name="skip_pager_hint">False</property>
+ <property name="type_hint">GDK_WINDOW_TYPE_HINT_DIALOG</property>
+ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
+
+ <child>
+ <widget class="GtkVBox" id="vbox2">
+ <property name="border_width">5</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">12</property>
+
+ <child>
+ <widget class="GtkVBox" id="vbox3">
+ <property name="border_width">5</property>
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">5</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox7">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">5</property>
+
+ <child>
+ <widget class="GtkImage" id="image5">
+ <property name="visible">True</property>
+ <property name="stock">gtk-dialog-info</property>
+ <property name="icon_size">6</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="categoryLabel">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Did you know?</property>
+ <property name="use_underline">False</property>
+ <property name="use_markup">True</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">True</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkScrolledWindow" id="scrolledwindow2">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+ <property name="shadow_type">GTK_SHADOW_IN</property>
+ <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
+
+ <child>
+ <widget class="GtkTextView" id="tipTextview">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="editable">False</property>
+ <property name="overwrite">False</property>
+ <property name="accepts_tab">True</property>
+ <property name="justification">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap_mode">GTK_WRAP_WORD</property>
+ <property name="cursor_visible">True</property>
+ <property name="pixels_above_lines">0</property>
+ <property name="pixels_below_lines">0</property>
+ <property name="pixels_inside_wrap">0</property>
+ <property name="left_margin">0</property>
+ <property name="right_margin">0</property>
+ <property name="indent">0</property>
+ <property name="text" translatable="yes">Did you know that you can design lots of cool things with glade?</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHBox" id="hbox5">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">12</property>
+
+ <child>
+ <widget class="GtkCheckButton" id="noshowCheckbutton">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Do not _show next time</property>
+ <property name="use_underline">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="active">False</property>
+ <property name="inconsistent">False</property>
+ <property name="draw_indicator">True</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkHButtonBox" id="hbuttonbox1">
+ <property name="visible">True</property>
+ <property name="layout_style">GTK_BUTTONBOX_END</property>
+ <property name="spacing">10</property>
+
+ <child>
+ <widget class="GtkButton" id="nextButton">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+
+ <child>
+ <widget class="GtkAlignment" id="alignment3">
+ <property name="visible">True</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xscale">0</property>
+ <property name="yscale">0</property>
+ <property name="top_padding">0</property>
+ <property name="bottom_padding">0</property>
+ <property name="left_padding">0</property>
+ <property name="right_padding">0</property>
+
+ <child>
+ <widget class="GtkHBox" id="hbox6">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">2</property>
+
+ <child>
+ <widget class="GtkImage" id="image4">
+ <property name="visible">True</property>
+ <property name="stock">gtk-go-forward</property>
+ <property name="icon_size">4</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label5">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">_Next Tip</property>
+ <property name="use_underline">True</property>
+ <property name="use_markup">False</property>
+ <property name="justify">GTK_JUSTIFY_LEFT</property>
+ <property name="wrap">False</property>
+ <property name="selectable">False</property>
+ <property name="xalign">0.5</property>
+ <property name="yalign">0.5</property>
+ <property name="xpad">0</property>
+ <property name="ypad">0</property>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="closeButton">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="has_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-close</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ </widget>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ <packing>
+ <property name="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ </packing>
+ </child>
+ </widget>
+ </child>
+</widget>
+
</glade-interface>
Modified: trunk/MonoDevelop/src/Main/Base/Commands/AutostartCommands.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Commands/AutostartCommands.cs 2004-02-01 01:37:34 UTC (rev 739)
+++ trunk/MonoDevelop/src/Main/Base/Commands/AutostartCommands.cs 2004-02-01 12:16:44 UTC (rev 740)
@@ -211,6 +211,10 @@
((Gtk.Window)WorkbenchSingleton.Workbench).ShowAll ();
WorkbenchSingleton.Workbench.RedrawAllComponents ();
+ // Give Gtk time to display the workbench window before showing the TOTD.
+ while (Gtk.Application.EventsPending ())
+ Gtk.Application.RunIteration ();
+
ShowTipOfTheDay (null, null);
// finally run the workbench window ...
Modified: trunk/MonoDevelop/src/Main/Base/Commands/HelpCommands.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Commands/HelpCommands.cs 2004-02-01 01:37:34 UTC (rev 739)
+++ trunk/MonoDevelop/src/Main/Base/Commands/HelpCommands.cs 2004-02-01 12:16:44 UTC (rev 740)
@@ -87,8 +87,8 @@
{
public override void Run()
{
- TipOfTheDayDialog totdd = new TipOfTheDayDialog ();
- totdd.Run ();
+ TipOfTheDayWindow totdw = new TipOfTheDayWindow ();
+ totdw.Show ();
}
}
Modified: trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/TipOfTheDay.cs
===================================================================
--- trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/TipOfTheDay.cs 2004-02-01 01:37:34 UTC (rev 739)
+++ trunk/MonoDevelop/src/Main/Base/Gui/Dialogs/TipOfTheDay.cs 2004-02-01 12:16:44 UTC (rev 740)
@@ -21,108 +21,85 @@
namespace ICSharpCode.SharpDevelop.Gui.Dialogs
{
- public class TipOfTheDayView : Frame
+ public class TipOfTheDayWindow
{
+ ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService (typeof (IResourceService));
+ PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService (typeof (PropertyService));
- TextBuffer buffer;
+ [Glade.Widget] Label categoryLabel;
+ [Glade.Widget] TextView tipTextview;
+ [Glade.Widget] CheckButton noshowCheckbutton;
+ [Glade.Widget] Button nextButton;
+ [Glade.Widget] Button closeButton;
+ [Glade.Widget] Window tipOfTheDayWindow;
+
string[] tips;
- int curtip = 0;
- ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
-
- public TipOfTheDayView(XmlElement el) : base ()
+ int currentTip = 0;
+
+ public TipOfTheDayWindow ()
{
+ Glade.XML totdXml = new Glade.XML (null, "Base.glade",
+ "tipOfTheDayWindow",
+ null);
+ totdXml.Autoconnect (this);
+
+ noshowCheckbutton.Active = propertyService.GetProperty ("ICSharpCode.SharpDevelop.Gui.Dialog.TipOfTheDayView.ShowTipsAtStartup", true);
+ noshowCheckbutton.Toggled += new EventHandler (OnNoshow);
+ nextButton.Clicked += new EventHandler (OnNext);
+ closeButton.Clicked += new EventHandler (OnClose);
+ tipOfTheDayWindow.DeleteEvent += new DeleteEventHandler (OnDelete);
+ XmlDocument doc = new XmlDocument();
+ doc.Load (propertyService.DataDirectory +
+ System.IO.Path.DirectorySeparatorChar + "options" +
+ System.IO.Path.DirectorySeparatorChar + "TipsOfTheDay.xml");
+ ParseTips (doc.DocumentElement);
+
+ tipTextview.Buffer.Clear ();
+ tipTextview.Buffer.InsertAtCursor (tips[currentTip]);
+ }
+
+ private void ParseTips (XmlElement el)
+ {
+ StringParserService stringParserService = (StringParserService)ServiceManager.Services.GetService (typeof (StringParserService));
XmlNodeList nodes = el.ChildNodes;
- StringParserService stringParserService = (StringParserService)ServiceManager.Services.GetService(typeof(StringParserService));
tips = new string[nodes.Count];
- for (int i = 0; i < nodes.Count; ++i) {
- tips[i] = stringParserService.Parse(nodes[i].InnerText);
+ for (int i = 0; i < nodes.Count; i++) {
+ tips[i] = stringParserService.Parse (nodes[i].InnerText);
}
- curtip = (new Random().Next()) % nodes.Count;
+ currentTip = (new Random ().Next ()) % nodes.Count;
+ }
- TextView view = new TextView ();
- view.WrapMode = WrapMode.Word;
- view.Editable = false;
- buffer = view.Buffer;
- buffer.InsertAtCursor(tips[curtip]);
-
- this.Add(view);
-
+ public void OnNoshow (object obj, EventArgs args)
+ {
+ propertyService.SetProperty ("ICSharpCode.SharpDevelop.Gui.Dialog.TipOfTheDayView.ShowTipsAtStartup",
+ noshowCheckbutton.Active);
}
-
- public void NextTip()
+
+ public void OnNext (object obj, EventArgs args)
{
- buffer.Clear();
- curtip = (curtip + 1) % tips.Length;
- buffer.InsertAtCursor(tips[curtip]);
+ tipTextview.Buffer.Clear ();
+ currentTip = ++currentTip % tips.Length;
+ tipTextview.Buffer.InsertAtCursor (tips[currentTip]);
}
- }
-
- public class TipOfTheDayDialog : MessageDialog
- {
- enum UserDefinedResponseType {Next=1, Show}
-
- CheckButton viewTipsAtStartCheckBox;
- Button closeButton;
- Button nextTipButton;
-
- TipOfTheDayView tipview;
- ResourceService resourceService = (ResourceService)ServiceManager.Services.GetService(typeof(IResourceService));
- PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
-
- public TipOfTheDayDialog() : base ((Window) WorkbenchSingleton.Workbench,
- DialogFlags.DestroyWithParent,
- MessageType.Info,
- ButtonsType.None,
- "")
+ public void OnClose (object obj, EventArgs args)
{
+ tipOfTheDayWindow.Destroy ();
+ }
- this.Modal = false;
-
- this.Title = resourceService.GetString ("Dialog.TipOfTheDay.DidYouKnowText");
-
- this.SetDefaultSize (320, 240);
-
- viewTipsAtStartCheckBox = new CheckButton("Show tips at startup");
- viewTipsAtStartCheckBox.Active = propertyService.GetProperty("ICSharpCode.SharpDevelop.Gui.Dialog.TipOfTheDayView.ShowTipsAtStartup", true);
- this.AddActionWidget(viewTipsAtStartCheckBox, (int) UserDefinedResponseType.Show);
-
- nextTipButton = (Button) this.AddButton ("_Next Tip", (int) UserDefinedResponseType.Next);
- closeButton = (Button) this.AddButton (Stock.Close, (int) ResponseType.Close);
-
- FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.Services.GetService(typeof(FileUtilityService));
- PropertyService propertyService = (PropertyService)ServiceManager.Services.GetService(typeof(PropertyService));
-
- XmlDocument doc = new XmlDocument();
- doc.Load(propertyService.DataDirectory +
- System.IO.Path.DirectorySeparatorChar + "options" +
- System.IO.Path.DirectorySeparatorChar + "TipsOfTheDay.xml" );
- tipview = new TipOfTheDayView(doc.DocumentElement);
-
- this.Response += new ResponseHandler (HandleResponse);
-
- this.VBox.PackStart(tipview);
- this.ShowAll();
+ public void OnDelete (object obj, DeleteEventArgs args)
+ {
+ tipOfTheDayWindow.Destroy ();
}
- public void HandleResponse (object sender, ResponseArgs e)
+ public void Show ()
{
- switch (e.ResponseId)
- {
- case (int) ResponseType.Close :
- this.Hide ();
- break;
- case (int) UserDefinedResponseType.Next :
- tipview.NextTip();
- break;
- case (int) UserDefinedResponseType.Show :
- propertyService.SetProperty("ICSharpCode.SharpDevelop.Gui.Dialog.TipOfTheDayView.ShowTipsAtStartup", viewTipsAtStartCheckBox.Active);
- break;
- }
+ tipOfTheDayWindow.TransientFor = (Window) WorkbenchSingleton.Workbench;
+ tipOfTheDayWindow.WindowPosition = WindowPosition.CenterOnParent;
+ tipOfTheDayWindow.ShowAll ();
}
-
}
}
More information about the Monodevelop-patches-list
mailing list