[Goodies-commits] r5909 - xfce4-sensors-plugin/trunk/src
Fabian Nowak
timystery at xfce.org
Sun Nov 2 16:43:13 CET 2008
Author: timystery
Date: 2008-11-02 15:43:13 +0000 (Sun, 02 Nov 2008)
New Revision: 5909
Modified:
xfce4-sensors-plugin/trunk/src/callbacks.c
xfce4-sensors-plugin/trunk/src/callbacks.h
xfce4-sensors-plugin/trunk/src/interface.c
xfce4-sensors-plugin/trunk/src/main.c
Log:
changed xfce4-sensors application to have different title frame and to close with close button
Modified: xfce4-sensors-plugin/trunk/src/callbacks.c
===================================================================
--- xfce4-sensors-plugin/trunk/src/callbacks.c 2008-11-02 14:24:00 UTC (rev 5908)
+++ xfce4-sensors-plugin/trunk/src/callbacks.c 2008-11-02 15:43:13 UTC (rev 5909)
@@ -35,7 +35,40 @@
/* Local includes */
#include "callbacks.h"
+
+
void
+on_main_window_response (GtkWidget *dlg, int response, t_sensors_dialog *sd)
+{
+ TRACE ("enters on_main_window_response");
+
+ if (response==GTK_RESPONSE_OK)
+ {
+ //g_free(sd->sensors->command_name);
+ //g_free(sd->coloredBars_Box);
+ //g_free(sd->font_Box);
+ //g_free(sd->labels_Box);
+ //g_free(sd->myComboBox);
+ //g_free(sd->myCommandName_Entry);
+ //g_free(sd->myExecCommand_CheckBox);
+ //g_free(sd->mySensorLabel);
+ //gtk_widget_destroy (sd->dialog);
+ //g_free(sd->smallspacing_checkbox);
+ //g_free(sd->suppressmessage_checkbox);
+ //g_free(sd->temperature_radio_group);
+ //g_free(sd->unit_checkbox);
+
+ g_free(sd);
+
+ //gtk_widget_destroy (sd->dialog);
+ gtk_main_quit();
+ }
+
+ TRACE ("leaves on_main_window_response");
+}
+
+
+void
sensor_entry_changed (GtkWidget *widget, t_sensors_dialog *sd)
{
gint gtk_combo_box_active;
Modified: xfce4-sensors-plugin/trunk/src/callbacks.h
===================================================================
--- xfce4-sensors-plugin/trunk/src/callbacks.h 2008-11-02 14:24:00 UTC (rev 5908)
+++ xfce4-sensors-plugin/trunk/src/callbacks.h 2008-11-02 15:43:13 UTC (rev 5909)
@@ -38,4 +38,6 @@
*/
void close_window_requested ();
+void on_main_window_response (GtkWidget *dlg, int response, t_sensors_dialog *sd);
+
Modified: xfce4-sensors-plugin/trunk/src/interface.c
===================================================================
--- xfce4-sensors-plugin/trunk/src/interface.c 2008-11-02 14:24:00 UTC (rev 5908)
+++ xfce4-sensors-plugin/trunk/src/interface.c 2008-11-02 15:43:13 UTC (rev 5909)
@@ -31,6 +31,7 @@
#include <sensors-interface-common.h>
/* Local includes */
+#include "callbacks.h"
#include "interface.h"
@@ -42,20 +43,33 @@
/* start and populate */
- dlg = (GtkWidget *) gtk_dialog_new_with_buttons (_("Xfce 4 Sensors Viewer"),
+ /* dlg = (GtkWidget *) gtk_dialog_new_with_buttons (_("Xfce 4 Sensors Viewer"),
NULL, // anciently: GTK_WINDOW(gtk_get_toplevel(plugin));
GTK_DIALOG_NO_SEPARATOR, // anciently: | GTK_DIALOG_DESTROY_WITH_PARENT
GTK_STOCK_CLOSE, GTK_RESPONSE_OK, NULL);
gtk_container_set_border_width (GTK_CONTAINER (dlg), 2);
- header = (GtkWidget *) xfce_create_header (NULL, _("View sensor values"));
- gtk_widget_set_size_request (GTK_BIN (header)->child, -1, 32);
- gtk_container_set_border_width (GTK_CONTAINER (header), BORDER-2);
- gtk_widget_show (header);
+ header = (GtkWidget *) xfce_create_framebox (_("View sensor values"), dlg); */
+/* gtk_widget_set_size_request (GTK_BIN (header)->child, -1, 32);
+ gtk_container_set_border_width (GTK_CONTAINER (header), BORDER-2); */
+ /* gtk_widget_show (header);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dlg)->vbox), header,
- FALSE, TRUE, 0);
+ FALSE, TRUE, 0); */
+ dlg = xfce_titled_dialog_new_with_buttons(
+ _("Xfce 4 Sensors Viewer"),
+ NULL, //GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (plugin))),
+ GTK_DIALOG_NO_SEPARATOR,
+ GTK_STOCK_CLOSE,
+ GTK_RESPONSE_OK,
+ NULL
+ );
+
+ gtk_window_set_icon_name(GTK_WINDOW(dlg),"xfce-sensors");
+
+ gtk_container_set_border_width (GTK_CONTAINER (dlg), 2);
+
vbox = GTK_DIALOG (dlg)->vbox;
sd->dialog = dlg;
@@ -73,5 +87,8 @@
add_sensors_frame (notebook, sd);
+ g_signal_connect (dlg, "response",
+ G_CALLBACK(on_main_window_response), sd);
+
return dlg;
}
Modified: xfce4-sensors-plugin/trunk/src/main.c
===================================================================
--- xfce4-sensors-plugin/trunk/src/main.c 2008-11-02 14:24:00 UTC (rev 5908)
+++ xfce4-sensors-plugin/trunk/src/main.c 2008-11-02 15:43:13 UTC (rev 5909)
@@ -61,6 +61,8 @@
t_sensors_dialog *sd;
t_sensors *sensors;
+ xfce_textdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
+
if ( argc > 1 && (strcmp(argv[1], "--help")==0 || strcmp(argv[1], "-h")==0) )
{
print_usage ();
More information about the Goodies-commits
mailing list