summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-05-25 20:06:04 +0200
committerGravatar Alexey Yakovenko <wakeroid@gmail.com>2010-05-25 20:06:04 +0200
commit528d7443fa6a544ede3a08b1cf7815b630df0727 (patch)
treefd7fc1a02f43b1c0fda61435674600ec74f14ee4
parentbe0f4b1926f7e77c7e03eae7b70ec12f1b905025 (diff)
disable playlist widget while adding files is in progress;
destroy progress dialog on gtkui exit
-rw-r--r--plugins/gtkui/gtkui.c1
-rw-r--r--plugins/gtkui/progress.c19
-rw-r--r--plugins/gtkui/progress.h3
3 files changed, 21 insertions, 2 deletions
diff --git a/plugins/gtkui/gtkui.c b/plugins/gtkui/gtkui.c
index 81464e13..c6493b11 100644
--- a/plugins/gtkui/gtkui.c
+++ b/plugins/gtkui/gtkui.c
@@ -912,6 +912,7 @@ gtkui_thread (void *ctx) {
cover_art_free ();
eq_window_destroy ();
trkproperties_destroy ();
+ progress_destroy ();
gtk_widget_destroy (mainwin);
gtk_widget_destroy (searchwin);
gdk_threads_leave ();
diff --git a/plugins/gtkui/progress.c b/plugins/gtkui/progress.c
index 7cc13844..89ce4bb4 100644
--- a/plugins/gtkui/progress.c
+++ b/plugins/gtkui/progress.c
@@ -24,6 +24,7 @@
#include "callbacks.h"
#include "support.h"
#include "progress.h"
+#include "gtkui.h"
static GtkWidget *progressdlg;
static GtkWidget *progressitem;
@@ -31,21 +32,31 @@ static int progress_aborted;
void
progress_init (void) {
- extern GtkWidget *mainwin;
progressdlg = create_addprogress ();
gtk_window_set_transient_for (GTK_WINDOW (progressdlg), GTK_WINDOW (mainwin));
progressitem = lookup_widget (progressdlg, "progresstitle");
}
void
+progress_destroy (void) {
+ if (progressdlg) {
+ gtk_widget_destroy (progressdlg);
+ progressdlg = NULL;
+ }
+}
+
+void
progress_settext (const char *text) {
gtk_entry_set_text (GTK_ENTRY (progressitem), text);
}
void
progress_show (void) {
- extern GtkWidget *mainwin;
progress_aborted = 0;
+ GtkWidget *playlist = lookup_widget (mainwin, "playlist");
+ if (playlist) {
+ gtk_widget_set_sensitive (playlist, FALSE);
+ }
progress_settext ("Initializing...");
gtk_widget_show_all (progressdlg);
gtk_window_present (GTK_WINDOW (progressdlg));
@@ -55,6 +66,10 @@ progress_show (void) {
void
progress_hide (void) {
gtk_widget_hide (progressdlg);
+ GtkWidget *playlist = lookup_widget (mainwin, "playlist");
+ if (playlist) {
+ gtk_widget_set_sensitive (playlist, TRUE);
+ }
}
void
diff --git a/plugins/gtkui/progress.h b/plugins/gtkui/progress.h
index f4b43da2..49b20248 100644
--- a/plugins/gtkui/progress.h
+++ b/plugins/gtkui/progress.h
@@ -23,6 +23,9 @@ void
progress_init (void);
void
+progress_destroy (void);
+
+void
progress_show (void);
void