[moserial] migrate tooltips from the glade file into code, for gtk_builder migration



commit c6fec6d070993d139b3f5be0eb3b8c307909fc8d
Author: Michael J. Chudobiak <mjc avtechpulse com>
Date:   Thu Aug 18 08:40:22 2011 -0400

    migrate tooltips from the glade file into code, for gtk_builder migration

 data/glade/moserial.glade  |   14 --------------
 data/glade/moserial.ui     |   14 --------------
 src/MainWindow.vala        |   11 ++++++++++-
 src/PreferencesDialog.vala |    5 +++++
 src/SettingsDialog.vala    |    8 ++++++++
 5 files changed, 23 insertions(+), 29 deletions(-)
---
diff --git a/data/glade/moserial.glade b/data/glade/moserial.glade
index 4ca1337..0b78114 100644
--- a/data/glade/moserial.glade
+++ b/data/glade/moserial.glade
@@ -192,7 +192,6 @@
             <child>
               <widget class="GtkToggleToolButton" id="toolbar_connect">
                 <property name="visible">True</property>
-                <property name="tooltip" translatable="yes">Open/close port</property>
                 <property name="is_important">True</property>
                 <property name="label" translatable="yes">Connect</property>
                 <property name="use_underline">True</property>
@@ -215,7 +214,6 @@
             <child>
               <widget class="GtkToggleToolButton" id="toolbar_logging">
                 <property name="visible">True</property>
-                <property name="tooltip" translatable="yes">Record sent and/or received data</property>
                 <property name="is_important">True</property>
                 <property name="label" translatable="yes">Record</property>
                 <property name="use_underline">True</property>
@@ -229,7 +227,6 @@
             <child>
               <widget class="GtkToolButton" id="toolbar_send">
                 <property name="visible">True</property>
-                <property name="tooltip" translatable="yes">Send a file</property>
                 <property name="is_important">True</property>
                 <property name="label" translatable="yes">Send File</property>
                 <property name="use_underline">True</property>
@@ -243,7 +240,6 @@
             <child>
               <widget class="GtkToolButton" id="toolbar_receive">
                 <property name="visible">True</property>
-                <property name="tooltip" translatable="yes">Receive a file</property>
                 <property name="is_important">True</property>
                 <property name="label" translatable="yes">Receive File</property>
                 <property name="use_underline">True</property>
@@ -266,7 +262,6 @@
             <child>
               <widget class="GtkToolButton" id="toolbar_settings">
                 <property name="visible">True</property>
-                <property name="tooltip" translatable="yes">Port configuration</property>
                 <property name="is_important">True</property>
                 <property name="label" translatable="yes">Port Setup</property>
                 <property name="use_underline">True</property>
@@ -280,7 +275,6 @@
             <child>
               <widget class="GtkToolButton" id="toolbar_preferences">
                 <property name="visible">True</property>
-                <property name="tooltip" translatable="yes">Other preferences</property>
                 <property name="is_important">True</property>
                 <property name="label" translatable="yes">Preferences</property>
                 <property name="use_underline">True</property>
@@ -302,7 +296,6 @@
             <child>
               <widget class="GtkToolButton" id="toolbar_help">
                 <property name="visible">True</property>
-                <property name="tooltip" translatable="yes">Help</property>
                 <property name="is_important">True</property>
                 <property name="label" translatable="yes">Help</property>
                 <property name="use_underline">True</property>
@@ -499,7 +492,6 @@
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="has_focus">True</property>
-                    <property name="tooltip" translatable="yes">Type outgoing data here. Press Enter or Send to send it.</property>
                     <property name="invisible_char">&#x25CF;</property>
                   </widget>
                   <packing>
@@ -512,7 +504,6 @@
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">False</property>
-                    <property name="tooltip" translatable="yes">Send the outgoing data now.</property>
                     <property name="use_underline">True</property>
                   </widget>
                   <packing>
@@ -651,7 +642,6 @@ Write Only</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">False</property>
-                        <property name="tooltip" translatable="yes">Also known as RTS/CTS handshaking</property>
                         <property name="use_underline">True</property>
                         <property name="draw_indicator">True</property>
                       </widget>
@@ -666,7 +656,6 @@ Write Only</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">False</property>
-                        <property name="tooltip" translatable="yes">Also known as XON/XOFF handshaking</property>
                         <property name="use_underline">True</property>
                         <property name="draw_indicator">True</property>
                       </widget>
