[chronojump] Improvements on chronopicRegister window
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] Improvements on chronopicRegister window
- Date: Tue, 25 Oct 2016 16:23:51 +0000 (UTC)
commit 49034fb9737825c507e235153451de0c7e0a0483
Author: Xavier de Blas <xaviblas gmail com>
Date: Tue Oct 25 18:23:17 2016 +0200
Improvements on chronopicRegister window
images/chronopic.png | Bin 0 -> 46191 bytes
po/POTFILES.in | 2 +-
src/Makefile.am | 1 +
src/constants.cs | 1 +
src/gui/chronopicRegister.cs | 33 ++++++++++++++++++++++-----------
src/gui/chronopicWizard.cs | 29 ++++++++++++++++++++---------
6 files changed, 45 insertions(+), 21 deletions(-)
---
diff --git a/images/chronopic.png b/images/chronopic.png
new file mode 100644
index 0000000..072de3c
Binary files /dev/null and b/images/chronopic.png differ
diff --git a/po/POTFILES.in b/po/POTFILES.in
index 88deb39..8777ed3 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -58,7 +58,7 @@ src/execute/run.cs
src/exportSession.cs
src/gui/chronojump.cs
src/gui/chronopic.cs
-src/gui/chronopicWizard.cs
+src/gui/chronopicRegister.cs
src/gui/convertWeight.cs
src/gui/encoderConfiguration.cs
src/gui/encoder.cs
diff --git a/src/Makefile.am b/src/Makefile.am
index 19df81d..d1ac377 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -312,6 +312,7 @@ RESOURCES = \
../images/auto-by-series.png,auto-by-series.png \
../images/auto-person-skip.png,auto-person-skip.png \
../images/auto-person-remove.png,auto-person-remove.png \
+ ../images/chronopic.png,chronopic.png \
../images/chronopic1.jpg,chronopic1.jpg \
../images/mini/chronopic1.jpg,mini/chronopic1.jpg \
../images/chronopic2.jpg,chronopic2.jpg \
diff --git a/src/constants.cs b/src/constants.cs
index 09f6824..09f3828 100644
--- a/src/constants.cs
+++ b/src/constants.cs
@@ -429,6 +429,7 @@ public class Constants
public static string FileNameJumpsFallCalculate = "dj-from-in.png";
public static string FileNameJumpsFallPredefined = "dj-from-out.png";
+ public static string FileNameChronopic = "chronopic.png";
public static string FileNameChronopic1 = "chronopic1.jpg";
public static string FileNameChronopic2 = "chronopic2.jpg";
public static string FileNameChronopic3 = "chronopic3.jpg";
diff --git a/src/gui/chronopicRegister.cs b/src/gui/chronopicRegister.cs
index 63e8978..98193f5 100644
--- a/src/gui/chronopicRegister.cs
+++ b/src/gui/chronopicRegister.cs
@@ -20,7 +20,9 @@
using System;
using System.Collections.Generic; //List<T>
+using Gdk;
using Gtk;
+using Mono.Unix;
public class ChronopicRegisterWindowTypes
{
@@ -71,7 +73,7 @@ public class ChronopicRegisterWindow
UtilGtk.IconWindow(chronopic_register_win);
createVBoxMain();
- createTreeView(list);
+ createContent(list);
createButton();
chronopic_register_win.ShowAll();
@@ -80,7 +82,7 @@ public class ChronopicRegisterWindow
private void createWindow(Gtk.Window app1)
{
- chronopic_register_win = new Window ("Chronopic register");
+ chronopic_register_win = new Gtk.Window ("Chronopic register");
chronopic_register_win.AllowGrow = false;
chronopic_register_win.Modal = true;
chronopic_register_win.TransientFor = app1;
@@ -102,19 +104,19 @@ public class ChronopicRegisterWindow
Gtk.ListStore listStoreAll;
//based on: ~/informatica/progs_meus/mono/treemodel.cs
- private void createTreeView(List<ChronopicRegisterPort> list)
+ private void createContent(List<ChronopicRegisterPort> list)
{
treeview = new Gtk.TreeView();
// Create column , cell renderer and add the cell to the serialN column
Gtk.TreeViewColumn serialNCol = new Gtk.TreeViewColumn ();
- serialNCol.Title = "Serial Number";
+ serialNCol.Title = " " + Catalog.GetString("Serial Number") + " ";
Gtk.CellRendererText serialNCell = new Gtk.CellRendererText ();
serialNCol.PackStart (serialNCell, true);
// Create column , cell renderer and add the cell to the port column
Gtk.TreeViewColumn portCol = new Gtk.TreeViewColumn ();
- portCol.Title = "Port";
+ portCol.Title = " Port ";
Gtk.CellRendererText portCell = new Gtk.CellRendererText ();
portCol.PackStart (portCell, true);
@@ -122,7 +124,7 @@ public class ChronopicRegisterWindow
//-- cell renderer toggles
Gtk.TreeViewColumn unknownCol = new Gtk.TreeViewColumn ();
- unknownCol.Title = "Not configured";
+ unknownCol.Title = " " + Catalog.GetString("Not configured") + " ";
Gtk.CellRendererToggle unknownCell = new Gtk.CellRendererToggle ();
unknownCell.Activatable = true;
unknownCell.Radio = true; //draw as radiobutton
@@ -130,7 +132,7 @@ public class ChronopicRegisterWindow
unknownCol.PackStart (unknownCell, true);
Gtk.TreeViewColumn contactsCol = new Gtk.TreeViewColumn ();
- contactsCol.Title = "Jumps/Runs";
+ contactsCol.Title = " " + Catalog.GetString("Jumps/Runs") + " ";
Gtk.CellRendererToggle contactsCell = new Gtk.CellRendererToggle ();
contactsCell.Activatable = true;
contactsCell.Radio = true; //draw as radiobutton
@@ -138,7 +140,7 @@ public class ChronopicRegisterWindow
contactsCol.PackStart (contactsCell, true);
Gtk.TreeViewColumn encoderCol = new Gtk.TreeViewColumn ();
- encoderCol.Title = "Encoder";
+ encoderCol.Title = " " + Catalog.GetString("Encoder") + " ";
Gtk.CellRendererToggle encoderCell = new Gtk.CellRendererToggle ();
encoderCell.Activatable = true;
encoderCell.Radio = true; //draw as radiobutton
@@ -173,16 +175,25 @@ public class ChronopicRegisterWindow
treeview.AppendColumn (contactsCol);
treeview.AppendColumn (encoderCol);
+ Gtk.HBox hbox = new Gtk.HBox(false, 0);
+
+ //create image
+ Pixbuf pixbuf = new Pixbuf (null, Util.GetImagePath(false) + Constants.FileNameChronopic);
+ Gtk.Image image = new Gtk.Image();
+ image.Pixbuf = pixbuf;
+ hbox.Add(image);
+ //create label
Gtk.Label label;
if(chronopicsFound)
- label = new Gtk.Label("");
+ label = new Gtk.Label("Chronopics found ... (blah, blah, blah)\nSay something if 1 or
more is not configured");
else
label = new Gtk.Label("Chronopic/s not found:\nConnect and reopen this window.");
+ hbox.Add(label);
- Gtk.VBox vboxTV = new Gtk.VBox(false, 8);
+ Gtk.VBox vboxTV = new Gtk.VBox(false, 12);
+ vboxTV.Add(hbox);
vboxTV.Add(treeview);
- vboxTV.Add(label);
vbox_main.Add(vboxTV);
}
diff --git a/src/gui/chronopicWizard.cs b/src/gui/chronopicWizard.cs
index 84117e7..23c123b 100644
--- a/src/gui/chronopicWizard.cs
+++ b/src/gui/chronopicWizard.cs
@@ -23,7 +23,7 @@ using System.IO; //for Path
using System.IO.Ports;
using Gtk;
using Glade;
-using Mono.Unix;
+//using Mono.Unix;
using System.Collections;
public class ChronopicWizardWindow
@@ -126,7 +126,8 @@ public class ChronopicWizardWindow
radio_encoder4.Visible = false;
radio_encoder5.Visible = false;
- button_next.Label = Catalog.GetString("Next");
+ //button_next.Label = Catalog.GetString("Next");
+ button_next.Label = "Next";
button_next.Sensitive = true;
}
@@ -256,7 +257,8 @@ public class ChronopicWizardWindow
{
button_done_contacts.Sensitive = false;
hbox_detection_contacts.Sensitive = true;
- progressbar_contacts.Text = Catalog.GetString("Detecting");
+ //progressbar_contacts.Text = Catalog.GetString("Detecting");
+ progressbar_contacts.Text = "Detecting";
progressbarContinue = true;
progressbarCount = 0;
GLib.Timeout.Add(50, new GLib.TimeoutHandler(progressbarContactsDo)); //each 50 ms
@@ -273,7 +275,8 @@ public class ChronopicWizardWindow
void on_button_cancel_contacts_clicked (object o, EventArgs args)
{
progressbarContinue = false;
- progressbar_contacts.Text = Catalog.GetString("Cancelled");
+ //progressbar_contacts.Text = Catalog.GetString("Cancelled");
+ progressbar_contacts.Text = "Cancelled";
hbox_detection_contacts.Sensitive = false;
button_done_contacts.Sensitive = true;
}
@@ -284,7 +287,8 @@ public class ChronopicWizardWindow
{
button_done_encoder.Sensitive = false;
hbox_detection_encoder.Sensitive = true;
- progressbar_encoder.Text = Catalog.GetString("Detecting");
+ //progressbar_encoder.Text = Catalog.GetString("Detecting");
+ progressbar_encoder.Text = "Detecting";
progressbarContinue = true;
progressbarCount = 0;
GLib.Timeout.Add(50, new GLib.TimeoutHandler(progressbarEncoderDo)); //each 50 ms
@@ -298,12 +302,14 @@ public class ChronopicWizardWindow
notebook_encoder.CurrentPage = 1;
button_next.Sensitive = true;
- button_next.Label = Catalog.GetString("Finish");
+ //button_next.Label = Catalog.GetString("Finish");
+ button_next.Label = "Finish";
}
void on_button_cancel_encoder_clicked (object o, EventArgs args)
{
progressbarContinue = false;
- progressbar_encoder.Text = Catalog.GetString("Cancelled");
+ //progressbar_encoder.Text = Catalog.GetString("Cancelled");
+ progressbar_encoder.Text = "Cancelled";
hbox_detection_encoder.Sensitive = false;
button_done_encoder.Sensitive = true;
}
@@ -316,6 +322,7 @@ public class ChronopicWizardWindow
if(notebook_main.CurrentPage == 0)
{
//from page 0 to page 1 show unplug message
+ /*
int numCPs = 1;
if(radio_start_both.Active)
numCPs = 2;
@@ -323,6 +330,8 @@ public class ChronopicWizardWindow
label_unplug.Text = Catalog.GetPluralString(
"Please, unplug Chronopic USB cable.",
"Please, unplug Chronopic USB cables.", numCPs);
+ */
+ label_unplug.Text = "Please, unplug Chronopic USB cable/s.";
button_next.Sensitive = false; //unsensitive until click on Done
}
@@ -333,7 +342,8 @@ public class ChronopicWizardWindow
if(radio_start_contacts.Active) {
//if there will be no encoder, rename Next to Finish
- button_next.Label = Catalog.GetString("Finish");
+ //button_next.Label = Catalog.GetString("Finish");
+ button_next.Label = "Finish";
}
else if(radio_start_encoder.Active) {
//if there will be no contacts, jump to encoder page
@@ -350,7 +360,8 @@ public class ChronopicWizardWindow
button_next.Sensitive = false; //unsensitive until click on Done
//rename Next to Finish
- button_next.Label = Catalog.GetString("Finish");
+ //button_next.Label = Catalog.GetString("Finish");
+ button_next.Label = "Finish";
}
}
else if(notebook_main.CurrentPage == 3) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]