Dolda2000 GitWeb
/
doldaconnect.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7989fee
)
Added progress bar for hublist fetching.
author
Fredrik Tolf
<fredrik@dolda2000.com>
Sun, 22 Jul 2007 04:21:26 +0000
(06:21 +0200)
committer
Fredrik Tolf
<fredrik@dolda2000.com>
Sun, 22 Jul 2007 04:21:26 +0000
(06:21 +0200)
clients/gtk2/dolcon.c
patch
|
blob
|
blame
|
history
clients/gtk2/hublist.c
patch
|
blob
|
blame
|
history
clients/gtk2/hublist.h
patch
|
blob
|
blame
|
history
clients/gtk2/mainwnd.desc
patch
|
blob
|
blame
|
history
diff --git
a/clients/gtk2/dolcon.c
b/clients/gtk2/dolcon.c
index
02a2423
..
60a1776
100644
(file)
--- a/
clients/gtk2/dolcon.c
+++ b/
clients/gtk2/dolcon.c
@@
-1445,6
+1445,11
@@
void cb_main_pubhubfilter_activate(GtkWidget *widget, gpointer data)
fetchhublist(pubhubaddr, filter);
}
fetchhublist(pubhubaddr, filter);
}
+void cb_main_pubhubabort_clicked(GtkWidget *widget, gpointer data)
+{
+ aborthublist();
+}
+
void cb_main_dcnctbtn_clicked(GtkWidget *widget, gpointer data)
{
GtkTreeIter iter;
void cb_main_dcnctbtn_clicked(GtkWidget *widget, gpointer data)
{
GtkTreeIter iter;
diff --git
a/clients/gtk2/hublist.c
b/clients/gtk2/hublist.c
index
37ad850
..
556e3c3
100644
(file)
--- a/
clients/gtk2/hublist.c
+++ b/
clients/gtk2/hublist.c
@@
-48,6
+48,8
@@
static bz_stream *bzs;
static char *mybuf;
static size_t mybufsize, mybufdata;
static char *mybuf;
static size_t mybufsize, mybufdata;
+#include "mainwnd.gtkh"
+
void aborthublist(void)
{
if(mybuf != NULL) {
void aborthublist(void)
{
if(mybuf != NULL) {
@@
-56,6
+58,7
@@
void aborthublist(void)
mybufsize = mybufdata = 0;
}
if(hc != NULL) {
mybufsize = mybufdata = 0;
}
if(hc != NULL) {
+ gtk_widget_hide(main_pubhubbarbox);
if(itag != -1)
gdk_input_remove(itag);
if(otag != -1)
if(itag != -1)
gdk_input_remove(itag);
if(otag != -1)
@@
-121,9
+124,16
@@
static void fdcb(gpointer data, gint source, GdkInputCondition cond)
return;
}
state = 1;
return;
}
state = 1;
+ gtk_progress_bar_set_text(GTK_PROGRESS_BAR(main_pubhubbar), _("Getting list..."));
}
}
if(state == 1) {
}
}
if(state == 1) {
+ if(hc->tlen > 0) {
+ gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(main_pubhubbar), ((double)hc->rxd) / ((double)hc->tlen));
+ } else {
+ gtk_progress_bar_set_pulse_step(GTK_PROGRESS_BAR(main_pubhubbar), ((double)hc->databufdata) / 10000.0);
+ gtk_progress_bar_pulse(GTK_PROGRESS_BAR(main_pubhubbar));
+ }
if(hc->databufdata > 0) {
if(bzs == NULL) {
bufcat(mybuf, hc->databuf, hc->databufdata);
if(hc->databufdata > 0) {
if(bzs == NULL) {
bufcat(mybuf, hc->databuf, hc->databufdata);
@@
-155,6
+165,9
@@
static void fdcb(gpointer data, gint source, GdkInputCondition cond)
memmove(mybuf, mybuf + hret, mybufdata -= hret);
}
if(ret) {
memmove(mybuf, mybuf + hret, mybufdata -= hret);
}
if(ret) {
+ gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(main_pubhubbar), 1);
+ gtk_progress_bar_set_text(GTK_PROGRESS_BAR(main_pubhubbar), _("Finalizing list..."));
+ gdk_window_process_updates(main_pubhubbar->window, FALSE);
handler(PHO_EOF, NULL, 0);
aborthublist();
}
handler(PHO_EOF, NULL, 0);
aborthublist();
}
@@
-184,6
+197,10
@@
void fetchhublist(char *url, regex_t *flt)
freeurl(u);
state = 0;
settags();
freeurl(u);
state = 0;
settags();
+ gtk_widget_show(main_pubhubbarbox);
+ gtk_progress_bar_set_text(GTK_PROGRESS_BAR(main_pubhubbar), _("Connecting..."));
+ gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(main_pubhubbar), 0);
+ gdk_window_process_updates(main_pubhubbarbox->window, TRUE);
len = strlen(url);
p = url + len;
len = strlen(url);
p = url + len;
diff --git
a/clients/gtk2/hublist.h
b/clients/gtk2/hublist.h
index
5c09d55
..
ac87e60
100644
(file)
--- a/
clients/gtk2/hublist.h
+++ b/
clients/gtk2/hublist.h
@@
-27,6
+27,7
@@
#define PHO_EOF 2
#define PHO_FINI 3
#define PHO_EOF 2
#define PHO_FINI 3
+void aborthublist(void);
int validhub(char *field, ...);
void fetchhublist(char *url, regex_t *flt);
int validhub(char *field, ...);
void fetchhublist(char *url, regex_t *flt);
diff --git
a/clients/gtk2/mainwnd.desc
b/clients/gtk2/mainwnd.desc
index
6bd07ad
..
d0ca65f
100644
(file)
--- a/
clients/gtk2/mainwnd.desc
+++ b/
clients/gtk2/mainwnd.desc
@@
-59,6
+59,10
@@
end
$tvcol title: "Description" text: 2 sortcol: 2 resizable: TRUE
end
end
$tvcol title: "Description" text: 2 sortcol: 2 resizable: TRUE
end
end
+ :hbox name: pubhubbarbox var: y noshow: y
+ $pbar name: pubhubbar var: y expand: TRUE fill: TRUE
+ $sbtn stock: CANCEL name: pubhubabort sig: clicked
+ end
:table rows: 2 cols: 3 fill: TRUE
$mlbl label: "_Filter:" tx: 0 ty: 0 mwidget: pubhubfilter
$text name: pubhubfilter var: y expand: y fill: y sig: activate tx: 1 ty: 0
:table rows: 2 cols: 3 fill: TRUE
$mlbl label: "_Filter:" tx: 0 ty: 0 mwidget: pubhubfilter
$text name: pubhubfilter var: y expand: y fill: y sig: activate tx: 1 ty: 0