~tjost/do-plugins/mythremote

« back to all changes in this revision

Viewing changes to MythRemote/src/MythRemotePreferences.cs

  • Committer: Tobias Jost
  • Date: 2010-08-30 01:47:42 UTC
  • Revision ID: jost86@googlemail.com-20100830014742-qrudrql6rkd0a9so
Editing Frontends works

Show diffs side-by-side

added added

removed removed

Lines of Context:
86
86
                                        string[] data = frontend.Split(',');
87
87
                                        frontendListStore.AppendValues(data[0], data[1], data[2]);                              
88
88
                                }                       
89
 
                        }                       
 
89
                        }
 
90
                        
 
91
                        setDeleteAndEdit();
90
92
                }                               
91
93
                
92
94
                protected virtual void OnListFrontendsButtonReleaseEvent (object o, Gtk.ButtonReleaseEventArgs args)
93
95
                {
94
 
                        buttonDelete.Sensitive = true;
 
96
                        setDeleteAndEdit();
 
97
                }
 
98
                
 
99
                private void setDeleteAndEdit()
 
100
                {
 
101
                  buttonDelete.Sensitive = true;
 
102
                        buttonEdit.Sensitive = true;
95
103
                        if(listFrontends.Selection.CountSelectedRows() == 0)
 
104
                        {
96
105
                           buttonDelete.Sensitive = false;
 
106
                           buttonEdit.Sensitive = false;
 
107
                        }       
97
108
                }
98
109
                
99
110
                protected virtual void OnButtonDeleteClicked (object sender, System.EventArgs e)
111
122
                        frontends = frontends.TrimStart('|');
112
123
                        frontends = frontends.TrimEnd('|');             
113
124
                        
114
 
                        prefs.Set<string>("frontends", frontends);                      
115
 
                        frontendListStore.Remove(ref iter);
116
 
                }
 
125
                        prefs.Set<string>("frontends", frontends);                                              
 
126
                        updateFrontendList();
 
127
                }
 
128
                
 
129
                protected virtual void OnButtonEditClicked (object sender, System.EventArgs e)
 
130
                {
 
131
                        Gtk.TreeIter iter;
 
132
                        listFrontends.Selection.GetSelected(out iter);
 
133
                        
 
134
                        string ip = (string)frontendListStore.GetValue(iter,0);
 
135
                        string name = (string)frontendListStore.GetValue(iter,1);
 
136
                        string mac = (string)frontendListStore.GetValue(iter,2);
 
137
                        
 
138
                        MythRemoteEditFrontendDialog newDlg = new MythRemoteEditFrontendDialog(ip, name, mac);
 
139
                        newDlg.Run();                   
 
140
                        updateFrontendList();
 
141
                }
 
142
                
117
143
                
118
144
                
119
145