[tasque/viewmodel: 37/78] Setup conditional compilation for AppIndicator
- From: Antonius Riha <antoniusri src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tasque/viewmodel: 37/78] Setup conditional compilation for AppIndicator
- Date: Wed, 29 Aug 2012 18:37:46 +0000 (UTC)
commit 912312855401d681d8f0fcde1d71edb6694190a0
Author: Antonius Riha <antoniusriha gmail com>
Date: Mon Jul 30 22:27:37 2012 +0200
Setup conditional compilation for AppIndicator
INSTALL | 13 +++++++++++++
build/build.csproj | 3 +++
src/Tasque.Gtk/Application.cs | 6 ++++++
src/Tasque.Gtk/Tasque.Gtk.csproj | 7 ++++++-
4 files changed, 28 insertions(+), 1 deletions(-)
---
diff --git a/INSTALL b/INSTALL
index 7d7c28d..6c0e146 100644
--- a/INSTALL
+++ b/INSTALL
@@ -15,6 +15,19 @@ opening the solution in Monodevelop. Otherwise Monodevelop will issue
warnings about some missing projects. Those projects are fetched during build.
+AppIndicator:
+For the systray icon to work on the Unity desktop appindicator-sharp is needed.
+By default appindicator support is enabled. It can be switched off by adding
+
+ /property:EnableAppIndicator=false
+
+to the command line, thus yielding
+
+ xbuild /property:Configuration=GtkLinuxDebug /property:EnableAppIndicator=false tasque.sln
+
+as the build command.
+
+
Instructions below are deprecated.
--------------------------------------------------------
diff --git a/build/build.csproj b/build/build.csproj
index 2ef4ece..694907c 100644
--- a/build/build.csproj
+++ b/build/build.csproj
@@ -140,6 +140,9 @@
<None Include="..\src\tasque\tasque.csproj">
<Link>tasque.csproj</Link>
</None>
+ <None Include="..\INSTALL">
+ <Link>INSTALL</Link>
+ </None>
</ItemGroup>
<ItemGroup>
<Compile Include="SetDataAtBuildTime.cs" />
diff --git a/src/Tasque.Gtk/Application.cs b/src/Tasque.Gtk/Application.cs
index d54964b..15d4334 100644
--- a/src/Tasque.Gtk/Application.cs
+++ b/src/Tasque.Gtk/Application.cs
@@ -388,6 +388,12 @@ namespace Tasque
private void SetupTrayIcon ()
{
+ GtkTrayBase tray;
+#if APPINDICATOR
+ tray = new AppIndicatorTray (null);
+#else
+ tray = new StatusIconTray (null);
+#endif
trayIcon = new Gtk.StatusIcon();
trayIcon.Pixbuf = Utilities.GetIcon ("tasque-24", 24);
diff --git a/src/Tasque.Gtk/Tasque.Gtk.csproj b/src/Tasque.Gtk/Tasque.Gtk.csproj
index fca2ffe..7da3b28 100644
--- a/src/Tasque.Gtk/Tasque.Gtk.csproj
+++ b/src/Tasque.Gtk/Tasque.Gtk.csproj
@@ -10,6 +10,7 @@
<AssemblyName>Tasque.Gtk</AssemblyName>
<RootNamespace>Tasque</RootNamespace>
<ReleaseVersion>0.1.10</ReleaseVersion>
+ <EnableAppIndicator Condition=" '$(EnableAppIndicator)' == '' ">true</EnableAppIndicator>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'GtkLinuxDebug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -17,6 +18,7 @@
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;TRACE;GTKLINUX</DefineConstants>
+ <DefineConstants Condition=" '$(EnableAppIndicator)' ">$(DefineConstants);APPINDICATOR</DefineConstants>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'GtkLinuxRelease|AnyCPU' ">
@@ -24,6 +26,7 @@
<Optimize>true</Optimize>
<OutputPath>bin\LinuxRelease</OutputPath>
<DefineConstants>TRACE;GTKLINUX</DefineConstants>
+ <DefineConstants Condition=" '$(EnableAppIndicator)' ">$(DefineConstants);APPINDICATOR</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CustomCommands>
@@ -126,7 +129,6 @@
<Compile Include="TaskWindow.cs" />
<Compile Include="Utilities.cs" />
<Compile Include="GtkApplicationBase.cs" />
- <Compile Include="AppIndicatorTray.cs" />
<Compile Include="StatusIconTray.cs" />
<Compile Include="GtkTrayBase.cs" />
</ItemGroup>
@@ -137,6 +139,9 @@
<Compile Include="GtkLinuxApplication.cs" />
<Compile Include="RemoteControl.cs" />
</ItemGroup>
+ <ItemGroup Condition=" '$(EnableAppIndicator)' ">
+ <Compile Include="AppIndicatorTray.cs" />
+ </ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
<Folder Include="data\" />
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]