~c-franke/do/XesamSearch

« back to all changes in this revision

Viewing changes to BeaglePidginItem.cs

  • Committer: Christof Franke
  • Date: 2008-02-26 10:55:05 UTC
  • Revision ID: kraut@workstation-20080226105505-8am13vug28ok1wsf
version 0.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// BeaglePidginItem.cs 
 
2
// User: kraut (c.franke@muenchen-mail.de) at 22:23¬†21.02.2008
 
3
 
 
4
 
 
5
using System;
 
6
using System.Collections;
 
7
using System.Collections.Generic;
 
8
using Do.Universe;
 
9
 
 
10
namespace Do.Addins.DoXesam
 
11
{
 
12
        
 
13
         class BeaglePidginItem : XesamItem, IOpenableItem
 
14
        {
 
15
                
 
16
                
 
17
                
 
18
                protected string speakingto;
 
19
                protected string speakingto_alias;
 
20
                protected string protocol;
 
21
                protected string client;
 
22
                protected string icon;
 
23
                
 
24
                
 
25
                
 
26
                
 
27
                
 
28
                public BeaglePidginItem (Dictionary<string,string> fields):base(fields)
 
29
                {       
 
30
                        this.speakingto=fields["beagle:speakingto"];
 
31
                        this.speakingto_alias=fields["beagle:speakingto_alias"];
 
32
                        this.protocol = fields["beagle:protocol"];
 
33
                        this.client = fields["beagle:client"];
 
34
                        this.icon=fields["beagle:speakingto_icon"];
 
35
                        
 
36
                        
 
37
                }
 
38
                
 
39
                public override string Name {
 
40
                        get {
 
41
                        if(speakingto_alias!="")
 
42
                                return speakingto_alias;
 
43
                        else
 
44
                                return speakingto;
 
45
                        }
 
46
                }
 
47
                
 
48
                public override string Description {
 
49
                        get {
 
50
                                return "IMLog: "+protocol+", "+base.date;
 
51
                                
 
52
                        }
 
53
                }
 
54
                
 
55
                public override string Icon {
 
56
                        get {
 
57
                                Hashtable icons=new Hashtable();
 
58
 
 
59
                                icons ["aim"] ="im-aim";
 
60
                                icons ["icq"] = "im-icq";
 
61
                                icons ["jabber"] = "im-jabber";
 
62
                                icons ["msn"] ="im-msn";
 
63
                                icons ["novell"] = "im-nov";
 
64
                                icons ["yahoo"] ="im-yahoo";
 
65
                                if(this.icon=="")
 
66
                                        return (string)icons[this.protocol];
 
67
                                else
 
68
                                        return this.icon;
 
69
                        }
 
70
                }
 
71
                
 
72
                
 
73
                /** open email via evolution **/
 
74
                public virtual void Open ()
 
75
                {
 
76
                        System.Diagnostics.Process locate;
 
77
                        locate = new System.Diagnostics.Process ();
 
78
                        locate.StartInfo.FileName = "beagle-imlogviewer";
 
79
                        locate.StartInfo.Arguments = "--client "+client+" "+(base.url.Replace("file://","")).Replace("%23", "\\#") ;
 
80
                        locate.StartInfo.RedirectStandardOutput = false;
 
81
                        locate.StartInfo.UseShellExecute = false;
 
82
                        locate.Start();
 
83
                }
 
84
        }    
 
85
        
 
86
}