Revision: 1847
http://gtkpod.svn.sourceforge.net/gtkpod/?rev=1847&view=rev
Author: Sikon
Date: 2007-12-19 07:28:42 -0800 (Wed, 19 Dec 2007)
Log Message:
-----------
More message box HIGification
Modified Paths:
--------------
gtkpod/trunk/ChangeLog_detailed
gtkpod/trunk/src/fetchcover.c
gtkpod/trunk/src/file_itunesdb.c
gtkpod/trunk/src/misc_confirm.c
gtkpod/trunk/src/misc_playlist.c
Modified: gtkpod/trunk/ChangeLog_detailed
===================================================================
--- gtkpod/trunk/ChangeLog_detailed 2007-12-19 13:35:43 UTC (rev 1846)
+++ gtkpod/trunk/ChangeLog_detailed 2007-12-19 15:28:42 UTC (rev 1847)
@@ -28,6 +28,12 @@
file as the context. It will first try to open the XML file in yelp
(the GNOME help viewer), and if that fails, will open the
corresponding HTML file in the browser.
+
+ * src/misc_confirm.c:
+ * src/file_itunesdb.c:
+ * src/misc_playlist.c:
+ * src/fetchcover.c:
+ More message box HIGification.
2007-12-18 Matvey Kozhev <sikon at users.sourceforge.net>
Modified: gtkpod/trunk/src/fetchcover.c
===================================================================
--- gtkpod/trunk/src/fetchcover.c 2007-12-19 13:35:43 UTC (rev 1846)
+++ gtkpod/trunk/src/fetchcover.c 2007-12-19 15:28:42 UTC (rev 1847)
@@ -350,54 +350,41 @@
gchar *basename = NULL;
gint i;
gchar *message;
- GtkWidget *label;
if (fetch_cover->parent_window == NULL)
fetch_cover->parent_window = GTK_WINDOW(gtkpod_window);
- GtkWidget *dialog = gtk_dialog_new_with_buttons (_("Coverart
file already exists"),
-
fetch_cover->parent_window,
-
GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
-
GTK_STOCK_YES,
-
GTK_RESPONSE_YES,
- GTK_STOCK_NO,
- GTK_RESPONSE_NO,
- GTK_STOCK_CANCEL,
- GTK_RESPONSE_REJECT,
- NULL);
-
filepath = g_build_filename(fetch_cover->dir,
fetch_cover->filename, NULL);
message = g_strdup_printf (_("The picture file %s already
exists.\n" \
"This may be associated with other music files
in the directory.\n\n" \
- "- Clicking Yes will overwrite the existing
file, possibly associating\n" \
- " other music files in the same directory
with this coverart file.\n" \
- "- Clicking No will save the file with a
unique file name.\n" \
- "- Clicking Cancel will abort the fetchcover
operation."), filepath);
+ "Do you want to overwrite the existing file,
possibly associating\n" \
+ "other music files in the same directory with
this cover art file,\n" \
+ "to save the file with a unique file name, or
to abort the fetchcover operation?"),
+ filepath);
- label = gtk_label_new (message);
-
- /* Add the label, and show everything we've added to the
dialog. */
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox),
label);
-
- gtk_widget_show_all (dialog);
- result = gtk_dialog_run (GTK_DIALOG(dialog));
+ result = gtkpod_confirmation_hig (fetch_cover->parent_window,
+
GTK_MESSAGE_WARNING,
+
_("Cover art file already exists"),
+
message,
+
_("Overwrite"),
+
_("Rename"),
+
_("Abort"),
+
NULL);
g_free (message);
switch (result)
{
- case GTK_RESPONSE_REJECT:
- /* Cancel has been clicked so no save */
- gtk_widget_destroy (dialog);
+ case GTK_RESPONSE_APPLY:
+ /* Abort has been clicked so no save */
return NULL;
- case GTK_RESPONSE_YES:
- /*** Yes clicked so overwrite the file is okay.
Leave final_filename intact
+ case GTK_RESPONSE_OK:
+ /*** Overwrite clicked so overwrite the file is
okay. Leave final_filename intact
* and remove the original
**/
g_remove (filepath);
- gtk_widget_destroy (dialog);
return filepath;
- case GTK_RESPONSE_NO:
+ case GTK_RESPONSE_CANCEL:
/* User doesn't want to overwrite anything so
need to do some work on filename */
/* Remove the suffix from the end of the
filename */
splitarr = g_strsplit (fetch_cover->filename,
".", 0);
@@ -424,11 +411,9 @@
newfilename = NULL;
basename = NULL;
g_strfreev(splitarr);
- gtk_widget_destroy (dialog);
return filepath;
default:
- gtk_widget_destroy (dialog);
return NULL;
}
}
Modified: gtkpod/trunk/src/file_itunesdb.c
===================================================================
--- gtkpod/trunk/src/file_itunesdb.c 2007-12-19 13:35:43 UTC (rev 1846)
+++ gtkpod/trunk/src/file_itunesdb.c 2007-12-19 15:28:42 UTC (rev 1847)
@@ -1848,21 +1848,24 @@
}
if (g_file_test (tunes, G_FILE_TEST_EXISTS))
{
- gchar *str = g_strdup_printf (_("You did not import the existing
iTunesDB ('%s'). This is most likely incorrect and will result in the loss of
the existing database.\n\nPress 'OK' if you want to proceed anyhow or 'Cancel'
to skip storing. If you cancel, you can import the existing database before
calling this function again.\n"), tunes);
- GtkWidget *dialog = gtk_message_dialog_new (
- GTK_WINDOW (gtkpod_window),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK_CANCEL,
- str);
- gint result = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- g_free (str);
- if (result == GTK_RESPONSE_CANCEL)
- {
- g_free (cfgdir);
- return FALSE;
- }
+ gchar *str = g_strdup_printf (_("You did not import the
existing iTunesDB ('%s'). This is most likely incorrect and will result in the
loss of the existing database.\n\nIf you skip storing, you can import the
existing database before calling this function again.\n"), tunes);
+
+ gint result = gtkpod_confirmation_hig (GTK_WINDOW
(gtkpod_window),
+
GTK_MESSAGE_WARNING,
+
_("Existing iTunes database not imported"),
+
str,
+
_("Proceed anyway"),
+
_("Skip storing"),
+
NULL,
+
NULL);
+
+ g_free (str);
+
+ if (result == GTK_RESPONSE_CANCEL)
+ {
+ g_free (cfgdir);
+ return FALSE;
+ }
}
}
Modified: gtkpod/trunk/src/misc_confirm.c
===================================================================
--- gtkpod/trunk/src/misc_confirm.c 2007-12-19 13:35:43 UTC (rev 1846)
+++ gtkpod/trunk/src/misc_confirm.c 2007-12-19 15:28:42 UTC (rev 1847)
@@ -829,25 +829,20 @@
static gboolean
ok_to_close_gtkpod (void)
{
- gint result = GTK_RESPONSE_YES;
+ gint result = GTK_RESPONSE_OK;
if (!files_are_saved ())
{
- GtkWidget *dialog = gtk_message_dialog_new (
- GTK_WINDOW (gtkpod_window),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_YES_NO,
- _("Data has been changed and not been saved.\nOK to exit gtkpod?"));
- result = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
+ const gchar *str = _("Data has been changed and not been saved.
If you quit gtkpod, all unsaved changes will be lost.\n\nAre you sure you want
to quit?");
+
+ result = gtkpod_confirmation_simple(GTK_WINDOW (gtkpod_window),
+
GTK_MESSAGE_WARNING,
+
_("Unsaved data present"),
+
str,
+
GTK_STOCK_QUIT);
}
- if (result == GTK_RESPONSE_YES)
- {
- return TRUE;
- }
- return FALSE;
+ return (result == GTK_RESPONSE_OK);
}
Modified: gtkpod/trunk/src/misc_playlist.c
===================================================================
--- gtkpod/trunk/src/misc_playlist.c 2007-12-19 13:35:43 UTC (rev 1846)
+++ gtkpod/trunk/src/misc_playlist.c 2007-12-19 15:28:42 UTC (rev 1847)
@@ -1008,23 +1008,26 @@
a mistake and we should tell him about it */
if (!eitdb->itdb_imported)
{
- gchar *itunesdb_filename = itdb_get_itunesdb_path (mountpoint);
- if (itunesdb_filename)
- {
- GtkWidget *dialog = gtk_message_dialog_new (
- GTK_WINDOW (gtkpod_window),
- GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_WARNING,
- GTK_BUTTONS_OK_CANCEL,
- _("You did not import the existing iTunesDB. This is most
likely incorrect and will result in the loss of the existing database.\n\nPress
'OK' if you want to proceed anyhow or 'Cancel' to abort. If you cancel, you can
import the existing database before calling this function again.\n"));
- gint result = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- g_free (itunesdb_filename);
- if (result == GTK_RESPONSE_CANCEL)
- {
- return;
- }
- }
+ gchar *itunesdb_filename = itdb_get_itunesdb_path (mountpoint);
+
+ if (itunesdb_filename)
+ {
+ const gchar *str = _("You did not import the existing
iTunesDB. This is most likely incorrect and will result in the loss of the
existing database.\n\nIf you abort the operation, you can import the existing
database before calling this function again.\n");
+
+ gint result = gtkpod_confirmation_hig (GTK_WINDOW
(gtkpod_window),
+
GTK_MESSAGE_WARNING,
+
_("Existing iTunes database not imported"),
+
str,
+
_("Proceed anyway"),
+
_("Abort operation"),
+
NULL,
+
NULL);
+
+ if (result == GTK_RESPONSE_CANCEL)
+ {
+ return;
+ }
+ }
}
gtkpod_statusbar_timeout (30*STATUSBAR_TIMEOUT);
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services
for just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
_______________________________________________
gtkpod-cvs2 mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gtkpod-cvs2