[blam/gtk3] Channel: save the state upon exit
- From: Carlos Martín Nieto <cmartin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [blam/gtk3] Channel: save the state upon exit
- Date: Sun, 13 Oct 2013 19:14:35 +0000 (UTC)
commit a114ad4a4bea36750356aea0280efae681692197
Author: Carlos Martín Nieto <cmn dwim me>
Date: Sun Oct 13 21:15:17 2013 +0200
Channel: save the state upon exit
src/Blam.cs | 6 +++---
src/Channel.cs | 3 ++-
2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/Blam.cs b/src/Blam.cs
index a0defe3..c276398 100644
--- a/src/Blam.cs
+++ b/src/Blam.cs
@@ -46,8 +46,6 @@ namespace Blam
channels = ChannelCollection.LoadFromFile (Defines.APP_HOMEDIR + "/collection.xml");
trayIcon = new TrayIcon(channels.ObservableChannels, channels.ObservableGroups);
- //trayIcon.RefreshAllEvent += RefreshAllActivated;
- //trayIcon.PreferencesEvent += PreferencesActivated;
trayIcon.ObserveClick.Subscribe(_ => toggleVisible());
@@ -146,7 +144,9 @@ namespace Blam
item = bld.GetObject<MenuItem>("menu-quit");
Observable.Merge(
item.ObserveActivated().Select(_ => Unit.Default),
- trayIcon.ObserveQuit).Subscribe(_ => {
+ trayIcon.ObserveQuit)
+ .Subscribe(_ => {
+ channels.SaveToFile();
Application.Quit();
});
}
diff --git a/src/Channel.cs b/src/Channel.cs
index 76174d4..f4f6051 100644
--- a/src/Channel.cs
+++ b/src/Channel.cs
@@ -51,7 +51,8 @@ namespace Imendio.Blam {
[XmlAttribute] public string http_username = "";
[XmlAttribute] public string http_password = "";
- List<string> items;
+ [XmlAttribute]
+ public List<string> items;
public event PropertyChangedEventHandler PropertyChanged;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]