[longomatch] Support disabling popup windows in the dashboard



commit 2a3428aa3a6e7ae3370d6642157d52432e6fa04a
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Fri Oct 24 19:04:17 2014 +0200

    Support disabling popup windows in the dashboard

 LongoMatch.Core/Store/Templates/Dashboard.cs       |    5 +++++
 LongoMatch.GUI/Gui/Component/CodingWidget.cs       |    4 +++-
 LongoMatch.GUI/Gui/Component/DashboardWidget.cs    |   19 ++++++++++++++++++-
 data/icons/Makefile.am                             |    1 +
 .../hicolor/scalable/actions/longomatch-popup.svg  |   13 +++++++++++++
 5 files changed, 40 insertions(+), 2 deletions(-)
---
diff --git a/LongoMatch.Core/Store/Templates/Dashboard.cs b/LongoMatch.Core/Store/Templates/Dashboard.cs
index 7d83d2b..66959b6 100644
--- a/LongoMatch.Core/Store/Templates/Dashboard.cs
+++ b/LongoMatch.Core/Store/Templates/Dashboard.cs
@@ -106,6 +106,11 @@ namespace LongoMatch.Core.Store.Templates
                        set;
                }
                
+               public bool DisablePopupWindow {
+                       get;
+                       set;
+               }
+               
                [JsonIgnore]
                public List<Timer> Timers {
                        get {
diff --git a/LongoMatch.GUI/Gui/Component/CodingWidget.cs b/LongoMatch.GUI/Gui/Component/CodingWidget.cs
index 7bbd4c5..fc57684 100644
--- a/LongoMatch.GUI/Gui/Component/CodingWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/CodingWidget.cs
@@ -289,7 +289,9 @@ namespace LongoMatch.Gui.Component
                        play.Team = teamtagger.SelectedTeam;
                        play.Players = selectedPlayers ?? new List<Player> ();
                        play.Tags = tags ?? new List<Tag> ();
-                       Config.GUIToolkit.EditPlay (play, project, true, true, true, true);
+                       if (!project.Dashboard.DisablePopupWindow) {
+                               Config.GUIToolkit.EditPlay (play, project, true, true, true, true);
+                       }
                        teamtagger.ResetSelection ();
                        selectedPlayers = null;
                        Config.EventsBroker.EmitNewEvent (play);
diff --git a/LongoMatch.GUI/Gui/Component/DashboardWidget.cs b/LongoMatch.GUI/Gui/Component/DashboardWidget.cs
index 698e317..3fb33e6 100644
--- a/LongoMatch.GUI/Gui/Component/DashboardWidget.cs
+++ b/LongoMatch.GUI/Gui/Component/DashboardWidget.cs
@@ -46,7 +46,7 @@ namespace LongoMatch.Gui.Component
                Dashboard template;
                DashboardButton selected;
                Gtk.Image editimage;
-               ToggleToolButton editbutton;
+               ToggleToolButton editbutton, popupbutton;
                RadioToolButton d11button, fillbutton, fitbutton;
                bool internalButtons, edited, ignoreChanges;
                Project project;
@@ -161,6 +161,7 @@ namespace LongoMatch.Gui.Component
                                tagproperties.Tagger = null;
                                tagproperties.Sensitive = false;
                                tagproperties.Dashboard = value;
+                               popupbutton.Active = value.DisablePopupWindow;
                        }
                }
 
@@ -264,6 +265,14 @@ namespace LongoMatch.Gui.Component
                        toolbar.Add (editbutton);
                        toolbar.Add (new SeparatorToolItem ());
                        
+                       popupbutton = new ToggleToolButton ();
+                       popupbutton.IconWidget = new Gtk.Image (Helpers.Misc.LoadIcon
+                                                               ("longomatch-popup", 22));
+                       popupbutton.Active = true;
+                       popupbutton.Toggled += HandlePopupToggled;
+                       toolbar.Add (popupbutton);
+                       toolbar.Add (new SeparatorToolItem ());
+                       
                        fitbutton = new RadioToolButton ((GLib.SList) null);
                        fitbutton.IconName = "longomatch-dash-fit";
                        fitbutton.Toggled += HandleFitModeToggled;
@@ -295,6 +304,14 @@ namespace LongoMatch.Gui.Component
                        Edited = true;
                }
                
+               void HandlePopupToggled (object sender, EventArgs e)
+               {
+                       if (ignoreChanges) {
+                               return;
+                       }
+                       template.DisablePopupWindow = popupbutton.Active;
+               }
+
                void HandleEditToggled (object sender, EventArgs e)
                {
                        if (ignoreChanges) {
diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am
index f4d1f5f..4e7fada 100644
--- a/data/icons/Makefile.am
+++ b/data/icons/Makefile.am
@@ -59,6 +59,7 @@ nobase_dist_icons_DATA = Makefile.am \
        hicolor/scalable/actions/longomatch-player-pic.svg \
        hicolor/scalable/actions/longomatch-player-swap-lock.svg \
        hicolor/scalable/actions/longomatch-player-swap-unlock.svg \
+       hicolor/scalable/actions/longomatch-popup.svg \
        hicolor/scalable/actions/longomatch-preferences.svg \
        hicolor/scalable/actions/longomatch-project-delete.svg \
        hicolor/scalable/actions/longomatch-project-export.svg \
diff --git a/data/icons/hicolor/scalable/actions/longomatch-popup.svg 
b/data/icons/hicolor/scalable/actions/longomatch-popup.svg
new file mode 100644
index 0000000..6e1b876
--- /dev/null
+++ b/data/icons/hicolor/scalable/actions/longomatch-popup.svg
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 17.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0)  -->
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";>
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg"; 
xmlns:xlink="http://www.w3.org/1999/xlink"; x="0px" y="0px"
+        width="22px" height="22px" viewBox="0 0 22 22" enable-background="new 0 0 22 22" 
xml:space="preserve">
+<path fill="none" stroke="#6A6A6A" stroke-miterlimit="10" stroke-dasharray="2,2" d="M-12.627,1.552"/>
+<g>
+       <rect x="1" y="5.438" fill="none" stroke="#6A6A6A" stroke-miterlimit="10" width="15.534" 
height="15.534"/>
+       <rect x="5.466" y="0.973" fill="#FFFFFF" stroke="#6A6A6A" stroke-miterlimit="10" width="15.534" 
height="15.534"/>
+       <line fill="none" stroke="#6A6A6A" stroke-miterlimit="10" x1="9.043" y1="12.929" x2="17.423" 
y2="4.55"/>
+       <line fill="none" stroke="#6A6A6A" stroke-miterlimit="10" x1="9.043" y1="4.55" x2="17.423" 
y2="12.929"/>
+</g>
+</svg>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]