aboutsummaryrefslogtreecommitdiff
path: root/status.c
diff options
context:
space:
mode:
authorLeandro Pereira <leandro@linuxmag.com.br>2004-06-14 21:33:25 -0300
committerSimon Quigley <tsimonq2@ubuntu.com>2017-06-19 14:38:31 -0500
commit7d65a12d6431f72e601ea1d0c3ef5d09af8bfb96 (patch)
tree7ad1761adce3212a13e5342a54865e31b917f18b /status.c
parent0864b0a8e6f0b0983c3536931cfbad1414137d6b (diff)
parent8c1612d32c5682a86216adb8c8d11ce715fe5475 (diff)
Import Debian changes 0.3.6-5
hardinfo (0.3.6-5) unstable; urgency=high * Add Amd64 support (closes: #253935). Thanks to Kurt Roeckx <Q@ping.be> * Close duplicate "doesn't work with newer pciutils" bug (closes: #254018). hardinfo (0.3.6-4) unstable; urgency=high * Fixed segfault on startup (closes: #242843). Thanks to Remco van de Meent <remco@debian.org> hardinfo (0.3.6-3) unstable; urgency=high * Added Debian menu entry icon. * Fixed some misc packaging bugs. * Changed package description. hardinfo (0.3.6-2) unstable; urgency=low * Sync with upstream sources. * Disabled "Network" tab. hardinfo (0.3.6-1) unstable; urgency=high * Sync with upstream sources. hardinfo (0.3.5-1) unstable; urgency=high * Sync with upstream sources. hardinfo (0.3.4-1) unstable; urgency=high * Sync with upstream sources. hardinfo (0.3.3-1) unstable; urgency=low * Sync with upstream sources. hardinfo (0.3.2-1) unstable; urgency=low * Sync with upstream sources. hardinfo (0.3.1-1) unstable; urgency=low * Sync with upstream sources. hardinfo (0.3-1) unstable; urgency=low * Initial Release.
Diffstat (limited to 'status.c')
-rw-r--r--status.c68
1 files changed, 68 insertions, 0 deletions
diff --git a/status.c b/status.c
new file mode 100644
index 00000000..0d3be0f3
--- /dev/null
+++ b/status.c
@@ -0,0 +1,68 @@
+#include "status.h"
+
+myStatus *my_status_new(gchar *title, gchar *text)
+{
+ GtkWidget *window, *label, *hbox, *img, *vbox, *progress;
+ myStatus *status;
+
+ window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ gtk_window_set_title(GTK_WINDOW(window), title);
+ gtk_container_set_border_width(GTK_CONTAINER(window), 15);
+ gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER_ALWAYS);
+
+ hbox = gtk_hbox_new(FALSE, 5);
+ gtk_widget_show(hbox);
+ gtk_container_add(GTK_CONTAINER(window), hbox);
+
+ img = gtk_image_new_from_file(IMG_PREFIX "logo.png");
+ gtk_widget_show(img);
+ gtk_box_pack_start(GTK_BOX(hbox), img, FALSE, FALSE, 0);
+ gtk_widget_set_usize(GTK_WIDGET(img), 96, 64);
+
+ vbox = gtk_vbox_new(FALSE, 5);
+ gtk_widget_show(vbox);
+ gtk_box_pack_start(GTK_BOX(hbox), vbox, TRUE, TRUE, 0);
+
+ label = gtk_label_new(text);
+ gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
+ gtk_misc_set_alignment(GTK_MISC(label), 0.0, 0.5);
+ gtk_widget_show(label);
+ gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, TRUE, 0);
+
+ progress = gtk_progress_bar_new();
+ gtk_widget_show(progress);
+ gtk_box_pack_start(GTK_BOX(vbox), progress, TRUE, FALSE, 0);
+
+ gtk_widget_show(window);
+
+ status = g_new0(myStatus, 1);
+ status->window = window;
+ status->label = label;
+ status->progress = progress;
+
+ return status;
+}
+
+void my_status_pulse(myStatus *status)
+{
+ gtk_progress_bar_pulse(GTK_PROGRESS_BAR(status->progress));
+
+ while (gtk_events_pending())
+ gtk_main_iteration();
+}
+
+void my_status_destroy(myStatus *status)
+{
+ gtk_widget_destroy(status->window);
+ g_free(status);
+ status = NULL;
+}
+
+void my_status_set_text(myStatus *status, gchar *text)
+{
+ gtk_label_set_markup(GTK_LABEL(status->label), text);
+
+ while (gtk_events_pending())
+ gtk_main_iteration();
+}
+