diff options
author | Christian Grothoff <christian@grothoff.org> | 2005-08-27 23:17:58 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2005-08-27 23:17:58 +0000 |
commit | f2abfd8ec27ed2e1a2edbec79e0e8a765e7eb49b (patch) | |
tree | 390e3dab2c00f1d5674cdb91023a0b0bff7bb0bf | |
parent | 950dff19d3fcaea9aaf9ba2d8ddb9a7cf117344e (diff) | |
download | gnunet-gtk-f2abfd8ec27ed2e1a2edbec79e0e8a765e7eb49b.tar.gz gnunet-gtk-f2abfd8ec27ed2e1a2edbec79e0e8a765e7eb49b.zip |
minor fixes
-rw-r--r-- | src/common/helper.c | 14 | ||||
-rw-r--r-- | src/core/main.c | 6 | ||||
-rw-r--r-- | src/include/gnunetgtk_common.h | 2 | ||||
-rw-r--r-- | src/plugins/fs/download.c | 5 | ||||
-rw-r--r-- | src/plugins/fs/upload.c | 2 |
5 files changed, 22 insertions, 7 deletions
diff --git a/src/common/helper.c b/src/common/helper.c index 83a3667a..c2d9a971 100644 --- a/src/common/helper.c +++ b/src/common/helper.c | |||
@@ -235,10 +235,18 @@ static void saveAddLogEntry(void * args) { | |||
235 | * @param txt the log entry | 235 | * @param txt the log entry |
236 | * | 236 | * |
237 | */ | 237 | */ |
238 | void addLogEntry(const char * txt) { | 238 | void addLogEntry(const char * txt, |
239 | infoMessage(NO, txt); | 239 | ...) { |
240 | va_list args; | ||
241 | gchar * note; | ||
242 | |||
243 | va_start(args, txt); | ||
244 | note = g_strdup_vprintf(txt, args); | ||
245 | va_end(args); | ||
246 | infoMessage(NO, note); | ||
240 | gtkSaveCall(&saveAddLogEntry, | 247 | gtkSaveCall(&saveAddLogEntry, |
241 | (void*) txt); | 248 | (void*) note); |
249 | g_free(note); | ||
242 | } | 250 | } |
243 | 251 | ||
244 | /** | 252 | /** |
diff --git a/src/core/main.c b/src/core/main.c index 9b2c06af..f738c3e4 100644 --- a/src/core/main.c +++ b/src/core/main.c | |||
@@ -101,6 +101,10 @@ static void gnunet_gtk_main_quit() { | |||
101 | gtk_main_quit(); | 101 | gtk_main_quit(); |
102 | } | 102 | } |
103 | 103 | ||
104 | static void customLog(const char * msg) { | ||
105 | addLogEntry("%s", msg); | ||
106 | } | ||
107 | |||
104 | int main(int argc, | 108 | int main(int argc, |
105 | char *argv[]) { | 109 | char *argv[]) { |
106 | GtkWidget * root; | 110 | GtkWidget * root; |
@@ -129,7 +133,7 @@ int main(int argc, | |||
129 | "mainWindow"); | 133 | "mainWindow"); |
130 | gtk_window_maximize(GTK_WINDOW(root)); | 134 | gtk_window_maximize(GTK_WINDOW(root)); |
131 | gtk_widget_show(root); | 135 | gtk_widget_show(root); |
132 | setCustomLogProc(&addLogEntry); | 136 | setCustomLogProc(&customLog); |
133 | /* start the event loop */ | 137 | /* start the event loop */ |
134 | gdk_threads_enter(); | 138 | gdk_threads_enter(); |
135 | gtk_main(); | 139 | gtk_main(); |
diff --git a/src/include/gnunetgtk_common.h b/src/include/gnunetgtk_common.h index 5cf23904..a4708493 100644 --- a/src/include/gnunetgtk_common.h +++ b/src/include/gnunetgtk_common.h | |||
@@ -59,7 +59,7 @@ void infoMessage(int doPopup, | |||
59 | * | 59 | * |
60 | * @param txt the log entry | 60 | * @param txt the log entry |
61 | */ | 61 | */ |
62 | void addLogEntry(const char * txt); | 62 | void addLogEntry(const char * txt, ...); |
63 | 63 | ||
64 | /** | 64 | /** |
65 | * Simple callback function. | 65 | * Simple callback function. |
diff --git a/src/plugins/fs/download.c b/src/plugins/fs/download.c index 06fbbadf..461b10b7 100644 --- a/src/plugins/fs/download.c +++ b/src/plugins/fs/download.c | |||
@@ -46,10 +46,13 @@ static GtkTreeStore * summary; | |||
46 | static int addFilesToDirectory | 46 | static int addFilesToDirectory |
47 | (const ECRS_FileInfo * fi, | 47 | (const ECRS_FileInfo * fi, |
48 | const HashCode512 * key, | 48 | const HashCode512 * key, |
49 | int isRoot, | ||
49 | void * closure) { | 50 | void * closure) { |
50 | struct ECRS_URI * uri = closure; | 51 | struct ECRS_URI * uri = closure; |
51 | DownloadList * pos; | 52 | DownloadList * pos; |
52 | 53 | ||
54 | if (isRoot == YES) | ||
55 | return OK; | ||
53 | FSUI_trackURI(fi); | 56 | FSUI_trackURI(fi); |
54 | pos = head; | 57 | pos = head; |
55 | while (pos != NULL) { | 58 | while (pos != NULL) { |
@@ -174,7 +177,7 @@ static void initiateDownload(GtkTreeModel * model, | |||
174 | if (name == NULL) | 177 | if (name == NULL) |
175 | name = filename; | 178 | name = filename; |
176 | 179 | ||
177 | addLogEntry(_("Downloading...")); | 180 | addLogEntry(_("Downloading `%s'"), name); |
178 | 181 | ||
179 | list = MALLOC(sizeof(DownloadList)); | 182 | list = MALLOC(sizeof(DownloadList)); |
180 | list->next = head; | 183 | list->next = head; |
diff --git a/src/plugins/fs/upload.c b/src/plugins/fs/upload.c index d3cb0b3c..feda58ae 100644 --- a/src/plugins/fs/upload.c +++ b/src/plugins/fs/upload.c | |||
@@ -345,7 +345,7 @@ void on_fsinsertuploadbutton_clicked(gpointer dummy, | |||
345 | int doIndex; | 345 | int doIndex; |
346 | int doRec; | 346 | int doRec; |
347 | 347 | ||
348 | addLogEntry(_("Uploading..")); | 348 | addLogEntry(_("Uploading `%s'"), filenamerest); |
349 | 349 | ||
350 | recBut = glade_xml_get_widget(getMainXML(), | 350 | recBut = glade_xml_get_widget(getMainXML(), |
351 | "scopeRecursiveButton"); | 351 | "scopeRecursiveButton"); |