@@ -881,7 +870,6 @@ Space</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">False</property>
-                    <property name="tooltip" translatable="yes">Normally disabled</property>
                     <property name="use_underline">True</property>
                     <property name="draw_indicator">True</property>
                   </widget>
@@ -1614,7 +1602,6 @@ None (straight binary)</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">False</property>
-                        <property name="tooltip" translatable="yes">If this option is enabled, a recorded file will be opened immediately after it is saved, using the default application for the file type. The default application is defined by the desktop environment.</property>
                         <property name="use_underline">True</property>
                         <property name="active">True</property>
                         <property name="draw_indicator">True</property>
@@ -1639,7 +1626,6 @@ None (straight binary)</property>
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">False</property>
-                        <property name="tooltip" translatable="yes">If this option is enabled, recording will be automatically stopped after an adjustable period of inactivity after receiving some data. That is, moserial will wait indefinitely to record the first data byte before activating the inactivity timer.</property>
                         <property name="use_underline">True</property>
                         <property name="draw_indicator">True</property>
                       </widget>
diff --git a/data/glade/moserial.ui b/data/glade/moserial.ui
index d7e049e..e4ab03c 100644
--- a/data/glade/moserial.ui
+++ b/data/glade/moserial.ui
@@ -399,7 +399,6 @@
             <child>
               <object class="GtkToggleToolButton" id="toolbar_connect">
                 <property name="visible">True</property>
-                <property name="tooltip-text" translatable="yes">Open/close port</property>
                 <property name="is_important">True</property>
                 <property name="label" translatable="yes">Connect</property>
                 <property name="use_underline">True</property>
@@ -422,7 +421,6 @@
             <child>
               <object class="GtkToggleToolButton" id="toolbar_logging">
                 <property name="visible">True</property>
-                <property name="tooltip-text" translatable="yes">Record sent and/or received data</property>
                 <property name="is_important">True</property>
                 <property name="label" translatable="yes">Record</property>
                 <property name="use_underline">True</property>
@@ -436,7 +434,6 @@
             <child>
               <object class="GtkToolButton" id="toolbar_send">
                 <property name="visible">True</property>
-                <property name="tooltip-text" translatable="yes">Send a file</property>
                 <property name="is_important">True</property>
                 <property name="label" translatable="yes">Send File</property>
                 <property name="use_underline">True</property>
@@ -450,7 +447,6 @@
             <child>
               <object class="GtkToolButton" id="toolbar_receive">
                 <property name="visible">True</property>
-                <property name="tooltip-text" translatable="yes">Receive a file</property>
                 <property name="is_important">True</property>
                 <property name="label" translatable="yes">Receive File</property>
                 <property name="use_underline">True</property>
@@ -473,7 +469,6 @@
             <child>
               <object class="GtkToolButton" id="toolbar_settings">
                 <property name="visible">True</property>
-                <property name="tooltip-text" translatable="yes">Port configuration</property>
                 <property name="is_important">True</property>
                 <property name="label" translatable="yes">Port Setup</property>
                 <property name="use_underline">True</property>
@@ -487,7 +482,6 @@
             <child>
               <object class="GtkToolButton" id="toolbar_preferences">
                 <property name="visible">True</property>
-                <property name="tooltip-text" translatable="yes">Other preferences</property>
                 <property name="is_important">True</property>
                 <property name="label" translatable="yes">Preferences</property>
                 <property name="use_underline">True</property>
@@ -509,7 +503,6 @@
             <child>
               <object class="GtkToolButton" id="toolbar_help">
                 <property name="visible">True</property>
-                <property name="tooltip-text" translatable="yes">Help</property>
                 <property name="is_important">True</property>
                 <property name="label" translatable="yes">Help</property>
                 <property name="use_underline">True</property>
@@ -696,7 +689,6 @@
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="has_focus">True</property>
-                    <property name="tooltip-text" translatable="yes">Type outgoing data here. Press Enter or Send to send it.</property>
                     <property name="invisible_char">&#x25CF;</property>
                   </object>
                   <packing>
@@ -709,7 +701,6 @@
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">False</property>
-                    <property name="tooltip-text" translatable="yes">Send the outgoing data now.</property>
                     <property name="use_underline">True</property>
                   </object>
                   <packing>
