[chronojump] social network poll gui done



commit 609d891263d8697c166770aa27ff5af5a4a80605
Author: Xavier de Blas <xaviblas gmail com>
Date:   Mon Jun 7 12:30:36 2021 +0200

    social network poll gui done

 glade/app1.glade           | 481 +++++++++++++++++++++++++++++++++++++++++++++
 src/gui/app1/chronojump.cs |  16 +-
 src/gui/sendLogAndPoll.cs  |   8 +
 3 files changed, 499 insertions(+), 6 deletions(-)
---
diff --git a/glade/app1.glade b/glade/app1.glade
index 8bb48291e..9671c84ef 100644
--- a/glade/app1.glade
+++ b/glade/app1.glade
@@ -25678,6 +25678,12 @@ Concentric</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -40996,6 +41002,12 @@ then click this button.</property>
                                                             <child>
                                                             <placeholder/>
                                                             </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
+                                                            <child>
+                                                            <placeholder/>
+                                                            </child>
                                                             </widget>
                                                             <packing>
                                                             <property name="expand">False</property>
@@ -48516,6 +48528,475 @@ then click this button.</property>
                 <property name="type">tab</property>
               </packing>
             </child>
+            <child>
+              <widget class="GtkVBox" id="vbox_social_network_poll">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <child>
+                  <widget class="GtkViewport" id="viewport_social_network_poll">
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <child>
+                      <widget class="GtkVBox" id="vbox15">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <child>
+                          <widget class="GtkHBox" id="hbox521">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <child>
+                              <widget class="GtkVBox" id="vbox86_social_network_poll">
+                                <property name="visible">True</property>
+                                <property name="can_focus">False</property>
+                                <property name="border_width">20</property>
+                                <property name="spacing">20</property>
+                                <child>
+                                  <widget class="GtkHBox" id="hbox_social_network_poll">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <property name="border_width">4</property>
+                                    <child>
+                                      <widget class="GtkFrame" id="frame36">
+                                        <property name="width_request">650</property>
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">False</property>
+                                        <property name="label_xalign">0</property>
+                                        <property name="label_yalign">1</property>
+                                        <property name="shadow_type">in</property>
+                                        <child>
+                                          <widget class="GtkScrolledWindow" id="scrolledwindow26">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">True</property>
+                                            <property name="hscrollbar_policy">never</property>
+                                            <property name="vscrollbar_policy">never</property>
+                                            <child>
+                                              <widget class="GtkViewport" id="viewport24">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="border_width">4</property>
+                                                <child>
+                                                  <widget class="GtkVBox" id="vbox152">
+                                                    <property name="width_request">630</property>
+                                                    <property name="visible">True</property>
+                                                    <property name="can_focus">False</property>
+                                                    <property name="border_width">20</property>
+                                                    <property name="spacing">16</property>
+                                                    <child>
+                                                      <widget class="GtkLabel" id="label645">
+                                                        <property name="visible">True</property>
+                                                        <property name="can_focus">False</property>
+                                                        <property name="xalign">0</property>
+                                                        <property name="label" translatable="yes">What 
social network do you use to watch videos?</property>
+                                                      </widget>
+                                                      <packing>
+                                                        <property name="expand">False</property>
+                                                        <property name="fill">False</property>
+                                                        <property name="position">0</property>
+                                                      </packing>
+                                                    </child>
+                                                    <child>
+                                                      <widget class="GtkHBox" id="hbox522">
+                                                        <property name="visible">True</property>
+                                                        <property name="can_focus">False</property>
+                                                        <child>
+                                                          <widget class="GtkVBox" id="vbox153">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">10</property>
+                                                            <child>
+                                                            <widget class="GtkRadioButton" 
id="radio_social_network_poll_nsnc">
+                                                            <property name="label" translatable="yes">I 
don't use social networks or don't want to respond</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="active">True</property>
+                                                            <property name="draw_indicator">True</property>
+                                                            <signal name="toggled" 
handler="on_radio_social_network_poll_toggled" swapped="no"/>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkTable" id="table23">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="n_rows">3</property>
+                                                            <property name="n_columns">2</property>
+                                                            <property name="column_spacing">20</property>
+                                                            <property name="row_spacing">10</property>
+                                                            <child>
+                                                            <widget class="GtkRadioButton" 
id="radio_social_network_poll_facebook">
+                                                            <property name="label">Facebook</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="active">True</property>
+                                                            <property name="draw_indicator">True</property>
+                                                            <property 
name="group">radio_social_network_poll_nsnc</property>
+                                                            <signal name="toggled" 
handler="on_radio_social_network_poll_toggled" swapped="no"/>
+                                                            </widget>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkRadioButton" 
id="radio_social_network_poll_instagram">
+                                                            <property name="label">Instagram</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="active">True</property>
+                                                            <property name="draw_indicator">True</property>
+                                                            <property 
name="group">radio_social_network_poll_nsnc</property>
+                                                            <signal name="toggled" 
handler="on_radio_social_network_poll_toggled" swapped="no"/>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="top_attach">1</property>
+                                                            <property name="bottom_attach">2</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkRadioButton" 
id="radio_social_network_poll_tiktok">
+                                                            <property name="label">TikTok</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="active">True</property>
+                                                            <property name="draw_indicator">True</property>
+                                                            <property 
name="group">radio_social_network_poll_nsnc</property>
+                                                            <signal name="toggled" 
handler="on_radio_social_network_poll_toggled" swapped="no"/>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="top_attach">2</property>
+                                                            <property name="bottom_attach">3</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkRadioButton" 
id="radio_social_network_poll_twitch">
+                                                            <property name="label">Twitch</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="active">True</property>
+                                                            <property name="draw_indicator">True</property>
+                                                            <property 
name="group">radio_social_network_poll_nsnc</property>
+                                                            <signal name="toggled" 
handler="on_radio_social_network_poll_toggled" swapped="no"/>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="left_attach">1</property>
+                                                            <property name="right_attach">2</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkRadioButton" 
id="radio_social_network_poll_youtube">
+                                                            <property name="label">Youtube</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="draw_indicator">True</property>
+                                                            <property 
name="group">radio_social_network_poll_nsnc</property>
+                                                            <signal name="toggled" 
handler="on_radio_social_network_poll_toggled" swapped="no"/>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="left_attach">1</property>
+                                                            <property name="right_attach">2</property>
+                                                            <property name="top_attach">1</property>
+                                                            <property name="bottom_attach">2</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox523">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <child>
+                                                            <widget class="GtkRadioButton" 
id="radio_social_network_poll_other">
+                                                            <property name="label" translatable="yes">Other 
(which)</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            <property name="draw_indicator">True</property>
+                                                            <property 
name="group">radio_social_network_poll_nsnc</property>
+                                                            <signal name="toggled" 
handler="on_radio_social_network_poll_toggled" swapped="no"/>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkEntry" 
id="entry_social_network_poll_other">
+                                                            <property name="width_request">100</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="sensitive">False</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="invisible_char">●</property>
+                                                            <property 
name="invisible_char_set">True</property>
+                                                            <property 
name="primary_icon_activatable">False</property>
+                                                            <property 
name="secondary_icon_activatable">False</property>
+                                                            <property 
name="primary_icon_sensitive">True</property>
+                                                            <property 
name="secondary_icon_sensitive">True</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="left_attach">1</property>
+                                                            <property name="right_attach">2</property>
+                                                            <property name="top_attach">2</property>
+                                                            <property name="bottom_attach">3</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                          </widget>
+                                                          <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                          </packing>
+                                                        </child>
+                                                      </widget>
+                                                      <packing>
+                                                        <property name="expand">False</property>
+                                                        <property name="fill">False</property>
+                                                        <property name="position">1</property>
+                                                      </packing>
+                                                    </child>
+                                                    <child>
+                                                      <widget class="GtkAlignment" id="alignment80">
+                                                        <property name="visible">True</property>
+                                                        <property name="can_focus">False</property>
+                                                        <property name="top_padding">10</property>
+                                                        <child>
+                                                          <widget class="GtkNotebook" 
id="notebook_social_network_poll_send_result">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="show_tabs">False</property>
+                                                            <property name="show_border">False</property>
+                                                            <child>
+                                                            <widget class="GtkHButtonBox" id="hbuttonbox22">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <child>
+                                                            <widget class="GtkButton" 
id="button_social_network_poll_send">
+                                                            <property name="label" translatable="yes">Send 
poll</property>
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">True</property>
+                                                            <property name="can_default">True</property>
+                                                            <property 
name="receives_default">False</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkLabel" id="label639">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label">send</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="tab_fill">False</property>
+                                                            <property name="type">tab</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox525">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">8</property>
+                                                            <child>
+                                                            <widget class="GtkHBox" id="hbox526">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="spacing">8</property>
+                                                            <child>
+                                                            <widget class="GtkImage" 
id="image_social_network_poll_send_no">
+                                                            <property name="can_focus">False</property>
+                                                            <property name="stock">gtk-no</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkImage" 
id="image_social_network_poll_send_yes">
+                                                            <property name="can_focus">False</property>
+                                                            <property name="stock">gtk-yes</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">False</property>
+                                                            <property name="fill">False</property>
+                                                            <property name="position">0</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkLabel" 
id="label_social_network_poll_message">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="xalign">0</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="expand">True</property>
+                                                            <property name="fill">True</property>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="position">1</property>
+                                                            </packing>
+                                                            </child>
+                                                            <child>
+                                                            <widget class="GtkLabel" id="label640">
+                                                            <property name="visible">True</property>
+                                                            <property name="can_focus">False</property>
+                                                            <property name="label">result</property>
+                                                            </widget>
+                                                            <packing>
+                                                            <property name="position">1</property>
+                                                            <property name="tab_fill">False</property>
+                                                            <property name="type">tab</property>
+                                                            </packing>
+                                                            </child>
+                                                          </widget>
+                                                        </child>
+                                                      </widget>
+                                                      <packing>
+                                                        <property name="expand">True</property>
+                                                        <property name="fill">True</property>
+                                                        <property name="position">2</property>
+                                                      </packing>
+                                                    </child>
+                                                  </widget>
+                                                </child>
+                                              </widget>
+                                            </child>
+                                          </widget>
+                                        </child>
+                                        <child>
+                                          <placeholder/>
+                                          <packing>
+                                            <property name="type">label_item</property>
+                                          </packing>
+                                        </child>
+                                      </widget>
+                                      <packing>
+                                        <property name="expand">True</property>
+                                        <property name="fill">True</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">0</property>
+                                  </packing>
+                                </child>
+                                <child>
+                                  <widget class="GtkHButtonBox" id="hbuttonbox21">
+                                    <property name="visible">True</property>
+                                    <property name="can_focus">False</property>
+                                    <child>
+                                      <widget class="GtkButton" id="button_open_chronojump1">
+                                        <property name="visible">True</property>
+                                        <property name="can_focus">True</property>
+                                        <property name="receives_default">True</property>
+                                        <property name="has_tooltip">True</property>
+                                        <signal name="clicked" handler="on_button_open_chronojump_clicked" 
swapped="no"/>
+                                        <accelerator key="Escape" signal="clicked"/>
+                                        <child>
+                                          <widget class="GtkEventBox" id="eventbox_button_open_chronojump1">
+                                            <property name="visible">True</property>
+                                            <property name="can_focus">False</property>
+                                            <child>
+                                              <widget class="GtkLabel" id="label647">
+                                                <property name="visible">True</property>
+                                                <property name="can_focus">False</property>
+                                                <property name="label" translatable="yes">Open 
Chronojump</property>
+                                              </widget>
+                                            </child>
+                                          </widget>
+                                        </child>
+                                      </widget>
+                                      <packing>
+                                        <property name="expand">False</property>
+                                        <property name="fill">False</property>
+                                        <property name="pack_type">end</property>
+                                        <property name="position">0</property>
+                                      </packing>
+                                    </child>
+                                  </widget>
+                                  <packing>
+                                    <property name="expand">False</property>
+                                    <property name="fill">False</property>
+                                    <property name="position">1</property>
+                                  </packing>
+                                </child>
+                              </widget>
+                              <packing>
+                                <property name="expand">True</property>
+                                <property name="fill">False</property>
+                                <property name="position">0</property>
+                              </packing>
+                            </child>
+                          </widget>
+                          <packing>
+                            <property name="expand">True</property>
+                            <property name="fill">False</property>
+                            <property name="position">0</property>
+                          </packing>
+                        </child>
+                      </widget>
+                    </child>
+                  </widget>
+                  <packing>
+                    <property name="expand">True</property>
+                    <property name="fill">True</property>
+                    <property name="position">0</property>
+                  </packing>
+                </child>
+              </widget>
+              <packing>
+                <property name="position">3</property>
+              </packing>
+            </child>
+            <child>
+              <widget class="GtkLabel" id="label20">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label">social network poll</property>
+              </widget>
+              <packing>
+                <property name="position">3</property>
+                <property name="tab_fill">False</property>
+                <property name="type">tab</property>
+              </packing>
+            </child>
           </widget>
           <packing>
             <property name="expand">True</property>
