Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
2007-03-17 Kevin Reay <kevintreay@gmail.com>
Browse files Browse the repository at this point in the history
	* browser.cs: Fixed bug where ctrl-clicking link a would cause crash
	due to AddTab() affecting the current CurrentTab.html.Url variable.
	* browser.glade: Make browser more gnome HIG compliant; added 
	common HIG-related features.
	* browser.cs: Fixed paste bug that would cause selected text to
	not be overridden (in editing mode).

svn path=/trunk/mono-tools/; revision=75235
  • Loading branch information
migueldeicaza committed Mar 30, 2007
1 parent 00d912f commit f643615
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 27 deletions.
9 changes: 9 additions & 0 deletions docbrowser/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2007-03-17 Kevin Reay <kevintreay@gmail.com>

* browser.cs: Fixed bug where ctrl-clicking link a would cause crash
due to AddTab() affecting the current CurrentTab.html.Url variable.
* browser.glade: Make browser more gnome HIG compliant; added
common HIG-related features.
* browser.cs: Fixed paste bug that would cause selected text to
not be overridden (in editing mode).

2007-03-15 Kevin Reay <kevintreay@gmail.com>

* browser.cs: Fix #80575. Add missing check for null CurrentTab.
Expand Down
39 changes: 32 additions & 7 deletions docbrowser/browser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,7 @@ public class Browser {
[Glade.Widget] CheckMenuItem showinheritedmembers;
[Glade.Widget] CheckMenuItem comments1;
[Glade.Widget] MenuItem postcomment;
[Glade.Widget] public MenuItem cut1;
[Glade.Widget] public MenuItem paste1;
[Glade.Widget] public MenuItem print;
public Notebook tabs_nb;
Expand Down Expand Up @@ -243,9 +244,9 @@ public Browser (bool UseGecko)

Stream icon = GetResourceImage ("monodoc.png");

if (icon != null){
if (icon != null) {
monodoc_pixbuf = new Gdk.Pixbuf (icon);
MainWindow.Icon = monodoc_pixbuf;
MainWindow.Icon = monodoc_pixbuf;
}

//ellipsizing label for the title
Expand Down Expand Up @@ -314,6 +315,7 @@ public Browser (bool UseGecko)

comments1.Active = SettingsHandler.Settings.ShowComments;

cut1.Sensitive = false;
paste1.Sensitive = false;

//
Expand Down Expand Up @@ -559,10 +561,12 @@ public override void Go ()

public void LinkClicked (object o, EventArgs args)
{
string url = CurrentTab.html.Url;

if (HoldCtrl)
AddTab();
AddTab ();

LoadUrl (CurrentTab.html.Url);
LoadUrl (url);
}

private System.Xml.XmlNode edit_node;
Expand Down Expand Up @@ -923,6 +927,17 @@ void OnQuitActivate (object sender, EventArgs a)
Application.Quit ();
}

//
// Invoked by Edit/Cut menu entry.
//
void OnCutActivate (object sender, EventArgs a)
{
if (CurrentTab.Tab_mode == Mode.Editor) {
Clipboard cb = Clipboard.Get (Gdk.Selection.Clipboard);
CurrentTab.text_editor.Buffer.CutClipboard (cb, true);
}
}

//
// Invoked by Edit/Copy menu entry.
//
Expand All @@ -946,9 +961,11 @@ void OnPasteActivate (object sender, EventArgs a)
if (!cb.WaitIsTextAvailable ())
return;

string text = cb.WaitForText ();
//string text = cb.WaitForText ();

//CurrentTab.text_editor.Buffer.InsertAtCursor (text);

CurrentTab.text_editor.Buffer.InsertAtCursor (text);
CurrentTab.text_editor.Buffer.PasteClipboard (cb);
}

