[moserial] update signal connect/disconnect syntax
- From: Michael J. Chudobiak <mjc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [moserial] update signal connect/disconnect syntax
- Date: Mon, 14 Feb 2011 14:53:24 +0000 (UTC)
commit 561a439602e13c3d830a985c9566122051f1c8d7
Author: Marlo <brooss teambb gmail com>
Date: Mon Feb 14 09:52:24 2011 -0500
update signal connect/disconnect syntax
src/AutoScroll.vala | 20 +++++-----
src/MainWindow.vala | 86 ++++++++++++++++++++--------------------
src/PreferencesDialog.vala | 14 +++---
src/ReceiveChooserDialog.vala | 4 +-
src/ReceiveProgressDialog.vala | 4 +-
src/RecordDialog.vala | 4 +-
src/SendChooserDialog.vala | 4 +-
src/SendProgressDialog.vala | 4 +-
src/SettingsDialog.vala | 6 +-
src/XmodemFilenameDialog.vala | 4 +-
10 files changed, 75 insertions(+), 75 deletions(-)
---
diff --git a/src/AutoScroll.vala b/src/AutoScroll.vala
index d05fb1d..89bd648 100644
--- a/src/AutoScroll.vala
+++ b/src/AutoScroll.vala
@@ -26,22 +26,22 @@ public class moserial.AutoScroll : GLib.Object
public static void doAutoScroll (Gtk.Adjustment va) {
if (va.value==va.upper-va.page_size)
- va.changed+=scroll;
+ va.changed.connect(scroll);
else
- va.changed-=scroll;
+ va.changed.disconnect(scroll);
}
public static void setup(Gtk.Adjustment incomingAsciiVerticalAdjuster, Gtk.Adjustment incomingHexVerticalAdjuster, Gtk.Adjustment outgoingAsciiVerticalAdjuster, Gtk.Adjustment outgoingHexVerticalAdjuster) {
- incomingAsciiVerticalAdjuster.changed+=scroll;
- incomingAsciiVerticalAdjuster.value_changed+=doAutoScroll;
+ incomingAsciiVerticalAdjuster.changed.connect(scroll);
+ incomingAsciiVerticalAdjuster.value_changed.connect(doAutoScroll);
- incomingHexVerticalAdjuster.changed+=scroll;
- incomingHexVerticalAdjuster.value_changed+=doAutoScroll;
+ incomingHexVerticalAdjuster.changed.connect(scroll);
+ incomingHexVerticalAdjuster.value_changed.connect(doAutoScroll);
- outgoingAsciiVerticalAdjuster.changed+=scroll;
- outgoingAsciiVerticalAdjuster.value_changed+=doAutoScroll;
+ outgoingAsciiVerticalAdjuster.changed.connect(scroll);
+ outgoingAsciiVerticalAdjuster.value_changed.connect(doAutoScroll);
- outgoingHexVerticalAdjuster.changed+=scroll;
- outgoingHexVerticalAdjuster.value_changed+=doAutoScroll;
+ outgoingHexVerticalAdjuster.changed.connect(scroll);
+ outgoingHexVerticalAdjuster.value_changed.connect(doAutoScroll);
}
}
diff --git a/src/MainWindow.vala b/src/MainWindow.vala
index 510d57f..45f41dc 100644
--- a/src/MainWindow.vala
+++ b/src/MainWindow.vala
@@ -101,9 +101,9 @@ public class moserial.MainWindow : Gtk.Window //Have to extend Gtk.Winow to get
construct {
//setup window
gtkWindow = (Gtk.Window)builder.get_object("window");
- gtkWindow.destroy += quitSave;
- gtkWindow.delete_event += deleteSaveSize;
- gtkWindow.key_press_event += keyPress;
+ gtkWindow.destroy.connect(quitSave);
+ gtkWindow.delete_event.connect(deleteSaveSize);
+ gtkWindow.key_press_event.connect(keyPress);
//load defaults
profile=new Profile();
@@ -124,35 +124,35 @@ public class moserial.MainWindow : Gtk.Window //Have to extend Gtk.Winow to get
//setup menu items
Action quit = (Action)builder.get_object("menubar_quit");
- quit.activate += quitSizeSave;
+ quit.activate.connect(quitSizeSave);
Action saveAs = (Action)builder.get_object("menubar_save_settings_as");
- saveAs.activate += saveProfileAs;
+ saveAs.activate.connect(saveProfileAs);
Action save = (Action)builder.get_object("menubar_save_settings");
- save.activate += saveProfile;
+ save.activate.connect(saveProfile);
Action open = (Action)builder.get_object("menubar_open_settings");
- open.activate += loadProfile;
+ open.activate.connect(loadProfile);
copyMenuItem = (Action)builder.get_object("menubar_copy");
- copyMenuItem.activate += this.copy;
+ copyMenuItem.activate.connect(this.copy);
Action editMenuItem = (Action)builder.get_object("menubar_edit");
- editMenuItem.activate += this.editMenu;
+ editMenuItem.activate.connect(this.editMenu);
cutMenuItem = (Action)builder.get_object("menubar_cut");
copyMenuItem.set_sensitive(false);
cutMenuItem.set_sensitive(false);
- cutMenuItem.activate += this.cut;
+ cutMenuItem.activate.connect(this.cut);
Action pasteMenuItem = (Action)builder.get_object("menubar_paste");
- pasteMenuItem.activate += this.paste;
+ pasteMenuItem.activate.connect(this.paste);
Action clearMenuItem = (Action)builder.get_object("menubar_clear");
- clearMenuItem.activate += this.clear;
+ clearMenuItem.activate.connect(this.clear);
//setup the Port Settings Dialog
settingsDialog = new SettingsDialog(builder);
- settingsDialog.updateSettings += this.updateSettings;
+ settingsDialog.updateSettings.connect(this.updateSettings);
settingsButton = (ToolButton)builder.get_object("toolbar_settings");
- settingsButton.clicked += this.showSettingsDialog;
+ settingsButton.clicked.connect(this.showSettingsDialog);
//setup the Help button
ToolButton helpButton = (ToolButton)builder.get_object("toolbar_help");
- helpButton.clicked += showHelpButton;
+ helpButton.clicked.connect(showHelpButton);
//setup the statusbar
statusbar = (Statusbar)builder.get_object("statusbar");
@@ -166,22 +166,22 @@ public class moserial.MainWindow : Gtk.Window //Have to extend Gtk.Winow to get
//setup the about dialog
Action about = (Action)builder.get_object("menubar_about");
- about.activate += showAboutDialog;
+ about.activate.connect(showAboutDialog);
//setup send
sendProgressDialog = new SendProgressDialog(builder);
sendChooserDialog = new SendChooserDialog(builder);
send = (ToolButton)builder.get_object("toolbar_send");
- send.clicked += doSendChooser;
- sendChooserDialog.startTransfer += this.doSend;
+ send.clicked.connect(doSendChooser);
+ sendChooserDialog.startTransfer.connect(this.doSend);
sz = new Szwrapper(Szwrapper.Protocol.NULL, null, null);
//setup receive
receiveProgressDialog = new ReceiveProgressDialog(builder);
receiveChooserDialog = new ReceiveChooserDialog(builder);
receive = (ToolButton)builder.get_object("toolbar_receive");
- receive.clicked += doReceiveChooser;
- receiveChooserDialog.startTransfer += this.doReceive;
+ receive.clicked .connect(doReceiveChooser);
+ receiveChooserDialog.startTransfer.connect(this.doReceive);
xmodemFilenameDialog = new XmodemFilenameDialog(builder);
rz = new Rzwrapper(Rzwrapper.Protocol.NULL, null, null, null);
@@ -189,27 +189,27 @@ public class moserial.MainWindow : Gtk.Window //Have to extend Gtk.Winow to get
//setup recording
recordDialog = new RecordDialog(builder);
recordButton = (ToggleToolButton)builder.get_object("toolbar_logging");
- recordButton.clicked += this.record;
- recordDialog.stopRecording += this.stopRecording;
- recordDialog.startRecording += this.startRecording;
+ recordButton.toggled.connect(this.record);
+ recordDialog.stopRecording.connect(this.stopRecording);
+ recordDialog.startRecording.connect(this.startRecording);
recordLabel = (Label)builder.get_object("record_label");
stopRecordingLabel = (Label)builder.get_object("stop_recording_label");
//setup preferences
preferencesDialog = new PreferencesDialog(builder);
- preferencesDialog.updatePreferences += this.updatePreferences;
+ preferencesDialog.updatePreferences.connect(this.updatePreferences);
ToolButton preferences = (ToolButton)builder.get_object("toolbar_preferences");
- preferences.clicked += this.showPreferencesDialog;
+ preferences.clicked.connect(this.showPreferencesDialog);
//setup connectbutton
connectButton = (ToggleToolButton)builder.get_object("toolbar_connect");
- connectButton.clicked += this.connectButtonClick;
+ connectButton.toggled.connect(this.connectButtonClick);
disconnectLabel = (Label)builder.get_object("disconnect_label");
connectLabel = (Label)builder.get_object("connect_label");
//setup help
Action contents = (Action)builder.get_object("menubar_contents");
- contents.activate += showHelpAction;
+ contents.activate.connect(showHelpAction);
//setup incoming notebook
incoming_notebook = (Notebook)builder.get_object("incoming_notebook");
@@ -254,19 +254,19 @@ public class moserial.MainWindow : Gtk.Window //Have to extend Gtk.Winow to get
//setup entry
sendButton = (Button)builder.get_object("send");
- sendButton.clicked += sendString;
+ sendButton.clicked.connect(sendString);
entry = (Gtk.Entry)builder.get_object("entry");
- entry.activate += sendString;
+ entry.activate.connect(sendString);
inputMode = (ComboBox)builder.get_object("input_mode");
inputMode.set_active(0);
- inputMode.changed += inputModeChanged;
+ inputMode.changed.connect(inputModeChanged);
terminationMode = (ComboBox)builder.get_object("termination_mode");
terminationMode.set_active(0);
//setup recent chooser
RecentManager recentManager = RecentManager.get_default ();
RecentChooserMenu recentChooserMenu = new Gtk.RecentChooserMenu.for_manager(recentManager);
- recentChooserMenu.item_activated += recentItemOpen;
+ recentChooserMenu.item_activated.connect(recentItemOpen);
RecentFilter filter = new RecentFilter();
filter.add_application(GLib.Environment.get_application_name());
recentChooserMenu.add_filter(filter);
@@ -442,15 +442,15 @@ public class moserial.MainWindow : Gtk.Window //Have to extend Gtk.Winow to get
if(sz.running)
{
sendProgressDialog.show();
- sz.updateStatus+=sendProgressDialog.updateStatus;
- sendProgressDialog.transferCanceled+=sz.transferCanceled;
- sz.transferComplete += this.sendComplete;
+ sz.updateStatus.connect(sendProgressDialog.updateStatus);
+ sendProgressDialog.transferCanceled.connect(sz.transferCanceled);
+ sz.transferComplete.connect(this.sendComplete);
}
}
public void sendComplete(GLib.Object o) {
- sz.updateStatus-=sendProgressDialog.updateStatus;
- sendProgressDialog.transferCanceled-=sz.transferCanceled;
+ sz.updateStatus.disconnect(sendProgressDialog.updateStatus);
+ sendProgressDialog.transferCanceled.disconnect(sz.transferCanceled);
sendProgressDialog.hide();
}
@@ -485,15 +485,15 @@ public class moserial.MainWindow : Gtk.Window //Have to extend Gtk.Winow to get
if(rz.running)
{
receiveProgressDialog.show();
- rz.updateStatus+=receiveProgressDialog.updateStatus;
- receiveProgressDialog.transferCanceled+=rz.transferCanceled;
- rz.transferComplete += this.receiveComplete;
+ rz.updateStatus.connect(receiveProgressDialog.updateStatus);
+ receiveProgressDialog.transferCanceled.connect(rz.transferCanceled);
+ rz.transferComplete.connect(this.receiveComplete);
}
}
public void receiveComplete(GLib.Object o) {
- rz.updateStatus-=receiveProgressDialog.updateStatus;
- receiveProgressDialog.transferCanceled-=rz.transferCanceled;
+ rz.updateStatus.disconnect(receiveProgressDialog.updateStatus);
+ receiveProgressDialog.transferCanceled.disconnect(rz.transferCanceled);
receiveProgressDialog.hide();
}
@@ -614,7 +614,7 @@ public class moserial.MainWindow : Gtk.Window //Have to extend Gtk.Winow to get
settingsButton.set_sensitive(false);
statusbar.pop(statusbarContext);
statusbar.push(statusbarContext, currentSettings.getStatusbarString(true));
- serialConnection.newData += this.updateIncoming;
+ serialConnection.newData.connect(this.updateIncoming);
connectButton.set_label_widget(disconnectLabel);
return true;
}
@@ -625,7 +625,7 @@ public class moserial.MainWindow : Gtk.Window //Have to extend Gtk.Winow to get
} else {
settingsButton.set_sensitive(true);
serialConnection.doDisconnect();
- serialConnection.newData -= this.updateIncoming;
+ serialConnection.newData.disconnect(this.updateIncoming);
bytecountbar.pop(bytecountbarContext);
bytecountbar.push(bytecountbarContext, serialConnection.getBytecountbarString());
//serialConnection = new SerialConnection();
diff --git a/src/PreferencesDialog.vala b/src/PreferencesDialog.vala
index 1ecc1d7..8fecf7f 100644
--- a/src/PreferencesDialog.vala
+++ b/src/PreferencesDialog.vala
@@ -48,11 +48,11 @@ public class moserial.PreferencesDialog : GLib.Object
recordLaunch = (CheckButton)builder.get_object("preferences_record_launch");
enableTimeout = (CheckButton)builder.get_object("preferences_record_enable_timeout");
timeout = (SpinButton)builder.get_object("preferences_record_timeout");
- systemFont.toggled += this.systemFontToggled;
- enableTimeout.toggled += this.enableTimeoutToggled;
- okButton.clicked += ok;
- cancelButton.clicked += cancel;
- dialog.delete_event += hide;
+ systemFont.toggled.connect(this.systemFontToggled);
+ enableTimeout.toggled.connect(this.enableTimeoutToggled);
+ okButton.clicked.connect(ok);
+ cancelButton.clicked.connect(cancel);
+ dialog.delete_event.connect(hide);
}
public void ok(Button button) {
hide();
@@ -131,14 +131,14 @@ public class moserial.PreferencesDialog : GLib.Object
dialog.hide_all();
return true;
}
- public void systemFontToggled(CheckButton button)
+ public void systemFontToggled(ToggleButton button)
{
if(button.get_active())
fontButton.set_sensitive(false);
else
fontButton.set_sensitive(true);
}
- public void enableTimeoutToggled(CheckButton button)
+ public void enableTimeoutToggled(ToggleButton button)
{
if(button.get_active())
timeout.set_sensitive(true);
diff --git a/src/ReceiveChooserDialog.vala b/src/ReceiveChooserDialog.vala
index 46d793d..12a2cb1 100644
--- a/src/ReceiveChooserDialog.vala
+++ b/src/ReceiveChooserDialog.vala
@@ -32,10 +32,10 @@ public class moserial.ReceiveChooserDialog : GLib.Object
construct {
dialog = (FileChooserDialog)builder.get_object("receive_chooser_dialog");
protocolCombo = (ComboBox)builder.get_object("receive_chooser_protocol");
- dialog.delete_event += hide;
+ dialog.delete_event.connect(hide);
dialog.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OK, Gtk.ResponseType.ACCEPT, null);
protocolCombo.set_active(2);
- dialog.response += response;
+ dialog.response.connect(response);
}
public void show(string? folder) {
diff --git a/src/ReceiveProgressDialog.vala b/src/ReceiveProgressDialog.vala
index 5555dd4..b9b1431 100644
--- a/src/ReceiveProgressDialog.vala
+++ b/src/ReceiveProgressDialog.vala
@@ -32,10 +32,10 @@ public class moserial.ReceiveProgressDialog : GLib.Object
construct {
dialog = (Dialog)builder.get_object("receive_progress_dialog");
cancelButton = (Button)builder.get_object("receive_progress_cancel");
- cancelButton.clicked += this.cancel;
+ cancelButton.clicked.connect(this.cancel);
status = (Gtk.Label)builder.get_object("receive_statusbox");
progressBar = (ProgressBar)builder.get_object("receive_progressbar");
- dialog.delete_event += hide;
+ dialog.delete_event.connect(hide);
}
public void show() {
diff --git a/src/RecordDialog.vala b/src/RecordDialog.vala
index cc5bfc0..94e94a8 100644
--- a/src/RecordDialog.vala
+++ b/src/RecordDialog.vala
@@ -35,8 +35,8 @@ public class moserial.RecordDialog : GLib.Object
dialog = (FileChooserDialog)builder.get_object("record_dialog");
cancelButton = (Button)builder.get_object("record_cancel");
streamCombo = (ComboBox)builder.get_object("record_stream");
- dialog.delete_event += hide;
- dialog.response += response;
+ dialog.delete_event.connect(hide);
+ dialog.response.connect(response);
dialog.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_SAVE, Gtk.ResponseType.ACCEPT, null);
dialog.set_do_overwrite_confirmation(true);
dialog.set_local_only(false);
diff --git a/src/SendChooserDialog.vala b/src/SendChooserDialog.vala
index 77642e7..9c683d0 100644
--- a/src/SendChooserDialog.vala
+++ b/src/SendChooserDialog.vala
@@ -31,10 +31,10 @@ public class moserial.SendChooserDialog : GLib.Object
construct {
dialog = (FileChooserDialog)builder.get_object("send_chooser_dialog");
protocolCombo = (ComboBox)builder.get_object("send_chooser_protocol");
- dialog.delete_event += hide;
+ dialog.delete_event.connect(hide);
dialog.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL, Gtk.STOCK_OK, Gtk.ResponseType.ACCEPT, null);
protocolCombo.set_active(2);
- dialog.response += response;
+ dialog.response.connect(response);
}
public void show(string? folder) {
diff --git a/src/SendProgressDialog.vala b/src/SendProgressDialog.vala
index 5f6c18a..473a735 100644
--- a/src/SendProgressDialog.vala
+++ b/src/SendProgressDialog.vala
@@ -32,10 +32,10 @@ public class moserial.SendProgressDialog : GLib.Object
construct {
dialog = (Dialog)builder.get_object("send_progress_dialog");
cancelButton = (Button)builder.get_object("send_progress_cancel");
- cancelButton.clicked += this.cancel;
+ cancelButton.clicked.connect( this.cancel);
status = (Gtk.Label)builder.get_object("send_statusbox");
progressBar = (ProgressBar)builder.get_object("send_progressbar");
- dialog.delete_event += hide;
+ dialog.delete_event.connect(hide);
}
public void show() {
diff --git a/src/SettingsDialog.vala b/src/SettingsDialog.vala
index 41a307a..5a7b89b 100644
--- a/src/SettingsDialog.vala
+++ b/src/SettingsDialog.vala
@@ -59,9 +59,9 @@ public class moserial.SettingsDialog : GLib.Object
softwareHandshake = (CheckButton)builder.get_object("settings_software_handshake");
accessModeCombo = (ComboBox)builder.get_object("settings_open_for");
localEcho = (CheckButton)builder.get_object("settings_local_echo");
- dialog.delete_event += hide;
- cancelButton.clicked += this.cancel;
- okButton.clicked += this.ok;
+ dialog.delete_event.connect(hide);
+ cancelButton.clicked.connect(this.cancel);
+ okButton.clicked.connect(this.ok);
ls = new ListStore(2, typeof(string), typeof(string));
deviceCombo = (ComboBoxEntry)builder.get_object("settings_device");
diff --git a/src/XmodemFilenameDialog.vala b/src/XmodemFilenameDialog.vala
index 54c430e..ff4f671 100644
--- a/src/XmodemFilenameDialog.vala
+++ b/src/XmodemFilenameDialog.vala
@@ -30,8 +30,8 @@ public class moserial.XmodemFilenameDialog : GLib.Object
construct {
dialog = (Dialog)builder.get_object("xmodem_filename_dialog");
xmodemFilename = (Gtk.Entry)builder.get_object("xmodem_filename");
- dialog.delete_event += hide;
- dialog.response += response;
+ dialog.delete_event.connect(hide);
+ dialog.response.connect(response);
}
public void show() {
dialog.run();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]