diff --git a/src/gui/app1/chronojump.cs b/src/gui/app1/chronojump.cs
index a0e7373fb..b81a85ea8 100644
--- a/src/gui/app1/chronojump.cs
+++ b/src/gui/app1/chronojump.cs
@@ -489,7 +489,7 @@ public partial class ChronoJumpWindow
        private UtilAll.OperatingSystems operatingSystem;
        private string progVersion;
        private string progName;
-       private enum notebook_start_pages { PROGRAM, SENDLOG, EXITCONFIRM }
+       private enum notebook_start_pages { PROGRAM, SENDLOG, EXITCONFIRM, SOCIALNETWORKPOLL }
        private enum notebook_sup_pages { START, CONTACTS, ENCODER, SESSION, NETWORKSPROBLEMS, HELP, NEWS }
        private enum notebook_analyze_pages { STATISTICS, JUMPSPROFILE, JUMPSDJOPTIMALFALL, 
JUMPSWEIGHTFVPROFILE, JUMPSEVOLUTION, JUMPSRJFATIGUE,
                RUNSEVOLUTION, SPRINT, FORCESENSOR, RACEENCODER }
@@ -587,13 +587,17 @@ public partial class ChronoJumpWindow
                        hbox_message_permissions_at_boot.Visible = true;
                }
 
