Linux about dialog
This commit is contained in:
parent
8ab088b623
commit
77627d7bec
|
@ -23,6 +23,7 @@ using MonoMac.Foundation;
|
|||
using MonoMac.AppKit;
|
||||
using MonoMac.ObjCRuntime;
|
||||
using MonoMac.WebKit;
|
||||
using SparkleLib;
|
||||
|
||||
namespace SparkleShare {
|
||||
|
||||
|
@ -69,7 +70,7 @@ namespace SparkleShare {
|
|||
};
|
||||
|
||||
VersionTextField = new NSTextField () {
|
||||
StringValue = "0.2.0",
|
||||
StringValue = Defines.VERSION,
|
||||
Frame = new RectangleF (22, Frame.Height - 94, 318, 22),
|
||||
BackgroundColor = NSColor.White,
|
||||
Bordered = false,
|
||||
|
|
|
@ -10,7 +10,7 @@ LINK = $(REF_SPARKLESHARE) $(NOTIFY_SHARP_LIBS) $(WEBKIT_SHARP_LIBS)
|
|||
SOURCES = \
|
||||
SparkleBubble.cs \
|
||||
SparkleController.cs \
|
||||
SparkleDialog.cs \
|
||||
SparkleAbout.cs \
|
||||
SparkleEntry.cs \
|
||||
SparkleInfobar.cs \
|
||||
SparkleIntro.cs \
|
||||
|
|
128
SparkleShare/SparkleAbout.cs
Normal file
128
SparkleShare/SparkleAbout.cs
Normal file
|
@ -0,0 +1,128 @@
|
|||
// SparkleShare, an instant update workflow to Git.
|
||||
// Copyright (C) 2010 Hylke Bons (hylkebons@gmail.com)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see (http://www.gnu.org/licenses/).
|
||||
|
||||
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
using Gtk;
|
||||
using SparkleLib;
|
||||
using Mono.Unix;
|
||||
|
||||
namespace SparkleShare {
|
||||
|
||||
public class SparkleDialog : Window {
|
||||
|
||||
// Short alias for the translations
|
||||
public static string _(string s)
|
||||
{
|
||||
return Catalog.GetString (s);
|
||||
}
|
||||
|
||||
|
||||
public SparkleDialog () : base ("")
|
||||
{
|
||||
|
||||
DefaultSize = new Gdk.Size (360, 260);
|
||||
|
||||
BorderWidth = 0;
|
||||
IconName = "folder-sparkleshare";
|
||||
Resizable = true;
|
||||
WindowPosition = WindowPosition.Center;
|
||||
Title = "About SparkleShare";
|
||||
Resizable = false;
|
||||
|
||||
Gdk.Color color = Style.Foreground (StateType.Insensitive);
|
||||
string secondary_text_color = SparkleUIHelpers.GdkColorToHex (color);
|
||||
|
||||
|
||||
EventBox box = new EventBox ();
|
||||
box.ModifyBg (StateType.Normal, new TreeView ().Style.Base (StateType.Normal));
|
||||
|
||||
Label header = new Label () {
|
||||
Markup = "<span font_size='xx-large'>SparkleShare</span>\n<span fgcolor='" + secondary_text_color + "'><small>" + Defines.VERSION + "</small></span>",
|
||||
Xalign = 0,
|
||||
Xpad = 18,
|
||||
Ypad = 18
|
||||
|
||||
};
|
||||
|
||||
box.Add (header);
|
||||
|
||||
Label license = new Label () {
|
||||
Xalign = 0,
|
||||
Xpad = 18,
|
||||
Ypad = 22,
|
||||
LineWrap = true,
|
||||
Wrap = true,
|
||||
LineWrapMode = Pango.WrapMode.Word,
|
||||
|
||||
Markup = "<small>Copyright © 2010–" + DateTime.Now.Year + " Hylke Bons and others\n" +
|
||||
"\n" +
|
||||
"SparkleShare is Free and Open Source Software. " +
|
||||
"You are free to use, modify, and redistribute it " +
|
||||
"under the terms of the GNU General Public License version 3 or later.</small>"
|
||||
};
|
||||
|
||||
VBox vbox = new VBox (false, 0) {
|
||||
BorderWidth = 0
|
||||
};
|
||||
|
||||
HButtonBox button_bar = new HButtonBox () {
|
||||
BorderWidth = 12
|
||||
};
|
||||
|
||||
Button credits_button = new Button ("_Show Credits") {
|
||||
UseUnderline = true
|
||||
};
|
||||
|
||||
credits_button.Clicked += delegate {
|
||||
|
||||
Process process = new Process ();
|
||||
process.StartInfo.FileName = "xdg-open";
|
||||
process.StartInfo.Arguments = "http://www.sparkleshare.org/credits";
|
||||
process.Start ();
|
||||
|
||||
};
|
||||
|
||||
Button website_button = new Button (_("_Visit Website")) {
|
||||
UseUnderline = true
|
||||
};
|
||||
|
||||
website_button.Clicked += delegate {
|
||||
|
||||
Process process = new Process ();
|
||||
process.StartInfo.FileName = "xdg-open";
|
||||
process.StartInfo.Arguments = "http://www.sparkleshare.org/";
|
||||
process.Start ();
|
||||
|
||||
};
|
||||
|
||||
button_bar.Add (website_button);
|
||||
button_bar.Add (credits_button);
|
||||
|
||||
vbox.PackStart (box, true, true, 0);
|
||||
vbox.PackStart (license, true, true, 0);
|
||||
vbox.PackStart (button_bar, false, false, 0);
|
||||
|
||||
Add (vbox);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,210 +0,0 @@
|
|||
// SparkleShare, an instant update workflow to Git.
|
||||
// Copyright (C) 2010 Hylke Bons (hylkebons@gmail.com)
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see (http://www.gnu.org/licenses/).
|
||||
|
||||
using Gtk;
|
||||
using SparkleLib;
|
||||
using Mono.Unix;
|
||||
using System.Diagnostics;
|
||||
|
||||
namespace SparkleShare {
|
||||
|
||||
public class SparkleDialog : Window {
|
||||
|
||||
// Short alias for the translations
|
||||
public static string _(string s)
|
||||
{
|
||||
return Catalog.GetString (s);
|
||||
}
|
||||
|
||||
|
||||
public SparkleDialog () : base ("")
|
||||
{
|
||||
|
||||
BorderWidth = 0;
|
||||
IconName = "folder-sparkleshare";
|
||||
Resizable = true;
|
||||
WindowPosition = WindowPosition.Center;
|
||||
Title = "SparkleShare " + Defines.VERSION;
|
||||
Resizable = false;
|
||||
|
||||
SetSizeRequest (480, 480);
|
||||
|
||||
Label label = new Label () {
|
||||
Xalign = 0,
|
||||
Xpad = 12,
|
||||
Ypad = 12
|
||||
};
|
||||
|
||||
Gdk.Color color = Style.Foreground (StateType.Insensitive);
|
||||
string secondary_text_color = SparkleUIHelpers.GdkColorToHex (color);
|
||||
|
||||
label.Markup = "<b><span size='x-large'>SparkleShare</span></b>\n" +
|
||||
"<span fgcolor='" + secondary_text_color + "'>version " + Defines.VERSION + "</span>\n\n" +
|
||||
|
||||
@"Copyright © 2010 Hylke Bons
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
Maintainer:
|
||||
|
||||
Hylke Bons (hylkebons@gmail.com)
|
||||
|
||||
Contributors:
|
||||
|
||||
Alex Hudson (home@alexhudson.com)
|
||||
Allan Day (allanpday@gmail.com)
|
||||
Andreas Nilsson (andreasn@gnome.org)
|
||||
Benjamin Podszun (benjamin.podszun@gmail.com)
|
||||
Bertrand Lorentz (bertrand.lorentz@gmail.com)
|
||||
Garrett LeSage (garrett@novell.com)
|
||||
Jakub Steiner (jimmac@redhat.com)
|
||||
Lapo Calamandrei (calamandrei@gmail.com)
|
||||
Luis Cordova (cordoval@gmail.com)
|
||||
Łukasz Jernaś (deejay1@srem.org)
|
||||
Michael Monreal (michael.monreal@gmail.com)
|
||||
Oleg Khlystov (pktfag@gmail.com)
|
||||
Paul Cutler (pcutler@gnome.org)
|
||||
Philipp Gildein (rmbl@openspeak-project.org)
|
||||
Ruben Vermeersch (rubenv@gnome.org)
|
||||
Sandy Armstrong (sanfordarmstrong@gmail.com)
|
||||
Simon Pither (simon@pither.com)
|
||||
Steven Harms (sharms@ubuntu.com)
|
||||
Vincent Untz (vuntz@gnome.org)
|
||||
|
||||
Thanks very much!";
|
||||
|
||||
|
||||
/* Git# is Copyright © 2007-2009 by the Git Development Community
|
||||
See source file headers for specific contributor copyrights.
|
||||
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or
|
||||
without modification, are permitted provided that the following
|
||||
conditions are met:
|
||||
|
||||
- Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
- Redistributions in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the following
|
||||
disclaimer in the documentation and/or other materials provided
|
||||
with the distribution.
|
||||
|
||||
- Neither the name of the Git Development Community nor the
|
||||
names of its contributors may be used to endorse or promote
|
||||
products derived from this software without specific prior
|
||||
written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
||||
CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
||||
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
||||
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
||||
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
||||
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
SmartIrc4net - The IRC library for .NET/C#
|
||||
|
||||
Copyright © 2003-2005 Mirco Bauer (meebey@meebey.net)
|
||||
|
||||
This library is free software; you can redistribute it and/or
|
||||
modify it under the terms of the GNU Lesser General Public
|
||||
License as published by the Free Software Foundation; either
|
||||
version 2.1 of the License, or (at your option) any later version.
|
||||
|
||||
This library is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Lesser General Public License for more details."; */
|
||||
|
||||
VBox wrapper = new VBox (false, 0);
|
||||
|
||||
VBox vbox = new VBox (false, 0) {
|
||||
BorderWidth = 0
|
||||
};
|
||||
|
||||
ScrolledWindow scrolled_window = new ScrolledWindow () {
|
||||
HscrollbarPolicy = PolicyType.Never,
|
||||
ShadowType = ShadowType.None,
|
||||
BorderWidth = 0
|
||||
};
|
||||
|
||||
scrolled_window.AddWithViewport (label);
|
||||
|
||||
(scrolled_window.Child as Viewport).ShadowType = ShadowType.None;
|
||||
(scrolled_window.Child as Viewport).ModifyBg (StateType.Normal,
|
||||
(new Entry () as Entry).Style.Base (StateType.Normal));
|
||||
|
||||
HButtonBox button_bar = new HButtonBox () {
|
||||
BorderWidth = 12
|
||||
};
|
||||
|
||||
Button close_button = new Button (Stock.Close);
|
||||
|
||||
close_button.Clicked += delegate {
|
||||
Destroy ();
|
||||
};
|
||||
|
||||
Button website_button = new Button (_("_Visit Website")) {
|
||||
UseUnderline = true
|
||||
};
|
||||
|
||||
website_button.Clicked += delegate {
|
||||
|
||||
Process process = new Process ();
|
||||
process.StartInfo.FileName = "xdg-open";
|
||||
process.StartInfo.Arguments = "http://www.sparkleshare.org/";
|
||||
process.Start ();
|
||||
|
||||
};
|
||||
|
||||
button_bar.Add (website_button);
|
||||
button_bar.Add (close_button);
|
||||
|
||||
vbox.PackStart (scrolled_window, true, true, 0);
|
||||
vbox.PackStart (new HSeparator (), false, false, 0);
|
||||
vbox.PackStart (button_bar, false, false, 0);
|
||||
|
||||
string image_path = SparkleHelpers.CombineMore (Defines.DATAROOTDIR, "sparkleshare",
|
||||
"pixmaps", "sparkleshare-about.png");
|
||||
System.Console.WriteLine(image_path);
|
||||
wrapper.PackStart (new Image (image_path), false, false, 0);
|
||||
wrapper.PackStart (vbox, true, true, 0);
|
||||
|
||||
Add (wrapper);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -51,7 +51,7 @@
|
|||
<Compile Include="SparkleUIHelpers.cs" />
|
||||
<Compile Include="SparkleInfobar.cs" />
|
||||
<Compile Include="SparkleController.cs" />
|
||||
<Compile Include="SparkleDialog.cs" />
|
||||
<Compile Include="SparkleAbout.cs" />
|
||||
<Compile Include="SparkleLinController.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
|
|
@ -5,7 +5,6 @@ SUBDIRS = \
|
|||
dist_pixmaps_DATA = \
|
||||
sparkleshare-gnome.svg \
|
||||
sparkleshare-mist.svg \
|
||||
sparkleshare-about.png \
|
||||
side-splash.png
|
||||
|
||||
pixmapsdir = $(pkgdatadir)/pixmaps/
|
||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 42 KiB |
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 1.4 MiB |
Loading…
Reference in a new issue