blam r645 - in trunk: . src
- From: cmartin svn gnome org
- To: svn-commits-list gnome org
- Subject: blam r645 - in trunk: . src
- Date: Tue, 16 Sep 2008 20:55:43 +0000 (UTC)
Author: cmartin
Date: Tue Sep 16 20:55:42 2008
New Revision: 645
URL: http://svn.gnome.org/viewvc/blam?rev=645&view=rev
Log:
Implement adding a channel through a dialog.
Modified:
trunk/ChangeLog
trunk/src/Application.cs
trunk/src/ChannelList.cs
trunk/src/Dialogs.cs
trunk/src/blam.glade
Modified: trunk/src/Application.cs
==============================================================================
--- trunk/src/Application.cs (original)
+++ trunk/src/Application.cs Tue Sep 16 20:55:42 2008
@@ -89,6 +89,7 @@
private AddChannelDialog addChannelDialog;
private ChannelDialog channelDialog;
+ private AddGroupDialog addGroupDialog;
private PreferencesDialog preferencesDialog;
private OpmlDialog opmlDialog;
@@ -237,6 +238,7 @@
channelDialog = new ChannelDialog (this);
addChannelDialog = new AddChannelDialog (this);
+ addGroupDialog = new AddGroupDialog (this);
preferencesDialog = new PreferencesDialog (this.Window);
opmlDialog = new OpmlDialog (this.Window);
opmlDialog.ChannelAdded += mCollection.Add;
@@ -566,6 +568,11 @@
addChannelDialog.Show ();
}
+ public void AddGroupActivated (object obj, EventArgs args)
+ {
+ addGroupDialog.Show();
+ }
+
public void EditChannelActivated (IChannel channel)
{
bool IsGroup = false;
Modified: trunk/src/ChannelList.cs
==============================================================================
--- trunk/src/ChannelList.cs (original)
+++ trunk/src/ChannelList.cs Tue Sep 16 20:55:42 2008
@@ -380,8 +380,6 @@
public void Activate (Gdk.EventButton eb)
{
- allocs = new ArrayList();
-
Gtk.Menu popup_menu = new Gtk.Menu ();
GtkUtil.AppendMenuItem (popup_menu,
Modified: trunk/src/Dialogs.cs
==============================================================================
--- trunk/src/Dialogs.cs (original)
+++ trunk/src/Dialogs.cs Tue Sep 16 20:55:42 2008
@@ -15,7 +15,7 @@
class AboutDialog {
[Widget] Gtk.AboutDialog aboutDialog = null;
-
+
public AboutDialog(Gtk.Window parent)
{
Glade.XML gladeXML = Glade.XML.FromAssembly("blam.glade",
@@ -34,6 +34,45 @@
}
+ class AddGroupDialog
+ {
+ [Widget] Gtk.Dialog addGroupDialog = null;
+ [Widget] Gtk.Entry groupName = null;
+ [Widget] Gtk.Button ok = null;
+
+ Application mApp = null;
+
+ public AddGroupDialog(Application app)
+ {
+ mApp = app;
+
+ Glade.XML gladeXML = Glade.XML.FromAssembly("blam.glade",
+ "addGroupDialog", null);
+ gladeXML.Autoconnect(this);
+ addGroupDialog.TransientFor = app.Window;
+ addGroupDialog.IconName = "blam";
+ }
+
+ public void Show()
+ {
+ groupName.Text = "";
+ addGroupDialog.ShowAll();
+ }
+
+ public void OkButtonClicked(object obj, EventArgs args)
+ {
+ ChannelGroup group = new ChannelGroup();
+ group.Name = groupName.Text;
+ mApp.CCollection.Groups.Add(group);
+ (mApp.ChannelList.Model as TreeStore).AppendValues(group);
+ }
+
+ public void CancelButtonClicked(object obj, EventArgs args)
+ {
+ addGroupDialog.Hide();
+ }
+ }
+
class AddChannelDialog {
[Widget] Gtk.Dialog addChannelDialog = null;
[Widget] Gtk.Entry urlEntry = null;
Modified: trunk/src/blam.glade
==============================================================================
--- trunk/src/blam.glade (original)
+++ trunk/src/blam.glade Tue Sep 16 20:55:42 2008
@@ -121,6 +121,15 @@
</widget>
</child>
<child>
+ <widget class="GtkImageMenuItem" id="menuitem3">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">gtk-add</property>
+ <property name="use_underline">True</property>
+ <property name="use_stock">True</property>
+ <signal name="activate" handler="AddGroupActivated"/>
+ </widget>
+ </child>
+ <child>
<widget class="GtkSeparatorMenuItem" id="separator2">
<property name="visible">True</property>
</widget>
@@ -1759,6 +1768,7 @@
<property name="label" translatable="yes">gtk-cancel</property>
<property name="use_stock">True</property>
<property name="response_id">0</property>
+ <signal name="clicked" handler="CancelButtonClicked"/>
</widget>
</child>
<child>
@@ -1769,6 +1779,7 @@
<property name="label" translatable="yes">gtk-ok</property>
<property name="use_stock">True</property>
<property name="response_id">0</property>
+ <signal name="clicked" handler="OkButtonClicked"/>
</widget>
<packing>
<property name="position">1</property>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]