+               bool showSocialNetworkPoll = true;
                //show send log if needed or other messages
-               if(! showSendLog)
-                       notebook_sup.CurrentPage = Convert.ToInt32(notebook_sup_pages.START);
-               else {
+               if (showSendLog)
+               {
                        show_send_log(sendLogMessage, preferences.crashLogLanguage);
                        notebook_start.CurrentPage = Convert.ToInt32(notebook_start_pages.SENDLOG);
                }
+               else if (showSocialNetworkPoll)
+                       notebook_start.CurrentPage = Convert.ToInt32(notebook_start_pages.SOCIALNETWORKPOLL);
+               else
+                       notebook_sup.CurrentPage = Convert.ToInt32(notebook_sup_pages.START);
 
                if(showCameraStop)
                        hbox_message_camera_at_boot.Visible = true;
@@ -776,7 +780,7 @@ public partial class ChronoJumpWindow
                        SqlitePreferences.Update(SqlitePreferences.LoadLastSessionAtStart, true, false);
                }
 
-               if(! showSendLog && preferences.loadLastModeAtStart &&
+               if(! showSendLog && ! showSocialNetworkPoll && preferences.loadLastModeAtStart &&
                                preferences.lastMode != Constants.Menuitem_modes.UNDEFINED && ! 
configChronojump.Compujump)
                {
                        // 0) note this code is repeated on gui/sendLog.cs on_button_open_chronojump_clicked()
@@ -810,7 +814,7 @@ public partial class ChronoJumpWindow
                        chronopicRegisterWin.Show();
                }
 
-               if(! showSendLog && notebook_sup.CurrentPage == Convert.ToInt32(notebook_sup_pages.START))
+               if(! showSendLog && ! showSocialNetworkPoll && notebook_sup.CurrentPage == 
Convert.ToInt32(notebook_sup_pages.START))
                        new ChronojumpLogo (drawingarea_chronojump_logo, viewport_chronojump_logo, 
preferences.logoAnimatedShow, preferences.fontType.ToString());
 
                //done at the end to ensure main window is shown
diff --git a/src/gui/sendLogAndPoll.cs b/src/gui/sendLogAndPoll.cs
index deed879a3..c5cc0c9e4 100644
--- a/src/gui/sendLogAndPoll.cs
+++ b/src/gui/sendLogAndPoll.cs
@@ -44,6 +44,9 @@ public partial class ChronoJumpWindow
 
        //--- send poll ----
 
+       [Widget] Gtk.RadioButton radio_social_network_poll_other;
+       [Widget] Gtk.Entry entry_social_network_poll_other;
+
 
        //--- send log ----
 
@@ -143,6 +146,11 @@ public partial class ChronoJumpWindow
 
        //--- send poll ----
 
+       private void on_radio_social_network_poll_toggled (object o, EventArgs args)
+       {
+               entry_social_network_poll_other.Sensitive = (o == (object) radio_social_network_poll_other);
+       }
+
        //--- send log and send poll----
 
        private void on_button_open_chronojump_clicked(object o, EventArgs args)


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