class About {
Expand All @@ -967,7 +984,13 @@ class About {

about.TransientFor = parent.window1;

logo_image.Pixbuf = new Gdk.Pixbuf (null, "monodoc.png");
Gdk.Pixbuf icon = new Gdk.Pixbuf (null, "monodoc.png");

if (icon != null) {
about.Icon = icon;
logo_image.Pixbuf = icon;
}

Assembly assembly = Assembly.GetExecutingAssembly ();
label_version.Markup = String.Format ("<b>Version:</b> {0}", assembly.GetName ().Version.ToString ());
}
Expand Down Expand Up @@ -2392,11 +2415,13 @@ public void SetMode (Mode m)

if (m == Mode.Viewer) {
this.Page = 0;
browser.cut1.Sensitive = false;
browser.paste1.Sensitive = false;
browser.print.Sensitive = true;
EditImg.Visible = false;
} else {
this.Page = 1;
browser.cut1.Sensitive = true;
browser.paste1.Sensitive = true;
browser.print.Sensitive = false;
EditImg.Visible = true;
Expand Down
110 changes: 90 additions & 20 deletions docbrowser/browser.glade
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
<child>
<widget class="GtkImageMenuItem" id="lookup_url1">
<property name="visible">True</property>
<property name="label" translatable="yes">_Lookup URL</property>
<property name="label" translatable="yes">_Lookup URL...</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnLookupURL" last_modification_time="Tue, 08 Jul 2003 23:25:06 GMT"/>
<accelerator key="L" modifiers="GDK_CONTROL_MASK" signal="activate"/>
Expand All @@ -85,9 +85,28 @@
<child>
<widget class="GtkImageMenuItem" id="print">
<property name="visible">True</property>
<property name="label">gtk-print</property>
<property name="use_stock">True</property>
<property name="label" translatable="yes">_Print...</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_print_activate" last_modification_time="Tue, 30 Aug 2005 05:02:29 GMT"/>
<accelerator key="P" modifiers="GDK_CONTROL_MASK" signal="activate"/>

<child internal-child="image">
<widget class="GtkImage" id="image119">
<property name="visible">True</property>
<property name="stock">gtk-print</property>
<property name="icon_size">1</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>

<child>
<widget class="GtkMenuItem" id="separator2">
<property name="visible">True</property>
</widget>
</child>

Expand Down Expand Up @@ -125,6 +144,27 @@

<child>
<widget class="GtkMenu" id="menuitem5_menu">
<child>
<widget class="GtkImageMenuItem" id="cut1">
<property name="visible">True</property>
<property name="label" translatable="yes">_Cut</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnCutActivate" last_modification_time="Tue, 08 Jul 2003 22:53:59 GMT"/>
<accelerator key="X" modifiers="GDK_CONTROL_MASK" signal="activate"/>

<child internal-child="image">
<widget class="GtkImage" id="image120">
<property name="visible">True</property>
<property name="stock">gtk-cut</property>
<property name="icon_size">1</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>

<child>
<widget class="GtkImageMenuItem" id="copy1">
Expand Down Expand Up @@ -170,6 +210,12 @@
</widget>
</child>

<child>
<widget class="GtkMenuItem" id="separator7">
<property name="visible">True</property>
</widget>
</child>

<child>
<widget class="GtkMenuItem" id="select_all1">
<property name="visible">True</property>
Expand Down Expand Up @@ -250,37 +296,61 @@
<child>
<widget class="GtkMenu" id="contributingMenu_menu">
<child>
<widget class="GtkCheckMenuItem" id="editing1">
<widget class="GtkImageMenuItem" id="contributor_settings1">
<property name="visible">True</property>
<property name="label" translatable="yes">Edit Mode</property>
<property name="label" translatable="yes">_Upload Contributions...</property>
<property name="use_underline">True</property>
<property name="active">False</property>
<signal name="activate" handler="OnEditingActivate" last_modification_time="Fri, 03 Oct 2003 22:44:59 GMT"/>
<signal name="activate" handler="OnUpload" last_modification_time="Wed, 08 Oct 2003 02:53:43 GMT"/>
<accelerator key="U" modifiers="GDK_CONTROL_MASK" signal="activate"/>

<child internal-child="image">
<widget class="GtkImage" id="image133">
<property name="visible">True</property>
<property name="stock">gtk-network</property>
<property name="icon_size">1</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>

<child>
<widget class="GtkMenuItem" id="separator1">
<widget class="GtkImageMenuItem" id="contributor_statistics1">
<property name="visible">True</property>
<property name="label" translatable="yes">_View Contribution Statistics...</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnContributionStatistics" last_modification_time="Wed, 08 Oct 2003 02:53:43 GMT"/>

<child internal-child="image">
<widget class="GtkImage" id="image133">
<property name="visible">True</property>
<property name="stock">gtk-find-and-replace</property>
<property name="icon_size">1</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>

<child>
<widget class="GtkMenuItem" id="contributor_settings1">
<widget class="GtkMenuItem" id="separator1">
<property name="visible">True</property>
<property name="label" translatable="yes">_Upload Contributions</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnUpload" last_modification_time="Wed, 08 Oct 2003 02:53:43 GMT"/>
<accelerator key="U" modifiers="GDK_CONTROL_MASK" signal="activate"/>
</widget>
</child>

<child>
<widget class="GtkMenuItem" id="contributor_statistics1">
<widget class="GtkCheckMenuItem" id="editing1">
<property name="visible">True</property>
<property name="label" translatable="yes">_View Contribution Statistics</property>
<property name="label" translatable="yes">Edit Mode</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnContributionStatistics" last_modification_time="Wed, 08 Oct 2003 02:53:43 GMT"/>
<property name="active">False</property>
<signal name="activate" handler="OnEditingActivate" last_modification_time="Fri, 03 Oct 2003 22:44:59 GMT"/>
</widget>
</child>
</widget>
Expand All @@ -300,14 +370,14 @@
<child>
<widget class="GtkImageMenuItem" id="about1">
<property name="visible">True</property>
<property name="label" translatable="yes">About</property>
<property name="label" translatable="yes">About...</property>
<property name="use_underline">True</property>
<signal name="activate" handler="OnAboutActivate" last_modification_time="Tue, 08 Jul 2003 22:54:49 GMT"/>

<child internal-child="image">
<widget class="GtkImage" id="image121">
<property name="visible">True</property>
<property name="stock">gnome-stock-about</property>
<property name="stock">gtk-about</property>
<property name="icon_size">1</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
Expand Down Expand Up @@ -985,7 +1055,7 @@

<widget class="GtkWindow" id="lookup">
<property name="visible">True</property>
<property name="title" translatable="yes">Lookup</property>
<property name="title" translatable="yes">Lookup URL</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
Expand All @@ -1008,7 +1078,7 @@
<child>
<widget class="GtkLabel" id="label8">
<property name="visible">True</property>
<property name="label" translatable="yes">_Url to lookup:</property>
<property name="label" translatable="yes">_URL to lookup:</property>
<property name="use_underline">True</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
Expand Down

0 comments on commit f643615

Please sign in to comment.