r1308 - trunk/src/target/OM-2007/applications/openmoko-dialer/src

thomas at sita.openmoko.org thomas at sita.openmoko.org
Fri Mar 9 19:27:23 CET 2007


Author: thomas
Date: 2007-03-09 19:27:21 +0100 (Fri, 09 Mar 2007)
New Revision: 1308

Modified:
   trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-main.c
   trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-window-dialer.c
   trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-window-history.c
   trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-window-incoming.c
   trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-window-outgoing.c
   trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-window-pin.c
   trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-window-talking.c
Log:
* Add a command line option to to the dialer to show the gui on first run
* Make sure no windows are shown and then hidden in openmoko-dialer


Modified: trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-main.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-main.c	2007-03-09 16:39:05 UTC (rev 1307)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-main.c	2007-03-09 18:27:21 UTC (rev 1308)
@@ -248,6 +248,15 @@
     }
 }
 
+static gboolean show_gui;
+
+static GOptionEntry entries[] = 
+{
+  { "show-gui", 's', 0, G_OPTION_ARG_NONE, &show_gui, "Show the GUI at startup (default off)", "N" },
+  { NULL }
+};
+
+
 int main( int argc, char** argv )
 {
   pid_t           lockapp;
@@ -258,6 +267,14 @@
 if (argc != 1)
     {
       /* Add init code. */
+      GError *error = NULL;
+      GOptionContext *context = g_option_context_new ("");
+
+      g_option_context_add_main_entries (context, entries, NULL);
+      g_option_context_add_group (context, gtk_get_option_group (TRUE));
+      g_option_context_parse (context, &argc, &argv, &error);
+
+      g_option_context_free (context);
     }
   lockapp = testlock ("/tmp/dialer.lock");
   if (lockapp > 0)
@@ -297,8 +314,11 @@
   window_history_init(p_dialer_data); 
   DBG_MSG ("\nusage: \"openmoko-dialer\" will not show any GUI initialy until you reactivate the app using another \"openmoko-dialer\" command");
 
+if (show_gui)
+{
+  handle_sigusr1 (SIGUSR1);
+}
 
-
 //from now on we will not use multithreads.
   gsm_lgsm_start(mainloop);
 

Modified: trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-window-dialer.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-window-dialer.c	2007-03-09 16:39:05 UTC (rev 1307)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-window-dialer.c	2007-03-09 18:27:21 UTC (rev 1308)
@@ -90,7 +90,7 @@
     window_history_init (appdata);
 
 //start dialling.
-  gtk_widget_show (appdata->window_history);
+  gtk_widget_show_all (appdata->window_history);
 
 }
 
@@ -147,7 +147,7 @@
   window_outgoing_prepare (appdata);
 
 //start dialling.
-  gtk_widget_show (appdata->window_outgoing);
+  gtk_widget_show_all (appdata->window_outgoing);
 
   g_free (codesinput);
 

Modified: trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-window-history.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-window-history.c	2007-03-09 16:39:05 UTC (rev 1307)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-window-history.c	2007-03-09 18:27:21 UTC (rev 1308)
@@ -362,7 +362,7 @@
                       G_CALLBACK (on_window_history_hide), p_dialer_data);
 
    //FIXME: without gtk_widget_show_all first and then hide, the history view will not show properly. -tony
-   gtk_widget_show_all(GTK_WIDGET(window));
+   //gtk_widget_show_all(GTK_WIDGET(window));
 
     //now the wheel and tool box, why should the wheel and toolbox created after the gtk_widget_show_all???
     // This causes a segfault for me... maybe a problem in libmokoui? - thomas
@@ -378,7 +378,7 @@
                       p_dialer_data);
 
     g_signal_connect (G_OBJECT (moko_finger_window_get_wheel (window)),
-                      "press_bottom",
+                      "prehttp://planet.gnome.org/ss_bottom",
                       G_CALLBACK (cb_tool_button_history_back_clicked),
                       p_dialer_data);
 
@@ -386,8 +386,7 @@
     tools = moko_finger_window_get_toolbox (window);
 
     /* TODO: remove the GTK_WIDGET() casts when libmokoui is fixed */
-    button =
-      GTK_WIDGET (moko_finger_tool_box_add_button_without_label (tools));
+    button = moko_finger_tool_box_add_button_without_label (tools);
     image = file_new_image_from_relative_path ("phone.png");
     moko_pixmap_button_set_finger_toolbox_btn_center_image (MOKO_PIXMAP_BUTTON
                                                             (button), image);
@@ -413,8 +412,6 @@
     g_signal_connect (G_OBJECT (button), "clicked",
                       G_CALLBACK (cb_tool_button_history_delete_clicked),
                       p_dialer_data);
-    //gtk_widget_show (GTK_WIDGET (tools));
-
     button =
       GTK_WIDGET (moko_finger_tool_box_add_button_without_label (tools));
     image = file_new_image_from_relative_path ("tony.png");
@@ -424,11 +421,8 @@
                       G_CALLBACK (cb_tool_button_history_back_clicked),
                       p_dialer_data);
 
-    //gtk_widget_show (GTK_WIDGET (tools));
-
     p_dialer_data->wheel_history = GTK_WIDGET (moko_finger_window_get_wheel (window));
     p_dialer_data->toolbox_history = GTK_WIDGET (tools);
-    gtk_widget_hide(GTK_WIDGET(window));
     DBG_LEAVE ();
   }
   else