@@ -858,7 +849,6 @@
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">False</property>
-                        <property name="tooltip-text" translatable="yes">Also known as RTS/CTS handshaking</property>
                         <property name="use_underline">True</property>
                         <property name="draw_indicator">True</property>
                       </object>
@@ -873,7 +863,6 @@
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">False</property>
-                        <property name="tooltip-text" translatable="yes">Also known as XON/XOFF handshaking</property>
                         <property name="use_underline">True</property>
                         <property name="draw_indicator">True</property>
                       </object>
@@ -1088,7 +1077,6 @@
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
                     <property name="receives_default">False</property>
-                    <property name="tooltip-text" translatable="yes">Normally disabled</property>
                     <property name="use_underline">True</property>
                     <property name="draw_indicator">True</property>
                   </object>
@@ -1834,7 +1822,6 @@
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">False</property>
-                        <property name="tooltip-text" translatable="yes">If this option is enabled, a recorded file will be opened immediately after it is saved, using the default application for the file type. The default application is defined by the desktop environment.</property>
                         <property name="use_underline">True</property>
                         <property name="active">True</property>
                         <property name="draw_indicator">True</property>
@@ -1859,7 +1846,6 @@
                         <property name="visible">True</property>
                         <property name="can_focus">True</property>
                         <property name="receives_default">False</property>
-                        <property name="tooltip-text" translatable="yes">If this option is enabled, recording will be automatically stopped after an adjustable period of inactivity after receiving some data. That is, moserial will wait indefinitely to record the first data byte before activating the inactivity timer.</property>
                         <property name="use_underline">True</property>
                         <property name="draw_indicator">True</property>
                       </object>
diff --git a/src/MainWindow.vala b/src/MainWindow.vala
index a4921e2..6b832b7 100644
--- a/src/MainWindow.vala
+++ b/src/MainWindow.vala
@@ -149,10 +149,12 @@ public class moserial.MainWindow : Gtk.Window //Have to extend Gtk.Winow to get
                 settingsDialog.updateSettings.connect(this.updateSettings);
                 settingsButton = (ToolButton)builder.get_object("toolbar_settings");
                 settingsButton.clicked.connect(this.showSettingsDialog);
+		settingsButton.set_tooltip_text (_("Port configuration"));
 
                 //setup the Help button
                 ToolButton helpButton = (ToolButton)builder.get_object("toolbar_help");
                 helpButton.clicked.connect(showHelpButton);
+		helpButton.set_tooltip_text (_("Read the manual"));
 
                 //setup the statusbar
                 statusbar = (Statusbar)builder.get_object("statusbar");
@@ -173,6 +175,7 @@ public class moserial.MainWindow : Gtk.Window //Have to extend Gtk.Winow to get
                 sendChooserDialog = new SendChooserDialog(builder);
                 send = (ToolButton)builder.get_object("toolbar_send");
                 send.clicked.connect(doSendChooser);
+		send.set_tooltip_text (_("Send a file"));
                 sendChooserDialog.startTransfer.connect(this.doSend);
                 sz = new Szwrapper(Szwrapper.Protocol.NULL, null, null);
 
@@ -180,7 +183,8 @@ public class moserial.MainWindow : Gtk.Window //Have to extend Gtk.Winow to get
                 receiveProgressDialog = new ReceiveProgressDialog(builder);
                 receiveChooserDialog = new ReceiveChooserDialog(builder);
                 receive = (ToolButton)builder.get_object("toolbar_receive");
-                receive.clicked .connect(doReceiveChooser);
+                receive.clicked.connect(doReceiveChooser);
+		receive.set_tooltip_text (_("Receive a file"));
                 receiveChooserDialog.startTransfer.connect(this.doReceive);
                 xmodemFilenameDialog = new XmodemFilenameDialog(builder);
                 rz = new Rzwrapper(Rzwrapper.Protocol.NULL, null, null, null);
@@ -190,6 +194,7 @@ public class moserial.MainWindow : Gtk.Window //Have to extend Gtk.Winow to get
                 recordDialog = new RecordDialog(builder);
                 recordButton = (ToggleToolButton)builder.get_object("toolbar_logging");
                 recordButton.toggled.connect(this.record);
+                recordButton.set_tooltip_text (_("Record sent and/or received data"));
                 recordDialog.stopRecording.connect(this.stopRecording);
                 recordDialog.startRecording.connect(this.startRecording);
                 recordLabel = (Label)builder.get_object("record_label");
