Moved Pithos data and logs from the GRNET folder under AppData to a GRNET\PITHOS...
authorPanagiotis Kanavos <pkanavos@gmail.com>
Tue, 13 Mar 2012 11:25:04 +0000 (13:25 +0200)
committerPanagiotis Kanavos <pkanavos@gmail.com>
Tue, 13 Mar 2012 11:25:04 +0000 (13:25 +0200)
trunk/Pithos.Client.WPF/App.xaml.cs
trunk/Pithos.Client.WPF/Configuration/PithosSettings.cs
trunk/Pithos.Client.WPF/LogConsole/LogConsoleViewModel.cs
trunk/Pithos.Client.WPF/Preferences/PreferencesView.xaml
trunk/Pithos.Client.WPF/Shell/ShellViewModel.cs
trunk/Pithos.Client.WPF/app.config
trunk/Pithos.Core/Agents/StatusAgent.cs

index d1ac421..9461263 100644 (file)
@@ -49,6 +49,7 @@ using System.Threading;
 using System.Threading.Tasks;
 using System.Windows;
 using Caliburn.Micro;
+using Pithos.Client.WPF.Configuration;
 using Pithos.Client.WPF.Properties;
 using log4net.Appender;
 using log4net.Core;
@@ -103,8 +104,7 @@ namespace Pithos.Client.WPF
 
             try
             {
-                var appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
-                var pithosDataPath = Path.Combine(appDataPath, "GRNET");
+                var pithosDataPath = PithosSettings.PithosDataPath;
                 if (!Directory.Exists(pithosDataPath))
                     Directory.CreateDirectory(pithosDataPath);
 
index 426fc36..bcf1f25 100644 (file)
@@ -262,14 +262,23 @@ namespace Pithos.Client.WPF.Configuration
                 .FirstOrDefault(a => a.Name == "DebugFileAppender");
             if (debugAppender != null)
             {
-                var appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
-                var pithosDataPath = Path.Combine(appDataPath, "GRNET");
+                var pithosDataPath = PithosDataPath;
                 debugAppender.File = Path.Combine(pithosDataPath, "debuglog.xml");
                 debugAppender.Threshold = !Settings.Default.DebugLoggingEnabled ? Level.Off : Level.All;
                 debugAppender.ActivateOptions();
             }
         }
 
+        public static string PithosDataPath
+        {
+            get
+            {
+                var appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
+                var pithosDataPath = Path.Combine(appDataPath, "GRNET\\PITHOS");
+                return pithosDataPath;
+            }
+        }
+
         public void Save()
         {
             _settings.Save();
index ce1f568..d2299d4 100644 (file)
@@ -27,7 +27,7 @@ namespace Pithos.Client.WPF.LogConsole
         private static readonly log4net.ILog Log = log4net.LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
 
         private readonly MemoryAppender _memoryAppender;
-        private IObservableCollection<LoggingEvent> _events;
+        private BindableCollection<LoggingEvent> _events;
 
         public LogConsoleViewModel()
         {
@@ -51,7 +51,7 @@ namespace Pithos.Client.WPF.LogConsole
             Events =new BindableCollection<LoggingEvent>(_memoryAppender.GetEvents());
         }
 
-        protected IObservableCollection<LoggingEvent> Events
+        protected BindableCollection<LoggingEvent> Events
         {
             get {
                 return _events;
index ddca716..af6b9b7 100644 (file)
                     <extToolkit:IntegerUpDown x:Name="StartupDelay" HorizontalAlignment="Left" Width="100" Margin="5,0" Watermark="Enter number of tasks" Minimum="0" />
                     <CheckBox Content="Enable Debug Logging" Height="16" HorizontalAlignment="Left" Margin="5,10,5,5" Name="DebugLoggingEnabled" VerticalAlignment="Top"/>
                     <Button x:Name="OpenLogPath" Content="Open Log Path" HorizontalAlignment="Left" Margin="5" Style="{StaticResource ButtonStyle}" Width="Auto"/>
-                    <Button x:Name="OpenLogConsole" Content="Open Log Console" HorizontalAlignment="Left" Margin="5" Style="{StaticResource ButtonStyle}" Width="Auto" Visibility="Hidden"/>
+                    <Button x:Name="OpenLogConsole" Content="Open Log Console" HorizontalAlignment="Left" Margin="5" Style="{StaticResource ButtonStyle}" Width="Auto" Visibility="Visible"/>
                 </WrapPanel>
             </TabItem>
         </TabControl>
index b814371..fc9b53f 100644 (file)
@@ -152,7 +152,9 @@ namespace Pithos.Client.WPF {
 
                                Proxy.SetFromSettings(settings);
 
-                               StatusMessage = "In Synch";
+                StatusMessage = Settings.Accounts.Count==0 
+                    ? "No Accounts added. Please add an account" 
+                    : "Starting";
 
                                _fileVersion=  new Lazy<FileVersionInfo>(() =>
                                {
@@ -456,8 +458,7 @@ namespace Pithos.Client.WPF {
 
         public void OpenLogPath()
         {
-            var appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
-            var pithosDataPath = Path.Combine(appDataPath, "GRNET");
+            var pithosDataPath = PithosSettings.PithosDataPath;
 
             Process.Start(pithosDataPath);
         }
index d8182e7..4561ce7 100644 (file)
                        <appender-ref ref="TraceAppender"/>
                </logger>
 
-<!--
+
                <logger name="Caliburn" additivity="false">
-                       <level value="WARN"/>
+                       <level value="DEBUG"/>
                        <appender-ref ref="TraceAppender"/>
                </logger>
--->
 
                <logger name="Pithos" additivity="false">
                        <level value="DEBUG"/>
                <root>
                        <level value="DEBUG" />
                        <appender-ref ref="DebugFileAppender" />
-<!--
                        <appender-ref ref="LossyFileAppender" />
+                       <!--
                        <appender-ref ref="LossySmtpAppender" />
 -->
                        <appender-ref ref="TraceAppender" />
index df52b11..1e98a36 100644 (file)
@@ -82,7 +82,7 @@ namespace Pithos.Core.Agents
         {            
             var appDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData);
 
-            _pithosDataPath = Path.Combine(appDataPath , "GRNET");
+            _pithosDataPath = Path.Combine(appDataPath , "GRNET\\PITHOS");
             if (!Directory.Exists(_pithosDataPath))
                 Directory.CreateDirectory(_pithosDataPath);