Modified: trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-window-incoming.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-window-incoming.c	2007-03-09 16:39:05 UTC (rev 1307)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-window-incoming.c	2007-03-09 18:27:21 UTC (rev 1308)
@@ -291,12 +291,6 @@
     moko_finger_window_set_contents (window, GTK_WIDGET (vbox));
 
 
-    gtk_widget_show_all (GTK_WIDGET (window));
-
-
-    gtk_widget_hide (GTK_WIDGET (window));
-
-
     moko_dialer_status_set_title_label (MOKO_DIALER_STATUS (status), "Incoming call");
     moko_dialer_status_set_status_label (MOKO_DIALER_STATUS (status), "");
 

Modified: trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-window-outgoing.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-window-outgoing.c	2007-03-09 16:39:05 UTC (rev 1307)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-window-outgoing.c	2007-03-09 18:27:21 UTC (rev 1308)
@@ -53,13 +53,13 @@
   gtk_widget_hide (appdata->window_outgoing);
 
 
-//transfer the contact info
+  //transfer the contact info
   window_talking_prepare (appdata);
 
-//start dialling.
+  //start dialling.
 
   DBG_TRACE ();
-  gtk_widget_show (appdata->window_talking);
+  gtk_widget_show_all (appdata->window_talking);
 
 
   DBG_LEAVE ();
@@ -281,9 +281,8 @@
     p_dialer_data->buttonRedial = button;
     g_signal_connect (G_OBJECT (button), "clicked",
                       G_CALLBACK (cb_redial_button_clicked), p_dialer_data);
-//gtk_widget_set_size_request(button,100,32);
     gtk_box_pack_start (GTK_BOX (hbox2), GTK_WIDGET (button), TRUE, TRUE, 40);
-//gtk_widget_set_size_request(button,60,24);
+    g_object_set (G_OBJECT (button), "no-show-all", TRUE, NULL);
 
 
     button = gtk_button_new_with_label ("Cancel");
@@ -294,9 +293,6 @@
 //gtk_widget_set_size_request(button,100,32);
     gtk_box_pack_start (GTK_BOX (hbox2), GTK_WIDGET (button), TRUE, TRUE, 40);
 
-
-
-
     gtk_box_pack_start (GTK_BOX (vbox), hbox2, FALSE, FALSE, 50);
 
 
@@ -308,15 +304,6 @@
     gtk_window_set_decorated(GTK_WINDOW(window ),FALSE); //FIXME: this line seems only necessary on my PC. tony
     moko_finger_window_set_contents (window, GTK_WIDGET (vbox));
 
-
-    gtk_widget_show_all (GTK_WIDGET (window));
-
-    gtk_widget_hide (p_dialer_data->buttonRedial);
-
-
-    gtk_widget_hide (GTK_WIDGET (window));
-
-
     moko_dialer_status_set_title_label (MOKO_DIALER_STATUS (status), "Outgoing call");
     moko_dialer_status_set_status_label (MOKO_DIALER_STATUS (status), "Calling ... (00:00:00)");
 

Modified: trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-window-pin.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-window-pin.c	2007-03-09 16:39:05 UTC (rev 1307)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-window-pin.c	2007-03-09 18:27:21 UTC (rev 1308)
@@ -217,10 +217,6 @@
 
     p_dialer_data->window_pin = window;
 
-    gtk_widget_show_all (GTK_WIDGET (window));
-    gtk_widget_hide (GTK_WIDGET (window));
-
-
   }
 
   return 1;

Modified: trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-window-talking.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-window-talking.c	2007-03-09 16:39:05 UTC (rev 1307)
+++ trunk/src/target/OM-2007/applications/openmoko-dialer/src/openmoko-dialer-window-talking.c	2007-03-09 18:27:21 UTC (rev 1308)
@@ -349,9 +349,10 @@
 
     gtk_box_pack_start (GTK_BOX (vbox), content_dtmf, FALSE, FALSE, 0);
     p_dialer_data->content_dtmf = content_dtmf;
+    g_object_set (G_OBJECT (content_dtmf), "no-show-all", TRUE);
 
 
-//now the container--window
+    //now the container--window
     window = MOKO_FINGER_WINDOW (moko_finger_window_new ());
     gtk_window_set_decorated(GTK_WINDOW(window ),FALSE);
     p_dialer_data->window_talking = GTK_WIDGET (window);
@@ -362,17 +363,7 @@
                       G_CALLBACK (on_window_talking_hide), p_dialer_data);
 
 
-
-
-    gtk_widget_show_all (GTK_WIDGET (window));
-
-//the gtk_widget_show_all is really bad, cause i have to call it and then hide some widgets.
-
-    gtk_widget_hide (content_dtmf);
-
-
     //now the wheel and tool box, why should the wheel and toolbox created after the gtk_widget_show_all???
-//   gtk_widget_show(GTK_WIDGET(moko_finger_window_get_wheel(window)));
     wheel=moko_finger_window_get_wheel (window);
     g_signal_connect (G_OBJECT (wheel),
                       "press_left_up",
@@ -418,9 +409,6 @@
     p_dialer_data->wheel_talking = GTK_WIDGET (wheel);
     p_dialer_data->toolbox_talking = GTK_WIDGET (tools);
 
-    //gtk_widget_hide(window);
-
-
     DBG_LEAVE ();
   }
 





More information about the commitlog mailing list