Beispiel #1
0
 void HandleM_viewNavigationRequested(object o, WebKit.NavigationRequestedArgs args)
 {
     if (contentLoaded)
     {
         m_view.StopLoading();
         if (args.Request.Uri.StartsWith("ocm://"))
         {
             string[] request = args.Request.Uri.Substring(6).Split('/');
             if (request[0].Equals("deleteLog"))
             {
                 MessageDialog dlg = new MessageDialog(null, DialogFlags.Modal, MessageType.Question, ButtonsType.YesNo, Mono.Unix.Catalog.GetString("Are you sure you wish to delete this log?"));
                 if (((int)ResponseType.Yes) == dlg.Run())
                 {
                     dlg.Hide();
                     m_App.CacheStore.PurgeLogsByKey(new String[] { request[1] });
                     m_App.RefreshAll();
                 }
                 dlg.Hide();
             }
             else if (request[0].Equals("editLog"))
             {
                 OfflineLogDialog dlg = new OfflineLogDialog();
                 dlg.MainWin    = m_Win;
                 dlg.useFullLog = true;
                 ocmengine.CacheLog log = m_App.CacheStore.GetCacheLogByKey(request[1]);
                 dlg.Log = log;
                 if ((int)ResponseType.Ok == dlg.Run())
                 {
                     log = dlg.Log;
                     m_App.CacheStore.AddLog(log.CacheCode, log);
                     dlg.Hide();
                     m_App.RefreshAll();
                 }
                 dlg.Hide();
             }
         }
         else
         {
             // System.Diagnostics.Process.Start(args.Request.Uri);
             Helper.ProcessStartURL(args.Request.Uri);
         }
     }
 }
 private void LogFindOffline()
 {
     OfflineLogDialog dlg = new OfflineLogDialog ();
     dlg.MainWin = this;
     CacheLog log = new CacheLog ();
     log.CacheCode = CacheList.SelectedCache.Name;
     log.LogDate = m_app.LoggingDate;
     log.LogStatus = "Found it";
     log.LoggedBy = "OCM";
     log.LogKey = CacheList.SelectedCache.Name + "-ofl";
     log.LogMessage = String.Empty;
     dlg.Log = log;
     if ((int)ResponseType.Ok == dlg.Run ()) {
         log = dlg.Log;
         ProcessOfflineLog (CacheList.SelectedCache, log, dlg.FTF);
         dlg.Hide ();
     }
     dlg.Hide ();
     HandleCacheListSelectionChanged(this, new CacheEventArgs(CacheList.SelectedCache));
 }
 void HandleM_viewNavigationRequested(object o, WebKit.NavigationRequestedArgs args)
 {
     if (contentLoaded)
     {
         m_view.StopLoading();
         if (args.Request.Uri.StartsWith("ocm://"))
         {
             string[]  request = args.Request.Uri.Substring(6).Split('/');
             if (request[0].Equals("deleteLog"))
             {
                 MessageDialog dlg = new MessageDialog(null, DialogFlags.Modal, MessageType.Question, ButtonsType.YesNo, Mono.Unix.Catalog.GetString("Are you sure you wish to delete this log?"));
                 if (((int) ResponseType.Yes) == dlg.Run())
                 {
                     dlg.Hide();
                     m_App.CacheStore.PurgeLogsByKey(new String[]{request[1]});
                     m_App.RefreshAll();
                 }
                 dlg.Hide();
             }
             else if (request[0].Equals("editLog"))
             {
                 OfflineLogDialog dlg = new OfflineLogDialog();
                 dlg.MainWin = m_Win;
                 dlg.useFullLog = true;
                 ocmengine.CacheLog log = m_App.CacheStore.GetCacheLogByKey(request[1]);
                 dlg.Log = log;
                 if ((int)ResponseType.Ok == dlg.Run ())
                 {
                     log = dlg.Log;
                     m_App.CacheStore.AddLog(log.CacheCode, log);
                     dlg.Hide ();
                     m_App.RefreshAll();
                 }
                 dlg.Hide ();
             }
         }
         else
             System.Diagnostics.Process.Start(args.Request.Uri);
     }
 }
 protected virtual void OnEditClick(object sender, System.EventArgs e)
 {
     Gtk.TreeIter itr;
     Gtk.TreeModel model;
     if (logView.Selection.GetSelected (out model, out itr))
     {
         CacheLog log = (CacheLog)model.GetValue (itr, 0);
         OfflineLogDialog dlg = new OfflineLogDialog();
         dlg.EditMessageOnly = true;
         dlg.Log = log;
         if ((int)ResponseType.Ok == dlg.Run())
         {
             log.LogMessage = dlg.Log.LogMessage;
             Engine.getInstance().Store.AddLogAtomic(log.CacheCode, log);
             logEntry.Buffer.Text = log.LogMessage;
             UpdateFNFile();
         }
         dlg.Hide();
         dlg.Dispose();
     }
 }