Add about dialog
This commit is contained in:
parent
9516f53b70
commit
5f0e5f7e49
|
@ -10,6 +10,7 @@ LINK = $(REF_SPARKLESHARE)
|
|||
SOURCES = \
|
||||
SparkleBubble.cs \
|
||||
SparkleController.cs \
|
||||
SparkleDialog.cs \
|
||||
SparkleEntry.cs \
|
||||
SparkleInfobar.cs \
|
||||
SparkleIntro.cs \
|
||||
|
|
209
SparkleShare/SparkleDialog.cs
Normal file
209
SparkleShare/SparkleDialog.cs
Normal file
|
@ -0,0 +1,209 @@
|
|||
// 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 (button_bar, false, false, 0);
|
||||
|
||||
string image_path = SparkleHelpers.CombineMore (Defines.PREFIX, "share", "pixmaps",
|
||||
"sparkleshare-about.png");
|
||||
|
||||
wrapper.PackStart (new Image (image_path), false, false, 0);
|
||||
wrapper.PackStart (vbox, true, true, 0);
|
||||
|
||||
Add (wrapper);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -25,6 +25,8 @@ using System.Timers;
|
|||
|
||||
namespace SparkleShare {
|
||||
|
||||
// TODO: Menu doesn't update anymore
|
||||
|
||||
// The statusicon that stays in the
|
||||
// user's notification area
|
||||
public class SparkleStatusIcon : StatusIcon {
|
||||
|
@ -224,14 +226,12 @@ namespace SparkleShare {
|
|||
Menu.Add (new SeparatorMenuItem ());
|
||||
|
||||
// A menu item that takes the user to http://www.sparkleshare.org/
|
||||
MenuItem about_item = new MenuItem (_("Visit Website"));
|
||||
MenuItem about_item = new MenuItem (_("About"));
|
||||
|
||||
about_item.Activated += delegate {
|
||||
|
||||
Process process = new Process ();
|
||||
process.StartInfo.FileName = "xdg-open";
|
||||
process.StartInfo.Arguments = "http://www.sparkleshare.org/";
|
||||
process.Start ();
|
||||
SparkleDialog dialog = new SparkleDialog ();
|
||||
dialog.ShowAll ();
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ SUBDIRS = \
|
|||
EXTRA_DIST = \
|
||||
sparkleshare-gnome.svg \
|
||||
sparkleshare-mist.svg \
|
||||
work-status-icons.svg \
|
||||
sparkleshare-about.png \
|
||||
side-splash.png
|
||||
|
||||
MAINTAINERCLEANFILES = \
|
||||
|
@ -13,6 +13,8 @@ MAINTAINERCLEANFILES = \
|
|||
install-data-local:
|
||||
$(mkinstalldirs) $(DESTDIR)$(datadir)/pixmaps
|
||||
$(INSTALL_DATA) $(srcdir)/side-splash.png $(DESTDIR)$(datadir)/pixmaps/side-splash.png
|
||||
$(INSTALL_DATA) $(srcdir)/sparkleshare-about.png $(DESTDIR)$(datadir)/pixmaps/sparkleshare-about.png
|
||||
|
||||
uninstall-hook:
|
||||
rm -f $(DESTDIR)$(datadir)/pixmaps/side-splash.png
|
||||
rm -f $(DESTDIR)$(datadir)/pixmaps/sparkleshare-about.png
|
||||
|
|
28
data/info.plist
Normal file
28
data/info.plist
Normal file
|
@ -0,0 +1,28 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>sparkleshare</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>sparkleshare.icns</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.sparkleshare.sparkleshare</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>SparkleShare</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>0.2</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>xmmd</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>0.2</string>
|
||||
<key>NSAppleScriptEnabled</key>
|
||||
<string>NO</string>
|
||||
</dict>
|
||||
</plist>
|
BIN
data/sparkleshare-about.png
Normal file
BIN
data/sparkleshare-about.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 42 KiB |
2534
data/sparkleshare-about.svg
Normal file
2534
data/sparkleshare-about.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 1.4 MiB |
52
data/sparkleshare-osx-start
Normal file
52
data/sparkleshare-osx-start
Normal file
|
@ -0,0 +1,52 @@
|
|||
#!/bin/sh
|
||||
|
||||
#get the bundle's MacOS directory full path
|
||||
DIR=$(cd "$(dirname "$0")"; pwd)
|
||||
|
||||
#change these values to match your app
|
||||
EXE_PATH="$DIR\SparkleShare.exe"
|
||||
PROCESS_NAME=sparkleshare-osx-start
|
||||
APPNAME="SparkleShare"
|
||||
|
||||
#set up environment
|
||||
MONO_FRAMEWORK_PATH=/Library/Frameworks/Mono.framework/Versions/Current
|
||||
export DYLD_FALLBACK_LIBRARY_PATH="$DIR:$MONO_FRAMEWORK_PATH/lib:/lib:/usr/lib"
|
||||
export PATH="$MONO_FRAMEWORK_PATH/bin:$PATH"
|
||||
|
||||
#mono version check
|
||||
REQUIRED_MAJOR=2
|
||||
REQUIRED_MINOR=4
|
||||
|
||||
VERSION_TITLE="Cannot launch $APPNAME"
|
||||
VERSION_MSG="$APPNAME requires the Mono Framework version $REQUIRED_MAJOR.$REQUIRED_MINOR or later."
|
||||
DOWNLOAD_URL="http://www.go-mono.com/mono-downloads/download.html"
|
||||
|
||||
MONO_VERSION="$(mono --version | grep 'Mono JIT compiler version ' | cut -f5 -d\ )"
|
||||
MONO_VERSION_MAJOR="$(echo $MONO_VERSION | cut -f1 -d.)"
|
||||
MONO_VERSION_MINOR="$(echo $MONO_VERSION | cut -f2 -d.)"
|
||||
if [ -z "$MONO_VERSION" ] \
|
||||
|| [ $MONO_VERSION_MAJOR -lt $REQUIRED_MAJOR ] \
|
||||
|| [ $MONO_VERSION_MAJOR -eq $REQUIRED_MAJOR -a $MONO_VERSION_MINOR -lt $REQUIRED_MINOR ]
|
||||
then
|
||||
osascript \
|
||||
-e "set question to display dialog \"$VERSION_MSG\" with title \"$VERSION_TITLE\" buttons {\"Cancel\", \"Download...\"} default button 2" \
|
||||
-e "if button returned of question is equal to \"Download...\" then open location \"$DOWNLOAD_URL\""
|
||||
echo "$VERSION_TITLE"
|
||||
echo "$VERSION_MSG"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#get an exec command that will work on the current OS version
|
||||
OSX_VERSION=$(uname -r | cut -f1 -d.)
|
||||
if [ $OSX_VERSION -lt 9 ]; then # If OSX version is 10.4
|
||||
MONO_EXEC="exec mono"
|
||||
else
|
||||
MONO_EXEC="exec -a \"$PROCESS_NAME\" mono"
|
||||
fi
|
||||
|
||||
#create log file directory if it doesn't exist
|
||||
LOG_FILE="$HOME/Library/Logs/$APPNAME/$APPNAME.log"
|
||||
mkdir -p "`dirname \"$LOG_FILE\"`"
|
||||
|
||||
#run app using mono
|
||||
$MONO_EXEC $MONO_OPTIONS "$EXE_PATH" $* 2>&1 1> "$LOG_FILE"
|
File diff suppressed because one or more lines are too long
Before Width: | Height: | Size: 179 KiB |
Loading…
Reference in a new issue