@@ -200,10 +205,12 @@ public class moserial.MainWindow : Gtk.Window //Have to extend Gtk.Winow to get
                 preferencesDialog.updatePreferences.connect(this.updatePreferences);
                 ToolButton preferences = (ToolButton)builder.get_object("toolbar_preferences");
                 preferences.clicked.connect(this.showPreferencesDialog);
+		preferences.set_tooltip_text (_("Other preferences"));
 
                 //setup connectbutton
                 connectButton = (ToggleToolButton)builder.get_object("toolbar_connect");
                 connectButton.toggled.connect(this.connectButtonClick);
+		connectButton.set_tooltip_text (_("Open/close port"));
                 disconnectLabel = (Label)builder.get_object("disconnect_label");
                 connectLabel = (Label)builder.get_object("connect_label");
 
@@ -251,8 +258,10 @@ public class moserial.MainWindow : Gtk.Window //Have to extend Gtk.Winow to get
                 //setup entry
                 sendButton = (Button)builder.get_object("send");
                 sendButton.clicked.connect(sendString);
+		sendButton.set_tooltip_text (_("Send the outgoing data now."));
                 entry = (Gtk.Entry)builder.get_object("entry");
                 entry.activate.connect(sendString);
+		entry.set_tooltip_text (_("Type outgoing data here. Press Enter or Send to send it."));
                 inputMode = (ComboBox)builder.get_object("input_mode");
                 inputMode.set_active(0);
 		inputMode.changed.connect(inputModeChanged);
diff --git a/src/PreferencesDialog.vala b/src/PreferencesDialog.vala
index 7668a9c..30ec858 100644
--- a/src/PreferencesDialog.vala
+++ b/src/PreferencesDialog.vala
@@ -45,8 +45,13 @@ public class moserial.PreferencesDialog : GLib.Object
                 fontColorButton = (ColorButton)builder.get_object("preferences_font_color_button");
                 backgroundColorButton = (ColorButton)builder.get_object("preferences_background_color_button");
                 highlightColorButton = (ColorButton)builder.get_object("preferences_highlight_color_button");
+
                 recordLaunch = (CheckButton)builder.get_object("preferences_record_launch");
+		recordLaunch.set_tooltip_text (_("If this option is enabled, a recorded file will be opened immediately after it is saved, using the default application for the file type. The default application is defined by the desktop environment."));
+
                 enableTimeout = (CheckButton)builder.get_object("preferences_record_enable_timeout");
+		enableTimeout.set_tooltip_text (_("If this option is enabled, recording will be automatically stopped after an adjustable period of inactivity after receiving some data. That is, moserial will wait indefinitely to record the first data byte before activating the inactivity timer."));
+
                 timeout = (SpinButton)builder.get_object("preferences_record_timeout");
                 systemFont.toggled.connect(this.systemFontToggled);
                 enableTimeout.toggled.connect(this.enableTimeoutToggled);
diff --git a/src/SettingsDialog.vala b/src/SettingsDialog.vala
index 8b0f8d6..003f3ab 100644
--- a/src/SettingsDialog.vala
+++ b/src/SettingsDialog.vala
@@ -55,10 +55,18 @@ public class moserial.SettingsDialog : GLib.Object
                 dataBitsCombo = (ComboBox)builder.get_object("settings_data_bits");
                 stopBitsCombo = (ComboBox)builder.get_object("settings_stop_bits");
                 parityCombo = (ComboBox)builder.get_object("settings_parity");
+
                 hardwareHandshake = (CheckButton)builder.get_object("settings_hardware_handshake");
+		hardwareHandshake.set_tooltip_text (_("Also known as RTS/CTS handshaking"));
+
                 softwareHandshake = (CheckButton)builder.get_object("settings_software_handshake");
+		softwareHandshake.set_tooltip_text (_("Also known as XON/XOFF handshaking"));
+
                 accessModeCombo = (ComboBox)builder.get_object("settings_open_for");
+
                 localEcho = (CheckButton)builder.get_object("settings_local_echo");
+		localEcho.set_tooltip_text (_("Normally disabled"));
+
                 dialog.delete_event.connect(hide);
                 cancelButton.clicked.connect(this.cancel);
                 okButton.clicked.connect(this.ok);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]