void on_entries_required_changed(object o, EventArgs args) { bool allOk = true; if (UtilGtk.ComboGetActive(combo_test_types) != Catalog.GetString(Constants.UndefinedDefault)) { image_test_type.Hide(); combo_tests.Sensitive = true; combo_variables.Sensitive = true; } else { image_test_type.Show(); combo_tests.Sensitive = false; combo_variables.Sensitive = false; allOk = false; } //a continent cannot be searched without selecting the country if (UtilGtk.ComboGetActive(combo_continents) == Catalog.GetString(Constants.Any)) { combo_countries.Sensitive = false; image_country.Hide(); } else { combo_countries.Sensitive = true; if (UtilGtk.ComboGetActive(combo_countries) == Catalog.GetString(Constants.UndefinedDefault)) { image_country.Show(); allOk = false; } else { image_country.Hide(); } } if (allOk) { textViewUpdate(sqlBuildSelect(false)); button_search.Sensitive = true; } else { textViewUpdate(""); button_search.Sensitive = false; } }
private void initialize(string title, Constants.MessageTypes type, string message) { LogB.Information("Dialog message: " + message); Glade.XML gladeXML; gladeXML = Glade.XML.FromAssembly(Util.GetGladePath() + "dialog_message.glade", "dialog_message", "chronojump"); gladeXML.Autoconnect(this); //put an icon to window UtilGtk.IconWindow(dialog_message); //with this, user doesn't see a moving/changing creation window //if uncommented, then does weird bug in windows not showing dialog as its correct size until window is moves //dialog_message.Hide(); if (title != "") { dialog_message.Title = title; } label_message.Text = message; label_message.UseMarkup = true; switch (type) { case Constants.MessageTypes.WARNING: image_warning.Show(); image_info.Hide(); image_help.Hide(); break; case Constants.MessageTypes.INFO: image_warning.Hide(); image_info.Show(); image_help.Hide(); break; case Constants.MessageTypes.HELP: image_warning.Hide(); image_info.Hide(); image_help.Show(); break; } label_message.Show(); dialog_message.Show(); }
private void on_button_send_log_clicked(object o, EventArgs args) { string email = entry_send_log.Text.ToString(); //email can be validated with Util.IsValidEmail(string) //or other methods, but maybe there's no need of complexity now //1st save email on sqlite if (email != null && email != "" && email != "0" && email != emailStored) { SqlitePreferences.Update("email", email, false); } //2nd add language as comments string language = get_send_log_language(); SqlitePreferences.Update("crashLogLanguage", language, false); string comments = "Answer in: " + language + "\n"; //3rd if there are comments, add them at the beginning of the file comments += textview_comments.Buffer.Text; //4th send Json Json js = new Json(); bool success = js.PostCrashLog(email, comments); if (success) { button_send_log.Label = Catalog.GetString("Thanks"); button_send_log.Sensitive = false; image_send_log_yes.Show(); image_send_log_no.Hide(); LogB.Information(js.ResultMessage); } else { button_send_log.Label = Catalog.GetString("Try again"); image_send_log_yes.Hide(); image_send_log_no.Show(); LogB.Error(js.ResultMessage); } label_send_log_message.Text = js.ResultMessage; }
protected void SetImage(Gdk.Pixbuf normal, Gdk.Pixbuf hover) { imageHover = hover; imageNormal = normal; if (imageNormal == null) { image.NoShowAll = true; image.Hide(); } else { image.NoShowAll = false; ShowAll(); } Update(); }
private void setDefaultValues() { label_connect_contacts.Text = "<b>" + label_connect_contacts.Text + "</b>"; label_connect_encoder.Text = "<b>" + label_connect_encoder.Text + "</b>"; label_connect_contacts.UseMarkup = true; label_connect_encoder.UseMarkup = true; check_multichronopic_show.Active = false; table_multi_chronopic.Visible = false; check_multitest_show.Active = false; check_multitest_show.Sensitive = false; if (isWindows) { combo_linux1.Hide(); combo_linux2.Hide(); combo_linux3.Hide(); combo_linux4.Hide(); combo_linux_encoder.Hide(); combo_windows2.Sensitive = false; combo_windows3.Sensitive = false; combo_windows4.Sensitive = false; } else { combo_windows1.Hide(); combo_windows2.Hide(); combo_windows3.Hide(); combo_windows4.Hide(); combo_windows_encoder.Hide(); combo_linux2.Sensitive = false; combo_linux3.Sensitive = false; combo_linux4.Sensitive = false; } button_connect_cp1.Sensitive = false; button_connect_cp2.Sensitive = false; button_connect_cp3.Sensitive = false; button_connect_cp4.Sensitive = false; connected = false; foreach (ChronopicPortData a in cpd) { if (a.Connected) { connected = true; } } image_cp1_yes.Hide(); image_cp2_yes.Hide(); image_cp3_yes.Hide(); image_cp4_yes.Hide(); //encoderPort = ""; //fakeButtonCancelled = new Gtk.Button(); }
private void connectionSucceded(int port, bool playSound) { string myPort = ((ChronopicPortData)cpd[port - 1]).Port; ((ChronopicPortData)cpd[port - 1]).Connected = true; if (port == 1) { button_connect_cp1.Sensitive = false; image_cp1_no.Hide(); image_cp1_yes.Show(); if (isWindows) { combo_windows1.Sensitive = false; combo_windows2.Sensitive = true; UtilGtk.ComboDelThisValue(combo_windows2, myPort); combo_windows2.Active = 0; //first option UtilGtk.ComboDelThisValue(combo_windows3, myPort); combo_windows3.Active = 0; UtilGtk.ComboDelThisValue(combo_windows4, myPort); combo_windows4.Active = 0; } else { combo_linux1.Sensitive = false; combo_linux2.Sensitive = true; UtilGtk.ComboDelThisValue(combo_linux2, myPort); combo_linux2.Active = 0; //first option UtilGtk.ComboDelThisValue(combo_linux3, myPort); combo_linux3.Active = 0; UtilGtk.ComboDelThisValue(combo_linux4, myPort); combo_linux4.Active = 0; } } else if (port == 2) { button_connect_cp2.Sensitive = false; image_cp2_no.Hide(); image_cp2_yes.Show(); if (isWindows) { combo_windows2.Sensitive = false; combo_windows3.Sensitive = true; UtilGtk.ComboDelThisValue(combo_windows3, myPort); combo_windows3.Active = 0; UtilGtk.ComboDelThisValue(combo_windows4, myPort); combo_windows4.Active = 0; } else { combo_linux2.Sensitive = false; combo_linux3.Sensitive = true; UtilGtk.ComboDelThisValue(combo_linux3, myPort); combo_linux3.Active = 0; UtilGtk.ComboDelThisValue(combo_linux4, myPort); combo_linux4.Active = 0; } } else if (port == 3) { button_connect_cp3.Sensitive = false; image_cp3_no.Hide(); image_cp3_yes.Show(); if (isWindows) { combo_windows3.Sensitive = false; combo_windows4.Sensitive = true; UtilGtk.ComboDelThisValue(combo_windows4, myPort); combo_windows4.Active = 0; } else { combo_linux3.Sensitive = false; combo_linux4.Sensitive = true; UtilGtk.ComboDelThisValue(combo_linux4, myPort); combo_linux4.Active = 0; } } else if (port == 4) { button_connect_cp4.Sensitive = false; image_cp4_no.Hide(); image_cp4_yes.Show(); if (isWindows) { combo_windows4.Sensitive = false; } else { combo_linux4.Sensitive = false; } } connectingInfoHide(); frame_connection.Visible = true; updateChronopicWin(true, Catalog.GetString("connected")); if (playSound) { Util.PlaySound(Constants.SoundTypes.GOOD, volumeOn); } updateChronopicWinValuesState = true; //connected }
/// <summary> /// Placeholder method to draw the existing filename inside the window. /// /// Currently, we are using a method where we create a new HBox and stuff /// the image widget there and remove the old widget, which is technically overkill /// but since this behaves somewhat like a double buffer, it should make the overall /// experience smoother. /// </summary> /// <param name="filename"> /// A <see cref="System.String"/> /// </param> void DrawImageInWindow(string filename) { // Create the new image widget and draw it being hidden try { Log.Debug("Drawing image now"); Gtk.Image drawTarget = new Gtk.Image(filename); drawTarget.Hide(); foreach(Widget child in hbox3.Children) { // remove all existing children hbox3.Remove(child); child.Dispose(); } drawTarget.Show(); hbox3.PackStart(drawTarget, true, true, 0); } catch (Exception ex) { Log.Error("Something broke in DrawImageInWindow - " + ex.Message); } }
private void initialize(string title, Constants.MessageTypes type, string message, bool showScroledWinBar) { LogB.Information("Dialog message: " + message); Glade.XML gladeXML; gladeXML = Glade.XML.FromAssembly(Util.GetGladePath() + "dialog_message.glade", "dialog_message", "chronojump"); gladeXML.Autoconnect(this); button_go.Visible = false; button_go_link = ""; Visible = true; //put an icon to window UtilGtk.IconWindow(dialog_message); //with this, user doesn't see a moving/changing creation window //if uncommented, then does weird bug in windows not showing dialog as its correct size until window is moves //dialog_message.Hide(); if (title != "") { dialog_message.Title = title; } label_message.Text = message; label_message.UseMarkup = true; image_warning.Hide(); image_info.Hide(); image_help.Hide(); image_inspect.Hide(); switch (type) { case Constants.MessageTypes.WARNING: image_warning.Show(); break; case Constants.MessageTypes.INFO: image_info.Show(); break; case Constants.MessageTypes.HELP: image_help.Show(); break; case Constants.MessageTypes.INSPECT: Pixbuf pixbuf = new Pixbuf(null, Util.GetImagePath(false) + "image_test_inspect.png"); image_inspect.Pixbuf = pixbuf; image_inspect.Show(); break; } if (showScroledWinBar) { dialog_message.HeightRequest = 450; scrolledwindow.SetPolicy(PolicyType.Never, PolicyType.Automatic); } else { scrolledwindow.SetPolicy(PolicyType.Never, PolicyType.Never); } label_message.Show(); dialog_message.Show(); }