moserial r32 - in trunk: . src
- From: mjc svn gnome org
- To: svn-commits-list gnome org
- Subject: moserial r32 - in trunk: . src
- Date: Fri, 20 Mar 2009 14:22:06 +0000 (UTC)
Author: mjc
Date: Fri Mar 20 14:22:06 2009
New Revision: 32
URL: http://svn.gnome.org/viewvc/moserial?rev=32&view=rev
Log:
2009-03-20 Michael J. Chudobiak <mjc svn gnome org>
* src/MainWindow.vala:
Show recording filename in window title.
Modified:
trunk/ChangeLog
trunk/src/MainWindow.vala
Modified: trunk/src/MainWindow.vala
==============================================================================
--- trunk/src/MainWindow.vala (original)
+++ trunk/src/MainWindow.vala Fri Mar 20 14:22:06 2009
@@ -279,13 +279,30 @@
updatePreferences(null, currentPreferences);
statusbar.pop(statusbarContext);
statusbar.push(statusbarContext, currentSettings.getStatusbarString(false));
- gtkWindow.set_title("moserial - %s".printf(GLib.Path.get_basename(filename)));
+ setWindowTitle(null);
profileChanged=false;
RecentManager recentManager = RecentManager.get_default ();
recentManager.add_item(GLib.Filename.to_uri(filename));
}
}
+ private void setWindowTitle (string? recordingFilename) {
+ var builder = new StringBuilder();
+ builder.append("moserial");
+
+ if (profileFilename != null) {
+ builder.append(" - ");
+ builder.append(GLib.Path.get_basename(profileFilename));
+ }
+
+ if (recordingFilename != null) {
+ builder.append(" - ");
+ builder.append(GLib.Path.get_basename(recordingFilename));
+ }
+
+ gtkWindow.set_title(builder.str);
+ }
+
private void recentItemOpen(RecentChooser r) {
applyProfile(GLib.Filename.from_uri(r.get_current_uri()));
}
@@ -476,6 +493,7 @@
public void stopRecording(moserial.RecordDialog dialog) {
recordButton.set_active(false); //this generates recordButton.clicked signal
+ setWindowTitle(null);
}
public void startRecording(moserial.RecordDialog dialog, string filename, moserial.SerialStreamRecorder.Direction direction) {
@@ -484,6 +502,7 @@
currentPaths.recordTo=MoUtils.getParentFolder(filename);
if (!ensureConnected())
stopRecording(dialog);
+ setWindowTitle(filename);
} catch (GLib.Error e) {
var errorDialog = new MessageDialog (gtkWindow, DialogFlags.DESTROY_WITH_PARENT, MessageType.ERROR, ButtonsType.CLOSE, "%s: %s\n%s".printf(_("Error: Could not open file"), filename, e.message));
errorDialog.run();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]