[chronojump] gui for MicroDiscover cancel
- From: Xavier de Blas <xaviblas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] gui for MicroDiscover cancel
- Date: Wed, 11 May 2022 12:38:07 +0000 (UTC)
commit f079db3b0fe39e63751a50e7958aae1e68602cc9
Author: Xavier de Blas <xaviblas gmail com>
Date: Wed May 11 14:37:53 2022 +0200
gui for MicroDiscover cancel
glade/app1.glade | 6 +++---
src/gui/app1/chronojump.cs | 34 +++++++++++++++++++++++++++-------
2 files changed, 30 insertions(+), 10 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index a0feccaef..9f82a5756 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -50334,15 +50334,15 @@ Since Chronojump 2.1.3, backups contain the complete data.</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <widget class="GtkButton"
id="button_micro_discover_close">
+ <widget class="GtkButton"
id="button_micro_discover_cancel_close">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="can_default">True</property>
<property
name="receives_default">False</property>
- <signal name="clicked"
handler="on_button_micro_discover_close_clicked" swapped="no"/>
+ <signal name="clicked"
handler="on_button_micro_discover_cancel_close_clicked" swapped="no"/>
<accelerator key="Escape" signal="clicked"/>
<child>
- <widget class="GtkEventBox"
id="eventbox_button_micro_discover_close">
+ <widget class="GtkEventBox"
id="eventbox_button_micro_discover_cancel_close">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index 03424cdc5..60e66a9b0 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -303,7 +303,7 @@ public partial class ChronoJumpWindow
[Widget] Gtk.Label label_micro_discover_ports;
[Widget] Gtk.ProgressBar progressbar_micro_discover_ports;
[Widget] Gtk.ProgressBar progressbar_micro_discover_status;
- [Widget] Gtk.EventBox eventbox_button_micro_discover_close;
+ [Widget] Gtk.EventBox eventbox_button_micro_discover_cancel_close;
[Widget] Gtk.Image image_button_micro_discover_cancel_close;
[Widget] Gtk.Label label_button_micro_discover_cancel_close;
@@ -671,7 +671,7 @@ public partial class ChronoJumpWindow
UtilGtk.EventBoxColorBackgroundActive (eventbox_button_open_chronojump, UtilGtk.YELLOW,
UtilGtk.YELLOW_LIGHT);
UtilGtk.EventBoxColorBackgroundActive (eventbox_button_help_close, UtilGtk.YELLOW,
UtilGtk.YELLOW_LIGHT);
UtilGtk.EventBoxColorBackgroundActive (eventbox_button_news_close, UtilGtk.YELLOW,
UtilGtk.YELLOW_LIGHT);
- UtilGtk.EventBoxColorBackgroundActive (eventbox_button_micro_discover_close, UtilGtk.YELLOW,
UtilGtk.YELLOW_LIGHT);
+ UtilGtk.EventBoxColorBackgroundActive (eventbox_button_micro_discover_cancel_close,
UtilGtk.YELLOW, UtilGtk.YELLOW_LIGHT);
UtilGtk.EventBoxColorBackgroundActive (eventbox_button_exit_cancel, UtilGtk.YELLOW,
UtilGtk.YELLOW_LIGHT);
UtilGtk.EventBoxColorBackgroundActive (eventbox_button_exit_confirm, UtilGtk.YELLOW,
UtilGtk.YELLOW_LIGHT);
app1s_eventboxes_paint();
@@ -4610,9 +4610,17 @@ public partial class ChronoJumpWindow
private bool pulseDiscoverGTK ()
{
progressbar_micro_discover_ports.Fraction = microDiscover.ProgressBarCurrentMicroValue;
- progressbar_micro_discover_ports.Text = microDiscover.ProgressBarCurrentMicroText;
+
+ if(microDiscover != null && microDiscover.Cancel)
+ progressbar_micro_discover_ports.Text = Catalog.GetString("Cancelling");
+ else
+ progressbar_micro_discover_ports.Text = microDiscover.ProgressBarCurrentMicroText;
+
//progressbar_micro_discover_status.Fraction = microDiscover.ProgressBarStatusValue;
- progressbar_micro_discover_status.Text = microDiscover.ProgressBarStatusText;
+ if(microDiscover != null && microDiscover.Cancel)
+ progressbar_micro_discover_status.Text = Catalog.GetString("Cancelling");
+ else
+ progressbar_micro_discover_status.Text = microDiscover.ProgressBarStatusText;
if(! discoverThread.IsAlive)
{
@@ -4622,6 +4630,12 @@ public partial class ChronoJumpWindow
progressbar_micro_discover_status.Fraction = 1;
+ if(microDiscover != null && microDiscover.Cancel)
+ {
+ progressbar_micro_discover_ports.Text = Catalog.GetString("Cancelled");
+ progressbar_micro_discover_status.Text = Catalog.GetString("Cancelled");
+ }
+
image_button_micro_discover_cancel_close.Pixbuf =
new Pixbuf (null, Util.GetImagePath(false) + "image_close.png");
label_button_micro_discover_cancel_close.Text = Catalog.GetString("Close");
@@ -4634,10 +4648,16 @@ public partial class ChronoJumpWindow
return true;
}
- private void on_button_micro_discover_close_clicked (object o, EventArgs args)
+ private void on_button_micro_discover_cancel_close_clicked (object o, EventArgs args)
{
- notebook_sup.CurrentPage = app1s_notebook_sup_entered_from; //CONTACTS or ENCODER
- menus_and_mode_sensitive (true);
+ if (discoverThread != null && discoverThread.IsAlive && microDiscover != null)
+ {
+ //label_micro_discover_ports.Text = Catalog.GetString("Cancelling");
+ microDiscover.Cancel = true;
+ } else {
+ notebook_sup.CurrentPage = app1s_notebook_sup_entered_from; //CONTACTS or ENCODER
+ menus_and_mode_sensitive (true);
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]